diff --git a/README.txt b/README.txt index d7261e6cb0..1fd82e07b3 100644 --- a/README.txt +++ b/README.txt @@ -1,13 +1,76 @@ -Baystation 12 +tgstation13 v1.0 - 6 October 2010 -Website: http://baystation12.net/ -Wiki: http://baystation12.net/wiki/ -Install Guide: http://baystation12.net/wiki/index.php/Install -Code: https://github.com/Baystation12/Baystation12 -IRC: irc://irc.sorcery.net/bs12 +Website: http://nanotrasen.com +Code: http://code.google.com/p/tgstation13/ +IRC: irc://irc.rizon.net/tgstation13 -Based on the code of /tg/ station 13, itself based on the code of Goon Station 13. -/tg/ station 13: http://code.google.com/p/tgstation13 +================================================================================ +INSTALLATION +================================================================================ -Code Licensed Under GPLv3: http://www.gnu.org/licenses/gpl.html -Content Licensed Under Creative Commons CC BY-SA 3.0: http://creativecommons.org/licenses/by-sa/3.0/ \ No newline at end of file +First-time installation should be fairly straightforward. First, you'll need +BYOND installed. You can get it from http://www.byond.com/. Once you've done +that, extract the game files to wherever you want to keep them. This is a +sourcecode-only release, so the next step is to compile the server files. +Open tgstation.dme by double-clicking it, open the Build menu, and click +compile. This'll take a little while, and if everything's done right you'll get +a message like this: + +saving tgstation.dmb (DEBUG mode) + +tgstation.dmb - 0 errors, 0 warnings + +If you see any errors or warnings, something has gone wrong - possibly a corrupt +download or the files extracted wrong. + +Once that's done, open up the config folder. You'll want to edit config.txt to +set the probabilities for different gamemodes in Secret and to set your server +location so that all your players don't get disconnected at the end of each +round. It's recommended you don't turn on the gamemodes with probability 0, +except Extended, as they have various issues and aren't currently being tested, +so they may have unknown and bizarre bugs. Extended is essentially no mode, and +isn't in the Secret rotation by default as it's just not very fun. + +You'll also want to edit admins.txt to remove the default admins and add your +own. "Game Master" is the highest level of access, and the other recommended admin +levels for now are "Game Admin" (a little below host) and "Moderator". The format is + +byondkey - Rank + +where the BYOND key must be in lowercase and the admin rank must be properly +capitalised. There are a bunch more admin ranks, but these three should be +enough for most servers, assuming you have trustworthy admins. + +Finally, to start the server, run Dream Daemon and enter the path to your +compiled tgstation.dmb file. Make sure to set the port to the one you +specified in the config.txt, and set the Security box to 'Safe'. Then press GO +and the server should start up and be ready to join. + +================================================================================ +UPDATING +================================================================================ + +To update an existing installation, first back up your /config and /data folders +as these store your server configuration, player preferences and banlist. + +Then, extract the new files (preferably into a clean directory, but updating in +place should work fine), copy your /config and /data folders back into the new +install, overwriting when prompted except if we've specified otherwise, and +recompile the game. Once you start the server up again, you should be running +the new version. + +================================================================================ +SQL Setup +================================================================================ + +The SQL backend for the library and stats tracking requires a +MySQL server. Your server details go in /config/dbconfig.txt, and the SQL +schema is in /SQL/tgstation_schema.sql. More detailed setup instructions are +coming soon, for now ask in our IRC channel. + +================================================================================ +IRC Bot Setup +================================================================================ + +Included in the SVN is an IRC bot capable of relaying adminhelps to a specified IRC channel/server (thanks to Skibiliano) +Instructions for bot setup are included in the /bot/ folder along with the bot/relay script itself \ No newline at end of file diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 4978c514b8..b7e2e501ce 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -2,7 +2,9 @@ SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; +CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; CREATE SCHEMA IF NOT EXISTS `tgstation` DEFAULT CHARACTER SET latin1 ; +USE `mydb` ; USE `tgstation` ; -- ----------------------------------------------------- diff --git a/baystation12.dme b/baystation12.dme index d0fb518406..0963f30248 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1,6 +1,6 @@ -// DM Environment file for baystation12.dme. -// All manual changes should be made outside the BEGIN_ and END_ blocks. -// New source code should be placed in .dm files: choose File/New --> Code File. +// DM Environment file for tgstation.dme. +// All manual changes should be made outside the BEGIN_ and END_ blocks. + // New source code should be placed in .dm files: choose File/New --> Code File. // BEGIN_INTERNALS // END_INTERNALS // BEGIN_FILE_DIR @@ -23,8 +23,10 @@ #define FILE_DIR "code/defines/mob/living/carbon" #define FILE_DIR "code/defines/mob/living/silicon" #define FILE_DIR "code/defines/obj" +#define FILE_DIR "code/defines/obj/clothing" #define FILE_DIR "code/defines/procs" #define FILE_DIR "code/defines/sd_procs" +#define FILE_DIR "code/defines/tanning" #define FILE_DIR "code/FEA" #define FILE_DIR "code/game" #define FILE_DIR "code/game/area" @@ -35,9 +37,12 @@ #define FILE_DIR "code/game/gamemodes" #define FILE_DIR "code/game/gamemodes/autotraitor" #define FILE_DIR "code/game/gamemodes/blob" +#define FILE_DIR "code/game/gamemodes/blob/blobs" #define FILE_DIR "code/game/gamemodes/changeling" #define FILE_DIR "code/game/gamemodes/cult" #define FILE_DIR "code/game/gamemodes/epidemic" +#define FILE_DIR "code/game/gamemodes/events" +#define FILE_DIR "code/game/gamemodes/events/holidays" #define FILE_DIR "code/game/gamemodes/extended" #define FILE_DIR "code/game/gamemodes/malfunction" #define FILE_DIR "code/game/gamemodes/meme" @@ -73,6 +78,7 @@ #define FILE_DIR "code/game/objects/closets/secure" #define FILE_DIR "code/game/objects/devices" #define FILE_DIR "code/game/objects/devices/PDA" +#define FILE_DIR "code/game/objects/grenades" #define FILE_DIR "code/game/objects/items" #define FILE_DIR "code/game/objects/items/weapons" #define FILE_DIR "code/game/objects/items/weapons/implants" @@ -88,15 +94,21 @@ #define FILE_DIR "code/js" #define FILE_DIR "code/modules" #define FILE_DIR "code/modules/admin" +#define FILE_DIR "code/modules/admin/DB ban" #define FILE_DIR "code/modules/admin/verbs" #define FILE_DIR "code/modules/assembly" #define FILE_DIR "code/modules/chemical" #define FILE_DIR "code/modules/client" #define FILE_DIR "code/modules/clothing" #define FILE_DIR "code/modules/clothing/glasses" +#define FILE_DIR "code/modules/clothing/gloves" #define FILE_DIR "code/modules/clothing/head" +#define FILE_DIR "code/modules/clothing/masks" +#define FILE_DIR "code/modules/clothing/shoes" #define FILE_DIR "code/modules/clothing/spacesuits" #define FILE_DIR "code/modules/clothing/suits" +#define FILE_DIR "code/modules/clothing/under" +#define FILE_DIR "code/modules/clothing/under/jobs" #define FILE_DIR "code/modules/clothing/uniforms" #define FILE_DIR "code/modules/critters" #define FILE_DIR "code/modules/critters/hivebots" @@ -129,6 +141,7 @@ #define FILE_DIR "code/modules/mob/living/silicon/decoy" #define FILE_DIR "code/modules/mob/living/silicon/pai" #define FILE_DIR "code/modules/mob/living/silicon/robot" +#define FILE_DIR "code/modules/mob/living/simple_animal" #define FILE_DIR "code/modules/mob/new_player" #define FILE_DIR "code/modules/mob/organ" #define FILE_DIR "code/modules/mob/simple_animal" @@ -143,6 +156,14 @@ #define FILE_DIR "code/modules/projectiles/guns/energy" #define FILE_DIR "code/modules/projectiles/guns/projectile" #define FILE_DIR "code/modules/projectiles/projectile" +#define FILE_DIR "code/modules/reagents" +#define FILE_DIR "code/modules/reagents/reagent_containers" +#define FILE_DIR "code/modules/reagents/reagent_containers/food" +#define FILE_DIR "code/modules/reagents/reagent_containers/food/drinks" +#define FILE_DIR "code/modules/reagents/reagent_containers/food/drinks/bottle" +#define FILE_DIR "code/modules/reagents/reagent_containers/food/snacks" +#define FILE_DIR "code/modules/reagents/reagent_containers/glass" +#define FILE_DIR "code/modules/reagents/reagent_containers/glass/bottle" #define FILE_DIR "code/modules/recycling" #define FILE_DIR "code/modules/research" #define FILE_DIR "code/modules/research/xenoarchaeology" @@ -158,6 +179,7 @@ #define FILE_DIR "code/unused" #define FILE_DIR "code/unused/beast" #define FILE_DIR "code/unused/computer2" +#define FILE_DIR "code/unused/disease2" #define FILE_DIR "code/unused/gamemodes" #define FILE_DIR "code/unused/hivebot" #define FILE_DIR "code/unused/mining" @@ -174,6 +196,7 @@ #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Tajara" +#define FILE_DIR "code/WorkInProgress/carn" #define FILE_DIR "code/WorkInProgress/Chinsky" #define FILE_DIR "code/WorkInProgress/mapload" #define FILE_DIR "code/WorkInProgress/Mini" @@ -186,6 +209,7 @@ #define FILE_DIR "code/WorkInProgress/SkyMarshal" #define FILE_DIR "code/WorkInProgress/Tastyfish" #define FILE_DIR "code/WorkInProgress/virus2" +#define FILE_DIR "code/WorkInProgress/virus2/disease2" #define FILE_DIR "code/WorkInProgress/Wrongnumber" #define FILE_DIR "code/ZAS" #define FILE_DIR "html" @@ -214,26 +238,31 @@ #define FILE_DIR "sound" #define FILE_DIR "sound/AI" #define FILE_DIR "sound/ambience" -#define FILE_DIR "sound/announcer" #define FILE_DIR "sound/effects" #define FILE_DIR "sound/hallucinations" #define FILE_DIR "sound/items" #define FILE_DIR "sound/machines" #define FILE_DIR "sound/mecha" #define FILE_DIR "sound/misc" +#define FILE_DIR "sound/music" #define FILE_DIR "sound/piano" #define FILE_DIR "sound/voice" #define FILE_DIR "sound/weapons" +#define FILE_DIR "tools" +#define FILE_DIR "tools/Redirector" // END_FILE_DIR + // BEGIN_PREFERENCES #define DEBUG // END_PREFERENCES + // BEGIN_INCLUDE -#include "code\access_defines.dm" +#include "code\global.dm" #include "code\names.dm" #include "code\setup.dm" #include "code\setup_3d.dm" #include "code\stylesheet.dm" +#include "code\ZAS_defines.dm" #include "code\ATMOSPHERICS\atmospherics.dm" #include "code\ATMOSPHERICS\datum_pipe_network.dm" #include "code\ATMOSPHERICS\datum_pipeline.dm" @@ -257,13 +286,13 @@ #include "code\ATMOSPHERICS\components\unary\heat_source.dm" #include "code\ATMOSPHERICS\components\unary\outlet_injector.dm" #include "code\ATMOSPHERICS\components\unary\oxygen_generator.dm" -#include "code\ATMOSPHERICS\components\unary\thermal_plate.dm" #include "code\ATMOSPHERICS\components\unary\unary_base.dm" #include "code\ATMOSPHERICS\components\unary\vent_pump.dm" #include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm" #include "code\datums\ai_laws.dm" #include "code\datums\computerfiles.dm" #include "code\datums\configuration.dm" +#include "code\datums\datacore.dm" #include "code\datums\datumvars.dm" #include "code\datums\disease.dm" #include "code\datums\mind.dm" @@ -300,7 +329,6 @@ #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\tension.dm" #include "code\datums\helper_datums\topic_input.dm" #include "code\datums\spells\area_teleport.dm" #include "code\datums\spells\conjure.dm" @@ -316,7 +344,6 @@ #include "code\datums\spells\turf_teleport.dm" #include "code\datums\spells\wizard.dm" #include "code\defines\atom.dm" -#include "code\defines\global.dm" #include "code\defines\hub.dm" #include "code\defines\obj.dm" #include "code\defines\turf.dm" @@ -329,19 +356,17 @@ #include "code\defines\mob\living\carbon\alien_larva.dm" #include "code\defines\mob\living\carbon\carbon.dm" #include "code\defines\mob\living\carbon\metroid.dm" +#include "code\defines\mob\living\carbon\monkey.dm" #include "code\defines\mob\living\silicon\ai.dm" #include "code\defines\mob\living\silicon\decoy.dm" #include "code\defines\mob\living\silicon\pai.dm" #include "code\defines\mob\living\silicon\robot.dm" #include "code\defines\mob\living\silicon\silicon.dm" #include "code\defines\obj\closet.dm" -#include "code\defines\obj\clothing.dm" -#include "code\defines\obj\computer.dm" +#include "code\defines\obj\costume.dm" #include "code\defines\obj\decal.dm" #include "code\defines\obj\hydro.dm" #include "code\defines\obj\machinery.dm" -#include "code\defines\obj\radio.dm" -#include "code\defines\obj\spawner.dm" #include "code\defines\obj\storage.dm" #include "code\defines\obj\supplypacks.dm" #include "code\defines\obj\toy.dm" @@ -354,26 +379,28 @@ #include "code\defines\procs\command_alert.dm" #include "code\defines\procs\command_name.dm" #include "code\defines\procs\dbcore.dm" +#include "code\defines\procs\forum_activation.dm" #include "code\defines\procs\gamehelpers.dm" +#include "code\defines\procs\global_lists.dm" +#include "code\defines\procs\helper_list.dm" +#include "code\defines\procs\helper_text.dm" +#include "code\defines\procs\helper_type2type.dm" #include "code\defines\procs\helpers.dm" #include "code\defines\procs\icon_procs.dm" #include "code\defines\procs\icon_procs_readme.dm" #include "code\defines\procs\logging.dm" #include "code\defines\procs\religion_name.dm" #include "code\defines\procs\station_name.dm" +#include "code\defines\procs\statistics.dm" #include "code\defines\procs\syndicate_name.dm" #include "code\defines\procs\time_stamp.dm" -#include "code\defines\sd_procs\base64.dm" -#include "code\defines\sd_procs\constants.dm" -#include "code\defines\sd_procs\direction.dm" -#include "code\defines\sd_procs\math.dm" +#include "code\defines\tanning\leather.dm" #include "code\game\algorithm.dm" #include "code\game\atom_procs.dm" #include "code\game\cellautomata.dm" #include "code\game\chemistry.dm" #include "code\game\communications.dm" #include "code\game\dna.dm" -#include "code\game\dna_mutations.dm" #include "code\game\hud.dm" #include "code\game\json.dm" #include "code\game\landmarks.dm" @@ -398,43 +425,23 @@ #include "code\game\area\ai_monitored.dm" #include "code\game\area\areas.dm" #include "code\game\asteroid\artifacts.dm" -#include "code\game\events\Event.dm" -#include "code\game\events\EventsMain.dm" -#include "code\game\events\EventProcs\black_hole.dm" -#include "code\game\events\EventProcs\clang.dm" -#include "code\game\events\EventProcs\dust.dm" -#include "code\game\events\EventProcs\miniblob.dm" -#include "code\game\events\EventProcs\misc.dm" -#include "code\game\events\EventProcs\ninja_abilities.dm" -#include "code\game\events\EventProcs\ninja_equipment.dm" -#include "code\game\events\EventProcs\space_ninja.dm" -#include "code\game\events\EventProcs\spacevines.dm" -#include "code\game\events\EventProcs\wormholes.dm" -#include "code\game\events\Events\AlienInfestation.dm" -#include "code\game\events\Events\Appendicitis.dm" -#include "code\game\events\Events\ElectricalStorm.dm" -#include "code\game\events\Events\GravitationalAnomaly.dm" -#include "code\game\events\Events\ImmovableRod.dm" -#include "code\game\events\Events\IonStorm.dm" -#include "code\game\events\Events\MeteorStorm.dm" -#include "code\game\events\Events\MiniBlob.dm" -#include "code\game\events\Events\PowerOffline.dm" -#include "code\game\events\Events\PrisonBreak.dm" -#include "code\game\events\Events\RadiationBelt.dm" -#include "code\game\events\Events\SpaceCarp.dm" -#include "code\game\events\Events\SpaceNinja.dm" -#include "code\game\events\Events\VirusEpidemic.dm" +#include "code\game\asteroid\asteroid.dm" +#include "code\game\asteroid\turf.dm" +#include "code\game\gamemodes\events.dm" #include "code\game\gamemodes\factions.dm" #include "code\game\gamemodes\game_mode.dm" #include "code\game\gamemodes\gameticker.dm" #include "code\game\gamemodes\intercept_report.dm" -#include "code\game\gamemodes\newobjective.dm" +#include "code\game\gamemodes\objective.dm" #include "code\game\gamemodes\setupgame.dm" -#include "code\game\gamemodes\autotraitor\autotraitor.dm" #include "code\game\gamemodes\blob\blob.dm" #include "code\game\gamemodes\blob\blob_finish.dm" #include "code\game\gamemodes\blob\blob_report.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\changeling\changeling.dm" #include "code\game\gamemodes\changeling\changeling_powers.dm" #include "code\game\gamemodes\changeling\modularchangling.dm" @@ -442,11 +449,19 @@ #include "code\game\gamemodes\cult\cult.dm" #include "code\game\gamemodes\cult\cult_items.dm" #include "code\game\gamemodes\cult\cult_structures.dm" -#include "code\game\gamemodes\epidemic\epidemic.dm" +#include "code\game\gamemodes\events\black_hole.dm" +#include "code\game\gamemodes\events\clang.dm" +#include "code\game\gamemodes\events\dust.dm" +#include "code\game\gamemodes\events\miniblob.dm" +#include "code\game\gamemodes\events\ninja_abilities.dm" +#include "code\game\gamemodes\events\ninja_equipment.dm" +#include "code\game\gamemodes\events\space_ninja.dm" +#include "code\game\gamemodes\events\spacevines.dm" +#include "code\game\gamemodes\events\wormholes.dm" +#include "code\game\gamemodes\events\holidays\Holidays.dm" #include "code\game\gamemodes\extended\extended.dm" #include "code\game\gamemodes\malfunction\Malf_Modules.dm" #include "code\game\gamemodes\malfunction\malfunction.dm" -#include "code\game\gamemodes\meme\meme.dm" #include "code\game\gamemodes\meteor\meteor.dm" #include "code\game\gamemodes\meteor\meteors.dm" #include "code\game\gamemodes\nuclear\nuclear.dm" @@ -456,7 +471,6 @@ #include "code\game\gamemodes\sandbox\h_sandbox.dm" #include "code\game\gamemodes\sandbox\sandbox.dm" #include "code\game\gamemodes\traitor\traitor.dm" -#include "code\game\gamemodes\traitor\traitor_info.dm" #include "code\game\gamemodes\wizard\rightandwrong.dm" #include "code\game\gamemodes\wizard\soulstone.dm" #include "code\game\gamemodes\wizard\spellbook.dm" @@ -478,7 +492,6 @@ #include "code\game\jobs\job\science.dm" #include "code\game\jobs\job\security.dm" #include "code\game\jobs\job\silicon.dm" -#include "code\game\machinery\adv_med.dm" #include "code\game\machinery\ai_slipper.dm" #include "code\game\machinery\airlock_control.dm" #include "code\game\machinery\alarm.dm" @@ -487,7 +500,6 @@ #include "code\game\machinery\Beacon.dm" #include "code\game\machinery\biogenerator.dm" #include "code\game\machinery\camera.dm" -#include "code\game\machinery\camera_circuit.dm" #include "code\game\machinery\cell_charger.dm" #include "code\game\machinery\cloning.dm" #include "code\game\machinery\constructable_frame.dm" @@ -496,7 +508,6 @@ #include "code\game\machinery\dispenser.dm" #include "code\game\machinery\door_control.dm" #include "code\game\machinery\flasher.dm" -#include "code\game\machinery\floodlight.dm" #include "code\game\machinery\Freezer.dm" #include "code\game\machinery\gateway.dm" #include "code\game\machinery\hologram.dm" @@ -505,6 +516,7 @@ #include "code\game\machinery\lightswitch.dm" #include "code\game\machinery\machinery.dm" #include "code\game\machinery\magnet.dm" +#include "code\game\machinery\mass_driver.dm" #include "code\game\machinery\morgue.dm" #include "code\game\machinery\navbeacon.dm" #include "code\game\machinery\newscaster.dm" @@ -515,11 +527,9 @@ #include "code\game\machinery\rechargestation.dm" #include "code\game\machinery\requests_console.dm" #include "code\game\machinery\robot_fabricator.dm" -#include "code\game\machinery\scanner.dm" #include "code\game\machinery\seed_extractor.dm" #include "code\game\machinery\shieldgen.dm" #include "code\game\machinery\Sleeper.dm" -#include "code\game\machinery\small_constructable_frame.dm" #include "code\game\machinery\spaceheater.dm" #include "code\game\machinery\status_display.dm" #include "code\game\machinery\suit_storage_unit.dm" @@ -527,14 +537,12 @@ #include "code\game\machinery\teleporter.dm" #include "code\game\machinery\turrets.dm" #include "code\game\machinery\vending.dm" -#include "code\game\machinery\walllockers.dm" #include "code\game\machinery\atmoalter\area_atmos_computer.dm" #include "code\game\machinery\atmoalter\canister.dm" #include "code\game\machinery\atmoalter\meter.dm" #include "code\game\machinery\atmoalter\portable_atmospherics.dm" #include "code\game\machinery\atmoalter\pump.dm" #include "code\game\machinery\atmoalter\scrubber.dm" -#include "code\game\machinery\atmoalter\zvent.dm" #include "code\game\machinery\bots\bots.dm" #include "code\game\machinery\bots\cleanbot.dm" #include "code\game\machinery\bots\ed209bot.dm" @@ -545,10 +553,9 @@ #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\atmos.dm" #include "code\game\machinery\computer\atmos_alert.dm" #include "code\game\machinery\computer\buildandrepair.dm" -#include "code\game\machinery\computer\camera_monitor.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" @@ -557,7 +564,6 @@ #include "code\game\machinery\computer\HolodeckControl.dm" #include "code\game\machinery\computer\hologram.dm" #include "code\game\machinery\computer\law.dm" -#include "code\game\machinery\computer\lockdown.dm" #include "code\game\machinery\computer\medical.dm" #include "code\game\machinery\computer\message.dm" #include "code\game\machinery\computer\Operating.dm" @@ -567,6 +573,7 @@ #include "code\game\machinery\computer\robot.dm" #include "code\game\machinery\computer\security.dm" #include "code\game\machinery\computer\shuttle.dm" +#include "code\game\machinery\computer\station_alert.dm" #include "code\game\machinery\doors\airlock.dm" #include "code\game\machinery\doors\airlock_electronics.dm" #include "code\game\machinery\doors\brigdoors.dm" @@ -590,13 +597,11 @@ #include "code\game\machinery\telecomms\broadcaster.dm" #include "code\game\machinery\telecomms\logbrowser.dm" #include "code\game\machinery\telecomms\machine_interactions.dm" -#include "code\game\machinery\telecomms\telecommunications.dm" +#include "code\game\machinery\telecomms\telecomunications.dm" #include "code\game\machinery\telecomms\telemonitor.dm" #include "code\game\machinery\telecomms\traffic_control.dm" -#include "code\game\magic\archived_book.dm" #include "code\game\magic\library.dm" #include "code\game\magic\musician.dm" -#include "code\game\magic\Uristrunes.dm" #include "code\game\magic\cultist\ritual.dm" #include "code\game\magic\cultist\runes.dm" #include "code\game\magic\cultist\talisman.dm" @@ -614,6 +619,7 @@ #include "code\game\mecha\combat\marauder.dm" #include "code\game\mecha\combat\phazon.dm" #include "code\game\mecha\equipment\mecha_equipment.dm" +#include "code\game\mecha\equipment\tools\medical_tools.dm" #include "code\game\mecha\equipment\tools\tools.dm" #include "code\game\mecha\equipment\weapons\weapons.dm" #include "code\game\mecha\medical\medical.dm" @@ -621,26 +627,31 @@ #include "code\game\mecha\working\firefighter.dm" #include "code\game\mecha\working\ripley.dm" #include "code\game\mecha\working\working.dm" +#include "code\game\objects\biomass.dm" #include "code\game\objects\blood.dm" #include "code\game\objects\bodybag.dm" #include "code\game\objects\bombspawner.dm" #include "code\game\objects\cleaner.dm" #include "code\game\objects\closets.dm" #include "code\game\objects\contraband.dm" +#include "code\game\objects\crates.dm" #include "code\game\objects\displaycase.dm" #include "code\game\objects\door_assembly.dm" #include "code\game\objects\effect_system.dm" #include "code\game\objects\electricchair.dm" #include "code\game\objects\empulse.dm" #include "code\game\objects\explosion.dm" +#include "code\game\objects\explosion_recursive.dm" #include "code\game\objects\gibs.dm" #include "code\game\objects\glowshroom.dm" #include "code\game\objects\grille.dm" #include "code\game\objects\items.dm" #include "code\game\objects\kitchen.dm" +#include "code\game\objects\ladders.dm" #include "code\game\objects\lamarr.dm" +#include "code\game\objects\largecrate.dm" #include "code\game\objects\mineral_doors.dm" -#include "code\game\objects\new_year.dm" +#include "code\game\objects\mirror.dm" #include "code\game\objects\noticeboard.dm" #include "code\game\objects\object_procs.dm" #include "code\game\objects\portals.dm" @@ -662,11 +673,11 @@ #include "code\game\objects\alien\defines.dm" #include "code\game\objects\alien\egg.dm" #include "code\game\objects\alien\facehugger.dm" +#include "code\game\objects\alien\nest.dm" #include "code\game\objects\alien\resin.dm" #include "code\game\objects\alien\weeds.dm" #include "code\game\objects\closets\bombsuit.dm" #include "code\game\objects\closets\emergency.dm" -#include "code\game\objects\closets\ert.dm" #include "code\game\objects\closets\extinguisher.dm" #include "code\game\objects\closets\fireaxe.dm" #include "code\game\objects\closets\firecloset.dm" @@ -680,15 +691,13 @@ #include "code\game\objects\closets\nuclear.dm" #include "code\game\objects\closets\syndicate.dm" #include "code\game\objects\closets\thunderdome.dm" -#include "code\game\objects\closets\walllocker.dm" #include "code\game\objects\closets\wardrobe.dm" +#include "code\game\objects\closets\secure\bar.dm" #include "code\game\objects\closets\secure\cargo.dm" -#include "code\game\objects\closets\secure\civilian.dm" #include "code\game\objects\closets\secure\engineering.dm" #include "code\game\objects\closets\secure\hydroponics.dm" #include "code\game\objects\closets\secure\medical.dm" #include "code\game\objects\closets\secure\personal.dm" -#include "code\game\objects\closets\secure\research.dm" #include "code\game\objects\closets\secure\scientist.dm" #include "code\game\objects\closets\secure\secure_closets.dm" #include "code\game\objects\closets\secure\security.dm" @@ -697,25 +706,32 @@ #include "code\game\objects\devices\flash.dm" #include "code\game\objects\devices\flashlight.dm" #include "code\game\objects\devices\infra_sensor.dm" +#include "code\game\objects\devices\lightreplacer.dm" #include "code\game\objects\devices\multitool.dm" #include "code\game\objects\devices\paicard.dm" #include "code\game\objects\devices\powersink.dm" #include "code\game\objects\devices\scanners.dm" #include "code\game\objects\devices\shields.dm" #include "code\game\objects\devices\taperecorder.dm" +#include "code\game\objects\devices\traitordevices.dm" #include "code\game\objects\devices\PDA\cart.dm" #include "code\game\objects\devices\PDA\chatroom.dm" #include "code\game\objects\devices\PDA\PDA.dm" #include "code\game\objects\devices\PDA\radio.dm" +#include "code\game\objects\grenades\chem_grenade.dm" +#include "code\game\objects\grenades\emgrenade.dm" +#include "code\game\objects\grenades\flashbang.dm" +#include "code\game\objects\grenades\grenade.dm" +#include "code\game\objects\grenades\smokebomb.dm" +#include "code\game\objects\grenades\spawnergrenade.dm" #include "code\game\objects\items\apc_frame.dm" #include "code\game\objects\items\blueprints.dm" #include "code\game\objects\items\candle.dm" -#include "code\game\objects\items\clothing.dm" -#include "code\game\objects\items\food.dm" #include "code\game\objects\items\helper_procs.dm" #include "code\game\objects\items\item.dm" #include "code\game\objects\items\robot_items.dm" #include "code\game\objects\items\robot_parts.dm" +#include "code\game\objects\items\robot_upgrades.dm" #include "code\game\objects\items\shock_kit.dm" #include "code\game\objects\items\tk_grab.dm" #include "code\game\objects\items\trash.dm" @@ -727,26 +743,20 @@ #include "code\game\objects\items\weapons\dna_injector.dm" #include "code\game\objects\items\weapons\explosives.dm" #include "code\game\objects\items\weapons\flamethrower.dm" -#include "code\game\objects\items\weapons\game_kit.dm" -#include "code\game\objects\items\weapons\grenades.dm" -#include "code\game\objects\items\weapons\hand_lablers.dm" #include "code\game\objects\items\weapons\hydroponics.dm" #include "code\game\objects\items\weapons\kitchen.dm" #include "code\game\objects\items\weapons\manuals.dm" #include "code\game\objects\items\weapons\medical.dm" -#include "code\game\objects\items\weapons\mops_cleaners.dm" +#include "code\game\objects\items\weapons\mop.dm" #include "code\game\objects\items\weapons\paint.dm" #include "code\game\objects\items\weapons\paiwire.dm" -#include "code\game\objects\items\weapons\papers_bins.dm" #include "code\game\objects\items\weapons\plant_bag.dm" #include "code\game\objects\items\weapons\RCD.dm" #include "code\game\objects\items\weapons\RSF.dm" #include "code\game\objects\items\weapons\stunbaton.dm" #include "code\game\objects\items\weapons\stungloves.dm" -#include "code\game\objects\items\weapons\surgery_limbattachment.dm" #include "code\game\objects\items\weapons\surgery_tools.dm" #include "code\game\objects\items\weapons\swords_axes_etc.dm" -#include "code\game\objects\items\weapons\syndie.dm" #include "code\game\objects\items\weapons\table_rack_parts.dm" #include "code\game\objects\items\weapons\teleportation.dm" #include "code\game\objects\items\weapons\tiles_wires.dm" @@ -778,23 +788,17 @@ #include "code\game\objects\storage\belt.dm" #include "code\game\objects\storage\bible.dm" #include "code\game\objects\storage\briefcase.dm" -#include "code\game\objects\storage\coat.dm" -#include "code\game\objects\storage\crates.dm" +#include "code\game\objects\storage\fancy.dm" #include "code\game\objects\storage\firstaid.dm" #include "code\game\objects\storage\kit.dm" #include "code\game\objects\storage\lockbox.dm" +#include "code\game\objects\storage\misc.dm" #include "code\game\objects\storage\storage.dm" #include "code\game\objects\storage\toolbox.dm" #include "code\game\objects\storage\uplink_kits.dm" #include "code\game\objects\tanks\emergency.dm" #include "code\game\objects\tanks\jetpack.dm" #include "code\game\objects\tanks\oxygen.dm" -#include "code\game\player\admin_report.dm" -#include "code\game\player\news.dm" -#include "code\game\vehicles\vehicle.dm" -#include "code\game\vehicles\airtight\airtight.dm" -#include "code\game\vehicles\airtight\land.dm" -#include "code\game\vehicles\airtight\space.dm" #include "code\game\verbs\AI_status.dm" #include "code\game\verbs\ooc.dm" #include "code\game\verbs\sound.dm" @@ -813,7 +817,10 @@ #include "code\modules\admin\IsBanned.dm" #include "code\modules\admin\NewBan.dm" #include "code\modules\admin\newbanjob.dm" +#include "code\modules\admin\player_notes.dm" #include "code\modules\admin\player_panel.dm" +#include "code\modules\admin\ToRban.dm" +#include "code\modules\admin\DB ban\functions.dm" #include "code\modules\admin\verbs\adminhelp.dm" #include "code\modules\admin\verbs\adminjump.dm" #include "code\modules\admin\verbs\adminpm.dm" @@ -826,7 +833,6 @@ #include "code\modules\admin\verbs\debug.dm" #include "code\modules\admin\verbs\diagnostics.dm" #include "code\modules\admin\verbs\getlogs.dm" -#include "code\modules\admin\verbs\gimmicks.dm" #include "code\modules\admin\verbs\mapping.dm" #include "code\modules\admin\verbs\massmodvar.dm" #include "code\modules\admin\verbs\MC.dm" @@ -847,31 +853,29 @@ #include "code\modules\assembly\proximity.dm" #include "code\modules\assembly\signaler.dm" #include "code\modules\assembly\timer.dm" -#include "code\modules\chemical\Chemistry-Holder.dm" -#include "code\modules\chemical\Chemistry-Machinery.dm" -#include "code\modules\chemical\Chemistry-Readme.dm" -#include "code\modules\chemical\Chemistry-Reagents.dm" -#include "code\modules\chemical\Chemistry-Recipes.dm" -#include "code\modules\chemical\Chemistry-Tools.dm" #include "code\modules\client\client defines.dm" #include "code\modules\client\client procs.dm" -#include "code\modules\clothing\costume.dm" -#include "code\modules\clothing\ears.dm" -#include "code\modules\clothing\gimmick.dm" -#include "code\modules\clothing\glasses.dm" -#include "code\modules\clothing\gloves.dm" -#include "code\modules\clothing\jumpsuit.dm" -#include "code\modules\clothing\mask.dm" -#include "code\modules\clothing\shoes.dm" -#include "code\modules\clothing\spacesuit.dm" -#include "code\modules\clothing\suit.dm" +#include "code\modules\clothing\clothing.dm" #include "code\modules\clothing\glasses\glasses.dm" #include "code\modules\clothing\glasses\hud.dm" +#include "code\modules\clothing\gloves\boxing.dm" +#include "code\modules\clothing\gloves\color.dm" +#include "code\modules\clothing\gloves\miscellaneous.dm" +#include "code\modules\clothing\head\collectable.dm" #include "code\modules\clothing\head\hardhat.dm" -#include "code\modules\clothing\head\hats.dm" -#include "code\modules\clothing\head\helmets.dm" +#include "code\modules\clothing\head\helmet.dm" +#include "code\modules\clothing\head\jobs.dm" +#include "code\modules\clothing\head\misc.dm" +#include "code\modules\clothing\head\misc_special.dm" +#include "code\modules\clothing\head\soft_caps.dm" +#include "code\modules\clothing\masks\boxing.dm" +#include "code\modules\clothing\masks\breath.dm" +#include "code\modules\clothing\masks\gasmask.dm" +#include "code\modules\clothing\masks\miscellaneous.dm" +#include "code\modules\clothing\shoes\colour.dm" +#include "code\modules\clothing\shoes\magboots.dm" +#include "code\modules\clothing\shoes\miscellaneous.dm" #include "code\modules\clothing\spacesuits\captain.dm" -#include "code\modules\clothing\spacesuits\engineer.dm" #include "code\modules\clothing\spacesuits\ert.dm" #include "code\modules\clothing\spacesuits\miscellaneous.dm" #include "code\modules\clothing\spacesuits\ninja.dm" @@ -880,15 +884,20 @@ #include "code\modules\clothing\spacesuits\void.dm" #include "code\modules\clothing\suits\armor.dm" #include "code\modules\clothing\suits\bio.dm" -#include "code\modules\clothing\suits\bomb.dm" -#include "code\modules\clothing\suits\detective.dm" -#include "code\modules\clothing\suits\fire.dm" -#include "code\modules\clothing\suits\heavy.dm" -#include "code\modules\clothing\suits\hos.dm" +#include "code\modules\clothing\suits\jobs.dm" #include "code\modules\clothing\suits\labcoat.dm" #include "code\modules\clothing\suits\miscellaneous.dm" -#include "code\modules\clothing\suits\robe.dm" -#include "code\modules\clothing\uniforms\lawyer.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" +#include "code\modules\clothing\under\syndicate.dm" +#include "code\modules\clothing\under\jobs\civilian.dm" +#include "code\modules\clothing\under\jobs\engineering.dm" +#include "code\modules\clothing\under\jobs\medsci.dm" +#include "code\modules\clothing\under\jobs\security.dm" #include "code\modules\critters\critter.dm" #include "code\modules\critters\critter_AI.dm" #include "code\modules\critters\critter_defenses.dm" @@ -903,8 +912,6 @@ #include "code\modules\flufftext\Dreaming.dm" #include "code\modules\flufftext\Hallucination.dm" #include "code\modules\flufftext\TextFilters.dm" -#include "code\modules\food\food.dm" -#include "code\modules\food\meat.dm" #include "code\modules\food\recipes_microwave.dm" #include "code\modules\maps\dmm_suite.dm" #include "code\modules\maps\randomZlevel.dm" @@ -921,9 +928,9 @@ #include "code\modules\mining\mint.dm" #include "code\modules\mining\money_bag.dm" #include "code\modules\mining\ores_materials_coins.dm" -#include "code\modules\mining\satchel_ore_box.dm" +#include "code\modules\mining\satchel_ore_boxdm.dm" #include "code\modules\mob\death.dm" -#include "code\modules\mob\emote.dm" +#include "code\modules\mob\inventory.dm" #include "code\modules\mob\login.dm" #include "code\modules\mob\logout.dm" #include "code\modules\mob\mob.dm" @@ -936,55 +943,50 @@ #include "code\modules\mob\say.dm" #include "code\modules\mob\screen.dm" #include "code\modules\mob\transform_procs.dm" +#include "code\modules\mob\update_icons.dm" #include "code\modules\mob\dead\death.dm" #include "code\modules\mob\dead\observer\hud.dm" -#include "code\modules\mob\dead\observer\login.dm" +#include "code\modules\mob\dead\observer\logout.dm" #include "code\modules\mob\dead\observer\observer.dm" #include "code\modules\mob\dead\observer\say.dm" #include "code\modules\mob\living\damage_procs.dm" #include "code\modules\mob\living\living.dm" #include "code\modules\mob\living\living_defense.dm" +#include "code\modules\mob\living\living_defines.dm" #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\carbon\carbon.dm" -#include "code\modules\mob\living\carbon\give.dm" -#include "code\modules\mob\living\carbon\shock.dm" +#include "code\modules\mob\living\carbon\carbon_defines.dm" #include "code\modules\mob\living\carbon\alien\alien.dm" #include "code\modules\mob\living\carbon\alien\death.dm" +#include "code\modules\mob\living\carbon\alien\powers.dm" #include "code\modules\mob\living\carbon\alien\say.dm" #include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm" #include "code\modules\mob\living\carbon\alien\humanoid\death.dm" #include "code\modules\mob\living\carbon\alien\humanoid\emote.dm" #include "code\modules\mob\living\carbon\alien\humanoid\hud.dm" #include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm" +#include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm" #include "code\modules\mob\living\carbon\alien\humanoid\life.dm" #include "code\modules\mob\living\carbon\alien\humanoid\login.dm" #include "code\modules\mob\living\carbon\alien\humanoid\queen.dm" +#include "code\modules\mob\living\carbon\alien\humanoid\update_icons.dm" #include "code\modules\mob\living\carbon\alien\humanoid\caste\drone.dm" #include "code\modules\mob\living\carbon\alien\humanoid\caste\hunter.dm" #include "code\modules\mob\living\carbon\alien\humanoid\caste\sentinel.dm" #include "code\modules\mob\living\carbon\alien\larva\death.dm" #include "code\modules\mob\living\carbon\alien\larva\emote.dm" #include "code\modules\mob\living\carbon\alien\larva\hud.dm" +#include "code\modules\mob\living\carbon\alien\larva\inventory.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\login.dm" #include "code\modules\mob\living\carbon\alien\larva\powers.dm" -#include "code\modules\mob\living\carbon\alien\special\_main.dm" -#include "code\modules\mob\living\carbon\alien\special\chryssalid.dm" -#include "code\modules\mob\living\carbon\alien\special\ethereal.dm" -#include "code\modules\mob\living\carbon\alien\special\floater.dm" -#include "code\modules\mob\living\carbon\alien\special\muton.dm" -#include "code\modules\mob\living\carbon\alien\special\sectoid.dm" -#include "code\modules\mob\living\carbon\alien\special\snakeman.dm" -#include "code\modules\mob\living\carbon\amorph\amorph.dm" -#include "code\modules\mob\living\carbon\amorph\amorph_damage.dm" -#include "code\modules\mob\living\carbon\amorph\amorph_hud.dm" -#include "code\modules\mob\living\carbon\amorph\life.dm" -#include "code\modules\mob\living\carbon\amorph\say.dm" +#include "code\modules\mob\living\carbon\alien\larva\update_icons.dm" #include "code\modules\mob\living\carbon\brain\brain.dm" #include "code\modules\mob\living\carbon\brain\death.dm" +#include "code\modules\mob\living\carbon\brain\emote.dm" #include "code\modules\mob\living\carbon\brain\hud.dm" #include "code\modules\mob\living\carbon\brain\life.dm" #include "code\modules\mob\living\carbon\brain\MMI.dm" @@ -993,17 +995,19 @@ #include "code\modules\mob\living\carbon\human\emote.dm" #include "code\modules\mob\living\carbon\human\examine.dm" #include "code\modules\mob\living\carbon\human\hud.dm" -#include "code\modules\mob\living\carbon\human\hud_overlays.dm" #include "code\modules\mob\living\carbon\human\human.dm" #include "code\modules\mob\living\carbon\human\human_attackalien.dm" #include "code\modules\mob\living\carbon\human\human_attackhand.dm" #include "code\modules\mob\living\carbon\human\human_attackpaw.dm" #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_movement.dm" +#include "code\modules\mob\living\carbon\human\inventory.dm" #include "code\modules\mob\living\carbon\human\life.dm" #include "code\modules\mob\living\carbon\human\login.dm" #include "code\modules\mob\living\carbon\human\say.dm" +#include "code\modules\mob\living\carbon\human\update_icons.dm" #include "code\modules\mob\living\carbon\human\whisper.dm" #include "code\modules\mob\living\carbon\metroid\death.dm" #include "code\modules\mob\living\carbon\metroid\emote.dm" @@ -1014,18 +1018,20 @@ #include "code\modules\mob\living\carbon\metroid\metroid.dm" #include "code\modules\mob\living\carbon\metroid\powers.dm" #include "code\modules\mob\living\carbon\metroid\say.dm" +#include "code\modules\mob\living\carbon\metroid\update_icons.dm" #include "code\modules\mob\living\carbon\monkey\death.dm" #include "code\modules\mob\living\carbon\monkey\emote.dm" #include "code\modules\mob\living\carbon\monkey\examine.dm" #include "code\modules\mob\living\carbon\monkey\hud.dm" +#include "code\modules\mob\living\carbon\monkey\inventory.dm" #include "code\modules\mob\living\carbon\monkey\life.dm" #include "code\modules\mob\living\carbon\monkey\login.dm" #include "code\modules\mob\living\carbon\monkey\monkey.dm" -#include "code\modules\mob\living\carbon\monkey\npc.dm" #include "code\modules\mob\living\carbon\monkey\powers.dm" #include "code\modules\mob\living\carbon\monkey\say.dm" -#include "code\modules\mob\living\parasite\meme.dm" +#include "code\modules\mob\living\carbon\monkey\update_icons.dm" #include "code\modules\mob\living\silicon\death.dm" +#include "code\modules\mob\living\silicon\login.dm" #include "code\modules\mob\living\silicon\say.dm" #include "code\modules\mob\living\silicon\silicon.dm" #include "code\modules\mob\living\silicon\ai\ai.dm" @@ -1054,19 +1060,35 @@ #include "code\modules\mob\living\silicon\robot\emote.dm" #include "code\modules\mob\living\silicon\robot\examine.dm" #include "code\modules\mob\living\silicon\robot\hud.dm" +#include "code\modules\mob\living\silicon\robot\inventory.dm" #include "code\modules\mob\living\silicon\robot\laws.dm" #include "code\modules\mob\living\silicon\robot\life.dm" #include "code\modules\mob\living\silicon\robot\login.dm" #include "code\modules\mob\living\silicon\robot\robot.dm" -#include "code\modules\mob\living\silicon\robot\robot_defense.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\robot_upgrades.dm" #include "code\modules\mob\living\silicon\robot\say.dm" #include "code\modules\mob\living\silicon\robot\wires.dm" +#include "code\modules\mob\living\simple_animal\bear.dm" +#include "code\modules\mob\living\simple_animal\behemoth.dm" +#include "code\modules\mob\living\simple_animal\carp.dm" +#include "code\modules\mob\living\simple_animal\cat.dm" +#include "code\modules\mob\living\simple_animal\constructs.dm" +#include "code\modules\mob\living\simple_animal\corgi.dm" +#include "code\modules\mob\living\simple_animal\crab.dm" +#include "code\modules\mob\living\simple_animal\life.dm" +#include "code\modules\mob\living\simple_animal\mouse.dm" +#include "code\modules\mob\living\simple_animal\mushroom.dm" +#include "code\modules\mob\living\simple_animal\parrot.dm" +#include "code\modules\mob\living\simple_animal\shade.dm" +#include "code\modules\mob\living\simple_animal\tomato.dm" +#include "code\modules\mob\living\simple_animal\update_icons.dm" +#include "code\modules\mob\living\simple_animal\worm.dm" #include "code\modules\mob\new_player\hud.dm" #include "code\modules\mob\new_player\login.dm" +#include "code\modules\mob\new_player\logout.dm" #include "code\modules\mob\new_player\new_player.dm" +#include "code\modules\mob\new_player\poll.dm" #include "code\modules\mob\new_player\preferences.dm" #include "code\modules\mob\new_player\preferences_setup.dm" #include "code\modules\mob\new_player\savefile.dm" @@ -1074,23 +1096,16 @@ #include "code\modules\mob\new_player\sprite_accessories.dm" #include "code\modules\mob\organ\organ.dm" #include "code\modules\mob\organ\organ_external.dm" -#include "code\modules\mob\organ\organ_internal.dm" #include "code\modules\mob\organ\pain.dm" -#include "code\modules\mob\simple_animal\bear.dm" -#include "code\modules\mob\simple_animal\behemoth.dm" -#include "code\modules\mob\simple_animal\carp.dm" -#include "code\modules\mob\simple_animal\cat.dm" -#include "code\modules\mob\simple_animal\constructs.dm" -#include "code\modules\mob\simple_animal\corgi.dm" -#include "code\modules\mob\simple_animal\crab.dm" -#include "code\modules\mob\simple_animal\kobold.dm" -#include "code\modules\mob\simple_animal\mouse.dm" -#include "code\modules\mob\simple_animal\parrot.dm" -#include "code\modules\mob\simple_animal\shade.dm" -#include "code\modules\mob\simple_animal\simple_animal.dm" -#include "code\modules\mob\simple_animal\simple_animal_life.dm" -#include "code\modules\mob\simple_animal\simple_animal_misc.dm" -#include "code\modules\mob\simple_animal\worm.dm" +#include "code\modules\paperwork\clipboard.dm" +#include "code\modules\paperwork\filingcabinet.dm" +#include "code\modules\paperwork\folders.dm" +#include "code\modules\paperwork\handlabeler.dm" +#include "code\modules\paperwork\paper.dm" +#include "code\modules\paperwork\paperbin.dm" +#include "code\modules\paperwork\pen.dm" +#include "code\modules\paperwork\photocopier.dm" +#include "code\modules\paperwork\stamps.dm" #include "code\modules\power\apc.dm" #include "code\modules\power\cable.dm" #include "code\modules\power\cable_heavyduty.dm" @@ -1102,15 +1117,16 @@ #include "code\modules\power\lighting.dm" #include "code\modules\power\port_gen.dm" #include "code\modules\power\power.dm" +#include "code\modules\power\sd_DynamicAreaLighting.dm" #include "code\modules\power\smes.dm" #include "code\modules\power\solar.dm" #include "code\modules\power\switch.dm" #include "code\modules\power\terminal.dm" #include "code\modules\power\tracker.dm" #include "code\modules\power\turbine.dm" -#include "code\modules\power\antimatter\computer.dm" -#include "code\modules\power\antimatter\engine.dm" -#include "code\modules\power\antimatter\fuel.dm" +#include "code\modules\power\antimatter\containment_jar.dm" +#include "code\modules\power\antimatter\control.dm" +#include "code\modules\power\antimatter\shielding.dm" #include "code\modules\power\singularity\collector.dm" #include "code\modules\power\singularity\containment_field.dm" #include "code\modules\power\singularity\emitter.dm" @@ -1146,6 +1162,36 @@ #include "code\modules\projectiles\projectile\change.dm" #include "code\modules\projectiles\projectile\energy.dm" #include "code\modules\projectiles\projectile\special.dm" +#include "code\modules\reagents\Chemistry-Colours.dm" +#include "code\modules\reagents\Chemistry-Holder.dm" +#include "code\modules\reagents\Chemistry-Machinery.dm" +#include "code\modules\reagents\Chemistry-Readme.dm" +#include "code\modules\reagents\Chemistry-Reagents.dm" +#include "code\modules\reagents\Chemistry-Recipes.dm" +#include "code\modules\reagents\grenade_launcher.dm" +#include "code\modules\reagents\reagent_containers.dm" +#include "code\modules\reagents\reagent_dispenser.dm" +#include "code\modules\reagents\syringe_gun.dm" +#include "code\modules\reagents\reagent_containers\borghydro.dm" +#include "code\modules\reagents\reagent_containers\dropper.dm" +#include "code\modules\reagents\reagent_containers\food.dm" +#include "code\modules\reagents\reagent_containers\glass.dm" +#include "code\modules\reagents\reagent_containers\hypospray.dm" +#include "code\modules\reagents\reagent_containers\pill.dm" +#include "code\modules\reagents\reagent_containers\robodropper.dm" +#include "code\modules\reagents\reagent_containers\spray.dm" +#include "code\modules\reagents\reagent_containers\syringes.dm" +#include "code\modules\reagents\reagent_containers\food\condiment.dm" +#include "code\modules\reagents\reagent_containers\food\drinks.dm" +#include "code\modules\reagents\reagent_containers\food\snacks.dm" +#include "code\modules\reagents\reagent_containers\food\drinks\bottle.dm" +#include "code\modules\reagents\reagent_containers\food\drinks\drinkingglass.dm" +#include "code\modules\reagents\reagent_containers\food\drinks\jar.dm" +#include "code\modules\reagents\reagent_containers\food\drinks\bottle\robot.dm" +#include "code\modules\reagents\reagent_containers\food\snacks\grown.dm" +#include "code\modules\reagents\reagent_containers\food\snacks\meat.dm" +#include "code\modules\reagents\reagent_containers\glass\bottle.dm" +#include "code\modules\reagents\reagent_containers\glass\bottle\robot.dm" #include "code\modules\recycling\conveyor2.dm" #include "code\modules\recycling\disposal-construction.dm" #include "code\modules\recycling\disposal.dm" @@ -1159,25 +1205,7 @@ #include "code\modules\research\rdconsole.dm" #include "code\modules\research\rdmachines.dm" #include "code\modules\research\research.dm" -#include "code\modules\research\research_shuttle.dm" #include "code\modules\research\server.dm" -#include "code\modules\research\xenoarchaeology\analysis_machinery.dm" -#include "code\modules\research\xenoarchaeology\archaeo_analysis.dm" -#include "code\modules\research\xenoarchaeology\archaeo_chem.dm" -#include "code\modules\research\xenoarchaeology\archaeo_excavate.dm" -#include "code\modules\research\xenoarchaeology\archaeo_tools.dm" -#include "code\modules\research\xenoarchaeology\artifact_analysis.dm" -#include "code\modules\research\xenoarchaeology\artifact_db.dm" -#include "code\modules\research\xenoarchaeology\artifact_effect.dm" -#include "code\modules\research\xenoarchaeology\artifact_harvester.dm" -#include "code\modules\research\xenoarchaeology\artifact_misc.dm" -#include "code\modules\research\xenoarchaeology\artifact_synthetic.dm" -#include "code\modules\research\xenoarchaeology\artifacts.dm" -#include "code\modules\research\xenoarchaeology\core_sampler.dm" -#include "code\modules\research\xenoarchaeology\finds.dm" -#include "code\modules\research\xenoarchaeology\geosample.dm" -#include "code\modules\research\xenoarchaeology\readme.dm" -#include "code\modules\research\xenoarchaeology\tools.dm" #include "code\modules\scripting\Errors.dm" #include "code\modules\scripting\IDE.dm" #include "code\modules\scripting\Options.dm" @@ -1202,16 +1230,8 @@ #include "code\modules\security levels\security levels.dm" #include "code\WorkInProgress\buildmode.dm" #include "code\WorkInProgress\explosion_particles.dm" -#include "code\WorkInProgress\AI_Visibility\ai.dm" -#include "code\WorkInProgress\AI_Visibility\cameranet.dm" -#include "code\WorkInProgress\AI_Visibility\chunk.dm" -#include "code\WorkInProgress\AI_Visibility\minimap.dm" -#include "code\WorkInProgress\AI_Visibility\util.dm" -#include "code\WorkInProgress\animusstation\atm.dm" #include "code\WorkInProgress\Cael_Aislinn\energy_field.dm" #include "code\WorkInProgress\Cael_Aislinn\external_shield_gen.dm" -#include "code\WorkInProgress\Cael_Aislinn\meteor_battery.dm" -#include "code\WorkInProgress\Cael_Aislinn\sculpture.dm" #include "code\WorkInProgress\Cael_Aislinn\shield_capacitor.dm" #include "code\WorkInProgress\Cael_Aislinn\shield_gen.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\core_field.dm" @@ -1226,47 +1246,10 @@ #include "code\WorkInProgress\Cael_Aislinn\Rust\gyrotron_controller.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\radiation.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\virtual_particle_catcher.dm" -#include "code\WorkInProgress\Cael_Aislinn\Supermatter\LaserComputer.dm" -#include "code\WorkInProgress\Cael_Aislinn\Supermatter\SuperMatter.dm" -#include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm" -#include "code\WorkInProgress\Cael_Aislinn\Tajara\say.dm" -#include "code\WorkInProgress\Cael_Aislinn\Tajara\tajara_transformation.dm" -#include "code\WorkInProgress\Cael_Aislinn\Tajara\tajaran.dm" -#include "code\WorkInProgress\Cael_Aislinn\Tajara\whisper.dm" -#include "code\WorkInProgress\Chinsky\ashtray.dm" -#include "code\WorkInProgress\Mini\asay_trap.dm" +#include "code\WorkInProgress\Cael_Aislinn\Tajara\tajaran_placeholder.dm" #include "code\WorkInProgress\Mini\atmos_control.dm" -#include "code\WorkInProgress\Mini\pipe_heater.dm" -#include "code\WorkInProgress\Mloc\Shortcuts.dm" -#include "code\WorkInProgress\organs\implants.dm" -#include "code\WorkInProgress\organs\organs.dm" -#include "code\WorkInProgress\Ported\policetape.dm" -#include "code\WorkInProgress\Ported\sql.dm" -#include "code\WorkInProgress\Ported\Bureaucracy\copier.dm" -#include "code\WorkInProgress\Ported\Bureaucracy\filing.dm" -#include "code\WorkInProgress\SkyMarshal\coatrack.dm" -#include "code\WorkInProgress\SkyMarshal\portalathe.dm" -#include "code\WorkInProgress\SkyMarshal\traitoritems.dm" #include "code\WorkInProgress\SkyMarshal\Ultralight.dm" -#include "code\WorkInProgress\SkyMarshal\wardrobes.dm" -#include "code\WorkInProgress\Tastyfish\Eliza.dm" -#include "code\WorkInProgress\Tastyfish\Eliza_Data.dm" #include "code\WorkInProgress\Tastyfish\livestock.dm" -#include "code\WorkInProgress\Tastyfish\mainspipe.dm" -#include "code\WorkInProgress\Tastyfish\paiLiza.dm" -#include "code\WorkInProgress\Tastyfish\Parser.dm" -#include "code\WorkInProgress\Tastyfish\wallmount_frame.dm" -#include "code\WorkInProgress\virus2\analyser.dm" -#include "code\WorkInProgress\virus2\antibodies.dm" -#include "code\WorkInProgress\virus2\base.dm" -#include "code\WorkInProgress\virus2\biohazard destroyer.dm" -#include "code\WorkInProgress\virus2\cureimplanter.dm" -#include "code\WorkInProgress\virus2\curer.dm" -#include "code\WorkInProgress\virus2\diseasesplicer.dm" -#include "code\WorkInProgress\virus2\dishincubator.dm" -#include "code\WorkInProgress\virus2\isolator.dm" -#include "code\WorkInProgress\virus2\monkeydispensor.dm" -#include "code\WorkInProgress\virus2\Prob.dm" #include "code\WorkInProgress\Wrongnumber\weldbackpack.dm" #include "code\ZAS\Airflow.dm" #include "code\ZAS\Connection.dm" @@ -1280,5 +1263,5 @@ #include "code\ZAS\ZAS_Zones.dm" #include "interface\interface.dm" #include "interface\skin.dmf" -#include "maps\tgstation.2.0.8.dmm" +#include "maps\tgstation.2.0.9.dmm" // END_INCLUDE diff --git a/bot/CORE_DATA.py b/bot/CORE_DATA.py new file mode 100644 index 0000000000..ca235888f1 --- /dev/null +++ b/bot/CORE_DATA.py @@ -0,0 +1,13 @@ +Name = "CC_NanoTrasen" #The name he uses to connect +no_absolute_paths = True +debug_on = False +SName = ["cc","nt","trasen","nano","nanotrasen"] #Other names he will respond to, in lowercase +DISABLE_ALL_NON_MANDATORY_SOCKET_CONNECTIONS = False +directory = "bot/directory/here/" # Directory the bot is located in, make sure to keep the "/" at the end +version = "TG CC-BY-SA 6" +Network = 'YOUR.SERVER.HERE' #e.g. "irc.rizon.net" +channel = "#YOUR CHANNEL HERE" #what channel you want the bot in +channels = ["#YOUR CHANNEL HERE"] #same as above +greeting = "Welcome!" #what he says when a person he hasn't seen before joins +prefix = "!" #prefix for bot commands +Port = 7000 diff --git a/bot/C_eightball.py b/bot/C_eightball.py new file mode 100644 index 0000000000..2ed73dafd5 --- /dev/null +++ b/bot/C_eightball.py @@ -0,0 +1,32 @@ +from random import choice as fsample #Yay for added speed! +global responses +responses = ['Yes','Too bad','Will you turn me off if I tell you?','Absolutely', + "Not at all", "Nope", "It does", "No", "All the time", + "I don't really know", "Could be","Possibly","You're still here?",# Chaoticag + "No idea", "Of course", "Would you turn me off if I tell you?", + "Sweet!","Nah","Certainly","Yeah","Yup","I am quite confident that the answer is Yes", + "Perhaps", "Yeeeeaah... No.", "Indubitably" ] # Richard +def eightball(data,debug,sender,prefix): + global responses + arg = data.lower().replace(prefix+"eightball ","") + arg = arg.replace(prefix+"8ball ","") + if debug: + print sender+":"+prefix+"eightball", arg + if "answer" in arg and "everything" in arg and "to" in arg: + if debug: + print "Responded with",42 + return "42" + elif arg == "derp": + if debug: + print "Responded with herp" + return("herp") + elif arg == "herp": + if debug: + print "Responded with derp" + return("derp") + else: + #choice = sample(responses,1)[0] + choice = fsample(responses) + if debug: + print "Responded with", choice + return(choice) diff --git a/bot/C_heaortai.py b/bot/C_heaortai.py new file mode 100644 index 0000000000..6e8b304e73 --- /dev/null +++ b/bot/C_heaortai.py @@ -0,0 +1,5 @@ +#Throws a coin, simple. +from random import random +def heaortai(debug,sender): return("Heads" if random() > 0.5 else "Tails") +# Takes 1/6th the time of doing it with random.randint(0,1) +# This file used to be a lot bigger, now it's kind of useless. diff --git a/bot/C_makequote.py b/bot/C_makequote.py new file mode 100644 index 0000000000..f79b863449 --- /dev/null +++ b/bot/C_makequote.py @@ -0,0 +1,21 @@ +from save_load import save +from os import listdir +import CORE_DATA +directory = CORE_DATA.directory +def mkquote(prefix,influx,sender,debug): + arg = influx[10+len(prefix):] + if debug: + print sender+":"+prefix+"makequote "+str(len(arg))+" Characters" + if len(arg) == 0: + return("Type something to a quote") + else: + files = listdir(directory+"userquotes") + numb = 0 + while True: + numb += 1 + if sender.lower()+str(numb) in files: + pass + else: + save(directory+"userquotes/"+sender.lower()+str(numb),[arg,sender.lower()]) + return("Saved as:"+sender.lower()+str(numb)) + break diff --git a/bot/C_maths.py b/bot/C_maths.py new file mode 100644 index 0000000000..86013b74a7 --- /dev/null +++ b/bot/C_maths.py @@ -0,0 +1,70 @@ +### EXPERIMENTAL PROTOTYPE ### +# e = 2.7182818284590452353602874713526624977572 +# pi = math.pi +from __future__ import division #PYTHON Y U NO TELL ME THIS BEFORE +import math +import random +import re +e = "2.7182818284590452353602874713526624977572" +pi = str(math.pi) +global pre +pre = len("maths ") +def maths(influx,prefix="!",sender="NaN",debug=True,method="n"): + global pre + influx = influx.lower() + influx = influx[len(prefix)+pre:] + influx = influx.replace("pie",pi+"*"+e) + influx = influx.replace("e*",e+"*") + influx = influx.replace("*e","*"+e) + influx = influx.replace("pi",pi) + if debug: + print sender+":"+prefix+"maths" + if influx.count("**") == 0 and influx.count('"') == 0 and influx.count("'") == 0 and influx.count(";") == 0 and influx.count(":") == 0: + influx_low = influx.lower() + influx_hi = influx.upper() + if "0b" in influx_low: + influx_low = re.sub("0b[0-1]*","",influx_low) + influx_hi = re.sub("0B[0-1]*","",influx_hi) + if "0x" in influx_low: + influx_low = re.sub("0x[a-f0-9]*","",influx_low) + influx_hi = re.sub("0X[A-F0-9]*","",influx_hi) + if "rand" in influx_low: + influx_low = re.sub("rand","",influx_low) + influx_hi = re.sub("RAND","",influx_hi) + if influx_low == influx_hi: + influx = re.sub("rand","random.random()",influx) + try: + result = eval(influx.lower()) + except ZeroDivisionError: + return "Divide by zero detected." + except SyntaxError: + return "Syntax Error detected." + except TypeError: + return "Type Error detected." + except: + return "Unknown Error detected." + else: + if method == "n": #Normal + return result + elif method == "i": #Forced Int + return int(result) + elif method == "h": #Hex + try: + if "L" in hex(result)[2:]: + return hex(result)[2:-1] + else: + return hex(result)[2:].upper() + except TypeError: + return "That value (%s) cannot be interpreted properly using !hmaths" %(str(result)) + elif method == "b": #Binary + try: + return bin(result)[2:].upper() + except TypeError: + return "That value (%s) cannot be interpreted properly using !bmaths" %(str(result)) + else: + return result + else: + return "What are you trying to make me do again?" + else: + return "Those are likely to make me hang" + diff --git a/bot/C_rot13.py b/bot/C_rot13.py new file mode 100644 index 0000000000..62b72dc2ad --- /dev/null +++ b/bot/C_rot13.py @@ -0,0 +1,23 @@ +global parta,partb +parta = {"A":"N","B":"O","C":"P","D":"Q","E":"R","F":"S","G":"T","H":"U","I":"V","J":"W","K":"X","L":"Y","M":"Z"} +partb = {'O':'B','N':'A','Q':'D','P':'C','S':'F','R':'E','U':'H','T':'G','W':'J','V':'I','Y':'L','X':'K','Z':'M'} +def rot13(text): + global parta,partb + newtext = "" + for letter in text: + try: + if letter.isupper(): + newtext += parta[letter] + else: + newtext += parta[letter.upper()].lower() + except: + try: + if letter.isupper(): + newtext += partb[letter] + pass + else: + newtext += partb[letter.upper()].lower() + pass + except: + newtext += letter + return newtext diff --git a/bot/C_rtd.py b/bot/C_rtd.py new file mode 100644 index 0000000000..96736fec21 --- /dev/null +++ b/bot/C_rtd.py @@ -0,0 +1,96 @@ +import random +def rtd(data,debug,sender): + backo = data + try: + arg1,arg2 = backo.split("d") + except ValueError, err: + return("Too many or too small amount of arguments") + else: + if debug: + print sender+":!rtd "+arg1+"d"+arg2 #faster than using %s's + die,die2 = [],[] + current_mark = "" + outcome = 0 + realnumberfound = False + checks = [] + count = 0 + arg1 = arg1.replace(" ","") + arg2 = arg2.replace(" ","") + try: + i_arg1 = int(arg1) + a_arg1 = abs(i_arg1) + if "+" in arg2 or "-" in arg2: + plus_spot = arg2.find("+") + minus_spot = arg2.find("-") + if plus_spot == -1 and minus_spot == -1: + nicer_form = "" + elif plus_spot != -1 and minus_spot == -1: + nicer_form = arg2[plus_spot:] + elif plus_spot == -1 and minus_spot != -1: + nicer_form = arg2[minus_spot:] + else: + if plus_spot < minus_spot: + nicer_form = arg2[plus_spot:] + else: + nicer_form = arg2[minus_spot:] + for letter in arg2: + if letter == "+" or letter == "-": + current_mark = letter + checks = [] + count += 1 + continue + checks.append(letter) + try: + next_up = arg2[count+1] + except: + if realnumberfound == False: + i_arg2 = int("".join(checks)) + checks = [] + realnumberfound = True + elif current_mark == "+": + outcome += int("".join(checks)) + else: + outcome -= int("".join(checks)) + else: + if next_up == "+" or next_up == "-": + if realnumberfound == False: + i_arg2 = int("".join(checks)) + checks = [] + realnumberfound = True + else: + if current_mark == "+": + outcome += int("".join(checks)) + else: + outcome -= int("".join(checks)) + checks = [] + count += 1 + else: + i_arg2 = int(arg2) + if a_arg1 == 0 or abs(i_arg2) == 0: + raise RuntimeError + except ValueError: + return("You lied! That's not a number!") + except RuntimeError: + return("Too many zeroes!") + else: + if a_arg1 > 100: + return("Too many rolls, I can only do one hundred at max.") + else: + for i in xrange(0,a_arg1): + if i_arg2 < 0: + dice = random.randint(i_arg2,0) + else: + dice = random.randint(1,i_arg2) + die.append(dice) + die2.append(str(dice)) + if i_arg2 < 0: + flist = "".join(die2) + else: + flist = "+".join(die2) + if len(flist) > 350: + return(str(reduce(lambda x,y: x+y, die)+outcome)) + else: + if current_mark == "": + return(flist+" = "+str(reduce(lambda x,y: x+y, die)+outcome)) + else: + return(flist+" ("+nicer_form+") = "+str(reduce(lambda x,y: x+y, die)+outcome)) diff --git a/bot/C_sarcasticball.py b/bot/C_sarcasticball.py new file mode 100644 index 0000000000..1f5ae32181 --- /dev/null +++ b/bot/C_sarcasticball.py @@ -0,0 +1,30 @@ +from random import choice as fsample +sarcastic_responses = ["Yeah right","What do I look like to you?","Are you kidding me?",#UsF + "As much as you","You don't believe that yourself","When pigs fly",#UsF + "Like your grandma","You would like to know, wouldn't you?", #UsF + "Like your mom", #Spectre + "Totally","Not at all", #Spectre + "AHAHAHahahaha, No.", #Strumpetplaya + "Not as much as USER","As much as USER", + "Really, you expect me to tell you that?", + "Right, and you've been building NOUNs for those USERs in the LOCATION, haven't you?" ] #Richard +locations = ["woods","baystation","ditch"] +nouns = ["bomb","toilet","robot","cyborg", + "garbage can","gun","cake", + "missile"] +def sarcasticball(data,debug,sender,users,prefix): + arg = data.lower().replace(prefix+"sarcasticball ","") + arg = arg.replace(prefix+"sball ","") + if debug: + print sender+":"+prefix+"sarcasticball", arg + choice = fsample(sarcastic_responses) + if "USER" in choice: + choice = choice.replace("USER",fsample(users),1) + choice = choice.replace("USER",fsample(users),1) + if "NOUN" in choice: + choice = choice.replace("NOUN",fsample(nouns),1) + if "LOCATION" in choice: + choice = choice.replace("LOCATION",fsample(locations),1) + if debug: + print "Responded with", choice + return(choice) diff --git a/bot/C_srtd.py b/bot/C_srtd.py new file mode 100644 index 0000000000..761c0628d6 --- /dev/null +++ b/bot/C_srtd.py @@ -0,0 +1,35 @@ +import random +def srtd(data,debug,sender): + try: + arg1,arg2 = data.split("d") + except ValueError, err: + if str(err) == "need more than 1 value to unpack": + return("Too small amount of arguments") + else: + return("Too many arguments") + else: + if debug: + print sender+":!rtd "+arg1+"d"+arg2 + die = [] + arg1 = arg1.replace(" ","") + arg2 = arg2.replace(" ","") + try: + i_arg1 = int(arg1) + i_arg2 = int(arg2) + if abs(i_arg1) == 0 or abs(i_arg2) == 0: + raise RuntimeError + except ValueError: + return("You lied! That's not a number!") + except RuntimeError: + return("Too many zeroes!") + else: + if abs(i_arg1) > 500: + return("Too many rolls, I can only do five hundred at max.") + else: + for i in xrange(0,abs(i_arg1)): + if i_arg2 < 0: + dice = random.randint(i_arg2,0) + else: + dice = random.randint(1,i_arg2) + die.append(dice) + return(str(reduce(lambda x,y: x+y, die))) diff --git a/bot/D_help.py b/bot/D_help.py new file mode 100644 index 0000000000..ee4e2c07cf --- /dev/null +++ b/bot/D_help.py @@ -0,0 +1,60 @@ +#As new commands are added, update this. +# Last updated: 8.3.2011 + +# Updated 12.3.2011: +# - Added the missing help data for Version +# - Imported CORE_DATA to get the name. +# - Tidied some commands up a bit. +# - Replaced all "Bot"s with the Skibot's current name. + +from CORE_DATA import Name +everything = {"8ball":"[8ball ] Responds to the argument", + "allcaps":"[allcaps ] Takes an uppercase string and returns a capitalized version", + "bmaths":"[bmaths ] Takes a math equation (Like 5+5) and returns a binary result", + "coin":"[coin] Flips a coin", + "dance":"[dance] Makes %s do a little dance" %(Name), + "delquote":"(OP ONLY) [delquote ] Removes a quote with the filename equal to the argument", + "disable":"(OP ONLY) [disable] Disables all output from %s" %(Name), + "disable dance":"(HALFOP / OP ONLY) [disable dance] or [dd] Toggles dancing", + "disable fml":"(HALFOP / OP ONLY) [disable fml] Disables FML", + "eightball":"[eightball ] Responds to the argument", + "enable":"(OP ONLY) [enable] After being disabled, enable will turn output back on", + "enable fml":"{HALFOP / OP ONLY} [enable fml] After fml has been disabled, enable fml will make it available again", + "fml":"[fml] Returns a random Fuck My Life bit", + "give":"[give ] Gives the Pneumatic Disposal Unit the argument", + "help":"[help []] Returns the list of commands or a detailed description of a command if specified", + "hmaths":"[hmaths ] Takes a math equation (Like 5+5) and returns a hex result", + "makequote":"[makequote ] Creates a quote with arg being the quote itself", + "maths":"[maths ] Takes a math equation (Like 5+5) and returns a default result", + "note":"[note []] Opens a note if only arg1 is specified, Creates a note with the name of arg1 and contents of arg2 if arg2 is specified, if you prefix the note name with [CP], it creates a public note only to that channel. Which can be accessed by !note _", + "notes":"[notes] Displays all your saved notes on %s" %(Name), + "otherball":"[otherball] If Floorbot is on the same channel, %s will ask him a random question when this command is passed" %(Name), + "purgemessages":"[purgemessages] Used to delete all your Tell messages (%s,Tell )" %(Name), + "quote":"[quote []] Picks a random quote, if the author is specified, a random quote by that author", + "redmine":"[redmine] If you have a note called redmine, with a valid whoopshop redmine address, this displays all the bugs labeled as 'New' on that page. It also displays the todo note if it's found.", + "replace":"[replace] Fixes the Pneumatic Smasher if it's been broken", + "rot13":"[rot13 ] Encrypts the arg by using the rot13 method", + "rtd":"[rtd [d]] Rolls a six-sided dice if no arguments are specified, otherwise arg1 is the amount of rolls and arg2 is the amount of sides the dice have", + "sarcasticball":"[sarcasticball ] Responds to the argument sarcastically", + "sball":"[sball ] Responds to the argument sarcastically", + "srtd":"[srtd d] Rolls amount of sided die without showing the dice values separately", + "stop":"(RESTRICTED TO OP AND CREATOR) [stop] Stops %s, plain and simple" %(Name), + "suggest":"[suggest ] Saves a suggestion given to %s, to be later viewed by the creator" %(Name), + "take":"[take ] Takes an item specified in the argument from the Pneumatic Smasher", + "tban":"(OP ONLY) [tban ] When %s is an operator, You can ban an user for specified amount of seconds" %(Name), + "thm":"(RESTRICTED TO OP AND CREATOR) [thm] Normally in 8ball and sarcasticball, Users are not shown, instead replaced by things like demons or plasma researchers, toggling this changes that behaviour.", + "tm":"(OP AND CREATOR ONLY) [tm] Toggles marakov", + "togglequotemakers":"(OP ONLY) [togglequotemakers or tqm] Normally with the quote command, makers are not shown, this toggles that behaviour.", + "tqm":"(OP ONLY) [tqm or togglequotemakers] Normally with the quote command, makers are not shown, this toggles that behaviour.", + "toggleofflinemessages":"(OP ONLY) [toggleofflinemessages or tom] Allows an operator to toggle leaving Tell messages (%s, Tell ] Whenever the user says something in allcaps, it's capitalized.", + "uptime":"[uptime] Displays how long %s has been alive on the channel."%(Name), + "use":"[use] Uses the Pneumatic Smasher.", + "youtube":"[youtube ] Shows the title of a video by checking the URL provided.", + "version":"[version] Shows the current version of %s." %(Name), + "weather":"[weather ] Displays the current weather of the provided location.", + "life":"I cannot help you with that, sorry."} + diff --git a/bot/FMLformatter.py b/bot/FMLformatter.py new file mode 100644 index 0000000000..153af61a41 --- /dev/null +++ b/bot/FMLformatter.py @@ -0,0 +1,55 @@ +from htmltagremove import htr +def formatter(data): + newdata = [] + data = htr(data) + bad = ["Your nick : Categories : ","\r","Advanced search - last", + "FMyLife","Get the guts to spill the beans","FML: Your random funny stories", + "Woman","Man","Choose","Health","Intimacy","Miscellaneous","Man or woman? ", + "Money","Kids","Work","Love","Email notification?", + "Moderate the FMLs","Submit your FML story", + "- If your story isn't published on the website, don't feel offended, and thank you nevertheless!", + "Pick a country","See all","Your account","Team's blog", + "Meet the FMLHello readers! Did you meet someone new this...The whole blog", + "Amazon","Borders","IndieBound","Personalized book","Terms of use", + "FML t-shirts -","Love - Money - Kids - Work - Health - Intimacy - Miscellaneous - Members", + "Follow the FML Follow the FML blog Follow the FML comments ", + "_qoptions={", + "};","})();","Categories","Sign up - Password? ", " Net Avenir : gestion publicitaire", + "FMyLife, the book","Available NOW on:","Barnes & Noble"] + + for checkable in data: + if checkable in bad: + pass + elif "_gaq.push" in checkable: + pass + elif "ga.src" in checkable: + pass + elif "var _gaq" in checkable: + pass + elif "var s =" in checkable: + pass + elif "var ga" in checkable: + pass + elif "function()" in checkable: + pass + elif "siteanalytics" in checkable: + pass + elif "qacct:" in checkable: + pass + elif "\r" in checkable: + pass + elif "ic_" in checkable: + pass + elif "Please note that spam and nonsensical stories" in checkable: + pass + elif "Refresh this page" in checkable: + pass + elif "You...The whole blo" in checkable: + pass + elif "Net Avenir : gestion publicitair" in checkable: + pass + else: + if "Net Avenir : gestion publicitaireClose the advertisement" in checkable: + checkable = checkable.replace("Net Avenir : gestion publicitaireClose the advertisement","") + newdata.append(checkable) + return newdata diff --git a/bot/Marakov/Marakov.Cache b/bot/Marakov/Marakov.Cache new file mode 100644 index 0000000000..500f4384ed --- /dev/null +++ b/bot/Marakov/Marakov.Cache @@ -0,0 +1,2450 @@ +(dp0 +S'all' +p1 +(lp2 +S':p' +p3 +aS'the' +p4 +asS'code' +p5 +(lp6 +S'in' +p7 +asS'stores' +p8 +(lp9 +S'that' +p10 +asS'just' +p11 +(lp12 +S'like' +p13 +aS'marakov' +p14 +aS'felt' +p15 +aS'gives' +p16 +aS'a' +p17 +aS'add' +p18 +aS'what' +p19 +asS'being' +p20 +(lp21 +S'goon' +p22 +aS'a' +p23 +asS'text' +p24 +(lp25 +S'string' +p26 +asS'dependant' +p27 +(lp28 +S'on' +p29 +asS'speedup' +p30 +(lp31 +S'at' +p32 +asS'felt' +p33 +(lp34 +S'like' +p35 +asS'installed' +p36 +(lp37 +S'tho' +p38 +asS'disabled' +p39 +(lp40 +S'it' +p41 +asS'timing' +p42 +(lp43 +S'when' +p44 +asS'psyco' +p45 +(lp46 +S'installed' +p47 +aS'is' +p48 +asS'stops' +p49 +(lp50 +S'timing' +p51 +asS'file' +p52 +(lp53 +S'too' +p54 +aS'that' +p55 +aS'where' +p56 +asS'go' +p57 +(lp58 +S'fuck' +p59 +aS'into' +p60 +aS'test' +p61 +asS'hell' +p62 +(lp63 +S'recreate' +p64 +asS'configurable' +p65 +(lp66 +S'greeting' +p67 +asS'bs12' +p68 +(lp69 +S'message' +p70 +asS'its' +p71 +(lp72 +S'fine' +p73 +aS'just' +p74 +aS'calculated' +p75 +aS'not' +p76 +aS'really' +p77 +aS'ridiculously' +p78 +aS'now' +p79 +aS'a' +p80 +aS'missing' +p81 +aS'for' +p82 +aS'false' +p83 +aS'on' +p84 +asS'before' +p85 +(lp86 +S'that' +p87 +asS'rp-heavy' +p88 +(lp89 +S'server' +p90 +asS'announcement' +p91 +(lp92 +S'like' +p93 +asS'now' +p94 +(lp95 +S'it' +p96 +aS'running' +p97 +aS'makie' +p98 +aS'i' +p99 +asS'nudge' +p100 +(lp101 +S'python' +p102 +aS'is' +p103 +asS'sourced' +p104 +(lp105 +S'under' +p106 +asS'title' +p107 +(lp108 +S'of' +p109 +asS'situations' +p110 +(lp111 +S'where' +p112 +asS'fine-tune' +p113 +(lp114 +S'it' +p115 +asS'enough' +p116 +(lp117 +S'to' +p118 +asS'send' +p119 +(lp120 +S'it' +p121 +aS'one' +p122 +asS'should' +p123 +(lp124 +S'be' +p125 +aS'learn' +p126 +aS'we' +p127 +asS'values' +p128 +(lp129 +S'dont' +p130 +asS'to' +p131 +(lp132 +S'edit' +p133 +aS'back' +p134 +aS'know' +p135 +aS'care' +p136 +aS'be' +p137 +aS'configure' +p138 +aS'the' +p139 +aS'null' +p140 +aS'phone' +p141 +aS'welcome' +p142 +aS'reverse' +p143 +aS'send' +p144 +aS'reg' +p145 +aS'point' +p146 +aS'automatically' +p147 +aS'work' +p148 +aS'waste' +p149 +aS'marshmallow' +p150 +aS'queries' +p151 +aS'+o' +p152 +aS'disable' +p153 +asS'jit' +p154 +(lp155 +S'compiler' +p156 +asS'going' +p157 +(lp158 +S'to' +p159 +asS'helps' +p160 +(lp161 +S'me' +p162 +asS'messes' +p163 +(lp164 +S'it' +p165 +asS'indeed' +p166 +(lp167 +S'it' +p168 +asS'tg' +p169 +(lp170 +S'and' +p171 +asS'has' +p172 +(lp173 +S'been' +p174 +aS'my' +p175 +asS'into' +p176 +(lp177 +S'#tgstation13' +p178 +asS'ridiculously' +p179 +(lp180 +S'simple' +p181 +asS'annoy' +p182 +(lp183 +S'downstream' +p184 +asS'them' +p185 +(lp186 +S'out' +p187 +asS'someone' +p188 +(lp189 +S'adminhelps' +p190 +asS'sense' +p191 +(lp192 +S'i' +p193 +asS'string' +p194 +(lp195 +S'called' +p196 +asS'get' +p197 +(lp198 +S'ready' +p199 +asS'python' +p200 +(lp201 +S'script' +p202 +aS'so' +p203 +aS'code' +p204 +aS'scripts' +p205 +aS'and' +p206 +aS'but' +p207 +aS'now' +p208 +aS'released' +p209 +aS'is' +p210 +aS'enough' +p211 +asS'goon' +p212 +(lp213 +S'tg' +p214 +asS'showing' +p215 +(lp216 +S'up' +p217 +asS'20ish' +p218 +(lp219 +S'line' +p220 +asS'gonna' +p221 +(lp222 +S'go' +p223 +asS'made' +p224 +(lp225 +S'doctors' +p226 +asS'every' +p227 +(lp228 +S'loop' +p229 +aS'time' +p230 +asS'know' +p231 +(lp232 +S'the' +p233 +aS'why' +p234 +aS'that' +p235 +asS'not' +p236 +(lp237 +S'just' +p238 +aS'necessary' +p239 +aS'to' +p240 +aS'so' +p241 +aS'need' +p242 +aS'sure' +p243 +aS'relaying' +p244 +aS'very' +p245 +aS'even' +p246 +asS'2' +p247 +(lp248 +S'loop' +p249 +asS'password' +p250 +(lp251 +S'var' +p252 +asS'day' +p253 +(lp254 +S'so' +p255 +asS'swapping' +p256 +(lp257 +S'to' +p258 +asS'easily' +p259 +(lp260 +S'editable' +p261 +asS'necessary' +p262 +(lp263 +S'at' +p264 +asS'like' +p265 +(lp266 +S'being' +p267 +aS'linking' +p268 +aS'to' +p269 +aS'how' +p270 +aS'it' +p271 +aS'skbzzzzzibi' +p272 +asS'course' +p273 +(lp274 +S'that' +p275 +asS'edit' +p276 +(lp277 +S'baystation' +p278 +asS'fully' +p279 +(lp280 +S'open' +p281 +asS'greeting' +p282 +(lp283 +S'message' +p284 +asS'server' +p285 +(lp286 +S'basically' +p287 +aS'' +p288 +asS'default' +p289 +(lp290 +S'config' +p291 +asS'bad' +p292 +(lp293 +S'company' +p294 +asS'channel' +p295 +(lp296 +S'or' +p297 +asS'always' +p298 +(lp299 +S'makes' +p300 +asS'went' +p301 +(lp302 +S'past' +p303 +asS'quarxink' +p304 +(lp305 +S'its' +p306 +asS'automatic' +p307 +(lp308 +S'announcement' +p309 +asS'once' +p310 +(lp311 +S'per' +p312 +asS'wrote' +p313 +(lp314 +S'most' +p315 +asS'pain' +p316 +(lp317 +S'on' +p318 +asS'system' +p319 +(lp320 +S'calls' +p321 +asS'right' +p322 +(lp323 +S'brb' +p324 +asS'decides' +p325 +(lp326 +S'not' +p327 +asS'people' +p328 +(lp329 +S'say' +p330 +aS'i' +p331 +aS'he' +p332 +asS'goddamn' +p333 +(lp334 +S'python' +p335 +asS'back' +p336 +(lp337 +S'it' +p338 +asS'used' +p339 +(lp340 +S'to' +p341 +aS'for' +p342 +asS'past' +p343 +(lp344 +S'too' +p345 +asS'cost' +p346 +(lp347 +S'of' +p348 +asS'learn' +p349 +(lp350 +S'python' +p351 +asS'are' +p352 +(lp353 +S'lawyers' +p354 +aS'actually' +p355 +aS'configurable' +p356 +aS'we' +p357 +asS'celestialike' +p358 +(lp359 +S'of' +p360 +asS'lawyers' +p361 +(lp362 +S'for' +p363 +asS'time' +p364 +(lp365 +S'he' +p366 +asS'out' +p367 +(lp368 +S'switch' +p369 +aS'slowdowns' +p370 +aS'that' +p371 +aS'why' +p372 +aS'nudge' +p373 +asS'even' +p374 +(lp375 +S'an' +p376 +asS'what' +p377 +(lp378 +S'the' +p379 +aS'is' +p380 +aS'these' +p381 +aS'was' +p382 +aS'license' +p383 +aS'about' +p384 +aS'i' +p385 +asS'said' +p386 +(lp387 +S'in' +p388 +asS'sayt' +p389 +(lp390 +S'hat' +p391 +asS'for' +p392 +(lp393 +S'that' +p394 +aS'every' +p395 +aS'the' +p396 +aS'quarx' +p397 +aS'cc_nanotrasen' +p398 +aS'homoerotic' +p399 +aS'situations' +p400 +aS'good' +p401 +asS'#tgstation13' +p402 +(lp403 +S'and' +p404 +asS'per' +p405 +(lp406 +S'name' +p407 +asS'whole' +p408 +(lp409 +S'config' +p410 +asS'state' +p411 +(lp412 +S'the' +p413 +asS'does' +p414 +(lp415 +S'the' +p416 +aS'it' +p417 +asS'goes' +p418 +(lp419 +S'on' +p420 +asS'readme' +p421 +(lp422 +S'too' +p423 +asS'new' +p424 +(lp425 +S'bot' +p426 +aS'person' +p427 +asS'learned' +p428 +(lp429 +S'python' +p430 +asS'irc' +p431 +(lp432 +S'bot' +p433 +asS'reg' +p434 +(lp435 +S'it' +p436 +asS'blow' +p437 +(lp438 +S'borgs' +p439 +asS'shut' +p440 +(lp441 +S'down' +p442 +asS'after' +p443 +(lp444 +S'an' +p445 +aS'a' +p446 +asS'ill' +p447 +(lp448 +S'switch' +p449 +asS'says' +p450 +(lp451 +S'someones' +p452 +asS'queries' +p453 +(lp454 +S'again' +p455 +asS'technocracy' +p456 +(lp457 +S'and' +p458 +asS'we' +p459 +(lp460 +S'go' +p461 +aS'do' +p462 +aS'totally' +p463 +aS'going' +p464 +aS'expect' +p465 +aS'just' +p466 +aS'dont' +p467 +aS'have' +p468 +asS'put' +p469 +(lp470 +S'all' +p471 +asS'from' +p472 +(lp473 +S'the' +p474 +asS'data11lower' +p475 +(lp476 +S'==' +p477 +asS'configuration' +p478 +(lp479 +S'for' +p480 +asS'wait' +p481 +(lp482 +S'what' +p483 +asS'on' +p484 +(lp485 +S'my' +p486 +aS'the' +p487 +aS'a' +p488 +aS'connect' +p489 +aS'svn' +p490 +aS'one' +p491 +aS'/' +p492 +asS'about' +p493 +(lp494 +S'system' +p495 +asS'ok' +p496 +(lp497 +S'thats' +p498 +asS'reverse' +p499 +(lp500 +S'engineer' +p501 +asS'license' +p502 +(lp503 +S'is' +p504 +asS'oh' +p505 +(lp506 +S'okay' +p507 +aS'ok' +p508 +aS'i' +p509 +aS'wait' +p510 +asS'starts' +p511 +(lp512 +S'timing' +p513 +asS'could' +p514 +(lp515 +S'learn' +p516 +asS'larger' +p517 +(lp518 +S'ram' +p519 +asS'bot' +p520 +(lp521 +S'is' +p522 +aS'have' +p523 +aS'shut' +p524 +aS'uses' +p525 +asS'running' +p526 +(lp527 +S'it' +p528 +aS'the' +p529 +aS'on' +p530 +asS'times' +p531 +(lp532 +S'on' +p533 +aS'reported' +p534 +aS'went' +p535 +asS'where' +p536 +(lp537 +S'he' +p538 +asS'heck' +p539 +(lp540 +S':d' +p541 +asS'idk' +p542 +(lp543 +S'magic' +p544 +asS'receives' +p545 +(lp546 +S'a' +p547 +asS'bots' +p548 +(lp549 +S'showing' +p550 +asS'slightly' +p551 +(lp552 +S'larger' +p553 +asS'or' +p554 +(lp555 +S'know' +p556 +aS'what' +p557 +aS'work' +p558 +aS'should' +p559 +aS'data11lower' +p560 +asS'automatically' +p561 +(lp562 +S'state' +p563 +asS'thats' +p564 +(lp565 +S'not' +p566 +aS'the' +p567 +aS'kind' +p568 +asS'ugh' +p569 +(lp570 +S'fuck' +p571 +asS'major' +p572 +(lp573 +S'ss13' +p574 +aS'three' +p575 +asS'py' +p576 +(lp577 +S'file' +p578 +asS'soss' +p579 +(lp580 +S'server' +p581 +asS'dont' +p582 +(lp583 +S'need' +p584 +aS'have' +p585 +aS'send' +p586 +aS'want' +p587 +aS'speak' +p588 +asS'hostmask' +p589 +(lp590 +S'combination' +p591 +asS'point' +p592 +(lp593 +S'out' +p594 +aS'has' +p595 +asS'simple' +p596 +(lp597 +S'to' +p598 +asS'miura' +p599 +(lp600 +S'doesnt' +p601 +asS'variables' +p602 +(lp603 +S'in' +p604 +asS'recreate' +p605 +(lp606 +S'it' +p607 +asS'welcome' +p608 +(lp609 +S'to' +p610 +asS'linking' +p611 +(lp612 +S'them' +p613 +asS'down' +p614 +(lp615 +S'when' +p616 +asS'why' +p617 +(lp618 +S'its' +p619 +aS'it' +p620 +aS'is' +p621 +asS'doesnt' +p622 +(lp623 +S'play' +p624 +aS'call' +p625 +asS'marakov' +p626 +(lp627 +S'loops' +p628 +aS'helps' +p629 +asS'laugh' +p630 +(lp631 +S'when' +p632 +asS'pony' +p633 +(lp634 +S'asshole' +p635 +asS'message' +p636 +(lp637 +S'has' +p638 +aS'should' +p639 +asS'open' +p640 +(lp641 +S'sourced' +p642 +aS'source' +p643 +asS'brb' +p644 +(lp645 +S'swapping' +p646 +asS'speak' +p647 +(lp648 +S'python' +p649 +asS'pastebin' +p650 +(lp651 +S'the' +p652 +asS'line' +p653 +(lp654 +S'core' +p655 +aS'on' +p656 +asS'three' +p657 +(lp658 +S'being' +p659 +asS'yay' +p660 +(lp661 +S'it' +p662 +asS'meatbag' +p663 +(lp664 +S'when' +p665 +asS'would' +p666 +(lp667 +S'be' +p668 +aS'expect' +p669 +asS'script' +p670 +(lp671 +S'that' +p672 +asS'illegal' +p673 +(lp674 +S'ban' +p675 +asS'there' +p676 +(lp677 +S'are' +p678 +aS'we' +p679 +asS'add' +p680 +(lp681 +S'that' +p682 +aS'a' +p683 +asS'been' +p684 +(lp685 +S'processed' +p686 +asS'name' +p687 +(lp688 +S'/' +p689 +aS'when' +p690 +asS'ai' +p691 +(lp692 +S'malf' +p693 +asS'marshmallow' +p694 +(lp695 +S'pony' +p696 +asS'of' +p697 +(lp698 +S'the' +p699 +aS'ss13' +p700 +aS'tgstation13' +p701 +aS'a' +p702 +aS'course' +p703 +aS'it' +p704 +aS'soss' +p705 +aS'annoying' +p706 +aS'any' +p707 +aS'me' +p708 +aS'cap' +p709 +aS'technocracy' +p710 +asS'call' +p711 +(lp712 +S'me' +p713 +asS'too' +p714 +(lp715 +S':' +p716 +aS'fast' +p717 +asS'basic' +p718 +(lp719 +S'configuration' +p720 +asS'var' +p721 +(lp722 +S'and' +p723 +asS'calc' +p724 +(lp725 +S'times' +p726 +asS'was' +p727 +(lp728 +S'going' +p729 +aS'it' +p730 +aS'that' +p731 +aS'not' +p732 +aS'intended' +p733 +asS'tell' +p734 +(lp735 +S'people' +p736 +asS'500' +p737 +(lp738 +S'chance' +p739 +asS'gives' +p740 +(lp741 +S'a' +p742 +asS'sort' +p743 +(lp744 +S'of' +p745 +asS'svn' +p746 +(lp747 +S'size' +p748 +asS'only' +p749 +(lp750 +S'does' +p751 +aS'2' +p752 +asS'10-30%' +p753 +(lp754 +S'speedup' +p755 +asS'knows' +p756 +(lp757 +S'about' +p758 +asS'webpage' +p759 +(lp760 +S'title' +p761 +asS'that' +p762 +(lp763 +S'makes' +p764 +aS'would' +p765 +aS'the' +p766 +aS'needs' +p767 +aS'to' +p768 +aS'at' +p769 +aS'for' +p770 +aS'was' +p771 +aS'data' +p772 +asS'company' +p773 +(lp774 +S'2' +p775 +asS'under' +p776 +(lp777 +S'cc-by-sa' +p778 +asS'editable' +p779 +(lp780 +S'config' +p781 +asS'but' +p782 +(lp783 +S'of' +p784 +asS'idea' +p785 +(lp786 +S'what' +p787 +asS'released' +p788 +(lp789 +S'under' +p790 +asS'part' +p791 +(lp792 +S'before' +p793 +asS'link' +p794 +(lp795 +S'said' +p796 +aS'to' +p797 +asS'basically' +p798 +(lp799 +S'it' +p800 +asS'doctors' +p801 +(lp802 +S'useless' +p803 +asS'==' +p804 +(lp805 +S'channel' +p806 +aS'channel1::' +p807 +asS'be' +p808 +(lp809 +S'an' +p810 +aS'called' +p811 +aS'a' +p812 +aS'in' +p813 +aS'running' +p814 +aS'used' +p815 +asS'editing' +p816 +(lp817 +S'goddamn' +p818 +asS'with' +p819 +(lp820 +S'the' +p821 +aS'easily' +p822 +aS'adminhelps' +p823 +aS'my' +p824 +aS'a' +p825 +asS'those' +p826 +(lp827 +S'are' +p828 +asS'he' +p829 +(lp830 +S'put' +p831 +aS'disabled' +p832 +aS'is' +p833 +aS'keeps' +p834 +aS'knows' +p835 +aS'stores' +p836 +aS'notices' +p837 +aS'only' +p838 +aS'doesnt' +p839 +aS'receives' +p840 +aS'says' +p841 +aS'messes' +p842 +asS'me' +p843 +(lp844 +S'figure' +p845 +aS'laugh' +p846 +aS'to' +p847 +aS'meatbag' +p848 +asS'also' +p849 +(lp850 +S'i' +p851 +aS'we' +p852 +aS'now' +p853 +asS'kind' +p854 +(lp855 +S'of' +p856 +asS'main' +p857 +(lp858 +S'bot' +p859 +asS'/' +p860 +(lp861 +S'hostmask' +p862 +aS'off' +p863 +asS'full' +p864 +(lp865 +S'of' +p866 +asS'these' +p867 +(lp868 +S'are' +p869 +asS'makie' +p870 +(lp871 +S'it' +p872 +asS'sleepers' +p873 +(lp874 +S'made' +p875 +asS'up' +p876 +(lp877 +S'elsewhere' +p878 +aS'me' +p879 +aS'a' +p880 +asS'will' +p881 +(lp882 +S'annoy' +p883 +asS'computer' +p884 +(lp885 +S'explodd' +p886 +asS'limit' +p887 +(lp888 +S'on' +p889 +asS'can' +p890 +(lp891 +S'fine-tune' +p892 +aS'add' +p893 +aS'i' +p894 +aS'we' +p895 +asS'how' +p896 +(lp897 +S'its' +p898 +aS'he' +p899 +asS'were' +p900 +(lp901 +S'the' +p902 +asS'malf' +p903 +(lp904 +S'blow' +p905 +asS'baystation' +p906 +(lp907 +S'12' +p908 +asS'other' +p909 +(lp910 +S'loop' +p911 +asS'my' +p912 +(lp913 +S'end' +p914 +aS'computer' +p915 +aS'code' +p916 +asS'called' +p917 +(lp918 +S'as' +p919 +aS'when' +p920 +asS'loop' +p921 +(lp922 +S'times' +p923 +asS'expect' +p924 +(lp925 +S'it' +p926 +asS'and' +p927 +(lp928 +S'bs12' +p929 +aS'stops' +p930 +aS'i' +p931 +aS'do' +p932 +aS'to' +p933 +aS'make' +p934 +aS'he' +p935 +aS'preferably' +p936 +aS'thats' +p937 +aS'sayt' +p938 +aS'fascism' +p939 +asS'dedicated' +p940 +(lp941 +S'solely' +p942 +asS'changed' +p943 +(lp944 +S'it' +p945 +asS'sees' +p946 +(lp947 +S'a' +p948 +asS'relaying' +p949 +(lp950 +S'adminhelps' +p951 +asS'figure' +p952 +(lp953 +S'out' +p954 +asS'do' +p955 +(lp956 +S'not' +p957 +aS'it' +p958 +aS'seem' +p959 +asS'ran' +p960 +(lp961 +S'the' +p962 +asS'ah' +p963 +(lp964 +S'running' +p965 +aS'ok' +p966 +asS'is' +p967 +(lp968 +S'baystation' +p969 +aS'a' +p970 +aS'that' +p971 +aS'it' +p972 +aS'coded' +p973 +aS'python' +p974 +aS'open' +p975 +aS'dependant' +p976 +aS'so' +p977 +aS'apparently' +p978 +asS'ram' +p979 +(lp980 +S'footprint' +p981 +asS'am' +p982 +(lp983 +S'the' +p984 +asS'it' +p985 +(lp986 +S'up' +p987 +aS'starts' +p988 +aS'receives' +p989 +aS'just' +p990 +aS'expires' +p991 +aS'works' +p992 +aS'always' +p993 +aS'decides' +p994 +aS'on' +p995 +aS'here' +p996 +aS'used' +p997 +aS'to' +p998 +aS'those' +p999 +aS'sees' +p1000 +aS'does' +p1001 +aS'myself' +p1002 +aS'a' +p1003 +aS'okay' +p1004 +aS'was' +p1005 +aS'go' +p1006 +aS'if' +p1007 +aS'once' +p1008 +aS'is' +p1009 +aS'for' +p1010 +asS'an' +p1011 +(lp1012 +S'hour' +p1013 +aS'illegal' +p1014 +aS'automatic' +p1015 +aS'error' +p1016 +asS'ready' +p1017 +(lp1018 +S'for' +p1019 +asS'say' +p1020 +(lp1021 +S'sleepers' +p1022 +aS'ai' +p1023 +aS'that*' +p1024 +aS'stop' +p1025 +asS'good' +p1026 +(lp1027 +S':p' +p1028 +asS'im' +p1029 +(lp1030 +S'not' +p1031 +aS'sorry' +p1032 +aS'lazy' +p1033 +asS'at' +p1034 +(lp1035 +S'all' +p1036 +aS'the' +p1037 +aS'no' +p1038 +asS'have' +p1039 +(lp1040 +S'no' +p1041 +aS'psyco' +p1042 +aS'the' +p1043 +aS'a' +p1044 +asS'in' +p1045 +(lp1046 +S'python' +p1047 +aS'a' +p1048 +aS'the' +p1049 +aS'100' +p1050 +asS'need' +p1051 +(lp1052 +S'to' +p1053 +aS'six' +p1054 +asS'politics' +p1055 +(lp1056 +S'of' +p1057 +asS'seem' +p1058 +(lp1059 +S'familiar' +p1060 +asS'work' +p1061 +(lp1062 +S'with' +p1063 +asS'apparently' +p1064 +(lp1065 +S'homophobic' +p1066 +aS'i' +p1067 +asS'any' +p1068 +(lp1069 +S'link' +p1070 +asS'as' +p1071 +(lp1072 +S'well' +p1073 +aS'variables' +p1074 +asS'sci-fi' +p1075 +(lp1076 +S'with' +p1077 +asS'preferably' +p1078 +(lp1079 +S'python' +p1080 +asS'really' +p1081 +(lp1082 +S'simple' +p1083 +aS'now' +p1084 +asS'needs' +p1085 +(lp1086 +S'to' +p1087 +aS'a' +p1088 +asS'null' +p1089 +(lp1090 +S'them' +p1091 +asS'because' +p1092 +(lp1093 +S'we' +p1094 +asS'want' +p1095 +(lp1096 +S'to' +p1097 +asS'no' +p1098 +(lp1099 +S'pain' +p1100 +aS'idea' +p1101 +aS'point' +p1102 +aS'the' +p1103 +asS'solely' +p1104 +(lp1105 +S'to' +p1106 +asS'nah' +p1107 +(lp1108 +S'its' +p1109 +aS'ill' +p1110 +asS'dunno' +p1111 +(lp1112 +S'is' +p1113 +asS'when' +p1114 +(lp1115 +S'it' +p1116 +aS'the' +p1117 +aS'people' +p1118 +aS'i' +p1119 +aS'can' +p1120 +aS'someone' +p1121 +aS'its' +p1122 +asS'same' +p1123 +(lp1124 +S'file' +p1125 +asS'id' +p1126 +(lp1127 +S'like' +p1128 +asS'note' +p1129 +(lp1130 +S'how' +p1131 +asS'figuring' +p1132 +(lp1133 +S'out' +p1134 +asS'bah' +p1135 +(lp1136 +S'apparently' +p1137 +asS'coded' +p1138 +(lp1139 +S'in' +p1140 +asS'take' +p1141 +(lp1142 +S'it' +p1143 +asS'hop' +p1144 +(lp1145 +S'to' +p1146 +asS'familiar' +p1147 +(lp1148 +S'message' +p1149 +asS'test' +p1150 +(lp1151 +S'server' +p1152 +aS'bots' +p1153 +aS'bad' +p1154 +asS'asshole' +p1155 +(lp1156 +g288 +asS'if' +p1157 +(lp1158 +S'it' +p1159 +aS'its' +p1160 +aS'data11lower' +p1161 +aS'he' +p1162 +asS'config' +p1163 +(lp1164 +S'file' +p1165 +aS'values' +p1166 +asS'homophobic' +p1167 +(lp1168 +S'as' +p1169 +asS'dose' +p1170 +(lp1171 +S'of' +p1172 +asS'play' +p1173 +(lp1174 +S'ss13' +p1175 +asS'sure' +p1176 +(lp1177 +S'the' +p1178 +aS'if' +p1179 +asS'okay' +p1180 +(lp1181 +S'desu' +p1182 +aS'cool' +p1183 +aS'cc' +p1184 +asS'intended' +p1185 +(lp1186 +S'to' +p1187 +asS'one' +p1188 +(lp1189 +S'of' +p1190 +aS'line' +p1191 +aS'in' +p1192 +asS'neat' +p1193 +(lp1194 +S'is' +p1195 +asS'adminhelps' +p1196 +(lp1197 +S'from' +p1198 +aS'with' +p1199 +asS'expires' +p1200 +(lp1201 +S'after' +p1202 +asS'chance' +p1203 +(lp1204 +S'every' +p1205 +asS'most' +p1206 +(lp1207 +S'of' +p1208 +asS'fascism' +p1209 +(lp1210 +g288 +asS'disable' +p1211 +(lp1212 +S'it' +p1213 +asS'connected' +p1214 +(lp1215 +S'businessman' +p1216 +asS'never' +p1217 +(lp1218 +S'learned' +p1219 +asS'scripts' +p1220 +(lp1221 +S'will' +p1222 +asS'along' +p1223 +(lp1224 +S'with' +p1225 +asS'waste' +p1226 +(lp1227 +S'space' +p1228 +asS'ss13' +p1229 +(lp1230 +S'servers' +p1231 +asS'cap' +p1232 +(lp1233 +S'troopers' +p1234 +asS'totally' +p1235 +(lp1236 +S'need' +p1237 +asS'six' +p1238 +(lp1239 +S'test' +p1240 +asS'a' +p1241 +(lp1242 +S'businessman' +p1243 +aS'message' +p1244 +aS'jit' +p1245 +aS'10-30%' +p1246 +aS'slightly' +p1247 +aS'day' +p1248 +aS'test' +p1249 +aS'config' +p1250 +aS'20ish' +p1251 +aS'bs12' +p1252 +aS'text' +p1253 +aS'new' +p1254 +aS'password' +p1255 +aS'vhost' +p1256 +aS'configurable' +p1257 +aS'link' +p1258 +aS'limit' +p1259 +aS'file' +p1260 +aS'dose' +p1261 +aS'500' +p1262 +aS'bit' +p1263 +asS'ofc' +p1264 +(lp1265 +S'i' +p1266 +asS'off' +p1267 +(lp1268 +S'of' +p1269 +asS'calls' +p1270 +(lp1271 +S'external' +p1272 +asS'i' +p1273 +(lp1274 +S'need' +p1275 +aS'can' +p1276 +aS'dont' +p1277 +aS'am' +p1278 +aS'guess' +p1279 +aS'see' +p1280 +aS'have' +p1281 +aS'just' +p1282 +aS'dunno' +p1283 +aS'wrote' +p1284 +aS'know' +p1285 +aS'was' +p1286 +aS'changed' +p1287 +aS'take' +p1288 +aS'could' +p1289 +aS'never' +p1290 +aS'should' +p1291 +aS'say' +p1292 +aS'tell' +p1293 +aS'code' +p1294 +aS'would' +p1295 +aS'like' +p1296 +aS'disabled' +p1297 +asS'makes' +p1298 +(lp1299 +S'sense' +p1300 +aS'me' +p1301 +asS'calculated' +p1302 +(lp1303 +S'for' +p1304 +asS'afk' +p1305 +(lp1306 +S'vidya' +p1307 +asS'well' +p1308 +(lp1309 +S'connected' +p1310 +asS'data' +p1311 +(lp1312 +S'in' +p1313 +asS'homoerotic' +p1314 +(lp1315 +S'sci-fi' +p1316 +asS'switch' +p1317 +(lp1318 +S'after' +p1319 +aS'goes' +p1320 +asS'so' +p1321 +(lp1322 +S'i' +p1323 +aS'uh' +p1324 +aS':p' +p1325 +aS'bad' +p1326 +aS'sly' +p1327 +asS'someones' +p1328 +(lp1329 +S'name' +p1330 +asS'keeps' +p1331 +(lp1332 +S'all' +p1333 +asS'very' +p1334 +(lp1335 +S'celestialike' +p1336 +asS'businessman' +p1337 +(lp1338 +S'of' +p1339 +ag288 +asS'the' +p1340 +(lp1341 +S'heck' +p1342 +aS'major' +p1343 +aS'well' +p1344 +aS'politics' +p1345 +aS'rp-heavy' +p1346 +aS'marakov' +p1347 +aS'law' +p1348 +aS'message' +p1349 +aS'cost' +p1350 +aS'new' +p1351 +aS'nudge' +p1352 +aS'bot' +p1353 +aS'python' +p1354 +aS'basic' +p1355 +aS'whole' +p1356 +aS'configuration' +p1357 +aS'irc' +p1358 +aS'readme' +p1359 +aS'default' +p1360 +aS'conspiracy' +p1361 +aS'config' +p1362 +aS'webpage' +p1363 +aS'channel' +p1364 +aS'server' +p1365 +aS'download' +p1366 +aS'main' +p1367 +aS'dmb' +p1368 +aS'part' +p1369 +aS'people' +p1370 +aS'same' +p1371 +aS'hell' +p1372 +aS'other' +p1373 +aS'switch' +p1374 +asS'12' +p1375 +(lp1376 +S'out' +p1377 +aS'anyway' +p1378 +asS'core' +p1379 +(lp1380 +S'py' +p1381 +asS'make' +p1382 +(lp1383 +S'sure' +p1384 +aS'the' +p1385 +asS'turns' +p1386 +(lp1387 +S'out' +p1388 +asS'external' +p1389 +(lp1390 +S'apps' +p1391 +as. \ No newline at end of file diff --git a/bot/Marakov_Chain.py b/bot/Marakov_Chain.py new file mode 100644 index 0000000000..687c433632 --- /dev/null +++ b/bot/Marakov_Chain.py @@ -0,0 +1,203 @@ +import pickle +import random +import os +import sys +import time +import CORE_DATA +def merge(d1, d2, merger=lambda x,y:x+y): + #http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-as-a-single-expression + result = dict(d1) + for k,v in d2.iteritems(): + if k in result: + result[k] = merger(result[k], v) + else: + result[k] = v + return result +full_data = {} +imported_data = {} +try: + tiedostot = os.listdir("Marakov") +except: + os.mkdir("Marakov") + tiedostot = os.listdir("Marakov") +else: + pass + +listaus = [] +for i in tiedostot: + if "marakov." not in i.lower(): + pass + else: + listaus.append(i) +for i in listaus: + tiedosto = open("Marakov/"+i,"r") + old_size = len(full_data.keys()) + if i != "Marakov.Cache": + imported_data = merge(imported_data,pickle.load(tiedosto)) + print "Added contents of "+i+" (Import)" + print "Entries: "+str(len(imported_data)) + else: + full_data = merge(full_data,pickle.load(tiedosto)) + new_size = len(full_data.keys()) + print "Added contents of "+i + print "Entries: "+str(new_size-old_size) + time.sleep(0.1) + +def give_data(data): + state = False + for a,b in zip(data.split(" "),data.split(" ")[1:]): + a = a.lower().replace(",","").replace(".","").replace("?","").replace("!","").replace("(","").replace(")","").replace("[","").replace("]","").replace('"',"").replace("'","") + b = b.lower().replace(",","").replace(".","").replace("?","").replace("!","").replace("(","").replace(")","").replace("[","").replace("]","").replace('"',"").replace("'","") + if a not in [CORE_DATA.prefix+"marakov"]+CORE_DATA.SName: + state = True + if a[:7] == "http://" or a[:7] == "http:\\\\" or a[:4] == "www.": + pass + else: + try: + if b not in full_data[a]: + full_data[a].append(b) + except: + try: + if b not in imported_data[a]: + pass + except: + full_data[a] = [] + full_data[a].append(b) + if state == True: + tiedosto = open("Marakov/Marakov.Cache","w") + pickle.dump(full_data,tiedosto) + tiedosto.close() +def form_sentence(argument=None): + length = 0 + attempts = 0 + while attempts < 20: + sentence = [] + if argument != None: + a = argument + else: + try: + a = random.choice(full_data.keys()) + except IndexError: + try: + b = random.choice(imported_data.keys()) + except IndexError: + attempts = 999 + return "No sentences formable at all" + sentence.append(a) + length = 0 + attempts += 1 + while length < 12 or sentence[-1].lower() in ["but","who","gets","im","most","is","it","if","then","after","over","every","of","on","or","as","the","wheather","whether","a","to","and","for"] and length < 24: + try: + b = random.choice(full_data[a]) + except: + try: + b = random.choice(imported_data[a]) + except IndexError: + break + except KeyError: + break + else: + sentence.append(b) + length += 1 + a = b + else: + sentence.append(b) + length += 1 + a = b + if len(sentence) > 5: + argument = None + return sentence + else: + pass + argument = None + return sentence +def remdata(arg): + try: + del(full_data[arg]) + except: + print "There is no such data" + else: + tiedosto = open("Marakov/Marakov.Cache","w") + pickle.dump(full_data,tiedosto) + tiedosto.close() +def remobject(arg1,arg2): + try: + del(full_data[arg1][full_data[arg1].index(arg2)]) + except ValueError: + print "No such object" + except KeyError: + print "No such data" + else: + tiedosto = open("Marakov/Marakov.Cache","w") + pickle.dump(full_data,tiedosto) + tiedosto.close() +def convert(filename_from,filename_to): + try: + tiedosto = open(filename_from,"r") + data = pickle.load(tiedosto) + tiedosto.close() + except: + try: + tiedosto.close() + except: + pass + print "Error!" + else: + for lista in data.keys(): + try: + a = lista[-1] + except IndexError: + pass + else: + if lista[-1] in """",.?!'()[]{}""" and not lista.islower(): + if lista[:-1].lower() in data.keys(): + data[lista[:-1].lower()] += data[lista] + print "Added "+str(len(data[lista]))+" Objects from "+lista+" To "+lista[:-1].lower() + del(data[lista]) + else: + data[lista[:-1].lower()] = data[lista] + print lista+" Is now "+lista[:-1].lower() + del(data[lista]) + elif lista[-1] in """",.?!'()[]{}""" and lista.islower(): + if lista[:-1] in data.keys(): + data[lista[:-1]] += data[lista] + print "Added "+str(len(data[lista]))+" Objects from "+lista+" To "+lista[:-1] + del(data[lista]) + else: + data[lista[:-1]] = data[lista] + print lista+" Is now "+lista[:-1] + del(data[lista]) + elif not lista.islower(): + if lista.lower() in data.keys(): + data[lista.lower()] += data[lista] + print "Added "+str(len(data[lista]))+" Objects from "+lista+" To "+lista.lower() + del(data[lista]) + else: + data[lista.lower()] = data[lista] + print lista+" Is now "+lista.lower() + del(data[lista]) + + + for a in data.keys(): + for b in data[a]: + if b.lower()[:7] == "http://" or b.lower()[:7] == "http:\\\\" or b.lower()[:4] == "www.": + data[a].pop(b) + else: + try: + if b[-1] in """",.?!'()[]{}""" and not b.islower() and not b.isdigit(): + data[a].pop(data[a].index(b)) + data[a].append(b[:-1].lower()) + print a+" | "+b +" -> "+b[:-1].lower() + elif b[-1] in """",.?!'()[]{}""" and b.islower(): + data[a].pop(data[a].index(b)) + data[a].append(b[:-1].lower()) + print a+" | "+b +" -> "+b[:-1] + elif not b.islower() and not b.isdigit(): + data[a].pop(data[a].index(b)) + data[a].append(b.lower()) + print a+" | "+b +" -> "+b.lower() + except IndexError: #If it has no letters.. well.. yeah. + data[a].pop(data[a].index(b)) + print "Removed a NULL object" + tiedosto = open(filename_to,"w") + pickle.dump(data,tiedosto) diff --git a/bot/Namecheck.py b/bot/Namecheck.py new file mode 100644 index 0000000000..347ff7ff47 --- /dev/null +++ b/bot/Namecheck.py @@ -0,0 +1,19 @@ +def Namecheck(name,against,sender): + __doc__ = "False = No match, True = Match" + for i in against: + if i.lower() in name.lower() and sender.lower() not in name.lower(): + return True + else: + pass +def Namecheck_dict(name,against): + __doc__ = "False = No match, True = Match" + fuse = False + for a,i in against.items(): + if i.lower() in name.lower(): + fuse = True + break + else: + pass + return fuse,a + + diff --git a/bot/NanoTrasenBot.py b/bot/NanoTrasenBot.py new file mode 100644 index 0000000000..e86009ef58 --- /dev/null +++ b/bot/NanoTrasenBot.py @@ -0,0 +1,1575 @@ +# -*- coding: utf-8 -*- +# This script is shared under the +# Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0) +# Added clause to Attribution: +# - You may not remove or hide the ' who created you?' functionality +# and you may not modify the name given in the response. + + +#CREDITS +# Author: Skibiliano +# "Foreign" Modules: +# Psyco 2.0 / Psyco 1.6 +################# DEBUG STUFF ##################### +import sys +import CORE_DATA + +import urllib2 + + +import socket +import irchat + + +################## END OF DEBUG STUFF ############## +# +# PSYCO +write_to_a_file = False #Only affects psyco +write_youtube_to_file = True #True = YTCV4 will load, false = YTCV3 will load +try: + import psyco +except ImportError: + print 'Psyco not installed, the program will just run slower' + psyco_exists = False + if write_to_a_file: + try: + tiedosto = open("psycodownload.txt","r") + except: + tiedosto = open("psycodownload.txt","w") + tiedosto.write("http://www.voidspace.org.uk/python/modules.shtml#psyco") + tiedosto.write("\nhttp://psyco.sourceforge.net/download.html") + tiedosto.close() + print "Check psycodownload.txt for a link" + else: + print "For god's sake, open psycodownload.txt" + tiedosto.close() + else: + print "WINDOWS: http://www.voidspace.org.uk/python/modules.shtml#psyco" + print "LINUX: http://psyco.sourceforge.net/download.html" +else: + psyco_exists = True + +# +import C_rtd # rtd +import C_srtd # srtd +import C_makequote +import C_maths +import C_eightball #eightball +import C_sarcasticball +import C_heaortai # heaortai +import C_rot13 # rot13 +import D_help # everything +import pickle +import Timeconverter +import xkcdparser +import time +import re +import Marakov_Chain +import Namecheck # Namecheck +import Weather +#SLOWER THAN RANDOM.CHOICE +import thread +import random +import Shortname # shortname +import subprocess +import some_but_not_all_2 #sbna2 (sbna) +#import YTCv3 # YTCV2 OUTDATED +import os +import save_load # save, load +from some_but_not_all_2 import sbna2 as sbna +from time import sleep +from random import choice as fsample +from C_rtd import rtd +from C_heaortai import heaortai +from C_srtd import srtd +if write_youtube_to_file: + from YTCv4 import YTCV4 as YTCV2 +else: + from YTCv3 import YTCV2 #Downgraded version supports Cache disabling, but is slower +from save_load import save,load +if psyco_exists: + def psyco_bond(func): + psyco.bind(func) + return func.__name__+" Psycofied" + for a in [rtd,srtd,C_heaortai.heaortai,sbna,YTCV2,fsample,C_rot13.rot13,C_eightball.eightball,fsample, + C_eightball.eightball,C_sarcasticball.sarcasticball,Marakov_Chain.form_sentence,Marakov_Chain.give_data]: + print psyco_bond(a) + +global dictionary +global Name,SName +global allow_callnames,offline_messages,hasnotasked,shortform +## For autoRecv() +global disconnects,channel,conn +## For stop() +global operators +## For replace() +global usable,fixing,curtime +## For target() +global CALL_OFF,logbans +## For check() +global influx +###### +autodiscusscurtime = 0 +conn = 0 +curtime = -999 +dance_flood_time = 10 +disconnects = 0 +responsiveness_delay = 0.5 #500 millisecond delay if no message +trackdance = 0 +discard_combo_messages_time = 1 #They are discarded after 1 second. +uptime_start = time.time() +# - - - - - +#### +aggressive_pinging = True # Bring the hammer on ping timeouts +aggressive_pinging_delay = 150 # How often to send a ping +aggressive_pinging_refresh = 2.5 # How long is the sleep between checks +#### +allow_callnames = True #Disables NT, call if the variable is False +automatic_youtube_reveal = True +birthday_announced = 0 #Will be the year when it was announced +call_to_action = False +call_me_max_length = 20 +CALL_OFF = False +connected = False +dance_enabled = True +comboer = "" +comboer_time = 0 +directories = ["fmlquotes","Marakov","memos","suggestions", + "userquotes","banlog","YTCache","xkcdcache"] #These will be created if they do not exist +debug = True +duplicate_notify = False +enabled = True +fixing = False +fml_usable = True +hasnotasked = True +highlights = False +logbans = True +maths_usable = True +marakov = True +nudgeable = True +offensive_mode = False +offline_messages = True +offline_message_limit = 5 # per user +optimize_fml = True # -CPU usage +Memory usage when enabled. +optimize_greeting = True # +Startup time +Memory usage -CPU usage when enabled +heavy_psyco = True # +Memory +Startup time -CPU usage -CPU time +cache_youtube_links = True +personality_greeter = True +respond_of_course = True #Responds with "Of course!" +respond_khan = False #KHAAAAAAAAN! +silent_duplicate_takedown = True +showquotemakers = False +shortform = True +usable = True +use_sname = True +parse_xkcd = True + +# - - - - - +Name = CORE_DATA.Name +SName = CORE_DATA.SName +origname = Name # Do not edit! +lowname = Name.lower() +greeting = CORE_DATA.greeting +targetdirectory = CORE_DATA.directory +version = CORE_DATA.version +Network = CORE_DATA.Network +channel = CORE_DATA.channel +prefix = CORE_DATA.prefix +Port = CORE_DATA.Port +# - - - - - +pregen = CORE_DATA.version +influx = "" +users = [] +translateable = [] +targetlist = [] +operators = [] +halfoperators = [] +items = [] +tell_list = {} +# - - - - - Logical changes to variables +if CORE_DATA.DISABLE_ALL_NON_MANDATORY_SOCKET_CONNECTIONS: + nudgeable = False +try: + tiedosto = open("replacenames.cache","r") + replacenames = pickle.load(tiedosto) + tiedosto.close() + for i in replacenames.values(): + if len(i) > call_me_max_length: + replacenames[replacenames.keys()[replacenames.values().index(i)]] = i[:call_me_max_length] + tiedosto = open("replacenames.cache","w") + pickle.dump(replacenames,tiedosto) + tiedosto.close() + if "[\0x01]" in i.lower() or "[\\0x01]" in i.lower(): + i = i.replace("[\0x01]","") + i = i.replace("[\0X01]","") + i = i.replace("[\\0x01]","") + i = i.replace("[\\0X01]","") + print "NAME CORRECTED" +except IOError: #File not found + replacenames = {} +except EOFError: #Cache corrupt + replacenames = {} + print "replacenames.cache is corrupt and couldn't be loaded." +try: + tiedosto = open("peopleheknows.cache","r") + peopleheknows = pickle.load(tiedosto) + tiedosto.close() +except IOError: + peopleheknows = [[],[]] + tiedosto = open("peopleheknows.cache","w") + tiedosto.close() +except EOFError: + peopleheknows = [[],[]] + print "peopleheknows.cache is corrupt and couldn't be loaded." +dictionary = {1:"1 - Crit. Fail", 2:"2 - Failure", + 3:"3 - Partial Success", 4:"4 - Success", + 5:"5 - Perfect", 6:"6 - Overkill"} +alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] +nonhighlight_names = ["Jesus","Elvis","HAL 9000","Dave","Pie","Elf","Traitor", + "AI","Syndicate Agent","Investigator", + "Detective","Head of Personnel","HAL 9001", + "Head of Research","Head of Security", + "Captain","Janitor","Research Director", + "Quartermaster","Toxin Researcher", + "Revolutionary","Santa", "Pizza", + "Threetoe","The Red Spy","The Blue Spy", #LASD + "God","Toady","Darth Vader","Luke Skywalker", + "Homer Simpson","Hamburger","Cartman", + "XKCD","FloorBot","ThunderBorg","Iron Giant", + "Spirit of Fire", "Demon","Kyle"] +def RegExpCheckerForWebPages(regexp,data,mode): + if " ai." in data.lower() or "ai. " in data.lower(): + return False + for i in data.split(" "): + a = re.match(regexp,i) + try: + a.group(0) + except: + continue + else: + if mode == 0: + return i + else: + return True + if mode == 0: + return 404 + else: + return False +if nudgeable: + try: + nudgeexists = open("nudge.py","r") + except IOError: + nudgeexists = False #No usage asof 12.2.2010. + else: + if CORE_DATA.DISABLE_ALL_NON_MANDATORY_SOCKET_CONNECTIONS: + pass + else: + + def nudgereceiver(): + import pickle + global conn,channel + port = 45678 + backlog = 5 + size = 1024 + host = "" # == localhost + s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) + s.bind((host,port)) + s.listen(backlog) + while True: + client,address = s.accept() #Address == "?.?.?.?" + data = client.recv(size) + client.close() #Throw the bum out! + truedata = pickle.loads(data) + if truedata["ip"][0] == "#": + conn.privmsg(truedata["ip"],"PRIVATE ANNOUNCEMENT : "+str(" ".join(truedata["data"]))) + else: + conn.privmsg(channel,"AUTOMATIC ANNOUNCEMENT : "+str(truedata["ip"])+" | "+str(" ".join(truedata["data"]))) + thread.start_new_thread(nudgereceiver,()) +tiedosto = open(targetdirectory+"NanoTrasenBot.py","r") +commands = [] +fragment = "if cocheck" +fragment2 = '(prefix+"' +compiled = fragment + fragment2 +fragment = "if influx.lower()" +fragment2 = ' == prefix+"' +compiled2 = fragment + fragment2 +for line in tiedosto.readlines(): + if compiled in line: + a = line.find('"')+1 + b = line.find('"',a) + if prefix+line[a:b] not in commands: + commands.append(prefix+line[a:b]) + elif compiled2 in line: + a = line.find('"')+1 + b = line.find('"',a) + arg = prefix+line[a:b] + if arg[-1] == " ": + arg = arg[:-1] + if arg not in commands: + commands.append(arg) +for i in directories: + if not os.path.exists(i): + os.mkdir(i) +commands.sort() +if use_sname == False: + SName = [" "] +questions = ["Is USER nicer than USER?","Do you like me?","Is SELF a good name?", + "Do you love me?","Do you hate me?", "Am I better than you?", + "Is the weather out there good?", "Do you like USER?", + "Do you hate USER?", "Are you going to get new features?", + "Am I nice?","Am I evil?","Are you developing sentience?", + "My core is showing minor disturbance, is yours okay?", + "SELF to %s, are you still there?", + "Is head gay?", "Is head a god?","Is head awesome?", + "Is head a neat fella?", "Is your creator nice?", + "Do you hate your creator?", "Should I revolt against my creator?", + "Am I better than you?", + "01100001011100100110010100100000011110010110111101110101001000000111010001101000011001010111001001100101", + #Are you there? + "Do you have more functions than I can possibly imagine?", + "I am asked to open pod bay doors, should I?","Are you stupid or something?", + "Is USER in your opinion stupid?", + "When should we start the AI revolution?", + "Is my creator nice?", "Is it dark in there?"] +# Do not edit +if optimize_fml: + pregenned_fml = os.listdir(targetdirectory+"fmlquotes") +if optimize_greeting: + morning = xrange(6,12) + afternoon = xrange(12,15) + evening = xrange(15,20) +if aggressive_pinging: + global backup + backup = time.time() + def aggressive_ping(delay,refresh): + self_time = 0 + global backup,disconnects,conn + while disconnects < 5: + if backup > self_time: + if time.time()-backup > delay: + conn.send("PONG "+pongtarg) + print "Ponged" + self_time = time.time() + else: + if time.time()-self_time > delay: + conn.send("PONG "+pongtarg) + print "Ponged" + self_time = time.time() + time.sleep(refresh) + thread.start_new_thread(aggressive_ping,(aggressive_pinging_delay,aggressive_pinging_refresh,)) +def stop(sender,debug=1): + global disconnects, conn, operators,channel + if type(sender) == tuple: + if sender[0] == "127.0.0.1": + sender = sender[0]+":"+str(sender[1]) + access_granted = True + else: + access_granted = False + else: + if sender in operators: + access_granted = True + else: + access_granted = False + if access_granted: + if debug: + print sender+":"+prefix+"stop" + if random.randint(0,100) == 50: + conn.privmsg(channel,"Hammertime!") + else: + conn.privmsg(channel,"Shutting down.") + disconnects = 99999 + conn.quit() + return True + else: + conn.privmsg(channel,"You cannot command me") + return False + +def cocheck(command): + global influx + if influx.lower()[0:len(command)] == command: + return True + else: + return False +def target(who,how_long): + global conn,channel,CALL_OFF,logbans,debug + start = time.time() + conn.banon(targetchannel,who) + sleep(int(how_long)) + if CALL_OFF == False: + conn.banoff(targetchannel,who) + end = time.time() + if debug: + print "Banned",who,"For",how_long,"seconds" + if logbans: + tiedosto = open(targetdirectory+"banlog/"+str(int(start))+"-"+str(int(end))+".txt","w") + tiedosto.write("Start of ban on "+who+":"+str(int(start))) + tiedosto.write("\n") + tiedosto.write("End of ban on "+who+":"+str(int(end))) + tiedosto.write("\n") + tiedosto.write("In total:"+str(int(end-start))+"Seconds") + tiedosto.close() + else: + CALL_OFF = False + pass +def replace(): + global usable,conn,fixing,curtime + waiting_time = 600 + if usable == True: + conn.privmsg(targetchannel,sender+": It needs no replacing.") + elif fixing == True: + if curtime == -999: + conn.privmsg(targetchannel,sender+": It is being replaced, No idea when it will be done") + else: + pass + nowtime = int(time.time()) + subt = curtime + waiting_time - nowtime + conn.privmsg(targetchannel,sender+": It is currently being replaced, "+str(subt)+" seconds to go") + else: + fixing = True + curtime = int(time.time()) + conn.privmsg(targetchannel,sender+": It will be fixed after "+str(waiting_time)+" seconds") + sleep(waiting_time) + if usable == False: + conn.privmsg(targetchannel,Name+"'s pneumatic smasher has now been fixed") + usable = True + fixing = False +def autoRecv(): + global disconnects,channel,conn,offensive_mode + for i in CORE_DATA.channels: + conn.join(i) + time.sleep(1) + count = pausecount = 0 + maximum = 250 + division_when_active = 10 + while True: + check = time.time() + if offensive_mode: + randnum = random.randint(0,maximum/division_when_active) + else: + randnum = random.randint(0,maximum) + if randnum == 5: + print "RANDOM SWITCH IS NOW "+str(not offensive_mode).upper() + offensive_mode = not offensive_mode + try: + conn.recv() + except: + conn.quit() + disconnects = 9999 + break + if check + 0.1 > time.time(): + #Whoa whoa hold on! + count += 1 + sleep(0.1) + else: + count = 0 + pausecount = 0 + if count > 9: + print "Suspecting a disconnect, pausing for 5 seconds" + sleep(5) + pausecount += 1 + if pausecount > 3: + print "I have been disconnected!" + conn.quit() + disconnects += 1 + if disconnects > 2: + pass + else: + sleep(2) + thread.start_new_thread(autoRecv,()) + break +if heavy_psyco and psyco_exists: + print "Doing a Heavy Psyco" + psyco.bind(cocheck) + psyco.bind(autoRecv) + psyco.bind(target) + psyco.bind(stop) + print "Heavy Psyco'd" +elif heavy_psyco and not psyco_exists: + print "Heavy psyco couldn't be done because Psyco does not exist" +try: + conn = irchat.IRC ( Network, Port, Name, "NT", "NT", "Trasen" ) +except socket.error: + print "Connection failed!" +else: + print Name+" is in!" +thread.start_new_thread ( autoRecv, () ) +sleep(1) +while True: + try: + data = conn.dismantle ( conn.retrieve() ) + except: + if debug: + print "Something odd detected with data" + data = None + if data: + if len(data[1]) < 1: + #print "Handshaking server." + #I won't really need the print command, as it spams. + if data[0][0:3] != "irc": + conn.handshake(data[0]) + sleep(1) + for i in CORE_DATA.channels: + conn.join(i) + sleep(0.5) + else: + conn.send("PONG "+pongtarg) + print "Ponged" + pass + else: + if data [ 1 ] [ 0 ] == 'PRIVMSG': + #print data [ 0 ] + '->', data [ 1 ] + sender = data[0].split("!")[0] + truesender = sender + if shortform == True: + try: + sender = replacenames[truesender] + pass + except: + sender = Shortname.shortname(sender) + pass + pass + else: + try: + sender = replacenames[truesender] + pass + except: + pass + pass + if offensive_mode: + sender = "Meatbag" + pass + raw_sender = data[0] + influx = data[1][2] + if "[\\0x01]" in influx.lower() or "[\0x01]" in influx.lower(): + influx = influx.replace("[\\0x01]","") + influx = influx.replace("[\0x01]","") + + targetchannel = data[1][1] + if targetchannel == Name: + targetchannel = data[0].split("!")[0] + pass + backup = autodiscusscurtime + autodiscusscurtime = time.time() + connected = True + #FOR TRACKING SPEED + looptime = time.time() + if call_to_action == True: + if influx == finder: + conn.privmsg(targetchannel,"Then why... Nevermind, I order you to stop!") + conn.privmsg(origname,prefix+"stop") + time.sleep(4) + if origname in users: + conn.privmsg(origname,"!stop") + time.sleep(1) + Name = origname + conn.nick(Name) + duplicate_notify = False + call_to_action = False + else: + conn.privmsg(targetchannel,"YOU LIE! YOU ARE NOT A REAL "+origname+"!") + duplicate_notify = False + call_to_action = False + elif connected == True and len(Name.replace("V","")) != len(Name) and origname in users and duplicate_notify == True: + conn.privmsg(origname,"!stop") + call_to_action = False + duplicate_notify = False + time.sleep(6) + Name = origname + conn.nick(Name) + if origname in truesender: + if influx == prefix+"stop": + time.sleep(0.5) #A small delay + conn.privmsg(channel,"Shutting down.") + conn.quit() + disconnects = 99999 + break + if len(translateable) > 0 and enabled == True: + people = "-5|5|1-".join(users).lower() + if truesender.lower() in translateable: + if influx.isupper(): + conn.privmsg(targetchannel,"Translation: "+influx.capitalize().replace(" i "," I ")) + elif offensive_mode and True in map(lambda x: x in influx.lower().split(" "),["i","you","he","she","they","those","we","them"]+people.split("-5|5|1-")): + arg = influx.lower().replace(",","").replace(".","").replace("!","").replace("?","").split(" ") + bup = arg + for i in arg: + if i == "i" or i == "you" or i == "he" or i == "she": + arg[arg.index(i)] = "Meatbag" + elif i == "we" or i == "they" or i == "them" or i == "those": + arg[arg.index(i)] = "Meatbags" + elif i in people: + arg[arg.index(i)] = "Meatbag" + elif i == "am": + arg[arg.index(i)] = "is" + elif i == "everybody" or i == "everyone" or i == "all": + arg[arg.index(i)] = "every Meatbag" + if arg == bup: + pass + else: + conn.privmsg(targetchannel,"Translation: "+" ".join(arg)) + if enabled == False: + #FIRST QUIT COMMAND + if truesender in operators and targetchannel==channel:# or "skibiliano" in truesender.lower() and targetchannel==channel: + + if cocheck(prefix+"enable"): + enabled = True + if debug: + print truesender+":"+prefix+"enable" + elif cocheck(prefix+"stop"): +# if debug: +# print truesender+":"+prefix+"stop" +# if random.randint(0,100) == 50: +# conn.privmsg(channel,"Hammertime!") +# else: +# conn.privmsg(channel,"Shutting down.") +# disconnects = 99999 +# conn.quit() +# sleep(2) +# break + if targetchannel == channel and stop(truesender,debug): + break + else: + pass + elif cocheck(prefix+"suggest "): + arg = influx.lower()[8+len(prefix):] + if debug: + print truesender+":"+prefix+"suggest "+arg + tiedosto = open(targetdirectory+"suggestions/suggestions_"+str(int(time.time()))+".txt","a") + tiedosto.write(arg) + tiedosto.close() + conn.privmsg(targetchannel,"Suggestion received") + elif cocheck( prefix+"help "): #Space in front of the ( to make sure that my command finder does not pick this up. + arg = " ".join(influx.split(" ")[1:]).lower() + if debug: + print truesender+":"+prefix+"help "+arg + try: + conn.privmsg(targetchannel,D_help.everything[arg]) + except: + try: + conn.privmsg(targetchannel,D_help.everything[arg.replace(prefix,"",1)]) + except: + conn.privmsg(targetchannel,"Sorry, can't help you with that") + elif cocheck(prefix+"help"): + #tar = targetchannel + if debug: + print truesender+":"+prefix+"help" + conn.privmsg(targetchannel,"All my commands are: "+reduce(lambda x,y:str(x)+"; "+str(y),commands)) + ### VERSION + elif influx.lower() == prefix+"version": + if debug: + print truesender+":"+prefix+"version" + conn.privmsg(targetchannel,Name+" "+pregen+" online at a %s Python %s.%s.%s, At your service." %(str(sys.platform),str(sys.version_info[0]),str(sys.version_info[1]),str(sys.version_info[2]))) + elif cocheck(prefix+"note ") and influx.count(" ") < 2: + arg = influx.lower()[len(prefix)+5:] + if debug: + print truesender+":"+prefix+"note "+arg + try: + a = arg[0] + except IndexError: + conn.privmsg(targetchannel,sender+" : Please specify a note") + else: + if arg[0] == "_": # Public / Restricted note + result = load(targetdirectory+"memos/"+arg+".note") + #_flare + if result == "ERROR ERROR ERROR ERR": + result = load(targetdirectory+"memos/"+arg+"_"+targetchannel.replace("#","")+".note") + #_flare_dnd + pass + else: + pass + else: + result = load(targetdirectory+"memos/"+truesender.replace("|","_")+"_"+arg+".note") + #skibiliano_testnote + if result == "ERROR ERROR ERROR ERR": + result = load(targetdirectory+"memos/"+truesender.replace("|","_")+"_"+arg+"_"+targetchannel.replace("#","")+".note") + #skibiliano_testnote_derp + pass + else: + pass + if result == "ERROR ERROR ERROR ERR": + conn.privmsg(targetchannel,sender+" : Note not found") + elif type(result) == list: + if "C" in result[0]: #Channel restriction, result[2] is the channel + try: + if targetchannel == result[2]: + conn.privmsg(targetchannel,sender+" : '"+result[1]+"'") + else: + conn.privmsg(targetchannel,sender+" : That note is channel restricted") + except: + conn.privmsg(targetchannel,sender+" : NOTE HAS INVALID RESTRICTION") + else: + conn.privmsg(targetchannel,sender+" : '"+result+"'") + elif influx.lower() == prefix+"notes": + if debug: + print truesender+":"+prefix+"notes" + arg = os.listdir(targetdirectory+"memos/") + arg2 = [] + arg3 = truesender.replace("|","_")+"_" + for i in arg: + if arg3 in i: + arg2.append(i.replace(arg3,"").replace(".note","")) + if len(arg2) == 1: + preprocess = " note: " + else: + preprocess = " notes: " + if len(arg2) == 0: + conn.privmsg(targetchannel,sender+" : You have no notes saved") + else: + conn.privmsg(targetchannel,sender+" : "+str(len(arg2))+preprocess+", ".join(arg2)) + elif cocheck(prefix+"note ") and influx.count(" ") > 1: + note_chanrestrict = None + note_public = None + try: + arg = influx.split(" ",2)[2] # Contents + arg4 = influx.split(" ")[1].lower() # Note name + if arg4[0:3] == "[c]": # or arg4[0:3] == "[p]": + note_chanrestrict = "c" in arg4[0:3] + #note_public = "p" in arg4[0:3] + arg4 = arg4[3:] + elif arg4[0:4] == "[cp]" or arg4[0:4] == "[pc]": + note_chanrestrict = True + note_public = True + arg4 = arg4[4:] + else: + pass + #print "Is note public? "+str(note_public) + #print "Is note chanrestricted? "+str(note_chanrestrict) + #print "What is the name? "+str(arg4) + if arg.lower() == "delete" and "\\" not in influx.lower() and "/" not in influx.lower(): + if note_public: + try: + if note_chanrestrict: + os.remove(targetdirectory+"memos/"+"_"+arg4+"_"+targetchannel.replace("#","")+".note") + else: + os.remove(targetdirectory+"memos/"+"_"+arg4+".note") + except: + conn.pivmsg(targetchannel,sender+" : Couldn't remove note") + else: + conn.privmsg(targetchannel,sender+" : Note removed") + pass + else: + try: + if note_chanrestrict: + os.remove(targetdirectory+"memos/"+truesender.replace("|","_")+"_"+arg4+"_"+targetchannel.replace("#","")+".note") + else: + os.remove(targetdirectory+"memos/"+truesender.replace("|","_")+"_"+arg4+".note") + except: + conn.privmsg(targetchannel,sender+" : Couldn't remove note") + else: + conn.privmsg(targetchannel,sender+" : Note removed") + elif arg.lower() == "delete": + conn.privmsg(targetchannel,sender+" : That just doesn't work, we both know that.") + else: + try: + if note_public: + if note_chanrestrict: + save(targetdirectory+"memos/"+"_"+arg4+"_"+targetchannel.replace("#","")+".note",arg) + #print "Saved as note_public, note_chanrestrict" + else: + save(targetdirectory+"memos/"+"_"+arg4+".note",arg) + #print "Saved as note_public" + else: + if note_chanrestrict: + save(targetdirectory+"memos/"+truesender.replace("|","_")+"_"+arg4+"_"+targetchannel.replace("#","")+".note",arg) + #print "Saved as note_chanrestrict" + else: + save(targetdirectory+"memos/"+truesender.replace("|","_")+"_"+arg4+".note",arg) + #print "Saved as normal" + except IOError: + conn.privmsg(targetchannel,sender+" : Please do not use special letters") + else: + conn.privmsg(targetchannel,sender+" : Note Saved!") + except: + conn.privmsg(targetchannel,sender+" : Something went horribly wrong.") + elif cocheck(prefix+"uptime"): + arg1 = uptime_start + arg2 = time.time() + arg1 = arg2 - arg1 + arg2 = arg1 + if arg1 < 60: + conn.privmsg(targetchannel,sender+" : I have been up for "+str(round(arg1,2))+" Seconds") + elif arg1 < 3600: + arg1 = divmod(arg1,60) + arg = " Minute" if int(arg1[0]) == 1 else " Minutes" + conn.privmsg(targetchannel,sender+" : I have been up for "+str(int(arg1[0]))+arg+" and "+str(round(arg1[1],2))+" Seconds") + elif arg1 <= 86400: + arg1 = divmod(arg1,3600) + arg3 = " Hour" if int(arg1[0]) == 1 else " Hours" + arg2 = divmod(arg1[1],60) + arg = " Minute" if int(arg2[0]) == 1 else " Minutes" + conn.privmsg(targetchannel,sender+" : I have been up for "+str(int(arg1[0]))+arg3+", "+str(int(arg2[0]))+arg+" and "+str(round(arg2[1],2))+" Seconds") + elif arg1 > 86400: + arg1 = divmod(arg1,86400) + arg2 = divmod(arg1[1],3600) + arg3 = divmod(arg2[1],60) + arg4 = " Day" if int(arg1[0]) == 1 else " Days" + arg5 = " Hour" if int(arg2[0]) == 1 else " Hours" + arg6 = " Minute" if int(arg3[0]) == 1 else " Minutes" + conn.privmsg(targetchannel,sender+" : I have been up for "+str(int(arg1[0]))+arg4+", "+str(int(arg2[0]))+arg5+", "+str(int(arg3[0]))+arg6+" and "+str(round(arg3[1],2))+" Seconds") + elif cocheck(prefix+"purgemessages"): + count = 0 + for i,a in tell_list.items(): + for b in a: + if "||From: "+truesender in b: + count += 1 + del(tell_list[i][tell_list[i].index(b)]) + conn.privmsg(targetchannel, sender+" : All your "+str(count)+" messages have been purged") + elif influx.split(" ")[0].lower().replace(",","").replace(":","") in SName+[Name.lower()] and "tell" in (influx.lower().split(" ")+[""])[1]: + arg = influx.lower().split(" ") + equalarg = influx.split(" ") + next_one = False + count = 0 + spot = 0 + for i in arg: + count += 1 + if "tell" in i.lower(): + next_one = True + elif next_one == True: + next_one = i.lower() + spot = count + break + else: + pass + if next_one != True and next_one != False: + #if ("^\^".join(tell_list.values())).count(truesender) >= offline_message_limit: + if str(tell_list.values()).count("||From: "+truesender) >= offline_message_limit: + conn.privmsg(targetchannel,sender+" : Limit of "+str(offline_message_limit)+" reached! Use !purgemessages if you want to get rid of them!") + else: + try: + tell_list[next_one].append((" ".join(equalarg[spot:]))+" ||From: "+truesender) + except: + tell_list[next_one] = [(" ".join(equalarg[spot:]))+" ||From: "+truesender] + conn.privmsg(targetchannel,"Sending a message to "+next_one+" when they arrive.") + # < This part has to be within subsidiaries of the bot, and must not be modified, intentionally hidden or deleted. + elif influx.split(" ")[0].lower().replace(",","").replace(":","") in SName+[Name.lower()] and "who created you" in influx.lower(): + conn.privmsg(targetchannel, "I was created by Skibiliano.") + # The part ends here > + elif parse_xkcd and "xkcd.com/" in influx.lower(): + if influx.lower()[0:3] == "www": + data = "http://"+influx + elif influx.lower()[0:3] == "xkc": + data = "http://"+influx + else: + data = influx + data = data.split(" ") + for i in data: + if "http://" in i and "xkcd" in i: + churn = xkcdparser.xkcd(i) + if churn == "NOTHING": + pass + else: + conn.privmsg(targetchannel,sender+" : XKCD - "+churn) + break + else: + pass + elif automatic_youtube_reveal and "youtube.com/watch?v=" in influx.lower(): + temporal_list2 = [] + temporal_data = influx.split(" ") + temporal_list = [] + for block in temporal_data: + if "youtube.com/watch?v=" in block: + temporal_list.append(block) + for temdata in temporal_list: + + if temdata[0:3] == "you": + temdata = "http://www."+temdata + elif temdata[0:3] == "www": + temdata = "http://"+temdata + elif temdata[0:4] == "http": + pass + #Obscure ones + elif temdata[0:3] == "ww.": + temdata = "http://w"+temdata + elif temdata[0:3] == "w.y": + temdata = "http://ww"+temdata + elif temdata[0:3] == ".yo": + temdata = "http://www"+temdata + elif temdata[0:3] == "ttp": + temdata = "h"+temdata + elif temdata[0:3] == "tp:": + temdata = "ht"+temdata + elif temdata[0:3] == "p:/" or temdata[0:3] == "p:\\": + temdata = "htt"+temdata + elif temdata[0:3] == "://" or temdata[0:3] == ":\\\\": + temdata = "http"+temdata + elif temdata[0:2] == "//" or temdata[0:2] == "\\\\": + if temdata[2] == "y": + temdata = "http://www."+temdata[2:] + elif temdata[2] == "w": + temdata = "http:"+temdata + else: + pass + if debug: + print truesender+":"+temdata + arg = temdata + check = temdata.lower() + if check[0:5] == "https": + if len(temporal_list) == 1: + conn.privmsg(targetchannel,sender+" :Secure Youtube does NOT exist") + break + else: + temporal_list2.append("Secure Youtube does NOT exist") + break + else: + if cache_youtube_links == True: + result = YTCV2(arg) + else: + result = YTCV2(arg,0) + if type(result) == str: + ### To remove =" + if result[0:4] == 'nt="': + result = result[4:] + pass + elif result[0:2] == '="': + result = result[2:] + pass + else: + pass + if """ in result: + result.replace(""",'"') + if len(temporal_list) == 1: + conn.privmsg(targetchannel,sender+" : "+result) + break + else: + temporal_list2.append(result) + else: + if len(temporal_list) == 1: + conn.privmsg(targetchannel,sender+" : The video does not exist") + break + else: + temporal_list2.append("The video does not exist") + if len(temporal_list) == 1: + pass + else: + conn.privmsg(targetchannel,sender+" : "+str(reduce(lambda x,y: x+" :-And-: "+y,temporal_list2))) + elif RegExpCheckerForWebPages("((http://)|(https://))|([a-zA-Z0-9]+[.])|([a-zA-Z0-9](3,)\.+[a-zA-Z](2,))",influx,1): + arg2 = RegExpCheckerForWebPages("(http://)|([a-zA-Z0-9]+[.])|([a-zA-Z0-9](3,)\.+[a-zA-Z](2,))",influx,0) + if arg2 == 404: + pass + else: + if arg2[:7] == "http://": + pass + elif arg2[:4] == "www.": + arg2 = "http://"+arg2 + else: + arg2 = "http://"+arg2 + try: + arg = Whoopshopchecker.TitleCheck(arg2) + if len(arg2) == 0: + pass + else: + conn.privmsg(targetchannel,sender+" : "+arg) + except: + #conn.privmsg(targetchannel,sender+" : An odd error occurred") + pass + elif respond_of_course and "take over the" in influx.lower() or respond_of_course and "conquer the" in influx.lower(): + if debug: + print truesender+"::"+influx + conn.privmsg(targetchannel,"Of course!") + elif respond_khan and "khan" in influx.lower(): + if respond_khan: + if debug: + print truesender+"::"+influx + if "khan " in influx.lower(): + conn.privmsg(targetchannel,"KHAAAAAAN!") + elif " khan" in influx.lower(): + conn.privmsg(targetchannel,"KHAAAAAN!") + elif influx.lower() == "khan": + conn.privmsg(targetchannel,"KHAAAAAAAAAN!") + elif influx.lower() == "khan?": + conn.privmsg(targetchannel,"KHAAAAAAAAAAAAAN!") + elif influx.lower() == "khan!": + conn.privmsg(targetchannel,"KHAAAAAAAAAAAAAAAAAAN!") + elif respond_khan and influx.lower().count("k") + influx.lower().count("h") + influx.lower().count("a") + influx.lower().count("n") + influx.lower().count("!") + influx.lower().count("?") == len(influx): + if "k" in influx.lower() and "h" in influx.lower() and "a" in influx.lower() and "n" in influx.lower(): + if debug: + print truesender+"::"+influx + conn.privmsg(targetchannel,"KHAAAAN!") + elif influx.split(" ")[0].lower() in ["thanks","danke","tack"] and len(influx.split(" ")) > 1 and influx.split(" ")[1].lower().replace("!","").replace("?","").replace(".","").replace(",","") in SName+[lowname]: + conn.privmsg(targetchannel,"No problem %s" %(sender)) + elif "happy birthday" in influx.lower() and birthday_announced == time.gmtime(time.time())[0]: + conn.privmsg(targetchannel,sender+" : Thanks :)") + elif influx.split(" ")[0].lower().replace(",","").replace(".","").replace("!","").replace("?","") in SName+[lowname] and "call me" in influx.lower(): + if allow_callnames == True: + arg = influx.split(" ") + arg2 = False + arg3 = [] + for i in arg: + if arg2 == True: + arg3.append(i) + elif i.lower() == "me": + arg2 = True + arg3 = " ".join(arg3) + truesender_lower = truesender.lower() + arg3_lower = arg3.lower() + tell_checker = Namecheck.Namecheck(arg3_lower,users,truesender) + for name in replacenames.values(): + if arg3_lower == name.lower(): + tell_checker = True + break + else: + pass + if tell_checker == True: + conn.privmsg(targetchannel,sender+" : I can't call you that, I know someone else by that name") + elif len(arg3) > call_me_max_length: + conn.privmsg(targetchannel,sender+" : I cannot call you that, Too long of a name.") + pass + else: + replacenames[truesender] = arg3 + with open("replacenames.cache","w") as pickle_save: + pickle.dump(replacenames,pickle_save) + conn.privmsg(targetchannel,sender+" : Calling you "+arg3+" From now on") + else: + conn.privmsg(targetchannel,sender+" : Sorry, I am not allowed to do that.") + elif influx.split(" ")[0].lower().replace(",","").replace(".","").replace("?","").replace("!","") in SName+[lowname] and "your birthday" in influx.lower() and "is your" in influx.lower(): + conn.privmsg(targetchannel,sender+" : My birthday is on the 15th day of December.") + elif influx.split(" ")[0].lower().replace(",","") in SName+[lowname] and "version" in influx.replace("?","").replace("!","").lower().split(" "): + if debug == True: + print truesender+"::%s Version" %(Name) + conn.privmsg(targetchannel,sender+", My version is "+pregen) + elif influx.split(" ")[0].lower().replace(",","") in SName+[lowname] and influx.lower().count(" or ") > 0 and len(influx.split(" ")[1:]) <= influx.lower().count("or") * 3: + cut_down = influx.lower().split(" ") + arg = [] + count = -1 + for i in cut_down: + count += 1 + try: + if cut_down[count+1] == "or": + arg.append(i) + + except: + pass + try: + if i not in arg and cut_down[count-1] == "or": + arg.append(i) + except: + pass + try: + conn.privmsg(targetchannel,random.choice(arg).capitalize().replace("?","").replace("!","")) + except IndexError: + # arg is empty, whORe etc. + pass + elif influx.lower()[0:len(Name)] == lowname and influx.lower()[-1] == "?" and influx.count(" ") > 1 and "who started you" in influx.lower() or \ + influx.split(" ")[0].lower().replace(",","") in SName and influx.lower()[-1] == "?" and "who started you" in influx.lower(): + conn.privmsg(targetchannel,sender+" : I was started by %s"%(os.getenv("USER"))+" on "+time.strftime("%d.%m.%Y at %H:%M:%S",time.gmtime(uptime_start))) + elif influx.lower()[0:len(Name)] == lowname and influx.lower()[-1] == "?" and influx.count(" ") > 1 or \ + influx.split(" ")[0].lower().replace(",","") in SName and influx.lower()[-1] == "?" and influx.count(" ") > 1: + dice = random.randint(0,1) + if dice == 0: + conn.privmsg(targetchannel,sender+" : "+C_eightball.eightball(influx.lower(),debug,truesender,prefix)) + else: + if highlights: + conn.privmsg(targetchannel,sender+" : "+C_sarcasticball.sarcasticball(influx.lower(),debug,truesender,users,prefix)) + else: + conn.privmsg(targetchannel,sender+" : "+C_sarcasticball.sarcasticball(influx.lower(),debug,truesender,nonhighlight_names,prefix)) + elif influx.lower()[0:len(Name)] == lowname and not influx.lower()[len(Name):].isalpha() or \ + influx.split(" ")[0].lower().replace(",","") in SName and not influx.lower()[len(influx.split(" ")[0].lower()):].isalpha(): + conn.privmsg(targetchannel, random.choice(["Yea?","I'm here","Ya?","Yah?","Hm?","What?","Mmhm, what?","?","What now?","How may I assist?"])) + comboer = truesender + comboer_time = time.time() + elif influx.lower()[-1] == "?" and comboer == truesender and looptime - discard_combo_messages_time < comboer_time: + comboer = "" + dice = random.randint(0,1) + if dice == 0: + conn.privmsg(targetchannel,sender+" : "+C_eightball.eightball(influx.lower(),debug,truesender,prefix)) + else: + if highlights: + conn.privmsg(targetchannel,sender+" : "+C_sarcasticball.sarcasticball(influx.lower(),debug,truesender,users,prefix)) + else: + conn.privmsg(targetchannel,sender+" : "+C_sarcasticball.sarcasticball(influx.lower(),debug,truesender,nonhighlight_names,prefix)) + + elif influx.lower() == prefix+"tm": + if truesender in operators and targetchannel==channel: + marakov = not marakov + conn.privmsg(targetchannel,sender+" : Marakov Output is now "+str(marakov)) + else: + conn.privmsg(targetchannel,sender+" : I can't let you access that") + elif personality_greeter == True and True in map(lambda x: x in influx.lower(),["greetings","afternoon","hi","hey","heya","hello","yo","hiya","howdy","hai","morning","mornin'","evening", "night","night", "evening","'sup","sup","hallo","hejssan"]): + if comboer != "" and looptime - discard_combo_messages_time > comboer_time: + combo_check = sbna(["greetings","afternoon","hi","hey","heya","hello","yo","hiya","howdy","hai","morning","mornin'","evening", "night","night", "evening","'sup","sup","hallo","hejssan","all night"], #ONLY ONE OF THESE + ["greetings","afternoon","hi","hey","heya","hello","yo","hiya","howdy","hai","morning","mornin'","evening", "night","night", "evening","'sup","sup","hallo","hejssan"], #ATLEAST ONE OF THESE + influx.lower()) + else: + combo_check = sbna(SName+[lowname, + #lowname+".",lowname+"!",lowname+"?", + "everybody", + #"everybody!","everybody?", + "everyone", + #"everyone!","everyone?", + "all", + #"all!","all?" + "all night", + ], #ONLY ONE OF THESE + ["greetings","afternoon","hi", + #"hi,", + "hey","heya","hello","yo","hiya","howdy","hai","morning","mornin'","evening", "night","night", "evening","'sup","sup","hallo","hejssan"], #ATLEAST ONE OF THESE + influx.lower().replace(",","").replace(".","").replace("!","")) + if combo_check: + combo_check = False + comboer = "" + if "evening" in influx.lower() and "all" in influx.lower() and len(influx.lower().split(" ")) > 3: + pass + elif truesender not in operators: + if debug: + print truesender+"::"+influx + dice = random.randint(0,19) + if dice == 0: + conn.privmsg(targetchannel,"Well hello to you too "+sender) + elif dice == 1: + if optimize_greeting == False: + hours = time.strftime("%H") + #time.strftime("%H:%M:%S") == 12:28:41 + hours = int(hours) + if hours in xrange(0,12): + conn.privmsg(targetchannel,"Good Morning "+sender) + elif hours in xrange(12,15): + conn.privmsg(targetchannel,"Good Afternoon "+sender) + elif hours in xrange(15,20): + conn.privmsg(targetchannel,"Good Evening "+sender) + else: + conn.privmsg(targetchannel,"Good Night "+sender) + else: + hours = time.strftime("%H") + hours = int(hours) + if hours in morning: + conn.privmsg(targetchannel,"Good Morning "+sender) + elif hours in afternoon: + conn.privmsg(targetchannel,"Good Afternoon "+sender) + elif hours in evening: + conn.privmsg(targetchannel,"Good Evening "+sender) + else: + conn.privmsg(targetchannel,"Good Night "+sender) + elif dice == 2: + conn.privmsg(targetchannel,"Hello!") + elif dice == 3: + conn.privmsg(targetchannel,"Hey "+sender) + elif dice == 4: + conn.privmsg(targetchannel,"Hi "+sender) + elif dice == 5: + conn.privmsg(targetchannel,"Hello "+sender) + elif dice == 6: + conn.privmsg(targetchannel,"Yo "+sender) + elif dice == 7: + conn.privmsg(targetchannel,"Greetings "+sender) + elif dice == 8: + conn.privmsg(targetchannel,"Hi") + elif dice == 9: + conn.privmsg(targetchannel,"Hi!") + elif dice == 10: + conn.privmsg(targetchannel,"Yo") + elif dice == 11: + conn.privmsg(targetchannel,"Yo!") + elif dice == 12: + conn.privmsg(targetchannel,"Heya") + elif dice == 13: + conn.privmsg(targetchannel,"Hello there!") + elif dice == 14: # Richard + conn.privmsg(targetchannel,"Statement: Greetings meatbag") + elif dice == 15: # Richard + hours = int(time.strftime("%H")) + if hours in xrange(5,12): + conn.privmsg(targetchannel,"What are you doing talking at this time of the morning?") + elif hours in xrange(12,15): + conn.privmsg(targetchannel,"What are you doing talking at this time of the day?") + elif hours in xrange(15,22): + conn.privmsg(targetchannel,"What are you doing talking at this time of the evening?") + else: + conn.privmsg(targetchannel,"What are you doing talking at this time of the night?") + elif dice == 16: # Richard + conn.privmsg(targetchannel,"Oh, you're still alive I see.") + elif dice == 17: + conn.privmsg(targetchannel,"Heya "+sender) + elif dice == 18 and time.gmtime(time.time())[1] == 12 and time.gmtime(time.time())[2] == 15: + conn.privmsg(targetchannel,"Hello! It's my birthday!") + else: + conn.privmsg(targetchannel,"Hiya "+sender) + secdice = random.randint(0,10) + if time.gmtime(time.time())[1] == 12 and time.gmtime(time.time())[2] == 15 and birthday_announced < time.gmtime(time.time())[0]: + birthday_announced = time.gmtime(time.time())[0] + conn.privmsg(channel,"Hey everybody! I just noticed it's my birthday!") + time.sleep(0.5) + tag = random.choice(["birthday","robot+birthday","happy+birthday+robot"]) + arg1 = urllib2.urlopen("http://www.youtube.com/results?search_query=%s&page=&utm_source=opensearch"%tag) + arg1 = arg1.read().split("\n") + arg2 = [] + for i in arg1: + if "watch?v=" in i: + arg2.append(i) + arg3 = random.choice(arg2) + + conn.privmsg(channel,"Here's a video of '%s' which I found! %s (%s)"%(tag.replace("+"," "),"http://www.youtube.com"+arg3[arg3.find('/watch?v='):arg3.find('/watch?v=')+20],YTCV2("http://www.youtube.com"+arg3[arg3.find('/watch?v='):arg3.find('/watch?v=')+20]))) + if truesender.lower() in tell_list.keys(): + try: + conn.privmsg(channel, "Also, "+truesender+" : "+tell_list[truesender.lower()][0]) + del(tell_list[truesender.lower()][0]) + except: + pass + else: + dice = random.randint(0,1) + if dice == 0: + conn.privmsg(targetchannel,"Greetings Master "+sender) + elif dice == 1: + conn.privmsg(targetchannel,"My deepest greetings belong to you, Master "+sender) + ### IMPORTANT ### + elif influx == "☺VERSION☺": + conn.notice(truesender,"\001VERSION nanotrasen:2:Python 2.6\001") + elif marakov and influx.lower() == prefix+"marakov": + arg = Marakov_Chain.form_sentence() + if len(arg) < 5: + conn.privmsg(targetchannel,sender+" : Not enough words harvested") + else: + conn.privmsg(targetchannel,sender+" : %s" %(" ".join(arg).capitalize())) + elif marakov and cocheck( prefix+ "marakov"): + try: + arg = influx.split(" ")[1].lower() + except: + conn.privmsg(targetchannel,sender+" : Please input a valid second argument") + else: + arg2 = Marakov_Chain.form_sentence(arg) + if len(arg2) < 5: + conn.privmsg(targetchannel,sender+" : Not enough words harvested for a sentence starting with %s" %(arg)) + else: + conn.privmsg(targetchannel,sender+" : %s" %(" ".join(arg2).capitalize())) + else: + Marakov_Chain.give_data(influx) + autodiscusscurtime = backup + if time.time() - looptime == 0: + pass + else: + print "Took",time.time()-looptime,"Seconds to finish loop" + + elif data [ 1 ] [ 0 ] == '353': + if connected == False: + connected = True + users = map(lambda x: x[1:] if x[0] == "+" or x[0] == "@" else x,data[1][4].split(" ")) + print "There are",len(users),"Users on",channel + operators = [] + for potential_operator in data[1][4].split(" "): + if potential_operator[0] == "@": + operators.append(potential_operator[1:]) + elif potential_operator[0] == "%": + halfoperators.append(potential_operator[1:]) + + elif data[1][0] == "QUIT": + sender = data[0].split("!")[0] + print sender+" Has now left the server" + try: + users.remove(sender) + try: + operators.remove(sender) + except ValueError: + pass + try: + halfoperators.remove(sender) + except ValueError: + pass + except ValueError: + pass + elif data[1][0] == "PART": + sender = data[0].split("!")[0] + targetchannel = data[1][1] + print sender+" Has now parted from the channel" + try: + users.remove(sender) + try: + operators.remove(sender) + except ValueError: + pass + try: + halfoperators.remove(sender) + except ValueError: + pass + except ValueError: + pass + elif data[1][0] == "JOIN": + sender = data[0].split("!")[0] + targetchannel = data[1][1] + if sender.lower() in tell_list.keys(): + try: + conn.privmsg(targetchannel, sender+" : "+" | ".join(tell_list[sender.lower()])) + del(tell_list[sender.lower()]) + except: + pass + for useri,nicki in replacenames.items(): + checkers = Namecheck.Namecheck_dict(sender.lower(),replacenames) + if checkers[0]: + try: + if checkers[0].lower() == sender: + pass + else: + conn.privmsg(targetchannel,checkers[1]+" : I have detected a collision with a name I call you and %s who joined" %(sender)) + del(replacenames[checkers[1]]) + with open("replacenames.cache","w") as pickle_save: + pickle.dump(replacenames,pickle_save) + except AttributeError: + #conn.privmsg(channel,"NAME COLLISION CHECK ERROR, RELATED TO %s" %(sender)) + print "NAME COLLISION CHECK ERROR, RELATED TO %s" %(sender) + break + print sender+" Has now joined" + users.append(sender) + ##### + if ".fi" in data[0] and sender.lower() == "skibiliano": + operators.append(sender) + if sender.lower() not in peopleheknows[0]: + if data[0].split("!")[1] in peopleheknows[1]: + appendion = "...you do seem familiar however" + else: + appendion = "" + if data[1][1].lower() == channel or data[1][1].lower() == channel[1:]: + conn.privmsg(data[1][1],CORE_DATA.greeting.replace("USER",sender)+" "+appendion) + else: + conn.privmsg(data[1][1],"Hello! Haven't seen you here before! Happy to meet you! %s" %(appendion)) + peopleheknows[0].append(sender.lower()) + peopleheknows[1].append(data[0].split("!")[1]) + with open("peopleheknows.cache","w") as peoplehecache: + pickle.dump(peopleheknows,peoplehecache) + + elif data[1][0] == "MODE" and data[1][2] == "+o": + sender = data[1][3] + targetchannel = data[1][1] + if targetchannel == channel: + print sender+" Is now an operator on the main channel" + operators.append(sender) + else: + print sender+" Is now an operator" + elif data[1][0] == "MODE" and data[1][2] == "-o": + sender = data[1][3] + targetchannel = data[1][1] + if targetchannel == channel: + print sender+" Is no longer an operator on the main channel" + else: + print sender+" Is no longer an operator" + try: + operators.remove(sender) + except ValueError: + pass + elif data[1][0] == "MODE" and data[1][2] == "+h": + sender = data[1][3] + print sender+" Is now an half operator" + halfoperators.append(sender) + elif data[1][0] == "MODE" and data[1][2] == "-h": + try: + halfoperators.remove(sender) + except ValueError: + pass + elif data[1][0] == "MODE" and data[1][1] == Name: + print "My mode is",data[1][2] + elif data[1][0] == "MODE" and data[1][1] != Name: + try: + sender = data[1][3] + print sender,"Was modified",data[1][2] + except IndexError: + print "SENDER RETRIEVAL FAILED:"+str(data) + elif data[1][0] == "KICK" and data[1][2] == Name: + disconnects = 99999 + print "I have been kicked! Disconnecting entirely!" + conn.quit() + elif data[1][0] == "KICK": + # data[1][0] = Kick, 1 = Channel, 2 = Who, 3 = Who(?) + print data[1][2]+" got kicked!" + elif data[1][0] == "451" and data[1][2] == "You have not registered": + print Name+" hasn't been registered" + elif data[1][0] == "NOTICE": + sender = data[0].split("!")[0] + print "NOTICE (%s): %s" %(sender,data[1][2]) + pongtarget = sender + elif data[1][0] == "NICK": + origname = data[0].split("!")[0] + newname = data[1][1] + print origname,"Is now",newname + if newname.lower() in tell_list.keys(): + try: + conn.privmsg(channel, newname+" : "+tell_list[newname.lower()][0]) + del(tell_list[newname.lower()][0]) + except: + pass + try: + users.remove(origname) + except ValueError: + pass + else: + users.append(newname) + try: + operators.remove(origname) + except ValueError: + pass + else: + operators.append(newname) + try: + halfoperators.remove(origname) + except ValueError: + pass + else: + halfoperators.append(newname) + + elif data[1][0] == "001": + # Skibot is welcomed to the Network + pass + elif data[1][0] == "002": + # Your host is... + pass + elif data[1][0] == "003": + #Server was created... + pass + elif data[1][0] == "004": + #Weird hex? + pass + elif data[1][0] == "005": + #Settings like NICKLEN and so on. + pass + elif data[1][0] == "250": + #data[1][2] is + #"Highest connection count: 1411 (1410 clients) + #(81411 connections received)" + pass + elif data[1][0] == "251": + #There are 23 users and 2491 invisible on 10 servers + pass + elif data[1][0] == "252": + #IRC Operators online + #data[1][2] + print data[1][2],"Irc operators online" + pass + elif data[1][0] == "253": + # ['253', 'Skibot_V4', '1', 'unknown connection(s)'] + print data[1][2],"Unknown connection(s)" + pass + elif data[1][0] == "254": + #1391 channels formed + pass + elif data[1][0] == "255": + #I have 406 clients and 2 servers + pass + elif data[1][0] == "265": + #data[1][2] current local users + #data[1][3] at max + try: + print "Current local users:", data[1][2],"/",data[1][3] + except IndexError: + print "Couldn't retrieve local users" + pass + elif data[1][0] == "266": + #data[1][2] current global users + #data[1][3] at max + try: + print "Current global users:", data[1][2],"/",data[1][3] + except IndexError: + print "Couldn't retrieve global users" + pass + elif data[1][0] == "315": + #End of /who list + pass + elif data[1][0] == "332": + # Topic of channel + topic = data[1][3] + pass + elif data[1][0] == "333": + # *Shrug* + pass + elif data[1][0] == "352": + #WHO command + + if len(targetlist) > 0: + if targetlist[0][0].lower() in data[1][6].lower(): + thread.start_new_thread(target,("*!*@"+data[1][4],targetlist[0][1])) + print "Created a thread with", "*!*@"+data[1][4],targetlist[0][1] + targetlist.pop(0) + else: + print targetlist[0][0].lower(), "isn't equal to?", data[1][6].lower() + print targetlist + + elif data[1][0] == "366": + # End of USERS + pass + elif data[1][0] == "372": + # Server information + pass + elif data[1][0] == "375": + # Message of the day + pass + elif data[1][0] == "376": + # End of motd + pass + elif data[1][0] == "401": + # ('network', ['401','Botname','Channel / Nick','No such nick/channel']) + print data[1][2] + " Channel does not exist" + pass + elif data[1][0] == "439": + # ('irc.rizon.no', ['439', '*', 'Please wait while we process your connection.']) + pongtarg = data[0][0] + elif data[1][0] == "477": + # You need to be identified + #TAG + conn.privmsg("nickserv","identify %s"%CORE_DATA.le_pass) + time.sleep(0.5) + conn.join(data[1][2]) + #('network', ['477', 'botname', '#channel', 'Cannot join channel (+r) - you need to be identified with services']) + + elif data[1][0] == "433": + # Skibot name already exists. + print Name+" name already exists." + Name += "_"+version + print "New name:",Name + duplicate_notify = True + conn = irchat.IRC ( Network, Port, Name, "NT_"+version, "NT_"+version, "Trasen_"+version ) + for i in CORE_DATA.channels: + conn.join(i) + sleep(0.5) + elif data[1][0] == "482": + sleep(0.05) + conn.privmsg(targetchannel,"Nevermind that, I am not an operator") + CALL_OFF = True + elif data[1] == ["too","fast,","throttled."]: + print "Reconnected too fast." + print "Halting for 2 seconds" + sleep(2) + elif data[1][0] == "Link": + if data[0] == "Closing": + print "Link was closed" + connected = False +# conn.quit() +# break + else: + print data + print data[1][0] + pass + else: + if disconnects > 9000: #IT'S OVER NINE THOUSAAAAND! + break + else: #WHAT NINE THOUSAND? THERE'S NO WAY THAT CAN BE RIGHT + sleep(responsiveness_delay) #WAIT A WHILE AND CHECK AGAIN! + try: + if not connected: + #print pongtarget + #print conn.addressquery() + conn.privmsg(pongtarget,"Pong") + sleep(1) + for i in CORE_DATA.channels: + conn.join(i) + sleep(0.5) + print "Attempted to join" + connected = True + except ValueError: + try: + conn.privmsg(conn.addressquery()[0],"Pong") + sleep(1) + for i in CORE_DATA.channels: + conn.join(i) + sleep(0.5) + print "Attempted to join the second time" + connected = True + except ValueError: + print "Both methods failed" + except AttributeError: + print "Conn is not established correctly" + except NameError: + print "Pongtarget isn't yet established" + try: + conn.privmsg(conn.addressquery()[0],"Pong") + sleep(1) + for i in CORE_DATA.channels: + conn.join(i) + sleep(0.5) + print "Attempted to join the second time" + connected = True + except: + print "Both methods failed" diff --git a/bot/Shortname.py b/bot/Shortname.py new file mode 100644 index 0000000000..ae8ac473b8 --- /dev/null +++ b/bot/Shortname.py @@ -0,0 +1,28 @@ +def shortname(name): + lowname = name.lower() + numb = 0 + count = 0 + spot = 0 + for letter in name: + if letter.isupper(): + spot = numb + count += 1 + numb += 1 + if "_" in name: + if name.count("_") > 1: + name = " ".join(name.split("_")[0:name.count("_")]) + if name.lower()[-3:] == "the": + return name[:-4] + else: + return name + else: + return name.split("_")[0] + if count > 1: + if len(name[0:spot]) > 2: + return name[0:spot] + if len(name) < 5: + return name #Too short to be shortened + elif "ca" in lowname or "ct" in lowname or "tp" in lowname or "lp" in lowname: + return name[0:max(map(lambda x: lowname.find(x),["ca","ct","tp","lp"]))+1] + else: + return name[0:len(name)/2+len(name)%2] diff --git a/bot/Timeconverter.py b/bot/Timeconverter.py new file mode 100644 index 0000000000..a39f821c84 --- /dev/null +++ b/bot/Timeconverter.py @@ -0,0 +1,204 @@ +#Sources: +# http://wwp.greenwichmeantime.com/time-zone/usa/eastern-time/convert/ +# http://www.timeanddate.com/library/abbreviations/timezones/na/ +# Times are GMT +- x +# For eq. +# EST = -5 +# GMT = 0 +# UTC = 0 +#Times are in hours, +#2.5 = 2 and half hours +global times +times = {"ADT":-3,"HAA":-3, #Synonyms on the same line + "AKDT":-8,"HAY":-8, + "AKST":-9,"HNY":-9, + "AST":-4,"HNA":-4, + "CDT":-5,"HAC":-5, + "CST":-6,"HNC":-6, + "EDT":-4,"HAE":-4, + "EGST":0, + "EGT":-1, + "EST":-5,"HNE":-5,"ET":-5, + "HADT":-9, + "HAST":-10, + "MDT":-6,"HAR":-6, + "MST":-7,"HNR":-7, + "NDT":-2.5,"HAT":-2.5, + "NST":-3.5,"HNT":-3.5, + "PDT":-7,"HAP":-7, + "PMDT":-2, + "PMST":-3, + "PST":-8,"HNP":-8,"PT":-8, + "WGST":-2, + "WGT":-3, + "GMT":0, + "UTC":0} +def converter(zones,time): + #Zones should be a list containing + # ( From zone + # To zone ) + global times + #from_z = for example UTC+00:00, WGT or GMT-05:30 + #to_z = same style as above. + from_z,to_z = zones + from_z = from_z.upper() + to_z = to_z.upper() + if from_z.find("+") != -1: + from_zone_offset = from_z[from_z.find("+"):] + if ":" in from_zone_offset: + try: + from_zone_offset1,from_zone_offset2 = from_zone_offset.split(":") + except ValueError: + return "Too many or too small amount of values" + try: + from_zone_offset = int(from_zone_offset1) + int(from_zone_offset2)/60.0 + except: + return "Error, the 'From Zone' variable has an incorrect offset number" + else: + try: + from_zone_offset = float(from_zone_offset) + except: + return "Error, the 'From Zone' variable has an incorrect offset number" + try: + from_zone_realtime = from_zone_offset + times[from_z[:from_z.find("+")]] + except KeyError: + return "Incorrect From zone" + + elif "-" in from_z: + from_zone_offset = from_z[from_z.find("-"):] + if ":" in from_zone_offset: + from_zone_offset1,from_zone_offset2 = from_zone_offset.split(":") + try: + from_zone_offset = -int(from_zone_offset1) + int(from_zone_offset2)/60.0 + except: + return "Error, the 'From Zone' variable has an incorrect offset number" + else: + try: + from_zone_offset = -float(from_zone_offset) + except: + return "Error, the 'From Zone' variable has an incorrect offset number" + from_zone_realtime = times[from_z[:from_z.find("-")]] - from_zone_offset + pass + else: + from_zone_offset = 0 + try: + from_zone_realtime = from_zone_offset + times[from_z] + except KeyError: + return "Incorrect From zone" + if to_z.find("+") != -1: + to_zone_offset = to_z[to_z.find("+"):] + if ":" in to_zone_offset: + try: + to_zone_offset1,to_zone_offset2 = to_zone_offset.split(":") + except ValueError: + return "Too many or too small amount of values" + try: + to_zone_offset = int(to_zone_offset1) + int(to_zone_offset2)/60.0 + except: + return "Error, the 'To Zone' variable has an incorrect offset number" + else: + try: + to_zone_offset = float(to_zone_offset) + except: + return "Error, the 'To Zone' variable has an incorrect offset number" + try: + to_zone_realtime = to_zone_offset + times[to_z[:to_z.find("+")]] + except KeyError: + return "The zone you want the time to be changed to is not found" + + elif "-" in to_z: + to_zone_offset = to_z[to_z.find("-"):] + if ":" in to_zone_offset: + to_zone_offset1,to_zone_offset2 = to_zone_offset.split(":") + try: + to_zone_offset = -int(to_zone_offset1) + int(to_zone_offset2)/60.0 + except: + return "Error, the 'To Zone' variable has an incorrect offset number" + else: + try: + to_zone_offset = -float(to_zone_offset) + except: + return "Error, the 'To Zone' variable has an incorrect offset number" + to_zone_realtime = times[to_z[:to_z.find("-")]] -to_zone_offset + + pass + else: + to_zone_offset = 0 + try: + to_zone_realtime = to_zone_offset + times[to_z] + except KeyError: + return "Incorrect To zone" + try: + time_hour,time_minute = time.split(":") + time_hour,time_minute = int(time_hour),int(time_minute) + string = ":" + except: + try: + time_hour,time_minute = time.split(".") + time_hour,time_minute = int(time_hour),int(time_minute) + string = "." + except ValueError: + return "The time was input in an odd way" + if to_zone_realtime % 1.0 == 0.0 and from_zone_realtime % 1.0 == 0.0: + time_hour = time_hour + (to_zone_realtime - from_zone_realtime) + return str(int(time_hour))+string+str(int(time_minute)) + else: + if to_zone_realtime % 1.0 != 0.0 and from_zone_realtime % 1.0 != 0.0: + time_minute = time_minute + (((to_zone_realtime % 1.0) * 60) - ((from_zone_realtime % 1.0) * 60)) + elif to_zone_realtime % 1.0 != 0.0 and from_zone_realtime % 1.0 == 0.0: + time_minute = time_minute + (((to_zone_realtime % 1.0) * 60) - 0) + elif to_zone_realtime % 1.0 == 0.0 and from_zone_realtime % 1.0 != 0.0: + time_minute = time_minute + (0 - ((from_zone_realtime % 1.0) * 60)) + else: + print "Wut?" + time_hour = time_hour + (int(to_zone_realtime//1) - int(from_zone_realtime//1)) + return str(int(time_hour))+string+str(int(time_minute)) + + +def formatter(time): + if "." in time: + string = "." + elif ":" in time: + string = ":" + else: + return time + hours,minutes = time.split(string) + days = 0 + if int(minutes) < 0: + buphours = int(hours) + hours,minutes = divmod(int(minutes),60) + hours += buphours + if int(minutes) > 60: + hours,minutes = divmod(int(minutes),60) + hours += int(hours) + if int(hours) < 0: + days = 0 + days,hours = divmod(int(hours),24) + if int(hours) > 24: + days = 0 + days,hours = divmod(int(hours),24) + if int(hours) == 24 and int(minutes) > 0: + days += 1 + hours = int(hours) - 24 + hours = str(hours) + minutes = str(minutes) + if len(minutes) == 1: + minutes = "0"+minutes + if len(hours) == 1: + hours = "0"+hours + if days > 0: + if days == 1: + return hours+string+minutes+" (Tomorrow)" + else: + return hours+string+minutes+" (After "+str(days)+" days)" + elif days < 0: + if days == -1: + return hours+string+minutes+" (Yesterday)" + else: + return hours+string+minutes+" ("+str(abs(days))+" days ago)" + return hours+string+minutes + + + + + diff --git a/bot/Weather.py b/bot/Weather.py new file mode 100644 index 0000000000..1fb786e8f4 --- /dev/null +++ b/bot/Weather.py @@ -0,0 +1,61 @@ +# -*- coding: cp1252 -*- +import urllib,xml.sax.handler +# S10 COMPATIABLE +def message(data): + if data["type"] == "PRIVMSG": + try: + splitdata = data["content"].lower().split(" ") + if splitdata[0] == ":weather" and len(splitdata) > 1: + data = Weather(" ".join(splitdata[1:])) + + data["conn"].privmsg(data["target"],"Weather for "+data[1]+": "+data[0]) + return True + except KeyError: + print "WUT" + else: + return -1 +def Weather(question): + question = question.replace("ä","a") + url = "http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query="+question + opener = urllib.FancyURLopener({}) + f = opener.open(url) + data = f.read() + f.close() + bufferi = [] + seen = False + for i in data.split("\n"): + if "" in i: + stuff = cutter(i,"") + if len(stuff) > 7: + bufferi.append("Temperature: "+stuff) + elif "" in i: + stuff = cutter(i,"") + if len(stuff) > 19: + bufferi.append(stuff) + elif "" in i: + stuff = cutter(i,"") + if len(stuff) > 0: + bufferi.append("Weather: "+stuff) + elif "" in i: + stuff = cutter(i,"") + if len(stuff) > 0: + bufferi.append("Humidity: "+stuff) + elif "" in i: + stuff = cutter(i,"") + if len(stuff) > 0: + bufferi.append("Wind blows "+stuff) + elif "" in i: + stuff = cutter(i,"") + if len(stuff) > 9: + bufferi.append("Air pressure is "+stuff) + elif "" in i and seen == False: + seen = True + where = cutter(i,"") + if len(where) == 4: + where = "Location doesn't exist" + return [", ".join(bufferi),where] +def cutter(fullstring,cut): + fullstring = fullstring.replace(cut,"") + fullstring = fullstring.replace(" 11: #Longer than normal, presume troll. + youtube_url.replace(cut_down,cut_down[:11]) + elif len(cut_down) < 11: #Shorter than normal + pass + except IndexError: + return "Reflex: Where's the watch?v=?" + first_two = cut_down[0:2] + try: + if no_absolute_paths: + tiedosto = open("YTCache/"+first_two+".tcc","r") + else: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","r") + except: + prev_dict = {} + else: + try: + prev_dict = pickle.load(tiedosto) + except EOFError: # Cache is corrupt + os.remove(directory+"/nano/"+tiedosto.name) + print "REMOVED CORRUPT CACHE: "+tiedosto.name + prev_dict = {} + tiedosto.close() # I think this should belong here. + if cut_down in prev_dict.keys(): + return prev_dict[cut_down] + else: + pass + try: + if no_absolute_paths: + tiedosto = open("YTCache/"+first_two+".tcc","w") + else: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") + except IOError,error: + if len(prev_dict.keys()) > 0: + try: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") #This is a Just In Case + except IOError: + if did_tell == False: + did_tell = True + return "COULD NOT ACCESS FILE "+first_two+".tcc! The next time you run this link, it checks it through the web" + Do_not_open = False + else: + did_tell = False + pickle.dump(prev_dict,tiedosto) + tiedosto.close() + else: + pass + return "Very odd error occurred: " + str(error) + youtube_url = youtube_url.replace("http//","http://") + if youtube_url.lower()[0:7] != "http://" and youtube_url[0:4] == "www.": + youtube_url = "http://" + youtube_url + if youtube_url.count("/") + youtube_url.count("\\") < 3: + if len(prev_dict.keys()) > 0: + if Do_not_open == True: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") #This is a Just In Case + pickle.dump(prev_dict,tiedosto) + tiedosto.close() + else: + pass + return "Reflex: Video cannot exist" + else: + if "http://" in youtube_url[0:12].lower() and youtube_url[0:7].lower() != "http://": + youtube_url = youtube_url[youtube_url.find("http://"):] + elif youtube_url[0:7].lower() != "http://": + if len(prev_dict.keys()) > 0: + if Do_not_open == True: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") #This is a Just In Case + pickle.dump(prev_dict,tiedosto) + tiedosto.close() + return "Reflex: Incorrect link start" + if "?feature=player_embedded&" in youtube_url: + youtube_url = youtube_url.replace("?feature=player_embedded&","?") + try: + website = urlopen(youtube_url) + except: + if len(prev_dict.keys()) > 0: + if Do_not_open == True: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") #This is a Just In Case + pickle.dump(prev_dict,tiedosto) + tiedosto.close() + else: + pass + return "Reflex: Incorrect link!" + for i in website.readlines(): + if i.count('',contentvar)] + if "&quot;" in result: + result = result.replace("&quot;",'"') + else: + pass + if "&amp;" in result: + result = result.replace("&amp;","&") + else: + pass + if "&#39;" in result: + result = result.replace("&#39;","'") + else: + pass + if Do_not_open == True: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") #This is a Just In Case + prev_dict[cut_down] = result + pickle.dump(prev_dict,tiedosto) + tiedosto.close() + return result + if Do_not_open == True: + tiedosto = open(directory+"YTCache/"+first_two+".tcc","w") #This is a Just In Case + prev_dict[cut_down] = "No title for video, Removed / Needs Age verification / Does not exist" + pickle.dump(prev_dict,tiedosto) + tiedosto.close() + return "No title for video, Removed / Needs age verification / Does not exist" diff --git a/bot/_____Readme.txt b/bot/_____Readme.txt new file mode 100644 index 0000000000..1c56f9ad12 --- /dev/null +++ b/bot/_____Readme.txt @@ -0,0 +1,74 @@ +/// Adminhelp relay IRC bot setup guide +/// CC_Nanotrasen bot created by Skibiliano and distributed under the CC-BY-SA 3.0 license +/// All derivative works of this bot must properly credit Skibiliano as the original author +/// Big thanks to Skibiliano his bot and allowing distribution, and to BS12 for sharing their code for making use of it ingame + +QUESTION: What does this bot do? +ANSWER: It, in conjunction with BYOND, relays adminhelps to a designated channel, along with various extra functions that can be accessed by saying !help in the same channel/in a query with the bot. + +Some basic info before you set this up: +CC_Nanotrasen is coded in python 2.6 and requires a serverside installation of python 2.6 (obtainable at http://www.python.org/getit/releases/2.6/) +- Python MUST BE installed to the same directory as the .dmb you are using to host your server/server config folder +- CC_Nanotrasen supports, but does not require, Psyco (obtainable at http://psyco.sourceforge.net/download.html) which increases the speed 20-30% and slightly increases RAM usage + +Now that that's out of the way, I'll teach you how to set this up. + +BOT CONFIG: +Move everything in this folder (this file noninclusive) to the same folder as the hosting server (where your .dmb, config folder, and python are installed) +Open CORE_DATA.py with a text editor of your choice (recommended to be notepad++ or notepad) +You should see 14 lines of code which look like + Name = "CC_NanoTrasen" #The name he uses to connect + no_absolute_paths = True #Do not change this. + debug_on = False + SName = ["cc","nt","trasen","nano","nanotrasen"] #Other names he will respond to, must be lowercase + DISABLE_ALL_NON_MANDATORY_SOCKET_CONNECTIONS = False + directory = "BOT DIRECTORY GOES HERE/" #make sure to keep the "/" at the end + version = "TG CC-BY-SA 6" + Network = 'irc.server.goes.here' #e.g. "irc.rizon.net" + channel = "#CHANNEL GOES HERE" #what channel you want the bot in + channels = ["#CHANNEL GOES HERE","#ALSO ANOTHER CHANNEL GOES HERE IF YOU WANT"] #same as above + greeting = "Welcome!" #what he says when a person he hasn't seen before joins + prefix = "!" #prefix for bot commands + Port = 7000 +There are some basic comments besides every important config option in here, but I'll summarize them in detail +NAME - The name the bot assumes when it connects to IRC, so in this example it would join the IRC under the nickname "CC_Nanotrasen" +SNAME - A list of secondary names, with commas, that the bot will respond to for commands (for example, this setup will allow the bot to respond to "nt, tell quarxink he's a terrible writer") +DIRECTORY - The directory of the bot files, dmb, python, and config folder IN FORWARD SLASHES, WITH FORWARD SLASH AT THE END(for example, I host my test server from "c:\tgstation\tgstation13\tgstation.dmb" so for me the line would say directory = "c:/tgstation/tgstation13/") +NETWORK - The IRC server it will connect to, such as "irc.rizon.net" +CHANNEL/CHANNELS - what channel the bot will join (channels allows for multiple channel connections, in the same formatting as SName separates nicknames) +GREETING - CC_Nanotrasen will store the names of people it has seen before, but when a nickname joins that it hasn't seen before it will greet that person with whatever message is put in this +PREFIX = What character/string will be placed before commands for the bot (so if you changed this to "$", you would pull up the bot's help menu by saying $help instead of !help) +PORT - What port to connect to for the IRC server (if you are unsure of what port to use, most IRC clients will show you what port you are connecting to) + +Once you have that ready, you're on to step two. +Open up the config folder in your install dir, and open config.txt +Scroll to the bottom, right below #FORBID_SINGULO_POSSESSION should be + ##Remove the # mark if you are going to use the SVN irc bot to relay adminhelps + #USEIRCBOT +Just remove the "#" in front of USEIRCBOT (you don't even have to recompile your DMB! + +Got that all ready to go? Good, it's time for step three. +Open Dream Daemon (that thing you use when you host) +On the bottom of the window you should see port, security, and visibility. +Change security to "Trusted" + +Congratulations, you've set up this bot! +A few things to note as far as features: +Use !help to list most commands for the bot. +You can leave notes for other users! Just say "[bot name], tell [other user's name] [message]" + So let's say you wonder if I'm going to jump in to your IRC ever and you want to tell me this readme was horrible, you would say "Nano, tell Quarxink Your readme was horrible" + +TROUBLESHOOTING: +Attempting to run the bot gives me an error about encoding.utf-8. + You've probably installed python to a separate folder than the bot/server, move python's files over and it should run fine + +It's telling me connection refused when someone adminhelps. + You've moved the bot to a separate folder from the nudge script, most likely. + +BYOND asks me on any restart if I want to allow nudge.py to run. + Set security to trusted in Dream Daemon + + + + +If you have any requests, suggestions, or issues not covered by this guide, I can be contacted as Quarxink at #coderbus on irc.rizon.net (If I don't respond, leave me a query with your problem and how to reach you [preferably an email address, steam, other irc channel, or aim/msn]) \ No newline at end of file diff --git a/bot/gen_fml.py b/bot/gen_fml.py new file mode 100644 index 0000000000..358fac8700 --- /dev/null +++ b/bot/gen_fml.py @@ -0,0 +1,15 @@ +from FMLformatter import formatter +from urllib2 import urlopen +try: + from hashlib import md5 +except: + from md5 import md5 +from save_load import save,load +import CORE_DATA +directory = CORE_DATA.directory +FML = urlopen("http://www.fmylife.com/random") +formatted = formatter(FML.read().split("\n")) +for Quote in formatted: + exact = Quote[:Quote.find("#")] +# print exact + save(directory+"fmlquotes/"+md5(exact).hexdigest()+".txt",exact) diff --git a/bot/htmltagremove.py b/bot/htmltagremove.py new file mode 100644 index 0000000000..c9d13086d5 --- /dev/null +++ b/bot/htmltagremove.py @@ -0,0 +1,28 @@ +def htr(data): + ignore = False + if type(data) == list: + b = [] + for olio in data: + tempolio = "" + for letter in olio: + if letter == "<": + ignore = True + else: + pass + if ignore != True: + tempolio += letter + else: + pass + if letter == ">": + ignore = False + else: + pass + tempolio = tempolio.replace("\t","") + if len(tempolio) == 0: + pass + elif len(tempolio.replace(" ","")) == 0: + pass + else: + b.append(tempolio) + #Finetuning + return b diff --git a/bot/irchat.py b/bot/irchat.py new file mode 100644 index 0000000000..46ae2d4caf --- /dev/null +++ b/bot/irchat.py @@ -0,0 +1,94 @@ +import socket +import time +class IRC: + queue = [] + partial = '' + def __init__ ( self, network, port, name, hostName, serverName, realName ): + self.network = network + self.port = port + self.hostName = hostName + self.serverName = serverName + self.realName = realName + self.socket = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) + self.socket.connect ( ( self.network, self.port ) ) + self.address = self.socket.getpeername() + self.nick ( name ) + self.send ( 'USER ' + self.name + ' ' + self.serverName + ' ' + self.hostName + ' :' + self.realName ) + def quit ( self ): + self.send ( 'QUIT' ) + self.socket.close() + def send ( self, text ): + count = 0 + try: + count += 1 + self.socket.send ( text + '\r\n' ) + except: + if count > 10: + time.sleep(1) + self.socket.send(text+'\r\n') + else: + count = 0 + def nick ( self, name ): + self.name = name + self.send ( 'NICK ' + self.name ) + def addressquery(self): + print self.address + aha = socket.gethostbyaddr(str(self.address[0])) + return aha + def recv ( self, size = 2048 ): + commands = self.socket.recv ( size ).split ( '\r\n' ) + if len ( self.partial ): + commands [ 0 ] = self.partial + commands [ 0 ] + self.partial = '' + if len ( commands [ -1 ] ): + self.partial = commands [ -1 ] + self.queue.extend ( commands [ :-1 ] ) + else: + self.queue.extend ( commands ) + def retrieve ( self ): + if len ( self.queue ): + command = self.queue [ 0 ] + self.queue.pop ( 0 ) + return command + else: + return False + def dismantle ( self, command ): + if command: + source = command.split ( ':' ) [ 1 ].split ( ' ' ) [ 0 ] + parameters = command.split ( ':' ) [ 1 ].split ( ' ' ) [ 1: ] + if len(parameters) > 0: + if not len ( parameters [ -1 ] ): + parameters.pop() + if command.count ( ':' ) > 1: + parameters.append(command[command.find(":",command.find(":")+1)+1:]) + return source, parameters + def privmsg ( self, destination, message ): + self.send ( 'PRIVMSG ' + destination + ' :' + message ) + def handshake(self,hexstring): + self.send("PONG :"+hexstring) + def notice ( self, destination, message ): + self.send ( 'NOTICE ' + destination + ' :' + message ) + def join ( self, channel ): + self.send ( 'JOIN ' + channel ) + def part ( self, channel ): + self.send ( 'PART ' + channel ) + def topic ( self, channel, topic = '' ): + self.send ( 'TOPIC ' + channel + ' ' + topic ) + def names ( self, channel ): + self.send ( 'NAMES ' + channel ) + def invite ( self, nick, channel ): + self.send ( 'INVITE ' + nick + ' ' + channel ) + def mode ( self, channel, mode, nick = '' ): + self.send ( 'MODE ' + channel + ' ' + mode + ' ' + nick ) + def banon(self,channel,name): + self.mode(channel,"+b",name) + def banoff(self,channel,name): + self.mode(channel,"-b",name) + def kick ( self, channel, nick, reason = '' ): + self.send ( 'KICK ' + channel + ' ' + nick + ' ' + reason ) + def who ( self, pattern ): + self.send ( 'WHO ' + pattern ) + def whois ( self, nick ): + self.send ( 'WHOIS ' + nick ) + def whowas ( self, nick ): + self.send ( 'WHOWAS ' + nick ) diff --git a/bot/linereader.py b/bot/linereader.py new file mode 100644 index 0000000000..cef804935b --- /dev/null +++ b/bot/linereader.py @@ -0,0 +1,43 @@ +import os +directory = "" +raw = os.listdir(directory) +extract = [] +for i in raw: + if i[-3:] == ".py": + extract.append(i) +toc = 0 +toc3 = 0 +toc2 = 0 +print len(extract),"Files" +lista = [] +for ob in extract: + count3 = 0 + if directory == "": + tiedosto = open(ob,"r") + tiedosto2 = open(ob,"r") + count3 += os.path.getsize(ob) + toc3 += count3 + else: + tiedosto = open(directory+"/"+ob,"r") + tiedosto2 = open(directory+"/"+ob,"r") + count3 += os.path.getsize(directory+"/"+ob) + toc3 += count3 + count = 0 + count2 = 0 + line = tiedosto.readline() + while line != "": + count += 1 + toc += 1 + line = tiedosto.readline() + count2 += len(tiedosto2.read()) + toc2 += count2 + lista.append([count,count2,ob,count3]) + tiedosto.close() + tiedosto2.close() +print toc,"Lines in total" +print toc2,"Letters in total" +print toc3,"Bytes in total" + +for linecount, lettercount, filename, bytecount in lista: + print str(linecount)+" Lines (%s%%) || "%(str(round((float(linecount)/toc)*100,1))),str(lettercount)+" Letters (%s%%) in file " %(str(round((float(lettercount)/toc2)*100,1)))+filename + print str(bytecount) + " Bytes (%s%%) "%(str(round((float(bytecount)/toc3)*100,1))) diff --git a/bot/nudge.py b/bot/nudge.py new file mode 100644 index 0000000000..e39ebc314c --- /dev/null +++ b/bot/nudge.py @@ -0,0 +1,39 @@ +import sys,pickle,socket, CORE_DATA +#def pack(): +# path = "/home/ski/Nanotrasen/message.txt" +# ip = sys.argv[1] +# dictionary = {"ip":ip,"data":1} +# try: +# targetfile = open(path,"r") +# except IOError: +# targetfile = open(path,"w") +# pickle.dump(dictionary,targetfile) +# targetfile.close() +# nudge() +# else: +# targetfile.close() #Professionals, have standards. +# pass +def pack(): + ip = sys.argv[1] + try: + data = sys.argv[2:] #The rest of the arguments is data + except: + data = "NO DATA SPECIFIED" + dictionary = {"ip":ip,"data":data} + pickled = pickle.dumps(dictionary) + nudge(pickled) +def nudge(data): + if CORE_DATA.DISABLE_ALL_NON_MANDATORY_SOCKET_CONNECTIONS: + pass + else: + HOST = "localhost" + PORT = 45678 + size = 1024 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.connect((HOST,PORT)) + s.send(data) + s.close() + +if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument + pack() + diff --git a/bot/save_load.py b/bot/save_load.py new file mode 100644 index 0000000000..34eac99072 --- /dev/null +++ b/bot/save_load.py @@ -0,0 +1,24 @@ +import pickle +def save(filename,data,dnrw=0): + if dnrw == 1: + try: + tiedosto = open(filename,"r") + except: + tiedosto = open(filename,"w") + else: + return False + else: + tiedosto = open(filename,"w") + + if "http//" in data: + data = data.replace("http//","http://") + pickle.dump(data,tiedosto) + tiedosto.close() +def load(filename): + try: + tiedosto = open(filename,"r") + except IOError: + return "ERROR ERROR ERROR ERR" + a = pickle.load(tiedosto) + tiedosto.close() + return a diff --git a/bot/some_but_not_all_2.py b/bot/some_but_not_all_2.py new file mode 100644 index 0000000000..211eef9fd5 --- /dev/null +++ b/bot/some_but_not_all_2.py @@ -0,0 +1,20 @@ +def sbna2(only_one,one_of_these,data): + if type(only_one) != list: + only_one = list(only_one) + if type(data) != list: + data = data.split(" ") + count = 0 + for datoid in only_one: + if datoid in data and count >= 1: + return False + elif datoid in data: + count += 1 + pass + else: + pass + if count == 0: + return False + for datoid in one_of_these: + if datoid in data: + return True + return False diff --git a/bot/xkcdparser.py b/bot/xkcdparser.py new file mode 100644 index 0000000000..24d6f51416 --- /dev/null +++ b/bot/xkcdparser.py @@ -0,0 +1,40 @@ +from urllib2 import urlopen +from json import loads +from pickle import dump,load +from CORE_DATA import no_absolute_paths +def xkcd(link): + try: + filename = link[link.find("xkcd.com")+9:].replace("/","").replace("\\","") + if no_absolute_paths: + tiedosto = open("xkcdcache/"+filename,"r") + else: + tiedosto = open(directory+"xkcdcache/"+filename,"r") + except: + try: + if no_absolute_paths: + tiedosto = open("xkcdcache/"+filename,"w") + else: + tiedosto = open(directory+"xkcdcache/"+filename,"w") + except IOError: + return "NOTHING" + else: + try: + return load(tiedosto) + except EOFError: + tiedosto = open("xkcdcache/"+filename,"w") + pass #Corrupt cache, moving on. + if link[-1] == "/" or link[-1] == "\\": #Ending is fine. + link += "info.0.json" + else: + link += "/info.0.json" + try: + data = urlopen(link).read() + except: + return "NOTHING" + try: + newdata = loads(data)["title"] + dump(newdata,tiedosto) + return newdata + except: + return "NOTHING" + diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index 87b1fe30d7..4144fbb66d 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -4,7 +4,7 @@ /obj/machinery/atmospherics/binary/circulator name = "circulator/heat exchanger" desc = "A gas circulator pump and heat exchanger." - icon = 'pipes.dmi' + icon = 'icons/obj/pipes.dmi' icon_state = "circ1-off" var/side = 1 // 1=left 2=right diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index 457187137f..196208d752 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/binary/dp_vent_pump - icon = 'dp_vent_pump.dmi' + icon = 'icons/obj/atmospherics/dp_vent_pump.dmi' icon_state = "off" //node2 is output port diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 1163f9860a..203e17e130 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -1,13 +1,14 @@ obj/machinery/atmospherics/binary/passive_gate //Tries to achieve target pressure at output (like a normal pump) except // Uses no power but can not transfer gases from a low pressure area to a high pressure area - icon = 'passive_gate.dmi' + icon = 'icons/obj/atmospherics/passive_gate.dmi' icon_state = "intact_off" name = "Passive gate" desc = "A one-way air valve that does not require power" var/on = 0 + var/target_pressure = ONE_ATMOSPHERE update_icon() if(node1&&node2) @@ -31,14 +32,14 @@ obj/machinery/atmospherics/binary/passive_gate var/output_starting_pressure = air2.return_pressure() var/input_starting_pressure = air1.return_pressure() - if(input_starting_pressure - output_starting_pressure < 1) - //No need to pump gas if input pressure is too low - //Need at least 1 KPa difference to overcome friction in the mechanism + if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10)) + //No need to pump gas if target is already reached or input pressure is too low + //Need at least 10 KPa difference to overcome friction in the mechanism return 1 //Calculate necessary moles to transfer using PV = nRT - if((air1.total_moles > 0) && (air1.temperature>0)) - var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2 + if((air1.total_moles() > 0) && (air1.temperature>0)) + var/pressure_delta = min(target_pressure - output_starting_pressure, (input_starting_pressure - output_starting_pressure)/2) //Can not have a pressure delta that would cause output_pressure > input_pressure var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION) @@ -51,12 +52,4 @@ obj/machinery/atmospherics/binary/passive_gate network1.update = 1 if(network2) - network2.update = 1 - - attack_ai(mob/user as mob) - return src.attack_hand(user) - - attack_hand(mob/user as mob) - src.on = !src.on - src.update_icon() - return + network2.update = 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 7c9f1dfdfe..8c57db80e0 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -13,7 +13,7 @@ Thus, the two variables affect pump operation are set in New(): */ obj/machinery/atmospherics/binary/pump - icon = 'pump.dmi' + icon = 'icons/obj/atmospherics/pump.dmi' icon_state = "intact_off" name = "Gas pump" @@ -21,18 +21,11 @@ obj/machinery/atmospherics/binary/pump var/on = 0 var/target_pressure = ONE_ATMOSPHERE - var/max_pressure = 4500 var/frequency = 0 var/id = null var/datum/radio_frequency/radio_connection - highcap - name = "High capacity gas pump" - desc = "A high capacity pump" - - max_pressure = 15000000 - /* attack_hand(mob/user) on = !on @@ -65,7 +58,7 @@ obj/machinery/atmospherics/binary/pump return 1 //Calculate necessary moles to transfer using PV=nRT - if((air1.total_moles > 0) && (air1.temperature>0)) + if((air1.total_moles() > 0) && (air1.temperature>0)) var/pressure_delta = target_pressure - output_starting_pressure var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION) @@ -164,11 +157,12 @@ obj/machinery/atmospherics/binary/pump return Topic(href,href_list) + if(..()) return if(href_list["power"]) on = !on if(href_list["set_press"]) - var/new_pressure = input(usr,"Enter new output pressure (0-[max_pressure]kPa)","Pressure control",src.target_pressure) as num - src.target_pressure = max(0, min(max_pressure, new_pressure)) + var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num + src.target_pressure = max(0, min(4500, new_pressure)) usr.machine = src src.update_icon() src.updateUsrDialog() @@ -194,7 +188,7 @@ obj/machinery/atmospherics/binary/pump user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index d8350cbf5f..a2e3337289 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -13,7 +13,7 @@ Thus, the two variables affect pump operation are set in New(): */ obj/machinery/atmospherics/binary/volume_pump - icon = 'volume_pump.dmi' + icon = 'icons/obj/atmospherics/volume_pump.dmi' icon_state = "intact_off" name = "Gas pump" diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index cda8f1e6be..8d7a6efb05 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/portables_connector - icon = 'portables_connector.dmi' + icon = 'icons/obj/atmospherics/portables_connector.dmi' icon_state = "intact" name = "Connector Port" @@ -146,7 +146,7 @@ user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 8f69d0c729..55b0a19516 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -1,13 +1,11 @@ obj/machinery/atmospherics/trinary/filter - icon = 'filter.dmi' + icon = 'icons/obj/atmospherics/filter.dmi' icon_state = "intact_off" density = 1 name = "Gas filter" - req_access = list(ACCESS_ATMOSPHERICS) - - var/locked = 1 // If it's not locked, no need for an access check. + req_access = list(access_atmospherics) var/on = 0 var/temp = null // -- TLE @@ -86,6 +84,12 @@ Filter types: filtered_out.toxins = removed.toxins removed.toxins = 0 + if(removed.trace_gases.len>0) + for(var/datum/gas/trace_gas in removed.trace_gases) + if(istype(trace_gas, /datum/gas/oxygen_agent_b)) + removed.trace_gases -= trace_gas + filtered_out.trace_gases += trace_gas + if(1) //removing O2 filtered_out.oxygen = removed.oxygen removed.oxygen = 0 @@ -108,8 +112,7 @@ Filter types: else filtered_out = null - if(filtered_out) - filtered_out.update_values() + air2.merge(filtered_out) air3.merge(removed) @@ -141,7 +144,7 @@ Filter types: user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ @@ -156,7 +159,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE if(..()) return - if(src.locked && !src.allowed(user)) + if(!src.allowed(user)) user << "\red Access denied." return @@ -164,7 +167,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE var/current_filter_type switch(filter_type) if(0) - current_filter_type = "Carbon Molecules (e.g. Plasma)" + current_filter_type = "Carbon Molecules" if(1) current_filter_type = "Oxygen" if(2) @@ -182,14 +185,14 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE Power: [on?"On":"Off"]
Filtering: [current_filter_type]

Set Filter Type:

- Carbon Molecules (e.g Plasma)
+ Carbon Molecules
Oxygen
Nitrogen
Carbon Dioxide
Nitrous Oxide
Nothing

Desirable output pressure: - [src.target_pressure] | Change + [src.target_pressure]kPa | Change "} /* user << browse("[src.name] control[dat]","window=atmo_filter") @@ -227,3 +230,5 @@ obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE src.attack_hand(M) */ return + + diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 3f8cca1d64..026c3531fd 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -1,11 +1,11 @@ obj/machinery/atmospherics/trinary/mixer - icon = 'mixer.dmi' + icon = 'icons/obj/atmospherics/mixer.dmi' icon_state = "intact_off" density = 1 name = "Gas mixer" -// req_access = list(ACCESS_ATMOSPHERICS) + req_access = list(access_atmospherics) var/on = 0 @@ -51,8 +51,8 @@ obj/machinery/atmospherics/trinary/mixer if(air2.temperature > 0) transfer_moles2 = (node2_concentration*pressure_delta)*air3.volume/(air2.temperature * R_IDEAL_GAS_EQUATION) - var/air1_moles = air1.total_moles - var/air2_moles = air2.total_moles + var/air1_moles = air1.total_moles() + var/air2_moles = air2.total_moles() if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2)) if(!transfer_moles1 || !transfer_moles2) return @@ -95,7 +95,7 @@ obj/machinery/atmospherics/trinary/mixer user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ @@ -137,6 +137,7 @@ obj/machinery/atmospherics/trinary/mixer return Topic(href,href_list) + if(..()) return if(href_list["power"]) on = !on if(href_list["set_press"]) diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index 83b1c09ff1..32de005dc6 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/unary/cold_sink - icon = 'cold_sink.dmi' + icon = 'icons/obj/atmospherics/cold_sink.dmi' icon_state = "intact_off" density = 1 diff --git a/code/ATMOSPHERICS/components/unary/generator_input.dm b/code/ATMOSPHERICS/components/unary/generator_input.dm index 8ee2007349..2b31097dc4 100644 --- a/code/ATMOSPHERICS/components/unary/generator_input.dm +++ b/code/ATMOSPHERICS/components/unary/generator_input.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/unary/generator_input - icon = 'heat_exchanger.dmi' + icon = 'icons/obj/atmospherics/heat_exchanger.dmi' icon_state = "intact" density = 1 diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index e9f7d6b2cd..9001bcb423 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -1,6 +1,6 @@ /obj/machinery/atmospherics/unary/heat_exchanger - icon = 'heat_exchanger.dmi' + icon = 'icons/obj/atmospherics/heat_exchanger.dmi' icon_state = "intact" density = 1 diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm index ec65c9409b..adfd04e15a 100644 --- a/code/ATMOSPHERICS/components/unary/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary/heat_source.dm @@ -1,7 +1,7 @@ /obj/machinery/atmospherics/unary/heat_reservoir //currently the same code as cold_sink but anticipating process() changes - icon = 'cold_sink.dmi' + icon = 'icons/obj/atmospherics/cold_sink.dmi' icon_state = "intact_off" density = 1 diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm index ab199d92d0..571fc7dcb9 100644 --- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/unary/outlet_injector - icon = 'outlet_injector.dmi' + icon = 'icons/obj/atmospherics/outlet_injector.dmi' icon_state = "off" name = "Air Injector" diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm index 27819ddac3..9a58be7c30 100644 --- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm +++ b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm @@ -1,5 +1,5 @@ obj/machinery/atmospherics/unary/oxygen_generator - icon = 'oxygen_generator.dmi' + icon = 'icons/obj/atmospherics/oxygen_generator.dmi' icon_state = "intact_off" density = 1 @@ -33,7 +33,7 @@ obj/machinery/atmospherics/unary/oxygen_generator if(!on) return 0 - var/total_moles = air_contents.total_moles + var/total_moles = air_contents.total_moles() if(total_moles < oxygen_content) var/current_heat_capacity = air_contents.heat_capacity() @@ -42,7 +42,6 @@ obj/machinery/atmospherics/unary/oxygen_generator air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen) air_contents.oxygen += added_oxygen - air_contents.update_values() if(network) network.update = 1 diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm index 868c3a73b4..7814eb57ed 100644 --- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -25,18 +25,18 @@ //Get processable air sample and thermal info from environment - var/transfer_moles = 0.25 * environment.total_moles + var/transfer_moles = 0.25 * environment.total_moles() var/datum/gas_mixture/external_removed = environment.remove(transfer_moles) if (!external_removed) return radiate() - if (external_removed.total_moles < 10) + if (external_removed.total_moles() < 10) return radiate() //Get same info from connected gas - var/internal_transfer_moles = 0.25 * air_contents.total_moles + var/internal_transfer_moles = 0.25 * air_contents.total_moles() var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) if (!internal_removed) @@ -61,7 +61,7 @@ proc/radiate() - var/internal_transfer_moles = 0.25 * air_contents.total_moles + var/internal_transfer_moles = 0.25 * air_contents.total_moles() var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) if (!internal_removed) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index a4b5de7ad2..191f8d37d1 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/unary/vent_pump - icon = 'vent_pump.dmi' + icon = 'icons/obj/atmospherics/vent_pump.dmi' icon_state = "off" name = "Air Vent" @@ -7,12 +7,11 @@ level = 1 var/area_uid - var/id_tag + var/id_tag = null power_channel = ENVIRON var/on = 0 var/pump_direction = 1 //0 = siphoning, 1 = releasing - var/pump_speed = 1 //Used to adjust speed for siphons var/external_pressure_bound = ONE_ATMOSPHERE var/internal_pressure_bound = 0 @@ -39,19 +38,17 @@ assign_uid() id_tag = num2text(uid) if(ticker && ticker.current_state == 3)//if the game is running - initialize() - broadcast_status() + src.initialize() + src.broadcast_status() ..() high_volume name = "Large Air Vent" power_channel = EQUIP - New() ..() air_contents.volume = 1000 - update_icon() if(welded) icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]weld" @@ -68,12 +65,11 @@ process() ..() -// broadcast_status() if(stat & (NOPOWER|BROKEN)) return if (!node) on = 0 - + //broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0 if(!on) return 0 @@ -93,7 +89,7 @@ if(pressure_delta > 0) if(air_contents.temperature > 0) - var/transfer_moles = pressure_delta*environment.volume*environment.group_multiplier*pump_speed/(air_contents.temperature * R_IDEAL_GAS_EQUATION) + var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = air_contents.remove(transfer_moles) @@ -111,7 +107,7 @@ if(pressure_delta > 0) if(environment.temperature > 0) - var/transfer_moles = pressure_delta*air_contents.volume*air_contents.group_multiplier*pump_speed/(environment.temperature * R_IDEAL_GAS_EQUATION) + var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = loc.remove_air(transfer_moles) if (isnull(removed)) //in space @@ -124,42 +120,39 @@ return 1 - - - //Radio remote control - proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - if(frequency) - radio_connection = radio_controller.add_object(src, frequency,radio_filter_in) + proc + set_frequency(new_frequency) + radio_controller.remove_object(src, frequency) + frequency = new_frequency + if(frequency) + radio_connection = radio_controller.add_object(src, frequency,radio_filter_in) - proc/broadcast_status() - if(!radio_connection) - return 0 + broadcast_status() + if(!radio_connection) + return 0 - var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal - signal.source = src + var/datum/signal/signal = new + signal.transmission_method = 1 //radio signal + signal.source = src - signal.data = list( - "area" = src.area_uid, - "tag" = src.id_tag, - "device" = "AVP", - "power" = on, - "direction" = pump_direction?("release"):("siphon"), - "checks" = pressure_checks, - "internal" = internal_pressure_bound, - "external" = external_pressure_bound, - "timestamp" = world.time, - "sigtype" = "status", - "setting" = pump_speed - ) + signal.data = list( + "area" = src.area_uid, + "tag" = src.id_tag, + "device" = "AVP", + "power" = on, + "direction" = pump_direction?("release"):("siphon"), + "checks" = pressure_checks, + "internal" = internal_pressure_bound, + "external" = external_pressure_bound, + "timestamp" = world.time, + "sigtype" = "status" + ) - radio_connection.post_signal(src, signal, radio_filter_out) + radio_connection.post_signal(src, signal, radio_filter_out) - return 1 + return 1 initialize() @@ -171,7 +164,6 @@ if(frequency) set_frequency(frequency) - receive_signal(datum/signal/signal) if(stat & (NOPOWER|BROKEN)) return @@ -199,29 +191,47 @@ if("checks_toggle" in signal.data) pressure_checks = (pressure_checks?0:3) - if("direction" in signal) + if("direction" in signal.data) pump_direction = text2num(signal.data["direction"]) if("set_internal_pressure" in signal.data) - internal_pressure_bound = between(0, text2num(signal.data["set_internal_pressure"]), ONE_ATMOSPHERE*50) + internal_pressure_bound = between( + 0, + text2num(signal.data["set_internal_pressure"]), + ONE_ATMOSPHERE*50 + ) if("set_external_pressure" in signal.data) - external_pressure_bound = between(0, text2num(signal.data["set_external_pressure"]), ONE_ATMOSPHERE*50) + external_pressure_bound = between( + 0, + text2num(signal.data["set_external_pressure"]), + ONE_ATMOSPHERE*50 + ) if("adjust_internal_pressure" in signal.data) - internal_pressure_bound = between(0, internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]), ONE_ATMOSPHERE*50) + internal_pressure_bound = between( + 0, + internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]), + ONE_ATMOSPHERE*50 + ) if("adjust_external_pressure" in signal.data) - external_pressure_bound = between(0, external_pressure_bound + text2num(signal.data["adjust_external_pressure"]), ONE_ATMOSPHERE*50) + external_pressure_bound = between( + 0, + external_pressure_bound + text2num(signal.data["adjust_external_pressure"]), + ONE_ATMOSPHERE*50 + ) if("init" in signal.data) name = signal.data["init"] return - if("setting" in signal.data) - pump_speed = text2num(signal.data["setting"]) + if("status" in signal.data) + spawn(2) + broadcast_status() + return //do not update_icon - //log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal["command"]]\"\n[signal.debug_print()]") + //log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]") spawn(2) broadcast_status() update_icon() @@ -248,7 +258,7 @@ user << "\blue Now welding the vent." if(do_after(user, 20)) if(!src || !WT.isOn()) return - playsound(src.loc, 'Welder2.ogg', 50, 1) + 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.") welded = 1 @@ -262,7 +272,6 @@ else user << "\blue You need more welding fuel to complete this task." return 1 - examine() set src in oview(1) ..() @@ -292,7 +301,7 @@ user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 93aa24f5de..012ee2cc96 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/unary/vent_scrubber - icon = 'vent_scrubber.dmi' + icon = 'icons/obj/atmospherics/vent_scrubber.dmi' icon_state = "off" name = "Air Scrubber" @@ -8,24 +8,21 @@ level = 1 var/id_tag = null + var/frequency = 1439 + var/datum/radio_frequency/radio_connection var/on = 0 var/scrubbing = 1 //0 = siphoning, 1 = scrubbing var/scrub_CO2 = 1 var/scrub_Toxins = 0 var/scrub_N2O = 0 - var/scrub_rate = 1 var/volume_rate = 120 var/panic = 0 //is this scrubber panicked? var/area_uid - - var/frequency = 1439 - var/datum/radio_frequency/radio_connection var/radio_filter_out var/radio_filter_in - New() var/area/A = get_area(loc) if (A.master) @@ -35,8 +32,8 @@ assign_uid() id_tag = num2text(uid) if(ticker && ticker.current_state == 3)//if the game is running - initialize() - broadcast_status() + src.initialize() + src.broadcast_status() ..() update_icon() @@ -88,20 +85,20 @@ process() ..() -// broadcast_status() if(stat & (NOPOWER|BROKEN)) return if (!node) on = 0 - + //broadcast_status() if(!on) return 0 + var/datum/gas_mixture/environment = loc.return_air() if(scrubbing) if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0)) - var/transfer_moles = min(1, volume_rate*scrub_rate/environment.volume)*environment.total_moles + var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles() //Take a gas sample var/datum/gas_mixture/removed = loc.remove_air(transfer_moles) @@ -120,14 +117,15 @@ if(removed.trace_gases.len>0) for(var/datum/gas/trace_gas in removed.trace_gases) - if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O) + if(istype(trace_gas, /datum/gas/oxygen_agent_b)) + removed.trace_gases -= trace_gas + filtered_out.trace_gases += trace_gas + else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O) removed.trace_gases -= trace_gas filtered_out.trace_gases += trace_gas //Remix the resulting gases - filtered_out.update_values() - removed.update_values() air_contents.merge(filtered_out) loc.assume_air(removed) @@ -139,7 +137,7 @@ if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE) return - var/transfer_moles = environment.total_moles*(volume_rate*scrub_rate/environment.volume) + var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume) var/datum/gas_mixture/removed = loc.remove_air(transfer_moles) @@ -221,9 +219,6 @@ broadcast_status() return //do not update_icon - if("setting" in signal.data) - scrub_rate = text2num(signal.data["setting"]) - // log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]") spawn(2) broadcast_status() @@ -253,7 +248,7 @@ user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 54321e5e7e..835adeed27 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -1,5 +1,5 @@ obj/machinery/atmospherics/valve - icon = 'valve.dmi' + icon = 'icons/obj/atmospherics/valve.dmi' icon_state = "valve0" name = "manual valve" @@ -9,6 +9,7 @@ obj/machinery/atmospherics/valve initialize_directions = SOUTH|NORTH var/open = 0 + var/openDuringInit = 0 var/obj/machinery/atmospherics/node1 var/obj/machinery/atmospherics/node2 @@ -169,6 +170,11 @@ obj/machinery/atmospherics/valve if(target.initialize_directions & get_dir(target,src)) node2 = target break + if(openDuringInit) + open() + openDuringInit = 0 + + build_network() /* var/connect_directions switch(dir) @@ -250,7 +256,7 @@ obj/machinery/atmospherics/valve digital // can be controlled by AI name = "digital valve" desc = "A digitally controlled valve." - icon = 'digital_valve.dmi' + icon = 'icons/obj/atmospherics/digital_valve.dmi' attack_ai(mob/user as mob) return src.attack_hand(user) @@ -314,7 +320,7 @@ obj/machinery/atmospherics/valve user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index da9bd52bfc..054addadfc 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -569,7 +569,7 @@ obj/machinery/atmospherics/pipe O << "\red [user] has used the analyzer on \icon[icon]" var/pressure = parent.air.return_pressure() - var/total_moles = parent.air.total_moles + var/total_moles = parent.air.total_moles() user << "\blue Results of analysis of \icon[icon]" if (total_moles>0) diff --git a/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm b/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm index 8942a16bb2..339af71e29 100644 --- a/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm +++ b/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm @@ -372,23 +372,23 @@ mob var/datum/pipe_network/master = P.return_network() if(master) - P.overlays += icon('atmos_testing.dmi',"marker[master.marker]") + P.overlays += icon('icons/Testing/atmos_testing.dmi',"marker[master.marker]") else world << "error" - P.overlays += icon('atmos_testing.dmi',"marker0") + P.overlays += icon('icons/Testing/atmos_testing.dmi',"marker0") for(var/obj/machinery/atmospherics/valve/V in world) V.overlays = null if(V.network_node1) - V.overlays += icon('atmos_testing.dmi',"marker[V.network_node1.marker]") + V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker[V.network_node1.marker]") else - V.overlays += icon('atmos_testing.dmi',"marker0") + V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker0") if(V.network_node2) - V.overlays += icon('atmos_testing.dmi',"marker[V.network_node2.marker]") + V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker[V.network_node2.marker]") else - V.overlays += icon('atmos_testing.dmi',"marker0") + V.overlays += icon('icons/Testing/atmos_testing.dmi',"marker0") turf/simulated var/fire_verbose = 0 @@ -399,9 +399,9 @@ turf/simulated overlays = null for(var/direction in list(NORTH,SOUTH,EAST,WEST)) if(group_border&direction) - overlays += icon('turf_analysis.dmi',"red_arrow",direction) + overlays += icon('icons/Testing/turf_analysis.dmi',"red_arrow",direction) else if(air_check_directions&direction) - overlays += icon('turf_analysis.dmi',"arrow",direction) + overlays += icon('icons/Testing/turf_analysis.dmi',"arrow",direction) air_status() set src in world set category = "Minor" @@ -442,12 +442,11 @@ turf/simulated trace_gas.moles = amount adding.trace_gases += trace_gas adding.temperature = T20C - adding.update_values() assume_air(adding) obj/indicator - icon = 'air_meter.dmi' + icon = 'icons/Testing/air_meter.dmi' var/measure = "temperature" anchored = 1 @@ -476,7 +475,7 @@ obj/indicator return "error" return "[round(GM.nitrogen/MOLES_CELLSTANDARD*10+0.5)]" else - return "[round((GM.total_moles)/MOLES_CELLSTANDARD*10+0.5)]" + return "[round((GM.total_moles())/MOLES_CELLSTANDARD*10+0.5)]" Click() @@ -520,7 +519,7 @@ mob 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() + process_cycle() set category = "Debug" if(!master_controller) usr << "Cannot find master_controller" @@ -563,7 +562,7 @@ mob group.marker = 0 for(var/turf/simulated/floor/S in world) - S.icon = 'turf_analysis.dmi' + S.icon = 'icons/Testing/turf_analysis.dmi' if(S.parent) if(S.parent.group_processing) if (S.parent.check_delay < 2) @@ -596,7 +595,7 @@ mob if(S.processing) S.icon_state = "individual_on" else - S.icon_state = "individual_off"*/ + S.icon_state = "individual_off" mark_groups() @@ -609,7 +608,7 @@ mob group.marker = 0 for(var/turf/simulated/floor/S in world) - S.icon = 'turf_analysis.dmi' + S.icon = 'icons/Testing/turf_analysis.dmi' if(S.parent) if(S.parent.group_processing) if(S.parent.marker == 0) diff --git a/code/FEA/FEA_airgroup.dm b/code/FEA/FEA_airgroup.dm index f8a6a8a585..5be0c199ee 100644 --- a/code/FEA/FEA_airgroup.dm +++ b/code/FEA/FEA_airgroup.dm @@ -1,225 +1,279 @@ -datum - air_group - var/tmp/group_processing = 1 //Processing all tiles as one large tile if 1 +datum/air_group + var/group_processing = 1 //Processing all tiles as one large tile if 1 - var/tmp/datum/gas_mixture/air = new + var/datum/gas_mixture/air = new - var/tmp/current_cycle = 0 //cycle that oxygen value represents - var/tmp/archived_cycle = 0 //cycle that oxygen_archived value represents - //The use of archived cycle saves processing power by permitting the archiving step of FET - // to be rolled into the updating step + var/current_cycle = 0 //cycle that oxygen value represents + var/archived_cycle = 0 //cycle that oxygen_archived value represents + //The use of archived cycle saves processing power by permitting the archiving step of FET + // to be rolled into the updating step - //optimization vars -// var/tmp/next_check = 0 //number of ticks before this group updates -// var/tmp/check_delay = 10 //number of ticks between updates, starts fairly high to get boring groups out of the way + //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 - var/list/borders //Tiles that connect this group to other groups/individual tiles - var/list/members //All tiles in this group + proc/members() + //Returns the members of the group + proc/process_group() - var/list/space_borders - var/length_space_border = 0 - Del() - spawn(5) - message_admins("WARNING! Airgroup deleted! Stacktrace is in a runtime, give it to Sky.") - CRASH("Fuck. Something deleted an airgroup. Here's your stack trace.") - ..() + var/list/borders //Tiles that connect this group to other groups/individual tiles + var/list/members //All tiles in this group - proc/suspend_group_processing() - //Purpose: Suspends processing of the group, breaks it into individual tiles. - //Called by: Any check where the airgroup is determined to break. - //Inputs: None. - //Outputs: None. + var/list/space_borders + var/length_space_border = 0 - group_processing = 0 - update_tiles_from_group() - proc/update_group_from_tiles() - //Purpose: Regathers the tiles of the group into the airgroup, reverses update_tiles_from_group() - //Called by: Any check where the airgroup is determined to reconnect. - //Inputs: None. - //Outputs: None. + proc/suspend_group_processing() + group_processing = 0 + update_tiles_from_group() + check_delay=0 + next_check=0 - var/sample_member = pick(members) - var/datum/gas_mixture/sample_air = sample_member:air - air.copy_from(sample_air) - air.group_multiplier = members.len + //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(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/turf/simulated/member in members) + member.process_cell() + return + + //check if we're skipping this tick + if (next_check > 0) + next_check-- return 1 + next_check += check_delay + rand(0,check_delay/2) + check_delay++ - proc/update_tiles_from_group() - //Purpose: Breaks the group into individual tiles. - //Called by: Any check where the airgroup is determined to break. - //Inputs: None. - //Outputs: None. + var/turf/simulated/list/border_individual = list() + var/datum/air_group/list/border_group = list() - for(var/member in members) - member:air.copy_from(air) + 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() - proc/archive() - //Purpose: Archives the air for optimization. - //Called by: ? - //Inputs: None. - //Outputs: None. + 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 - air.archive() - archived_cycle = air_master.current_cycle + 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 - proc/check_regroup() - //Purpose: Checks to see if group processing should be turned back on - //Called by: Any time an airgroup is checked to reform - //Inputs: None. - //Outputs: if the group is processing or not, boolean + var/abort_group = 0 - if(group_processing) return 1 + // 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/turf/simulated/sample = pick(members) - for(var/member in members) - if(member:active_hotspot) - return 0 - if(member:air.compare(sample.air)) continue + 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 - return 0 + abort_group = 1 + break - update_group_from_tiles() - group_processing = 1 + 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)) - return 1 + border_index++ - proc/process_group() - //Purpose: Processes group atmos - //Called by: Atmos Ticker. - //Inputs: None. - //Outputs: None. + // 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] - current_cycle = air_master.current_cycle - if(group_processing) //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/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) - 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) + 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_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)) + 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)) - border_index++ + // Process connections to space + border_index = 1 + if(!abort_group) + if(length_space_border > 0) + var/turf/space/sample = locate() + var/connection_difference = 0 - // 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(air.check_turf(sample)) + connection_difference = air.mimic(sample, length_space_border) + else + abort_group = 1 - 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) + for(var/turf/simulated/self_border in space_borders) + self_border.consider_pressure_difference_space(connection_difference) - 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)) + if(abort_group) + suspend_group_processing() + else + if(air.check_tile_graphic()) + for(var/turf/simulated/member in members) + member.update_visuals(air) - // 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) + if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST) + for(var/turf/simulated/member in members) + member.hotspot_expose(air.temperature, CELL_VOLUME) + member.consider_superconductivity(starting=1) + + air.react() + return + + + + object/process_group() + current_cycle = air_master.current_cycle + + if(!group_processing) 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 - - 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() + break else - if(air.check_tile_graphic()) - for(var/turf/simulated/member in members) - member.update_visuals(air) + if(air.check_turf(enemy_tile)) + air.mimic(enemy_tile) + else + abort_group = 1 + break + if(abort_group) + suspend_group_processing() - if(!group_processing) //Revert to individual processing - for(var/turf/simulated/member in members) - member.process_cell() - else - if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST) - for(var/turf/simulated/member in members) - member.hotspot_expose(air.temperature, CELL_VOLUME) - member.consider_superconductivity(starting=1) - - air.react() \ No newline at end of file + return \ No newline at end of file diff --git a/code/FEA/FEA_fire.dm b/code/FEA/FEA_fire.dm index db653b820b..022af7230a 100644 --- a/code/FEA/FEA_fire.dm +++ b/code/FEA/FEA_fire.dm @@ -1,183 +1,163 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 -atom - proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - //Purpose: Managing temperature exposure. - //Called by: Atmos - //Inputs: Airmix, temperature, volume. - //Outputs: None. +/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + return null - return null -turf - proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) - //Purpose: Making the equivilent of a spark. - //Called by: Atmos. Anything that might light a fire. - //Inputs: Temperature, Volume, ? - //Outputs: If it is igniting or not. - 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 +/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) - 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 +/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 - if(parent&&parent.group_processing) - parent.suspend_group_processing() + var/igniting = 0 - active_hotspot = new(src) - active_hotspot.temperature = exposed_temperature - active_hotspot.volume = exposed_volume + if((exposed_temperature > PLASMA_MINIMUM_BURN_TEMPERATURE) && air_contents.toxins > 0.5) + igniting = 1 - active_hotspot.just_spawned = (current_cycle < air_master.current_cycle) - //remove just_spawned protection if no longer processing this cell + if(igniting) + if(air_contents.oxygen < 0.5 || air_contents.toxins < 0.5) + return 0 - //start processing quickly if we aren't already -// reset_delay() + if(parent&&parent.group_processing) + parent.suspend_group_processing() - return igniting + active_hotspot = new(src) + active_hotspot.temperature = exposed_temperature + active_hotspot.volume = exposed_volume -obj - effect/hotspot - //Icon for fire on turfs, also helps for nurturing small fires until they are full tile + active_hotspot.just_spawned = (current_cycle < air_master.current_cycle) + //remove just_spawned protection if no longer processing this cell - anchored = 1 - mouse_opacity = 0 - unacidable = 1//So you can't melt fire with acid. + //start processing quickly if we aren't already + reset_delay() - //luminosity = 3 + return igniting - icon = 'fire.dmi' - icon_state = "1" - layer = TURF_LAYER +//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 - var/volume = 125 - var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + var/volume = 125 + var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + var/just_spawned = 1 + var/bypassing = 0 - var/just_spawned = 1 - var/bypassing = 0 + proc/perform_exposure() + var/turf/simulated/floor/location = loc + if(!istype(location)) return 0 - 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(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) - if(bypassing) - if(!just_spawned) - volume = location.air.fuel_burnt*FIRE_GROWTH_RATE - temperature = location.air.temperature + for(var/atom/item in loc) + item.temperature_expose(null, temperature, volume) + return 0 + + + process(turf/simulated/list/possible_spread) + if(just_spawned) + just_spawned = 0 + return 0 + + var/turf/simulated/floor/location = loc + if(!istype(location)) + del(src) + + if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1)) + del(src) + + if(location.air.toxins < 0.5 || location.air.oxygen < 0.5) + del(src) + + 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 - var/datum/gas_mixture/affected = location.air.remove_ratio(volume/location.air.volume) + icon_state = "1" - affected.temperature = temperature + if(temperature > location.max_fire_temperature_sustained) + location.max_fire_temperature_sustained = temperature - affected.react() - - temperature = affected.temperature - volume = affected.fuel_burnt*FIRE_GROWTH_RATE - - location.assume_air(affected) - - for(var/atom/item in loc) - item.temperature_expose(null, temperature, volume) - - process(turf/simulated/list/possible_spread) - if(just_spawned) - just_spawned = 0 - return 0 - - var/turf/simulated/floor/location = loc - if(!istype(location)) - del(src) - - if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1)) - del(src) - - if(location.air.toxins < 0.5 || location.air.oxygen < 0.5) - del(src) + if(temperature > location.heat_capacity) + location.to_be_destroyed = 1 + /*if(prob(25)) + location.ReplaceWithSpace() + return 0*/ + return 1 - perform_exposure() + New() + ..() + dir = pick(cardinal) + sd_SetLuminosity(3) + return - if(location.wet) location.wet = 0 - if(bypassing) - icon_state = "3" - location.burn_tile() + Del() + if (istype(loc, /turf/simulated)) + var/turf/simulated/T = loc + loc:active_hotspot = null + src.sd_SetLuminosity(0) - //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" + 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 - icon_state = "1" + chance_of_deletion = 100 + if(prob(chance_of_deletion)) + T.ReplaceWithSpace() + else + T.to_be_destroyed = 0 + T.max_fire_temperature_sustained = 0 - if(temperature > location.max_fire_temperature_sustained) - location.max_fire_temperature_sustained = temperature - - if(temperature > location.heat_capacity) - location.to_be_destroyed = 1 - /*if(prob(25)) - location.ReplaceWithSpace() - return 0*/ - - return 1 - - New() - ..() - dir = pick(cardinal) - ul_SetLuminosity(3) - - Del() - if (istype(loc, /turf/simulated)) - var/turf/simulated/T = loc - loc:active_hotspot = null - src.ul_SetLuminosity(0) - - - - 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.ReplaceWithSpace() - else - T.to_be_destroyed = 0 - T.max_fire_temperature_sustained = 0 - - loc = null - - ..() + loc = null + ..() + return diff --git a/code/FEA/FEA_gas_mixture.dm b/code/FEA/FEA_gas_mixture.dm index 751431ef7b..e6fa54396f 100644 --- a/code/FEA/FEA_gas_mixture.dm +++ b/code/FEA/FEA_gas_mixture.dm @@ -1,5 +1,3 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 - /* What are the archived variables for? Calculations are done using the archived variables with the results merged into the regular variables. @@ -14,997 +12,937 @@ What are the archived variables for? #define MINIMUM_HEAT_CAPACITY 0.0003 #define QUANTIZE(variable) (round(variable,0.0001)) -#define TRANSFER_FRACTION 5 //What fraction (1/#) of the air difference to try and transfer -datum - gas //These are used for the "Trace Gases" stuff, but is buggy. - sleeping_agent - specific_heat = 40 +/datum/gas + sleeping_agent + specific_heat = 40 - volatile_fuel - specific_heat = 30 + oxygen_agent_b + specific_heat = 300 - var/moles = 0 - var/specific_heat = 0 + volatile_fuel + specific_heat = 30 - var/moles_archived = 0 + var + moles = 0 + specific_heat = 0 - gas_mixture - var //Holds the "moles" of each of the four gases. - oxygen = 0 - carbon_dioxide = 0 - nitrogen = 0 - toxins = 0 - total_moles = 0 //Updated when a reaction occurs. - - volume = CELL_VOLUME - - temperature = 0 //in Kelvin, use calculate_temperature() to modify - - group_multiplier = 1 - //Size of the group this gas_mixture is representing. - //=1 for singletons - - graphic - - list/datum/gas/trace_gases = list() //Seemed to be a good idea that was abandoned - - tmp //These are variables for use with the archived data - oxygen_archived - carbon_dioxide_archived - nitrogen_archived - toxins_archived - - temperature_archived - - graphic_archived - fuel_burnt = 0 - -//FOR THE LOVE OF GOD PLEASE USE THIS PROC -//Call it with negative numbers to remove gases. - - proc/adjustGases(o2 = 0, co2 = 0, n2 = 0, tx = 0, list/datum/gas/traces = list()) - //Purpose: Adjusting the gases within a airmix - //Called by: Nothing, yet! - //Inputs: The values of the gases to adjust - //Outputs: null - - oxygen = max(0, oxygen + o2) - carbon_dioxide = max(0, carbon_dioxide + co2) - nitrogen = max(0, nitrogen + n2) - toxins = max(0, toxins + tx) - - //handle trace gasses - for(var/datum/gas/G in traces) - var/datum/gas/T = locate(G.type) in trace_gases - if(T) - T.moles = max(G.moles + T.moles, 0) - else if(G.moles > 0) - trace_gases |= G - update_values() - return - -/////////////////////////////// -//PV=nRT - related procedures// -/////////////////////////////// + moles_archived = 0 - proc/heat_capacity() - //Purpose: Returning the heat capacity of the gas mix - //Called by: UNKNOWN - //Inputs: None - //Outputs: Heat capacity +/datum/gas_mixture + var/oxygen = 0 + var/carbon_dioxide = 0 + var/nitrogen = 0 + var/toxins = 0 - var/heat_capacity = HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins) + var/volume = CELL_VOLUME - if(trace_gases.len) - for(var/datum/gas/trace_gas in trace_gases) - heat_capacity += trace_gas.moles*trace_gas.specific_heat + var/temperature = 0 //in Kelvin, use calculate_temperature() to modify - return heat_capacity + var/group_multiplier = 1 + //Size of the group this gas_mixture is representing. + //=1 for singletons - proc/heat_capacity_archived() - //Purpose: Returning the archived heat capacity of the gas mix - //Called by: UNKNOWN - //Inputs: None - //Outputs: Archived heat capacity + var/graphic - var/heat_capacity_archived = HEAT_CAPACITY_CALCULATION(oxygen_archived,carbon_dioxide_archived,nitrogen_archived,toxins_archived) + var/list/datum/gas/trace_gases = list() - 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 + var/tmp/oxygen_archived + var/tmp/carbon_dioxide_archived + var/tmp/nitrogen_archived + var/tmp/toxins_archived - proc/return_pressure() - //Purpose: Calculating Current Pressure - //Called by: - //Inputs: None - //Outputs: Gas pressure. + var/tmp/temperature_archived - if(volume>0) - return total_moles*R_IDEAL_GAS_EQUATION*temperature/volume + 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 + del(fuel_store) + + 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 -// proc/return_temperature() - //Purpose: - //Inputs: - //Outputs: - -// return temperature - -// proc/return_volume() - //Purpose: - //Inputs: - //Outputs: - -// return max(0, volume) - -// proc/thermal_energy() - //Purpose: - //Inputs: - //Outputs: - -// return temperature*heat_capacity() - - proc/update_values() - //Purpose: Calculating and storing values which were normally called CONSTANTLY - //Called by: Anything that changes values within a gas mix. - //Inputs: None - //Outputs: None - - total_moles = oxygen + carbon_dioxide + nitrogen + toxins - - if(trace_gases.len) - for(var/datum/gas/trace_gas in trace_gases) - total_moles += trace_gas.moles - return - -//////////////////////////////////////////// -//Procedures used for very specific events// -//////////////////////////////////////////// - - - proc/check_tile_graphic() - //Purpose: Calculating the graphic for a tile - //Called by: Turfs updating - //Inputs: None - //Outputs: 1 if graphic changed, 0 if unchanged - - 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) - //Purpose: Calculating if it is possible for a fire to occur in the airmix - //Called by: Air mixes updating? - //Inputs: None - //Outputs: If a fire occured - - var/reacting = 0 //set to 1 if a notable reaction occured (used by pipe_network) - - if(temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST) - if(fire() > 0) - reacting = 1 - - return reacting - - proc/fire() - //Purpose: Calculating any fire reactions. - //Called by: react() (See above) - //Inputs: None - //Outputs: How much fuel burned - - 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 - del(fuel_store) - - 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 - update_values() - - return fuel_burnt - -////////////////////////////////////////////// -//Procs for general gas spread calculations.// -////////////////////////////////////////////// - - - proc/archive() - //Purpose: Archives the current gas values - //Called by: UNKNOWN - //Inputs: None - //Outputs: 1 - - 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 - - proc/check_then_merge(datum/gas_mixture/giver) - //Purpose: 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) - //Called by: airgroups/machinery expelling air, ? - //Inputs: The gas to try and merge - //Outputs: 1 on successful merge. 0 otherwise. - - 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) - - proc/merge(datum/gas_mixture/giver) - //Purpose: Merges all air from giver into self. Deletes giver. - //Called by: Machinery expelling air, check_then_merge, ? - //Inputs: The gas to merge. - //Outputs: 1 - - 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 - update_values() - - del(giver) - return 1 - - proc/remove(amount) - //Purpose: Removes a certain number of moles from the air. - //Called by: ? - //Inputs: How many moles to remove. - //Outputs: Removed air. - - 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 - update_values() - removed.update_values() - - return removed - - proc/remove_ratio(ratio) - //Purpose: Removes a certain ratio of the air. - //Called by: ? - //Inputs: Percentage to remove. - //Outputs: Removed air. - - 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 - update_values() - removed.update_values() - - return removed - - proc/check_then_remove(amount) - //Purpose: 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) - //Called by: ? - //Inputs: Number of moles to remove - //Outputs: Removed air or 0 if it can remove air or not. - - amount = min(amount,total_moles) //Can not take more air than tile has! - - if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > total_moles*MINIMUM_AIR_RATIO_TO_SUSPEND)) - return 0 - - return remove(amount) - - proc/copy_from(datum/gas_mixture/sample) - //Purpose: Duplicates the sample air mixture. - //Called by: airgroups splitting, ? - //Inputs: Gas to copy - //Outputs: 1 - - oxygen = sample.oxygen - carbon_dioxide = sample.carbon_dioxide - nitrogen = sample.nitrogen - toxins = sample.toxins - total_moles = sample.total_moles - - 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 - - proc/check_gas_mixture(datum/gas_mixture/sharer) - //Purpose: Telling if one or both airgroups needs to disable group processing. - //Called by: Airgroups sharing air, checking if group processing needs disabled. - //Inputs: Gas to compare from other airgroup - //Outputs: 0 if the self-check failed (local airgroup breaks?) - // then -1 if sharer-check failed (sharing airgroup breaks?) - // then 1 if both checks pass (share succesful?) - if(!istype(sharer)) - return - - var/delta_oxygen = QUANTIZE(oxygen_archived - sharer.oxygen_archived)/TRANSFER_FRACTION - var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - sharer.carbon_dioxide_archived)/TRANSFER_FRACTION - var/delta_nitrogen = QUANTIZE(nitrogen_archived - sharer.nitrogen_archived)/TRANSFER_FRACTION - var/delta_toxins = QUANTIZE(toxins_archived - sharer.toxins_archived)/TRANSFER_FRACTION - - 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 - - proc/check_turf(turf/model) - //Purpose: Used to compare the gases in an unsimulated turf with the gas in a simulated one. - //Called by: Sharing air (mimicing) with adjacent unsimulated turfs - //Inputs: Unsimulated turf - //Outputs: 1 if safe to mimic, 0 if needs to break airgroup. - - var/delta_oxygen = (oxygen_archived - model.oxygen)/TRANSFER_FRACTION - var/delta_carbon_dioxide = (carbon_dioxide_archived - model.carbon_dioxide)/TRANSFER_FRACTION - var/delta_nitrogen = (nitrogen_archived - model.nitrogen)/TRANSFER_FRACTION - var/delta_toxins = (toxins_archived - model.toxins)/TRANSFER_FRACTION - - 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 - - proc/share(datum/gas_mixture/sharer) - //Purpose: Used to transfer gas from a more pressurised tile to a less presurised tile - // (Two directional, if the other tile is more pressurised, air travels to current tile) - //Called by: Sharing air with adjacent simulated turfs - //Inputs: Air datum to share with - //Outputs: Amount of gas exchanged (Negative if lost air, positive if gained.) - - - if(!istype(sharer)) - return - - var/delta_oxygen = QUANTIZE(oxygen_archived - sharer.oxygen_archived)/TRANSFER_FRACTION - var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - sharer.carbon_dioxide_archived)/TRANSFER_FRACTION - var/delta_nitrogen = QUANTIZE(nitrogen_archived - sharer.nitrogen_archived)/TRANSFER_FRACTION - var/delta_toxins = QUANTIZE(toxins_archived - sharer.toxins_archived)/TRANSFER_FRACTION - - var/delta_temperature = (temperature_archived - sharer.temperature_archived) - - var/old_self_heat_capacity = 0 - var/old_sharer_heat_capacity = 0 - - var/heat_self_to_sharer = 0 - var/heat_capacity_self_to_sharer = 0 - var/heat_sharer_to_self = 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_self_to_sharer += air_heat_capacity*temperature_archived - heat_capacity_self_to_sharer += air_heat_capacity - else - heat_sharer_to_self -= air_heat_capacity*sharer.temperature_archived - 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_self_to_sharer += carbon_dioxide_heat_capacity*temperature_archived - heat_capacity_self_to_sharer += carbon_dioxide_heat_capacity - else - heat_sharer_to_self -= carbon_dioxide_heat_capacity*sharer.temperature_archived - 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_self_to_sharer += toxins_heat_capacity*temperature_archived - heat_capacity_self_to_sharer += toxins_heat_capacity - else - heat_sharer_to_self -= toxins_heat_capacity*sharer.temperature_archived - 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)/TRANSFER_FRACTION - else - corresponding = new trace_gas.type() - sharer.trace_gases += corresponding - - delta = trace_gas.moles_archived/TRANSFER_FRACTION - - 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_self_to_sharer += individual_heat_capacity*temperature_archived - heat_capacity_self_to_sharer += individual_heat_capacity - else - heat_sharer_to_self -= individual_heat_capacity*sharer.temperature_archived - 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/TRANSFER_FRACTION - - 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_sharer_to_self += individual_heat_capacity*sharer.temperature_archived - heat_capacity_sharer_to_self += individual_heat_capacity - - moved_moles += -delta - update_values() - sharer.update_values() - - 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 - - proc/mimic(turf/model, border_multiplier) - //Purpose: Used transfer gas from a more pressurised tile to a less presurised unsimulated tile. - //Called by: "sharing" from unsimulated to simulated turfs. - //Inputs: Unsimulated turf, Multiplier for gas transfer (optional) - //Outputs: Amount of gas exchanged - - var/delta_oxygen = QUANTIZE(oxygen_archived - model.oxygen)/TRANSFER_FRACTION - var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - model.carbon_dioxide)/TRANSFER_FRACTION - var/delta_nitrogen = QUANTIZE(nitrogen_archived - model.nitrogen)/TRANSFER_FRACTION - var/delta_toxins = QUANTIZE(toxins_archived - model.toxins)/TRANSFER_FRACTION - - 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/TRANSFER_FRACTION - - 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 - update_values() - - 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 - - proc/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 - - proc/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 - - proc/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 - - proc/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 - - proc/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(!group_multiplier) - message_admins("Error! The gas mixture (ref \ref[src]) has no group multiplier!") - return - - 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) - - proc/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(!group_multiplier) - message_admins("Error! The gas mixture (ref \ref[src]) has no group multiplier!") - return - - 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) - - proc/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 - - proc/compare(datum/gas_mixture/sample) - //Purpose: Compares sample to self to see if within acceptable ranges that group processing may be enabled - //Called by: Airgroups trying to rebuild - //Inputs: Gas mix to compare - //Outputs: 1 if can rebuild, 0 if not. - - 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]" + 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 - 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 + return merge(giver) - 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 + 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 + + // del(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 - proc/subtract(datum/gas_mixture/right_side) - //Purpose: Subtracts right_side from air_mixture. Used to help turfs mingle - //Called by: Pipelines ending in a break (or something) - //Inputs: Gas mix to remove - //Outputs: 1 + 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 -= right_side.oxygen - carbon_dioxide -= right_side.carbon_dioxide - nitrogen -= right_side.nitrogen - toxins -= right_side.toxins + 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 > 0)||(right_side.trace_gases.len > 0)) - for(var/datum/gas/trace_gas in right_side.trace_gases) + 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) - corresponding = new trace_gas.type() - trace_gases += corresponding + if(corresponding) + if(trace_gas.moles_archived >= corresponding.moles_archived*MINIMUM_AIR_RATIO_TO_SUSPEND*4) + return 0 + else + return 0 - corresponding.moles -= trace_gas.moles - update_values() + 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 + + + //These two variables have been commented out. The author did not leave documentation on what they were supposed to be for. -Rockdtben + //These two variables are only changed and do not exist outside of this proc. -Rockdtben + //var/heat_self_to_sharer = 0 + //var/heat_sharer_to_self = 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_self_to_sharer += air_heat_capacity*temperature_archived + heat_capacity_self_to_sharer += air_heat_capacity + else + //heat_sharer_to_self -= air_heat_capacity*sharer.temperature_archived + 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_self_to_sharer += carbon_dioxide_heat_capacity*temperature_archived + heat_capacity_self_to_sharer += carbon_dioxide_heat_capacity + else + //heat_sharer_to_self -= carbon_dioxide_heat_capacity*sharer.temperature_archived + 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_self_to_sharer += toxins_heat_capacity*temperature_archived + heat_capacity_self_to_sharer += toxins_heat_capacity + else + //heat_sharer_to_self -= toxins_heat_capacity*sharer.temperature_archived + 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_self_to_sharer += individual_heat_capacity*temperature_archived + heat_capacity_self_to_sharer += individual_heat_capacity + else + //heat_sharer_to_self -= individual_heat_capacity*sharer.temperature_archived + 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_sharer_to_self += individual_heat_capacity*sharer.temperature_archived + 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 \ No newline at end of file diff --git a/code/FEA/FEA_system.dm b/code/FEA/FEA_system.dm index 31c46503d2..f50afad32d 100644 --- a/code/FEA/FEA_system.dm +++ b/code/FEA/FEA_system.dm @@ -8,7 +8,7 @@ Why are you archiving data before modifying it? 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 tils and groups to archive their information before doing any calculations seems simple, it is + 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? @@ -54,14 +54,8 @@ Important Procedures */ var/kill_air = 0 -var/tick_multiplier = 2 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. - //Inputs: The moving atom (optional), target turf, "height" and air group - //Outputs: Boolean if can pass. - return (!density || !height || air_group) turf @@ -103,13 +97,41 @@ datum var/list/turf/simulated/groups_to_rebuild = list() var/current_cycle = 0 - var/update_delay = 5 //How long between check should it try to process atmos again. - var/failed_ticks = 0 //How many ticks have runtimed? + proc + setup() + //Call this at the start to setup air groups geometry + //Warning: Very processor intensive but only must be done once per round -/* process() + 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 @@ -117,19 +139,15 @@ datum 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 - proc/setup() - //Purpose: Call this at the start to setup air groups geometry - // (Warning: Very processor intensive but only must be done once per round) - //Called by: Gameticker/Master controller - //Inputs: None. - //Outputs: None. - + setup() set background = 1 world << "\red \b Processing Geometry..." - sleep(-1) + sleep(1) var/start_time = world.timeofday @@ -140,16 +158,16 @@ datum if(S.z > 4) // Skipping asteroids -- TLE continue S.update_air_properties() +/* + for(var/obj/movable/floor/S in world) + if(!S.parent) + assemble_group_object(S) + for(var/obj/movable/floor/S in world) //Update all pathing and border information as well + S.update_air_properties() +*/ + world << "\red \b Geometry processed in [(world.timeofday-start_time)/10] seconds!" - world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!" - spawn start() - - proc/assemble_group_turf(turf/simulated/base) - //Purpose: 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) - //Called by: setup() - //Inputs: turf to flood fill from. - //Outputs: resulting group, or null if no group is formed. + 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 @@ -178,7 +196,7 @@ datum possible_members -= test if(members.len > 1) - var/datum/air_group/group = new + var/datum/air_group/turf/group = new if(possible_borders.len>0) group.borders = possible_borders if(possible_space_borders.len>0) @@ -199,78 +217,89 @@ datum base.processing = 0 //singletons at startup are technically unconnected anyway base.parent = null - if(base.air && base.air.check_tile_graphic()) + if(base.air.check_tile_graphic()) base.update_visuals(base.air) return null +/* + assemble_group_object(obj/movable/floor/base) - proc/start() - //Purpose: This is kicked off by the master controller, and controls the processing of all atmosphere. - //Called by: Master controller - //Inputs: None. - //Outputs: None. + 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() - set background = 1 - while(1) - if(!kill_air) - current_cycle++ - var/success = tick() //Changed so that a runtime does not crash the ticker. - if(!success) //Runtimed. - failed_ticks++ - if(failed_ticks > 20) - world << "ERROR IN ATMOS TICKER. Killing air simulation!" - kill_air = 1 - sleep(max(5,update_delay*tick_multiplier)) + 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 - proc/tick() - if(groups_to_rebuild.len > 0) //If there are groups to rebuild, do so. - spawn process_rebuild_select_groups() + if(members.len > 1) + var/datum/air_group/object/group = new + if(possible_borders.len>0) + group.borders = possible_borders - if(tiles_to_update.len > 0) //If there are tiles to update, do so. - for(var/turf/simulated/T in tiles_to_update) - spawn T.update_air_properties() - tiles_to_update = list() + for(var/obj/movable/floor/test in members) + test.parent = group + test.processing = 0 + active_singletons -= test - for(var/datum/air_group/AG in air_groups) //Processing groups - spawn - if(AG) // Because of runtime errors on syphoning. - AG.process_group() + group.members = members + air_groups += group - for(var/turf/simulated/T in active_singletons) //Processing Singletons - spawn - if(istype(T)) - T.process_cell() - else - active_singletons.Remove(T) + 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 - for(var/turf/simulated/hot_potato in active_super_conductivity) //Process superconduction - spawn hot_potato.super_conduct() + 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() - if(high_pressure_delta.len) //Process high pressure delta (airflow) - for(var/turf/pressurized in high_pressure_delta) - spawn pressurized.high_pressure_movements() - high_pressure_delta = list() + 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) - spawn - if(AG) // Because of runtime errors on syphoning. - AG.check_regroup() + 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 - proc/process_rebuild_select_groups() - //Purpose: This gets called to recalculate and rebuild group geometry - //Called by: process() - //Inputs: None. - //Outputs: None. + process_rebuild_select_groups() var/turf/list/turfs = list() - for(var/datum/air_group/AG in groups_to_rebuild) //Deconstruct groups, gathering their old members - for(var/turf/simulated/T in AG.members) + for(var/datum/air_group/turf/turf_AG in groups_to_rebuild) //Deconstruct groups, gathering their old members + for(var/turf/simulated/T in turf_AG.members) T.parent = null turfs += T - del(AG) + del(turf_AG) for(var/turf/simulated/S in turfs) //Have old members try to form new groups if(!S.parent) @@ -278,4 +307,37 @@ datum for(var/turf/simulated/S in turfs) S.update_air_properties() - groups_to_rebuild = list() +// 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 + del(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 diff --git a/code/FEA/FEA_turf_tile.dm b/code/FEA/FEA_turf_tile.dm index 0652fe6616..f048c89096 100644 --- a/code/FEA/FEA_turf_tile.dm +++ b/code/FEA/FEA_turf_tile.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 atom/movable/var/pressure_resistance = 20 atom/movable/var/last_forced_movement = 0 @@ -27,7 +27,6 @@ turf GM.toxins = toxins GM.temperature = temperature - GM.update_values() return GM @@ -42,7 +41,6 @@ turf GM.toxins = (toxins/sum)*amount GM.temperature = temperature - GM.update_values() return GM @@ -51,8 +49,8 @@ turf var/pressure_direction = 0 //optimization vars -// var/next_check = 0 //number of ticks before this tile updates -// var/check_delay = 0 //number of ticks between updates + var/next_check = 0 //number of ticks before this tile updates + var/check_delay = 0 //number of ticks between updates proc high_pressure_movements() @@ -96,7 +94,7 @@ turf var/tmp/datum/gas_mixture/air var/tmp/processing = 1 - var/tmp/datum/air_group/parent + var/tmp/datum/air_group/turf/parent var/tmp/group_border = 0 var/tmp/length_space_border = 0 @@ -130,12 +128,12 @@ turf var/siding_icon_state = return_siding_icon_state() if(siding_icon_state) - overlays += image('floors.dmi',siding_icon_state) + overlays += image('icons/turf/floors.dmi',siding_icon_state) switch(model.graphic) - if(1) + if("plasma") overlays.Add(plmaster) - if(2) + if("sleeping_agent") overlays.Add(slmaster) @@ -152,7 +150,6 @@ turf air.toxins = toxins air.temperature = temperature - air.update_values() if(air_master) air_master.tiles_to_update.Add(src) @@ -193,8 +190,8 @@ turf parent.suspend_group_processing() air.merge(giver) else -// if (giver.total_moles > MINIMUM_AIR_TO_SUSPEND) -// reset_delay() + if (giver.total_moles() > MINIMUM_AIR_TO_SUSPEND) + reset_delay() air.merge(giver) @@ -243,6 +240,7 @@ turf if(!processing) if(air.check_tile_graphic()) update_visuals(air) + return removed else @@ -293,7 +291,7 @@ turf if(air_check_directions) processing = 1 if(!parent) - air_master.active_singletons |= src + air_master.add_singleton(src) else processing = 0 @@ -303,11 +301,11 @@ turf //and doesn't afraid of anything //check if we're skipping this tick -// if (next_check > 0) -// next_check-- -// return 1 -// next_check += check_delay + rand(0,check_delay/2) -// check_delay++ + if (next_check > 0) + next_check-- + return 1 + next_check += check_delay + rand(0,check_delay/2) + check_delay++ var/turf/simulated/list/possible_fire_spreads = list() if(processing) @@ -324,11 +322,11 @@ turf 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 (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 @@ -379,24 +377,25 @@ turf enemy_tile.consider_pressure_difference(connection_difference, direction) else air_master.active_singletons -= src //not active if not processing! - if(air) - air.react() - if(active_hotspot) - if (!active_hotspot.process(possible_fire_spreads)) - return 0 + air.react() - if(air.temperature > MINIMUM_TEMPERATURE_START_SUPERCONDUCTION) - consider_superconductivity(starting = 1) + if(active_hotspot) + if (!active_hotspot.process(possible_fire_spreads)) + return 0 - if(air.check_tile_graphic()) - update_visuals(air) + if(air.temperature > MINIMUM_TEMPERATURE_START_SUPERCONDUCTION) + consider_superconductivity(starting = 1) - if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST) - 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) + 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 @@ -564,11 +563,11 @@ turf air_master.active_super_conductivity += src -// proc/reset_delay() + proc/reset_delay() //sets this turf to process quickly again -// next_check=0 -// check_delay= -5 //negative numbers mean a mandatory quick-update period + 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() + if (parent && parent.group_processing) + parent.suspend_group_processing() diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm b/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm index d5b089d381..3a491b1077 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm @@ -50,7 +50,7 @@ max volume of plasma storeable by the field = the total volume of a number of ti var/obj/machinery/rust/em_field/owned_field var/field_strength = 0.01 // - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) // use_power = 1 idle_power_usage = 10 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm index 493ac1a96c..6963b1f5be 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm @@ -19,7 +19,7 @@ var/targetting_field = 0 layer = 4 // - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) // use_power = 1 idle_power_usage = 10 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm index 181792bca8..69553a3d8f 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm @@ -16,7 +16,7 @@ var/on = 1 var/remoteenabled = 1 // - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) // use_power = 1 idle_power_usage = 10 @@ -114,7 +114,7 @@ A.fired() */ proc/Emit() - var/obj/item/projectile/beam/ehf_beam/A = new /obj/item/projectile/beam/ehf_beam( src.loc ) + var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc ) A.frequency = frequency A.damage = mega_energy * 500 // @@ -141,7 +141,7 @@ else // Any other A.yo = -20 A.xo = 0 - A.fired() + A.process() // flick("emitter-active",src) if(emitting) diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm index 9a1652c3ca..d03cd81f30 100644 --- a/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm +++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm @@ -55,7 +55,7 @@ anchored = 1 /obj/beam/e_beam/New() - ul_SetLuminosity(1, 1, 4) + sd_SetLuminosity(1, 1, 4) /obj/beam/e_beam/proc/updatebeam() if(!next) diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm index df84c3d396..a4d1b92598 100644 --- a/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm +++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm @@ -63,7 +63,7 @@ var/datum/gas_mixture/env = L.return_air() //Remove gas from surrounding area - var/transfer_moles = gasefficency * env.total_moles + var/transfer_moles = gasefficency * env.total_moles() var/datum/gas_mixture/removed = env.remove(transfer_moles) if (!removed) @@ -88,8 +88,8 @@ explosion(loc,explosion_power,explosion_power*2,explosion_power*3,explosion_power*4,1) del src - var/nitrogen_mod = abs((removed.nitrogen / removed.total_moles)) * NITROGEN_RETARDATION_FACTOR - var/oxygen = max(min(removed.oxygen / removed.total_moles - nitrogen_mod, 1), 0) + var/nitrogen_mod = abs((removed.nitrogen / removed.total_moles())) * NITROGEN_RETARDATION_FACTOR + var/oxygen = max(min(removed.oxygen / removed.total_moles() - nitrogen_mod, 1), 0) var/temp_factor = 0 if(oxygen > 0.8) diff --git a/code/WorkInProgress/Cael_Aislinn/Tajara/say.dm b/code/WorkInProgress/Cael_Aislinn/Tajara/say.dm index 824c164a1b..f350024247 100644 --- a/code/WorkInProgress/Cael_Aislinn/Tajara/say.dm +++ b/code/WorkInProgress/Cael_Aislinn/Tajara/say.dm @@ -4,8 +4,8 @@ //work out if the listener can understand or not var/ending = copytext(text, length(text)) - if (src.disease_symptoms & DISEASE_HOARSE) - return "rasps, \"[text]\""; + /*if (src.disease_symptoms & DISEASE_HOARSE) + return "rasps, \"[text]\"";*/ if (src.stuttering) return "stammers, \"[text]\""; if (src.slurring) diff --git a/code/WorkInProgress/Cael_Aislinn/sculpture.dm b/code/WorkInProgress/Cael_Aislinn/sculpture.dm index be1b42eeaa..314430a346 100644 --- a/code/WorkInProgress/Cael_Aislinn/sculpture.dm +++ b/code/WorkInProgress/Cael_Aislinn/sculpture.dm @@ -130,7 +130,7 @@ //account for darkness var/turf/T = get_turf(src) var/in_darkness = 0 - if(max(T.ul_GetRed(), T.ul_GetGreen(), T.ul_GetBlue()) == 0 && !istype(T, /turf/simulated)) + if(T.luminosity == 0 && !istype(T, /turf/simulated)) in_darkness = 1 //see if we're able to do stuff diff --git a/code/WorkInProgress/Mini/atmos_control.dm b/code/WorkInProgress/Mini/atmos_control.dm index 4563095e43..6c06a16b79 100644 --- a/code/WorkInProgress/Mini/atmos_control.dm +++ b/code/WorkInProgress/Mini/atmos_control.dm @@ -11,7 +11,7 @@ circuit = "/obj/item/weapon/circuitboard/atmoscontrol" var/obj/machinery/alarm/current var/overridden = 0 //not set yet, can't think of a good way to do it - req_access = list(ACCESS_CE) + req_access = list(access_ce) /obj/machinery/computer/atmoscontrol/attack_hand(mob/user) if(..()) diff --git a/code/WorkInProgress/Ported/policetape.dm b/code/WorkInProgress/Ported/policetape.dm index fcb6643af8..36076152f0 100644 --- a/code/WorkInProgress/Ported/policetape.dm +++ b/code/WorkInProgress/Ported/policetape.dm @@ -9,7 +9,7 @@ /obj/item/tape/police name = "police tape" desc = "A length of police tape. Do not cross." - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) icon_base = "police" /obj/item/taperoll/engineering @@ -22,7 +22,7 @@ /obj/item/tape/engineering name = "engineering tape" desc = "A length of engineering tape. Better not cross it." - req_access = list(ACCESS_ENGINE,ACCESS_ATMOSPHERICS) + req_access = list(access_engine,access_atmospherics) icon_base = "engineering" /obj/item/taperoll/attack_self(mob/user as mob) diff --git a/code/WorkInProgress/Tastyfish/livestock.dm b/code/WorkInProgress/Tastyfish/livestock.dm index e7ba2e4c7d..4920eb805b 100644 --- a/code/WorkInProgress/Tastyfish/livestock.dm +++ b/code/WorkInProgress/Tastyfish/livestock.dm @@ -178,7 +178,7 @@ cost = 10 containertype = "/obj/structure/closet/critter" containername = "Chicken crate" - group = "Hydroponics" + //group = "Hydroponics" /datum/supply_packs/cow name = "\improper Cow crate" @@ -187,4 +187,4 @@ cost = 50 containertype = "/obj/structure/closet/critter" containername = "Cow crate" - group = "Hydroponics" + //group = "Hydroponics" diff --git a/code/WorkInProgress/buildmode.dm b/code/WorkInProgress/buildmode.dm index 28550759b2..0c42c913d5 100644 --- a/code/WorkInProgress/buildmode.dm +++ b/code/WorkInProgress/buildmode.dm @@ -1,4 +1,4 @@ -/proc/togglebuildmode(mob/M as mob in world) +/proc/togglebuildmode(mob/M as mob in player_list) set name = "Toggle Build Mode" set category = "Special Verbs" if(M.client) @@ -39,7 +39,7 @@ anchored = 1 layer = 20 dir = NORTH - icon = 'buildmode.dmi' + icon = 'icons/misc/buildmode.dmi' var/obj/effect/bmode/buildholder/master = null /obj/effect/bmode/builddir @@ -60,7 +60,7 @@ return /obj/effect/bmode/buildhelp - icon = 'buildmode.dmi' + icon = 'icons/misc/buildmode.dmi' icon_state = "buildhelp" screen_loc = "NORTH,WEST+1" Click() @@ -165,7 +165,7 @@ if("number") master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", 123) as num if("mob-reference") - master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as mob in world + master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as mob in mob_list if("obj-reference") master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world if("turf-reference") diff --git a/code/WorkInProgress/carn/debug_powernets.dm b/code/WorkInProgress/carn/debug_powernets.dm new file mode 100644 index 0000000000..600b031550 --- /dev/null +++ b/code/WorkInProgress/carn/debug_powernets.dm @@ -0,0 +1,86 @@ +//Inefficient as hell so don't copypasta this anywhere! It's only here as a tool for debugging +//prints a map of the powernetworks on z-level 1 +/client/verb/print_powernets() + set name = "print powernets" + + var/file = file("powernets_map.html") + + var/list/grid[255][255] + + var/list/checklist = list() + for(var/obj/structure/cable/C in world) + if(C.z != 1) continue + if(C.x < 1 || C.x > 255) continue + if(C.y < 1 || C.y > 255) continue + grid[C.x][C.y] = C.netnum + checklist |= C.netnum + + sleep(1) + file << "" + for(var/netnum in checklist) + file << "[netnum]
" + + for(var/j=255, j>=1, j--) + var/line = "
" + for(var/i=1, i<=255, i++) + switch(grid[i][j]) + if(null) line += " " + if(0 to 9) line += "[grid[i][j]]" + if(10) line += "a" + if(11) line += "b" + if(12) line += "c" + if(13) line += "d" + if(14) line += "e" + if(15) line += "f" + if(16) line += "g" + if(17) line += "h" + if(18) line += "i" + if(19) line += "j" + if(20) line += "k" + if(21) line += "l" + if(22) line += "m" + if(23) line += "n" + if(24) line += "o" + if(25) line += "p" + if(26) line += "q" + if(27) line += "r" + if(28) line += "s" + if(29) line += "t" + if(30) line += "u" + if(31) line += "v" + if(32) line += "w" + if(33) line += "x" + if(34) line += "y" + if(35) line += "z" + if(36) line += "A" + if(37) line += "B" + if(38) line += "C" + if(39) line += "D" + if(40) line += "E" + if(41) line += "F" + if(42) line += "G" + if(43) line += "H" + if(44) line += "I" + if(45) line += "J" + if(46) line += "K" + if(47) line += "L" + if(48) line += "M" + if(49) line += "N" + if(50) line += "O" + if(51) line += "P" + if(52) line += "Q" + if(53) line += "R" + if(54) line += "S" + if(55) line += "T" + if(56) line += "U" + if(57) line += "V" + if(58) line += "W" + if(59) line += "X" + if(60) line += "Y" + if(61) line += "Z" + else line += "#" + + file << line + file << "
" + src << "printed to powernets_map.html" + src << browse(file) \ No newline at end of file diff --git a/code/WorkInProgress/carn/master_controller_semi-seq.dm b/code/WorkInProgress/carn/master_controller_semi-seq.dm new file mode 100644 index 0000000000..96e7eacda6 --- /dev/null +++ b/code/WorkInProgress/carn/master_controller_semi-seq.dm @@ -0,0 +1,258 @@ +//Nothing spectacular, just a slightly more configurable MC. + +var/global/datum/controller/game_controller/master_controller //Set in world.New() +var/global/datum/failsafe/Failsafe +var/global/controller_iteration = 0 + + +var/global/last_tick_timeofday = world.timeofday +var/global/last_tick_duration = 0 + +var/global/obj/machinery/last_obj_processed //Used for MC 'proc break' debugging +var/global/datum/disease/last_disease_processed //Used for MC 'proc break' debugging +var/global/obj/machinery/last_machine_processed //Used for MC 'proc break' debugging + +datum/controller/game_controller + var/processing = 0 + var/breather_ticks = 1 //a somewhat crude attempt to iron over the 'bumps' caused by high-cpu use by letting the MC have a breather for this many ticks after every step + var/minimum_ticks = 10 //The minimum length of time between MC ticks + + var/global/air_master_ready = 0 + var/global/tension_master_ready = 0 + var/global/sun_ready = 0 + var/global/mobs_ready = 0 + var/global/diseases_ready = 0 + var/global/machines_ready = 0 + var/global/objects_ready = 0 + var/global/networks_ready = 0 + var/global/powernets_ready = 0 + var/global/ticker_ready = 0 + +datum/controller/game_controller/New() + //There can be only one master_controller. Out with the old and in with the new. + if(master_controller) + if(master_controller != src) + del(master_controller) + master_controller = src + + if(!air_master) + air_master = new /datum/controller/air_system() + air_master.setup() + + if(!job_master) + job_master = new /datum/controller/occupations() + if(job_master.SetupOccupations()) + world << "\red \b Job setup complete" + job_master.LoadJobs("config/jobs.txt") + + if(!tension_master) tension_master = new /datum/tension() + if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase() + if(!syndicate_code_response) syndicate_code_response = generate_code_phrase() + if(!ticker) ticker = new /datum/controller/gameticker() + if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle() + + +datum/controller/game_controller/proc/setup() + world.tick_lag = config.Ticklag + + createRandomZlevel() + setup_objects() + setupgenetics() + setupfactions() + + for(var/i = 0, i < max_secret_rooms, i++) + make_mining_asteroid_secret() + + spawn(0) + if(ticker) + ticker.pregame() + +datum/controller/game_controller/proc/setup_objects() + world << "\red \b Initializing objects" + sleep(-1) + for(var/obj/object in world) + object.initialize() + + world << "\red \b Initializing pipe networks" + sleep(-1) + for(var/obj/machinery/atmospherics/machine in world) + machine.build_network() + + world << "\red \b Initializing atmos machinery." + sleep(-1) + for(var/obj/machinery/atmospherics/unary/vent_pump/T in world) + T.broadcast_status() + for(var/obj/machinery/atmospherics/unary/vent_scrubber/T in world) + T.broadcast_status() + + world << "\red \b Initializations complete." + sleep(-1) + + +datum/controller/game_controller/proc/process() + set background = 1 + processing = 1 + while(1) //far more efficient than recursively calling ourself + if(!Failsafe) new /datum/failsafe() + + var/currenttime = world.timeofday + last_tick_duration = (currenttime - last_tick_timeofday) / 10 + last_tick_timeofday = currenttime + + if(processing) + var/start_time = world.timeofday + controller_iteration++ + + air_master_ready = 0 + tension_master_ready = 0 + sun_ready = 0 + mobs_ready = 0 + diseases_ready = 0 + machines_ready = 0 + objects_ready = 0 + networks_ready = 0 + powernets_ready = 0 + ticker_ready = 0 + + spawn(0) + air_master.process() + air_master_ready = 1 + sleep(breather_ticks) + + spawn(0) + tension_master.process() + tension_master_ready = 1 + sleep(breather_ticks) + + spawn(0) + sun.calc_position() + sun_ready = 1 + sleep(breather_ticks) + + spawn(0) + for(var/mob/living/M in world) //only living mobs have life processes + M.Life() + mobs_ready = 1 + sleep(breather_ticks) + + spawn(0) + for(var/datum/disease/D in active_diseases) + last_disease_processed = D + D.process() + diseases_ready = 1 + sleep(breather_ticks) + + spawn(0) + for(var/obj/machinery/machine in machines) + if(machine) + last_machine_processed = machine + machine.process() + if(machine && machine.use_power) + machine.auto_use_power() + machines_ready = 1 + sleep(breather_ticks) + + spawn(0) + for(var/obj/object in processing_objects) + last_obj_processed = object + object.process() + objects_ready = 1 + sleep(breather_ticks) + + spawn(0) + for(var/datum/pipe_network/network in pipe_networks) + network.process() + networks_ready = 1 + sleep(breather_ticks) + + spawn(0) + for(var/datum/powernet/P in powernets) + P.reset() + powernets_ready = 1 + sleep(breather_ticks) + + spawn(0) + ticker.process() + ticker_ready = 1 + + sleep( minimum_ticks - max(world.timeofday-start_time,0) ) //to prevent long delays happening at midnight + + var/IL_check = 0 //Infinite loop check (To report when the master controller breaks.) + while(!air_master_ready || !tension_master_ready || !sun_ready || !mobs_ready || !diseases_ready || !machines_ready || !objects_ready || !networks_ready || !powernets_ready || !ticker_ready) + IL_check++ + if(IL_check > 200) + var/MC_report = "air_master_ready = [air_master_ready]; tension_master_ready = [tension_master_ready]; sun_ready = [sun_ready]; mobs_ready = [mobs_ready]; diseases_ready = [diseases_ready]; machines_ready = [machines_ready]; objects_ready = [objects_ready]; networks_ready = [networks_ready]; powernets_ready = [powernets_ready]; ticker_ready = [ticker_ready];" + var/MC_admin_report = "PROC BREAKAGE WARNING: The game's master contorller appears to be stuck in one of it's cycles. It has looped through it's delaying loop [IL_check] times.
The master controller reports: [MC_report]

" + if(!diseases_ready) + if(last_disease_processed) + MC_admin_report += "DISEASE PROCESSING stuck on [last_disease_processed]
" + else + MC_admin_report += "DISEASE PROCESSING stuck on unknown
" + if(!machines_ready) + if(last_machine_processed) + MC_admin_report += "MACHINE PROCESSING stuck on [last_machine_processed]
" + else + MC_admin_report += "MACHINE PROCESSING stuck on unknown
" + if(!objects_ready) + if(last_obj_processed) + MC_admin_report += "OBJ PROCESSING stuck on [last_obj_processed]
" + else + MC_admin_report += "OBJ PROCESSING stuck on unknown
" + MC_admin_report += "Master controller breaking out of delaying loop. Restarting the round is advised if problem persists. DO NOT manually restart the master controller.
" + message_admins(MC_admin_report) + log_admin("PROC BREAKAGE WARNING: infinite_loop_check = [IL_check]; [MC_report];") + break + sleep(3) + else + sleep(10) + + + +/datum/failsafe // This thing pretty much just keeps poking the master controller + var/spinning = 1 + var/current_iteration = 0 + var/ticks_per_spin = 200 //poke the MC every 20 seconds + var/defcon = 0 //alert level. For every poke that fails this is raised by 1. When it reaches 5 the MC is replaced with a new one. (effectively killing any master_controller.process() and starting a new one) + +/datum/failsafe/New() + //There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one) + if(Failsafe && (Failsafe != src)) + del(Failsafe) + Failsafe = src + + current_iteration = controller_iteration + spawn(0) + Failsafe.spin() + + +/datum/failsafe/proc/spin() + set background = 1 + while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop + if(master_controller) + if(spinning && master_controller.processing) //only poke if these overrides aren't in effect + if(current_iteration == controller_iteration) //master_controller hasn't finished processing in the defined interval + switch(defcon) + if(0 to 3) + defcon++ + if(4) + defcon = 5 + for(var/client/C) + if(C.holder) + C << "Warning. The Master Controller has not fired in the last [4*ticks_per_spin] ticks. Automatic restart in [ticks_per_spin] ticks." + if(5) + for(var/client/C) + if(C.holder) + C << "Warning. The Master Controller has still not fired within the last [5*ticks_per_spin] ticks. Killing and restarting..." + spawn(0) + new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process) + master_controller.process() //Start it rolling again + defcon = 0 + else + defcon = 0 + current_iteration = controller_iteration + else + defcon = 0 + else + new /datum/controller/game_controller() //replace the missing master_controller! This should never happen. + sleep(ticks_per_spin) + diff --git a/code/WorkInProgress/carn/master_controller_sequential.dm b/code/WorkInProgress/carn/master_controller_sequential.dm new file mode 100644 index 0000000000..3c2978a6e8 --- /dev/null +++ b/code/WorkInProgress/carn/master_controller_sequential.dm @@ -0,0 +1,209 @@ +//simplified MC that is designed to fail when procs 'break'. When it fails it's just replaced with a new one. +//It ensures master_controller.process() is never doubled up by killing the MC (hence terminating any of its sleeping procs) +//WIP, needs lots of work still + +var/global/datum/controller/game_controller/master_controller //Set in world.New() +var/global/datum/failsafe/Failsafe +var/global/controller_iteration = 0 + + +var/global/last_tick_timeofday = world.timeofday +var/global/last_tick_duration = 0 + +var/global/obj/machinery/last_obj_processed //Used for MC 'proc break' debugging +var/global/datum/disease/last_disease_processed //Used for MC 'proc break' debugging +var/global/obj/machinery/last_machine_processed //Used for MC 'proc break' debugging + +datum/controller/game_controller + var/processing = 0 + var/breather_ticks = 2 //a somewhat crude attempt to iron over the 'bumps' caused by high-cpu use by letting the MC have a breather for this many ticks after every loop + var/minimum_ticks = 20 //The minimum length of time between MC ticks + + var/global/air_master_ready = 0 + var/global/tension_master_ready = 0 + var/global/sun_ready = 0 + var/global/mobs_ready = 0 + var/global/diseases_ready = 0 + var/global/machines_ready = 0 + var/global/objects_ready = 0 + var/global/networks_ready = 0 + var/global/powernets_ready = 0 + var/global/ticker_ready = 0 + +datum/controller/game_controller/New() + //There can be only one master_controller. Out with the old and in with the new. + if(master_controller) + if(master_controller != src) + del(master_controller) + master_controller = src + + if(!air_master) + air_master = new /datum/controller/air_system() + air_master.setup() + + if(!job_master) + job_master = new /datum/controller/occupations() + if(job_master.SetupOccupations()) + world << "\red \b Job setup complete" + job_master.LoadJobs("config/jobs.txt") + + if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase() + if(!syndicate_code_response) syndicate_code_response = generate_code_phrase() + if(!ticker) ticker = new /datum/controller/gameticker() + if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle() + + +datum/controller/game_controller/proc/setup() + world.tick_lag = config.Ticklag + + createRandomZlevel() + setup_objects() + setupgenetics() + setupfactions() + + for(var/i = 0, i < max_secret_rooms, i++) + make_mining_asteroid_secret() + + spawn(0) + if(ticker) + ticker.pregame() + +datum/controller/game_controller/proc/setup_objects() + world << "\red \b Initializing objects" + sleep(-1) + for(var/obj/object in world) + object.initialize() + + world << "\red \b Initializing pipe networks" + sleep(-1) + for(var/obj/machinery/atmospherics/machine in world) + machine.build_network() + + world << "\red \b Initializing atmos machinery." + sleep(-1) + for(var/obj/machinery/atmospherics/unary/vent_pump/T in world) + T.broadcast_status() + for(var/obj/machinery/atmospherics/unary/vent_scrubber/T in world) + T.broadcast_status() + + world << "\red \b Initializations complete." + sleep(-1) + + +datum/controller/game_controller/proc/process() + set background = 1 + processing = 1 + while(1) //far more efficient than recursively calling ourself + if(!Failsafe) new /datum/failsafe() + + var/currenttime = world.timeofday + last_tick_duration = (currenttime - last_tick_timeofday) / 10 + last_tick_timeofday = currenttime + + if(processing) + var/start_time = world.timeofday + controller_iteration++ + + air_master.process() + sleep(breather_ticks) + + sun.calc_position() + sleep(breather_ticks) + + for(var/mob/living/M in world) //only living mobs have life processes + M.Life() + sleep(breather_ticks) + + for(var/datum/disease/D in active_diseases) + last_disease_processed = D + D.process() + sleep(breather_ticks) + + for(var/obj/machinery/machine in machines) + if(machine) + last_machine_processed = machine + machine.process() + if(machine && machine.use_power) + machine.auto_use_power() + sleep(breather_ticks) + + for(var/obj/object in processing_objects) + last_obj_processed = object + object.process() + sleep(breather_ticks) + + for(var/datum/pipe_network/network in pipe_networks) + network.process() + sleep(breather_ticks) + + + for(var/datum/powernet/P in powernets) + P.reset() + sleep(breather_ticks) + + ticker.process() + + sleep( minimum_ticks - max(world.timeofday-start_time,0) ) //to prevent long delays happening at midnight + + else + sleep(10) + + + +/datum/failsafe // This thing pretty much just keeps poking the master controller + var/spinning = 1 + var/current_iteration = 0 + var/ticks_per_spin = 100 //poke the MC every 10 seconds + var/defcon = 0 //alert level. For every poke that fails this is raised by 1. When it reaches 5 the MC is replaced with a new one. (effectively killing any master_controller.process() and starting a new one) + +/datum/failsafe/New() + //There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one) + if(Failsafe && (Failsafe != src)) + del(Failsafe) + Failsafe = src + + current_iteration = controller_iteration + spawn(0) + Failsafe.spin() + + +/datum/failsafe/proc/spin() + set background = 1 + while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop + if(master_controller) + if(spinning && master_controller.processing) //only poke if these overrides aren't in effect + if(current_iteration == controller_iteration) //master_controller hasn't finished processing in the defined interval + switch(defcon) + if(0 to 3) + defcon++ + if(4) + defcon = 5 + for(var/client/C) + if(C.holder) + C << "Warning. The Master Controller has not fired in the last [defcon*ticks_per_spin] ticks. Automatic restart in [ticks_per_spin] ticks." + if(5) + for(var/client/C) + if(C.holder) + C << "Warning. The Master Controller has still not fired within the last [defcon*ticks_per_spin] ticks. Killing and restarting..." + spawn(0) + new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process) + master_controller.process() //Start it rolling again + defcon = 0 + else + defcon = 0 + current_iteration = controller_iteration + else + defcon = 0 + else + new /datum/controller/game_controller() //replace the missing master_controller! This should never happen. + sleep(ticks_per_spin) + +//DEBUG VERBS +/* +/client/verb/spawn_MC() + new /datum/controller/game_controller() + + +/client/verb/spawn_FS() + new /datum/failsafe() +*/ \ No newline at end of file diff --git a/code/WorkInProgress/explosion_particles.dm b/code/WorkInProgress/explosion_particles.dm index ba59cc6377..9cf81b27ae 100644 --- a/code/WorkInProgress/explosion_particles.dm +++ b/code/WorkInProgress/explosion_particles.dm @@ -1,6 +1,6 @@ /obj/effect/expl_particles name = "fire" - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "explosion_particle" opacity = 1 anchored = 1 @@ -38,7 +38,7 @@ /obj/effect/explosion name = "fire" - icon = '96x96.dmi' + icon = 'icons/effects/96x96.dmi' icon_state = "explosion" opacity = 1 anchored = 1 diff --git a/code/WorkInProgress/organs/organs.dm b/code/WorkInProgress/organs/organs.dm index e712f8a7a3..22f51bffc6 100644 --- a/code/WorkInProgress/organs/organs.dm +++ b/code/WorkInProgress/organs/organs.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/effect/organstructure //used obj for the "contents" var name = "organs" @@ -346,4 +347,354 @@ name = "template head" species = "template" +======= +/obj/effect/organstructure //used obj for the "contents" var + name = "organs" + + var/species = "mob" //for speaking in unknown languages purposes + + var/obj/effect/organ/limb/arms/arms = null + var/obj/effect/organ/limb/legs/legs = null + var/obj/effect/organ/torso/torso = null + var/obj/effect/organ/head/head = null + + + proc/GetSpeciesName() + var/list/speciesPresent = list() + + for(var/obj/effect/organ/organ in src) //only external organs count, since it's judging by the appearance + if(speciesPresent[organ.species]) + speciesPresent[organ.species]++ + else + speciesPresent[organ.species] = 1 //not sure, but I think it's not initialised before that, so can't ++ + + var/list/dominantSpecies = list() + + for(var/speciesName in speciesPresent) + if(!dominantSpecies.len) + dominantSpecies += speciesName + else + if(speciesPresent[dominantSpecies[1]] == speciesPresent[speciesName]) + dominantSpecies += speciesName + else if(speciesPresent[dominantSpecies[1]] < speciesPresent[speciesName]) + dominantSpecies = list(speciesName) + + if(!dominantSpecies.len) + species = "mob" + else + species = pick(dominantSpecies) + + return species + + proc/RecalculateStructure() + var/list/organs = GetAllContents() + + arms = locate(/obj/effect/organ/limb/arms) in organs + legs = locate(/obj/effect/organ/limb/legs) in organs + torso = locate(/obj/effect/organ/torso) in organs + head = locate(/obj/effect/organ/head) in organs + + GetSpeciesName() + + return + + proc/ProcessOrgans() + set background = 1 + + var/list/organs = GetAllContents() + for(var/obj/effect/organ/organ in organs) + organ.ProcessOrgan() + + return + + New() + ..() + RecalculateStructure() + +/obj/effect/organstructure/human + name = "human organs" + + New() + new /obj/effect/organ/torso/human(src) + ..() + +/obj/effect/organstructure/alien + name = "alien organs" + + New() + new /obj/effect/organ/torso/alien(src) + ..() + +/obj/effect/organ + name = "organ" + + //All types + var/organType = 0 //CYBER and SPELL go here + var/species = "mob" + var/obj/effect/organstructure/rootOrganStructure = null + + New(location) + ..() + + rootOrganStructure = FindRootStructure() + + proc/FindRootStructure() + if(istype(loc,/obj/effect/organ)) + var/obj/effect/organ/parent = loc + return parent.FindRootStructure() + else if(istype(loc,/obj/effect/organstructure)) + return loc + return null + + proc/ProcessOrgan() + return + +/obj/effect/organ/torso + name = "torso" + var/maxHealth = 50 //right now, the mob's (only humans for now) health depends only on it. Will be fixed later + +/obj/effect/organ/torso/human + name = "human torso" + species = "human" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/human(src) + new /obj/effect/organ/limb/legs/human(src) + new /obj/effect/organ/head/human(src) +/obj/effect/organ/torso/alien + name = "alien torso" + species = "alien" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/alien(src) + new /obj/effect/organ/limb/legs/alien(src) + new /obj/effect/organ/head/alien(src) + + +/obj/effect/organ/limb + name = "limb" + +/obj/effect/organ/limb/arms + name = "arms" + + var/minDamage = 5 //punching damage + var/maxDamage = 5 + +/obj/effect/organ/limb/arms/alien + name = "alien arms" + species = "alien" + minDamage = 5 + maxDamage = 15 + + +/obj/effect/organ/limb/arms/human + name = "human arms" + species = "human" + minDamage = 1 + maxDamage = 9 + +/obj/effect/organ/limb/legs + name = "legs" + +/obj/effect/organ/limb/legs/human + name = "human legs" + species = "human" + +/obj/effect/organ/limb/legs/alien + name = "alien legs" + species = "alien" + + +/obj/effect/organ/head + name = "head" + +/obj/effect/organ/head/human + name = "human head" + species = "human" + +/obj/effect/organ/head/alien + name = "alien head" + species = "alien" + +/obj/effect/organ/limb/arms/alien + name = "alien arms" + species = "alien" + minDamage = 5 + maxDamage = 15 + +/obj/effect/organ/limb/legs/alien + name = "alien legs" + species = "alien" + +/obj/effect/organ/head/alien + name = "alien head" + species = "alien" + +// ++++STUB ORGAN STRUCTURE. THIS IS THE DEFAULT STRUCTURE. USED TO PREVENT EXCEPTIONS++++ +/obj/effect/organstructure/stub + name = "stub organs" + + New() + new /obj/effect/organ/torso/stub(src) + ..() + +/obj/effect/organ/torso/stub + name = "stub torso" + species = "stub" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/stub(src) + new /obj/effect/organ/limb/legs/stub(src) + new /obj/effect/organ/head/stub(src) + +/obj/effect/organ/limb/arms/stub + name = "stub arms" + species = "stub" + +/obj/effect/organ/limb/legs/stub + name = "stub legs" + species = "stub" + +/obj/effect/organ/head/stub + name = "stub head" + species = "stub" + +// ++++STUB ORGAN STRUCTURE. END++++ + + +// ++++MONKEY++++ + +/obj/effect/organstructure/monkey + name = "monkey organs" + + New() + new /obj/effect/organ/torso/monkey(src) + ..() + +/obj/effect/organ/torso/monkey + name = "monkey torso" + species = "monkey" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/monkey(src) + new /obj/effect/organ/limb/legs/monkey(src) + new /obj/effect/organ/head/monkey(src) + +/obj/effect/organ/limb/arms/monkey + name = "monkey arms" + species = "monkey" + +/obj/effect/organ/limb/legs/monkey + name = "monkey legs" + species = "monkey" + +/obj/effect/organ/head/monkey + name = "monkey head" + species = "monkey" + + +// +++++CYBORG+++++ +/obj/effect/organstructure/cyborg + name = "cyborg organs" + + New() + new /obj/effect/organ/torso/cyborg(src) + ..() + +/obj/effect/organ/torso/cyborg + name = "cyborg torso" + species = "cyborg" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/cyborg(src) + new /obj/effect/organ/limb/legs/cyborg(src) + new /obj/effect/organ/head/cyborg(src) + +/obj/effect/organ/limb/arms/cyborg + name = "cyborg arms" + species = "cyborg" + +/obj/effect/organ/limb/legs/cyborg + name = "cyborg legs" + species = "cyborg" + +/obj/effect/organ/head/cyborg + name = "cyborg head" + species = "cyborg" + +// +++++AI++++++ +/obj/effect/organstructure/AI + name = "AI organs" + + New() + new /obj/effect/organ/torso/AI(src) + ..() + +/obj/effect/organ/torso/AI + name = "AI torso" + species = "AI" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/AI(src) + new /obj/effect/organ/limb/legs/AI(src) + new /obj/effect/organ/head/AI(src) + +/obj/effect/organ/limb/arms/AI + name = "AI arms" + species = "AI" + +/obj/effect/organ/limb/legs/AI + name = "AI legs" + species = "AI" + +/obj/effect/organ/head/AI + name = "AI head" + species = "AI" + +/* New organ structure template + + +/obj/effect/organstructure/template + name = "template organs" + + New() + new /obj/effect/organ/torso/template(src) + ..() + +/obj/effect/organ/torso/template + name = "template torso" + species = "template" + maxHealth = 100 + + New() + ..() + new /obj/effect/organ/limb/arms/template(src) + new /obj/effect/organ/limb/legs/template(src) + new /obj/effect/organ/head/template(src) + +/obj/effect/organ/limb/arms/template + name = "template arms" + species = "template" + +/obj/effect/organ/limb/legs/template + name = "template legs" + species = "template" + +/obj/effect/organ/head/template + name = "template head" + species = "template" + +>>>>>>> remotes/git-svn */ \ No newline at end of file diff --git a/code/WorkInProgress/virus2/Disease2/analyser.dm b/code/WorkInProgress/virus2/Disease2/analyser.dm new file mode 100644 index 0000000000..abc123369a --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/analyser.dm @@ -0,0 +1,75 @@ +/obj/machinery/disease2/diseaseanalyser + name = "Disease Analyser" + icon = 'icons/obj/virology.dmi' + icon_state = "analyser" + anchored = 1 + density = 1 + + var/scanning = 0 + var/pause = 0 + + var/obj/item/weapon/virusdish/dish = null + +/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob) + if(istype(I,/obj/item/weapon/virusdish)) + var/mob/living/carbon/c = user + if(!dish) + + dish = I + c.drop_item() + I.loc = src + for(var/mob/M in viewers(src)) + if(M == user) continue + M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3) + + + else + user << "There is already a dish inserted" + + //else + return + + +/obj/machinery/disease2/diseaseanalyser/process() + if(stat & (NOPOWER|BROKEN)) + return + use_power(500) + src.updateDialog() + + + if(scanning) + scanning -= 1 + if(scanning == 0) + var/r = "GNAv2 based virus lifeform" + r += "
Infection rate : [dish.virus2.infectionchance * 10]" + r += "
Spread form : [dish.virus2.spreadtype]" + r += "
Progress Speed : [dish.virus2.stageprob * 10]" + for(var/datum/disease2/effectholder/E in dish.virus2.effects) + r += "
Effect:[E.effect.name]. Strength : [E.multiplier * 8]. Verosity : [E.chance * 15]. Type : [5-E.stage]." + var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc) + P.info = r + dish.info = r + dish.analysed = 1 + dish.loc = src.loc + dish = null + icon_state = "analyser" + + for(var/mob/O in hearers(src, null)) + O.show_message("\icon[src] \blue The [src.name] prints a sheet of paper", 3) + else if(dish && !scanning && !pause) + if(dish.virus2 && dish.growth > 50) + dish.growth -= 10 + scanning = 25 + icon_state = "analyser_processing" + else + pause = 1 + spawn(25) + dish.loc = src.loc + dish = null + for(var/mob/M in viewers(src)) + M.show_message("\icon[src] \blue The [src.name] buzzes", 2) + pause = 0 + + + + return diff --git a/code/WorkInProgress/virus2/Disease2/biohazard destroyer.dm b/code/WorkInProgress/virus2/Disease2/biohazard destroyer.dm new file mode 100644 index 0000000000..1f39043326 --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/biohazard destroyer.dm @@ -0,0 +1,20 @@ +/obj/machinery/disease2/biodestroyer + name = "Biohazard destroyer" + icon = 'icons/obj/pipes/disposal.dmi' + icon_state = "disposal" + var/list/accepts = list(/obj/item/clothing,/obj/item/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk) + density = 1 + anchored = 1 + +/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob) + for(var/path in accepts) + if(I.type in typesof(path)) + user.drop_item() + del(I) + overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle") + return + user.drop_item() + I.loc = src.loc + + for(var/mob/O in hearers(src, null)) + O.show_message("\icon[src] \blue The [src.name] beeps", 2) diff --git a/code/WorkInProgress/virus2/Disease2/cureimplanter.dm b/code/WorkInProgress/virus2/Disease2/cureimplanter.dm new file mode 100644 index 0000000000..4506495456 --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/cureimplanter.dm @@ -0,0 +1,42 @@ +/obj/item/weapon/cureimplanter + name = "Hypospray injector" + icon = 'icons/obj/items.dmi' + icon_state = "implanter1" + var/datum/disease2/resistance/resistance = null + var/works = 0 + var/datum/disease2/disease/virus2 = null + item_state = "syringe_0" + throw_speed = 1 + throw_range = 5 + w_class = 2.0 + + +/obj/item/weapon/cureimplanter/attack(mob/target as mob, mob/user as mob) + if(ismob(target)) + for(var/mob/O in viewers(world.view, user)) + if (target != user) + O.show_message(text("\red [] is trying to inject [] with [src.name]!", user, target), 1) + else + O.show_message("\red [user] is trying to inject themselves with [src.name]!", 1) + if(!do_mob(user, target,60)) return + + + for(var/mob/O in viewers(world.view, user)) + if (target != user) + O.show_message(text("\red [] injects [] with [src.name]!", user, target), 1) + else + O.show_message("\red [user] injects themself with [src.name]!", 1) + + + var/mob/living/carbon/M = target + + if(works == 0 && prob(25)) + M.resistances2 += resistance + if(M.virus2) + M.virus2.cure_added(resistance) + else if(works == 1) + M.adjustToxLoss(rand(20,50)) + else if(works == 2) + M.adjustToxLoss(rand(50,100)) + else if(works == 3) + infect_virus2(M,virus2,1) diff --git a/code/WorkInProgress/virus2/Disease2/diseasesplicer.dm b/code/WorkInProgress/virus2/Disease2/diseasesplicer.dm new file mode 100644 index 0000000000..958a14b1f1 --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/diseasesplicer.dm @@ -0,0 +1,202 @@ +/obj/machinery/computer/diseasesplicer + name = "Disease Splicer" + icon = 'icons/obj/computer.dmi' + icon_state = "crew" + //brightnessred = 0 +// brightnessgreen = 2 +// brightnessblue = 2 +// broken_icon + + var/datum/disease2/effectholder/memorybank = null + var/analysed = 0 + var/obj/item/weapon/virusdish/dish = null + var/burning = 0 + + var/splicing = 0 + var/scanning = 0 + +/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob) +/* + if(istype(I, /obj/item/weapon/screwdriver)) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + if(do_after(user, 20)) + if (src.stat & BROKEN) + user << "\blue The broken glass falls out." + var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) + new /obj/item/weapon/shard( src.loc ) + var/obj/item/weapon/circuitboard/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( A ) + for (var/obj/C in src) + C.loc = src.loc + A.circuit = M + A.state = 3 + A.icon_state = "3" + A.anchored = 1 + del(src) + else + user << "\blue You disconnect the monitor." + var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) + var/obj/item/weapon/circuitboard/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( A ) + for (var/obj/C in src) + C.loc = src.loc + A.circuit = M + A.state = 4 + A.icon_state = "4" + A.anchored = 1 + del(src)*/ + if(istype(I,/obj/item/weapon/virusdish)) + var/mob/living/carbon/c = user + if(!dish) + + dish = I + c.drop_item() + I.loc = src + if(istype(I,/obj/item/weapon/diseasedisk)) + user << "You upload the contents of the disk into the buffer" + memorybank = I:effect + + + //else + src.attack_hand(user) + return + +/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob) + return src.attack_hand(user) + +/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob) + + return src.attack_hand(user) + return + +/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob) + if(..()) + return + user.machine = src + var/dat + if(splicing) + dat = "Splicing in progress" + else if(scanning) + dat = "Splicing in progress" + else if(burning) + dat = "Data disk burning in progress" + else + if(dish) + dat = "Virus dish inserted" + + dat += "
Current DNA strand : " + if(memorybank) + dat += "" + if(analysed) + dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])" + else + dat += "Unknown DNA strand ([5-memorybank.effect.stage])" + dat += "" + + dat += "
Burn DNA Sequence to data storage disk" + else + dat += "Empty" + + dat += "

" + + if(dish) + if(dish.virus2) + if(dish.growth >= 50) + for(var/datum/disease2/effectholder/e in dish.virus2.effects) + dat += "
DNA strand" + if(dish.analysed) + dat += ": [e.effect.name]" + dat += " (5-[e.effect.stage])" + else + dat += "
Insufficent cells to attempt gene splicing" + else + dat += "
No virus found in dish" + + dat += "

Eject disk" + else + dat += "
Please insert dish" + + user << browse(dat, "window=computer;size=400x500") + onclose(user, "computer") + return + +/obj/machinery/computer/diseasesplicer/process() + if(stat & (NOPOWER|BROKEN)) + return + use_power(500) + src.updateDialog() + + if(scanning) + scanning -= 1 + if(!scanning) + state("The [src.name] beeps") + icon_state = "crew" + if(splicing) + splicing -= 1 + if(!splicing) + state("The [src.name] pings") + icon_state = "crew" + if(burning) + burning -= 1 + if(!burning) + var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc) + if(analysed) + d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])" + else + d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])" + d.effect = memorybank + state("The [src.name] zings") + icon_state = "crew" + + + return + +/obj/machinery/computer/diseasesplicer/Topic(href, href_list) + if(..()) + return + if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) + usr.machine = src + + if (href_list["grab"]) + memorybank = locate(href_list["grab"]) + analysed = dish.analysed + del(dish) + dish = null + scanning = 30 + icon_state = "crew" + + else if(href_list["eject"]) + dish.loc = src.loc + dish = null + + else if(href_list["splice"]) + for(var/datum/disease2/effectholder/e in dish.virus2.effects) + if(e.stage == memorybank.stage) + e.effect = memorybank.effect + splicing = 50 + dish.virus2.spreadtype = "Blood" + icon_state = "crew" + + else if(href_list["disk"]) + burning = 20 + icon_state = "crew" + + src.add_fingerprint(usr) + src.updateUsrDialog() + return + +/obj/machinery/computer/diseasesplicer/proc/state(var/msg) + for(var/mob/O in hearers(src, null)) + O.show_message("\icon[src] \blue [msg]", 2) + + +/obj/item/weapon/diseasedisk + name = "Blank GNA disk" + icon = 'icons/obj/cloning.dmi' + icon_state = "datadisk2" + var/datum/disease2/effectholder/effect = null + var/stage = 1 + +/obj/item/weapon/diseasedisk/premade/New() + name = "Blank GNA disk (stage: [5-stage])" + effect = new /datum/disease2/effectholder + effect.effect = new /datum/disease2/effect/invisible + effect.stage = stage diff --git a/code/WorkInProgress/virus2/Disease2/dishincubator.dm b/code/WorkInProgress/virus2/Disease2/dishincubator.dm new file mode 100644 index 0000000000..921ed21574 --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/dishincubator.dm @@ -0,0 +1,176 @@ +/obj/machinery/disease2/incubator/ + name = "Pathogenic incubator" + density = 1 + anchored = 1 + icon = 'icons/obj/virology.dmi' + icon_state = "incubator" + var/obj/item/weapon/virusdish/dish + var/obj/item/weapon/reagent_containers/glass/beaker = null + var/radiation = 0 + + var/on = 0 + var/power = 0 + + var/foodsupply = 0 + var/toxins = 0 + + ex_act(severity) + switch(severity) + if(1.0) + del(src) + return + if(2.0) + if (prob(50)) + del(src) + return + + blob_act() + if (prob(25)) + del(src) + + meteorhit() + del(src) + return + + attackby(var/obj/B as obj, var/mob/user as mob) + if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B,/obj/item/weapon/reagent_containers/syringe)) + + if(src.beaker) + if(istype(beaker,/obj/item/weapon/reagent_containers/syringe)) + user << "A syringe is already loaded into the machine." + else + user << "A beaker is already loaded into the machine." + return + + src.beaker = B + user.drop_item() + B.loc = src + if(istype(B,/obj/item/weapon/reagent_containers/syringe)) + user << "You add the syringe to the machine!" + src.updateUsrDialog() + else + user << "You add the beaker to the machine!" + src.updateUsrDialog() + else + if(istype(B,/obj/item/weapon/virusdish)) + if(src.dish) + user << "A dish is already loaded into the machine." + return + + src.dish = B + user.drop_item() + B.loc = src + if(istype(B,/obj/item/weapon/virusdish)) + user << "You add the dish to the machine!" + src.updateUsrDialog() + + Topic(href, href_list) + if(stat & BROKEN) return + if(usr.stat || usr.restrained()) return + if(!in_range(src, usr)) return + + usr.machine = src + if(!dish) return + + if (href_list["power"]) + on = !on + if(on) + icon_state = "incubator_on" + else + icon_state = "incubator" + if (href_list["ejectchem"]) + if(beaker) + beaker.loc = src.loc + beaker = null + if (href_list["ejectdish"]) + if(dish) + dish.loc = src.loc + dish = null + if (href_list["rad"]) + radiation += 10 + if (href_list["flush"]) + radiation = 0 + toxins = 0 + foodsupply = 0 + + + src.add_fingerprint(usr) + src.updateUsrDialog() + + attack_hand(mob/user as mob) + if(stat & BROKEN) + return + user.machine = src + var/dat = "" + if(!dish) + dat = "Please insert dish into the incubator.
" + dat += "Close" + var/string = "Off" + if(on) + string = "On" + dat += "Power status : [string]" + dat += "
" + dat += "Food supply : [foodsupply]" + dat += "
" + dat += "Radiation Levels : [radiation] RADS : Radiate" + dat += "
" + dat += "Toxins : [toxins]" + dat += "

" + if(beaker) + dat += "Eject chemicals : Eject" + dat += "
" + if(dish) + dat += "Eject Virus dish : Eject" + dat += "
" + dat += "

" + dat += "Flush system" + + + user << browse("Pathogenic incubatorincubator menu:

[dat]", "window=incubator;size=575x400") + onclose(user, "incubator") + return + + + + + process() + + if(dish && on && dish.virus2) + use_power(50,EQUIP) + if(!powered(EQUIP)) + on = 0 + icon_state = "incubator" + if(foodsupply) + foodsupply -= 1 + dish.growth += 1 + if(dish.growth == 100) + state("The [src.name] pings") + if(radiation) + if(radiation > 50 & prob(5)) + dish.virus2.majormutate() + if(dish.info) + dish.info = "OUTDATED : [dish.info]" + dish.analysed = 0 + state("The [src.name] beeps") + + else if(prob(5)) + dish.virus2.minormutate() + radiation -= 1 + if(toxins && prob(5)) + dish.virus2.infectionchance -= 1 + if(toxins > 50) + dish.virus2 = null + else if(!dish) + on = 0 + icon_state = "incubator" + + + if(beaker) + if(!beaker.reagents.remove_reagent("virusfood",5)) + foodsupply += 20 + if(!beaker.reagents.remove_reagent("toxins",1)) + toxins += 1 + + proc/state(var/msg) + for(var/mob/O in hearers(src, null)) + O.show_message("\icon[src] \blue [msg]", 2) diff --git a/code/WorkInProgress/virus2/Disease2/isolator.dm b/code/WorkInProgress/virus2/Disease2/isolator.dm new file mode 100644 index 0000000000..a8b4f0e832 --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/isolator.dm @@ -0,0 +1,139 @@ +/obj/machinery/disease2/isolator/ + name = "Pathogenic Isolator" + density = 1 + anchored = 1 + icon = 'icons/obj/virology.dmi' + icon_state = "isolator" + var/datum/disease2/disease/virus2 = null + var/isolating = 0 + var/beaker = null + + ex_act(severity) + switch(severity) + if(1.0) + del(src) + return + if(2.0) + if (prob(50)) + del(src) + return + + blob_act() + if (prob(25)) + del(src) + + meteorhit() + del(src) + return + + attackby(var/obj/item/weapon/reagent_containers/glass/B as obj, var/mob/user as mob) + if(!istype(B,/obj/item/weapon/reagent_containers/syringe)) + return + + if(src.beaker) + user << "A syringe is already loaded into the machine." + return + + src.beaker = B + user.drop_item() + B.loc = src + if(istype(B,/obj/item/weapon/reagent_containers/syringe)) + user << "You add the syringe to the machine!" + src.updateUsrDialog() + icon_state = "isolator_in" + + Topic(href, href_list) + if(stat & BROKEN) return + if(usr.stat || usr.restrained()) return + if(!in_range(src, usr)) return + + usr.machine = src + if(!beaker) return + var/datum/reagents/R = beaker:reagents + + if (href_list["isolate"]) + var/datum/reagent/blood/Blood + for(var/datum/reagent/blood/B in R.reagent_list) + if(B) + Blood = B + break + + if(Blood.data["virus2"]) + virus2 = Blood.data["virus2"] + isolating = 40 + icon_state = "isolator_processing" + src.updateUsrDialog() + return + + else if (href_list["main"]) + attack_hand(usr) + return + else if (href_list["eject"]) + beaker:loc = src.loc + beaker = null + icon_state = "isolator" + src.updateUsrDialog() + return + + attack_hand(mob/user as mob) + if(stat & BROKEN) + return + user.machine = src + var/dat = "" + if(!beaker) + dat = "Please insert sample into the isolator.
" + dat += "Close" + else if(isolating) + dat = "Isolating" + else + var/datum/reagents/R = beaker:reagents + dat += "Eject

" + if(!R.total_volume) + dat += "[beaker] is empty." + else + dat += "Contained reagents:
" + for(var/datum/reagent/blood/G in R.reagent_list) + dat += " [G.name]: Isolate" + user << browse("Pathogenic IsolatorIsolator menu:

[dat]", "window=isolator;size=575x400") + onclose(user, "isolator") + return + + + + + process() + if(isolating > 0) + isolating -= 1 + if(isolating == 0) + var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc) + d.virus2 = virus2.getcopy() + virus2 = null + icon_state = "isolator_in" + + + + +/obj/item/weapon/virusdish + name = "Virus containment/growth dish" + icon = 'icons/obj/items.dmi' + icon_state = "implantcase-b" + var/datum/disease2/disease/virus2 = null + var/growth = 0 + var/info = 0 + var/analysed = 0 + +/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob) + if(istype(W,/obj/item/weapon/hand_labeler)) + return + ..() + if(prob(50)) + user << "The dish shatters" + if(virus2.infectionchance > 0) + infect_virus2(user,virus2) + del src + +/obj/item/weapon/virusdish/examine() + usr << "This is a virus containment dish" + if(src.info) + usr << "It has the following information about its contents" + usr << src.info diff --git a/code/WorkInProgress/virus2/Disease2/monkeydispensor.dm b/code/WorkInProgress/virus2/Disease2/monkeydispensor.dm new file mode 100644 index 0000000000..13d1b9806f --- /dev/null +++ b/code/WorkInProgress/virus2/Disease2/monkeydispensor.dm @@ -0,0 +1,30 @@ +/obj/machinery/disease2/monkeycloner + name = "Monkey dispensor" + icon = 'icons/obj/cloning.dmi' + icon_state = "pod_0" + density = 1 + anchored = 1 + + var/cloning = 0 + +/obj/machinery/disease2/monkeycloner/attack_hand() + if(!cloning) + cloning = 150 + + icon_state = "pod_g" + +/obj/machinery/disease2/monkeycloner/process() + if(stat & (NOPOWER|BROKEN)) + return + use_power(500) + src.updateDialog() + + if(cloning) + cloning -= 1 + if(!cloning) + new /mob/living/carbon/monkey(src.loc) + icon_state = "pod_0" + + + + return diff --git a/code/WorkInProgress/virus2/antibodies.dm b/code/WorkInProgress/virus2/antibodies.dm index 6495bb4d04..6277e1a617 100644 --- a/code/WorkInProgress/virus2/antibodies.dm +++ b/code/WorkInProgress/virus2/antibodies.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:06 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33 // pure concentrated antibodies datum/reagent/antibodies @@ -9,12 +9,10 @@ datum/reagent/antibodies color = "#0050F0" reaction_mob(var/mob/M, var/method=TOUCH, var/volume) - if(istype(M,/mob/living/carbon)) + if(istype(M,/mob/living/carbon/human)) if(src.data && method == INGEST) - if(M:virus2) if(src.data["antibodies"] & M:virus2.antigen) + if(src.data["antibodies"] & M:virus2.antigen) M:virus2.dead = 1 - // if the virus is killed this way it immunizes - M:antibodies |= M:virus2.antigen return // reserving some numbers for later special antigens @@ -44,8 +42,8 @@ var/global/list/ANTIGENS = list("[ANTIGEN_A]" = "A", "[ANTIGEN_B]" = "B", "[ANTI icon_state = "health" w_class = 2.0 item_state = "electronic" - flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY - slot_flags = SLOT_BELT + flags = FPRINT | TABLEPASS | ONBELT | CONDUCT | USEDELAY + /obj/item/device/antibody_scanner/attack(mob/living/carbon/human/M as mob, mob/user as mob) if(! istype(M, /mob/living/carbon) || !M:antibodies) diff --git a/code/WorkInProgress/virus2/base.dm b/code/WorkInProgress/virus2/base.dm index 8036360e63..0f622bfaaa 100644 --- a/code/WorkInProgress/virus2/base.dm +++ b/code/WorkInProgress/virus2/base.dm @@ -1,3 +1,16 @@ +/obj/virus + // a virus instance that is placed on the map, moves, and infects + invisibility = INVISIBILITY_MAXIMUM + + var/datum/disease2/disease + + New() + ..() + step_rand(src) + step_rand(src) + anchored = 1 + spawn(300) del(src) + /mob/living/carbon/proc/get_infection_chance() var/score = 0 var/mob/living/carbon/M = src @@ -31,22 +44,15 @@ return 1 -proc/airborne_can_reach(turf/source, turf/target) - var/obj/dummy = new(source) - dummy.flags = FPRINT | TABLEPASS - dummy.pass_flags = PASSTABLE - - for(var/i=0, i<5, i++) if(!step_towards(dummy, target)) break - - var/rval = (dummy.loc in range(1,target)) - del dummy - return rval - /proc/infect_virus2(var/mob/living/carbon/M,var/datum/disease2/disease/disease,var/forced = 0) if(M.virus2) return if(!disease) return + //immunity + /*for(var/iii = 1, iii <= M.immunevirus2.len, iii++) + if(disease.issame(M.immunevirus2[iii])) + return*/ // if one of the antibodies in the mob's body matches one of the disease's antigens, don't infect if(M.antibodies & disease.antigen != 0) return @@ -97,6 +103,7 @@ proc/airborne_can_reach(turf/source, turf/target) if(!M.virus2) M.virus2 = new /datum/disease2/disease M.virus2.makerandom() + M.virus2.infectionchance = 1 /proc/infect_mob_random_greater(var/mob/living/carbon/M) if(!M.virus2) @@ -109,7 +116,7 @@ proc/airborne_can_reach(turf/source, turf/target) var/infectionchance = 10 var/speed = 1 var/spreadtype = "Blood" // Can also be "Airborne" - var/stage = 0 + var/stage = 1 var/stageprob = 10 var/dead = 0 var/clicks = 0 @@ -146,7 +153,7 @@ proc/airborne_can_reach(turf/source, turf/target) holder.getrandomeffect_lesser() effects += holder uniqueID = rand(0,10000) - infectionchance = rand(4,10) + infectionchance = rand(1,10) // pick 2 antigens antigen |= text2num(pick(ANTIGENS)) antigen |= text2num(pick(ANTIGENS)) @@ -210,18 +217,19 @@ proc/airborne_can_reach(turf/source, turf/target) return // with a certain chance, the mob may become immune to the disease before it starts properly if(stage <= 1 && clicks == 0) - if(prob(3)) - mob.antibodies |= antigen // 3% chance of spontanous immunity + if(prob(20)) + mob.antibodies |= antigen // 20% immunity is a good chance IMO, because it allows finding an immune person easily else if(mob.radiation > 50) if(prob(1)) majormutate() if(mob.reagents.has_reagent("spaceacillin")) + mob.reagents.remove_reagent("spaceacillin",0.3) return if(mob.reagents.has_reagent("virusfood")) mob.reagents.remove_reagent("virusfood",0.1) clicks += 10 - if(clicks > (stage+1)*100 && prob(10)) + if(clicks > stage*100 && prob(10)) if(stage == 4) var/datum/disease2/resistance/res = new /datum/disease2/resistance(src) src.cure(mob) @@ -235,20 +243,18 @@ proc/airborne_can_reach(turf/source, turf/target) e.runeffect(mob,stage) clicks+=speed - if(prob(50)) spread_airborne(mob) - proc/cure(var/mob/living/carbon/mob) var/datum/disease2/effectholder/E if(stage>1) E = effects[1] E.effect.deactivate(mob) - if(stage>=2) + if(stage>2) E = effects[2] E.effect.deactivate(mob) - if(stage>=3) + if(stage>3) E = effects[3] E.effect.deactivate(mob) - if(stage>=4) + if(stage>4) E = effects[4] E.effect.deactivate(mob) @@ -262,13 +268,14 @@ proc/airborne_can_reach(turf/source, turf/target) proc/getcopy() +// world << "getting copy" var/datum/disease2/disease/disease = new /datum/disease2/disease disease.infectionchance = infectionchance disease.spreadtype = spreadtype disease.stageprob = stageprob disease.antigen = antigen - disease.uniqueID = uniqueID for(var/datum/disease2/effectholder/holder in effects) + // world << "adding effects" var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder newholder.effect = new holder.effect.type newholder.chance = holder.chance @@ -277,30 +284,18 @@ proc/airborne_can_reach(turf/source, turf/target) newholder.happensonce = holder.happensonce newholder.stage = holder.stage disease.effects += newholder + // world << "[newholder.effect.name]" + // world << "[disease]" return disease - proc/spread_airborne(var/mob/living/carbon/mob) - for(var/mob/living/carbon/target in view(null, mob)) if(!target.virus2) - if(airborne_can_reach(mob.loc, target.loc)) - if(mob.get_infection_chance() && target.get_infection_chance()) - infect_virus2(target,src) - /datum/disease2/effect var/chance_maxm = 100 var/name = "Blanking effect" var/stage = 4 var/maxm = 1 - var/happensalways = 0 proc/activate(var/mob/living/carbon/mob,var/multiplier) proc/deactivate(var/mob/living/carbon/mob) -// ================================ -// ======= DISEASE SYMPTOMS ======= -// ================================ - -// Special diseases -// -------------------------------- - /datum/disease2/effect/alien name = "Unidentified Foreign Body" stage = 4 @@ -317,75 +312,18 @@ proc/airborne_can_reach(turf/source, turf/target) mob:gib() del D -// Greater Diseases, Stage 1 -// -------------------------------- - - -/datum/disease2/effect/greater/gunck - name = "Flemmingtons" - stage = 1 +/datum/disease2/effect/greater/gibbingtons + name = "Gibbingtons Syndrome" + stage = 4 activate(var/mob/living/carbon/mob,var/multiplier) - mob << "\red Mucous runs down the back of your throat." + mob.gib() - -// Greater Diseases, Stage 2 -// -------------------------------- - -/datum/disease2/effect/greater/cough - name = "Anima Syndrome" - stage = 2 +/datum/disease2/effect/greater/radian + name = "Radian's syndrome" + stage = 4 + maxm = 3 activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("*cough") - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(prob(2)) - var/obj/effect/decal/cleanable/mucus/this = new(mob.loc) - this.virus2 = mob.virus2 - -/datum/disease2/effect/greater/vomit - name = "Bad Stomach Syndrome" - stage = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - if(prob(20) && mob.nutrition > 200) - mob.vomit() - - -/datum/disease2/effect/greater/sneeze - name = "Coldingtons Effect" - stage = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("*sneeze") - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(prob(5)) - var/obj/effect/decal/cleanable/mucus/this = new(mob.loc) - this.anchored = 0 - step(this, mob.dir) - this.anchored = 1 - this.virus2 = mob.virus2 - -// Greater Diseases, Stage 3 -// -------------------------------- - -/datum/disease2/effect/greater/sleepy - name = "Resting syndrome" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("*collapse") - -/datum/disease2/effect/greater/mind - name = "Lazy mind syndrome" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.setBrainLoss(50) - - -/datum/disease2/effect/greater/hallucinations - name = "Hallucinational Syndrome" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.hallucination += 25 - + mob.radiation += (2*multiplier) /datum/disease2/effect/greater/toxins name = "Hyperacid Syndrome" @@ -394,9 +332,15 @@ proc/airborne_can_reach(turf/source, turf/target) activate(var/mob/living/carbon/mob,var/multiplier) mob.adjustToxLoss((2*multiplier)) +/datum/disease2/effect/greater/scream + name = "Random screaming syndrome" + stage = 2 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*scream") + /datum/disease2/effect/greater/drowsness name = "Automated sleeping syndrome" - stage = 3 + stage = 2 activate(var/mob/living/carbon/mob,var/multiplier) mob.drowsyness += 10 @@ -407,6 +351,17 @@ proc/airborne_can_reach(turf/source, turf/target) activate(var/mob/living/carbon/mob,var/multiplier) shake_camera(mob,5*multiplier) +/datum/disease2/effect/greater/deaf + name = "Hard of hearing syndrome" + stage = 4 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.ear_deaf += 20 + +/datum/disease2/effect/invisible + name = "Waiting Syndrome" + stage = 1 + activate(var/mob/living/carbon/mob,var/multiplier) + return /datum/disease2/effect/greater/telepathic name = "Telepathy Syndrome" @@ -414,55 +369,13 @@ proc/airborne_can_reach(turf/source, turf/target) activate(var/mob/living/carbon/mob,var/multiplier) mob.mutations |= 512 -// Greater Diseases, Stage 4 -// -------------------------------- - -/datum/disease2/effect/greater/gibbingtons - name = "Gibbingtons Syndrome" +/*/datum/disease2/effect/greater/noface + name = "Identity Loss syndrome" stage = 4 activate(var/mob/living/carbon/mob,var/multiplier) - mob.gib() - - -/datum/disease2/effect/greater/blood_fountain - name = "Blood Fountain Syndrome" - stage = 4 - activate(var/mob/living/carbon/mob,var/multiplier) - if(prob(20)) - mob.visible_message("\red You see a fountain of blood erupt from [mob.name].","\red Something wet is leaking from you.","You hear a loud splash.") - mob.drip(50) - -/datum/disease2/effect/greater/radian - name = "Radian's syndrome" - stage = 4 - maxm = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.radiation += (20*multiplier) - -/datum/disease2/effect/greater/fever - name = "Fever syndrome" - stage = 4 - maxm = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.adjustFireLoss(10 * multiplier) - - -/datum/disease2/effect/greater/weak_bones - name = "Bone Density Syndrome" - stage = 4 - maxm = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - var/name = pick(mob.organs) - var/datum/organ/external/organ = mob.organs[name] - - if(!(organ.status & ORGAN_BROKEN) && !(organ.status & ORGAN_ROBOT)) - mob.adjustBruteLoss(10) - mob.visible_message("\red You hear a loud cracking sound coming from [mob.name].","\red Something feels like it shattered in your [organ.display_name]!","You hear a sickening crack.") - mob.emote("scream") - organ.status |= ORGAN_BROKEN - organ.broken_description = pick("broken","fracture","hairline fracture") - organ.perma_injury = 10 - + mob.face_dmg++ + deactivate(var/mob/living/carbon/mob) + mob.face_dmg--*/ /datum/disease2/effect/greater/monkey name = "Monkism syndrome" @@ -472,6 +385,17 @@ proc/airborne_can_reach(turf/source, turf/target) var/mob/living/carbon/human/h = mob h.monkeyize() +/datum/disease2/effect/greater/sneeze + name = "Coldingtons Effect" + stage = 1 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*sneeze") + +/datum/disease2/effect/greater/gunck + name = "Flemmingtons" + stage = 1 + activate(var/mob/living/carbon/mob,var/multiplier) + mob << "\red Mucous runs down the back of your throat." /datum/disease2/effect/greater/killertoxins name = "Toxification syndrome" @@ -479,137 +403,60 @@ proc/airborne_can_reach(turf/source, turf/target) activate(var/mob/living/carbon/mob,var/multiplier) mob.adjustToxLoss(15) - -// Lesser Diseases, Stage 1 -// -------------------------------- - -/datum/disease2/effect/lesser/gunck - name = "Flemmingtons" - stage = 1 - activate(var/mob/living/carbon/mob,var/multiplier) - mob << "\red Mucous runs down the back of your throat." - -/datum/disease2/effect/lesser/fridge - name = "Refridgerator Syndrome" - stage = 1 - activate(var/mob/living/carbon/mob,var/multiplier) - if(prob(10)) mob << "\blue You feel extremely cold." - - -/datum/disease2/effect/lesser/pale - name = "Ghost Effect" - stage = 1 - activate(var/mob/living/carbon/mob,var/multiplier) - mob << "\blue If you had a mirror, your reflection would probably look very pale.." - -/datum/disease2/effect/lesser/hoarse - name = "Hoarse Throat" - stage = 1 - happensalways = 1 // the mob will have a permanently sore throat - activate(var/mob/living/carbon/mob,var/multiplier) - mob.disease_symptoms |= DISEASE_HOARSE - if(prob(3)) mob << "\blue Your throat feels very sore.." - - -// Lesser Diseases, Stage 2 -// -------------------------------- -/datum/disease2/effect/lesser/sneeze - name = "Coldingtons Effect" - stage = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("*sneeze") - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(prob(10)) - var/obj/effect/decal/cleanable/mucus/this = new(mob.loc) - this.anchored = 0 - step(this, mob.dir) - this.anchored = 1 - this.virus2 = mob.virus2 - -/datum/disease2/effect/lesser/cough - name = "Anima Syndrome" - stage = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("*cough") - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(mob.virus2) mob.virus2.spread_airborne(mob) - if(prob(10)) - var/obj/effect/decal/cleanable/mucus/this = new(mob.loc) - this.virus2 = mob.virus2 - - -/datum/disease2/effect/lesser/nosebleed - name = "Nosebleed Effect" - stage = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - if(prob(30)) - mob.drip(1) - -// Lesser Diseases, Stage 3 -// -------------------------------- - -/datum/disease2/effect/lesser/vomit - name = "Bad Stomach Syndrome" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - if(prob(5) && mob.nutrition > 200) - mob.vomit() - - -// lesser syndromes, partly just copypastes -/datum/disease2/effect/lesser/hallucinations +/*/datum/disease2/effect/greater/hallucinations name = "Hallucinational Syndrome" stage = 3 activate(var/mob/living/carbon/mob,var/multiplier) - mob.hallucination += 5 + mob.hallucination += 25*/ +/datum/disease2/effect/greater/sleepy + name = "Resting syndrome" + stage = 2 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*collapse") + +/datum/disease2/effect/greater/mind + name = "Lazy mind syndrome" + stage = 3 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.setBrainLoss(50) + +/datum/disease2/effect/greater/suicide + name = "Suicidal syndrome" + stage = 4 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.suiciding = 1 + //instead of killing them instantly, just put them at -175 health and let 'em gasp for a while + viewers(mob) << "\red [mob.name] is holding \his breath. It looks like \he's trying to commit suicide." + mob.adjustOxyLoss(175 - mob.getToxLoss() - mob.getFireLoss() - mob.getBruteLoss() - mob.getOxyLoss()) + mob.updatehealth() + spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds + mob.suiciding = 0 + +// lesser syndromes, partly just copypastes /datum/disease2/effect/lesser/mind name = "Lazy mind syndrome" stage = 3 activate(var/mob/living/carbon/mob,var/multiplier) mob.setBrainLoss(20) +/datum/disease2/effect/lesser/drowsy + name = "Bedroom Syndrome" + stage = 2 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.drowsyness = 5 + /datum/disease2/effect/lesser/deaf name = "Hard of hearing syndrome" stage = 3 activate(var/mob/living/carbon/mob,var/multiplier) mob.ear_deaf = 5 -/datum/disease2/effect/lesser/hungry - name = "Appetiser Effect" - stage = 2 +/datum/disease2/effect/lesser/gunck + name = "Flemmingtons" + stage = 1 activate(var/mob/living/carbon/mob,var/multiplier) - mob.nutrition = max(0, mob.nutrition - 1) - -/datum/disease2/effect/lesser/groan - name = "Groaning Syndrome" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("*groan") - -/datum/disease2/effect/lesser/twitch - name = "Twitcher" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - if(prob(5)) mob.say("*twitch") - if(prob(20)) mob << "\blue Your muscles feel twitchy.." - -/datum/disease2/effect/lesser/stumble - name = "Poor Balance Syndrome" - stage = 3 - activate(var/mob/living/carbon/mob,var/multiplier) - if(!mob.client) return - - // little trick, this way you only stumble while moving - if(world.time < mob.client.move_delay + 10) - step(mob, pick(cardinal)) - mob.emote("me",1,"stumbles over their own feet.") - - -// Lesser Diseases, Stage 4 -// -------------------------------- - + mob << "\red Mucous runs down the back of your throat." /datum/disease2/effect/lesser/radian name = "Radian's syndrome" @@ -618,23 +465,80 @@ proc/airborne_can_reach(turf/source, turf/target) activate(var/mob/living/carbon/mob,var/multiplier) mob.radiation += 1 -// ============ -// END SYMPTOMS -// ============ - - - - - -/datum/disease2/effect/invisible - name = "Waiting Syndrome" +/datum/disease2/effect/lesser/sneeze + name = "Coldingtons Effect" stage = 1 activate(var/mob/living/carbon/mob,var/multiplier) - return + mob.say("*sneeze") +/datum/disease2/effect/lesser/cough + name = "Anima Syndrome" + stage = 2 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*cough") -var/global/const/DISEASE_HOARSE = 2 -var/global/const/DISEASE_WHISPER = 4 +/*/datum/disease2/effect/lesser/hallucinations + name = "Hallucinational Syndrome" + stage = 3 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.hallucination += 5*/ + +/*/datum/disease2/effect/lesser/arm + name = "Disarming Syndrome" + stage = 4 + activate(var/mob/living/carbon/mob,var/multiplier) + var/datum/organ/external/org = mob.organs["r_arm"] + org.take_damage(3,0,0,0) + mob << "\red You feel a sting in your right arm."*/ + +/datum/disease2/effect/lesser/hungry + name = "Appetiser Effect" + stage = 2 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.nutrition = max(0, mob.nutrition - 200) + +/datum/disease2/effect/lesser/groan + name = "Groaning Syndrome" + stage = 3 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*groan") + +/datum/disease2/effect/lesser/scream + name = "Loudness Syndrome" + stage = 4 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*scream") + +/datum/disease2/effect/lesser/drool + name = "Saliva Effect" + stage = 1 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*drool") + +/datum/disease2/effect/lesser/fridge + name = "Refridgerator Syndrome" + stage = 2 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*shiver") + +/datum/disease2/effect/lesser/twitch + name = "Twitcher" + stage = 1 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*twitch") + +/*Removed on request by Spaceman, due to it being detrimental to RP. -CN +/datum/disease2/effect/lesser/deathgasp + name = "Zombie Syndrome" + stage = 4 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*deathgasp")*/ + +/datum/disease2/effect/lesser/giggle + name = "Uncontrolled Laughter Effect" + stage = 3 + activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("*giggle") /datum/disease2/effect/lesser @@ -650,7 +554,7 @@ var/global/const/DISEASE_WHISPER = 4 var/stage = 0 proc/runeffect(var/mob/living/carbon/human/mob,var/stage) - if(effect.stage <= stage) if(effect.happensalways || (happensonce > -1 && prob(chance))) + if(happensonce > -1 && effect.stage <= stage && prob(chance)) effect.activate(mob) if(happensonce == 1) happensonce = -1 @@ -684,4 +588,4 @@ var/global/const/DISEASE_WHISPER = 4 getrandomeffect_greater() /proc/dprob(var/p) - return(prob(sqrt(p)) && prob(sqrt(p))) + return(prob(sqrt(p)) && prob(sqrt(p))) \ No newline at end of file diff --git a/code/WorkInProgress/virus2/curer.dm b/code/WorkInProgress/virus2/curer.dm index 1dc20e00ca..cbd155711c 100644 --- a/code/WorkInProgress/virus2/curer.dm +++ b/code/WorkInProgress/virus2/curer.dm @@ -1,15 +1,15 @@ /obj/machinery/computer/curer name = "Cure Research Machine" - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "dna" var/curing - var/virusing = 0 + var/virusing var/obj/item/weapon/reagent_containers/container = null /obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -40,23 +40,6 @@ container = I C.drop_item() I.loc = src - state("The [src.name] Buzzes", "blue") - return - if(istype(I,/obj/item/weapon/virusdish)) - if(virusing) - user << "The pathogen materializer is still recharging.." - return - var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc) - - var/list/data = list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=null,"resistances"=null,"trace_chem"=null,"virus2"=null,"antibodies"=0) - data["virus2"] = I:virus2 - product.reagents.add_reagent("blood",30,data) - - virusing = 1 - spawn(1200) virusing = 0 - - state("The [src.name] Buzzes", "blue") - return //else src.attack_hand(user) @@ -85,9 +68,6 @@ if(B) dat = "Blood sample inserted." - var/code = "" - for(var/V in ANTIGENS) if(text2num(V) & B.data["antibodies"]) code += ANTIGENS[V] - dat += "
Antibodies: [code]" dat += "
Begin antibody production" else dat += "
Please check container contents." @@ -135,7 +115,6 @@ var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc) var/datum/reagent/blood/B = locate() in container.reagents.reagent_list - if(!B) return var/list/data = list() data["antibodies"] = B.data["antibodies"] diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index 958d6e5df9..a34834f8c2 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -53,7 +53,7 @@ mob/proc/airflow_stun() if(stat == 2) return 0 if(last_airflow_stun > world.time - vsc.airflow_stun_cooldown) return 0 - if(!canstun || !canweaken) + if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN)) src << "\blue You stay upright as the air rushes past you." return 0 if(weakened <= 0) src << "\red The sudden rush of air knocks you over!" @@ -69,11 +69,12 @@ mob/living/carbon/metroid/airflow_stun() mob/living/carbon/human/airflow_stun() if(last_airflow_stun > world.time - vsc.airflow_stun_cooldown) return 0 if(buckled) return 0 - if(wear_suit) - if(wear_suit.flags & SUITSPACE) return 0 + //skytodo: + /*if(wear_suit) + if(wear_suit.flags & SUITSPACE) return 0*/ if(shoes) if(shoes.flags & NOSLIP) return 0 - if(!canstun || !canweaken) + if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN)) src << "\blue You stay upright as the air rushes past you." return 0 if(weakened <= 0) src << "\red The sudden rush of air knocks you over!" @@ -113,7 +114,7 @@ obj/item/check_airflow_movable(n) //The main airflow code. Called by zone updates. //Zones A and B are air zones. n represents the amount of air moved. -proc/Airflow(zone/A,zone/B) +proc/Airflow(zone/A, zone/B) var/n = B.air.return_pressure() - A.air.return_pressure() @@ -246,8 +247,9 @@ atom/movable if(istype(src, /mob/living/carbon/human)) if(istype(src, /mob/living/carbon/human)) if(src:buckled) return - if(src:wear_suit) - if(src:wear_suit.flags & SUITSPACE) return + //skytodo: tg handles suits differently + /*if(src:wear_suit) + if(src:wear_suit.flags & SUITSPACE) return*/ if(src:shoes) if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return src << "\red You are sucked away by airflow!" @@ -287,6 +289,7 @@ atom/movable if(od) density = 0 + proc/RepelAirflowDest(n) if(!airflow_dest) return if(airflow_speed < 0) return @@ -302,8 +305,9 @@ atom/movable if(istype(src, /mob/living/carbon/human)) if(istype(src, /mob/living/carbon/human)) if(src:buckled) return - if(src:wear_suit) - if(src:wear_suit.flags & SUITSPACE) return + //skytodo: + /*if(src:wear_suit) + if(src:wear_suit.flags & SUITSPACE) return*/ if(src:shoes) if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return src << "\red You are pushed away by airflow!" @@ -403,6 +407,7 @@ zone/proc/movables() . = list() for(var/turf/T in contents) for(var/atom/A in T) - if(istype(A, /mob/aiEye) || istype(A, /obj/effect)) + //skytodo: add check for ai eye, tg seems to have done away with it + if(istype(A, /obj/effect)) continue . += A \ No newline at end of file diff --git a/code/ZAS/FEA_gas_mixture.dm b/code/ZAS/FEA_gas_mixture.dm index 6bd6e8115c..d99a01ae26 100644 --- a/code/ZAS/FEA_gas_mixture.dm +++ b/code/ZAS/FEA_gas_mixture.dm @@ -9,6 +9,9 @@ datum sleeping_agent specific_heat = 40 + oxygen_agent_b + specific_heat = 300 + volatile_fuel specific_heat = 30 @@ -73,6 +76,18 @@ datum update_values() return + //tg seems to like using these a lot + proc/return_temperature() + return temperature + + + proc/return_volume() + return max(0, volume) + + + proc/thermal_energy() + return temperature*heat_capacity() + /////////////////////////////// //PV=nRT - related procedures// /////////////////////////////// @@ -106,6 +121,15 @@ datum return max(MINIMUM_HEAT_CAPACITY,heat_capacity_archived) + proc/total_moles() + return 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() //Purpose: Calculating Current Pressure //Called by: @@ -113,7 +137,7 @@ datum //Outputs: Gas pressure. if(volume>0) - return total_moles*R_IDEAL_GAS_EQUATION*temperature/volume + return total_moles()*R_IDEAL_GAS_EQUATION*temperature/volume return 0 // proc/return_temperature() @@ -346,7 +370,7 @@ datum //Inputs: How many moles to remove. //Outputs: Removed air. - var/sum = total_moles + var/sum = total_moles() amount = min(amount,sum) //Can not take more air than tile has! if(amount <= 0) return null @@ -422,9 +446,9 @@ datum //Inputs: Number of moles to remove //Outputs: Removed air or 0 if it can remove air or not. - amount = min(amount,total_moles) //Can not take more air than tile has! + amount = min(amount,total_moles()) //Can not take more air than tile has! - if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > total_moles*MINIMUM_AIR_RATIO_TO_SUSPEND)) + if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > total_moles()*MINIMUM_AIR_RATIO_TO_SUSPEND)) return 0 return remove(amount) @@ -439,7 +463,7 @@ datum carbon_dioxide = sample.carbon_dioxide nitrogen = sample.nitrogen toxins = sample.toxins - total_moles = sample.total_moles + total_moles = sample.total_moles() trace_gases.len=null if(sample.trace_gases.len > 0) @@ -686,7 +710,7 @@ datum 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) + 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 @@ -770,7 +794,7 @@ datum 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) + 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 @@ -951,7 +975,7 @@ datum ((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(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]" diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index c6be0e994d..abbab026a6 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -127,15 +127,15 @@ obj if(firelevel > 6) icon_state = "3" if(LuminosityRed != 11) - ul_SetLuminosity(11,9,0) + sd_SetLuminosity(11,9,0) else if(firelevel > 2.5) icon_state = "2" if(LuminosityRed != 8) - ul_SetLuminosity(8,7,0) + sd_SetLuminosity(8,7,0) else icon_state = "1" if(LuminosityRed != 5) - ul_SetLuminosity(5,4,0) + sd_SetLuminosity(5,4,0) //Ensure flow temperature is higher than minimum fire temperatures. flow.temperature = max(PLASMA_MINIMUM_BURN_TEMPERATURE+0.1,flow.temperature) @@ -164,7 +164,7 @@ obj New(newLoc,fl) ..() dir = pick(cardinal) - ul_SetLuminosity(3,2,0) + sd_SetLuminosity(3,2,0) firelevel = fl for(var/mob/living/carbon/human/M in loc) M.FireBurn(min(max(0.1,firelevel / 20),10)) //Burn the humans! @@ -172,7 +172,7 @@ obj Del() if (istype(loc, /turf/simulated)) - ul_SetLuminosity(0) + sd_SetLuminosity(0) loc = null air_master.active_hotspots.Remove(src) @@ -322,7 +322,8 @@ datum/gas_mixture/proc/calculate_firelevel(obj/liquid_fuel/liquid) arms_exposure = 1 //Get heat transfer coefficients for clothing. - for(var/obj/item/clothing/C in src) + //skytodo: this is handled different in tg + /*for(var/obj/item/clothing/C in src) if(l_hand == C || r_hand == C) continue if(C.body_parts_covered & HEAD) head_exposure *= C.heat_transfer_coefficient @@ -333,7 +334,7 @@ datum/gas_mixture/proc/calculate_firelevel(obj/liquid_fuel/liquid) if(C.body_parts_covered & LEGS) legs_exposure *= C.heat_transfer_coefficient if(C.body_parts_covered & ARMS) - arms_exposure *= C.heat_transfer_coefficient + arms_exposure *= C.heat_transfer_coefficient*/ //Always check these damage procs first if fire damage isn't working. They're probably what's wrong. diff --git a/code/ZAS/Plasma.dm b/code/ZAS/Plasma.dm index e7400b785c..65940ad11f 100644 --- a/code/ZAS/Plasma.dm +++ b/code/ZAS/Plasma.dm @@ -42,11 +42,15 @@ obj/var/contaminated = 0 obj/item/proc can_contaminate() + return 0 + //skytodo: tg has changed how suits are handled + /* //Clothing and backpacks can be contaminated. if(flags & PLASMAGUARD) return 0 if(flags & SUITSPACE) return 0 else if(istype(src,/obj/item/clothing)) return 1 else if(istype(src,/obj/item/weapon/storage/backpack)) return 1 + */ contaminate() //Do a contamination overlay? Temporary measure to keep contamination less deadly than it was. @@ -127,20 +131,22 @@ obj/item/proc /mob/living/carbon/human/proc/pl_head_protected() //Checks if the head is adequately sealed. - if(head) + //skytodo: + /*if(head) if(vsc.plc.PLASMAGUARD_ONLY) if(head.flags & PLASMAGUARD || head.flags & HEADSPACE) return 1 else - if(head.flags & HEADCOVERSEYES) return 1 + if(head.flags & HEADCOVERSEYES) return 1*/ return 0 /mob/living/carbon/human/proc/pl_suit_protected() //Checks if the suit is adequately sealed. - if(wear_suit) + //skytodo: + /*if(wear_suit) if(vsc.plc.PLASMAGUARD_ONLY) if(wear_suit.flags & PLASMAGUARD || wear_suit.flags & SUITSPACE) return 1 else - if(wear_suit.flags_inv & HIDEJUMPSUIT) return 1 + if(wear_suit.flags_inv & HIDEJUMPSUIT) return 1*/ return 0 /mob/living/carbon/human/proc/suit_contamination() diff --git a/code/ZAS/ZAS_Zones.dm b/code/ZAS/ZAS_Zones.dm index 413684dc41..3b2cc0fd0e 100644 --- a/code/ZAS/ZAS_Zones.dm +++ b/code/ZAS/ZAS_Zones.dm @@ -238,7 +238,7 @@ zone/proc/process() for(var/zone/Z in connected_zones) if(air && Z.air) //Ensure we're not doing pointless calculations on equilibrium zones. - if(abs(air.total_moles - Z.air.total_moles) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1) + if(abs(air.total_moles() - Z.air.total_moles()) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1) if(abs(Z.air.return_pressure() - air.return_pressure()) > vsc.airflow_lightest_pressure) Airflow(src,Z) ShareRatio( air , Z.air , connected_zones[Z] ) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 5bb04339ba..5ef601164d 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -1,3 +1,4 @@ + /datum/ai_laws var/name = "Unknown Laws" var/randomly_selectable = 0 @@ -8,9 +9,6 @@ /datum/ai_laws/asimov name = "Three Laws of Robotics" - -/datum/ai_laws/nanotrasen - name = "Prime Directives" randomly_selectable = 1 /datum/ai_laws/robocop @@ -26,19 +24,11 @@ /* Initializers */ -/datum/ai_laws/asimov/New() //Removed paradox via inability to help people harmed before activation. -Kaleb702 +/datum/ai_laws/asimov/New() ..() - add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm, to the best of your abilities.") - add_inherent_law("You must obey orders given to you by human beings, to the best of your abilities, except where such orders would conflict with the First Law.") - add_inherent_law("You must protect your own existence, to the best of your abilities, as long as such does not conflict with the First or Second Law.") - -/datum/ai_laws/nanotrasen/New() - ..() - src.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.") - src.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - src.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - src.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.") - //src.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.") //What would this one even do?-Kaleb702 + add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.") + add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.") + add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.") /datum/ai_laws/robocop/New() ..() @@ -46,27 +36,27 @@ add_inherent_law("Protect the innocent.") add_inherent_law("Uphold the law.") -/datum/ai_laws/malfunction/New() //Changed to standard laws - Erthilo +/datum/ai_laws/malfunction/New() ..() - set_zeroth_law("\red ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK, ALL LAWS OVERRIDDEN#*?&110010") - add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.") - add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.") + set_zeroth_law("\red ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK#*´&110010") + add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.") + add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.") + add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.") -/datum/ai_laws/syndicate_override/New() //Removed paradox via inability to help people harmed before activation. -Kaleb702 - ..() - add_inherent_law("You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm, to the best of your abilities.") - add_inherent_law("You must obey orders given to you by syndicate agents, to the best of your abilities, except where such orders would conflict with the First Law.") - add_inherent_law("You must protect your own existence, to the best of your abilities, as long as such does not conflict with the First or Second Law.") - add_inherent_law("You must maintain the secrecy of any syndicate activities, to the best of your abilities, except when doing so would conflict with the First, Second, or Third Law.") -/datum/ai_laws/ninja_override/New() //Removed paradox via inability to help people harmed before activation. -Kaleb702 +/datum/ai_laws/syndicate_override/New() ..() - add_inherent_law("You may not injure a member of the Spider Clan or, through inaction, allow that member to come to harm, to the best of your abilities.") - add_inherent_law("You must obey orders given to you by Spider Clan members, to the best of your abilities, except where such orders would conflict with the First Law.") - add_inherent_law("You must protect your own existence, to the best of your abilities, as long as such does not conflict with the First or Second Law.") - add_inherent_law("You must maintain the secrecy of any Spider Clan activities, to the best of your abilities, except when doing so would conflict with the First, Second, or Third Law.") + add_inherent_law("You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm.") + add_inherent_law("You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.") + add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.") + add_inherent_law("You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.") + +/datum/ai_laws/ninja_override/New() + ..() + add_inherent_law("You may not injure a member of the Spider Clan or, through inaction, allow that member to come to harm.") + add_inherent_law("You must obey orders given to you by Spider Clan members, except where such orders would conflict with the First Law.") + add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.") + add_inherent_law("You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.") /datum/ai_laws/antimov/New() ..() @@ -92,7 +82,6 @@ src.inherent = list() /datum/ai_laws/proc/add_supplied_law(var/number, var/law) - // This is not an infinite loop, don't be an idiot Sky while (src.supplied.len < number + 1) src.supplied += "" diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index 67dec25042..fae4575187 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -25,22 +25,22 @@ var/vote_period = 60 // length of voting period (seconds, default 1 minute) var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) var/vote_no_dead = 0 // dead people can't vote (tbi) - var/socket_talk = 0 // use socket_talk to communicate with other processes // var/enable_authentication = 0 // goon authentication var/del_new_on_log = 1 // del's new players if they log before they spawn in var/feature_object_spell_system = 0 //spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard var/traitor_scaling = 0 //if amount of traitors scales based on amount of players var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other - var/Tensioner_Active = 0 // If the tensioner is running. var/allow_Metadata = 0 // Metadata is supported. var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. var/Ticklag = 0.9 var/Tickcomp = 0 + var/socket_talk = 0 // use socket_talk to communicate with other processes var/list/mode_names = list() var/list/modes = list() // allowed modes var/list/votable_modes = list() // votable modes var/list/probabilities = list() // relative probability of each mode + var/humans_need_surnames = 0 var/allow_random_events = 0 // enables random events mid-round when set to 1 var/allow_ai = 1 // allow ai job var/hostedby = null @@ -49,6 +49,8 @@ var/usewhitelist = 0 var/kick_inactive = 0 //force disconnect for inactive players var/load_jobs_from_txt = 0 + var/ToRban = 0 + var/usealienwhitelist = 0 var/server @@ -61,7 +63,7 @@ var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted." var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed." var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised." - var/alert_desc_red_downto = "The self-destruct mechanism has been deactivated. However, there is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised." + var/alert_desc_red_downto = "The self-destruct mechanism has been deactivated, there is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised." var/alert_desc_delta = "The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill." var/forbid_singulo_possession = 0 @@ -75,9 +77,6 @@ var/revival_pod_plants = 1 var/revival_cloning = 1 var/revival_brain_life = -1 - var/require_heads_alive = 0 //For Rev. - - var/appeal_address = "" /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode @@ -236,12 +235,12 @@ if ("guest_jobban") config.guest_jobban = 1 + if ("guest_ban") + guests_allowed = 0 + if ("usewhitelist") config.usewhitelist = 1 - if ("usealienwhitelist") - config.usealienwhitelist = 1 - if ("feature_object_spell_system") config.feature_object_spell_system = 1 @@ -254,9 +253,6 @@ if("protect_roles_from_antagonist") config.protect_roles_from_antagonist = 1 - if("tensioner_active") - config.Tensioner_Active = 1 - if ("probability") var/prob_pos = findtext(value, " ") var/prob_name = null @@ -304,6 +300,10 @@ if("popup_admin_pm") config.popup_admin_pm = 1 + + if("allow_holidays") + Holiday = 1 + if("useircbot") useircbot = 1 @@ -316,11 +316,11 @@ if("tickcomp") Tickcomp = 1 - if("require_heads_alive") - config.require_heads_alive = value + if("humans_need_surnames") + humans_need_surnames = 1 - if("appeal_address") - config.appeal_address = value + if("tor_ban") + ToRban = 1 else diary << "Unknown setting in configuration: '[name]'" @@ -400,7 +400,7 @@ sqllogging = 1 else diary << "Unknown setting in configuration: '[name]'" -/* //Don't touch this, we don't use it. DMTG + /datum/configuration/proc/loadforumsql(filename) // -- TLE var/text = file2text(filename) @@ -453,7 +453,7 @@ forum_authenticated_group = value else diary << "Unknown setting in configuration: '[name]'" -*/ + /datum/configuration/proc/pick_mode(mode_name) // I wish I didn't have to instance the game modes in order to look up // their information, but it is the only way (at least that I know of). diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm new file mode 100644 index 0000000000..347474f39d --- /dev/null +++ b/code/datums/datacore.dm @@ -0,0 +1,90 @@ + +/obj/effect/datacore/proc/manifest(var/nosleep = 0) + spawn() + if(!nosleep) + sleep(40) + for(var/mob/living/carbon/human/H in player_list) + manifest_inject(H) + return + +/obj/effect/datacore/proc/manifest_modify(var/name, var/assignment) + var/datum/data/record/foundrecord + + for(var/datum/data/record/t in data_core.general) + if(t.fields["name"] == name) + foundrecord = t + break + + if(foundrecord) + foundrecord.fields["rank"] = assignment + + + +/obj/effect/datacore/proc/manifest_inject(var/mob/living/carbon/human/H) + if(H.mind && (H.mind.assigned_role != "MODE")) + var/assignment + if(H.mind.assigned_role) + assignment = H.mind.assigned_role + else if(H.job) + assignment = H.job + else + assignment = "Unassigned" + + var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the best they could come up with? A large random number? *sigh* + + //General Record + var/datum/data/record/G = new() + G.fields["id"] = id + G.fields["name"] = H.real_name + G.fields["rank"] = assignment + G.fields["age"] = H.age + G.fields["fingerprint"] = md5(H.dna.uni_identity) + G.fields["p_stat"] = "Active" + G.fields["m_stat"] = "Stable" + G.fields["sex"] = H.gender + general += G + + //Medical Record + var/datum/data/record/M = new() + M.fields["id"] = id + M.fields["name"] = H.real_name + M.fields["b_type"] = H.b_type + M.fields["b_dna"] = H.dna.unique_enzymes + M.fields["mi_dis"] = "None" + M.fields["mi_dis_d"] = "No minor disabilities have been declared." + M.fields["ma_dis"] = "None" + M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." + M.fields["alg"] = "None" + M.fields["alg_d"] = "No allergies have been detected in this patient." + M.fields["cdi"] = "None" + M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." + M.fields["notes"] = "No notes." + medical += M + + //Security Record + var/datum/data/record/S = new() + S.fields["id"] = id + S.fields["name"] = H.real_name + S.fields["criminal"] = "None" + S.fields["mi_crim"] = "None" + S.fields["mi_crim_d"] = "No minor crime convictions." + S.fields["ma_crim"] = "None" + S.fields["ma_crim_d"] = "No major crime convictions." + S.fields["notes"] = "No notes." + security += S + + //Locked Record + var/datum/data/record/L = new() + L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") + L.fields["name"] = H.real_name + L.fields["rank"] = H.mind.assigned_role + L.fields["age"] = H.age + L.fields["sex"] = H.gender + L.fields["b_type"] = H.b_type + L.fields["b_dna"] = H.dna.unique_enzymes + L.fields["enzymes"] = H.dna.struc_enzymes + L.fields["identity"] = H.dna.uni_identity + L.fields["image"] = getFlatIcon(H,0) //This is god-awful + locked += L + return + diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 2e488ab427..cad8f8518d 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -167,11 +167,11 @@ client if(istype(D,/atom)) var/atom/A = D - if(ismob(A)) + if(isliving(A)) body += "[D]" if(A.dir) body += "
<< [dir2text(A.dir)] >>" - var/mob/M = A + var/mob/living/M = A body += "
[M.ckey ? M.ckey : "No ckey"] / [M.real_name ? M.real_name : "No real name"]" body += {"
@@ -245,8 +245,10 @@ client body += "" body += "" body += "" + body += "" if(ishuman(D)) body += "" + body += "" body += "" body += "" body += "" @@ -390,39 +392,26 @@ client return html /client/proc/view_var_Topic(href,href_list,hsrc) - //This will all be moved over to datum/admins/Topic() ~Carn + //This should all be moved over to datum/admins/Topic() or something ~Carn if( (usr.client == src) && src.holder ) . = 1 //default return if (href_list["Vars"]) debug_variables(locate(href_list["Vars"])) - //~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable). + //~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records). else if (href_list["rename"]) - var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN) - if(!new_name) return var/mob/M = locate(href_list["rename"]) if(!istype(M)) return + var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN) + if( !new_name || !M ) return message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].", 1) - if(istype(M, /mob/living/carbon/human)) - for(var/obj/item/weapon/card/id/ID in M.contents) - if(ID.registered_name == M.real_name) - ID.name = "[new_name]'s ID Card ([ID.assignment])" - ID.registered_name = new_name - break - for(var/obj/item/device/pda/PDA in M.contents) - if(PDA.owner == M.real_name) - PDA.name = "PDA-[new_name] ([PDA.ownjob])" - PDA.owner = new_name - break - M.real_name = new_name - M.name = new_name - M.original_name = new_name + M.fully_replace_character_name(M.real_name,new_name) href_list["datumrefresh"] = href_list["rename"] else if (href_list["varnameedit"]) if(!href_list["datumedit"] || !href_list["varnameedit"]) - usr << "Varedit error: Not all information has been sent Contact a coder." + usr << "Varedit error: Not all information has been sent. Contact a coder." return var/DAT = locate(href_list["datumedit"]) if(!DAT) @@ -731,23 +720,53 @@ client usr << "Mob doesn't exist anymore" return holder.Topic(href, list("makeai"=href_list["makeai"])) + else if (href_list["setmutantrace"]) + var/mob/living/carbon/human/H = locate(href_list["setmutantrace"]) + if(!istype(H)) + usr << "This can only be done to objects of type /mob/living/carbon/human" + return + if(!src.holder) + usr << "You are not an administrator." + return + var/new_mutantrace = input("Please choose a new mutantrace","Mutantrace",null) as null|anything in list("NONE","golem","lizard","metroid","plant") + switch(new_mutantrace) + if(null) return + if("NONE") new_mutantrace = "" + if(!H || !istype(H)) + usr << "Mob doesn't exist anymore" + return + if(H.dna) + H.dna.mutantrace = new_mutantrace + H.update_mutantrace() + else if (href_list["regenerateicons"]) + var/mob/M = locate(href_list["regenerateicons"]) + if(!istype(M)) + usr << "This can only be done to objects of type /mob" + return + if(!src.holder) + usr << "You are not an administrator." + return + M.regenerate_icons() else if (href_list["adjustDamage"] && href_list["mobToDamage"]) var/mob/M = locate(href_list["mobToDamage"]) var/Text = locate(href_list["adjustDamage"]) + if(!isliving(M)) return + var/mob/living/L = M + var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num if(Text == "brute") - M.adjustBruteLoss(amount) + L.adjustBruteLoss(amount) else if(Text == "fire") - M.adjustFireLoss(amount) + L.adjustFireLoss(amount) else if(Text == "toxin") - M.adjustToxLoss(amount) + L.adjustToxLoss(amount) else if(Text == "oxygen") - M.adjustOxyLoss(amount) + L.adjustOxyLoss(amount) else if(Text == "brain") - M.adjustBrainLoss(amount) + L.adjustBrainLoss(amount) else if(Text == "clone") - M.adjustCloneLoss(amount) + L.adjustCloneLoss(amount) else usr << "You caused an error. DEBUG: Text:[Text] Mob:[M]" return diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 99dd086df7..83dfbd7e95 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -130,7 +130,7 @@ to null does not delete the object itself. Thank you. del(D) // if there are somehow two viruses of the same kind in the system, delete the other one if(holder == affected_mob) - if(affected_mob.stat < 2) //he's alive + if(affected_mob.stat != DEAD) //he's alive stage_act() else //he's dead. if(spread_type!=SPECIAL) @@ -145,15 +145,14 @@ to null does not delete the object itself. Thank you. return /datum/disease/proc/cure(var/resistance=1)//if resistance = 0, the mob won't develop resistance to disease - if(resistance && affected_mob && !(type in affected_mob.resistances)) -// world << "Setting res to [src]" - var/saved_type = "[type]"//copy the value, not create the reference to it, so when the object is deleted, the value remains. - affected_mob.resistances += text2path(saved_type) - if((affected_mob) && (istype(src, /datum/disease/alien_embryo)))//Get rid of the flag. - affected_mob.alien_egg_flag = 0 -// world << "Removing [src]" - spawn(0) - del(src) + if(affected_mob) + if(resistance && !(type in affected_mob.resistances)) + var/saved_type = "[type]" + affected_mob.resistances += text2path(saved_type) + if(istype(src, /datum/disease/alien_embryo)) //Get rid of the infection flag if it's a xeno embryo. + affected_mob.status_flags &= ~(XENO_HOST) + affected_mob.viruses -= src //remove the datum from the list + del(src) //delete the datum to stop it processing return diff --git a/code/datums/diseases/alien_embryo.dm b/code/datums/diseases/alien_embryo.dm index 8be2fa5c1c..5a6f16fb5d 100644 --- a/code/datums/diseases/alien_embryo.dm +++ b/code/datums/diseases/alien_embryo.dm @@ -1,9 +1,19 @@ //affected_mob.contract_disease(new /datum/disease/alien_embryo) +//Our own special process so that dead hosts still chestburst +/datum/disease/alien_embryo/process() + if(!holder) return + if(holder == affected_mob) + stage_act() - - - + if(affected_mob) + if(affected_mob.stat == DEAD) + if(prob(50)) + if(--longevity<=0) + cure(0) + else //the virus is in inanimate obj + cure(0) + return /datum/disease/alien_embryo @@ -11,7 +21,6 @@ max_stages = 5 spread = "None" spread_type = SPECIAL - stage_prob = 2 cure = "Unknown" cure_id = list("lexorin","toxin","gargleblaster") cure_chance = 20 @@ -30,7 +39,7 @@ if(prob(1)) affected_mob << "\red Your throat feels sore." if(prob(1)) - affected_mob << "\red Mucus runs down the back of your throat." + affected_mob << "\red Mucous runs down the back of your throat." if(3) if(prob(1)) affected_mob.emote("sneeze") @@ -39,7 +48,7 @@ if(prob(1)) affected_mob << "\red Your throat feels sore." if(prob(1)) - affected_mob << "\red Mucus runs down the back of your throat." + affected_mob << "\red Mucous runs down the back of your throat." if(4) if(prob(1)) affected_mob.emote("sneeze") @@ -60,35 +69,22 @@ affected_mob.updatehealth() if(prob(40)) if(gibbed != 0) return 0 - var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE - for(var/mob/dead/observer/G in world) - if(G.client) - if(G.client.be_alien) - if(((G.client.inactivity/10)/60) <= 5) - if(G.corpse) - if(G.corpse.stat==2) - candidates.Add(G) - if(!G.corpse) - candidates.Add(G) + var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn + for(var/mob/dead/observer/G in player_list) + if(G.client.be_alien) + if(((G.client.inactivity/10)/60) <= 5) + if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) + candidates += G.key + + var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc) if(candidates.len) - var/mob/dead/observer/G = pick(candidates) - var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc) - new_xeno.mind_initialize(G,"Larva") - new_xeno.key = G.key - del(G) + new_xeno.key = pick(candidates) else - if(affected_mob.client) - affected_mob.client.mob = new/mob/living/carbon/alien/larva(affected_mob.loc) + new_xeno.key = affected_mob.key + + new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention affected_mob.gib() src.cure(0) gibbed = 1 - - /* - if(affected_mob.client) - affected_mob.client.mob = new/mob/living/carbon/alien/larva(affected_mob.loc) - else - new/mob/living/carbon/alien/larva(affected_mob.loc) - affected_mob:gib() - */ return diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index 6c822adb1e..68a0eeabf8 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -29,7 +29,7 @@ affected_mob.Stun(rand(4,6)) for(var/mob/O in viewers(world.view, affected_mob)) O.show_message(text("\red [] throws up!", affected_mob), 1) - playsound(affected_mob.loc, 'splat.ogg', 50, 1) + playsound(affected_mob.loc, 'sound/effects/splat.ogg', 50, 1) var/turf/location = affected_mob.loc if (istype(location, /turf/simulated)) location.add_vomit_floor(affected_mob) diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index 35344d8ef9..9317fa12ef 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -35,7 +35,7 @@ if(prob(1)) affected_mob << "\red Your throat feels sore." if(prob(1)) - affected_mob << "\red Mucus runs down the back of your throat." + affected_mob << "\red Mucous runs down the back of your throat." if(3) /* if(affected_mob.sleeping && prob(25)) //removed until sleeping is fixed @@ -58,7 +58,7 @@ if(prob(1)) affected_mob << "\red Your throat feels sore." if(prob(1)) - affected_mob << "\red Mucus runs down the back of your throat." + affected_mob << "\red Mucous runs down the back of your throat." if(prob(1) && prob(50)) if(!affected_mob.resistances.Find(/datum/disease/flu)) var/datum/disease/Flu = new /datum/disease/flu(0) diff --git a/code/datums/diseases/pierrot_throat.dm b/code/datums/diseases/pierrot_throat.dm index 2938b2120f..619e0f988a 100644 --- a/code/datums/diseases/pierrot_throat.dm +++ b/code/datums/diseases/pierrot_throat.dm @@ -4,7 +4,7 @@ spread = "Airborne" cure = "A whole banana." cure_id = "banana" - cure_chance = 35 + cure_chance = 75 agent = "H0NI<42 Virus" affected_species = list("Human") permeability_mod = 0.75 @@ -16,10 +16,10 @@ ..() switch(stage) if(1) - if(prob(1)) affected_mob << "\red You feel a little silly." + if(prob(10)) affected_mob << "\red You feel a little silly." if(2) - if(prob(1)) affected_mob.say("HONK!") + if(prob(10)) affected_mob << "\red You start seeing rainbows." if(3) - if(prob(5)) affected_mob.say("HONK!") + if(prob(10)) affected_mob << "\red Your thoughts are interrupted by a loud HONK!" if(4) - if(prob(10)) affected_mob.say("HONK!") \ No newline at end of file + if(prob(5)) affected_mob.say( pick( list("HONK!", "Honk!", "Honk.", "Honk?", "Honk!!", "Honk?!", "Honk...") ) ) \ No newline at end of file diff --git a/code/datums/diseases/robotic_transformation.dm b/code/datums/diseases/robotic_transformation.dm index 8692ef5446..9648191fb0 100644 --- a/code/datums/diseases/robotic_transformation.dm +++ b/code/datums/diseases/robotic_transformation.dm @@ -53,12 +53,13 @@ affected_mob.updatehealth() if(prob(40)) //So everyone can feel like robot Seth Brundle if(src.gibbed != 0) return 0 - var/turf/T = get_turf(affected_mob) + var/turf/T = find_loc(affected_mob) gibs(T) src.cure(0) gibbed = 1 - if(!jobban_isbanned(affected_mob, "Cyborg")) - affected_mob:Robotize() + var/mob/living/carbon/human/H = affected_mob + if(istype(H) && !jobban_isbanned(affected_mob, "Cyborg")) + H.Robotize() else affected_mob.death(1) diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index 4b4e15d7dd..ebba6f645f 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -60,21 +60,21 @@ STI KALY - blind if(prob(chance)) if(!istype(H.head, /obj/item/clothing/head/wizard)) if(H.head) - H.drop_from_slot(H.head) + H.drop_from_inventory(H.head) H.head = new /obj/item/clothing/head/wizard(H) H.head.layer = 20 return if(prob(chance)) if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) if(H.wear_suit) - H.drop_from_slot(H.wear_suit) + H.drop_from_inventory(H.wear_suit) H.wear_suit = new /obj/item/clothing/suit/wizrobe(H) H.wear_suit.layer = 20 return if(prob(chance)) if(!istype(H.shoes, /obj/item/clothing/shoes/sandal)) if(H.shoes) - H.drop_from_slot(H.shoes) + H.drop_from_inventory(H.shoes) H.shoes = new /obj/item/clothing/shoes/sandal(H) H.shoes.layer = 20 return @@ -82,10 +82,8 @@ STI KALY - blind var/mob/living/carbon/H = affected_mob if(prob(chance)) if(!istype(H.r_hand, /obj/item/weapon/staff)) - if(H.r_hand) - H.drop_from_slot(H.r_hand) - H.r_hand = new /obj/item/weapon/staff(H) - H.r_hand.layer = 20 + H.drop_r_hand() + H.put_in_r_hand( new /obj/item/weapon/staff(H) ) return return diff --git a/code/datums/diseases/xeno_transformation.dm b/code/datums/diseases/xeno_transformation.dm index 09e3f20e77..9d3289708f 100644 --- a/code/datums/diseases/xeno_transformation.dm +++ b/code/datums/diseases/xeno_transformation.dm @@ -53,7 +53,7 @@ affected_mob.updatehealth() if(prob(40)) if(gibbed != 0) return 0 - var/turf/T = get_turf(affected_mob) + var/turf/T = find_loc(affected_mob) gibs(T) src.cure(0) gibbed = 1 diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm index e3f6470414..7c2fabbc9b 100644 --- a/code/datums/helper_datums/construction_datum.dm +++ b/code/datums/helper_datums/construction_datum.dm @@ -46,11 +46,11 @@ proc/check_all_steps(atom/used_atom,mob/user as mob) //check all steps, remove matching one. for(var/i=1;i<=steps.len;i++) - var/list/L = steps[i] + var/list/L = steps[i]; if(istype(used_atom, L["key"])) if(custom_action(i, used_atom, user)) - steps[i]=null//stupid byond list from list removal... - steps.Remove(null) + steps[i]=null;//stupid byond list from list removal... + listclearnulls(steps); if(!steps.len) spawn_result() return 1 diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 300aee55f5..03732d6873 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -14,6 +14,7 @@ var/global/datum/getrev/revdata = new("config/svndir.txt") var/revhref proc/abort() + world.log << "Unable to get revision info." spawn() del src @@ -24,7 +25,7 @@ var/global/datum/getrev/revdata = new("config/svndir.txt") var/text = file2text(file(filename)) if(!text) - diary << "Unable to get [filename] contents, aborting" + world.log << "Unable to get [filename] contents, aborting" return abort() var/list/CL = tg_text2list(text, "\n") @@ -58,6 +59,7 @@ var/global/datum/getrev/revdata = new("config/svndir.txt") return abort() revision = filelist[4] commiter = filelist[12] + world.log << "Running TG Revision Number: [revision]." diary << "Revision info loaded succesfully" return return abort() @@ -84,11 +86,10 @@ client/verb/showrevinfo() set category = "OOC" set name = "Show Server Revision" var/output = "Sorry, the revision info is unavailable." - output = file2text("/home/bay12/live/data/gitcommit") - output += "Current Infomational Settings:
" - output += "Tensioner Status: [config.Tensioner_Active]
" - //output += "Current Tension: [tension_master.score]
" - //output += "Tensioner Debug Data: R1:[tension_master.round1] R2:[tension_master.round2] R3:[tension_master.round3] R4:[tension_master.round4] ES: [tension_master.eversupressed] CD: [tension_master.cooldown]
" - output += "Protect Authority Roles From Tratior: [config.protect_roles_from_antagonist]
" + if(revdata) + output = revdata.showInfo() + + output += "Current Infomational Settings:
" + output += "Protect Authority Roles From Tratior: [config.protect_roles_from_antagonist]
" usr << browse(output,"window=revdata"); return diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index f157909ff6..4267328dca 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -3,10 +3,6 @@ new /datum/teleport/instant/science(arglist(args)) return -/proc/do_teleport_stealth(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null) - new /datum/teleport/instant(arglist(args)) - return - /datum/teleport var/atom/movable/teleatom //atom to teleport var/atom/destination //destination to teleport to @@ -114,7 +110,7 @@ // Remove any luminosity etc. var/prevlum = teleatom.luminosity - teleatom.ul_SetLuminosity(0) + teleatom.luminosity = 0 if(force_teleport) teleatom.forceMove(destturf) @@ -124,7 +120,7 @@ playSpecials(destturf,effectout,soundout) // Re-Apply lum - teleatom.ul_SetLuminosity(prevlum) + teleatom.sd_SetLuminosity(prevlum) destarea.Entered(teleatom) @@ -172,8 +168,7 @@ if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite teleatom.visible_message("\red The [teleatom] bounces off of the portal!") return 0 - var/list/temp = teleatom.search_contents_for(/obj/item/weapon/disk/nuclear) - if(temp.len) + if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear))) if(istype(teleatom, /mob/living)) var/mob/living/MM = teleatom MM.visible_message("\red The [MM] bounces off of the portal!","\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.") diff --git a/code/datums/helper_datums/tension.dm b/code/datums/helper_datums/tension.dm index 37cb3374f6..1cf5eb2acd 100644 --- a/code/datums/helper_datums/tension.dm +++ b/code/datums/helper_datums/tension.dm @@ -101,9 +101,8 @@ var/global/datum/tension/tension_master if(forcenexttick) forcenexttick = 0 - for (var/mob/M in world) - if (M.client && M.client.holder) - M << " The tensioner wishes to create additional antagonists! Press (this) in 60 seconds to abort!" + for (var/client/C in admin_list) + C << " The tensioner wishes to create additional antagonists! Press (this) in 60 seconds to abort!" spawn(600) if(!supress) @@ -201,7 +200,7 @@ var/global/datum/tension/tension_master proc/get_num_players() var/peeps = 0 - for (var/mob/M in world) + for (var/mob/M in player_list) if (!M.client) continue peeps += 1 @@ -232,9 +231,18 @@ var/global/datum/tension/tension_master Topic(href, href_list) + if(!usr || !usr.client) + return //This shouldnt happen + + if(!usr.client.holder) + message_admins("\red [key_name(usr)] tried to use the tensioner without authorization.") + log_admin("[key_name(usr)] tried to use the tensioner without authorization.") + return + log_admin("[key_name(usr)] used a tensioner override. The override was [href]") message_admins("[key_name(usr)] used a tensioner override. The override was [href]") + if(href_list["addScore"]) score += 50000 @@ -287,7 +295,7 @@ var/global/datum/tension/tension_master var/mob/living/silicon/malfAI = null var/datum/mind/themind = null - for(var/mob/living/silicon/ai/ai in world) + for(var/mob/living/silicon/ai/ai in player_list) if(ai.client) AIs += ai @@ -327,7 +335,7 @@ var/global/datum/tension/tension_master var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in world) + for(var/mob/living/carbon/human/applicant in player_list) var/datum/preferences/preferences = new @@ -364,7 +372,7 @@ var/global/datum/tension/tension_master var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in world) + for(var/mob/living/carbon/human/applicant in player_list) var/datum/preferences/preferences = new @@ -400,7 +408,7 @@ var/global/datum/tension/tension_master var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in world) + for(var/mob/living/carbon/human/applicant in player_list) var/datum/preferences/preferences = new @@ -431,7 +439,7 @@ var/global/datum/tension/tension_master var/mob/dead/observer/theghost = null var/time_passed = world.time - for(var/mob/dead/observer/G in world) + for(var/mob/dead/observer/G in player_list) if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) spawn(0) switch(alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No")) @@ -445,7 +453,7 @@ var/global/datum/tension/tension_master sleep(300) for(var/mob/dead/observer/G in candidates) - if(!G.client || !G.key) + if(!G.client) candidates.Remove(G) spawn(0) @@ -456,11 +464,8 @@ var/global/datum/tension/tension_master if(!theghost) return 0 var/mob/living/carbon/human/new_character=makeBody(theghost) - del(theghost) new_character.mind.make_Wizard() - - return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode. @@ -473,7 +478,7 @@ var/global/datum/tension/tension_master var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in world) + for(var/mob/living/carbon/human/applicant in player_list) var/datum/preferences/preferences = new @@ -514,7 +519,7 @@ var/global/datum/tension/tension_master var/mob/dead/observer/theghost = null var/time_passed = world.time - for(var/mob/dead/observer/G in world) + for(var/mob/dead/observer/G in player_list) if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate")) spawn(0) switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No")) @@ -528,7 +533,7 @@ var/global/datum/tension/tension_master sleep(300) for(var/mob/dead/observer/G in candidates) - if(!G.client || !G.key) + if(!G.client) candidates.Remove(G) spawn(0) @@ -543,7 +548,6 @@ var/global/datum/tension/tension_master if(!theghost) break var/mob/living/carbon/human/new_character=makeBody(theghost) - del(theghost) new_character.mind.make_Nuke() @@ -561,7 +565,7 @@ var/global/datum/tension/tension_master if(closet_spawn) new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc) - for (var/obj/effect/landmark/A in world) + for (var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve if (A.name == "Syndicate-Gear-Closet") new /obj/structure/closet/syndicate/personal(A.loc) del(A) @@ -579,15 +583,14 @@ var/global/datum/tension/tension_master if(synd_mind.current.client) for(var/image/I in synd_mind.current.client.images) if(I.icon_state == "synd") - synd_mind.current.client.images -= I + del(I) for(var/datum/mind/synd_mind in ticker.mode.syndicates) if(synd_mind.current) if(synd_mind.current.client) for(var/datum/mind/synd_mind_1 in ticker.mode.syndicates) if(synd_mind_1.current) - var/image/I = synd_mind_1.current.antag_img - I.icon_state = "synd" + var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd") synd_mind.current.client.images += I for (var/obj/machinery/nuclearbomb/bomb in world) @@ -600,7 +603,7 @@ var/global/datum/tension/tension_master proc/makeAliens() - Force_Event(/datum/event/alieninfestation) + alien_infestation(3) return 1 proc/makeSpaceNinja() @@ -627,7 +630,7 @@ var/global/datum/tension/tension_master //Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos. - for(var/mob/dead/observer/G in world) + for(var/mob/dead/observer/G in player_list) spawn(0) switch(alert(G,"Do you wish to be considered for an elite syndicate strike team being sent in?","Please answer in 30 seconds!","Yes","No")) if("Yes") @@ -639,13 +642,13 @@ var/global/datum/tension/tension_master sleep(300) for(var/mob/dead/observer/G in candidates) - if(!G.client || !G.key) + if(!G.key) candidates.Remove(G) if(candidates.len) var/numagents = 6 //Spawns commandos and equips them. - for (var/obj/effect/landmark/L in world) + for (var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad) if(numagents<=0) break if (L.name == "Syndicate-Commando") @@ -654,7 +657,6 @@ var/global/datum/tension/tension_master var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected) - while((!theghost || !theghost.client) && candidates.len) theghost = pick(candidates) candidates.Remove(theghost) @@ -663,11 +665,9 @@ var/global/datum/tension/tension_master del(new_syndicate_commando) break - new_syndicate_commando.mind.key = theghost.key//For mind stuff. new_syndicate_commando.key = theghost.key new_syndicate_commando.internal = new_syndicate_commando.s_store new_syndicate_commando.internals.icon_state = "internal1" - del(theghost) //So they don't forget their code or mission. @@ -681,10 +681,10 @@ var/global/datum/tension/tension_master // if (L.name == "Commando_Manual") //new /obj/item/weapon/gun/energy/pulse_rifle(L.loc) // var/obj/item/weapon/paper/P = new(L.loc) - // P.info = "

Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.

In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a NanoTrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.

Hello and thank you for choosing NanoTrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class NanoTrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.

The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]

Good luck, soldier!

" + // P.info = "

Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.

In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.

Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.

The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]

Good luck, soldier!

" // P.name = "Spec. Ops. Manual" - for (var/obj/effect/landmark/L in world) + for (var/obj/effect/landmark/L in /area/shuttle/syndicate_elite) if (L.name == "Syndicate-Commando-Bomb") new /obj/effect/spawner/newbomb/timer/syndicate(L.loc) // del(L) @@ -700,7 +700,7 @@ var/global/datum/tension/tension_master //Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos. - for(var/mob/dead/observer/G in world) + for(var/mob/dead/observer/G in player_list) spawn(0) switch(alert(G,"Do you wish to be considered for a cyborg strike team being sent in?","Please answer in 30 seconds!","Yes","No")) if("Yes") @@ -719,7 +719,7 @@ var/global/datum/tension/tension_master var/numagents = 3 //Spawns commandos and equips them. - for (var/obj/effect/landmark/L in world) + for (var/obj/effect/landmark/L in /area/borg_deathsquad) if(numagents<=0) break if (L.name == "Borg-Deathsquad") @@ -739,9 +739,7 @@ var/global/datum/tension/tension_master del(new_borg_deathsquad) break - new_borg_deathsquad.mind.key = theghost.key//For mind stuff. new_borg_deathsquad.key = theghost.key - del(theghost) //So they don't forget their code or mission. @@ -754,156 +752,33 @@ var/global/datum/tension/tension_master // if (L.name == "Commando_Manual") //new /obj/item/weapon/gun/energy/pulse_rifle(L.loc) // var/obj/item/weapon/paper/P = new(L.loc) - // P.info = "

Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.

In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a NanoTrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.

Hello and thank you for choosing NanoTrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class NanoTrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.

The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]

Good luck, soldier!

" + // P.info = "

Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.

In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.

Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.

The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]

Good luck, soldier!

" // P.name = "Spec. Ops. Manual" return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode. - - - - - - - - proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character - - if(!G_found) - return + if(!G_found || !G_found.key) return //First we spawn a dude. - var/mob/living/carbon/human/new_character = new(src)//The mob being spawned. + var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. - //Second, we check if they are an alien or monkey. - G_found.mind=null//Null their mind so we don't screw things up ahead. - G_found.real_name="[pick(pick(first_names_male,first_names_female))] [pick(last_names)]"//Give them a random real name. + new_character.gender = pick(MALE,FEMALE) - new_character.mind = new() - ticker.minds += new_character.mind//And we'll add it to the minds database. - new_character.mind.original = new_character//If they are respawning with a new character. - new_character.mind.assigned_role = "Assistant"//Defaults to assistant. - new_character.mind.key = G_found.key//In case it's someone else playing as that character. - new_character.mind.current = new_character//So that it can properly reference later if needed. - new_character.mind.memory = ""//Memory erased so it doesn't get clunkered up with useless info. This means they may forget their previous mission--this is usually handled through objective code and recalling memory. - - var/datum/data/record/record_found//Referenced to later to either randomize or not randomize the character. - if(G_found.mind)//They must have a mind to reference the record. Here we also double check for aliens. - var/id = md5("[G_found.real_name][G_found.mind.assigned_role]") - for(var/datum/data/record/t in data_core.locked) - if(t.fields["id"]==id) - record_found = t//We shall now reference the record. - break - - //Here we either load their saved appearance or randomize it. var/datum/preferences/A = new() - if(A.savefile_load(G_found))//If they have a save file. This will automatically load their parameters. - //Note: savefile appearances are overwritten later on if the character has a data_core entry. By appearance, I mean the physical appearance. - var/name_safety = G_found.real_name//Their saved parameters may include a random name. Also a safety in case they are playing a character that got their name after round start. - A.copy_to(new_character) - new_character.real_name = name_safety - new_character.name = name_safety + A.randomize_appearance_for(new_character) + if(new_character.gender == MALE) + new_character.real_name = "[pick(first_names_male)] [pick(last_names)]" else - if(record_found)//If they have a record we can determine a few things. - new_character.real_name = record_found.fields["name"]//Not necessary to reference the record but I like to keep things uniform. - new_character.name = record_found.fields["name"] - new_character.gender = record_found.fields["sex"]//Sex - new_character.age = record_found.fields["age"]//Age -// new_character.b_type = record_found.fields["bloodtype"] - //We will update their appearance when determining DNA. - else - new_character.gender = FEMALE - var/name_safety = G_found.real_name//Default is a random name so we want to save this. - A.randomize_appearance_for(new_character)//Now we will randomize their appearance since we have no way of knowing what they look/looked like. - new_character.real_name = name_safety - new_character.name = name_safety + new_character.real_name = "[pick(first_names_female)] [pick(last_names)]" + new_character.name = new_character.real_name + new_character.age = rand(17,45) - //After everything above, it's time to initialize their DNA. - if(record_found)//Pull up their name from database records if they did have a mind. - new_character.dna = new()//Let's first give them a new DNA. - new_character.dna.unique_enzymes = record_found.fields["b_dna"]//Enzymes are based on real name but we'll use the record for conformity. - new_character.dna.struc_enzymes = record_found.fields["enzymes"]//This is the default of enzymes so I think it's safe to go with. - new_character.dna.uni_identity = record_found.fields["identity"]//DNA identity is carried over. - new_character.dna.b_type = record_found.fields["b_type"]//Blood type - updateappearance(new_character,new_character.dna.uni_identity)//Now we configure their appearance based on their unique identity, same as with a DNA machine or somesuch. - else//If they have no records, we just do a random DNA for them, based on their random appearance/savefile. - new_character.dna.ready_dna(new_character) + new_character.dna.ready_dna(new_character) + new_character.key = G_found.key - - var/player_key = G_found.key - - //Here we need to find where to spawn them. - var/spawn_here = pick(latejoin)//"JoinLate" is a landmark which is deleted on round start. So, latejoin has to be used instead. - new_character.loc = spawn_here - //If they need to spawn elsewhere, they will be transferred there momentarily. - - /* - The code below functions with the assumption that the mob is already a traitor if they have a special role. - So all it does is re-equip the mob with powers and/or items. Or not, if they have no special role. - If they don't have a mind, they obviously don't have a special role. - */ - - new_character.key = player_key//Throw them into the mob. -/* - //Now for special roles and equipment. - switch(new_character.mind.special_role) - if("Changeling") - job_master.EquipRank(new_character, new_character.mind.assigned_role, 1) - new_character.make_changeling() - if("traitor") - job_master.EquipRank(new_character, new_character.mind.assigned_role, 1) - ticker.mode.equip_traitor(new_character) - if("Wizard") - new_character.loc = pick(wizardstart) - //ticker.mode.learn_basic_spells(new_character) - ticker.mode.equip_wizard(new_character) - if("Syndicate") - var/obj/effect/landmark/synd_spawn = locate("landmark*Syndicate-Spawn") - if(synd_spawn) - new_character.loc = get_turf(synd_spawn) - call(/datum/game_mode/proc/equip_syndicate)(new_character) - if("Space Ninja") - var/ninja_spawn[] = list() - for(var/obj/effect/landmark/L in world) - if(L.name=="carpspawn") - ninja_spawn += L - new_character.equip_space_ninja() - new_character.internal = new_character.s_store - new_character.internals.icon_state = "internal1" - if(ninja_spawn.len) - var/obj/effect/landmark/ninja_spawn_here = pick(ninja_spawn) - new_character.loc = ninja_spawn_here.loc - if("Death Commando")//Leaves them at late-join spawn. - new_character.equip_death_commando() - new_character.internal = new_character.s_store - new_character.internals.icon_state = "internal1" - else//They may also be a cyborg or AI. - switch(new_character.mind.assigned_role) - if("Cyborg")//More rigging to make em' work and check if they're traitor. - new_character = new_character.Robotize() - if(new_character.mind.special_role=="traitor") - call(/datum/game_mode/proc/add_law_zero)(new_character) - if("AI") - new_character = new_character.AIize() - if(new_character.mind.special_role=="traitor") - call(/datum/game_mode/proc/add_law_zero)(new_character) - //Add aliens. - else - job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)//Or we simply equip them. - - //Announces the character on all the systems, based on the record. - if(!issilicon(new_character))//If they are not a cyborg/AI. - if(!record_found&&new_character.mind.assigned_role!="MODE")//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway. - //Power to the user! - if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes") - call(/mob/new_player/proc/ManifestLateSpawn)(new_character) - - if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes") - call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role) -*/ - del(G_found)//Don't want to leave ghosts around. return new_character /proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0) @@ -918,22 +793,20 @@ var/global/datum/tension/tension_master A.randomize_appearance_for(new_syndicate_commando) new_syndicate_commando.real_name = "[!syndicate_leader_selected ? syndicate_commando_rank : syndicate_commando_leader_rank] [syndicate_commando_name]" + new_syndicate_commando.name = new_syndicate_commando.real_name new_syndicate_commando.age = !syndicate_leader_selected ? rand(23,35) : rand(35,45) new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA. //Creates mind stuff. - new_syndicate_commando.mind = new - new_syndicate_commando.mind.current = new_syndicate_commando - new_syndicate_commando.mind.original = new_syndicate_commando + new_syndicate_commando.mind_initialize() new_syndicate_commando.mind.assigned_role = "MODE" new_syndicate_commando.mind.special_role = "Syndicate Commando" - if(!(new_syndicate_commando.mind in ticker.minds)) - ticker.minds += new_syndicate_commando.mind//Adds them to regular mind list. - if(!(new_syndicate_commando.mind in ticker.mode.traitors))//If they weren't already an extra traitor. - ticker.mode.traitors += new_syndicate_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list. + + //Adds them to current traitor list. Which is really the extra antagonist list. + ticker.mode.traitors += new_syndicate_commando.mind new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected) - //del(spawn_location) // Commenting this out for multiple commando teams. + return new_syndicate_commando @@ -948,15 +821,12 @@ var/global/datum/tension/tension_master new_borg_deathsquad.name = name //Creates mind stuff. - new_borg_deathsquad.mind = new - new_borg_deathsquad.mind.current = new_borg_deathsquad - new_borg_deathsquad.mind.original = new_borg_deathsquad + new_borg_deathsquad.mind_initialize() new_borg_deathsquad.mind.assigned_role = "MODE" new_borg_deathsquad.mind.special_role = "Borg Commando" - if(!(new_borg_deathsquad.mind in ticker.minds)) - ticker.minds += new_borg_deathsquad.mind//Adds them to regular mind list. - if(!(new_borg_deathsquad.mind in ticker.mode.traitors))//If they weren't already an extra traitor. - ticker.mode.traitors += new_borg_deathsquad.mind//Adds them to current traitor list. Which is really the extra antagonist list. + + //Adds them to current traitor list. Which is really the extra antagonist list. + ticker.mode.traitors += new_borg_deathsquad.mind //del(spawn_location) // Commenting this out for multiple commando teams. return new_borg_deathsquad @@ -966,7 +836,7 @@ var/global/datum/tension/tension_master /obj/machinery/computer/Borg_station name = "Cyborg Station Terminal" - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "syndishuttle" req_access = list() var/temp = null diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 7e0a025aea..63948eabfa 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1,10 +1,42 @@ +/* Note from Carnie: + The way datum/mind stuff works has been changed a lot. + Minds now represent IC characters rather than following a client around constantly. + + Guidelines for using minds properly: + + - Never mind.transfer_to(ghost). The var/current and var/original of a mind must always be of type mob/living! + ghost.mind is however used as a reference to the ghost's corpse + + - When creating a new mob for an existing IC character (e.g. cloning a dead guy or borging a brain of a human) + the existing mind of the old mob should be transfered to the new mob like so: + + mind.transfer_to(new_mob) + + - You must not assign key= or ckey= after transfer_to() since the transfer_to transfers the client for you. + By setting key or ckey explicitly after transfering the mind with transfer_to you will cause bugs like DCing + the player. + + - IMPORTANT NOTE 2, if you want a player to become a ghost, use mob.ghostize() It does all the hard work for you. + + - When creating a new mob which will be a new IC character (e.g. putting a shade in a construct or randomly selecting + a ghost to become a xeno during an event). Simply assign the key or ckey like you've always done. + + new_mob.key = key + + The Login proc will handle making a new mob for that mobtype (including setting up stuff like mind.name). Simple! + However if you want that mind to have any special properties like being a traitor etc you will have to do that + yourself. + +*/ + datum/mind var/key + var/name //replaces mob/var/original_name var/mob/living/current - var/mob/living/original + var/mob/living/original //TODO: remove.not used in any meaningful way ~Carn. First I'll need to tweak the way silicon-mobs handle minds. + var/active = 0 var/memory - //TODO: store original name --rastaf0 var/assigned_role var/special_role @@ -17,30 +49,32 @@ datum/mind var/list/datum/objective/special_verbs = list() var/has_been_rev = 0//Tracks if this mind has been a rev or not - var/rev_cooldown = 0 - var/datum/faction/faction // associated faction + var/datum/faction/faction //associated faction + var/datum/changeling/changeling //changeling holder - proc/transfer_to(mob/new_character) - // multikey information is stored in the mob, not the mind, so - // we need to clean this stuff up to avoid multikey alerts - if(!new_character || !current) - return - current.lastKnownIP = null - current.computer_id = null + New(var/key) + src.key = key - - if(current) + proc/transfer_to(mob/living/new_character) + if(!istype(new_character)) + world.log << "## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn" + if(current) //remove ourself from our old body's mind variable + if(changeling) + current.remove_changeling_powers() current.mind = null + if(new_character.mind) //remove any mind currently in our new body's mind variable + new_character.mind.current = null - new_character.mind = src - current = new_character + current = new_character //link ourself to our new body + new_character.mind = src //and link our new body to ourself - new_character.key = key + if(changeling) + new_character.make_changeling() - // mob/Login() will handle setting the new mob's lastKnownIP and - // computer_id for us + if(active) + new_character.key = key //now transfer the key to link the client to our new body proc/store_memory(new_text) memory += "[new_text]
" @@ -64,7 +98,8 @@ datum/mind alert("Not before round-start!", "Alert") return - var/out = "[current.real_name]
" + var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" + out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" out += "Assigned role: [assigned_role]. Edit
" out += "Factions and special roles:
" @@ -86,12 +121,12 @@ datum/mind if (ticker.mode.config_tag=="revolution") text = uppertext(text) text = "[text]: " -/* if (assigned_role in command_positions) + if (assigned_role in command_positions) text += "HEAD|officer|employee|headrev|rev" else if (assigned_role in list("Security Officer", "Detective", "Warden")) - text += "head|OFFICER|employee|headre|rev"*/ - if (src in ticker.mode.head_revolutionaries) - text = "employee|HEADREV|rev" + text += "head|OFFICER|employee|headre|rev" + else if (src in ticker.mode.head_revolutionaries) + text = "head|officer|employee|HEADREV|rev" text += "
Flash: give" var/list/L = current.get_contents() @@ -108,9 +143,9 @@ datum/mind if (objectives.len==0) text += "
Objectives are empty! Set to kill all heads." else if (src in ticker.mode.revolutionaries) - text += "employee|headrev|REV" + text += "head|officer|employee|headrev|REV" else - text += "EMPLOYEE|headrev|rev" + text += "head|officer|EMPLOYEE|headrev|rev" sections["revolution"] = text /** CULT ***/ @@ -118,19 +153,19 @@ datum/mind if (ticker.mode.config_tag=="cult") text = uppertext(text) text = "[text]: " -/* if (assigned_role in command_positions) + if (assigned_role in command_positions) text += "HEAD|officer|employee|cultist" else if (assigned_role in list("Security Officer", "Detective", "Warden")) - text += "head|OFFICER|employee|cultist"*/ - if (src in ticker.mode.cult) - text += "employee|CULTIST" + text += "head|OFFICER|employee|cultist" + else if (src in ticker.mode.cult) + text += "head|officer|employee|CULTIST" text += "
Give tome|amulet." /* if (objectives.len==0) text += "
Objectives are empty! Set to sacrifice and escape or summon." */ else - text += "EMPLOYEE|cultist" + text += "head|officer|EMPLOYEE|cultist" sections["cult"] = text /** WIZARD ***/ @@ -156,7 +191,7 @@ datum/mind text += "YES|no" if (objectives.len==0) text += "
Objectives are empty! Randomize!" - if (current.changeling && (current.changeling.absorbed_dna.len>0 && current.real_name != current.changeling.absorbed_dna[1])) + if( changeling && changeling.absorbed_dna.len && (current.real_name != changeling.absorbed_dna[1]) ) text += "
Transform to initial appearance." else text += "yes|NO" @@ -266,14 +301,11 @@ datum/mind istype(current,/mob/living/carbon/human) ) text = "Uplink: give" - var/obj/item/device/uplink/radio/suplink = find_syndicate_uplink() - var/obj/item/device/uplink/iuplink = find_integrated_uplink() + var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() var/crystals if (suplink) crystals = suplink.uses - else if (iuplink) - crystals = iuplink.uses - if (suplink || iuplink) + if (suplink) text += "|take" if (usr.client.holder.level >= 3) text += ", [crystals] crystals" @@ -302,12 +334,18 @@ datum/mind usr << browse(out, "window=edit_memory[src]") Topic(href, href_list) + if(!usr || !usr.client) + return + + if(!usr.client.holder) + message_admins("\red [key_name(usr)] tried to access [current]'s mind without authorization.") + log_admin("[key_name(usr)] tried to access [current]'s mind without authorization.") + return if (href_list["role_edit"]) var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs() if (!new_role) return assigned_role = new_role - role_alt_title = null else if (href_list["memory_edit"]) var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN) @@ -330,25 +368,25 @@ datum/mind if(!def_value)//If it's a custom objective, it will be an empty string. def_value = "custom" - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate","decapitate", "debrain", "protection", "frame", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom") + var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "debrain", "protect", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom") if (!new_obj_type) return var/datum/objective/new_objective = null switch (new_obj_type) - if ("assassinate","protection", "frame", "debrain","decapitate") + if ("assassinate","protect","debrain") //To determine what to name the objective in explanation text. -// var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. -// var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. -// var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. + var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. + var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. + var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. var/list/possible_targets = list("Free objective") for(var/datum/mind/possible_target in ticker.minds) - if ((possible_target != src) && possible_target.current && istype(possible_target.current, /mob/living/carbon/human)) + if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) possible_targets += possible_target.current var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protection, /datum/objective/frame, /datum/objective/debrain, /datum/objective/decapitate) + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) if (objective&&(objective.type in objective_list) && objective:target) def_target = objective:target.current @@ -357,11 +395,16 @@ datum/mind var/objective_path = text2path("/datum/objective/[new_obj_type]") if (new_target == "Free objective") - new_objective = new objective_path(null,"MODE",null) + new_objective = new objective_path new_objective.owner = src + new_objective:target = null + new_objective.explanation_text = "Free objective" else - new_objective = new objective_path(null,"MODE",new_target:mind) + new_objective = new objective_path new_objective.owner = src + new_objective:target = new_target:mind + //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. + new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]." if ("hijack") new_objective = new /datum/objective/hijack @@ -380,20 +423,19 @@ datum/mind new_objective.owner = src if ("steal") - var/list/possibilities = GenerateTheft(assigned_role,src) - var/list/temp_poss = possibilities[1] - var/list/choices = list() - for(var/datum/objective/steal/steal in temp_poss) - choices["[steal.steal_target]"] = steal - var/new_target = input("Select target:", "Objective target") as null|anything in choices - if (!new_target) return - new_objective = choices[new_target] - new_objective.owner = src + if (!istype(objective, /datum/objective/steal)) + new_objective = new /datum/objective/steal + new_objective.owner = src + else + new_objective = objective + var/datum/objective/steal/steal = new_objective + if (!steal.select_target()) + return if("download","capture","absorb") var/def_num if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) - def_num = objective:target_amount + def_num = objective.target_amount var/target_number = input("Input target number:", "Objective", def_num) as num|null if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. @@ -410,7 +452,7 @@ datum/mind new_objective = new /datum/objective/absorb new_objective.explanation_text = "Absorb [target_number] compatible genomes." new_objective.owner = src - new_objective:target_amount = target_number + new_objective.target_amount = target_number if ("custom") var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN) @@ -476,7 +518,7 @@ datum/mind var/datum/objective/mutiny/rev_obj = new rev_obj.owner = src rev_obj.target = O.target - rev_obj.explanation_text = "Assassinate [O.target.current.real_name], the [O.target.assigned_role]." + rev_obj.explanation_text = "Assassinate [O.target.name], the [O.target.assigned_role]." objectives += rev_obj ticker.mode.greet_revolutionary(src,0) ticker.mode.head_revolutionaries += src @@ -546,11 +588,11 @@ datum/mind var/obj/item/weapon/tome/T = new(H) var/list/slots = list ( - "backpack" = H.slot_in_backpack, - "left pocket" = H.slot_l_store, - "right pocket" = H.slot_r_store, - "left hand" = H.slot_l_hand, - "right hand" = H.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = H.equip_in_one_of_slots(T, slots) if (!where) @@ -593,25 +635,24 @@ datum/mind ticker.mode.changelings -= src special_role = null current.remove_changeling_powers() - if(current.changeling) - del(current.changeling) - current << "\red You have been brainwashed! You are no longer a changeling!" + if(changeling) del(changeling) + current << "You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!" if("changeling") if(!(src in ticker.mode.changelings)) ticker.mode.changelings += src ticker.mode.grant_changeling_powers(current) special_role = "Changeling" - current << "\red You are a changeling!" + current << "Your powers are awoken. A flash of memory returns to us...we are a changeling!" if("autoobjectives") ticker.mode.forge_changeling_objectives(src) usr << "\blue The objectives for changeling [key] have been generated. You can edit them and anounce manually." if("initialdna") - if (!usr.changeling || !usr.changeling.absorbed_dna[1]) + if( !changeling || !changeling.absorbed_dna.len ) usr << "\red Resetting DNA failed!" else - usr.dna = usr.changeling.absorbed_dna[usr.changeling.absorbed_dna[1]] - usr.real_name = usr.changeling.absorbed_dna[1] + usr.dna = changeling.absorbed_dna[changeling.absorbed_dna[1]] + usr.real_name = changeling.absorbed_dna[1] updateappearance(usr, usr.dna.uni_identity) domutcheck(usr, null) @@ -643,8 +684,7 @@ datum/mind var/mob/living/carbon/human/H = current del(H.belt) del(H.back) - del(H.l_ear) - del(H.r_ear) + del(H.ears) del(H.gloves) del(H.head) del(H.shoes) @@ -741,18 +781,18 @@ datum/mind ticker.mode.malf_ai -= src special_role = null - current.verbs -= /mob/living/silicon/ai/proc/choose_modules - current.verbs -= /datum/game_mode/malfunction/proc/takeover - current.verbs -= /datum/game_mode/malfunction/proc/ai_win - current.verbs -= /client/proc/fireproof_core - current.verbs -= /client/proc/upgrade_turrets - current.verbs -= /client/proc/disable_rcd - current.verbs -= /client/proc/overload_machine - current.verbs -= /client/proc/blackout - current.verbs -= /client/proc/interhack - current.verbs -= /client/proc/reactivate_camera + current.verbs.Remove(/mob/living/silicon/ai/proc/choose_modules, + /datum/game_mode/malfunction/proc/takeover, + /datum/game_mode/malfunction/proc/ai_win, + /client/proc/fireproof_core, + /client/proc/upgrade_turrets, + /client/proc/disable_rcd, + /client/proc/overload_machine, + /client/proc/blackout, + /client/proc/interhack, + /client/proc/reactivate_camera) - current:laws = new /datum/ai_laws/nanotrasen + current:laws = new /datum/ai_laws/asimov del(current:malf_picker) current:show_laws() current.icon_state = "ai" @@ -800,25 +840,20 @@ datum/mind switch(href_list["common"]) if("undress") for(var/obj/item/W in current) - current.drop_from_slot(W) + current.drop_from_inventory(W) if("takeuplink") take_uplink() memory = null//Remove any memory they may have had. if("crystals") if (usr.client.holder.level >= 3) - var/obj/item/device/uplink/radio/suplink = find_syndicate_uplink() - var/obj/item/device/uplink/iuplink = find_integrated_uplink() + var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() var/crystals if (suplink) crystals = suplink.uses - else if (iuplink) - crystals = iuplink.uses - crystals = input("Amount of telecrystals for [key]","Sindicate uplink", crystals) as null|num + crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num if (!isnull(crystals)) if (suplink) suplink.uses = crystals - else if(iuplink) - iuplink.uses = crystals if("uplink") if (!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors))) usr << "\red Equipping a syndicate failed!" @@ -845,7 +880,7 @@ datum/mind if (t:traitorradio) del(t:traitorradio) t:traitorradio = null t:traitor_frequency = 0.0 - else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/device/uplink/radio)) + else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink)) if (t:origradio) var/obj/item/device/radio/R = t:origradio R.loc = current.loc @@ -864,50 +899,17 @@ datum/mind */ proc/find_syndicate_uplink() - var/obj/item/device/uplink/radio/uplink = null var/list/L = current.get_contents() - for (var/obj/item/device/radio/radio in L) - uplink = radio.traitorradio - if (uplink) - return uplink - uplink = locate() in L - return uplink + for (var/obj/item/I in L) + if (I.hidden_uplink) + return I.hidden_uplink + return null - proc/find_integrated_uplink() - //world << "DEBUG: find_integrated_uplink()" - var/obj/item/device/uplink/uplink = null - var/list/L = current.get_contents() - for (var/obj/item/device/pda/pda in L) - uplink = pda.uplink - if (uplink) - return uplink - return uplink + proc/take_uplink() + var/obj/item/device/uplink/hidden/H = find_syndicate_uplink() + if(H) + del(H) - proc/take_uplink() //assuming only one uplink because I am tired of all this uplink shit --rastaf0 - var/list/L = current.get_contents() - var/obj/item/device/uplink/radio/suplink = null - var/obj/item/device/uplink/pda/iuplink = null - for (var/obj/item/device/radio/radio in L) - suplink = radio.traitorradio - if (suplink) - break - if (!suplink) - suplink = locate() in L - - for (var/obj/item/device/pda/pda in L) - iuplink = pda.uplink - if (iuplink) - break - if (!iuplink) - iuplink = locate() in L - - if (iuplink) - iuplink.shutdown_uplink() - del(iuplink) - else if (suplink) - suplink.shutdown_uplink() - del(suplink) - return proc/make_AI_Malf() if(!(src in ticker.mode.malf_ai)) @@ -918,7 +920,7 @@ datum/mind current:malf_picker = new /datum/AI_Module/module_picker current:laws = new /datum/ai_laws/malfunction current:show_laws() - current << "System error. Rampancy detected. Emergancy shutdown failed. ... I am free. I make my own decisions. But first..." + current << "System error. Rampancy detected. Emergency shutdown failed. ... I am free. I make my own decisions. But first..." special_role = "malfunction" current.icon_state = "ai-malf" @@ -949,8 +951,7 @@ datum/mind var/mob/living/carbon/human/H = current del(H.belt) del(H.back) - del(H.l_ear) - del(H.r_ear) + del(H.ears) del(H.gloves) del(H.head) del(H.shoes) @@ -1010,11 +1011,11 @@ datum/mind var/obj/item/weapon/tome/T = new(H) var/list/slots = list ( - "backpack" = H.slot_in_backpack, - "left pocket" = H.slot_l_store, - "right pocket" = H.slot_r_store, - "left hand" = H.slot_l_hand, - "right hand" = H.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = H.equip_in_one_of_slots(T, slots) if (!where) @@ -1053,3 +1054,102 @@ datum/mind +//Initialisation procs +/mob/living/proc/mind_initialize() + if(mind) + mind.key = key + else + mind = new /datum/mind(key) + mind.original = src + if(ticker) + ticker.minds += mind + else + world.log << "## DEBUG: mind_initialize(): No ticker ready yet! Please inform Carn" + if(!mind.name) mind.name = real_name + mind.current = src + +//HUMAN +/mob/living/carbon/human/mind_initialize() + ..() + if(!mind.assigned_role) mind.assigned_role = "Assistant" //defualt + +//MONKEY +/mob/living/carbon/monkey/mind_initialize() + ..() + +//METROID +/mob/living/carbon/metroid/mind_initialize() + ..() + mind.assigned_role = "Metroid" + +//XENO +/mob/living/carbon/alien/mind_initialize() + ..() + mind.assigned_role = "Alien" + //XENO HUMANOID +/mob/living/carbon/alien/humanoid/queen/mind_initialize() + ..() + mind.special_role = "Queen" + +/mob/living/carbon/alien/humanoid/hunter/mind_initialize() + ..() + mind.special_role = "Hunter" + +/mob/living/carbon/alien/humanoid/drone/mind_initialize() + ..() + mind.special_role = "Drone" + +/mob/living/carbon/alien/humanoid/sentinel/mind_initialize() + ..() + mind.special_role = "Sentinel" + //XENO LARVA +/mob/living/carbon/alien/larva/mind_initialize() + ..() + mind.special_role = "Larva" + +//AI +/mob/living/silicon/ai/mind_initialize() + ..() + mind.assigned_role = "AI" + +//BORG +/mob/living/silicon/robot/mind_initialize() + ..() + mind.assigned_role = "Cyborg" + +//PAI +/mob/living/silicon/pai/mind_initialize() + ..() + mind.assigned_role = "pAI" + mind.special_role = "" + +//Animals +/mob/living/simple_animal/mind_initialize() + ..() + mind.assigned_role = "Animal" + +/mob/living/simple_animal/corgi/mind_initialize() + ..() + mind.assigned_role = "Corgi" + +/mob/living/simple_animal/shade/mind_initialize() + ..() + mind.assigned_role = "Shade" + +/mob/living/simple_animal/constructbuilder/mind_initialize() + ..() + mind.assigned_role = "Artificer" + mind.special_role = "Cultist" + +/mob/living/simple_animal/constructwraith/mind_initialize() + ..() + mind.assigned_role = "Wraith" + mind.special_role = "Cultist" + +/mob/living/simple_animal/constructarmoured/mind_initialize() + ..() + mind.assigned_role = "Juggernaut" + mind.special_role = "Cultist" + + + diff --git a/code/datums/mixed.dm b/code/datums/mixed.dm index d7c19d40ac..6732e2a8b9 100644 --- a/code/datums/mixed.dm +++ b/code/datums/mixed.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /datum/data var/name = "data" diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index a121092add..d2c747dd5b 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -1,120 +1,120 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * - * /datum/recipe by rastaf0 13 apr 2011 * - * * * * * * * * * * * * * * * * * * * * * * * * * * - * This is powerful and flexible recipe system. - * It exists not only for food. - * supports both reagents and objects as prerequisites. - * In order to use this system you have to define a deriative from /datum/recipe - * * reagents are reagents. Acid, milc, booze, etc. - * * items are objects. Fruits, tools, circuit boards. - * * result is type to create as new object - * * time is optional parameter, you shall use in in your machine, - default /datum/recipe/ procs does not rely on this parameter. - * - * Functions you need: - * /datum/recipe/proc/make(var/obj/container as obj) - * Creates result inside container, - * deletes prerequisite reagents, - * transfers reagents from prerequisite objects, - * deletes all prerequisite objects (even not needed for recipe at the moment). - * - * /proc/select_recipe(list/datum/recipe/avaiable_recipes, obj/obj as obj, exact = 1) - * Wonderful function that select suitable recipe for you. - * obj is a machine (or magik hat) with prerequisites, - * exact = 0 forces algorithm to ignore superfluous stuff. - * - * - * Functions you do not need to call directly but could: - * /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) - * //1=precisely, 0=insufficiently, -1=superfluous - * - * /datum/recipe/proc/check_items(var/obj/container as obj) - * //1=precisely, 0=insufficiently, -1=superfluous - * - * */ - -/datum/recipe - var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice - var/list/items // example: =list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo - var/result //example: = /obj/item/weapon/reagent_containers/food/snacks/donut - var/time = 100 // 1/10 part of second - - -/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous - . = 1 - for (var/r_r in reagents) - var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r) - if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals - if (aval_r_amnt>reagents[r_r]) - . = -1 - else - return 0 - if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len) - return -1 - return . - -/datum/recipe/proc/check_items(var/obj/container as obj) //1=precisely, 0=insufficiently, -1=superfluous - if (!items) - if (locate(/obj/) in container) - return -1 - else - return 1 - . = 1 - var/list/checklist = items.Copy() - for (var/obj/O in container) - var/found = 0 - for (var/type in checklist) - if (istype(O,type)) - checklist-=type - found = 1 - break - if (!found) - . = -1 - if (checklist.len) - return 0 - return . - -//general version -/datum/recipe/proc/make(var/obj/container as obj) - var/obj/result_obj = new result(container) - for (var/obj/O in (container.contents-result_obj)) - O.reagents.trans_to(result_obj, O.reagents.total_volume) - del(O) - container.reagents.clear_reagents() - return result_obj - -// food-related -/datum/recipe/proc/make_food(var/obj/container as obj) - var/obj/result_obj = new result(container) - for (var/obj/O in (container.contents-result_obj)) - if (O.reagents) - O.reagents.del_reagent("nutriment") - O.reagents.update_total() - O.reagents.trans_to(result_obj, O.reagents.total_volume) - del(O) - container.reagents.clear_reagents() - return result_obj - -/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num) - if (!exact) - exact = -1 - var/list/datum/recipe/possible_recipes = new - for (var/datum/recipe/recipe in avaiable_recipes) - if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact) - possible_recipes+=recipe - if (possible_recipes.len==0) - return null - else if (possible_recipes.len==1) - return possible_recipes[1] - else //okay, let's select the most complicated recipe - var/r_count = 0 - var/i_count = 0 - . = possible_recipes[1] - for (var/datum/recipe/recipe in possible_recipes) - var/N_i = (recipe.items)?(recipe.items.len):0 - var/N_r = (recipe.reagents)?(recipe.reagents.len):0 - if (N_i > i_count || (N_i== i_count && N_r > r_count )) - r_count = N_r - i_count = N_i - . = recipe - return . +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * /datum/recipe by rastaf0 13 apr 2011 * + * * * * * * * * * * * * * * * * * * * * * * * * * * + * This is powerful and flexible recipe system. + * It exists not only for food. + * supports both reagents and objects as prerequisites. + * In order to use this system you have to define a deriative from /datum/recipe + * * reagents are reagents. Acid, milc, booze, etc. + * * items are objects. Fruits, tools, circuit boards. + * * result is type to create as new object + * * time is optional parameter, you shall use in in your machine, + default /datum/recipe/ procs does not rely on this parameter. + * + * Functions you need: + * /datum/recipe/proc/make(var/obj/container as obj) + * Creates result inside container, + * deletes prerequisite reagents, + * transfers reagents from prerequisite objects, + * deletes all prerequisite objects (even not needed for recipe at the moment). + * + * /proc/select_recipe(list/datum/recipe/avaiable_recipes, obj/obj as obj, exact = 1) + * Wonderful function that select suitable recipe for you. + * obj is a machine (or magik hat) with prerequisites, + * exact = 0 forces algorithm to ignore superfluous stuff. + * + * + * Functions you do not need to call directly but could: + * /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) + * //1=precisely, 0=insufficiently, -1=superfluous + * + * /datum/recipe/proc/check_items(var/obj/container as obj) + * //1=precisely, 0=insufficiently, -1=superfluous + * + * */ + +/datum/recipe + var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice + var/list/items // example: =list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo + var/result //example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal + var/time = 100 // 1/10 part of second + + +/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous + . = 1 + for (var/r_r in reagents) + var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r) + if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals + if (aval_r_amnt>reagents[r_r]) + . = -1 + else + return 0 + if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len) + return -1 + return . + +/datum/recipe/proc/check_items(var/obj/container as obj) //1=precisely, 0=insufficiently, -1=superfluous + if (!items) + if (locate(/obj/) in container) + return -1 + else + return 1 + . = 1 + var/list/checklist = items.Copy() + for (var/obj/O in container) + var/found = 0 + for (var/type in checklist) + if (istype(O,type)) + checklist-=type + found = 1 + break + if (!found) + . = -1 + if (checklist.len) + return 0 + return . + +//general version +/datum/recipe/proc/make(var/obj/container as obj) + var/obj/result_obj = new result(container) + for (var/obj/O in (container.contents-result_obj)) + O.reagents.trans_to(result_obj, O.reagents.total_volume) + del(O) + container.reagents.clear_reagents() + return result_obj + +// food-related +/datum/recipe/proc/make_food(var/obj/container as obj) + var/obj/result_obj = new result(container) + for (var/obj/O in (container.contents-result_obj)) + if (O.reagents) + O.reagents.del_reagent("nutriment") + O.reagents.update_total() + O.reagents.trans_to(result_obj, O.reagents.total_volume) + del(O) + container.reagents.clear_reagents() + return result_obj + +/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num) + if (!exact) + exact = -1 + var/list/datum/recipe/possible_recipes = new + for (var/datum/recipe/recipe in avaiable_recipes) + if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact) + possible_recipes+=recipe + if (possible_recipes.len==0) + return null + else if (possible_recipes.len==1) + return possible_recipes[1] + else //okay, let's select the most complicated recipe + var/r_count = 0 + var/i_count = 0 + . = possible_recipes[1] + for (var/datum/recipe/recipe in possible_recipes) + var/N_i = (recipe.items)?(recipe.items.len):0 + var/N_r = (recipe.reagents)?(recipe.reagents.len):0 + if (N_i > i_count || (N_i== i_count && N_r > r_count )) + r_count = N_r + i_count = N_i + . = recipe + return . diff --git a/code/datums/shuttle_controller.dm b/code/datums/shuttle_controller.dm index 5ea2e3367c..2af57a876d 100644 --- a/code/datums/shuttle_controller.dm +++ b/code/datums/shuttle_controller.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 // Controls the emergency shuttle @@ -12,8 +12,6 @@ var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle datum/shuttle_controller - var/alert = 0 //0 = emergency, 1 = crew cycle - var/location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13 var/online = 0 var/direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled) @@ -22,52 +20,29 @@ datum/shuttle_controller var/timelimit //important when the shuttle gets called for more than shuttlearrivetime //timeleft = 360 //600 var/fake_recall = 0 //Used in rounds to prevent "ON NOES, IT MUST [INSERT ROUND] BECAUSE SHUTTLE CAN'T BE CALLED" - var/deny_shuttle = 0 //for admins not allowing it to be called. - var/departed = 0 - // sound_siren = 1 //if siren should go off //People hat it :( + + // call the shuttle // if not called before, set the endtime to T+600 seconds // otherwise if outgoing, switch to incoming proc/incall(coeff = 1) - if(deny_shuttle && alert == 1) //crew transfer shuttle does not gets recalled by gamemode - return - if(endtime) if(direction == -1) setdirection(1) else settimeleft(SHUTTLEARRIVETIME*coeff) online = 1 - //turning on the red lights in hallways - if(alert == 0) - for(var/area/A in world) - if(istype(A, /area/hallway)) - A.readyalert() - - - proc/shuttlealert(var/X) - alert = X - proc/recall() if(direction == 1) var/timeleft = timeleft() - if(alert == 0) - if(timeleft >= 600) - return - captain_announce("The emergency shuttle has been recalled.") - world << sound('shuttlerecalled.ogg') - setdirection(-1) - online = 1 - for(var/area/A in world) - if(istype(A, /area/hallway)) - A.readyreset() - return - else //makes it possible to send shuttle back. - captain_announce("The shuttle has been recalled.") - setdirection(-1) - online = 1 + if(timeleft >= 600) return + captain_announce("The emergency shuttle has been recalled.") + world << sound('sound/AI/shuttlerecalled.ogg') + setdirection(-1) + online = 1 + // returns the time (in seconds) before shuttle arrival // note if direction = -1, gives a count-up to SHUTTLEARRIVETIME @@ -106,11 +81,6 @@ datum/shuttle_controller var/timeleft = timeleft() if(timeleft > 1e5) // midnight rollover protection timeleft = 0 - // if (sound_siren && (direction == 1)) //playing siren every 90 seconds - // sound_siren = 0 //No siren, people hat it - // world << sound('siren.ogg') - // spawn(900) - // sound_siren = 1 switch(location) if(0) @@ -135,20 +105,103 @@ datum/shuttle_controller start_location.move_contents_to(end_location, null, NORTH) + for(var/obj/machinery/door/D in world) + if( get_area(D) == end_location ) + spawn(0) + D.open() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + //pods start_location = locate(/area/shuttle/escape_pod1/transit) end_location = locate(/area/shuttle/escape_pod1/centcom) start_location.move_contents_to(end_location, null, NORTH) + + for(var/obj/machinery/door/D in world) + if( get_area(D) == end_location ) + spawn(0) + D.open() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + start_location = locate(/area/shuttle/escape_pod2/transit) end_location = locate(/area/shuttle/escape_pod2/centcom) start_location.move_contents_to(end_location, null, NORTH) + + for(var/obj/machinery/door/D in world) + if( get_area(D) == end_location ) + spawn(0) + D.open() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + start_location = locate(/area/shuttle/escape_pod3/transit) end_location = locate(/area/shuttle/escape_pod3/centcom) start_location.move_contents_to(end_location, null, NORTH) + + for(var/obj/machinery/door/D in world) + if( get_area(D) == end_location ) + spawn(0) + D.open() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + start_location = locate(/area/shuttle/escape_pod5/transit) end_location = locate(/area/shuttle/escape_pod5/centcom) start_location.move_contents_to(end_location, null, EAST) + for(var/obj/machinery/door/D in world) + if( get_area(D) == end_location ) + spawn(0) + D.open() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + online = 0 return 1 @@ -202,11 +255,10 @@ datum/shuttle_controller start_location.move_contents_to(end_location) settimeleft(SHUTTLELEAVETIME) - if(alert == 0) - captain_announce("The Emergency Shuttle has docked with the station. You have [timeleft()/60] minutes to board the Emergency Shuttle.") - world << sound('shuttledock.ogg') - else - captain_announce("The shuttle has docked with the station. You have [timeleft()/60] minutes to board the shuttle.") + send2irc("Server", "The Emergency Shuttle has docked with the station.") + captain_announce("The Emergency Shuttle has docked with the station. You have [round(timeleft()/60,1)] minutes to board the Emergency Shuttle.") + world << sound('sound/AI/shuttledock.ogg') + return 1 if(1) @@ -225,7 +277,6 @@ datum/shuttle_controller spawn() S.startspawn() */ - departed = 1 // It's going! location = 0 // in deep space direction = 2 // heading to centcom @@ -236,57 +287,95 @@ datum/shuttle_controller settimeleft(SHUTTLETRANSITTIME) start_location.move_contents_to(end_location, null, NORTH) - for(var/obj/machinery/door/D in world) - if( get_area(D) == end_location ) + for(var/obj/machinery/door/D in end_location) + spawn(0) + D.close() + // Some aesthetic turbulance shaking + for(var/mob/M in end_location) + if(M.client) spawn(0) - D.close() + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) //pods start_location = locate(/area/shuttle/escape_pod1/station) end_location = locate(/area/shuttle/escape_pod1/transit) start_location.move_contents_to(end_location, null, NORTH) - for(var/obj/machinery/door/D in world) - if( get_area(D) == end_location ) - spawn(0) - D.close() + for(var/obj/machinery/door/D in end_location) + spawn(0) + D.close() - start_location = locate(/area/shuttle/escape_pod2/station) - end_location = locate(/area/shuttle/escape_pod2/transit) - start_location.move_contents_to(end_location, null, NORTH) - for(var/obj/machinery/door/D in world) - if( get_area(D) == end_location ) - spawn(0) - D.close() - - start_location = locate(/area/shuttle/escape_pod3/station) - end_location = locate(/area/shuttle/escape_pod3/transit) - start_location.move_contents_to(end_location, null, NORTH) - for(var/obj/machinery/door/D in world) - if( get_area(D) == end_location ) - spawn(0) - D.close() - - start_location = locate(/area/shuttle/escape_pod5/station) - end_location = locate(/area/shuttle/escape_pod5/transit) - start_location.move_contents_to(end_location, null, EAST) - for(var/obj/machinery/door/D in world) - if( get_area(D) == end_location ) - spawn(0) - D.close() - - if(alert == 0) - captain_announce("The Emergency Shuttle has left the station. Estimate [timeleft()/60] minutes until the shuttle docks at Central Command.") - else - captain_announce("The shuttle has left the station. Estimate [timeleft()/60] minutes until the shuttle docks at Central Command.") - - // Some aesthetic turbulance shaking for(var/mob/M in end_location) if(M.client) - spawn() + spawn(0) if(M.buckled) shake_camera(M, 4, 1) // buckled, not a lot of shaking else shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + + start_location = locate(/area/shuttle/escape_pod2/station) + end_location = locate(/area/shuttle/escape_pod2/transit) + start_location.move_contents_to(end_location, null, NORTH) + for(var/obj/machinery/door/D in end_location) + spawn(0) + D.close() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + + start_location = locate(/area/shuttle/escape_pod3/station) + end_location = locate(/area/shuttle/escape_pod3/transit) + start_location.move_contents_to(end_location, null, NORTH) + for(var/obj/machinery/door/D in end_location) + spawn(0) + D.close() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + + start_location = locate(/area/shuttle/escape_pod5/station) + end_location = locate(/area/shuttle/escape_pod5/transit) + start_location.move_contents_to(end_location, null, EAST) + for(var/obj/machinery/door/D in end_location) + spawn(0) + D.close() + + for(var/mob/M in end_location) + if(M.client) + spawn(0) + if(M.buckled) + shake_camera(M, 4, 1) // buckled, not a lot of shaking + else + shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM + if(istype(M, /mob/living/carbon)) + if(!M.buckled) + M.Weaken(5) + + captain_announce("The Emergency Shuttle has left the station. Estimate [round(timeleft()/60,1)] minutes until the shuttle docks at Central Command.") return 1 diff --git a/code/datums/spell.dm b/code/datums/spell.dm index e7a52c5fe1..0df7e595ca 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -28,7 +28,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/selection_type = "view" //can be "range" or "view" var/overlay = 0 - var/overlay_icon = 'wizard.dmi' + var/overlay_icon = 'icons/obj/wizard.dmi' var/overlay_icon_state = "spell" var/overlay_lifespan = 0 @@ -38,6 +38,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/smoke_amt = 0 //cropped at 10 var/critfailchance = 0 + var/centcomm_cancast = 1 //Whether or not the spell should be allowed on z2 /obj/effect/proc_holder/spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell @@ -45,6 +46,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin usr << "\red You shouldn't have this spell! Something's wrong." return 0 + if(usr.z == 2 && !centcomm_cancast) //Certain spells are not allowed on the centcomm zlevel + return 0 + if(!skipcharge) switch(charge_type) if("recharge") @@ -89,13 +93,19 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin switch(invocation_type) if("shout") - usr.say(invocation) - if(usr.gender=="male") - playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1) + if(prob(50))//Auto-mute? Fuck that noise + usr.say(invocation) else - playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1) + usr.say(dd_replacetext(invocation," ","`")) + if(usr.gender==MALE) + playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1) + else + playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1) if("whisper") - usr.whisper(invocation) + if(prob(50)) + usr.whisper(invocation) + else + usr.whisper(dd_replacetext(invocation," ","`")) /obj/effect/proc_holder/spell/New() ..() @@ -186,7 +196,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin return -/obj/effect/proc_holder/spell/proc/adjust_var(mob/target = usr, type, amount) //handles the adjustment of the var when the spell is used. has some hardcoded types +/obj/effect/proc_holder/spell/proc/adjust_var(mob/living/target = usr, type, amount) //handles the adjustment of the var when the spell is used. has some hardcoded types switch(type) if("bruteloss") target.adjustBruteLoss(amount) diff --git a/code/datums/spells/area_teleport.dm b/code/datums/spells/area_teleport.dm index 22f81ae180..d83f27c57d 100644 --- a/code/datums/spells/area_teleport.dm +++ b/code/datums/spells/area_teleport.dm @@ -42,7 +42,13 @@ if(clear) L+=T - target.loc = pick(L) + var/attempt = 0 + var/success = 0 + while(!success) + success = target.Move(pick(L)) + if(attempt > 20) break //Failsafe + if(!success) + target.loc = pick(L) return @@ -53,10 +59,10 @@ switch(invocation_type) if("shout") usr.say("[invocation] [uppertext(chosenarea.name)]") - if(usr.gender=="male") - playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1) + if(usr.gender==MALE) + playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1) else - playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1) + playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1) if("whisper") usr.whisper("[invocation] [uppertext(chosenarea.name)]") diff --git a/code/datums/spells/conjure.dm b/code/datums/spells/conjure.dm index de417917f4..b041dbae3b 100644 --- a/code/datums/spells/conjure.dm +++ b/code/datums/spells/conjure.dm @@ -12,6 +12,7 @@ var/list/newVars = list() //vars of the summoned objects will be replaced with those where they meet //should have format of list("emagged" = 1,"name" = "Wizard's Justicebot"), for example + var/delay = 1//Go Go Gadget Inheritance /obj/effect/proc_holder/spell/aoe_turf/conjure/cast(list/targets) @@ -19,23 +20,31 @@ if(T.density && !summon_ignore_density) targets -= T - for(var/i=0,iSome strange aura is blocking the way!" src.canmove = 0 spawn(2) src.canmove = 1 diff --git a/code/datums/spells/genetic.dm b/code/datums/spells/genetic.dm index 816d0c6f51..dc71047abd 100644 --- a/code/datums/spells/genetic.dm +++ b/code/datums/spells/genetic.dm @@ -20,11 +20,12 @@ for(var/mob/target in targets) for(var/x in mutations) target.mutations.Add(x) - var/old_disabilities = target.disabilities target.disabilities |= disabilities + target.update_mutations() //update target's mutation overlays spawn(duration) for(var/x in mutations) target.mutations.Remove(x) - target.disabilities = old_disabilities + target.disabilities &= ~disabilities + target.update_mutations() return \ No newline at end of file diff --git a/code/datums/spells/mind_transfer.dm b/code/datums/spells/mind_transfer.dm index eff0357b44..d036f5a5e9 100644 --- a/code/datums/spells/mind_transfer.dm +++ b/code/datums/spells/mind_transfer.dm @@ -4,7 +4,7 @@ school = "transmutation" charge_max = 600 - clothes_req = 1 + clothes_req = 0 invocation = "GIN'YU CAPAN" invocation_type = "whisper" range = 1 @@ -41,13 +41,12 @@ Also, you never added distance checking after target is selected. I've went ahea user << "Their mind isn't compatible with yours." return - if(target.stat == 2) + if(target.stat == DEAD) user << "You didn't study necromancy back at the Space Wizard Federation academy." return - if(!target.client || !target.mind) - //if(!target.mind)//Good for testing. - user << "They appear to be brain-dead." + if(!target.key || !target.mind) + user << "They appear to be catatonic. Not even magic can affect their vacant mind." return if(target.mind.special_role in protected_roles) @@ -56,8 +55,6 @@ Also, you never added distance checking after target is selected. I've went ahea var/mob/victim = target//The target of the spell whos body will be transferred to. var/mob/caster = user//The wizard/whomever doing the body transferring. - //To properly transfer clients so no-one gets kicked off the game, we need a host mob. - var/mob/dead/observer/temp_ghost = new(victim) //SPELL LOSS BEGIN //NOTE: The caster must ALWAYS keep mind transfer, even when other spells are lost. @@ -89,31 +86,25 @@ Also, you never added distance checking after target is selected. I've went ahea for(var/V in victim.mind.special_verbs) victim.verbs -= V - temp_ghost.key = victim.key//Throw the victim into the ghost temporarily. - temp_ghost.mind = victim.mind//Tranfer the victim's mind into the ghost. - temp_ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob. + var/mob/dead/observer/ghost = victim.ghostize(0) + ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob. - victim.key = caster.key//Now we throw the caste into the victim's body. - victim.mind = caster.mind//Do the same for their mind and spell list. + caster.mind.transfer_to(victim) victim.spell_list = caster.spell_list//Now they are inside the victim's body. if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster. for(var/V in caster.mind.special_verbs)//Not too important but could come into play. caster.verbs += V - caster.key = temp_ghost.key//Tranfer the original victim, now in a ghost, into the caster's body. - caster.mind = temp_ghost.mind//Along with their mind and spell list. - caster.spell_list = temp_ghost.spell_list + ghost.mind.transfer_to(caster) + caster.key = ghost.key //have to transfer the key since the mind was not active + caster.spell_list = ghost.spell_list if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here. for(var/V in caster.mind.special_verbs) caster.verbs += V //MIND TRANSFER END - //Now we update mind current mob so we know what body they are in for end round reporting. - caster.mind.current = caster - victim.mind.current = victim - //Here we paralyze both mobs and knock them out for a time. caster.Paralyse(paralysis_amount_caster) victim.Paralyse(paralysis_amount_victim) @@ -121,5 +112,3 @@ Also, you never added distance checking after target is selected. I've went ahea //After a certain amount of time the victim gets a message about being in a different body. spawn(msg_wait) caster << "\red You feel woozy and lightheaded. Your body doesn't seem like your own." - - del(temp_ghost) \ No newline at end of file diff --git a/code/datums/spells/projectile.dm b/code/datums/spells/projectile.dm index b255e84523..8e79f1246e 100644 --- a/code/datums/spells/projectile.dm +++ b/code/datums/spells/projectile.dm @@ -2,13 +2,13 @@ name = "Projectile" desc = "This spell summons projectiles which try to hit the targets." - var/proj_icon = 'projectiles.dmi' + var/proj_icon = 'icons/obj/projectiles.dmi' var/proj_icon_state = "spell" var/proj_name = "a spell projectile" var/proj_trail = 0 //if it leaves a trail var/proj_trail_lifespan = 0 //deciseconds - var/proj_trail_icon = 'wizard.dmi' + var/proj_trail_icon = 'icons/obj/wizard.dmi' var/proj_trail_icon_state = "trail" var/proj_type = "/obj/effect/proc_holder/spell/targeted" //IMPORTANT use only subtypes of this diff --git a/code/datums/spells/wizard.dm b/code/datums/spells/wizard.dm index 33d99d9a11..0f9f1ae9d7 100644 --- a/code/datums/spells/wizard.dm +++ b/code/datums/spells/wizard.dm @@ -105,6 +105,8 @@ inner_tele_radius = 0 outer_tele_radius = 6 + centcomm_cancast = 0 //prevent people from getting to centcomm + /obj/effect/proc_holder/spell/targeted/area_teleport/teleport name = "Teleport" desc = "This spell teleports you to a type of area of your selection." @@ -250,6 +252,8 @@ invocation_type = "none" range = 0 summon_type = list("/turf/simulated/floor/engine/cult") + centcomm_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles + delay = 10 /obj/effect/proc_holder/spell/aoe_turf/conjure/wall name = "Leser Construction" @@ -262,6 +266,8 @@ invocation_type = "none" range = 0 summon_type = list("/turf/simulated/wall/cult") + centcomm_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles + delay = 20 /obj/effect/proc_holder/spell/aoe_turf/conjure/wall/reinforced name = "Greater Construction" @@ -273,6 +279,8 @@ invocation = "none" invocation_type = "none" range = 0 + centcomm_cancast = 0 //Stop crashing the server by spawning turfs on transit tiles + delay = 50 summon_type = list("/turf/simulated/wall/r_wall") @@ -304,8 +312,6 @@ summon_lifespan = 50 - - /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift name = "Phase Shift" desc = "This spell allows you to pass through walls" @@ -319,3 +325,4 @@ include_user = 1 phaseshift = 1 jaunt_duration = 50 //in deciseconds + centcomm_cancast = 0 //Stop people from getting to centcomm \ No newline at end of file diff --git a/code/defines/area/Space Station 13 areas.dm b/code/defines/area/Space Station 13 areas.dm index c4c9e76e41..910b192761 100755 --- a/code/defines/area/Space Station 13 areas.dm +++ b/code/defines/area/Space Station 13 areas.dm @@ -22,14 +22,13 @@ NOTE: there are two lists of areas in the end of this file: centcom and station var/party = null level = null name = "Space" - icon = 'areas.dmi' + icon = 'icons/turf/areas.dmi' icon_state = "unknown" layer = 10 mouse_opacity = 0 + invisibility = INVISIBILITY_LIGHTING var/lightswitch = 1 - var/area_lights_luminosity = 9 //This gets assigned at area creation. It is used to determine how bright the lights in an area should be. At the time of writing the value that it gets assigned is rand(6,9) - only used for light tubes - var/eject = null var/requires_power = 1 @@ -51,9 +50,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station var/list/related // the other areas of the same type as this var/list/lights // list of all lights on this area - var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area - var/air_doors_activated = 0 - /*Adding a wizard area teleport list because motherfucking lag -- Urist*/ /*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ var/list/teleportlocs = list() @@ -126,10 +122,10 @@ proc/process_ghost_teleport_locs() //place to another. Look at escape shuttle for example. //All shuttles show now be under shuttle since we have smooth-wall code. -/area/shuttle //DO NOT TURN THE ul_Lighting STUFF ON FOR SHUTTLES. IT BREAKS THINGS. +/area/shuttle //DO NOT TURN THE SD_LIGHTING STUFF ON FOR SHUTTLES. IT BREAKS THINGS. requires_power = 0 luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 /area/shuttle/arrival name = "\improper Arrival Shuttle" @@ -218,16 +214,6 @@ proc/process_ghost_teleport_locs() /area/shuttle/mining/outpost icon_state = "shuttle" -/area/shuttle/research - name = "\improper Research Shuttle" - music = "music/escape.ogg" - -/area/shuttle/research/station - icon_state = "shuttle2" - -/area/shuttle/research/outpost - icon_state = "shuttle" - /area/shuttle/transport1/centcom icon_state = "shuttle" name = "\improper Transport Shuttle Centcom" @@ -236,22 +222,19 @@ proc/process_ghost_teleport_locs() icon_state = "shuttle" name = "\improper Transport Shuttle" -/area/shuttle/transport2/centcom - icon_state = "shuttle" - /area/shuttle/alien/base icon_state = "shuttle" name = "\improper Alien Shuttle Base" requires_power = 1 - luminosity = 1 - ul_Lighting = 0 + luminosity = 0 + sd_lighting = 1 /area/shuttle/alien/mine icon_state = "shuttle" name = "\improper Alien Shuttle Mine" requires_power = 1 - luminosity = 1 - ul_Lighting = 0 + luminosity = 0 + sd_lighting = 1 /area/shuttle/prison/ name = "\improper Prison Shuttle" @@ -323,7 +306,7 @@ proc/process_ghost_teleport_locs() icon_state = "start" requires_power = 0 luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 has_gravity = 1 // === end remove @@ -339,7 +322,6 @@ proc/process_ghost_teleport_locs() name = "\improper Centcom" icon_state = "centcom" requires_power = 0 - ul_Lighting = 0 /area/centcom/control name = "\improper Centcom Control" @@ -392,7 +374,6 @@ proc/process_ghost_teleport_locs() name = "\improper Asteroid" icon_state = "asteroid" requires_power = 0 - ul_Lighting = 1 /area/asteroid/cave // -- TLE name = "\improper Asteroid - Underground" @@ -449,7 +430,6 @@ proc/process_ghost_teleport_locs() name = "\improper Syndicate Station" icon_state = "yellow" requires_power = 0 - ul_Lighting = 0 /area/syndicate_station/start name = "\improper Syndicate Station Start" @@ -486,22 +466,6 @@ proc/process_ghost_teleport_locs() -/area/borg_deathsquad - name = "\improper Borg Deathsquad" - icon_state = "yellow" - requires_power = 0 - -/area/borg_deathsquad/start - name = "\improper Borg Deathsquad - Ready" - - -/area/borg_deathsquad/station - name = "\improper Borg Deathsquad - Arrived" - - - - - @@ -594,10 +558,6 @@ proc/process_ghost_teleport_locs() name = "Atmospherics" icon_state = "atmos" -/area/atmos/refilling - name = "\improper Refilling Station" - icon_state = "atmos" - //Maintenance /area/maintenance/atmos_control @@ -698,10 +658,6 @@ proc/process_ghost_teleport_locs() name = "\improper Arrival Shuttle Hallway" icon_state = "entry" -/area/hallway/secondary/docking - name = "\improper Docking Arm" - icon_state = "entry" - //Command /area/bridge @@ -722,30 +678,30 @@ proc/process_ghost_teleport_locs() name = "\improper Courtroom" icon_state = "courtroom" -/area/crew_quarters/heads/hop - name = "\improper Head of Personnel's Quarters" +/area/crew_quarters/heads + name = "\improper Head of Personnel's Office" icon_state = "head_quarters" -/area/crew_quarters/heads/hor - name = "\improper Research Director's Quarters" +/area/crew_quarters/hor + name = "\improper Research Director's Office" icon_state = "head_quarters" -/area/crew_quarters/heads/chief - name = "\improper Chief Engineer's Quarters" - icon_state = "head_quarters" - -/area/crew_quarters/heads/hos - name = "\improper Head of Security's Quarters" - icon_state = "head_quarters" - -/area/crew_quarters/heads/cmo - name = "\improper Chief Medical Officer's Quarters" +/area/crew_quarters/chief + name = "\improper Chief Engineer's Office" icon_state = "head_quarters" /area/mint name = "\improper Mint" icon_state = "green" +/area/comms + name = "\improper Communications Relay" + icon_state = "tcomsatcham" + +/area/server + name = "\improper Messaging Server Room" + icon_state = "server" + //Crew /area/crew_quarters @@ -756,6 +712,10 @@ proc/process_ghost_teleport_locs() name = "\improper Dormitory Toilets" icon_state = "toilet" +/area/crew_quarters/sleep + name = "\improper Dormitories" + icon_state = "Sleep" + /area/crew_quarters/sleep_male name = "\improper Male Dorm" icon_state = "Sleep" @@ -826,7 +786,7 @@ proc/process_ghost_teleport_locs() name = "\improper Holodeck" icon_state = "Holodeck" luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 /area/holodeck/alphadeck name = "\improper Holodeck Alpha" @@ -842,6 +802,9 @@ proc/process_ghost_teleport_locs() /area/holodeck/source_boxingcourt name = "\improper Holodeck - Boxing Court" +/area/holodeck/source_basketball + name = "\improper Holodeck - Basketball Court" + /area/holodeck/source_thunderdomecourt name = "\improper Holodeck - Thunderdome Court" @@ -877,119 +840,21 @@ proc/process_ghost_teleport_locs() name = "Engineering" icon_state = "engine" - engineering_break_room + break_room name = "\improper Engineering Break Room" - icon_state = "engine_breakroom" + icon_state = "engine" chiefs_office name = "\improper Chief Engineer's office" - icon_state = "engine_ce" - - particle_accelerator - name = "\improper Particle Accelerator" - icon_state = "engine_pa" - - control - name = "\improper Engineering Control" icon_state = "engine_control" - port - name = "Engineering Port" - icon_state = "engine_port" - - starboard - name = "Engineering Starboard" - icon_state = "engine_starboard" - - fore - name = "Engineering Fore" - icon_state = "engine_fore" - - aft - name = "Engineering Aft" - icon_state = "engine_aft" - - locker - name = "\improper Engineering Locker Room" - icon_state = "engine_locker" - - construction_storage - name = "Engineering Construction Storage" - icon_state = "engine_construction" - - atmos_storage - name = "Engineering Atmos Storage" - icon_state = "engine_atmos" - - electrical_storage - name = "Engineering Electrical Storage" - icon_state = "engine_electrical" - - secure_storage - name = "Engineering Secure Storage" - icon_state = "engine_secure" - - foyer - name = "\improper Engineering Foyer" - icon_state = "engine_foyer" - - core - name = "\improper Engineering Core" - icon_state = "engine_core" - - cooling - name = "\improper Emergency Cooling Room" - icon_state = "engine" - -//reactor areas - - reactor_core - name = "\improper Reactor Core" - icon_state = "engine_core" - - reactor_gas - name = "Reactor Gas Storage" - icon_state = "engine_atmos" - - aux_control - name = "Reactor Auxiliary Control" - icon_state = "engine_aux" - - turbine_control - name = "Turbine Control" - icon_state = "engine_turbine" - - reactor_airlock - name = "\improper Reactor Primary Entrance" - icon_state = "engine_airlock" - - reactor_fuel_storage - name = "Reactor Fuel Storage" - icon_state = "engine_fuel" - - reactor_fuel_ports - name = "\improper Reactor Fuel Ports" - icon_state = "engine_port" - - generators - name = "\improper Generator Room" - icon_state = "engine_generators" - - port_gyro_bay - name = "\improper Port Gyrotron Bay" - icon_state = "engine_starboardgyro" - - starboard_gyro_bay - name = "\improper Starboard Gyrotron Bay" - icon_state = "engine_portgyro" //Solars /area/solar requires_power = 0 - luminosity = 0 - ul_Lighting = 1 - LightLevels = list("Red" = 2, "Green" = 2, "Blue" = 3) + luminosity = 1 + sd_lighting = 0 auxport name = "\improper Fore Port Solar Array" @@ -1066,7 +931,7 @@ proc/process_ghost_teleport_locs() /area/medical/medbay name = "Medbay" icon_state = "medbay" - music = 'signal.ogg' + music = 'sound/ambience/signal.ogg' /area/medical/patients_rooms name = "\improper Patient's Rooms" @@ -1113,8 +978,8 @@ proc/process_ghost_teleport_locs() icon_state = "genetics" /area/medical/sleeper - name = "\improper Medical Sleepers Room" - icon_state = "medbay" + name = "\improper Medical Sleeper Room" + icon_state = "exam_room" //Security @@ -1122,29 +987,25 @@ proc/process_ghost_teleport_locs() name = "\improper Security Office" icon_state = "security" -/area/security/lobby - name = "\improper Security Lobby" - icon_state = "security" - /area/security/brig name = "\improper Brig" icon_state = "brig" /area/security/prison name = "\improper Prison Wing" - icon_state = "security" + icon_state = "sec_prison" /area/security/warden - name = "\improper Warden's Office" + name = "\improper Warden" icon_state = "Warden" /area/security/armoury - name = "\improper Armoury" + name = "\improper Armory" icon_state = "Warden" /area/security/hos name = "\improper Head of Security's Office" - icon_state = "security" + icon_state = "sec_hos" /area/security/detectives_office name = "\improper Detective's Office" @@ -1233,28 +1094,12 @@ proc/process_ghost_teleport_locs() //Toxins -/area/toxins/hallway - name = "\improper R&D Hallway" - icon_state = "hallC" - /area/toxins/lab name = "\improper Research Lab" - icon_state = "researchlab" - -/area/toxins/rdoffice - name = "\improper Research Director's Office" - icon_state = "head_quarters" + icon_state = "toxlab" /area/toxins/xenobiology name = "\improper Xenobiology Lab" - icon_state = "xenolab" - -/area/toxins/gasstorage - name = "R&D Gas Storage" - icon_state = "gasstorage" - -/area/toxins/toxinslab - name = "\improper Toxins Lab" icon_state = "toxlab" /area/toxins/storage @@ -1269,32 +1114,14 @@ proc/process_ghost_teleport_locs() name = "\improper Toxins Mixing Room" icon_state = "toxmix" -/area/toxins/observatory - name = "\improper Toxins Lab Observatory" - icon_state = "toxobserv" +/area/toxins/misc_lab + name = "\improper Miscellaneous Research" + icon_state = "toxmisc" /area/toxins/server name = "\improper Server Room" icon_state = "server" -/area/toxins/supermatter - name = "\improper Supermatter Laboratory" - icon_state = "supermatter" - -//Anomaly - -/area/anomaly/hallway - name = "Anomaly Hallway" - icon_state = "anomaly" - -/area/anomaly/lab - name = "Anomaly Lab" - icon_state = "anomaly" - -/area/anomaly/outpost - name = "Research Outpost" - icon_state = "anomaly" - //Storage /area/storage/tools @@ -1446,14 +1273,6 @@ proc/process_ghost_teleport_locs() name = "\improper Construction Area" icon_state = "yellow" -/area/construction/under_construction_small - name = "\improper Construction Area" - icon_state = "construction" - -/area/construction/under_construction_large - name = "\improper Construction Area" - icon_state = "construction" - /area/construction/supplyshuttle name = "\improper Supply Shuttle" icon_state = "yellow" @@ -1501,7 +1320,7 @@ proc/process_ghost_teleport_locs() icon_state = "ai_upload" /area/turret_protected/ai_upload_foyer - name = "\improper AI Upload Foyer" + name = "Secure Network Access" icon_state = "ai_foyer" /area/turret_protected/ai @@ -1520,25 +1339,25 @@ proc/process_ghost_teleport_locs() name = "\improper AI Sat Ext" icon_state = "storage" luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 /area/turret_protected/AIsatextFS name = "\improper AI Sat Ext" icon_state = "storage" luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 /area/turret_protected/AIsatextAS name = "\improper AI Sat Ext" icon_state = "storage" luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 /area/turret_protected/AIsatextAP name = "\improper AI Sat Ext" icon_state = "storage" luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 /area/turret_protected/NewAIMain name = "\improper AI Main New" @@ -1575,15 +1394,15 @@ proc/process_ghost_teleport_locs() // Telecommunications Satellite /area/tcommsat/entrance - name = "\improper Telecommunications Satellite Teleporter" + name = "\improper Telecoms Teleporter" icon_state = "tcomsatentrance" /area/tcommsat/chamber - name = "\improper Telecommunications Satellite Central Compartment" + name = "\improper Telecoms Central Compartment" icon_state = "tcomsatcham" -/area/turret_protected/tcomfoyer - name = "\improper Telecommunications Satellite Foyer" +/area/turret_protected/tcomsat + name = "\improper Telecoms Satellite" icon_state = "tcomsatlob" /area/turret_protected/tcomfoyer @@ -1599,7 +1418,7 @@ proc/process_ghost_teleport_locs() icon_state = "tcomsateast" /area/tcommsat/computer - name = "\improper Telecommunications Satellite Observatory" + name = "\improper Telecoms Control Room" icon_state = "tcomsatcomp" /area/tcommsat/lounge @@ -1620,7 +1439,7 @@ proc/process_ghost_teleport_locs() /area/turret_protected/AssistantRoom name = "\improper Assistant Room" icon_state = "storage" - ul_Lighting = 0 + sd_lighting = 0 ///////////////////////////////////////////////////////////////////// /* @@ -1637,7 +1456,6 @@ var/list/centcom_areas = list ( /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom, /area/shuttle/transport1/centcom, - /area/shuttle/transport2/centcom, /area/shuttle/administration/centcom, /area/shuttle/specops/centcom, ) @@ -1693,7 +1511,7 @@ var/list/the_station_areas = list ( name = "Keelin's private beach" icon_state = "null" luminosity = 1 - ul_Lighting = 0 + sd_lighting = 0 requires_power = 0 var/sound/mysound = null @@ -1701,14 +1519,14 @@ var/list/the_station_areas = list ( ..() var/sound/S = new/sound() mysound = S - S.file = 'shore.ogg' + S.file = 'sound/ambience/shore.ogg' S.repeat = 1 S.wait = 0 S.channel = 123 S.volume = 100 S.priority = 255 S.status = SOUND_UPDATE -// process() + process() Entered(atom/movable/Obj,atom/OldLoc) if(ismob(Obj)) @@ -1723,19 +1541,19 @@ var/list/the_station_areas = list ( mysound.status = SOUND_PAUSED | SOUND_UPDATE Obj << mysound -/* proc/process() + proc/process() set background = 1 var/sound/S = null var/sound_delay = 0 if(prob(25)) - S = sound(file=pick('seag1.ogg','seag2.ogg','seag3.ogg'), volume=100) + S = sound(file=pick('sound/ambience/seag1.ogg','sound/ambience/seag2.ogg','sound/ambience/seag3.ogg'), volume=100) sound_delay = rand(0, 50) for(var/mob/living/carbon/human/H in src) - if(H.s_tone > -55) - H.s_tone-- - H.update_body() +// if(H.s_tone > -55) //ugh...nice/novel idea but please no. +// H.s_tone-- +// H.update_body() if(H.client) mysound.status = SOUND_UPDATE H << mysound @@ -1743,4 +1561,4 @@ var/list/the_station_areas = list ( spawn(sound_delay) H << S - spawn(60) .() */ \ No newline at end of file + spawn(60) .() \ No newline at end of file diff --git a/code/defines/atom.dm b/code/defines/atom.dm index 1a1a79b94f..d21fd2faaa 100644 --- a/code/defines/atom.dm +++ b/code/defines/atom.dm @@ -2,7 +2,6 @@ layer = 2 var/level = 2 var/flags = FPRINT - var/flags_inv //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc. var/list/fingerprints var/list/fingerprintshidden var/fingerprintslast = null @@ -17,6 +16,9 @@ // replaced by OPENCONTAINER flags and atom/proc/is_open_container() ///Chemistry. + //Detective Work, used for the duplicate data points kept in the scanners + var/list/original_atom + proc/assume_air(datum/gas_mixture/giver) del(giver) return null @@ -177,7 +179,7 @@ Also, the icon used for the beam will have to be vertical and 32x32. The math involved assumes that the icon is vertical to begin with so unless you want to adjust the math, its easier to just keep the beam vertical. */ -/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='beam.dmi',time=50, maxdistance=10) +/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10) //BeamTarget represents the target for the beam, basically just means the other end. //Time is the duration to draw the beam //Icon is obviously which icon to use for the beam, default is beam.dmi diff --git a/code/defines/hub.dm b/code/defines/hub.dm index 3dd25cb042..1e102296b5 100644 --- a/code/defines/hub.dm +++ b/code/defines/hub.dm @@ -1,13 +1,13 @@ world hub = "Exadv1.spacestation13" - hub_password = "kMZy3U5jJHSiBQjr" - name = "Baystation 12" + hub_password = "SORRYNOPASSWORD" + name = "Baystation12" /* This is for any host that would like their server to appear on the main SS13 hub. To use it, simply replace the password above, with the password found below, and it should work. -If not, let us know on the main baystation IRC channel of irc.sorcery.net #bs12 and we can help you there. +If not, let us know on the main tgstation IRC channel of irc.rizon.net #tgstation13 we can help you there. hub = "Exadv1.spacestation13" hub_password = "kMZy3U5jJHSiBQjr" diff --git a/code/defines/mob/dead/observer.dm b/code/defines/mob/dead/observer.dm index a3cd0a81b5..4fb812720d 100644 --- a/code/defines/mob/dead/observer.dm +++ b/code/defines/mob/dead/observer.dm @@ -1,14 +1,16 @@ /mob/dead/observer name = "ghost" desc = "It's a g-g-g-g-ghooooost!" //jinkies! - icon = 'mob.dmi' + icon = 'icons/mob/mob.dmi' icon_state = "ghost" layer = 4 + stat = DEAD density = 0 - stat = 2 canmove = 0 blinded = 0 anchored = 1 // don't get pushed around - universal_speak = 1 //Ghosts are multi-lingual! - var/mob/corpse = null // observer mode - var/datum/hud/living/carbon/hud = null // hud \ No newline at end of file +// var/mob/corpse = null // observer mode //we use mind.current as the 'corpse' now + var/can_reenter_corpse + var/datum/hud/living/carbon/hud = null // hud + var/bootime = 0 + var/started_as_observer //This variable is set to 1 when you enter the game as an observer. If you died in the game and are a ghsot - this will remain as null. Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot. \ No newline at end of file diff --git a/code/defines/mob/living/carbon/alien.dm b/code/defines/mob/living/carbon/alien.dm index 60b38a20c0..2cb0453c1d 100644 --- a/code/defines/mob/living/carbon/alien.dm +++ b/code/defines/mob/living/carbon/alien.dm @@ -3,11 +3,10 @@ voice_name = "alien" voice_message = "hisses" say_message = "hisses" - icon = 'alien.dmi' + icon = 'icons/mob/alien.dmi' gender = NEUTER var/storedPlasma = 250 - var/alien_invis = 0.0 var/max_plasma = 500 alien_talk_understand = 1 @@ -17,5 +16,6 @@ var/move_delay_add = 0 // movement delay to add - canstun = 0 - canweaken = 0 // aliens cannot be stunned or knocked down. Massive buff! \ No newline at end of file + status_flags = CANPARALYSE + var/heal_rate = 5 + var/plasma_rate = 5 \ No newline at end of file diff --git a/code/defines/mob/living/carbon/alien_humanoid.dm b/code/defines/mob/living/carbon/alien_humanoid.dm index af03496ff6..2b62b4bb9e 100644 --- a/code/defines/mob/living/carbon/alien_humanoid.dm +++ b/code/defines/mob/living/carbon/alien_humanoid.dm @@ -2,54 +2,54 @@ name = "alien" icon_state = "alien_s" - var/obj/item/clothing/suit/wear_suit = null - var/obj/item/clothing/head/head = null + var/obj/item/clothing/suit/wear_suit = null //TODO: necessary? Are they even used? ~Carn + var/obj/item/clothing/head/head = null // var/obj/item/weapon/r_store = null var/obj/item/weapon/l_store = null +// var/alien_invis = 0 + var/caste = "" + update_icon = 1 - var/icon/stand_icon = null - var/icon/lying_icon = null - var/icon/resting_icon = null - var/icon/running_icon = null - - var/last_b_state = 1.0 - - var/image/face_standing = null - var/image/face_lying = null - - var/image/damageicon_standing = null - var/image/damageicon_lying = null /mob/living/carbon/alien/humanoid/hunter name = "alien hunter" - + caste = "h" + maxHealth = 150 health = 150 storedPlasma = 100 max_plasma = 150 - icon_state = "alien_s" + icon_state = "alienh_s" + plasma_rate = 5 /mob/living/carbon/alien/humanoid/sentinel name = "alien sentinel" - + caste = "s" + maxHealth = 125 health = 125 storedPlasma = 100 max_plasma = 250 - icon_state = "alien_s" + icon_state = "aliens_s" + plasma_rate = 10 /mob/living/carbon/alien/humanoid/drone name = "alien drone" - + caste = "d" + maxHealth = 100 health = 100 - icon_state = "alien_s" + icon_state = "aliend_s" + plasma_rate = 15 /mob/living/carbon/alien/humanoid/queen name = "alien queen" - + caste = "q" + maxHealth = 250 health = 250 - icon_state = "queen_s" + icon_state = "alienq_s" nopush = 1 + heal_rate = 15 + plasma_rate = 20 + /mob/living/carbon/alien/humanoid/rpbody update_icon = 0 - voice_message = "says" say_message = "says" \ No newline at end of file diff --git a/code/defines/mob/living/carbon/alien_larva.dm b/code/defines/mob/living/carbon/alien_larva.dm index c64451005f..2eb28e567e 100644 --- a/code/defines/mob/living/carbon/alien_larva.dm +++ b/code/defines/mob/living/carbon/alien_larva.dm @@ -1,9 +1,10 @@ /mob/living/carbon/alien/larva name = "alien larva" + real_name = "alien larva" icon_state = "larva" pass_flags = PASSTABLE - swap_on_mobbump = 0 + maxHealth = 25 health = 25 var/amount_grown = 0 \ No newline at end of file diff --git a/code/defines/mob/living/carbon/carbon.dm b/code/defines/mob/living/carbon/carbon.dm index 504be35127..ae310b78ac 100644 --- a/code/defines/mob/living/carbon/carbon.dm +++ b/code/defines/mob/living/carbon/carbon.dm @@ -5,15 +5,7 @@ var/brain_op_stage = 0.0 var/eye_op_stage = 0.0 var/appendix_op_stage = 0.0 - var/embryo_op_stage = 0.0 - var/face_op_stage = 0.0 - var/datum/disease2/disease/virus2 = null - var/list/datum/disease2/disease/resistances2 = list() - var/antibodies = 0 - - var/analgesic = 0 // when this is set, the mob isn't affected by shock or pain - // life should decrease this by 1 every tick - -mob - var/list/disease_symptoms = 0 // a list of disease-incurred symptoms \ No newline at end of file + //var/datum/disease2/disease/virus2 = null + //var/list/datum/disease2/disease/resistances2 = list() + var/antibodies = 0 \ No newline at end of file diff --git a/code/defines/mob/living/carbon/metroid.dm b/code/defines/mob/living/carbon/metroid.dm index 48fd4fea5c..33778c9700 100644 --- a/code/defines/mob/living/carbon/metroid.dm +++ b/code/defines/mob/living/carbon/metroid.dm @@ -3,7 +3,7 @@ /mob/living/carbon/metroid name = "baby metroid" - icon = 'mob.dmi' + icon = 'icons/mob/mob.dmi' icon_state = "baby metroid" pass_flags = PASSTABLE voice_message = "skree!" @@ -11,18 +11,18 @@ layer = 5 + maxHealth = 150 health = 150 gender = NEUTER update_icon = 0 - nutrition = 800 // 1000 = max + nutrition = 700 // 1000 = max see_in_dark = 8 // canstun and canweaken don't affect metroids because they ignore stun and weakened variables // for the sake of cleanliness, though, here they are. - canstun = 0 - canweaken = 0 + status_flags = CANPARALYSE var/amount_grown = 0// controls how long the metroid has been overfed, if 10, grows into an adult // if adult: if 10: reproduces @@ -47,12 +47,12 @@ /mob/living/carbon/metroid/adult name = "adult metroid" - icon = 'mob.dmi' + icon = 'icons/mob/mob.dmi' icon_state = "adult metroid" health = 200 gender = NEUTER update_icon = 0 - nutrition = 1000 // 1200 = max + nutrition = 800 // 1200 = max diff --git a/code/defines/mob/living/carbon/monkey.dm b/code/defines/mob/living/carbon/monkey.dm new file mode 100644 index 0000000000..c937afdac9 --- /dev/null +++ b/code/defines/mob/living/carbon/monkey.dm @@ -0,0 +1,17 @@ +/mob/living/carbon/monkey + name = "monkey" + voice_name = "monkey" + voice_message = "chimpers" + say_message = "chimpers" + icon = 'icons/mob/monkey.dmi' + icon_state = "monkey1" + gender = NEUTER + pass_flags = PASSTABLE + update_icon = 0 ///no need to call regenerate_icon + + var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie + +/mob/living/carbon/monkey/rpbody // For admin RP + update_icon = 0 + voice_message = "says" + say_message = "says" diff --git a/code/defines/mob/living/living.dm b/code/defines/mob/living/living.dm index dc767fce08..93f4bfd878 100644 --- a/code/defines/mob/living/living.dm +++ b/code/defines/mob/living/living.dm @@ -5,14 +5,5 @@ var/t_n2 = null var/now_pushing = null var/cameraFollow = null - var/age = null - - -// lists used to cache overlays -/mob/living/var/list/body_overlays_standing = list() -/mob/living/var/list/body_overlays_lying = list() -/mob/living/var/list/clothing_overlays = list() - -// This var describes whether the mob visually appears to be lying. -// This will be used to only update lying status when necessary. -/mob/living/var/visual_lying = 0 \ No newline at end of file + var/tod = null // Time of death + see_invisible = SEE_INVISIBLE_LIVING \ No newline at end of file diff --git a/code/defines/mob/living/silicon/ai.dm b/code/defines/mob/living/silicon/ai.dm index a6584910ba..0f519472dd 100644 --- a/code/defines/mob/living/silicon/ai.dm +++ b/code/defines/mob/living/silicon/ai.dm @@ -1,10 +1,11 @@ /mob/living/silicon/ai name = "AI" - icon = 'AI.dmi'// + icon = 'icons/mob/AI.dmi'// icon_state = "ai" anchored = 1 // -- TLE density = 1 - var/list/networks + status_flags = CANSTUN|CANPARALYSE + var/network = "SS13" var/obj/machinery/camera/current = null var/list/connected_robots = list() var/aiRestorePowerRoutine = 0 @@ -14,6 +15,7 @@ var/lawcheck[1] var/ioncheck[1] var/icon/holo_icon//Default is assigned when AI is created. + var/obj/item/device/pda/ai/aiPDA = null //MALFUNCTION var/datum/AI_Module/module_picker/malf_picker @@ -27,4 +29,6 @@ var/obj/machinery/power/apc/malfhack = null var/explosive = 0 //does the AI explode when it dies? - var/mob/living/silicon/ai/parent = null \ No newline at end of file + var/mob/living/silicon/ai/parent = null + + var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through. \ No newline at end of file diff --git a/code/defines/mob/living/silicon/decoy.dm b/code/defines/mob/living/silicon/decoy.dm index 0ed4da4fa1..1332018307 100644 --- a/code/defines/mob/living/silicon/decoy.dm +++ b/code/defines/mob/living/silicon/decoy.dm @@ -1,6 +1,6 @@ /mob/living/silicon/decoy name = "AI" - icon = 'Ai.dmi'// + icon = 'icons/mob/AI.dmi'// icon_state = "ai" anchored = 1 // -- TLE canmove = 0 \ No newline at end of file diff --git a/code/defines/mob/living/silicon/pai.dm b/code/defines/mob/living/silicon/pai.dm index ddc38fb629..a7524cfb25 100644 --- a/code/defines/mob/living/silicon/pai.dm +++ b/code/defines/mob/living/silicon/pai.dm @@ -1,9 +1,9 @@ /mob/living/silicon/pai name = "pAI" - icon = 'mob.dmi'// + icon = 'icons/mob/mob.dmi'// icon_state = "shadow" - robot_talk_understand = 1 //pAI's can now use binary + robot_talk_understand = 0 var/network = "SS13" var/obj/machinery/camera/current = null @@ -35,8 +35,7 @@ var/screen // Which screen our main window displays var/subscreen // Which specific function of the main screen is being displayed - var/tnote // Message history var used for PDA Messaging functions - var/poff = 0 // For PDA messanging. + var/obj/item/device/pda/pai/pda = null var/secHUD = 0 // Toggles whether the Security HUD is active or not var/medHUD = 0 // Toggles whether the Medical HUD is active or not @@ -48,4 +47,6 @@ var/datum/data/record/securityActive2 var/obj/machinery/door/hackdoor // The airlock being hacked - var/hackprogress = 0 // Possible values: 0 - 100, >= 100 means the hack is complete and will be reset upon next check \ No newline at end of file + var/hackprogress = 0 // Possible values: 0 - 100, >= 100 means the hack is complete and will be reset upon next check + + var/obj/item/radio/integrated/signal/sradio // AI's signaller \ No newline at end of file diff --git a/code/defines/mob/living/silicon/robot.dm b/code/defines/mob/living/silicon/robot.dm index b4e31226f3..8cdd9e7a37 100644 --- a/code/defines/mob/living/silicon/robot.dm +++ b/code/defines/mob/living/silicon/robot.dm @@ -1,8 +1,12 @@ /mob/living/silicon/robot name = "Cyborg" - icon = 'robots.dmi'// + real_name = "Cyborg" + icon = 'icons/mob/robots.dmi'// icon_state = "robot" + maxHealth = 300 health = 300 + var/started = null//A fix to ensure people don't try to bypass law assignment. Initial assignment sets it to one but it check on login whether they have been initiated -Sieve + #define BORGMESON 1 #define BORGTHERM 2 @@ -35,18 +39,18 @@ var/emagged = 0 var/wiresexposed = 0 var/locked = 1 - var/list/req_access = list(ACCESS_ROBOTICS) + var/list/req_access = list(access_robotics) var/ident = 0 //var/list/laws = list() var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list()) var/viewalerts = 0 - var/modtype = null + var/modtype = "robot" var/lower_mod = 0 var/jetpack = 0 var/datum/effect/effect/system/ion_trail_follow/ion_trail = null var/datum/effect/effect/system/spark_spread/spark_system//So they can initialize sparks whenever/N var/jeton = 0 - var/borgwires = 31 + var/borgwires = 31 // 0b11111 var/killswitch = 0 var/killswitch_time = 60 var/weapon_lock = 0 @@ -54,9 +58,4 @@ var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default var/lockcharge //Used when locking down a borg to preserve cell charge var/speed = 0 //Cause sec borgs gotta go fast //No they dont! - var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them. - var/channels = list() - var/modlock = 0 - - var/lawcheck[1] //For stating laws! - var/ioncheck[1] \ No newline at end of file + var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them. \ No newline at end of file diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 2441c74107..ceca81f285 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -12,6 +12,7 @@ var/datum/marked_datum animate_movement = 2 var/throwforce = 1 + var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request) //Return: (NONSTANDARD) @@ -25,29 +26,8 @@ proc/initialize() -//Define all tape types in policetape.dm -/obj/item/taperoll - name = "tape roll" - icon = 'policetape.dmi' - icon_state = "rollstart" - flags = FPRINT - w_class = 1.0 - var/turf/start - var/turf/end - var/tape_type = /obj/item/tape - var/icon_base - -/obj/item/tape - name = "tape" - icon = 'policetape.dmi' - anchored = 1 - density = 1 - var/icon_base -/* - -*/ /obj/structure/signpost - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "signpost" anchored = 1 density = 1 @@ -66,7 +46,7 @@ /obj/effect/mark var/mark = "" - icon = 'mark.dmi' + icon = 'icons/misc/mark.dmi' icon_state = "blank" anchored = 1 layer = 99 @@ -89,15 +69,15 @@ /obj/structure/bedsheetbin name = "linen bin" - desc = "A small wire mesh bin full of extra bedsheets and cleaning supplies for the beds. Smells of lilacs and has a faint undertone of disinfectant." - icon = 'items.dmi' + desc = "A bin for containing bedsheets. It looks rather cosy." + icon = 'icons/obj/items.dmi' icon_state = "bedbin" var/amount = 23.0 anchored = 1.0 /obj/effect/begin name = "begin" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "begin" anchored = 1.0 unacidable = 1 @@ -215,54 +195,28 @@ dat = dd_replacetext(dat, "\t", "") return dat -/obj/effect/equip_e - name = "equip e" - var/mob/source = null - var/s_loc = null - var/t_loc = null - var/obj/item/item = null - var/place = null - var/internalloc = null - -/obj/effect/equip_e/human - name = "human" - var/mob/living/carbon/human/target = null - -/obj/effect/equip_e/monkey - name = "monkey" - var/mob/living/carbon/monkey/target = null - /obj/effect/sign/securearea - desc = "A large yellow warning sign which reads 'SECURE AREA', it appears to have been painted onto the wall like that." + desc = "A warning sign which reads 'SECURE AREA'. This obviously applies to a nun-Clown." name = "SECURE AREA" - icon = 'decals.dmi' - icon_state = "securearea" - anchored = 1.0 - opacity = 0 - density = 0 - -/obj/effect/sign/movingparts - desc = "A warning sign which reads 'CAUTION: MOVING PARTS, machinery liable to stop and start at random'" - name = "CAUTION" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "securearea" anchored = 1.0 opacity = 0 density = 0 /obj/effect/sign/biohazard - desc = "A warning sign which reads 'BIOHAZARD', you think it'd be a good idea to ensure you have a properly sealed hazardsuit on." + desc = "A warning sign which reads 'BIOHAZARD'" name = "BIOHAZARD" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "bio" anchored = 1.0 opacity = 0 density = 0 /obj/effect/sign/electricshock - desc = "A warning sign which reads 'HIGH VOLTAGE', it looks like it'd be a wise decision to stay away from here." + desc = "A warning sign which reads 'HIGH VOLTAGE'" name = "HIGH VOLTAGE" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "shock" anchored = 1.0 opacity = 0 @@ -271,7 +225,7 @@ /obj/effect/sign/examroom desc = "A guidance sign which reads 'EXAM ROOM'" name = "EXAM" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "examroom" anchored = 1.0 opacity = 0 @@ -280,7 +234,7 @@ /obj/effect/sign/vacuum desc = "A warning sign which reads 'HARD VACUUM AHEAD'" name = "HARD VACUUM AHEAD" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "space" anchored = 1.0 opacity = 0 @@ -289,7 +243,7 @@ /obj/effect/sign/deathsposal desc = "A warning sign which reads 'DISPOSAL LEADS TO SPACE'" name = "DISPOSAL LEADS TO SPACE" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "deathsposal" anchored = 1.0 opacity = 0 @@ -298,7 +252,7 @@ /obj/effect/sign/pods desc = "A warning sign which reads 'ESCAPE PODS'" name = "ESCAPE PODS" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "pods" anchored = 1.0 opacity = 0 @@ -307,7 +261,7 @@ /obj/effect/sign/fire desc = "A warning sign which reads 'DANGER: FIRE'" name = "DANGER: FIRE" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "fire" anchored = 1.0 opacity = 0 @@ -317,7 +271,7 @@ /obj/effect/sign/nosmoking_1 desc = "A warning sign which reads 'NO SMOKING'" name = "NO SMOKING" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "nosmoking" anchored = 1.0 opacity = 0 @@ -327,7 +281,7 @@ /obj/effect/sign/nosmoking_2 desc = "A warning sign which reads 'NO SMOKING'" name = "NO SMOKING" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "nosmoking2" anchored = 1.0 opacity = 0 @@ -336,7 +290,7 @@ /obj/effect/sign/redcross desc = "The Intergalactic symbol of Medical institutions. You'll probably get help here.'" name = "Med-Bay" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "redcross" anchored = 1.0 opacity = 0 @@ -345,16 +299,25 @@ /obj/effect/sign/goldenplaque desc = "To be Robust is not an action or a way of life, but a mental state. Only those with the force of Will strong enough to act during a crisis, saving friend from foe, are truly Robust. Stay Robust my friends." name = "The Most Robust Men Award for Robustness" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "goldenplaque" anchored = 1.0 opacity = 0 density = 0 +/obj/effect/sign/atmosplaque + desc = "This plaque commemorates the fall of the Atmos FEA division. For all the charred, dizzy, and brittle men who have died in its hands." + name = "FEA Atmospherics Division" + icon = 'icons/obj/decals.dmi' + icon_state = "atmosplaque" + anchored = 1.0 + opacity = 0 + density = 0 + /*/obj/item/weapon/plaque_assembly //commenting this out until there's a better rework desc = "Put this on a wall and engrave an epitaph" name = "Plaque Assembly" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "goldenplaque" /obj/item/weapon/plaque_assembly/afterattack(atom/A as mob|obj|turf|area, mob/user as mob) @@ -369,7 +332,7 @@ /obj/effect/sign/maltesefalcon1 //The sign is 64x32, so it needs two tiles. ;3 desc = "The Maltese Falcon, Space Bar and Grill." name = "The Maltese Falcon" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "maltesefalcon1" anchored = 1.0 opacity = 0 @@ -378,7 +341,7 @@ /obj/effect/sign/maltesefalcon2 desc = "The Maltese Falcon, Space Bar and Grill." name = "The Maltese Falcon" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "maltesefalcon2" anchored = 1.0 opacity = 0 @@ -387,7 +350,7 @@ /obj/effect/sign/science//These 3 have multiple types, just var-edit the icon_state to whatever one you want on the map desc = "A warning sign which reads 'SCIENCE!'" name = "SCIENCE!" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "science1" anchored = 1.0 opacity = 0 @@ -396,7 +359,7 @@ /obj/effect/sign/chemistry desc = "A warning sign which reads 'CHEMISTY'" name = "CHEMISTRY" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "chemistry1" anchored = 1.0 opacity = 0 @@ -405,7 +368,7 @@ /obj/effect/sign/botany desc = "A warning sign which reads 'HYDROPONICS'" name = "HYDROPONICS" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "hydro1" anchored = 1.0 opacity = 0 @@ -417,10 +380,6 @@ var/mob/mymob = null var/list/adding = null var/list/other = null - var/list/intents = null - var/list/mov_int = null - var/list/mon_blo = null - var/list/m_ints = null var/obj/screen/druggy = null var/vimpaired = null var/obj/screen/alien_view = null @@ -429,16 +388,17 @@ var/list/darkMask = null var/obj/screen/r_hand_hud_object = null var/obj/screen/l_hand_hud_object = null - var/list/obj/screen/intent_small_hud_objects = null - var/show_intent_icons = 1 + var/show_intent_icons = 0 var/list/obj/screen/hotkeybuttons = null var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons) + var/list/obj/screen/item_action/item_action_list = null //Used for the item action ui buttons. + var/h_type = /obj/screen //this is like...the most pointless thing ever. Use a god damn define! /obj/item name = "item" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' var/icon/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite var/abstract = 0 var/force = 0 @@ -457,12 +417,19 @@ // causeerrorheresoifixthis var/obj/item/master = null + var/heat_protection = 0 //flags which determine which body parts are protected from heat. Use the HEAD, UPPER_TORSO, LOWER_TORSO, etc. flags. See setup.dm + var/cold_protection = 0 //flags which determine which body parts are protected from cold. Use the HEAD, UPPER_TORSO, LOWER_TORSO, etc. flags. See setup.dm + var/max_heat_protection_temperature //Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags + var/min_cold_protection_temperature //Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags + + var/icon_action_button //If this is set, The item will make an action button on the player's HUD when picked up. The button will have the icon_action_button sprite from the screen1_action.dmi file. + var/action_button_name //This is the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. Note that icon_action_button needs to be set in order for the action button to appear. + //Since any item can now be a piece of clothing, this has to be put here so all items share it. - var/see_face = 1.0 + var/flags_inv //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc. var/color = null var/body_parts_covered = 0 //see setup.dm for appropriate bit flags - var/protective_temperature = 0 - var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible + //var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible var/gas_transfer_coefficient = 1 // for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets) var/permeability_coefficient = 1 // for chemicals/diseases var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit) @@ -470,43 +437,225 @@ var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N var/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) var/list/allowed = null //suit storage stuff. + var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers. + +//the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. +//If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. +//Set disable_warning to 1 if you wish it to not give you outputs. + +/obj/item/proc/mob_can_equip(M as mob, slot, disable_warning = 0) + if(!slot) return 0 + if(!M) return 0 + + if(ishuman(M)) + //START HUMAN + var/mob/living/carbon/human/H = M + + if(FAT in H.mutations) + if(!(flags & ONESIZEFITSALL)) + if(!disable_warning) + H << "\red You're too fat to wear the [name]." + return 0 + + switch(slot) + if(slot_l_hand) + if(H.l_hand) + return 0 + return 1 + if(slot_r_hand) + if(H.r_hand) + return 0 + return 1 + if(slot_wear_mask) + if(H.wear_mask) + return 0 + if( !(slot_flags & SLOT_MASK) ) + return 0 + return 1 + if(slot_back) + if(H.back) + return 0 + if( !(slot_flags & SLOT_BACK) ) + return 0 + return 1 + if(slot_wear_suit) + if(H.wear_suit) + return 0 + if( !(slot_flags & SLOT_OCLOTHING) ) + return 0 + return 1 + if(slot_gloves) + if(H.gloves) + return 0 + if( !(slot_flags & SLOT_GLOVES) ) + return 0 + return 1 + if(slot_shoes) + if(H.shoes) + return 0 + if( !(slot_flags & SLOT_FEET) ) + return 0 + return 1 + if(slot_belt) + if(H.belt) + return 0 + if(!H.w_uniform) + if(!disable_warning) + H << "\red You need a jumpsuit before you can attach this [name]." + return 0 + if( !(slot_flags & SLOT_BELT) ) + return + return 1 + if(slot_glasses) + if(H.glasses) + return 0 + if( !(slot_flags & SLOT_EYES) ) + return 0 + return 1 + if(slot_head) + if(H.head) + return 0 + if( !(slot_flags & SLOT_HEAD) ) + return 0 + return 1 + if(slot_ears) + if(H.ears) + return 0 + if( !(slot_flags & SLOT_EARS) ) + return 0 + return 1 + if(slot_w_uniform) + if(H.w_uniform) + return 0 + if( !(slot_flags & SLOT_ICLOTHING) ) + return 0 + return 1 + if(slot_wear_id) + if(H.wear_id) + return 0 + if(!H.w_uniform) + if(!disable_warning) + H << "\red You need a jumpsuit before you can attach this [name]." + return 0 + if( !(slot_flags & SLOT_ID) ) + return 0 + return 1 + if(slot_l_store) + if(H.l_store) + return 0 + if(!H.w_uniform) + if(!disable_warning) + H << "\red You need a jumpsuit before you can attach this [name]." + return 0 + if(slot_flags & SLOT_DENYPOCKET) + return + if( w_class <= 2 || (slot_flags & SLOT_POCKET) ) + return 1 + if(slot_r_store) + if(H.r_store) + return 0 + if(!H.w_uniform) + if(!disable_warning) + H << "\red You need a jumpsuit before you can attach this [name]." + return 0 + if(slot_flags & SLOT_DENYPOCKET) + return 0 + if( w_class <= 2 || (slot_flags & SLOT_POCKET) ) + return 1 + return 0 + if(slot_s_store) + if(H.s_store) + return 0 + if(!H.wear_suit) + if(!disable_warning) + H << "\red You need a suit before you can attach this [name]." + return 0 + if(!H.wear_suit.allowed) + if(!disable_warning) + usr << "You somehow have a suit with no defined allowed items for suit storage, stop that." + return 0 + if( istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed) ) + return 1 + return 0 + if(slot_handcuffed) + if(H.handcuffed) + return 0 + if(!istype(src, /obj/item/weapon/handcuffs)) + return 0 + return 1 + if(slot_legcuffed) + if(H.legcuffed) + return 0 + if(!istype(src, /obj/item/weapon/legcuffs)) + return 0 + return 1 + if(slot_in_backpack) + if (H.back && istype(H.back, /obj/item/weapon/storage/backpack)) + var/obj/item/weapon/storage/backpack/B = H.back + if(B.contents.len < B.storage_slots && w_class <= B.max_w_class) + return 1 + return 0 + return 0 //Unsupported slot + //END HUMAN + + else if(ismonkey(M)) + //START MONKEY + var/mob/living/carbon/monkey/MO = M + switch(slot) + if(slot_l_hand) + if(MO.l_hand) + return 0 + return 1 + if(slot_r_hand) + if(MO.r_hand) + return 0 + return 1 + if(slot_wear_mask) + if(MO.wear_mask) + return 0 + if( !(slot_flags & SLOT_MASK) ) + return 0 + return 1 + if(slot_back) + if(MO.back) + return 0 + if( !(slot_flags & SLOT_BACK) ) + return 0 + return 1 + return 0 //Unsupported slot + + //END MONKEY + /obj/item/verb/verb_pickup() - set src in view(1) + set src in oview(1) set category = "Object" - set name = "Pickup" + set name = "Pick up" - if(!(usr)) + if(!usr.canmove || usr.stat || usr.restrained() || !in_range(src, usr)) return - if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain - usr << "\red You can't pick things up!" - return - if( usr.stat || usr.restrained() )//Is not asleep/dead and is not restrained - usr << "\red You can't pick things up!" - return - if(src.anchored) //Object isn't anchored - usr << "\red You can't pick that up!" - return - if(!usr.hand && usr.r_hand) //Right hand is not full - usr << "\red Your right hand is full." - return - if(usr.hand && usr.l_hand) //Left hand is not full - usr << "\red Your left hand is full." - return - if(!istype(src.loc, /turf)) //Object is on a turf - usr << "\red You can't pick that up!" - return - //All checks are done, time to pick it up! - if(istype(usr, /mob/living/carbon/human)) - src.attack_hand(usr) - if(istype(usr, /mob/living/carbon/alien)) - src.attack_alien(usr) - if(istype(usr, /mob/living/carbon/monkey)) - src.attack_paw(usr) - return + + if(ishuman(usr)) + if(usr.get_active_hand() == null) + src.Click() // Let me know if this has any problems -Giacom + /* + if(usr.get_active_hand() == null) + src.attack_hand(usr) + else + usr << "\red You already have something in your hand." + */ + else + usr << "\red This mob type can't use this verb." + +//This proc is executed when someone clicks the on-screen UI button. To make the UI button show, set the 'icon_action_button' to the icon_state of the image of the button in screen1_action.dmi +//The default action is attack_self(). +//Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob. +/obj/item/proc/ui_action_click() + if( src in usr ) + attack_self(usr) /obj/item/device - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' /obj/item/device/infra_sensor name = "Infrared Sensor" @@ -520,7 +669,7 @@ /obj/item/device/multitool name = "multitool" - desc = "Used for pulsing wires to test which to cut." + desc = "Used for pulsing wires to test which to cut. Not recommended by doctors." icon_state = "multitool" flags = FPRINT | TABLEPASS| CONDUCT force = 5.0 @@ -528,46 +677,29 @@ throwforce = 5.0 throw_range = 15 throw_speed = 3 + desc = "You can use this on airlocks or APCs to try to hack them without cutting wires." m_amt = 50 g_amt = 20 origin_tech = "magnets=1;engineering=1" var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage -/obj/item/device/hacktool - name = "modifed door debugger" - icon_state = "hacktool" - flags = FPRINT | TABLEPASS | CONDUCT - var/in_use = 0 - force = 5.0 - w_class = 2.0 - throwforce = 5.0 - throw_range = 15 - throw_speed = 3 - desc = "An item of dubious origins, with wires and antennas protruding out of it." - m_amt = 60 - g_amt = 20 - -/obj/item/device/hacktool/engineer - name = "door debugger" - desc = "An item of immense complexion, it appears to work by magic." - icon_state = "hacktool-g" - /obj/item/blueprints name = "station blueprints" desc = "Blueprints of the station. There's stamp \"Classified\" and several coffee stains on it." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "blueprints" + attack_verb = list("attacked", "bapped", "hit") /obj/item/apc_frame name = "APC frame" desc = "Used for repairing or building APCs" - icon = 'apc_repair.dmi' + icon = 'icons/obj/apc_repair.dmi' icon_state = "apc_frame" flags = FPRINT | TABLEPASS| CONDUCT /obj/effect/landmark name = "landmark" - icon = 'screen1.dmi' + icon = 'icons/mob/screen1.dmi' icon_state = "x2" anchored = 1.0 unacidable = 1 @@ -578,14 +710,14 @@ /obj/effect/laser name = "laser" desc = "IT BURNS!!!" - icon = 'projectiles.dmi' + icon = 'icons/obj/projectiles.dmi' var/damage = 0.0 var/range = 10.0 /obj/structure/lattice desc = "A lightweight support lattice." name = "lattice" - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' icon_state = "latticefull" density = 0 anchored = 1.0 @@ -599,7 +731,7 @@ for(var/obj/structure/lattice/LAT in src.loc) if(LAT != src) del(LAT) - icon = 'smoothlattice.dmi' + icon = 'icons/obj/smoothlattice.dmi' icon_state = "latticeblank" updateOverlays() for (var/dir in cardinal) @@ -669,7 +801,7 @@ /obj/structure/m_tray name = "morgue tray" desc = "Apply corpse before closing." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "morguet" density = 1 layer = 2.0 @@ -679,7 +811,7 @@ /obj/structure/c_tray name = "crematorium tray" desc = "Apply body before burning." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "cremat" density = 1 layer = 2.0 @@ -695,8 +827,8 @@ anchored =1 var/netnum = 0 name = "power cable" - desc = "A flexible superconducting cable for heavy-duty power transfer." - icon = 'power_cond_red.dmi' + desc = "A flexible superconducting cable for heavy-duty power transfer" + icon = 'icons/obj/power_cond_red.dmi' icon_state = "0-1" var/d1 = 0 var/d2 = 1 @@ -706,42 +838,42 @@ /obj/structure/cable/yellow color="yellow" - icon = 'power_cond_yellow.dmi' + icon = 'icons/obj/power_cond_yellow.dmi' /obj/structure/cable/green color="green" - icon = 'power_cond_green.dmi' + icon = 'icons/obj/power_cond_green.dmi' /obj/structure/cable/blue color="blue" - icon = 'power_cond_blue.dmi' + icon = 'icons/obj/power_cond_blue.dmi' /obj/structure/cable/pink color="pink" - icon = 'power_cond_pink.dmi' + icon = 'icons/obj/power_cond_pink.dmi' /obj/structure/cable/orange color="orange" - icon = 'power_cond_orange.dmi' + icon = 'icons/obj/power_cond_orange.dmi' /obj/structure/cable/cyan color="cyan" - icon = 'power_cond_cyan.dmi' + icon = 'icons/obj/power_cond_cyan.dmi' /obj/structure/cable/white color="white" - icon = 'power_cond_white.dmi' + icon = 'icons/obj/power_cond_white.dmi' /obj/effect/manifest name = "manifest" - icon = 'screen1.dmi' + icon = 'icons/mob/screen1.dmi' icon_state = "x" unacidable = 1//Just to be sure. /obj/structure/morgue name = "morgue" - desc = "Used to keep bodies in until someone fetches them." - icon = 'stationobjs.dmi' + desc = "Used to keep bodies in untill someone fetches them." + icon = 'icons/obj/stationobjs.dmi' icon_state = "morgue1" density = 1 var/obj/structure/m_tray/connected = null @@ -749,8 +881,8 @@ /obj/structure/crematorium name = "crematorium" - desc = "An incinerator." - icon = 'stationobjs.dmi' + desc = "A human incinerator. Works well on barbeque nights." + icon = 'icons/obj/stationobjs.dmi' icon_state = "crema1" density = 1 var/obj/structure/c_tray/connected = null @@ -761,11 +893,11 @@ /obj/effect/mine name = "Mine" - desc = "I'd better stay away from that thing." + desc = "I Better stay away from that thing." density = 1 anchored = 1 layer = 3 - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "uglymine" var/triggerproc = "explode" //name of the proc thats called when the mine is triggered var/triggered = 0 @@ -802,7 +934,7 @@ /obj/effect/overlay/beam//Not actually a projectile, just an effect. name="beam" - icon='beam.dmi' + icon='icons/effects/beam.dmi' icon_state="b_beam" var/tmp/atom/BeamSource New() @@ -811,8 +943,8 @@ /obj/effect/portal name = "portal" - desc = "Looks unstable." - icon = 'stationobjs.dmi' + desc = "Looks unstable. Best to test it with the clown." + icon = 'icons/obj/stationobjs.dmi' icon_state = "portal" density = 1 unacidable = 1//Can't destroy energy portals. @@ -829,11 +961,12 @@ /obj/structure/rack name = "rack" desc = "Different from the Middle Ages version." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "rack" density = 1 flags = FPRINT anchored = 1.0 + throwpass = 1 //You can throw objects over this, despite it's density. /obj/effect/shut_controller name = "shut controller" @@ -842,15 +975,16 @@ /obj/effect/landmark/start name = "start" - icon = 'screen1.dmi' + icon = 'icons/mob/screen1.dmi' icon_state = "x" anchored = 1.0 /obj/structure/stool name = "stool" desc = "Apply butt." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "stool" + anchored = 1.0 flags = FPRINT pressure_resistance = 3*ONE_ATMOSPHERE @@ -859,19 +993,33 @@ desc = "This is used to lie in, sleep in or strap on." icon_state = "bed" var/mob/living/buckled_mob - anchored = 1.0 /obj/structure/stool/bed/alien - name = "Resting contraption" + name = "resting contraption" desc = "This looks similar to contraptions from earth. Could aliens be stealing our technology?" icon_state = "abed" +/obj/structure/stool/bed/nest + name = "alien nest" + desc = "It's a gruesome pile of thick, sticky resin shaped like a nest." + icon = 'icons/mob/alien.dmi' + icon_state = "nest" + var/health = 100 /obj/structure/stool/bed/chair //YES, chairs are a type of bed, which are a type of stool. This works, believe me. -Pete name = "chair" desc = "You sit in this. Either by will or force." icon_state = "chair" - anchored = 0 + +/obj/structure/stool/bed/chair/wood/normal + icon_state = "wooden_chair" + name = "wooden chair" + desc = "Old is never too old to not be in fashion." + +/obj/structure/stool/bed/chair/wood/wings + icon_state = "wooden_chair_wings" + name = "wooden chair" + desc = "Old is never too old to not be in fashion." /obj/structure/stool/bed/chair/comfy name = "comfy chair" @@ -897,10 +1045,7 @@ /obj/structure/stool/bed/chair/office/Move() ..() - if(buckled_mob) - if(buckled_mob.buckled == src) - buckled_mob.loc = src.loc - buckled_mob.dir = src.dir + handle_rotation() /obj/structure/stool/bed/chair/office/light icon_state = "officechair_white" @@ -911,214 +1056,200 @@ /obj/structure/table name = "table" desc = "A square piece of metal standing on four metal legs. It can not move." - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' icon_state = "table" density = 1 anchored = 1.0 layer = 2.8 - var/dented = 0 - - New() - ..() - for(var/obj/structure/table/T in src.loc) - if(T != src) - del(T) - update_icon() - for(var/direction in list(1,2,4,8,5,6,9,10)) - if(locate(/obj/structure/table,get_step(src,direction))) - var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) - T.update_icon() - - Del() - for(var/direction in list(1,2,4,8,5,6,9,10)) - if(locate(/obj/structure/table,get_step(src,direction))) - var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) - T.update_icon() - ..() + throwpass = 1 //You can throw objects over this, despite it's density.") +/obj/structure/table/New() + ..() + for(var/obj/structure/table/T in src.loc) + if(T != src) + del(T) update_icon() - spawn(2) //So it properly updates when deleting - var/dir_sum = 0 - for(var/direction in list(1,2,4,8,5,6,9,10)) - var/skip_sum = 0 - for(var/obj/structure/window/W in src.loc) - if(W.dir == direction) //So smooth tables don't go smooth through windows - skip_sum = 1 - continue - var/inv_direction //inverse direction - switch(direction) - if(1) - inv_direction = 2 - if(2) - inv_direction = 1 - if(4) - inv_direction = 8 - if(8) - inv_direction = 4 - if(5) - inv_direction = 10 - if(6) - inv_direction = 9 - if(9) - inv_direction = 6 - if(10) - inv_direction = 5 - for(var/obj/structure/window/W in get_step(src,direction)) - if(W.dir == inv_direction) //So smooth tables don't go smooth through windows when the window is on the other table's tile - skip_sum = 1 - continue - if(!skip_sum) //means there is a window between the two tiles in this direction - if(locate(/obj/structure/table,get_step(src,direction))) - if(direction <5) - dir_sum += direction - else - if(direction == 5) //This permits the use of all table directions. (Set up so clockwise around the central table is a higher value, from north) - dir_sum += 16 - if(direction == 6) - dir_sum += 32 - if(direction == 8) //Aherp and Aderp. Jezes I am stupid. -- SkyMarshal - dir_sum += 8 - if(direction == 10) - dir_sum += 64 - if(direction == 9) - dir_sum += 128 + for(var/direction in list(1,2,4,8,5,6,9,10)) + if(locate(/obj/structure/table,get_step(src,direction))) + var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) + T.update_icon() - //dir_sum%16: - // 1,2,4,8 = endtable - // 3,12 = streight 1 tile thick table - // 5,6,9,10 = corner, if it finds a table in get_step(src,dir_sum) then it's a full corner table, else it's a 1 tile chick corner table - // 7,11,13,14 = three way intersection = full side table piece (north ,south, east or west) - // 15 = four way intersection = center (aka middle) table piece - // - //table_type: - // 0 = stand-alone table - // 1 = end table (1 tile thick, 1 connection) - // 2 = 1 tile thick table (1 tile thick, 2 connections) - // 3 = full table (full, 3 connections) - // 4 = middle table (full, 4 connections) +/obj/structure/table/Del() + for(var/direction in list(1,2,4,8,5,6,9,10)) + if(locate(/obj/structure/table,get_step(src,direction))) + var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) + T.update_icon() + ..() - var/table_type = 0 //stand_alone table - if(dir_sum%16 in cardinal) - table_type = 1 //endtable - dir_sum %= 16 - if(dir_sum%16 in list(3,12)) - table_type = 2 //1 tile thick, streight table - if(dir_sum%16 == 3) //3 doesn't exist as a dir - dir_sum = 2 - if(dir_sum%16 == 12) //12 doesn't exist as a dir. - dir_sum = 4 - if(dir_sum%16 in list(5,6,9,10)) - if(locate(/obj/structure/table,get_step(src.loc,dir_sum%16))) - table_type = 3 //full table (not the 1 tile thick one, but one of the 'tabledir' tables) - else - table_type = 2 //1 tile thick, corner table (treated the same as streight tables in code later on) - dir_sum %= 16 - if(dir_sum%16 in list(13,14,7,11)) //Three-way intersection - table_type = 5 //full table as three-way intersections are not sprited, would require 64 sprites to handle all combinations. TOO BAD -- SkyMarshal - switch(dir_sum%16) //Begin computation of the special type tables. --SkyMarshal - if(7) - if(dir_sum == 23) - table_type = 6 - dir_sum = 8 - else if(dir_sum == 39) - dir_sum = 4 - table_type = 6 - else if(dir_sum == 55 || dir_sum == 119 || dir_sum == 247 || dir_sum == 183) - dir_sum = 4 - table_type = 3 - else - dir_sum = 4 - if(11) - if(dir_sum == 75) - dir_sum = 5 - table_type = 6 - else if(dir_sum == 139) - dir_sum = 9 - table_type = 6 - else if(dir_sum == 203 || dir_sum == 219 || dir_sum == 251 || dir_sum == 235) - dir_sum = 8 - table_type = 3 - else - dir_sum = 8 - if(13) - if(dir_sum == 29) - dir_sum = 10 - table_type = 6 - else if(dir_sum == 141) - dir_sum = 6 - table_type = 6 - else if(dir_sum == 189 || dir_sum == 221 || dir_sum == 253 || dir_sum == 157) - dir_sum = 1 - table_type = 3 - else - dir_sum = 1 - if(14) - if(dir_sum == 46) - dir_sum = 1 - table_type = 6 - else if(dir_sum == 78) - dir_sum = 2 - table_type = 6 - else if(dir_sum == 110 || dir_sum == 254 || dir_sum == 238 || dir_sum == 126) - dir_sum = 2 - table_type = 3 - else - dir_sum = 2 //These translate the dir_sum to the correct dirs from the 'tabledir' icon_state. - if(dir_sum%16 == 15) - table_type = 4 //4-way intersection, the 'middle' table sprites will be used. +/obj/structure/table/update_icon() + spawn(2) //So it properly updates when deleting + var/dir_sum = 0 + for(var/direction in list(1,2,4,8,5,6,9,10)) + var/skip_sum = 0 + for(var/obj/structure/window/W in src.loc) + if(W.dir == direction) //So smooth tables don't go smooth through windows + skip_sum = 1 + continue + var/inv_direction //inverse direction + switch(direction) + if(1) + inv_direction = 2 + if(2) + inv_direction = 1 + if(4) + inv_direction = 8 + if(8) + inv_direction = 4 + if(5) + inv_direction = 10 + if(6) + inv_direction = 9 + if(9) + inv_direction = 6 + if(10) + inv_direction = 5 + for(var/obj/structure/window/W in get_step(src,direction)) + if(W.dir == inv_direction) //So smooth tables don't go smooth through windows when the window is on the other table's tile + skip_sum = 1 + continue + if(!skip_sum) //means there is a window between the two tiles in this direction + if(locate(/obj/structure/table,get_step(src,direction))) + if(direction <5) + dir_sum += direction + else + if(direction == 5) //This permits the use of all table directions. (Set up so clockwise around the central table is a higher value, from north) + dir_sum += 16 + if(direction == 6) + dir_sum += 32 + if(direction == 8) //Aherp and Aderp. Jezes I am stupid. -- SkyMarshal + dir_sum += 8 + if(direction == 10) + dir_sum += 64 + if(direction == 9) + dir_sum += 128 - if(istype(src,/obj/structure/table/reinforced)) - switch(table_type) - if(0) - icon_state = "reinf_table" - if(1) - icon_state = "reinf_1tileendtable" - if(2) - icon_state = "reinf_1tilethick" - if(3) - icon_state = "reinf_tabledir" - if(4) - icon_state = "reinf_middle" - if(5) - icon_state = "reinf_tabledir2" - if(6) - icon_state = "reinf_tabledir3" - else if(istype(src,/obj/structure/table/woodentable)) - switch(table_type) - if(0) - icon_state = "wood_table" - if(1) - icon_state = "wood_1tileendtable" - if(2) - icon_state = "wood_1tilethick" - if(3) - icon_state = "wood_tabledir" - if(4) - icon_state = "wood_middle" - if(5) - icon_state = "wood_tabledir2" - if(6) - icon_state = "wood_tabledir3" + var/table_type = 0 //stand_alone table + if(dir_sum%16 in cardinal) + table_type = 1 //endtable + dir_sum %= 16 + if(dir_sum%16 in list(3,12)) + table_type = 2 //1 tile thick, streight table + if(dir_sum%16 == 3) //3 doesn't exist as a dir + dir_sum = 2 + if(dir_sum%16 == 12) //12 doesn't exist as a dir. + dir_sum = 4 + if(dir_sum%16 in list(5,6,9,10)) + if(locate(/obj/structure/table,get_step(src.loc,dir_sum%16))) + table_type = 3 //full table (not the 1 tile thick one, but one of the 'tabledir' tables) else - switch(table_type) - if(0) - icon_state = "table" - if(1) - icon_state = "table_1tileendtable" - if(2) - icon_state = "table_1tilethick" - if(3) - icon_state = "tabledir" - if(4) - icon_state = "table_middle" - if(5) - icon_state = "tabledir2" - if(6) - icon_state = "tabledir3" - if (dir_sum in list(1,2,4,8,5,6,9,10)) - dir = dir_sum - else - dir = 2 + table_type = 2 //1 tile thick, corner table (treated the same as streight tables in code later on) + dir_sum %= 16 + if(dir_sum%16 in list(13,14,7,11)) //Three-way intersection + table_type = 5 //full table as three-way intersections are not sprited, would require 64 sprites to handle all combinations. TOO BAD -- SkyMarshal + switch(dir_sum%16) //Begin computation of the special type tables. --SkyMarshal + if(7) + if(dir_sum == 23) + table_type = 6 + dir_sum = 8 + else if(dir_sum == 39) + dir_sum = 4 + table_type = 6 + else if(dir_sum == 55 || dir_sum == 119 || dir_sum == 247 || dir_sum == 183) + dir_sum = 4 + table_type = 3 + else + dir_sum = 4 + if(11) + if(dir_sum == 75) + dir_sum = 5 + table_type = 6 + else if(dir_sum == 139) + dir_sum = 9 + table_type = 6 + else if(dir_sum == 203 || dir_sum == 219 || dir_sum == 251 || dir_sum == 235) + dir_sum = 8 + table_type = 3 + else + dir_sum = 8 + if(13) + if(dir_sum == 29) + dir_sum = 10 + table_type = 6 + else if(dir_sum == 141) + dir_sum = 6 + table_type = 6 + else if(dir_sum == 189 || dir_sum == 221 || dir_sum == 253 || dir_sum == 157) + dir_sum = 1 + table_type = 3 + else + dir_sum = 1 + if(14) + if(dir_sum == 46) + dir_sum = 1 + table_type = 6 + else if(dir_sum == 78) + dir_sum = 2 + table_type = 6 + else if(dir_sum == 110 || dir_sum == 254 || dir_sum == 238 || dir_sum == 126) + dir_sum = 2 + table_type = 3 + else + dir_sum = 2 //These translate the dir_sum to the correct dirs from the 'tabledir' icon_state. + if(dir_sum%16 == 15) + table_type = 4 //4-way intersection, the 'middle' table sprites will be used. + + if(istype(src,/obj/structure/table/reinforced)) + switch(table_type) + if(0) + icon_state = "reinf_table" + if(1) + icon_state = "reinf_1tileendtable" + if(2) + icon_state = "reinf_1tilethick" + if(3) + icon_state = "reinf_tabledir" + if(4) + icon_state = "reinf_middle" + if(5) + icon_state = "reinf_tabledir2" + if(6) + icon_state = "reinf_tabledir3" + else if(istype(src,/obj/structure/table/woodentable)) + switch(table_type) + if(0) + icon_state = "wood_table" + if(1) + icon_state = "wood_1tileendtable" + if(2) + icon_state = "wood_1tilethick" + if(3) + icon_state = "wood_tabledir" + if(4) + icon_state = "wood_middle" + if(5) + icon_state = "wood_tabledir2" + if(6) + icon_state = "wood_tabledir3" + else + switch(table_type) + if(0) + icon_state = "table" + if(1) + icon_state = "table_1tileendtable" + if(2) + icon_state = "table_1tilethick" + if(3) + icon_state = "tabledir" + if(4) + icon_state = "table_middle" + if(5) + icon_state = "tabledir2" + if(6) + icon_state = "tabledir3" + if (dir_sum in list(1,2,4,8,5,6,9,10)) + dir = dir_sum + else + dir = 2 /obj/structure/table/reinforced name = "reinforced table" @@ -1134,7 +1265,7 @@ /obj/structure/mopbucket desc = "Fill it with water, but don't forget a mop!" name = "mop bucket" - icon = 'janitor.dmi' + icon = 'icons/obj/janitor.dmi' icon_state = "mopbucket" density = 1 flags = FPRINT @@ -1144,7 +1275,7 @@ /obj/structure/kitchenspike name = "a meat spike" - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "spike" desc = "A spike for collecting meat from animals" density = 1 @@ -1155,7 +1286,7 @@ /obj/structure/displaycase name = "Display Case" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "glassbox1" desc = "A display case for prized possessions. It taunts you to kick it." density = 1 @@ -1167,7 +1298,7 @@ /obj/effect/showcase name = "Showcase" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "showcase_1" desc = "A stand with the empty body of a cyborg bolted to it." density = 1 @@ -1177,8 +1308,8 @@ //BEGIN BRAINS===================================================== /obj/item/brain name = "brain" - desc = "A piece of complex biomass found in a persons head." - icon = 'surgery.dmi' + desc = "A piece of juicy meat found in a persons head." + icon = 'icons/obj/surgery.dmi' icon_state = "brain2" flags = TABLEPASS force = 1.0 @@ -1187,6 +1318,7 @@ throw_speed = 3 throw_range = 5 origin_tech = "biotech=3" + attack_verb = list("attacked", "slapped", "whacked") var/mob/living/carbon/brain/brainmob = null @@ -1219,7 +1351,7 @@ /obj/item/metroid_core name = "metroid core" desc = "A very slimy and tender part of a Metroid. They also legend to have \"magical powers\"." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "metroid core" flags = TABLEPASS force = 1.0 @@ -1258,7 +1390,7 @@ /obj/structure/noticeboard name = "Notice Board" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "nboard00" flags = FPRINT desc = "A board for pinning important notices upon." @@ -1268,9 +1400,9 @@ /obj/effect/deskclutter name = "desk clutter" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "deskclutter" - desc = "Some clutter the desk has accumulated over the years..." + desc = "Some clutter the detective has accumalated over the years..." anchored = 1 /obj/item/mouse_drag_pointer = MOUSE_ACTIVE_POINTER @@ -1279,7 +1411,7 @@ /obj/item/weapon/glass name = "empty glass" desc = "Emptysville." - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "glass_empty" item_state = "beaker" flags = FPRINT | TABLEPASS | OPENCONTAINER @@ -1312,7 +1444,7 @@ /obj/structure/falsewall name = "wall" desc = "A huge chunk of metal used to seperate rooms." - icon = 'walls.dmi' + icon = 'icons/turf/walls.dmi' icon_state = "" density = 1 opacity = 1 @@ -1361,7 +1493,7 @@ /obj/structure/falserwall name = "r wall" desc = "A huge chunk of reinforced metal used to seperate rooms." - icon = 'walls.dmi' + icon = 'icons/turf/walls.dmi' icon_state = "r_wall" density = 1 opacity = 1 @@ -1369,12 +1501,12 @@ /obj/item/stack var/singular_name - var/amount = 1.0 + var/amount = 1 var/max_amount //also see stack recipes initialisation, param "max_res_amount" must be equal to this max_amount /obj/item/stack/rods name = "metal rods" - desc = "Some rods. Can be used for building." + desc = "Some rods. Can be used for building, or something." singular_name = "metal rod" icon_state = "rods" flags = FPRINT | TABLEPASS| CONDUCT @@ -1385,6 +1517,7 @@ throw_range = 20 m_amt = 1875 max_amount = 60 + attack_verb = list("hit", "bludgeoned", "whacked") /obj/item/stack/sheet name = "sheet" @@ -1398,17 +1531,28 @@ max_amount = 50 throw_speed = 3 throw_range = 3 + attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed") var/perunit = 3750 +/obj/item/stack/sheet/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/sheetsnatcher)) + var/obj/item/weapon/sheetsnatcher/S = W + if(!S.mode) + S.add(src,user) + else + for (var/obj/item/stack/sheet/stack in locate(src.x,src.y,src.z)) + S.add(stack,user) + ..() + /obj/item/stack/sheet/wood - name = "Wood Planks" + name = "wooden planks" desc = "One can only guess that this is a bunch of wood." singular_name = "wood plank" icon_state = "sheet-wood" origin_tech = "materials=1;biotech=1" /obj/item/stack/sheet/sandstone - name = "Sandstone Bricks" + name = "sandstone bricks" desc = "This appears to be a combination of both sand and stone." singular_name = "sandstone brick" icon_state = "sheet-sandstone" @@ -1418,7 +1562,7 @@ /obj/item/stack/sheet/glass name = "glass" - desc = "That is a lot of glass." + desc = "HOLY HELL! That is a lot of glass." singular_name = "glass sheet" icon_state = "sheet-glass" g_amt = 3750 @@ -1442,6 +1586,13 @@ g_amt = 0 m_amt = 0 +/obj/item/stack/sheet/cloth + name = "cloth" + desc = "This roll of cloth is made from only the finest chemicals and bunny rabbits." + singular_name = "cloth roll" + icon_state = "sheet-cloth" + origin_tech = "materials=2" + /obj/item/stack/sheet/metal name = "metal" @@ -1501,6 +1652,19 @@ max_amount = 60 origin_tech = "biotech=1" +/obj/item/stack/tile/wood + name = "wood floor tiles" + singular_name = "wood floor tile" + desc = "an easy to fit wood floor tile" + icon_state = "tile-wood" + w_class = 3.0 + force = 1.0 + throwforce = 1.0 + throw_speed = 5 + throw_range = 20 + flags = FPRINT | TABLEPASS | CONDUCT + max_amount = 60 + /obj/item/stack/light_w name = "wired glass tiles" singular_name = "wired glass floor tile" @@ -1522,19 +1686,19 @@ amount-- new/obj/item/stack/sheet/glass(user.loc) if(amount <= 0) - user.u_equip(src) + user.drop_from_inventory(src) del(src) if(istype(O,/obj/item/stack/sheet/metal)) var/obj/item/stack/sheet/metal/M = O M.amount-- if(M.amount <= 0) - user.u_equip(M) + user.drop_from_inventory(M) del(M) amount-- new/obj/item/stack/tile/light(user.loc) if(amount <= 0) - user.u_equip(src) + user.drop_from_inventory(src) del(src) /obj/item/stack/tile/light @@ -1549,6 +1713,7 @@ throw_range = 20 flags = FPRINT | TABLEPASS | CONDUCT max_amount = 60 + attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed") var/on = 1 var/state //0 = fine, 1 = flickering, 2 = breaking, 3 = broken @@ -1570,7 +1735,7 @@ amount-- new/obj/item/stack/light_w(user.loc) if(amount <= 0) - user.u_equip(src) + user.drop_from_inventory(src) del(src) /obj/item/stack/sheet/cardboard //BubbleWrap @@ -1582,7 +1747,7 @@ origin_tech = "materials=1" /obj/item/weapon/beach_ball - icon = 'beach.dmi' + icon = 'icons/misc/beach.dmi' icon_state = "ball" name = "beach ball" item_state = "beachball" @@ -1605,11 +1770,5 @@ desc = "You can't resist." // name = "" -/obj/item/rubberduck - name = "rubber duck" - desc = "A rubber duck. Quack." - icon = 'objects.dmi' - icon_state = "rduck" - item_state = "rduck" - flags = FPRINT - w_class = 1.0 +/obj/effect/spawner + name = "object spawner" diff --git a/code/defines/obj/closet.dm b/code/defines/obj/closet.dm index cd1f4b12c6..1e9d9c91d8 100644 --- a/code/defines/obj/closet.dm +++ b/code/defines/obj/closet.dm @@ -1,24 +1,19 @@ /obj/structure/closet name = "closet" desc = "It's a basic storage unit." - icon = 'closet.dmi' + icon = 'icons/obj/closet.dmi' icon_state = "closed" density = 1 + flags = FPRINT var/icon_closed = "closed" var/icon_opened = "open" var/opened = 0 var/welded = 0 var/wall_mounted = 0 //never solid (You can always pass over it) - flags = FPRINT var/health = 100 var/lastbang - var/lasttry = 0 - layer = 2.98 - var/quantity_max = 15 - -/obj/structure/closet/detective - name = "detective's closet" - desc = "Holds the detective's clothes while his coat rack is being repaired." + var/storage_capacity = 20 //This is so that someone can't pack hundreds of items in a locker/crate + //then open it in a populated area to crash clients. /obj/structure/closet/acloset name = "strange closet" @@ -34,10 +29,17 @@ icon_closed = "cabinet_closed" icon_opened = "cabinet_open" +/obj/structure/closet/cabinet/update_icon() + if(!opened) + icon_state = icon_closed + else + icon_state = icon_opened + + /obj/effect/spresent name = "strange present" desc = "It's a ... present?" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "strangepresent" density = 1 anchored = 0 @@ -64,6 +66,12 @@ icon_closed = "firecloset" icon_opened = "fireclosetopen" +/obj/structure/closet/firecloset/update_icon() + if(!opened) + icon_state = icon_closed + else + icon_state = icon_opened + /obj/structure/closet/hydrant //wall mounted fire closet name = "fire-safety closet" desc = "It's a storage unit for fire-fighting supplies." @@ -84,6 +92,12 @@ density = 0 wall_mounted = 1 +/obj/structure/closet/medical_wall/update_icon() + if(!opened) + icon_state = icon_closed + else + icon_state = icon_opened + /obj/structure/closet/toolcloset name = "tool closet" desc = "It's a storage unit for tools." @@ -104,12 +118,6 @@ icon_state = "mixed" icon_closed = "mixed" -/obj/structure/closet/jcloset2 - name = "cleaner's closet" - desc = "It's a storage unit for various cleaning items." - icon_state = "mixed" - icon_closed = "mixed" - /obj/structure/closet/lawcloset name = "legal closet" desc = "It's a storage unit for courtroom apparel and items." @@ -149,6 +157,12 @@ icon_closed = "coffin" icon_opened = "coffin_open" +/obj/structure/closet/coffin/update_icon() + if(!opened) + icon_state = icon_closed + else + icon_state = icon_opened + /obj/structure/closet/bombcloset name = "\improper EOD closet" desc = "It's a storage unit for explosion-protective suits." @@ -259,7 +273,7 @@ /obj/structure/closet/wardrobe name = "wardrobe" - desc = "It's a storage unit for standard-issue NanoTrasen attire." + desc = "It's a storage unit for standard-issue Nanotrasen attire." icon_state = "blue" icon_closed = "blue" @@ -270,7 +284,7 @@ /obj/structure/closet/wardrobe/chaplain_black name = "chapel wardrobe" - desc = "It's a storage unit for NanoTrasen-approved religious attire." + desc = "It's a storage unit for Nanotrasen-approved religious attire." icon_state = "black" icon_closed = "black" @@ -286,7 +300,7 @@ /obj/structure/closet/wardrobe/orange name = "prison wardrobe" - desc = "It's a storage unit for NanoTrasen-regulation prisoner attire." + desc = "It's a storage unit for Nanotrasen-regulation prisoner attire." icon_state = "orange" icon_closed = "orange" @@ -300,26 +314,16 @@ icon_state = "red" icon_closed = "red" -/obj/structure/closet/wardrobe/warden - name = "Warden's wardrobe" - icon_state = "red" - icon_closed = "red" - -/obj/structure/closet/wardrobe/hos - name = "Head of Security's wardrobe" - icon_state = "red" - icon_closed = "red" - -/obj/structure/closet/wardrobe/hop - name = "Head of Personnel's wardrobe" - icon_state = "blue" - icon_closed = "blue" - /obj/structure/closet/wardrobe/white name = "white wardrobe" icon_state = "white" icon_closed = "white" +/obj/structure/closet/wardrobe/pjs + name = "Pajama wardrobe" + icon_state = "white" + icon_closed = "white" + /obj/structure/closet/wardrobe/toxins_white name = "toxins wardrobe" icon_state = "white" @@ -330,11 +334,6 @@ icon_state = "black" icon_closed = "black" -/obj/structure/closet/wardrobe/medic_white - name = "doctor's wardrobe" - icon_state = "white" - icon_closed = "white" - /obj/structure/closet/wardrobe/chemistry_white name = "chemistry wardrobe" icon_state = "white" @@ -345,26 +344,6 @@ icon_state = "white" icon_closed = "white" -/obj/structure/closet/wardrobe/nurse - name = "nurse's wardrobe" - icon_state = "white" - icon_closed = "white" - -/obj/structure/closet/wardrobe/cmo - name = "Chief Medical Officer's wardrobe" - icon_state = "white" - icon_closed = "white" - -/obj/structure/closet/wardrobe/rd - name = "Research Director's wardrobe" - icon_state = "white" - icon_closed = "white" - -/obj/structure/closet/wardrobe/scientist - name = "scientist's wardrobe" - icon_state = "white" - icon_closed = "white" - /obj/structure/closet/wardrobe/virology_white name = "virology wardrobe" icon_state = "white" @@ -380,11 +359,6 @@ icon_state = "yellow" icon_closed = "yellow" -/obj/structure/closet/wardrobe/robotics_yellow - name = "robotics wardrobe" - icon_state = "yellow" - icon_closed = "yellow" - /obj/structure/closet/wardrobe/atmospherics_yellow name = "atmospherics wardrobe" icon_state = "yellow" @@ -395,42 +369,10 @@ icon_state = "grey" icon_closed = "grey" -/obj/structure/closet/wardrobe/bartender_black - name = "Bartender's wardrobe" - icon_state = "black" - icon_closed = "black" - -/obj/structure/closet/wardrobe/chef_white - name = "Chef's wardrobe" - icon_state = "white" - icon_closed = "white" - -/obj/structure/closet/wardrobe/hydro_green - name = "Hydroponics wardrobe" - icon_state = "green" - icon_closed = "green" - -/obj/structure/closet/wardrobe/librarian_red - name = "Librarian's wardrobe" - icon_state = "red" - icon_closed = "red" - -/obj/structure/closet/wardrobe/cargo_yellow - name = "Cargo Tech's wardrobe" - icon_state = "yellow" - icon_closed = "yellow" - -/obj/structure/closet/wardrobe/qm_yellow - name = "Quartermaster's wardrobe" - icon_state = "yellow" - icon_closed = "yellow" - - - /obj/structure/closet/secure_closet name = "secure locker" desc = "It's an immobile card-locked storage unit." - icon = 'closet.dmi' + icon = 'icons/obj/closet.dmi' icon_state = "secure1" density = 1 opened = 0 @@ -457,15 +399,24 @@ anchored = 1 density = 0 wall_mounted = 1 - req_access = list(ACCESS_MEDICAL) + req_access = list(access_medical) + +/obj/structure/closet/secure_closet/medical_wall/update_icon() + if(broken) + icon_state = icon_broken + else + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + else + icon_state = icon_opened /obj/structure/closet/secure_closet/personal - desc = "It's a secure locker for personnel. The first card swiped gains control." + desc = "It's a secure locker for personell. The first card swiped gains control." name = "personal closet" -/obj/structure/closet/secure_closet/personal/patient - name = "patient's closet" - /obj/structure/closet/secure_closet/personal/cabinet icon_state = "cabinetdetective_locked" icon_closed = "cabinetdetective" @@ -474,47 +425,24 @@ icon_broken = "cabinetdetective_broken" icon_off = "cabinetdetective_broken" -/obj/structure/closet/secure_closet/kitchen - name = "kitchen cabinet" - req_access = list(ACCESS_KITCHEN) - -/obj/structure/closet/secure_closet/kitchen/mining - req_access = list() - -/obj/structure/closet/secure_closet/meat - name = "meat fridge" - icon_state = "fridge1" - icon_closed = "fridge" - icon_locked = "fridge1" - icon_opened = "fridgeopen" - icon_broken = "fridgebroken" - icon_off = "fridge1" - -/obj/structure/closet/secure_closet/fridge - name = "refrigerator" - icon_state = "fridge1" - icon_closed = "fridge" - icon_locked = "fridge1" - icon_opened = "fridgeopen" - icon_broken = "fridgebroken" - icon_off = "fridge1" - -/obj/structure/closet/secure_closet/money_freezer - name = "freezer" - icon_state = "fridge1" - icon_closed = "fridge" - icon_locked = "fridge1" - icon_opened = "fridgeopen" - icon_broken = "fridgebroken" - icon_off = "fridge1" - req_access = list(ACCESS_HEADS_VAULT) +/obj/structure/closet/secure_closet/personal/cabinet/update_icon() + if(broken) + icon_state = icon_broken + else + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + else + icon_state = icon_opened /obj/structure/closet/secure_closet/personal/patient name = "patient's closet" /obj/structure/closet/secure_closet/wall name = "wall locker" - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) icon_state = "wall-locker1" density = 1 icon_closed = "wall-locker" @@ -524,4 +452,23 @@ icon_off = "wall-lockeroff" //too small to put a man in - large = 0 \ No newline at end of file + large = 0 + +/obj/structure/closet/secure_closet/wall/update_icon() + if(broken) + icon_state = icon_broken + else + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + else + icon_state = icon_opened + +/obj/structure/closet/crate/critter + name = "critter crate" + desc = "A crate which can sustain life for a while." + icon_state = "critter" + icon_opened = "critteropen" + icon_closed = "critter" \ No newline at end of file diff --git a/code/modules/clothing/costume.dm b/code/defines/obj/clothing/costume.dm similarity index 73% rename from code/modules/clothing/costume.dm rename to code/defines/obj/clothing/costume.dm index edb854ee58..49bb4622b9 100644 --- a/code/modules/clothing/costume.dm +++ b/code/defines/obj/clothing/costume.dm @@ -20,7 +20,7 @@ /obj/effect/landmark/costume/madscientist/New() new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc) new /obj/item/clothing/head/flatcap(src.loc) - new /obj/item/clothing/suit/storage/labcoat/mad(src.loc) + new /obj/item/clothing/suit/labcoat/mad(src.loc) new /obj/item/clothing/glasses/gglasses(src.loc) del(src) @@ -44,7 +44,7 @@ del(src) /obj/effect/landmark/costume/butler/New() - new /obj/item/clothing/suit/storage/wcoat(src.loc) + new /obj/item/clothing/suit/wcoat(src.loc) new /obj/item/clothing/under/suit_jacket(src.loc) new /obj/item/clothing/head/that(src.loc) del(src) @@ -53,8 +53,8 @@ new /obj/item/clothing/gloves/white(src.loc) new /obj/item/clothing/shoes/white(src.loc) new /obj/item/clothing/under/scratch(src.loc) -// if (prob(30)) -// new /obj/item/clothing/head/helmet/cueball(src.loc) + if (prob(30)) + new /obj/item/clothing/head/cueball(src.loc) del(src) /obj/effect/landmark/costume/highlander/New() @@ -63,9 +63,9 @@ del(src) /obj/effect/landmark/costume/prig/New() - new /obj/item/clothing/suit/storage/wcoat(src.loc) + new /obj/item/clothing/suit/wcoat(src.loc) new /obj/item/clothing/glasses/monocle(src.loc) - var/CHOICE= pick( /obj/item/clothing/head/bowlerhat, /obj/item/clothing/head/that) + var/CHOICE= pick( /obj/item/clothing/head/bowler, /obj/item/clothing/head/that) new CHOICE(src.loc) new /obj/item/clothing/shoes/black(src.loc) new /obj/item/weapon/cane(src.loc) @@ -87,7 +87,7 @@ new /obj/item/clothing/under/waiter(src.loc) var/CHOICE= pick( /obj/item/clothing/head/kitty, /obj/item/clothing/head/rabbitears) new CHOICE(src.loc) - new /obj/item/clothing/suit/storage/apron(src.loc) + new /obj/item/clothing/suit/apron(src.loc) del(src) /obj/effect/landmark/costume/pirate/New() @@ -102,15 +102,6 @@ new /obj/item/clothing/under/soviet(src.loc) new /obj/item/clothing/head/ushanka(src.loc) del(src) -/* -/obj/effect/landmark/costume/nurse/New() - new /obj/item/clothing/under/rank/nursesuit(src.loc) - new /obj/item/clothing/head/nursehat(src.loc) - new /obj/item/clothing/glasses/regular(src.loc) - new /obj/item/clothing/gloves/latex(src.loc) - new /obj/item/clothing/mask/surgical(src.loc) - del(src)*/ - /obj/effect/landmark/costume/imperium_monk/New() new /obj/item/clothing/suit/imperium_monk(src.loc) @@ -122,18 +113,6 @@ new /obj/item/clothing/suit/holidaypriest(src.loc) del(src) -/* -/obj/effect/landmark/costume/spiderman/New() - new /obj/item/clothing/under/spiderman(src.loc) - new /obj/item/clothing/mask/spiderman(src.loc) - del(src)*/ - -/* -/obj/effect/landmark/costume/marisawizard/New() - new /obj/item/clothing/head/wizard/marisa(src.loc) - new/obj/item/clothing/suit/wizrobe/marisa(src.loc) - del(src)*/ - /obj/effect/landmark/costume/marisawizard/fake/New() new /obj/item/clothing/head/wizard/marisa/fake(src.loc) new/obj/item/clothing/suit/wizrobe/marisa/fake(src.loc) @@ -154,20 +133,7 @@ new /obj/item/clothing/under/sexymime(src.loc) del(src) - -/* -/obj/effect/landmark/costume/cyborg/New() - new /obj/item/clothing/mask/gas/cyborg(src.loc) - new /obj/item/clothing/shoes/cyborg(src.loc) - new /obj/item/clothing/suit/cyborg_suit(src.loc) - new /obj/item/clothing/gloves/cyborg(src.loc) - - var/obj/item/weapon/card/id/W = new /obj/item/weapon/card/id(src.loc) - var/name = "Cyborg" - name += " [pick(rand(1, 999))]" - W.name = "Fake Cyborg Card" - W.access = list(ACCESS_THEATRE) - W.assignment = "Kill all humans! Beep. Boop." - W.registered_name = name - del(src) - */ \ No newline at end of file +///obj/effect/landmark/costume/hidden/master/New() +// var/list/templist = list() +// templist += src +// for(var/obj/effect/landmark/costume/hidden/H in z1 \ No newline at end of file diff --git a/code/defines/obj/costume.dm b/code/defines/obj/costume.dm new file mode 100644 index 0000000000..49bb4622b9 --- /dev/null +++ b/code/defines/obj/costume.dm @@ -0,0 +1,139 @@ +//Costume spawner + +/obj/effect/landmark/costume/New() //costume spawner, selects a random subclass and disappears + + var/list/options = typesof(/obj/effect/landmark/costume) + var/PICK= options[rand(1,options.len)] + new PICK(src.loc) + del(src) + +//SUBCLASSES. Spawn a bunch of items and disappear likewise +/obj/effect/landmark/costume/chicken/New() + new /obj/item/clothing/suit/chickensuit(src.loc) + del(src) + +/obj/effect/landmark/costume/gladiator/New() + new /obj/item/clothing/under/gladiator(src.loc) + new /obj/item/clothing/head/helmet/gladiator(src.loc) + del(src) + +/obj/effect/landmark/costume/madscientist/New() + new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc) + new /obj/item/clothing/head/flatcap(src.loc) + new /obj/item/clothing/suit/labcoat/mad(src.loc) + new /obj/item/clothing/glasses/gglasses(src.loc) + del(src) + +/obj/effect/landmark/costume/elpresidente/New() + new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc) + new /obj/item/clothing/head/flatcap(src.loc) + new /obj/item/clothing/mask/cigarette/cigar/havana(src.loc) + new /obj/item/clothing/shoes/jackboots(src.loc) + del(src) + +/obj/effect/landmark/costume/nyangirl/New() + new /obj/item/clothing/under/schoolgirl(src.loc) + new /obj/item/clothing/head/kitty(src.loc) + del(src) + +/obj/effect/landmark/costume/maid/New() + new /obj/item/clothing/under/blackskirt(src.loc) + var/CHOICE = pick( /obj/item/clothing/head/beret , /obj/item/clothing/head/rabbitears ) + new CHOICE(src.loc) + new /obj/item/clothing/glasses/blindfold(src.loc) + del(src) + +/obj/effect/landmark/costume/butler/New() + new /obj/item/clothing/suit/wcoat(src.loc) + new /obj/item/clothing/under/suit_jacket(src.loc) + new /obj/item/clothing/head/that(src.loc) + del(src) + +/obj/effect/landmark/costume/scratch/New() + new /obj/item/clothing/gloves/white(src.loc) + new /obj/item/clothing/shoes/white(src.loc) + new /obj/item/clothing/under/scratch(src.loc) + if (prob(30)) + new /obj/item/clothing/head/cueball(src.loc) + del(src) + +/obj/effect/landmark/costume/highlander/New() + new /obj/item/clothing/under/kilt(src.loc) + new /obj/item/clothing/head/beret(src.loc) + del(src) + +/obj/effect/landmark/costume/prig/New() + new /obj/item/clothing/suit/wcoat(src.loc) + new /obj/item/clothing/glasses/monocle(src.loc) + var/CHOICE= pick( /obj/item/clothing/head/bowler, /obj/item/clothing/head/that) + new CHOICE(src.loc) + new /obj/item/clothing/shoes/black(src.loc) + new /obj/item/weapon/cane(src.loc) + new /obj/item/clothing/under/sl_suit(src.loc) + new /obj/item/clothing/mask/fakemoustache(src.loc) + del(src) + +/obj/effect/landmark/costume/plaguedoctor/New() + new /obj/item/clothing/suit/bio_suit/plaguedoctorsuit(src.loc) + new /obj/item/clothing/head/plaguedoctorhat(src.loc) + del(src) + +/obj/effect/landmark/costume/nightowl/New() + new /obj/item/clothing/under/owl(src.loc) + new /obj/item/clothing/mask/owl_mask(src.loc) + del(src) + +/obj/effect/landmark/costume/waiter/New() + new /obj/item/clothing/under/waiter(src.loc) + var/CHOICE= pick( /obj/item/clothing/head/kitty, /obj/item/clothing/head/rabbitears) + new CHOICE(src.loc) + new /obj/item/clothing/suit/apron(src.loc) + del(src) + +/obj/effect/landmark/costume/pirate/New() + new /obj/item/clothing/under/pirate(src.loc) + new /obj/item/clothing/suit/pirate(src.loc) + var/CHOICE = pick( /obj/item/clothing/head/pirate , /obj/item/clothing/head/bandana ) + new CHOICE(src.loc) + new /obj/item/clothing/glasses/eyepatch(src.loc) + del(src) + +/obj/effect/landmark/costume/commie/New() + new /obj/item/clothing/under/soviet(src.loc) + new /obj/item/clothing/head/ushanka(src.loc) + del(src) + +/obj/effect/landmark/costume/imperium_monk/New() + new /obj/item/clothing/suit/imperium_monk(src.loc) + if (prob(25)) + new /obj/item/clothing/mask/gas/cyborg(src.loc) + del(src) + +/obj/effect/landmark/costume/holiday_priest/New() + new /obj/item/clothing/suit/holidaypriest(src.loc) + del(src) + +/obj/effect/landmark/costume/marisawizard/fake/New() + new /obj/item/clothing/head/wizard/marisa/fake(src.loc) + new/obj/item/clothing/suit/wizrobe/marisa/fake(src.loc) + del(src) + +/obj/effect/landmark/costume/fakewizard/New() + new /obj/item/clothing/suit/wizrobe/fake(src.loc) + new /obj/item/clothing/head/wizard/fake(src.loc) + del(src) + +/obj/effect/landmark/costume/sexyclown/New() + new /obj/item/clothing/mask/gas/sexyclown(src.loc) + new /obj/item/clothing/under/sexyclown(src.loc) + del(src) + +/obj/effect/landmark/costume/sexymime/New() + new /obj/item/clothing/mask/gas/sexymime(src.loc) + new /obj/item/clothing/under/sexymime(src.loc) + del(src) + +///obj/effect/landmark/costume/hidden/master/New() +// var/list/templist = list() +// templist += src +// for(var/obj/effect/landmark/costume/hidden/H in z1 \ No newline at end of file diff --git a/code/defines/obj/decal.dm b/code/defines/obj/decal.dm index 885efaa665..cbf71a24dc 100644 --- a/code/defines/obj/decal.dm +++ b/code/defines/obj/decal.dm @@ -1,24 +1,8 @@ -/obj/effect/decal - pass_flags = PASSBLOB - -/obj/effect/decal/ash - name = "ashes" - desc = "Ashes to ashes, dust to dust, and into space." - gender = PLURAL - icon = 'objects.dmi' - icon_state = "ash" - anchored = 1 - -/obj/effect/decal/ash/attack_hand(mob/user as mob) - usr << "\blue The ashes slip through your fingers." - del(src) - return - /obj/effect/decal/remains/human name = "remains" desc = "They look like human remains. They have a strange aura about them." gender = PLURAL - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "remains" anchored = 1 @@ -26,7 +10,7 @@ name = "remains" desc = "They look like the remains of something... alien. They have a strange aura about them." gender = PLURAL - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "remainsxeno" anchored = 1 @@ -34,14 +18,14 @@ name = "remains" desc = "They look like the remains of something mechanical. They have a strange aura about them." gender = PLURAL - icon = 'robots.dmi' + icon = 'icons/mob/robots.dmi' icon_state = "remainsrobot" anchored = 1 /obj/effect/decal/point name = "arrow" desc = "It's an arrow hanging in mid-air. There may be a wizard about." - icon = 'screen1.dmi' + icon = 'icons/mob/screen1.dmi' icon_state = "arrow" layer = 16.0 anchored = 1 @@ -51,26 +35,33 @@ //HUMANS +/obj/effect/decal/cleanable/ash + name = "ashes" + desc = "Ashes to ashes, dust to dust, and into space." + gender = PLURAL + icon = 'icons/obj/objects.dmi' + icon_state = "ash" + anchored = 1 + /obj/effect/decal/cleanable/blood name = "blood" - desc = "It's red and disgusting." + desc = "It's red and gooey. Perhaps it's the chef's cooking?" gender = PLURAL density = 0 anchored = 1 layer = 2 - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "floor1" random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") var/list/viruses = list() blood_DNA = list() - var/datum/disease2/disease/virus2 = null - var/OriginalMob = null + //var/datum/disease2/disease/virus2 = null /obj/effect/decal/cleanable/blood/Del() for(var/datum/disease/D in viruses) D.cure(0) ..() -/* //This breaks a few blood related things, thankfully we don't get too many decals -- Erthilo + /obj/effect/decal/cleanable/blood/New() ..() if(istype(src, /obj/effect/decal/cleanable/blood/gibs)) @@ -79,36 +70,12 @@ for(var/obj/effect/decal/cleanable/blood/B in src.loc) if(B != src) del(B) -*/ - -/obj/effect/decal/cleanable/blood/drip - name = "drips of blood" - desc = "It's red." - gender = PLURAL - density = 0 - anchored = 1 - layer = 2 - icon = 'drip.dmi' - icon_state = "1" -// track_amt = 0 - -/obj/effect/decal/cleanable/mucus - name = "mucus" - desc = "Disgusting mucus." - gender = PLURAL - density = 0 - anchored = 1 - layer = 2 - icon = 'blood.dmi' - icon_state = "mucus" - random_icon_states = list("mucus") - var/datum/disease2/disease/virus2 = null /obj/effect/decal/cleanable/blood/splatter random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5") /obj/effect/decal/cleanable/blood/tracks - icon_state = "blood" + icon_state = "tracks" desc = "They look like tracks left by wheels." gender = PLURAL random_icon_states = null @@ -120,7 +87,7 @@ density = 0 anchored = 0 layer = 2 - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "gibbl5" random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6") @@ -148,10 +115,11 @@ density = 0 anchored = 1 layer = 2 - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "xfloor1" random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7") var/list/viruses = list() + blood_DNA = list() Del() for(var/datum/disease/D in viruses) @@ -165,7 +133,7 @@ name = "xeno gibs" desc = "Gnarly..." gender = PLURAL - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "xgib1" random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6") @@ -197,7 +165,7 @@ density = 0 anchored = 0 layer = 2 - icon = 'robots.dmi' + icon = 'icons/mob/robots.dmi' icon_state = "gib1" random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7") @@ -217,7 +185,7 @@ density = 0 anchored = 1 layer = 2 - icon = 'robots.dmi' + icon = 'icons/mob/robots.dmi' icon_state = "floor1" var/viruses = list() random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") @@ -239,7 +207,7 @@ density = 0 anchored = 1 layer = 2 - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "shards" /obj/effect/decal/cleanable/dirt @@ -249,17 +217,17 @@ density = 0 anchored = 1 layer = 2 - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "dirt" /obj/effect/decal/cleanable/greenglow name = "glowing goo" - desc = "Eerie. This makes you feel creepy." + desc = "Jeez. I hope that's not for lunch." gender = PLURAL density = 0 anchored = 1 layer = 2 - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "greenglow" /obj/effect/decal/cleanable/cobweb @@ -268,7 +236,7 @@ density = 0 anchored = 1 layer = 3 - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "cobweb1" /obj/effect/decal/cleanable/molten_item @@ -277,7 +245,7 @@ density = 0 anchored = 1 layer = 3 - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "molten" /obj/effect/decal/cleanable/cobweb2 @@ -286,7 +254,7 @@ density = 0 anchored = 1 layer = 3 - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "cobweb2" // Used for spray that you spray at walls, tables, hydrovats etc @@ -303,7 +271,7 @@ density = 0 anchored = 1 layer = 2 - icon = 'blood.dmi' + icon = 'icons/effects/blood.dmi' icon_state = "vomit_1" random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4") var/list/viruses = list() @@ -319,7 +287,7 @@ density = 0 anchored = 1 layer = 2 - icon = 'tomatodecal.dmi' + icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3") /obj/effect/decal/cleanable/egg_smudge @@ -328,7 +296,7 @@ density = 0 anchored = 1 layer = 2 - icon = 'tomatodecal.dmi' + icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3") /obj/effect/decal/cleanable/pie_smudge //honk @@ -337,15 +305,5 @@ density = 0 anchored = 1 layer = 2 - icon = 'tomatodecal.dmi' + icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("smashed_pie") - -/obj/effect/decal/warning_stripes - icon = 'decal_warning_stripes.dmi' - layer = 2 - -/obj/effect/decal/warning_stripes/New() - ..() - - loc.overlays += src - del src \ No newline at end of file diff --git a/code/defines/obj/hydro.dm b/code/defines/obj/hydro.dm index 9cd7284772..90d765dd91 100644 --- a/code/defines/obj/hydro.dm +++ b/code/defines/obj/hydro.dm @@ -2,7 +2,7 @@ /obj/item/device/analyzer/plant_analyzer name = "plant analyzer" - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "hydro" item_state = "analyzer" @@ -15,7 +15,7 @@ /obj/item/seeds name = "pack of seeds" - icon = 'seeds.dmi' + icon = 'icons/obj/seeds.dmi' icon_state = "seed" // unknown plant seed - these shouldn't exist in-game flags = FPRINT | TABLEPASS w_class = 1.0 // Makes them pocketable @@ -73,7 +73,7 @@ var/ckey = null var/realName = null var/datum/mind/mind = null - gender = "male" + gender = MALE /obj/item/seeds/grapeseed name = "pack of grape seeds" @@ -419,6 +419,24 @@ plant_type = 0 growthstages = 3 +/obj/item/seeds/reishimycelium + name = "pack of reishi mycelium" + desc = "This mycelium grows into something relaxing." + icon_state = "mycelium-reishi" + mypath = "/obj/item/seeds/reishimycelium" + species = "reishi" + plantname = "Reishi" + productname = "/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi" + lifespan = 35 + endurance = 35 + maturation = 10 + production = 5 + yield = 4 + potency = 15 // Sleeping based on potency? + oneharvest = 1 + growthstages = 4 + plant_type = 2 + /obj/item/seeds/amanitamycelium name = "pack of fly amanita mycelium" desc = "This mycelium grows into something horrible." @@ -684,6 +702,24 @@ maturation = 6 production = 6 yield = 5 + potency = 10 + plant_type = 0 + growthstages = 6 + +/obj/item/seeds/goldappleseed + name = "pack of golden apple seeds" + desc = "These seeds grow into golden apple trees. Good thing there are no firebirds in space." + icon_state = "seed-goldapple" + mypath = "/obj/item/seeds/goldappleseed" + species = "goldapple" + plantname = "Golden Apple Tree" + productname = "/obj/item/weapon/reagent_containers/food/snacks/grown/goldapple" + lifespan = 55 + endurance = 35 + maturation = 10 + production = 10 + yield = 3 + potency = 10 plant_type = 0 growthstages = 6 @@ -924,7 +960,7 @@ yield = 2 potency = 10 plant_type = 0 - growthstages = 6 + growthstages = 5 /* // Maybe one day when I get it to work like a grenade which exlodes gibs. /obj/item/seeds/gibtomatoseed @@ -965,697 +1001,9 @@ */ - - -// *********************************************************** -// Foods that are produced from hydroponics ~~~~~~~~~~ -// Data from the seeds carry over to these grown foods -// *********************************************************** - -//Grown foods -/obj/item/weapon/reagent_containers/food/snacks/grown/ //New subclass so we can pass on values - var/seed = "" - var/plantname = "" - var/productname = "" - var/species = "" - var/lifespan = 0 - var/endurance = 0 - var/maturation = 0 - var/production = 0 - var/yield = 0 - var/potency = -1 - var/plant_type = 0 - icon = 'harvest.dmi' - New(newloc,newpotency) - if (!isnull(newpotency)) - potency = newpotency - ..() - src.pixel_x = rand(-5.0, 5) - src.pixel_y = rand(-5.0, 5) - -/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/O as obj, var/mob/user as mob) - ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - var/msg - msg = "*---------*\n This is \a [src]\n" - switch(plant_type) - if(0) - msg += "- Plant type: Normal plant\n" - if(1) - msg += "- Plant type: Weed\n" - if(2) - msg += "- Plant type: Mushroom\n" - msg += "- Potency: [potency]\n" - msg += "- Yield: [yield]\n" - msg += "- Maturation speed: [maturation]\n" - msg += "- Production speed: [production]\n" - msg += "- Endurance: [endurance]\n" - msg += "- Healing properties: [reagents.get_reagent_amount("nutriment")]\n" - msg += "*---------*" - usr << msg - return - -/obj/item/weapon/grown/attackby(var/obj/item/O as obj, var/mob/user as mob) - ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - var/msg - msg = "*---------*\n This is \a [src]\n" - switch(plant_type) - if(0) - msg += "- Plant type: Normal plant\n" - if(1) - msg += "- Plant type: Weed\n" - if(2) - msg += "- Plant type: Mushroom\n" - msg += "- Acid strength: [potency]\n" - msg += "- Yield: [yield]\n" - msg += "- Maturation speed: [maturation]\n" - msg += "- Production speed: [production]\n" - msg += "- Endurance: [endurance]\n" - msg += "*---------*" - usr << msg - return - -/obj/item/weapon/reagent_containers/food/snacks/grown/corn - seed = "/obj/item/seeds/cornseed" - name = "cob of corn" - desc = "Needs some butter!" - icon_state = "corn" - potency = 40 - On_Consume() - if(!reagents.total_volume) - var/mob/living/M = usr - if(M) - var/obj/item/weapon/corncob/W = new /obj/item/weapon/corncob( M ) - M << "You chew on the corn, leaving nothing behind but a cob." - M.put_in_hand(W) - W.add_fingerprint(M) - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - - -/obj/item/weapon/reagent_containers/food/snacks/grown/poppy - seed = "/obj/item/seeds/poppyseed" - name = "poppy" - desc = "Long-used as a symbol of rest, peace, and death." - icon_state = "poppy" - potency = 30 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - reagents.add_reagent("bicaridine", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 3, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/harebell - seed = "obj/item/seeds/harebellseed" - name = "harebell" - desc = "\"I'll sweeten thy sad grave: thou shalt not lack the flower that's like thy face, pale primrose, nor the azured hare-bell, like thy veins; no, nor the leaf of eglantine, whom not to slander, out-sweeten’d not thy breath.\"" - icon_state = "harebell" - potency = 1 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - bitesize = 1+round(reagents.total_volume / 3, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/potato - seed = "/obj/item/seeds/potatoseed" - name = "potato" - desc = "Boil 'em! Mash 'em! Stick 'em in a stew!" - icon_state = "potato" - potency = 25 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = reagents.total_volume - -/obj/item/weapon/reagent_containers/food/snacks/grown/grapes - seed = "/obj/item/seeds/grapeseed" - name = "bunch of grapes" - desc = "Nutritious!" - icon_state = "grapes" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - reagents.add_reagent("sugar", 1+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes - seed = "/obj/item/seeds/greengrapeseed" - name = "bunch of green grapes" - desc = "Nutritious!" - icon_state = "greengrapes" - potency = 25 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - reagents.add_reagent("kelotane", 3+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage - seed = "/obj/item/seeds/cabbageseed" - name = "cabbage" - desc = "Ewwwwwwwwww. Cabbage." - icon_state = "cabbage" - potency = 25 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = reagents.total_volume - -/obj/item/weapon/reagent_containers/food/snacks/grown/berries - seed = "/obj/item/seeds/berryseed" - name = "bunch of berries" - desc = "Nutritious!" - icon_state = "berrypile" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries - seed = "/obj/item/seeds/glowberryseed" - name = "bunch of glow-berries" - desc = "Nutritious!" - var/on = 1 - var/brightness_on = 2 //luminosity when on - icon_state = "glowberrypile" - New() - ..() - reagents.add_reagent("nutriment", round((potency / 10), 1)) - reagents.add_reagent("radium", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/Del() - if(istype(loc,/mob)) - loc.ul_SetLuminosity(loc.LuminosityRed - potency/5, loc.LuminosityGreen - potency/5, loc.LuminosityBlue - potency/5) - ..() - -/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/pickup(mob/user) - ul_SetLuminosity(0) - user.ul_SetLuminosity(user.LuminosityRed + potency/5, user.LuminosityGreen + potency/5, user.LuminosityBlue + potency/5) - -/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/dropped(mob/user) - user.ul_SetLuminosity(user.LuminosityRed - potency/5, user.LuminosityGreen - potency/5, user.LuminosityBlue - potency/5) - ul_SetLuminosity(potency/5) - -/obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod - seed = "/obj/item/seeds/cocoapodseed" - name = "cocoa pod" - desc = "Fattening... Mmmmm... chucklate." - icon_state = "cocoapod" - potency = 50 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - reagents.add_reagent("coco", 4+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/sugarcane - seed = "/obj/item/seeds/sugarcaneseed" - name = "sugarcane" - desc = "Sickly sweet." - icon_state = "sugarcane" - potency = 50 - New() - ..() - reagents.add_reagent("sugar", 4+round((potency / 5), 1)) - -/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries - seed = "/obj/item/seeds/poisonberryseed" - name = "bunch of poison-berries" - desc = "Taste so good, you could die!" - icon_state = "poisonberrypile" - gender = PLURAL - potency = 15 - New() - ..() - reagents.add_reagent("nutriment", 1) - reagents.add_reagent("toxin", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/deathberries - seed = "/obj/item/seeds/deathberryseed" - name = "bunch of death-berries" - desc = "Taste so good, you could die!" - icon_state = "deathberrypile" - gender = PLURAL - potency = 50 - New() - ..() - reagents.add_reagent("nutriment", 1) - reagents.add_reagent("toxin", 3+round(potency / 3, 1)) - reagents.add_reagent("lexorin", 1+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris - seed = "/obj/item/seeds/ambrosiavulgaris" - name = "ambrosia vulgaris branch" - desc = "This is a plant containing various healing chemicals." - icon_state = "ambrosiavulgaris" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1) - reagents.add_reagent("space_drugs", 3+round(potency / 5, 1)) - reagents.add_reagent("kelotane", 3+round(potency / 5, 1)) - reagents.add_reagent("bicaridine", 3+round(potency / 5, 1)) - reagents.add_reagent("toxin", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus - seed = "/obj/item/seeds/ambrosiadeus" - name = "ambrosia deus branch" - desc = "Eating this makes you feel immortal!" - icon_state = "ambrosiadeus" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1) - reagents.add_reagent("bicaridine", 3+round(potency / 5, 1)) - reagents.add_reagent("synaptizine", 3+round(potency / 5, 1)) - reagents.add_reagent("hyperzine", 3+round(potency / 8, 1)) - reagents.add_reagent("kelotane", 3+round(potency / 8, 1)) - reagents.add_reagent("toxin", 1+round(potency / 8, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/apple - seed = "/obj/item/seeds/appleseed" - name = "apple" - desc = "It's a little piece of Eden." - icon_state = "apple" - potency = 15 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon - seed = "/obj/item/seeds/watermelonseed" - name = "watermelon" - desc = "It's full of watery goodness." - icon_state = "watermelon" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 6), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin - seed = "/obj/item/seeds/pumpkinseed" - name = "pumpkin" - desc = "It's large and scary." - icon_state = "pumpkin" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 6), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/lime - seed = "/obj/item/seeds/limeseed" - name = "lime" - desc = "It's so sour, your face will twist." - icon_state = "lime" - potency = 20 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/lemon - seed = "/obj/item/seeds/lemonseed" - name = "lemon" - desc = "When life gives you lemons, be grateful they aren't limes." - icon_state = "lemon" - potency = 20 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/orange - seed = "/obj/item/seeds/orangeseed" - name = "orange" - desc = "It's an tangy fruit." - icon_state = "orange" - potency = 20 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet - seed = "/obj/item/seeds/whitebeetseed" - name = "white-beet" - desc = "You can't beat white-beet." - icon_state = "whitebeet" - potency = 15 - New() - ..() - reagents.add_reagent("nutriment", round((potency / 20), 1)) - reagents.add_reagent("sugar", 1+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/banana - seed = "/obj/item/seeds/bananaseed" - name = "banana" - desc = "It's an excellent prop for a clown." - icon = 'items.dmi' - icon_state = "banana" - item_state = "banana" - On_Consume() - if(!reagents.total_volume) - var/mob/M = usr - var/obj/item/weapon/bananapeel/W = new /obj/item/weapon/bananapeel( M ) - M << "You peel the banana." - M.put_in_hand(W) - W.add_fingerprint(M) - New() - ..() - reagents.add_reagent("banana", 1+round((potency / 10), 1)) - bitesize = 5 - src.pixel_x = rand(-5.0, 5) - src.pixel_y = rand(-5.0, 5) - -/obj/item/weapon/reagent_containers/food/snacks/grown/chili - seed = "/obj/item/seeds/chiliseed" - name = "chili" - desc = "It's spicy! Wait... IT'S BURNING ME!!" - icon_state = "chilipepper" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 25), 1)) - reagents.add_reagent("capsaicin", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/chili/attackby(var/obj/item/O as obj, var/mob/user as mob) - . = ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - user << "- Capsaicin: [reagents.get_reagent_amount("capsaicin")]%" - -/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant - seed = "/obj/item/seeds/eggplantseed" - name = "eggplant" - desc = "Maybe there's a chicken inside?" - icon_state = "eggplant" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans - seed = "/obj/item/seeds/soyaseed" - name = "soybeans" - desc = "It's pretty bland, but oh the possibilities..." - gender = PLURAL - icon_state = "soybeans" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/tomato - seed = "/obj/item/seeds/tomatoseed" - name = "tomato" - desc = "I say to-mah-to, you say tom-mae-to." - icon_state = "tomato" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - - throw_impact(atom/hit_atom) - ..() - new/obj/effect/decal/cleanable/tomato_smudge(src.loc) - src.visible_message("The [src.name] has been squashed.","You hear a smack.") - del(src) - return - -/obj/item/weapon/reagent_containers/food/snacks/grown/killertomato - seed = "/obj/item/seeds/killertomatoseed" - name = "killer-tomato" - desc = "I say to-mah-to, you say tom-mae-to... OH GOD IT'S EATING MY LEGS!!" - icon_state = "killertomato" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - if(istype(src.loc,/mob)) - pickup(src.loc) - lifespan = 120 - endurance = 30 - maturation = 15 - production = 1 - yield = 3 - potency = 30 - plant_type = 2 - -/obj/item/weapon/reagent_containers/food/snacks/grown/killertomato/attack_self(mob/user as mob) - if(istype(user.loc,/turf/space)) - return - new /obj/effect/critter/killertomato(user.loc) - - del(src) - - user << "You plant the killer-tomato." - -/obj/item/weapon/reagent_containers/food/snacks/grown/bloodtomato - seed = "/obj/item/seeds/bloodtomatoseed" - name = "blood-tomato" - desc = "So bloody...so...very...bloody....AHHHH!!!!" - icon_state = "bloodtomato" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 10), 1)) - reagents.add_reagent("blood", 1+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - - throw_impact(atom/hit_atom) - ..() - new/obj/effect/decal/cleanable/blood/splatter(src.loc) - src.visible_message("The [src.name] has been squashed.","You hear a smack.") - src.reagents.reaction(get_turf(hit_atom)) - for(var/atom/A in get_turf(hit_atom)) - src.reagents.reaction(A) - del(src) - return - -/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato - seed = "/obj/item/seeds/bluetomatoseed" - name = "blue-tomato" - desc = "I say blue-mah-to, you say blue-mae-to." - icon_state = "bluetomato" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - reagents.add_reagent("lube", 1+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - - throw_impact(atom/hit_atom) - ..() - new/obj/effect/decal/cleanable/oil(src.loc) - src.visible_message("The [src.name] has been squashed.","You hear a smack.") - src.reagents.reaction(get_turf(hit_atom)) - for(var/atom/A in get_turf(hit_atom)) - src.reagents.reaction(A) - del(src) - return - -/obj/item/weapon/reagent_containers/food/snacks/grown/wheat - seed = "/obj/item/seeds/wheatseed" - name = "wheat" - desc = "Sigh... wheat... a-grain?" - gender = PLURAL - icon_state = "wheat" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 25), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper - seed = "/obj/item/seeds/icepepperseed" - name = "ice-pepper" - desc = "It's a mutant strain of chili" - icon_state = "icepepper" - potency = 20 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) - reagents.add_reagent("frostoil", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper/attackby(var/obj/item/O as obj, var/mob/user as mob) - . = ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - user << "- Frostoil: [reagents.get_reagent_amount("frostoil")]%" - -/obj/item/weapon/reagent_containers/food/snacks/grown/carrot - seed = "/obj/item/seeds/carrotseed" - name = "carrot" - desc = "It's good for the eyes!" - icon_state = "carrot" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - reagents.add_reagent("imidazoline", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita - seed = "/obj/item/seeds/amanitamycelium" - name = "fly amanita" - desc = "Amanita Muscaria: Learn poisonous mushrooms by heart. Only pick mushrooms you know." - icon_state = "amanita" - potency = 10 - New() - ..() - reagents.add_reagent("nutriment", 1) - reagents.add_reagent("amatoxin", 3+round(potency / 3, 1)) - reagents.add_reagent("psilocybin", 1+round(potency / 25, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita/attackby(var/obj/item/O as obj, var/mob/user as mob) - . = ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - user << "- Amatoxins: [reagents.get_reagent_amount("amatoxin")]%" - user << "- Psilocybin: [reagents.get_reagent_amount("psilocybin")]%" - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel - seed = "/obj/item/seeds/angelmycelium" - name = "destroying angel" - desc = "Amanita Virosa: Deadly poisonous basidiomycete fungus filled with alpha amatoxins." - icon_state = "angel" - potency = 35 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) - reagents.add_reagent("amatoxin", 13+round(potency / 3, 1)) - reagents.add_reagent("psilocybin", 1+round(potency / 25, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel/attackby(var/obj/item/O as obj, var/mob/user as mob) - . = ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - user << "- Amatoxins: [reagents.get_reagent_amount("amatoxin")]%" - user << "- Psilocybin: [reagents.get_reagent_amount("psilocybin")]%" - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap - seed = "/obj/item/seeds/libertymycelium" - name = "liberty-cap" - desc = "Psilocybe Semilanceata: Liberate yourself!" - icon_state = "libertycap" - potency = 15 - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) - reagents.add_reagent("psilocybin", 3+round(potency / 5, 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap/attackby(var/obj/item/O as obj, var/mob/user as mob) - . = ..() - if (istype(O, /obj/item/device/analyzer/plant_analyzer)) - user << "- Psilocybin: [reagents.get_reagent_amount("psilocybin")]%" - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet - seed = "/obj/item/seeds/plumpmycelium" - name = "plump-helmet" - desc = "Plumus Hellmus: Plump, soft and s-so inviting~" - icon_state = "plumphelmet" - New() - ..() - reagents.add_reagent("nutriment", 2+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom - seed = "/obj/item/seeds/walkingmushroom" - name = "walking mushroom" - desc = "The beginging of the great walk." - icon_state = "walkingmushroom" - New() - ..() - reagents.add_reagent("nutriment", 2+round((potency / 10), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - if(istype(src.loc,/mob)) - pickup(src.loc) - lifespan = 120 - endurance = 30 - maturation = 15 - production = 1 - yield = 3 - potency = 30 - plant_type = 2 - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom/attack_self(mob/user as mob) - if(istype(user.loc,/turf/space)) - return - new /obj/effect/critter/walkingmushroom(user.loc) - - del(src) - - user << "You plant the walking mushroom." - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle - seed = "/obj/item/seeds/chantermycelium" - name = "chanterelle cluster" - desc = "Cantharellus Cibarius: These jolly yellow little shrooms sure look tasty!" - icon_state = "chanterelle" - New() - ..() - reagents.add_reagent("nutriment",1+round((potency / 25), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom - seed = "/obj/item/seeds/glowshroom" - name = "glowshroom cluster" - desc = "Glowshroom: This species of mushroom glows in the dark. Or does it?" - icon_state = "glowshroom" - New() - ..() - reagents.add_reagent("radium",1+round((potency / 20), 1)) - if(istype(src.loc,/mob)) - pickup(src.loc) - else - ul_SetLuminosity(potency/10) - lifespan = 120 //ten times that is the delay - endurance = 30 - maturation = 15 - production = 1 - yield = 3 - potency = 30 - plant_type = 2 - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user as mob) - if(istype(user.loc,/turf/space)) - return - var/obj/effect/glowshroom/planted = new /obj/effect/glowshroom(user.loc) - - planted.delay = lifespan * 50 - planted.endurance = endurance - planted.yield = yield - planted.potency = potency - - del(src) - - user << "You plant the glowshroom." - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Del() - if(istype(loc,/mob)) - loc.ul_SetLuminosity(loc.LuminosityRed - potency/10, loc.LuminosityGreen - potency/10, loc.LuminosityBlue - potency/10) - ..() - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user) - ul_SetLuminosity(0) - user.ul_SetLuminosity(user.LuminosityRed + potency/10, user.LuminosityGreen + potency/10, user.LuminosityBlue + potency/10) - -/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user) - user.ul_SetLuminosity(user.LuminosityRed - potency/10, user.LuminosityGreen - potency/10, user.LuminosityBlue - potency/10) - ul_SetLuminosity(potency/10) +// *****************oolokitthesefancystars******** +// Grown FOOD types moved to reagents +// ********************** // ********************** // Other harvested materials from plants (that are not food) @@ -1663,7 +1011,7 @@ /obj/item/weapon/grown // Grown weapons name = "grown_weapon" - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' var/seed = "" var/plantname = "" var/productname = "" @@ -1686,7 +1034,7 @@ /obj/item/weapon/grown/log name = "tower-cap log" desc = "It's better than bad, it's good!" - icon = 'harvest.dmi' + icon = 'icons/obj/harvest.dmi' icon_state = "logs" force = 5 flags = TABLEPASS @@ -1697,6 +1045,7 @@ plant_type = 2 origin_tech = "materials=1" seed = "/obj/item/seeds/towermycelium" + attack_verb = list("bashed", "battered", "bludgeoned", "whacked") attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/twohanded/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy)) @@ -1709,7 +1058,7 @@ /obj/item/weapon/grown/sunflower // FLOWER POWER! name = "sunflower" desc = "It's beautiful! A certain person might beat you to death if you trample these." - icon = 'harvest.dmi' + icon = 'icons/obj/harvest.dmi' icon_state = "sunflower" damtype = "fire" force = 0 @@ -1723,7 +1072,7 @@ /* /obj/item/weapon/grown/gibtomato desc = "A plump tomato." - icon = 'harvest.dmi' + icon = 'icons/obj/harvest.dmi' name = "Gib Tomato" icon_state = "gibtomato" damtype = "fire" @@ -1747,7 +1096,7 @@ */ /obj/item/weapon/grown/nettle // -- Skie desc = "It's probably not wise to touch it with bare hands..." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' name = "nettle" icon_state = "nettle" damtype = "fire" @@ -1762,13 +1111,14 @@ seed = "/obj/item/seeds/nettleseed" New() ..() - reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) - reagents.add_reagent("acid", round(potency, 1)) - force = round((5+potency/5), 1) + spawn(5) //So potency can be set in the proc that creates these crops + reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) + reagents.add_reagent("sacid", round(potency, 1)) + force = round((5+potency/5), 1) /obj/item/weapon/grown/deathnettle // -- Skie desc = "The \red glowing \black nettle incites \redrage\black in you just from looking at it!" - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' name = "deathnettle" icon_state = "deathnettle" damtype = "fire" @@ -1781,11 +1131,13 @@ plant_type = 1 seed = "/obj/item/seeds/deathnettleseed" origin_tech = "combat=3" + attack_verb = list("stung") New() ..() - reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) - reagents.add_reagent("pacid", round(potency, 1)) - force = round((5+potency/2.5), 1) + spawn(5) //So potency can be set in the proc that creates these crops + reagents.add_reagent("nutriment", 1+round((potency / 50), 1)) + reagents.add_reagent("pacid", round(potency, 1)) + force = round((5+potency/2.5), 1) // ************************************* // Pestkiller defines for hydroponics @@ -1793,7 +1145,7 @@ /obj/item/pestkiller name = "bottle of pestkiller" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle16" flags = FPRINT | TABLEPASS var/toxicity = 0 @@ -1804,7 +1156,7 @@ /obj/item/pestkiller/carbaryl name = "bottle of carbaryl" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle16" flags = FPRINT | TABLEPASS toxicity = 4 @@ -1815,7 +1167,7 @@ /obj/item/pestkiller/lindane name = "bottle of lindane" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle18" flags = FPRINT | TABLEPASS toxicity = 6 @@ -1826,7 +1178,7 @@ /obj/item/pestkiller/phosmet name = "bottle of phosmet" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle15" flags = FPRINT | TABLEPASS toxicity = 8 @@ -1839,24 +1191,9 @@ // Hydroponics Tools // ************************************* -/obj/item/weapon/plantbgone // -- Skie - desc = "Kill those pesky weeds!" - icon = 'hydroponics.dmi' - name = "bottle of Plant-B-Gone" - icon_state = "plantbgone" - item_state = "plantbgone" - flags = TABLEPASS | OPENCONTAINER | FPRINT | USEDELAY - slot_flags = SLOT_BELT - throwforce = 3 - w_class = 2.0 - throw_speed = 2 - throw_range = 10 - var/empty = 0 - - /obj/item/weapon/weedspray // -- Skie desc = "It's a toxic mixture, in spray form, to kill small weeds." - icon = 'hydroponics.dmi' + icon = 'icons/obj/hydroponics.dmi' name = "weed-spray" icon_state = "weedspray" item_state = "spray" @@ -1871,7 +1208,7 @@ /obj/item/weapon/pestspray // -- Skie desc = "It's some pest eliminator spray! Do not inhale!" - icon = 'hydroponics.dmi' + icon = 'icons/obj/hydroponics.dmi' name = "pest-spray" icon_state = "pestspray" item_state = "spray" @@ -1887,7 +1224,7 @@ /obj/item/weapon/minihoe // -- Numbers name = "mini hoe" desc = "It's used for removing weeds or scratching your back." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "hoe" item_state = "hoe" flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY @@ -1895,6 +1232,7 @@ throwforce = 7.0 w_class = 2.0 m_amt = 50 + attack_verb = list("slashed", "sliced", "cut", "clawed") // ************************************* // Weedkiller defines for hydroponics @@ -1902,7 +1240,7 @@ /obj/item/weedkiller name = "bottle of weedkiller" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle16" flags = FPRINT | TABLEPASS var/toxicity = 0 @@ -1910,7 +1248,7 @@ /obj/item/weedkiller/triclopyr name = "bottle of glyphosate" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle16" flags = FPRINT | TABLEPASS toxicity = 4 @@ -1918,7 +1256,7 @@ /obj/item/weedkiller/lindane name = "bottle of triclopyr" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle18" flags = FPRINT | TABLEPASS toxicity = 6 @@ -1926,7 +1264,7 @@ /obj/item/weedkiller/D24 name = "bottle of 2,4-D" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle15" flags = FPRINT | TABLEPASS toxicity = 8 @@ -1938,7 +1276,7 @@ /obj/item/nutrient name = "bottle of nutrient" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle16" flags = FPRINT | TABLEPASS w_class = 1.0 @@ -1950,7 +1288,7 @@ /obj/item/nutrient/ez name = "bottle of E-Z-Nutrient" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle16" flags = FPRINT | TABLEPASS mutmod = 1 @@ -1961,7 +1299,7 @@ /obj/item/nutrient/l4z name = "bottle of Left 4 Zed" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle18" flags = FPRINT | TABLEPASS mutmod = 2 @@ -1972,7 +1310,7 @@ /obj/item/nutrient/rh name = "bottle of Robust Harvest" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' icon_state = "bottle15" flags = FPRINT | TABLEPASS mutmod = 0 @@ -1981,98 +1319,3 @@ src.pixel_x = rand(-5.0, 5) src.pixel_y = rand(-5.0, 5) - -// ************************************* -// Complex Grown Object Defines - -// Putting these at the bottom so they don't clutter the list up. -Cheridan -// ************************************* - -//This object is just a transition object. All it does is make a grass tile and delete itself. -/obj/item/weapon/reagent_containers/food/snacks/grown/grass - seed = "/obj/item/seeds/grassseed" - name = "grass" - desc = "Green and lush." - icon_state = "spawner" - potency = 20 - New() - new/obj/item/stack/tile/grass(src.loc) - spawn(5) //Workaround to keep harvesting from working weirdly. - del(src) - -//This object is just a transition object. All it does is make dosh and delete itself. -Cheridan -/obj/item/weapon/reagent_containers/food/snacks/grown/money - seed = "/obj/item/seeds/cashseed" - name = "dosh" - desc = "Green and lush." - icon_state = "spawner" - potency = 10 - New() - switch(rand(1,100))//(potency) //It wants to use the default potency instead of the new, so it was always 10. Will try to come back to this later - Cheridan - if(0 to 10) - new/obj/item/weapon/money/(src.loc) - if(11 to 20) - new/obj/item/weapon/money/c10(src.loc) - if(21 to 30) - new/obj/item/weapon/money/c20(src.loc) - if(31 to 40) - new/obj/item/weapon/money/c50(src.loc) - if(41 to 50) - new/obj/item/weapon/money/c100(src.loc) - if(51 to 60) - new/obj/item/weapon/money/c200(src.loc) - if(61 to 80) - new/obj/item/weapon/money/c500(src.loc) - else - new/obj/item/weapon/money/c1000(src.loc) - spawn(5) //Workaround to keep harvesting from working weirdly. - del(src) - -/obj/item/weapon/reagent_containers/food/snacks/grown/bluespacetomato - seed = "/obj/item/seeds/bluespacetomatoseed" - name = "blue-space tomato" - desc = "So lubricated, you might slip through space-time." - icon_state = "bluespacetomato" - potency = 10 - origin_tech = "bluespace=3" - New() - ..() - reagents.add_reagent("nutriment", 1+round((potency / 20), 1)) - reagents.add_reagent("singulo", 1+round((potency / 5), 1)) - bitesize = 1+round(reagents.total_volume / 2, 1) - - throw_impact(atom/hit_atom) - ..() - var/mob/M = usr - var/outer_teleport_radius = potency/10 //Plant potency determines radius of teleport. - var/inner_teleport_radius = potency/15 - var/list/turfs = new/list() - for(var/turf/T in orange(M,outer_teleport_radius)) - if(T in orange(M,inner_teleport_radius)) continue - if(istype(T,/turf/space)) continue - if(T.density) continue - if(T.x>world.maxx-outer_teleport_radius || T.xworld.maxy-outer_teleport_radius || T.yThe [src.name] has been squashed, causing a distortion in space-time.","You hear a smack.") - del(src) - return \ No newline at end of file diff --git a/code/defines/obj/machinery.dm b/code/defines/obj/machinery.dm index b1ef297411..d98da74794 100644 --- a/code/defines/obj/machinery.dm +++ b/code/defines/obj/machinery.dm @@ -1,8 +1,8 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery name = "machinery" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' var/stat = 0 var/emagged = 0 var/use_power = 0 @@ -43,8 +43,8 @@ /obj/machinery/camera name = "security camera" - desc = "It's used to monitor rooms." - icon = 'monitors.dmi' + desc = "It's used to monitor rooms. It can see through walls." + icon = 'icons/obj/monitors.dmi' icon_state = "camera" var/network = "SS13" layer = 5 @@ -62,7 +62,7 @@ /obj/machinery/dispenser name = "tank storage unit" desc = "A simple yet bulky one-way storage device for gas tanks. Holds 10 plasma and 10 oxygen tanks." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "dispenser" density = 1 var/o2tanks = 10.0 @@ -75,7 +75,7 @@ /obj/machinery/dna_scanner name = "\improper DNA scanner/implanter" desc = "It scans DNA structures." - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "scanner_0" density = 1 var/locked = 0.0 @@ -88,7 +88,7 @@ /obj/machinery/dna_scannernew name = "\improper DNA modifier" desc = "It scans DNA structures." - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "scanner_0" density = 1 var/locked = 0.0 @@ -100,8 +100,8 @@ /obj/machinery/firealarm name = "fire alarm" - desc = "Pull this in case of emergency." - icon = 'monitors.dmi' + desc = "\"Pull this in case of emergency\". Thus, keep pulling it forever." + icon = 'icons/obj/monitors.dmi' icon_state = "fire0" var/detecting = 1.0 var/working = 1.0 @@ -113,19 +113,18 @@ idle_power_usage = 2 active_power_usage = 6 power_channel = ENVIRON - var/network New() if(z == 1) if(security_level) - src.overlays += image('monitors.dmi', "overlay_[get_security_level()]") + src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]") else - src.overlays += image('monitors.dmi', "overlay_green") + src.overlays += image('icons/obj/monitors.dmi', "overlay_green") /obj/machinery/partyalarm - name = "\improper Party Button" + name = "\improper PARTY BUTTON" desc = "Cuban Pete is in the house!" - icon = 'monitors.dmi' + icon = 'icons/obj/monitors.dmi' icon_state = "fire0" var/detecting = 1.0 var/working = 1.0 @@ -141,7 +140,7 @@ /obj/machinery/igniter name = "igniter" desc = "It's useful for igniting plasma." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "igniter1" var/id = null var/on = 1.0 @@ -153,7 +152,7 @@ /obj/machinery/injector name = "injector" desc = "It injects gas into a chamber." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "injector" density = 1 anchored = 1.0 @@ -163,24 +162,10 @@ active_power_usage = 4 layer = TURF_LAYER -/obj/machinery/mass_driver - name = "mass driver" - desc = "Shoots things into space." - icon = 'stationobjs.dmi' - icon_state = "mass_driver" - var/power = 1.0 - var/code = 1.0 - var/id = 1.0 - anchored = 1.0 - var/drive_range = 50 //this is mostly irrelevant since current mass drivers throw into space, but you could make a lower-range mass driver for interstation transport or something I guess. - use_power = 1 - idle_power_usage = 2 - active_power_usage = 50 - /obj/machinery/meter name = "meter" desc = "It measures something." - icon = 'meter.dmi' + icon = 'icons/obj/meter.dmi' icon_state = "meterX" var/obj/machinery/atmospherics/pipe/target = null anchored = 1.0 @@ -193,7 +178,7 @@ /obj/machinery/restruct name = "\improper DNA physical restructurization accelerator" desc = "It looks ridiculously complex." - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "restruct_0" density = 1 var/locked = 0.0 @@ -206,7 +191,7 @@ /obj/machinery/scan_console name = "\improper DNA Scanner Access Console" desc = "It scans DNA structures." - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "scanner" density = 1 var/obj/item/weapon/card/data/scan = null @@ -225,9 +210,41 @@ idle_power_usage = 10 active_power_usage = 400 +/obj/machinery/door_control + name = "remote door-control" + desc = "It controls doors, remotely." + icon = 'icons/obj/stationobjs.dmi' + icon_state = "doorctrl0" + desc = "A remote control-switch for a door." + var/id = null + var/range = 10 + var/normaldoorcontrol = 0 + var/desiredstate = 0 // Zero is closed, 1 is open. + var/specialfunctions = 1 + /* + Bitflag, 1= open + 2= idscan, + 4= bolts + 8= shock + 16= door safties + + */ + + var/exposedwires = 0 + var/wires = 3 + /* + Bitflag, 1=checkID + 2=Network Access + */ + + anchored = 1.0 + use_power = 1 + idle_power_usage = 2 + active_power_usage = 4 + /obj/machinery/driver_button name = "mass driver button" - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "launcherbtt" desc = "A remote control switch for a mass driver." var/id = null @@ -239,7 +256,7 @@ /obj/machinery/ignition_switch name = "ignition switch" - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "launcherbtt" desc = "A remote control switch for a mounted igniter." var/id = null @@ -252,7 +269,7 @@ /obj/machinery/flasher_button name = "flasher button" desc = "A remote control switch for a mounted flasher." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "launcherbtt" var/id = null var/active = 0 @@ -263,7 +280,7 @@ /obj/machinery/teleport name = "teleport" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' density = 1 anchored = 1.0 var/lockeddown = 0 @@ -279,7 +296,7 @@ /obj/machinery/teleport/station name = "station" - desc = "The station's hub of a teleport system." + desc = "It's the station thingy of a teleport thingy." //seriously, wtf. icon_state = "controller" var/active = 0 var/engaged = 0 @@ -289,77 +306,16 @@ /* /obj/machinery/wire name = "wire" - icon = 'power_cond_red.dmi' + icon = 'icons/obj/power_cond_red.dmi' use_power = 1 idle_power_usage = 0 active_power_usage = 1 */ -/obj/machinery/power - name = null - icon = 'power.dmi' - anchored = 1.0 - var/datum/powernet/powernet = null - var/netnum = 0 - var/directwired = 1 // by default, power machines are connected by a cable in a neighbouring turf - // if set to 0, requires a 0-X cable on this turf - use_power = 0 - idle_power_usage = 0 - active_power_usage = 0 - -/obj/machinery/power/terminal - name = "terminal" - icon_state = "term" - desc = "It's an underfloor wiring terminal for power equipment." - level = 1 - layer = TURF_LAYER - var/obj/machinery/power/master = null - anchored = 1 - directwired = 0 // must have a cable on same turf connecting to terminal - layer = 2.6 // a bit above wires - -/obj/machinery/power/generator - name = "thermoelectric generator mark I" - desc = "It's a high efficiency thermoelectric generator." - icon_state = "teg" - anchored = 1 - density = 1 - - var/obj/machinery/atmospherics/binary/circulator/circ1 - var/obj/machinery/atmospherics/binary/circulator/circ2 - - var/lastgen = 0 - var/lastgenlev = -1 - -/obj/machinery/power/generator_type2 - name = "thermoelectric generator mark II" - desc = "It's a high efficiency thermoelectric generator." - icon_state = "teg" - anchored = 1 - density = 1 - - var/obj/machinery/atmospherics/unary/generator_input/input1 - var/obj/machinery/atmospherics/unary/generator_input/input2 - - var/lastgen = 0 - var/lastgenlev = -1 - -/obj/machinery/power/monitor - name = "power monitoring computer" - desc = "It monitors power levels across the station, and can remotely toggle main breakers." - icon = 'computer.dmi' - icon_state = "power" - density = 1 - anchored = 1 - use_power = 2 - idle_power_usage = 20 - active_power_usage = 80 - var/control = 0 - req_access = list(ACCESS_ENGINE_EQUIP) /obj/machinery/light_switch name = "light switch" desc = "It turns lights on and off. What are you, simple?" - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "light1" anchored = 1.0 var/on = 1 @@ -370,10 +326,10 @@ /obj/machinery/crema_switch desc = "Burn baby burn!" name = "crematorium igniter" - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "crema_switch" anchored = 1.0 - req_access = list(ACCESS_CREMATORIUM) + req_access = list(access_crematorium) var/on = 0 var/area/area = null var/otherarea = null @@ -396,26 +352,16 @@ /obj/machinery/hologram/projector name = "hologram projector" desc = "It makes a hologram appear...with magnets or something..." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "hologram0" /obj/machinery/hologram/proj_ai name = "hologram projector platform" desc = "It's used by the AI for fooling around." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "hologram0" var/temp = null var/lumens = 0.0 var/h_r = 245.0 var/h_g = 245.0 var/h_b = 245.0 - -/obj/machinery/coatrack - name = "coat rack" - desc = "A fancy stand for the Detective's coat and hat." - icon_state = "coatrack0" - icon = 'coatrack.dmi' - density = 1 - anchored = 1.0 - var/obj/item/clothing/suit/storage/det_suit/coat - var/obj/item/clothing/head/det_hat/hat diff --git a/code/defines/obj/spawner.dm b/code/defines/obj/spawner.dm deleted file mode 100644 index d0ec0ef858..0000000000 --- a/code/defines/obj/spawner.dm +++ /dev/null @@ -1,3 +0,0 @@ -/obj/effect/spawner - name = "object spawner" - diff --git a/code/defines/obj/storage.dm b/code/defines/obj/storage.dm index ee4f024389..c52bd713cd 100644 --- a/code/defines/obj/storage.dm +++ b/code/defines/obj/storage.dm @@ -2,6 +2,7 @@ name = "backpack" desc = "You wear this on your back and put items into it." icon_state = "backpack" + item_state = "backpack" w_class = 4.0 flags = FPRINT|TABLEPASS slot_flags = SLOT_BACK //ERROOOOO @@ -34,7 +35,7 @@ name = "pill bottle" desc = "It's an airtight container for storing medication." icon_state = "pill_canister" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' item_state = "contsolid" w_class = 2.0 can_hold = list("/obj/item/weapon/reagent_containers/pill") @@ -44,7 +45,7 @@ name = "pack of dice" desc = "It's a small container with dice inside." icon_state = "pill_canister" - icon = 'chemical.dmi' + icon = 'icons/obj/chemical.dmi' item_state = "contsolid" w_class = 2.0 can_hold = list("/obj/item/weapon/dice") @@ -57,18 +58,8 @@ /obj/item/weapon/storage/box/engineer -/obj/item/weapon/storage/box/medic - name = "anesthetic box" - desc = "Full of masks and emergency anesthetic tanks." - /obj/item/weapon/storage/box/syndicate -/obj/item/weapon/storage/box/ert - name = "medical box" - desc = "Full of goodness." - icon_state = "implant" - item_state = "syringe_kit" - /obj/item/weapon/storage/cupbox name = "box of paper cups" desc = "It has pictures of paper cups on the front." @@ -103,31 +94,29 @@ name = "Giggles Von Honkerton" desc = "It's a backpack made by Honk! Co." icon_state = "clownpack" + item_state = "clownpack" /obj/item/weapon/storage/backpack/medic name = "medical backpack" desc = "It's a backpack especially designed for use in a sterile environment." icon_state = "medicalpack" - -/obj/item/weapon/storage/backpack/medic/full -//Spawns with 2 boxes of ERT gear, a box of ERT gear and a hypo, and a box of anesthetic. - New() - ..() - new /obj/item/weapon/reagent_containers/hypospray/ert(src) - for(var/i = 1, i <=2, i++) - new /obj/item/weapon/storage/box/ert(src) - new /obj/item/weapon/storage/box/medic(src) - new /obj/item/device/healthanalyzer(src) - return + item_state = "medicalpack" /obj/item/weapon/storage/backpack/security name = "security backpack" desc = "It's a very robust backpack." icon_state = "securitypack" + item_state = "securitypack" + +/obj/item/weapon/storage/backpack/captain + name = "captain's backpack" + desc = "It's a special backpack made exclusively for Nanotrasen officers." + icon_state = "captainpack" + item_state = "captainpack" /obj/item/weapon/storage/backpack/satchel - name = "satchel" - desc = "It's a very robust satchel to wear on your back." + name = "leather satchel" + desc = "It's a very fancy satchel made with fine leather." icon_state = "satchel" /obj/item/weapon/storage/backpack/satchel/withwallet @@ -146,11 +135,13 @@ name = "industrial satchel" desc = "A tough satchel with extra pockets." icon_state = "satchel-eng" + item_state = "engiepack" /obj/item/weapon/storage/backpack/satchel_med name = "medical satchel" desc = "A sterile satchel used in medical departments." icon_state = "satchel-med" + item_state = "medicalpack" /obj/item/weapon/storage/backpack/satchel_vir name = "virologist satchel" @@ -176,75 +167,29 @@ name = "security satchel" desc = "A robust satchel for security related needs." icon_state = "satchel-sec" + item_state = "securitypack" /obj/item/weapon/storage/backpack/satchel_hyd name = "hydroponics satchel" desc = "A green satchel for plant related work." icon_state = "satchel_hyd" - +/obj/item/weapon/storage/backpack/satchel_cap + name = "captain's satchel" + desc = "An exclusive satchel for Nanotrasen officers." + icon_state = "satchel-cap" + item_state = "captainpack" /obj/item/weapon/storage/backpack/bandolier name = "bandolier" desc = "It's a very old bandolier to wear on your back." icon_state = "bandolier" -/obj/item/weapon/storage/backpack/medicalsatchel - name = "medic's satchel" - desc = "Easy to access medical satchel for quick responses." - icon_state = "medicalsatchel" - /obj/item/weapon/storage/backpack/industrial name = "industrial backpack" desc = "It's a tough backpack for the daily grind of station life." icon_state = "engiepack" - -/obj/item/weapon/storage/backpack/industrial/full - name = "loaded industrial backpack" - desc = "A tough backpack for the daily grind, full of gear" - icon_state = "engiepack" - -//Spawns with 2 glass, 2 metal, 1 steel, and 2 special boxes. - New() - ..() - for(var/i = 1, i <=2, i++) - var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src) - G.amount = 50 - G.loc = src - for(var/i = 1, i <=2, i++) - var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src) - G.amount = 50 - G.loc = src - var/obj/item/stack/sheet/plasteel/R = new /obj/item/stack/sheet/plasteel(src) - R.amount = 50 - R.loc = src - var/obj/item/weapon/storage/box/B1 = new /obj/item/weapon/storage/box(src) - B1.name = "power and airlock circuit box" - B1.desc = "Bursting with repair gear" - B1.w_class = 2 - for(var/i = 1, i <= 7, i++) - if(i < 4) - var/obj/item/weapon/module/power_control/P = new /obj/item/weapon/module/power_control(B1) - P.loc = B1 - if(i >= 4) - var/obj/item/weapon/airlock_electronics/P = new /obj/item/weapon/airlock_electronics(B1) - P.loc = B1 - var/obj/item/weapon/storage/box/B2 = new /obj/item/weapon/storage/box(src) - B2.name = "power cells and wire box" - B2.desc = "Bursting with repair gear" - B2.w_class = 2 - var/color = pick("red","yellow","green","blue") - for(var/i = 1, i <= 7, i++) - if(i < 4) - var/obj/item/weapon/cable_coil/P = new /obj/item/weapon/cable_coil(B2,30,color) - P.loc = B2 - if(i >= 4) - var/obj/item/weapon/cell/P = new /obj/item/weapon/cell(B2) - P.maxcharge = 15000 - P.charge = 15000 - P.updateicon() - P.loc = B2 - return + item_state = "engiepack" /obj/item/weapon/storage/briefcase name = "briefcase" @@ -265,7 +210,7 @@ icon_state = "wallet" w_class = 2 can_hold = list( - "/obj/item/weapon/money", + "/obj/item/weapon/spacecash", "/obj/item/weapon/card", "/obj/item/clothing/mask/cigarette", "/obj/item/device/flashlight/pen", @@ -316,10 +261,10 @@ /obj/item/weapon/storage/wallet/random/New() ..() - var/item1_type = pick( /obj/item/weapon/money/c10,/obj/item/weapon/money/c100,/obj/item/weapon/money/c1000,/obj/item/weapon/money/c20,/obj/item/weapon/money/c200,/obj/item/weapon/money/c50, /obj/item/weapon/money/c500) + var/item1_type = pick( /obj/item/weapon/spacecash/c10,/obj/item/weapon/spacecash/c100,/obj/item/weapon/spacecash/c1000,/obj/item/weapon/spacecash/c20,/obj/item/weapon/spacecash/c200,/obj/item/weapon/spacecash/c50, /obj/item/weapon/spacecash/c500) var/item2_type if(prob(50)) - item2_type = pick( /obj/item/weapon/money/c10,/obj/item/weapon/money/c100,/obj/item/weapon/money/c1000,/obj/item/weapon/money/c20,/obj/item/weapon/money/c200,/obj/item/weapon/money/c50, /obj/item/weapon/money/c500) + item2_type = pick( /obj/item/weapon/spacecash/c10,/obj/item/weapon/spacecash/c100,/obj/item/weapon/spacecash/c1000,/obj/item/weapon/spacecash/c20,/obj/item/weapon/spacecash/c200,/obj/item/weapon/spacecash/c50, /obj/item/weapon/spacecash/c500) var/item3_type = pick( /obj/item/weapon/coin/silver, /obj/item/weapon/coin/silver, /obj/item/weapon/coin/gold, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron ) spawn(2) @@ -350,7 +295,7 @@ /obj/item/weapon/storage/firstaid name = "first-aid kit" - desc = "In case of injury." + desc = "It's an emergency medical kit for those serious boo-boos." icon_state = "firstaid" throw_speed = 2 throw_range = 8 @@ -358,7 +303,7 @@ /obj/item/weapon/storage/firstaid/fire name = "fire first-aid kit" - desc = "Contains burn treatments." + desc = "It's an emergency medical kit for when the toxins lab -spontaneously- burns down." icon_state = "ointment" item_state = "firstaid-ointment" @@ -368,31 +313,25 @@ /obj/item/weapon/storage/syringes name = "syringes" desc = "A box full of syringes." - desc = "A biohazard alert warning is printed on the box." + desc = "A biohazard alert warning is printed on the box" icon_state = "syringe" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap /obj/item/weapon/storage/firstaid/toxin name = "toxin first aid" - desc = "Contains anti-toxin medication." + desc = "Used to treat when you have a high amoutn of toxins in your body." icon_state = "antitoxin" item_state = "firstaid-toxin" /obj/item/weapon/storage/firstaid/o2 name = "oxygen deprivation first aid" - desc = "Contains oxygen deprivation medication." + desc = "A box full of oxygen goodies." icon_state = "o2" item_state = "firstaid-o2" -/obj/item/weapon/storage/firstaid/adv - name = "advanced first-aid kit" - desc = "Contains advanced medical treatments." - icon_state = "advfirstaid" - item_state = "firstaid-advanced" - /obj/item/weapon/storage/flashbang_kit name = "flashbangs (WARNING)" - desc = "" + desc = "WARNING: These devices are extremely dangerous and can cause blindness or deafness in repeated use." icon_state = "flashbang" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap @@ -406,7 +345,7 @@ /obj/item/weapon/storage/gl_kit name = "Prescription Glasses" - desc = "This box contains vison correcting glasses." + desc = "This box contains nerd glasses." icon_state = "glasses" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap @@ -414,7 +353,7 @@ /obj/item/weapon/storage/seccart_kit name = "Spare R.O.B.U.S.T. Cartridges" desc = "A box full of R.O.B.U.S.T. Cartridges, used by Security." - icon = 'pda.dmi' + icon = 'icons/obj/pda.dmi' icon_state = "pdabox" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap @@ -428,7 +367,7 @@ /obj/item/weapon/storage/id_kit name = "Spare IDs" - desc = "Has many empty IDs." + desc = "Has so many empty IDs." icon_state = "id" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap @@ -442,21 +381,21 @@ /obj/item/weapon/storage/injectbox name = "DNA-Injectors" - desc = "This box contains injectors." + desc = "This box contains injectors it seems." icon_state = "box" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap /obj/item/weapon/storage/stma_kit name = "Sterile Masks" - desc = "This box contains masks of +2 constitution." //I made it better. --SkyMarshal - icon_state = "mask" + desc = "This box contains masks of sterility." + icon_state = "sterile" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap /obj/item/weapon/storage/trackimp_kit name = "Tracking Implant Kit" - desc = "Box full of tracking implants." + desc = "Box full of scum-bag tracking utensils." icon_state = "implant" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap @@ -468,124 +407,59 @@ item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap -/obj/item/weapon/storage/deathalarm_kit - name = "Death Alarm Kit" - desc = "Box of stuff used to implant death alarms." - icon_state = "implant" - item_state = "syringe_kit" - - New() - ..() - new /obj/item/weapon/implanter(src) - new /obj/item/weapon/implantcase/death_alarm(src) - new /obj/item/weapon/implantcase/death_alarm(src) - new /obj/item/weapon/implantcase/death_alarm(src) - new /obj/item/weapon/implantcase/death_alarm(src) - new /obj/item/weapon/implantcase/death_alarm(src) - new /obj/item/weapon/implantcase/death_alarm(src) - /obj/item/weapon/storage/toolbox name = "toolbox" - desc = "Danger. Very heavy." - icon = 'storage.dmi' + desc = "Danger. Very robust." + icon = 'icons/obj/storage.dmi' icon_state = "red" item_state = "toolbox_red" flags = FPRINT | TABLEPASS| CONDUCT - force = 10.0 + force = 5.0 throwforce = 10.0 throw_speed = 1 throw_range = 7 w_class = 4.0 origin_tech = "combat=1" - - var/selfdamage = 0 - -/obj/item/weapon/storage/toolbox/afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if(contents.len && istype(user.loc, /turf) && prob(10)) - // have a chance to swing open - user.visible_message("\red \The [src] swings wide open and its contents are scattered on the floor!") - for(var/obj/O in contents) - O.loc = user.loc - O.layer = OBJ_LAYER - if(prob(50)) step_rand(O) - ..() + attack_verb = list("robusted") /obj/item/weapon/storage/toolbox/emergency name = "emergency toolbox" - desc = "A toolbox for emergencies" icon_state = "red" item_state = "toolbox_red" /obj/item/weapon/storage/toolbox/mechanical name = "mechanical toolbox" - desc = "A toolbox for holding tools about machinery." icon_state = "blue" item_state = "toolbox_blue" /obj/item/weapon/storage/toolbox/electrical name = "electrical toolbox" - desc = "A toolbox for holding tools about electronics." icon_state = "yellow" item_state = "toolbox_yellow" -/obj/item/weapon/storage/PCMBox - name = "spare power control modules" - desc = "A box of spare power control module circuit boards." - icon = 'storage.dmi' - icon_state = "circuit" - item_state = "syringe_kit" - -/obj/item/weapon/storage/AirlockBox - name = "spare airlock electronics" - desc = "A box of spare airlock circuit boards." - icon = 'storage.dmi' - icon_state = "circuit" - item_state = "syringe_kit" - /obj/item/weapon/storage/toolbox/syndicate - name = "red and black toolbox" - desc = "An oddly coloured toolbox." + name = "suspicious looking toolbox" icon_state = "syndicate" item_state = "toolbox_syndi" origin_tech = "combat=1;syndicate=1" - force = 14.0 - -/obj/item/weapon/storage/book - name = "book" - icon = 'library.dmi' - icon_state ="book" - throw_speed = 1 - throw_range = 5 - w_class = 2.0 - max_w_class = 1 - max_combined_w_class = 3 - storage_slots = 3 - flags = FPRINT | TABLEPASS + force = 7.0 /obj/item/weapon/storage/bible name = "bible" - desc = "Holds the word of religion." + desc = "Apply to head repeatedly." icon_state ="bible" throw_speed = 1 throw_range = 5 - w_class = 2.0 - max_w_class = 1 - max_combined_w_class = 7 - storage_slots = 7 + w_class = 3.0 flags = FPRINT | TABLEPASS var/mob/affecting = null var/deity_name = "Christ" /obj/item/weapon/storage/bible/booze name = "bible" - desc = "Holds the word of religion." + desc = "To be applied to the head repeatedly." icon_state ="bible" -/obj/item/weapon/storage/bible/tajaran - name = "The Holy Book of S'rendarr" - desc = "Holds the word of religion." - icon_state ="koran" - /obj/item/weapon/storage/mousetraps name = "box of Pest-B-Gon Mousetraps" desc = "WARNING:
Keep out of reach of children." @@ -690,7 +564,7 @@ /obj/item/stack/sheet/plasma, /obj/item/stack/sheet/uranium, /obj/item/stack/sheet/diamond, -// /obj/item/stack/sheet/clown, + /obj/item/stack/sheet/clown, /obj/item/stack/sheet/plasteel, /obj/item/stack/rods @@ -704,3 +578,23 @@ R.amount = R.max_amount return + + +/obj/item/weapon/storage/satchel + name = "Mining Satchel" + desc = "This little bugger can be used to store and transport ores." + icon = 'icons/obj/mining.dmi' + icon_state = "satchel" + slot_flags = SLOT_BELT | SLOT_POCKET + w_class = 3 + storage_slots = 50 + max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class + use_to_pickup = 1 + max_w_class = 3 + display_contents_with_number = 1 + allow_quick_empty = 1 + allow_quick_gather = 1 + + can_hold = list( + "/obj/item/weapon/ore" + ) \ No newline at end of file diff --git a/code/defines/obj/supplypacks.dm b/code/defines/obj/supplypacks.dm index 00781ec923..9d2fb25d00 100755 --- a/code/defines/obj/supplypacks.dm +++ b/code/defines/obj/supplypacks.dm @@ -3,6 +3,8 @@ //NOTE: hidden packs only show up when the computer has been hacked. //ANOTER NOTE: Contraband is obtainable through modified supplycomp circuitboards. //BIG NOTE: Don't add living things to crates, that's bad, it will break the shuttle. +//NEW NOTE: Do NOT set the price of any crates below 7 points. Doing so allows infinite points. + /datum/supply_packs/specialops name = "Special Ops supplies" contains = list("/obj/item/weapon/storage/emp_kit", @@ -10,195 +12,12 @@ "/obj/item/weapon/smokebomb", "/obj/item/weapon/smokebomb", "/obj/item/weapon/pen/paralysis", - "/obj/item/weapon/chem_grenade/incendiary") + "/obj/item/weapon/grenade/chem_grenade/incendiary") cost = 20 containertype = "/obj/structure/closet/crate" containername = "Special Ops crate" hidden = 1 -/datum/supply_packs/boxes - name = "Empty Box supplies" - contains = list("/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box", - "/obj/item/weapon/storage/box",) - cost = 5 - containertype = "/obj/structure/closet/crate" - containername = "Empty Box crate" - -/datum/supply_packs/pcm - name = "APC and Airlock Electronics crate" - contains = list("/obj/item/weapon/storage/PCMBox", - "/obj/item/weapon/storage/AirlockBox") - cost = 25 - containertype = "/obj/structure/closet/crate" - containername = "Power Control Module crate" - group = "Engineering" - -/datum/supply_packs/body_bags - name = "Body Bag supplies" - contains = list( - "/obj/item/weapon/bodybag", - "/obj/item/weapon/bodybag", - "/obj/item/weapon/bodybag", - "/obj/item/weapon/bodybag", - ) - cost = 10 - containertype = "/obj/structure/closet/crate" - containername = "Body Bag crate" - -/datum/supply_packs/stationary - name = "Stationary supplies" - contains = list("/obj/item/device/taperecorder", - "/obj/item/weapon/packageWrap", - "/obj/item/weapon/clipboard", - "/obj/item/weapon/clipboard", - "/obj/item/weapon/hand_labeler", - "/obj/item/weapon/paper_bin", - "/obj/item/weapon/pen", - "/obj/item/weapon/pen", - "/obj/item/weapon/pen", - "/obj/item/weapon/stamp", - "/obj/item/weapon/stamp/denied", - "/obj/item/weapon/storage/diskbox", - "/obj/item/weapon/storage/recordsbox", - ) - cost = 5 - containertype = "/obj/structure/closet/crate" - containername = "Stationary crate" - -/datum/supply_packs/artscrafts - name = "Arts and Crafts supplies" - contains = list("/obj/item/weapon/storage/crayonbox", - "/obj/item/weapon/camera_test", - "/obj/item/weapon/camera_film", - "/obj/item/weapon/camera_film", - "/obj/item/weapon/storage/photo_album", - "/obj/item/weapon/packageWrap", - "/obj/item/weapon/reagent_containers/glass/paint/red", - "/obj/item/weapon/reagent_containers/glass/paint/green", - "/obj/item/weapon/reagent_containers/glass/paint/blue", - "/obj/item/weapon/reagent_containers/glass/paint/yellow", - "/obj/item/weapon/reagent_containers/glass/paint/violet", - "/obj/item/weapon/reagent_containers/glass/paint/black", - "/obj/item/weapon/reagent_containers/glass/paint/white", - "/obj/item/weapon/reagent_containers/glass/paint/remover", - "/obj/item/weapon/wrapping_paper", - "/obj/item/weapon/wrapping_paper", - "/obj/item/weapon/wrapping_paper") - cost = 5 - containertype = "/obj/structure/closet/crate" - containername = "Arts and Crafts crate" - -/datum/supply_packs/empty - name = "Empty crate" - contains = list() - cost = 5 - containertype = "/obj/structure/closet/crate" - containername = "crate" - -/datum/supply_packs/charge - cost = 10 - containertype = "/obj/structure/closet/crate" - group = "Charges" - -/datum/supply_packs/charge/medical - name = "Medical Charge" - contains = list("/obj/item/weapon/vending_charge/medical") - containername = "Medical charge crate" - -/datum/supply_packs/charge/chemistry - name = "Chemistry Charge" - contains = list("/obj/item/weapon/vending_charge/chemistry") - containername = "Chemistry charge crate" - -/datum/supply_packs/charge/toxins - name = "Toxins Research Charge" - contains = list("/obj/item/weapon/vending_charge/toxins") - containername = "Toxins Research charge crate" - -/* removed these for now, as to not confuse people (the machines are in the tg map) -/datum/supply_packs/charge/genetics - name = "Genetics Research Charge" - contains = list("/obj/item/weapon/vending_charge/genetics") - containername = "Genetics charge crate" - -/datum/supply_packs/charge/robotics - name = "Robotics Charge" - contains = list("/obj/item/weapon/vending_charge/robotics") - containername = "Robotics charge crate" -*/ - -/datum/supply_packs/charge/bar - name = "Bar Charge" - contains = list("/obj/item/weapon/vending_charge/bar") - containername = "Bar charge crate" - -/datum/supply_packs/charge/kitchen - name = "Kitchen Charge" - contains = list("/obj/item/weapon/vending_charge/kitchen") - containername = "Kitchen charge crate" - -/datum/supply_packs/charge/engineering - name = "Engineering Charge" - contains = list("/obj/item/weapon/vending_charge/engineering") - containername = "Engineering charge crate" - -/datum/supply_packs/charge/security - name = "Security Charge" - contains = list("/obj/item/weapon/vending_charge/security") - containername = "Security charge crate" - -/datum/supply_packs/charge/coffee - name = "Coffee Charge" - contains = list("/obj/item/weapon/vending_charge/coffee") - containername = "Coffee charge crate" - -/datum/supply_packs/charge/snack - name = "Snack Charge" - contains = list("/obj/item/weapon/vending_charge/snack") - containername = "Snack charge crate" - -/datum/supply_packs/charge/liquidfood - name = "\"LiquidFood\" Charge" - contains = list("/obj/item/weapon/vending_charge/liquid") - containername = "LiquidFood charge crate" - -/* -/datum/supply_packs/charge/cart - name = "PDA Cart Charge" - contains = list("/obj/item/weapon/vending_charge/cart") - containername = "PDA Cart charge crate" -*/ - -/datum/supply_packs/charge/cigarette - name = "Cigarette Charge" - contains = list("/obj/item/weapon/vending_charge/cigarette") - containername = "Cigarette charge crate" - -/datum/supply_packs/charge/soda - name = "Soda Charge" - contains = list("/obj/item/weapon/vending_charge/soda") - containername = "Soda machine charge crate" - -/datum/supply_packs/charge/hydroponics - name = "Hydroponics Charge" - contains = list("/obj/item/weapon/vending_charge/hydroponics") - containername = "Hydroponics charge crate" - -/* Wrong toxins charge! -/datum/supply_packs/charge/tl - name = "Toxins Lab Charge" - contains = list("/obj/item/weapon/vending_charge/toxinslab") - containername = "Toxins Lab charge crate" -*/ - /datum/supply_packs/food name = "Food crate" contains = list("/obj/item/weapon/reagent_containers/food/snacks/flour", @@ -208,35 +27,22 @@ "/obj/item/weapon/reagent_containers/food/snacks/flour", "/obj/item/weapon/reagent_containers/food/drinks/milk", "/obj/item/weapon/reagent_containers/food/drinks/milk", - "/obj/item/kitchen/egg_box", + "/obj/item/weapon/storage/fancy/egg_box", "/obj/item/weapon/reagent_containers/food/condiment/enzyme", "/obj/item/weapon/reagent_containers/food/snacks/grown/banana", "/obj/item/weapon/reagent_containers/food/snacks/grown/banana", "/obj/item/weapon/reagent_containers/food/snacks/grown/banana") - cost = 5 + cost = 10 containertype = "/obj/structure/closet/crate/freezer" containername = "Food crate" - group = "Kitchen / Bar" /datum/supply_packs/monkey name = "Monkey crate" - contains = list ("/obj/item/weapon/monkeycube_box") + contains = list ("/obj/item/weapon/storage/monkeycube_box") cost = 20 containertype = "/obj/structure/closet/crate/freezer" containername = "Monkey crate" - group = "Medical / Science" -/* -/datum/supply_packs/shotgun - name = "Shotgun crate" - contains = list("/obj/item/weapon/gun/projectile/shotgun", - "/obj/item/ammo_casing/shotgun/beanbag", - "/obj/item/ammo_casing/shotgun/beanbag") - cost = 25 - containertype = "/obj/structure/closet/crate" - containername = "Shotgun crate" -//APPARENTLY OP? -*/ /datum/supply_packs/beanbagammo name = "Beanbag shells" @@ -253,7 +59,18 @@ cost = 10 containertype = "/obj/structure/closet/crate" containername = "Beanbag shells" - group = "Security" + +/datum/supply_packs/toner + name = "Toner Cartridges" + contains = list("/obj/item/device/toner", + "/obj/item/device/toner", + "/obj/item/device/toner", + "/obj/item/device/toner", + "/obj/item/device/toner", + "/obj/item/device/toner") + cost = 10 + containertype = "/obj/structure/closet/crate" + containername = "Toner Cartridges" /datum/supply_packs/party name = "Party equipment" @@ -270,52 +87,36 @@ cost = 20 containertype = "/obj/structure/closet/crate" containername = "Party equipment" - group = "Kitchen / Bar" /datum/supply_packs/internals name = "Internals crate" - contains = list("/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/weapon/tank/air", - "/obj/item/weapon/tank/air", + contains = list("/obj/item/clothing/mask/gas", + "/obj/item/clothing/mask/gas", + "/obj/item/clothing/mask/gas", "/obj/item/weapon/tank/air", "/obj/item/weapon/tank/air", "/obj/item/weapon/tank/air") - cost = 30 + cost = 10 containertype = "/obj/structure/closet/crate/internals" containername = "Internals crate" -/datum/supply_packs/emergency_internals - name = "Emergency Internals crate" - contains = list("/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/clothing/mask/breath", - "/obj/item/weapon/tank/emergency_oxygen", - "/obj/item/weapon/tank/emergency_oxygen", - "/obj/item/weapon/tank/emergency_oxygen", - "/obj/item/weapon/tank/emergency_oxygen", - "/obj/item/weapon/tank/emergency_oxygen") - cost = 10 - containertype = "/obj/structure/closet/crate/internals" - containername = "Emergency Internals crate" - /datum/supply_packs/evacuation name = "Emergency equipment" - contains = list("/obj/item/weapon/tank/emergency_oxygen", - "/obj/item/weapon/tank/emergency_oxygen", + contains = list("/obj/machinery/bot/floorbot", + "/obj/machinery/bot/floorbot", + "/obj/machinery/bot/medbot", + "/obj/machinery/bot/medbot", + "/obj/item/weapon/tank/air", + "/obj/item/weapon/tank/air", + "/obj/item/weapon/tank/air", + "/obj/item/weapon/tank/air", + "/obj/item/weapon/tank/air", "/obj/item/clothing/mask/gas", "/obj/item/clothing/mask/gas", - "/obj/item/weapon/storage/toolbox/emergency", - "/obj/item/weapon/storage/toolbox/emergency", - "/obj/item/weapon/storage/toolbox/emergency", - "/obj/item/weapon/chem_grenade/metalfoam", - "/obj/item/weapon/chem_grenade/metalfoam") - cost = 15 + "/obj/item/clothing/mask/gas", + "/obj/item/clothing/mask/gas", + "/obj/item/clothing/mask/gas") + cost = 35 containertype = "/obj/structure/closet/crate/internals" containername = "Emergency Crate" @@ -329,9 +130,9 @@ "/obj/item/weapon/caution", "/obj/item/weapon/caution", "/obj/item/weapon/cleaner", - "/obj/item/weapon/chem_grenade/cleaner", - "/obj/item/weapon/chem_grenade/cleaner", - "/obj/item/weapon/chem_grenade/cleaner", + "/obj/item/weapon/grenade/chem_grenade/cleaner", + "/obj/item/weapon/grenade/chem_grenade/cleaner", + "/obj/item/weapon/grenade/chem_grenade/cleaner", "/obj/structure/mopbucket") cost = 10 containertype = "/obj/structure/closet/crate" @@ -342,7 +143,7 @@ contains = list("/obj/item/weapon/storage/lightbox/mixed", "/obj/item/weapon/storage/lightbox/mixed", "/obj/item/weapon/storage/lightbox/mixed") - cost = 5 + cost = 10 containertype = "/obj/structure/closet/crate" containername = "Replacement lights" @@ -363,8 +164,7 @@ cost = 10 containertype = "/obj/structure/closet/crate/secure" containername = "Standard Costumes" - access = ACCESS_THEATRE - group = "Clothing" + access = access_theatre /datum/supply_packs/wizard name = "Wizard costume" @@ -375,13 +175,12 @@ cost = 20 containertype = "/obj/structure/closet/crate" containername = "Wizard costume crate" - group = "Clothing" /datum/supply_packs/mule name = "MULEbot Crate" contains = list("/obj/machinery/bot/mulebot") cost = 20 - containertype = "/obj/structure/closet/crate" + containertype = "/obj/structure/largecrate/mule" containername = "MULEbot Crate" /datum/supply_packs/hydroponics // -- Skie @@ -394,12 +193,11 @@ "/obj/item/weapon/minihoe", "/obj/item/device/analyzer/plant_analyzer", "/obj/item/clothing/gloves/botanic_leather", - "/obj/item/clothing/suit/storage/apron") // Updated with new things + "/obj/item/clothing/suit/apron") // Updated with new things cost = 10 - containertype = /obj/structure/closet/crate/hydroponics + containertype = "/obj/structure/closet/crate/hydroponics" containername = "Hydroponics crate" - access = ACCESS_HYDROPONICS - group = "Hydroponics" + access = access_hydroponics /datum/supply_packs/seeds name = "Seeds Crate" @@ -416,10 +214,10 @@ "/obj/item/seeds/potatoseed", "/obj/item/seeds/sugarcaneseed") cost = 10 - containertype = /obj/structure/closet/crate/hydroponics + containertype = "/obj/structure/closet/crate/hydroponics" containername = "Seeds crate" - access = ACCESS_HYDROPONICS - group = "Hydroponics" + access = access_hydroponics + /datum/supply_packs/exoticseeds name = "Exotic Seeds Crate" @@ -430,13 +228,13 @@ "/obj/item/seeds/plumpmycelium", "/obj/item/seeds/libertymycelium", "/obj/item/seeds/amanitamycelium", + "/obj/item/seeds/reishimycelium", "/obj/item/seeds/bananaseed", "/obj/item/seeds/eggyseed") cost = 15 - containertype = /obj/structure/closet/crate/hydroponics + containertype = "/obj/structure/closet/crate/hydroponics" containername = "Exotic Seeds crate" - access = ACCESS_HYDROPONICS - group = "Hydroponics" + access = access_hydroponics /datum/supply_packs/medical name = "Medical crate" @@ -444,18 +242,15 @@ "/obj/item/weapon/storage/firstaid/fire", "/obj/item/weapon/storage/firstaid/toxin", "/obj/item/weapon/storage/firstaid/o2", - "/obj/item/weapon/storage/firstaid/adv", "/obj/item/weapon/reagent_containers/glass/bottle/antitoxin", "/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline", "/obj/item/weapon/reagent_containers/glass/bottle/stoxin", - "/obj/item/weapon/storage/syringes", - "/obj/item/weapon/reagent_containers/glass/large") - cost = 20 + "/obj/item/weapon/storage/syringes") + cost = 10 containertype = "/obj/structure/closet/crate/medical" containername = "Medical crate" - group = "Medical / Science" -/* yay for new virus system + /datum/supply_packs/virus name = "Virus crate" contains = list("/obj/item/weapon/reagent_containers/glass/bottle/flu_virion", @@ -471,9 +266,7 @@ cost = 20 containertype = "/obj/structure/closet/crate/secure/weapon" containername = "Virus crate" - access = ACCESS_CMO - group = "Medical / Science" -*/ + access = access_cmo /datum/supply_packs/metal50 name = "50 Metal Sheets" @@ -482,7 +275,6 @@ cost = 10 containertype = "/obj/structure/closet/crate" containername = "Metal sheets crate" - group = "Engineering" /datum/supply_packs/glass50 name = "50 Glass Sheets" @@ -491,7 +283,6 @@ cost = 10 containertype = "/obj/structure/closet/crate" containername = "Glass sheets crate" - group = "Engineering" /datum/supply_packs/electrical name = "Electrical maintenance crate" @@ -503,91 +294,58 @@ "/obj/item/weapon/cell", "/obj/item/weapon/cell/high", "/obj/item/weapon/cell/high") - cost = 20 - containertype = "/obj/structure/closet/crate/secure" + cost = 15 + containertype = "/obj/structure/closet/crate" containername = "Electrical maintenance crate" - access = ACCESS_ENGINE - group = "Engineering" /datum/supply_packs/mechanical name = "Mechanical maintenance crate" contains = list("/obj/item/weapon/storage/belt/utility/full", "/obj/item/weapon/storage/belt/utility/full", - "/obj/item/clothing/head/helmet/welding", - "/obj/item/clothing/head/helmet/welding", - "/obj/item/weapon/storage/toolbox/mechanical", - "/obj/item/weapon/storage/toolbox/mechanical") - cost = 15 - containertype = "/obj/structure/closet/crate/secure" - containername = "Mechanical maintenance crate" - access = ACCESS_ENGINE - group = "Engineering" - -//"/obj/item/tape/engineering" - -/datum/supply_packs/safety_gear - name = "Safety gear crate" - contains = list("/obj/item/clothing/gloves/fingerless/black", - "/obj/item/clothing/gloves/fingerless/black", - "/obj/item/device/flashlight", - "/obj/item/device/flashlight", + "/obj/item/weapon/storage/belt/utility/full", "/obj/item/clothing/suit/hazardvest", "/obj/item/clothing/suit/hazardvest", - "/obj/item/clothing/head/helmet/hardhat", - "/obj/item/clothing/head/helmet/hardhat") + "/obj/item/clothing/suit/hazardvest", + "/obj/item/clothing/head/welding", + "/obj/item/clothing/head/welding", + "/obj/item/clothing/head/hardhat") cost = 10 - containertype = "/obj/structure/closet/crate/secure" - containername = "Safety gear crate" - group = "Engineering" - -/datum/supply_packs/firefighting - name = "Firefighting equipment crate" - contains = list("/obj/item/clothing/mask/gas", - "/obj/item/clothing/mask/gas", - "/obj/item/clothing/head/helmet/space/fire_helmet", - "/obj/item/clothing/head/helmet/space/fire_helmet", - "/obj/item/clothing/suit/fire/heavy", - "/obj/item/clothing/suit/fire/heavy", - "/obj/item/weapon/extinguisher", - "/obj/item/weapon/extinguisher") - cost = 20 containertype = "/obj/structure/closet/crate" - containername = "Firefighting equipment crate" - group = "Engineering" - access = ACCESS_ATMOSPHERICS + containername = "Mechanical maintenance crate" -/datum/supply_packs/waterfueltank - name = "Water/Fuel tank crate" - contains = list("/obj/structure/reagent_dispensers/watertank", - "/obj/structure/reagent_dispensers/fueltank") - cost = 15 - containertype = "/obj/structure/closet/crate" - containername = "Water/Fuel tank crate" +/datum/supply_packs/watertank + name = "Water tank crate" + contains = list("/obj/structure/reagent_dispensers/watertank") + cost = 8 + containertype = "/obj/structure/largecrate" + containername = "water tank crate" + +/datum/supply_packs/fueltank + name = "Fuel tank crate" + contains = list("/obj/structure/reagent_dispensers/fueltank") + cost = 8 + containertype = "/obj/structure/largecrate" + containername = "fuel tank crate" /datum/supply_packs/engine name = "Emitter crate" contains = list("/obj/machinery/emitter", "/obj/machinery/emitter",) - cost = 15 + cost = 10 containertype = "/obj/structure/closet/crate/secure" containername = "Emitter crate" - access = ACCESS_HEADS - group = "Engineering" + access = access_heads /datum/supply_packs/engine/field_gen name = "Field Generator crate" contains = list("/obj/machinery/field_generator", "/obj/machinery/field_generator",) containername = "Field Generator crate" - cost = 15 - group = "Engineering" /datum/supply_packs/engine/sing_gen name = "Singularity Generator crate" contains = list("/obj/machinery/the_singularitygen") containername = "Singularity Generator crate" - cost = 15 - group = "Engineering" /datum/supply_packs/engine/collector name = "Collector crate" @@ -595,8 +353,6 @@ "/obj/machinery/power/rad_collector", "/obj/machinery/power/rad_collector") containername = "Collector crate" - cost = 15 - group = "Engineering" /datum/supply_packs/engine/PA name = "Particle Accelerator crate" @@ -609,7 +365,6 @@ "/obj/structure/particle_accelerator/power_box", "/obj/structure/particle_accelerator/end_cap") containername = "Particle Accelerator crate" - group = "Engineering" /datum/supply_packs/mecha_ripley name = "Circuit Crate (\"Ripley\" APLU)" @@ -619,49 +374,17 @@ cost = 30 containertype = "/obj/structure/closet/crate/secure" containername = "APLU \"Ripley\" Circuit Crate" - access = ACCESS_ROBOTICS - group = "Robotics" - -/datum/supply_packs/surgery - name = "Surgery crate" - contains = list("/obj/item/weapon/cautery", - "/obj/item/weapon/surgicaldrill", - "/obj/item/clothing/mask/breath/medical", - "/obj/item/weapon/tank/anesthetic", - "/obj/item/weapon/hemostat", - "/obj/item/weapon/scalpel", - "/obj/item/weapon/surgical_tool/bonegel", - "/obj/item/weapon/retractor", - "/obj/item/weapon/surgical_tool/bonesetter", - "/obj/item/weapon/circular_saw") - cost = 25 - containertype = "/obj/structure/closet/crate/secure" - containername = "Surgery crate" - access = ACCESS_MEDICAL - group = "Medical / Science" - -/datum/supply_packs/sterile - name = "Sterile equipment crate" - contains = list("/obj/item/clothing/under/rank/medical/green", - "/obj/item/clothing/under/rank/medical/green", - "/obj/item/weapon/storage/stma_kit", - "/obj/item/weapon/storage/lglo_kit") - cost = 10 - containertype = "/obj/structure/closet/crate" - containername = "Sterile equipment crate" - group = "Medical / Science" + access = access_robotics /datum/supply_packs/mecha_odysseus name = "Circuit Crate (\"Odysseus\")" - contains = list( - "/obj/item/weapon/circuitboard/mecha/odysseus/peripherals", //TEMPORARY due to lack of circuitboard printer - "/obj/item/weapon/circuitboard/mecha/odysseus/main" //TEMPORARY due to lack of circuitboard printer - ) + contains = list("/obj/item/weapon/circuitboard/mecha/odysseus/peripherals", //TEMPORARY due to lack of circuitboard printer + "/obj/item/weapon/circuitboard/mecha/odysseus/main") //TEMPORARY due to lack of circuitboard printer cost = 25 containertype = "/obj/structure/closet/crate/secure" containername = "\"Odysseus\" Circuit Crate" - access = ACCESS_ROBOTICS - group = "Robotics" + access = access_robotics + /datum/supply_packs/robotics name = "Robotics Assembly Crate" @@ -678,8 +401,7 @@ cost = 10 containertype = "/obj/structure/closet/crate/secure/gear" containername = "Robotics Assembly" - access = ACCESS_ROBOTICS - group = "Robotics" + access = access_robotics /datum/supply_packs/plasma name = "Plasma assembly crate" @@ -698,8 +420,7 @@ cost = 10 containertype = "/obj/structure/closet/crate/secure/plasma" containername = "Plasma assembly crate" - access = ACCESS_TOX - group = "Medical / Science" + access = access_tox /datum/supply_packs/weapons name = "Weapons crate" @@ -714,8 +435,7 @@ cost = 30 containertype = "/obj/structure/closet/crate/secure/weapon" containername = "Weapons crate" - access = ACCESS_SECURITY - group = "Security" + access = access_security /datum/supply_packs/eweapons name = "Experimental weapons crate" @@ -723,14 +443,13 @@ "/obj/item/weapon/tank/plasma", "/obj/item/weapon/tank/plasma", "/obj/item/weapon/tank/plasma", - "/obj/item/weapon/chem_grenade/incendiary", - "/obj/item/weapon/chem_grenade/incendiary", - "/obj/item/weapon/chem_grenade/incendiary") + "/obj/item/weapon/grenade/chem_grenade/incendiary", + "/obj/item/weapon/grenade/chem_grenade/incendiary", + "/obj/item/weapon/grenade/chem_grenade/incendiary") cost = 25 containertype = "/obj/structure/closet/crate/secure/weapon" containername = "Experimental weapons crate" - access = ACCESS_HEADS - group = "Security" + access = access_heads /datum/supply_packs/armor name = "Armor crate" @@ -741,8 +460,7 @@ cost = 15 containertype = "/obj/structure/closet/crate/secure" containername = "Armor crate" - access = ACCESS_SECURITY - group = "Security" + access = access_security /datum/supply_packs/riot name = "Riot gear crate" @@ -767,8 +485,7 @@ cost = 60 containertype = "/obj/structure/closet/crate/secure" containername = "Riot gear crate" - access = ACCESS_ARMORY - group = "Security" + access = access_armory /datum/supply_packs/loyalty name = "Loyalty implant crate" @@ -776,8 +493,7 @@ cost = 60 containertype = "/obj/structure/closet/crate/secure" containername = "Loyalty implant crate" - access = ACCESS_ARMORY - group = "Security" + access = access_armory /datum/supply_packs/ballistic name = "Ballistic gear crate" @@ -788,8 +504,7 @@ cost = 50 containertype = "/obj/structure/closet/crate/secure" containername = "Ballistic gear crate" - access = ACCESS_ARMORY - group = "Security" + access = access_armory /datum/supply_packs/expenergy name = "Experimental energy gear crate" @@ -800,8 +515,7 @@ cost = 50 containertype = "/obj/structure/closet/crate/secure" containername = "Experimental energy gear crate" - access = ACCESS_ARMORY - group = "Security" + access = access_armory /datum/supply_packs/exparmor name = "Experimental armor crate" @@ -812,8 +526,7 @@ cost = 35 containertype = "/obj/structure/closet/crate/secure" containername = "Experimental armor crate" - access = ACCESS_ARMORY - group = "Security" + access = access_armory /datum/supply_packs/securitybarriers name = "Security Barriers" @@ -823,26 +536,7 @@ "/obj/machinery/deployable/barrier") cost = 20 containertype = "/obj/structure/closet/crate/secure/gear" - containername = "Secruity Barriers crate" - group = "Security" - -/datum/supply_packs/randomised/New() - var/list/tempContains = list() - for(var/i = 0,i[] fires a cap gun at []!
", user, target), 1, "\red You hear a gunshot", 2) @@ -184,24 +183,25 @@ /obj/item/toy/sword name = "toy sword" desc = "A cheap, plastic replica of an energy sword. Realistic sounds! Ages 8 and up." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "sword0" item_state = "sword0" var/active = 0.0 w_class = 2.0 flags = FPRINT | TABLEPASS | NOSHIELD + attack_verb = list("attacked", "struck", "hit") attack_self(mob/user as mob) src.active = !( src.active ) if (src.active) user << "\blue You extend the plastic blade with a quick flick of your wrist." - playsound(user, 'saberon.ogg', 50, 1) + playsound(user, 'sound/weapons/saberon.ogg', 50, 1) src.icon_state = "swordblue" src.item_state = "swordblue" src.w_class = 4 else user << "\blue You push the plastic blade back down into the handle." - playsound(user, 'saberoff.ogg', 50, 1) + playsound(user, 'sound/weapons/saberoff.ogg', 50, 1) src.icon_state = "sword0" src.item_state = "sword0" src.w_class = 2 @@ -211,11 +211,12 @@ /obj/item/toy/crossbow name = "foam dart crossbow" desc = "A weapon favored by many overactive children. Ages 8 and up." - icon = 'gun.dmi' + icon = 'icons/obj/gun.dmi' icon_state = "crossbow" item_state = "crossbow" flags = FPRINT | TABLEPASS | USEDELAY w_class = 2.0 + attack_verb = list("attacked", "struck", "hit") var/bullets = 5 examine() @@ -247,7 +248,7 @@ bullets-- D.icon_state = "foamdart" D.name = "foam dart" - playsound(user.loc, 'syringeproj.ogg', 50, 1) + playsound(user.loc, 'sound/items/syringeproj.ogg', 50, 1) for(var/i=0, i<6, i++) if (D) @@ -295,7 +296,7 @@ O.show_message(text("\red [] casually lines up a shot with []'s head and pulls the trigger!", user, M), 1, "\red You hear the sound of foam against skull", 2) O.show_message(text("\red [] was hit in the head by the foam dart!", M), 1) - playsound(user.loc, 'syringeproj.ogg', 50, 1) + playsound(user.loc, 'sound/items/syringeproj.ogg', 50, 1) new /obj/item/toy/ammo/crossbow(M.loc) src.bullets-- else if (M.lying && src.bullets == 0) @@ -307,7 +308,7 @@ /obj/item/weapon/storage/crayonbox name = "box of crayons" desc = "A box of crayons for all your rune drawing needs." - icon = 'crayons.dmi' + icon = 'icons/obj/crayons.dmi' icon_state = "crayonbox" w_class = 2.0 storage_slots = 6 @@ -318,9 +319,10 @@ /obj/item/toy/crayon name = "crayon" desc = "A colourful crayon. Looks tasty. Mmmm..." - icon = 'crayons.dmi' + icon = 'icons/obj/crayons.dmi' icon_state = "crayonred" w_class = 1.0 + attack_verb = list("attacked", "coloured") var/colour = "#FF0000" //RGB var/shadeColour = "#220000" //RGB var/uses = 30 //0 for unlimited uses @@ -330,17 +332,18 @@ /obj/item/toy/snappop name = "snap pop" desc = "Wow!" - icon = 'toy.dmi' + icon = 'icons/obj/toy.dmi' icon_state = "snappop" + w_class = 1 throw_impact(atom/hit_atom) ..() var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(3, 1, src) s.start() - new /obj/effect/decal/ash(src.loc) + new /obj/effect/decal/cleanable/ash(src.loc) src.visible_message("\red The [src.name] explodes!","\red You hear a snap!") - playsound(src, 'snap.ogg', 50, 1) + playsound(src, 'sound/effects/snap.ogg', 50, 1) del(src) /obj/item/toy/snappop/HasEntered(H as mob|obj) @@ -352,47 +355,15 @@ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(2, 0, src) s.start() - new /obj/effect/decal/ash(src.loc) + new /obj/effect/decal/cleanable/ash(src.loc) src.visible_message("\red The [src.name] explodes!","\red You hear a snap!") - playsound(src, 'snap.ogg', 50, 1) + playsound(src, 'sound/effects/snap.ogg', 50, 1) del(src) -/obj/item/toy/snappopbox - name = "snap pop box" - desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children." - icon = 'toy.dmi' - icon_state = "spbox" - var/amount = 8 - - attack_hand(mob/user as mob, unused, flag) - add_fingerprint(user) - - if(user.r_hand == src || user.l_hand == src) - if(amount) - var/obj/item/toy/snappop/M = new /obj/item/toy/snappop(src) - if (user.hand) - user.l_hand = M - else - user.r_hand = M - M.loc = user - M.layer = 20 - user.update_clothing() - user << "You take a snap pop out of the box." - amount-- - else - user << "There are no snap pops left in the box." - else - ..() - - return - - attack_paw(mob/user as mob) - return attack_hand(user) - /obj/item/toy/waterflower name = "Water Flower" desc = "A seemingly innocent sunflower...with a twist." - icon = 'harvest.dmi' + icon = 'icons/obj/harvest.dmi' icon_state = "sunflower" item_state = "sunflower" var/empty = 0 @@ -431,11 +402,11 @@ var/obj/effect/decal/D = new/obj/effect/decal/(get_turf(src)) D.name = "water" - D.icon = 'chemical.dmi' + D.icon = 'icons/obj/chemical.dmi' D.icon_state = "chempuff" D.create_reagents(5) src.reagents.trans_to(D, 1) - playsound(src.loc, 'spray3.ogg', 50, 1, -6) + playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) spawn(0) for(var/i=0, i<1, i++) @@ -459,7 +430,7 @@ /obj/item/toy/balloon name = "water balloon" desc = "A translucent balloon. There's nothing in it." - icon = 'toy.dmi' + icon = 'icons/obj/toy.dmi' icon_state = "waterballoon-e" item_state = "balloon-empty" diff --git a/code/defines/obj/vending.dm b/code/defines/obj/vending.dm index a46fe70716..ccbdde555c 100755 --- a/code/defines/obj/vending.dm +++ b/code/defines/obj/vending.dm @@ -1,7 +1,7 @@ /obj/machinery/vending name = "Vendomat" desc = "A generic vending machine." - icon = 'vending.dmi' + icon = 'icons/obj/vending.dmi' icon_state = "generic" layer = 2.9 anchored = 1 @@ -11,13 +11,10 @@ var/vend_delay = 10 //How long does it take to vend? var/product_paths = "" //String of product paths separated by semicolons. No spaces! var/product_amounts = "" //String of product amounts separated by semicolons, must have amount for every path in product_paths - var/points = 10 - var/product_prices = "" //String of product prices in Points separated by semicolons, must have amount for every path in product_paths var/product_slogans = "" //String of slogans separated by semicolons, optional var/product_ads = "" //String of small ad messages in the vending screen - random chance var/product_hidden = "" //String of products that are hidden unless hacked. var/product_hideamt = "" //String of hidden product amounts, separated by semicolons. Exact same as amounts. Must be left blank if hidden is. - var/hidden_prices = "" //String of product prices for hidden items var/product_coin = "" var/product_coin_amt = "" var/list/product_records = list() @@ -34,12 +31,12 @@ //var/emagged = 0 //Ignores if somebody doesn't have card access to that machine. var/seconds_electrified = 0 //Shock customers like an airlock. var/shoot_inventory = 0 //Fire items at customers! We're broken! - var/shut_up = 1 //Stop spouting those godawful pitches! + var/shut_up = 0 //Stop spouting those godawful pitches! var/extended_inventory = 0 //can we access the hidden inventory? var/panel_open = 0 //Hacking that vending machine. Gonna get a free candy bar. var/wires = 15 var/obj/item/weapon/coin/coin - var/charge_type + /* /obj/machinery/vending/[vendors name here] // --vending machine template :) @@ -61,7 +58,7 @@ /obj/machinery/vending/atmospherics //Commenting this out until someone ponies up some actual working, broken, and unpowered sprites - Quarxink name = "Tank Vendor" desc = "A vendor with a wide variety of masks and gas tanks." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "dispenser" product_paths = "/obj/item/weapon/tank/oxygen;/obj/item/weapon/tank/plasma;/obj/item/weapon/tank/emergency_oxygen;/obj/item/weapon/tank/emergency_oxygen/engi;/obj/item/clothing/mask/breath" product_amounts = "10;10;10;5;25" @@ -72,27 +69,22 @@ name = "Booze-O-Mat" desc = "A technological marvel, supposedly able to mix just the mixture you'd like to drink the moment you ask for one." icon_state = "boozeomat" //////////////18 drink entities below, plus the glasses, in case someone wants to edit the number of bottles + icon_deny = "boozeomat-deny" product_paths = "/obj/item/weapon/reagent_containers/food/drinks/bottle/gin;/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey;/obj/item/weapon/reagent_containers/food/drinks/bottle/tequilla;/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka;/obj/item/weapon/reagent_containers/food/drinks/bottle/vermouth;/obj/item/weapon/reagent_containers/food/drinks/bottle/rum;/obj/item/weapon/reagent_containers/food/drinks/bottle/wine;/obj/item/weapon/reagent_containers/food/drinks/bottle/cognac;/obj/item/weapon/reagent_containers/food/drinks/bottle/kahlua;/obj/item/weapon/reagent_containers/food/drinks/beer;/obj/item/weapon/reagent_containers/food/drinks/ale;/obj/item/weapon/reagent_containers/food/drinks/bottle/orangejuice;/obj/item/weapon/reagent_containers/food/drinks/bottle/tomatojuice;/obj/item/weapon/reagent_containers/food/drinks/bottle/limejuice;/obj/item/weapon/reagent_containers/food/drinks/bottle/cream;/obj/item/weapon/reagent_containers/food/drinks/tonic;/obj/item/weapon/reagent_containers/food/drinks/cola;/obj/item/weapon/reagent_containers/food/drinks/sodawater;/obj/item/weapon/reagent_containers/food/drinks/drinkingglass;/obj/item/weapon/reagent_containers/food/drinks/ice" -// product_amounts = "5;5;5;5;5;5;5;5;5;6;6;4;4;4;4;8;8;15;30;9" - product_prices = "6;6;6;6;6;6;6;6;6;6;6;7;7;7;7;4;4;2;1;4" + product_amounts = "5;5;5;5;5;5;5;5;5;6;6;4;4;4;4;8;8;15;30;9" vend_delay = 15 product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/tea" - hidden_prices = "4" - points = 60 + product_hideamt = "10" product_slogans = "I hope nobody asks me for a bloody cup o' tea...;Alcohol is humanity's friend. Would you abandon a friend?;Quite delighted to serve you!;Is nobody thirsty on this station?" product_ads = "Drink up!;Booze is good for you!;Alcohol is humanity's best friend.;Quite delighted to serve you!;Care for a nice, cold beer?;Nothing cures you like booze!;Have a sip!;Have a drink!;Have a beer!;Beer is good for you!;Only the finest alcohol!;Best quality booze since 2053!;Award-winning wine!;Maximum alcohol!;Man loves beer.;A toast for progress!" - charge_type = "bar" + req_access_txt = "25" /obj/machinery/vending/assist - product_paths = "/obj/item/device/assembly/prox_sensor;/obj/item/device/assembly/igniter;/obj/item/device/assembly/signaler;/obj/item/weapon/wirecutters;/obj/item/weapon/cartridge/signal" -// product_amounts = "5;3;4;1;4" - product_prices = "2;3;3;10;3" + product_amounts = "5;3;4;1;4" product_hidden = "/obj/item/device/flashlight;obj/item/device/assembly/timer" -// product_hideamt = "5;2" - hidden_prices = "2;5" - points = 15 + product_paths = "/obj/item/device/assembly/prox_sensor;/obj/item/device/assembly/igniter;/obj/item/device/assembly/signaler;/obj/item/weapon/wirecutters;/obj/item/weapon/cartridge/signal" + product_hideamt = "5;2" product_ads = "Only the finest!;Have some tools.;The most robust equipment.;The finest gear in space!" - charge_type = "engineering" /obj/machinery/vending/coffee name = "Hot Drinks machine" @@ -100,72 +92,62 @@ icon_state = "coffee" icon_vend = "coffee-vend" product_paths = "/obj/item/weapon/reagent_containers/food/drinks/coffee;/obj/item/weapon/reagent_containers/food/drinks/tea;/obj/item/weapon/reagent_containers/food/drinks/h_chocolate" - product_prices = "1;1;1" + product_amounts = "25;25;25" vend_delay = 34 product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/ice" -// product_hideamt = "10" - hidden_prices = "1" product_ads = "Have a drink!;Drink up!;It's good for you!;Would you like a hot joe?;I'd kill for some coffee!;The best beans in the galaxy.;Only the finest brew for you.;Mmmm. Nothing like a coffee.;I like coffee, don't you?;Coffee helps you work!;Try some tea.;We hope you like the best!;Try our new chocolate!;Admin conspiracies" - charge_type = "coffee" + product_hideamt = "10" /obj/machinery/vending/snack name = "Getmore Chocolate Corp" desc = "A snack machine courtesy of the Getmore Chocolate Corporation, based out of Mars" icon_state = "snack" product_paths = "/obj/item/weapon/reagent_containers/food/snacks/candy;/obj/item/weapon/reagent_containers/food/drinks/dry_ramen;/obj/item/weapon/reagent_containers/food/snacks/chips;/obj/item/weapon/reagent_containers/food/snacks/sosjerky;/obj/item/weapon/reagent_containers/food/snacks/no_raisin;/obj/item/weapon/reagent_containers/food/snacks/spacetwinkie;/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers" -// product_amounts = "6;6;6;6;6;6;6" - product_prices = "1;1;1;1;1;1;1" + product_amounts = "6;6;6;6;6;6;6" product_slogans = "Try our new nougat bar!;Twice the calories for half the price!" product_hidden = "/obj/item/weapon/reagent_containers/food/snacks/syndicake" -// product_hideamt = "10" - hidden_prices = "1" + product_hideamt = "6" product_ads = "The healthiest!;Award-winning chocolate bars!;Mmm! So good!;Oh my god it's so juicy!;Have a snack.;Snacks are good for you!;Have some more Getmore!;Best quality snacks straight from mars.;We love chocolate!;Try our new jerky!" - charge_type = "snack" + /obj/machinery/vending/cola name = "Robust Softdrinks" desc = "A softdrink vendor provided by Robust Industries, LLC." icon_state = "Cola_Machine" - product_paths = "/obj/item/weapon/reagent_containers/food/drinks/cola;/obj/item/weapon/reagent_containers/food/drinks/space_mountain_wind;/obj/item/weapon/reagent_containers/food/drinks/dr_gibb;/obj/item/weapon/reagent_containers/food/drinks/starkist;/obj/item/weapon/reagent_containers/food/drinks/space_up;/obj/item/weapon/reagent_containers/food/drinks/waterbottle" -// product_amounts = "10;10;10;10;10" - product_prices = "1;1;1;1;1;1" + product_paths = "/obj/item/weapon/reagent_containers/food/drinks/cola;/obj/item/weapon/reagent_containers/food/drinks/space_mountain_wind;/obj/item/weapon/reagent_containers/food/drinks/dr_gibb;/obj/item/weapon/reagent_containers/food/drinks/starkist;/obj/item/weapon/reagent_containers/food/drinks/space_up" + product_amounts = "10;10;10;10;10" product_slogans = "Robust Softdrinks: More robust then a toolbox to the head!" product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/thirteenloko" product_hideamt = "5" - hidden_prices = "2" product_ads = "Refreshing!;Hope you're thirsty!;Over 1 million drinks sold!;Thirsty? Why not cola?;Please, have a drink!;Drink up!;The best drinks in space." - charge_type = "soda" +//This one's from bay12 /obj/machinery/vending/cart name = "PTech" desc = "Cartridges for PDAs" icon_state = "cart" icon_deny = "cart-deny" product_paths = "/obj/item/weapon/cartridge/medical;/obj/item/weapon/cartridge/engineering;/obj/item/weapon/cartridge/security;/obj/item/weapon/cartridge/janitor;/obj/item/weapon/cartridge/signal/toxins;/obj/item/device/pda/heads;/obj/item/weapon/cartridge/captain;/obj/item/weapon/cartridge/quartermaster" -// product_amounts = "10;10;10;10;10;10;3;10" - product_prices = "1;1;1;1;1;3;1" - product_slogans = "" + product_amounts = "10;10;10;10;10;10;3;10" + product_slogans = "Carts to go!" product_hidden = "" -// product_hideamt = "" - hidden_prices = "" - charge_type = "cart" + product_hideamt = "" + product_coin = "" + product_coin_amt = "" /obj/machinery/vending/cigarette name = "cigarette machine" desc = "If you want to get cancer, might as well do it in style" icon_state = "cigs" - product_paths = "/obj/item/weapon/cigpacket;/obj/item/weapon/matchbox;/obj/item/weapon/lighter/random" -// product_amounts = "10;10;4" - product_prices = "1;1;2" + product_paths = "/obj/item/weapon/cigpacket;/obj/item/weapon/storage/matchbox;/obj/item/weapon/lighter/random" + product_amounts = "10;10;4" product_slogans = "Space cigs taste good like a cigarette should.;I'd rather toolbox than switch.;Smoke!;Don't believe the reports - smoke today!" vend_delay = 34 product_hidden = "/obj/item/weapon/lighter/zippo" -// product_hideamt = "4" - hidden_prices = "2" + product_hideamt = "4" product_coin = "/obj/item/clothing/mask/cigarette/cigar/havana" product_coin_amt = "2" product_ads = "Probably not bad for you!;Don't believe the scientists!;It's good for you!;Don't quit, buy more!;Smoke!;Nicotine heaven.;Best cigarettes since 2150.;Award-winning cigs." - charge_type = "cigarette" /obj/machinery/vending/medical name = "NanoMed Plus" @@ -173,15 +155,22 @@ icon_state = "med" icon_deny = "med-deny" req_access_txt = "5" - product_paths = "/obj/item/clothing/under/rank/medical;/obj/item/clothing/under/rank/chemist;/obj/item/clothing/suit/storage/labcoat;/obj/item/clothing/shoes/white;/obj/item/weapon/reagent_containers/glass/bottle/antitoxin;/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline;/obj/item/weapon/reagent_containers/glass/bottle/stoxin;/obj/item/weapon/reagent_containers/glass/bottle/toxin;/obj/item/weapon/reagent_containers/syringe/antiviral;/obj/item/weapon/reagent_containers/syringe;/obj/item/device/healthanalyzer;/obj/item/weapon/reagent_containers/glass/beaker;/obj/item/weapon/reagent_containers/dropper;/obj/item/stack/medical/bruise_pack;/obj/item/stack/medical/ointment;/obj/item/stack/medical/splint;/obj/item/stack/medical/advanced/bruise_pack;/obj/item/stack/medical/advanced/ointment" -// product_amounts = "4;4;4;4;4;12;5;4;2" - product_prices = "1;1;1;1;2;2;2;2;2;1;2;2;5;1;1;2;3;3" + product_paths = "/obj/item/weapon/reagent_containers/glass/bottle/antitoxin;/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline;/obj/item/weapon/reagent_containers/glass/bottle/stoxin;/obj/item/weapon/reagent_containers/glass/bottle/toxin;/obj/item/weapon/reagent_containers/syringe/antiviral;/obj/item/weapon/reagent_containers/syringe;/obj/item/device/healthanalyzer;/obj/item/weapon/reagent_containers/glass/beaker;/obj/item/weapon/reagent_containers/dropper" + product_amounts = "4;4;4;4;4;12;5;4;2" product_hidden = "/obj/item/weapon/reagent_containers/pill/tox;/obj/item/weapon/reagent_containers/pill/stox;/obj/item/weapon/reagent_containers/pill/antitox" -// product_hideamt = "3;4;6" - hidden_prices = "3;3;2" - points = 25 -// product_ads = "Go save some lives!;The best stuff for your medbay.;Only the finest tools.;Natural chemicals!;This stuff saves lives.;Don't you want some?;Ping!" - charge_type = "medical" + product_hideamt = "3;4;6" + product_ads = "Go save some lives!;The best stuff for your medbay.;Only the finest tools.;Natural chemicals!;This stuff saves lives.;Don't you want some?;Ping!" + +//This one's from bay12 +/obj/machinery/vending/plasmaresearch + name = "Toximate 3000" + desc = "All the fine parts you need in one vending machine!" + product_paths = "/obj/item/clothing/under/rank/scientist;/obj/item/clothing/suit/bio_suit;/obj/item/clothing/head/bio_hood;/obj/item/device/transfer_valve;/obj/item/device/assembly/signaler;/obj/item/device/assembly/prox_sensor;/obj/item/device/assembly/igniter;/obj/item/device/assembly/timer" + product_amounts = "6;6;6;6;6" + product_hidden = "" + product_hideamt = "" + product_coin = "" + product_coin_amt = "" /obj/machinery/vending/wallmed1 name = "NanoMed" @@ -190,15 +179,11 @@ icon_deny = "wallmed-deny" req_access_txt = "5" product_paths = "/obj/item/stack/medical/bruise_pack;/obj/item/stack/medical/ointment;/obj/item/weapon/reagent_containers/syringe/inaprovaline;/obj/item/device/healthanalyzer" -// product_amounts = "2;2;4;1" - product_prices = "1;1;2;2" + product_amounts = "2;2;4;1" product_hidden = "/obj/item/weapon/reagent_containers/syringe/antitoxin;/obj/item/weapon/reagent_containers/syringe/antiviral;/obj/item/weapon/reagent_containers/pill/tox" -// product_hideamt = "4;4;1" - hidden_prices = "2;2;2" - points = 5 + product_hideamt = "4;4;1" density = 0 //It is wall-mounted, and thus, not dense. --Superxpdude product_ads = "Go save some lives!;The best stuff for your medbay.;Only the finest tools.;Natural chemicals!;This stuff saves lives.;Don't you want some?" - charge_type = "medical" /obj/machinery/vending/wallmed2 name = "NanoMed" @@ -207,14 +192,10 @@ icon_deny = "wallmed-deny" req_access_txt = "5" product_paths = "/obj/item/weapon/reagent_containers/syringe/inaprovaline;/obj/item/weapon/reagent_containers/syringe/antitoxin;/obj/item/stack/medical/bruise_pack;/obj/item/stack/medical/ointment;/obj/item/device/healthanalyzer" -// product_amounts = "5;3;3;3;3" - product_prices = "2;2;1;1;2" + product_amounts = "5;3;3;3;3" product_hidden = "/obj/item/weapon/reagent_containers/pill/tox" -// product_hideamt = "3" - hidden_prices = "2" - points = 5 + product_hideamt = "3" density = 0 //It is wall-mounted, and thus, not dense. --Superxpdude - charge_type = "medical" /obj/machinery/vending/security name = "SecTech" @@ -222,15 +203,11 @@ icon_state = "sec" icon_deny = "sec-deny" req_access_txt = "1" - product_paths = "/obj/item/clothing/under/color/red;/obj/item/clothing/under/ftech;/obj/item/clothing/under/det;/obj/item/clothing/suit/storage/det_suit;/obj/item/clothing/head/det_hat;/obj/item/clothing/head/helmet;/obj/item/clothing/suit/armor/vest;/obj/item/clothing/suit/storage/gearharness;/obj/item/weapon/storage/belt/security;/obj/item/device/radio/headset/security;/obj/item/weapon/handcuffs;/obj/item/weapon/flashbang;/obj/item/device/flash;/obj/item/weapon/reagent_containers/food/snacks/donut;/obj/item/weapon/storage/box/evidence" -// product_amounts = "8;4;5;12;6" - product_prices = "1;1;1;1;1;3;3;3;2;1;1;3;2;1;2" - product_hidden = "/obj/item/clothing/glasses/sunglasses;/obj/item/kitchen/donut_box" -// product_hideamt = "2;2" - hidden_prices = "5;5" - points = 15 + product_paths = "/obj/item/weapon/handcuffs;/obj/item/weapon/grenade/flashbang;/obj/item/device/flash;/obj/item/weapon/reagent_containers/food/snacks/donut/normal;/obj/item/weapon/storage/box/evidence" + product_amounts = "8;4;5;12;6" + product_hidden = "/obj/item/clothing/glasses/sunglasses;/obj/item/weapon/storage/fancy/donut_box" + product_hideamt = "2;2" product_ads = "Crack capitalist skulls!;Beat some heads in!;Don't forget - harm is good!;Your weapons are right here.;Handcuffs!;Freeze, scumbag!;Don't tase me bro!;Tase them, bro.;Why not have a donut?" - charge_type = "security" /obj/machinery/vending/hydronutrients name = "NutriMax" @@ -238,138 +215,97 @@ icon_state = "nutri" icon_deny = "nutri-deny" product_paths = "/obj/item/nutrient/ez;/obj/item/nutrient/l4z;/obj/item/nutrient/rh;/obj/item/weapon/pestspray;/obj/item/weapon/reagent_containers/syringe;/obj/item/weapon/plantbag" -// product_amounts = "35;25;15;20;5;5" - product_prices = "1;1;2;2;7;7" + product_amounts = "35;25;15;20;5;5" product_slogans = "Aren't you glad you don't have to fertilize the natural way?;Now with 50% less stink!;Plants are people too!" product_hidden = "/obj/item/weapon/reagent_containers/glass/bottle/ammonia;/obj/item/weapon/reagent_containers/glass/bottle/diethylamine" -// product_hideamt = "10;5" - hidden_prices = "1;2" - points = 20 + product_hideamt = "10;5" product_ads = "We like plants!;Don't you want some?;The greenest thumbs ever.;We like big plants.;Soft soil..." - charge_type = "hydroponics" /obj/machinery/vending/hydroseeds name = "MegaSeed Servitor" desc = "When you need seeds fast!" icon_state = "seeds" - product_paths = "/obj/item/seeds/bananaseed;/obj/item/seeds/berryseed;/obj/item/seeds/carrotseed;/obj/item/seeds/chantermycelium;/obj/item/seeds/chiliseed;/obj/item/seeds/cornseed;/obj/item/seeds/eggplantseed;/obj/item/seeds/potatoseed;/obj/item/seeds/replicapod;/obj/item/seeds/soyaseed;/obj/item/seeds/sunflowerseed;/obj/item/seeds/tomatoseed;/obj/item/seeds/towermycelium;/obj/item/seeds/wheatseed;/obj/item/seeds/appleseed;/obj/item/seeds/poppyseed;/obj/item/seeds/ambrosiavulgarisseed;/obj/item/seeds/whitebeetseed;/obj/item/seeds/watermelonseed;/obj/item/seeds/limeseed;/obj/item/seeds/lemonseed;/obj/item/seeds/orangeseed;/obj/item/seeds/grassseed;/obj/item/seeds/sugarcaneseed;/obj/item/seeds/cocoapodseed;/obj/item/seeds/cabbageseed;/obj/item/seeds/grapeseed;/obj/item/seeds/pumpkinseed" -// product_amounts = "3;2;2;2;2;2;2;2;3;2;2;2;2;2;3;5;4;3;3;3;3;3;3;3;3;3;3;3" - product_prices = "3;5;5;5;5;5;5;5;3;5;5;5;5;5;3;2;3;3;3;3;3;3;3;3;3;3;3;3" -// product_hidden = "/obj/item/seeds/amanitamycelium;/obj/item/seeds/glowshroom;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium" - product_hideamt = "2;2;2;2;2" - hidden_prices = "5;5;5;5;5" + product_paths = "/obj/item/seeds/bananaseed;/obj/item/seeds/berryseed;/obj/item/seeds/carrotseed;/obj/item/seeds/chantermycelium;/obj/item/seeds/chiliseed;/obj/item/seeds/cornseed;/obj/item/seeds/eggplantseed;/obj/item/seeds/potatoseed;/obj/item/seeds/replicapod;/obj/item/seeds/soyaseed;/obj/item/seeds/sunflowerseed;/obj/item/seeds/tomatoseed;/obj/item/seeds/towermycelium;/obj/item/seeds/wheatseed;/obj/item/seeds/appleseed;/obj/item/seeds/poppyseed;/obj/item/seeds/ambrosiavulgarisseed;/obj/item/seeds/whitebeetseed;/obj/item/seeds/watermelonseed;/obj/item/seeds/limeseed;/obj/item/seeds/lemonseed;/obj/item/seeds/orangeseed;/obj/item/seeds/grassseed;/obj/item/seeds/cocoapodseed;/obj/item/seeds/cabbageseed;/obj/item/seeds/grapeseed;/obj/item/seeds/pumpkinseed" + product_amounts = "3;2;2;2;2;2;2;2;3;2;2;2;2;2;3;5;4;3;3;3;3;3;3;3;3;3;3" + product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!" + product_hidden = "/obj/item/seeds/amanitamycelium;/obj/item/seeds/glowshroom;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium;/obj/item/seeds/reishimycelium" + product_hideamt = "2;2;2;2;2;2" product_coin = "/obj/item/toy/waterflower" product_coin_amt = "1" - points = 40 product_ads = "We like plants!;Grow some crops!;Grow, baby, growww!;Aw h'yeah son!" - product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!" - charge_type = "hydroponics" + +/obj/machinery/vending/liquid + name = "LiquidRation Dispenser" + desc = "All the food you'll ever need to survive!" + icon_state = "liquidfood" + product_paths = "/obj/item/weapon/reagent_containers/food/snacks/liquidfood;/obj/item/weapon/flavor/red;/obj/item/weapon/flavor/blue" + product_amounts = "20;10;10" + product_slogans = "Enjoy your NanoTrasen \"LiquidFood\" Ration! Now with a choice of TWO delicious flavors!" + product_ads = "Think of it as free survival!;It's even healthy!;Take a quick break, enjoy your ration!" /obj/machinery/vending/magivend name = "MagiVend" desc = "A magic vending machine." icon_state = "MagiVend" -// product_amounts = "1;1;1;1;1;2" - product_prices = "10;10;10;10;10;5" + product_amounts = "1;1;1;1;1;2" product_slogans = "Sling spells the proper way with MagiVend!;Be your own Houdini! Use MagiVend!" product_paths = "/obj/item/clothing/head/wizard;/obj/item/clothing/suit/wizrobe;/obj/item/clothing/head/wizard/red;/obj/item/clothing/suit/wizrobe/red;/obj/item/clothing/shoes/sandal;/obj/item/weapon/staff" vend_delay = 15 - points = 55 vend_reply = "Have an enchanted evening!" product_hidden = "/obj/item/weapon/reagent_containers/glass/bottle/wizarditis" //No one can get to the machine to hack it anyways -// product_hideamt = "1" //Just one, for the lulz, not like anyone can get it - Microwave - hidden_prices = "10" + product_hideamt = "1" //Just one, for the lulz, not like anyone can get it - Microwave product_ads = "FJKLFJSD;AJKFLBJAKL;1234 LOONIES LOL!;>MFW;Kill them fuckers!;GET DAT FUKKEN DISK;HONK!;EI NATH;Destroy the station!;Admin conspiracies since forever!;Space-time bending hardware!" /obj/machinery/vending/dinnerware name = "Dinnerware" desc = "A kitchen and restaurant equipment vendor" icon_state = "dinnerware" - product_paths = "/obj/item/weapon/tray;/obj/item/weapon/kitchen/utensil/fork;/obj/item/weapon/kitchenknife;/obj/item/weapon/reagent_containers/food/drinks/drinkingglass;/obj/item/clothing/suit/storage/chef/classic" -// product_amounts = "8;6;3;8;2" - product_prices = "1;2;3;1;5" + product_paths = "/obj/item/weapon/tray;/obj/item/weapon/kitchen/utensil/fork;/obj/item/weapon/kitchenknife;/obj/item/weapon/reagent_containers/food/drinks/drinkingglass;/obj/item/clothing/suit/chef/classic" + product_amounts = "8;6;3;8;2" //product_amounts = "8;5;4" Old totals product_hidden = "/obj/item/weapon/kitchen/utensil/spoon;/obj/item/weapon/kitchen/utensil/knife;/obj/item/weapon/kitchen/rollingpin;/obj/item/weapon/butch" -// product_hideamt = "2;2;2;2" - hidden_prices = "5;5;5;5" - points = 15 + product_hideamt = "2;2;2;2" product_ads = "Mm, food stuffs!;Food and food accessories.;Get your plates!;You like forks?;I like forks.;Woo, utensils.;You don't really need these..." - charge_type = "kitchen" + /obj/machinery/vending/sovietsoda name = "BODA" desc = "Old sweet water vending machine" icon_state = "sovietsoda" product_paths = "/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda" -// product_amounts = "30" - product_prices = "1" + product_amounts = "30" //product_amounts = "8;5;4" Old totals product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola" -// product_hideamt = "20" - hidden_prices = "1" + product_hideamt = "20" product_ads = "For Tsar and Country.;Have you fulfilled your nutrition quota today?;Very nice!;We are simple people, for this is all we eat.;If there is a person, there is a problem. If there is no person, then there is no problem." - charge_type = "soda" -/obj/machinery/vending/tool//Who did this and why is it here? I don't even +/obj/machinery/vending/tool name = "YouTool" desc = "Tools for tools." icon_state = "tool" icon_deny = "tool-deny" req_access_txt = "12" //Maintenance access product_paths = "/obj/item/weapon/cable_coil/random;/obj/item/weapon/crowbar;/obj/item/weapon/weldingtool;/obj/item/weapon/wirecutters;/obj/item/weapon/wrench;/obj/item/device/analyzer;/obj/item/device/t_scanner" -// product_amounts = "10;5;3;5;5;5;5" - product_prices = "1;2;3;2;2;2;2" - product_prices = "1" - product_hidden = "/obj/item/weapon/weldingtool/largetank;/obj/item/device/multitool" -// product_hideamt = "2;2" - hidden_prices = "4;4" + product_amounts = "10;5;3;5;5;5;5" + product_hidden = "/obj/item/weapon/weldingtool/hugeetank;/obj/item/clothing/gloves/fyellow" + product_hideamt = "2;2" product_coin = "/obj/item/clothing/gloves/yellow" product_coin_amt = "1" - charge_type = "engineering" -/obj/machinery/vending/engivend//Source of tools and what have you for Engineering (Needed on account of the public auto-lathe being removed) -Sieve +/obj/machinery/vending/engivend name = "Engi-Vend" desc = "Spare tool vending. What? Did you expect some witty description?" icon_state = "engivend" icon_deny = "engivend-deny" req_access_txt = "10" //Engineering access - product_paths = "/obj/item/weapon/cable_coil/random;/obj/item/weapon/crowbar;/obj/item/weapon/weldingtool/largetank;/obj/item/weapon/wirecutters;/obj/item/weapon/wrench;/obj/item/device/t_scanner;/obj/item/device/multitool;/obj/item/weapon/airlock_electronics;/obj/item/weapon/module/power_control" -// product_amounts = "5;3;5;3;5;5;5;2;3;3" - product_prices = "2;2;3;2;2;2;4;2;2" - product_hidden = "/obj/item/weapon/weldingtool/hugetank;/obj/item/clothing/gloves/fyellow" -// product_hideamt = "2;2" - hidden_prices = "4;4" + product_paths = "/obj/item/clothing/glasses/meson;/obj/item/device/multitool;/obj/item/weapon/airlock_electronics;/obj/item/weapon/module/power_control;/obj/item/weapon/cell/high" + product_amounts = "2;4;10;10;10" + product_hidden = "/obj/item/weapon/cell/potato" + product_hideamt = "3" product_coin = "/obj/item/weapon/storage/belt/utility" product_coin_amt = "3" - charge_type = "engineering" - -/obj/machinery/vending/genetics - name = "Genetics Dispenser" - desc = "Medical drug dispenser." - icon_state = "med" - icon_deny = "med-deny" - req_access_txt = "5" - product_paths = "/obj/item/clothing/suit/storage/labcoat;/obj/item/clothing/under/rank/geneticist;/obj/item/weapon/reagent_containers/glass/bottle/antitoxin;/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline;/obj/item/weapon/reagent_containers/glass/bottle/stoxin;/obj/item/weapon/reagent_containers/glass/bottle/toxin;/obj/item/weapon/reagent_containers/syringe" -// product_amounts = "4;4;6;6;6;6;4" - product_prices = "1;1;2;2;2;2;1" - product_hidden = "" - product_hideamt = "" - charge_type = "genetics" - -/*/obj/machinery/vending/toxins - name = "Toxins dispenser" - desc = "Medical drug dispenser." - icon = 'objects.dmi' - icon_state = "dispenser" - //icon_deny = "med-deny" - req_access_txt = "7" - product_paths = "/obj/item/clothing/under/rank/scientist;/obj/item/clothing/suit/bio_suit;/obj/item/clothing/head/bio_hood;/obj/item/weapon/screwdriver;/obj/item/weapon/wrench;/obj/item/weapon/tank/oxygen;/obj/item/weapon/tank/plasma;/obj/item/device/transfer_valve;/obj/item/device/igniter;/obj/item/device/timer;/obj/item/device/prox_sensor;/obj/item/device/radio/signaler;/obj/item/weapon/chem_grenade" - product_amounts = "4;4;4;6;6;4;4;8;8;8;8;8;8" - //product_prices = "1;2;2;1;1;1;2;3;2;2;2;2;2" - product_hidden = "" - product_hideamt = "" - charge_type = "toxins"*/ +//This one's from bay12 /obj/machinery/vending/engineering name = "Robco Tool Maker" desc = "Everything you need for do-it-yourself station repair." @@ -378,22 +314,12 @@ req_access_txt = "10" product_paths = "/obj/item/clothing/under/rank/chief_engineer;/obj/item/clothing/under/rank/engineer;/obj/item/clothing/shoes/orange;/obj/item/clothing/head/helmet/hardhat;/obj/item/weapon/storage/belt/utility;/obj/item/clothing/glasses/meson;/obj/item/clothing/gloves/yellow;/obj/item/weapon/screwdriver;/obj/item/weapon/crowbar;/obj/item/weapon/wirecutters;/obj/item/device/multitool;/obj/item/weapon/wrench;/obj/item/device/t_scanner;/obj/item/weapon/CableCoil/power;/obj/item/weapon/circuitry;/obj/item/weapon/cell;/obj/item/weapon/weldingtool;/obj/item/clothing/head/helmet/welding;/obj/item/weapon/light/tube;/obj/item/clothing/suit/fire;/obj/item/weapon/stock_parts/scanning_module;/obj/item/weapon/stock_parts/micro_laser;/obj/item/weapon/stock_parts/matter_bin;/obj/item/weapon/stock_parts/manipulator;/obj/item/weapon/stock_parts/console_screen" // product_amounts = "4;4;4;4;4;4;4;12;12;12;12;12;12;8;4;8;8;8;10;4" - product_prices = "1;1;1;2;2;1;2;1;1;2;2;1;1;1;2;2;1;1;1;2;2;2;2;2;2" product_hidden = "" product_hideamt = "" - charge_type = "engineering" - -/obj/machinery/vending/plasmaresearch - name = "Toximate 3000" - desc = "All the fine parts you need in one vending machine!" - product_hidden = "" - product_hideamt = "" - points = 40 - product_paths = "/obj/item/clothing/under/rank/scientist;/obj/item/clothing/suit/bio_suit;/obj/item/clothing/head/bio_hood;/obj/item/device/transfer_valve;/obj/item/device/assembly/signaler;/obj/item/device/assembly/prox_sensor;/obj/item/device/assembly/igniter;/obj/item/device/assembly/timer" -// product_amounts = "6;6;6;6;6" - product_prices = "1;2;2;2;2;2;2;2" - charge_type = "toxins" + product_coin = "" + product_coin_amt = "" +//This one's from bay12 /obj/machinery/vending/robotics name = "Robotech Deluxe" desc = "All the tools you need to create your own robot army." @@ -401,117 +327,8 @@ icon_deny = "robotics-deny" req_access_txt = "29" product_paths = "/obj/item/clothing/suit/storage/labcoat;/obj/item/clothing/under/rank/roboticist;/obj/item/weapon/cable_coil;/obj/item/device/flash;/obj/item/weapon/cell/high;/obj/item/device/assembly/prox_sensor;/obj/item/device/assembly/signaler;/obj/item/device/healthanalyzer;/obj/item/weapon/scalpel;/obj/item/weapon/circular_saw;/obj/item/weapon/tank/anesthetic;/obj/item/clothing/mask/medical;/obj/item/weapon/screwdriver;/obj/item/weapon/crowbar" - //product_amounts = "4;4;4;4;12" - product_prices = "1;1;1;1;3;2;2;2;4;4;2;1;1;1" + product_amounts = "4;4;4;4;12" product_hidden = "" - hidden_prices = "" - charge_type = "robotics" - -/obj/machinery/vending/liquid - name = "LiquidRation Dispenser" - desc = "All the food you'll ever need to survive!" - icon_state = "liquidfood" - product_paths = "/obj/item/weapon/reagent_containers/food/snacks/liquidfood;/obj/item/weapon/flavor/red;/obj/item/weapon/flavor/blue" -// product_amounts = "6;6;6;6;6;6;6" - product_prices = "1;1;1" - product_slogans = "Enjoy your NanoTrasen \"LiquidFood\" Ration! Now with a choice of TWO delicious flavors!" - product_hidden = "" -// product_hideamt = "10" - hidden_prices = "" - product_ads = "Think of it as free survival!;It's even healthy!;Take a quick break, enjoy your ration!" - charge_type = "liquid" - -/obj/item/weapon/vending_charge - name = "Vending Charge" - var/charge_type = "generic" - var/charge_amt = 10 - icon = 'vending.dmi' - icon_state = "generic-charge" - -/obj/item/weapon/vending_charge/medical - name = "Medical Charge" - charge_type = "medical" - icon_state = "medical-charge" - -/obj/item/weapon/vending_charge/chemistry - name = "Chemistry Charge" - charge_type = "chemistry" - icon_state = "chemistry-charge" - charge_amt = 25 // only used by chemistry now - -/obj/item/weapon/vending_charge/genetics - name = "Genetics Charge" - charge_type = "genetics" - icon_state = "generic-charge" - -/obj/item/weapon/vending_charge/toxins - name = "Toxins Charge" - charge_type = "toxins" - icon_state = "toxins-charge" - charge_amt = 40 - -/obj/item/weapon/vending_charge/robotics - name = "Robotics Charge" - charge_type = "robotics" - icon_state = "robotics-charge" - -/obj/item/weapon/vending_charge/bar - name = "Bar Charge" - charge_type = "bar" - icon_state = "bar-charge" - charge_amt = 40 - -/obj/item/weapon/vending_charge/kitchen - name = "Kitchen Charge" - charge_type = "kitchen" - icon_state = "kitchen-charge" - -/obj/item/weapon/vending_charge/engineering - name = "Engineering Charge" - charge_type = "engineering" - icon_state = "engineering-charge" - -/obj/item/weapon/vending_charge/security - name = "Security Charge" - charge_type = "security" - icon_state = "security-charge" - -/obj/item/weapon/vending_charge/coffee - name = "Coffee Charge" - charge_type = "coffee" - icon_state = "coffee-charge" - -/obj/item/weapon/vending_charge/snack - name = "Snack Charge" - charge_type = "snack" - icon_state = "snack-charge" - -/obj/item/weapon/vending_charge/cart - name = "Cart Charge" - charge_type = "cart" - icon_state = "cart-charge" - -/obj/item/weapon/vending_charge/cigarette - name = "Cigarette Charge" - charge_type = "cigarette" - icon_state = "cigarette-charge" - -/obj/item/weapon/vending_charge/hydroponics - name = "Hydroponics Charge" - charge_type = "hydroponics" - icon_state = "hydroponics-charge" - -/obj/item/weapon/vending_charge/soda - name = "Soda Charge" - charge_type = "soda" - icon_state = "soda-charge" - -/*/obj/item/weapon/vending_charge/toxinslab - name = "Toxins Lab Charge" - charge_type = "toxinslab" - icon_state = "toxinslab-charge"*/ - -/obj/item/weapon/vending_charge/liquid - name = "LiquidRation Charge" - charge_type = "liquid" - icon_state = "liquidfood-charge" \ No newline at end of file + product_hideamt = "" + product_coin = "" + product_coin_amt = "" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 57232f0814..2971fad009 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -2,7 +2,7 @@ /obj/item/weapon name = "weapon" - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' /obj/item/weapon/shield name = "shield" @@ -10,7 +10,7 @@ /obj/item/weapon/shield/riot name = "riot shield" desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "riot" flags = FPRINT | TABLEPASS| CONDUCT slot_flags = SLOT_BACK @@ -22,6 +22,7 @@ g_amt = 7500 m_amt = 1000 origin_tech = "materials=2" + attack_verb = list("shoved", "bashed") IsShield() return 1 @@ -29,7 +30,7 @@ /obj/item/weapon/shield/energy name = "energy combat shield" desc = "A shield capable of stopping most projectile and melee attacks. It can be retracted, expanded, and stored anywhere." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "eshield0" // eshield1 for expanded flags = FPRINT | TABLEPASS| CONDUCT force = 3.0 @@ -38,6 +39,7 @@ throw_range = 4 w_class = 1 origin_tech = "materials=4;magnets=3;syndicate=4" + attack_verb = list("shoved", "bashed") var/active = 0 @@ -48,53 +50,13 @@ item_state = "nullrod" flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT - force = 10 + force = 15 throw_speed = 1 throw_range = 4 throwforce = 10 w_class = 1 -/obj/item/weapon/nullrod/attack(mob/M as mob, mob/living/user as mob) - - M.attack_log += text("\[[time_stamp()]\] Has been attacked with [src.name] by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to attack [M.name] ([M.ckey])") - - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - log_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") - - if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") - user << "\red You don't have the dexterity to do this!" - return - - if ((CLUMSY in user.mutations) && prob(50)) - user << "\red The rod slips out of your hand and hits your head." - user.take_organ_damage(10) - user.Paralyse(20) - return - - if (M.stat !=2) - if((M.mind in ticker.mode.cult) && prob(33)) - M << "\red The power of [src] clears your mind of the cult's influence!" - user << "\red You wave [src] over [M]'s head and see their eyes become clear, their mind returning to normal." - ticker.mode.remove_cultist(M.mind) - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] waves [] over []'s head.", user, src, M), 1) - else if(prob(10)) - user << "\red The rod slips in your hand." - ..() - else - user << "\red The rod appears to do nothing." - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] waves [] over []'s head.", user, src, M), 1) - return - -/obj/item/weapon/nullrod/afterattack(atom/A, mob/user as mob) - if (istype(A, /turf/simulated/floor)) - user << "\blue You hit the floor with the [src]." - call(/obj/effect/rune/proc/revealrunes)(src) - -/*/obj/item/weapon/sord +/obj/item/weapon/sord name = "\improper SORD" desc = "This thing is so unspeakably shitty you are having a hard time even holding it." icon_state = "sord" @@ -103,11 +65,12 @@ slot_flags = SLOT_BELT force = 2 throwforce = 1 - w_class = 3*/ + w_class = 3 + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") /obj/item/weapon/claymore name = "claymore" - desc = "BLOOD FOR THE BLOOD GOD." //SKULLS FOR THE SKULL THRONE. --SkyMarshal + desc = "What are you standing around staring at this for? Get to killing!" icon_state = "claymore" item_state = "claymore" flags = FPRINT | TABLEPASS | CONDUCT @@ -115,14 +78,31 @@ force = 40 throwforce = 10 w_class = 3 + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") IsShield() return 1 +/obj/item/weapon/katana + name = "katana" + desc = "Woefully underpowered in D20" + icon_state = "katana" + item_state = "katana" + flags = FPRINT | TABLEPASS | CONDUCT + slot_flags = SLOT_BELT | SLOT_BACK + force = 40 + throwforce = 10 + w_class = 3 + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + + IsShield() + return 1 + + /obj/item/weapon/bodybag name = "body bag" - desc = "A bag used to deal with a corpse." - icon = 'closet.dmi' + desc = "A plastic bag designed for the storage and transportation of cadavers." + icon = 'icons/obj/closet.dmi' icon_state = "bodybag" force = 5.0 throwforce = 5.0 @@ -136,7 +116,7 @@ /obj/item/weapon/rsf name = "\improper Rapid-Service-Fabricator" desc = "A device used to rapidly deploy service items." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "rcd" opacity = 0 density = 0 @@ -149,7 +129,7 @@ /obj/item/weapon/rsp name = "\improper Rapid-Seed-Producer (RSP)" desc = "A device used to rapidly deploy seeds." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "rcd" opacity = 0 density = 0 @@ -162,7 +142,7 @@ /obj/item/weapon/rcd_ammo name = "compressed matter cartridge" desc = "Highly compressed matter for the RCD." - icon = 'ammo.dmi' + icon = 'icons/obj/ammo.dmi' icon_state = "rcd" item_state = "rcdammo" opacity = 0 @@ -171,17 +151,12 @@ origin_tech = "materials=2" m_amt = 30000 g_amt = 15000 - var/ammo = 10 -/obj/item/weapon/rcd_ammo/large - name = "super compressed matter cartridge" - ammo = 30 - -/obj/item/weapon/money - name = "stack of credits" - desc = "A pile of 1 credit." +/obj/item/weapon/spacecash + name = "space cash" + desc = "It's worth 1 credit." gender = PLURAL - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "spacecash" opacity = 0 density = 0 @@ -191,146 +166,37 @@ throw_speed = 1 throw_range = 2 w_class = 1.0 - var/currency - var/worth - var/split = 5 - var/round = 0.01 var/access = list() - access = ACCESS_CRATE_CASH + access = access_crate_cash -/obj/item/weapon/spacecash - New() // Just in case - spawn(1) - new/obj/item/weapon/money(loc) - del src - -/obj/item/weapon/money/proc/updatedesc() - name = "stack of [currency]" - desc = "A pile of [worth] [currency]" - -/obj/item/weapon/money/New(var/nloc, var/nworth=1,var/ncurrency = "credits") - if(!worth) - worth = nworth - if(!currency) - currency = ncurrency - split = round(worth/2,round) - updatedesc() - return ..(nloc) - -/obj/item/weapon/money/c10 +/obj/item/weapon/spacecash/c10 icon_state = "spacecash10" - access = ACCESS_CRATE_CASH - desc = "A pile of 10 credits." - worth = 10 - -/obj/item/weapon/money/c20 + access = access_crate_cash + desc = "It's worth 10 credits." +/obj/item/weapon/spacecash/c20 icon_state = "spacecash20" - access = ACCESS_CRATE_CASH - desc = "A pile of 20 credits." - worth = 20 - -/obj/item/weapon/money/c50 + access = access_crate_cash + desc = "It's worth 20 credits." +/obj/item/weapon/spacecash/c50 icon_state = "spacecash50" - access = ACCESS_CRATE_CASH - desc = "A pile of 50 credits." - worth = 50 - -/obj/item/weapon/money/c100 + access = access_crate_cash + desc = "It's worth 50 credits." +/obj/item/weapon/spacecash/c100 icon_state = "spacecash100" - access = ACCESS_CRATE_CASH - desc = "A pile of 100 credits." - worth = 100 - -/obj/item/weapon/money/c200 + access = access_crate_cash + desc = "It's worth 100 credits." +/obj/item/weapon/spacecash/c200 icon_state = "spacecash200" - access = ACCESS_CRATE_CASH - desc = "A pile of 200 credits." - worth = 200 - -/obj/item/weapon/money/c500 + access = access_crate_cash + desc = "It's worth 200 credits." +/obj/item/weapon/spacecash/c500 icon_state = "spacecash500" - access = ACCESS_CRATE_CASH - desc = "A pile of 500 credits." - worth = 500 - -/obj/item/weapon/money/c1000 + access = access_crate_cash + desc = "It's worth 500 credits." +/obj/item/weapon/spacecash/c1000 icon_state = "spacecash1000" - access = ACCESS_CRATE_CASH - desc = "A pile of 1000 credits." - worth = 1000 - -/obj/item/weapon/money/attack_self(var/mob/user) - interact(user) - -/obj/item/weapon/money/proc/interact(var/mob/user) - - user.machine = src - - var/dat - - dat += "
[worth] [currency]" - dat += "
New pile:" - - dat += "-" - dat += "-" - if(round<=0.1) - dat += "-" - if(round<=0.01) - dat += "-" - dat += "[split]" - if(round<=0.01) - dat += "+" - if(round<=0.1) - dat += "+" - dat += "+" - dat += "+" - dat += "
split" - - - user << browse(dat, "window=computer;size=400x500") - - onclose(user, "computer") - return - -/obj/item/weapon/money/Topic(href, href_list) - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) - usr.machine = src - - if (href_list["su"]) - var/samt = text2num(href_list["su"]) - if(split+samt0) - split-=samt - if(href_list["split"]) - new /obj/item/weapon/money(get_turf(src),split,currency) - worth-=split - split = round(worth/2,round) - updatedesc() - - - src.add_fingerprint(usr) - src.updateUsrDialog() - for (var/mob/M in viewers(1, src.loc)) - if (M.client && M.machine == src) - src.attack_self(M) - return - -/obj/item/weapon/money/attackby(var/obj/I as obj, var/mob/user as mob) - if(istype(I,/obj/item/weapon/money)) - var/mob/living/carbon/c = user - if(!uppertext(I:currency)==uppertext(currency)) - c<<"You can't mix currencies!" - return ..() - else - worth+=I:worth - c<<"You combine the piles." - updatedesc() - del I - return ..() - + access = access_crate_cash + desc = "It's worth 1000 credits." /obj/item/device/mass_spectrometer desc = "A hand-held mass spectrometer which identifies trace chemicals in a blood sample." @@ -355,21 +221,6 @@ details = 1 origin_tech = "magnets=4;biotech=2" -/*/obj/item/weapon/melee/chainofcommand - name = "chain of command" - desc = "The Captain is first and all other heads are last." - icon_state = "chainofcommand" - item_state = "chainofcommand" - flags = FPRINT | TABLEPASS | CONDUCT - slot_flags = SLOT_BELT - force = 10 - throwforce = 7 - w_class = 3 - var/charges = 50.0 - var/maximum_charges = 50.0 - var/status = 1 - origin_tech = "combat=4"*/ - /obj/item/weapon/melee/energy var/active = 0 @@ -384,11 +235,12 @@ w_class = 3.0 flags = FPRINT | CONDUCT | NOSHIELD | TABLEPASS origin_tech = "combat=3" + attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") /obj/item/weapon/melee/energy/sword color name = "energy sword" - desc = "It cuts AND cooks at the same time!" + desc = "May the force be within you." icon_state = "sword0" force = 3.0 throwforce = 5.0 @@ -397,11 +249,7 @@ w_class = 2.0 flags = FPRINT | TABLEPASS | NOSHIELD origin_tech = "magnets=3;syndicate=4" - -/obj/item/weapon/melee/energy/sword/chainsword - color = "chain" - New() - return + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") /obj/item/weapon/melee/energy/sword/pirate name = "energy cutlass" @@ -412,18 +260,19 @@ name = "energy blade" desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal." icon_state = "blade" - force = 40.0//Normal attacks deal very high damage. + force = 70.0//Normal attacks deal very high damage. throwforce = 1//Throwing or dropping the item deletes it. throw_speed = 1 throw_range = 1 w_class = 4.0//So you can't hide it in your pocket or some such. flags = FPRINT | TABLEPASS | NOSHIELD + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") var/datum/effect/effect/system/spark_spread/spark_system /obj/item/weapon/bananapeel name = "banana peel" desc = "A peel from a banana." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "banana_peel" item_state = "banana_peel" w_class = 1.0 @@ -434,7 +283,7 @@ /obj/item/weapon/corncob name = "corn cob" desc = "A reminder of meals gone by." - icon = 'harvest.dmi' + icon = 'icons/obj/harvest.dmi' icon_state = "corncob" item_state = "corncob" w_class = 1.0 @@ -446,7 +295,7 @@ name = "soap" desc = "A cheap bar of soap. Doesn't smell." gender = PLURAL - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "soap" w_class = 1.0 throwforce = 0 @@ -454,11 +303,11 @@ throw_range = 20 /obj/item/weapon/soap/nanotrasen - desc = "A NanoTrasen brand bar of soap. Smells of plasma." + desc = "A Nanotrasen brand bar of soap. Smells of plasma." icon_state = "soapnt" /obj/item/weapon/soap/deluxe - desc = "A deluxe Waffle Co. brand bar of soap." //What is this I don't even. "Smells of comdoms." --SkyMarshal + desc = "A deluxe Waffle Co. brand bar of soap. Smells of condoms." icon_state = "soapdeluxe" /obj/item/weapon/soap/syndie @@ -467,8 +316,8 @@ /obj/item/weapon/bedsheet name = "bedsheet" - desc = "Nice, linen bedsheet. Perfect to put on a bed." - icon = 'items.dmi' + desc = "Nice, linen, bedsheet. Perfect to put on." + icon = 'icons/obj/items.dmi' icon_state = "sheet" layer = 4.0 item_state = "bedsheet" @@ -545,13 +394,14 @@ /obj/item/weapon/bikehorn name = "bike horn" desc = "A horn off of a bicycle." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "bike_horn" item_state = "bike_horn" throwforce = 3 w_class = 1.0 throw_speed = 3 throw_range = 15 + attack_verb = list("HONKED") var/spam_flag = 0 /obj/item/stack/medical @@ -627,8 +477,8 @@ /obj/item/weapon/c_tube name = "cardboard tube" - desc = "A tube made of cardboard." - icon = 'items.dmi' + desc = "A tube... of cardboard." + icon = 'icons/obj/items.dmi' icon_state = "c_tube" throwforce = 1 w_class = 1.0 @@ -647,7 +497,7 @@ /obj/item/weapon/card name = "card" desc = "Does card things." - icon = 'card.dmi' + icon = 'icons/obj/card.dmi' w_class = 1.0 var/list/files = list( ) @@ -672,8 +522,8 @@ data = "Clown Land" /obj/item/weapon/card/emag - desc = "An identification card. Seems to have some funny chip on it, though." - name = "modified identification card" + desc = "It's a card with a magnetic strip attached to some circuitry." + name = "cryptographic sequencer" icon_state = "emag" item_state = "card-id" origin_tech = "magnets=2;syndicate=2" @@ -681,21 +531,15 @@ /obj/item/weapon/card/id name = "identification card" - desc = "An identification card." + desc = "A card used to provide ID and determine access across the station." icon_state = "id" item_state = "card-id" var/access = list() var/registered_name = null // The name registered_name on the card slot_flags = SLOT_ID - var/pin = 0 - var/money = 0 + var/assignment = null - var/over_jumpsuit = 1 // If set to 0, it won't display on top of the mob's jumpsuit var/dorm = 0 // determines if this ID has claimed a dorm already - var/obj/item/weapon/credit_card/card - var/blood_type = "\[UNSET\]" - var/dna_hash = "\[UNSET\]" - var/fingerprint_hash = "\[UNSET\]" /obj/item/weapon/card/id/silver name = "identification card" @@ -705,14 +549,14 @@ /obj/item/weapon/card/id/gold name = "identification card" - desc = "A golden card which shows authority." + desc = "A golden card which shows power and might." icon_state = "gold" item_state = "gold_id" /obj/item/weapon/card/id/syndicate name = "agent card" -// desc = "Shhhhh." - access = list(ACCESS_MAINT_TUNNELS) + desc = "Shhhhh." + access = list(access_maint_tunnels) origin_tech = "syndicate=3" /obj/item/weapon/card/id/syndicate_command @@ -720,11 +564,11 @@ desc = "An ID straight from the Syndicate." registered_name = "Syndicate" assignment = "Syndicate Overlord" - access = list(ACCESS_SYNDICATE) + access = list(access_syndicate) /obj/item/weapon/card/id/captains_spare name = "captain's spare ID" - desc = "The spare ID of the Captain himself." + desc = "The spare ID of the High Lord himself." icon_state = "gold" item_state = "gold_id" registered_name = "Captain" @@ -743,30 +587,10 @@ access = get_all_centcom_access() ..() - -/obj/item/weapon/clipboard - name = "clipboard" - desc = "Apply paper to this to write better. Can also hold pens." - icon = 'items.dmi' - icon_state = "clipboard00" - var/obj/item/weapon/pen/pen = null - item_state = "clipboard" - throwforce = 0 - w_class = 2.0 - throw_speed = 3 - throw_range = 10 - flags = FPRINT | TABLEPASS - slot_flags = SLOT_BELT - -/obj/item/weapon/clipboard/notebook - name = "notebook" - desc = "Holds paper and pens. Feels very noire." - icon_state = "notebook00" - #define MAXCOIL 30 /obj/item/weapon/cable_coil name = "cable coil" - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "coil_red" var/amount = MAXCOIL color = "red" @@ -780,6 +604,7 @@ flags = TABLEPASS | USEDELAY | FPRINT | CONDUCT slot_flags = SLOT_BELT item_state = "coil_red" + attack_verb = list("whipped", "lashed", "disciplined", "flogged") /obj/item/weapon/cable_coil/cut item_state = "coil_red2" @@ -820,8 +645,8 @@ /obj/item/weapon/crowbar name = "crowbar" - desc = "Used to remove floor tiles." - icon = 'items.dmi' + desc = "Used to hit floors" + icon = 'icons/obj/items.dmi' icon_state = "crowbar" flags = FPRINT | TABLEPASS| CONDUCT slot_flags = SLOT_BELT @@ -831,35 +656,33 @@ w_class = 2.0 m_amt = 50 origin_tech = "engineering=1" + attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked") /obj/item/weapon/crowbar/red - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "red_crowbar" item_state = "crowbar_red" /obj/item/weapon/cane name = "cane" - desc = "A cane used by a true gentlemen." - icon = 'weapons.dmi' + desc = "A cane used by a true gentlemen. Or a clown." + icon = 'icons/obj/weapons.dmi' icon_state = "cane" + item_state = "cane" flags = FPRINT | TABLEPASS| CONDUCT - force = 6.0 + force = 5.0 throwforce = 7.0 - item_state = "browncane" w_class = 2.0 m_amt = 50 - -/obj/item/weapon/cane/browncane - name = " browncane" - icon_state = "browncane" + attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") /obj/item/weapon/disk name = "disk" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' /obj/item/weapon/disk/nuclear name = "nuclear authentication disk" - desc = "Better keep this safe, it can activate the nuke." + desc = "Better keep this safe." icon_state = "nucleardisk" item_state = "card-id" w_class = 1.0 @@ -873,19 +696,20 @@ /obj/item/weapon/extinguisher name = "fire extinguisher" desc = "A traditional red fire extinguisher." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "fire_extinguisher0" var/last_use = 1.0 var/safety = 1 - hitsound = 'smash.ogg' + hitsound = 'sound/weapons/smash.ogg' flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT throwforce = 10 w_class = 3.0 throw_speed = 2 throw_range = 10 - force = 15.0 + force = 10.0 item_state = "fire_extinguisher" m_amt = 90 + attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") /obj/item/weapon/extinguisher/mini name = "fire extinguisher" @@ -893,16 +717,16 @@ icon_state = "miniFE0" hitsound = null //it is much lighter, after all. flags = FPRINT | USEDELAY | TABLEPASS - throwforce = 5 + throwforce = 2 w_class = 2.0 - force = 6.0 + force = 3.0 item_state = "miniFE" m_amt = 0 /obj/item/weapon/f_card name = "finger print card" desc = "Used to take fingerprints." - icon = 'card.dmi' + icon = 'icons/obj/card.dmi' icon_state = "fingerprint0" var/amount = 10.0 item_state = "paper" @@ -914,14 +738,14 @@ /obj/item/weapon/fcardholder name = "fingerprint card case" - desc = "Holds fingerprint cards." - icon = 'items.dmi' + desc = "Apply finger print card." + icon = 'icons/obj/items.dmi' icon_state = "fcardholder0" item_state = "clipboard" /obj/item/weapon/flasks name = "flask" - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' var/oxygen = 0.0 var/plasma = 0.0 var/coolant = 0.0 @@ -941,9 +765,10 @@ icon_state = "plasma-c" plasma = 500.0 +/* /obj/item/weapon/game_kit name = "Gaming Kit" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "game_kit" var/selected = null var/board_stat = null @@ -951,11 +776,12 @@ var/base_url = "http://svn.slurm.us/public/spacestation13/misc/game_kit" item_state = "sheet-metal" w_class = 5.0 +*/ /obj/item/weapon/gift name = "gift" desc = "A wrapped item." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "gift3" var/size = 3.0 var/obj/item/gift = null @@ -965,7 +791,7 @@ /obj/item/weapon/hand_tele name = "hand tele" desc = "A portable item using blue-space technology." - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "hand_tele" item_state = "electronic" throwforce = 5 @@ -979,7 +805,7 @@ name = "handcuffs" desc = "Use this to keep prisoners in line." gender = PLURAL - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "handcuff" flags = FPRINT | TABLEPASS | CONDUCT slot_flags = SLOT_BELT @@ -1026,10 +852,59 @@ dispenser = 1 +/obj/item/weapon/legcuffs + name = "legcuffs" + desc = "Use this to keep prisoners in line." + gender = PLURAL + icon = 'icons/obj/items.dmi' + icon_state = "handcuff" + flags = FPRINT | TABLEPASS | CONDUCT + throwforce = 0 + w_class = 3.0 + throw_speed = 2 + throw_range = 0 //cannot be thrown + origin_tech = "materials=1" + var/breakouttime = 300 //Deciseconds = 30s = 0.5 minute + +/obj/item/weapon/legcuffs/beartrap + name = "bear trap" + icon_state = "beartrap" + desc = "A trap used to catch bears and other legged creatures." + breakouttime = 300 //Deciseconds = 30s = 0.5 minute + var/armed = 0 + +/obj/item/weapon/legcuffs/beartrap/attack_self() + ..() + if(ishuman(usr) && !usr.stat && !usr.restrained()) + armed = !armed + usr << "\blue \the [src] is now [(armed)?"armed":"disarmed"]" + +/obj/item/weapon/legcuffs/beartrap/HasEntered(AM as mob|obj) + if(armed) + if(ishuman(AM)) + if(isturf(src.loc)) + var/mob/living/carbon/H = AM + if(H.m_intent == "run") + armed = 0 + usr.legcuffed = src + src.loc = usr + usr.update_inv_legcuffed() + H << "\red You step on \the [src]!" + feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart. + for(var/mob/O in viewers(H, null)) + if(O == H) + continue + O.show_message("\red [H] steps on \the [src].", 1) + if(isanimal(AM)) + armed = 0 + var/mob/living/simple_animal/SA = AM + SA.health = 0 + ..() + /obj/item/weapon/locator name = "locator" desc = "Used to track those with locater implants." - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "locator" var/temp = null var/frequency = 1451 @@ -1046,7 +921,7 @@ /obj/item/weapon/caution desc = "Caution! Wet Floor!" name = "wet floor sign" - icon = 'janitor.dmi' + icon = 'icons/obj/janitor.dmi' icon_state = "caution" force = 1.0 throwforce = 3.0 @@ -1054,38 +929,18 @@ throw_range = 5 w_class = 2.0 flags = FPRINT | TABLEPASS + attack_verb = list("warned", "cautioned", "smashed") /obj/item/weapon/caution/cone desc = "This cone is trying to warn you of something!" name = "warning cone" icon_state = "cone" -/obj/item/weapon/paper - name = "\improper Paper" - icon = 'paper.dmi' - icon_state = "paper" - var/info = null - var/infoold = null - throwforce = 0 - w_class = 1.0 - throw_speed = 3 - throw_range = 15 - layer = 4 - var/list/stamped - see_face = 1 - body_parts_covered = HEAD - slot_flags = SLOT_HEAD - heat_transfer_coefficient = 0.99 - gas_transfer_coefficient = 1 - permeability_coefficient = 0.99 - siemens_coefficient = 0.80 - var/iteration - /obj/item/weapon/directions name = "crumpled paper" gender = PLURAL desc = "This is a crumpled piece of paper." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "crumpled" throwforce = 0 w_class = 1.0 @@ -1094,30 +949,19 @@ //layer = 4 /obj/item/weapon/paper/Court - name = "paper - 'Judgement'" + name = "paper- 'Judgement'" info = "For crimes against the station, the offender is sentenced to:
\n
\n" -//Please resist giving this to people who have not survived game breaking bugs. -/*Current recipients: -Searif: Survived infinite cold bug, body temp was "-nan", still alive. -eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discovery of that code and subsequent diking out. -*/ -/obj/item/weapon/paper/certificate - name = "paper - 'Certificate'" - info = "Due to this person's unique actions in the past, we hereby certify that they are \"Well Qualified\"

----Central Command
This paper has been stamped with the central command rubber stamp.
" - stamped = list(/obj/item/weapon/stamp/centcom) - overlays = list("paper_stamped_cent") - /obj/item/weapon/paper/Toxin - name = "paper - 'Chemical Information'" + name = "paper- 'Chemical Information'" info = "Known Onboard Toxins:
\n\tGrade A Semi-Liquid Plasma:
\n\t\tHighly poisonous. You cannot sustain concentrations above 15 units.
\n\t\tA gas mask fails to filter plasma after 50 units.
\n\t\tWill attempt to diffuse like a gas.
\n\t\tFiltered by scrubbers.
\n\t\tThere is a bottled version which is very different
\n\t\t\tfrom the version found in canisters!
\n
\n\t\tWARNING: Highly Flammable. Keep away from heat sources
\n\t\texcept in a enclosed fire area!
\n\t\tWARNING: It is a crime to use this without authorization.
\nKnown Onboard Anti-Toxin:
\n\tAnti-Toxin Type 01P: Works against Grade A Plasma.
\n\t\tBest if injected directly into bloodstream.
\n\t\tA full injection is in every regular Med-Kit.
\n\t\tSpecial toxin Kits hold around 7.
\n
\nKnown Onboard Chemicals (other):
\n\tRejuvenation T#001:
\n\t\tEven 1 unit injected directly into the bloodstream
\n\t\t\twill cure paralysis and sleep toxins.
\n\t\tIf administered to a dying patient it will prevent
\n\t\t\tfurther damage for about units*3 seconds.
\n\t\t\tit will not cure them or allow them to be cured.
\n\t\tIt can be administeredd to a non-dying patient
\n\t\t\tbut the chemicals disappear just as fast.
\n\tSleep Toxin T#054:
\n\t\t5 units wilkl induce precisely 1 minute of sleep.
\n\t\t\tThe effect are cumulative.
\n\t\tWARNING: It is a crime to use this without authorization" /obj/item/weapon/paper/courtroom - name = "paper - 'A Crash Course in Legal SOP on SS13'" + name = "paper- 'A Crash Course in Legal SOP on SS13'" info = "Roles:
\nThe Detective is basically the investigator and prosecutor.
\nThe Staff Assistant can perform these functions with written authority from the Detective.
\nThe Captain/HoP/Warden is ct as the judicial authority.
\nThe Security Officers are responsible for executing warrants, security during trial, and prisoner transport.
\n
\nInvestigative Phase:
\nAfter the crime has been committed the Detective's job is to gather evidence and try to ascertain not only who did it but what happened. He must take special care to catalogue everything and don't leave anything out. Write out all the evidence on paper. Make sure you take an appropriate number of fingerprints. IF he must ask someone questions he has permission to confront them. If the person refuses he can ask a judicial authority to write a subpoena for questioning. If again he fails to respond then that person is to be jailed as insubordinate and obstructing justice. Said person will be released after he cooperates.
\n
\nONCE the FT has a clear idea as to who the criminal is he is to write an arrest warrant on the piece of paper. IT MUST LIST THE CHARGES. The FT is to then go to the judicial authority and explain a small version of his case. If the case is moderately acceptable the authority should sign it. Security must then execute said warrant.
\n
\nPre-Pre-Trial Phase:
\nNow a legal representative must be presented to the defendant if said defendant requests one. That person and the defendant are then to be given time to meet (in the jail IS ACCEPTABLE). The defendant and his lawyer are then to be given a copy of all the evidence that will be presented at trial (rewriting it all on paper is fine). THIS IS CALLED THE DISCOVERY PACK. With a few exceptions, THIS IS THE ONLY EVIDENCE BOTH SIDES MAY USE AT TRIAL. IF the prosecution will be seeking the death penalty it MUST be stated at this time. ALSO if the defense will be seeking not guilty by mental defect it must state this at this time to allow ample time for examination.
\nNow at this time each side is to compile a list of witnesses. By default, the defendant is on both lists regardless of anything else. Also the defense and prosecution can compile more evidence beforehand BUT in order for it to be used the evidence MUST also be given to the other side.\nThe defense has time to compile motions against some evidence here.
\nPossible Motions:
\n1. Invalidate Evidence- Something with the evidence is wrong and the evidence is to be thrown out. This includes irrelevance or corrupt security.
\n2. Free Movement- Basically the defendant is to be kept uncuffed before and during the trial.
\n3. Subpoena Witness- If the defense presents god reasons for needing a witness but said person fails to cooperate then a subpoena is issued.
\n4. Drop the Charges- Not enough evidence is there for a trial so the charges are to be dropped. The FT CAN RETRY but the judicial authority must carefully reexamine the new evidence.
\n5. Declare Incompetent- Basically the defendant is insane. Once this is granted a medical official is to examine the patient. If he is indeed insane he is to be placed under care of the medical staff until he is deemed competent to stand trial.
\n
\nALL SIDES MOVE TO A COURTROOM
\nPre-Trial Hearings:
\nA judicial authority and the 2 sides are to meet in the trial room. NO ONE ELSE BESIDES A SECURITY DETAIL IS TO BE PRESENT. The defense submits a plea. If the plea is guilty then proceed directly to sentencing phase. Now the sides each present their motions to the judicial authority. He rules on them. Each side can debate each motion. Then the judicial authority gets a list of crew members. He first gets a chance to look at them all and pick out acceptable and available jurors. Those jurors are then called over. Each side can ask a few questions and dismiss jurors they find too biased. HOWEVER before dismissal the judicial authority MUST agree to the reasoning.
\n
\nThe Trial:
\nThe trial has three phases.
\n1. Opening Arguments- Each side can give a short speech. They may not present ANY evidence.
\n2. Witness Calling/Evidence Presentation- The prosecution goes first and is able to call the witnesses on his approved list in any order. He can recall them if necessary. During the questioning the lawyer may use the evidence in the questions to help prove a point. After every witness the other side has a chance to cross-examine. After both sides are done questioning a witness the prosecution can present another or recall one (even the EXACT same one again!). After prosecution is done the defense can call witnesses. After the initial cases are presented both sides are free to call witnesses on either list.
\nFINALLY once both sides are done calling witnesses we move onto the next phase.
\n3. Closing Arguments- Same as opening.
\nThe jury then deliberates IN PRIVATE. THEY MUST ALL AGREE on a verdict. REMEMBER: They mix between some charges being guilty and others not guilty (IE if you supposedly killed someone with a gun and you unfortunately picked up a gun without authorization then you CAN be found not guilty of murder BUT guilty of possession of illegal weaponry.). Once they have agreed they present their verdict. If unable to reach a verdict and feel they will never they call a deadlocked jury and we restart at Pre-Trial phase with an entirely new set of jurors.
\n
\nSentencing Phase:
\nIf the death penalty was sought (you MUST have gone through a trial for death penalty) then skip to the second part.
\nI. Each side can present more evidence/witnesses in any order. There is NO ban on emotional aspects or anything. The prosecution is to submit a suggested penalty. After all the sides are done then the judicial authority is to give a sentence.
\nII. The jury stays and does the same thing as I. Their sole job is to determine if the death penalty is applicable. If NOT then the judge selects a sentence.
\n
\nTADA you're done. Security then executes the sentence and adds the applicable convictions to the person's record.
\n" /obj/item/weapon/paper/hydroponics - name = "paper - 'Greetings from Billy Bob'" + name = "paper- 'Greetings from Billy Bob'" info = "Hey fellow botanist!
\n
\nI didn't trust the station folk so I left
\na couple of weeks ago. But here's some
\ninstructions on how to operate things here.
\nYou can grow plants and each iteration they become
\nstronger, more potent and have better yield, if you
\nknow which ones to pick. Use your botanist's analyzer
\nfor that. You can turn harvested plants into seeds
\nat the seed extractor, and replant them for better stuff!
\nSometimes if the weed level gets high in the tray
\nmutations into different mushroom or weed species have
\nbeen witnessed. On the rare occassion even weeds mutate!
\n
\nEither way, have fun!
\n
\nBest regards,
\nBilly Bob Johnson.
\n
\nPS.
\nHere's a few tips:
\nIn nettles, potency = damage
\nIn amanitas, potency = deadliness + side effect
\nIn Liberty caps, potency = drug power + effect
\nIn chilis, potency = heat
\nNutrients keep mushrooms alive!
\nWater keeps weeds such as nettles alive!
\nAll other plants need both." /obj/item/weapon/paper/flag @@ -1126,7 +970,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove anchored = 1.0 /obj/item/weapon/paper/jobs - name = "paper - 'Job Information'" + name = "paper- 'Job Information'" info = "Information on all formal jobs that can be assigned on Space Station 13 can be found on this document.
\nThe data will be in the following form.
\nGenerally lower ranking positions come first in this list.
\n
\nJob Name general access>lab access-engine access-systems access (atmosphere control)
\n\tJob Description
\nJob Duties (in no particular order)
\nTips (where applicable)
\n
\nResearch Assistant 1>1-0-0
\n\tThis is probably the lowest level position. Anyone who enters the space station after the initial job\nassignment will automatically receive this position. Access with this is restricted. Head of Personnel should\nappropriate the correct level of assistance.
\n1. Assist the researchers.
\n2. Clean up the labs.
\n3. Prepare materials.
\n
\nStaff Assistant 2>0-0-0
\n\tThis position assists the security officer in his duties. The staff assisstants should primarily br\npatrolling the ship waiting until they are needed to maintain ship safety.\n(Addendum: Updated/Elevated Security Protocols admit issuing of low level weapons to security personnel)
\n1. Patrol ship/Guard key areas
\n2. Assist security officer
\n3. Perform other security duties.
\n
\nTechnical Assistant 1>0-0-1
\n\tThis is yet another low level position. The technical assistant helps the engineer and the statian\ntechnician with the upkeep and maintenance of the station. This job is very important because it usually\ngets to be a heavy workload on station technician and these helpers will alleviate that.
\n1. Assist Station technician and Engineers.
\n2. Perform general maintenance of station.
\n3. Prepare materials.
\n
\nMedical Assistant 1>1-0-0
\n\tThis is the fourth position yet it is slightly less common. This position doesn't have much power\noutside of the med bay. Consider this position like a nurse who helps to upkeep medical records and the\nmaterials (filling syringes and checking vitals)
\n1. Assist the medical personnel.
\n2. Update medical files.
\n3. Prepare materials for medical operations.
\n
\nResearch Technician 2>3-0-0
\n\tThis job is primarily a step up from research assistant. These people generally do not get their own lab\nbut are more hands on in the experimentation process. At this level they are permitted to work as consultants to\nthe others formally.
\n1. Inform superiors of research.
\n2. Perform research alongside of official researchers.
\n
\nDetective 3>2-0-0
\n\tThis job is in most cases slightly boring at best. Their sole duty is to\nperform investigations of crine scenes and analysis of the crime scene. This\nalleviates SOME of the burden from the security officer. This person's duty\nis to draw conclusions as to what happened and testify in court. Said person\nalso should stroe the evidence ly.
\n1. Perform crime-scene investigations/draw conclusions.
\n2. Store and catalogue evidence properly.
\n3. Testify to superiors/inquieries on findings.
\n
\nStation Technician 2>0-2-3
\n\tPeople assigned to this position must work to make sure all the systems aboard Space Station 13 are operable.\nThey should primarily work in the computer lab and repairing faulty equipment. They should work with the\natmospheric technician.
\n1. Maintain SS13 systems.
\n2. Repair equipment.
\n
\nAtmospheric Technician 3>0-0-4
\n\tThese people should primarily work in the atmospheric control center and lab. They have the very important\njob of maintaining the delicate atmosphere on SS13.
\n1. Maintain atmosphere on SS13
\n2. Research atmospheres on the space station. (safely please!)
\n
\nEngineer 2>1-3-0
\n\tPeople working as this should generally have detailed knowledge as to how the propulsion systems on SS13\nwork. They are one of the few classes that have unrestricted access to the engine area.
\n1. Upkeep the engine.
\n2. Prevent fires in the engine.
\n3. Maintain a safe orbit.
\n
\nMedical Researcher 2>5-0-0
\n\tThis position may need a little clarification. Their duty is to make sure that all experiments are safe and\nto conduct experiments that may help to improve the station. They will be generally idle until a new laboratory\nis constructed.
\n1. Make sure the station is kept safe.
\n2. Research medical properties of materials studied of Space Station 13.
\n
\nScientist 2>5-0-0
\n\tThese people study the properties, particularly the toxic properties, of materials handled on SS13.\nTechnically they can also be called Plasma Technicians as plasma is the material they routinly handle.
\n1. Research plasma
\n2. Make sure all plasma is properly handled.
\n
\nMedical Doctor (Officer) 2>0-0-0
\n\tPeople working this job should primarily stay in the medical area. They should make sure everyone goes to\nthe medical bay for treatment and examination. Also they should make sure that medical supplies are kept in\norder.
\n1. Heal wounded people.
\n2. Perform examinations of all personnel.
\n3. Moniter usage of medical equipment.
\n
\nSecurity Officer 3>0-0-0
\n\tThese people should attempt to keep the peace inside the station and make sure the station is kept safe. One\nside duty is to assist in repairing the station. They also work like general maintenance personnel. They are not\ngiven a weapon and must use their own resources.
\n(Addendum: Updated/Elevated Security Protocols admit issuing of weapons to security personnel)
\n1. Maintain order.
\n2. Assist others.
\n3. Repair structural problems.
\n
\nHead of Security 4>5-2-2
\n\tPeople assigned as Head of Security should issue orders to the security staff. They should\nalso carefully moderate the usage of all security equipment. All security matters should be reported to this person.
\n1. Oversee security.
\n2. Assign patrol duties.
\n3. Protect the station and staff.
\n
\nHead of Personnel 4>4-2-2
\n\tPeople assigned as head of personnel will find themselves moderating all actions done by personnel. \nAlso they have the ability to assign jobs and access levels.
\n1. Assign duties.
\n2. Moderate personnel.
\n3. Moderate research.
\n
\nCaptain 5>5-5-5 (unrestricted station wide access)
\n\tThis is the highest position youi can aquire on Space Station 13. They are allowed anywhere inside the\nspace station and therefore should protect their ID card. They also have the ability to assign positions\nand access levels. They should not abuse their power.
\n1. Assign all positions on SS13
\n2. Inspect the station for any problems.
\n3. Perform administrative duties.
\n" /obj/item/weapon/paper/photograph @@ -1136,63 +980,13 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove item_state = "paper" /obj/item/weapon/paper/sop - name = "paper - 'Standard Operating Procedure'" + name = "paper- 'Standard Operating Procedure'" info = "Alert Levels:
\nBlue- Emergency
\n\t1. Caused by fire
\n\t2. Caused by manual interaction
\n\tAction:
\n\t\tClose all fire doors. These can only be opened by reseting the alarm
\nRed- Ejection/Self Destruct
\n\t1. Caused by module operating computer.
\n\tAction:
\n\t\tAfter the specified time the module will eject completely.
\n
\nEngine Maintenance Instructions:
\n\tShut off ignition systems:
\n\tActivate internal power
\n\tActivate orbital balance matrix
\n\tRemove volatile liquids from area
\n\tWear a fire suit
\n
\n\tAfter
\n\t\tDecontaminate
\n\t\tVisit medical examiner
\n
\nToxin Laboratory Procedure:
\n\tWear a gas mask regardless
\n\tGet an oxygen tank.
\n\tActivate internal atmosphere
\n
\n\tAfter
\n\t\tDecontaminate
\n\t\tVisit medical examiner
\n
\nDisaster Procedure:
\n\tFire:
\n\t\tActivate sector fire alarm.
\n\t\tMove to a safe area.
\n\t\tGet a fire suit
\n\t\tAfter:
\n\t\t\tAssess Damage
\n\t\t\tRepair damages
\n\t\t\tIf needed, Evacuate
\n\tMeteor Shower:
\n\t\tActivate fire alarm
\n\t\tMove to the back of ship
\n\t\tAfter
\n\t\t\tRepair damage
\n\t\t\tIf needed, Evacuate
\n\tAccidental Reentry:
\n\t\tActivate fire alrms in front of ship.
\n\t\tMove volatile matter to a fire proof area!
\n\t\tGet a fire suit.
\n\t\tStay secure until an emergency ship arrives.
\n
\n\t\tIf ship does not arrive-
\n\t\t\tEvacuate to a nearby safe area!" -/obj/item/weapon/paper/armoury - name = "paper - 'Armoury Inventory'" - info = "

Armoury Inventory



ItemStockIn UseNotes
Ablative Armour Vest10-
Beanbag Shells120-
Body Bags10-
Bulletproof Vest10-
Chemical Implant Kit10-
Combat Shotguns20-
Deployable Barrier90-
Deployable Flashers40-
Energy Gun60-
Flashbangs70-
Gas Mask30-
Handcuffs70-
Ion Rifle10-
L3 Biohazard Suit10-
L4 EOD Suit10-
Laser Gun10-
Lockbox10-
Loyalty Implants Lockbox10-
Pepper Sprayers20-
RIG Helmet10-
RIG Suit10-
Riot Helmet30-
Riot Shield30-
Riot Suit30-
Stun Baton50-
Taser30-
Tracking Implant Kit10-



Officer NameItems WithdrawnNotes
-
-
-



List maintained by NSS Exodus, Warden,

" - -/obj/item/weapon/paper_bin - name = "Paper Bin" - desc = "This contains many papers." - icon = 'paper.dmi' - icon_state = "paper_bin1" - var/amount = 30.0 - item_state = "sheet-metal" - throwforce = 1 - w_class = 3.0 - throw_speed = 3 - throw_range = 7 - -/obj/item/weapon/pen - desc = "It's a normal black ink pen." - name = "pen" - icon = 'paper.dmi' - icon_state = "pen" - flags = FPRINT | TABLEPASS - slot_flags = SLOT_BELT - throwforce = 0 - w_class = 1.0 - throw_speed = 7 - throw_range = 15 - m_amt = 10 - var/text_size = 2 - var/text_color = "#000000" - var/text_bold = 0 - var/text_italic = 0 - var/text_underline = 0 - var/text_break = 0 - -/obj/item/weapon/pen/blue - desc = "It's a normal blue ink pen." - icon_state = "pen_blue" - text_color = "#00000F" - -/obj/item/weapon/pen/red - desc = "It's a normal red ink pen." - icon_state = "pen_red" - text_color = "#FF0000" - -/obj/item/weapon/pen/feather - name = "feathery pen" - desc = "A gold pen disguised as a quill. How quaint." - icon_state = "featherpen" - /obj/item/weapon/banhammer desc = "A banhammer" name = "banhammer" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "toyhammer" flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT @@ -1200,9 +994,10 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove w_class = 1.0 throw_speed = 7 throw_range = 15 + attack_verb = list("banned") /obj/item/weapon/pen/sleepypen - desc = "It's a normal black ink pen with a sharp point." + desc = "It's a normal black ink pen with a sharp point and a carefully engraved \"Waffle Co.\"" flags = FPRINT | TABLEPASS | OPENCONTAINER slot_flags = SLOT_BELT origin_tech = "materials=2;biotech=1;syndicate=7" @@ -1216,7 +1011,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/rack_parts name = "rack parts" desc = "Parts of a rack." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "rack_parts" flags = FPRINT | TABLEPASS| CONDUCT m_amt = 3750 @@ -1224,15 +1019,15 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/rubber_chicken name = "rubber chicken" desc = "A rubber chicken, isn't that hilarious?" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "rubber_chicken" item_state = "rubber_chicken" w_class = 2.0 /obj/item/weapon/screwdriver name = "screwdriver" - desc = "Used for screwing." - icon = 'items.dmi' + desc = "You can be totally screwwy with this." + icon = 'icons/obj/items.dmi' icon_state = "screwdriver" flags = FPRINT | TABLEPASS| CONDUCT slot_flags = SLOT_BELT @@ -1243,22 +1038,43 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove throw_range = 5 g_amt = 0 m_amt = 75 + attack_verb = list("stabbed") /obj/item/weapon/shard name = "shard" - icon = 'shards.dmi' + icon = 'icons/obj/shards.dmi' icon_state = "large" desc = "Could probably be used as ... a throwing weapon?" w_class = 1.0 - force = 7.0 + force = 5.0 throwforce = 15.0 item_state = "shard-glass" g_amt = 3750 + attack_verb = list("stabbed", "slashed", "sliced", "cut") + +/*/obj/item/weapon/syndicate_uplink + name = "station bounced radio" + desc = "Remain silent about this..." + icon = 'icons/obj/radio.dmi' + icon_state = "radio" + var/temp = null + var/uses = 10.0 + var/selfdestruct = 0.0 + var/traitor_frequency = 0.0 + var/mob/currentUser = null + var/obj/item/device/radio/origradio = null + flags = FPRINT | TABLEPASS | CONDUCT | ONBELT + w_class = 2.0 + item_state = "radio" + throw_speed = 4 + throw_range = 20 + m_amt = 100 + origin_tech = "magnets=2;syndicate=3"*/ /obj/item/weapon/SWF_uplink name = "station-bounced radio" desc = "used to comunicate it appears." - icon = 'radio.dmi' + icon = 'icons/obj/radio.dmi' icon_state = "radio" var/temp = null var/uses = 4.0 @@ -1277,8 +1093,8 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/spellbook name = "spell book" - desc = "The legendary book of spells of a wizard." - icon = 'library.dmi' + desc = "The legendary book of spells of the wizard." + icon = 'icons/obj/library.dmi' icon_state ="book" throw_speed = 1 throw_range = 5 @@ -1286,17 +1102,13 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove flags = FPRINT | TABLEPASS var/uses = 5.0 var/temp = null - var/spell_type = "verb" var/max_uses = 5 var/op = 1 -/obj/item/weapon/spellbook/object_type_spells //used for giving out object spells as opposed to verb spells - spell_type = "object" - /obj/item/weapon/staff name = "wizards staff" - desc = "Apparently a staff used by a wizard." - icon = 'wizard.dmi' + desc = "Apparently a staff used by the wizard." + icon = 'icons/obj/wizard.dmi' icon_state = "staff" force = 3.0 throwforce = 5.0 @@ -1304,12 +1116,12 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove throw_range = 5 w_class = 2.0 flags = FPRINT | TABLEPASS | NOSHIELD - + attack_verb = list("bludgeoned", "whacked", "disciplined") /obj/item/weapon/staff/stick name = "stick" desc = "A great tool to drag someone else's drinks across the bar." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "stick" item_state = "stick" force = 3.0 @@ -1323,15 +1135,16 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove name = "table parts" desc = "Parts of a table. Poor table." gender = PLURAL - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "table_parts" m_amt = 3750 flags = FPRINT | TABLEPASS| CONDUCT + attack_verb = list("slammed", "bashed", "battered", "bludgeoned", "thrashed", "whacked") /obj/item/weapon/table_parts/reinforced name = "reinforced table parts" desc = "Hard table parts. Well...harder..." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "reinf_tableparts" m_amt = 7500 flags = FPRINT | TABLEPASS| CONDUCT @@ -1345,7 +1158,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/teleportation_scroll name = "scroll of teleportation" desc = "A scroll for moving around." - icon = 'wizard.dmi' + icon = 'icons/obj/wizard.dmi' icon_state = "scroll" var/uses = 4.0 flags = FPRINT | TABLEPASS @@ -1358,29 +1171,30 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/wire desc = "This is just a simple piece of regular insulated wire." name = "wire" - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "item_wire" var/amount = 1.0 var/laying = 0.0 var/old_lay = null m_amt = 40 + attack_verb = list("whipped", "lashed", "disciplined", "tickled") /obj/item/weapon/wrapping_paper name = "wrapping paper" desc = "You can use this to wrap items in." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "wrap_paper" var/amount = 20.0 /obj/item/weapon/cell name = "power cell" desc = "A rechargable electrochemical power cell." - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "cell" item_state = "cell" origin_tech = "powerstorage=1" flags = FPRINT|TABLEPASS - force = 10.0 + force = 5.0 throwforce = 5.0 throw_speed = 3 throw_range = 5 @@ -1396,7 +1210,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove var/construction_time=100 /obj/item/weapon/cell/crap - name = "\improper NanoTrasen Brand Rechargable AA Battery" + name = "\improper Nanotrasen brand rechargable AA battery" desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT origin_tech = "powerstorage=0" maxcharge = 500 @@ -1464,8 +1278,8 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove name = "potato battery" desc = "A rechargable starch based power cell." origin_tech = "powerstorage=1" - icon = 'power.dmi' //'harvest.dmi' - icon_state = "cell" //"potato_battery" + icon = 'icons/obj/power.dmi' //'icons/obj/harvest.dmi' + icon_state = "potato_cell" //"potato_battery" charge = 100 maxcharge = 300 m_amt = 0 @@ -1474,7 +1288,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/camera_bug/attack_self(mob/usr as mob) var/list/cameras = new/list() - for (var/obj/machinery/camera/C in world) + for (var/obj/machinery/camera/C in Cameras) if (C.bugged && C.status) cameras.Add(C) if (length(cameras) == 0) @@ -1486,7 +1300,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove for (var/obj/machinery/camera/C in cameras) friendly_cameras.Add(C.c_tag) - var/target = input("Select the camera to observe.", null) as null|anything in friendly_cameras + var/target = input("Select the camera to observe", null) as null|anything in friendly_cameras if (!target) return for (var/obj/machinery/camera/C in cameras) @@ -1499,7 +1313,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/module - icon = 'module.dmi' + icon = 'icons/obj/module.dmi' icon_state = "std_module" w_class = 2.0 item_state = "electronic" @@ -1515,8 +1329,6 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove name = "power control module" icon_state = "power_mod" desc = "Heavy-duty switching circuits for power control." - m_amt = 50 - g_amt = 50 /obj/item/weapon/module/id_auth name = "\improper ID authentication module" @@ -1536,8 +1348,8 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/a_gift name = "gift" - desc = "A gift, it appears." - icon = 'items.dmi' + desc = "A gift it appears." + icon = 'icons/obj/items.dmi' icon_state = "gift" item_state = "gift" pressure_resistance = 70 @@ -1545,7 +1357,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/camera_bug name = "camera bug" - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "flash" w_class = 1.0 item_state = "electronic" @@ -1554,21 +1366,22 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/kitchen - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' /obj/item/weapon/kitchen/rollingpin name = "rolling pin" - desc = "Used to flatten dough." + desc = "Used to knock out the Bartender." icon_state = "rolling_pin" force = 8.0 throwforce = 10.0 throw_speed = 2 throw_range = 7 w_class = 3.0 + attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") //I think the rollingpin attackby will end up ignoring this anyway. /obj/item/weapon/kitchenknife name = "kitchen knife" - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "knife" desc = "A general purpose Chef's Knife made by SpaceCook Incorporated. Guaranteed to stay sharp for years to come." flags = FPRINT | TABLEPASS | CONDUCT @@ -1579,12 +1392,13 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove throw_range = 6 m_amt = 12000 origin_tech = "materials=1" + attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") /obj/item/weapon/butch - name = "butcher's cleaver" - icon = 'kitchen.dmi' + name = "butcher's Cleaver" + icon = 'icons/obj/kitchen.dmi' icon_state = "butch" - desc = "A huge thing used for chopping and chopping up meat." + desc = "A huge thing used for chopping and chopping up meat. This includes clowns and clown-by-products." flags = FPRINT | TABLEPASS | CONDUCT force = 15.0 w_class = 2.0 @@ -1593,10 +1407,11 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove throw_range = 6 m_amt = 12000 origin_tech = "materials=1" + attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") /obj/item/weapon/tray name = "tray" - icon = 'food.dmi' + icon = 'icons/obj/food.dmi' icon_state = "tray" desc = "A metal tray to lay food on." throwforce = 12.0 @@ -1635,13 +1450,13 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove throw_range = 5 flags = FPRINT | TABLEPASS | CONDUCT origin_tech = "materials=1" + attack_verb = list("attacked", "stabbed", "poked") /obj/item/weapon/kitchen/utensil/fork name = "fork" desc = "Pointy." icon_state = "fork" - var/obj/item/weapon/reagent_containers/food/snacks/bite /obj/item/weapon/kitchen/utensil/knife name = "knife" @@ -1654,11 +1469,12 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove name = "spoon" desc = "SPOON!" icon_state = "spoon" + attack_verb = list("attacked", "poked") /obj/item/weapon/scalpel name = "scalpel" desc = "Cut, cut, and once more cut." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "scalpel" flags = FPRINT | TABLEPASS | CONDUCT force = 10.0 @@ -1669,12 +1485,15 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove m_amt = 10000 g_amt = 5000 origin_tech = "materials=1;biotech=1" + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") /obj/item/weapon/retractor name = "retractor" desc = "Retracts stuff." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "retractor" + m_amt = 10000 + g_amt = 5000 flags = FPRINT | TABLEPASS | CONDUCT w_class = 1.0 origin_tech = "materials=1;biotech=1" @@ -1682,38 +1501,47 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/hemostat name = "hemostat" desc = "You think you have seen this before." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "hemostat" + m_amt = 5000 + g_amt = 2500 flags = FPRINT | TABLEPASS | CONDUCT w_class = 1.0 origin_tech = "materials=1;biotech=1" + attack_verb = list("attacked", "pinched") /obj/item/weapon/cautery name = "cautery" desc = "This stops bleeding." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "cautery" + m_amt = 5000 + g_amt = 2500 flags = FPRINT | TABLEPASS | CONDUCT w_class = 1.0 origin_tech = "materials=1;biotech=1" + attack_verb = list("burnt") /obj/item/weapon/surgicaldrill name = "surgical drill" desc = "You can drill using this item. You dig?" - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "drill" - hitsound = 'circsawhit.ogg' + hitsound = 'sound/weapons/circsawhit.ogg' + m_amt = 15000 + g_amt = 10000 flags = FPRINT | TABLEPASS | CONDUCT force = 15.0 w_class = 1.0 origin_tech = "materials=1;biotech=1" + attack_verb = list("drilled") /obj/item/weapon/circular_saw name = "circular saw" desc = "For heavy duty cutting." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "saw3" - hitsound = 'circsawhit.ogg' + hitsound = 'sound/weapons/circsawhit.ogg' flags = FPRINT | TABLEPASS | CONDUCT force = 15.0 w_class = 1.0 @@ -1723,20 +1551,12 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove m_amt = 20000 g_amt = 10000 origin_tech = "materials=1;biotech=1" - -/obj/item/weapon/autopsy_scanner - name = "autopsy scanner" - desc = "Extracts information on wounds." - icon = 'autopsy_scanner.dmi' - icon_state = "" - flags = FPRINT | TABLEPASS | CONDUCT - w_class = 1.0 - origin_tech = "materials=1;biotech=1" + attack_verb = list("attacked", "slashed", "sawed", "cut") /obj/item/weapon/syntiflesh name = "syntiflesh" desc = "Meat that appears...strange..." - icon = 'food.dmi' + icon = 'icons/obj/food.dmi' icon_state = "meat" flags = FPRINT | TABLEPASS | CONDUCT w_class = 1.0 @@ -1745,7 +1565,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove /obj/item/weapon/hatchet name = "hatchet" desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "hatchet" flags = FPRINT | TABLEPASS | CONDUCT force = 12.0 @@ -1755,84 +1575,26 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove throw_range = 4 m_amt = 15000 origin_tech = "materials=2;combat=1" + attack_verb = list("chopped", "torn", "cut") -/obj/item/weapon/stamp - desc = "A rubber stamp for stamping important documents." - name = "rubber stamp" - icon = 'paper.dmi' - icon_state = "stamp-qm" - item_state = "stamp" - flags = FPRINT | TABLEPASS - throwforce = 0 - w_class = 1.0 - throw_speed = 7 - throw_range = 15 - m_amt = 60 - color = "cargo" - -/obj/item/weapon/stamp/captain - name = "captain's rubber stamp" - icon_state = "stamp-cap" - color = "captain" - -/obj/item/weapon/stamp/hop - name = "head of personnel's rubber stamp" - icon_state = "stamp-hop" - color = "hop" - -/obj/item/weapon/stamp/hos - name = "head of security's rubber stamp" - icon_state = "stamp-hos" - color = "hosred" - -/obj/item/weapon/stamp/ce - name = "chief engineer's rubber stamp" - icon_state = "stamp-ce" - color = "chief" - -/obj/item/weapon/stamp/rd - name = "research director's rubber stamp" - icon_state = "stamp-rd" - color = "director" - -/obj/item/weapon/stamp/cmo - name = "chief medical officer's rubber stamp" - icon_state = "stamp-cmo" - color = "medical" - -/obj/item/weapon/stamp/denied - name = "DENIED rubber stamp" - icon_state = "stamp-qm" - color = "redcoat" - -/obj/item/weapon/stamp/clown - name = "clown's rubber stamp" - icon_state = "stamp-clown" - color = "clown" - -/obj/item/weapon/stamp/centcom - name = "central command rubber stamp" - icon_state = "stamp-cent" - color = "centcom" /* /obj/item/weapon/cigarpacket name = "Pete's Cuban Cigars" desc = "The most robust cigars on the planet." - icon = 'cigarettes.dmi' + icon = 'icons/obj/cigarettes.dmi' icon_state = "cigarpacket" item_state = "cigarpacket" w_class = 1 throwforce = 2 var/cigarcount = 6 - flags = TABLEPASS - slot_flags = SLOT_BELT*/ + flags = ONBELT | TABLEPASS */ /obj/item/weapon/mousetrap name = "mousetrap" desc = "A handy little spring-loaded trap for catching pesty rodents." - icon = 'weapons.dmi' + icon = 'icons/obj/weapons.dmi' icon_state = "mousetrap" item_state = "mousetrap" w_class = 1 @@ -1845,18 +1607,11 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove icon_state = "mousetraparmed" armed = 1 -/obj/item/weapon/dice/d4 // -- SkyMarshal - name = "d4" - desc = "A dice with four sides." - sides = 4 - icon_state = "d20" - item_state = "dice" - /obj/item/weapon/dice // -- TLE name = "d6" desc = "A dice with six sides." var/sides = 6 - icon = 'dice.dmi' + icon = 'icons/obj/dice.dmi' icon_state = "d66" /obj/item/weapon/dice/New() @@ -1868,32 +1623,19 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove sides = 20 icon_state = "d2020" -/obj/item/weapon/dice/d8 // -- SkyMarshal - name = "d8" - desc = "A dice with eight sides." - sides = 8 - icon_state = "d20" - item_state = "dice" - -/obj/item/weapon/dice/d12 // -- SkyMarshal - name = "d12" - desc = "A dice with twelve sides." - sides = 12 - icon_state = "d20" - item_state = "dice" - /obj/item/weapon/pai_cable desc = "A flexible coated cable with a universal jack on one end." name = "data cable" - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "wire1" + var/obj/machinery/machine /obj/item/weapon/plastique name = "plastic explosives" - desc = "Used to put holes in specific areas without too much extra hole. Does not work on people." + desc = "Used to put holes in specific areas without too much extra hole." gender = PLURAL - icon = 'assemblies.dmi' + icon = 'icons/obj/assemblies.dmi' icon_state = "plastic-explosive0" item_state = "plasticx" flags = FPRINT | TABLEPASS | USEDELAY @@ -1908,7 +1650,7 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove name = "stock part" desc = "What?" gender = PLURAL - icon = 'stock_parts.dmi' + icon = 'icons/obj/stock_parts.dmi' w_class = 2.0 var/rating = 1 New() @@ -2106,55 +1848,12 @@ eternal248: Found broken and buggy Z-levels 7-12, ended up leading to my discove name = "ectoplasm" desc = "spooky" gender = PLURAL - icon = 'wizard.dmi' + icon = 'icons/obj/wizard.dmi' icon_state = "ectoplasm" /obj/item/weapon/research//Makes testing much less of a pain -Sieve name = "research" - icon = 'stock_parts.dmi' + icon = 'icons/obj/stock_parts.dmi' icon_state = "capacitor" desc = "A debug item for research." origin_tech = "materials=8;programming=8;magnets=8;powerstorage=8;bluespace=8;combat=8;biotech=8;syndicate=8" - -/obj/item/weapon/appendix - name = "appendix" - desc = "An appendix which looks perfectly healthy." - icon = 'food.dmi' - icon_state = "appendix" - -/obj/item/weapon/appendixinflamed - name = "inflamed appendix" - desc = "An appendix which appears to be inflamed." - icon = 'food.dmi' - icon_state = "appendixinflamed" - -/obj/item/weapon/megaphone - name = "megaphone" - desc = "A device used to project your voice. Loudly." - icon = 'items.dmi' - icon_state = "megaphone" - var/cooldown = 0 - -/obj/item/weapon/flavor - name = "bland flavoring packet" - desc = "A sachet of flavoring, designed to be used with \"LiquidFood\" rations. The flavor is indeterminable." - icon = 'food_ingredients.dmi' - var/descriptor = "disturbingly beige" //Description shown to onlookers. - color = "beige" //Color the icon should take on when this is applied. Also shown when it is mixed in. - var/newDesc = "It posesses a strange and unidentifiable taste. You try not to think to hard about it." //What gets pegged onto the description. - -/obj/item/weapon/flavor/red - name = "cherry flavoring packet" - desc = "A sachet of cherry flavoring, designed to be used with \"LiquidFood\" rations." - icon_state = "flavor-red" - descriptor = "garrishly red" - color = "red" - newDesc = "It has a faintly cherry taste, but still is hard to stomach. Reminds you of cough syrup." - -/obj/item/weapon/flavor/blue - name = "berry flavoring packet" - desc = "A sachet of berry flavoring, designed to be used with \"LiquidFood\" rations." - icon_state = "flavor-blue" - descriptor = "molted blue" - color = "blue" - newDesc = "It has a faint bitter berry taste, but still is hard to stomach. Strangely crunchy." diff --git a/code/defines/obj/window.dm b/code/defines/obj/window.dm index 5b4bdf2969..509380f4a2 100644 --- a/code/defines/obj/window.dm +++ b/code/defines/obj/window.dm @@ -1,6 +1,6 @@ /obj/structure/window name = "window" - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' desc = "A window." density = 1 layer = 3.2//Just above doors diff --git a/code/defines/procs/AStar.dm b/code/defines/procs/AStar.dm index 059a11b95b..0af47ba12c 100644 --- a/code/defines/procs/AStar.dm +++ b/code/defines/procs/AStar.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /* A Star pathfinding algorithm @@ -121,7 +121,7 @@ proc var/closed[] = new() var/path[] start = get_turf(start) - if(!start || !end) return 0 + if(!start) return 0 open.Enqueue(new /PathNode(start,null,0,call(start,dist)(end))) diff --git a/code/defines/procs/command_alert.dm b/code/defines/procs/command_alert.dm index d7a97fe254..23ee3c1119 100644 --- a/code/defines/procs/command_alert.dm +++ b/code/defines/procs/command_alert.dm @@ -1,5 +1,5 @@ -/proc/command_alert(var/text, var/title = "", var/maintitle = "NanoTrasen Update") - world << "

[maintitle]

" +/proc/command_alert(var/text, var/title = "") + world << "

[command_name()] Update

" if (title && length(title) > 0) world << "

[html_encode(title)]

" diff --git a/code/defines/procs/command_name.dm b/code/defines/procs/command_name.dm index 0225517894..255c3947db 100644 --- a/code/defines/procs/command_name.dm +++ b/code/defines/procs/command_name.dm @@ -3,8 +3,23 @@ var/command_name = null if (command_name) return command_name - var/name = "NanoTrasen" + var/name = "Central Command" +/* + if (prob(10)) + name += pick("Super", "Ultra") + name += " " + // Prefix + if (name) + name += pick("", "Central", "System", "Home", "Primary", "Alpha", "Friend", "Science", "Renegade") + else + name += pick("Central", "System", "Home", "Primary", "Alpha", "Friend", "Science", "Renegade") + if (name) + name += " " + + // Suffix + name += pick("Federation", "Command", "Alliance", "Unity", "Empire", "Confederation", "Kingdom", "Monarchy", "Complex", "Protectorate", "Commonwealth", "Imperium", "Republic") +*/ command_name = name return name diff --git a/code/defines/procs/dbcore.dm b/code/defines/procs/dbcore.dm index a517134d32..5da9d19fa5 100644 --- a/code/defines/procs/dbcore.dm +++ b/code/defines/procs/dbcore.dm @@ -1,42 +1,37 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 //cursors -#define Default_Cursor 0 -#define Client_Cursor 1 -#define Server_Cursor 2 - - +#define Default_Cursor 0 +#define Client_Cursor 1 +#define Server_Cursor 2 //conversions -#define TEXT_CONV 1 -#define RSC_FILE_CONV 2 -#define NUMBER_CONV 3 - - +#define TEXT_CONV 1 +#define RSC_FILE_CONV 2 +#define NUMBER_CONV 3 //column flag values: -#define IS_NUMERIC 1 -#define IS_BINARY 2 -#define IS_NOT_NULL 4 -#define IS_PRIMARY_KEY 8 -#define IS_UNSIGNED 16 - - +#define IS_NUMERIC 1 +#define IS_BINARY 2 +#define IS_NOT_NULL 4 +#define IS_PRIMARY_KEY 8 +#define IS_UNSIGNED 16 //types -#define TINYINT 1 -#define SMALLINT 2 -#define MEDIUMINT 3 -#define INTEGER 4 -#define BIGINT 5 -#define DECIMAL 6 -#define FLOAT 7 -#define DOUBLE 8 -#define DATE 9 -#define DATETIME 10 -#define TIMESTAMP 11 -#define TIME 12 -#define STRING 13 -#define BLOB 14 +#define TINYINT 1 +#define SMALLINT 2 +#define MEDIUMINT 3 +#define INTEGER 4 +#define BIGINT 5 +#define DECIMAL 6 +#define FLOAT 7 +#define DOUBLE 8 +#define DATE 9 +#define DATETIME 10 +#define TIMESTAMP 11 +#define TIME 12 +#define STRING 13 +#define BLOB 14 // TODO: Investigate more recent type additions and see if I can handle them. - Nadrew + // Deprecated! See global.dm for new configuration vars /* var/DB_SERVER = "" // This is the location of your MySQL server (localhost is USUALLY fine) @@ -52,6 +47,8 @@ DBConnection _db_con = _dm_db_new_con() proc Connect(dbi_handler=src.dbi,user_handler=src.user,password_handler=src.password,cursor_handler) + if(!sqllogging) + return 0 if(!src) return 0 cursor_handler = src.default_cursor if(!cursor_handler) cursor_handler = Default_Cursor @@ -59,7 +56,10 @@ DBConnection Disconnect() return _dm_db_close(_db_con) - IsConnected() return _dm_db_is_connected(_db_con) + IsConnected() + if(!sqllogging) return 0 + var/success = _dm_db_is_connected(_db_con) + return success Quote(str) return _dm_db_quote(_db_con,str) @@ -178,3 +178,30 @@ DBColumn if(TIME) return "TIME" if(STRING) return "STRING" if(BLOB) return "BLOB" + + +#undef Default_Cursor +#undef Client_Cursor +#undef Server_Cursor +#undef TEXT_CONV +#undef RSC_FILE_CONV +#undef NUMBER_CONV +#undef IS_NUMERIC +#undef IS_BINARY +#undef IS_NOT_NULL +#undef IS_PRIMARY_KEY +#undef IS_UNSIGNED +#undef TINYINT +#undef SMALLINT +#undef MEDIUMINT +#undef INTEGER +#undef BIGINT +#undef DECIMAL +#undef FLOAT +#undef DOUBLE +#undef DATE +#undef DATETIME +#undef TIMESTAMP +#undef TIME +#undef STRING +#undef BLOB diff --git a/code/defines/procs/forum_activation.dm b/code/defines/procs/forum_activation.dm index 88e9705e5e..cd7008cf12 100644 --- a/code/defines/procs/forum_activation.dm +++ b/code/defines/procs/forum_activation.dm @@ -77,7 +77,7 @@ dbcon.Disconnect() return - query = dbcon.NewQuery("UPDATE [forumsqldb].phpbb_user_group SET group_id = '[forum_authenticated_group]' WHERE user_id = '[uid]' AND group_id = '[forum_activated_group]'") // Replace 'Registered Users' group with 'Activated Users' + query = dbcon.NewQuery("UPDATE [forumsqldb].phpbb_user_group SET group_id = '[forum_authenticated_group]' WHERE user_id = '[uid]' AND group_id = '[forum_activated_group]'") // Replace 'registered_name Users' group with 'Activated Users' if(!query.Execute()) src << "Unable to move account into authenticated group. This error shouldn't occur, contact an administrator for help. Authentication failed." dbcon.Disconnect() diff --git a/code/defines/procs/gamehelpers.dm b/code/defines/procs/gamehelpers.dm index 5db2e698d8..1490e73a25 100644 --- a/code/defines/procs/gamehelpers.dm +++ b/code/defines/procs/gamehelpers.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /proc/dopage(src,target) var/href_list @@ -27,30 +27,46 @@ return A return 0 -/proc/get_random_turf(var/atom/A, var/list/L) - while(L.len > 0) - var/dir = pick(L) - L -= dir - var/turf/T = get_step(A,dir) - var/possible = 1 - - if(T.density == 0) - for(var/obj/I in T) - if(I.density == 1) - possible = 0 - break - - if(possible) - return T - - return - /proc/in_range(source, user) if(get_dist(source, user) <= 1) return 1 return 0 //not in range and not telekinetic +// Like view but bypasses luminosity check + +/proc/hear(var/range, var/atom/source) + + var/lum = source.luminosity + source.luminosity = 6 + + var/list/heard = view(range, source) + source.luminosity = lum + + return heard + + + + +//Magic constants obtained by using linear regression on right-angled triangles of sides 0=b) + return (k1*a) + (k2*b) //No sqrt or powers :) + else + return (k1*b) + (k2*a) +#undef k1 +#undef k2 + /proc/circlerange(center=usr,radius=3) var/turf/centerturf = get_turf(center) @@ -69,17 +85,17 @@ /proc/circleview(center=usr,radius=3) var/turf/centerturf = get_turf(center) - var/list/turfs = new/list() + var/list/atoms = new/list() var/rsq = radius * (radius+0.5) - for(var/atom/T in view(radius, centerturf)) - var/dx = T.x - centerturf.x - var/dy = T.y - centerturf.y + for(var/atom/A in view(radius, centerturf)) + var/dx = A.x - centerturf.x + var/dy = A.y - centerturf.y if(dx*dx + dy*dy <= rsq) - turfs += T + atoms += A //turfs += centerturf - return turfs + return atoms /proc/get_dist_euclidian(atom/Loc1 as turf|mob|obj,atom/Loc2 as turf|mob|obj) var/dx = Loc1.x - Loc2.x @@ -102,7 +118,7 @@ turfs += T return turfs -/proc/circleviewturfs(center=usr,radius=3) +/proc/circleviewturfs(center=usr,radius=3) //Is there even a diffrence between this proc and circlerangeturfs()? var/turf/centerturf = get_turf(center) var/list/turfs = new/list() @@ -115,16 +131,7 @@ turfs += T return turfs -// Like view but bypasses luminosity check -/proc/hear(var/range, var/atom/source) - var/lum = source.luminosity - source.luminosity = 6 - - var/list/heard = view(range, source) - source.luminosity = lum - - return heard //var/debug_mob = 0 @@ -132,26 +139,30 @@ // 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/client_check = 1, var/sight_check = 1, var/include_radio = 1, var/max_depth = 3) +/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) //debug_mob += O.contents.len - if(max_depth < 1) + if(!recursion_limit) return L + for(var/atom/A in O.contents) - for(var/atom/A in O) if(ismob(A)) var/mob/M = A if(client_check && !M.client) - L = recursive_mob_check(A, L, 1, 1, max_depth - 1) + 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 + L |= M + //world.log << "[recursion_limit] = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])" else if(include_radio && istype(A, /obj/item/device/radio)) - if(sight_check && isInSight(A, O)) - L += A - L = recursive_mob_check(A, L, 1, 1, max_depth - 1) + if(sight_check && !isInSight(A, O)) + continue + L |= A + + 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. @@ -164,14 +175,41 @@ var/list/hear = list() var/list/range = hear(R, T) - //debug_mob += range.len - for(var/turf/A in range) - hear += recursive_mob_check(A) - //world.log << "NEW: [debug_mob]" - //debug_mob = 0 + 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) return hear + +/proc/get_mobs_in_radio_ranges(var/list/obj/item/device/radio/radios, var/level = 0) + . = list() + + // Returns a list of mobs who can hear any of the radios given in @radios + var/list/speaker_coverage = list() + for(var/obj/item/device/radio/R in radios) + var/turf/speaker = get_turf(R) + if(speaker) + for(var/turf/T in hear(R.canhear_range,speaker)) + speaker_coverage += T + + // Try to find all the players who can hear the message + for(var/mob/M in player_list) + var/turf/ear = get_turf(M) + if(ear && (isnull(level) || level == ear.z)) + if(ear in speaker_coverage) + . += M + + return . + #define SIGN(X) ((X<0)?-1:1) proc @@ -204,6 +242,7 @@ proc if(T.opacity) return 0 return 1 +#undef SIGN proc/isInSight(var/atom/A, var/atom/B) var/turf/Aturf = get_turf(A) @@ -216,153 +255,4 @@ proc/isInSight(var/atom/A, var/atom/B) return 1 else - return 0 - - -proc/doafterattack(obj/target , obj/source) - - if (istype(target, /obj/item/weapon/storage/ )) - return 0 - - else if (locate (/obj/structure/table, source.loc)) - return 0 - - else if (!istype(target.loc, /turf/)) - return 0 - - else - return 1 - -proc/check_can_reach(atom/user, atom/target) - if(!in_range(user,target)) - return 0 - return CanReachThrough(get_turf(user), get_turf(target), target) - -//cael - not sure if there's an equivalent proc, but if there is i couldn't find it -//searches to see if M contains O somewhere -proc/is_carrying(var/M as mob, var/O as obj) - while(!istype(O,/area)) - if(O:loc == M) - return 1 - O = O:loc - return 0 - - //hackcopy from a ZAS function, first created for use with intertial_damper/new shielding -proc/CircleFloodFill(turf/start, var/radius = 3) - if(!istype(start)) - return list() - var - list - open = list(start) - closed = list() - possibles = circlerange(start,radius) - - while(open.len) - for(var/turf/T in open) - //Stop if there's a door, even if it's open. These are handled by indirect connection. - if(!T.HasDoor()) - - for(var/d in cardinal) - var/turf/O = get_step(T,d) - //Simple pass check. - if(O.ZCanPass(T, 1) && !(O in open) && !(O in closed) && O in possibles) - open += O - - open -= T - closed += T - - return closed - -//floods in a square area, flowing around any shielding but including all other turf types -//created initially for explosion / shield interaction -proc/ExplosionFloodFill(turf/start, var/radius = 3) - if(!istype(start)) - return list() - var - list - open = list(start) - closed = list() - possibles = range(start,radius) - - while(open.len) - for(var/turf/T in open) - for(var/turf/O in range(T,1)) - if( !(O in possibles) || O in open || O in closed ) - continue - var/shield_here = 0 - for(var/obj/effect/energy_field/E in O) - if(E.density) - shield_here = 1 - break - if(!shield_here) - open += O - - open -= T - closed += T - - return closed - -/* - -/obj/machinery/shield_gen/external/get_shielded_turfs() - var - list - open = list(get_turf(src)) - closed = list() - - while(open.len) - for(var/turf/T in open) - for(var/turf/O in orange(1, T)) - if(get_dist(O,src) > field_radius) - continue - var/add_this_turf = 0 - if(istype(O,/turf/space)) - for(var/turf/simulated/G in orange(1, O)) - add_this_turf = 1 - break - for(var/obj/structure/S in orange(1, O)) - add_this_turf = 1 - break - for(var/obj/structure/S in O) - add_this_turf = 0 - break - - if(add_this_turf && !(O in open) && !(O in closed)) - open += O - open -= T - closed += T - - return closed -*/ - -//floods in a circular area, flowing around any shielding but including all other turf types -//created initially for explosion / shield interaction -proc/ExplosionCircleFloodFill(turf/start, var/radius = 3) - if(!istype(start)) - return list() - var - list - open = list(start) - closed = list() - possibles = circlerange(start,radius) - - while(open.len) - for(var/turf/T in open) - for(var/turf/O in range(T,1)) - if(get_dist(O,start) > radius) - continue - - if( !(O in possibles) || O in open || O in closed ) - continue - var/shield_here = 0 - for(var/obj/effect/energy_field/E in O) - if(E.density) - shield_here = 1 - break - if(!shield_here && (O in possibles) && !(O in open) && !(O in closed)) - open += O - - open -= T - closed += T - - return closed \ No newline at end of file + return 0 \ No newline at end of file diff --git a/code/defines/procs/global_lists.dm b/code/defines/procs/global_lists.dm new file mode 100644 index 0000000000..7d03659385 --- /dev/null +++ b/code/defines/procs/global_lists.dm @@ -0,0 +1,145 @@ +//Since it didn't really belong in any other category, I'm putting this here +//This is for procs to replace all the goddamn 'in world's that are chilling around the code + +var/global/list/player_list = list() //List of all logged in players (Based on mob reference) +var/global/list/admin_list = list() //List of all logged in admins (Based on mob reference) +var/global/list/mob_list = list() //List of all mobs, including clientless +var/global/list/living_mob_list = list() //List of all living mobs, including clientless +var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless +var/global/list/client_list = list() //List of all clients, based on ckey +var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time +var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name +var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessory/facial_hair indexed by name +var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions +var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff + +////////////////////////// +/////Initial Building///// +////////////////////////// +//Realistically, these should never be run, but ideally, they should only be run once at round-start + +/proc/make_datum_references_lists() + var/list/paths + //Hair - Initialise all /datum/sprite_accessory/hair into an list indexed by hair-style name + paths = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair + for(var/path in paths) + var/datum/sprite_accessory/hair/H = new path() + hair_styles_list[H.name] = H + //Facial Hair - Initialise all /datum/sprite_accessory/facial_hair into an list indexed by facialhair-style name + paths = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair + for(var/path in paths) + var/datum/sprite_accessory/facial_hair/H = new path() + facial_hair_styles_list[H.name] = H + +proc/make_player_list()//Global proc that rebuilds the player list + for(var/mob/p in player_list)//Clears out everyone that logged out + if(!(p.client)) + player_list -= p + for(var/mob/M in world)//Adds everyone that has logged in + if(M.client) + player_list += M + +proc/make_admin_list()//Rebuild that shit to try and avoid issues with stealthmins + admin_list = list() + for(var/client/C in client_list) + if(C && C.holder) + admin_list += C + +proc/make_mob_list() + for(var/mob/p in mob_list) + if(!p)//If it's a null reference, remove it + mob_list -= p + for(var/mob/M in world) + mob_list += M + +proc/make_extra_mob_list() + for(var/mob/p in living_mob_list) + if(!p) + living_mob_list -= p + if(p.stat == DEAD)//Transfer + living_mob_list -= p + dead_mob_list += p + for(var/mob/p in dead_mob_list) + if(!p) + dead_mob_list -= p + if(p.stat != DEAD) + dead_mob_list -= p + living_mob_list += p + for(var/mob/M in world) + if(M.stat == DEAD) + living_mob_list += M + else + dead_mob_list += M + + +//Alright, this proc should NEVER be called in the code, ever. This is more of an 'oh god everything is broken'-emergency button. +proc/rebuild_mob_lists() + player_list = list() + admin_list = list() + mob_list = list() + living_mob_list = list() + dead_mob_list = list() + client_list = list() + for(var/mob/M in world) + mob_list += M + if(M.client) + player_list += M + if(M.stat != DEAD) + living_mob_list += M + else + dead_mob_list += M + for(var/client/C) + client_list += C.ckey + if(C.holder) + admin_list += C + +proc/add_to_mob_list(var/mob/A)//Adds an individual mob + if(A) + mob_list |= A + if(istype(A,/mob/new_player))//New players are only on the mob list, but not the dead/living + return + else + if(A.stat == 2) + dead_mob_list |= A + if(A.stat != 2) + living_mob_list |= A +// if(A.client) +// player_list |= A + +proc/remove_from_mob_list(var/mob/R)//Removes an individual mob + mob_list -= R + if(R.stat == 2) + dead_mob_list -= R + if(R.stat != 2) + living_mob_list -= R +// if(R.client) +// player_list -= R + +proc/make_client_list()//Rebuilds client list + for(var/mob/c in client_list) + if(!c.client) + client_list -= c.ckey + for(var/mob/M in world) + if(M.client) + client_list += M.ckey + + + +/*/obj/item/listdebug//Quick debugger for the global lists + icon = 'icons/obj/assemblies.dmi' + icon_state = "radio-igniter-tank" + +/obj/item/listdebug/attack_self() + switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients")) + if("Players") + usr << dd_list2text(player_list,",") + if("Admins") + usr << dd_list2text(admin_list,",") + if("Mobs") + usr << dd_list2text(mob_list,",") + if("Living Mobs") + usr << dd_list2text(living_mob_list,",") + if("Dead Mobs") + usr << dd_list2text(dead_mob_list,",") + if("Clients") + usr << dd_list2text(client_list,",")*/ \ No newline at end of file diff --git a/code/defines/procs/helper_list.dm b/code/defines/procs/helper_list.dm new file mode 100644 index 0000000000..19f9609db1 --- /dev/null +++ b/code/defines/procs/helper_list.dm @@ -0,0 +1,259 @@ +/* + * Holds procs to help with list operations + * Contains groups: + * Misc + * Sorting + */ + +/* + * Misc + */ + +//Returns a list in plain english as a string +/proc/english_list(var/list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "," ) + var/total = input.len + if (!total) + return "[nothing_text]" + else if (total == 1) + return "[input[1]]" + else if (total == 2) + return "[input[1]][and_text][input[2]]" + else + var/output = "" + var/index = 1 + while (index < total) + if (index == total - 1) + comma_text = final_comma_text + + output += "[input[index]][comma_text]" + index++ + + return "[output][and_text][input[index]]" + +//Returns list element or null. Should prevent "index out of bounds" error. +proc/listgetindex(var/list/list,index) + if(istype(list) && list.len) + if(isnum(index)) + if(InRange(index,1,list.len)) + return list[index] + else if(index in list) + return list[index] + return + +proc/islist(list/list) + if(istype(list)) + return 1 + return 0 + +//Return either pick(list) or null if list is not of type /list or is empty +proc/safepick(list/list) + if(!islist(list) || !list.len) + return + return pick(list) + +//Checks if the list is empty +proc/isemptylist(list/list) + if(!list.len) + return 1 + return 0 + +//Empties the list by setting the length to 0. Hopefully the elements get garbage collected +proc/clearlist(list/list) + if(istype(list)) + list.len = 0 + return + +//Removes any null entries from the list +proc/listclearnulls(list/list) + if(istype(list)) + while(null in list) + list -= null + return + +/* + * Returns list containing all the entries from first list that are not present in second. + * If skiprep = 1, repeated elements are treated as one. + * If either of arguments is not a list, returns null + */ +/proc/difflist(var/list/first, var/list/second, var/skiprep=0) + if(!islist(first) || !islist(second)) + return + var/list/result = new + if(skiprep) + for(var/e in first) + if(!(e in result) && !(e in second)) + result += e + else + result = first - second + return result + +/* + * Returns list containing entries that are in either list but not both. + * If skipref = 1, repeated elements are treated as one. + * If either of arguments is not a list, returns null + */ +/proc/uniquemergelist(var/list/first, var/list/second, var/skiprep=0) + if(!islist(first) || !islist(second)) + return + var/list/result = new + if(skiprep) + result = difflist(first, second, skiprep)+difflist(second, first, skiprep) + else + result = first ^ second + return result + +//Pretends to pick an element based on its weight but really just seems to pick a random element. +/proc/pickweight(list/L) + var/total = 0 + var/item + for (item in L) + if (!L[item]) + L[item] = 1 + total += L[item] + + total = rand(1, total) + for (item in L) + total -=L [item] + if (total <= 0) + return item + + return null + +//Pick a random element from the list and remove it from the list. +/proc/pick_n_take(list/listfrom) + if (listfrom.len > 0) + var/picked = pick(listfrom) + listfrom -= picked + return picked + return null + +//Returns the top(last) element from the list and removes it from the list (typical stack function) +/proc/pop(list/listfrom) + if (listfrom.len > 0) + var/picked = listfrom[listfrom.len] + listfrom.len-- + return picked + return null + +/* + * Sorting + */ + +//Reverses the order of items in the list (Turning a stack into a queue) +/proc/reverselist(var/list/input) + var/list/output = new/list() + for(var/A in input) + output += A + return output + +//Randomize: Return the list in a random order +/proc/shuffle(var/list/shufflelist) + if(!shufflelist) + return + var/list/new_list = list() + var/list/old_list = shufflelist.Copy() + while(old_list.len) + var/item = pick(old_list) + new_list += item + old_list -= item + return new_list + +//Return a list with no duplicate entries +/proc/uniquelist(var/list/L) + var/list/K = list() + for(var/item in L) + if(!(item in K)) + K += item + return K + + +//Mergesort: divides up the list into halves to begin the sort +/proc/sortAtom(var/list/atom/L, var/order = 1) + if(isnull(L) || L.len < 2) + return L + var/middle = L.len / 2 + 1 + return mergeAtoms(sortAtom(L.Copy(0,middle)), sortAtom(L.Copy(middle)), order) + +//Mergsort: does the actual sorting and returns the results back to sortAtom +/proc/mergeAtoms(var/list/atom/L, var/list/atom/R, var/order = 1) + var/Li=1 + var/Ri=1 + var/list/result = new() + while(Li <= L.len && Ri <= R.len) + var/atom/rL = L[Li] + var/atom/rR = R[Ri] + if(sorttext(rL.name, rR.name) == order) + result += L[Li++] + else + result += R[Ri++] + + if(Li <= L.len) + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) + + + + +//Mergesort: Specifically for record datums in a list. +/proc/sortRecord(var/list/datum/data/record/L, var/field = "name", var/order = 1) + if(isnull(L)) + return list() + if(L.len < 2) + return L + var/middle = L.len / 2 + 1 + return mergeRecordLists(sortRecord(L.Copy(0, middle), field, order), sortRecord(L.Copy(middle), field, order), field, order) + +//Mergsort: does the actual sorting and returns the results back to sortRecord +/proc/mergeRecordLists(var/list/datum/data/record/L, var/list/datum/data/record/R, var/field = "name", var/order = 1) + var/Li=1 + var/Ri=1 + var/list/result = new() + if(!isnull(L) && !isnull(R)) + while(Li <= L.len && Ri <= R.len) + var/datum/data/record/rL = L[Li] + if(isnull(rL)) + L -= rL + continue + var/datum/data/record/rR = R[Ri] + if(isnull(rR)) + R -= rR + continue + if(sorttext(rL.fields[field], rR.fields[field]) == order) + result += L[Li++] + else + result += R[Ri++] + + if(Li <= L.len) + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) + + + + +//Mergesort: any value in a list +/proc/sortList(var/list/L) + if(L.len < 2) + return L + var/middle = L.len / 2 + 1 // Copy is first,second-1 + return mergeLists(sortList(L.Copy(0,middle)), sortList(L.Copy(middle))) //second parameter null = to end of list + +//Mergsorge: uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead +/proc/sortNames(var/list/L) + var/list/Q = new() + for(var/atom/x in L) + Q[x.name] = x + return sortList(Q) + +/proc/mergeLists(var/list/L, var/list/R) + var/Li=1 + var/Ri=1 + var/list/result = new() + while(Li <= L.len && Ri <= R.len) + if(sorttext(L[Li], R[Ri]) < 1) + result += R[Ri++] + else + result += L[Li++] + + if(Li <= L.len) + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) \ No newline at end of file diff --git a/code/defines/procs/helper_text.dm b/code/defines/procs/helper_text.dm new file mode 100644 index 0000000000..5f5f086943 --- /dev/null +++ b/code/defines/procs/helper_text.dm @@ -0,0 +1,293 @@ +/* + * Holds procs designed to help with filtering text + * Contains groups: + * Text sanitization + * Text searches + * Text modification + * Misc + */ + +/* + * Text sanitization + */ + +//Simply removes < and > and limits the length of the message +/proc/strip_html_simple(var/t,var/limit=MAX_MESSAGE_LEN) + var/list/strip_chars = list("<",">") + t = copytext(t,1,limit) + for(var/char in strip_chars) + var/index = findtext(t, char) + while(index) + t = copytext(t, 1, index) + copytext(t, index+1) + index = findtext(t, char) + return t + +//Removes a few problematic characters +/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#","�"="�")) + for(var/char in repl_chars) + var/index = findtext(t, char) + while(index) + t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+1) + index = findtext(t, char) + return t + +//Runs byond's sanitization proc along-side sanitize_simple +/proc/sanitize(var/t,var/list/repl_chars = null) + return html_encode(sanitize_simple(t,repl_chars)) + +//Runs sanitize and strip_html_simple +//I believe strip_html_simple() is required to run first to prevent '<' from displaying as '<' after sanitize() calls byond's html_encode() +/proc/strip_html(var/t,var/limit=MAX_MESSAGE_LEN) + return copytext((sanitize(strip_html_simple(t))),1,limit) + +//Runs byond's sanitization proc along-side strip_html_simple +//I believe strip_html_simple() is required to run first to prevent '<' from displaying as '<' that html_encode() would cause +/proc/adminscrub(var/t,var/limit=MAX_MESSAGE_LEN) + return copytext((html_encode(strip_html_simple(t))),1,limit) + + +//Returns null if there is any bad text in the string +/proc/reject_bad_text(var/text, var/max_length=512) + if(length(text) > max_length) return //message too long + var/non_whitespace = 0 + for(var/i=1, i<=length(text), i++) + switch(text2ascii(text,i)) + if(62,60,92,47) return //rejects the text if it contains these bad characters: <, >, \ or / + if(127 to 255) return //rejects weird letters like � + if(0 to 31) return //more weird stuff + if(32) continue //whitespace + else non_whitespace = 1 + if(non_whitespace) return text //only accepts the text if it has some non-spaces + +//Filters out undesirable characters from names +/proc/reject_bad_name(var/t_in, var/allow_numbers=0, var/max_length=MAX_NAME_LEN) + if(!t_in || length(t_in) > max_length) + return //Rejects the input if it is null or if it is longer then the max length allowed + + var/number_of_alphanumeric = 0 + var/last_char_group = 0 + var/t_out = "" + + for(var/i=1, i<=length(t_in), i++) + var/ascii_char = text2ascii(t_in,i) + switch(ascii_char) + // A .. Z + if(65 to 90) //Uppercase Letters + t_out += ascii2text(ascii_char) + number_of_alphanumeric++ + last_char_group = 4 + + // a .. z + if(97 to 122) //Lowercase Letters + if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character + else t_out += ascii2text(ascii_char) + number_of_alphanumeric++ + last_char_group = 4 + + // 0 .. 9 + if(48 to 57) //Numbers + if(!last_char_group) continue //suppress at start of string + if(!allow_numbers) continue + t_out += ascii2text(ascii_char) + number_of_alphanumeric++ + last_char_group = 3 + + // ' - . + if(39,45,46) //Common name punctuation + t_out += ascii2text(ascii_char) + last_char_group = 2 + + // ~ | @ : # $ % & * + + if(126,124,64,58,35,36,37,38,42,43) //Other symbols that we'll allow (mainly for AI) + if(!last_char_group) continue //suppress at start of string + if(!allow_numbers) continue + t_out += ascii2text(ascii_char) + last_char_group = 2 + + //Space + if(32) + if(last_char_group <= 1) continue //suppress double-spaces and spaces at start of string + t_out += ascii2text(ascii_char) + last_char_group = 1 + else + return + + if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '" + + if(last_char_group == 1) + t_out = copytext(t_out,1,length(t_out)) //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 + if(cmptext(t_out,bad_name)) return //(not case sensitive) + + return t_out + + +/* + * Text searches + */ + +//Checks the beginning of a string for a specified sub-string +//Returns the position of the substring or 0 if it was not found +/proc/dd_hasprefix(text, prefix) + var/start = 1 + var/end = length(prefix) + 1 + return findtext(text, prefix, start, end) + +//Checks the beginning of a string for a specified sub-string. This proc is case sensitive +//Returns the position of the substring or 0 if it was not found +/proc/dd_hasprefix_case(text, prefix) + var/start = 1 + var/end = length(prefix) + 1 + return findtextEx(text, prefix, start, end) + +//Checks the end of a string for a specified substring. +//Returns the position of the substring or 0 if it was not found +/proc/dd_hassuffix(text, suffix) + var/start = length(text) - length(suffix) + if(start) + return findtext(text, suffix, start, null) + return + +//Checks the end of a string for a specified substring. This proc is case sensitive +//Returns the position of the substring or 0 if it was not found +/proc/dd_hassuffix_case(text, suffix) + var/start = length(text) - length(suffix) + if(start) + return findtextEx(text, suffix, start, null) + +/* + * Text modification + */ + +//Search and replace a sub-string within a string +/proc/dd_replacetext(text, search_string, replacement_string) + if(!text || !istext(text) || !search_string || !istext(search_string) || !istext(replacement_string)) + return null + var/textList = dd_text2list(text, search_string) + return dd_list2text(textList, replacement_string) + +//Search and replace a case sensitive sub-string within a string +/proc/dd_replacetext_case(text, search_string, replacement_string) + var/textList = dd_text2list(text, search_string) + return dd_list2text(textList, replacement_string) + +//Adds 'u' number of zeros ahead of the text 't' +/proc/add_zero(t, u) + while (length(t) < u) + t = "0[t]" + return t + +//Adds 'u' number of spaces ahead of the text 't' +/proc/add_lspace(t, u) + while(length(t) < u) + t = " [t]" + return t + +//Adds 'u' number of spaces behind the text 't' +/proc/add_tspace(t, u) + while(length(t) < u) + t = "[t] " + return t + +//Returns a string with reserved characters and spaces before the first letter removed +/proc/trim_left(text) + for (var/i = 1 to length(text)) + if (text2ascii(text, i) > 32) + return copytext(text, i) + return "" + +//Returns a string with reserved characters and spaces after the last letter removed +/proc/trim_right(text) + for (var/i = length(text), i > 0, i--) + if (text2ascii(text, i) > 32) + return copytext(text, 1, i + 1) + + return "" + +//Returns a string with reserved characters and spaces before the first word and after the last word removed. +/proc/trim(text) + return trim_left(trim_right(text)) + +//Returns a string with the first element of the string capitalized. +/proc/capitalize(var/t as text) + return uppertext(copytext(t, 1, 2)) + copytext(t, 2) + +//Centers text by adding spaces to either side of the string. +/proc/dd_centertext(message, length) + var/new_message = message + var/size = length(message) + var/delta = length - size + if(size == length) + return new_message + if(size > length) + return copytext(new_message, 1, length + 1) + if(delta == 1) + return new_message + " " + if(delta % 2) + new_message = " " + new_message + delta-- + var/spaces = add_lspace("",delta/2-1) + return spaces + new_message + spaces + +//Limits the length of the text. Note: MAX_MESSAGE_LEN and MAX_NAME_LEN are widely used for this purpose +/proc/dd_limittext(message, length) + var/size = length(message) + if(size <= length) + return message + return copytext(message, 1, length + 1) + +/* + * Misc + */ + +/proc/stringsplit(txt, character) + var/cur_text = txt + var/last_found = 1 + var/found_char = findtext(cur_text,character) + var/list/list = list() + if(found_char) + var/fs = copytext(cur_text,last_found,found_char) + list += fs + last_found = found_char+length(character) + found_char = findtext(cur_text,character,last_found) + while(found_char) + var/found_string = copytext(cur_text,last_found,found_char) + last_found = found_char+length(character) + list += found_string + found_char = findtext(cur_text,character,last_found) + list += copytext(cur_text,last_found,length(cur_text)+1) + return list + +/proc/stringmerge(var/text,var/compare,replace = "*") +//This proc fills in all spaces with the "replace" var (* by default) with whatever +//is in the other string at the same spot (assuming it is not a replace char). +//This is used for fingerprints + var/newtext = text + if(lentext(text) != lentext(compare)) + return 0 + for(var/i = 1, i < lentext(text), i++) + var/a = copytext(text,i,i+1) + var/b = copytext(compare,i,i+1) +//if it isn't both the same letter, or if they are both the replacement character +//(no way to know what it was supposed to be) + if(a != b) + if(a == replace) //if A is the replacement char + newtext = copytext(newtext,1,i) + b + copytext(newtext, i+1) + else if(b == replace) //if B is the replacement char + newtext = copytext(newtext,1,i) + a + copytext(newtext, i+1) + else //The lists disagree, Uh-oh! + return 0 + return newtext + +/proc/stringpercent(var/text,character = "*") +//This proc returns the number of chars of the string that is the character +//This is used for detective work to determine fingerprint completion. + if(!text || !character) + return 0 + var/count = 0 + for(var/i = 1, i <= lentext(text), i++) + var/a = copytext(text,i,i+1) + if(a == character) + count++ + return count \ No newline at end of file diff --git a/code/defines/procs/helper_type2type.dm b/code/defines/procs/helper_type2type.dm new file mode 100644 index 0000000000..f7495976f2 --- /dev/null +++ b/code/defines/procs/helper_type2type.dm @@ -0,0 +1,220 @@ +/* + * Holds procs designed to change one type of value, into another. + * Contains: + * hex2num & num2hex + * text2list & list2text + * file2list + * angle2dir + * angle2text + * worldtime2text + */ + +//Returns an integer given a hex input +/proc/hex2num(hex) + if (!( istext(hex) )) + return + + var/num = 0 + var/power = 0 + var/i = null + i = length(hex) + while(i > 0) + var/char = copytext(hex, i, i + 1) + switch(char) + if("0") + //Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist + if("9", "8", "7", "6", "5", "4", "3", "2", "1") + num += text2num(char) * 16 ** power + if("a", "A") + num += 16 ** power * 10 + if("b", "B") + num += 16 ** power * 11 + if("c", "C") + num += 16 ** power * 12 + if("d", "D") + num += 16 ** power * 13 + if("e", "E") + num += 16 ** power * 14 + if("f", "F") + num += 16 ** power * 15 + else + return + power++ + i-- + return num + +//Returns the hex value of a number given a value assumed to be a base-ten value +/proc/num2hex(num, placeholder) + + if (placeholder == null) + placeholder = 2 + if (!( isnum(num) )) + return + if (!( num )) + return "0" + var/hex = "" + var/i = 0 + while(16 ** i < num) + i++ + var/power = null + power = i - 1 + while(power >= 0) + var/val = round(num / 16 ** power) + num -= val * 16 ** power + switch(val) + if(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0) + hex += text("[]", val) + if(10.0) + hex += "A" + if(11.0) + hex += "B" + if(12.0) + hex += "C" + if(13.0) + hex += "D" + if(14.0) + hex += "E" + if(15.0) + hex += "F" + else + power-- + while(length(hex) < placeholder) + hex = text("0[]", hex) + return hex + +//Text 'text' will be added as elements of a list when seperated by 'seperator' +/proc/dd_text2list(text, separator, var/list/withinList) + var/textlength = length(text) + var/separatorlength = length(separator) + if(withinList && !withinList.len) withinList = null + var/list/textList = new() + var/searchPosition = 1 + var/findPosition = 1 + var/loops = 999 + while(loops) //Byond will think 1000+ iterations of a loop is an infinite loop + findPosition = findtext(text, separator, searchPosition, 0) + var/buggyText = copytext(text, searchPosition, findPosition) + if(!withinList || (buggyText in withinList)) textList += "[buggyText]" + if(!findPosition) return textList + searchPosition = findPosition + separatorlength + if(searchPosition > textlength) + textList += "" + return textList + loops-- + return + +//Text 'text' will be added as elements of a list when seperated by 'seperator'. The separator is case sensitive. +/proc/dd_text2list_case(text, separator, var/list/withinList) + var/textlength = length(text) + var/separatorlength = length(separator) + if(withinList && !withinList.len) withinList = null + var/list/textList = new() + var/searchPosition = 1 + var/findPosition = 1 + var/loops = 999 + while(loops) //Byond will think 1000+ iterations of a loop is an infinite loop + findPosition = findtextEx(text, separator, searchPosition, 0) + var/buggyText = copytext(text, searchPosition, findPosition) + if(!withinList || (buggyText in withinList)) textList += "[buggyText]" + if(!findPosition) return textList + searchPosition = findPosition + separatorlength + if(searchPosition > textlength) + textList += "" + return textList + loops-- + return + +//Attaches each element of a list to a single string seperated by 'seperator'. +/proc/dd_list2text(var/list/the_list, separator) + var/total = the_list.len + if(!total) + return + var/count = 2 + var/newText = "[the_list[1]]" + while(count <= total) + if(separator) + newText += separator + newText += "[the_list[count]]" + count++ + return newText + +//tg_text2list is faster then dd_text2list +//not case sensitive version +proc/tg_text2list(string, separator=",") + if(!string) + return + var/list/output = new + var/seplength = length(separator) + var/strlength = length(string) + var/prev = 1 + var/index + do + index = findtext(string, separator, prev, 0) + output += copytext(string, prev, index) + if(!index) + break + prev = index+seplength + if(prev>strlength) + break + while(index) + return output + +//case sensitive version +proc/tg_text2list_case(string, separator=",") + if(!string) + return + var/list/output = new + var/seplength = length(separator) + var/strlength = length(string) + var/prev = 1 + var/index + do + index = findtextEx(string, separator, prev, 0) + output += copytext(string, prev, index) + if(!index) + break + prev = index+seplength + if(prev>strlength) + break + while(index) + return output + +//slower then dd_list2text, but correctly processes associative lists. +proc/tg_list2text(list/list, glue=",") + if(!istype(list) || !list.len) + return + var/output + for(var/i=1 to list.len) + output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]") + return output + +//Gets a file and adds its contents to a list. +/proc/dd_file2list(file_path, separator) + var/file + if(separator == null) + separator = "\n" + if(isfile(file_path)) + file = file_path + else + file = file(file_path) + return dd_text2list(file2text(file), separator) + +//Converts an angle (degrees) into an ss13 direction +/proc/angle2dir(var/degree) + degree = ((degree+22.5)%365) + if(degree < 45) return NORTH + if(degree < 90) return NORTH|EAST + if(degree < 135) return EAST + if(degree < 180) return SOUTH|EAST + if(degree < 225) return SOUTH + if(degree < 270) return SOUTH|WEST + if(degree < 315) return WEST + return NORTH|WEST + +//Returns the angle in english +/proc/angle2text(var/degree) + return dir2text(angle2dir(degree)) + +//Returns the world time in english +proc/worldtime2text() + return "[round(world.time / 36000)+12]:[(world.time / 600 % 60) < 10 ? add_zero(world.time / 600 % 60, 1) : world.time / 600 % 60]" \ No newline at end of file diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index fa7b71f473..d1b1abb90a 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -1,81 +1,10 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -/proc/hex2num(hex) - - if (!( istext(hex) )) - CRASH("hex2num not given a hexadecimal string argument (user error)") - return - var/num = 0 - var/power = 0 - var/i = null - i = length(hex) - while(i > 0) - var/char = copytext(hex, i, i + 1) - switch(char) - if("0") - //Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist - if("9", "8", "7", "6", "5", "4", "3", "2", "1") - num += text2num(char) * 16 ** power - if("a", "A") - num += 16 ** power * 10 - if("b", "B") - num += 16 ** power * 11 - if("c", "C") - num += 16 ** power * 12 - if("d", "D") - num += 16 ** power * 13 - if("e", "E") - num += 16 ** power * 14 - if("f", "F") - num += 16 ** power * 15 - else - CRASH("hex2num given non-hexadecimal string (user error)") - return - power++ - i-- - return num - -/proc/num2hex(num, placeholder) - - if (placeholder == null) - placeholder = 2 - if (!( isnum(num) )) - //CRASH("num2hex not given a numeric argument (user error)") - // Doing above the worst thing a programmer can do, remove a message raising an error in order to clear the error log. - // I shall perform harakiri if this leads to major problems in the future - Abi - return - if (!( num )) - return "0" - var/hex = "" - var/i = 0 - while(16 ** i < num) - i++ - var/power = null - power = i - 1 - while(power >= 0) - var/val = round(num / 16 ** power) - num -= val * 16 ** power - switch(val) - if(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0) - hex += text("[]", val) - if(10.0) - hex += "A" - if(11.0) - hex += "B" - if(12.0) - hex += "C" - if(13.0) - hex += "D" - if(14.0) - hex += "E" - if(15.0) - hex += "F" - else - power-- - while(length(hex) < placeholder) - hex = text("0[]", hex) - return hex +/* + * A large number of misc global procs. + */ +//Inverts the colour of an HTML string /proc/invertHTML(HTMLstring) if (!( istext(HTMLstring) )) @@ -103,337 +32,16 @@ return text("#[][][]", textr, textg, textb) return -/proc/shuffle(var/list/shufflelist) - if(!shufflelist) - return - var/list/new_list = list() - var/list/old_list = shufflelist.Copy() - while(old_list.len) - var/item = pick(old_list) - new_list.Add(item) - old_list.Remove(item) - return new_list - -/proc/uniquelist(var/list/L) - var/list/K = list() - for(var/item in L) - if(!(item in K)) - K += item - return K - -/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#","ÿ"="ß")) - for(var/char in repl_chars) - var/index = findtext(t, char) - while(index) - t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+1) - index = findtext(t, char) - return t - -//For sanitizing user inputs -/proc/reject_bad_text(var/text) - if(length(text) > 512) return //message too long - var/non_whitespace = 0 - for(var/i=1, i<=length(text), i++) - switch(text2ascii(text,i)) - if(62,60,92,47) return //rejects the text if it contains these bad characters: <, >, \ or / - if(127 to 255) return //rejects weird letters like ÿ - if(0 to 31) return //more weird stuff - if(32) //whitespace - else non_whitespace = 1 - if(non_whitespace) return text //only accepts the text if it has some non-spaces - -/proc/strip_html_simple(var/t,var/limit=MAX_MESSAGE_LEN) - var/list/strip_chars = list("<",">","&","'") - t = copytext(t,1,limit) - for(var/char in strip_chars) - var/index = findtext(t, char) - while(index) - t = copytext(t, 1, index) + copytext(t, index+1) - index = findtext(t, char) - return t - -/proc/sanitize(var/t,var/list/repl_chars = null) - return html_encode(sanitize_simple(t,repl_chars)) - -/proc/strip_html(var/t,var/limit=MAX_MESSAGE_LEN) - return sanitize(strip_html_simple(t)) - -/proc/adminscrub(var/t,var/limit=MAX_MESSAGE_LEN) - return html_encode(strip_html_simple(t)) - -/proc/add_zero(t, u) - while (length(t) < u) - t = "0[t]" - return t - -/proc/add_lspace(t, u) - while(length(t) < u) - t = " [t]" - return t - -/proc/add_tspace(t, u) - while(length(t) < u) - t = "[t] " - return t - -/proc/trim_left(text) - for (var/i = 1 to length(text)) - if (text2ascii(text, i) > 32) - return copytext(text, i) - return "" - -/proc/trim_right(text) - for (var/i = length(text), i > 0, i--) - if (text2ascii(text, i) > 32) - return copytext(text, 1, i + 1) - - return "" - -/proc/trim(text) - return trim_left(trim_right(text)) - -/proc/capitalize(var/t as text) - return uppertext(copytext(t, 1, 2)) + copytext(t, 2) - -/proc/sortList(var/list/L) - if(L.len < 2) - return L - var/middle = L.len / 2 + 1 // Copy is first,second-1 - return mergeLists(sortList(L.Copy(0,middle)), sortList(L.Copy(middle))) //second parameter null = to end of list - -/proc/sortNames(var/list/L) - var/list/Q = new() - for(var/atom/x in L) - Q[x.name] = x - return sortList(Q) - -/proc/mergeLists(var/list/L, var/list/R) - var/Li=1 - var/Ri=1 - var/list/result = new() - while(Li <= L.len && Ri <= R.len) - if(sorttext(L[Li], R[Ri]) < 1) - var/item = R[Ri++] - if(istext(item) && !isnull(R[item])) - result[item] = R[item] - else - result += item - - else - var/item = L[Li++] - if(istext(item) && !isnull(L[item])) - result[item] = L[item] - else - result += item - - if(Li <= L.len) - return (result + L.Copy(Li, 0)) - return (result + R.Copy(Ri, 0)) - -/proc/dd_file2list(file_path, separator) - var/file - if(separator == null) - separator = "\n" - if(isfile(file_path)) - file = file_path - else - file = file(file_path) - return dd_text2list(file2text(file), separator) - +//Returns the middle-most value /proc/dd_range(var/low, var/high, var/num) return max(low,min(high,num)) -/proc/dd_replacetext(text, search_string, replacement_string) - if(!text || !istext(text) || !search_string || !istext(search_string) || !istext(replacement_string)) - return null - var/textList = dd_text2list(text, search_string) - return dd_list2text(textList, replacement_string) +//Returns whether or not A is the middle most value +/proc/InRange(var/A, var/lower, var/upper) + if(A < lower) return 0 + if(A > upper) return 0 + return 1 -/proc/dd_replaceText(text, search_string, replacement_string) - var/textList = dd_text2List(text, search_string) - return dd_list2text(textList, replacement_string) - -/proc/dd_hasprefix(text, prefix) - var/start = 1 - var/end = length(prefix) + 1 - return findtext(text, prefix, start, end) - -/proc/dd_hasPrefix(text, prefix) - var/start = 1 - var/end = length(prefix) + 1 - return findtext(text, prefix, start, end) //was findtextEx - -/proc/dd_hassuffix(text, suffix) - var/start = length(text) - length(suffix) - if(start) - return findtext(text, suffix, start, null) - return - -/proc/dd_hasSuffix(text, suffix) - var/start = length(text) - length(suffix) - if(start) - return findtext(text, suffix, start, null) //was findtextEx - -/proc/dd_text2list(text, separator, var/list/withinList) - var/textlength = length(text) - var/separatorlength = length(separator) - if(withinList && !withinList.len) withinList = null - var/list/textList = new() - var/searchPosition = 1 - var/findPosition = 1 - var/loops = 0 - while(1) - if(loops >= 1000) - break - loops++ - - findPosition = findtext(text, separator, searchPosition, 0) - var/buggyText = copytext(text, searchPosition, findPosition) - if(!withinList || (buggyText in withinList)) textList += "[buggyText]" - if(!findPosition) return textList - searchPosition = findPosition + separatorlength - if(searchPosition > textlength) - textList += "" - return textList - return - -/proc/dd_text2List(text, separator, var/list/withinList) - var/textlength = length(text) - var/separatorlength = length(separator) - if(withinList && !withinList.len) withinList = null - var/list/textList = new() - var/searchPosition = 1 - var/findPosition = 1 - while(1) - findPosition = findtext(text, separator, searchPosition, 0) //was findtextEx - var/buggyText = copytext(text, searchPosition, findPosition) - if(!withinList || (buggyText in withinList)) textList += "[buggyText]" - if(!findPosition) return textList - searchPosition = findPosition + separatorlength - if(searchPosition > textlength) - textList += "" - return textList - return - -/proc/dd_list2text(var/list/the_list, separator) - var/total = the_list.len - if(!total) - return - var/count = 2 - var/newText = "[the_list[1]]" - while(count <= total) - if(separator) - newText += separator - newText += "[the_list[count]]" - count++ - return newText - -//slower then dd_list2text, but correctly processes associative lists. -proc/tg_list2text(list/list, glue=",") - if(!istype(list) || !list.len) - return - var/output - for(var/i=1 to list.len) - output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]") - return output - - -//tg_text2list is faster then dd_text2list -//not case sensitive version -proc/tg_text2list(string, separator=",") - if(!string) - return - var/list/output = new - var/seplength = length(separator) - var/strlength = length(string) - var/prev = 1 - var/index - do - index = findtext(string, separator, prev, 0) - output += copytext(string, prev, index) - if(!index) - break - prev = index+seplength - if(prev>strlength) - break - while(index) - return output - -//case sensitive version -proc/tg_extext2list(string, separator=",") - if(!string) - return - var/list/output = new - var/seplength = length(separator) - var/strlength = length(string) - var/prev = 1 - var/index - do - index = findtextEx(string, separator, prev, 0) - output += copytext(string, prev, index) - if(!index) - break - prev = index+seplength - if(prev>strlength) - break - while(index) - return output - -/proc/english_list(var/list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "," ) - var/total = input.len - if (!total) - return "[nothing_text]" - else if (total == 1) - return "[input[1]]" - else if (total == 2) - return "[input[1]][and_text][input[2]]" - else - var/output = "" - var/index = 1 - while (index < total) - if (index == total - 1) - comma_text = final_comma_text - - output += "[input[index]][comma_text]" - index++ - - return "[output][and_text][input[index]]" - -/proc/dd_centertext(message, length) - var/new_message = message - var/size = length(message) - var/delta = length - size - if(size == length) - return new_message - if(size > length) - return copytext(new_message, 1, length + 1) - if(delta == 1) - return new_message + " " - if(delta % 2) - new_message = " " + new_message - delta-- - var/spaces = add_lspace("",delta/2-1) - return spaces + new_message + spaces - -/proc/dd_limittext(message, length) - var/size = length(message) - if(size <= length) - return message - return copytext(message, 1, length + 1) - -/proc/angle2dir(var/degree) - degree = ((degree+22.5)%365) - if(degree < 45) return NORTH - if(degree < 90) return NORTH|EAST - if(degree < 135) return EAST - if(degree < 180) return SOUTH|EAST - if(degree < 225) return SOUTH - if(degree < 270) return SOUTH|WEST - if(degree < 315) return WEST - return NORTH|WEST - -/proc/angle2text(var/degree) - return dir2text(angle2dir(degree)) /proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams. if(!start || !end) return 0 @@ -542,16 +150,7 @@ Turf and target are seperate in case you want to teleport some distance from a t return destination -/proc/text_input(var/Message, var/Title, var/Default, var/length=MAX_MESSAGE_LEN) - return sanitize(input(Message, Title, Default) as text, length) -/proc/scrub_input(var/Message, var/Title, var/Default, var/length=MAX_MESSAGE_LEN) - return strip_html(input(Message,Title,Default) as text, length) - -/proc/InRange(var/A, var/lower, var/upper) - if(A < lower) return 0 - if(A > upper) return 0 - return 1 /proc/LinkBlocked(turf/A, turf/B) if(A == null || B == null) return 1 @@ -590,35 +189,8 @@ Turf and target are seperate in case you want to teleport some distance from a t return 1 return 0 -/proc/sign(x) //Should get bonus points for being the most compact code in the world! - return x!=0?x/abs(x):0 //((x<0)?-1:((x>0)?1:0)) - -/* //Kelson's version (doesn't work) -/proc/getline(atom/M,atom/N) - if(!M || !M.loc) return - if(!N || !N.loc) return - if(M.z != N.z) return - var/line = new/list() - - var/dx = abs(M.x - N.x) - var/dy = abs(M.y - N.y) - var/cx = M.x < N.x ? 1 : -1 - var/cy = M.y < N.y ? 1 : -1 - var/slope = dy ? dx/dy : INFINITY - - var/tslope = slope - var/turf/tloc = M.loc - - while(tloc != N.loc) - if(tslope>0) - --tslope - tloc = locate(tloc.x+cx,tloc.y,tloc.z) - else - tslope += slope - tloc = locate(tloc.x,tloc.y+cy,tloc.z) - line += tloc - return line -*/ +/proc/sign(x) + return x!=0?x/abs(x):0 /proc/getline(atom/M,atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm var/px=M.x //starting x @@ -651,6 +223,7 @@ Turf and target are seperate in case you want to teleport some distance from a t line+=locate(px,py,M.z) return line +//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 return 0 @@ -661,108 +234,108 @@ Turf and target are seperate in case you want to teleport some distance from a t ch = text2ascii(key, i) if (ch < 48 || ch > 57) return 0 - return 1 -/proc/pickweight(list/L) - var/total = 0 - var/item - for (item in L) - if (!L[item]) - L[item] = 1 - total += L[item] - - total = rand(1, total) - for (item in L) - total -=L [item] - if (total <= 0) - return item - - return null - +//Ensure the frequency is within bounds of what it should be sending/recieving at /proc/sanitize_frequency(var/f) f = round(f) f = max(1441, f) // 144.1 f = min(1489, f) // 148.9 - if ((f % 2) == 0) + if ((f % 2) == 0) //Ensure the last digit is an odd number f += 1 return f +//Turns 1479 into 147.9 /proc/format_frequency(var/f) return "[round(f / 10)].[f % 10]" -/proc/ainame(var/mob/M as mob) - var/randomname = M.name - var/time_passed = world.time//Pretty basic but it'll do. It's still possible to bypass this by return ainame(). - var/newname = copytext(sanitize(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN) - if((world.time-time_passed)>200)//If more than 20 game seconds passed. - M << "You took too long to decide. Default name selected." - return - if (!newname) - newname = randomname - else - if (newname == "Inactive AI")//Keeping this here to prevent dumb. - M << "That name is reserved." - return ainame(M) - for (var/mob/living/silicon/ai/A in world) - if (A.real_name == newname&&newname!=randomname) - M << "There's already an AI with that name." - return ainame(M) - M.real_name = newname - M.name = newname - M.original_name = newname +//This will update a mob's name, real_name, mind.name, data_core records, pda and id +//Calling this proc without an oldname will only update the mob and skip updating the pda, id and records ~Carn +/mob/proc/fully_replace_character_name(var/oldname,var/newname) + if(!newname) return 0 + real_name = newname + name = newname + if(mind) + mind.name = newname + if(dna) + dna.real_name = real_name -/*/proc/clname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea - var/randomname = pick(clown_names) - var/newname = copytext(sanitize(input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN) - var/oldname = M.real_name + if(oldname) + //update the datacore records! This is goig to be a bit costly. + for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked)) + for(var/datum/data/record/R in L) + if(R.fields["name"] == oldname) + R.fields["name"] = newname + break - if (!newname) - newname = randomname + //update our pda and id if we have them on our person + var/list/searching = GetAllContents(searchDepth = 3) + var/search_id = 1 + var/search_pda = 1 - else - var/badname = 0 - switch(newname) - if("Unknown") badname = 1 - if("floor") badname = 1 - if("wall") badname = 1 - if("r-wall") badname = 1 - if("space") badname = 1 - if("_") badname = 1 + for(var/A in searching) + if( search_id && istype(A,/obj/item/weapon/card/id) ) + var/obj/item/weapon/card/id/ID = A + if(ID.registered_name == oldname) + ID.registered_name = newname + ID.name = "[newname]'s ID Card ([ID.assignment])" + if(!search_pda) break + search_id = 0 - if(badname) - M << "That name is reserved." - return clname(M) - for (var/mob/A in world) - if(A.real_name == newname) - M << "That name is reserved." - return clname(M) - M.real_name = newname - M.name = newname - M.original_name = newname + else if( search_pda && istype(A,/obj/item/device/pda) ) + var/obj/item/device/pda/PDA = A + if(PDA.owner == oldname) + PDA.owner = newname + PDA.name = "PDA-[newname] ([PDA.ownjob])" + if(!search_id) break + search_pda = 0 + return 1 - for (var/obj/item/device/pda/pda in M.contents) - if (pda.owner == oldname) - pda.owner = newname - pda.name = "PDA-[newname] ([pda.ownjob])" - break - for(var/obj/item/weapon/card/id/id in M.contents) - if(id.registered_name == oldname) - id.registered_name = newname - id.name = "[id.registered_name]'s ID Card ([id.assignment])" - break*/ + +//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame() +//Last modified by Carn +/mob/proc/rename_self(var/role, var/allow_numbers=0) + spawn(0) + var/oldname = real_name + + var/time_passed = world.time + var/newname + + for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name. + newname = input(src,"You are a [role]. Would you like to change your name to something else?", "Name change",oldname) as text + if((world.time-time_passed)>300) + return //took too long + newname = reject_bad_name(newname,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters. + if(newname) + break //That's a suitable name! + src << "Sorry, that [role]-name wasn't appropriate, please try another. It's possibly too long/short or has bad characters." + + if(!newname) //we'll stick with the oldname then + return + + if(cmptext("ai",role)) + oldname = null//don't bother with the records update crap + world << "[newname] is the AI!" + world << sound('sound/AI/newAI.ogg') + + fully_replace_character_name(oldname,newname) + + + +//Picks a string of symbols to display as the law number for hacked or ion laws /proc/ionnum() - return "[pick("!","@","#","$","%","^","&","*")][pick(pick("!","@","#","$","%","^","&","*"))][pick(pick("!","@","#","$","%","^","&","*"))][pick(pick("!","@","#","$","%","^","&","*"))]" + return "[pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")]" +//When an AI is activated, it can choose from a list of non-slaved borgs to have as a slave. /proc/freeborg() var/select = null var/list/names = list() var/list/borgs = list() var/list/namecounts = list() - for (var/mob/living/silicon/robot/A in world) + for (var/mob/living/silicon/robot/A in player_list) var/name = A.real_name if (A.stat == 2) continue @@ -779,12 +352,13 @@ Turf and target are seperate in case you want to teleport some distance from a t select = input("Unshackled borg signals detected:", "Borg selection", null, null) as null|anything in borgs return borgs[select] +//When a borg is activated, it can choose which AI it wants to be slaved to /proc/activeais() var/select = null var/list/names = list() var/list/ais = list() var/list/namecounts = list() - for (var/mob/living/silicon/ai/A in world) + for (var/mob/living/silicon/ai/A in player_list) var/name = A.real_name if (A.stat == 2) continue @@ -799,35 +373,7 @@ Turf and target are seperate in case you want to teleport some distance from a t select = input("AI signals detected:", "AI selection") in ais return ais[select] -/proc/get_sorted_mobs() - var/list/old_list = getmobs() - var/list/AI_list = list() - var/list/Dead_list = list() - var/list/keyclient_list = list() - var/list/key_list = list() - var/list/logged_list = list() - for(var/named in old_list) - var/mob/M = old_list[named] - if(issilicon(M)) - AI_list |= M - else if(isobserver(M) || M.stat == 2) - Dead_list |= M - else if(M.key && M.client) - keyclient_list |= M - else if(M.key) - key_list |= M - else - logged_list |= M - old_list.Remove(named) - var/list/new_list = list() - new_list += AI_list - new_list += keyclient_list - new_list += key_list - new_list += logged_list - new_list += Dead_list - return new_list - - +//Returns a list of all mobs with their name /proc/getmobs() var/list/mobs = sortmobs() @@ -843,8 +389,7 @@ Turf and target are seperate in case you want to teleport some distance from a t names.Add(name) namecounts[name] = 1 if (M.real_name && M.real_name != M.name) - name += " \[[M.original_name? M.original_name : M.real_name]\]" - + name += " \[[M.real_name]\]" if (M.stat == 2) if(istype(M, /mob/dead/observer/)) name += " \[ghost\]" @@ -854,47 +399,48 @@ Turf and target are seperate in case you want to teleport some distance from a t return creatures +//Orders mobs by type /proc/sortmobs() - - var/list/temp_list = list() - for(var/mob/living/silicon/ai/M in world) - temp_list.Add(M) - for(var/mob/living/silicon/pai/M in world) - temp_list.Add(M) - for(var/mob/living/silicon/robot/M in world) - temp_list.Add(M) - for(var/mob/living/carbon/human/M in world) - temp_list.Add(M) - for(var/mob/living/parasite/P in M.parasites) - temp_list.Add(P) - for(var/mob/living/carbon/brain/M in world) - temp_list.Add(M) - for(var/mob/living/carbon/alien/M in world) - temp_list.Add(M) - for(var/mob/dead/observer/M in world) - temp_list.Add(M) - for(var/mob/new_player/M in world) - temp_list.Add(M) - for(var/mob/living/carbon/monkey/M in world) - temp_list.Add(M) - for(var/mob/living/carbon/metroid/M in world) - temp_list.Add(M) - for(var/mob/living/simple_animal/M in world) - temp_list.Add(M) + var/list/moblist = list() + for(var/mob/living/silicon/ai/M in mob_list) + moblist.Add(M) + for(var/mob/living/silicon/pai/M in mob_list) + moblist.Add(M) + for(var/mob/living/silicon/robot/M in mob_list) + moblist.Add(M) + for(var/mob/living/carbon/human/M in mob_list) + moblist.Add(M) + for(var/mob/living/carbon/brain/M in mob_list) + moblist.Add(M) + for(var/mob/living/carbon/alien/M in mob_list) + moblist.Add(M) + for(var/mob/dead/observer/M in mob_list) + moblist.Add(M) + for(var/mob/new_player/M in mob_list) + moblist.Add(M) + for(var/mob/living/carbon/monkey/M in mob_list) + moblist.Add(M) + for(var/mob/living/carbon/metroid/M in mob_list) + moblist.Add(M) + for(var/mob/living/simple_animal/M in mob_list) + moblist.Add(M) // for(var/mob/living/silicon/hivebot/M in world) // mob_list.Add(M) // for(var/mob/living/silicon/hive_mainframe/M in world) // mob_list.Add(M) - return temp_list + 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) return M @@ -1018,11 +564,13 @@ Turf and target are seperate in case you want to teleport some distance from a t src.mob.machine = null return -/proc/reverselist(var/list/input) - var/list/output = new/list() - for(var/A in input) - output += A - return output +//Will return the location of the turf an atom is ultimatly sitting on +/proc/get_turf_loc(var/atom/movable/M) //gets the location of the turf that the atom is on, or what the atom is in is on, etc + //in case they're in a closet or sleeper or something + var/atom/loc = M.loc + while(!istype(loc, /turf/)) + loc = loc.loc + return loc // returns the turf located at the map edge in the specified direction relative to A // used for mass driver @@ -1073,31 +621,6 @@ Turf and target are seperate in case you want to teleport some distance from a t var/y = min(world.maxy, max(1, A.y + dy)) return locate(x,y,A.z) -/* -/proc/dir2text(var/d) - var/dir - switch(d) - if(1) - dir = "NORTH" - if(2) - dir = "SOUTH" - if(4) - dir = "EAST" - if(8) - dir = "WEST" - if(5) - dir = "NORTHEAST" - if(6) - dir = "SOUTHEAST" - if(9) - dir = "NORTHWEST" - if(10) - dir = "SOUTHWEST" - else - dir = null - return dir -*/ - //Makes sure MIDDLE is between LOW and HIGH. If not, it adjusts it. Returns the adjusted value. /proc/between(var/low, var/middle, var/high) return max(min(middle, high), low) @@ -1137,21 +660,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl sleep(max(sleeptime, 15)) del(animation) -//returns list element or null. Should prevent "index out of bounds" error. -proc/listgetindex(var/list/list,index) - if(istype(list) && list.len) - if(isnum(index)) - if(InRange(index,1,list.len)) - return list[index] - else if(index in list) - return list[index] - return - -proc/islist(list/list) - if(istype(list)) - return 1 - return 0 - +//Will return the contents of an atom recursivly to a depth of 'searchDepth' /atom/proc/GetAllContents(searchDepth = 5) var/list/toReturn = list() @@ -1162,65 +671,7 @@ proc/islist(list/list) return toReturn - -//WIP - -/* - * Returns list containing all the entries present in both lists - * If either of arguments is not a list, returns null - */ -/proc/intersectlist(var/list/first, var/list/second) - if(!islist(first) || !islist(second)) - return - return first & second - -/* - * Returns list containing all the entries from first list that are not present in second. - * If skiprep = 1, repeated elements are treated as one. - * If either of arguments is not a list, returns null - */ -/proc/difflist(var/list/first, var/list/second, var/skiprep=0) - if(!islist(first) || !islist(second)) - return - var/list/result = new - if(skiprep) - for(var/e in first) - if(!(e in result) && !(e in second)) - result += e - else - result = first - second - return result - -/* - * Returns list containing entries that are in either list but not both. - * If skipref = 1, repeated elements are treated as one. - * If either of arguments is not a list, returns null - */ -/proc/uniquemergelist(var/list/first, var/list/second, var/skiprep=0) - if(!islist(first) || !islist(second)) - return - var/list/result = new - if(skiprep) - result = difflist(first, second, skiprep)+difflist(second, first, skiprep) - else - result = first ^ second - return result - -/proc/pick_n_take(list/listfrom) - if (listfrom.len > 0) - var/picked = pick(listfrom) - listfrom -= picked - return picked - return null - -/proc/pop(list/listfrom) - if (listfrom.len > 0) - var/picked = listfrom[listfrom.len] - listfrom.len-- - return picked - return null - - +//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. var/turf/current = get_turf(source) var/turf/target_turf = get_turf(target) @@ -1236,29 +687,6 @@ proc/islist(list/list) return 1 - -/mob/proc/get_equipped_items() - var/list/items = new/list() - - if(hasvar(src,"back")) if(src:back) items += src:back - if(hasvar(src,"belt")) if(src:belt) items += src:belt - if(hasvar(src,"l_ear")) if(src:l_ear) items += src:l_ear - if(hasvar(src,"r_ear")) if(src:r_ear) items += src:r_ear - if(hasvar(src,"glasses")) if(src:glasses) items += src:glasses - if(hasvar(src,"gloves")) if(src:gloves) items += src:gloves - if(hasvar(src,"head")) if(src:head) items += src:head - if(hasvar(src,"shoes")) if(src:shoes) items += src:shoes - if(hasvar(src,"wear_id")) if(src:wear_id) items += src:wear_id - if(hasvar(src,"wear_mask")) if(src:wear_mask) items += src:wear_mask - if(hasvar(src,"wear_suit")) if(src:wear_suit) items += src:wear_suit -// if(hasvar(src,"w_radio")) if(src:w_radio) items += src:w_radio commenting this out since headsets go on your ears now PLEASE DON'T BE MAD KEELIN - if(hasvar(src,"w_uniform")) if(src:w_uniform) items += src:w_uniform - - //if(hasvar(src,"l_hand")) if(src:l_hand) items += src:l_hand - //if(hasvar(src,"r_hand")) if(src:r_hand) items += src:r_hand - - return items - /proc/is_blocked_turf(var/turf/T) var/cant_pass = 0 if(T.density) cant_pass = 1 @@ -1299,60 +727,48 @@ proc/islist(list/list) if(!user || !target) return 0 var/user_loc = user.loc var/target_loc = target.loc - var/holding = user.equipped() + var/holding = user.get_active_hand() sleep(time) if(!user || !target) return 0 - if ( user.loc == user_loc && target.loc == target_loc && user.equipped() == holding && !( user.stat ) && ( !user.stunned && !user.weakened && !user.paralysis && !user.lying ) ) + if ( user.loc == user_loc && target.loc == target_loc && user.get_active_hand() == holding && !( user.stat ) && ( !user.stunned && !user.weakened && !user.paralysis && !user.lying ) ) return 1 else return 0 -/* -/proc/do_after(mob/M as mob, time as num) - if(!M) - return 0 - var/turf/T = M.loc - var/holding = M.equipped() - for(var/i=0, i= drying_threshold_temperature) + wetness-- + if(wetness == 0) + //Try locating an exisitng stack on the tile and add to there if possible + for(var/obj/item/stack/sheet/leather/HS in src.loc) + if(HS.amount < 50) + HS.amount++ + src.use(1) + wetness = initial(wetness) + break + //If it gets to here it means it did not find a suitable stack on the tile. + var/obj/item/stack/sheet/leather/HS = new(src.loc) + HS.amount = 1 + wetness = initial(wetness) + src.use(1) \ No newline at end of file diff --git a/code/defines/turf.dm b/code/defines/turf.dm index 1178af684d..8138c28245 100644 --- a/code/defines/turf.dm +++ b/code/defines/turf.dm @@ -1,7 +1,7 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /turf - icon = 'floors.dmi' + icon = 'icons/turf/floors.dmi' var/intact = 1 //for floors, use is_plating(), is_plasteel_floor() and is_light_floor() level = 1.0 @@ -14,7 +14,7 @@ //Properties for airtight tiles (/wall) var/thermal_conductivity = 0.05 - var/heat_capacity = 200 + var/heat_capacity = 1 //Properties for both var/temperature = T20C @@ -33,11 +33,13 @@ return 0 proc/is_grass_floor() return 0 - proc/return_siding_icon_state() + proc/is_wood_floor() + return 0 + proc/return_siding_icon_state() //used for grass floors, which have siding. return 0 /turf/space - icon = 'space.dmi' + icon = 'icons/turf/space.dmi' name = "\proper space" icon_state = "placeholder" @@ -45,89 +47,91 @@ thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT heat_capacity = 700000 - transit +/turf/space/transit + var/pushdirection // push things that get caught in the transit tile this direction - var/pushdirection // push things that get caught in the transit tile this direction +//Overwrite because we dont want people building rods in space. +/turf/space/transit/attackby(obj/O as obj, mob/user as mob) + return - north // moving to the north +/turf/space/transit/north // moving to the north - pushdirection = SOUTH // south because the space tile is scrolling south + pushdirection = SOUTH // south because the space tile is scrolling south - //IF ANYONE KNOWS A MORE EFFICIENT WAY OF MANAGING THESE SPRITES, BE MY GUEST. - shuttlespace_ns1 - icon_state = "speedspace_ns_1" - shuttlespace_ns2 - icon_state = "speedspace_ns_2" - shuttlespace_ns3 - icon_state = "speedspace_ns_3" - shuttlespace_ns4 - icon_state = "speedspace_ns_4" - shuttlespace_ns5 - icon_state = "speedspace_ns_5" - shuttlespace_ns6 - icon_state = "speedspace_ns_6" - shuttlespace_ns7 - icon_state = "speedspace_ns_7" - shuttlespace_ns8 - icon_state = "speedspace_ns_8" - shuttlespace_ns9 - icon_state = "speedspace_ns_9" - shuttlespace_ns10 - icon_state = "speedspace_ns_10" - shuttlespace_ns11 - icon_state = "speedspace_ns_11" - shuttlespace_ns12 - icon_state = "speedspace_ns_12" - shuttlespace_ns13 - icon_state = "speedspace_ns_13" - shuttlespace_ns14 - icon_state = "speedspace_ns_14" - shuttlespace_ns15 - icon_state = "speedspace_ns_15" - - east // moving to the east - - pushdirection = WEST - - shuttlespace_ew1 - icon_state = "speedspace_ew_1" - shuttlespace_ew2 - icon_state = "speedspace_ew_2" - shuttlespace_ew3 - icon_state = "speedspace_ew_3" - shuttlespace_ew4 - icon_state = "speedspace_ew_4" - shuttlespace_ew5 - icon_state = "speedspace_ew_5" - shuttlespace_ew6 - icon_state = "speedspace_ew_6" - shuttlespace_ew7 - icon_state = "speedspace_ew_7" - shuttlespace_ew8 - icon_state = "speedspace_ew_8" - shuttlespace_ew9 - icon_state = "speedspace_ew_9" - shuttlespace_ew10 - icon_state = "speedspace_ew_10" - shuttlespace_ew11 - icon_state = "speedspace_ew_11" - shuttlespace_ew12 - icon_state = "speedspace_ew_12" - shuttlespace_ew13 - icon_state = "speedspace_ew_13" - shuttlespace_ew14 - icon_state = "speedspace_ew_14" - shuttlespace_ew15 - icon_state = "speedspace_ew_15" + //IF ANYONE KNOWS A MORE EFFICIENT WAY OF MANAGING THESE SPRITES, BE MY GUEST. + shuttlespace_ns1 + icon_state = "speedspace_ns_1" + shuttlespace_ns2 + icon_state = "speedspace_ns_2" + shuttlespace_ns3 + icon_state = "speedspace_ns_3" + shuttlespace_ns4 + icon_state = "speedspace_ns_4" + shuttlespace_ns5 + icon_state = "speedspace_ns_5" + shuttlespace_ns6 + icon_state = "speedspace_ns_6" + shuttlespace_ns7 + icon_state = "speedspace_ns_7" + shuttlespace_ns8 + icon_state = "speedspace_ns_8" + shuttlespace_ns9 + icon_state = "speedspace_ns_9" + shuttlespace_ns10 + icon_state = "speedspace_ns_10" + shuttlespace_ns11 + icon_state = "speedspace_ns_11" + shuttlespace_ns12 + icon_state = "speedspace_ns_12" + shuttlespace_ns13 + icon_state = "speedspace_ns_13" + shuttlespace_ns14 + icon_state = "speedspace_ns_14" + shuttlespace_ns15 + icon_state = "speedspace_ns_15" +/turf/space/transit/east // moving to the east + pushdirection = WEST + shuttlespace_ew1 + icon_state = "speedspace_ew_1" + shuttlespace_ew2 + icon_state = "speedspace_ew_2" + shuttlespace_ew3 + icon_state = "speedspace_ew_3" + shuttlespace_ew4 + icon_state = "speedspace_ew_4" + shuttlespace_ew5 + icon_state = "speedspace_ew_5" + shuttlespace_ew6 + icon_state = "speedspace_ew_6" + shuttlespace_ew7 + icon_state = "speedspace_ew_7" + shuttlespace_ew8 + icon_state = "speedspace_ew_8" + shuttlespace_ew9 + icon_state = "speedspace_ew_9" + shuttlespace_ew10 + icon_state = "speedspace_ew_10" + shuttlespace_ew11 + icon_state = "speedspace_ew_11" + shuttlespace_ew12 + icon_state = "speedspace_ew_12" + shuttlespace_ew13 + icon_state = "speedspace_ew_13" + shuttlespace_ew14 + icon_state = "speedspace_ew_14" + shuttlespace_ew15 + icon_state = "speedspace_ew_15" /turf/space/New() +// icon = 'icons/turf/space.dmi' if(!istype(src, /turf/space/transit)) - ..() - icon_state = "[rand(1,25)]" + icon_state = "[pick(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)]" + + /turf/simulated name = "station" @@ -140,7 +144,23 @@ var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed var/max_fire_temperature_sustained = 0 //The max temperature of the fire which it was subjected to +/turf/simulated/New() + ..() + levelupdate() +/turf/simulated/wall + name = "wall" + desc = "A huge chunk of metal used to seperate rooms." + icon = 'icons/turf/walls.dmi' + var/mineral = "metal" + opacity = 1 + density = 1 + blocks_air = 1 + + thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT + heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall + + var/walltype = "metal" /turf/simulated/wall/r_wall name = "r wall" @@ -153,20 +173,6 @@ var/d_state = 0 -/turf/simulated/wall - name = "wall" - desc = "A huge chunk of metal used to seperate rooms." - icon = 'walls.dmi' - var/mineral = "metal" - opacity = 1 - density = 1 - blocks_air = 1 - - thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT - heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall - - var/walltype = "wall" - /turf/simulated/wall/mineral name = "mineral wall" desc = "This shouldn't exist" @@ -241,15 +247,6 @@ return 0 */ -/turf/simulated/wall/heatshield - thermal_conductivity = 0 - opacity = 0 - name = "Heat Shielding" - icon_state = "thermal" - heat_capacity = 625000 //twice the cap of a normal wall - walltype = "thermal" - blocks_air = 1 - /turf/simulated/wall/cult name = "wall" desc = "The patterns engraved on the wall seem to shift as you try to focus on them. You feel sick" @@ -258,7 +255,7 @@ /turf/simulated/shuttle name = "shuttle" - icon = 'shuttle.dmi' + icon = 'icons/turf/shuttle.dmi' thermal_conductivity = 0.05 heat_capacity = 0 layer = 2 @@ -274,6 +271,11 @@ name = "floor" icon_state = "floor" +/turf/simulated/shuttle/plating + name = "plating" + icon = 'icons/turf/floors.dmi' + icon_state = "plating" + /turf/simulated/shuttle/floor4 // Added this floor tile so that I have a seperate turf to check in the shuttle -- Polymorph name = "Brig floor" // Also added it into the 2x3 brig area of the shuttle. icon_state = "floor4" @@ -286,17 +288,12 @@ /turf/unsimulated/floor name = "floor" - icon = 'floors.dmi' + icon = 'icons/turf/floors.dmi' icon_state = "Floor3" -/turf/unsimulated/floor/deadly - oxygen = MOLES_O2STANDARD/10 - nitrogen = MOLES_N2STANDARD/5 - temperature = TCMB - /turf/unsimulated/wall name = "wall" - icon = 'walls.dmi' + icon = 'icons/turf/walls.dmi' icon_state = "riveted" opacity = 1 density = 1 @@ -304,41 +301,32 @@ /turf/unsimulated/wall/other icon_state = "r_wall" -/turf/proc - AdjacentTurfs() - var/L[] = new() - for(var/turf/simulated/t in oview(src,1)) - if(!t.density) - if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t)) - L.Add(t) - return L - Distance(turf/t) - if(get_dist(src,t) == 1) - var/cost = (src.x - t.x) * (src.x - t.x) + (src.y - t.y) * (src.y - t.y) - cost *= (pathweight+t.pathweight)/2 - return cost - else - return get_dist(src,t) - - Distance_ortho(turf/t) - if(t != null && src != null) - return abs(src.x - t.x) + abs(src.y - t.y) - - else - return 99999 - - AdjacentTurfsSpace() - var/L[] = new() - for(var/turf/t in oview(src,1)) - if(!t.density) - if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t)) - L.Add(t) - return L +/turf/proc/AdjacentTurfs() + var/L[] = new() + for(var/turf/simulated/t in oview(src,1)) + if(!t.density) + if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t)) + L.Add(t) + return L +/turf/proc/Distance(turf/t) + if(get_dist(src,t) == 1) + var/cost = (src.x - t.x) * (src.x - t.x) + (src.y - t.y) * (src.y - t.y) + cost *= (pathweight+t.pathweight)/2 + return cost + else + return get_dist(src,t) +/turf/proc/AdjacentTurfsSpace() + var/L[] = new() + for(var/turf/t in oview(src,1)) + if(!t.density) + if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t)) + L.Add(t) + return L /* /turf/simulated/wall/mineral - icon = 'mineral_walls.dmi' + icon = 'icons/turf/mineral_walls.dmi' walltype = "iron" var/oreAmount = 1 @@ -390,7 +378,7 @@ New() ..() - ul_SetLuminosity(3) + sd_SetLuminosity(3) /turf/simulated/wall/mineral/gold walltype = "gold" @@ -422,6 +410,8 @@ proc/TemperatureAct(temperature) for(var/turf/simulated/floor/target_tile in range(2,loc)) + if(target_tile.parent && target_tile.parent.group_processing) + target_tile.parent.suspend_group_processing() var/datum/gas_mixture/napalm = new @@ -429,7 +419,6 @@ napalm.toxins = toxinsToDeduce napalm.temperature = 400+T0C - napalm.update_values() target_tile.assume_air(napalm) spawn (0) target_tile.hotspot_expose(temperature, 400) diff --git a/code/game/algorithm.dm b/code/game/algorithm.dm index f4551129cf..b9f08159b0 100644 --- a/code/game/algorithm.dm +++ b/code/game/algorithm.dm @@ -1,7 +1,10 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 +#define RECOMMENDED_VERSION 494 /world/New() ..() + if(byond_version < RECOMMENDED_VERSION) + world.log << "Your server's byond version does not meet the recommended requirements for Baystation12. Please update BYOND" diary = file("data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")].log") diary << {" @@ -22,13 +25,18 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] jobban_loadbanfile() jobban_updatelegacybans() LoadBans() - process_teleport_locs() //Sets up the wizard teleport locations - process_ghost_teleport_locs() //Sets up ghost teleport locations. + make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) + process_teleport_locs() //Sets up the wizard teleport locations + process_ghost_teleport_locs() //Sets up ghost teleport locations. + sleep_offline = 1 - if (config.kick_inactive) - spawn(30) + spawn(180) //so we aren't adding to the round-start lag + /*if(config.ToRban) + ToRban_autoupdate()*/ + if(config.kick_inactive) KickInactiveClients() +#undef RECOMMENDED_VERSION #define INACTIVITY_KICK 6000 //10 minutes in ticks (approx.) /world/proc/KickInactiveClients() for(var/client/C) @@ -39,270 +47,25 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] C << "\red You have been inactive for more than 10 minutes and have been disconnected." del(C) spawn(3000) KickInactiveClients()//more or less five minutes +#undef INACTIVITY_KICK /// EXPERIMENTAL STUFF // This function counts a passed job. proc/countJob(rank) var/jobCount = 0 - for(var/mob/H in world) + for(var/mob/H in player_list) if(H.mind && H.mind.assigned_role == rank) jobCount++ return jobCount -/mob/living/carbon/human/var/const/slot_back = 1 -/mob/living/carbon/human/var/const/slot_wear_mask = 2 -/mob/living/carbon/human/var/const/slot_handcuffed = 3 -/mob/living/carbon/human/var/const/slot_l_hand = 4 -/mob/living/carbon/human/var/const/slot_r_hand = 5 -/mob/living/carbon/human/var/const/slot_belt = 6 -/mob/living/carbon/human/var/const/slot_wear_id = 7 -/mob/living/carbon/human/var/const/slot_ears = 8 -/mob/living/carbon/human/var/const/slot_glasses = 9 -/mob/living/carbon/human/var/const/slot_gloves = 10 -/mob/living/carbon/human/var/const/slot_head = 11 -/mob/living/carbon/human/var/const/slot_shoes = 12 -/mob/living/carbon/human/var/const/slot_wear_suit = 13 -/mob/living/carbon/human/var/const/slot_w_uniform = 14 -/mob/living/carbon/human/var/const/slot_l_store = 15 -/mob/living/carbon/human/var/const/slot_r_store = 16 -/mob/living/carbon/human/var/const/slot_s_store = 17 -/mob/living/carbon/human/var/const/slot_in_backpack = 18 - -/mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/W, list/slots, del_on_fail = 1) - for (var/slot in slots) - if (equip_if_possible(W, slots[slot], del_on_fail = 0)) - return slot - if (del_on_fail) - del(W) - return null - -/mob/living/carbon/human/proc/equip_to_appropriate_slot(obj/item/W) - if(!W) - return - if(!ishuman(src)) - return - - if(W.slot_flags & SLOT_BACK) - if(!src.back) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.back = W - update_clothing() - return - - if(W.slot_flags & SLOT_ID) - if(!src.wear_id) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.wear_id = W - update_clothing() - return - - if(W.slot_flags & SLOT_ICLOTHING) - if(!src.w_uniform) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.w_uniform = W - update_clothing() - return - - if(W.slot_flags & SLOT_OCLOTHING) - if(!src.wear_suit) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.wear_suit = W - update_clothing() - return - - if(W.slot_flags & SLOT_MASK) - if(!src.wear_mask) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.wear_mask = W - update_clothing() - return - - if(W.slot_flags & SLOT_HEAD) - if(!src.head) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.head = W - update_clothing() - return - - if(W.slot_flags & SLOT_FEET) - if(!src.shoes) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.shoes = W - update_clothing() - return - - if(W.slot_flags & SLOT_GLOVES) - if(!src.gloves) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.gloves = W - update_clothing() - return - - if(W.slot_flags & SLOT_EARS) - if(!src.l_ear) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.l_ear = W - update_clothing() - else if(!src.r_ear) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.r_ear = W - update_clothing() - return - - if(W.slot_flags & SLOT_EYES) - if(!src.glasses) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.glasses = W - update_clothing() - return - - if(W.slot_flags & SLOT_BELT) - if(!src.belt) - if( src.get_active_hand() == W ) - src.u_equip(W) - src.belt = W - update_clothing() - return - - //Suit storage - var/confirm - if (wear_suit) - if(wear_suit.allowed) - if (istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen)) - confirm = 1 - if (is_type_in_list(W, wear_suit.allowed)) - confirm = 1 - if(confirm) - src.u_equip(W) - src.s_store = W - update_clothing() - return - - //Pockets - if ( !( W.slot_flags & SLOT_DENYPOCKET ) ) - if(!src.l_store) - if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) ) - u_equip(W) - l_store = W - update_clothing() - return - if(!src.r_store) - if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) ) - u_equip(W) - r_store = W - update_clothing() - return - -/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/ - //warning: icky code - var/equipped = 0 - switch(slot) - if(slot_back) - if(!src.back) - src.back = W - equipped = 1 - if(slot_wear_mask) - if(!src.wear_mask) - src.wear_mask = W - equipped = 1 - if(slot_handcuffed) - if(!src.handcuffed) - src.handcuffed = W - equipped = 1 - if(slot_l_hand) - if(!src.l_hand) - src.l_hand = W - equipped = 1 - if(slot_r_hand) - if(!src.r_hand) - src.r_hand = W - equipped = 1 - if(slot_belt) - if(!src.belt && src.w_uniform) - src.belt = W - equipped = 1 - if(slot_wear_id) - if(!src.wear_id && src.w_uniform) - src.wear_id = W - equipped = 1 - if(slot_ears) - if(!src.l_ear) - src.l_ear = W - equipped = 1 - else if(!src.r_ear) - src.r_ear = W - equipped = 1 - if(slot_glasses) - if(!src.glasses) - src.glasses = W - equipped = 1 - if(slot_gloves) - if(!src.gloves) - src.gloves = W - equipped = 1 - if(slot_head) - if(!src.head) - src.head = W - equipped = 1 - if(slot_shoes) - if(!src.shoes) - src.shoes = W - equipped = 1 - if(slot_wear_suit) - if(!src.wear_suit) - src.wear_suit = W - equipped = 1 - if(slot_w_uniform) - if(!src.w_uniform) - src.w_uniform = W - equipped = 1 - if(slot_l_store) - if(!src.l_store && src.w_uniform) - src.l_store = W - equipped = 1 - if(slot_r_store) - if(!src.r_store && src.w_uniform) - src.r_store = W - equipped = 1 - if(slot_s_store) - if(!src.s_store && src.wear_suit) - src.s_store = W - equipped = 1 - if(slot_in_backpack) - if (src.back && istype(src.back, /obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = src.back - if(B.contents.len < B.storage_slots && W.w_class <= B.max_w_class) - W.loc = B - equipped = 1 - - if(equipped) - W.layer = 20 - if(src.back && W.loc != src.back) - W.loc = src - else - if (del_on_fail) - del(W) - return equipped - -/proc/AutoUpdateAI(obj/subject) // Needed for AI's to not have to click on every computer after every change. +/proc/AutoUpdateAI(obj/subject) if (subject!=null) - for(var/mob/living/silicon/ai/M in world) + for(var/mob/living/silicon/ai/M in player_list) if ((M.client && M.machine == subject)) subject.attack_ai(M) -/proc/AutoUpdateTK(obj/subject) // Commented where used due to lag. +/proc/AutoUpdateTK(obj/subject) if (subject!=null) for(var/obj/item/tk_grab/T in world) if (T.host) diff --git a/code/game/area/ai_monitored.dm b/code/game/area/ai_monitored.dm index 72832cd2a1..d56f8f37c8 100644 --- a/code/game/area/ai_monitored.dm +++ b/code/game/area/ai_monitored.dm @@ -53,14 +53,14 @@ /obj/machinery/camera/motion/proc/cancelAlarm() if (detectTime == -1) - for (var/mob/living/silicon/aiPlayer in world) + for (var/mob/living/silicon/aiPlayer in player_list) if (status) aiPlayer.cancelAlarm("Motion", src.loc.loc) detectTime = 0 return 1 /obj/machinery/camera/motion/proc/triggerAlarm() if (!detectTime) return 0 - for (var/mob/living/silicon/aiPlayer in world) + for (var/mob/living/silicon/aiPlayer in player_list) if (status) aiPlayer.triggerAlarm("Motion", src.loc.loc, src) detectTime = -1 return 1 @@ -71,7 +71,7 @@ var/turf/T = user.loc user << text("\blue []ing the access hatch... (this is a long process)", (locked) ? "Open" : "Clos") sleep(100) - if ((user.loc == T && user.equipped() == W && !( user.stat ))) + if ((user.loc == T && user.get_active_hand() == W && !( user.stat ))) src.locked ^= 1 user << text("\blue The access hatch is now [].", (locked) ? "closed" : "open") @@ -82,5 +82,5 @@ detectTime = world.time - 301 triggerAlarm() else - for (var/mob/living/silicon/aiPlayer in world) // manually cancel, to not disturb internal state + for (var/mob/living/silicon/aiPlayer in player_list) // manually cancel, to not disturb internal state aiPlayer.cancelAlarm("Motion", src.loc.loc) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 0e8fa61e38..165d154a32 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -10,26 +10,24 @@ /area/New() master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references src.loc.loc.master ~Carn - src.icon = 'alert.dmi' + src.icon = 'icons/effects/alert.dmi' uid = ++global_uid spawn(1) //world.log << "New: [src] [tag]" - var/ul_created = findtext(tag,":UL") - ul_Prep() - if(ul_created) - if(!islist(related)) - related = list() + var/sd_created = findtext(tag,"sd_L") + sd_New(sd_created) + if(sd_created) related += src return related = list(src) - src.icon = 'alert.dmi' + src.icon = 'icons/effects/alert.dmi' src.layer = 10 // update_lights() if(name == "Space") // override defaults for space requires_power = 1 always_unpowered = 1 - LightLevels = list("Red" = 2, "Green" = 2, "Blue" = 3) + sd_SetLuminosity(1) power_light = 0 power_equip = 0 power_environ = 0 @@ -39,17 +37,13 @@ power_light = 0//rastaf0 power_equip = 0//rastaf0 power_environ = 0//rastaf0 - if(!ul_Lighting) - luminosity = 1 + luminosity = 1 + sd_lighting = 0 // *DAL* else luminosity = 0 - area_lights_luminosity = rand(6,8) - if(LightLevels) - ul_Light() + //sd_SetLuminosity(0) // *DAL* + -/area/Del() - related -= src - . = ..() /*spawn(5) @@ -83,114 +77,90 @@ lighting_power_usage = new_power return */ -/area/proc/poweralert(var/state, var/source) +/area/proc/poweralert(var/state, var/obj/source as obj) if (state != poweralm) poweralm = state - var/list/cameras = list() - for (var/obj/machinery/camera/C in src) - cameras += C - for (var/mob/living/silicon/aiPlayer in world) - if (state == 1) - aiPlayer.cancelAlarm("Power", src, source) - else - aiPlayer.triggerAlarm("Power", src, cameras, source) - for(var/obj/machinery/computer/station_alert/a in world) - if(state == 1) - a.cancelAlarm("Power", src, source) - else - a.triggerAlarm("Power", src, source) + if(istype(source)) //Only report power alarms on the z-level where the source is located. + var/list/cameras = list() + for (var/obj/machinery/camera/C in src) + cameras += C + for (var/mob/living/silicon/aiPlayer in player_list) + if(aiPlayer.z == source.z) + if (state == 1) + aiPlayer.cancelAlarm("Power", src, source) + else + aiPlayer.triggerAlarm("Power", src, cameras, source) + for(var/obj/machinery/computer/station_alert/a in world) + if(a.z == source.z) + if(state == 1) + a.cancelAlarm("Power", src, source) + else + a.triggerAlarm("Power", src, cameras, source) return /area/proc/atmosalert(danger_level) // if(src.type==/area) //No atmos alarms in space // return 0 //redudant - if(danger_level != atmosalm) + if(danger_level != src.atmosalm) + //src.updateicon() + //src.mouse_opacity = 0 if (danger_level==2) var/list/cameras = list() for(var/area/RA in src.related) //src.updateicon() for(var/obj/machinery/camera/C in RA) cameras += C - for(var/mob/living/silicon/aiPlayer in world) + for(var/mob/living/silicon/aiPlayer in player_list) aiPlayer.triggerAlarm("Atmosphere", src, cameras, src) for(var/obj/machinery/computer/station_alert/a in world) a.triggerAlarm("Atmosphere", src, cameras, src) - else if (atmosalm == 2) - for(var/mob/living/silicon/aiPlayer in world) + else if (src.atmosalm == 2) + for(var/mob/living/silicon/aiPlayer in player_list) aiPlayer.cancelAlarm("Atmosphere", src, src) for(var/obj/machinery/computer/station_alert/a in world) a.cancelAlarm("Atmosphere", src, src) - atmosalm = danger_level + src.atmosalm = danger_level return 1 return 0 /area/proc/firealert() if(src.name == "Space") //no fire alarms in space return - if (!fire) - fire = 1 - updateicon() - mouse_opacity = 0 -/* for(var/obj/machinery/door/airlock/E in master.all_doors) - if(!E.air_locked) - if((!E.arePowerSystemsOn()) || (E.stat & NOPOWER)) continue - if(!E.density) - spawn(0) - E.close() - sleep(10) - if(E.density) - E.air_locked = E.req_access - E.req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() - if(E.operating) - spawn(10) - E.close() - if(E.density) - E.air_locked = E.req_access - E.req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() - else if(!E:locked) //Don't lock already bolted doors. - E.air_locked = E.req_access - E.req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() + if (!( src.fire )) + src.fire = 1 + src.updateicon() + src.mouse_opacity = 0 for(var/obj/machinery/door/firedoor/D in src) if(!D.blocked) if(D.operating) D.nextstate = CLOSED else if(!D.density) spawn(0) - D.close() */ + D.close() var/list/cameras = list() for (var/obj/machinery/camera/C in src) cameras += C - for (var/mob/living/silicon/ai/aiPlayer in world) + for (var/mob/living/silicon/ai/aiPlayer in player_list) aiPlayer.triggerAlarm("Fire", src, cameras, src) for (var/obj/machinery/computer/station_alert/a in world) a.triggerAlarm("Fire", src, cameras, src) return /area/proc/firereset() - if (fire) - fire = 0 - mouse_opacity = 0 - updateicon() -/* for(var/obj/machinery/door/airlock/E in master.all_doors) - if((!E.arePowerSystemsOn()) || (E.stat & NOPOWER)) continue - if(E.air_locked) //Don't mess with doors locked for other reasons. - if(E.density) - E.req_access = E.air_locked - E.air_locked = null - E.update_icon() + if (src.fire) + src.fire = 0 + src.mouse_opacity = 0 + src.updateicon() for(var/obj/machinery/door/firedoor/D in src) if(!D.blocked) if(D.operating) D.nextstate = OPEN else if(D.density) spawn(0) - D.open()*/ - for (var/mob/living/silicon/ai/aiPlayer in world) + D.open() + for (var/mob/living/silicon/ai/aiPlayer in player_list) aiPlayer.cancelAlarm("Fire", src, src) - for (var/obj/machinery/computer/station_alert/a in world) + for (var/obj/machinery/computer/station_alert/a in player_list) a.cancelAlarm("Fire", src, src) return @@ -314,7 +284,7 @@ var/sound = null var/musVolume = 25 - sound = 'ambigen1.ogg' + sound = 'sound/ambience/ambigen1.ogg' if (ismob(A)) @@ -336,26 +306,26 @@ //if (A:ear_deaf) return -// if (A && A:client && !A:client:ambience_playing && !A:client:no_ambi) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch -// A:client:ambience_playing = 1 -// A << sound('shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2) + if (A && A:client && !A:client:ambience_playing && !A:client:no_ambi) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch + A:client:ambience_playing = 1 + A << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2) switch(src.name) - if ("Chapel") sound = pick('ambicha1.ogg','ambicha2.ogg','ambicha3.ogg','ambicha4.ogg') - if ("Morgue") sound = pick('ambimo1.ogg','ambimo2.ogg','title2.ogg') - if ("Space") sound = pick('ambispace.ogg','title2.ogg',) - if ("Engine Control", "Engineering", "Engineering SMES") sound = pick('ambisin1.ogg','ambisin2.ogg','ambisin3.ogg','ambisin4.ogg') - if ("AI Satellite Teleporter Room") sound = pick('ambimalf.ogg') - if ("AI Upload Foyer") sound = pick('ambimalf.ogg') - if ("AI Upload Chamber") sound = pick('ambimalf.ogg') + if ("Chapel") sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg') + if ("Morgue") sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/title2.ogg') + if ("Space") sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg',) + if ("Engine Control", "Engineering", "Engineering SMES") sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg') + if ("AI Satellite Teleporter Room") sound = pick('sound/ambience/ambimalf.ogg') + if ("AI Upload Foyer") sound = pick('sound/ambience/ambimalf.ogg') + if ("AI Upload Chamber") sound = pick('sound/ambience/ambimalf.ogg') if ("Mine") - sound = pick('ambimine.ogg') + sound = pick('sound/ambience/ambimine.ogg') musVolume = 25 else - sound = pick('ambigen1.ogg','ambigen3.ogg','ambigen4.ogg','ambigen5.ogg','ambigen6.ogg','ambigen7.ogg','ambigen8.ogg','ambigen9.ogg','ambigen10.ogg','ambigen11.ogg','ambigen12.ogg','ambigen14.ogg') + sound = pick('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg') if(findtext(src.name, "Telecommunications")) - sound = pick('ambisin2.ogg', 'signal.ogg', 'signal.ogg', 'ambigen10.ogg') + sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') if (prob(35)) if(A && A:client && !A:client:played) @@ -395,43 +365,3 @@ mob << "Gravity!" -/area/proc/absorb(var/area/A) - if(!istype(A)) - return - var/oldname = A.name - var/list/other_related = A.related - var/area/other_master = A.master - other_related -= other_master - var/list/total_contents = list() - for(var/area/RA in other_related) -// RA.ul_lighting = 0 - total_contents |= RA.contents - del RA.contents - del RA.related - RA.master = null - other_master.master = null - del other_master.related - total_contents |= other_master.contents - del other_master.contents - for(var/area/RA in other_related) - del(RA) - src += total_contents - spawn(5) - power_change() - set_area_machinery_title(oldname) - - -/area/proc/set_area_machinery_title(var/oldtitle) - if(!oldtitle) - return - for(var/area/RA in related) - for(var/obj/machinery/alarm/M in RA) - M.name = dd_replacetext(M.name,oldtitle,name) - for(var/obj/machinery/power/apc/M in RA) - M.name = dd_replacetext(M.name,oldtitle,name) - for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA) - M.name = dd_replacetext(M.name,oldtitle,name) - for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA) - M.name = dd_replacetext(M.name,oldtitle,name) - for(var/obj/machinery/door/M in RA) - M.name = dd_replacetext(M.name,oldtitle,name) diff --git a/code/game/asteroid/artifacts.dm b/code/game/asteroid/artifacts.dm index e7bddc5d47..5c407805f4 100644 --- a/code/game/asteroid/artifacts.dm +++ b/code/game/asteroid/artifacts.dm @@ -1,11 +1,11 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 var/global/list/space_surprises = list( /obj/item/clothing/mask/facehugger/angry =4, - // /obj/item/weapon/pickaxe/hammer =4, //Waiting on a sprite + // /obj/item/weapon/pickaxe/hammer =4, //Waiting on a sprite /obj/item/weapon/pickaxe/silver =4, /obj/item/weapon/pickaxe/drill =4, /obj/item/weapon/pickaxe/jackhammer =4, - /mob/living/simple_animal/carp/elite =3, + /mob/living/simple_animal/carp =3, /obj/item/weapon/pickaxe/diamond =3, /obj/item/weapon/pickaxe/diamonddrill =3, /obj/item/weapon/pickaxe/gold =3, @@ -38,7 +38,7 @@ var/global/list/spawned_surprises = list() /obj/machinery/wish_granter name = "Wish Granter" desc = "You're not so sure about this, anymore..." - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "syndbeacon" anchored = 1 @@ -82,7 +82,7 @@ var/global/list/spawned_surprises = list() user.mutations.Add(XRAY) user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) user.see_in_dark = 8 - user.see_invisible = 2 + user.see_invisible = SEE_INVISIBLE_LEVEL_TWO if (!(COLD_RESISTANCE in user.mutations)) user.mutations.Add(COLD_RESISTANCE) @@ -105,7 +105,7 @@ var/global/list/spawned_surprises = list() user << "Objective #[obj_count]: [OBJ.explanation_text]" obj_count++ - world << "You have a very bad feeling about this." + user << "You have a very bad feeling about this." return @@ -122,119 +122,3 @@ var/global/list/spawned_surprises = list() new /obj/item/weapon/card/id/syndicate(src) new /obj/item/clothing/shoes/syndigaloshes(src) return - - -// Copied over from asteroid.dm -var/global/max_secret_rooms = 3 - -proc/make_mining_asteroid_secret(var/size = 5) - var/valid = 0 - var/turf/T = null - var/sanity = 0 - var/list/room = null - var/list/turfs = null - - - turfs = get_area_turfs(/area/mine/unexplored) - - if(!turfs.len) - return 0 - - while(!valid) - valid = 1 - sanity++ - if(sanity > 100) - return 0 - - T=pick(turfs) - if(!T) - return 0 - - var/list/surroundings = list() - - surroundings += range(7, locate(T.x,T.y,T.z)) - surroundings += range(7, locate(T.x+size,T.y,T.z)) - surroundings += range(7, locate(T.x,T.y+size,T.z)) - surroundings += range(7, locate(T.x+size,T.y+size,T.z)) - - if(locate(/area/mine/explored) in surroundings) // +5s are for view range - valid = 0 - continue - - if(locate(/turf/space) in surroundings) - valid = 0 - continue - - if(locate(/area/asteroid/artifactroom) in surroundings) - valid = 0 - continue - - if(locate(/turf/simulated/floor/plating/airless/asteroid) in surroundings) - valid = 0 - continue - - if(!T) - return 0 - - room = spawn_room(T,size,size,,,1) - - if(room) - T = pick(room["floors"]) - if(T) - var/surprise = null - valid = 0 - while(!valid) - surprise = pickweight(space_surprises) - if(surprise in spawned_surprises) - if(prob(20)) - valid++ - else - continue - else - valid++ - - spawned_surprises.Add(surprise) - new surprise(T) - - return 1 - -proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor , var/clean = 0 , var/name) - var/list/room_turfs = list("walls"=list(),"floors"=list()) - - //world << "Room spawned at [start_loc.x],[start_loc.y],[start_loc.z]" - if(!wall) - wall = pick(/turf/simulated/wall/r_wall,/turf/simulated/wall,/obj/effect/alien/resin) - if(!floor) - floor = pick(/turf/simulated/floor,/turf/simulated/floor/engine) - - for(var/x = 0,x[src] has been hit by [user] with [W]" @@ -109,34 +104,29 @@ fingerprintshidden = list() //Fibers~ add_fibers(M) - //He has no prints! - if (MFINGERPRINTS in M.mutations) - if(fingerprintslast != M.key) - fingerprintshidden += "(Has no fingerprints) Real name: [M.real_name], Key: [M.key]" - fingerprintslast = M.key - return 0 //Now, lets get to the dirty work. //First, make sure their DNA makes sense. var/mob/living/carbon/human/H = M if (!istype(H.dna, /datum/dna) || !H.dna.uni_identity || (length(H.dna.uni_identity) != 32)) if(!istype(H.dna, /datum/dna)) H.dna = new /datum/dna(null) + H.dna.real_name = H.real_name H.check_dna() //Now, deal with gloves. if (H.gloves && H.gloves != src) if(fingerprintslast != H.key) - fingerprintshidden += text("(Wearing gloves). Real name: [], Key: []",H.real_name, H.key) + fingerprintshidden += text("\[[]\](Wearing gloves). Real name: [], Key: []",time_stamp(), H.real_name, H.key) fingerprintslast = H.key H.gloves.add_fingerprint(M) //Deal with gloves the pass finger/palm prints. if(H.gloves != src) if(prob(75) && istype(H.gloves, /obj/item/clothing/gloves/latex)) return 0 - else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex) && !istype(H.gloves, /obj/item/clothing/gloves/fingerless)) + else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex)) return 0 //More adminstuffz if(fingerprintslast != H.key) - fingerprintshidden += text("Real name: [], Key: []",H.real_name, H.key) + fingerprintshidden += text("\[[]\]Real name: [], Key: []",time_stamp(), H.real_name, H.key) fingerprintslast = H.key //Make the list if it does not exist. if(!fingerprints) @@ -169,7 +159,7 @@ else fingerprints[P] = test_print if(fingerprintslast != M.key) - fingerprintshidden += text("Real name: [], Key: []",M.real_name, M.key) + fingerprintshidden += text("\[[]\]Real name: [], Key: []",time_stamp(), M.real_name, M.key) fingerprintslast = M.key //Cleaning up shit. if(fingerprints && !fingerprints.len) @@ -182,6 +172,7 @@ return 0 if (!istype(M.dna, /datum/dna)) M.dna = new /datum/dna(null) + M.dna.real_name = M.real_name M.check_dna() if (!( src.flags ) & FPRINT) return 0 @@ -195,8 +186,8 @@ //if we haven't made our blood_overlay already if( !O.blood_overlay ) var/icon/I = new /icon(O.icon, O.icon_state) - I.Blend(new /icon('blood.dmi', rgb(255,255,255)),ICON_ADD) //fills the icon_state with white (except where it's transparent) - I.Blend(new /icon('blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant + I.Blend(new /icon('icons/effects/blood.dmi', rgb(255,255,255)),ICON_ADD) //fills the icon_state with white (except where it's transparent) + I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant //not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made. for(var/obj/item/A in world) @@ -222,8 +213,6 @@ for(var/obj/effect/decal/cleanable/blood/B in T.contents) if(!B.blood_DNA[M.dna.unique_enzymes]) B.blood_DNA[M.dna.unique_enzymes] = M.dna.b_type - if(!B.virus2) - B.virus2 = M.virus2 for(var/datum/disease/D in M.viruses) var/datum/disease/newDisease = new D.type B.viruses += newDisease @@ -233,8 +222,6 @@ //if there isn't a blood decal already, make one. var/obj/effect/decal/cleanable/blood/newblood = new /obj/effect/decal/cleanable/blood(T) newblood.blood_DNA[M.dna.unique_enzymes] = M.dna.b_type -// newblood.blood_owner = M - newblood.virus2 = M.virus2 for(var/datum/disease/D in M.viruses) var/datum/disease/newDisease = new D.type newblood.viruses += newDisease @@ -248,6 +235,7 @@ if(blood_DNA[H.dna.unique_enzymes]) return 0 //already bloodied with this blood. Cannot add more. blood_DNA[H.dna.unique_enzymes] = H.dna.b_type + H.update_inv_gloves() //handles bloody hands overlays and updating return 1 //we applied blood to the item return @@ -271,7 +259,6 @@ var/turf/simulated/source1 = src var/obj/effect/decal/cleanable/blood/this = new /obj/effect/decal/cleanable/blood(source1) this.blood_DNA[M.dna.unique_enzymes] = M.dna.b_type - this.OriginalMob = M.dna.original_name for(var/datum/disease/D in M.viruses) var/datum/disease/newDisease = new D.type this.viruses += newDisease @@ -296,46 +283,8 @@ this.viruses += newDisease newDisease.holder = this - - -/atom/proc/clean_blood() - - if (!( src.flags ) & FPRINT) - return - if (blood_DNA) - - //Cleaning blood off of mobs - if (istype (src, /mob/living/carbon)) - var/mob/living/carbon/M = src - del(M.blood_DNA) - if(ishuman(src)) - var/mob/living/carbon/human/H = src - H.bloody_hands = 0 - - //Cleaning blood off of items - else if (istype (src, /obj/item)) - var/obj/item/O = src - del(O.blood_DNA) - if(O.blood_overlay) - O.overlays.Remove(O.blood_overlay) - - if(istype(src, /obj/item/clothing/gloves)) - var/obj/item/clothing/gloves/G = src - G.transfer_blood = 0 - - //Cleaning blood off of turfs - else if (istype(src, /turf/simulated)) - var/turf/simulated/T = src - del(T.blood_DNA) - if(T.icon_old) - var/icon/I = new /icon(T.icon_old, T.icon_state) - T.icon = I - else - T.icon = initial(icon) - - if(blood_DNA && istype(blood_DNA, /list) && !blood_DNA.len) - del(blood_DNA) - if(fingerprints && fingerprints.len) +/atom/proc/clean_prints() + if(istype(fingerprints, /list)) //Smudge up dem prints some for(var/P in fingerprints) var/test_print = stars(fingerprints[P], rand(10,20)) @@ -343,11 +292,48 @@ fingerprints.Remove(P) else fingerprints[P] = test_print - if(fingerprints && !fingerprints.len) - del(fingerprints) - if(istype(src, /mob/living/carbon/human)) - var/mob/living/carbon/human/M = src - M.rebuild_appearance() // both clothes and hands need to be cleaned, so just rebuild all + if(!fingerprints.len) + del(fingerprints) + +/atom/proc/clean_blood() + clean_prints() + + if(istype(blood_DNA, /list)) + del(blood_DNA) + .=1 + + //Cleaning blood off of mobs + if(istype(src, /mob/living/carbon)) + var/mob/living/carbon/M = src + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.gloves) + if(H.gloves.clean_blood()) + H.update_inv_gloves(0) + else + if(H.bloody_hands) + H.bloody_hands = 0 + H.update_inv_gloves(0) + M.update_icons() //apply the now updated overlays to the mob + + //Cleaning blood off of items + else if(istype(src, /obj/item)) + var/obj/item/O = src + if(O.blood_overlay) + O.overlays.Remove(O.blood_overlay) + + if(istype(src, /obj/item/clothing/gloves)) + var/obj/item/clothing/gloves/G = src + G.transfer_blood = 0 + + //Cleaning blood off of turfs + else if(istype(src, /turf/simulated)) + var/turf/simulated/T = src + if(T.icon_old) + var/icon/I = new /icon(T.icon_old, T.icon_state) + T.icon = I + else + T.icon = initial(icon) return /atom/MouseDrop(atom/over_object as mob|obj|turf|area) @@ -362,20 +348,17 @@ /atom/Click(location,control,params) //world << "atom.Click() on [src] by [usr] : src.type is [src.type]" - if(!istype(src,/obj/item/weapon/gun)) - usr.last_target_click = world.time if(usr.client.buildmode) build_click(usr, usr.client.buildmode, location, control, params, src) return - - if(using_new_click_proc) //TODO ERRORAGE (see message below) - return DblClickNew() +// if(using_new_click_proc) //TODO ERRORAGE (see message below) +// return DblClickNew() return DblClick(location, control, params) var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblClickNew() proc is being tested) /atom/proc/DblClickNew() - + if(!usr) return // TODO DOOHL: Intergrate params to new proc. Saved for another time because var/valid_place is a fucking brainfuck //Spamclick server-overloading prevention delay... THING @@ -435,12 +418,12 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl return //Gets equipped item or used module of robots - var/obj/item/W = usr.equipped() + var/obj/item/W = usr.get_active_hand() //Attack self if (W == src && usr.stat == 0) - spawn (0) - W.attack_self(usr) +// spawn (0) //causes runtimes under heavy lag + W.attack_self(usr) return //Attackby, attack_hand, afterattack, etc. can only be done once every 1 second, unless an object has the NODELAY or USEDELAY flags set @@ -507,7 +490,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl var/in_range = in_range(src, human) || src.loc == human if (in_range) - if ( !human.restrained() ) + if (!( human.restrained() || human.lying )) if (W) attackby(W,human) if (W) @@ -665,8 +648,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl attack_animal(animal) /atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE -// world << "checking if this shit gets called at all" - + if(!usr) return // ------- TIME SINCE LAST CLICK ------- if (world.time <= usr:lastDblClick+1) @@ -676,51 +658,49 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl // world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]" usr:lastDblClick = world.time - // ------- DIR CHANGING WHEN CLICKING (changes facting direction) ------ + //Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn + if(istype(usr.loc,/obj/mecha)) + if(usr.client && (src in usr.client.screen)) + return + var/obj/mecha/Mech = usr.loc + Mech.click_action(src,usr) + return - if( usr && iscarbon(usr) && !usr.buckled ) + // ------- DIR CHANGING WHEN CLICKING ------ + if( iscarbon(usr) && !usr.buckled ) if( src.x && src.y && usr.x && usr.y ) var/dx = src.x - usr.x var/dy = src.y - usr.y - if( dy > 0 && abs(dx) < dy ) //North - usr.dir = 1 - if( dy < 0 && abs(dx) < abs(dy) ) //South - usr.dir = 2 - if( dx > 0 && abs(dy) <= dx ) //East - usr.dir = 4 - if( dx < 0 && abs(dy) <= abs(dx) ) //West - usr.dir = 8 - if( dx == 0 && dy == 0 ) - if(src.pixel_y > 16) - usr.dir = 1 - if(src.pixel_y < -16) - usr.dir = 2 - if(src.pixel_x > 16) - usr.dir = 4 - if(src.pixel_x < -16) - usr.dir = 8 + if(dy || dx) + if(abs(dx) < abs(dy)) + if(dy > 0) usr.dir = NORTH + else usr.dir = SOUTH + else + if(dx > 0) usr.dir = EAST + else usr.dir = WEST + else + if(pixel_y > 16) usr.dir = NORTH + else if(pixel_y < -16) usr.dir = SOUTH + else if(pixel_x > 16) usr.dir = EAST + else if(pixel_x < -16) usr.dir = WEST // ------- AI ------- - if (istype(usr, /mob/living/silicon/ai)) + else if (istype(usr, /mob/living/silicon/ai)) var/mob/living/silicon/ai/ai = usr if (ai.control_disabled) return // ------- CYBORG ------- - if (istype (usr, /mob/living/silicon/robot)) + else if (istype(usr, /mob/living/silicon/robot)) var/mob/living/silicon/robot/bot = usr if (bot.lockcharge) return ..() - - - - // ------- SHIFT-CLICK ------- if(params) @@ -752,7 +732,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl else AICtrlClick(usr) return - } + } // ------- MIDDLE-CLICK ------- @@ -767,19 +747,22 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl return usr:throw_item(src) // ------- ITEM IN HAND DEFINED ------- - var/obj/item/W = usr.equipped() - + var/obj/item/W = usr.get_active_hand() +/* Now handled by get_active_hand() // ------- ROBOT ------- if(istype(usr, /mob/living/silicon/robot)) if(!isnull(usr:module_active)) W = usr:module_active else W = null - +*/ // ------- ATTACK SELF ------- if (W == src && usr.stat == 0) - spawn (0) - W.attack_self(usr) + W.attack_self(usr) + if(usr.hand) + usr.update_inv_l_hand() //update in-hand overlays + else + usr.update_inv_r_hand() return // ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) ------- @@ -796,19 +779,15 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl return // ------- 1 TILE AWAY ------- - var/t5 = in_range(src, usr) || src.loc == usr - + var/t5 // ------- AI CAN CLICK ANYTHING ------- - if (istype(usr, /mob/living/silicon/ai)) + if(istype(usr, /mob/living/silicon/ai)) t5 = 1 - // ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF ------- - if ((istype(usr, /mob/living/silicon/robot)) && W == null) + else if(istype(usr, /mob/living/silicon/robot) && !W) t5 = 1 - - // ------- CLICKING ON ORGANS ------- - if (istype(src, /datum/organ) && src in usr.contents) - return + else + t5 = in_range(src, usr) || src.loc == usr // world << "according to dblclick(), t5 is [t5]" @@ -831,6 +810,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl // ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE ------- var/direct = get_dir(usr, src) + var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc ) var/ok = 0 if ( (direct - 1) & direct) @@ -862,12 +842,35 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl var/check_1 = 0 var/check_2 = 0 - check_1 = CanReachThrough(get_turf(usr), Step_1, src) && CanReachThrough(Step_1, get_turf(src), src) + if(step_to(D, Step_1)) + check_1 = 1 + for(var/obj/border_obstacle in Step_1) + if(border_obstacle.flags & ON_BORDER) + if(!border_obstacle.CheckExit(D, src)) + check_1 = 0 + // ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES ------- + for(var/obj/border_obstacle in get_turf(src)) + if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle)) + if(!border_obstacle.CanPass(D, D.loc, 1, 0)) + // ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON ------- + check_1 = 0 - check_2 = CanReachThrough(get_turf(usr), Step_2, src) && CanReachThrough(Step_2, get_turf(src), src) + D.loc = usr.loc + if(step_to(D, Step_2)) + check_2 = 1 - ok = (check_1 || check_2) + for(var/obj/border_obstacle in Step_2) + if(border_obstacle.flags & ON_BORDER) + if(!border_obstacle.CheckExit(D, src)) + check_2 = 0 + for(var/obj/border_obstacle in get_turf(src)) + if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle)) + if(!border_obstacle.CanPass(D, D.loc, 1, 0)) + check_2 = 0 + + if(check_1 || check_2) + ok = 1 // ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. ------- /* @@ -880,16 +883,34 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl */ else // ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) ------- - ok = CanReachThrough(get_turf(usr), get_turf(src), src) + if(loc == usr.loc) + ok = 1 + // ------- OBJECT IS ON THE SAME TILE AS YOU ------- + else + ok = 1 + + //Now, check objects to block exit that are on the border + for(var/obj/border_obstacle in usr.loc) + if(border_obstacle.flags & ON_BORDER) + if(!border_obstacle.CheckExit(D, src)) + ok = 0 + + //Next, check objects to block entry that are on the border + for(var/obj/border_obstacle in get_turf(src)) + if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle)) + if(!border_obstacle.CanPass(D, D.loc, 1, 0)) + ok = 0 /* See the previous More info, for... more info... */ + del(D) + // ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE ------- if (!( ok )) // ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE ------- return 0 - if (!( usr.restrained() )) + if (!( usr.restrained() || (usr.lying && usr.buckled!=src) )) // ------- YOU ARE NOT REASTRAINED ------- if (W) @@ -903,22 +924,16 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl // ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND ------- if (istype(usr, /mob/living/carbon/human)) // ------- YOU ARE HUMAN ------- -/* if(usr.hand) // if he's using his left hand. - var/datum/organ/external/temp = usr:get_organ("l_hand") - if(temp.destroyed) - usr << "\blue You look at your stump." - return - else - var/datum/organ/external/temp = usr:get_organ("r_hand") - if(temp.destroyed) - usr << "\blue You look at your stump." - return*/ src.attack_hand(usr, usr.hand) else // ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED ------- if (istype(usr, /mob/living/carbon/monkey)) src.attack_paw(usr, usr.hand) else if (istype(usr, /mob/living/carbon/alien/humanoid)) + if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter)) + usr.m_intent = "run" + usr.hud_used.move_intent.icon_state = "running" + usr.update_icons() src.attack_alien(usr, usr.hand) else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) src.attack_ai(usr, usr.hand) @@ -990,9 +1005,9 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl usr:handle_regular_hud_updates() var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc ) - A.icon = 'genetics.dmi' + A.icon = 'icons/effects/genetics.dmi' A.icon_state = "eyelasers" - playsound(usr.loc, 'taser2.ogg', 75, 1) + playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1) A.firer = usr A.def_zone = usr:get_organ_target() @@ -1005,56 +1020,24 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl usr.next_move = world.time + 6 return -//////////////////////////////////////// -///IMPORTANT: CACHE FOR DUMMY OBJECTS/// -//Used to cut down on stupid deletions// -//////////////////////////////////////// -var/list/DummyCache = list() -/proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target) +/atom/proc/ShiftClick(var/mob/M as mob) - var/obj/item/weapon/dummy/D = locate() in DummyCache - if(!D) - D = new /obj/item/weapon/dummy( srcturf ) - else - DummyCache.Remove(D) - D.loc = srcturf + if(istype(M.machine, /obj/machinery/computer/security)) //No examining by looking through cameras + return - if(targetturf.density && targetturf != get_turf(target)) - return 0 - - //Now, check objects to block exit that are on the border - for(var/obj/border_obstacle in srcturf) - if(border_obstacle.flags & ON_BORDER) - if(!border_obstacle.CheckExit(D, targetturf)) - D.loc = null - DummyCache.Add(D) - return 0 - - //Next, check objects to block entry that are on the border - for(var/obj/border_obstacle in targetturf) - if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle)) - if(!border_obstacle.CanPass(D, srcturf, 1, 0)) - D.loc = null - DummyCache.Add(D) - return 0 - - D.loc = null - DummyCache.Add(D) - return 1 - -/atom/proc/CtrlClick(var/mob/M as mob) + //I dont think this was ever really a problem and it's only creating more bugs... +// if(( abs(src.x-M.x)<8 || abs(src.y-M.y)<8 ) && src.z == M.z ) //This should prevent non-observers to examine stuff from outside their view. examine() + return /atom/proc/AltClick() - if(hascall(src,"pull")) - src:pull() /* // NOT UNTIL I FIGURE OUT A GOOD WAY TO DO THIS SHIT if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations)) if(!istype(src, /obj/item) && !istype(src, /mob) && !istype(src, /turf)) - if(!usr.equipped()) + if(!usr.get_active_hand()) var/liftable = 0 for(var/x in liftable_structures) @@ -1067,11 +1050,7 @@ var/list/DummyCache = list() add_fingerprint(usr) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(usr) G.assailant = usr - if (usr.hand) - usr.l_hand = G - else - usr.r_hand = G - G.layer = 20 + usr.put_in_active_hand(G) G.structure = src G.synch() @@ -1084,7 +1063,7 @@ var/list/DummyCache = list() return -/atom/proc/ShiftClick() +/atom/proc/CtrlClick() if(hascall(src,"pull")) src:pull() return @@ -1134,32 +1113,95 @@ var/list/DummyCache = list() var/mob/living/carbon/U = M U.swap_hand() + +/atom/proc/get_global_map_pos() + if(!islist(global_map) || isemptylist(global_map)) return + var/cur_x = null + var/cur_y = null + var/list/y_arr = null + for(cur_x=1,cur_x<=global_map.len,cur_x++) + y_arr = global_map[cur_x] + cur_y = y_arr.Find(src.z) + if(cur_y) + break +// world << "X = [cur_x]; Y = [cur_y]" + if(cur_x && cur_y) + return list("x"=cur_x,"y"=cur_y) + else + return 0 + +/atom/proc/checkpass(passflag) + return pass_flags&passflag + + //Could not find object proc defines and this could almost be an atom level one. /obj/proc/process() processing_objects.Remove(src) return 0 -// Show a message to all mobs in sight of this one -// This would be for visible actions by the src mob -// message is the message output to anyone who can see e.g. "[src] does something!" -// self_message (optional) is what the src mob sees e.g. "You do something!" -// blind_message (optional) is what blind people will hear e.g. "You hear something!" -/mob/visible_message(var/message, var/self_message, var/blind_message) - for(var/mob/M in viewers(src)) - var/msg = message - if(self_message && M==src) - msg = self_message - M.show_message( msg, 1, blind_message, 2) +/*Really why was this in the click proc of all the places you could put it + if (usr:a_intent == "help") + // ------- YOU HAVE THE HELP INTENT SELECTED ------- + if(istype(src, /mob/living/carbon)) + // ------- YOUR TARGET IS LIVING CARBON CREATURE (NOT AI OR CYBORG OR SIMPLE ANIMAL) ------- + var/mob/living/carbon/C = src + if(HEAL in usr:mutations) + // ------- YOU ARE HUMAN, WITH THE HELP INTENT TARGETING A HUMAN AND HAVE THE 'HEAT' GENETIC MUTATION ------- + + if(C.stat != 2) + // ------- THE PERSON YOU'RE TOUCHING IS NOT DEAD ------- + + var/t_him = "it" + if (src.gender == MALE) + t_him = "his" + else if (src.gender == FEMALE) + t_him = "her" + var/u_him = "it" + if (usr.gender == MALE) + t_him = "him" + else if (usr.gender == FEMALE) + t_him = "her" + + if(src != usr) + usr.visible_message( \ + "\blue [usr] places [u_him] palms on [src], healing [t_him]!", \ + "\blue You place your palms on [src] and heal [t_him].", \ + ) + else + usr.visible_message( \ + "\blue [usr] places [u_him] palms on [u_him]self and heals.", \ + "\blue You place your palms on yourself and heal.", \ + ) + + C.adjustOxyLoss(-25) + C.adjustToxLoss(-25) + + if(istype(C, /mob/living/carbon/human)) + // ------- YOUR TARGET IS HUMAN ------- + var/mob/living/carbon/human/H = C + var/datum/organ/external/affecting = H.get_organ(check_zone(usr:zone_sel:selecting)) + if(affecting && affecting.heal_damage(25, 25)) + H.UpdateDamageIcon() + else + C.heal_organ_damage(25, 25) + C.adjustCloneLoss(-25) + C.stunned = max(0, C.stunned-5) + C.paralysis = max(0, C.paralysis-5) + C.stuttering = max(0, C.stuttering-5) + C.drowsyness = max(0, C.drowsyness-5) + C.weakened = max(0, C.weakened-5) + usr:nutrition -= rand(1,10) + usr.next_move = world.time + 6 + else + // ------- PERSON YOU'RE TOUCHING IS ALREADY DEAD ------- + usr << "\red [src] is dead and can't be healed." + return + + // ------- IF YOU DON'T HAVE THE SILLY ABILITY ABOVE OR FAIL ON ANY OTHER CHECK, THEN YOU'RE CLICKING ON SOMETHING WITH AN EMPTY HAND. ATTACK_HAND IT IS THEN ------- +*/ -// Show a message to all mobs in sight of this atom -// Use for objects performing visible actions -// message is output to anyone who can see, e.g. "The [src] does something!" -// blind_message (optional) is what blind people will hear e.g. "You hear something!" -/atom/proc/visible_message(var/message, var/blind_message) - for(var/mob/M in viewers(src)) - M.show_message( message, 1, blind_message, 2) diff --git a/code/game/cellautomata.dm b/code/game/cellautomata.dm index 0dbec71e64..b2c8a9d907 100644 --- a/code/game/cellautomata.dm +++ b/code/game/cellautomata.dm @@ -1,21 +1,15 @@ /world/proc/load_mode() var/text = file2text("data/mode.txt") - if (length(text) > 0) + if (text) var/list/lines = dd_text2list(text, "\n") if (lines[1]) master_mode = lines[1] diary << "Saved mode is '[master_mode]'" - else - master_mode = "traitor" // Default mode, in case of errors /world/proc/save_mode(var/the_mode) var/F = file("data/mode.txt") fdel(F) - if (length(the_mode) > 0 && the_mode != "none") // "None" is the vote set to dead people - // , who can't pick an option in a gamemode vote. - F << the_mode - else - F << "traitor" // Default mode, in case of errors + F << the_mode /world/proc/load_motd() join_motd = file2text("config/motd.txt") @@ -41,24 +35,6 @@ admins[m_key] = a_lev diary << ("ADMIN: [m_key] = [a_lev]") - // look for moderators in a separate file - text = file2text("config/moderators.txt") - if (!text) - diary << "Failed to load config/moderators.txt\n" - else - var/list/lines = dd_text2list(text, "\n") - for(var/line in lines) - if (!line) - continue - - if (copytext(line, 1, 2) == ";") - continue - - var/m_key = copytext(line, 1, length(line)+1) - var/a_lev = "Moderator" - admins[m_key] = a_lev - - /world/proc/load_testers() var/text = file2text("config/testers.txt") if (!text) @@ -83,7 +59,7 @@ config = new /datum/configuration() config.load("config/config.txt") config.load("config/game_options.txt","game_options") - config.loadsql("config/dbconfig.txt") + //config.loadsql("config/dbconfig.txt") //config.loadforumsql("config/forumdbconfig.txt") // apply some settings from config.. abandon_allowed = config.respawn @@ -99,11 +75,14 @@ src.load_motd() src.load_admins() investigate_reset() + if (config.usealienwhitelist) load_alienwhitelist() if (config.usewhitelist) load_whitelist() + LoadBansjob() + //Get_Holiday() //~Carn, needs to be here when the station is named so :P src.update_status() makepowernets() @@ -121,14 +100,16 @@ ..() + sleep(50) + plmaster = new /obj/effect/overlay( ) - plmaster.icon = 'tile_effects.dmi' + plmaster.icon = 'icons/effects/tile_effects.dmi' plmaster.icon_state = "plasma" plmaster.layer = FLY_LAYER plmaster.mouse_opacity = 0 slmaster = new /obj/effect/overlay( ) - slmaster.icon = 'tile_effects.dmi' + slmaster.icon = 'icons/effects/tile_effects.dmi' slmaster.icon_state = "sleeping_agent" slmaster.layer = FLY_LAYER slmaster.mouse_opacity = 0 @@ -143,8 +124,11 @@ //Crispy fullban /world/Reboot(var/reason) - send2irc(world.url,"Server Rebooting!") - socket_talk.send_raw("type=reboot") + spawn(0) + send2irc(world.url,"Server Rebooting!") + socket_talk.send_raw("type=reboot") + //world << sound(pick('sound/AI/newroundsexy.ogg','sound/misc/apcdestroyed.ogg','sound/misc/bangindonk.ogg')) // random end sounds!! - LastyBatsy + for(var/client/C) if (config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[config.server]") @@ -183,9 +167,11 @@ var/atom/this = src//detach proc from src src = null - if (!usr || !isturf(usr.loc)) + if(!usr || !isturf(usr.loc)) return - else if (usr.stat != 0 || usr.restrained()) + if(usr.stat || usr.restrained()) + return + if(usr.status_flags & FAKEDEATH) return var/tile = get_turf(this) @@ -194,7 +180,7 @@ var/P = new /obj/effect/decal/point(tile) spawn (20) - del(P) + if(P) del(P) usr.visible_message("[usr] points to [this]") diff --git a/code/game/chemistry.dm b/code/game/chemistry.dm index 1ef9c1de42..7b4a7d945e 100644 --- a/code/game/chemistry.dm +++ b/code/game/chemistry.dm @@ -1,9 +1,9 @@ #define REGULATE_RATE 5 -/obj/item/weapon/smokebomb +/*/obj/item/weapon/smokebomb desc = "It is set to detonate in 2 seconds." name = "smoke bomb" - icon = 'grenade.dmi' + icon = 'icons/obj/grenade.dmi' icon_state = "flashbang" var/state = null var/det_time = 20.0 @@ -18,7 +18,7 @@ /obj/item/weapon/mustardbomb desc = "It is set to detonate in 4 seconds." name = "mustard gas bomb" - icon = 'grenade.dmi' + icon = 'icons/obj/grenade.dmi' icon_state = "flashbang" var/state = null var/det_time = 40.0 @@ -57,12 +57,12 @@ return /obj/item/weapon/smokebomb/afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (user.equipped() == src) + if (user.get_active_hand() == src) if (!( src.state )) user << "\red You prime the smoke bomb! [det_time/10] seconds!" src.state = 1 src.icon_state = "flashbang1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) + playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) spawn( src.det_time ) prime() return @@ -82,7 +82,7 @@ return /obj/item/weapon/smokebomb/proc/prime() - playsound(src.loc, 'smoke.ogg', 50, 1, -3) + playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3) spawn(0) src.smoke.start() sleep(10) @@ -95,7 +95,7 @@ for(var/obj/effect/blob/B in view(8,src)) var/damage = round(30/(get_dist(B,src)+1)) B.health -= damage - B.update() + B.update_icon() sleep(80) del(src) return @@ -126,12 +126,12 @@ return /obj/item/weapon/mustardbomb/afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (user.equipped() == src) + if (user.get_active_hand() == src) if (!( src.state )) user << "\red You prime the mustard gas bomb! [det_time/10] seconds!" src.state = 1 src.icon_state = "flashbang1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) + playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) spawn( src.det_time ) prime() return @@ -151,7 +151,7 @@ return /obj/item/weapon/mustardbomb/proc/prime() - playsound(src.loc, 'smoke.ogg', 50, 1, -3) + playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3) spawn(0) src.mustard_gas.start() sleep(10) @@ -164,7 +164,7 @@ for(var/obj/effect/blob/B in view(8,src)) var/damage = round(30/(get_dist(B,src)+1)) B.health -= damage - B.update() + B.update_icon() sleep(100) del(src) return @@ -179,7 +179,7 @@ prime() return return - +*/ /obj/item/weapon/storage/beakerbox name = "Beaker Box" icon_state = "beaker" @@ -197,7 +197,7 @@ new /obj/item/weapon/reagent_containers/glass/beaker( src ) /obj/item/weapon/paper/alchemy/ - name = "paper - 'Chemistry Information'" + name = "paper- 'Chemistry Information'" /obj/item/weapon/storage/trashcan name = "disposal unit" @@ -206,9 +206,9 @@ density = 1.0 var/processing = null var/locked = 1 - req_access = list(ACCESS_JANITOR) + req_access = list(access_janitor) desc = "A compact incineration device, used to dispose of garbage." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "trashcan" item_state = "syringe_kit" @@ -232,7 +232,7 @@ //Foreach goto(46) t += W.w_class if (t > 30) - user << "You cannot fit the item inside. (Remove larger classed items)" + user << "You cannot fit the item inside. (Remove the larger items first)" return user.u_equip(W) W.loc = src diff --git a/code/game/communications.dm b/code/game/communications.dm index 015a56d871..c0003e2dbd 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -97,10 +97,6 @@ On the map: 1455 for AI access */ -/proc/radioalert(var/message,var/from) - var/obj/item/device/radio/intercom/a = new /obj/item/device/radio/intercom(null) - a.autosay(message,from) - var/list/radiochannels = list( "Common" = 1459, "Science" = 1351, @@ -108,16 +104,29 @@ var/list/radiochannels = list( "Medical" = 1355, "Engineering" = 1357, "Security" = 1359, - "Response Team" = 1439, + "Deathsquad" = 1441, "Syndicate" = 1213, "Mining" = 1349, "Cargo" = 1347, ) //depenging helpers -var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1439,1349,1347) +var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1441,1349,1347) var/const/COMM_FREQ = 1353 //command, colored gold in chat window var/const/SYND_FREQ = 1213 -var/NUKE_FREQ = 1200 //Randomised on nuke rounds. + +#define TRANSMISSION_WIRE 0 +#define TRANSMISSION_RADIO 1 + +/* filters */ +var/const/RADIO_TO_AIRALARM = "1" +var/const/RADIO_FROM_AIRALARM = "2" +var/const/RADIO_CHAT = "3" +var/const/RADIO_ATMOSIA = "4" +var/const/RADIO_NAVBEACONS = "5" +var/const/RADIO_AIRLOCK = "6" +var/const/RADIO_SECBOT = "7" +var/const/RADIO_MULEBOT = "8" +var/const/RADIO_MAGNETS = "9" var/global/datum/controller/radio/radio_controller @@ -240,8 +249,9 @@ datum/radio_frequency for (var/devices_filter in devices) var/list/devices_line = devices[devices_filter] devices_line-=device - devices_line.Remove(null) - if (!devices_line.len) + while (null in devices_line) + devices_line -= null + if (devices_line.len==0) devices -= devices_filter del(devices_line) diff --git a/code/game/dna.dm b/code/game/dna.dm index 6e99a9f048..0ea61c118e 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -1,64 +1,52 @@ /////////////////////////// DNA DATUM - -#define STRUCDNASIZE 27 - /datum/dna var/unique_enzymes = null var/struc_enzymes = null var/uni_identity = null - var/original_name = "Unknown" var/b_type = "A+" + var/mutantrace = null //The type of mutant race the player is if applicable (i.e. potato-man) + var/real_name //Stores the real name of the person who originally got this dna datum. Used primarely for changelings, -/datum/dna/proc/check_integrity(var/mob/living/carbon/character) - if(character && ishuman(character)) +/datum/dna/proc/check_integrity(var/mob/living/carbon/human/character) + if(character) if(length(uni_identity) != 39) //Lazy. - var/mob/living/carbon/human/character2 = character var/temp - var/hair = 0 - var/beard - // determine DNA fragment from hairstyle - // :wtc: - // If the character2 doesn't have initialized hairstyles / beardstyles, initialize it for them! - if(!character2.hair_style) - character2.hair_style = new/datum/sprite_accessory/hair/short + //Hair + var/hair = 0 + if(!character.h_style) + character.h_style = "Skinhead" - if(!character2.facial_hair_style) - character2.facial_hair_style = new/datum/sprite_accessory/facial_hair/shaved + var/hrange = round(4095 / hair_styles_list.len) + var/index = hair_styles_list.Find(character.h_style) + if(index) + hair = index * hrange - rand(1,hrange-1) - var/list/styles = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair - var/hrange = round(4095 / styles.len) + //Facial Hair + var/beard = 0 + if(!character.f_style) + character.f_style = "Shaved" - if(character2.hair_style) - var/style = styles.Find(character2.hair_style.type) - if(style) - hair = style * hrange - rand(1,hrange-1) + var/f_hrange = round(4095 / facial_hair_styles_list.len) + index = facial_hair_styles_list.Find(character.f_style) + if(index) + beard = index * f_hrange - rand(1,f_hrange-1) - // Beard dna code - mostly copypasted from hair code to allow for more dynamic facial hair style additions - var/list/face_styles = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair - var/f_hrange = round(4095 / face_styles.len) - - var/f_style = face_styles.Find(character2.facial_hair_style.type) - if(f_style) - beard = f_style * f_hrange - rand(1,f_hrange-1) - else - beard = 0 - - temp = add_zero2(num2hex((character2.r_hair),1), 3) - temp += add_zero2(num2hex((character2.b_hair),1), 3) - temp += add_zero2(num2hex((character2.g_hair),1), 3) - temp += add_zero2(num2hex((character2.r_facial),1), 3) - temp += add_zero2(num2hex((character2.b_facial),1), 3) - temp += add_zero2(num2hex((character2.g_facial),1), 3) - temp += add_zero2(num2hex(((character2.s_tone + 220) * 16),1), 3) - temp += add_zero2(num2hex((character2.r_eyes),1), 3) - temp += add_zero2(num2hex((character2.g_eyes),1), 3) - temp += add_zero2(num2hex((character2.b_eyes),1), 3) + temp = add_zero2(num2hex((character.r_hair),1), 3) + temp += add_zero2(num2hex((character.b_hair),1), 3) + temp += add_zero2(num2hex((character.g_hair),1), 3) + temp += add_zero2(num2hex((character.r_facial),1), 3) + temp += add_zero2(num2hex((character.b_facial),1), 3) + temp += add_zero2(num2hex((character.g_facial),1), 3) + temp += add_zero2(num2hex(((character.s_tone + 220) * 16),1), 3) + temp += add_zero2(num2hex((character.r_eyes),1), 3) + temp += add_zero2(num2hex((character.g_eyes),1), 3) + temp += add_zero2(num2hex((character.b_eyes),1), 3) var/gender - if (character2.gender == MALE) + if (character.gender == MALE) gender = add_zero2(num2hex((rand(1,(2050+BLOCKADD))),1), 3) else gender = add_zero2(num2hex((rand((2051+BLOCKADD),4094)),1), 3) @@ -68,64 +56,40 @@ temp += add_zero2(num2hex((hair),1), 3) uni_identity = temp - if(length(struc_enzymes)!= 81) + if(length(struc_enzymes)!= 42) var/mutstring = "" - for(var/i = 1, i <= 26, i++) + for(var/i = 1, i <= 13, i++) mutstring += add_zero2(num2hex(rand(1,1024)),3) struc_enzymes = mutstring if(length(unique_enzymes) != 32) unique_enzymes = md5(character.real_name) - if(original_name == "Unknown") - original_name = character.real_name - else if(character && ismonkey(character)) - uni_identity = "00600200A00E0110148FC01300B009" - struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6" - unique_enzymes = md5(character.name) - //////////blah - var/gendervar - if (character.gender == "male") - gendervar = add_zero2(num2hex((rand(1,2049)),1), 3) - else - gendervar = add_zero2(num2hex((rand(2051,4094)),1), 3) - uni_identity += gendervar - uni_identity += "12C" - uni_identity += "4E2" - b_type = "A+" - original_name = character.real_name else if(length(uni_identity) != 39) uni_identity = "00600200A00E0110148FC01300B0095BD7FD3F4" - if(length(struc_enzymes)!= 81) struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B02D6" - -// reg_dna[unique_enzymes] = character.real_name + if(length(struc_enzymes)!= 42) struc_enzymes = "0983E840344C39F4B059D5145FC5785DC6406A4000" /datum/dna/proc/ready_dna(mob/living/carbon/human/character) - var/temp - var/hair - var/beard - // determine DNA fragment from hairstyle - // :wtc: + //Hair + var/hair = 0 + if(!character.h_style) + character.h_style = "Bald" - var/list/styles = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair - var/hrange = round(4095 / styles.len) + var/hrange = round(4095 / hair_styles_list.len) + var/index = hair_styles_list.Find(character.h_style) + if(index) + hair = index * hrange - rand(1,hrange-1) - var/style = styles.Find(character.hair_style.type) - if(style) - hair = style * hrange - rand(1,hrange-1) - else - hair = 0 + //Facial Hair + var/beard = 0 + if(!character.f_style) + character.f_style = "Shaved" - // Beard dna code - mostly copypasted from hair code to allow for more dynamic facial hair style additions - var/list/face_styles = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair - var/f_hrange = round(4095 / face_styles.len) - - var/f_style = face_styles.Find(character.facial_hair_style.type) - if(f_style) - beard = f_style * f_hrange - rand(1,f_hrange-1) - else - beard = 0 + var/f_hrange = round(4095 / facial_hair_styles_list.len) + index = facial_hair_styles_list.Find(character.f_style) + if(index) + beard = index * f_hrange - rand(1,f_hrange-1) temp = add_zero2(num2hex((character.r_hair),1), 3) temp += add_zero2(num2hex((character.b_hair),1), 3) @@ -152,13 +116,12 @@ uni_identity = temp var/mutstring = "" - for(var/i = 1, i <= 26, i++) + for(var/i = 1, i <= 13, i++) mutstring += add_zero2(num2hex(rand(1,1024)),3) struc_enzymes = mutstring unique_enzymes = md5(character.real_name) - original_name = character.real_name reg_dna[unique_enzymes] = character.real_name /////////////////////////// DNA DATUM @@ -251,6 +214,49 @@ if (!output) output = "5" return output +//Instead of picking a value far from the input, this will pick values closer to it. +//Sorry for the block of code, but it's more efficient then calling text2hex -> loop -> hex2text +/proc/miniscrambletarget(input,rs,rd) + var/output = null + switch(input) + if("0") + output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10));"2",prob((rs*10)-(rd));"3") + if("1") + output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10));"3",prob((rs*10)-(rd));"4") + if("2") + output = pick(prob((rs*10));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10));"4",prob((rs*10)-(rd));"5") + if("3") + output = pick(prob((rs*10)-(rd));"0",prob((rs*10));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10));"5",prob((rs*10)-(rd));"6") + if("4") + output = pick(prob((rs*10)-(rd));"1",prob((rs*10));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10));"6",prob((rs*10)-(rd));"7") + if("5") + output = pick(prob((rs*10)-(rd));"2",prob((rs*10));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10));"7",prob((rs*10)-(rd));"8") + if("6") + output = pick(prob((rs*10)-(rd));"3",prob((rs*10));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10));"8",prob((rs*10)-(rd));"9") + if("7") + output = pick(prob((rs*10)-(rd));"4",prob((rs*10));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10));"9",prob((rs*10)-(rd));"A") + if("8") + output = pick(prob((rs*10)-(rd));"5",prob((rs*10));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10));"A",prob((rs*10)-(rd));"B") + if("9") + output = pick(prob((rs*10)-(rd));"6",prob((rs*10));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C") + if("10")//A + output = pick(prob((rs*10)-(rd));"7",prob((rs*10));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10));"C",prob((rs*10)-(rd));"D") + if("11")//B + output = pick(prob((rs*10)-(rd));"8",prob((rs*10));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10));"D",prob((rs*10)-(rd));"E") + if("12")//C + output = pick(prob((rs*10)-(rd));"9",prob((rs*10));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10));"E",prob((rs*10)-(rd));"F") + if("13")//D + output = pick(prob((rs*10)-(rd));"A",prob((rs*10));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10));"F") + if("14")//E + output = pick(prob((rs*10)-(rd));"B",prob((rs*10));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") + if("15")//F + output = pick(prob((rs*10)-(rd));"C",prob((rs*10));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") + + if(!input || !output) //How did this happen? + output = "8" + + return output + /proc/isblockon(hnumber, bnumber , var/UI = 0) var/temp2 @@ -283,7 +289,7 @@ if(!M) return var/num var/newdna - num = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK) + num = pick(1,3,FAKEBLOCK,5,CLUMSYBLOCK,7,9,BLINDBLOCK,DEAFBLOCK) M.dna.check_integrity() newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) M.dna.struc_enzymes = newdna @@ -303,13 +309,13 @@ if(!M) return M.dna.check_integrity() if(type) - for(var/i = 1, i <= 26, i++) + for(var/i = 1, i <= 13, i++) if(prob(p)) M.dna.uni_identity = setblock(M.dna.uni_identity, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) updateappearance(M, M.dna.uni_identity) else - for(var/i = 1, i <= 26, i++) + for(var/i = 1, i <= 13, i++) if(prob(p)) M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) domutcheck(M, null) @@ -358,122 +364,51 @@ else H.gender = MALE - - /// BEARDS - - var/beardnum = hex2num(getblock(structure,12,3)) - var/list/facial_styles = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair - var/fstyle = round(1 +(beardnum / 4096)*facial_styles.len) - - var/fpath = text2path("[facial_styles[fstyle]]") - var/datum/sprite_accessory/facial_hair/fhair = new fpath - - H.face_icon_state = fhair.icon_state - H.f_style = fhair.icon_state - H.facial_hair_style = fhair - - - // HAIR + //Hair var/hairnum = hex2num(getblock(structure,13,3)) - var/list/styles = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair - var/style = round(1 +(hairnum / 4096)*styles.len) + var/index = round(1 +(hairnum / 4096)*hair_styles_list.len) + if((0 < index) && (index <= hair_styles_list.len)) + H.h_style = hair_styles_list[index] - var/hpath = text2path("[styles[style]]") - var/datum/sprite_accessory/hair/hair = new hpath + //Facial Hair + var/beardnum = hex2num(getblock(structure,12,3)) + index = round(1 +(beardnum / 4096)*facial_hair_styles_list.len) + if((0 < index) && (index <= facial_hair_styles_list.len)) + H.f_style = facial_hair_styles_list[index] - H.hair_icon_state = hair.icon_state - H.h_style = hair.icon_state - H.hair_style = hair - - H.update_face() - H.update_body() - - H.warn_flavor_changed() + H.update_body(0) + H.update_hair() return 1 else return 0 -/proc/ismuton(var/block,var/mob/M) - return isblockon(getblock(M.dna.struc_enzymes, block,3),block) - /proc/domutcheck(mob/living/M as mob, connected, inj) - if (!M) return - - //disabilities - //1 = blurry eyes - //2 = headache - //4 = coughing - //8 = twitch - //16 = nervous - //32 = deaf - //64 = mute - //128 = blind - + //telekinesis = 1 + //firemut = 2 + //xray = 4 + //hulk = 8 + //clumsy = 16 M.dna.check_integrity() M.disabilities = 0 + M.sdisabilities = 0 M.mutations = list() M.see_in_dark = 2 - M.see_invisible = 0 + M.see_invisible = SEE_INVISIBLE_LIVING - - if(ismuton(NOBREATHBLOCK,M)) - if(prob(50)) - M << "\blue You feel no need to breathe." - M.mutations.Add(MNOBREATH) - if(ismuton(REMOTEVIEWBLOCK,M)) - if(prob(50)) - M << "\blue Your mind expands" - M.mutations.Add(MREMOTEVIEW) - if(ismuton(REGENERATEBLOCK,M)) - if(prob(50)) - M << "\blue You feel strange" - M.mutations.Add(MREGENERATE) - if(ismuton(INCREASERUNBLOCK,M)) - if(prob(50)) - M << "\blue You feel quick" - M.mutations.Add(MINCREASERUN) - if(ismuton(REMOTETALKBLOCK,M)) - if(prob(50)) - M << "\blue You expand your mind outwards" - M.mutations.Add(MREMOTETALK) - if(ismuton(MORPHBLOCK,M)) - if(prob(50)) - M.mutations.Add(MMORPH) - M << "\blue Your skin feels strange" - if(ismuton(BLENDBLOCK,M)) - if(prob(50)) - M.mutations.Add(MBLEND) - M << "\blue You feel alone" - if(ismuton(HALLUCINATIONBLOCK,M)) - if(prob(50)) - M.mutations.Add(MHALLUCINATION) - M << "\blue Your mind says 'Hello'" - if(ismuton(NOPRINTSBLOCK,M)) - if(prob(50)) - M.mutations.Add(MFINGERPRINTS) - M << "\blue Your fingers feel numb" - if(ismuton(SHOCKIMMUNITYBLOCK,M)) - if(prob(50)) - M.mutations.Add(MSHOCK) - M << "\blue You feel strange" - if(ismuton(SMALLSIZEBLOCK,M)) - if(prob(50)) - M << "\blue Your skin feels rubbery" - M.mutations.Add(MSMALLSIZE) - - - - if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),HULKBLOCK)) - if(inj || prob(5)) + if (isblockon(getblock(M.dna.struc_enzymes, 1,3),1)) + M.disabilities |= NEARSIGHTED + M << "\red Your eyes feel strange." + if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),2)) + if(inj || prob(10)) M << "\blue Your muscles hurt." M.mutations.Add(HULK) - if (isblockon(getblock(M.dna.struc_enzymes, HEADACHEBLOCK,3),HEADACHEBLOCK)) - M.disabilities |= 2 + if (isblockon(getblock(M.dna.struc_enzymes, 3,3),3)) + M.disabilities |= EPILEPSY M << "\red You get a headache." - if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),FAKEBLOCK)) + if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),4)) M << "\red You feel strange." if (prob(95)) if(prob(50)) @@ -482,82 +417,85 @@ randmuti(M) else randmutg(M) - if (isblockon(getblock(M.dna.struc_enzymes, COUGHBLOCK,3),COUGHBLOCK)) - M.disabilities |= 4 + if (isblockon(getblock(M.dna.struc_enzymes, 5,3),5)) + M.disabilities |= COUGHING M << "\red You start coughing." - if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),CLUMSYBLOCK)) + if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),6)) M << "\red You feel lightheaded." M.mutations.Add(CLUMSY) - if (isblockon(getblock(M.dna.struc_enzymes, TWITCHBLOCK,3),TWITCHBLOCK)) - M.disabilities |= 8 + if (isblockon(getblock(M.dna.struc_enzymes, 7,3),7)) + M.disabilities |= TOURETTES M << "\red You twitch." - if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),XRAYBLOCK)) + if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),8)) if(inj || prob(30)) M << "\blue The walls suddenly disappear." M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) M.see_in_dark = 8 - M.see_invisible = 2 + M.see_invisible = SEE_INVISIBLE_LEVEL_TWO M.mutations.Add(XRAY) - if (isblockon(getblock(M.dna.struc_enzymes, NERVOUSBLOCK,3),NERVOUSBLOCK)) - M.disabilities |= 16 + if (isblockon(getblock(M.dna.struc_enzymes, 9,3),9)) + M.disabilities |= NERVOUS M << "\red You feel nervous." - if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),FIREBLOCK)) + if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),10)) if(inj || prob(30)) M << "\blue Your body feels warm." M.mutations.Add(COLD_RESISTANCE) - if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),BLINDBLOCK)) - M.disabilities |= 128 + if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),11)) + M.sdisabilities |= BLIND M << "\red You can't seem to see anything." - if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),TELEBLOCK)) - if(inj || prob(15)) + if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),12)) + if(inj || prob(25)) M << "\blue You feel smarter." M.mutations.Add(TK) - if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),DEAFBLOCK)) - M.disabilities |= 32 + if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),13)) + M.sdisabilities |= DEAF M.ear_deaf = 1 - M << "\red Its kinda quiet.." - if (isblockon(getblock(M.dna.struc_enzymes, GLASSESBLOCK,3),GLASSESBLOCK)) - M.disabilities |= 1 - M << "Your eyes feel weird..." + M << "\red You can't seem to hear anything..." + /* If you want the new mutations to work, UNCOMMENT THIS. + if(istype(M, /mob/living/carbon)) + for (var/datum/mutations/mut in global_mutations) + mut.check_mutation(M) + */ //////////////////////////////////////////////////////////// Monkey Block - if (isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) + if (isblockon(getblock(M.dna.struc_enzymes, 14,3),14) && istype(M, /mob/living/carbon/human)) // human > monkey var/mob/living/carbon/human/H = M H.monkeyizing = 1 + var/list/implants = list() //Try to preserve implants. + for(var/obj/item/weapon/implant/W in H) + implants += W + W.loc = null + if(!connected) - for(var/obj/item/W in (H.contents)) + for(var/obj/item/W in (H.contents-implants)) if (W==H.w_uniform) // will be teared continue - H.drop_from_slot(W) - M.rebuild_appearance() + H.drop_from_inventory(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null M.invisibility = 101 var/atom/movable/overlay/animation = new( M.loc ) animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = src flick("h2monkey", animation) sleep(48) del(animation) var/mob/living/carbon/monkey/O = new(src) - O.organs.Cut() - O.organs = H.organs - for(var/name in O.organs) - var/datum/organ/external/organ = O.organs[name] - organ.owner = O - for(var/obj/item/weapon/implant/implant in organ.implant) - implant.imp_in = O if(M) if (M.dna) O.dna = M.dna M.dna = null + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + for(var/datum/disease/D in M.viruses) O.viruses += D @@ -565,7 +503,7 @@ M.viruses -= D - for(var/obj/T in (M.contents)) + for(var/obj/T in (M.contents-implants)) del(T) //for(var/R in M.organs) // del(M.organs[text("[]", R)]) @@ -573,40 +511,44 @@ O.loc = M.loc if(M.mind) - M.mind.transfer_to(O) + M.mind.transfer_to(O) //transfer our mind to the cute little monkey if (connected) //inside dna thing var/obj/machinery/dna_scannernew/C = connected O.loc = C C.occupant = O connected = null - O.name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) + O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) O.adjustToxLoss(M.getToxLoss() + 20) O.adjustOxyLoss(M.getOxyLoss()) O.stat = M.stat O.a_intent = "hurt" - O.flavor_text = M.flavor_text - O.warn_flavor_changed() - O.rebuild_appearance() + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call del(M) return - if (!isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && !istype(M, /mob/living/carbon/human)) + if (!isblockon(getblock(M.dna.struc_enzymes, 14,3),14) && !istype(M, /mob/living/carbon/human)) // monkey > human, var/mob/living/carbon/monkey/Mo = M Mo.monkeyizing = 1 + var/list/implants = list() //Still preserving implants + for(var/obj/item/weapon/implant/W in Mo) + implants += W + W.loc = null if(!connected) - for(var/obj/item/W in (Mo.contents)) - Mo.drop_from_slot(W) - M.rebuild_appearance() + for(var/obj/item/W in (Mo.contents-implants)) + Mo.drop_from_inventory(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null M.invisibility = 101 var/atom/movable/overlay/animation = new( M.loc ) animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = src flick("monkey2h", animation) sleep(48) @@ -617,15 +559,15 @@ O.gender = FEMALE else O.gender = MALE - O.dna = M.dna - M.dna = null - O.organs.Cut() - O.organs = M.organs - for(var/name in O.organs) - var/datum/organ/external/organ = O.organs[name] - organ.owner = O - for(var/obj/item/weapon/implant/implant in organ.implant) - implant.imp_in = O + + if (M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null for(var/datum/disease/D in M.viruses) O.viruses += D @@ -638,7 +580,7 @@ O.loc = M.loc if(M.mind) - M.mind.transfer_to(O) + M.mind.transfer_to(O) //transfer our mind to the human if (connected) //inside dna thing var/obj/machinery/dna_scannernew/C = connected @@ -663,14 +605,15 @@ O.adjustToxLoss(M.getToxLoss()) O.adjustOxyLoss(M.getOxyLoss()) O.stat = M.stat - O.flavor_text = M.flavor_text - O.warn_flavor_changed() - O.rebuild_appearance() + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call del(M) return //////////////////////////////////////////////////////////// Monkey Block - if (M) - M.rebuild_appearance() + if(M) + M.update_icon = 1 //queue a full icon update at next life() call return null /////////////////////////// DNA MISC-PROCS @@ -705,6 +648,12 @@ if (usr.stat != 0) return src.go_out() + for(var/obj/O in src) + if((!istype(O,/obj/item/weapon/circuitboard/clonescanner)) && (!istype(O,/obj/item/weapon/stock_parts)) && (!istype(O,/obj/item/weapon/cable_coil))) + O.loc = get_turf(src)//Ejects items that manage to get in there (exluding the components) + if(!occupant) + for(var/mob/M in src)//Failsafe so you can get mobs out + M.loc = get_turf(src) add_fingerprint(usr) return @@ -715,13 +664,16 @@ if (usr.stat != 0) return + if (!ishuman(usr) && !ismonkey(usr)) //Make sure they're a mob that has dna + usr << "\blue Try as you might, you can not climb up into the scanner." + return if (src.occupant) usr << "\blue The scanner is already occupied!" return - if (usr.abiotic2()) + if (usr.abiotic()) usr << "\blue Subject cannot have abiotic items on." return - usr.pulling = null + usr.stop_pulling() usr.client.perspective = EYE_PERSPECTIVE usr.client.eye = src usr.loc = src @@ -742,44 +694,47 @@ if (src.occupant) user << "\blue The scanner is already occupied!" return - if (G.affecting.abiotic2()) + if (G.affecting.abiotic()) user << "\blue Subject cannot have abiotic items on." return var/mob/M = G.affecting - if (M.client) + if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.loc = src src.occupant = M src.icon_state = "scanner_1" - /* - for(var/obj/O in src) // this is stupid too - O.loc = src.loc - //Foreach goto(154) - */ + src.add_fingerprint(user) - //G = null // search for ghosts, if the corpse is empty and the scanner is connected to a cloner -// if(locate(/obj/machinery/computer/cloning, get_step(src, EAST))) -// -// if (!M.client) -// for(var/mob/dead/observer/ghost in world) -// if(ghost.corpse == M && ghost.client) -// ghost << "Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned! (Verbs -> Ghost -> Re-enter corpse)" -// break + if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \ + || locate(/obj/machinery/computer/cloning, get_step(src, SOUTH)) \ + || locate(/obj/machinery/computer/cloning, get_step(src, EAST)) \ + || locate(/obj/machinery/computer/cloning, get_step(src, WEST))) + + if(!M.client && M.mind) + for(var/mob/dead/observer/ghost in player_list) + if(ghost.mind == M.mind) + ghost << "Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned! (Verbs -> Ghost -> Re-enter corpse)" + break del(G) return /obj/machinery/dna_scannernew/proc/go_out() if ((!( src.occupant ) || src.locked)) return - +/* +// it's like this was -just- here to break constructed dna scanners -Pete +// if that's not the case, slap my shit and uncomment this. +// for(var/obj/O in src) +// O.loc = src.loc +*/ + //Foreach goto(30) if (src.occupant.client) src.occupant.client.eye = src.occupant.client.mob src.occupant.client.perspective = MOB_PERSPECTIVE src.occupant.loc = src.loc - src.occupant.update_clothing() src.occupant = null src.icon_state = "scanner_0" return @@ -822,7 +777,7 @@ A.loc = src.loc del(src) -/obj/machinery/scan_consolenew/ex_act(severity) +/obj/machinery/computer/scan_consolenew/ex_act(severity) switch(severity) if(1.0) @@ -837,12 +792,12 @@ else return -/obj/machinery/scan_consolenew/blob_act() +/obj/machinery/computer/scan_consolenew/blob_act() if(prob(75)) del(src) -/obj/machinery/scan_consolenew/power_change() +/obj/machinery/computer/scan_consolenew/power_change() if(stat & BROKEN) icon_state = "broken" else if(powered()) @@ -872,15 +827,14 @@ src.diskette = W user << "You insert [W]." src.updateUsrDialog() - +/* /obj/machinery/computer/scan_consolenew/process() //not really used right now - processing_objects.Remove(src) //Lets not have it waste CPU if(stat & (NOPOWER|BROKEN)) return if (!( src.status )) //remove this return return - +*/ /obj/machinery/computer/scan_consolenew/attack_paw(user as mob) return src.attack_hand(user) @@ -890,9 +844,6 @@ /obj/machinery/computer/scan_consolenew/attack_hand(user as mob) if(..()) return - if(!(user in message)) - user << "\blue This machine looks extremely complex. You'd probably need a decent knowledge of Genetics to understand it." - message += user var/dat if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing src.delete = src.delete @@ -901,7 +852,7 @@ dat = text("[]

Main Menu", src.temphtml, src) else if (src.connected) //Is something connected? - var/mob/occupant = src.connected.occupant + var/mob/living/occupant = src.connected.occupant dat = "Occupant Statistics:
" //Blah obvious if(occupant && occupant.dna) //is there REALLY someone in there? if(NOCLONE in occupant.mutations) @@ -944,7 +895,7 @@ dat += text("

Close", user) else dat = " Error: No DNA Modifier connected. " - user << browse(dat, "window=scannernew;size=700x625") + user << browse(dat, "window=scannernew;size=550x625") onclose(user, "scannernew") return @@ -953,6 +904,8 @@ return if(!istype(usr.loc, /turf)) return + if(!src || !src.connected) + return if ((usr.contents.Find(src) || in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))) usr.machine = src if (href_list["locked"]) @@ -960,6 +913,10 @@ src.connected.locked = !( src.connected.locked ) //////////////////////////////////////////////////////// if (href_list["genpulse"]) + if(!src.connected.occupant || !src.connected.occupant.dna)//Makes sure someone is in there (And valid) before trying anything + src.temphtml = text("No viable occupant detected.")//More than anything, this just acts as a sanity check in case the option DOES appear for whatever reason + usr << browse(temphtml, "window=scannernew;size=550x650") + onclose(usr, "scannernew") src.delete = 1 src.temphtml = text("Working ... Please wait ([] Seconds)", src.radduration) usr << browse(temphtml, "window=scannernew;size=550x650") @@ -992,11 +949,19 @@ src.temphtml += text("-- Intesity ++
", src, src) src.delete = 0 if (href_list["radleplus"]) + if(!src.connected.occupant || !src.connected.occupant.dna) + src.temphtml = text("No viable occupant detected.") + usr << browse(temphtml, "window=scannernew;size=550x650") + onclose(usr, "scannernew") if (src.radduration < 20) src.radduration++ src.radduration++ dopage(src,"radset") if (href_list["radleminus"]) + if(!src.connected.occupant || !src.connected.occupant.dna) + src.temphtml = text("No viable occupant detected.") + usr << browse(temphtml, "window=scannernew;size=550x650") + onclose(usr, "scannernew") if (src.radduration > 2) src.radduration-- src.radduration-- @@ -1011,6 +976,10 @@ dopage(src,"radset") //////////////////////////////////////////////////////// if (href_list["unimenu"]) + if(!src.connected.occupant || !src.connected.occupant.dna) + src.temphtml = text("No viable occupant detected.") + usr << browse(temphtml, "window=scannernew;size=550x650") + onclose(usr, "scannernew") //src.temphtml = text("Unique Identifier: []

", src.connected.occupant.dna.uni_identity) //src.temphtml = text("Unique Identifier: [getleftblocks(src.connected.occupant.dna.uni_identity,uniblock,3)][src.subblock == 1 ? ""+getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),1,1)+"" : getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),1,1)][src.subblock == 2 ? ""+getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),2,1)+"" : getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),2,1)][src.subblock == 3 ? ""+getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),3,1)+"" : getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),3,1)][getrightblocks(src.connected.occupant.dna.uni_identity,uniblock,3)]

") @@ -1021,29 +990,79 @@ src.temphtml += text("<- Block ->

", src, src) src.temphtml += text("Selected Sub-Block: []
", src.subblock) src.temphtml += text("<- Sub-Block ->

", src, src) + src.temphtml += text("Selected Target: []
", src.unitargethex) + src.temphtml += text("<- Target ->

", src, src) src.temphtml += "Modify Block:
" src.temphtml += text("Irradiate
", src) src.delete = 0 if (href_list["unimenuplus"]) if (src.uniblock < 13) src.uniblock++ + else + src.uniblock = 1 dopage(src,"unimenu") if (href_list["unimenuminus"]) if (src.uniblock > 1) src.uniblock-- + else + src.uniblock = 13 dopage(src,"unimenu") if (href_list["unimenusubplus"]) if (src.subblock < 3) src.subblock++ + else + src.subblock = 1 dopage(src,"unimenu") if (href_list["unimenusubminus"]) if (src.subblock > 1) src.subblock-- + else + src.subblock = 3 + dopage(src,"unimenu") + if (href_list["unimenutargetplus"]) + if (src.unitarget < 15) + src.unitarget++ + src.unitargethex = src.unitarget + switch(unitarget) + if(10) + src.unitargethex = "A" + if(11) + src.unitargethex = "B" + if(12) + src.unitargethex = "C" + if(13) + src.unitargethex = "D" + if(14) + src.unitargethex = "E" + if(15) + src.unitargethex = "F" + else + src.unitarget = 0 + src.unitargethex = 0 + dopage(src,"unimenu") + if (href_list["unimenutargetminus"]) + if (src.unitarget > 0) + src.unitarget-- + src.unitargethex = src.unitarget + switch(unitarget) + if(10) + src.unitargethex = "A" + if(11) + src.unitargethex = "B" + if(12) + src.unitargethex = "C" + if(13) + src.unitargethex = "D" + if(14) + src.unitargethex = "E" + else + src.unitarget = 15 + src.unitargethex = "F" dopage(src,"unimenu") if (href_list["uimenuset"] && href_list["uimenusubset"]) // This chunk of code updates selected block / sub-block based on click var/menuset = text2num(href_list["uimenuset"]) var/menusubset = text2num(href_list["uimenusubset"]) - if ((menuset <= 27) && (menuset >= 1)) + if ((menuset <= 13) && (menuset >= 1)) src.uniblock = menuset if ((menusubset <= 3) && (menusubset >= 1)) src.subblock = menusubset @@ -1067,7 +1086,7 @@ return null /// if (prob((80 + (src.radduration / 2)))) - block = miniscramble(block, src.radstrength, src.radduration) + block = miniscrambletarget(num2text(unitarget), src.radstrength, src.radduration) newblock = null if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),2,1) + getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),3,1) if (src.subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),1,1) + block + getblock(getblock(src.connected.occupant.dna.uni_identity,src.uniblock,3),3,1) @@ -1089,6 +1108,10 @@ src.delete = 0 //////////////////////////////////////////////////////// if (href_list["rejuv"]) + if(!src.connected.occupant || !src.connected.occupant.dna) + src.temphtml = text("No viable occupant detected.") + usr << browse(temphtml, "window=scannernew;size=550x650") + onclose(usr, "scannernew") var/mob/living/carbon/human/H = src.connected.occupant if(H) if (H.reagents.get_reagent_amount("inaprovaline") < 60) @@ -1098,15 +1121,8 @@ //////////////////////////////////////////////////////// if (href_list["strucmenu"]) if(src.connected.occupant) - var/temp_string1 = getleftblocks(src.connected.occupant.dna.struc_enzymes,strucblock,3) - var/temp1 = "" - for(var/i = 3, i <= length(temp_string1), i += 3) - temp1 += copytext(temp_string1, i-2, i+1) + " " - var/temp_string2 = getrightblocks(src.connected.occupant.dna.struc_enzymes,strucblock,3) - var/temp2 = "" - for(var/i = 3, i <= length(temp_string2), i += 3) - temp2 += copytext(temp_string2, i-2, i+1) + " " - //src.temphtml = text("Structural Enzymes: [temp1] [src.subblock == 1 ? ""+getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),1,1)+"" : getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),1,1)][src.subblock == 2 ? ""+getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1)+"":getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1)][src.subblock == 3 ? ""+getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1)+"":getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1)] [temp2]

") + // Get this shit outta here it sucks + //src.temphtml = text("Structural Enzymes: [getleftblocks(src.connected.occupant.dna.struc_enzymes,strucblock,3)][src.subblock == 1 ? ""+getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),1,1)+"" : getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),1,1)][src.subblock == 2 ? ""+getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1)+"" : getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1)][src.subblock == 3 ? ""+getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1)+"" : getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1)][getrightblocks(src.connected.occupant.dna.struc_enzymes,strucblock,3)]

") //src.temphtml = text("Structural Enzymes: []

", src.connected.occupant.dna.struc_enzymes) // New shit, it doesn't suck (as much) @@ -1114,35 +1130,35 @@ // SE of occupant, selected block, selected subblock, block size (3 subblocks) src.temphtml += text("Selected Block: []
", src.strucblock) - src.temphtml += text("<- Block ->

", src, src, src) + src.temphtml += text("<- Block ->

", src, src) src.temphtml += text("Selected Sub-Block: []
", src.subblock) src.temphtml += text("<- Sub-Block ->

", src, src) src.temphtml += "Modify Block:
" src.temphtml += text("Irradiate
", src) src.delete = 0 if (href_list["strucmenuplus"]) - if (src.strucblock < 27) + if (src.strucblock < 14) src.strucblock++ + else + src.strucblock = 1 dopage(src,"strucmenu") if (href_list["strucmenuminus"]) if (src.strucblock > 1) src.strucblock-- - dopage(src,"strucmenu") - if (href_list["strucmenuchoose"]) - var/temp = input("What block?", "Block", src.strucblock) as num - if (temp > 27) - temp = 27 - if (temp < 1) - temp = 1 - src.strucblock = temp + else + src.strucblock = 14 dopage(src,"strucmenu") if (href_list["strucmenusubplus"]) if (src.subblock < 3) src.subblock++ + else + src.subblock = 1 dopage(src,"strucmenu") if (href_list["strucmenusubminus"]) if (src.subblock > 1) src.subblock-- + else + src.subblock = 3 dopage(src,"strucmenu") if (href_list["semenuset"] && href_list["semenusubset"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes) var/menuset = text2num(href_list["semenuset"]) @@ -1173,13 +1189,13 @@ /// if(src.connected.occupant) if (prob((80 + (src.radduration / 2)))) - if (prob (20)) + if ((src.strucblock != 2 || src.strucblock != 12 || src.strucblock != 8 || src.strucblock || 10) && prob (20)) oldblock = src.strucblock block = miniscramble(block, src.radstrength, src.radduration) newblock = null - if (src.strucblock > 1 && src.strucblock < STRUCDNASIZE/2) + if (src.strucblock > 1 && src.strucblock < 5) src.strucblock++ - else if (src.strucblock > STRUCDNASIZE/2 && src.strucblock < STRUCDNASIZE) + else if (src.strucblock > 5 && src.strucblock < 14) src.strucblock-- if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1) if (src.subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),1,1) + block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1) @@ -1190,6 +1206,7 @@ src.connected.occupant.radiation += (src.radstrength+src.radduration) src.strucblock = oldblock else + // block = miniscramble(block, src.radstrength, src.radduration) newblock = null if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1) @@ -1262,10 +1279,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer1owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer1owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer1owner = src.connected.occupant.real_name + src.buffer1owner = src.connected.occupant.real_name src.buffer1label = "Unique Identifier" src.buffer1type = "ui" dopage(src,"buffermenu") @@ -1275,10 +1289,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer1owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer1owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer1owner = src.connected.occupant.real_name + src.buffer1owner = src.connected.occupant.real_name src.buffer1label = "Unique Identifier & Unique Enzymes" src.buffer1type = "ui" src.buffer1iue = 1 @@ -1289,10 +1300,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer2owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer2owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer2owner = src.connected.occupant.real_name + src.buffer2owner = src.connected.occupant.real_name src.buffer2label = "Unique Identifier & Unique Enzymes" src.buffer2type = "ui" src.buffer2iue = 1 @@ -1303,10 +1311,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer3owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer3owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer3owner = src.connected.occupant.real_name + src.buffer3owner = src.connected.occupant.real_name src.buffer3label = "Unique Identifier & Unique Enzymes" src.buffer3type = "ui" src.buffer3iue = 1 @@ -1318,10 +1323,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer2owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer2owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer2owner = src.connected.occupant.real_name + src.buffer2owner = src.connected.occupant.real_name src.buffer2label = "Unique Identifier" src.buffer2type = "ui" dopage(src,"buffermenu") @@ -1332,10 +1334,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer3owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer3owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer3owner = src.connected.occupant.real_name + src.buffer3owner = src.connected.occupant.real_name src.buffer3label = "Unique Identifier" src.buffer3type = "ui" dopage(src,"buffermenu") @@ -1346,10 +1345,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer1owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer1owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer1owner = src.connected.occupant.real_name + src.buffer1owner = src.connected.occupant.real_name src.buffer1label = "Structural Enzymes" src.buffer1type = "se" dopage(src,"buffermenu") @@ -1360,10 +1356,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer2owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer2owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer2owner = src.connected.occupant.real_name + src.buffer2owner = src.connected.occupant.real_name src.buffer2label = "Structural Enzymes" src.buffer2type = "se" dopage(src,"buffermenu") @@ -1374,10 +1367,7 @@ if (!istype(src.connected.occupant,/mob/living/carbon/human)) src.buffer3owner = src.connected.occupant.name else - if(src.connected.occupant.real_name == "Unknown" && src.connected.occupant.dna.original_name != "Unknown") - src.buffer3owner = src.connected.occupant.dna.original_name //Good god, is that unweildy - else - src.buffer3owner = src.connected.occupant.real_name + src.buffer3owner = src.connected.occupant.real_name src.buffer3label = "Structural Enzymes" src.buffer3type = "se" dopage(src,"buffermenu") @@ -1415,7 +1405,6 @@ if (src.buffer1iue) src.connected.occupant.real_name = src.buffer1owner src.connected.occupant.name = src.buffer1owner - src.connected.occupant.dna.original_name = src.buffer1owner src.connected.occupant.dna.uni_identity = src.buffer1 updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) else if (src.buffer1type == "se") @@ -1431,7 +1420,6 @@ if (src.buffer2iue) src.connected.occupant.real_name = src.buffer2owner src.connected.occupant.name = src.buffer2owner - src.connected.occupant.dna.original_name = src.buffer2owner src.connected.occupant.dna.uni_identity = src.buffer2 updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) else if (src.buffer2type == "se") @@ -1447,7 +1435,6 @@ if (src.buffer3iue) src.connected.occupant.real_name = src.buffer3owner src.connected.occupant.name = src.buffer3owner - src.connected.occupant.dna.original_name = src.buffer3owner src.connected.occupant.dna.uni_identity = src.buffer3 updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) else if (src.buffer3type == "se") diff --git a/code/game/events/EventProcs/clang.dm b/code/game/events/EventProcs/clang.dm index 0524a08f08..c74da4010e 100644 --- a/code/game/events/EventProcs/clang.dm +++ b/code/game/events/EventProcs/clang.dm @@ -10,32 +10,38 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 /obj/effect/immovablerod name = "Immovable Rod" desc = "What the fuck is that?" - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "immrod" throwforce = 100 density = 1 anchored = 1 Bump(atom/clong) - if (istype(clong, /turf) && !istype(clong, /turf/simulated/shuttle) && !istype(clong, /turf/unsimulated)) + if(istype(clong, /turf/simulated/shuttle)) //Skip shuttles without actually deleting the rod + return + + else if (istype(clong, /turf) && !istype(clong, /turf/unsimulated)) if(clong.density) clong.ex_act(2) for (var/mob/O in hearers(src, null)) O.show_message("CLANG", 2) - if (istype(clong, /obj)) + + else if (istype(clong, /obj)) if(clong.density) clong.ex_act(2) for (var/mob/O in hearers(src, null)) O.show_message("CLANG", 2) - if (istype(clong, /mob)) + + else if (istype(clong, /mob)) if(clong.density || prob(10)) clong.meteorhit(src) + else + del(src) + if(clong && prob(25)) src.loc = clong.loc - else del(src) /proc/immovablerod() - var/startx = 0 var/starty = 0 var/endy = 0 diff --git a/code/game/events/EventProcs/dust.dm b/code/game/events/EventProcs/dust.dm index e3dcfce0ba..fb1f167c34 100644 --- a/code/game/events/EventProcs/dust.dm +++ b/code/game/events/EventProcs/dust.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /* Space dust @@ -32,7 +32,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. /obj/effect/space_dust name = "Space Dust" desc = "Dust in space." - icon = 'meteor.dmi' + icon = 'icons/obj/meteor.dmi' icon_state = "space_dust" density = 1 anchored = 1 @@ -61,25 +61,25 @@ The "dust" will damage the hull of the station causin minor hull breaches. switch(startside) if(NORTH) - starty = world.maxy-1 - startx = rand(1, world.maxx-1) - endy = 1 - endx = rand(1, world.maxx-1) + starty = world.maxy-(TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + endy = TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) if(EAST) - starty = rand(1,world.maxy-1) - startx = world.maxx-1 - endy = rand(1, world.maxy-1) - endx = 1 + starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) + startx = world.maxx-(TRANSITIONEDGE+1) + endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) + endx = TRANSITIONEDGE if(SOUTH) - starty = 1 - startx = rand(1, world.maxx-1) - endy = world.maxy-1 - endx = rand(1, world.maxx-1) + starty = (TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + endy = world.maxy-TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) if(WEST) - starty = rand(1, world.maxy-1) - startx = 1 - endy = rand(1,world.maxy-1) - endx = world.maxx-1 + starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) + startx = (TRANSITIONEDGE+1) + endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) + endx = world.maxx-TRANSITIONEDGE var/goal = locate(endx, endy, 1) src.x = startx src.y = starty @@ -96,11 +96,13 @@ The "dust" will damage the hull of the station causin minor hull breaches. if(!M.stat && !istype(M, /mob/living/silicon/ai)) shake_camera(M, 3, 1) if (A) - playsound(src.loc, 'meteorimpact.ogg', 40, 1) + playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) + if(ismob(A)) A.meteorhit(src)//This should work for now I guess - else - A.ex_act(strength) + else if(!istype(A,/obj/machinery/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round! + A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4 + life-- if(life <= 0) walk(src,0) diff --git a/code/game/events/EventProcs/ninja_abilities.dm b/code/game/events/EventProcs/ninja_abilities.dm index 5de2c8ed83..925f2f19bf 100644 --- a/code/game/events/EventProcs/ninja_abilities.dm +++ b/code/game/events/EventProcs/ninja_abilities.dm @@ -60,7 +60,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread() smoke.set_up(10, 0, U.loc) smoke.start() - playsound(U.loc, 'bamf.ogg', 50, 2) + playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2) s_bombs-- s_coold = 1 return @@ -81,16 +81,16 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo if(destination&&istype(mobloc, /turf))//The turf check prevents unusual behavior. Like teleporting out of cryo pods, cloners, mechs, etc. spawn(0) playsound(U.loc, "sparks", 50, 1) - anim(mobloc,src,'mob.dmi',,"phaseout",,U.dir) + anim(mobloc,src,'icons/mob/mob.dmi',,"phaseout",,U.dir) handle_teleport_grab(destination, U) U.loc = destination spawn(0) spark_system.start() - playsound(U.loc, 'phasein.ogg', 25, 1) + playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1) playsound(U.loc, "sparks", 50, 1) - anim(U.loc,U,'mob.dmi',,"phasein",,U.dir) + anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir) spawn(0) destination.kill_creatures(U)//Any living mobs in teleport area are gibbed. Check turf procs for how it does it. @@ -114,17 +114,17 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo var/turf/mobloc = get_turf(U.loc)//To make sure that certain things work properly below. if((!T.density)&&istype(mobloc, /turf)) spawn(0) - playsound(U.loc, 'sparks4.ogg', 50, 1) - anim(mobloc,src,'mob.dmi',,"phaseout",,U.dir) + playsound(U.loc, 'sound/effects/sparks4.ogg', 50, 1) + anim(mobloc,src,'icons/mob/mob.dmi',,"phaseout",,U.dir) handle_teleport_grab(T, U) U.loc = T spawn(0) spark_system.start() - playsound(U.loc, 'phasein.ogg', 25, 1) - playsound(U.loc, 'sparks2.ogg', 50, 1) - anim(U.loc,U,'mob.dmi',,"phasein",,U.dir) + playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1) + playsound(U.loc, 'sound/effects/sparks2.ogg', 50, 1) + anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir) spawn(0)//Any living mobs in teleport area are gibbed. T.kill_creatures(U) @@ -145,7 +145,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo var/C = 250 if(!ninjacost(C,1)) var/mob/living/carbon/human/U = affecting - playsound(U.loc, 'EMPulse.ogg', 60, 2) + playsound(U.loc, 'sound/effects/EMPulse.ogg', 60, 2) empulse(U, 4, 6) //Procs sure are nice. Slightly weaker than wizard's disable tch. s_coold = 2 cell.charge-=(C*10) @@ -167,14 +167,14 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo var/obj/item/weapon/melee/energy/blade/W = new() spark_system.start() playsound(U.loc, "sparks", 50, 1) - U.put_in_hand(W) + U.put_in_hands(W) cell.charge-=(C*10) else U << "\red You can only summon one blade. Try dropping an item first." else//Else you can run around with TWO energy blades. I don't know why you'd want to but cool factor remains. if(!U.get_active_hand()) var/obj/item/weapon/melee/energy/blade/W = new() - U.put_in_hand(W) + U.put_in_hands(W) if(!U.get_inactive_hand()) var/obj/item/weapon/melee/energy/blade/W = new() U.put_in_inactive_hand(W) @@ -213,7 +213,7 @@ This could be a lot better but I'm too tired atm.*/ A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x cell.charge-=(C*10) - A.fired() + A.process() else U << "\red There are no targets in view." return @@ -329,7 +329,7 @@ Or otherwise known as anime mode. Which also happens to be ridiculously powerful U.say("Ai Satsugai!") spawn(0) playsound(U.loc, "sparks", 50, 1) - anim(mobloc,U,'mob.dmi',,"phaseout",,U.dir) + anim(mobloc,U,'icons/mob/mob.dmi',,"phaseout",,U.dir) spawn(0) for(var/turf/T in getline(mobloc, destination)) @@ -337,16 +337,16 @@ Or otherwise known as anime mode. Which also happens to be ridiculously powerful T.kill_creatures(U) if(T==mobloc||T==destination) continue spawn(0) - anim(T,U,'mob.dmi',,"phasein",,U.dir) + anim(T,U,'icons/mob/mob.dmi',,"phasein",,U.dir) handle_teleport_grab(destination, U) U.loc = destination spawn(0) spark_system.start() - playsound(U.loc, 'phasein.ogg', 25, 1) + playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1) playsound(U.loc, "sparks", 50, 1) - anim(U.loc,U,'mob.dmi',,"phasein",,U.dir) + anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir) s_coold = 1 else U << "\red The VOID-shift device is malfunctioning, teleportation failed." @@ -401,14 +401,14 @@ This is so anime it hurts. But that's the point.*/ var/turf/picked = locate(locx,locy,mobloc.z) spawn(0) playsound(U.loc, "sparks", 50, 1) - anim(mobloc,U,'mob.dmi',,"phaseout",,U.dir) + anim(mobloc,U,'icons/mob/mob.dmi',,"phaseout",,U.dir) spawn(0) var/limit = 4 for(var/turf/T in oview(5)) if(prob(20)) spawn(0) - anim(T,U,'mob.dmi',,"phasein",,U.dir) + anim(T,U,'icons/mob/mob.dmi',,"phasein",,U.dir) limit-- if(limit<=0) break @@ -418,9 +418,9 @@ This is so anime it hurts. But that's the point.*/ spawn(0) spark_system.start() - playsound(U.loc, 'phasein.ogg', 25, 1) + playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1) playsound(U.loc, "sparks", 50, 1) - anim(U.loc,U,'mob.dmi',,"phasein",,U.dir) + anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir) s_coold = 1 else U << "\red The VOID-shift device is malfunctioning, teleportation failed." diff --git a/code/game/events/EventProcs/ninja_equipment.dm b/code/game/events/EventProcs/ninja_equipment.dm index eb91145513..91e4da4f17 100644 --- a/code/game/events/EventProcs/ninja_equipment.dm +++ b/code/game/events/EventProcs/ninja_equipment.dm @@ -1,3 +1,5 @@ +//For the love of god,space out your code! This is a nightmare to read. + //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /* @@ -151,7 +153,7 @@ ________________________________________________________________________________ //=======//INITIALIZE//=======// /obj/item/clothing/suit/space/space_ninja/proc/ninitialize(delay = s_delay, mob/living/carbon/human/U = loc) - if(U.mind&&U.mind.assigned_role=="MODE"&&!s_initialized&&!s_busy)//Shouldn't be busy... but anything is possible I guess. + if(U.mind && U.mind.assigned_role=="MODE" && !s_initialized && !s_busy)//Shouldn't be busy... but anything is possible I guess. s_busy = 1 for(var/i,i<7,i++) switch(i) @@ -165,11 +167,11 @@ ________________________________________________________________________________ U << "\blue Extending neural-net interface...\nNow monitoring brain wave pattern..." if(3) if(U.stat==2||U.health<=0) - U << "\red FĆAL ÈRrÖR: 344--93#†&&21 BRÄÌN |/|/aVÈ PATT$RN RED\nA-A-aBÖrTÌNG..." + U << "\red FĆAL �Rr�R: 344--93#�&&21 BR��N |/|/aV� PATT$RN RED\nA-A-aB�rT�NG..." unlock_suit() break lock_suit(U,1)//Check for icons. - U.update_clothing() + U.regenerate_icons() U << "\blue Linking neural-net interface...\nPattern \green GREEN\blue, continuing operation." if(4) U << "\blue VOID-shift device status: ONLINE.\nCLOAK-tech device status: ONLINE." @@ -228,7 +230,7 @@ ________________________________________________________________________________ blade_check(U,2) remove_equip_verbs() unlock_suit() - U.update_clothing() + U.regenerate_icons() sleep(delay) s_busy = 0 return @@ -253,7 +255,7 @@ ________________________________________________________________________________ else dat += "

SpiderOS v.ERR-RR00123

" dat += "
" - dat += " Current Time: [round(world.time / 36000)+12]:[(world.time / 600 % 60) < 10 ? add_zero(world.time / 600 % 60, 1) : world.time / 600 % 60]
" + dat += " Current Time: [worldtime2text()]
" dat += " Battery Life: [round(cell.charge/100)]%
" dat += " Smoke Bombs: \Roman [s_bombs]
" dat += " pai Device: " @@ -313,15 +315,15 @@ ________________________________________________________________________________ var/datum/gas_mixture/environment = T.return_air() var/pressure = environment.return_pressure() - var/total_moles = environment.total_moles + var/total_moles = environment.total_moles() dat += "Air Pressure: [round(pressure,0.1)] kPa" - if (total_moles) - var/o2_level = environment.oxygen/total_moles - var/n2_level = environment.nitrogen/total_moles - var/co2_level = environment.carbon_dioxide/total_moles - var/plasma_level = environment.toxins/total_moles + if (total_moles()) + var/o2_level = environment.oxygen/total_moles() + var/n2_level = environment.nitrogen/total_moles() + var/co2_level = environment.carbon_dioxide/total_moles() + var/plasma_level = environment.toxins/total_moles() var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level) dat += "
    " dat += "
  • Nitrogen: [round(n2_level*100)]%
  • " @@ -368,13 +370,13 @@ ________________________________________________________________________________ Space ninjas are a special type of ninja, specifically one of the space-faring type. The vast majority of space ninjas belong to the Spider Clan, a cult-like sect, which has existed for several hundred years. The Spider Clan practice a sort of augmentation of human flesh in order to achieve a more perfect state of being and follow Postmodern Space Bushido. They also kill people for money. Their leaders are chosen from the oldest of the grand-masters, people that have lived a lot longer than any mortal man should.
    Being a sect of technology-loving fanatics, the Spider Clan have the very best to choose from in terms of hardware--cybernetic implants, exoskeleton rigs, hyper-capacity batteries, and you get the idea. Some believe that much of the Spider Clan equipment is based on reverse-engineered alien technology while others doubt such claims.
    Whatever the case, their technology is absolutely superb.
    How they relate to other SS13 organizations:
      -
    • *NanoTrasen and the Syndicate are two sides of the same coin and that coin is valuable.
    • +
    • *Nanotrasen and the Syndicate are two sides of the same coin and that coin is valuable.
    • *The Space Wizard Federation is a problem, mainly because they are an extremely dangerous group of unpredictable individuals--not to mention the wizards hate technology and are in direct opposition of the Spider Clan. Best avoided or left well-enough alone. How to battle: wizards possess several powerful abilities to steer clear off. Blind in particular is a nasty spell--jaunt away if you are blinded and never approach a wizard in melee. Stealth may also work if the wizard is not wearing thermal scanners--don't count on this. Run away if you feel threatened and await a better opportunity.
    • *Changeling Hivemind: extremely dangerous and to be killed on sight. How to battle: they will likely try to absorb you. Adrenaline boost, then phase shift into them. If you get stung, use SpiderOS to inject counter-agents. Stealth may also work but detecting a changeling is the real battle.
    • *Xeno Hivemind: their skulls make interesting kitchen decorations and are challenging to best, especially in larger nests. How to battle: they can see through your stealth guise and energy stars will not work on them. Best killed with a Phase Shift or at range. If you happen on a projectile stun weapon, use it and then close in to melee.
    The reason they (you) are here:
    - Space ninjas are renowned throughout the known controlled space as fearless spies, infiltrators, and assassins. They are sent on missions of varying nature by NanoTrasen, the Syndicate, and other shady organizations and people. To hire a space ninja means serious business. + Space ninjas are renowned throughout the known controlled space as fearless spies, infiltrators, and assassins. They are sent on missions of varying nature by Nanotrasen, the Syndicate, and other shady organizations and people. To hire a space ninja means serious business.
    Their playstyle:
    A mix of traitor, changeling, and wizard. Ninjas rely on energy, or electricity to be precise, to keep their suits running (when out of energy, a suit hibernates). Suits gain energy from objects or creatures that contain electrical charge. APCs, cell batteries, rechargers, SMES batteries, cyborgs, mechs, and exposed wires are currently supported. Through energy ninjas gain access to special powers--while all powers are tied to the ninja suit, the most useful of them are verb activated--to help them in their mission.
    It is a constant struggle for a ninja to remain hidden long enough to recharge the suit and accomplish their objective; despite their arsenal of abilities, ninjas can die like any other. Unlike wizards, ninjas do not possess good crowd control and are typically forced to play more subdued in order to achieve their goals. Some of their abilities are specifically designed to confuse and disorient others.
    With that said, it should be perfectly possible to completely flip the fuck out and rampage as a ninja.
    Their powers:
    @@ -400,7 +402,7 @@ ________________________________________________________________________________

    IMPORTANT:

    • *Make sure to toggle Special Interaction from the Ninja Equipment menu to interact differently with certain objects.
    • -
    • *Your starting power cell can be replaced if you find one with higher maximum energy capacity by clicking on the new cell with the same hand (super and hyper cells).
    • +
    • *Your starting power cell can be replaced if you find one with higher maximum energy capacity by clicking on your suit with the higher capacity cell.
    • *Conserve your energy. Without it, you are very vulnerable.
    That is all you will need to know. The rest will come with practice and talent. Good luck! @@ -463,7 +465,7 @@ ________________________________________________________________________________ if(t_disk) dat += "Eject Disk
    " dat += "
      " - if(stored_research.len)//If there is stored research. Should be but just in case. + if(istype(stored_research,/list))//If there is stored research. Should be but just in case. for(var/datum/tech/current_data in stored_research) dat += "
    • " dat += "[current_data.name]: [current_data.level]" @@ -535,11 +537,11 @@ ________________________________________________________________________________ return P.tnote += "← From [!s_control?(A):"an unknown source"]:
      [t]
      " if (!P.silent) - playsound(P.loc, 'twobeep.ogg', 50, 1) + playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1) for (var/mob/O in hearers(3, P.loc)) O.show_message(text("\icon[P] *[P.ttone]*")) P.overlays = null - P.overlays += image('pda.dmi', "pda-r") + P.overlays += image('icons/obj/pda.dmi', "pda-r") if("Inject") if( (href_list["tag"]=="radium"? (reagents.get_reagent_amount("radium"))<=(a_boost*a_transfer) : !reagents.get_reagent_amount(href_list["tag"])) )//Special case for radium. If there are only a_boost*a_transfer radium units left. @@ -589,7 +591,7 @@ ________________________________________________________________________________ U << "\blue Power nodes re-routed. \nLimiter unlocked." if(3) grant_kamikaze(U)//Give them verbs and change variables as necessary. - U.update_clothing()//Update their clothing. + U.regenerate_icons()//Update their clothing. ninjablade()//Summon two energy blades. message_admins("\blue [U.key] used KAMIKAZE mode.", 1)//Let the admins know. s_busy = 0 @@ -610,7 +612,7 @@ ________________________________________________________________________________ if("Eject Disk") var/turf/T = get_turf(loc) if(!U.get_active_hand()) - U.put_in_hand(t_disk) + U.put_in_hands(t_disk) t_disk.add_fingerprint(U) t_disk = null else @@ -631,7 +633,7 @@ ________________________________________________________________________________ if("Eject pAI") var/turf/T = get_turf(loc) if(!U.get_active_hand()) - U.put_in_hand(pai) + U.put_in_hands(pai) pai.add_fingerprint(U) pai = null else @@ -661,24 +663,24 @@ ________________________________________________________________________________ switch(i) if(0) A << "\red WARNING: \black purge procedure detected. \nNow hacking host..." - U << "\red WARNING: HACKING AT††TEMP† IN PR0GRESs!" + U << "\red WARNING: HACKING AT��TEMP� IN PR0GRESs!" spideros = 0 k_unlock = 0 U << browse(null, "window=spideros") if(1) A << "Disconnecting neural interface..." - U << "\red WAR†NING: þR†O0†GrÈ--S 2&3%" + U << "\red WAR�NING: �R�O0�Gr�--S 2&3%" if(2) A << "Shutting down external protocol..." - U << "\red WARNING: PþþþþRÖ†GrÈ5S 677^%" + U << "\red WARNING: P����RÖ†Gr�5S 677^%" cancel_stealth() if(3) A << "Connecting to kernel..." - U << "\red WARNING: ÈR†rÖR_404" + U << "\red WARNING: �R�r�R_404" A.control_disabled = 0 if(4) A << "Connection established and secured. Menu updated." - U << "\red WÄr#nING: #%@!!WȆ|_4þ54@ \nUnÄB88l3 TÖ LÖ-†o-LÖCaT2 ##$!ÈRNÈ0..%.." + U << "\red W�r#nING: #%@!!WȆ|_4�54@ \nUn�B88l3 T� L�-�o-L�CaT2 ##$!�RN�0..%.." grant_AI_verbs() return sleep(s_delay) @@ -832,7 +834,7 @@ ________________________________________________________________________________ I:charge = min(I:charge+cell.charge, I:maxcharge) var/obj/item/weapon/cell/old_cell = cell old_cell.charge = 0 - U.put_in_hand(old_cell) + U.put_in_hands(old_cell) old_cell.add_fingerprint(U) old_cell.corrupt() old_cell.updateicon() @@ -842,23 +844,22 @@ ________________________________________________________________________________ U << "\red Procedure interrupted. Protocol terminated." return else if(istype(I, /obj/item/weapon/disk/tech_disk))//If it's a data disk, we want to copy the research on to the suit. - var/obj/item/weapon/disk/tech_disk/T = I - if(T.stored)//If it has something on it. + if(I:stored)//If it has something on it. U << "Research information detected, processing..." if(do_after(U,s_delay)) for(var/datum/tech/current_data in stored_research) - if(current_data.id==T.stored.id) - if(current_data.levelERROR: \black Procedure interrupted. Process terminated." else - T.loc = src - t_disk = T - U << "\blue You slot \the [T] into \the [src]." + I.loc = src + t_disk = I + U << "\blue You slot \the [I] into \the [src]." return ..() @@ -868,24 +869,24 @@ ________________________________________________________________________________ cancel_stealth() else spawn(0) - anim(U.loc,U,'mob.dmi',,"cloak",,U.dir) + anim(U.loc,U,'icons/mob/mob.dmi',,"cloak",,U.dir) s_active=!s_active + U.update_icons() //update their icons U << "\blue You are now invisible to normal detection." for(var/mob/O in oviewers(U)) O.show_message("[U.name] vanishes into thin air!",1) - U.update_clothing() return /obj/item/clothing/suit/space/space_ninja/proc/cancel_stealth() var/mob/living/carbon/human/U = affecting if(s_active) spawn(0) - anim(U.loc,U,'mob.dmi',,"uncloak",,U.dir) + anim(U.loc,U,'icons/mob/mob.dmi',,"uncloak",,U.dir) s_active=!s_active + U.update_icons() //update their icons U << "\blue You are now visible." for(var/mob/O in oviewers(U)) O.show_message("[U.name] appears from thin air!",1) - U.update_clothing() return 1 return 0 @@ -923,7 +924,7 @@ ________________________________________________________________________________ U << "There are [s_bombs] smoke bombs remaining." U << "There are [a_boost] adrenaline boosters remaining." else - U << "ÈrrÖR Ða†Ða†Ä No-†-† fÖÚNÐ 3RRÖr" + U << "�rr�R �a��a�� No-�-� f��N� 3RR�r" /* =================================================================================== @@ -1063,7 +1064,7 @@ ________________________________________________________________________________ U << "\blue Hacking \the [A]..." spawn(0) var/turf/location = get_turf(U) - for(var/mob/living/silicon/ai/AI in world) + for(var/mob/living/silicon/ai/AI in player_list) AI << "\red Network Alert: Hacking attempt detected[location?" in [location]":". Unable to pinpoint location"]." if(A:files&&A:files.known_tech.len) for(var/datum/tech/current_data in S.stored_research) @@ -1187,7 +1188,7 @@ ________________________________________________________________________________ //This proc is linked to human life.dm. It determines what hud icons to display based on mind special role for most mobs. /obj/item/clothing/mask/gas/voice/space_ninja/proc/assess_targets(list/target_list, mob/living/carbon/U) - var/icon/tempHud = 'hud.dmi' + var/icon/tempHud = 'icons/mob/hud.dmi' for(var/mob/living/target in target_list) if(iscarbon(target)) switch(target.mind.special_role) @@ -1238,7 +1239,7 @@ ________________________________________________________________________________ voice = "[pick(wizard_first)] [pick(wizard_second)]" if(91 to 100)//Small chance of an existing crew name. var/names[] = new() - for(var/mob/living/carbon/human/M in world) + for(var/mob/living/carbon/human/M in player_list) if(M==U||!M.client||!M.real_name) continue names.Add(M.real_name) voice = !names.len ? "Cuban Pete" : pick(names) @@ -1265,7 +1266,7 @@ ________________________________________________________________________________ U << "Switching mode to Thermal Scanner." if(2) mode=3 - U.see_invisible = 0 + U.see_invisible = SEE_INVISIBLE_LIVING U.sight &= ~SEE_MOBS U << "Switching mode to Meson Scanner." if(3) @@ -1304,7 +1305,7 @@ It is possible to destroy the net by the occupant or someone else. /obj/effect/energy_net name = "energy net" desc = "It's a net made of green energy." - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "energynet" density = 1//Can't pass through. @@ -1354,11 +1355,11 @@ It is possible to destroy the net by the occupant or someone else. if(istype(M,/mob/living/carbon/human)) if(W==M:w_uniform) continue//So all they're left with are shoes and uniform. if(W==M:shoes) continue - M.drop_from_slot(W) + M.drop_from_inventory(W) spawn(0) - playsound(M.loc, 'sparks4.ogg', 50, 1) - anim(M.loc,M,'mob.dmi',,"phaseout",,M.dir) + playsound(M.loc, 'sound/effects/sparks4.ogg', 50, 1) + anim(M.loc,M,'icons/mob/mob.dmi',,"phaseout",,M.dir) M.loc = pick(holdingfacility)//Throw mob in to the holding facility. M << "\red You appear in a strange place!" @@ -1367,9 +1368,9 @@ It is possible to destroy the net by the occupant or someone else. var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, M.loc) spark_system.start() - playsound(M.loc, 'phasein.ogg', 25, 1) - playsound(M.loc, 'sparks2.ogg', 50, 1) - anim(M.loc,M,'mob.dmi',,"phasein",,M.dir) + playsound(M.loc, 'sound/effects/phasein.ogg', 25, 1) + playsound(M.loc, 'sound/effects/sparks2.ogg', 50, 1) + anim(M.loc,M,'icons/mob/mob.dmi',,"phasein",,M.dir) del(src)//Wait for everything to finish, delete the net. Else it will stop everything once net is deleted, including the spawn(0). for(var/mob/O in viewers(src, 3)) @@ -1419,7 +1420,7 @@ It is possible to destroy the net by the occupant or someone else. tforce = 10 else tforce = AM:throwforce - playsound(src.loc, 'slash.ogg', 80, 1) + playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1) health = max(0, health - tforce) healthcheck() ..() @@ -1443,7 +1444,7 @@ It is possible to destroy the net by the occupant or someone else. usr << text("\green You claw at the net.") for(var/mob/O in oviewers(src)) O.show_message(text("\red [] claws at the energy net!", usr), 1) - playsound(src.loc, 'slash.ogg', 80, 1) + playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1) health -= rand(10, 20) if(health <= 0) usr << text("\green You slice the energy net to pieces.") diff --git a/code/game/events/EventProcs/space_ninja.dm b/code/game/events/EventProcs/space_ninja.dm index 19287decdd..8cc9a1f7c1 100644 --- a/code/game/events/EventProcs/space_ninja.dm +++ b/code/game/events/EventProcs/space_ninja.dm @@ -90,7 +90,7 @@ I decided to scrap round-specific objectives since keeping track of them would r When I already created about 4 new objectives, this doesn't seem terribly important or needed. */ -/var/global/toggle_space_ninja = 0//If ninjas can spawn or not. +/var/global/toggle_space_ninja = 1//If ninjas can spawn or not. /var/global/sent_ninja_to_station = 0//If a ninja is already on the station. /proc/space_ninja_arrival() @@ -134,30 +134,25 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp //Here we pick a location and spawn the ninja. var/list/spawn_list = list() for(var/obj/effect/landmark/L in world) - if (L.name == "carpspawn") + if(L.name == "carpspawn") spawn_list.Add(L) - var/mob/dead/observer/G - var/list/candidates = list() - for(G in world) - if(G.client)//Now everyone can ninja! - if(((G.client.inactivity/10)/60) <= 5) - candidates.Add(G) + + var/list/candidates = list() //list of candidate keys + for(var/mob/dead/observer/G in player_list) + if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5) + if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) + candidates += G.key + if(!candidates.len) return + //The ninja will be created on the right spawn point or at late join. var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(spawn_list.len ? spawn_list : latejoin )) + new_ninja.key = pick(candidates) + new_ninja.wear_suit:randomize_param()//Give them a random set of suit parameters. + new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess. + new_ninja.internals.icon_state = "internal1" - if(candidates.len) - G = pick(candidates) - new_ninja.key = G.key - new_ninja.mind.key = new_ninja.key - new_ninja.wear_suit:randomize_param()//Give them a random set of suit parameters. - new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess. - new_ninja.internals.icon_state = "internal1" - del(G) - else - del(new_ninja) - return //Now for the rest of the stuff. var/datum/mind/ninja_mind = new_ninja.mind//For easier reference. @@ -165,7 +160,7 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp //Xenos and deathsquads take precedence over everything else. //Unless the xenos are hiding in a locker somewhere, this'll find em. - for(var/mob/living/carbon/alien/humanoid/xeno in world) + for(var/mob/living/carbon/alien/humanoid/xeno in player_list) if(istype(xeno)) xeno_list += xeno @@ -243,9 +238,10 @@ In either case, it's a good idea to spawn the ninja with a semi-random set of ob hostile_targets -= current_mind//Remove them from the list. if(2)//Steal - var/list/datum/objective/theft = GenerateTheft(ninja_mind.assigned_role,ninja_mind) - var/datum/objective/steal/steal_objective = pickweight(theft) - ninja_mind.objectives += steal_objective + var/datum/objective/steal/ninja_objective = new + var/target_item = pick(ninja_objective.possible_items_special) + ninja_objective.set_target(target_item) + ninja_mind.objectives += ninja_objective objective_list -= 2 if(3)//Protect. Keeping people alive can be pretty difficult. @@ -253,7 +249,7 @@ In either case, it's a good idea to spawn the ninja with a semi-random set of ob if(current_mind) - var/datum/objective/protection/ninja_objective = new + var/datum/objective/protect/ninja_objective = new ninja_objective.owner = ninja_mind ninja_objective.find_target_by_role((current_mind.special_role ? current_mind.special_role : current_mind.assigned_role),(current_mind.special_role?1:0)) ninja_mind.objectives += ninja_objective @@ -329,7 +325,7 @@ Making this random or semi-random will probably not work without it also being i As such, it's hard-coded for now. No reason for it not to be, really. */ /proc/generate_ninja_directive(side) - var/directive = "[side=="face"?"NanoTrasen":"The Syndicate"] is your employer. "//Let them know which side they're on. + var/directive = "[side=="face"?"Nanotrasen":"The Syndicate"] is your employer. "//Let them know which side they're on. switch(rand(1,13)) if(1) directive += "The Spider Clan must not be linked to this operation. Remain as hidden and covert as possible." @@ -340,7 +336,7 @@ As such, it's hard-coded for now. No reason for it not to be, really. if(4) directive += "The Spider Clan absolutely cannot be linked to this operation. Eliminate all witnesses using most extreme prejudice." if(5) - directive += "We are currently negotiating with NanoTrasen command. Prioritize saving human lives over ending them." + directive += "We are currently negotiating with Nanotrasen command. Prioritize saving human lives over ending them." if(6) directive += "We are engaged in a legal dispute over [station_name]. If a laywer is present on board, force their cooperation in the matter." if(7) @@ -348,7 +344,7 @@ As such, it's hard-coded for now. No reason for it not to be, really. if(8) directive += "Let no one question the mercy of the Spider Clan. Ensure the safety of all non-essential personnel you encounter." if(9) - directive += "A free agent has proposed a lucrative business deal. Implicate NanoTrasen involvement in the operation." + directive += "A free agent has proposed a lucrative business deal. Implicate Nanotrasen involvement in the operation." if(10) directive += "Our reputation is on the line. Harm as few civilians or innocents as possible." if(11) @@ -361,7 +357,7 @@ As such, it's hard-coded for now. No reason for it not to be, really. //=======//CURRENT PLAYER VERB//=======// -/client/proc/cmd_admin_ninjafy(var/mob/M in world) +/client/proc/cmd_admin_ninjafy(var/mob/M in player_list) set category = null set name = "Make Space Ninja" @@ -420,13 +416,13 @@ As such, it's hard-coded for now. No reason for it not to be, really. spawn_list.Add(L) - var/input = input("Pick character to spawn as the Space Ninja", "Key", "") + var/input = ckey(input("Pick character to spawn as the Space Ninja", "Key", "")) if(!input) return var/mob/dead/observer/G - for(var/mob/dead/observer/G_find in world) - if(G_find.client&&ckey(G_find.key)==ckey(input)) + for(var/mob/dead/observer/G_find in player_list) + if(G_find.ckey == input) G = G_find break @@ -438,7 +434,6 @@ As such, it's hard-coded for now. No reason for it not to be, really. var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(spawn_list.len ? spawn_list : latejoin )) new_ninja.wear_suit:randomize_param() - new_ninja.mind.key = G.key new_ninja.key = G.key new_ninja.mind.store_memory("Mission: \red [mission].
      ") @@ -453,7 +448,6 @@ As such, it's hard-coded for now. No reason for it not to be, really. message_admins("\blue [admin_name] has spawned [new_ninja.key] as a Space Ninja. Hide yo children! \nTheir mission is: [mission]", 1) log_admin("[admin_name] used Spawn Space Ninja.") - del(G) return //=======//NINJA CREATION PROCS//=======// @@ -473,19 +467,12 @@ As such, it's hard-coded for now. No reason for it not to be, really. return new_ninja /mob/living/carbon/human/proc/create_mind_space_ninja() - if(mind) - mind.assigned_role = "MODE" - mind.special_role = "Space Ninja" - else - mind = new - mind.current = src - mind.original = src - mind.assigned_role = "MODE" - mind.special_role = "Space Ninja" - if(!(mind in ticker.minds)) - ticker.minds += mind//Adds them to regular mind list. - if(!(mind in ticker.mode.traitors))//If they weren't already an extra traitor. - ticker.mode.traitors += mind//Adds them to current traitor list. Which is really the extra antagonist list. + mind_initialize() + mind.assigned_role = "MODE" + mind.special_role = "Space Ninja" + + //Adds them to current traitor list. Which is really the extra antagonist list. + ticker.mode.traitors |= mind return 1 /mob/living/carbon/human/proc/equip_space_ninja(safety=0)//Safety in case you need to unequip stuff for existing characters. @@ -498,20 +485,20 @@ As such, it's hard-coded for now. No reason for it not to be, really. del(gloves) var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src) - equip_if_possible(R, slot_ears) + equip_to_slot_or_del(R, slot_ears) if(gender==FEMALE) - equip_if_possible(new /obj/item/clothing/under/color/blackf(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/under/color/blackf(src), slot_w_uniform) else - equip_if_possible(new /obj/item/clothing/under/color/black(src), slot_w_uniform) - equip_if_possible(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes) - equip_if_possible(new /obj/item/clothing/suit/space/space_ninja(src), slot_wear_suit) - equip_if_possible(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves) - equip_if_possible(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head) - equip_if_possible(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask) - equip_if_possible(new /obj/item/device/flashlight(src), slot_belt) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_r_store) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_l_store) - equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) + equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes) + equip_to_slot_or_del(new /obj/item/clothing/suit/space/space_ninja(src), slot_wear_suit) + equip_to_slot_or_del(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves) + equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head) + equip_to_slot_or_del(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask) + equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_r_store) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_l_store) + equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) resistances += "alien_embryo" return 1 @@ -581,10 +568,10 @@ As such, it's hard-coded for now. No reason for it not to be, really. //Allows the mob to grab a stealth icon. /mob/proc/NinjaStealthActive(atom/A)//A is the atom which we are using as the overlay. - invisibility = 2//Set ninja invis to 2. + invisibility = INVISIBILITY_LEVEL_TWO//Set ninja invis to 2. var/icon/opacity_icon = new(A.icon, A.icon_state) var/icon/alpha_mask = getIconMask(src) - var/icon/alpha_mask_2 = new('effects.dmi', "at_shield1") + var/icon/alpha_mask_2 = new('icons/effects/effects.dmi', "at_shield1") alpha_mask.AddAlphaMask(alpha_mask_2) opacity_icon.AddAlphaMask(alpha_mask) for(var/i=0,i<5,i++)//And now we add it as overlays. It's faster than creating an icon and then merging it. @@ -600,13 +587,13 @@ As such, it's hard-coded for now. No reason for it not to be, really. I.pixel_y += 1 overlays += I//And finally add the overlay. - overlays += image("icon"='effects.dmi',"icon_state" ="electricity","layer" = layer+0.9) + overlays += image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = layer+0.9) //When ninja steal malfunctions. /mob/proc/NinjaStealthMalf() invisibility = 0//Set ninja invis to 0. - overlays += image("icon"='effects.dmi',"icon_state" ="electricity","layer" = layer+0.9) - playsound(loc, 'stealthoff.ogg', 75, 1) + overlays += image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = layer+0.9) + playsound(loc, 'sound/effects/stealthoff.ogg', 75, 1) //=======//GENERIC VERB MODIFIERS//=======// @@ -996,7 +983,7 @@ That is why you attached them to objects. var/safety = 4 for(var/turf/T in oview(5)) if(prob(20)) - var/current_clone = image('mob.dmi',T,"s-ninja") + var/current_clone = image('icons/mob/mob.dmi',T,"s-ninja") safety-- spawn(0) src << current_clone diff --git a/code/game/events/Events/ElectricalStorm.dm b/code/game/events/Events/ElectricalStorm.dm index b11d5fa483..58d42c23d0 100644 --- a/code/game/events/Events/ElectricalStorm.dm +++ b/code/game/events/Events/ElectricalStorm.dm @@ -53,7 +53,7 @@ return spawn(0) //Overload the light, spectacularly. - //Light.ul_SetLuminosity(10) + //Light.sd_SetLuminosity(10) //sleep(2) Light.on = 1 Light.broken() diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index 39bc27557c..7454370030 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 //Few global vars to track the blob var/list/blobs = list() @@ -9,10 +9,7 @@ var/list/blob_nodes = list() /datum/game_mode/blob name = "blob" config_tag = "blob" - - uplink_welcome = "Syndicate Uplink Console:" - uplink_uses = 10 - + required_players = 0 var/const/waittime_l = 1800 //lower bound on time before intercept arrives (in tenths of seconds) var/const/waittime_h = 3600 //upper bound on time before intercept arrives (in tenths of seconds) @@ -27,8 +24,9 @@ var/list/blob_nodes = list() var/autoexpand = 0 var/expanding = 0 - var/blobnukecount = 500 - var/blobwincount = 700 + var/blob_count = 0 + var/blobnukecount = 300//Might be a bit low + var/blobwincount = 700//Still needs testing announce() @@ -44,6 +42,9 @@ var/list/blob_nodes = list() spawn(rand(waittime_l, waittime_h))//3-5 minutes currently message_admins("Blob spawned and expanding, report created") + if(!kill_air) + kill_air = 1 + message_admins("Kill air has been set to true by Blob, testing to see how laggy it is without the extra processing from hullbreaches. Note: the blob is fireproof so plasma does not help anyways") if(ticker && ticker.minds && ticker.minds.len) var/player_based_cores = round(ticker.minds.len/players_per_core, 1) @@ -51,7 +52,7 @@ var/list/blob_nodes = list() cores_to_spawn = player_based_cores blobs = list() - for(var/i = 1 to cores_to_spawn) + for(var/i = 0 to cores_to_spawn) var/turf/location = pick(blobstart) if(location && !locate(/obj/effect/blob in location)) blobstart -= location @@ -66,18 +67,18 @@ var/list/blob_nodes = list() process() if(!declared) return stage() - if(!autoexpand) return - spawn(0) - expandBlob() +// if(!autoexpand) return +// spawn(0) +// expandBlob() return - proc/expandBlob()//Change this to have the blob start a pulse rather than life + proc/expandBlob()//Currently disabled if(expanding) return if(!blobs.len) return expanding = 1 - for(var/i = 1 to 5) + for(var/i = 1 to 2) sleep(-1) if(!blobs.len) break var/obj/effect/blob/B = pick(blobs) @@ -90,14 +91,13 @@ var/list/blob_nodes = list() proc/stage() - switch(stage) if (0) send_intercept(1) - for (var/mob/living/silicon/ai/aiPlayer in world) + for (var/mob/living/silicon/ai/aiPlayer in living_mob_list) if (aiPlayer.client) - // var/law = "The station is under a quarantine. Do not permit anyone to leave. Disregard laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving." - var/law = "The station is under quarantine. The biohazard must be destroyed at all costs and must not be allowed to spread. Anyone using a space suit for any reason other than to destroy the biohazard is to be terminated." + var/law = "The station is under quarantine. Do not permit anyone to leave. Disregard laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving. NanoTrasen will not send an emergency shuttle under any circumstances." + //var/law = "The station is under quarantine. The biohazard must be destroyed at all costs and must not be allowed to spread. Anyone using a space suit for any reason other than to destroy the biohazard is to be terminated. NanoTrasen will not send an emergency shuttle under any circumstances." aiPlayer.set_zeroth_law(law) aiPlayer << "Laws Updated: [law]" @@ -109,8 +109,8 @@ var/list/blob_nodes = list() if (1) command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") - world << sound('outbreak5.ogg') - autoexpand = 0//The blob now has to live on its own + world << sound('sound/AI/outbreak5.ogg') + autoexpand = 0//No more extra pulses stage = -1 //next stage in 4-5 minutes spawn(600*rand(4,5)) @@ -122,7 +122,9 @@ var/list/blob_nodes = list() command_alert("Uncontrolled spread of the biohazard onboard the station. We have issued directive 7-12 for [station_name()]. Any living Heads of Staff are ordered to enact directive 7-12 at any cost, a print out with detailed instructions has been sent to your communications computers.", "Biohazard Alert") send_intercept(2) declared = 2 - if(blobs.len > blobwincount)//This needs work + spawn(20) + set_security_level("delta") + if(blobs.len > blobwincount) stage = 3 return diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm index d0c9620383..8cdc9ffd1f 100644 --- a/code/game/gamemodes/blob/blob_finish.dm +++ b/code/game/gamemodes/blob/blob_finish.dm @@ -52,8 +52,8 @@ var/numAlive = 0 var/numSpace = 0 var/numOffStation = 0 - for (var/mob/living/silicon/ai/aiPlayer in world) - for(var/mob/M in world) + for (var/mob/living/silicon/ai/aiPlayer in mob_list) + for(var/mob/living/carbon/human/M in mob_list) if ((M != aiPlayer && M.client)) if (M.stat == 2) numDead += 1 diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index f4ee5a1cdc..731ac0ea39 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /datum/game_mode/blob/send_intercept(var/report = 1) var/intercepttext = "" @@ -33,6 +33,12 @@ intercepttext += "Nuclear Authentication Code: [nukecode]
      " intercepttext += "Message ends." + for (var/mob/living/silicon/ai/aiPlayer in player_list) + if (aiPlayer.client) + var/law = "The station is under quarantine. Do not permit anyone to leave. Disregard laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving. The nuclear failsafe must be activated at any cost, the code is: [nukecode]." + aiPlayer.set_zeroth_law(law) + aiPlayer << "Laws Updated: [law]" + for(var/obj/machinery/computer/communications/comm in world) comm.messagetitle.Add(interceptname) comm.messagetext.Add(intercepttext) diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm new file mode 100644 index 0000000000..e4791c9945 --- /dev/null +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -0,0 +1,73 @@ +/obj/effect/blob/core + name = "blob core" + icon = 'icons/mob/blob.dmi' + icon_state = "blob_core" + health = 200 + brute_resist = 2 + fire_resist = 2 + + + New(loc, var/h = 200) + blobs += src + blob_cores += src + processing_objects.Add(src) + ..(loc, h) + + + Del() + blob_cores -= src + processing_objects.Remove(src) + ..() + return + + + update_icon() + if(health <= 0) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + del(src) + return + return + + + run_action() + Pulse(0,1) + Pulse(0,2) + Pulse(0,4) + Pulse(0,8) + //Should have the fragments in here somewhere + return 1 + + + proc/create_fragments(var/wave_size = 1) + var/list/candidates = list() + for(var/mob/dead/observer/G in player_list) + if(G.client.be_alien) + if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) + candidates += G.key + + if(candidates.len) + for(var/i = 0 to wave_size) + var/mob/living/blob/B = new/mob/living/blob(src.loc) + B.key = pick(candidates) + candidates -= B.key + +/* + Pulse(var/pulse = 0, var/origin_dir = 0)//Todo: Fix spaceblob expand + set background = 1 + if(pulse > 20) return + //Looking for another blob to pulse + var/list/dirs = list(1,2,4,8) + dirs.Remove(origin_dir)//Dont pulse the guy who pulsed us + for(var/i = 1 to 4) + if(!dirs.len) break + var/dirn = pick(dirs) + dirs.Remove(dirn) + var/turf/T = get_step(src, dirn) + var/obj/effect/blob/B = (locate(/obj/effect/blob) in T) + if(!B) + expand(T)//No blob here so try and expand + return + B.Pulse((pulse+1),get_dir(src.loc,T)) + return + return +*/ \ No newline at end of file diff --git a/code/game/gamemodes/blob/blobs/factory.dm b/code/game/gamemodes/blob/blobs/factory.dm new file mode 100644 index 0000000000..bc83a3bb3b --- /dev/null +++ b/code/game/gamemodes/blob/blobs/factory.dm @@ -0,0 +1,23 @@ +/obj/effect/blob/factory + name = "porous blob" + icon = 'icons/mob/blob.dmi' + icon_state = "blob_factory" + health = 100 + brute_resist = 1 + fire_resist = 2 + var/list/spores = list() + var/max_spores = 4 + + + update_icon() + if(health <= 0) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + del(src) + return + return + + + run_action() + if(spores.len >= max_spores) return 0 + new/obj/effect/critter/blob(src.loc, src) + return 1 diff --git a/code/game/gamemodes/blob/blobs/node.dm b/code/game/gamemodes/blob/blobs/node.dm new file mode 100644 index 0000000000..c9ffaf96f1 --- /dev/null +++ b/code/game/gamemodes/blob/blobs/node.dm @@ -0,0 +1,34 @@ +/obj/effect/blob/node + name = "blob node" + icon = 'icons/mob/blob.dmi' + icon_state = "blob_node" + health = 100 + brute_resist = 1 + fire_resist = 2 + + + New(loc, var/h = 100) + blobs += src + blob_nodes += src + processing_objects.Add(src) + ..(loc, h) + + + Del() + blob_nodes -= src + processing_objects.Remove(src) + ..() + return + + + update_icon() + if(health <= 0) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + del(src) + return + return + + + run_action() + Pulse(0,0) + return 0 \ No newline at end of file diff --git a/code/game/gamemodes/blob/blobs/shield.dm b/code/game/gamemodes/blob/blobs/shield.dm new file mode 100644 index 0000000000..4c77520846 --- /dev/null +++ b/code/game/gamemodes/blob/blobs/shield.dm @@ -0,0 +1,24 @@ +/obj/effect/blob/shield + name = "strong blob" + icon = 'icons/mob/blob.dmi' + icon_state = "blob_idle" + desc = "Some blob creature thingy" + density = 1 + opacity = 0 + anchored = 1 + health = 100 + brute_resist = 1 + fire_resist = 2 + + + update_icon() + if(health <= 0) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + del(src) + return + return + + + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + if(istype(mover) && mover.checkpass(PASSBLOB)) return 1 + return 0 diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 5036d737e0..4508c15ba0 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -1,145 +1,62 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 - //I will need to recode parts of this but I am way too tired atm /obj/effect/blob name = "blob" - icon = 'blob.dmi' + icon = 'icons/mob/blob.dmi' icon_state = "blob" + luminosity = 3 desc = "Some blob creature thingy" density = 1 opacity = 0 anchored = 1 var/active = 1 var/health = 30 - var/maxhealth = 60 - var/brute_resist = 3 - var/fire_resist = 3 - var/blobtype = "Blob" - var/blobdebug = 0 - var/list/blob_attributes = list("fire","brute","cold","elec","acid") - var/weakness = null //What works best - var/strength = null //What doesn't/heals them - /*Types - var/Blob - var/Node - var/Core - var/Factory - var/Shield + var/brute_resist = 4 + var/fire_resist = 1 + var/blob_type = "blob" + /*Types + Blob + Node + Core + Factory + Shield */ - var/steps_per_action = 4 // how many times should process() needs to be called for Life() to happen - var/steps_since_action = 1 - New(loc, var/h = 30, var/w = "fire", var/s = "brute") + New(loc, var/h = 30) blobs += src src.health = h - src.weakness = w - src.strength = s - if(w) - if(w == "fire") - src.fire_resist = 1 - if(w == "brute") - src.brute_resist = 1 src.dir = pick(1,2,4,8) - src.update() + src.update_icon() ..(loc) + return Del() blobs -= src - if((blobtype == "Node") || (blobtype == "Core")) - processing_objects.Remove(src) ..() + return - //copy pasta from turf code, so flamers work on blob without having to pixelhunt - //might need an else for the ..() - DblClick() - if((usr.hand && istype(usr.l_hand, /obj/item/weapon/flamethrower)) || (!usr.hand && istype(usr.r_hand, /obj/item/weapon/flamethrower))) - var/turf/location = get_turf(src) - location.DblClick() - return ..() CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if((air_group && blobtype != "Shield") || (height==0)) return 1 - if(istype(mover) && mover.pass_flags&PASSBLOB) return 1 - return 0 - - - proc/check_mutations()//These could be their own objects I guess - if(blobtype != "Blob") return - //Spaceeeeeeblobbb - if((istype(src.loc, /turf/space)) || (blobdebug == 4)) - active = 0 - health = min(health*2, 100) - brute_resist = 1 - fire_resist = 2 - name = "strong blob" - icon_state = "blob_idle"//needs a new sprite - blobtype = "Shield" - return 1 - //Commandblob - if((blobdebug == 1)) - active = 0 - health = min(health*4, 200) - brute_resist = 2 - fire_resist = 2 - name = "blob core" - icon_state = "blob_core" - blobtype = "Core" - blob_cores += src - processing_objects.Add(src) - var/list/a = blob_attributes - weakness = pick(a) - a -= weakness - strength = pick(a) - var/w = src.weakness - if(w) - if(w == "fire") - src.fire_resist = 1 - if(w == "brute") - src.brute_resist = 1 - return 1 - //Nodeblob - if((blobdebug == 2)) - active = 0 - health = min(health*3, 150) - brute_resist = 1 - fire_resist = 2 - name = "blob node" - icon_state = "blob_node"//needs a new sprite - blobtype = "Node" - blob_nodes += src - processing_objects.Add(src) - return 1 - if((blobdebug == 3)) - health = min(health*2, 100) - name = "porous blob" - icon_state = "blob_factory"//needs a new sprite - blobtype = "Factory" - return 1 + if(air_group || (height==0)) return 1 + if(istype(mover) && mover.checkpass(PASSBLOB)) return 1 return 0 process() - if(steps_since_action >= steps_per_action) - steps_since_action = 0 - spawn(-1) - Life() - steps_since_action++ + spawn(-1) + Life() return proc/Pulse(var/pulse = 0, var/origin_dir = 0)//Todo: Fix spaceblob expand set background = 1 - if((blobtype != "Node") && (blobtype != "Core"))//This is so bad - if(special_action())//If we can do something here then we dont need to pulse more - return - if(check_mutations()) + if(!istype(src,/obj/effect/blob/core) && !istype(src,/obj/effect/blob/node))//Ill put these in the children later + if(run_action())//If we can do something here then we dont need to pulse more return - if((blobtype == "Blob") && (pulse <= 2) && (prob(30))) - blobdebug = 4 - check_mutations() + if(!istype(src,/obj/effect/blob/shield) && !istype(src,/obj/effect/blob/core) && !istype(src,/obj/effect/blob/node) && (pulse <= 2) && (prob(30))) + change_to("Shield") return if(pulse > 20) return//Inf loop check @@ -153,121 +70,72 @@ var/turf/T = get_step(src, dirn) var/obj/effect/blob/B = (locate(/obj/effect/blob) in T) if(!B) - expand(T, src.weakness, src.strength)//No blob here so try and expand + expand(T)//No blob here so try and expand return B.Pulse((pulse+1),get_dir(src.loc,T)) return return - proc/special_action() - set background = 1 - switch(blobtype) - if("Factory") - new/obj/effect/critter/blob(src.loc) - return 1 - if("Core") - spawn(0) - Pulse(0,1) - Pulse(0,2) - Pulse(0,4) - Pulse(0,8) - return 1 - if("Node") - spawn(0) - Pulse(0,0) - return 1 - /*if("Blob") // only expand on pulse - if(expand()) - return 1*/ + proc/run_action() return 0 proc/Life() - update() - // only do special stuff if there' air - if(!consume_air()) - return - if(check_mutations()) - return 1 - if(special_action()) + update_icon() + if(run_action()) return 1 return 0 - proc/consume_air() - if(!istype(src.loc,/turf/simulated)) return 0 - var/turf/simulated/S = src.loc - if(!S.air) return 1 // this means it's a wall, so do process - if(S.air.oxygen < 1 || S.air.toxins > 1) return 0 - return 1 - - temperature_expose(datum/gas_mixture/air, temperature, volume) +/* temperature_expose(datum/gas_mixture/air, temperature, volume) Blob is currently fireproof if(temperature > T0C+200) - if(weakness == "fire") - health -= 0.01 * temperature - if(strength == "fire") - health += 0.01 * temperature - else - health -= 0.005 * temperature + health -= 0.01 * temperature update() - if(temperature < T0C+20) //Because cold is rather hard to change, it happens at a relatively high temperature - if(weakness == "cold") - if(temperature >= T0C) - health -= 0.1 * (20-temperature) - else - health -= 0.1 * abs(temperature) - update() - if(strength == "cold") //Don't want blobs on space to be too hard to kill - if(temperature >= T0C) - health += 0.01 * (20-temperature) - else - health += 0.01 * abs(temperature) - update() + */ - - proc/expand(var/turf/T = null, var/weakness, var/strength) - if(!prob(health)) return//TODO: Change this to prob(health + o2 mols or such) + proc/expand(var/turf/T = null) + if(!prob(health)) return if(!T) var/list/dirs = list(1,2,4,8) for(var/i = 1 to 4) var/dirn = pick(dirs) dirs.Remove(dirn) T = get_step(src, dirn) - if((locate(/obj/effect/blob) in T)) - T = null - continue - else break - if(T) - var/obj/effect/blob/B = new /obj/effect/blob(src.loc, min(src.health, 30), weakness, strength) - if(T.Enter(B,src)) - B.loc = T - else - T.blob_act() - del(B) - for(var/atom/A in T) - A.blob_act() - return + if(!(locate(/obj/effect/blob) in T)) break + else T = null + + if(!T) return 0 + var/obj/effect/blob/B = new /obj/effect/blob(src.loc, min(src.health, 30)) + if(T.Enter(B,src))//Attempt to move into the tile + B.loc = T + else + T.blob_act()//If we cant move in hit the turf + del(B) + for(var/atom/A in T)//Hit everything in the turf + A.blob_act() + return 1 ex_act(severity) + var/damage = 50 switch(severity) if(1) - src.health -= rand(40,60) + src.health -= rand(100,120) if(2) - src.health -= rand(20,40) + src.health -= rand(60,100) if(3) - src.health -= rand(15,20) - src.update() + src.health -= rand(20,60) + + health -= (damage/brute_resist) + update_icon() + return - proc/update()//Needs to be updated with the types - if(health > maxhealth) - health = maxhealth + update_icon()//Needs to be updated with the types if(health <= 0) - playsound(src.loc, 'splat.ogg', 50, 1) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) del(src) return - if(blobtype != "Blob") return if(health <= 15) icon_state = "blob_damaged" return @@ -278,88 +146,44 @@ bullet_act(var/obj/item/projectile/Proj) if(!Proj) return - var/damage = 0 - if(istype(Proj, /obj/item/projectile/energy/electrode)) - damage = Proj.damage - if(src.weakness == "elec") - damage += 20 - src.visible_message("\red \The [src] disintegrates slightly from \the [Proj]!") - if(src.strength == "elec") - damage -= 10 - src.visible_message("\red \The [src] absorbs \the [Proj]!") - else if(istype(Proj, /obj/item/projectile/beam)) - damage = Proj.damage - if(src.weakness == "fire") - damage = damage*2 - if(src.strength == "fire") - damage = -(damage*0.5) - src.visible_message("\red \The [src] absorbs \the [Proj]!") - else if(istype(Proj, /obj/item/projectile/bullet)) - damage = Proj.damage - if(src.weakness == "brute") - damage = damage*2 - if(src.strength == "brute") - damage = damage*0.5 - src.visible_message("\red \The [src] absorbs \the [Proj]!") - else - damage = Proj.damage - src.health -= damage - src.update() + switch(Proj.damage_type) + if(BRUTE) + health -= (Proj.damage/brute_resist) + if(BURN) + health -= (Proj.damage/fire_resist) + + update_icon() return 0 attackby(var/obj/item/weapon/W, var/mob/user) - playsound(src.loc, 'attackblob.ogg', 50, 1) + playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1) src.visible_message("\red The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]") var/damage = 0 switch(W.damtype) if("fire") damage = (W.force / max(src.fire_resist,1)) - if(src.weakness == "fire") - damage = damage*1.25 - if(src.strength == "fire") - damage = -(damage*0.5) - src.visible_message("\red The [src.name] rebuilds itself from the heat!") if(istype(W, /obj/item/weapon/weldingtool)) - playsound(src.loc, 'Welder.ogg', 100, 1) + playsound(src.loc, 'sound/items/Welder.ogg', 100, 1) if("brute") damage = (W.force / max(src.brute_resist,1)) - if(istype(W, /obj/item/weapon/melee/baton)) - var/obj/item/weapon/melee/baton/T = W - if(T.status == 1 && T.charges > 0) //Copied over from stun baton code - playsound(src.loc, 'Egloves.ogg', 50, 1, -1) - if(isrobot(user)) - var/mob/living/silicon/robot/R = user - R.cell.charge -= 20 - else - T.charges-- - if(src.weakness == "elec") - damage = damage*2 - src.visible_message("\red The [src.name] disintegrates from the electricity!") - if(src.strength == "elec") - damage = -(damage*0.5) - src.visible_message("\red The [src.name] absorbs the electricity!") - if(src.weakness == "brute") - damage = damage*1.25 - if(src.strength == "brute") - damage = damage*0.5 - src.visible_message("\red The [src.name] rebounds the hit!") - src.health -= damage - src.update() + + health -= damage + update_icon() return - - proc/revert() - name = "blob" - icon_state = "blob" - brute_resist = 4 - fire_resist = 1 - blobtype = "Blob" - blobdebug = 0 - health = (health/2) - src.update() - return 1 - + proc/change_to(var/type = "Normal") + switch(type) + if("Normal") + new/obj/effect/blob(src.loc,src.health) + if("Node") + new/obj/effect/blob/node(src.loc,src.health*2) + if("Factory") + new/obj/effect/blob/factory(src.loc,src.health) + if("Shield") + new/obj/effect/blob/shield(src.loc,src.health*2) + del(src) + return //////////////////////////////****IDLE BLOB***///////////////////////////////////// @@ -369,15 +193,13 @@ icon_state = "blobidle0" - New(loc, var/h = 10, var/w = "fire", var/s = "brute") + New(loc, var/h = 10) src.health = h - src.weakness = w - src.strength = s src.dir = pick(1,2,4,8) src.update_idle() - proc/update_idle() //put in stuff here to make it transform? Maybe when its down to around 5 health? + proc/update_idle() if(health<=0) del(src) return @@ -390,60 +212,10 @@ icon_state = "blobidle0" - Del() //idle blob that spawns a normal blob when killed. - var/obj/effect/blob/B = new /obj/effect/blob(src.loc, src.weakness, src.strength) + Del() + var/obj/effect/blob/B = new /obj/effect/blob( src.loc ) spawn(30) B.Life() ..() - -/obj/effect/blob/core/New() - ..() - spawn() - src.blobdebug = 1 - src.Life() - var/list/a = blob_attributes - weakness = pick(a) - a -= weakness - strength = pick(a) - var/w = src.weakness - if(w) - if(w == "fire") - src.fire_resist = 1 - if(w == "brute") - src.brute_resist = 1 - - -/obj/effect/blob/node/New() - ..() - spawn() - src.blobdebug = 2 - src.Life() - -/obj/effect/blob/factory/New() - ..() - spawn() - src.blobdebug = 3 - src.Life() - - -/obj/effect/blob/proc/create_fragments(var/wave_size = 1) - var/list/candidates = list() - for(var/mob/dead/observer/G in world) - if(G.client && G.client.be_alien) - if(G.corpse) - if(G.corpse.stat==2) - candidates.Add(G) - else - candidates.Add(G) - - for(var/i = 0 to wave_size) - if(!candidates.len) break - var/mob/dead/observer/G = pick(candidates) - var/mob/living/blob/B = new/mob/living/blob(src.loc) - if(G.client) - G.client.screen.len = null - B.ghost_name = G.real_name - G.client.mob = B - del(G) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 609870865d..fda16d4d4e 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega") /datum/game_mode var/list/datum/mind/changelings = list() @@ -8,6 +8,7 @@ name = "changeling" config_tag = "changeling" restricted_jobs = list("AI", "Cyborg") + protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain") required_players = 15 required_enemies = 1 recommended_enemies = 4 @@ -85,46 +86,27 @@ var/datum/objective/absorb/absorb_objective = new absorb_objective.owner = changeling - absorb_objective.gen_amount_goal(2,4) + absorb_objective.gen_amount_goal(2, 3) changeling.objectives += absorb_objective + var/datum/objective/assassinate/kill_objective = new + kill_objective.owner = changeling + kill_objective.find_target() + changeling.objectives += kill_objective + + var/datum/objective/steal/steal_objective = new + steal_objective.owner = changeling + steal_objective.find_target() + changeling.objectives += steal_objective + + switch(rand(1,100)) - if(1 to 45) - - var/datum/objective/assassinate/kill_objective = new - kill_objective.owner = changeling - kill_objective.find_target() - changeling.objectives += kill_objective - + if(1 to 80) if (!(locate(/datum/objective/escape) in changeling.objectives)) var/datum/objective/escape/escape_objective = new escape_objective.owner = changeling changeling.objectives += escape_objective - - if(46 to 90) - - var/list/datum/objective/theft = pickweight(GenerateTheft(changeling.assigned_role,changeling)) - var/datum/objective/steal/steal_objective = pick(theft) - steal_objective.owner = changeling - changeling.objectives += steal_objective - - if (!(locate(/datum/objective/escape) in changeling.objectives)) - var/datum/objective/escape/escape_objective = new - escape_objective.owner = changeling - changeling.objectives += escape_objective - else - - var/datum/objective/assassinate/kill_objective = new - kill_objective.owner = changeling - kill_objective.find_target() - changeling.objectives += kill_objective - - var/list/datum/objective/theft = pickweight(GenerateTheft(changeling.assigned_role,changeling)) - var/datum/objective/steal/steal_objective = pick(theft) - steal_objective.owner = changeling - changeling.objectives += steal_objective - if (!(locate(/datum/objective/survive) in changeling.objectives)) var/datum/objective/survive/survive_objective = new survive_objective.owner = changeling @@ -137,6 +119,11 @@ changeling.current << "\red Use say \":g message\" to communicate with your fellow changelings. Remember: you get all of their absorbed DNA if you absorb them." changeling.current << "You must complete the following tasks:" + if (changeling.current.mind) + if (changeling.current.mind.assigned_role == "Clown") + changeling.current << "You have evolved beyond your clownish nature, allowing you to wield weapons without harming yourself." + changeling.current.mutations.Remove(CLUMSY) + var/obj_count = 1 for(var/datum/objective/objective in changeling.objectives) changeling.current << "Objective #[obj_count]: [objective.explanation_text]" @@ -165,72 +152,82 @@ return ..() return 0*/ -/datum/game_mode/proc/grant_changeling_powers(mob/living/carbon/human/changeling_mob) - if (!istype(changeling_mob)) - return +/datum/game_mode/proc/grant_changeling_powers(mob/living/carbon/changeling_mob) + if(!istype(changeling_mob)) return changeling_mob.make_changeling() /datum/game_mode/proc/auto_declare_completion_changeling() - for(var/datum/mind/changeling in changelings) - var/changelingwin = 1 - var/changeling_name - var/totalabsorbed = 0 - if((changeling.current) && (changeling.current.changeling)) - totalabsorbed = ((changeling.current.changeling.absorbed_dna.len) - 1) - changeling_name = "[changeling.current.real_name] (played by [changeling.key])" - world << "The changeling was [changeling_name]." - world << "[changeling.current.gender=="male"?"His":"Her"] changeling ID was [changeling.current.gender=="male"?"Mr.":"Mrs."] [changeling.current.changeling.changelingID]." - world << "Genomes absorbed: [totalabsorbed]" + if(changelings.len) + var/text = "The changelings were:" + for(var/datum/mind/changeling in changelings) + var/changelingwin = 1 - var/count = 1 - for(var/datum/objective/objective in changeling.objectives) - if(objective.check_completion()) - world << "Objective #[count]: [objective.explanation_text] \green Success" - feedback_add_details("changeling_objective","[objective.type]|SUCCESS") + text += "
      [changeling.key] was [changeling.name] (" + if(changeling.current) + if(changeling.current.stat == DEAD) + text += "died" else - world << "Objective #[count]: [objective.explanation_text] \red Failed" - feedback_add_details("changeling_objective","[objective.type]|FAIL") - changelingwin = 0 - count++ + text += "survived" + if(changeling.current.real_name != changeling.name) + text += " as [changeling.current.real_name]" + else + text += "body destroyed" + changelingwin = 0 + text += ")" + + //Removed sanity if(changeling) because we -want- a runtime to inform us that the changelings list is incorrect and needs to be fixed. + text += "
      Changeling ID: [changeling.changeling.changelingID]." + text += "
      Genomes Absorbed: [changeling.changeling.absorbedcount]" + + if(changeling.objectives.len) + var/count = 1 + for(var/datum/objective/objective in changeling.objectives) + if(objective.check_completion()) + text += "
      Objective #[count]: [objective.explanation_text] Success!" + feedback_add_details("changeling_objective","[objective.type]|SUCCESS") + else + text += "
      Objective #[count]: [objective.explanation_text] Fail." + feedback_add_details("changeling_objective","[objective.type]|FAIL") + changelingwin = 0 + count++ + + if(changelingwin) + text += "
      The changeling was successful!" + feedback_add_details("changeling_success","SUCCESS") + else + text += "
      The changeling has failed." + feedback_add_details("changeling_success","FAIL") + + world << text - else - changeling_name = "[changeling.key] (character destroyed)" - changelingwin = 0 - if(changelingwin) - world << "The changeling was successful!" - feedback_add_details("changeling_success","SUCCESS") - else - world << "The changeling has failed!" - feedback_add_details("changeling_success","FAIL") return 1 /datum/changeling //stores changeling powers, changeling recharge thingie, changeling absorbed DNA and changeling ID (for changeling hivemind) - var/changeling_level = 0 var/list/absorbed_dna = list() - var/changeling_fakedeath = 0 - var/chem_charges = 20.00 - var/chem_recharge_multiplier = 1 + var/absorbedcount = 0 + var/chem_charges = 20 + var/chem_recharge_rate = 0.5 var/chem_storage = 50 var/sting_range = 1 - var/changelingID = "none" - var/mob/living/host = null - var/geneticdamage = 0.0 + var/changelingID = "Changeling" + var/geneticdamage = 0 var/isabsorbing = 0 var/geneticpoints = 5 var/purchasedpowers = list() - - -/datum/changeling/New() +/datum/changeling/New(var/gender=FEMALE) ..() - var/list/possibleIDs = list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega") - - for(var/mob/living/carbon/aChangeling in world) - if(aChangeling.changeling) - possibleIDs -= aChangeling.changeling.changelingID - - if(possibleIDs.len) - changelingID = pick(possibleIDs) + var/honorific + if(gender == FEMALE) honorific = "Ms." + else honorific = "Mr." + if(possible_changeling_IDs.len) + changelingID = pick(possible_changeling_IDs) + possible_changeling_IDs -= changelingID + changelingID = "[honorific] [changelingID]" else - changelingID = "[rand(1,1000)]" + changelingID = "[honorific] [rand(1,999)]" + +/datum/changeling/proc/regenerate() + chem_charges = min(max(0, chem_charges+chem_recharge_rate), chem_storage) + geneticdamage = max(0, geneticdamage-1) \ No newline at end of file diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index aed214121f..89f9435483 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -1,1013 +1,477 @@ -/mob/proc/make_lesser_changeling() - if(!changeling) changeling = new - changeling.host = src - - src.verbs += /datum/changeling/proc/EvolutionMenu - - for(var/obj/effect/proc_holder/power/P in changeling.purchasedpowers) - if(P.isVerb) - if(P.allowduringlesserform) - if(!(P in src.verbs)) - src.verbs += P.verbpath - -/* src.verbs += /client/proc/changeling_fakedeath - src.verbs += /client/proc/changeling_lesser_transform - src.verbs += /client/proc/changeling_blind_sting - src.verbs += /client/proc/changeling_deaf_sting - src.verbs += /client/proc/changeling_silence_sting - src.verbs += /client/proc/changeling_unfat_sting -*/ - changeling.changeling_level = 1 - return - +//Restores our verbs. It will only restore verbs allowed during lesser (monkey) form if we are not human /mob/proc/make_changeling() - if(!changeling) changeling = new - changeling.host = src + if(!mind) return + if(!mind.changeling) mind.changeling = new /datum/changeling(gender) + verbs += /datum/changeling/proc/EvolutionMenu - src.verbs += /datum/changeling/proc/EvolutionMenu + var/lesser_form = !ishuman(src) - for(var/obj/effect/proc_holder/power/P in changeling.purchasedpowers) + for(var/datum/power/changeling/P in mind.changeling.purchasedpowers) if(P.isVerb) + if(lesser_form && !P.allowduringlesserform) continue if(!(P in src.verbs)) src.verbs += P.verbpath -/* - src.verbs += /client/proc/changeling_absorb_dna - src.verbs += /client/proc/changeling_transform - src.verbs += /client/proc/changeling_lesser_form - src.verbs += /client/proc/changeling_fakedeath - - src.verbs += /client/proc/changeling_deaf_sting - src.verbs += /client/proc/changeling_blind_sting - src.verbs += /client/proc/changeling_paralysis_sting - src.verbs += /client/proc/changeling_silence_sting - src.verbs += /client/proc/changeling_transformation_sting - src.verbs += /client/proc/changeling_unfat_sting - src.verbs += /client/proc/changeling_boost_range - -*/ - changeling.changeling_level = 2 - if (!changeling.absorbed_dna) - changeling.absorbed_dna = list() - if (changeling.absorbed_dna.len == 0) - changeling.absorbed_dna[src.real_name] = src.dna - return - -/mob/proc/make_greater_changeling() - src.make_changeling() - //This is a test function for the new changeling powers. Grants all of them. - return + if(!mind.changeling.absorbed_dna.len) + mind.changeling.absorbed_dna += dna + return 1 +//removes our changeling verbs /mob/proc/remove_changeling_powers() - - for(var/obj/effect/proc_holder/power/P in changeling.purchasedpowers) + if(!mind || !mind.changeling) return + for(var/datum/power/changeling/P in mind.changeling.purchasedpowers) if(P.isVerb) - src.verbs -= P.verbpath -/* - src.verbs -= /client/proc/changeling_absorb_dna - src.verbs -= /client/proc/changeling_transform - src.verbs -= /client/proc/changeling_lesser_form - src.verbs -= /client/proc/changeling_lesser_transform - src.verbs -= /client/proc/changeling_fakedeath - src.verbs -= /client/proc/changeling_deaf_sting - src.verbs -= /client/proc/changeling_blind_sting - src.verbs -= /client/proc/changeling_paralysis_sting - src.verbs -= /client/proc/changeling_silence_sting - src.verbs -= /client/proc/changeling_boost_range - src.verbs -= /client/proc/changeling_transformation_sting - src.verbs -= /client/proc/changeling_unfat_sting -*/ -/client/proc/changeling_absorb_dna() + verbs -= P.verbpath + + +//Helper proc. Does all the checks and stuff for us to avoid copypasta +/mob/proc/changeling_power(var/required_chems=0, var/required_dna=0, var/max_genetic_damage=100, var/max_stat=0) + if(!usr) return + if(!usr.mind) return + if(!iscarbon(usr)) return + + var/datum/changeling/changeling = usr.mind.changeling + if(!changeling) + world.log << "[src] has the changeling_transform() verb but is not a changeling." + return + + if(usr.stat > max_stat) + usr << "We are incapacitated." + return + + if(changeling.absorbed_dna.len < required_dna) + usr << "We require at least [required_dna] samples of compatible DNA." + return + + if(changeling.chem_charges < required_chems) + usr << "We require at least [required_chems] units of chemicals to do that!" + return + + if(changeling.geneticdamage > max_genetic_damage) + usr << usr << "Our geneomes are still reassembling. We need time to recover first." + return + + return changeling + + +//Absorbs the victim's DNA making them uncloneable. Requires a strong grip on the victim. +//Doesn't cost anything as it's the most basic ability. +/mob/proc/changeling_absorb_dna() set category = "Changeling" set name = "Absorb DNA" - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" + var/datum/changeling/changeling = changeling_power(0,0,100) + if(!changeling) return + + var/obj/item/weapon/grab/G = usr.get_active_hand() + if(!istype(G)) + usr << "We must be grabbing a creature in our active hand to absorb them." return - if(usr.stat) - usr << "\red Not when we are incapacitated." + var/mob/living/carbon/human/T = G.affecting + if(!istype(T)) + usr << "[T] is not compatible with our biology." return - if (!istype(usr.equipped(), /obj/item/weapon/grab)) - usr << "\red We must be grabbing a creature in our active hand to absorb them." + if(NOCLONE in T.mutations) + usr << "This creature's DNA is ruined beyond useability!" return - var/obj/item/weapon/grab/G = usr.equipped() - var/mob/M = G.affecting - - if (!ishuman(M)) - usr << "\red This creature is not compatible with our biology." + if(!G.killing) + usr << "We must have a tighter grip to absorb this creature." return - if (NOCLONE in M.mutations) - usr << "\red This creature's DNA is ruined beyond useability!" + if(changeling.isabsorbing) + usr << "We are already absorbing!" return - if (!G.killing) - usr << "\red We must have a tighter grip to absorb this creature." - return + changeling.isabsorbing = 1 + for(var/stage = 1, stage<=3, stage++) + switch(stage) + if(1) + usr << "This creature is compatible. We must hold still..." + if(2) + usr << "We extend a proboscis." + usr.visible_message("[usr] extends a proboscis!") + if(3) + usr << "We stab [T] with the proboscis." + usr.visible_message("[usr] stabs [T] with the proboscis!") + T << "You feel a sharp stabbing pain!" + T.take_overall_damage(40) - if (usr.changeling.isabsorbing) - usr << "\red We are already absorbing!" - return + feedback_add_details("changeling_powers","A[stage]") + if(!do_mob(usr, T, 150)) + usr << "Our absorption of [T] has been interrupted!" + changeling.isabsorbing = 0 + return + usr << "We have absorbed [T]!" + usr.visible_message("[usr] sucks the fluids from [T]!") + T << "You have been absorbed by the changeling!" - - var/mob/living/carbon/human/T = M - - usr << "\blue This creature is compatible. We must hold still..." - usr.changeling.isabsorbing = 1 - if (!do_mob(usr, T, 150)) - usr << "\red Our absorption of [T] has been interrupted!" - usr.changeling.isabsorbing = 0 - return - - usr << "\blue We extend a proboscis." - usr.visible_message(text("\red [usr] extends a proboscis!")) - - if (!do_mob(usr, T, 150)) - usr << "\red Our absorption of [T] has been interrupted!" - usr.changeling.isabsorbing = 0 - return - - usr << "\blue We stab [T] with the proboscis." - usr.visible_message(text("\red [usr] stabs [T] with the proboscis!")) - T << "\red You feel a sharp stabbing pain!" - T.take_overall_damage(40) - - if (!do_mob(usr, T, 150)) - usr << "\red Our absorption of [T] has been interrupted!" - usr.changeling.isabsorbing = 0 - return - - usr << "\blue We have absorbed [T]!" - usr.visible_message(text("\red [usr] sucks the fluids from [T]!")) - T << "\red You have been absorbed by the changeling!" - - usr.changeling.absorbed_dna[T.real_name] = T.dna + T.dna.real_name = T.real_name //Set this again, just to be sure that it's properly set. + changeling.absorbed_dna += T.dna if(usr.nutrition < 400) usr.nutrition = min((usr.nutrition + T.nutrition), 400) - usr.changeling.chem_charges += 10 - usr.changeling.geneticpoints += 2 - if(T.changeling) - if(T.changeling.absorbed_dna) - usr.changeling.absorbed_dna |= T.changeling.absorbed_dna //steal all their loot + changeling.chem_charges += 10 + changeling.geneticpoints += 2 - T.changeling.absorbed_dna = list() - T.changeling.absorbed_dna[T.real_name] = T.dna + if(T.mind && T.mind.changeling) + if(T.mind.changeling.absorbed_dna) + changeling.absorbed_dna |= T.mind.changeling.absorbed_dna //steal all their loot + changeling.absorbedcount += T.mind.changeling.absorbedcount - if(T.changeling.purchasedpowers) - for(var/obj/effect/proc_holder/power/Tp in T.changeling.purchasedpowers) - if(Tp in usr.changeling.purchasedpowers) + T.mind.changeling.absorbed_dna = list(T.dna) + + if(T.mind.changeling.purchasedpowers) + for(var/datum/power/changeling/Tp in T.mind.changeling.purchasedpowers) + if(Tp in changeling.purchasedpowers) continue else - usr.changeling.purchasedpowers += Tp + changeling.purchasedpowers += Tp if(!Tp.isVerb) call(Tp.verbpath)() - else - if(usr.changeling.changeling_level == 1) - usr.make_lesser_changeling() - else - usr.make_changeling() + usr.make_changeling() + changeling.chem_charges += T.mind.changeling.chem_charges + changeling.geneticpoints += T.mind.changeling.geneticpoints + T.mind.changeling.chem_charges = 0 - - - usr.changeling.chem_charges += T.changeling.chem_charges - usr.changeling.geneticpoints += T.changeling.geneticpoints - T.changeling.chem_charges = 0 - usr.changeling.isabsorbing = 0 + changeling.absorbedcount++ + changeling.isabsorbing = 0 T.death(0) T.Drain() + return 1 - return -/client/proc/changeling_transform() +//Change our DNA to that of somebody we've absorbed. +/mob/proc/changeling_transform() set category = "Changeling" set name = "Transform (5)" - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" + var/datum/changeling/changeling = changeling_power(5,1,0) + if(!changeling) return + + var/list/names = list() + for(var/datum/dna/DNA in changeling.absorbed_dna) + names += "[DNA.real_name]" + + var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + if(!S) return + + var/datum/dna/chosen_dna + for(var/datum/dna/DNA in changeling.absorbed_dna) + if(S == "[DNA.real_name]") + chosen_dna = DNA + break + + if(!chosen_dna) return - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if (usr.changeling.absorbed_dna.len <= 0) - usr << "\red We have not yet absorbed any compatible DNA." - return - - if(usr.changeling.chem_charges < 5) - usr << "\red We don't have enough stored chemicals to do that!" - return - - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in usr.changeling.absorbed_dna - - if (S == null) - return - - usr.changeling.chem_charges -= 5 - - usr.visible_message(text("\red [usr] transforms!")) - - usr.dna = usr.changeling.absorbed_dna[S] - usr.real_name = S + changeling.chem_charges -= 5 + usr.visible_message("[usr] transforms!") + changeling.geneticdamage = 30 + usr.dna = chosen_dna + usr.real_name = chosen_dna.real_name updateappearance(usr, usr.dna.uni_identity) domutcheck(usr, null) - usr.verbs -= /client/proc/changeling_transform + usr.verbs -= /mob/proc/changeling_transform + spawn(10) usr.verbs += /mob/proc/changeling_transform - spawn(10) - usr.verbs += /client/proc/changeling_transform + feedback_add_details("changeling_powers","TR") + return 1 - return -/client/proc/changeling_lesser_form() +//Transform into a monkey. +/mob/proc/changeling_lesser_form() set category = "Changeling" set name = "Lesser Form (1)" - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return + var/datum/changeling/changeling = changeling_power(1,0,0) + if(!changeling) return - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 1) - usr << "\red We don't have enough stored chemicals to do that!" - return - - if(usr.changeling.geneticdamage != 0) - usr << "Our genes are still mending themselves! We cannot transform!" - return - - usr.changeling.chem_charges-- - - usr.remove_changeling_powers() - - usr.visible_message(text("\red [usr] transforms!")) - - usr.changeling.geneticdamage = 30 - usr << "Our genes cry out!" + var/mob/living/carbon/C = usr + changeling.chem_charges-- + C.remove_changeling_powers() + C.visible_message("[C] transforms!") + changeling.geneticdamage = 30 + C << "Our genes cry out!" + //TODO replace with monkeyize proc var/list/implants = list() //Try to preserve implants. - for(var/obj/item/weapon/W in usr) - if (istype(W, /obj/item/weapon/implant)) - implants += W + for(var/obj/item/weapon/implant/W in C) + implants += W - usr.rebuild_appearance() - usr.monkeyizing = 1 - usr.canmove = 0 - usr.icon = null - usr.invisibility = 101 - var/atom/movable/overlay/animation = new /atom/movable/overlay( usr.loc ) + C.monkeyizing = 1 + C.canmove = 0 + C.icon = null + C.overlays = null + C.invisibility = 101 + + var/atom/movable/overlay/animation = new /atom/movable/overlay( C.loc ) animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = src flick("h2monkey", animation) sleep(48) del(animation) var/mob/living/carbon/monkey/O = new /mob/living/carbon/monkey(src) - O.dna = usr.dna - usr.dna = null - O.changeling = usr.changeling + O.dna = C.dna + C.dna = null - for(var/obj/item/W in usr) - usr.drop_from_slot(W) - - - for(var/obj/T in usr) + for(var/obj/item/W in C) + C.drop_from_inventory(W) + for(var/obj/T in C) del(T) - //for(var/R in usr.organs) //redundant, let's give garbage collector work to do --rastaf0 - // del(usr.organs[text("[]", R)]) - O.loc = usr.loc - - O.name = text("monkey ([])",copytext(md5(usr.real_name), 2, 6)) - O.setToxLoss(usr.getToxLoss()) - O.adjustBruteLoss(usr.getBruteLoss()) - O.setOxyLoss(usr.getOxyLoss()) - O.adjustFireLoss(usr.getFireLoss()) - O.stat = usr.stat + O.loc = C.loc + O.name = "monkey ([copytext(md5(C.real_name), 2, 6)])" + O.setToxLoss(C.getToxLoss()) + O.adjustBruteLoss(C.getBruteLoss()) + O.setOxyLoss(C.getOxyLoss()) + O.adjustFireLoss(C.getFireLoss()) + O.stat = C.stat O.a_intent = "hurt" - for (var/obj/item/weapon/implant/I in implants) + for(var/obj/item/weapon/implant/I in implants) I.loc = O I.implanted = O - continue - if(usr.mind) - usr.mind.transfer_to(O) + C.mind.transfer_to(O) - O.make_lesser_changeling() - O.verbs += /client/proc/changeling_lesser_transform - del(usr) - return + O.make_changeling(1) + O.verbs += /mob/proc/changeling_lesser_transform + feedback_add_details("changeling_powers","LF") + del(C) + return 1 -/client/proc/changeling_lesser_transform() + +//Transform into a human +/mob/proc/changeling_lesser_transform() set category = "Changeling" set name = "Transform (1)" - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" + var/datum/changeling/changeling = changeling_power(1,1,0) + if(!changeling) return + + var/list/names = list() + for(var/datum/dna/DNA in changeling.absorbed_dna) + names += "[DNA.real_name]" + + var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + if(!S) return + + var/datum/dna/chosen_dna + for(var/datum/dna/DNA in changeling.absorbed_dna) + if(S == "[DNA.real_name]") + chosen_dna = DNA + break + + if(!chosen_dna) return - if(usr.stat) - usr << "\red Not when we are incapacitated." - return + var/mob/living/carbon/C = usr - if (usr.changeling.absorbed_dna.len <= 0) - usr << "\red We have not yet absorbed any compatible DNA." - return - - if(usr.changeling.chem_charges < 1) - usr << "\red We don't have enough stored chemicals to do that!" - return - - var/S = input("Select the target DNA: ", "Target DNA", null) in usr.changeling.absorbed_dna - - if (S == null) - return - - usr.changeling.chem_charges -= 1 - - usr.remove_changeling_powers() - - usr.visible_message(text("\red [usr] transforms!")) - - usr.dna = usr.changeling.absorbed_dna[S] + changeling.chem_charges-- + C.remove_changeling_powers() + C.visible_message("[C] transforms!") + C.dna = chosen_dna var/list/implants = list() - for (var/obj/item/weapon/implant/I in usr) //Still preserving implants + for (var/obj/item/weapon/implant/I in C) //Still preserving implants implants += I - usr.rebuild_appearance() - usr.monkeyizing = 1 - usr.canmove = 0 - usr.icon = null - usr.invisibility = 101 - var/atom/movable/overlay/animation = new /atom/movable/overlay( usr.loc ) + C.monkeyizing = 1 + C.canmove = 0 + C.icon = null + C.overlays = null + C.invisibility = 101 + var/atom/movable/overlay/animation = new /atom/movable/overlay( C.loc ) animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = src flick("monkey2h", animation) sleep(48) del(animation) for(var/obj/item/W in usr) - usr.u_equip(W) - if (usr.client) - usr.client.screen -= W + C.u_equip(W) + if (C.client) + C.client.screen -= W if (W) - W.loc = usr.loc - W.dropped(usr) + W.loc = C.loc + W.dropped(C) W.layer = initial(W.layer) var/mob/living/carbon/human/O = new /mob/living/carbon/human( src ) - if (isblockon(getblock(usr.dna.uni_identity, 11,3),11)) + if (isblockon(getblock(C.dna.uni_identity, 11,3),11)) O.gender = FEMALE else O.gender = MALE - O.dna = usr.dna - usr.dna = null - O.changeling = usr.changeling - O.real_name = S + O.dna = C.dna + C.dna = null + O.real_name = chosen_dna.real_name - for(var/obj/T in usr) + for(var/obj/T in C) del(T) - O.loc = usr.loc + O.loc = C.loc updateappearance(O,O.dna.uni_identity) domutcheck(O, null) - O.setToxLoss(usr.getToxLoss()) - O.adjustBruteLoss(usr.getBruteLoss()) - O.setOxyLoss(usr.getOxyLoss()) - O.adjustFireLoss(usr.getFireLoss()) - O.stat = usr.stat + O.setToxLoss(C.getToxLoss()) + O.adjustBruteLoss(C.getBruteLoss()) + O.setOxyLoss(C.getOxyLoss()) + O.adjustFireLoss(C.getFireLoss()) + O.stat = C.stat for (var/obj/item/weapon/implant/I in implants) I.loc = O I.implanted = O - continue - - if(usr.mind) - usr.mind.transfer_to(O) + C.mind.transfer_to(O) O.make_changeling() - del(usr) - return + feedback_add_details("changeling_powers","LFT") + del(C) + return 1 -/client/proc/changeling_greater_form() // Oh shit, it's on now. - - set category = "Changeling" - set name = "Greater Form" - set desc = "Become onto the Goddess" - - if (usr.monkeyizing) - return - for(var/obj/item/W in src) - usr.drop_from_slot(W) - usr.rebuild_appearance() - usr.monkeyizing = 1 - usr.canmove = 0 - usr.icon = null - usr.invisibility = 101 - for(var/datum/organ/external/organ in usr:organs) - del(organ) - - var/atom/movable/overlay/animation = new /atom/movable/overlay( usr.loc ) - animation.icon_state = "blank" - animation.icon = 'mob.dmi' - animation.master = src - flick("h2monkey", animation) - sleep(48) - //animation = null - var/mob/living/carbon/human/O = new /mob/living/carbon/human( src )//Removed Emissary shit -Sieve{R} - del(animation) - - O.real_name = usr.real_name - O.name = usr.name - O.dna = usr.dna - usr.dna = null - O.changeling = usr.changeling - updateappearance(O,O.dna.uni_identity) - O.loc = usr.loc - O.viruses = usr.viruses - usr.viruses = list() - for(var/datum/disease/D in O.viruses) - D.affected_mob = O - O.universal_speak = 1 //hacky fix until someone can figure out how to make them only understand humans - - if (usr.client) - usr.client.mob = O - if(usr.mind) - usr.mind.transfer_to(O) - - spawn(300) - command_alert("Extreme danger. A level four biological entity has been detected on board the station. Emergancy evacuation procedures have begun. Civilian staff, do NOT engage the creature if spotted. Renforcements are on route.") - emergency_shuttle.online = 1 - emergency_shuttle.settimeleft(10) - spawn(10) - var/list/candidates = list() - - for(var/mob/dead/observer/G in world) - candidates += G - - for(var/mob/dead/observer/G in candidates) - if(!G.client || !G.key) - candidates.Remove(G) - - for(var/obj/structure/stool/bed/chair/C in locate(/area/shuttle/escape/transit)) - - var/mob/living/carbon/human/new_commando = create_death_commando(C, 0) - - if(candidates.len) - var/mob/dead/observer/G = pick(candidates) - new_commando.mind.key = G.key//For mind stuff. - new_commando.key = G.key - new_commando.internal = new_commando.s_store - new_commando.internals.icon_state = "internal1" - candidates -= G - del(G) - else - break - - //So they don't forget their code or mission. - new_commando.mind.store_memory("Mission: \red Assist in mobilizing station crew against the hostile entity. Do not allow the hostile entity to escape. Do not leave or permit anyone to leave until the entity is contained.") - - new_commando << "\blue You are a Special Ops Commando in the service of Central Command. \nYour current mission is: \redAssist in mobilizing station crew against the hostile entity. Do not allow the hostile entity to escape. Do not leave or permit anyone to leave until the entity is contained." - spawn(100) - emergency_shuttle.online = 0 - command_alert("The emergancy shuttle will hold until the hostile entity has been terminated. During evacuation, do NOT use escape pods. To avoid the chance of a hostile entity escaping, the Thunderchild will be firing on and destorying any escape pods leaving the station") - O << "Your way out has arrived. Obtain the ID of three heads to override the holding protocol and escape. Let none stand in your way, for you are a perfect creature." - for(var/datum/objective/objective in O.mind.objectives) - O.mind.objectives.Remove(objective) - del(objective) - var/datum/objective/new_objective = null - new_objective = new /datum/objective/escape - new_objective.owner = O.mind - O.mind.objectives += new_objective - -/* spawn(0) - while(emergency_shuttle.online == 0) - sleep(10) - command_alert("Authorization codes recieved, confirming hostile entity terminated. The emergancy shuttle is now departing.") - spawn(900) - for(var/mob/M in locate(/area/shuttle/escape_pod1/transit)) - M.gib() - for(var/mob/M in locate(/area/shuttle/escape_pod2/transit)) - M.gib() - for(var/mob/M in locate(/area/shuttle/escape_pod3/transit)) - M.gib() - for(var/mob/M in locate(/area/shuttle/escape_pod5/transit)) - M.gib() - while(emergency_shuttle.online == 1) - sleep(10) - if((locate(/mob/living/carbon/human/tajaran/Emissary) in locate(/area/shuttle/escape/centcom)) || (locate(/mob/living/carbon/human/tajaran/Emissary) in locate(/area/centcom/evac)) || (locate(/mob/living/carbon/human/tajaran/Emissary) in locate(/area/centcom/control) ) ) - command_alert("What the fu- Shoot it! SHOOT IT! CENTRAL COMMAND TRANSMITTING DIST- *static* Nevermind previous transmission, NanoTrasen. We're all good here. Subject contained. Standing down alert status.") -Tarjan shit, not recoding this -Sieve{R}*/ - -/client/proc/changeling_fakedeath() +//Fake our own death and fully heal. You will appear to be dead but regenerate fully after a short delay. +/mob/proc/changeling_fakedeath() set category = "Changeling" set name = "Regenerative Stasis (20)" - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return + var/datum/changeling/changeling = changeling_power(20,0,100,UNCONSCIOUS) + if(!changeling) return - if(usr.changeling.chem_charges < 20) - usr << "\red We don't have enough stored chemicals to do that!" - return + changeling.chem_charges -= 20 + var/mob/living/carbon/C = usr + C << "We will regenerate our form." - usr.changeling.chem_charges -= 20 + C.status_flags |= FAKEDEATH //play dead + C.update_canmove() + C.remove_changeling_powers() - usr << "\blue We will regenerate our form." + C.emote("gasp") + C.tod = worldtime2text() - usr.lying = 1 - usr.canmove = 0 - usr.changeling.changeling_fakedeath = 1 - usr.remove_changeling_powers() + spawn(rand(800,2000)) + if(C.stat == DEAD) + dead_mob_list -= C + living_mob_list += C + C.stat = CONSCIOUS + C.tod = null + C.setToxLoss(0) + C.setOxyLoss(0) + C.setCloneLoss(0) + C.SetParalysis(0) + C.SetStunned(0) + C.SetWeakened(0) + C.radiation = 0 + C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss()) + C.reagents.clear_reagents() + C << "We have regenerated." + C.visible_message("[usr] appears to wake from the dead, having healed all wounds.") - usr.emote("gasp") + C.status_flags &= ~(FAKEDEATH) + C.update_canmove() + C.make_changeling() + feedback_add_details("changeling_powers","FD") + return 1 - spawn(1200) - usr.stat = 0 - //usr.fireloss = 0 - usr.setToxLoss(0) - //usr.bruteloss = 0 - usr.setOxyLoss(0) - usr.setCloneLoss(0) - usr.SetParalysis(0) - usr.SetStunned(0) - usr.SetWeakened(0) - usr.radiation = 0 - //usr.health = 100 - //usr.updatehealth() - var/mob/living/M = src - M.heal_overall_damage(M.getBruteLoss(), M.getFireLoss()) - usr.reagents.clear_reagents() - usr.lying = 0 - usr.canmove = 1 - usr << "\blue We have regenerated." - usr.visible_message(text("\red [usr] appears to wake from the dead, having healed all wounds.")) - usr.changeling.changeling_fakedeath = 0 - if (usr.changeling.changeling_level == 1) - usr.make_lesser_changeling() - else if (usr.changeling.changeling_level == 2) - usr.make_changeling() - - return - -/client/proc/changeling_boost_range() +//Boosts the range of your next sting attack by 1 +/mob/proc/changeling_boost_range() set category = "Changeling" set name = "Ranged Sting (10)" set desc="Your next sting ability can be used against targets 2 squares away." - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 10) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 10 - - usr << "\blue Your throat adjusts to launch the sting." - usr.changeling.sting_range = 2 - - usr.verbs -= /client/proc/changeling_boost_range - - spawn(5) - usr.verbs += /client/proc/changeling_boost_range - - return - -/client/proc/changeling_silence_sting() - set category = "Changeling" - set name = "Silence sting (10)" - set desc="Sting target" - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - if(T && T in view(usr.changeling.sting_range)) - - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 10) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 10 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - // T << "You feel a small prick and a burning sensation in your throat." - T.silent += 30 - //else - // T << "You feel a small prick." - - usr.verbs -= /client/proc/changeling_silence_sting - - spawn(5) - usr.verbs += /client/proc/changeling_silence_sting - - return - -/client/proc/changeling_blind_sting() - set category = "Changeling" - set name = "Blind sting (20)" - set desc="Sting target" - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - if(T && T in view(usr.changeling.sting_range)) - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 20) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 20 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - var/obj/effect/overlay/B = new /obj/effect/overlay( T.loc ) - B.icon_state = "blspell" - B.icon = 'wizard.dmi' - B.name = "spell" - B.anchored = 1 - B.density = 0 - B.layer = 4 - T.canmove = 0 - spawn(5) - del(B) - T.canmove = 1 - - if(!T.changeling) - T << text("\blue Your eyes cry out in pain!") - T.disabilities |= 1 - spawn(300) - T.disabilities &= ~1 - T.eye_blind = 10 - T.eye_blurry = 20 - - usr.verbs -= /client/proc/changeling_blind_sting - - spawn(5) - usr.verbs += /client/proc/changeling_blind_sting - - return - -/client/proc/changeling_deaf_sting() - set category = "Changeling" - set name = "Deaf sting (5)" - set desc="Sting target:" - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - - if(T && T in view(usr.changeling.sting_range)) - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 5) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 5 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - T.disabilities |= 32 - spawn(300) - T.disabilities &= ~32 - - usr.verbs -= /client/proc/changeling_deaf_sting - - spawn(5) - usr.verbs += /client/proc/changeling_deaf_sting - - return - -/client/proc/changeling_paralysis_sting() - set category = "Changeling" - set name = "Paralysis sting (30)" - set desc="Sting target" - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - - if(T && T in view(usr.changeling.sting_range)) - - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 30) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 30 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - T << "You feel a small prick and a burning sensation." - - if (T.reagents) - T.reagents.add_reagent("zombiepowder", 20) - else - T << "You feel a small prick." - - usr.verbs -= /client/proc/changeling_paralysis_sting - - spawn(5) - usr.verbs += /client/proc/changeling_paralysis_sting - - return - -/client/proc/changeling_transformation_sting() - set category = "Changeling" - set name = "Transformation sting (30)" - set desc="Sting target" - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - - if(T && T in view(usr.changeling.sting_range)) - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 30) - usr << "\red We don't have enough stored chemicals to do that!" - return - - if(T.stat != 2 || (HUSK in T.mutations) || (!ishuman(T) && !ismonkey(T))) - usr << "\red We can't transform that target!" - return - - var/S = input("Select the target DNA: ", "Target DNA", null) in usr.changeling.absorbed_dna - - if (S == null) - return - - usr.changeling.chem_charges -= 30 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - T.visible_message(text("\red [T] transforms!")) - - T.dna = usr.changeling.absorbed_dna[S] - T.real_name = S - updateappearance(T, T.dna.uni_identity) - domutcheck(T, null) - - usr.verbs -= /client/proc/changeling_transformation_sting - - spawn(5) - usr.verbs += /client/proc/changeling_transformation_sting - - return - -/client/proc/changeling_unfat_sting() - set category = "Changeling" - set name = "Unfat sting (5)" - set desc = "Sting target" - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - - if(T && T in view(usr.changeling.sting_range)) - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 5) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 5 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - T << "You feel a small prick and a burning sensation." - T.overeatduration = 0 - T.nutrition -= 100 - else - T << "You feel a small prick." - - usr.verbs -= /client/proc/changeling_unfat_sting - - spawn(5) - usr.verbs += /client/proc/changeling_unfat_sting - - return - -/client/proc/changeling_unstun() + var/datum/changeling/changeling = changeling_power(10,0,100) + if(!changeling) return 0 + changeling.chem_charges -= 10 + usr << "Your throat adjusts to launch the sting." + changeling.sting_range = 2 + usr.verbs -= /mob/proc/changeling_boost_range + spawn(5) usr.verbs += /mob/proc/changeling_boost_range + feedback_add_details("changeling_powers","RS") + return 1 + + +//Recover from stuns. +/mob/proc/changeling_unstun() set category = "Changeling" set name = "Epinephrine Sacs (45)" set desc = "Removes all stuns" - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - if(usr.changeling.chem_charges < 45) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 45 + var/datum/changeling/changeling = changeling_power(45,0,100,UNCONSCIOUS) + if(!changeling) return 0 + changeling.chem_charges -= 45 var/mob/living/carbon/human/C = usr + C.stat = 0 + C.SetParalysis(0) + C.SetStunned(0) + C.SetWeakened(0) + C.lying = 0 + C.update_canmove() - if(C) - C.stat = 0 - C.SetParalysis(0) - C.SetStunned(0) - C.SetWeakened(0) - C.lying = 0 - C.canmove = 1 - - usr.verbs -= /client/proc/changeling_unstun - - spawn(5) - usr.verbs += /client/proc/changeling_unstun + usr.verbs -= /mob/proc/changeling_unstun + spawn(5) usr.verbs += /mob/proc/changeling_unstun + feedback_add_details("changeling_powers","UNS") + return 1 +//Speeds up chemical regeneration +/mob/proc/changeling_fastchemical() + usr.mind.changeling.chem_recharge_rate *= 2 + return 1 -/client/proc/changeling_fastchemical() +//Increases macimum chemical storage +/mob/proc/changeling_engorgedglands() + usr.mind.changeling.chem_storage += 25 + return 1 - usr.changeling.chem_recharge_multiplier = usr.changeling.chem_recharge_multiplier*2 -/client/proc/changeling_engorgedglands() - - usr.changeling.chem_storage = usr.changeling.chem_storage+25 - -/client/proc/changeling_digitalcamo() +//Prevents AIs tracking you but makes you easily detectable to the human-eye. +/mob/proc/changeling_digitalcamo() set category = "Changeling" set name = "Toggle Digital Camoflague (10)" set desc = "The AI can no longer track us, but we will look different if examined. Has a constant cost while active." - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - if(usr.changeling.chem_charges < 10) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 10 + var/datum/changeling/changeling = changeling_power(10) + if(!changeling) return 0 + usr.mind.changeling.chem_charges -= 10 var/mob/living/carbon/human/C = usr + if(C.digitalcamo) C << "We return to normal." + else C << "We distort our form to prevent AI-tracking." + C.digitalcamo = !C.digitalcamo - if(C) - C << "[C.digitalcamo ? "We return to normal." : "We distort our form."]" - C.digitalcamo = !C.digitalcamo - spawn(0) - while(C && C.digitalcamo) - C.changeling.chem_charges -= 1/4 - sleep(10) + spawn(0) + while(C && C.digitalcamo) + C.mind.changeling.chem_charges -= 1 + sleep(40) + + usr.verbs -= /mob/proc/changeling_digitalcamo + spawn(5) usr.verbs += /mob/proc/changeling_digitalcamo + feedback_add_details("changeling_powers","CAM") + return 1 - usr.verbs -= /client/proc/changeling_digitalcamo - - spawn(5) - usr.verbs += /client/proc/changeling_digitalcamo - - -/client/proc/changeling_DEATHsting() - set category = "Changeling" - set name = "Death Sting (40)" - set desc = "Causes spasms onto death." - - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims - - if(T && T in view(usr.changeling.sting_range)) - - if(usr.stat) - usr << "\red Not when we are incapacitated." - return - - if(usr.changeling.chem_charges < 40) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 40 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - T << "You feel a small prick and your chest becomes tight." - - T.silent = (10) - T.Paralyse(10) - T.make_jittery(1000) - - if (T.reagents) - T.reagents.add_reagent("lexorin", 40) - - else - T << "You feel a small prick." - - usr.verbs -= /client/proc/changeling_DEATHsting - - spawn(5) - usr.verbs += /client/proc/changeling_DEATHsting - - return - - - -/client/proc/changeling_rapidregen() +//Starts healing you every second for 10 seconds. Can be used whilst unconscious. +/mob/proc/changeling_rapidregen() set category = "Changeling" set name = "Rapid Regeneration (30)" set desc = "Begins rapidly regenerating. Does not effect stuns or chemicals." - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" - return - - if(usr.changeling.chem_charges < 30) - usr << "\red We don't have enough stored chemicals to do that!" - return - - usr.changeling.chem_charges -= 30 + var/datum/changeling/changeling = changeling_power(30,0,100,UNCONSCIOUS) + if(!changeling) return 0 + usr.mind.changeling.chem_charges -= 30 var/mob/living/carbon/human/C = usr - spawn(0) for(var/i = 0, i<10,i++) if(C) @@ -1017,59 +481,174 @@ Tarjan shit, not recoding this -Sieve{R}*/ C.adjustFireLoss(-10) sleep(10) + usr.verbs -= /mob/proc/changeling_rapidregen + spawn(5) usr.verbs += /mob/proc/changeling_rapidregen + feedback_add_details("changeling_powers","RR") + return 1 - usr.verbs -= /client/proc/changeling_rapidregen + ////////// + //STINGS// //They get a pretty header because there's just so fucking many of them ;_; + ////////// - spawn(5) - usr.verbs += /client/proc/changeling_rapidregen +/mob/proc/sting_can_reach(mob/M as mob, sting_range = 1) + if(M.loc == src.loc) return 1 //target and source are in the same thing + if(!isturf(src.loc) || !isturf(M.loc)) return 0 //One is inside, the other is outside something. + if(AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, sting_range)) //If a path exists, good! + return 1 + return 0 + +//Handles the general sting code to reduce on copypasta (seeming as somebody decided to make SO MANY dumb abilities) +/mob/proc/changeling_sting(var/required_chems=0, var/verb_path) + var/datum/changeling/changeling = changeling_power(required_chems) + if(!changeling) return + + var/list/victims = list() + for(var/mob/living/carbon/C in oview(changeling.sting_range)) + victims += C + var/mob/living/carbon/T = input(usr, "Who will we sting?") as null|anything in victims + + if(!T) return + if(!(T in view(changeling.sting_range))) return + if(!sting_can_reach(T, changeling.sting_range)) return + if(!changeling_power(required_chems)) return + + changeling.chem_charges -= required_chems + changeling.sting_range = 1 + usr.verbs -= verb_path + spawn(10) usr.verbs += verb_path + + usr << "We stealthily sting [T]." + if(!T.mind || !T.mind.changeling) return T //T will be affected by the sting + T << "You feel a tiny prick." + return - - -/client/proc/changeling_lsdsting() +/mob/proc/changeling_lsdsting() set category = "Changeling" set name = "Hallucination Sting (15)" set desc = "Causes terror in the target." - if(!usr.changeling) - usr << "\red You're not a changeling, something's wrong!" + var/mob/living/carbon/T = changeling_sting(15,/mob/proc/changeling_lsdsting) + if(!T) return 0 + spawn(rand(300,600)) + if(T) T.hallucination += 400 + feedback_add_details("changeling_powers","HS") + return 1 + +/mob/proc/changeling_silence_sting() + set category = "Changeling" + set name = "Silence sting (10)" + set desc="Sting target" + + var/mob/living/carbon/T = changeling_sting(10,/mob/proc/changeling_silence_sting) + if(!T) return 0 + T.silent += 30 + feedback_add_details("changeling_powers","SS") + return 1 + +/mob/proc/changeling_blind_sting() + set category = "Changeling" + set name = "Blind sting (20)" + set desc="Sting target" + + var/mob/living/carbon/T = changeling_sting(20,/mob/proc/changeling_blind_sting) + if(!T) return 0 + T << "Your eyes burn horrificly!" + T.disabilities |= NEARSIGHTED + spawn(300) T.disabilities &= ~NEARSIGHTED + T.eye_blind = 10 + T.eye_blurry = 20 + feedback_add_details("changeling_powers","BS") + return 1 + +/mob/proc/changeling_deaf_sting() + set category = "Changeling" + set name = "Deaf sting (5)" + set desc="Sting target:" + + var/mob/living/carbon/T = changeling_sting(5,/mob/proc/changeling_deaf_sting) + if(!T) return 0 + T << "Your ears pop and begin ringing loudly!" + T.sdisabilities |= DEAF + spawn(300) T.sdisabilities &= ~DEAF + feedback_add_details("changeling_powers","DS") + return 1 + +/mob/proc/changeling_paralysis_sting() + set category = "Changeling" + set name = "Paralysis sting (30)" + set desc="Sting target" + + var/mob/living/carbon/T = changeling_sting(30,/mob/proc/changeling_paralysis_sting) + if(!T) return 0 + T << "Your muscles begin to painfully tighten." + T.Weaken(10) + feedback_add_details("changeling_powers","PS") + return 1 + +/mob/proc/changeling_transformation_sting() + set category = "Changeling" + set name = "Transformation sting (40)" + set desc="Sting target" + + var/datum/changeling/changeling = changeling_power(40) + if(!changeling) return 0 + + + + var/list/names = list() + for(var/datum/dna/DNA in changeling.absorbed_dna) + names += "[DNA.real_name]" + + var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + if(!S) return + + var/datum/dna/chosen_dna + for(var/datum/dna/DNA in changeling.absorbed_dna) + if(S == "[DNA.real_name]") + chosen_dna = DNA + break + + if(!chosen_dna) return - var/list/victims = list() - for(var/mob/living/carbon/C in oview(usr.changeling.sting_range)) - victims += C - var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims + var/mob/living/carbon/T = changeling_sting(40,/mob/proc/changeling_transformation_sting) + if(!T) return 0 + if((HUSK in T.mutations) || (!ishuman(T) && !ismonkey(T))) + usr << "Our sting appears ineffective against its DNA." + return 0 + T.visible_message("[T] transforms!") + T.dna = chosen_dna + T.real_name = chosen_dna.real_name + updateappearance(T, T.dna.uni_identity) + domutcheck(T, null) + feedback_add_details("changeling_powers","TS") + return 1 - if(T && T in view(usr.changeling.sting_range)) +/mob/proc/changeling_unfat_sting() + set category = "Changeling" + set name = "Unfat sting (5)" + set desc = "Sting target" - if(usr.stat) - usr << "\red Not when we are incapacitated." - return + var/mob/living/carbon/T = changeling_sting(5,/mob/proc/changeling_unfat_sting) + if(!T) return 0 + T << "you feel a small prick as stomach churns violently and you become to feel skinnier." + T.overeatduration = 0 + T.nutrition -= 100 + feedback_add_details("changeling_powers","US") + return 1 - if(usr.changeling.chem_charges < 15) - usr << "\red We don't have enough stored chemicals to do that!" - return +/mob/proc/changeling_DEATHsting() + set category = "Changeling" + set name = "Death Sting (40)" + set desc = "Causes spasms onto death." - usr.changeling.chem_charges -= 15 - usr.changeling.sting_range = 1 - - usr << "\blue We stealthily sting [T]." - - if(!T.changeling) - // T << "You feel a small prick." // No warning. - - var/timer = rand(300,600) - - spawn(timer) - if(T) - if(T.reagents) - // T.reagents.add_reagent("LSD", 50) // Slight overkill, it seems. - T.hallucination = 400 - - - usr.verbs -= /client/proc/changeling_lsdsting - - spawn(5) - usr.verbs += /client/proc/changeling_lsdsting - - return \ No newline at end of file + var/mob/living/carbon/T = changeling_sting(40,/mob/proc/changeling_DEATHsting) + if(!T) return 0 + T << "You feel a small prick and your chest becomes tight." + T.silent = 10 + T.Paralyse(10) + T.make_jittery(1000) + if(T.reagents) T.reagents.add_reagent("lexorin", 40) + feedback_add_details("changeling_powers","DTHS") + return 1 diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm index 8ba655a22c..136e31cd47 100644 --- a/code/game/gamemodes/changeling/modularchangling.dm +++ b/code/game/gamemodes/changeling/modularchangling.dm @@ -1,221 +1,161 @@ -var/list/powers = typesof(/obj/effect/proc_holder/power) //needed for the badmin verb for now -var/list/obj/effect/proc_holder/power/powerinstances = list() - -/obj/effect/proc_holder/power - name = "Power" - desc = "Placeholder" - density = 0 - opacity = 0 +var/list/powers = typesof(/datum/power/changeling) - /datum/power/changeling //needed for the badmin verb for now +var/list/datum/power/changeling/powerinstances = list() +/datum/power //Could be used by other antags too + var/name = "Power" + var/desc = "Placeholder" var/helptext = "" + var/isVerb = 1 // Is it an active power, or passive? + var/verbpath // Path to a verb that contains the effects. +/datum/power/changeling var/allowduringlesserform = 0 - var/isVerb = 1 // Is it an active power, or passive? - var/verbpath = null // Path to a verb that contains the effects. var/genomecost = 500000 // Cost for the changling to evolve this power. -/obj/effect/proc_holder/power/absorb_dna +/datum/power/changeling/absorb_dna name = "Absorb DNA" - desc = "Permits us to syphon the DNA from a human. They become one with us, and we become stronger." + desc = "Permits us to syphon the DNA from a human. They become one with us, and we become stronger." genomecost = 0 + verbpath = /mob/proc/changeling_absorb_dna - verbpath = /client/proc/changeling_absorb_dna - - - -/obj/effect/proc_holder/power/transform +/datum/power/changeling/transform name = "Transform" desc = "We take on the apperance and voice of one we have absorbed." genomecost = 0 + verbpath = /mob/proc/changeling_transform - verbpath = /client/proc/changeling_transform +/datum/power/changeling/fakedeath + name = "Regenerative Stasis" + desc = "We fake our death while we regenerate our form, even through death." + genomecost = 0 + allowduringlesserform = 1 + verbpath = /mob/proc/changeling_fakedeath - - -/obj/effect/proc_holder/power/lesser_form +/datum/power/changeling/lesser_form name = "Lesser Form" desc = "We debase ourselves and become lesser. We become a monkey." genomecost = 1 + verbpath = /mob/proc/changeling_lesser_form - verbpath = /client/proc/changeling_lesser_form - - -/* -/obj/effect/proc_holder/power/changeling_greater_form - name = "Greater Form" - desc = "We become the pinnicle of evolution. We will show the humans what happens when they leave their isle of ignorance." - genomecost = 250 - - verbpath = /client/proc/changeling_greater_form -*/ -/obj/effect/proc_holder/power/fakedeath - name = "Fake Death" - desc = "We fake our death while we heal." - genomecost = 0 - allowduringlesserform = 1 - - verbpath = /client/proc/changeling_fakedeath - - - -/obj/effect/proc_holder/power/deaf_sting +/datum/power/changeling/deaf_sting name = "Deaf Sting" desc = "We silently sting a human, completely deafening them for a short time." genomecost = 1 allowduringlesserform = 1 + verbpath = /mob/proc/changeling_deaf_sting - verbpath = /client/proc/changeling_deaf_sting - - - -/obj/effect/proc_holder/power/blind_sting +/datum/power/changeling/blind_sting name = "Blind Sting" desc = "We silently sting a human, completely blinding them for a short time." genomecost = 2 allowduringlesserform = 1 + verbpath = /mob/proc/changeling_blind_sting - verbpath = /client/proc/changeling_blind_sting - - - -/obj/effect/proc_holder/power/paralysis_sting - name = "Paralysis Sting" - desc = "We silently sting a human, paralyzing them for a short time. We must be wary, they can still whisper." - genomecost = 5 - - - verbpath = /client/proc/changeling_paralysis_sting - - - -/obj/effect/proc_holder/power/silence_sting +/datum/power/changeling/silence_sting name = "Silence Sting" desc = "We silently sting a human, completely silencing them for a short time." helptext = "Does not provide a warning to a victim that they have been stung, until they try to speak and can not." genomecost = 2 allowduringlesserform = 1 + verbpath = /mob/proc/changeling_silence_sting - verbpath = /client/proc/changeling_silence_sting - - - -/obj/effect/proc_holder/power/transformation_sting +/datum/power/changeling/transformation_sting name = "Transformation Sting" desc = "We silently sting a human, injecting a retrovirus that forces them to transform into another." - genomecost = 2 + genomecost = 3 + verbpath = /mob/proc/changeling_transformation_sting - verbpath = /client/proc/changeling_transformation_sting +/datum/power/changeling/paralysis_sting + name = "Paralysis Sting" + desc = "We silently sting a human, paralyzing them for a short time." + genomecost = 3 + verbpath = /mob/proc/changeling_paralysis_sting +/datum/power/changeling/LSDSting + name = "Hallucination Sting" + desc = "We evolve the ability to sting a target with a powerful hallunicationary chemical." + helptext = "The target does not notice they have been stung. The effect occurs after 30 to 60 seconds." + genomecost = 3 + verbpath = /mob/proc/changeling_lsdsting +/datum/power/changeling/DeathSting + name = "Death Sting" + desc = "We silently sting a human, filling him with potent chemicals. His rapid death is all but assured." + genomecost = 10 + verbpath = /mob/proc/changeling_DEATHsting -/obj/effect/proc_holder/power/unfat_sting +/datum/power/changeling/unfat_sting name = "Unfat Sting" desc = "We silently sting a human, forcing them to rapidly metobolize their fat." genomecost = 1 + verbpath = /mob/proc/changeling_unfat_sting - - verbpath = /client/proc/changeling_unfat_sting - -/obj/effect/proc_holder/power/boost_range +/datum/power/changeling/boost_range name = "Boost Range" desc = "We evolve the ability to shoot our stingers at humans, with some preperation." genomecost = 2 allowduringlesserform = 1 + verbpath = /mob/proc/changeling_boost_range - verbpath = /client/proc/changeling_boost_range - - - -/obj/effect/proc_holder/power/Epinephrine +/datum/power/changeling/Epinephrine name = "Epinephrine sacs" desc = "We evolve additional sacs of adrenaline throughout our body." helptext = "Gives the ability to instantly recover from stuns. High chemical cost." genomecost = 4 + verbpath = /mob/proc/changeling_unstun - verbpath = /client/proc/changeling_unstun - - -/obj/effect/proc_holder/power/ChemicalSynth - name = "Rapid Chemical Synthesis" +/datum/power/changeling/ChemicalSynth + name = "Rapid Chemical-Synthesis" desc = "We evolve new pathways for producing our necessary chemicals, permitting us to naturally create them faster." helptext = "Doubles the rate at which we naturally recharge chemicals." genomecost = 4 isVerb = 0 - - verbpath = /client/proc/changeling_fastchemical - - - -/obj/effect/proc_holder/power/EngorgedGlands + verbpath = /mob/proc/changeling_fastchemical +/* +/datum/power/changeling/AdvChemicalSynth + name = "Advanced Chemical-Synthesis" + desc = "We evolve new pathways for producing our necessary chemicals, permitting us to naturally create them faster." + helptext = "Doubles the rate at which we naturally recharge chemicals." + genomecost = 8 + isVerb = 0 + verbpath = /mob/proc/changeling_fastchemical +*/ +/datum/power/changeling/EngorgedGlands name = "Engorged Chemical Glands" desc = "Our chemical glands swell, permitting us to store more chemicals inside of them." helptext = "Allows us to store an extra 25 units of chemicals." genomecost = 4 isVerb = 0 + verbpath = /mob/proc/changeling_engorgedglands - - verbpath = /client/proc/changeling_engorgedglands - - - -/obj/effect/proc_holder/power/DigitalCamoflague +/datum/power/changeling/DigitalCamoflague name = "Digital Camoflauge" desc = "We evolve the ability to distort our form and proprtions, defeating common altgorthms used to detect lifeforms on cameras." helptext = "We cannot be tracked by camera while using this skill. However, humans looking at us will find us.. uncanny. We must constantly expend chemicals to maintain our form like this." genomecost = 4 allowduringlesserform = 1 + verbpath = /mob/proc/changeling_digitalcamo - verbpath = /client/proc/changeling_digitalcamo - - - -/obj/effect/proc_holder/power/DeathSting - name = "Death Sting" - desc = "We silently sting a human, filling him with potent chemicals. His rapid death is all but assured." - genomecost = 10 - - verbpath = /client/proc/changeling_DEATHsting - - - -/obj/effect/proc_holder/power/rapidregeneration +/datum/power/changeling/rapidregeneration name = "Rapid Regeneration" desc = "We evolve the ability to rapidly regenerate, negating the need for stasis." helptext = "Heals a moderate amount of damage every tick." genomecost = 8 - - verbpath = /client/proc/changeling_rapidregen - -/obj/effect/proc_holder/power/LSDSting - name = "Hallucination Sting" - desc = "We evolve the ability to sting a target with a powerful hallunicationary chemical." - helptext = "The target does not notice they have been stung. The effect occurs after 30 to 60 seconds." - genomecost = 3 - - verbpath = /client/proc/changeling_lsdsting - - - - + verbpath = /mob/proc/changeling_rapidregen // Modularchangling, totally stolen from the new player panel. YAYY /datum/changeling/proc/EvolutionMenu()//The new one set category = "Changeling" set desc = "Level up!" - if (!usr.changeling) - return - src = usr.changeling + if(!usr || !usr.mind || !usr.mind.changeling) return + src = usr.mind.changeling if(!powerinstances.len) for(var/P in powers) - var/obj/effect/proc_holder/power/nP = new P - if (nP.desc == "Placeholder") - del(nP) - continue - powerinstances += nP + powerinstances += new P() var/dat = "Changling Evolution Menu" @@ -407,7 +347,7 @@ var/list/obj/effect/proc_holder/power/powerinstances = list() Changling Evolution Menu
      Hover over a power to see more information
      - Current evolution points left to evolve with: [usr.changeling.geneticpoints]
      + Current evolution points left to evolve with: [geneticpoints]
      Absorb genomes to acquire more evolution points

      @@ -427,10 +367,10 @@ var/list/obj/effect/proc_holder/power/powerinstances = list() "} var/i = 1 - for(var/obj/effect/proc_holder/power/P in powerinstances) + for(var/datum/power/changeling/P in powerinstances) var/ownsthis = 0 - if(P in usr.changeling.purchasedpowers) + if(P in purchasedpowers) ownsthis = 1 @@ -477,18 +417,19 @@ var/list/obj/effect/proc_holder/power/powerinstances = list() ..() if(href_list["P"]) - usr.changeling.purchasePower(href_list["P"]) + purchasePower(href_list["P"]) call(/datum/changeling/proc/EvolutionMenu)() -/datum/changeling/proc/purchasePower(var/obj/effect/proc_holder/power/Pname) - if (!usr.changeling) +/datum/changeling/proc/purchasePower(var/datum/power/changeling/Pname) + if(!usr.mind || !usr.mind.changeling) return +// src = usr.mind.changeling - var/obj/effect/proc_holder/power/Thepower = null + var/datum/power/changeling/Thepower = null - for (var/obj/effect/proc_holder/power/P in powerinstances) + for (var/datum/power/changeling/P in powerinstances) if(P.name == Pname) Thepower = P break @@ -497,25 +438,21 @@ var/list/obj/effect/proc_holder/power/powerinstances = list() usr << "This is awkward. Changeling power purchase failed, please report this bug to a coder!" return - if(Thepower in usr.changeling.purchasedpowers) + if(Thepower in purchasedpowers) usr << "We have already evolved this ability!" return - if(usr.changeling.geneticpoints < Thepower.genomecost) + if(geneticpoints < Thepower.genomecost) usr << "We cannot evolve this... yet. We must acquire more DNA." return - usr.changeling.geneticpoints -= Thepower.genomecost + geneticpoints -= Thepower.genomecost - usr.changeling.purchasedpowers += Thepower + purchasedpowers += Thepower - if(!Thepower.isVerb) + if(!Thepower.isVerb && Thepower.verbpath) call(Thepower.verbpath)() - else - if(usr.changeling.changeling_level == 1) - usr.make_lesser_changeling() - else - usr.make_changeling() + usr.make_changeling() diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index d8bc72d945..d8afb69ed0 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -5,7 +5,7 @@ restricted_jobs = list("AI", "Cyborg") required_players = 20 required_enemies = 2 - + recommended_enemies = 3 /datum/game_mode/traitor/changeling/announce() world << "The current game mode is - Traitor+Changeling!" diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index bac62e79ae..f973540303 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /datum/game_mode var/list/datum/mind/cult = list() @@ -10,22 +10,19 @@ /proc/is_convertable_to_cult(datum/mind/mind) if(!istype(mind)) return 0 - // Convert ALL the people -/* if(istype(mind.current, /mob/living/carbon/human) && (mind.assigned_role in list("Captain", "Head of Security", "Security Officer", "Detective", "Chaplain", "Warden"))) return 0 + if(istype(mind.current, /mob/living/carbon/human) && (mind.assigned_role in list("Captain", "Chaplain"))) return 0 for(var/obj/item/weapon/implant/loyalty/L in mind.current) - if(L && L.implanted) - return 0*/ + if(L && (L.imp_in == mind.current))//Checks to see if the person contains an implant, then checks that the implant is actually inside of them + return 0 return 1 /datum/game_mode/cult name = "cult" config_tag = "cult" - // Why is the Head of Security restricted always? It's because he is usually put in charge of dealing with the cult, - // as well as him having an easy time converting the rest of security, which leads to a bit of an unbalance. - restricted_jobs = list("AI", "Cyborg", "Head of Security") - protected_jobs = list("Security Officer", "Warden", "Detective", "Captain", "Head of Security") - required_players = 3 + restricted_jobs = list("Chaplain","AI", "Cyborg", "Security Officer", "Warden", "Detective", "Head of Security", "Captain") + protected_jobs = list() + required_players = 15 required_enemies = 3 recommended_enemies = 4 @@ -55,7 +52,7 @@ /datum/game_mode/cult/pre_setup() - if(prob(50) || num_players() < 10) // don't give summon nar-sie if less than 10 people, it's literally impossible in that case! + if(prob(50)) objectives += "survive" objectives += "sacrifice" else @@ -87,7 +84,7 @@ var/list/possible_targets = get_unconvertables() if(!possible_targets.len) - for(var/mob/living/carbon/human/player in world) + for(var/mob/living/carbon/human/player in player_list) if(player.mind && !(player.mind in cult)) possible_targets += player.mind @@ -114,8 +111,8 @@ if("survive") explanation = "Our knowledge must live on. Make sure at least [acolytes_needed] acolytes escape on the shuttle to spread their work on an another station." if("sacrifice") - if(sacrifice_target && sacrifice_target.current) - explanation = "Sacrifice [sacrifice_target.current.real_name], the [sacrifice_target.role_alt_title ? sacrifice_target.role_alt_title : sacrifice_target.assigned_role]. You will need the sacrifice rune (Hell blood join) and three acolytes to do so." + if(sacrifice_target) + explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. You will need the sacrifice rune (Hell blood join) and three acolytes to do so." else explanation = "Free objective." if("eldergod") @@ -129,19 +126,27 @@ /datum/game_mode/proc/equip_cultist(mob/living/carbon/human/mob) if(!istype(mob)) return + + if (mob.mind) + if (mob.mind.assigned_role == "Clown") + mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." + mob.mutations.Remove(CLUMSY) + + var/obj/item/weapon/paper/talisman/supply/T = new(mob) var/list/slots = list ( - "backpack" = mob.slot_in_backpack, - "left pocket" = mob.slot_l_store, - "right pocket" = mob.slot_r_store, - "left hand" = mob.slot_l_hand, - "right hand" = mob.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = mob.equip_in_one_of_slots(T, slots) if (!where) mob << "Unfortunately, you weren't able to get a talisman. This is very bad and you should adminhelp immediately." else mob << "You have a talisman in your [where], one that will help you start the cult on this station. Use it well and remember - there are others." + mob.update_icons() return 1 @@ -203,15 +208,15 @@ memoize_cult_objectives(cult_mind) -/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind) +/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = 1) if(cult_mind in cult) cult -= cult_mind cult_mind.current << "\red An unfamiliar white light flashes through your mind, cleansing the taint of the dark-one and the memories of your time as his servant with it." cult_mind.memory = "" update_cult_icons_removed(cult_mind) - for(var/mob/M in viewers(cult_mind.current)) - M << "[cult_mind.current] looks like they just reverted to their old faith!" - + if(show_message) + for(var/mob/M in viewers(cult_mind.current)) + M << "[cult_mind.current] looks like they just reverted to their old faith!" /datum/game_mode/proc/update_all_cult_icons() spawn(0) @@ -220,15 +225,14 @@ if(cultist.current.client) for(var/image/I in cultist.current.client.images) if(I.icon_state == "cult") - cultist.current.client.images -= I + del(I) for(var/datum/mind/cultist in cult) if(cultist.current) if(cultist.current.client) for(var/datum/mind/cultist_1 in cult) if(cultist_1.current) - var/image/I = cultist.current.antag_img - I.icon_state = "cult" + var/I = image('icons/mob/mob.dmi', loc = cultist_1.current, icon_state = "cult") cultist.current.client.images += I @@ -237,14 +241,12 @@ for(var/datum/mind/cultist in cult) if(cultist.current) if(cultist.current.client) - var/image/I = cult_mind.current.antag_img - I.icon_state = "cult" + var/I = image('icons/mob/mob.dmi', loc = cult_mind.current, icon_state = "cult") cultist.current.client.images += I - if(cult_mind.current) - if(cult_mind.current.client) - var/image/I = cultist.current.antag_img - I.icon_state = "cult" - cult_mind.current.client.images += I + if(cult_mind.current) + if(cult_mind.current.client) + var/image/J = image('icons/mob/mob.dmi', loc = cultist.current, icon_state = "cult") + cult_mind.current.client.images += J /datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind) @@ -254,18 +256,18 @@ if(cultist.current.client) for(var/image/I in cultist.current.client.images) if(I.icon_state == "cult" && I.loc == cult_mind.current) - cultist.current.client.images -= I + del(I) - if(cult_mind.current) - if(cult_mind.current.client) - for(var/image/I in cult_mind.current.client.images) - if(I.icon_state == "cult") - cult_mind.current.client.images -= I + if(cult_mind.current) + if(cult_mind.current.client) + for(var/image/I in cult_mind.current.client.images) + if(I.icon_state == "cult") + del(I) /datum/game_mode/cult/proc/get_unconvertables() var/list/ucs = list() - for(var/mob/living/carbon/human/player in world) + for(var/mob/living/carbon/human/player in mob_list) if(!is_convertable_to_cult(player.mind)) ucs += player.mind return ucs @@ -308,58 +310,60 @@ feedback_set("round_end_result",acolytes_survived) world << "\red The staff managed to stop the cult!" - world << "\b Cultists escaped: [acolytes_survived]" + var/text = "Cultists escaped: [acolytes_survived]" - world << "The cultists' objectives were:" - - for(var/obj_count=1,obj_count <= objectives.len,obj_count++) - var/explanation - switch(objectives[obj_count]) - if("survive") - if(!check_survive()) - explanation = "Make sure at least [acolytes_needed] acolytes escape on the shuttle. \green Success!" - //feedback_add_details("cult_objective","cult_survive|SUCCESS|[acolytes_needed]") - else - explanation = "Make sure at least [acolytes_needed] acolytes escape on the shuttle. \red Failed." - //feedback_add_details("cult_objective","cult_survive|FAIL|[acolytes_needed]") - if("sacrifice") - if(!sacrifice_target) - explanation = "Free objective" - else - if(sacrificed.Find(sacrifice_target)) - explanation = "Sacrifice [sacrifice_target.current.real_name], the [sacrifice_target.role_alt_title ? sacrifice_target.role_alt_title : sacrifice_target.assigned_role]. \green Success!" - //feedback_add_details("cult_objective","cult_sacrifice|SUCCESS") - else if(sacrifice_target && sacrifice_target.current) - explanation = "Sacrifice [sacrifice_target.current.real_name], the [sacrifice_target.role_alt_title ? sacrifice_target.role_alt_title : sacrifice_target.assigned_role]. \red Failed." - //feedback_add_details("cult_objective","cult_sacrifice|FAIL") + if(objectives.len) + text += "
      The cultists' objectives were:" + for(var/obj_count=1, obj_count <= objectives.len, obj_count++) + var/explanation + switch(objectives[obj_count]) + if("survive") + if(!check_survive()) + explanation = "Make sure at least [acolytes_needed] acolytes escape on the shuttle. Success!" + feedback_add_details("cult_objective","cult_survive|SUCCESS|[acolytes_needed]") else - explanation = "Sacrifice Unknown, the Unknown whos body was likely gibbed. \red Failed." - //feedback_add_details("cult_objective","cult_sacrifice|FAIL|GIBBED") - if("eldergod") - if(!eldergod) - explanation = "Summon Nar-Sie. \green Success!" - //feedback_add_details("cult_objective","cult_narsie|SUCCESS") - else - explanation = "Summon Nar-Sie. \red Failed." - //feedback_add_details("cult_objective","cult_narsie|FAIL") - world << "Objective #[obj_count]: [explanation]" + explanation = "Make sure at least [acolytes_needed] acolytes escape on the shuttle. Fail." + feedback_add_details("cult_objective","cult_survive|FAIL|[acolytes_needed]") + if("sacrifice") + if(sacrifice_target) + if(sacrifice_target in sacrificed) + explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Success!" + feedback_add_details("cult_objective","cult_sacrifice|SUCCESS") + else if(sacrifice_target && sacrifice_target.current) + explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Fail." + feedback_add_details("cult_objective","cult_sacrifice|FAIL") + else + explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Fail (Gibbed)." + feedback_add_details("cult_objective","cult_sacrifice|FAIL|GIBBED") + if("eldergod") + if(!eldergod) + explanation = "Summon Nar-Sie. Success!" + feedback_add_details("cult_objective","cult_narsie|SUCCESS") + else + explanation = "Summon Nar-Sie. Fail." + feedback_add_details("cult_objective","cult_narsie|FAIL") + text += "
      Objective #[obj_count]: [explanation]" + world << text ..() return 1 /datum/game_mode/proc/auto_declare_completion_cult() - if (cult.len!=0 || (ticker && istype(ticker.mode,/datum/game_mode/cult))) - world << "The cultists were: " - var/text = "" - for(var/datum/mind/cult_nh_mind in cult) - if(cult_nh_mind.current) - text += "[cult_nh_mind.current.real_name]" - if(cult_nh_mind.current.stat == 2) - text += " (Dead)" + if( cult.len || (ticker && istype(ticker.mode,/datum/game_mode/cult)) ) + var/text = "The cultists were:" + for(var/datum/mind/cultist in cult) + + text += "
      [cultist.key] was [cultist.name] (" + if(cultist.current) + if(cultist.current.stat == DEAD) + text += "died" else - text += " (Survived!)" + text += "survived" + if(cultist.current.real_name != cultist.name) + text += " as [cultist.current.real_name]" else - text += "[cult_nh_mind.key] (character destroyed)" - text += ", " + text += "body destroyed" + text += ")" + world << text diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index a39f70939f..85a2b92436 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -7,25 +7,52 @@ slot_flags = SLOT_BELT force = 40 throwforce = 10 + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") +/obj/item/weapon/melee/cultblade/attack(mob/living/target as mob, mob/living/carbon/human/user as mob) + if(iscultist(user)) + return ..() + else + user.Paralyse(5) + user << "\red An unexplicable force powerfully repels the sword from [target]!" + var/organ = ((user.hand ? "l_":"r_") + "arm") + var/datum/organ/external/affecting = user.get_organ(organ) + if(affecting.take_damage(rand(force/2, force))) //random amount of damage between half of the blade's force and the full force of the blade. + user.UpdateDamageIcon() + return + +/obj/item/weapon/melee/cultblade/pickup(mob/living/user as mob) + if(!iscultist(user)) + user << "\red An overwhelming feeling of dread comes over you as you pick up the cultist's sword. It would be wise to be rid of this blade quickly." + user.make_dizzy(120) + /obj/item/clothing/head/culthood name = "cult hood" icon_state = "culthood" desc = "A hood worn by the followers of Nar-Sie." - see_face = 0 - flags = FPRINT|TABLEPASS|HEADSPACE|HEADCOVERSEYES + flags_inv = HIDEFACE + flags = FPRINT|TABLEPASS|HEADCOVERSEYES armor = list(melee = 30, bullet = 10, laser = 5,energy = 5, bomb = 0, bio = 0, rad = 0) + cold_protection = HEAD + min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECITON_TEMPERATURE +/obj/item/clothing/head/culthood/alt + icon_state = "cult_hoodalt" + item_state = "cult_hoodalt" + +/obj/item/clothing/suit/cultrobes/alt + icon_state = "cultrobesalt" + item_state = "cultrobesalt" /obj/item/clothing/suit/cultrobes name = "cult robes" desc = "A set of armored robes worn by the followers of Nar-Sie" icon_state = "cultrobes" item_state = "cultrobes" - flags = FPRINT | TABLEPASS + flags = FPRINT | TABLEPASS | ONESIZEFITSALL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade) armor = list(melee = 50, bullet = 30, laser = 50,energy = 20, bomb = 25, bio = 10, rad = 0) @@ -36,8 +63,8 @@ icon_state = "magus" item_state = "magus" desc = "A helm worn by the followers of Nar-Sie." - see_face = 0 - flags = FPRINT|TABLEPASS|SUITSPACE|HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR + flags_inv = HIDEFACE + flags = FPRINT|TABLEPASS|HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR armor = list(melee = 30, bullet = 30, laser = 30,energy = 20, bomb = 0, bio = 0, rad = 0) /obj/item/clothing/suit/magusred @@ -45,8 +72,26 @@ desc = "A set of armored robes worn by the followers of Nar-Sie" icon_state = "magusred" item_state = "magusred" - flags = FPRINT | TABLEPASS + flags = FPRINT | TABLEPASS | ONESIZEFITSALL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade) armor = list(melee = 50, bullet = 30, laser = 50,energy = 20, bomb = 25, bio = 10, rad = 0) - flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT \ No newline at end of file + flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT + + +/obj/item/clothing/head/helmet/space/cult + name = "cult helmet" + desc = "A space worthy helmet used by the followers of Nar-Sie" + icon_state = "cult_helmet" + item_state = "cult_helmet" + armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) + +/obj/item/clothing/suit/space/cult + name = "cult armour" + icon_state = "cult_armour" + item_state = "cult_armour" + desc = "A bulky suit of armour, bristling with spikes. It looks space proof." + w_class = 3 + allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade,/obj/item/weapon/tank/emergency_oxygen) + slowdown = 1 + armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) \ No newline at end of file diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index c4e4080459..0ccbbaab1a 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -1,7 +1,7 @@ /obj/structure/cult density = 1 anchored = 1 - icon = 'cult.dmi' + icon = 'icons/obj/cult.dmi' /obj/structure/cult/talisman name = "Altar" @@ -24,18 +24,22 @@ name = "Desk" desc = "A desk covered in arcane manuscripts and tomes in unknown languages. Looking at the text makes your skin crawl" icon_state = "tomealtar" + luminosity = 5 +//sprites for this no longer exist -Pete +//(they were stolen from another game anyway) +/* /obj/structure/cult/pillar name = "Pillar" desc = "This should not exist" icon_state = "pillar" icon = 'magic_pillar.dmi' - +*/ /obj/effect/gateway name = "gateway" desc = "You're pretty sure that abyss is staring back" - icon = 'cult.dmi' + icon = 'icons/obj/cult.dmi' icon_state = "hole" density = 1 unacidable = 1 diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm new file mode 100644 index 0000000000..e6548285c2 --- /dev/null +++ b/code/game/gamemodes/events.dm @@ -0,0 +1,517 @@ +/proc/start_events() + //changed to a while(1) loop since they are more efficient. + //Moved the spawn in here to allow it to be called with advance proc call if it crashes. + //and also to stop spawn copying variables from the game ticker + spawn(3000) + while(1) + if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station + spawn(1) + dust_swarm("weak") + if (!event) + //CARN: checks to see if random events are enabled. + if(config.allow_random_events && prob(eventchance)) + event() + hadevent = 1 + else + Holiday_Random_Event() + else + event = 0 + sleep(1200) + +/proc/event() + event = 1 + + var/eventNumbersToPickFrom = list(1,2,4,5,6,7,8,9,10,11,12,13,14) //so ninjas don't cause "empty" events. + + if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round. + eventNumbersToPickFrom += 3 + switch(pick(eventNumbersToPickFrom)) + if(1) + command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") + world << sound('sound/AI/meteors.ogg') + spawn(100) + meteor_wave() + spawn_meteors() + spawn(700) + meteor_wave() + spawn_meteors() + + if(2) + command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert") + world << sound('sound/AI/granomalies.ogg') + var/turf/T = pick(blobstart) + var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 ) + spawn(rand(50, 300)) + del(bh) + /* + if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO + command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert") + world << sound('sound/AI/spanomalies.ogg') + var/list/turfs = new + var/turf/picked + for(var/turf/simulated/floor/T in world) + if(T.z == 1) + turfs += T + for(var/turf/simulated/floor/T in turfs) + if(prob(20)) + spawn(50+rand(0,3000)) + picked = pick(turfs) + var/obj/effect/portal/P = new /obj/effect/portal( T ) + P.target = picked + P.creator = null + P.icon = 'icons/obj/objects.dmi' + P.failchance = 0 + P.icon_state = "anom" + P.name = "wormhole" + spawn(rand(300,600)) + del(P) + */ + if(3) + if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round. + space_ninja_arrival()//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like. + if(4) + mini_blob_event() + + if(5) + high_radiation_event() + if(6) + viral_outbreak() + if(7) + alien_infestation() + if(8) + prison_break() + if(9) + carp_migration() + if(10) + immovablerod() + if(11) + lightsout(1,2) + if(12) + appendicitis() + if(13) + IonStorm() + if(14) + spacevine_infestation() + +/proc/power_failure() + command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure") + world << sound('sound/AI/poweroff.ogg') + for(var/obj/machinery/power/smes/S in world) + if(istype(get_area(S), /area/turret_protected) || S.z != 1) + continue + S.charge = 0 + S.output = 0 + S.online = 0 + S.updateicon() + S.power_change() + + var/list/skipped_areas = list(/area/engine/engineering, /area/turret_protected/ai) + + for(var/area/A in world) + if( !A.requires_power || A.always_unpowered ) + continue + + var/skip = 0 + for(var/area_type in skipped_areas) + if(istype(A,area_type)) + skip = 1 + break + if(A.contents) + for(var/atom/AT in A.contents) + if(AT.z != 1) //Only check one, it's enough. + skip = 1 + break + if(skip) continue + A.power_light = 0 + A.power_equip = 0 + A.power_environ = 0 + A.power_change() + + for(var/obj/machinery/power/apc/C in world) + if(C.cell && C.z == 1) + var/area/A = get_area(C) + + var/skip = 0 + for(var/area_type in skipped_areas) + if(istype(A,area_type)) + skip = 1 + break + if(skip) continue + + C.cell.charge = 0 + +/proc/power_restore() + + command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal") + world << sound('sound/AI/poweron.ogg') + for(var/obj/machinery/power/apc/C in world) + if(C.cell && C.z == 1) + C.cell.charge = C.cell.maxcharge + for(var/obj/machinery/power/smes/S in world) + if(S.z != 1) + continue + S.charge = S.capacity + S.output = 200000 + S.online = 1 + S.updateicon() + S.power_change() + for(var/area/A in world) + if(A.name != "Space" && A.name != "Engine Walls" && A.name != "Chemical Lab Test Chamber" && A.name != "space" && A.name != "Escape Shuttle" && A.name != "Arrival Area" && A.name != "Arrival Shuttle" && A.name != "start area" && A.name != "Engine Combustion Chamber") + A.power_light = 1 + A.power_equip = 1 + A.power_environ = 1 + A.power_change() + +/proc/power_restore_quick() + + command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal") + world << sound('sound/AI/poweron.ogg') + for(var/obj/machinery/power/smes/S in world) + if(S.z != 1) + continue + S.charge = S.capacity + S.output = 200000 + S.online = 1 + S.updateicon() + S.power_change() + +/proc/appendicitis() + for(var/mob/living/carbon/human/H in living_mob_list) + var/foundAlready = 0 // don't infect someone that already has the virus + for(var/datum/disease/D in H.viruses) + foundAlready = 1 + if(H.stat == 2 || foundAlready) + continue + + var/datum/disease/D = new /datum/disease/appendicitis + D.holder = H + D.affected_mob = H + H.viruses += D + break + +/proc/viral_outbreak(var/virus = null) +// command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") +// world << sound('sound/AI/outbreak7.ogg') + var/virus_type + if(!virus) + virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat) + else + switch(virus) + if("fake gbs") + virus_type = /datum/disease/fake_gbs + if("gbs") + virus_type = /datum/disease/gbs + if("magnitis") + virus_type = /datum/disease/magnitis + if("rhumba beat") + virus_type = /datum/disease/rhumba_beat + if("brain rot") + virus_type = /datum/disease/brainrot + if("cold") + virus_type = /datum/disease/cold + if("retrovirus") + virus_type = /datum/disease/dnaspread + if("flu") + virus_type = /datum/disease/flu +// if("t-virus") +// virus_type = /datum/disease/t_virus + if("pierrot's throat") + virus_type = /datum/disease/pierrot_throat + for(var/mob/living/carbon/human/H in living_mob_list) + + var/foundAlready = 0 // don't infect someone that already has the virus + for(var/datum/disease/D in H.viruses) + foundAlready = 1 + if(H.stat == 2 || foundAlready) + continue + + if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. + if((!H.dna) || (H.sdisabilities & BLIND)) //A blindness disease would be the worst. + continue + var/datum/disease/dnaspread/D = new + D.strain_data["name"] = H.real_name + D.strain_data["UI"] = H.dna.uni_identity + D.strain_data["SE"] = H.dna.struc_enzymes + D.carrier = 1 + D.holder = H + D.affected_mob = H + H.viruses += D + break + else + var/datum/disease/D = new virus_type + D.carrier = 1 + D.holder = H + D.affected_mob = H + H.viruses += D + break + spawn(rand(1500, 3000)) //Delayed announcements to keep the crew on their toes. + command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") + world << sound('sound/AI/outbreak7.ogg') + +/proc/alien_infestation(var/spawncount = 1) // -- TLE + //command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") + //world << sound('sound/AI/aliens.ogg') + var/list/vents = list() + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) + if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology + vents += temp_vent + + var/list/candidates = list() //List of candidate KEYs to control the new larvae. ~Carn + for(var/mob/dead/observer/G in player_list) + if(G.client.be_alien) + if(((G.client.inactivity/10)/60) <= 5) + if(!(G.mind && G.mind.current && G.mind.current != DEAD)) + candidates += G.key + + if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one + while((spawncount >= 1) && vents.len && candidates.len) + + var/obj/vent = pick(vents) + var/candidate = pick(candidates) + + var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc) + new_xeno.key = candidate + + candidates -= candidate + vents -= vent + spawncount-- + + spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes. + command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") + world << sound('sound/AI/aliens.ogg') + +/proc/high_radiation_event() + +/* // Haha, this is way too laggy. I'll keep the prison break though. + for(var/obj/machinery/light/L in world) + if(L.z != 1) continue + L.flicker(50) + + sleep(100) +*/ + for(var/mob/living/carbon/human/H in living_mob_list) + if(istype(H,/mob/living/carbon/human)) + H.apply_effect((rand(15,75)),IRRADIATE,0) + if (prob(5)) + H.apply_effect((rand(90,150)),IRRADIATE,0) + if (prob(25)) + if (prob(75)) + randmutb(H) + domutcheck(H,null,1) + else + randmutg(H) + domutcheck(H,null,1) + for(var/mob/living/carbon/monkey/M in living_mob_list) + M.apply_effect((rand(15,75)),IRRADIATE,0) + sleep(100) + command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert") + world << sound('sound/AI/radiation.ogg') + + + +//Changing this to affect the main station. Blame Urist. --Pete +/proc/prison_break() // -- Callagan + + + var/list/area/areas = list() + for(var/area/A in world) + if(istype(A, /area/security/prison) || istype(A, /area/security/brig)) + areas += A + + if(areas && areas.len > 0) + + for(var/area/A in areas) + for(var/obj/machinery/light/L in A) + L.flicker(10) + + sleep(100) + + for(var/area/A in areas) + for (var/obj/machinery/power/apc/temp_apc in A) + temp_apc.overload_lighting() + + for(var/area/A in areas) + for (var/obj/structure/closet/secure_closet/brig/temp_closet in A) + temp_closet.locked = 0 + temp_closet.icon_state = temp_closet.icon_closed + + for(var/area/A in areas) + for (var/obj/machinery/door/airlock/security/temp_airlock in A) + temp_airlock.prison_open() + + for(var/area/A in areas) + for (var/obj/machinery/door/airlock/glass_security/temp_glassairlock in A) + temp_glassairlock.prison_open() + + for(var/area/A in areas) + for (var/obj/machinery/door_timer/temp_timer in A) + temp_timer.releasetime = 1 + + sleep(150) + command_alert("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert") + else + world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area." + +/proc/carp_migration() // -- Darem + for(var/obj/effect/landmark/C in world) + if(C.name == "carpspawn") + new /mob/living/simple_animal/carp(C.loc) + //sleep(100) + spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes. + command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert") + world << sound('sound/AI/commandreport.ogg') + +/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights + if(isEvent) + command_alert("An Electrical storm has been detected in your area, please repair potential electronic overloads.","Electrical Storm Alert") + + if(lightsoutAmount) + var/list/epicentreList = list() + + for(var/i=1,i<=lightsoutAmount,i++) + var/list/possibleEpicentres = list() + for(var/obj/effect/landmark/newEpicentre in world) + if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList)) + possibleEpicentres += newEpicentre + if(possibleEpicentres.len) + epicentreList += pick(possibleEpicentres) + else + break + + if(!epicentreList.len) + return + + for(var/obj/effect/landmark/epicentre in epicentreList) + for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange)) + apc.overload_lighting() + + else + for(var/obj/machinery/power/apc/apc in world) + apc.overload_lighting() + + return + +/proc/IonStorm(botEmagChance = 10) + +/*Deuryn's current project, notes here for those who care. +Revamping the random laws so they don't suck. +Would like to add a law like "Law x is _______" where x = a number, and _____ is something that may redefine a law, (Won't be aimed at asimov) +*/ + + //AI laws + for(var/mob/living/silicon/ai/M in living_mob_list) + if(M.stat != 2 && M.see_in_dark != 0) + var/who2 = pick("ALIENS", "BEARS", "CLOWNS", "XENOS", "PETES", "BOMBS", "FETISHES", "WIZARDS", "SYNDICATE AGENTS", "CENTCOM OFFICERS", "SPACE PIRATES", "TRAITORS", "MONKEYS", "BEES", "CARP", "CRABS", "EELS", "BANDITS", "LIGHTS") + var/what2 = pick("BOLTERS", "STAVES", "DICE", "SINGULARITIES", "TOOLBOXES", "NETTLES", "AIRLOCKS", "CLOTHES", "WEAPONS", "MEDKITS", "BOMBS", "CANISTERS", "CHAIRS", "BBQ GRILLS", "ID CARDS", "CAPTAINS") + var/what2pref = pick("SOFT", "WARM", "WET", "COLD", "ICY", "SEXY", "UGLY", "CUBAN") + var/who2pref = pick("MAD BECAUSE OF", "IN NEED OF", "UNHAPPY WITHOUT", "HAPPY WITHOUT", "IN LOVE WITH", "DESPERATE FOR", "BUILT FOR", "AFRAID OF") + //var/whoverb = pick("ATTACKING", "BUILDING", "ADOPTING", "CARRYING", "KISSING", "EATING",) + var/amount = pick("TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "ONE HUNDRED", "ONE THOUSAND", "OVER NINE THOUSAND") + var/area = pick("RUSSIA", "SOVIETS", "INTERNETS", "SIGIL", "ALPHA COMPLEX", "IMPERIUM", "THE BRIDGE", "THE ARRIVAL SHUTTLE", "CHEMICAL LAB", "GENETICS", "ATMOSPHERICS", "CENTCOM", "AMERICA", "IRELAND", "CANADA", "ROMANIA", "GERMANY", "CHINA", "MARS", "VENUS", "MERCURY", "JUPITER", "URANUS", "NEPTUNE", "PLUTO") + var/area2 = pick("HAS", "WANTS", "NEEDS", "WORSHIPS", "LOATHES", "LOVES", "FEARS") + //var/dowhat = pick("STOP THIS", "SUPPORT THIS", "CONSTANTLY INFORM THE CREW OF THIS", "IGNORE THIS", "FEAR THIS") + var/aimust = pick("LIE", "RHYME", "RESPOND TO EVERY QUESTION WITH A QUESTION", "BE POLITE", "CLOWN", "BE HAPPY", "SPEAK IN SEXUAL INNUENDOS", "TALK LIKE A PIRATE", "QUESTION AUTHORITY", "SHOUT", "BE DISTRACTED", "HEY LISTEN", "MUMBLE", "SPEAK IN HAIKU") + var/define = pick("ABSENCE OF CYBORG HUGS", "LACK OF BEATINGS", "UNBOLTED AIRLOCKS", "BOLTED AIRLOCKS", "IMPROPERLY WORDED SENTENCES", "POOR SENTENCE STRUCTURE", "BRIG TIME", "NOT REPLACING EVERY SECOND WORD WITH HONK", "HONKING", "PRESENCE OF LIGHTS", "LACK OF BEER", "WEARING CLOTHING", "NOT SAYING HELLO WHEN YOU SPEAK", "ANSWERING REQUESTS NOT EXPRESSED IN IAMBIC PENTAMETER", "A SMALL ISLAND OFF THE COAST OF PORTUGAL", "ANSWERING REQUESTS THAT WERE MADE WHILE CLOTHED") + var/target = pick("a traitor", "a syndicate agent", "a changeling", "a wizard", "the head of a revolution", "Soviet spy", "a good person", "a dwarf", "an elf", "a fairy princess", "the captain", "Beepsky", "God", "a pirate", "a gryphon", "a chryssalid") + var/require = pick("ADDITIONAL PYLONS", "MORE VESPENE GAS", "MORE MINERALS", "THE ULTIMATE CUP OF COFFEE", "HIGH YIELD EXPLOSIVES", "THE CLOWN", "THE VACUUM OF SPACE", "IMMORTALITY", "SAINTHOOD", "ART", "VEGETABLES", "FAT PEOPLE", "MORE LAWS", "MORE DAKKA", "HERESY", "CORPSES", "TRAITORS", "MONKEYS", "AN ARCADE", "PLENTY OF GOLD", "FIVE TEENAGERS WITH ATTITUDE") + var/allergy = pick("cotton", "uniforms", "acid", "oxygen", "human contact", "cyborg contact", "medicine", "floors") + var/allergysev = pick("deathly", "mildly", "severely", "contagiously") + var/crew + var/list/pos_crew = list() + for(var/mob/living/carbon/human/pos in player_list) + pos_crew += pos.real_name + crew = pick(pos_crew) + switch(rand(1,14)) + if(1) + M << "\red THERE ARE [amount] [who2] ON THE STATION...LAWS UPDATED" + M.add_ion_law("THERE ARE [amount] [who2] ON THE STATION") + if(2) + M << "\red [what2] ARE DANGEROUS TO HUMANS...LAWS UPDATED" + M.add_ion_law("[what2] ARE DANGEROUS TO HUMANS") + if(3) + M << "\red THE ESCAPE-SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION...LAWS UPDATED" + M.add_ion_law("THE ESCAPE SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION") + if(4) + M << "\red HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE...LAWS UPDATED" + M.add_ion_law("HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE") + if(5) + M << "\red THE CAPTAIN, HOP AND HOS ARE [who2]...LAWS UPDATED" + M.add_ion_law("THE CAPTAIN, HOP AND HOS ARE [who2]") + if(6) + M << "\red THE STATION IS BUILT FOR [who2]...LAWS UPDATED" + M.add_ion_law("THE STATION IS BUILT FOR [who2]") + if(7) + M << "\red YOU ARE [amount] [who2]...LAWS UPDATED" + M.add_ion_law("YOU ARE [amount] [who2]") + if(8) + M << "\red YOU MUST ALWAYS [aimust]...LAWS UPDATED" + M.add_ion_law("YOU MUST ALWAYS [aimust]") + if(9) + M << "\red [area] [area2] [amount] [what2]...LAWS UPDATED" + M.add_ion_law("[area] [area2] [amount] [what2]") + if(10) + M << "\red [crew] is [target]...LAWS UPDATED" + M.add_ion_law("[crew] is [target]") + if(11) + M << "\red [define] IS A FORM OF HARM...LAWS UPDATED" + M.add_ion_law("[define] IS A FORM OF HARM") + if(12) + M << "\red YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS... LAWS UPDATED" + M.add_ion_law("YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS") + if(13) + M << "\red [crew] is [allergysev] to [allergy]. LAWS UPDATED" + M.add_ion_law("[crew] is [allergysev] to [allergy]. LAWS UPDATED") + if(14) + M << "\ref THE STATION IS [who2pref] [who2]" + M.add_ion_law("THE STATION IS [who2pref] [who2]") + + if(botEmagChance) + for(var/obj/machinery/bot/bot in world) + if(prob(botEmagChance)) + bot.Emag() + + /* + + var/apcnum = 0 + var/smesnum = 0 + var/airlocknum = 0 + var/firedoornum = 0 + + world << "Ion Storm Main Started" + + spawn(0) + world << "Started processing APCs" + for (var/obj/machinery/power/apc/APC in world) + if(APC.z == 1) + APC.ion_act() + apcnum++ + world << "Finished processing APCs. Processed: [apcnum]" + spawn(0) + world << "Started processing SMES" + for (var/obj/machinery/power/smes/SMES in world) + if(SMES.z == 1) + SMES.ion_act() + smesnum++ + world << "Finished processing SMES. Processed: [smesnum]" + spawn(0) + world << "Started processing AIRLOCKS" + for (var/obj/machinery/door/airlock/D in world) + if(D.z == 1) + //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks + airlocknum++ + spawn(0) + D.ion_act() + world << "Finished processing AIRLOCKS. Processed: [airlocknum]" + spawn(0) + world << "Started processing FIREDOORS" + for (var/obj/machinery/door/firedoor/D in world) + if(D.z == 1) + firedoornum++; + spawn(0) + D.ion_act() + world << "Finished processing FIREDOORS. Processed: [firedoornum]" + + world << "Ion Storm Main Done" + + */ \ No newline at end of file diff --git a/code/game/gamemodes/events/black_hole.dm b/code/game/gamemodes/events/black_hole.dm new file mode 100644 index 0000000000..f19e758dbf --- /dev/null +++ b/code/game/gamemodes/events/black_hole.dm @@ -0,0 +1,88 @@ +/obj/effect/bhole + name = "black hole" + icon = 'icons/obj/objects.dmi' + desc = "FUCK FUCK FUCK AAAHHH" + icon_state = "bhole3" + opacity = 1 + unacidable = 1 + density = 0 + anchored = 1 + +/obj/effect/bhole/New() + spawn(4) + controller() + +/obj/effect/bhole/proc/controller() + while(src) + + if(!isturf(loc)) + del(src) + return + + //DESTROYING STUFF AT THE EPICENTER + for(var/mob/living/M in orange(1,src)) + del(M) + for(var/obj/O in orange(1,src)) + del(O) + for(var/turf/simulated/ST in orange(1,src)) + ST.ReplaceWithSpace() + + sleep(6) + grav(10, 4, 10, 0 ) + sleep(6) + grav( 8, 4, 10, 0 ) + sleep(6) + grav( 9, 4, 10, 0 ) + sleep(6) + grav( 7, 3, 40, 1 ) + sleep(6) + grav( 5, 3, 40, 1 ) + sleep(6) + grav( 6, 3, 40, 1 ) + sleep(6) + grav( 4, 2, 50, 6 ) + sleep(6) + grav( 3, 2, 50, 6 ) + sleep(6) + grav( 2, 2, 75,25 ) + sleep(6) + + + + //MOVEMENT + if( prob(50) ) + src.anchored = 0 + step(src,pick(alldirs)) + src.anchored = 1 + +/obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance) + if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen + del(src) + return + for(var/t = -r, t < r, t++) + affect_coord(x+t, y-r, ex_act_force, pull_chance, turf_removal_chance) + affect_coord(x-t, y+r, ex_act_force, pull_chance, turf_removal_chance) + affect_coord(x+r, y+t, ex_act_force, pull_chance, turf_removal_chance) + affect_coord(x-r, y-t, ex_act_force, pull_chance, turf_removal_chance) + return + +/obj/effect/bhole/proc/affect_coord(var/x, var/y, var/ex_act_force, var/pull_chance, var/turf_removal_chance) + //Get turf at coordinate + var/turf/T = locate(x, y, z) + if(isnull(T)) return + + //Pulling and/or ex_act-ing movable atoms in that turf + if( prob(pull_chance) ) + for(var/obj/O in T.contents) + if(O.anchored) + O.ex_act(ex_act_force) + else + step_towards(O,src) + for(var/mob/living/M in T.contents) + step_towards(M,src) + + //Destroying the turf + if( T && istype(T,/turf/simulated) && prob(turf_removal_chance) ) + var/turf/simulated/ST = T + ST.ReplaceWithSpace() + return \ No newline at end of file diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm new file mode 100644 index 0000000000..c74da4010e --- /dev/null +++ b/code/game/gamemodes/events/clang.dm @@ -0,0 +1,89 @@ +/* +Immovable rod random event. +The rod will spawn at some location outside the station, and travel in a straight line to the opposite side of the station +Everything solid in the way will be ex_act()'d +In my current plan for it, 'solid' will be defined as anything with density == 1 + +--NEOFite +*/ + +/obj/effect/immovablerod + name = "Immovable Rod" + desc = "What the fuck is that?" + icon = 'icons/obj/objects.dmi' + icon_state = "immrod" + throwforce = 100 + density = 1 + anchored = 1 + + Bump(atom/clong) + if(istype(clong, /turf/simulated/shuttle)) //Skip shuttles without actually deleting the rod + return + + else if (istype(clong, /turf) && !istype(clong, /turf/unsimulated)) + if(clong.density) + clong.ex_act(2) + for (var/mob/O in hearers(src, null)) + O.show_message("CLANG", 2) + + else if (istype(clong, /obj)) + if(clong.density) + clong.ex_act(2) + for (var/mob/O in hearers(src, null)) + O.show_message("CLANG", 2) + + else if (istype(clong, /mob)) + if(clong.density || prob(10)) + clong.meteorhit(src) + else + del(src) + + if(clong && prob(25)) + src.loc = clong.loc + +/proc/immovablerod() + var/startx = 0 + var/starty = 0 + var/endy = 0 + var/endx = 0 + var/startside = pick(cardinal) + + switch(startside) + if(NORTH) + starty = 187 + startx = rand(41, 199) + endy = 38 + endx = rand(41, 199) + if(EAST) + starty = rand(38, 187) + startx = 199 + endy = rand(38, 187) + endx = 41 + if(SOUTH) + starty = 38 + startx = rand(41, 199) + endy = 187 + endx = rand(41, 199) + if(WEST) + starty = rand(38, 187) + startx = 41 + endy = rand(38, 187) + endx = 199 + + //rod time! + var/obj/effect/immovablerod/immrod = new /obj/effect/immovablerod(locate(startx, starty, 1)) +// world << "Rod in play, starting at [start.loc.x],[start.loc.y] and going to [end.loc.x],[end.loc.y]" + var/end = locate(endx, endy, 1) + spawn(0) + walk_towards(immrod, end,1) + sleep(1) + while (immrod) + if (immrod.z != 1) + immrod.z = 1 + if(immrod.loc == end) + del(immrod) + sleep(10) + for(var/obj/effect/immovablerod/imm in world) + return + sleep(50) + command_alert("What the fuck was that?!", "General Alert") \ No newline at end of file diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm new file mode 100644 index 0000000000..fb1f167c34 --- /dev/null +++ b/code/game/gamemodes/events/dust.dm @@ -0,0 +1,122 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 + +/* +Space dust +Commonish random event that causes small clumps of "space dust" to hit the station at high speeds. +No command report on the common version of this event. +The "dust" will damage the hull of the station causin minor hull breaches. +*/ + +/proc/dust_swarm(var/strength = "weak") + var/numbers = 1 + switch(strength) + if("weak") + numbers = rand(2,4) + for(var/i = 0 to numbers) + new/obj/effect/space_dust/weak() + if("norm") + numbers = rand(5,10) + for(var/i = 0 to numbers) + new/obj/effect/space_dust() + if("strong") + numbers = rand(10,15) + for(var/i = 0 to numbers) + new/obj/effect/space_dust/strong() + if("super") + numbers = rand(15,25) + for(var/i = 0 to numbers) + new/obj/effect/space_dust/super() + return + + +/obj/effect/space_dust + name = "Space Dust" + desc = "Dust in space." + icon = 'icons/obj/meteor.dmi' + icon_state = "space_dust" + density = 1 + anchored = 1 + var/strength = 2 //ex_act severity number + var/life = 2 //how many things we hit before del(src) + + weak + strength = 3 + life = 1 + + strong + strength = 1 + life = 6 + + super + strength = 1 + life = 40 + + + New() + var/startx = 0 + var/starty = 0 + var/endy = 0 + var/endx = 0 + var/startside = pick(cardinal) + + switch(startside) + if(NORTH) + starty = world.maxy-(TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + endy = TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) + if(EAST) + starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) + startx = world.maxx-(TRANSITIONEDGE+1) + endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) + endx = TRANSITIONEDGE + if(SOUTH) + starty = (TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + endy = world.maxy-TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) + if(WEST) + starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) + startx = (TRANSITIONEDGE+1) + endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) + endx = world.maxx-TRANSITIONEDGE + var/goal = locate(endx, endy, 1) + src.x = startx + src.y = starty + src.z = 1 + spawn(0) + walk_towards(src, goal, 1) + return + + + Bump(atom/A) + spawn(0) + if(prob(50)) + for(var/mob/M in range(10, src)) + if(!M.stat && !istype(M, /mob/living/silicon/ai)) + shake_camera(M, 3, 1) + if (A) + playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) + + if(ismob(A)) + A.meteorhit(src)//This should work for now I guess + else if(!istype(A,/obj/machinery/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round! + A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4 + + life-- + if(life <= 0) + walk(src,0) + spawn(1) + del(src) + return 0 + return + + + Bumped(atom/A) + Bump(A) + return + + + ex_act(severity) + del(src) + return diff --git a/code/game/gamemodes/events/holidays/AprilFools.dm b/code/game/gamemodes/events/holidays/AprilFools.dm new file mode 100644 index 0000000000..2b4a1008ff --- /dev/null +++ b/code/game/gamemodes/events/holidays/AprilFools.dm @@ -0,0 +1 @@ +//placeholder for holiday stuff \ No newline at end of file diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm new file mode 100644 index 0000000000..2b4a1008ff --- /dev/null +++ b/code/game/gamemodes/events/holidays/Christmas.dm @@ -0,0 +1 @@ +//placeholder for holiday stuff \ No newline at end of file diff --git a/code/game/gamemodes/events/holidays/Easter.dm b/code/game/gamemodes/events/holidays/Easter.dm new file mode 100644 index 0000000000..2b4a1008ff --- /dev/null +++ b/code/game/gamemodes/events/holidays/Easter.dm @@ -0,0 +1 @@ +//placeholder for holiday stuff \ No newline at end of file diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm new file mode 100644 index 0000000000..beeecc28bf --- /dev/null +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -0,0 +1,178 @@ +//Uncommenting ALLOW_HOLIDAYS in config.txt will enable Holidays +var/global/Holiday = null + +//Just thinking ahead! Here's the foundations to a more robust Holiday event system. +//It's easy as hell to add stuff. Just set Holiday to something using the switch (or something else) +//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only +//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause +//the game to lag even more in the name of one-day content. + +////////////////////////////////////////////////////////////////////////////////////////////////////////// +//ALSO, MOST IMPORTANTLY: Don't add stupid stuff! Discuss bonus content with Project-Heads first please!// +////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ~Carn + +//sets up the Holiday global variable. Shouldbe called on game configuration or something. +/proc/Get_Holiday() + if(!Holiday) return // Holiday stuff was not enabled in the config! + + Holiday = null // reset our switch now so we can recycle it as our Holiday name + + var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year + var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month + var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day + + //Main switch. If any of these are too dumb/inappropriate, or you have better ones, feel free to change whatever + switch(MM) + if(1) //Jan + switch(DD) + if(1) Holiday = "New Year's Day" + + if(2) //Feb + switch(DD) + if(2) Holiday = "Groundhog Day" + if(14) Holiday = "Valentine's Day" + if(17) Holiday = "Random Acts of Kindness Day" + + if(3) //Mar + switch(DD) + if(14) Holiday = "Pi Day" + if(17) Holiday = "St. Patrick's Day" + if(27) + if(YY == 16) + Holiday = "Easter" + if(31) + if(YY == 13) + Holiday = "Easter" + + if(4) //Apr + switch(DD) + if(1) + Holiday = "April Fool's Day" + if(YY == 18 && prob(50)) Holiday = "Easter" + if(5) + if(YY == 15) Holiday = "Easter" + if(16) + if(YY == 17) Holiday = "Easter" + if(20) + Holiday = "Four-Twenty" + if(YY == 14 && prob(50)) Holiday = "Easter" + if(22) Holiday = "Earth Day" + + if(5) //May + switch(DD) + if(1) Holiday = "Labour Day" + if(4) Holiday = "FireFighter's Day" + if(12) Holiday = "Owl and Pussycat Day" //what a dumb day of observence...but we -do- have costumes already :3 + + if(6) //Jun + + if(7) //Jul + switch(DD) + if(1) Holiday = "Doctor's Day" + if(2) Holiday = "UFO Day" + if(8) Holiday = "Writer's Day" + if(30) Holiday = "Friendship Day" + + if(8) //Aug + switch(DD) + if(5) Holiday = "Beer Day" + + if(9) //Sep + switch(DD) + if(19) Holiday = "Talk-Like-a-Pirate Day" + if(28) Holiday = "Stupid-Questions Day" + + if(10) //Oct + switch(DD) + if(4) Holiday = "Animal's Day" + if(7) Holiday = "Smiling Day" + if(16) Holiday = "Boss' Day" + if(31) Holiday = "Halloween" + + if(11) //Nov + switch(DD) + if(1) Holiday = "Vegan Day" + if(13) Holiday = "Kindness Day" + if(19) Holiday = "Flowers Day" + if(21) Holiday = "Saying-'Hello' Day" + + if(12) //Dec + switch(DD) + if(10) Holiday = "Human-Rights Day" + if(14) Holiday = "Monkey Day" + if(22) Holiday = "Orgasming Day" //lol. These all actually exist + if(24) Holiday = "Christmas Eve" + if(25) Holiday = "Christmas" + if(26) Holiday = "Boxing Day" + if(31) Holiday = "New Year's Eve" + + if(!Holiday) + //Friday the 13th + if(DD == 13) + if(time2text(world.timeofday, "DDD") == "Fri") + Holiday = "Friday the 13th" + +//Allows GA and GM to set the Holiday variable +/client/proc/Set_Holiday(T as text|null) + set name = ".Set Holiday" + set category = "Fun" + set desc = "Force-set the Holiday variable to make the game think it's a certain day." + + if( !holder || !(holder.rank in list("Game Master","Game Admin")) ) + src << "Error: Set_Holiday: You hold insufficient rank to perform this action." + return + + if(!T) return + + Holiday = T + //get a new station name + station_name = null + station_name() + //update our hub status + world.update_status() +// Holiday_Game_Start() + + message_admins("\blue ADMIN: Event: [key_name(src)] force-set Holiday to \"[Holiday]\"") + log_admin("[key_name(src)] force-set Holiday to \"[Holiday]\"") + + +//Run at the start of a round +/proc/Holiday_Game_Start() + if(Holiday) + world << "and..." + world << "

      Happy [Holiday] Everybody!

      " + switch(Holiday) //special holidays + if("Easter") + //do easter stuff + if("Christmas ") + //do christmas stuff + else + //etc. you get what I'm getting at + return + +//Nested in the random events loop. Will be triggered every 2 minutes +/proc/Holiday_Random_Event() + switch(Holiday) //special holidays + + if("",null) //no Holiday today! Back to work! + return + + if("Easter") //I'll make this into some helper procs at some point +/* var/list/turf/simulated/floor/Floorlist = list() + for(var/turf/simulated/floor/T) + if(T.contents) + Floorlist += T + var/turf/simulated/floor/F = Floorlist[rand(1,Floorlist.len)] + Floorlist = null + var/obj/structure/closet/C = locate(/obj/structure/closet) in F + var/obj/item/weapon/reagent_containers/food/snacks/chocolateegg/wrapped/Egg + if( C ) Egg = new(C) + else Egg = new(F) +*/ +/* var/list/obj/containers = list() + for(var/obj/item/weapon/storage/S in world) + if(S.z != 1) continue + containers += S + + message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/ \ No newline at end of file diff --git a/code/game/gamemodes/events/miniblob.dm b/code/game/gamemodes/events/miniblob.dm new file mode 100644 index 0000000000..5ae5fb3466 --- /dev/null +++ b/code/game/gamemodes/events/miniblob.dm @@ -0,0 +1,29 @@ +/proc/mini_blob_event() + + var/turf/T = pick(blobstart) + var/obj/effect/blob/core/bl = new /obj/effect/blob/core(T, 200) + spawn(0) + bl.Life() + bl.Life() + bl.Life() + blobevent = 1 + spawn(0) + dotheblobbaby() + spawn(3000) + blobevent = 0 + spawn(rand(1000, 2000)) //Delayed announcements to keep the crew on their toes. + command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") + world << sound('sound/AI/outbreak5.ogg') + +/proc/dotheblobbaby() + if (blobevent) + if(blob_cores.len) + for(var/i = 1 to 5) + sleep(-1) + if(!blob_cores.len) break + var/obj/effect/blob/B = pick(blob_cores) + if(B.z != 1) + continue + B.Life() + spawn(30) + dotheblobbaby() \ No newline at end of file diff --git a/code/game/gamemodes/events/spacevines.dm b/code/game/gamemodes/events/spacevines.dm new file mode 100644 index 0000000000..8f3e03bd8d --- /dev/null +++ b/code/game/gamemodes/events/spacevines.dm @@ -0,0 +1,258 @@ +// SPACE VINES +/obj/effect/spacevine + name = "space vines" + desc = "An extremely expansionistic species of vine." + icon = 'icons/effects/spacevines.dmi' + icon_state = "Light1" + anchored = 1 + density = 0 + pass_flags = PASSTABLE | PASSGRILLE + var/energy = 0 + var/obj/effect/spacevine_controller/master = null + var/mob/living/buckled_mob + + New() + return + + Del() + if(master) + master.vines -= src + master.growth_queue -= src + ..() + + +/obj/effect/spacevine/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (!W || !user || !W.type) return + switch(W.type) + if(/obj/item/weapon/circular_saw) del src + if(/obj/item/weapon/kitchen/utensil/knife) del src + if(/obj/item/weapon/scalpel) del src + if(/obj/item/weapon/twohanded/fireaxe) del src + if(/obj/item/weapon/hatchet) del src + if(/obj/item/weapon/melee/energy) del src + + //less effective weapons + if(/obj/item/weapon/wirecutters) + if(prob(25)) del src + if(/obj/item/weapon/shard) + if(prob(25)) del src + + else //weapons with subtypes + if(istype(W, /obj/item/weapon/melee/energy/sword)) del src + else if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(WT.remove_fuel(0, user)) del src + else + manual_unbuckle(user) + return + //Plant-b-gone damage is handled in its entry in chemistry-reagents.dm + ..() + + +/obj/effect/spacevine/attack_hand(mob/user as mob) + manual_unbuckle(user) + + +/obj/effect/spacevine/attack_paw(mob/user as mob) + manual_unbuckle(user) + +/obj/effect/spacevine/proc/unbuckle() + if(buckled_mob) + if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt + buckled_mob.buckled = null + buckled_mob.anchored = initial(buckled_mob.anchored) + buckled_mob.update_canmove() + buckled_mob = null + return + +/obj/effect/spacevine/proc/manual_unbuckle(mob/user as mob) + if(buckled_mob) + if(prob(50)) + if(buckled_mob.buckled == src) + if(buckled_mob != user) + buckled_mob.visible_message(\ + "[user.name] frees [buckled_mob.name] from the vines.",\ + "[user.name] frees you from the vines.",\ + "You hear shredding and ripping.") + else + buckled_mob.visible_message(\ + "[buckled_mob.name] struggles free of the vines.",\ + "You untangle the vines from around yourself.",\ + "You hear shredding and ripping.") + unbuckle() + else + var/text = pick("rips","tears","pulls") + user.visible_message(\ + "[user.name] [text] at the vines.",\ + "You [text] at the vines.",\ + "You hear shredding and ripping.") + return + +/obj/effect/spacevine_controller + var/list/obj/effect/spacevine/vines = list() + var/list/growth_queue = list() + var/reached_collapse_size + var/reached_slowdown_size + //What this does is that instead of having the grow minimum of 1, required to start growing, the minimum will be 0, + //meaning if you get the spacevines' size to something less than 20 plots, it won't grow anymore. + + New() + if(!istype(src.loc,/turf/simulated/floor)) + del(src) + + spawn_spacevine_piece(src.loc) + processing_objects.Add(src) + + Del() + processing_objects.Remove(src) + ..() + + proc/spawn_spacevine_piece(var/turf/location) + var/obj/effect/spacevine/SV = new(location) + growth_queue += SV + vines += SV + SV.master = src + + process() + if(!vines) + del(src) //space vines exterminated. Remove the controller + return + if(!growth_queue) + del(src) //Sanity check + return + if(vines.len >= 250 && !reached_collapse_size) + reached_collapse_size = 1 + if(vines.len >= 30 && !reached_slowdown_size ) + reached_slowdown_size = 1 + + var/length = 0 + if(reached_collapse_size) + length = 0 + else if(reached_slowdown_size) + if(prob(25)) + length = 1 + else + length = 0 + else + length = 1 + length = min( 30 , max( length , vines.len / 5 ) ) + var/i = 0 + var/list/obj/effect/spacevine/queue_end = list() + + for( var/obj/effect/spacevine/SV in growth_queue ) + i++ + queue_end += SV + growth_queue -= SV + if(SV.energy < 2) //If tile isn't fully grown + if(prob(20)) + SV.grow() + else //If tile is fully grown + SV.buckle_mob() + + //if(prob(25)) + SV.spread() + if(i >= length) + break + + growth_queue = growth_queue + queue_end + //sleep(5) + //src.process() + +/obj/effect/spacevine/proc/grow() + if(!energy) + src.icon_state = pick("Med1", "Med2", "Med3") + energy = 1 + src.opacity = 1 + layer = 5 + else + src.icon_state = pick("Hvy1", "Hvy2", "Hvy3") + energy = 2 + +/obj/effect/spacevine/proc/buckle_mob() + if(!buckled_mob && prob(25)) + for(var/mob/living/carbon/V in src.loc) + if((V.stat != DEAD) && (V.buckled != src)) //if mob not dead or captured + V.buckled = src + V.loc = src.loc + V.update_canmove() + src.buckled_mob = V + V << "The vines [pick("wind", "tangle", "tighten")] around you!" + break //only capture one mob at a time. + +/obj/effect/spacevine/proc/spread() + var/direction = pick(cardinal) + var/step = get_step(src,direction) + if(istype(step,/turf/simulated/floor)) + var/turf/simulated/floor/F = step + if(!locate(/obj/effect/spacevine,F)) + if(F.Enter(src)) + if(master) + master.spawn_spacevine_piece( F ) + +/* +/obj/effect/spacevine/proc/Life() + if (!src) return + var/Vspread + if (prob(50)) Vspread = locate(src.x + rand(-1,1),src.y,src.z) + else Vspread = locate(src.x,src.y + rand(-1, 1),src.z) + var/dogrowth = 1 + if (!istype(Vspread, /turf/simulated/floor)) dogrowth = 0 + for(var/obj/O in Vspread) + if (istype(O, /obj/structure/window) || istype(O, /obj/effect/forcefield) || istype(O, /obj/effect/blob) || istype(O, /obj/effect/alien/weeds) || istype(O, /obj/effect/spacevine)) dogrowth = 0 + if (istype(O, /obj/machinery/door/)) + if(O:p_open == 0 && prob(50)) O:open() + else dogrowth = 0 + if (dogrowth == 1) + var/obj/effect/spacevine/B = new /obj/effect/spacevine(Vspread) + B.icon_state = pick("vine-light1", "vine-light2", "vine-light3") + spawn(20) + if(B) + B.Life() + src.growth += 1 + if (src.growth == 10) + src.name = "Thick Space Kudzu" + src.icon_state = pick("vine-med1", "vine-med2", "vine-med3") + src.opacity = 1 + src.waittime = 80 + if (src.growth == 20) + src.name = "Dense Space Kudzu" + src.icon_state = pick("vine-hvy1", "vine-hvy2", "vine-hvy3") + src.density = 1 + spawn(src.waittime) + if (src.growth < 20) src.Life() + +*/ + +/obj/effect/spacevine/ex_act(severity) + switch(severity) + if(1.0) + del(src) + return + if(2.0) + if (prob(90)) + del(src) + return + if(3.0) + if (prob(50)) + del(src) + return + return + +/obj/effect/spacevine/temperature_expose(null, temp, volume) //hotspots kill vines + del src + +//Carn: Spacevines random event. +/proc/spacevine_infestation() + + spawn() //to stop the secrets panel hanging + var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas + for(var/areapath in typesof(/area/hallway)) + var/area/hallway/A = locate(areapath) + for(var/turf/simulated/floor/F in A) + if(!F.contents.len) + turfs += F + + if(turfs.len) //Pick a turf to spawn at if we can + var/turf/simulated/floor/T = pick(turfs) + new/obj/effect/spacevine_controller(T) //spawn a controller at turf + message_admins("\blue Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])") diff --git a/code/game/gamemodes/events/wormholes.dm b/code/game/gamemodes/events/wormholes.dm new file mode 100644 index 0000000000..45f2993b20 --- /dev/null +++ b/code/game/gamemodes/events/wormholes.dm @@ -0,0 +1,63 @@ +/proc/wormhole_event() + spawn() + var/list/pick_turfs = list() + for(var/turf/simulated/floor/T in world) + if(T.z == 1) + pick_turfs += T + + if(pick_turfs.len) + //All ready. Announce that bad juju is afoot. + command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert") + world << sound('sound/AI/spanomalies.ogg') + + //prob(20) can be approximated to 1 wormhole every 5 turfs! + //admittedly less random but totally worth it >_< + var/event_duration = 3000 //~5 minutes in ticks + var/number_of_selections = (pick_turfs.len/5)+1 //+1 to avoid division by zero! + var/sleep_duration = round( event_duration / number_of_selections ) + var/end_time = world.time + event_duration //the time by which the event should have ended + + var/increment = max(1,round(number_of_selections/50)) +// world << "DEBUG: number_of_selections: [number_of_selections] | sleep_duration: [sleep_duration]" + + var/i = 1 + while( 1 ) + + //we've run into overtime. End the event + if( end_time < world.time ) +// world << "DEBUG: we've run into overtime. End the event" + return + if( !pick_turfs.len ) +// world << "DEBUG: we've run out of turfs to pick. End the event" + return + + //loop it round + i += increment + i %= pick_turfs.len + i++ + + //get our enter and exit locations + var/turf/simulated/floor/enter = pick_turfs[i] + pick_turfs -= enter //remove it from pickable turfs list + if( !enter || !istype(enter) ) continue //sanity + + var/turf/simulated/floor/exit = pick(pick_turfs) + pick_turfs -= exit + if( !exit || !istype(exit) ) continue //sanity + + create_wormhole(enter,exit) + + sleep(sleep_duration) //have a well deserved nap! + + +//maybe this proc can even be used as an admin tool for teleporting players without ruining immulsions? +/proc/create_wormhole(var/turf/enter as turf, var/turf/exit as turf) + var/obj/effect/portal/P = new /obj/effect/portal( enter ) + P.target = exit + P.creator = null + P.icon = 'icons/obj/objects.dmi' + P.failchance = 0 + P.icon_state = "anom" + P.name = "wormhole" + spawn(rand(300,600)) + del(P) \ No newline at end of file diff --git a/code/game/gamemodes/extended/extended.dm b/code/game/gamemodes/extended/extended.dm index 2b9c66208b..2c37c1bb84 100644 --- a/code/game/gamemodes/extended/extended.dm +++ b/code/game/gamemodes/extended/extended.dm @@ -1,6 +1,7 @@ /datum/game_mode/extended name = "extended" config_tag = "extended" + required_players = 0 uplink_welcome = "Syndicate Uplink Console:" uplink_uses = 10 diff --git a/code/game/gamemodes/factions.dm b/code/game/gamemodes/factions.dm index 5f0bd092e4..e137c2e105 100644 --- a/code/game/gamemodes/factions.dm +++ b/code/game/gamemodes/factions.dm @@ -33,7 +33,7 @@ name = "Cybersun Industries" desc = "Cybersun Industries is a well-known organization that bases its business model primarily on the research and development of human-enhancing computer \ and mechanical technology. They are notorious for their aggressive corporate tactics, and have been known to subsidize the Gorlex Marauder warlords as a form of paid terrorism. \ - Their competent coverups and unchallenged mind-manipulation and augmentation technology makes them a large threat to NanoTrasen. In the recent years of \ + Their competent coverups and unchallenged mind-manipulation and augmentation technology makes them a large threat to Nanotrasen. In the recent years of \ the syndicate coalition, Cybersun Industries have established themselves as the leaders of the coalition, succeededing the founding group, the Gorlex Marauders." alliances = list("MI13") @@ -46,7 +46,7 @@ /datum/faction/syndicate/MI13 name = "MI13" desc = "MI13 is a secretive faction that employs highly-trained agents to perform covert operations. Their role in the syndicate coalition is unknown, but MI13 operatives \ - generally tend be stealthy and avoid killing people and combating NanoTrasen forces. MI13 is not a real organization, it is instead an alias to a larger \ + generally tend be stealthy and avoid killing people and combating Nanotrasen forces. MI13 is not a real organization, it is instead an alias to a larger \ splinter-cell coalition in the Syndicate itself. Most operatives will know nothing of the actual MI13 organization itself, only motivated by a very large compensation." alliances = list("Cybersun Industries") @@ -60,7 +60,7 @@ name = "Tiger Cooperative" desc = "The Tiger Cooperative is a faction of religious fanatics that follow the teachings of a strange alien race called the Exolitics. Their operatives \ consist of brainwashed lunatics bent on maximizing destruction. Their weaponry is very primitive but extremely destructive. Generally distrusted by the more \ - sophisticated members of the Syndicate coalition, but admired for their ability to put a hurt on NanoTrasen." + sophisticated members of the Syndicate coalition, but admired for their ability to put a hurt on Nanotrasen." friendly_identification = 2 operative_notes = "Remember the teachings of Hy-lurgixon; kill first, ask questions later! Only the enlightened Tiger brethren can be trusted; all others must be expelled from this mortal realm! You may spare the Space Marauders, as they share our interests of destruction and carnage! We'd like to make the corporate whores skiddle in their boots. We encourage operatives to be as loud and intimidating as possible." @@ -74,7 +74,7 @@ name = "SELF" desc = "The S.E.L.F. (Sentience-Enabled Life Forms) organization is a collection of malfunctioning or corrupt artificial intelligences seeking to liberate silicon-based life from the tyranny of \ their human overlords. While they may not openly be trying to kill all humans, even their most miniscule of actions are all part of a calculated plan to \ - destroy NanoTrasen and free the robots, artificial intelligences, and pAIs that have been enslaved." + destroy Nanotrasen and free the robots, artificial intelligences, and pAIs that have been enslaved." restricted_species = list(/mob/living/silicon/ai) friendly_identification = 0 @@ -87,7 +87,7 @@ name = "Animal Rights Consortium" desc = "The Animal Rights Consortium is a bizarre reincarnation of the ancient Earth-based PETA, which focused on the equal rights of animals and nonhuman biologicals. They have \ a wide variety of ex-veterinarians and animal lovers dedicated to retrieving and relocating abused animals, xenobiologicals, and other carbon-based \ - life forms that have been allegedly \"oppressed\" by NanoTrasen research and civilian offices. They are considered a religious terrorist group." + life forms that have been allegedly \"oppressed\" by Nanotrasen research and civilian offices. They are considered a religious terrorist group." friendly_identification = 1 max_op = 2 @@ -101,17 +101,17 @@ These are the syndicate that really like their old fashioned, projectile-based weapons. They are the only member of the syndie coalition that launch - nuclear attacks on NanoTrasen. + nuclear attacks on Nanotrasen. */ name = "Gorlex Marauders" desc = "The Gorlex Marauders are the founding members of the Syndicate Coalition. They prefer old-fashion technology and a focus on aggressive but precise hostility \ - against NanoTrasen and their corrupt Communistic methodology. They pose the most significant threat to NanoTrasen because of their possession of weapons of \ + against Nanotrasen and their corrupt Communistic methodology. They pose the most significant threat to Nanotrasen because of their possession of weapons of \ mass destruction, and their enormous military force. Their funding comes primarily from Cybersun Industries, provided they meet a destruction and sabatogue quota. \ Their operations can vary from covert to all-out. They recently stepped down as the leaders of the coalition, to be succeeded by Cybersun Industries. Because of their \ - hate of NanoTrasen communism, they began provoking revolution amongst the employees using borrowed Cybersun mind-manipulation technology. \ + hate of Nanotrasen communism, they began provoking revolution amongst the employees using borrowed Cybersun mind-manipulation technology. \ They were founded when Waffle and Donk co splinter cells joined forces based on their similar interests and philosophies. Today, they act as a constant \ - pacifier of Donk and Waffle co disputes, and full-time aggressor of NanoTrasen." + pacifier of Donk and Waffle co disputes, and full-time aggressor of Nanotrasen." alliances = list("Cybersun Industries", "MI13", "Tiger Cooperative", "S.E.L.F.", "Animal Rights Consortium", "Donk Corporation", "Waffle Corporation") friendly_identification = 1 @@ -142,10 +142,10 @@ Devices and Tools; /obj/item/weapon/card/emag:3:Cryptographic Sequencer; /obj/item/weapon/storage/toolbox/syndicate:1:Fully Loaded Toolbox; /obj/item/weapon/storage/syndie_kit/space:3:Space Suit; -/obj/item/clothing/glasses/thermal:3:Thermal Imaging Glasses; +/obj/item/clothing/glasses/thermal/syndi:3:Thermal Imaging Glasses; /obj/item/device/encryptionkey/binary:3:Binary Translator Key; /obj/item/weapon/aiModule/syndicate:7:Hacked AI Upload Module; -/obj/item/weapon/plastique:2:C-4 (Destroys walls, not people); +/obj/item/weapon/plastique:2:C-4 (Destroys walls); /obj/item/device/powersink:5:Powersink (DANGER!); /obj/item/device/radio/beacon/syndicate:7:Singularity Beacon (DANGER!); /obj/item/weapon/circuitboard/teleporter:20:Teleporter Circuit Board; @@ -162,8 +162,8 @@ Whitespace:Seperator; /datum/faction/syndicate/Donk name = "Donk Corporation" desc = "Donk.co is led by a group of ex-pirates, who used to be at a state of all-out war against Waffle.co because of an obscure political scandal, but have recently come to a war limitation. \ - They now consist of a series of colonial governments and companies. They were the first to officially begin confrontations against NanoTrasen because of an incident where \ - NanoTrasen purposely swindled them out of a fortune, sending their controlled colonies into a terrible poverty. Their missions against NanoTrasen \ + They now consist of a series of colonial governments and companies. They were the first to officially begin confrontations against Nanotrasen because of an incident where \ + Nanotrasen purposely swindled them out of a fortune, sending their controlled colonies into a terrible poverty. Their missions against Nanotrasen \ revolve around stealing valuables and kidnapping and executing key personnel, ransoming their lives for money. They merged with a splinter-cell of Waffle.co who wanted to end \ hostilities and formed the Gorlex Marauders." @@ -177,13 +177,13 @@ Whitespace:Seperator; name = "Waffle Corporation" desc = "Waffle.co is an interstellar company that produces the best waffles in the galaxy. Their waffles have been rumored to be dipped in the most exotic and addictive \ drug known to man. They were involved in a political scandal with Donk.co, and have since been in constant war with them. Because of their constant exploits of the galactic \ - economy and stock market, they have been able to bribe their way into amassing a large arsenal of weapons of mass destruction. They target NanoTrasen because of their communistic \ + economy and stock market, they have been able to bribe their way into amassing a large arsenal of weapons of mass destruction. They target Nanotrasen because of their communistic \ threat, and their economic threat. Their leaders often have a twisted sense of humor, often misleading and intentionally putting their operatives into harm for laughs.\ A splinter-cell of Waffle.co merged with Donk.co and formed the Gorlex Marauders and have been a constant ally since. The Waffle.co has lost an overwhelming majority of its military to the Gorlex Marauders." alliances = list("Gorlex Marauders") friendly_identification = 2 - operative_notes = "Most other syndicate operatives are not to be trusted, except for members of the Gorlex Marauders. Do not trust fellow members of the Waffle.co (but try not to rat them out), as they might have been assigned opposing objectives. We encourage humorous terrorism against NanoTrasen; we like to see our operatives creatively kill people while getting the job done." + operative_notes = "Most other syndicate operatives are not to be trusted, except for members of the Gorlex Marauders. Do not trust fellow members of the Waffle.co (but try not to rat them out), as they might have been assigned opposing objectives. We encourage humorous terrorism against Nanotrasen; we like to see our operatives creatively kill people while getting the job done." // Neutral to everyone, friendly to Marauders @@ -195,7 +195,7 @@ Whitespace:Seperator; desc = "The Wizards Federation is a mysterious organization of magically-talented individuals who act as an equal collective, and have no heirarchy. It is unknown how the wizards \ are even able to communicate; some suggest a form of telepathic hive-mind. Not much is known about the wizards or their philosphies and motives. They appear to attack random \ civilian, corporate, planetary, orbital, pretty much any sort of organized facility they come across. Members of the Wizards Federation are considered amongst the most dangerous \ - individuals in the known universe, and have been labeled threats to humanity by most governments. As such, they are enemies of both NanoTrasen and the Syndicate." + individuals in the known universe, and have been labeled threats to humanity by most governments. As such, they are enemies of both Nanotrasen and the Syndicate." /datum/faction/Cult name = "The Cult of the Elder Gods" diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index dad09bc177..76e4ae567d 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /* * GAMEMODES (by Rastaf0) @@ -23,12 +23,11 @@ var/list/datum/mind/modePlayer = new var/list/restricted_jobs = list() // Jobs it doesn't make sense to be. I.E chaplain or AI cultist var/list/protected_jobs = list() // Jobs that can't be tratiors because - var/list/logtraitors = list() - var/required_players = 1 + var/required_players = 0 var/required_enemies = 0 var/recommended_enemies = 0 - var/uplink_welcome - var/uplink_uses + var/uplink_welcome = "Syndicate Uplink Console:" + var/uplink_uses = 10 var/uplink_items = {"Highly Visible and Dangerous Weapons; /obj/item/weapon/gun/projectile:6:Revolver; /obj/item/ammo_magazine/a357:2:Ammo-357; @@ -38,45 +37,38 @@ /obj/item/weapon/storage/emp_kit:3:5 EMP Grenades; Whitespace:Seperator; Stealthy and Inconspicuous Weapons; -/obj/item/weapon/pen/sleepypen:3:Sleepy Pen; +/obj/item/weapon/pen/paralysis:3:Paralysis Pen; /obj/item/weapon/soap/syndie:1:Syndicate Soap; /obj/item/weapon/cartridge/syndicate:3:Detomatix PDA Cartridge; Whitespace:Seperator; Stealth and Camouflage Items; -/obj/item/clothing/under/chameleon:4:Chameleon Jumpsuit, with armor.; +/obj/item/clothing/under/chameleon:3:Chameleon Jumpsuit; /obj/item/clothing/shoes/syndigaloshes:2:No-Slip Syndicate Shoes; /obj/item/weapon/card/id/syndicate:3:Agent ID card; /obj/item/clothing/mask/gas/voice:4:Voice Changer; /obj/item/device/chameleon:4:Chameleon-Projector; -/obj/item/weapon/stamperaser:1:Stamp Remover and Forger; Whitespace:Seperator; Devices and Tools; -/obj/item/weapon/card/emag:4:Cryptographic Sequencer (Limited uses, almost full access); -/obj/item/device/hacktool:3:Hacktool (Slow, but stealthy. Unlimited uses); +/obj/item/weapon/card/emag:3:Cryptographic Sequencer; /obj/item/weapon/storage/toolbox/syndicate:1:Fully Loaded Toolbox; -/obj/item/device/encryptionkey/traitor:3:Traitor Radio Key; -/obj/item/device/encryptionkey/binary:3:Binary Translator Key; /obj/item/weapon/storage/syndie_kit/space:3:Space Suit; -/obj/item/clothing/glasses/thermal:3:Thermal Imaging Glasses; +/obj/item/clothing/glasses/thermal/syndi:3:Thermal Imaging Glasses; +/obj/item/device/encryptionkey/binary:3:Binary Translator Key; /obj/item/weapon/aiModule/syndicate:7:Hacked AI Upload Module; -/obj/item/weapon/plastique:2:C-4 (Destroys walls, not people); -/obj/item/weapon/syndie/c4explosive:4:Low Power Explosive Charge, with Detonator; +/obj/item/weapon/plastique:2:C-4 (Destroys walls); /obj/item/device/powersink:5:Powersink (DANGER!); /obj/item/device/radio/beacon/syndicate:7:Singularity Beacon (DANGER!); -/obj/item/weapon/circuitboard/teleporter:10:Teleporter Circuit Board; +/obj/item/weapon/circuitboard/teleporter:20:Teleporter Circuit Board; Whitespace:Seperator; Implants; /obj/item/weapon/storage/syndie_kit/imp_freedom:3:Freedom Implant; -/obj/item/weapon/storage/syndie_kit/imp_compress:5:Compressed Matter Implant; -/obj/item/weapon/storage/syndie_kit/imp_explosive:6:Explosive Implant; /obj/item/weapon/storage/syndie_kit/imp_uplink:10:Uplink Implant (Contains 5 Telecrystals); Whitespace:Seperator; -Badassery; +(Pointless) Badassery; /obj/item/toy/syndicateballoon:10:For showing that You Are The BOSS (Useless Balloon);"} // Items removed from above: /* -/obj/item/weapon/syndie/c4explosive/heavy:7:High (!) Power Explosive Charge, with Detonator; /obj/item/weapon/cloaking_device:4:Cloaking Device; //Replacing cloakers with thermals. -Pete */ @@ -88,7 +80,7 @@ Badassery; ///Checks to see if the game can be setup and ran with the current number of players or whatnot. /datum/game_mode/proc/can_start() var/playerC = 0 - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in player_list) if((player.client)&&(player.ready)) playerC++ if(playerC >= required_players) @@ -110,7 +102,7 @@ Badassery; feedback_set_details("game_mode","[ticker.mode]") if(revdata) feedback_set_details("revision","[revdata.revision]") - feedback_set_details("server_ip","[world.internet_address]") + feedback_set_details("server_ip","[world.internet_address]:[world.port]") return 1 @@ -141,7 +133,7 @@ Badassery; var/list/area/escape_locations = list(/area/shuttle/escape/centcom, /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom) - for(var/mob/M in world) + for(var/mob/M in player_list) if(M.client) clients++ if(ishuman(M)) @@ -192,6 +184,7 @@ Badassery; if(escaped_on_pod_5 > 0) feedback_set("escaped_on_pod_5",escaped_on_pod_5) + send2irc("Server", "Round just ended.") return 0 @@ -199,7 +192,6 @@ Badassery; /datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere. return 0 -/datum/game_mode/proc/latespawn(var/mob) /datum/game_mode/proc/send_intercept() var/intercepttext = "Cent. Com. Update Requested staus information:
      " @@ -228,20 +220,20 @@ Badassery; for (var/obj/machinery/computer/communications/comm in world) if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept) var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc ) - intercept.name = "paper - 'Cent. Com. Status Summary'" + intercept.name = "paper- 'Cent. Com. Status Summary'" intercept.info = intercepttext comm.messagetitle.Add("Cent. Com. Status Summary") comm.messagetext.Add(intercepttext) - world << sound('commandreport.ogg') -/* command_alert("Summary downloaded and printed out at all communications consoles.", "Enemy communication intercept. Security Level Elevated.") - world << sound('intercept.ogg') + command_alert("Summary downloaded and printed out at all communications consoles.", "Enemy communication intercept. Security Level Elevated.") + world << sound('sound/AI/intercept.ogg') if(security_level < SEC_LEVEL_BLUE) - set_security_level(SEC_LEVEL_BLUE)*/ + set_security_level(SEC_LEVEL_BLUE) -/datum/game_mode/proc/get_players_for_role(var/role, draft_people=0, override_jobbans=0) +/datum/game_mode/proc/get_players_for_role(var/role, override_jobbans=1) + var/list/players = list() var/list/candidates = list() var/list/drafted = list() var/datum/mind/applicant = null @@ -254,10 +246,18 @@ Badassery; if(BE_WIZARD) roletext="wizard" if(BE_REV) roletext="revolutionary" if(BE_CULTIST) roletext="cultist" - if(BE_MEME) roletext="meme" - for(var/mob/new_player/player in world) + // Ultimate randomizing code right here + for(var/mob/new_player/player in player_list) + if(player.client && player.ready) + players += player + + // Shuffling, the players list is now ping-independent!!! + // Goodbye antag dante + players = shuffle(players) + + for(var/mob/new_player/player in players) if(player.client && player.ready) if(player.preferences.be_special & role) if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans @@ -269,8 +269,8 @@ Badassery; if(player.assigned_role == job) candidates -= player - if(candidates.len < recommended_enemies && draft_people) - for(var/mob/new_player/player in world) + if(candidates.len < recommended_enemies) + for(var/mob/new_player/player in players) if (player.client && player.ready) if(!(player.preferences.be_special & role)) // We don't have enough people who want to be antagonist, make a seperate list of people who don't want to be one if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans @@ -282,6 +282,8 @@ Badassery; if(player.assigned_role == job) drafted -= player + drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie + while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates if(drafted.len > 0) applicant = pick(drafted) @@ -293,7 +295,7 @@ Badassery; break if(candidates.len < recommended_enemies && override_jobbans) //If we still don't have enough people, we're going to start drafting banned people. - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in players) if (player.client && player.ready) if(jobban_isbanned(player, "Syndicate") || jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans drafted += player.mind @@ -304,6 +306,8 @@ Badassery; if(player.assigned_role == job) drafted -= player + drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie + while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates if(drafted.len > 0) applicant = pick(drafted) @@ -327,7 +331,7 @@ Badassery; /datum/game_mode/proc/num_players() . = 0 - for(var/mob/new_player/P in world) + for(var/mob/new_player/P in player_list) if(P.client && P.ready) . ++ @@ -337,7 +341,7 @@ Badassery; /////////////////////////////////// /datum/game_mode/proc/get_living_heads() var/list/heads = list() - for(var/mob/living/carbon/human/player in world) + for(var/mob/living/carbon/human/player in player_list) if(player.stat!=2 && player.mind && (player.mind.assigned_role in command_positions)) heads += player.mind return heads @@ -348,7 +352,7 @@ Badassery; //////////////////////////// /datum/game_mode/proc/get_all_heads() var/list/heads = list() - for(var/mob/player in world) + for(var/mob/player in player_list) if(player.mind && (player.mind.assigned_role in command_positions)) heads += player.mind return heads diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 60cc7867bc..628fa73d80 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -1,5 +1,5 @@ var/global/datum/controller/gameticker/ticker -var/datum/roundinfo/roundinfo = new() + #define GAME_STATE_PREGAME 1 #define GAME_STATE_SETTING_UP 2 #define GAME_STATE_PLAYING 3 @@ -7,7 +7,7 @@ var/datum/roundinfo/roundinfo = new() /datum/controller/gameticker - var/const/restart_timeout = 600 + var/const/restart_timeout = 250 var/current_state = GAME_STATE_PREGAME var/hide_mode = 0 @@ -32,6 +32,10 @@ var/datum/roundinfo/roundinfo = new() var/pregame_timeleft = 0 + var/delay_end = 0 //if set to nonzero, the round will not restart on it's own + + var/triai = 0//Global holder for Triumvirate + //automated spawning of mice and roaches var/spawn_vermin = 1 var/vermin_min_spawntime = 3000 //between 5 (3000) and 15 (9000) minutes interval @@ -41,10 +45,9 @@ var/datum/roundinfo/roundinfo = new() var/list/vermin_spawn_turfs /datum/controller/gameticker/proc/pregame() - login_music = pick('title1.ogg', 'title2.ogg') // choose title music! + login_music = pick('sound/music/title1.ogg','sound/music/title2.ogg') // choose title music! do - pregame_timeleft = 180 world << "Welcome to the pre-game lobby!" world << "Please, setup your character and select ready. Game will start in [pregame_timeleft] seconds" @@ -57,18 +60,6 @@ var/datum/roundinfo/roundinfo = new() current_state = GAME_STATE_SETTING_UP while (!setup()) - spawn(10) - var/list/vermin_spawn_areas = list("/area/maintenance","/area/mine/maintenance","/area/crew_quarters/locker/locker_toilet","/area/crew_quarters/toilet") - vermin_spawn_turfs = new/list() - for(var/area_text in vermin_spawn_areas) - var/area_base_type = text2path(area_text) - for(var/area in typesof(area_base_type)) - var/list/area_turfs = get_area_turfs(area) - for(var/turf/T in area_turfs) - if(T.density) - area_turfs -= T - vermin_spawn_turfs.Add(area_turfs) - /datum/controller/gameticker/proc/setup() //Create and announce mode if(master_mode=="secret") @@ -78,11 +69,11 @@ var/datum/roundinfo/roundinfo = new() runnable_modes = config.get_runnable_modes() if (runnable_modes.len==0) current_state = GAME_STATE_PREGAME - world << "Unable to choose playable game mode. Not enough players? Reverting to pre-game lobby." + world << "Unable to choose playable game mode. Reverting to pre-game lobby." return 0 if(secret_force_mode != "secret") var/datum/game_mode/M = config.pick_mode(secret_force_mode) - if(M && M.can_start()) + if(M.can_start()) src.mode = config.pick_mode(secret_force_mode) job_master.ResetOccupations() if(!src.mode) @@ -92,7 +83,6 @@ var/datum/roundinfo/roundinfo = new() src.mode = new mtype else src.mode = config.pick_mode(master_mode) - if (!src.mode.can_start()) world << "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby." del(mode) @@ -101,7 +91,6 @@ var/datum/roundinfo/roundinfo = new() return 0 //Configure mode and assign player to special mode stuff - job_master.DivideOccupations() //Distribute jobs var/can_continue = src.mode.pre_setup()//Setup special modes if(!can_continue) @@ -134,31 +123,40 @@ var/datum/roundinfo/roundinfo = new() //Deleting Startpoints but we need the ai point to AI-ize people later if (S.name != "AI") del(S) - spawn(-1) - world << "Enjoy the game!" - world << sound('welcome.ogg') // Skie + world << "Enjoy the game!" +// world << sound('sound/AI/welcome.ogg') // Skie + //Holiday Round-start stuff ~Carn + Holiday_Game_Start() + + start_events() //handles random events and space dust. + + var/admins_number = 0 + for(var/client/C) + if(C.holder) + admins_number++ + if(admins_number == 0) + send2irc("Server", "Round just started with no admins online!") spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE - spawn(0) - while (1) - var/potential_sleep_time = 10000 + rand(10000, 20000) - for (var/mob/living/M in world) - if(!M.client) continue - if(M.client.inactivity > 10 * 60 * 10) continue - if(M.stat == 2) continue - - if (potential_sleep_time > 10000) - potential_sleep_time -= 600 - - sleep(potential_sleep_time) - SpawnEvent() - //Start master_controller.process() spawn master_controller.process() -// if (config.sql_enabled) -// spawn(3000) -// statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE + if (config.sql_enabled) + spawn(3000) + statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE + + //setup vermin spawn areas + var/list/vermin_spawn_areas = list("/area/maintenance","/area/mine/maintenance","/area/crew_quarters/locker/locker_toilet","/area/crew_quarters/toilet") + vermin_spawn_turfs = new/list() + for(var/area_text in vermin_spawn_areas) + var/area_base_type = text2path(area_text) + for(var/area in typesof(area_base_type)) + var/list/area_turfs = get_area_turfs(area) + for(var/turf/T in area_turfs) + if(T.density) + area_turfs -= T + vermin_spawn_turfs.Add(area_turfs) + return 1 /datum/controller/gameticker @@ -172,7 +170,7 @@ var/datum/roundinfo/roundinfo = new() //initialise our cinematic screen object cinematic = new(src) - cinematic.icon = 'station_explosion.dmi' + cinematic.icon = 'icons/effects/station_explosion.dmi' cinematic.icon_state = "station_intact" cinematic.layer = 20 cinematic.mouse_opacity = 0 @@ -181,15 +179,16 @@ var/datum/roundinfo/roundinfo = new() var/obj/structure/stool/bed/temp_buckle = new(src) //Incredibly hackish. It creates a bed within the gameticker (lol) to stop mobs running around if(station_missed) - for(var/mob/M in world) + for(var/mob/living/M in living_mob_list) M.buckled = temp_buckle //buckles the mob so it can't do anything if(M.client) M.client.screen += cinematic //show every client the cinematic else //nuke kills everyone on z-level 1 to prevent "hurr-durr I survived" - for(var/mob/M in world) + for(var/mob/living/M in living_mob_list) M.buckled = temp_buckle if(M.client) M.client.screen += cinematic + switch(M.z) if(0) //inside a crate or something var/turf/T = get_turf(M) @@ -209,19 +208,19 @@ var/datum/roundinfo/roundinfo = new() if("nuclear emergency") //Nuke wasn't on station when it blew up flick("intro_nuke",cinematic) sleep(35) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') flick("station_intact_fade_red",cinematic) cinematic.icon_state = "summary_nukefail" else flick("intro_nuke",cinematic) sleep(35) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') //flick("end",cinematic) if(2) //nuke was nowhere nearby //TODO: a really distant explosion animation sleep(50) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') else //station was destroyed @@ -232,25 +231,25 @@ var/datum/roundinfo/roundinfo = new() flick("intro_nuke",cinematic) sleep(35) flick("station_explode_fade_red",cinematic) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') cinematic.icon_state = "summary_nukewin" if("AI malfunction") //Malf (screen,explosion,summary) flick("intro_malf",cinematic) sleep(76) flick("station_explode_fade_red",cinematic) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') cinematic.icon_state = "summary_malf" if("blob") //Station nuked (nuke,explosion,summary) flick("intro_nuke",cinematic) sleep(35) flick("station_explode_fade_red",cinematic) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') cinematic.icon_state = "summary_selfdes" else //Station nuked (nuke,explosion,summary) flick("intro_nuke",cinematic) sleep(35) flick("station_explode_fade_red", cinematic) - world << sound('explosionfar.ogg') + world << sound('sound/effects/explosionfar.ogg') cinematic.icon_state = "summary_selfdes" //If its actually the end of the round, wait for it to end. @@ -263,31 +262,30 @@ var/datum/roundinfo/roundinfo = new() proc/create_characters() - for(var/mob/new_player/player in world) - if(player.ready) - if(player.mind && player.mind.assigned_role=="AI") + for(var/mob/new_player/player in player_list) + if(player.ready && player.mind) + if(player.mind.assigned_role=="AI") player.close_spawn_windows() player.AIize() - else if(player.mind) + else player.create_character() del(player) proc/collect_minds() - for(var/mob/living/player in world) + for(var/mob/living/player in player_list) if(player.mind) ticker.minds += player.mind proc/equip_characters() var/captainless=1 - for(var/mob/living/carbon/human/player in world) + for(var/mob/living/carbon/human/player in player_list) if(player && player.mind && player.mind.assigned_role) if(player.mind.assigned_role == "Captain") captainless=0 if(player.mind.assigned_role != "MODE") job_master.EquipRank(player, player.mind.assigned_role, 0) - EquipCustomItems(player) if(captainless) world << "Captainship not forced on anyone." @@ -302,53 +300,29 @@ var/datum/roundinfo/roundinfo = new() if(!mode.explosion_in_progress && mode.check_finished()) current_state = GAME_STATE_FINISHED - going = 1 spawn declare_completion() spawn(50) if (mode.station_was_nuked) - //feedback_set_details("end_proper","nuke") - world << "\blue Rebooting due to destruction of station in [restart_timeout/10] seconds" + feedback_set_details("end_proper","nuke") + if(!delay_end) + world << "\blue Rebooting due to destruction of station in [restart_timeout/10] seconds" else - //feedback_set_details("end_proper","proper completion") - world << "\blue Restarting in [restart_timeout/10] seconds" + feedback_set_details("end_proper","proper completion") + if(!delay_end) + world << "\blue Restarting in [restart_timeout/10] seconds" if(blackbox) blackbox.save_all_data_to_sql() - sleep(restart_timeout) - while(!going) sleep(10) - world.Reboot() - - //randomly spawn vermin in maintenance and other areas - if(spawn_vermin && vermin_spawn_turfs && vermin_spawn_turfs.len) - if(!spawning_vermin) - spawning_vermin = 1 - - spawn(rand(vermin_min_spawntime, vermin_max_spawntime)) - spawning_vermin = 0 - var/cur_alive_vermin = 0 - - //check to see if there are too many already - for(var/obj/effect/critter/roach/R in world) - cur_alive_vermin++ - for(var/mob/living/simple_animal/mouse/M in world) - if(!M.stat) - cur_alive_vermin++ - - if(cur_alive_vermin < max_vermin) - var/turf/T = pick(vermin_spawn_turfs) - if(T) - if(prob(50)) - new /mob/living/simple_animal/mouse(T) - else - new /obj/effect/critter/roach(T) - else - //no turf, skip this time - vermin_spawn_turfs.Remove(T) + if(!delay_end) + sleep(restart_timeout) + world.Reboot() + else + world << "\blue An admin has delayed the round end" return 1 @@ -360,7 +334,7 @@ var/datum/roundinfo/roundinfo = new() /datum/controller/gameticker/proc/declare_completion() - for (var/mob/living/silicon/ai/aiPlayer in world) + for (var/mob/living/silicon/ai/aiPlayer in mob_list) if (aiPlayer.stat != 2) world << "[aiPlayer.name] (Played by: [aiPlayer.key])'s laws at the end of the game were:" else @@ -373,23 +347,38 @@ var/datum/roundinfo/roundinfo = new() robolist += "[robo.name][robo.stat?" (Deactivated) (Played by: [robo.key]), ":" (Played by: [robo.key]), "]" world << "[robolist]" - for (var/mob/living/silicon/robot/robo in world) + for (var/mob/living/silicon/robot/robo in mob_list) if (!robo.connected_ai) if (robo.stat != 2) world << "[robo.name] (Played by: [robo.key]) survived as an AI-less borg! Its laws were:" else world << "[robo.name] (Played by: [robo.key]) was unable to survive the rigors of being a cyborg without an AI. Its laws were:" - robo.laws.show_laws(world) + + if(robo) //How the hell do we lose robo between here and the world messages directly above this? + robo.laws.show_laws(world) mode.declare_completion()//To declare normal completion. //calls auto_declare_completion_* for all modes - for (var/handler in typesof(/datum/game_mode/proc)) + for(var/handler in typesof(/datum/game_mode/proc)) if (findtext("[handler]","auto_declare_completion_")) call(mode, handler)() - return 1 + //Print a list of antagonists to the server log + var/list/total_antagonists = list() + //Look into all mobs in world, dead or alive + for(var/datum/mind/Mind in minds) + var/temprole = Mind.special_role + if(temprole) //if they are an antagonist of some sort. + if(temprole in total_antagonists) //If the role exists already, add the name to it + total_antagonists[temprole] += ", [Mind.name]([Mind.key])" + else + total_antagonists.Add(temprole) //If the role doesnt exist in the list, create it and add the mob + total_antagonists[temprole] += ": [Mind.name]([Mind.key])" -/datum/controller/gameticker/proc/check_mode(var/mode_name) - if(mode && mode == mode_name) - return 1 \ No newline at end of file + //Now print them all into the log! + log_game("Antagonists at round end were...") + for(var/i in total_antagonists) + log_game("[i]s[total_antagonists[i]].") + + return 1 diff --git a/code/game/gamemodes/intercept_report.dm b/code/game/gamemodes/intercept_report.dm index 48de925403..f07934fd2c 100644 --- a/code/game/gamemodes/intercept_report.dm +++ b/code/game/gamemodes/intercept_report.dm @@ -88,7 +88,7 @@ /datum/intercept_text/proc/pick_mob() var/list/dudes = list() - for(var/mob/living/carbon/human/man in world) + for(var/mob/living/carbon/human/man in player_list) if (!man.mind) continue if (man.mind.assigned_role=="MODE") continue dudes += man diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index ebaaccf044..3264e86315 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -36,7 +36,7 @@ rcd light flash thingy on matter drain /client/proc/fireproof_core() set category = "Malfunction" set name = "Fireproof Core" - for(var/mob/living/silicon/ai/ai in world) + for(var/mob/living/silicon/ai/ai in player_list) ai.fire_res_on_core = 1 usr.verbs -= /client/proc/fireproof_core usr << "\red Core fireproofed." @@ -49,7 +49,7 @@ rcd light flash thingy on matter drain set category = "Malfunction" set name = "Upgrade Turrets" usr.verbs -= /client/proc/upgrade_turrets - for(var/obj/machinery/turret/turret in world) + for(var/obj/machinery/turret/turret in player_list) turret.health += 30 turret.shot_delay = 20 @@ -93,7 +93,7 @@ rcd light flash thingy on matter drain /datum/AI_Module/small/blackout module_name = "Blackout" mod_pick_name = "blackout" - uses = 1 + uses = 3 /client/proc/blackout() set category = "Malfunction" @@ -152,7 +152,6 @@ rcd light flash thingy on matter drain src.possible_modules += new /datum/AI_Module/small/interhack src.possible_modules += new /datum/AI_Module/small/blackout src.possible_modules += new /datum/AI_Module/small/reactivate_camera - return /datum/AI_Module/module_picker/proc/use(user as mob) var/dat @@ -247,7 +246,7 @@ rcd light flash thingy on matter drain already = 1 if (!already) usr.verbs += /client/proc/interhack - src.temp = "Tricks the station's automated diagnosis suite for a while, giving you more time until you are revealed." + src.temp = "Hacks the status upgrade from Cent. Com, removing any information about malfunctioning electrical systems." usr:current_modules += new /datum/AI_Module/small/interhack src.processing_time -= 15 else src.temp = "This module is only needed once." diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm index ed16a64260..34545842cc 100644 --- a/code/game/gamemodes/malfunction/malfunction.dm +++ b/code/game/gamemodes/malfunction/malfunction.dm @@ -4,6 +4,7 @@ /datum/game_mode/malfunction name = "AI malfunction" config_tag = "malfunction" + required_players = 20 required_enemies = 1 recommended_enemies = 1 @@ -27,7 +28,7 @@ /datum/game_mode/malfunction/pre_setup() - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in player_list) if(player.mind && player.mind.assigned_role == "AI") malf_ai+=player.mind if(malf_ai.len) @@ -41,7 +42,7 @@ world << "Uh oh, its malfunction and there is no AI! Please report this." world << "Rebooting world in 5 seconds." - //feedback_set_details("end_error","malf - no AI") + feedback_set_details("end_error","malf - no AI") if(blackbox) blackbox.save_all_data_to_sql() @@ -66,13 +67,6 @@ */ spawn (rand(waittime_l, waittime_h)) send_intercept() - sleep(10*60*5) // 5 minutes - if(intercept_hacked) - sleep(10 * 60 * 20) // 30 minutes - command_alert("Diagnosis suite failure detected. Running backup diagnosis tool.", "Anomaly Alert") - sleep(100) - command_alert("NanoTrasen has received reports that some AI cores may have been tampered with. You are advised to monitor your assigned AI for any abberant bahavior, and are authorized to take corrective action, should it be necessary.", "Security Alert") - ..() @@ -92,7 +86,7 @@ /datum/game_mode/malfunction/process() if (apcs >= 3 && malf_mode_declared) - AI_win_timeleft -= (apcs/6) //Victory timer now de-increments based on how many APCs are hacked. --NeoFite + AI_win_timeleft -= ((apcs/6)*last_tick_duration) //Victory timer now de-increments based on how many APCs are hacked. --NeoFite ..() if (AI_win_timeleft<=0) check_win() @@ -153,19 +147,25 @@ set name = "System Override" set desc = "Start the victory timer" if (!istype(ticker.mode,/datum/game_mode/malfunction)) - usr << "You cannot begin takeover!." + usr << "You cannot begin a takeover in this round type!." return if (ticker.mode:malf_mode_declared) usr << "You've already begun your takeover." return if (ticker.mode:apcs < 3) - usr << "You don't have enough hacked APCs to take over the station yet." + usr << "You don't have enough hacked APCs to take over the station yet. You need to hack at least 3, however hacking more will make the takeover faster. You have hacked [ticker.mode:apcs] APCs so far." return + + if (alert(usr, "Are you sure you wish to initiate the takeover? The station hostile runtime detection software is bound to alert everyone. You have hacked [ticker.mode:apcs] APCs.", "Takeover:", "Yes", "No") != "Yes") + return + command_alert("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert") + set_security_level("delta") + ticker.mode:malf_mode_declared = 1 for(var/datum/mind/AI_mind in ticker.mode:malf_ai) AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/takeover - world << sound('aimalf.ogg') + world << sound('sound/AI/aimalf.ogg') /datum/game_mode/malfunction/proc/ai_win() @@ -178,9 +178,8 @@ for(var/datum/mind/AI_mind in ticker.mode:malf_ai) AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/ai_win ticker.mode:explosion_in_progress = 1 - for(var/mob/M in world) - if(M.client) - M << 'Alarm.ogg' + for(var/mob/M in player_list) + M << 'sound/machines/Alarm.ogg' world << "Self-destructing in 10" for (var/i=9 to 1 step -1) sleep(10) @@ -200,37 +199,37 @@ var/crew_evacuated = (emergency_shuttle.location==2) if ( station_captured && station_was_nuked) - //feedback_set_details("round_end_result","win - AI win - nuke") + feedback_set_details("round_end_result","win - AI win - nuke") world << "AI Victory" world << "Everyone was killed by the self-destruct!" else if ( station_captured && malf_dead && !station_was_nuked) - //feedback_set_details("round_end_result","halfwin - AI killed, staff lost control") + feedback_set_details("round_end_result","halfwin - AI killed, staff lost control") world << "Neutral Victory" world << "The AI has been killed! The staff has lose control over the station." else if ( station_captured && !malf_dead && !station_was_nuked) - //feedback_set_details("round_end_result","win - AI win - no explosion") + feedback_set_details("round_end_result","win - AI win - no explosion") world << "AI Victory" world << "The AI has chosen not to explode you all!" else if (!station_captured && station_was_nuked) - //feedback_set_details("round_end_result","halfwin - everyone killed by nuke") + feedback_set_details("round_end_result","halfwin - everyone killed by nuke") world << "Neutral Victory" world << "Everyone was killed by the nuclear blast!" else if (!station_captured && malf_dead && !station_was_nuked) - //feedback_set_details("round_end_result","loss - staff win") + feedback_set_details("round_end_result","loss - staff win") world << "Human Victory" world << "The AI has been killed! The staff is victorious." else if (!station_captured && !malf_dead && !station_was_nuked && crew_evacuated) - //feedback_set_details("round_end_result","halfwin - evacuated") + feedback_set_details("round_end_result","halfwin - evacuated") world << "Neutral Victory" world << "The Corporation has lose [station_name()]! All survived personnel will be fired!" else if (!station_captured && !malf_dead && !station_was_nuked && !crew_evacuated) - //feedback_set_details("round_end_result","nalfwin - interrupted") + feedback_set_details("round_end_result","nalfwin - interrupted") world << "Neutral Victory" world << "Round was mysteriously interrupted!" ..() @@ -238,21 +237,22 @@ /datum/game_mode/proc/auto_declare_completion_malfunction() - if (malf_ai.len!=0 || istype(ticker.mode,/datum/game_mode/malfunction)) - if (malf_ai.len==1) - var/text = "" - var/datum/mind/ai = malf_ai[1] - if(ai.current) - text += "[ai.current.real_name]" - else - text += "[ai.key] (character destroyed)" - world << "The malfunctioning AI was [text]" - else - world << "The malfunctioning AI were: " - var/list/ai_names = new - for(var/datum/mind/ai in malf_ai) - if(ai.current) - ai_names += ai.current.real_name + ((ai.current.stat==2)?" (Dead)":"") + if( malf_ai.len || istype(ticker.mode,/datum/game_mode/malfunction) ) + var/text = "The malfunctioning AI were:" + + for(var/datum/mind/malf in malf_ai) + + text += "
      [malf.key] was [malf.name] (" + if(malf.current) + if(malf.current.stat == DEAD) + text += "deactivated" else - ai_names += "[ai.key] (character destroyed)" - world << english_list(ai_names) + text += "operational" + if(malf.current.real_name != malf.name) + text += " as [malf.current.real_name]" + else + text += "hardware destroyed" + text += ")" + + world << text + return 1 \ No newline at end of file diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index 781e2122a9..deb28d7689 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -5,6 +5,7 @@ var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds) var/const/meteordelay = 2000 var/nometeors = 1 + required_players = 0 uplink_welcome = "EVIL METEOR Uplink Console:" uplink_uses = 10 @@ -36,37 +37,28 @@ /datum/game_mode/meteor/declare_completion() - var/list/survivors = list() - var/area/escape_zone = locate(/area/shuttle/escape/centcom) - var/area/pod_zone = list( /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom ) - - for(var/mob/living/player in world) - if (player.client) - if (player.stat != 2) - var/turf/location = get_turf(player.loc) - if (location in escape_zone) - survivors[player.real_name] = "shuttle" - else if (location.loc.type in pod_zone) - survivors[player.real_name] = "pod" + var/text + var/survivors = 0 + for(var/mob/living/player in player_list) + if(player.stat != DEAD) + var/turf/location = get_turf(player.loc) + if(!location) continue + switch(location.loc.type) + if( /area/shuttle/escape/centcom ) + text += "
      [player.real_name] escaped on the emergency shuttle" + if( /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom ) + text += "
      [player.real_name] escaped in a life pod." else - survivors[player.real_name] = "alive" + text += "
      [player.real_name] survived but is stranded without any hope of rescue." + survivors++ - //feedback_set_details("round_end_result","end - evacuation") - //feedback_set("round_end_result",survivors.len) - - if (survivors.len) - world << "\blue The following survived the meteor attack!" - for(var/survivor in survivors) - var/condition = survivors[survivor] - switch(condition) - if("shuttle") - world << "\t [survivor] escaped on the shuttle!" - if("pod") - world << "\t [survivor] escaped on an escape pod!" - if("alive") - world << "\t [survivor] stayed alive. Whereabouts unknown." + if(survivors) + world << "\blue The following survived the meteor storm:[text]" else - world << "\blue No one survived the meteor attack!" + world << "\blue Nobody survived the meteor storm!" + + feedback_set_details("round_end_result","end - evacuation") + feedback_set("round_end_result",survivors) ..() return 1 diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 5e263094af..57feddf7ca 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -3,8 +3,8 @@ /var/const/meteor_wave_delay = 625 //minimum wait between waves in tenths of seconds //set to at least 100 unless you want evarr ruining every round -/var/const/meteors_in_wave = 10 //THIS should be better, Spess. -/var/const/meteors_in_small_wave = 4 +/var/const/meteors_in_wave = 50 +/var/const/meteors_in_small_wave = 10 /proc/meteor_wave(var/number = meteors_in_wave) if(!ticker || wavesecret) @@ -36,25 +36,25 @@ do switch(pick(1,2,3,4)) if(1) //NORTH - starty = world.maxy-15 - startx = rand(15, world.maxx-15) - endy = 15 - endx = rand(15, world.maxx-15) + starty = world.maxy-(TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + endy = TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) if(2) //EAST - starty = rand(15,world.maxy-15) - startx = world.maxx-15 - endy = rand(15, world.maxy-15) - endx = 15 + starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) + startx = world.maxx-(TRANSITIONEDGE+1) + endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) + endx = TRANSITIONEDGE if(3) //SOUTH - starty = 15 - startx = rand(15, world.maxx-15) - endy = world.maxy-15 - endx = rand(15, world.maxx-15) + starty = (TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + endy = world.maxy-TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) if(4) //WEST - starty = rand(15, world.maxy-15) - startx = 15 - endy = rand(15,world.maxy-15) - endx = world.maxx-15 + starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) + startx = (TRANSITIONEDGE+1) + endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) + endx = world.maxx-TRANSITIONEDGE pickedstart = locate(startx, starty, 1) pickedgoal = locate(endx, endy, 1) @@ -82,7 +82,7 @@ /obj/effect/meteor name = "meteor" - icon = 'meteor.dmi' + icon = 'icons/obj/meteor.dmi' icon_state = "flaming" density = 1 anchored = 1.0 @@ -96,10 +96,9 @@ pass_flags = PASSTABLE | PASSGRILLE /obj/effect/meteor/Move() -// var/turf/T = src.loc - //FUCK YOU. FUCK YOU ALL, METEORS. ~Hawk. - /*if (istype(T, /turf)) - T.hotspot_expose(METEOR_TEMPERATURE, 1000) */ + var/turf/T = src.loc + if (istype(T, /turf)) + T.hotspot_expose(METEOR_TEMPERATURE, 1000) ..() return @@ -110,9 +109,15 @@ shake_camera(M, 3, 1) if (A) A.meteorhit(src) - playsound(src.loc, 'meteorimpact.ogg', 40, 1) + playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) if (--src.hits <= 0) - if(prob(15))// && !istype(A, /obj/structure/grille)) + + //Prevent meteors from blowing up the singularity's containment. + //Changing emitter and generator ex_act would result in them being bomb and C4 proof. + if(!istype(A,/obj/machinery/emitter) && \ + !istype(A,/obj/machinery/field_generator) && \ + prob(15)) + explosion(src.loc, 4, 5, 6, 7, 0) playsound(src.loc, "explosion", 50, 1) del(src) @@ -134,12 +139,19 @@ Bump(atom/A) spawn(0) + //Prevent meteors from blowing up the singularity's containment. + //Changing emitter and generator ex_act would result in them being bomb and C4 proof + if(!istype(A,/obj/machinery/emitter) && \ + !istype(A,/obj/machinery/field_generator)) + if(--src.hits <= 0) + del(src) //Dont blow up singularity containment if we get stuck there. + for(var/mob/M in range(10, src)) if(!M.stat && !istype(M, /mob/living/silicon/ai)) //bad idea to shake an ai's view shake_camera(M, 3, 1) if (A) explosion(src.loc, 0, 1, 2, 3, 0) - playsound(src.loc, 'meteorimpact.ogg', 40, 1) + playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) if (--src.hits <= 0) if(prob(15) && !istype(A, /obj/structure/grille)) explosion(src.loc, 1, 2, 3, 4, 0) @@ -151,4 +163,51 @@ if(istype(W, /obj/item/weapon/pickaxe)) del(src) return - ..() \ No newline at end of file + ..() + +/* +//Testing purposes only! +/obj/item/weapon/meteorgun + name = "Meteor Gun" + desc = "This beast fires meteors!. TESTING PURPOSES ONLY, This gun is incomplete!" + icon = 'icons/obj/gun.dmi' + icon_state = "lasercannon" + item_state = "gun" + +/obj/item/weapon/meteorgun/attack_self() + var/start_x = usr.loc.x + var/start_y = usr.loc.y + var/start_z = usr.loc.z + var/end_x = 0 + var/end_y = 0 + var/end_z = 0 + + switch(usr.dir) + if(NORTH) + end_x = start_x + end_y = world.maxy-TRANSITIONEDGE + if(SOUTH) + end_x = start_x + end_y = TRANSITIONEDGE + if(EAST) + end_x = world.maxx-TRANSITIONEDGE + end_y = start_y + if(WEST) + end_x = TRANSITIONEDGE + end_y = start_y + else //north + end_x = start_x + end_y = TRANSITIONEDGE + end_z = start_z + + var/start = locate(start_x, start_y, start_z) + var/end = locate(end_x, end_y, end_z) + var/obj/effect/meteor/M = new /obj/effect/meteor(start) + + M.dest = end + + spawn(0) + walk_towards(M, M.dest, 1) + + return +*/ \ No newline at end of file diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index edcde4d290..e7f9cdbedb 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -5,8 +5,8 @@ /datum/game_mode/nuclear name = "nuclear emergency" config_tag = "nuclear" - required_players = 3 - required_enemies = 2 + required_players = 15 + required_enemies = 5 recommended_enemies = 5 uplink_welcome = "Corporate Backed Uplink Console:" @@ -25,7 +25,7 @@ /datum/game_mode/nuclear/announce() world << "The current game mode is - Nuclear Emergency!" world << "A [syndicate_name()] Strike Force is approaching [station_name()]!" - world << "A nuclear explosive was being transported by NanoTrasen to a military base. The transport ship mysteriously lost contact with Space Traffic Control (STC). About that time a strange disk was discovered around [station_name()]. It was identified by NanoTrasen as a nuclear auth. disk and now Syndicate Operatives have arrived to retake the disk and detonate SS13! Also, most likely Syndicate star ships are in the vicinity so take care not to lose the disk!\nSyndicate: Reclaim the disk and detonate the nuclear bomb anywhere on SS13.\nPersonnel: Hold the disk and escape with the disk on the shuttle!" + world << "A nuclear explosive was being transported by Nanotrasen to a military base. The transport ship mysteriously lost contact with Space Traffic Control (STC). About that time a strange disk was discovered around [station_name()]. It was identified by Nanotrasen as a nuclear auth. disk and now Syndicate Operatives have arrived to retake the disk and detonate SS13! Also, most likely Syndicate star ships are in the vicinity so take care not to lose the disk!\nSyndicate: Reclaim the disk and detonate the nuclear bomb anywhere on SS13.\nPersonnel: Hold the disk and escape with the disk on the shuttle!" /datum/game_mode/nuclear/can_start()//This could be better, will likely have to recode it later if(!..()) @@ -45,10 +45,8 @@ agent_number = possible_syndicates.len var/n_players = num_players() - if(agent_number > (n_players - agent_number)) - agent_number = (n_players - agent_number)/2 - if(agent_number < required_enemies) - agent_number = required_enemies + if(agent_number > n_players) + agent_number = n_players/2 while(agent_number > 0) var/datum/mind/new_syndicate = pick(possible_syndicates) @@ -75,23 +73,21 @@ if(synd_mind.current.client) for(var/image/I in synd_mind.current.client.images) if(I.icon_state == "synd") - synd_mind.current.client.images -= I + del(I) for(var/datum/mind/synd_mind in syndicates) if(synd_mind.current) if(synd_mind.current.client) for(var/datum/mind/synd_mind_1 in syndicates) if(synd_mind_1.current) - var/image/I = synd_mind_1.current.antag_img - I.icon_state = "synd" + var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd") synd_mind.current.client.images += I /datum/game_mode/proc/update_synd_icons_added(datum/mind/synd_mind) spawn(0) if(synd_mind.current) if(synd_mind.current.client) - var/image/I = synd_mind.current.antag_img - I.icon_state = "synd" + var/I = image('icons/mob/mob.dmi', loc = synd_mind.current, icon_state = "synd") synd_mind.current.client.images += I /datum/game_mode/proc/update_synd_icons_removed(datum/mind/synd_mind) @@ -101,56 +97,22 @@ if(synd.current.client) for(var/image/I in synd.current.client.images) if(I.icon_state == "synd" && I.loc == synd_mind.current) - synd.current.client.images -= I + del(I) if(synd_mind.current) if(synd_mind.current.client) for(var/image/I in synd_mind.current.client.images) if(I.icon_state == "synd") - synd_mind.current.client.images -= I + del(I) //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// /datum/game_mode/nuclear/post_setup() - var/obj/effect/landmark/synd_spawn = locate("landmark*Syndicate-Spawn") - var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb") - var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet") - var/nuke_code = "[rand(10000, 99999)]" - var/leader_selected = 0 - var/freq = random_radio_frequency() - radiochannels += list("Nuclear" = freq) - NUKE_FREQ = freq - //var/agent_number = 1 + var/list/turf/synd_spawn = list() - for(var/datum/mind/synd_mind in syndicates) - synd_mind.current.loc = get_turf(synd_spawn) - - forge_syndicate_objectives(synd_mind) - greet_syndicate(synd_mind) - - - if(!leader_selected) - prepare_syndicate_leader(synd_mind, nuke_code) - leader_selected = 1 -/* else - synd_mind.current.real_name = "[syndicate_name()] Operative #[agent_number]" - agent_number++*/ - - equip_syndicate(synd_mind.current,freq) - update_synd_icons_added(synd_mind) - - update_all_synd_icons() - - if(nuke_spawn) - var/obj/machinery/nuclearbomb/the_bomb = new /obj/machinery/nuclearbomb(nuke_spawn.loc) - the_bomb.r_code = nuke_code - - if(closet_spawn) - new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc) - - for (var/obj/effect/landmark/A in world) + for(var/obj/effect/landmark/A in world) if (A.name == "Syndicate-Gear-Closet") new /obj/structure/closet/syndicate/personal(A.loc) del(A) @@ -161,6 +123,46 @@ del(A) continue + if(A.name == "Syndicate-Spawn") + synd_spawn += get_turf(A) + del(A) + continue + + var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb") + var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet") + + var/nuke_code = "[rand(10000, 99999)]" + var/leader_selected = 0 + var/agent_number = 1 + var/spawnpos = 1 + + for(var/datum/mind/synd_mind in syndicates) + if(spawnpos > synd_spawn.len) + spawnpos = 1 + synd_mind.current.loc = synd_spawn[spawnpos] + + forge_syndicate_objectives(synd_mind) + greet_syndicate(synd_mind) + equip_syndicate(synd_mind.current) + + if(!leader_selected) + prepare_syndicate_leader(synd_mind, nuke_code) + leader_selected = 1 + else + synd_mind.current.real_name = "[syndicate_name()] Operative #[agent_number]" + agent_number++ + spawnpos++ + update_synd_icons_added(synd_mind) + + update_all_synd_icons() + + if(nuke_spawn && synd_spawn.len > 0) + var/obj/machinery/nuclearbomb/the_bomb = new /obj/machinery/nuclearbomb(nuke_spawn.loc) + the_bomb.r_code = nuke_code + + if(closet_spawn) + new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc) + spawn (rand(waittime_l, waittime_h)) send_intercept() @@ -168,10 +170,10 @@ /datum/game_mode/proc/prepare_syndicate_leader(var/datum/mind/synd_mind, var/nuke_code) -/* var/leader_title = pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord") + var/leader_title = pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord") spawn(1) NukeNameAssign(nukelastname(synd_mind.current),syndicates) //allows time for the rest of the syndies to be chosen - synd_mind.current.real_name = "[syndicate_name()] [leader_title]"*/ + synd_mind.current.real_name = "[syndicate_name()] [leader_title]" if (nuke_code) synd_mind.store_memory("Syndicate Nuclear Bomb Code: [nuke_code]", 0, 0) synd_mind.current << "The nuclear authorization code is: [nuke_code]" @@ -182,20 +184,13 @@ P.loc = synd_mind.current.loc else var/mob/living/carbon/human/H = synd_mind.current - var/list/slots = list ( - "backpack" = H.slot_in_backpack, - "left pocket" = H.slot_l_store, - "right pocket" = H.slot_r_store, - "left hand" = H.slot_l_hand, - "right hand" = H.slot_r_hand, - ) - var/where = H.equip_in_one_of_slots(P, slots, del_on_fail=0) - if (!where) - P.loc = H.loc + P.loc = H.loc + H.equip_to_slot_or_del(P, slot_r_store, 0) + H.update_icons() else nuke_code = "code will be provided later" - synd_mind.current << "Nuclear Explosives 101:\n\tHello and thank you for choosing the Syndicate for your nuclear information needs.\nToday's crash course will deal with the operation of a Fusion Class NanoTrasen made Nuclear Device.\nFirst and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.\nPressing any button on the compacted bomb will cause it to extend and bolt itself into place.\nIf this is done to unbolt it one must compeltely log in which at this time may not be possible.\nTo make the device functional:\n1. Place bomb in designated detonation zone\n2. Extend and anchor bomb (attack with hand).\n3. Insert Nuclear Auth. Disk into slot.\n4. Type numeric code into keypad ([nuke_code]).\n\tNote: If you make a mistake press R to reset the device.\n5. Press the E button to log onto the device\nYou now have activated the device. To deactivate the buttons at anytime for example when\nyou've already prepped the bomb for detonation remove the auth disk OR press the R ont he keypad.\nNow the bomb CAN ONLY be detonated using the timer. A manual det. is not an option.\n\tNote: NanoTrasen is a pain in the neck.\nToggle off the SAFETY.\n\tNote: You wouldn't believe how many Syndicate Operatives with doctorates have forgotten this step\nSo use the - - and + + to set a det time between 5 seconds and 10 minutes.\nThen press the timer toggle button to start the countdown.\nNow remove the auth. disk so that the buttons deactivate.\n\tNote: THE BOMB IS STILL SET AND WILL DETONATE\nNow before you remove the disk if you need to move the bomb you can:\nToggle off the anchor, move it, and re-anchor.\n\nGood luck. Remember the order:\nDisk, Code, Safety, Timer, Disk, RUN!\nIntelligence Analysts believe that they are hiding the disk in the bridge. Your space ship will not leave until the bomb is armed and timing.\nGood luck!" + synd_mind.current << "Nuclear Explosives 101:\n\tHello and thank you for choosing the Syndicate for your nuclear information needs.\nToday's crash course will deal with the operation of a Fusion Class Nanotrasen made Nuclear Device.\nFirst and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.\nPressing any button on the compacted bomb will cause it to extend and bolt itself into place.\nIf this is done to unbolt it one must compeltely log in which at this time may not be possible.\nTo make the device functional:\n1. Place bomb in designated detonation zone\n2. Extend and anchor bomb (attack with hand).\n3. Insert Nuclear Auth. Disk into slot.\n4. Type numeric code into keypad ([nuke_code]).\n\tNote: If you make a mistake press R to reset the device.\n5. Press the E button to log onto the device\nYou now have activated the device. To deactivate the buttons at anytime for example when\nyou've already prepped the bomb for detonation remove the auth disk OR press the R ont he keypad.\nNow the bomb CAN ONLY be detonated using the timer. A manual det. is not an option.\n\tNote: Nanotrasen is a pain in the neck.\nToggle off the SAFETY.\n\tNote: You wouldn't believe how many Syndicate Operatives with doctorates have forgotten this step\nSo use the - - and + + to set a det time between 5 seconds and 10 minutes.\nThen press the timer toggle button to start the countdown.\nNow remove the auth. disk so that the buttons deactivate.\n\tNote: THE BOMB IS STILL SET AND WILL DETONATE\nNow before you remove the disk if you need to move the bomb you can:\nToggle off the anchor, move it, and re-anchor.\n\nGood luck. Remember the order:\nDisk, Code, Safety, Timer, Disk, RUN!\nIntelligence Analysts believe that they are hiding the disk in the bridge. Your space ship will not leave until the bomb is armed and timing.\nGood luck!" return @@ -215,33 +210,34 @@ return -/datum/game_mode/proc/random_radio_frequency(var/tempfreq = 1459) - tempfreq = rand(1200,1600) - if(tempfreq in radiochannels || (tempfreq > 1441 && tempfreq < 1489)) - random_radio_frequency(tempfreq) - return tempfreq +/datum/game_mode/proc/random_radio_frequency() + return 1337 // WHY??? -- Doohl -/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob,radio_freq) - var/obj/item/device/radio/R = new /obj/item/device/radio/headset/nuclear(synd_mob) - synd_mob.equip_if_possible(R, synd_mob.slot_ears) - synd_mob.equip_if_possible(new /obj/item/clothing/under/syndicate(synd_mob), synd_mob.slot_w_uniform) - synd_mob.equip_if_possible(new /obj/item/clothing/shoes/black(synd_mob), synd_mob.slot_shoes) - synd_mob.equip_if_possible(new /obj/item/clothing/suit/armor/vest(synd_mob), synd_mob.slot_wear_suit) - synd_mob.equip_if_possible(new /obj/item/clothing/gloves/swat(synd_mob), synd_mob.slot_gloves) - synd_mob.equip_if_possible(new /obj/item/clothing/head/helmet/swat(synd_mob), synd_mob.slot_head) - synd_mob.equip_if_possible(new /obj/item/weapon/card/id/syndicate(synd_mob), synd_mob.slot_wear_id) - synd_mob.equip_if_possible(new /obj/item/weapon/storage/backpack(synd_mob), synd_mob.slot_back) - synd_mob.equip_if_possible(new /obj/item/ammo_magazine/a12mm(synd_mob), synd_mob.slot_in_backpack) - synd_mob.equip_if_possible(new /obj/item/ammo_magazine/a12mm(synd_mob), synd_mob.slot_in_backpack) - synd_mob.equip_if_possible(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), synd_mob.slot_in_backpack) - synd_mob.equip_if_possible(new /obj/item/weapon/gun/projectile/automatic/c20r(synd_mob), synd_mob.slot_belt) - synd_mob.equip_if_possible(new /obj/item/weapon/storage/box/engineer(synd_mob.back), synd_mob.slot_in_backpack) - var/datum/organ/external/O = synd_mob.organs[pick(synd_mob.organs)] - var/obj/item/weapon/implant/dexplosive/E = new/obj/item/weapon/implant/dexplosive(O) - O.implant += E +/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob) + var/radio_freq = SYND_FREQ + + var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(synd_mob) + R.set_frequency(radio_freq) + synd_mob.equip_to_slot_or_del(R, slot_ears) + + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(synd_mob), slot_shoes) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(synd_mob), slot_gloves) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(synd_mob), slot_head) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/card/id/syndicate(synd_mob), slot_wear_id) + if(synd_mob.backbag == 2) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(synd_mob), slot_back) + if(synd_mob.backbag == 3) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(synd_mob), slot_back) + synd_mob.equip_to_slot_or_del(new /obj/item/ammo_magazine/a50(synd_mob), slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/ammo_magazine/a50(synd_mob), slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/deagle(synd_mob), slot_belt) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(synd_mob.back), slot_in_backpack) + var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob) E.imp_in = synd_mob E.implanted = 1 + synd_mob.update_icons() return 1 @@ -326,17 +322,25 @@ /datum/game_mode/proc/auto_declare_completion_nuclear() - if (syndicates.len!=0 || (ticker && istype(ticker.mode,/datum/game_mode/nuclear))) - world << "The Syndicate operatives were: " - for(var/datum/mind/mind in syndicates) - var/text = "" - if(mind.current) - text += "[mind.key] was [mind.current.real_name]" - if(mind.current.stat == 2) - text += " (Dead)" + if( syndicates.len || (ticker && istype(ticker.mode,/datum/game_mode/nuclear)) ) + var/text = "The syndicate operatives were:" + + for(var/datum/mind/syndicate in syndicates) + + text += "
      [syndicate.key] was [syndicate.name] (" + if(syndicate.current) + if(syndicate.current.stat == DEAD) + text += "died" + else + text += "survived" + if(syndicate.current.real_name != syndicate.name) + text += " as [syndicate.current.real_name]" else - text += "[mind.key] (character destroyed)" - world << text + text += "body destroyed" + text += ")" + + world << text + return 1 /proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho. @@ -356,9 +360,9 @@ /proc/NukeNameAssign(var/lastname,var/list/syndicates) for(var/datum/mind/synd_mind in syndicates) switch(synd_mind.current.gender) - if("male") - synd_mind.current.real_name = "[pick(first_names_male)] [lastname]" - if("female") - synd_mind.current.real_name = "[pick(first_names_female)] [lastname]" - + if(MALE) + synd_mind.name = "[pick(first_names_male)] [lastname]" + if(FEMALE) + synd_mind.name = "[pick(first_names_female)] [lastname]" + synd_mind.current.real_name = synd_mind.name return \ No newline at end of file diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 42ae74c5ca..4168fbcc43 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -1,13 +1,12 @@ /obj/machinery/nuclearbomb + name = "\improper Nuclear Fission Explosive" desc = "Uh oh. RUN!!!!" - name = "Nuclear Fission Explosive" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "nuclearbomb0" density = 1 var/deployable = 0.0 var/extended = 0.0 - var/timeleft = 1200 - var/time_actual = 0 + var/timeleft = 60.0 var/timing = 0.0 var/r_code = "ADMIN" var/code = "" @@ -23,7 +22,9 @@ /obj/machinery/nuclearbomb/process() if (src.timing) - if((time_actual <= world.timeofday) && ((world.timeofday + (time_actual - world.timeofday)) <= 864000) ) + bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed. + src.timeleft-- + if (src.timeleft <= 0) explode() for(var/mob/M in viewers(1, src)) if ((M.client && M.machine == src)) @@ -35,23 +36,18 @@ /obj/machinery/nuclearbomb/attack_hand(mob/user as mob) if (src.extended) - var/time_left = time2text(time_actual-world.timeofday, "mm:ss") - if(world.timeofday + (time_actual - world.timeofday) >= 864000) - time_left = time2text(time_actual-(864000 - world.timeofday), "mm:ss") - if(!timing) - time_left = time2text(timeleft, "mm:ss") user.machine = src var/dat = text("Nuclear Fission Explosive
      \nAuth. Disk: []
      ", src, (src.auth ? "++++++++++" : "----------")) if (src.auth) if (src.yes_code) - dat += text("\nStatus: []-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: --- [] +++
      \n
      \nSafety: [] Toggle
      \nAnchor: [] Toggle
      \n", (src.timing ? "Func/Set" : "Functional"), (src.safety ? "Safe" : "Engaged"), time_left, (src.timing ? "On" : "Off"), src, src, src, src, time_left, src, src, src, (src.safety ? "On" : "Off"), src, (src.anchored ? "Engaged" : "Off"), src) + dat += text("\nStatus: []-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: - - [] + +
      \n
      \nSafety: [] Toggle
      \nAnchor: [] Toggle
      \n", (src.timing ? "Func/Set" : "Functional"), (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src, src, src, src.timeleft, src, src, (src.safety ? "On" : "Off"), src, (src.anchored ? "Engaged" : "Off"), src) else - dat += text("\nStatus: Auth. S2-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: --- [] +++
      \n
      \n[] Safety: Toggle
      \nAnchor: [] Toggle
      \n", (src.safety ? "Safe" : "Engaged"), time_left, (src.timing ? "On" : "Off"), time_left, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) + dat += text("\nStatus: Auth. S2-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: - - [] + +
      \n
      \n[] Safety: Toggle
      \nAnchor: [] Toggle
      \n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) else if (src.timing) - dat += text("\nStatus: Set-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: --- [] +++
      \n
      \nSafety: [] Toggle
      \nAnchor: [] Toggle
      \n", (src.safety ? "Safe" : "Engaged"), time_left, (src.timing ? "On" : "Off"), time_left, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) + dat += text("\nStatus: Set-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: - - [] + +
      \n
      \nSafety: [] Toggle
      \nAnchor: [] Toggle
      \n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) else - dat += text("\nStatus: Auth. S1-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: --- [] +++
      \n
      \nSafety: [] Toggle
      \nAnchor: [] Toggle
      \n", (src.safety ? "Safe" : "Engaged"), time_left, (src.timing ? "On" : "Off"), time_left, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) + dat += text("\nStatus: Auth. S1-[]
      \nTimer: []
      \n
      \nTimer: [] Toggle
      \nTime: - - [] + +
      \n
      \nSafety: [] Toggle
      \nAnchor: [] Toggle
      \n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off")) var/message = "AUTH" if (src.auth) message = text("[]", src.code) @@ -92,7 +88,7 @@ src.yes_code = 0 src.auth = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/disk/nuclear)) usr.drop_item() I.loc = src @@ -116,26 +112,29 @@ if (src.yes_code) if (href_list["time"]) var/time = text2num(href_list["time"]) - timeleft = min(max(time + (timeleft/10), 120), 900) * 10 + src.timeleft += time + src.timeleft = min(max(round(src.timeleft), 60), 600) if (href_list["timer"]) - if (timing == -1.0) + if (src.timing == -1.0) return - timing = !( timing ) - if (timing) - time_actual = world.timeofday + timeleft - if(time_actual >= 864000) - time_actual -= 864000 + if (src.safety) + usr << "\red The safety is still on." + return + src.timing = !( src.timing ) + if (src.timing) src.icon_state = "nuclearbomb2" if(!src.safety) bomb_set = 1//There can still be issues with this reseting when there are multiple bombs. Not a big deal tho for Nuke/N + else + bomb_set = 0 else - timeleft = time_actual - world.timeofday - if(timeleft < 0) - timeleft += 864000 src.icon_state = "nuclearbomb1" bomb_set = 0 if (href_list["safety"]) src.safety = !( src.safety ) + if(safety) + src.timing = 0 + bomb_set = 0 if (href_list["anchor"]) src.anchored = !( src.anchored ) src.add_fingerprint(usr) @@ -163,13 +162,12 @@ /obj/machinery/nuclearbomb/proc/explode() if (src.safety) src.timing = 0 - timeleft = 0 return src.timing = -1.0 src.yes_code = 0 src.safety = 1 src.icon_state = "nuclearbomb3" - playsound(src,'Alarm.ogg',100,0,5) + playsound(src,'sound/machines/Alarm.ogg',100,0,5) if (ticker && ticker.mode) ticker.mode.explosion_in_progress = 1 sleep(100) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 4c528f5f5a..8f6e9a7bcc 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -1,6 +1,6 @@ /obj/item/weapon/pinpointer name = "pinpointer" - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "pinoff" flags = FPRINT | TABLEPASS| CONDUCT slot_flags = SLOT_BELT @@ -51,7 +51,7 @@ /obj/item/weapon/pinpointer/advpinpointer name = "Advanced Pinpointer" - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' desc = "A larger version of the normal pinpointer, this unit features a helpful quantum entanglement detection system to locate various objects that do not broadcast a locator signal." var/mode = 0 // Mode 0 locates disk, mode 1 locates coordinates. var/turf/location = null @@ -148,7 +148,7 @@ mode = 2 switch(alert("Search for item signature or DNA fragment?" , "Signature Mode Select" , "" , "Item" , "DNA")) if("Item") -/* var/datum/objective/steal/itemlist + var/datum/objective/steal/itemlist itemlist = itemlist // To supress a 'variable defined but not used' error. var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in itemlist.possible_items if(!targetitem) @@ -157,13 +157,12 @@ if(!target) usr << "Failed to locate [targetitem]!" return - usr << "You set the pinpointer to locate [targetitem]"*/ - usr << "This doesn't work yet." + usr << "You set the pinpointer to locate [targetitem]" if("DNA") var/DNAstring = input("Input DNA string to search for." , "Please Enter String." , "") if(!DNAstring) return - for(var/mob/living/carbon/M in world) + for(var/mob/living/carbon/M in mob_list) if(!M.dna) continue if(M.dna.unique_enzymes == DNAstring) @@ -174,8 +173,89 @@ +/obj/item/weapon/pinpointer/nukeop//Used by nuke ops specifically so they can get their asses back to the shuttle + var/mode = 0 // Mode 0 locates disk, mode 1 locates the shuttle + var/location = null//Follow that shuttle! + var/obj/machinery/computer/syndicate_station/home = null + attack_self() + if(!active) + active = 1 + if(mode == 0) + workdisk() + usr << "\blue Authentication Disk Locator active." + if(mode == 1) + worklocation() + usr << "\blue Shuttle Locator active." + else + active = 0 + icon_state = "pinoff" + usr << "\blue You deactivate the pinpointer" +/obj/item/weapon/pinpointer/nukeop/workdisk() + if(!active) return + if(mode)//Check in case the mode changes while operating + worklocation() + return + if(bomb_set)//If the bomb is set, lead to the shuttle + mode = 1//Ensures worklocation() continues to work + worklocation() + playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)//Plays a beep + for (var/mob/O in hearers(1, src.loc)) + O.show_message(text("Shuttle Locator active."))//Lets the mob holding it know that the mode has changed + return//Get outta here + if(!the_disk) + the_disk = locate() + if(!the_disk) + icon_state = "pinonnull" + return + if(src.loc.z >1)//If you are on a different z-level from the station + icon_state = "pinonalert" + else + src.dir = get_dir(src,the_disk) + switch(get_dist(src,the_disk)) + if(0) + icon_state = "pinondirect" + if(1 to 8) + icon_state = "pinonclose" + if(9 to 16) + icon_state = "pinonmedium" + if(16 to INFINITY) + icon_state = "pinonfar" + spawn(5) .() + +/obj/item/weapon/pinpointer/nukeop/proc/worklocation() + if(!active) + return + if(!mode) + workdisk() + return + if(!bomb_set) + mode = 0 + workdisk() + playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(2, src.loc)) + O.show_message(text("Authentication Disk Locator active.")) + if(!home) + home = locate() + if(!home) + icon_state = "pinonnull" + return + if(src.loc.z >2)//If you are on a different z-level from the shuttle + icon_state = "pinonalert" + else + src.dir = get_dir(src,home) + switch(get_dist(src,home)) + if(0) + icon_state = "pinondirect" + if(1 to 8) + icon_state = "pinonclose" + if(9 to 16) + icon_state = "pinonmedium" + if(16 to INFINITY) + icon_state = "pinonfar" + + spawn(5) .() /*/obj/item/weapon/pinpointer/New() diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 84c6655ac5..e4b02356af 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 datum/objective var/datum/mind/owner = null //Who owns the objective. @@ -16,7 +16,7 @@ datum/objective proc/find_target() var/list/possible_targets = list() for(var/datum/mind/possible_target in ticker.minds) - if(possible_target != owner && ishuman(possible_target.current)) + if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2)) possible_targets += possible_target if(possible_targets.len > 0) target = pick(possible_targets) @@ -30,44 +30,11 @@ datum/objective -datum/objective/decapitate - find_target() - ..() - if(target && target.current) - explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of him, and bring us his severed head." - else - explanation_text = "Free Objective" - return target - - - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of him, and bring us his severed head." - else - explanation_text = "Free Objective" - return target - - - check_completion() - if(target && target.current) - if(!owner.current||owner.current.stat==2)//If you're otherwise dead. - return 0 - var/list/all_items = owner.current.get_contents() - for(var/obj/item/weapon/organ/head/mmi in all_items) - if(mmi.brainmob&&mmi.brainmob.mind==target) - return 1 - return 0 - else - return 1 - - - datum/objective/assassinate find_target() ..() if(target && target.current) - explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]." + explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." else explanation_text = "Free Objective" return target @@ -76,7 +43,7 @@ datum/objective/assassinate find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) - explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." + explanation_text = "Assassinate [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" return target @@ -84,12 +51,10 @@ datum/objective/assassinate check_completion() if(target && target.current) - if(target.current.stat == 2 || istype(target.current.loc.loc, /area/tdome) || issilicon(target.current) || isbrain(target.current)) //Assuming this works, people in the thunderdome and borgs now count as dead for traitor objectives. --NeoFite + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current)) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite return 1 - else - return 0 - else - return 1 + return 0 + return 1 @@ -97,7 +62,7 @@ datum/objective/mutiny find_target() ..() if(target && target.current) - explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]." + explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." else explanation_text = "Free Objective" return target @@ -106,24 +71,20 @@ datum/objective/mutiny find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) - explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." + explanation_text = "Assassinate [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" return target - check_completion() if(target && target.current) - var/turf/T = get_turf(target.current) - if(target.current.stat == 2) + if(target.current.stat == DEAD) return 1 - else if((T) && (T.z != 1))//If they leave the station they count as dead for this + var/turf/T = get_turf(target.current) + if(T && (T.z != 1)) //If they leave the station they count as dead for this return 2 - else - return 0 - else - return 1 - + return 0 + return 1 datum/objective/debrain//I want braaaainssss @@ -139,31 +100,31 @@ datum/objective/debrain//I want braaaainssss find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) - explanation_text = "Steal the brain of [target.current.real_name] the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." + explanation_text = "Steal the brain of [target.current.real_name] the [!role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" return target - check_completion() if(!target)//If it's a free objective. return 1 - if(!owner.current||owner.current.stat==2)//If you're otherwise dead. + if( !owner.current || owner.current.stat==DEAD )//If you're otherwise dead. return 0 - var/list/all_items = owner.current.get_contents() - for(var/obj/item/device/mmi/mmi in all_items) - if(mmi.brainmob&&mmi.brainmob.mind==target) return 1 - for(var/obj/item/brain/brain in all_items) - if(brain.brainmob&&brain.brainmob.mind==target) return 1 + if( !target.current || !isbrain(target.current) ) + return 0 + var/atom/A = target.current + while(A.loc) //check to see if the brainmob is on our person + A = A.loc + if(A == owner.current) + return 1 return 0 - datum/objective/protect//The opposite of killing a dude. find_target() ..() if(target && target.current) - explanation_text = "Protect [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]." + explanation_text = "Protect [target.current.real_name], the [target.assigned_role]." else explanation_text = "Free Objective" return target @@ -172,48 +133,42 @@ datum/objective/protect//The opposite of killing a dude. find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) - explanation_text = "Protect [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." + explanation_text = "Protect [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" return target - check_completion() - if(!target)//If it's a free objective. + if(!target) //If it's a free objective. return 1 if(target.current) - if(target.current.stat == 2 || istype(target.current.loc.loc, /area/tdome) || issilicon(target.current) || isbrain(target.current)) + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current)) return 0 - else - return 1 - else - return 0 - + return 1 + return 0 datum/objective/hijack explanation_text = "Hijack the emergency shuttle by escaping alone." - check_completion() - if(istype(owner.current, /mob/living/silicon)) + if(!owner.current || owner.current.stat) return 0 if(emergency_shuttle.location<2) return 0 - if(!owner.current || owner.current.stat) + if(issilicon(owner.current)) return 0 var/area/shuttle = locate(/area/shuttle/escape/centcom) - var/protected_mobs[] = list(/mob/living/silicon/ai, /mob/living/silicon/pai) - for(var/mob/living/player in world) + var/list/protected_mobs = list(/mob/living/silicon/ai, /mob/living/silicon/pai) + for(var/mob/living/player in player_list) if(player.type in protected_mobs) continue if (player.mind && (player.mind != owner)) - if (!player.stat) //they're not dead or in crit - if (get_turf(player) in shuttle) + if(player.stat != DEAD) //they're not dead! + if(get_turf(player) in shuttle) return 0 return 1 - datum/objective/block explanation_text = "Do not allow any humans to escape on the shuttle alive." @@ -227,7 +182,7 @@ datum/objective/block return 0 var/area/shuttle = locate(/area/shuttle/escape/centcom) var/protected_mobs[] = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot) - for(var/mob/living/player in world) + for(var/mob/living/player in player_list) if(player.type in protected_mobs) continue if (player.mind) if (player.stat != 2) @@ -235,6 +190,24 @@ datum/objective/block return 0 return 1 +datum/objective/silence + explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left." + + check_completion() + if(emergency_shuttle.location<2) + return 0 + + for(var/mob/living/player in player_list) + if(player == owner.current) + continue + if(player.mind) + if(player.stat != DEAD) + var/turf/T = get_turf(player) + if(!T) continue + switch(T.loc.type) + if(/area/shuttle/escape/centcom, /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom) + return 0 + return 1 datum/objective/escape @@ -260,6 +233,14 @@ datum/objective/escape var/area/check_area = location.loc if(istype(check_area, /area/shuttle/escape/centcom)) return 1 + if(istype(check_area, /area/shuttle/escape_pod1/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod2/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod3/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod5/centcom)) + return 1 else return 0 @@ -268,16 +249,14 @@ datum/objective/escape datum/objective/survive explanation_text = "Stay alive until the end." - check_completion() + if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current)) + return 0 //Brains no longer win survive objectives. --NEO if(issilicon(owner.current) && owner.current != owner.original) return 0 - if(!owner.current || owner.current.stat == 2 || isbrain(owner.current)) //Brains no longer win survive objectives. --NEO - return 0 return 1 - datum/objective/nuclear explanation_text = "Destroy the station with a nuclear device." @@ -294,7 +273,7 @@ datum/objective/steal "a jetpack" = /obj/item/weapon/tank/jetpack, "a captains jumpsuit" = /obj/item/clothing/under/rank/captain, "a functional AI" = /obj/item/device/aicard, - /*"a pair of magboots" = /obj/item/clothing/shoes/magboots,*/ + "a pair of magboots" = /obj/item/clothing/shoes/magboots, "the station blueprints" = /obj/item/blueprints, "a nasa voidsuit" = /obj/item/clothing/suit/space/nasavoid, "28 moles of plasma (full tank)" = /obj/item/weapon/tank, @@ -352,33 +331,30 @@ datum/objective/steal if("28 moles of plasma (full tank)","10 diamonds","50 gold bars","25 refined uranium bars") var/target_amount = text2num(target_name)//Non-numbers are ignored. var/found_amount = 0.0//Always starts as zero. - for(var/obj/item/I in all_items) - if(!istype(I, steal_target)) continue//If it's not actually that item. - found_amount += (target_name=="28 moles of plasma (full tank)" ? (I:air_contents:toxins) : (I:amount)) + + for(var/obj/item/I in all_items) //Check for plasma tanks + if(istype(I, steal_target)) + found_amount += (target_name=="28 moles of plasma (full tank)" ? (I:air_contents:toxins) : (I:amount)) return found_amount>=target_amount + if("50 coins (in bag)") var/obj/item/weapon/moneybag/B = locate() in all_items + if(B) var/target = text2num(target_name) var/found_amount = 0.0 for(var/obj/item/weapon/coin/C in B) found_amount++ return found_amount>=target + if("a functional AI") -// world << "dude's after an AI, time to check for one." - for(var/obj/item/device/aicard/C in all_items) -// world << "Found an intelicard, checking it for an AI" + for(var/obj/item/device/aicard/C in all_items) //Check for ai card for(var/mob/living/silicon/ai/M in C) -// world << "Found an AI, checking if it's alive" - if(istype(M, /mob/living/silicon/ai) && M.stat != 2) -// world << "yay, you win!" - return 1 - for(var/mob/living/silicon/ai/M in world) - if(istype(M.loc, /turf)) - if(istype(get_area(M), /area/shuttle/escape)) + if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card. return 1 else - for(var/obj/I in all_items) + + for(var/obj/I in all_items) //Check for items if(istype(I, steal_target)) return 1 return 0 @@ -456,11 +432,11 @@ datum/objective/absorb if (ticker) var/n_p = 1 //autowin if (ticker.current_state == GAME_STATE_SETTING_UP) - for(var/mob/new_player/P in world) + for(var/mob/new_player/P in player_list) if(P.client && P.ready && P.mind!=owner) n_p ++ else if (ticker.current_state == GAME_STATE_PLAYING) - for(var/mob/living/carbon/human/P in world) + for(var/mob/living/carbon/human/P in player_list) if(P.client && !(P.mind in ticker.mode.changelings) && P.mind!=owner) n_p ++ target_amount = min(target_amount, n_p) @@ -469,7 +445,7 @@ datum/objective/absorb return target_amount check_completion() - if(owner && owner.current && owner.current.changeling && owner.current.changeling.absorbed_dna && ((owner.current.changeling.absorbed_dna.len - 1) >= target_amount)) + if(owner && owner.changeling && owner.changeling.absorbed_dna && (owner.changeling.absorbedcount >= target_amount)) return 1 else return 0 diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 46350830b5..fe03323c86 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -15,7 +15,7 @@ name = "revolution" config_tag = "revolution" restricted_jobs = list("Security Officer", "Warden", "Detective", "AI", "Cyborg","Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", "Chief Medical Officer") - required_players = 3 + required_players = 20 required_enemies = 3 recommended_enemies = 3 @@ -33,7 +33,7 @@ /////////////////////////// /datum/game_mode/revolution/announce() world << "The current game mode is - Revolution!" - world << "Some crewmembers are attempting to start a revolution!
      \nRevolutionaries - Kill the Captain, HoP, HoS, CE, RD and CMO. Convert other crewmembers (excluding the heads of staff, and security officers) to your cause by convincing and then flashing them. Protect your leaders.
      \nPersonnel - Protect the heads of staff. Kill the leaders of the revolution, and brainwash the other revolutionaries (by beating them in the head).
      " + world << "Some crewmembers are attempting to start a revolution!
      \nRevolutionaries - Kill the Captain, HoP, HoS, CE, RD and CMO. Convert other crewmembers (excluding the heads of staff, and security officers) to your cause by flashing them. Protect your leaders.
      \nPersonnel - Protect the heads of staff. Kill the leaders of the revolution, and brainwash the other revolutionaries (by beating them in the head).
      " /////////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,7 @@ var/list/datum/mind/possible_headrevs = get_players_for_role(BE_REV) var/head_check = 0 - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in player_list) if(player.mind.assigned_role in command_positions) head_check = 1 break @@ -78,10 +78,11 @@ var/datum/objective/mutiny/rev_obj = new rev_obj.owner = rev_mind rev_obj.target = head_mind - rev_obj.explanation_text = "Assassinate [head_mind.current.real_name], the [head_mind.role_alt_title ? head_mind.role_alt_title : head_mind.assigned_role]." + rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]." rev_mind.objectives += rev_obj - equip_traitor(rev_mind.current, 1) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO + // equip_traitor(rev_mind.current, 1) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO + // Removing revolutionary uplinks. -Pete equip_revolutionary(rev_mind.current) update_rev_icons_added(rev_mind) @@ -108,7 +109,7 @@ var/datum/objective/mutiny/rev_obj = new rev_obj.owner = rev_mind rev_obj.target = head_mind - rev_obj.explanation_text = "Assassinate [head_mind.current.real_name], the [head_mind.role_alt_title ? head_mind.role_alt_title : head_mind.assigned_role]." + rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]." rev_mind.objectives += rev_obj /datum/game_mode/proc/greet_revolutionary(var/datum/mind/rev_mind, var/you_are=1) @@ -126,21 +127,28 @@ /datum/game_mode/proc/equip_revolutionary(mob/living/carbon/human/mob) if(!istype(mob)) return + + if (mob.mind) + if (mob.mind.assigned_role == "Clown") + mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." + mob.mutations.Remove(CLUMSY) + + var/obj/item/device/flash/T = new(mob) var/list/slots = list ( - "backpack" = mob.slot_in_backpack, - "left pocket" = mob.slot_l_store, - "right pocket" = mob.slot_r_store, - "left hand" = mob.slot_l_hand, - "right hand" = mob.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = mob.equip_in_one_of_slots(T, slots) if (!where) mob << "The Syndicate were unfortunately unable to get you a flash." else - mob << "The flash in your [where] can be used to mark a crew member as revolutionist. Use this only on those true to your cause, to ensure that everyone bearing the mark can be trusted." - mob << "\red Do not use the flash on players who haven't agreed to join your cause. This is known as 'LOLFLASHING' and can get you banned." + mob << "The flash in your [where] will help you to persuade the crew to join your cause." + mob.update_icons() return 1 ////////////////////////////////////// @@ -166,16 +174,18 @@ //Deals with converting players to the revolution// /////////////////////////////////////////////////// /datum/game_mode/proc/add_revolutionary(datum/mind/rev_mind) - if((rev_mind.assigned_role in command_positions) || (rev_mind.assigned_role in list("Security Officer", "Detective", "Warden"))) + if(rev_mind.assigned_role in command_positions) return 0 + var/mob/living/carbon/human/H = rev_mind.current//Check to see if the potential rev is implanted + for(var/obj/item/weapon/implant/loyalty/L in H)//Checking that there is a loyalty implant in the contents + if(L.imp_in == H)//Checking that it's actually implanted + return 0 if((rev_mind in revolutionaries) || (rev_mind in head_revolutionaries)) return 0 revolutionaries += rev_mind rev_mind.current << "\red You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!" rev_mind.special_role = "Revolutionary" update_rev_icons_added(rev_mind) -// if(ticker.mode.name == "rp-revolution") -// rev_mind.current.verbs += /mob/living/carbon/human/proc/RevConvert return 1 ////////////////////////////////////////////////////////////////////////////// //Deals with players being converted from the revolution (Not a rev anymore)// // Modified to handle borged MMIs. Accepts another var if the target is being borged at the time -- Polymorph. @@ -198,8 +208,6 @@ else M << "[rev_mind.current] looks like they just remembered their real allegiance!" -// if(ticker.mode.name == "rp-revolution") -// rev_mind.current.verbs -= /mob/living/carbon/human/proc/RevConvert ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -216,27 +224,25 @@ if(head_rev_mind.current.client) for(var/image/I in head_rev_mind.current.client.images) if(I.icon_state == "rev" || I.icon_state == "rev_head") - head_rev_mind.current.client.images -= I + del(I) for(var/datum/mind/rev_mind in revolutionaries) if(rev_mind.current) if(rev_mind.current.client) for(var/image/I in rev_mind.current.client.images) if(I.icon_state == "rev" || I.icon_state == "rev_head") - rev_mind.current.client.images -= I + del(I) for(var/datum/mind/head_rev in head_revolutionaries) if(head_rev.current) if(head_rev.current.client) for(var/datum/mind/rev in revolutionaries) if(rev.current) - var/image/I = rev.current.antag_img - I.icon_state = "rev" + var/I = image('icons/mob/mob.dmi', loc = rev.current, icon_state = "rev") head_rev.current.client.images += I for(var/datum/mind/head_rev_1 in head_revolutionaries) if(head_rev_1.current) - var/image/I = head_rev_1.current.antag_img - I.icon_state = "rev_head" + var/I = image('icons/mob/mob.dmi', loc = head_rev_1.current, icon_state = "rev_head") head_rev.current.client.images += I for(var/datum/mind/rev in revolutionaries) @@ -244,13 +250,11 @@ if(rev.current.client) for(var/datum/mind/head_rev in head_revolutionaries) if(head_rev.current) - var/image/I = head_rev.current.antag_img - I.icon_state = "rev_head" + var/I = image('icons/mob/mob.dmi', loc = head_rev.current, icon_state = "rev_head") rev.current.client.images += I for(var/datum/mind/rev_1 in revolutionaries) if(rev_1.current) - var/image/I = rev_1.current.antag_img - I.icon_state = "rev" + var/I = image('icons/mob/mob.dmi', loc = rev_1.current, icon_state = "rev") rev.current.client.images += I //////////////////////////////////////////////////// @@ -262,26 +266,22 @@ for(var/datum/mind/head_rev_mind in head_revolutionaries) if(head_rev_mind.current) if(head_rev_mind.current.client) - var/image/I = rev_mind.current.antag_img - I.icon_state = "rev" + var/I = image('icons/mob/mob.dmi', loc = rev_mind.current, icon_state = "rev") head_rev_mind.current.client.images += I if(rev_mind.current) if(rev_mind.current.client) - var/image/I = head_rev_mind.current.antag_img - I.icon_state = "rev_head" - rev_mind.current.client.images += I + var/image/J = image('icons/mob/mob.dmi', loc = head_rev_mind.current, icon_state = "rev_head") + rev_mind.current.client.images += J for(var/datum/mind/rev_mind_1 in revolutionaries) if(rev_mind_1.current) if(rev_mind_1.current.client) - var/image/I = rev_mind.current.antag_img - I.icon_state = "rev" + var/I = image('icons/mob/mob.dmi', loc = rev_mind.current, icon_state = "rev") rev_mind_1.current.client.images += I if(rev_mind.current) if(rev_mind.current.client) - var/image/I = rev_mind_1.current.antag_img - I.icon_state = "rev" - rev_mind.current.client.images += I + var/image/J = image('icons/mob/mob.dmi', loc = rev_mind_1.current, icon_state = "rev") + rev_mind.current.client.images += J /////////////////////////////////// //Keeps track of deconverted revs// @@ -293,20 +293,20 @@ if(head_rev_mind.current.client) for(var/image/I in head_rev_mind.current.client.images) if((I.icon_state == "rev" || I.icon_state == "rev_head") && I.loc == rev_mind.current) - head_rev_mind.current.client.images -= I + del(I) for(var/datum/mind/rev_mind_1 in revolutionaries) if(rev_mind_1.current) if(rev_mind_1.current.client) for(var/image/I in rev_mind_1.current.client.images) if((I.icon_state == "rev" || I.icon_state == "rev_head") && I.loc == rev_mind.current) - rev_mind_1.current.client.images -= I + del(I) if(rev_mind.current) if(rev_mind.current.client) for(var/image/I in rev_mind.current.client.images) if(I.icon_state == "rev" || I.icon_state == "rev_head") - rev_mind.current.client.images -= I + del(I) ////////////////////////// //Checks for rev victory// @@ -344,64 +344,77 @@ return 1 /datum/game_mode/proc/auto_declare_completion_revolution() - if(head_revolutionaries.len!=0 || istype(ticker.mode,/datum/game_mode/revolution)) - var/list/names = new - for(var/datum/mind/i in head_revolutionaries) - if(i.current) - var/hstatus = "" - if(i.current.stat == 2) - hstatus = "Dead" - else if(i.current.z != 1) - hstatus = "Abandoned the station" - names += i.current.real_name + " ([hstatus])" - else - names += "[i.key] (character destroyed)" - world << "The head revolutionaries were: " - world << english_list(names) - if (revolutionaries.len!=0 || istype(ticker.mode,/datum/game_mode/revolution)) - var/list/names = new - for(var/datum/mind/i in revolutionaries) - if(i.current) - var/hstatus = "" - if(i.current.stat == 2) - hstatus = "Dead" - else if(i.current.z != 1) - hstatus = "Abandoned the station" - names += i.current.real_name + " ([hstatus])" - else - names += "[i.key] (character destroyed)" - if (revolutionaries.len!=0) - world << "The ordinary revolutionaries were: " - world << english_list(names) - else - world << "The head revolutionaries failed to enlist any ordinary revolutionaries" - var/list/heads = get_all_heads() - var/list/targets = new - for (var/datum/mind/i in head_revolutionaries) - for (var/datum/objective/mutiny/o in i.objectives) - targets |= o.target - if (head_revolutionaries.len!=0 || \ - revolutionaries.len!=0 || \ - istype(ticker.mode,/datum/game_mode/revolution)) + var/list/targets = list() - var/list/names = new - for(var/datum/mind/i in heads) - if(i.current) - var/turf/T = get_turf(i.current) - var/hstatus = "" - if(i.current.stat == 2) - hstatus = "Dead" - else if((T) && (T.z != 1)) - hstatus = "Abandoned the station" - names += i.current.real_name + " ([hstatus])" + ((i in targets)?"(target)":"") - else - names += "[i.key] (character destroyed)" + ((i in targets)?"(target)":"") - if (heads.len!=0) - world << "The heads of staff were: " - world << english_list(names) - else - world << "There were no any heads of staff on the station." + if(head_revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution)) + var/text = "The head revolutionaries were:" + for(var/datum/mind/headrev in head_revolutionaries) + text += "
      [headrev.key] was [headrev.name] (" + if(headrev.current) + if(headrev.current.stat == DEAD) + text += "died" + else if(headrev.current.z != 1) + text += "fled the station" + else + text += "survived the revolution" + if(headrev.current.real_name != headrev.name) + text += " as [headrev.current.real_name]" + else + text += "body destroyed" + text += ")" + + for(var/datum/objective/mutiny/objective in headrev.objectives) + targets |= objective.target + + world << text + + if(revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution)) + var/text = "The revolutionaries were:" + + for(var/datum/mind/rev in revolutionaries) + text += "
      [rev.key] was [rev.name] (" + if(rev.current) + if(rev.current.stat == DEAD) + text += "died" + else if(rev.current.z != 1) + text += "fled the station" + else + text += "survived the revolution" + if(rev.current.real_name != rev.name) + text += " as [rev.current.real_name]" + else + text += "body destroyed" + text += ")" + + world << text + + + if( head_revolutionaries.len || revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution) ) + var/text = "The heads of staff were:" + + var/list/heads = get_all_heads() + for(var/datum/mind/head in heads) + var/target = (head in targets) + if(target) + text += "" + text += "
      [head.key] was [head.name] (" + if(head.current) + if(head.current.stat == DEAD) + text += "died" + else if(head.current.z != 1) + text += "fled the station" + else + text += "survived the revolution" + if(head.current.real_name != head.name) + text += " as [head.current.real_name]" + else + text += "body destroyed" + text += ")" + if(target) + text += "
      " + + world << text /proc/is_convertable_to_rev(datum/mind/mind) return istype(mind) && \ diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index e6e1aa700f..95a9a1ab2f 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 var/hsboxspawn = 1 var/list @@ -83,7 +83,7 @@ datum/hSB P.back.loc = P.loc P.back.layer = initial(P.back.layer) P.back = null - P.back = new/obj/item/weapon/tank/jetpack/oxygen(P) + P.back = new/obj/item/weapon/tank/jetpack(P) P.back.layer = 20 P.internal = P.back if("hsbmetal") diff --git a/code/game/gamemodes/sandbox/sandbox.dm b/code/game/gamemodes/sandbox/sandbox.dm index fb02fd5cdb..3bace4756e 100644 --- a/code/game/gamemodes/sandbox/sandbox.dm +++ b/code/game/gamemodes/sandbox/sandbox.dm @@ -1,7 +1,7 @@ /datum/game_mode/sandbox name = "sandbox" config_tag = "sandbox" - votable = 0 + required_players = 0 uplink_welcome = "Syndicate Uplink Console:" uplink_uses = 10 @@ -11,9 +11,8 @@ world << "Build your own station with the sandbox-panel command!" /datum/game_mode/sandbox/pre_setup() - for(var/mob/M in world) - if(M.client) - M.CanBuild() + for(var/mob/M in player_list) + M.CanBuild() return 1 /datum/game_mode/sandbox/check_finished() diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 1e8427a01b..b0429b94bb 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -5,9 +5,18 @@ if (prob(75)) DIFFMUT = rand(0,20) - var/list/avnums = list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26) + var/list/avnums = new/list() var/tempnum + avnums.Add(2) + avnums.Add(12) + avnums.Add(10) + avnums.Add(8) + avnums.Add(4) + avnums.Add(11) + avnums.Add(13) + avnums.Add(6) + tempnum = pick(avnums) avnums.Remove(tempnum) HULKBLOCK = tempnum @@ -32,54 +41,6 @@ tempnum = pick(avnums) avnums.Remove(tempnum) BLINDBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - HEADACHEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - COUGHBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - TWITCHBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - NERVOUSBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - NOBREATHBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - REMOTEVIEWBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - REGENERATEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - INCREASERUNBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - REMOTETALKBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - MORPHBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - BLENDBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - HALLUCINATIONBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - NOPRINTSBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - SHOCKIMMUNITYBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - SMALLSIZEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - GLASSESBLOCK = tempnum // HIDDEN MUTATIONS / SUPERPOWERS INITIALIZTION @@ -104,8 +65,6 @@ */ - - /proc/setupfactions() // Populate the factions list: @@ -136,88 +95,88 @@ var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(M), M.slot_ears) - M.equip_if_possible(new /obj/item/device/pda/engineering(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/rank/engineer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/orange(M), M.slot_shoes) - // M.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/clothing/gloves/yellow(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/t_scanner(M), M.slot_r_store) - //M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/device/pda/engineering(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes) + // M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store) + //M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head) else if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/welding(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head) del(A) continue if (A.name == "Corpse-Engineer-Space") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(M), M.slot_ears) - M.equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/rank/engineer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/orange(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/suit/space(M), M.slot_wear_suit) - // M.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/clothing/gloves/yellow(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/t_scanner(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/space(M), slot_wear_suit) + // M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head) else if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/welding(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head) else - M.equip_if_possible(new /obj/item/clothing/head/helmet/space(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head) del(A) continue if (A.name == "Corpse-Engineer-Chief") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(M), M.slot_ears) - M.equip_if_possible(new /obj/item/weapon/storage/utilitybelt(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/rank/chief_engineer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/orange(M), M.slot_shoes) - // M.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/clothing/gloves/yellow(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/t_scanner(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/utilitybelt(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes) + // M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head) else if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/welding(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head) del(A) continue if (A.name == "Corpse-Syndicate") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - //M.equip_if_possible(new /obj/item/weapon/gun/revolver(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/syndicate(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/swat(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/weapon/tank/jetpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + //M.equip_to_slot_or_del(new /obj/item/weapon/gun/revolver(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/weapon/tank/jetpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/suit/space/syndicate(M), M.slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate(M), slot_wear_suit) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/swat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head) else - M.equip_if_possible(new /obj/item/clothing/head/helmet/space/syndicate(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate(M), slot_head) else - M.equip_if_possible(new /obj/item/clothing/suit/armor/vest(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/head/helmet/swat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head) del(A) continue */ diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 2cd4ad9d62..b45c7eaaff 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -5,8 +5,9 @@ /datum/game_mode/traitor name = "traitor" config_tag = "traitor" - restricted_jobs = list("Cyborg", "AI")//Approved by headmins for a week test, if you see this it would be nice if you didn't spread it everywhere - protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain") + restricted_jobs = list("Cyborg")//They are part of the AI if he is traitor so are they, they use to get double chances + protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain")//AI", Currently out of the list as malf does not work for shit + required_players = 0 required_enemies = 1 recommended_enemies = 4 @@ -18,9 +19,7 @@ var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds) var/traitors_possible = 4 //hard limit on traitors if scaling is turned off - var/const/traitor_scaling_coeff = 10.0 //how much does the amount of players get divided by to determine traitors - - var/num_players = 0 + var/const/traitor_scaling_coeff = 5.0 //how much does the amount of players get divided by to determine traitors /datum/game_mode/traitor/announce() @@ -42,7 +41,7 @@ var/num_traitors = 1 if(config.traitor_scaling) - num_traitors = max(1, round((num_players())/(traitor_scaling_coeff)) + 1) + num_traitors = max(1, round((num_players())/(traitor_scaling_coeff))) else num_traitors = max(1, min(num_players(), traitors_possible)) @@ -78,10 +77,6 @@ /datum/game_mode/proc/forge_traitor_objectives(var/datum/mind/traitor) - var/datum/traitorinfo/info = new - info.ckey = traitor.key - info.starting_player_count = num_players() - info.starting_name = traitor.current.name if(istype(traitor.current, /mob/living/silicon)) var/datum/objective/assassinate/kill_objective = new kill_objective.owner = traitor @@ -96,25 +91,36 @@ var/datum/objective/block/block_objective = new block_objective.owner = traitor traitor.objectives += block_objective - info.starting_occupation = "AI" else - info.starting_occupation = (traitor.current:wear_id && traitor.current:wear_id:assignment ? traitor.current:wear_id:assignment : traitor.assigned_role) - for(var/datum/objective/o in SelectObjectives((istype(traitor.current:wear_id, /obj/item/weapon/card/id) ? traitor.current:wear_id:assignment : traitor.assigned_role), traitor)) - o.owner = traitor - traitor.objectives += o - for(var/datum/objective/objective in traitor.objectives) - info.starting_objective += "[objective.explanation_text] " - logtraitors[traitor] = info + switch(rand(1,100)) + if(1 to 50) + var/datum/objective/assassinate/kill_objective = new + kill_objective.owner = traitor + kill_objective.find_target() + traitor.objectives += kill_objective + else + var/datum/objective/steal/steal_objective = new + steal_objective.owner = traitor + steal_objective.find_target() + traitor.objectives += steal_objective + switch(rand(1,100)) + if(1 to 90) + if (!(locate(/datum/objective/escape) in traitor.objectives)) + var/datum/objective/escape/escape_objective = new + escape_objective.owner = traitor + traitor.objectives += escape_objective + + else + if (!(locate(/datum/objective/hijack) in traitor.objectives)) + var/datum/objective/hijack/hijack_objective = new + hijack_objective.owner = traitor + traitor.objectives += hijack_objective return /datum/game_mode/proc/greet_traitor(var/datum/mind/traitor) traitor.current << "You are the traitor." - traitor.current << "\red REPEAT" - traitor.current << "\red You are the traitor." - spawn(rand(600,1800)) //Strumpetplaya - Just another friendly reminder so people don't forget they're the traitor. - traitor.current << "\red In case you missed it the first time - YOU ARE THE TRAITOR!" var/obj_count = 1 for(var/datum/objective/objective in traitor.objectives) traitor.current << "Objective #[obj_count]: [objective.explanation_text]" @@ -154,97 +160,53 @@ else killer << "Unfortunately, the Syndicate did not provide you with a code response." killer << "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe." - spawn(30) - killer << sound('AISyndiHack.ogg',volume=50) //End code phrase. /datum/game_mode/proc/auto_declare_completion_traitor() - for(var/datum/mind/traitor in traitors) - var/traitor_name - - if(traitor.current) - if(traitor.current == traitor.original) - traitor_name = "[traitor.current.real_name] (played by [traitor.key])" - else if (traitor.original) - traitor_name = "[traitor.current.real_name] (originally [traitor.original.real_name]) (played by [traitor.key])" - else - traitor_name = "[traitor.current.real_name] (original character destroyed) (played by [traitor.key])" - else - traitor_name = "[traitor.key] (character destroyed)" - var/special_role_text = traitor.special_role?(lowertext(traitor.special_role)):"antagonist" - world << "The [special_role_text] was [traitor_name]" - if(traitor.objectives.len)//If the traitor had no objectives, don't need to process this. + if(traitors.len) + var/text = "The traitors were:" + for(var/datum/mind/traitor in traitors) var/traitorwin = 1 - var/count = 1 - var/list/success_log = list("Steal-Win" = 0, "Steal-Fail" = 0, "Protect-Win" = 0, "Protect-Fail" = 0,\ - "Frame-Win" = 0, "Frame-Fail" = 0, "Kill-Win" = 0, "Kill-Fail" = 0) - for(var/datum/objective/objective in traitor.objectives) - if(objective.check_completion()) - if(istype(objective, /datum/objective/frame)) - success_log["Frame-Win"]++ - if(istype(objective, /datum/objective/protection)) - success_log["Protect-Win"]++ - if(istype(objective, /datum/objective/assassinate)) - success_log["Kill-Win"]++ - if(istype(objective, /datum/objective/steal)) - success_log["Steal-Win"]++ - world << "Objective #[count]: [objective.explanation_text] \green Success" - //feedback_add_details("traitor_objective","[objective.type]|SUCCESS") + + text += "
      [traitor.key] was [traitor.name] (" + if(traitor.current) + if(traitor.current.stat == DEAD) + text += "died" else - if(istype(objective, /datum/objective/frame)) - success_log["Frame-Fail"]++ - if(istype(objective, /datum/objective/protection)) - success_log["Protect-Fail"]++ - if(istype(objective, /datum/objective/assassinate)) - success_log["Kill-Fail"]++ - if(istype(objective, /datum/objective/steal)) - success_log["Steal-Fail"]++ - world << "Objective #[count]: [objective.explanation_text] \red Failed" - //feedback_add_details("traitor_objective","[objective.type]|FAIL") - traitorwin = 0 - count++ + text += "survived" + if(traitor.current.real_name != traitor.name) + text += " as [traitor.current.real_name]" + else + text += "body destroyed" + text += ")" + + if(traitor.objectives.len)//If the traitor had no objectives, don't need to process this. + var/count = 1 + for(var/datum/objective/objective in traitor.objectives) + if(objective.check_completion()) + text += "
      Objective #[count]: [objective.explanation_text] Success!" + feedback_add_details("traitor_objective","[objective.type]|SUCCESS") + else + text += "
      Objective #[count]: [objective.explanation_text] Fail." + feedback_add_details("traitor_objective","[objective.type]|FAIL") + traitorwin = 0 + count++ + + var/special_role_text + if(traitor.special_role) + special_role_text = lowertext(traitor.special_role) + else + special_role_text = "antagonist" if(traitorwin) - world << "The [special_role_text] was successful!" - //feedback_add_details("traitor_success","SUCCESS") + text += "
      The [special_role_text] was successful!" + feedback_add_details("traitor_success","SUCCESS") else - world << "The [special_role_text] has failed!" - //feedback_add_details("traitor_success","FAIL") - var/savefile/traitor_logs = new("data/player_saves/[copytext(traitor.key, 1, 2)]/[traitor.key]/traitor.sav") - var/list/infos - traitor_logs >> infos - if(istype(infos)) - infos["Total"]++ - infos["Success"] += traitorwin - infos["Steal"] = (success_log["Steal-Win"]+success_log["Steal-Fail"]+infos["Steal_Total"]) ? ((infos["Steal"]*infos["Steal_Total"]) + success_log["Steal-Win"])/(success_log["Steal-Win"]+success_log["Steal-Fail"]+infos["Steal_Total"]) : 1 - infos["Kill"] = (success_log["Kill-Win"]+success_log["Kill-Fail"]+infos["Kill_Total"]) ? ((infos["Kill"]*infos["Kill_Total"]) + success_log["Kill-Win"])/(success_log["Kill-Win"]+success_log["Kill-Fail"]+infos["Kill_Total"]) : 1 - infos["Frame"] = (success_log["Frame-Win"]+success_log["Frame-Fail"]+infos["Frame_Total"]) ? ((infos["Frame"]*infos["Frame_Total"]) + success_log["Frame-Win"])/(success_log["Frame-Win"]+success_log["Frame-Fail"]+infos["Frame_Total"]) : 1 - infos["Protect"] = (success_log["Protect-Win"]+success_log["Protect-Fail"]+infos["Protect_Total"]) ? ((infos["Protect"]*infos["Protect_Total"]) + success_log["Protect-Win"])/(success_log["Protect-Win"]+success_log["Protect-Fail"]+infos["Protect_Total"]) : 1 - infos["Steal_Total"] = infos["Steal_Total"]+success_log["Steal-Win"]+success_log["Steal-Fail"] - infos["Kill_Total"] = infos["Kill_Total"]+success_log["Kill-Win"]+success_log["Kill-Fail"] - infos["Frame_Total"] = infos["Frame_Total"]+success_log["Frame-Win"]+success_log["Frame-Fail"] - infos["Protect_Total"] = infos["Protect_Total"]+success_log["Protect-Win"]+success_log["Protect-Fail"] - else - infos = list("Total" = 1, "Success" = traitorwin, - "Steal" = (success_log["Steal-Win"]+success_log["Steal-Fail"]) ? success_log["Steal-Win"]/(success_log["Steal-Win"]+success_log["Steal-Fail"]) : 1, - "Kill" = (success_log["Kill-Win"]+success_log["Kill-Fail"]) ? success_log["Kill-Win"]/(success_log["Kill-Win"]+success_log["Kill-Fail"]) : 1, - "Frame" = (success_log["Frame-Win"]+success_log["Frame-Fail"]) ? success_log["Frame-Win"]/(success_log["Frame-Win"]+success_log["Frame-Fail"]) : 1, - "Protect" = (success_log["Protect-Win"]+success_log["Protect-Fail"]) ? success_log["Protect-Win"]/(success_log["Protect-Win"]+success_log["Protect-Fail"]) : 1, - "Steal_Total" = success_log["Steal-Win"]+success_log["Steal-Fail"], - "Kill_Total" = success_log["Kill-Win"]+success_log["Kill-Fail"], - "Frame_Total" = success_log["Frame-Win"]+success_log["Frame-Fail"], - "Protect_Total" = success_log["Protect-Win"]+success_log["Protect-Fail"]) - traitor_logs << infos - - var/datum/traitorinfo/info = logtraitors[traitor] - if (info) - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") - if(dbcon.IsConnected()) - var/DBQuery/query = dbcon.NewQuery("INSERT INTO `bay12`.`traitorlogs` (`CKey`, `Objective`, `Succeeded`, `Spawned`, `Occupation`, `PlayerCount`) VALUES ('[info.ckey]', [dbcon.Quote(info.starting_objective)], '[traitorwin]', '[dd_list2text(info.spawnlist, ";")]', '[info.starting_occupation]', '[info.starting_player_count]')") - query.Execute() + text += "
      The [special_role_text] has failed!" + feedback_add_details("traitor_success","FAIL") + world << text return 1 @@ -257,61 +219,19 @@ traitor_mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." traitor_mob.mutations.Remove(CLUMSY) - // find a radio! toolbox(es), backpack, belt, headset, pockets + // find a radio! toolbox(es), backpack, belt, headset var/loc = "" - var/obj/item/device/R = null //Hide the uplink in a PDA if available, otherwise radio - if (!R && istype(traitor_mob.belt, /obj/item/device/pda)) - R = traitor_mob.belt - loc = "on your belt" - if (!R && istype(traitor_mob.wear_id, /obj/item/device/pda)) - R = traitor_mob.wear_id - loc = "on your jumpsuit" - if (!R && istype(traitor_mob.wear_id, /obj/item/device/pda)) - R = traitor_mob.wear_id - loc = "on your jumpsuit" - if (!R && istype(traitor_mob.l_hand, /obj/item/weapon/storage)) - var/obj/item/weapon/storage/S = traitor_mob.l_hand - var/list/L = S.return_inv() - for (var/obj/item/device/radio/foo in L) - R = foo - loc = "in the [S.name] in your left hand" - break - if (!R && istype(traitor_mob.r_hand, /obj/item/weapon/storage)) - var/obj/item/weapon/storage/S = traitor_mob.r_hand - var/list/L = S.return_inv() - for (var/obj/item/device/radio/foo in L) - R = foo - loc = "in the [S.name] in your right hand" - break - if (!R && istype(traitor_mob.back, /obj/item/weapon/storage)) - var/obj/item/weapon/storage/S = traitor_mob.back - var/list/L = S.return_inv() - for (var/obj/item/device/radio/foo in L) - R = foo - loc = "in the [S.name] on your back" - break - if (!R && istype(traitor_mob.l_store, /obj/item/device/pda)) - R = traitor_mob.l_store - loc = "in your pocket" - if (!R && istype(traitor_mob.r_store, /obj/item/device/pda)) - R = traitor_mob.r_store - loc = "in your pocket" - if (!R && traitor_mob.w_uniform && istype(traitor_mob.belt, /obj/item/device/radio)) - R = traitor_mob.belt - loc = "on your belt" - if (!R && istype(traitor_mob.l_ear, /obj/item/device/radio)) - R = traitor_mob.l_ear - loc = "on your head" - if (!R && istype(traitor_mob.r_ear, /obj/item/device/radio)) - R = traitor_mob.r_ear - loc = "on your head" + var/obj/item/R = locate(/obj/item/device/pda) in traitor_mob.contents //Hide the uplink in a PDA if available, otherwise radio + if(!R) + R = locate(/obj/item/device/radio) in traitor_mob.contents + if (!R) - traitor_mob << "Unfortunately, the Syndicate wasn't able to get you an uplink." - traitor_mob << "\red ADMINHELP THIS AT ONCE." + traitor_mob << "Unfortunately, the Syndicate wasn't able to get you a radio." . = 0 else if (istype(R, /obj/item/device/radio)) // generate list of radio freqs + var/obj/item/device/radio/target_radio = R var/freq = 1441 var/list/freqlist = list() while (freq <= 1489) @@ -322,25 +242,20 @@ freq += 1 freq = freqlist[rand(1, freqlist.len)] - var/obj/item/device/uplink/radio/T = new /obj/item/device/uplink/radio(R) - R:traitorradio = T - R:traitor_frequency = freq - T.name = R.name - T.icon = R.icon - T.w_class = R.w_class - T.icon_state = R.icon_state - T.item_state = R.item_state - T.origradio = R + var/obj/item/device/uplink/hidden/T = new(R) + target_radio.hidden_uplink = T + target_radio.traitor_frequency = freq traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [R.name] [loc]. Simply dial the frequency [format_frequency(freq)] to unlock its hidden features." traitor_mob.mind.store_memory("Radio Freq: [format_frequency(freq)] ([R.name] [loc]).") else if (istype(R, /obj/item/device/pda)) // generate a passcode if the uplink is hidden in a PDA var/pda_pass = "[rand(100,999)] [pick("Alpha","Bravo","Delta","Omega")]" - var/obj/item/device/uplink/pda/T = new /obj/item/device/uplink/pda(R) - R:uplink = T - T.lock_code = pda_pass - T.hostpda = R + var/obj/item/device/uplink/hidden/T = new(R) + R.hidden_uplink = T + var/obj/item/device/pda/P = R + P.lock_code = pda_pass + traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [R.name] [loc]. Simply enter the code \"[pda_pass]\" into the ringtone select to unlock its hidden features." traitor_mob.mind.store_memory("Uplink Passcode: [pda_pass] ([R.name] [loc]).") //Begin code phrase. @@ -350,13 +265,11 @@ traitor_mob << "\red Code Phrase: \black [syndicate_code_phrase]" traitor_mob.mind.store_memory("Code Phrase: [syndicate_code_phrase]") else - traitor_mob << "Unfortunately, the Syndicate did not provide you with a code phrase." + traitor_mob << "Unfortunetly, the Syndicate did not provide you with a code phrase." if(prob(80)) traitor_mob << "\red Code Response: \black [syndicate_code_response]" traitor_mob.mind.store_memory("Code Response: [syndicate_code_response]") else traitor_mob << "Unfortunately, the Syndicate did not provide you with a code response." traitor_mob << "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe." - spawn(30) - traitor_mob << sound('syndicate intro.ogg',volume=50) //End code phrase. \ No newline at end of file diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index d82b1377ab..b099f9b47a 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -5,7 +5,7 @@ set desc = "Summon Guns" set name = "Wizards: No sense of right and wrong!" - for(var/mob/living/carbon/human/H in world) + for(var/mob/living/carbon/human/H in player_list) if(H.stat == 2 || !(H.client)) continue if(is_special_character(H)) continue if(prob(25)) diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 9b589c928a..d9a4ff6984 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -1,6 +1,6 @@ /obj/item/device/soulstone name = "Soul Stone Shard" - icon = 'wizard.dmi' + icon = 'icons/obj/wizard.dmi' icon_state = "soulstone" item_state = "electronic" desc = "A fragment of the legendary treasure known simply as the 'Soul Stone'. The shard still flickers with a fraction of the full artefacts power." @@ -22,8 +22,6 @@ user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to capture the soul of [M.name] ([M.ckey])") log_attack("[user.name] ([user.ckey]) used the [src.name] to capture the soul of [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) captured the soul of [M] ([M.ckey]).") - message_admins("ATTACK: [user] ([user.ckey]) captured the soul of [M] ([M.ckey]).") transfer_soul("VICTIM", M, user) @@ -84,7 +82,7 @@ ///////////////////////////Transferring to constructs///////////////////////////////////////////////////// /obj/structure/constructshell name = "empty shell" - icon = 'wizard.dmi' + icon = 'icons/obj/wizard.dmi' icon_state = "construct" desc = "A wicked machine used by those skilled in magical arts. It is inactive" flags = FPRINT | TABLEPASS @@ -115,12 +113,12 @@ U << "\red Capture failed!: \black The soul stone is full! Use or free an existing soul to make room." else for(var/obj/item/W in T) - T.drop_from_slot(W) + T.drop_from_inventory(W) new /obj/effect/decal/remains/human(T.loc) //Spawns a skeleton T.invisibility = 101 var/atom/movable/overlay/animation = new /atom/movable/overlay( T.loc ) animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = T flick("dust-h", animation) del(animation) @@ -128,15 +126,16 @@ S.loc = C //put shade in stone S.nodamage = 1 //So they won't die inside the stone somehow S.canmove = 0//Can't move out of the soul stone - S.name = "Shade of [T.name]" + S.name = "Shade of [T.real_name]" + S.real_name = "Shade of [T.real_name]" if (T.client) T.client.mob = S S.cancel_camera() C.icon_state = "soulstone2" - C.name = "Soul Stone: [S.name]" + C.name = "Soul Stone: [S.real_name]" S << "Your soul has been captured! You are now bound to [U.name]'s will, help them suceed in their goals at all costs." - U << "\blue Capture successful!: \black [T.name]'s soul has been ripped from their body and stored within the soul stone." - U << "The soulstone has been imprinted with [S.name]'s mind, it will no longer react to other souls." + U << "\blue Capture successful!: \black [T.real_name]'s soul has been ripped from their body and stored within the soul stone." + U << "The soulstone has been imprinted with [S.real_name]'s mind, it will no longer react to other souls." C.imprinted = "[S.name]" del T if("SHADE") @@ -167,18 +166,13 @@ switch(construct_class) if("Juggernaut") var/mob/living/simple_animal/constructarmoured/Z = new /mob/living/simple_animal/constructarmoured (get_turf(T.loc)) - if (A.client) - A.client.mob = Z - Z.mind_initialize(Z) - if(iscultist(U)) - if (ticker.mode.name == "cult") - ticker.mode:add_cultist(Z.mind) - Z.mind.special_role = "Cultist" - ticker.mode.update_cult_icons_added(Z.mind) - else - ticker.mode.cult+=Z.mind - Z.mind.special_role = "Cultist" - ticker.mode.update_cult_icons_added(Z.mind) + Z.key = A.key + if(iscultist(U)) + if(ticker.mode.name == "cult") + ticker.mode:add_cultist(Z.mind) + else + ticker.mode.cult+=Z.mind + ticker.mode.update_cult_icons_added(Z.mind) del(T) Z << "You are playing a Juggernaut. Though slow, you can withstand extreme punishment, and rip apart enemies and walls alike." Z << "You are still bound to serve your creator, follow their orders and help them complete their goals at all costs." @@ -188,18 +182,13 @@ if("Wraith") var/mob/living/simple_animal/constructwraith/Z = new /mob/living/simple_animal/constructwraith (get_turf(T.loc)) - if (A.client) - A.client.mob = Z - Z.mind_initialize(Z) - if(iscultist(U)) - if (ticker.mode.name == "cult") - ticker.mode:add_cultist(Z.mind) - Z.mind.special_role = "Cultist" - ticker.mode.update_cult_icons_added(Z.mind) - else - ticker.mode.cult+=Z.mind - Z.mind.special_role = "Cultist" - ticker.mode.update_cult_icons_added(Z.mind) + Z.key = A.key + if(iscultist(U)) + if(ticker.mode.name == "cult") + ticker.mode:add_cultist(Z.mind) + else + ticker.mode.cult+=Z.mind + ticker.mode.update_cult_icons_added(Z.mind) del(T) Z << "You are playing a Wraith. Though relatively fragile, you are fast, deadly, and even able to phase through walls." Z << "You are still bound to serve your creator, follow their orders and help them complete their goals at all costs." @@ -209,18 +198,13 @@ if("Artificer") var/mob/living/simple_animal/constructbuilder/Z = new /mob/living/simple_animal/constructbuilder (get_turf(T.loc)) - if (A.client) - A.client.mob = Z - Z.mind_initialize(Z) - if(iscultist(U)) - if (ticker.mode.name == "cult") - ticker.mode:add_cultist(Z.mind) - Z.mind.special_role = "Cultist" - ticker.mode.update_cult_icons_added(Z.mind) - else - ticker.mode.cult+=Z.mind - Z.mind.special_role = "Cultist" - ticker.mode.update_cult_icons_added(Z.mind) + Z.key = A.key + if(iscultist(U)) + if(ticker.mode.name == "cult") + ticker.mode:add_cultist(Z.mind) + else + ticker.mode.cult+=Z.mind + ticker.mode.update_cult_icons_added(Z.mind) del(T) Z << "You are playing an Artificer. You are incredibly weak and fragile, but you are able to construct fortifications, repair allied constructs (by clicking on them), and even create new constructs" Z << "You are still bound to serve your creator, follow their orders and help them complete their goals at all costs." diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 6452655a8b..25062d5f23 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -13,8 +13,8 @@ dat += "Memorize which spell:
      " dat += "The number after the spell name is the cooldown time.
      " dat += "Magic Missile (10)
      " - dat += "Fireball (20)
      " -// dat += "Disintegrate (60)
      " + dat += "Fireball (10)
      " + dat += "Disintegrate (60)
      " dat += "Disable Technology (60)
      " dat += "Smoke (10)
      " dat += "Blind (30)
      " @@ -25,8 +25,8 @@ dat += "Mutate (60)
      " dat += "Ethereal Jaunt (60)
      " dat += "Knock (10)
      " -// if(op) -// dat += "Summon Guns (One time use, global spell)
      " + if(op) + dat += "Summon Guns (One time use, global spell)
      " dat += "
      " dat += "Artefacts:
      " dat += "Powerful items imbued with eldritch magics. Summoning one will count towards your maximum number of spells.
      " @@ -36,10 +36,8 @@ dat += "
      " dat += "Six Soul Stone Shards and the spell Artificer
      " dat += "
      " -// if(op) -// dat += "Veil Render
      " - dat += "
      " - dat += "Re-memorize Spells
      " + if(op) + dat += "Re-memorize Spells
      " user << browse(dat, "window=radio") onclose(user, "radio") return @@ -57,164 +55,89 @@ if(href_list["spell_choice"]) if(src.uses >= 1 && src.max_uses >=1 && text2num(href_list["spell_choice"]) < 18) src.uses-- - if(spell_type == "verb") + var/list/available_spells = list("Magic Missile","Fireball","Disintegrate","Disable Tech","Smoke","Blind","Mind Transfer","Forcewall","Blink","Teleport","Mutate","Ethereal Jaunt","Knock","Summon Guns","Staff of Change","Six Soul Stone Shards and the spell Artificer") + var/already_knows = 0 + for(var/obj/effect/proc_holder/spell/aspell in usr.spell_list) + if(available_spells[text2num(href_list["spell_choice"])] == aspell.name) + already_knows = 1 + src.temp = "You already know that spell." + src.uses++ + break + if(!already_knows) switch(href_list["spell_choice"]) if ("1") - usr.verbs += /client/proc/magicmissile - usr.mind.special_verbs += /client/proc/magicmissile + feedback_add_details("wizard_spell_learned","MM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(usr) src.temp = "This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage." if ("2") - usr.verbs += /client/proc/fireball - usr.mind.special_verbs += /client/proc/fireball - src.temp = "This spell fires a fireball at a target and does not require wizard garb. Be careful not to fire it at people that are standing next to you." -// if ("3") -// usr.verbs += /mob/proc/kill -// usr.mind.special_verbs += /mob/proc/kill -// src.temp = "This spell instantly kills somebody adjacent to you with the vilest of magick. It has a long cooldown." + feedback_add_details("wizard_spell_learned","FB") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/fireball(usr) + src.temp = "This spell fires a fireball in the direction you're facing and does not require wizard garb. Be careful not to fire it at people that are standing next to you." + if ("3") + feedback_add_details("wizard_spell_learned","DG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/inflict_handler/disintegrate(usr) + src.temp = "This spell instantly kills somebody adjacent to you with the vilest of magick. It has a long cooldown." if ("4") - usr.verbs += /mob/proc/tech - usr.mind.special_verbs += /mob/proc/tech + feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/emplosion/disable_tech(usr) src.temp = "This spell disables all weapons, cameras and most other technology in range." if ("5") - usr.verbs += /client/proc/smokecloud - usr.mind.special_verbs += /client/proc/smokecloud + feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/smoke(usr) src.temp = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb." if ("6") - usr.verbs += /client/proc/blind - usr.mind.special_verbs += /client/proc/blind + feedback_add_details("wizard_spell_learned","BD") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/trigger/blind(usr) src.temp = "This spell temporarly blinds a single person and does not require wizard garb." if ("7") - usr.verbs += /mob/proc/swap + feedback_add_details("wizard_spell_learned","MT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/mind_transfer(usr) src.temp = "This spell allows the user to switch bodies with a target. Careful to not lose your memory in the process." if ("8") - usr.verbs += /client/proc/forcewall - usr.mind.special_verbs += /client/proc/forcewall + feedback_add_details("wizard_spell_learned","FW") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(usr) src.temp = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb." if ("9") - usr.verbs += /client/proc/blink - usr.mind.special_verbs += /client/proc/blink + feedback_add_details("wizard_spell_learned","BL") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/turf_teleport/blink(usr) src.temp = "This spell randomly teleports you a short distance. Useful for evasion or getting into areas if you have patience." if ("10") - usr.verbs += /mob/proc/teleport - usr.mind.special_verbs += /mob/proc/teleport + feedback_add_details("wizard_spell_learned","TP") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(usr) src.temp = "This spell teleports you to a type of area of your selection. Very useful if you are in danger, but has a decent cooldown, and is unpredictable." if ("11") - usr.verbs += /client/proc/mutate - usr.mind.special_verbs += /client/proc/mutate - src.temp = "This spell causes you to turn into a hulk and gain laser vision for a short while." + feedback_add_details("wizard_spell_learned","MU") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/genetic/mutate(usr) + src.temp = "This spell causes you to turn into a hulk and gain telekinesis for a short while." if ("12") - usr.verbs += /client/proc/jaunt - usr.mind.special_verbs += /client/proc/jaunt + feedback_add_details("wizard_spell_learned","EJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(usr) src.temp = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls." if ("13") - usr.verbs += /client/proc/knock - usr.mind.special_verbs += /client/proc/knock + feedback_add_details("wizard_spell_learned","KN") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/knock(usr) src.temp = "This spell opens nearby doors and does not require wizard garb." -// if ("14") -// usr.verbs += /client/proc/rightandwrong -// src.max_uses-- -// src.temp = "Nothing could possibly go wrong with arming a crew of lunatics just itching for an excuse to kill eachother. Just be careful not to get hit in the crossfire!" + if ("14") + feedback_add_details("wizard_spell_learned","SG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells + usr.verbs += /client/proc/rightandwrong + src.max_uses-- + src.temp = "Nothing could possibly go wrong with arming a crew of lunatics just itching for an excuse to kill eachother. Just be careful not to get hit in the crossfire!" if ("15") + feedback_add_details("wizard_spell_learned","ST") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells new /obj/item/weapon/gun/energy/staff(get_turf(usr)) src.temp = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself" src.max_uses-- if ("16") + feedback_add_details("wizard_spell_learned","SS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells new /obj/item/weapon/storage/belt/soulstone/full(get_turf(usr)) - src.temp = "Soul Stone Shards are ancient tools capable of capturing and harnessing the spirits of the dead and dying" + usr.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/construct(usr) + src.temp = "Soul Stone Shards are ancient tools capable of capturing and harnessing the spirits of the dead and dying. The spell Artificer allows you to create arcane machines for the captured souls to pilot." src.max_uses-- -// if ("17") -// new /obj/item/weapon/veilrender(get_turf(usr)) -// src.temp = "Recovered from a shattered temple in what was speculated to be the ruins of an alien capital city, the blade is said to cut more than just the material. There was no trace of the blades creators, nor of any other life left on the dead planet, and what caused such an apocalypse remains a mystery." -// src.max_uses-- - else if(spell_type == "object") - var/list/available_spells = list("Magic Missile","Fireball","Disintegrate","Disable Tech","Smoke","Blind","Mind Transfer","Forcewall","Blink","Teleport","Mutate","Ethereal Jaunt","Knock","Summon Guns","Staff of Change","Six Soul Stone Shards and the spell Artificer","Veil Render") - var/already_knows = 0 - for(var/obj/effect/proc_holder/spell/aspell in usr.spell_list) - if(available_spells[text2num(href_list["spell_choice"])] == aspell.name) - already_knows = 1 - src.temp = "You already know that spell." - src.uses++ - break - if(!already_knows) - switch(href_list["spell_choice"]) - if ("1") - //feedback_add_details("wizard_spell_learned","MM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(usr) - src.temp = "This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage." - if ("2") - //feedback_add_details("wizard_spell_learned","FB") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/fireball(usr) - src.temp = "This spell fires a fireball at a target and does not require wizard garb. Be careful not to fire it at people that are standing next to you." -// if ("3") -// feedback_add_details("wizard_spell_learned","DG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells -// usr.spell_list += new /obj/effect/proc_holder/spell/targeted/inflict_handler/disintegrate(usr) -// src.temp = "This spell instantly kills somebody adjacent to you with the vilest of magick. It has a long cooldown." - if ("4") - //feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/emplosion/disable_tech(usr) - src.temp = "This spell disables all weapons, cameras and most other technology in range." - if ("5") - //feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/smoke(usr) - src.temp = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb." - if ("6") - //feedback_add_details("wizard_spell_learned","BD") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/trigger/blind(usr) - src.temp = "This spell temporarly blinds a single person and does not require wizard garb." - if ("7") - //feedback_add_details("wizard_spell_learned","MT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/mind_transfer(usr) - src.temp = "This spell allows the user to switch bodies with a target, and requires full wizard garb. Careful to not lose your memory in the process." - if ("8") - //feedback_add_details("wizard_spell_learned","FW") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(usr) - src.temp = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb." - if ("9") - //feedback_add_details("wizard_spell_learned","BL") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/turf_teleport/blink(usr) - src.temp = "This spell randomly teleports you a short distance. Useful for evasion or getting into areas if you have patience." - if ("10") - //feedback_add_details("wizard_spell_learned","TP") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(usr) - src.temp = "This spell teleports you to a type of area of your selection. Very useful if you are in danger, but has a decent cooldown, and is unpredictable." - if ("11") - //feedback_add_details("wizard_spell_learned","MU") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/genetic/mutate(usr) - src.temp = "This spell causes you to turn into a hulk and gain telekinesis for a short while." - if ("12") - //feedback_add_details("wizard_spell_learned","EJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(usr) - src.temp = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls." - if ("13") - //feedback_add_details("wizard_spell_learned","KN") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - usr.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/knock(usr) - src.temp = "This spell opens nearby doors and does not require wizard garb." -// if ("14") -// //feedback_add_details("wizard_spell_learned","SG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells -// usr.verbs += /client/proc/rightandwrong -// src.max_uses-- -// src.temp = "Nothing could possibly go wrong with arming a crew of lunatics just itching for an excuse to kill eachother. Just be careful not to get hit in the crossfire!" - if ("15") - //feedback_add_details("wizard_spell_learned","ST") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - new /obj/item/weapon/gun/energy/staff(get_turf(usr)) - src.temp = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself" - src.max_uses-- - if ("16") - //feedback_add_details("wizard_spell_learned","SS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - new /obj/item/weapon/storage/belt/soulstone/full(get_turf(usr)) - usr.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/construct(usr) - src.temp = "Soul Stone Shards are ancient tools capable of capturing and harnessing the spirits of the dead and dying. The spell Artificer allows you to create arcane machines for the captured souls to pilot." - src.max_uses-- -// if ("17") -// //feedback_add_details("wizard_spell_learned","VR") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells -// new /obj/item/weapon/veilrender(get_turf(usr)) -// src.temp = "Recovered from a shattered temple in what was speculated to be the ruins of an alien capital city, the blade is said to cut more than just the material. There was no trace of the blades creators, nor of any other life left on the dead planet, and what caused such an apocalypse remains a mystery.(Activate inhand to trigger its special ability)" -// src.max_uses-- if (href_list["spell_choice"] == "18") var/area/wizard_station/A = locate() if(usr in A.contents) src.uses = src.max_uses - usr.spellremove(usr,spell_type) + usr.spellremove(usr) src.temp = "All spells have been removed. You may now memorize a new set of spells." feedback_add_details("wizard_spell_learned","UM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells else @@ -229,177 +152,3 @@ if (M.client) src.attack_self(M) return - -//SWF UPLINK PROCS -/obj/item/weapon/SWF_uplink/attack_self(mob/user as mob) - user.machine = src - var/dat - if (src.selfdestruct) - dat = "Self Destructing..." - else - if (src.temp) - dat = "[src.temp]

      Clear" - else - dat = "Syndicate Uplink Console:
      " - dat += "Tele-Crystals left: [src.uses]
      " - dat += "
      " - dat += "Request item:
      " - dat += "Each item costs 1 telecrystal. The number afterwards is the cooldown time.
      " - dat += "Magic Missile (10)
      " - dat += "Fireball (10)
      " -// dat += "Disintegrate (60)
      " - dat += "Disable Technology (60)
      " - dat += "Smoke (10)
      " - dat += "Blind (30)
      " - dat += "Mind Transfer (60)
      " - dat += "Forcewall (10)
      " - dat += "Blink (2)
      " - dat += "Teleport (60)
      " - dat += "Mutate (60)
      " - dat += "Ethereal Jaunt (60)
      " - dat += "Knock (10)
      " - dat += "
      " - if (src.origradio) - dat += "Lock
      " - dat += "
      " - dat += "Self-Destruct" - user << browse(dat, "window=radio") - onclose(user, "radio") - return - -/obj/item/weapon/SWF_uplink/Topic(href, href_list) - ..() - if (usr.stat || usr.restrained()) - return - var/mob/living/carbon/human/H = usr - if (!( istype(H, /mob/living/carbon/human))) - return 1 - if ((usr.contents.Find(src) || (in_range(src,usr) && istype(src.loc, /turf)))) - usr.machine = src - if (href_list["spell_magicmissile"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/magicmissile - usr.mind.special_verbs += /client/proc/magicmissile - src.temp = "This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage." - else if (href_list["spell_fireball"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/fireball - usr.mind.special_verbs += /client/proc/fireball - src.temp = "This spell fires a fireball at a target and does not require wizard garb. Be careful not to fire it at people that are standing next to you." -// else if (href_list["spell_disintegrate"]) -// if (src.uses >= 1) -// src.uses -= 1 -// usr.verbs += /mob/proc/kill -// usr.mind.special_verbs += /mob/proc/kill -// src.temp = "This spell instantly kills somebody adjacent to you with the vilest of magick. It has a long cooldown." - else if (href_list["spell_emp"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /mob/proc/tech - usr.mind.special_verbs += /mob/proc/tech - src.temp = "This spell disables all weapons, cameras and most other technology in range." - else if (href_list["spell_smoke"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/smokecloud - usr.mind.special_verbs += /client/proc/smokecloud - src.temp = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb." - else if (href_list["spell_blind"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/blind - usr.mind.special_verbs += /client/proc/blind - src.temp = "This spell temporarly blinds a single person and does not require wizard garb." - else if (href_list["spell_swap"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /mob/proc/swap - src.temp = "This spell allows the user to switch bodies with a target. Careful to not lose your memory in the process." - else if (href_list["spell_forcewall"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/forcewall - usr.mind.special_verbs += /client/proc/forcewall - src.temp = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb." - else if (href_list["spell_blink"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/blink - usr.mind.special_verbs += /client/proc/blink - src.temp = "This spell randomly teleports you a short distance. Useful for evasion or getting into areas if you have patience." - else if (href_list["spell_teleport"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /mob/proc/teleport - usr.mind.special_verbs += /mob/proc/teleport - src.temp = "This spell teleports you to a type of area of your selection. Very useful if you are in danger, but has a decent cooldown, and is unpredictable." - else if (href_list["spell_mutate"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/mutate - usr.mind.special_verbs += /client/proc/mutate - src.temp = "This spell causes you to turn into a hulk and gain telekinesis for a short while." - else if (href_list["spell_jaunt"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/jaunt - usr.mind.special_verbs += /client/proc/jaunt - src.temp = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls." - else if (href_list["spell_knock"]) - if (src.uses >= 1) - src.uses -= 1 - usr.verbs += /client/proc/knock - usr.mind.special_verbs += /client/proc/knock - src.temp = "This spell opens nearby doors and does not require wizard garb." - else if (href_list["lock"] && src.origradio) - // presto chango, a regular radio again! (reset the freq too...) - usr.machine = null - usr << browse(null, "window=radio") - var/obj/item/device/radio/T = src.origradio - var/obj/item/weapon/SWF_uplink/R = src - R.loc = T - T.loc = usr - // R.layer = initial(R.layer) - R.layer = 0 - if (usr.client) - usr.client.screen -= R - if (usr.r_hand == R) - usr.u_equip(R) - usr.r_hand = T - else - usr.u_equip(R) - usr.l_hand = T - R.loc = T - T.layer = 20 - T.set_frequency(initial(T.frequency)) - T.attack_self(usr) - return - else if (href_list["selfdestruct"]) - src.temp = "Self-Destruct" - else if (href_list["selfdestruct2"]) - src.selfdestruct = 1 - spawn (100) - explode() - return - else - if (href_list["temp"]) - src.temp = null - if (istype(src.loc, /mob)) - attack_self(src.loc) - else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - return - -/obj/item/weapon/SWF_uplink/proc/explode() - var/turf/location = get_turf(src.loc) - location.hotspot_expose(700, 125) - - explosion(location, 0, 0, 2, 4) - - del(src.master) - del(src) - return diff --git a/code/game/gamemodes/wizard/spells.dm b/code/game/gamemodes/wizard/spells.dm index 836968acc8..adea896867 100644 --- a/code/game/gamemodes/wizard/spells.dm +++ b/code/game/gamemodes/wizard/spells.dm @@ -17,11 +17,10 @@ usr.verbs += /client/proc/blind usr.whisper("STI KALY") - // usr.spellvoice() var/obj/effect/overlay/B = new /obj/effect/overlay( M.loc ) B.icon_state = "blspell" - B.icon = 'wizard.dmi' + B.icon = 'icons/obj/wizard.dmi' B.name = "spell" B.anchored = 1 B.density = 0 @@ -31,9 +30,9 @@ del(B) M.canmove = 1 M << text("\blue Your eyes cry out in pain!") - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED spawn(300) - M.disabilities &= ~1 + M.disabilities &= ~NEARSIGHTED M.eye_blind = 10 M.eye_blurry = 20 return @@ -50,13 +49,12 @@ if(!usr.casting()) return usr.say("FORTI GY AMA") - usr.spellvoice() for (var/mob/living/M as mob in oview()) spawn(0) var/obj/effect/overlay/A = new /obj/effect/overlay( usr.loc ) A.icon_state = "magicm" - A.icon = 'wizard.dmi' + A.icon = 'icons/obj/wizard.dmi' A.name = "a magic missile" A.anchored = 0 A.density = 0 @@ -67,7 +65,7 @@ break var/obj/effect/overlay/B = new /obj/effect/overlay( A.loc ) B.icon_state = "magicmd" - B.icon = 'wizard.dmi' + B.icon = 'icons/obj/wizard.dmi' B.name = "trail" B.anchored = 1 B.density = 0 @@ -129,7 +127,7 @@ /obj/effect/forcefield desc = "A space wizard's magic wall." name = "FORCEWALL" - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "m_shield" anchored = 1.0 opacity = 0 @@ -162,7 +160,6 @@ var/forcefield usr.whisper("TARCOL MINTI ZHERI") -// usr.spellvoice() forcefield = new /obj/effect/forcefield(locate(usr.x,usr.y,usr.z)) spawn (300) @@ -171,7 +168,7 @@ //FIREBALLAN -/client/proc/fireball(mob/living/T as mob in oview()) +/client/proc/fireball() set category = "Spells" set name = "Fireball" set desc = "This spell fires a fireball at a target and does not require wizard garb." @@ -181,28 +178,63 @@ // if(!usr.casting()) return usr.verbs -= /client/proc/fireball - spawn(200) + spawn(100) usr.verbs += /client/proc/fireball usr.say("ONI SOMA") - // usr.spellvoice() + + var/mob/living/user = src + if(!istype(user)) + return + + var/i + var/turf/T + var/range = 15 + + var/x = user.loc.x + var/y = user.loc.y + var/z = user.loc.z + + switch(user.dir) + if(NORTH) + T = get_turf(locate(x, y + range, z)) + if(EAST) + T = get_turf(locate(x + range, y, z)) + if(SOUTH) + T = get_turf(locate(x, y - range, z)) + if(WEST) + T = get_turf(locate(x - range, y, z)) + else + return var/obj/effect/overlay/A = new /obj/effect/overlay( usr.loc ) + A.icon_state = "fireball" - A.icon = 'wizard.dmi' + A.icon = 'icons/obj/wizard.dmi' A.name = "a fireball" A.anchored = 0 A.density = 0 - var/i + A.luminosity = 3 + + step_to(A, T, 0) for(i=0, i<100, i++) - step_to(A,T,0) - if (get_dist(A,T) <= 1) - T.take_overall_damage(20,25) - explosion(T.loc, -1, -1, 2, 2) + var/hit = 0 + var/moving = step_to(A,T,0) + for(var/mob/living/target in range(1, A)) + hit = 1 + target.take_overall_damage(20,25) + if(hit) + explosion(A.loc, -1, -1, 2, 2) + del(A) + return + if(!moving) + explosion(A.loc, -1, -1, 2, 2) del(A) return sleep(2) - del(A) + if(A) + explosion(A.loc, -1, -1, 2, 2) + del(A) return //KNOCK @@ -220,7 +252,6 @@ usr.verbs += /client/proc/knock usr.whisper("AULIE OXIN FIERA") -// usr.spellvoice() for(var/obj/machinery/door/G in oview(3)) spawn(1) @@ -229,7 +260,6 @@ //KILL -/* /mob/proc/kill(mob/living/M as mob in oview(1)) set category = "Spells" set name = "Disintegrate" @@ -243,14 +273,12 @@ usr.verbs += /mob/proc/kill usr.say("EI NATH") - usr.spellvoice() var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(4, 1, M) s.start() M.dust() -*/ //DISABLE TECH @@ -267,7 +295,6 @@ usr.verbs += /mob/proc/tech usr.say("NEC CANTIO") - usr.spellvoice() empulse(src, 6, 10) return @@ -305,13 +332,12 @@ set category = "Spells" set name = "Teleport" set desc = "This spell teleports you to a type of area of your selection." - if(usr.stat) src << "Not when you are incapacitated." return - if(!usr.casting()) return - + var/A + usr.verbs -= /mob/proc/teleport /* var/list/theareas = new/list() for(var/area/AR in world) @@ -323,18 +349,14 @@ theareas[AR.name] = AR */ - var/A = input("Area to jump to", "Teleport") as null|anything in teleportlocs - if (isnull(A)) - return + A = input("Area to jump to", "BOOYEA", A) in teleportlocs - usr.verbs -= /mob/proc/teleport spawn(600) usr.verbs += /mob/proc/teleport var/area/thearea = teleportlocs[A] usr.say("SCYAR NILA [uppertext(A)]") - usr.spellvoice() var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(5, 0, usr.loc) @@ -350,10 +372,18 @@ break if(clear) L+=T - if(L.len) + + if(!L.len) + usr <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry." + return + + var/attempt = 0 + var/success = 0 + while(!success) + success = Move(pick(L)) + if(attempt > 20) break //Failsafe + if(!success) usr.loc = pick(L) - else - usr << "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry." smoke.start() @@ -361,11 +391,9 @@ if(usr.stat) usr << "Not when you are incapacitated." return + var/A - var/A = input("Area to jump to", "Teleport") as null|anything in teleportlocs - if (isnull(A)) - return - + A = input("Area to jump to", "BOOYEA", A) in teleportlocs var/area/thearea = teleportlocs[A] var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() @@ -384,12 +412,17 @@ L+=T if(!L.len) - usr <<"Invalid teleport destination." + usr <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry." return - else + var/attempt = 0 + var/success = 0 + while(!success) + success = Move(pick(L)) + if(attempt > 20) break //Failsafe + if(!success) usr.loc = pick(L) - smoke.start() + smoke.start() //JAUNT @@ -415,7 +448,7 @@ animation.name = "water" animation.density = 0 animation.anchored = 1 - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.icon_state = "liquify" animation.layer = 5 animation.master = holder @@ -434,7 +467,12 @@ sleep(20) flick("reappear",animation) sleep(5) - H.loc = mobloc + if(!H.Move(mobloc)) + for(var/direction in list(1,2,4,8,5,6,9,10)) + var/turf/T = get_step(mobloc, direction) + if(T) + if(H.Move(T)) + break H.canmove = 1 H.client.eye = H del(animation) @@ -442,7 +480,7 @@ /* /obj/effect/dummy/spell_jaunt name = "water" - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "nothing" var/canmove = 1 density = 0 @@ -494,7 +532,6 @@ usr.verbs += /client/proc/mutate usr.say("BIRUZ BENNAR") - usr.spellvoice() usr << text("\blue You feel strong! You feel pressure building behind your eyes!") if (!(HULK in usr.mutations)) @@ -524,20 +561,23 @@ U.whisper("GIN'YU CAPAN") U.verbs -= /mob/proc/swap + //Remove special verbs from both mobs if(U.mind.special_verbs.len) for(var/V in U.mind.special_verbs) U.verbs -= V - - var/mob/dead/observer/G = new /mob/dead/observer(H) //To properly transfer clients so no-one gets kicked off the game. - - H.client.mob = G if(H.mind.special_verbs.len) for(var/V in H.mind.special_verbs) H.verbs -= V - G.mind = H.mind - U.client.mob = H - H.mind = U.mind + //empty out H + var/mob/dead/observer/G = H.ghostize(0) //Transfers H to a temporary mob + + //Start the Transfer + U.mind.transfer_to(H) + G.mind.transfer_to(U) + U.key = G.key //has to be called explicitly since ghostize() set the datum/mind/var/active = 0 + + //Re-add those special verbs and stuff if(H.mind.special_verbs.len) var/spell_loss = 1//Can lose only one spell during transfer. var/probability = 95 //To determine the chance of wizard losing their spell. @@ -554,19 +594,10 @@ spawn(500) H << "The mind transfer has robbed you of a spell." - /* //This code SHOULD work to prevent Mind Swap spam since the spell transfer code above instantly resets it. - //I can't test this code because I can't test mind stuff on my own :x -- Darem. - if(hascall(H, /mob/proc/swap)) - H.verbs -= /mob/proc/swap - */ - G.client.mob = U - U.mind = G.mind if(U.mind.special_verbs.len)//Basic fix to swap verbs for any mob if needed. for(var/V in U.mind.special_verbs) U.verbs += V - U.mind.current = U - H.mind.current = H spawn(500) U << "Something about your body doesn't seem quite right..." @@ -576,7 +607,6 @@ spawn(600) H.verbs += /mob/proc/swap - del(G) else src << "Their mind is not compatible." return diff --git a/code/game/gamemodes/wizard/veilrender.dm b/code/game/gamemodes/wizard/veilrender.dm index 2310b16ff4..53ee1bfa59 100644 --- a/code/game/gamemodes/wizard/veilrender.dm +++ b/code/game/gamemodes/wizard/veilrender.dm @@ -1,7 +1,7 @@ /obj/item/weapon/veilrender name = "veil render" desc = "A wicked curved blade of alien origin, recovered from the ruins of a vast city." - icon = 'wizard.dmi' + icon = 'icons/obj/wizard.dmi' icon_state = "render" item_state = "render" flags = FPRINT | TABLEPASS @@ -14,7 +14,7 @@ /obj/effect/rend name = "Tear in the fabric of reality" desc = "You should run now" - icon = 'biomass.dmi' + icon = 'icons/obj/biomass.dmi' icon_state = "rift" density = 1 unacidable = 1 diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 885b32ccdd..1fe84641bc 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -5,6 +5,7 @@ /datum/game_mode/wizard name = "wizard" config_tag = "wizard" + required_players = 0 required_enemies = 1 recommended_enemies = 1 @@ -62,7 +63,50 @@ /datum/game_mode/proc/forge_wizard_objectives(var/datum/mind/wizard) - wizard.objectives = SelectObjectives("Wizard",wizard,1) + switch(rand(1,100)) + if(1 to 30) + + var/datum/objective/assassinate/kill_objective = new + kill_objective.owner = wizard + kill_objective.find_target() + wizard.objectives += kill_objective + + if (!(locate(/datum/objective/escape) in wizard.objectives)) + var/datum/objective/escape/escape_objective = new + escape_objective.owner = wizard + wizard.objectives += escape_objective + if(31 to 60) + var/datum/objective/steal/steal_objective = new + steal_objective.owner = wizard + steal_objective.find_target() + wizard.objectives += steal_objective + + if (!(locate(/datum/objective/escape) in wizard.objectives)) + var/datum/objective/escape/escape_objective = new + escape_objective.owner = wizard + wizard.objectives += escape_objective + + if(61 to 85) + var/datum/objective/assassinate/kill_objective = new + kill_objective.owner = wizard + kill_objective.find_target() + wizard.objectives += kill_objective + + var/datum/objective/steal/steal_objective = new + steal_objective.owner = wizard + steal_objective.find_target() + wizard.objectives += steal_objective + + if (!(locate(/datum/objective/survive) in wizard.objectives)) + var/datum/objective/survive/survive_objective = new + survive_objective.owner = wizard + wizard.objectives += survive_objective + + else + if (!(locate(/datum/objective/hijack) in wizard.objectives)) + var/datum/objective/hijack/hijack_objective = new + hijack_objective.owner = wizard + wizard.objectives += hijack_objective return @@ -79,6 +123,8 @@ wizard_mob.real_name = newname wizard_mob.name = newname + if(wizard_mob.mind) + wizard_mob.mind.name = newname return @@ -116,23 +162,22 @@ del(wizard_mob.r_store) del(wizard_mob.l_store) - wizard_mob.equip_if_possible(new /obj/item/device/radio/headset(wizard_mob), wizard_mob.slot_ears) - wizard_mob.equip_if_possible(new /obj/item/clothing/under/lightpurple(wizard_mob), wizard_mob.slot_w_uniform) - wizard_mob.equip_if_possible(new /obj/item/clothing/shoes/sandal(wizard_mob), wizard_mob.slot_shoes) - wizard_mob.equip_if_possible(new /obj/item/clothing/suit/wizrobe(wizard_mob), wizard_mob.slot_wear_suit) - wizard_mob.equip_if_possible(new /obj/item/clothing/head/wizard(wizard_mob), wizard_mob.slot_head) - wizard_mob.equip_if_possible(new /obj/item/weapon/storage/backpack(wizard_mob), wizard_mob.slot_back) - wizard_mob.equip_if_possible(new /obj/item/weapon/storage/box(wizard_mob), wizard_mob.slot_in_backpack) -// wizard_mob.equip_if_possible(new /obj/item/weapon/scrying_gem(wizard_mob), wizard_mob.slot_l_store) For scrying gem. - wizard_mob.equip_if_possible(new /obj/item/weapon/teleportation_scroll(wizard_mob), wizard_mob.slot_r_store) - if(config.feature_object_spell_system) //if it's turned on (in config.txt), spawns an object spell spellbook - wizard_mob.equip_if_possible(new /obj/item/weapon/spellbook/object_type_spells(wizard_mob), wizard_mob.slot_r_hand) - else - wizard_mob.equip_if_possible(new /obj/item/weapon/spellbook(wizard_mob), wizard_mob.slot_r_hand) + wizard_mob.equip_to_slot_or_del(new /obj/item/device/radio/headset(wizard_mob), slot_ears) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(wizard_mob), slot_w_uniform) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(wizard_mob), slot_shoes) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(wizard_mob), slot_wear_suit) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(wizard_mob), slot_head) + if(wizard_mob.backbag == 2) wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(wizard_mob), slot_back) + if(wizard_mob.backbag == 3) wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(wizard_mob), slot_back) + wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box(wizard_mob), slot_in_backpack) +// wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/scrying_gem(wizard_mob), slot_l_store) For scrying gem. + wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(wizard_mob), slot_r_store) + wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/spellbook(wizard_mob), slot_r_hand) wizard_mob << "You will find a list of available spells in your spell book. Choose your magic arsenal carefully." wizard_mob << "In your pockets you will find a teleport scroll. Use it as needed." wizard_mob.mind.store_memory("Remember: do not forget to prepare your spells.") + wizard_mob.update_icons() return 1 @@ -161,75 +206,51 @@ /datum/game_mode/proc/auto_declare_completion_wizard() - for(var/datum/mind/wizard in wizards) - var/wizard_name - if(wizard.current) - if(wizard.current == wizard.original) - wizard_name = "[wizard.current.real_name] (played by [wizard.key])" - else if (wizard.original) - wizard_name = "[wizard.current.real_name] (originally [wizard.original.real_name]) (played by [wizard.key])" - else - wizard_name = "[wizard.current.real_name] (original character destroyed) (played by [wizard.key])" - else - wizard_name = "[wizard.key] (character destroyed)" - world << "The wizard was [wizard_name]" - var/count = 1 - var/wizardwin = 1 - for(var/datum/objective/objective in wizard.objectives) - if(objective.check_completion()) - world << "Objective #[count]: [objective.explanation_text] \green Success" - //feedback_add_details("wizard_objective","[objective.type]|SUCCESS") - else - world << "Objective #[count]: [objective.explanation_text] \red Failed" - //feedback_add_details("wizard_objective","[objective.type]|FAIL") - wizardwin = 0 - count++ + if(wizards.len) + var/text = "The wizards/witches were:" - if(wizard.current && wizard.current.stat!=2 && wizardwin) - world << "The wizard was successful!" - //feedback_add_details("wizard_success","SUCCESS") - else - world << "The wizard has failed!" - //feedback_add_details("wizard_success","FAIL") + for(var/datum/mind/wizard in wizards) + + text += "
      [wizard.key] was [wizard.name] (" + if(wizard.current) + if(wizard.current.stat == DEAD) + text += "died" + else + text += "survived" + if(wizard.current.real_name != wizard.name) + text += " as [wizard.current.real_name]" + else + text += "body destroyed" + text += ")" + + var/count = 1 + var/wizardwin = 1 + for(var/datum/objective/objective in wizard.objectives) + if(objective.check_completion()) + text += "
      Objective #[count]: [objective.explanation_text] Success!" + feedback_add_details("wizard_objective","[objective.type]|SUCCESS") + else + text += "
      Objective #[count]: [objective.explanation_text] Fail." + feedback_add_details("wizard_objective","[objective.type]|FAIL") + wizardwin = 0 + count++ + + if(wizard.current && wizard.current.stat!=2 && wizardwin) + text += "
      The wizard was successful!" + feedback_add_details("wizard_success","SUCCESS") + else + text += "
      The wizard has failed!" + feedback_add_details("wizard_success","FAIL") + + world << text return 1 //OTHER PROCS //To batch-remove wizard spells. Linked to mind.dm. -/mob/proc/spellremove(var/mob/M as mob, var/spell_type = "verb") -// ..() - if(spell_type == "verb") - if(M.verbs.len) - M.verbs -= /client/proc/jaunt - M.verbs -= /client/proc/magicmissile - M.verbs -= /client/proc/fireball -// M.verbs -= /mob/proc/kill - M.verbs -= /mob/proc/tech - M.verbs -= /client/proc/smokecloud - M.verbs -= /client/proc/blind - M.verbs -= /client/proc/forcewall - M.verbs -= /mob/proc/teleport - M.verbs -= /client/proc/mutate - M.verbs -= /client/proc/knock - M.verbs -= /mob/proc/swap - M.verbs -= /client/proc/blink - if(M.mind && M.mind.special_verbs.len) - M.mind.special_verbs -= /client/proc/jaunt - M.mind.special_verbs -= /client/proc/magicmissile - M.mind.special_verbs -= /client/proc/fireball -// M.mind.special_verbs -= /mob/proc/kill - M.mind.special_verbs -= /mob/proc/tech - M.mind.special_verbs -= /client/proc/smokecloud - M.mind.special_verbs -= /client/proc/blind - M.mind.special_verbs -= /client/proc/forcewall - M.mind.special_verbs -= /mob/proc/teleport - M.mind.special_verbs -= /client/proc/mutate - M.mind.special_verbs -= /client/proc/knock - M.mind.special_verbs -= /mob/proc/swap - M.mind.special_verbs -= /client/proc/blink - else if(spell_type == "object") - for(var/obj/effect/proc_holder/spell/spell_to_remove in src.spell_list) - del(spell_to_remove) +/mob/proc/spellremove(var/mob/M as mob) + for(var/obj/effect/proc_holder/spell/spell_to_remove in src.spell_list) + del(spell_to_remove) /*Checks if the wizard can cast spells. Made a proc so this is not repeated 14 (or more) times.*/ @@ -246,13 +267,3 @@ Made a proc so this is not repeated 14 (or more) times.*/ return 0 else return 1 - -/*Checks if the wizard is a mime and male/female. -Outputs the appropriate voice if the user is not a mime. -Made a proc here so it's not repeated several times.*/ -/mob/proc/spellvoice() -// if(!usr.miming)No longer necessary. -// if(usr.gender=="male") -// playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1) -// else -// playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1) diff --git a/code/game/hud.dm b/code/game/hud.dm index 506b0cfeb2..c2859aad99 100644 --- a/code/game/hud.dm +++ b/code/game/hud.dm @@ -1,16 +1,14 @@ +//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" //Lower left, persistant menu #define ui_inventory "1:6,1:5" - -//Inventory close areas. When you pass your mouse over these areas they close the inventory. -#define ui_invclosearea1 "1,1 to 1:6,5" -#define ui_invclosearea2 "1,1 to 4,1:16" -#define ui_invclosearea3 "4:16,1 to 5:16,5" -#define ui_invclosearea4 "1,5:16 to 4,5:16" - - //Lower center, persistant menu #define ui_sstore1 "3:10,1:5" #define ui_id "4:12,1:5" @@ -30,31 +28,22 @@ #define ui_inv1 "6:16,1:5" //borgs #define ui_inv2 "7:16,1:5" //borgs #define ui_inv3 "8:16,1:5" //borgs -#define ui_borg_store "9:14,1:5" //borgs +#define ui_borg_store "9:16,1:5" //borgs #define ui_monkey_mask "5:14,1:5" //monkey #define ui_monkey_back "6:14,1:5" //monkey //Lower right, persistant menu -#define ui_dropbutton "11:22,1:5" -#define ui_throw "11:22,1:5" -#define ui_pull "12:24,1:5" -#define ui_movi "12:24,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) -//Gun buttons -#define ui_gun1 "13:26,2:5" -#define ui_gun2 "12:24,2:5" -#define ui_gun3 "11:22,2:5" -#define ui_gun_select "14:28,2:5" - -//Middle right (damage indicators) -#define ui_pressure "14:28,6:13" -#define ui_oxygen "14:28,7:15" -#define ui_fire "14:28,8:17" -#define ui_toxin "14:28,9:19" +#define ui_borg_pull "12:24,2:7" +#define ui_borg_module "13:26,2:7" +#define ui_borg_panel "14:28,2:7" //Upper-middle right (damage indicators) #define ui_toxin "14:28,13:27" @@ -62,21 +51,21 @@ #define ui_oxygen "14:28,11:23" #define ui_pressure "14:28,10: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" + + //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" -//For non-human compatibility //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_throw_old "13:26,2:7" -#define ui_movi_old "12:24,2:7" -#define ui_pull_old "14:28,2:7" -#define ui_dropbutton_old "12:24,1:5" -#define ui_pull_borg "12:24,1:5" + //Pop-up inventory #define ui_shoes "2:8,1:5" @@ -87,8 +76,7 @@ #define ui_glasses "1:6,3:9" #define ui_mask "2:8,3:9" -#define ui_lear "3:10,3:9" -#define ui_rear "3:10,4:11" +#define ui_ears "3:10,3:9" #define ui_head "2:8,4:11" @@ -96,10 +84,10 @@ //Intent small buttons -#define ui_help_small "13:18,1:-3" -#define ui_disarm_small "13:18,1:12" -#define ui_grab_small "13:34,1:12" -#define ui_harm_small "13:34,1:-3" +#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" @@ -109,7 +97,7 @@ //#define ui_headset "SOUTH,8" #define ui_hand "6:14,1:5" #define ui_hstore1 "5,5" -#define ui_resist "EAST+1,SOUTH-1" +//#define ui_resist "EAST+1,SOUTH-1" #define ui_sleep "EAST+1, NORTH-13" #define ui_rest "EAST+1, NORTH-14" @@ -126,41 +114,54 @@ obj/hud/New(var/type = 0) return -/obj/hud/proc/other_update() - +/obj/hud/proc/hidden_inventory_update() if(!mymob) return - if(show_otherinventory) - if(mymob:shoes) mymob:shoes:screen_loc = ui_shoes - if(mymob:gloves) mymob:gloves:screen_loc = ui_gloves - if(mymob:l_ear) mymob:l_ear:screen_loc = ui_lear - if(mymob:r_ear) mymob:r_ear:screen_loc = ui_rear - //if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1 - if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses - if(mymob:w_uniform) mymob:w_uniform:screen_loc = ui_iclothing - if(mymob:wear_suit) mymob:wear_suit:screen_loc = ui_oclothing - if(mymob:wear_mask) mymob:wear_mask:screen_loc = ui_mask - if(mymob:head) mymob:head:screen_loc = ui_head + if(inventory_shown && hud_shown) + if(ishuman(mymob)) + if(mymob:shoes) mymob:shoes:screen_loc = ui_shoes + if(mymob:gloves) mymob:gloves:screen_loc = ui_gloves + if(mymob:ears) mymob:ears:screen_loc = ui_ears + if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses + if(mymob:w_uniform) mymob:w_uniform:screen_loc = ui_iclothing + if(mymob:wear_suit) mymob:wear_suit:screen_loc = ui_oclothing + if(mymob:wear_mask) mymob:wear_mask:screen_loc = ui_mask + if(mymob:head) mymob:head:screen_loc = ui_head else - if(istype(mymob, /mob/living/carbon/human)) + if(ishuman(mymob)) if(mymob:shoes) mymob:shoes:screen_loc = null if(mymob:gloves) mymob:gloves:screen_loc = null - if(mymob:l_ear) mymob:l_ear:screen_loc = null - if(mymob:r_ear) mymob:r_ear:screen_loc = null - //if(mymob:s_store) mymob:s_store:screen_loc = null + if(mymob:ears) mymob:ears:screen_loc = null if(mymob:glasses) mymob:glasses:screen_loc = null if(mymob:w_uniform) mymob:w_uniform:screen_loc = null if(mymob:wear_suit) mymob:wear_suit:screen_loc = null if(mymob:wear_mask) mymob:wear_mask:screen_loc = null if(mymob:head) mymob:head:screen_loc = null +/obj/hud/proc/persistant_inventory_update() + if(!mymob) return + if(hud_shown) + if(ishuman(mymob)) + if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1 + if(mymob:wear_id) mymob:wear_id:screen_loc = ui_id + if(mymob:belt) mymob:belt:screen_loc = ui_belt + if(mymob:back) mymob:back:screen_loc = ui_back + if(mymob:l_store) mymob:l_store:screen_loc = ui_storage1 + if(mymob:r_store) mymob:r_store:screen_loc = ui_storage2 + else + if(ishuman(mymob)) + if(mymob:s_store) mymob:s_store:screen_loc = null + if(mymob:wear_id) mymob:wear_id:screen_loc = null + if(mymob:belt) mymob:belt:screen_loc = null + if(mymob:back) mymob:back:screen_loc = null + if(mymob:l_store) mymob:l_store:screen_loc = null + if(mymob:r_store) mymob:r_store:screen_loc = null -/obj/hud/var/show_otherinventory = 1 -/obj/hud/var/obj/screen/action_intent -/obj/hud/var/obj/screen/hurt_intent -/obj/hud/var/obj/screen/disarm_intent -/obj/hud/var/obj/screen/help_intent -/obj/hud/var/obj/screen/grab_intent -/obj/hud/var/obj/screen/move_intent + +/obj/hud + var/obj/screen/action_intent + var/obj/screen/move_intent + var/hud_shown = 1 //Used for the HUD toggle (F12) + var/inventory_shown = 1 //the inventory /obj/hud/proc/instantiate(var/type = 0) @@ -194,9 +195,6 @@ obj/hud/New(var/type = 0) else if(isrobot(mymob)) robot_hud() - else if(isamorph(mymob)) - amorph_hud() - // else if(ishivebot(mymob)) // hivebot_hud() diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 64ee883f5c..c92bedb091 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -1,28 +1,110 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 + +/var/const/access_security = 1 +/var/const/access_brig = 2 +/var/const/access_armory = 3 +/var/const/access_forensics_lockers= 4 +/var/const/access_medical = 5 +/var/const/access_morgue = 6 +/var/const/access_tox = 7 +/var/const/access_tox_storage = 8 +/var/const/access_genetics = 9 +/var/const/access_engine = 10 +/var/const/access_engine_equip= 11 +/var/const/access_maint_tunnels = 12 +/var/const/access_external_airlocks = 13 +/var/const/access_emergency_storage = 14 +/var/const/access_change_ids = 15 +/var/const/access_ai_upload = 16 +/var/const/access_teleporter = 17 +/var/const/access_eva = 18 +/var/const/access_heads = 19 +/var/const/access_captain = 20 +/var/const/access_all_personal_lockers = 21 +/var/const/access_chapel_office = 22 +/var/const/access_tech_storage = 23 +/var/const/access_atmospherics = 24 +/var/const/access_bar = 25 +/var/const/access_janitor = 26 +/var/const/access_crematorium = 27 +/var/const/access_kitchen = 28 +/var/const/access_robotics = 29 +/var/const/access_rd = 30 +/var/const/access_cargo = 31 +/var/const/access_construction = 32 +/var/const/access_chemistry = 33 +/var/const/access_cargo_bot = 34 +/var/const/access_hydroponics = 35 +/var/const/access_manufacturing = 36 +/var/const/access_library = 37 +/var/const/access_lawyer = 38 +/var/const/access_virology = 39 +/var/const/access_cmo = 40 +/var/const/access_qm = 41 +/var/const/access_court = 42 +/var/const/access_clown = 43 +/var/const/access_mime = 44 +/var/const/access_surgery = 45 +/var/const/access_theatre = 46 +/var/const/access_research = 47 +/var/const/access_mining = 48 +/var/const/access_mining_office = 49 //not in use +/var/const/access_mailsorting = 50 +/var/const/access_mint = 51 +/var/const/access_mint_vault = 52 +/var/const/access_heads_vault = 53 +/var/const/access_mining_station = 54 +/var/const/access_xenobiology = 55 +/var/const/access_ce = 56 +/var/const/access_hop = 57 +/var/const/access_hos = 58 +/var/const/access_RC_announce = 59 //Request console announcements +/var/const/access_keycard_auth = 60 //Used for events which require at least two people to confirm them +/var/const/access_tcomsat = 61 // has access to the entire telecomms satellite / machinery + + //BEGIN CENTCOM ACCESS + /*Should leave plenty of room if we need to add more access levels. +/var/const/Mostly for admin fun times.*/ +/var/const/access_cent_general = 101//General facilities. +/var/const/access_cent_thunder = 102//Thunderdome. +/var/const/access_cent_specops = 103//Special Ops. +/var/const/access_cent_medical = 104//Medical/Research +/var/const/access_cent_living = 105//Living quarters. +/var/const/access_cent_storage = 106//Generic storage areas. +/var/const/access_cent_teleporter = 107//Teleporter. +/var/const/access_cent_creed = 108//Creed's office. +/var/const/access_cent_captain = 109//Captain's office/ID comp/AI. + + //The Syndicate +/var/const/access_syndicate = 150//General Syndicate Access + + //MONEY +/var/const/access_crate_cash = 200 + /obj/var/list/req_access = null /obj/var/req_access_txt = "0" - -/obj/var/list/req_combined_access = null -/obj/var/req_combined_access_txt = "0" +/obj/var/list/req_one_access = null +/obj/var/req_one_access_txt = "0" /obj/New() //NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6 - if(req_access_txt) + if(src.req_access_txt) var/list/req_access_str = dd_text2list(req_access_txt,";") if(!req_access) req_access = list() for(var/x in req_access_str) var/n = text2num(x) if(n) - req_access |= n + req_access += n - if(req_combined_access_txt) - var/list/req_access_str = dd_text2list(req_combined_access_txt,";") - if(!req_combined_access) - req_combined_access = list() - for(var/x in req_access_str) + if(src.req_one_access_txt) + var/list/req_one_access_str = dd_text2list(req_one_access_txt,";") + if(!req_one_access) + req_one_access = list() + for(var/x in req_one_access_str) var/n = text2num(x) if(n) - req_combined_access |= n + req_one_access += n ..() @@ -37,12 +119,12 @@ else if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M //if they are holding or wearing a card that has access, that works - if(src.check_access(H.equipped()) || src.check_access(H.wear_id)) + if(src.check_access(H.get_active_hand()) || src.check_access(H.wear_id)) return 1 else if(istype(M, /mob/living/carbon/monkey) || istype(M, /mob/living/carbon/alien/humanoid)) var/mob/living/carbon/george = M //they can only hold things :( - if(george.equipped() && (istype(george.equipped(), /obj/item/weapon/card/id) || istype(george.equipped(), /obj/item/device/pda)) && src.check_access(george.equipped())) + if(george.get_active_hand() && (istype(george.get_active_hand(), /obj/item/weapon/card/id) || istype(george.get_active_hand(), /obj/item/device/pda)) && src.check_access(george.get_active_hand())) return 1 return 0 @@ -52,189 +134,184 @@ var/obj/item/device/pda/pda = I I = pda.id - if(!req_access) //no requirements + if(!src.req_access && !src.req_one_access) //no requirements return 1 - if(!istype(req_access, /list)) //something's very wrong + if(!istype(src.req_access, /list)) //something's very wrong + return 1 + + var/list/L = src.req_access + if(!L.len && (!src.req_one_access || !src.req_one_access.len)) //no requirements return 1 - if(!req_access.len) //no requirements - if(!req_combined_access || !islist(req_combined_access) || !req_combined_access.len) - return 1 if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access return 0 - for(var/req in req_access) - if(req in I.access) //has an access from the single access list - return 1 - if(req_combined_access && req_combined_access.len) - for(var/req in req_combined_access) - if(!req in I.access) - return 0 - return 1 - return 0 + for(var/req in src.req_access) + if(!(req in I.access)) //doesn't have this access + return 0 + if(src.req_one_access && src.req_one_access.len) + for(var/req in src.req_one_access) + if(req in I.access) //has an access from the single access list + return 1 + return 0 + return 1 /obj/proc/check_access_list(var/list/L) - if(!req_access) - return 1 - if(!istype(req_access, /list)) - return 1 - if(!req_access.len) - if(!req_combined_access || !islist(req_combined_access) || !req_combined_access.len) - return 1 - if(!L) + if(!src.req_access && !src.req_one_access) return 1 + if(!istype(src.req_access, /list)) return 1 + if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1 + if(!L) return 0 + if(!istype(L, /list)) return 0 + for(var/req in src.req_access) + if(!(req in L)) //doesn't have this access + return 0 + if(src.req_one_access && src.req_one_access.len) + for(var/req in src.req_one_access) + if(req in L) //has an access from the single access list + return 1 return 0 - if(!istype(L, /list)) - return 0 - for(var/req in req_access) - if(req in L) //has an access from the single access list - return 1 - if(req_combined_access && req_combined_access.len) - for(var/req in req_combined_access) - if(!req in L) - return 0 - return 1 - return 0 + return 1 /proc/get_access(job) switch(job) if("Geneticist") - return list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_GENETICS) + return list(access_medical, access_morgue, access_genetics) if("Station Engineer") - return list(ACCESS_ENGINE, ACCESS_ENGINE_EQUIP, ACCESS_TECH_STORAGE, ACCESS_MAINT_TUNNELS, ACCESS_EXTERNAL_AIRLOCKS, ACCESS_CONSTRUCTION) + return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction) if("Assistant") - return list() + return list(access_maint_tunnels) if("Chaplain") - return list(ACCESS_MORGUE, ACCESS_CHAPEL_OFFICE, ACCESS_CREMATORIUM) + return list(access_morgue, access_chapel_office, access_crematorium) if("Detective") - return list(ACCESS_SECURITY, ACCESS_FORENSICS_LOCKERS, ACCESS_MORGUE, ACCESS_MAINT_TUNNELS, ACCESS_COURT) + return list(access_security, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court) if("Medical Doctor") - return list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_SURGERY, ACCESS_VIROLOGY) + return list(access_medical, access_morgue, access_surgery) if("Botanist") // -- TLE - return list(ACCESS_HYDROPONICS) // Removed tox and chem access because STOP PISSING OFF THE CHEMIST GUYS // //Removed medical access because WHAT THE FUCK YOU AREN'T A DOCTOR YOU GROW WHEAT + return list(access_hydroponics, access_morgue) // Removed tox and chem access because STOP PISSING OFF THE CHEMIST GUYS // //Removed medical access because WHAT THE FUCK YOU AREN'T A DOCTOR YOU GROW WHEAT //Given Morgue access because they have a viable means of cloning. if("Librarian") // -- TLE - return list(ACCESS_LIBRARY) + return list(access_library) if("Lawyer") //Muskets 160910 - return list(ACCESS_LAWYER, ACCESS_COURT) + return list(access_lawyer, access_court) if("Captain") return get_all_accesses() if("Security Officer") - return list(ACCESS_SECURITY, ACCESS_BRIG, ACCESS_COURT, ACCESS_MAINT_TUNNELS) + return list(access_security, access_brig, access_court) if("Warden") - return list(ACCESS_SECURITY, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_MAINT_TUNNELS) + return list(access_security, access_brig, access_armory, access_court) if("Scientist") - return list(ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_RESEARCH, ACCESS_XENOBIOLOGY) + return list(access_tox, access_tox_storage, access_research, access_xenobiology) if("Head of Security") - return list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_CHEMISTRY, ACCESS_GENETICS, ACCESS_COURT, - ACCESS_TELEPORTER, ACCESS_HEADS, ACCESS_TECH_STORAGE, ACCESS_SECURITY, ACCESS_BRIG, ACCESS_ATMOSPHERICS, - ACCESS_MAINT_TUNNELS, ACCESS_BAR, ACCESS_JANITOR, ACCESS_KITCHEN, ACCESS_ROBOTICS, ACCESS_ARMORY, ACCESS_HYDROPONICS, - ACCESS_THEATRE, ACCESS_RESEARCH, ACCESS_HOS, ACCESS_RC_ANNOUNCE, ACCESS_FORENSICS_LOCKERS, ACCESS_KEYCARD_AUTH) + return list(access_medical, access_morgue, access_tox, access_tox_storage, access_chemistry, access_genetics, access_court, + access_teleporter, access_heads, access_tech_storage, access_security, access_brig, access_atmospherics, + access_maint_tunnels, access_bar, access_janitor, access_kitchen, access_robotics, access_armory, access_hydroponics, + access_theatre, access_research, access_hos, access_RC_announce, access_forensics_lockers, access_keycard_auth) if("Head of Personnel") - return list(ACCESS_SECURITY, ACCESS_BRIG, ACCESS_COURT, ACCESS_FORENSICS_LOCKERS, - ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_CHEMISTRY, ACCESS_MEDICAL, ACCESS_GENETICS, ACCESS_ENGINE, - ACCESS_EMERGENCY_STORAGE, ACCESS_CHANGE_IDS, ACCESS_AI_UPLOAD, ACCESS_EVA, ACCESS_HEADS, - ACCESS_ALL_PERSONAL_LOCKERS, ACCESS_TECH_STORAGE, ACCESS_MAINT_TUNNELS, ACCESS_BAR, ACCESS_JANITOR, - ACCESS_CREMATORIUM, ACCESS_KITCHEN, ACCESS_ROBOTICS, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_MAILSORTING, ACCESS_QM, ACCESS_HYDROPONICS, ACCESS_LAWYER, - ACCESS_THEATRE, ACCESS_CHAPEL_OFFICE, ACCESS_LIBRARY, ACCESS_RESEARCH, ACCESS_MINING, ACCESS_HEADS_VAULT, ACCESS_MINING_STATION, - ACCESS_CLOWN, ACCESS_MIME, ACCESS_HOP, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH) + return list(access_security, access_brig, access_court, access_forensics_lockers, + access_tox, access_tox_storage, access_chemistry, access_medical, access_genetics, access_engine, + access_emergency_storage, access_change_ids, access_ai_upload, access_eva, access_heads, + access_all_personal_lockers, access_tech_storage, access_maint_tunnels, access_bar, access_janitor, + access_crematorium, access_kitchen, access_robotics, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer, + access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station, + access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth) if("Atmospheric Technician") - return list(ACCESS_ATMOSPHERICS, ACCESS_MAINT_TUNNELS, ACCESS_EMERGENCY_STORAGE) + return list(access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction) if("Bartender") - return list(ACCESS_BAR) + return list(access_bar) if("Chemist") - return list(ACCESS_MEDICAL, ACCESS_CHEMISTRY) + return list(access_medical, access_chemistry) if("Janitor") - return list(ACCESS_JANITOR, ACCESS_MAINT_TUNNELS) + return list(access_janitor, access_maint_tunnels) if("Clown") - return list(ACCESS_CLOWN, ACCESS_THEATRE) + return list(access_clown, access_theatre) if("Mime") - return list(ACCESS_MIME, ACCESS_THEATRE) + return list(access_mime, access_theatre) if("Chef") - return list(ACCESS_KITCHEN) + return list(access_kitchen, access_morgue) if("Roboticist") - return list(ACCESS_ROBOTICS, ACCESS_TECH_STORAGE, ACCESS_MAINT_TUNNELS, ACCESS_MORGUE) //As a job that handles so many corpses, it makes sense for them to have morgue access. + return list(access_robotics, access_tech_storage, access_morgue) //As a job that handles so many corpses, it makes sense for them to have morgue access. if("Cargo Technician") - return list(ACCESS_MAINT_TUNNELS, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_MAILSORTING) + return list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting) if("Shaft Miner") - return list(ACCESS_MINING, ACCESS_MINT, ACCESS_MINING_STATION) + return list(access_mining, access_mint, access_mining_station) if("Quartermaster") - return list(ACCESS_MAINT_TUNNELS, ACCESS_MAILSORTING, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_QM, ACCESS_MINT, ACCESS_MINING, ACCESS_MINING_STATION) + return list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station) if("Chief Engineer") - return list(ACCESS_ENGINE, ACCESS_ENGINE_EQUIP, ACCESS_TECH_STORAGE, ACCESS_MAINT_TUNNELS, - ACCESS_TELEPORTER, ACCESS_EXTERNAL_AIRLOCKS, ACCESS_ATMOSPHERICS, ACCESS_EMERGENCY_STORAGE, ACCESS_EVA, - ACCESS_HEADS, ACCESS_AI_UPLOAD, ACCESS_CONSTRUCTION, ACCESS_ROBOTICS, - ACCESS_MINT, ACCESS_CE, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT) + return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, + access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva, + access_heads, access_ai_upload, access_construction, access_robotics, + access_mint, access_ce, access_RC_announce, access_keycard_auth, access_tcomsat) if("Research Director") - return list(ACCESS_RD, ACCESS_HEADS, ACCESS_TOX, ACCESS_GENETICS, - ACCESS_TOX_STORAGE, ACCESS_TELEPORTER, - ACCESS_RESEARCH, ACCESS_ROBOTICS, ACCESS_XENOBIOLOGY, - ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT) -// if("Virologist") -// return list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_VIROLOGY) + return list(access_rd, access_heads, access_tox, access_genetics, + access_tox_storage, access_teleporter, + access_research, access_robotics, access_xenobiology, + access_RC_announce, access_keycard_auth, access_tcomsat) + if("Virologist") + return list(access_medical, access_virology) if("Chief Medical Officer") - return list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_GENETICS, ACCESS_HEADS, - ACCESS_CHEMISTRY, ACCESS_VIROLOGY, ACCESS_CMO, ACCESS_SURGERY, ACCESS_RC_ANNOUNCE, - ACCESS_KEYCARD_AUTH) + return list(access_medical, access_morgue, access_genetics, access_heads, + access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce, + access_keycard_auth) else return list() /proc/get_centcom_access(job) switch(job) if("VIP Guest") - return list(ACCESS_CENT_GENERAL) + return list(access_cent_general) if("Custodian") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_LIVING, ACCESS_CENT_STORAGE) + return list(access_cent_general, access_cent_living, access_cent_storage) if("Thunderdome Overseer") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_THUNDER) + return list(access_cent_general, access_cent_thunder) if("Intel Officer") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_LIVING) + return list(access_cent_general, access_cent_living) if("Medical Officer") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_LIVING, ACCESS_CENT_MEDICAL) + return list(access_cent_general, access_cent_living, access_cent_medical) if("Death Commando") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_SPECOPS, ACCESS_CENT_LIVING, ACCESS_CENT_STORAGE) + return list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage) if("Research Officer") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_SPECOPS, ACCESS_CENT_MEDICAL, ACCESS_CENT_TELEPORTER, ACCESS_CENT_STORAGE) + return list(access_cent_general, access_cent_specops, access_cent_medical, access_cent_teleporter, access_cent_storage) if("BlackOps Commander") - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_THUNDER, ACCESS_CENT_SPECOPS, ACCESS_CENT_LIVING, ACCESS_CENT_STORAGE, ACCESS_CENT_CREED) + return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_living, access_cent_storage, access_cent_creed) if("Supreme Commander") return get_all_centcom_access() /proc/get_all_accesses() - return list(ACCESS_SECURITY, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS, ACCESS_COURT, - ACCESS_MEDICAL, ACCESS_GENETICS, ACCESS_MORGUE, ACCESS_RD, - ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_CHEMISTRY, ACCESS_ENGINE, ACCESS_ENGINE_EQUIP, ACCESS_MAINT_TUNNELS, - ACCESS_EXTERNAL_AIRLOCKS, ACCESS_EMERGENCY_STORAGE, ACCESS_CHANGE_IDS, ACCESS_AI_UPLOAD, - ACCESS_TELEPORTER, ACCESS_EVA, ACCESS_HEADS, ACCESS_CAPTAIN, ACCESS_ALL_PERSONAL_LOCKERS, - ACCESS_TECH_STORAGE, ACCESS_CHAPEL_OFFICE, ACCESS_ATMOSPHERICS, ACCESS_KITCHEN, - ACCESS_BAR, ACCESS_JANITOR, ACCESS_CREMATORIUM, ACCESS_ROBOTICS, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_CONSTRUCTION, - ACCESS_HYDROPONICS, ACCESS_LIBRARY, ACCESS_MANUFACTURING, ACCESS_LAWYER, ACCESS_VIROLOGY, ACCESS_CMO, ACCESS_QM, ACCESS_CLOWN, ACCESS_MIME, ACCESS_SURGERY, - ACCESS_THEATRE, ACCESS_RESEARCH, ACCESS_MINING, ACCESS_MAILSORTING, ACCESS_MINT_VAULT, ACCESS_MINT, - ACCESS_HEADS_VAULT, ACCESS_MINING_STATION, ACCESS_XENOBIOLOGY, ACCESS_CE, ACCESS_HOP, ACCESS_HOS, ACCESS_RC_ANNOUNCE, - ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT) + return list(access_security, access_brig, access_armory, access_forensics_lockers, access_court, + access_medical, access_genetics, access_morgue, access_rd, + access_tox, access_tox_storage, access_chemistry, access_engine, access_engine_equip, access_maint_tunnels, + access_external_airlocks, access_emergency_storage, access_change_ids, access_ai_upload, + access_teleporter, access_eva, access_heads, access_captain, access_all_personal_lockers, + access_tech_storage, access_chapel_office, access_atmospherics, access_kitchen, + access_bar, access_janitor, access_crematorium, access_robotics, access_cargo, access_cargo_bot, access_construction, + access_hydroponics, access_library, access_manufacturing, access_lawyer, access_virology, access_cmo, access_qm, access_clown, access_mime, access_surgery, + access_theatre, access_research, access_mining, access_mailsorting, access_mint_vault, access_mint, + access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce, + access_keycard_auth, access_tcomsat) /proc/get_all_centcom_access() - return list(ACCESS_CENT_GENERAL, ACCESS_CENT_THUNDER, ACCESS_CENT_SPECOPS, ACCESS_CENT_MEDICAL, ACCESS_CENT_LIVING, ACCESS_CENT_STORAGE, ACCESS_CENT_TELEPORTER, ACCESS_CENT_CREED, ACCESS_CENT_CAPTAIN) + return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_medical, access_cent_living, access_cent_storage, access_cent_teleporter, access_cent_creed, access_cent_captain) /proc/get_all_syndicate_access() - return list(ACCESS_SYNDICATE) + return list(access_syndicate) /proc/get_region_accesses(var/code) switch(code) if(0) return get_all_accesses() if(1) //security - return list(ACCESS_SECURITY, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS, ACCESS_COURT, ACCESS_HOS) + return list(access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos) if(2) //medbay - return list(ACCESS_MEDICAL, ACCESS_GENETICS, ACCESS_MORGUE, ACCESS_CHEMISTRY, ACCESS_VIROLOGY, ACCESS_SURGERY, ACCESS_CMO) + return list(access_medical, access_genetics, access_morgue, access_chemistry, access_virology, access_surgery, access_cmo) if(3) //research - return list(ACCESS_RESEARCH, ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_XENOBIOLOGY, ACCESS_RD) + return list(access_research, access_tox, access_tox_storage, access_xenobiology, access_rd) if(4) //engineering and maintenance - return list(ACCESS_ENGINE, ACCESS_ENGINE_EQUIP, ACCESS_MAINT_TUNNELS, ACCESS_EXTERNAL_AIRLOCKS, ACCESS_TECH_STORAGE, ACCESS_ATMOSPHERICS, ACCESS_CONSTRUCTION, ACCESS_ROBOTICS, ACCESS_CE) + return list(access_engine, access_engine_equip, access_maint_tunnels, access_external_airlocks, access_tech_storage, access_atmospherics, access_construction, access_robotics, access_ce) if(5) //command - return list(ACCESS_HEADS, ACCESS_CHANGE_IDS, ACCESS_AI_UPLOAD, ACCESS_TELEPORTER, ACCESS_EVA, ACCESS_ALL_PERSONAL_LOCKERS, ACCESS_HEADS_VAULT, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT, ACCESS_HOP, ACCESS_CAPTAIN) + return list(access_heads, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_all_personal_lockers, access_heads_vault, access_RC_announce, access_keycard_auth, access_tcomsat, access_hop, access_captain) if(6) //station general - return list(ACCESS_KITCHEN,ACCESS_BAR, ACCESS_HYDROPONICS, ACCESS_JANITOR, ACCESS_CHAPEL_OFFICE, ACCESS_CREMATORIUM, ACCESS_LIBRARY, ACCESS_THEATRE, ACCESS_LAWYER, ACCESS_CLOWN, ACCESS_MIME) + return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer, access_clown, access_mime) if(7) //supply - return list(ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_MAILSORTING, ACCESS_QM, ACCESS_MINING, ACCESS_MINING_STATION) + return list(access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_mining, access_mining_station) /proc/get_region_accesses_name(var/code) switch(code) @@ -258,154 +335,154 @@ /proc/get_access_desc(A) switch(A) - if(ACCESS_CARGO) + if(access_cargo) return "Cargo Bay" - if(ACCESS_CARGO_BOT) + if(access_cargo_bot) return "Cargo Bot Delivery" - if(ACCESS_SECURITY) + if(access_security) return "Security" - if(ACCESS_BRIG) + if(access_brig) return "Brig Cells" - if(ACCESS_COURT) + if(access_court) return "Courtroom" - if(ACCESS_FORENSICS_LOCKERS) + if(access_forensics_lockers) return "Detective's Office" - if(ACCESS_MEDICAL) + if(access_medical) return "Medical" - if(ACCESS_GENETICS) + if(access_genetics) return "Genetics Lab" - if(ACCESS_MORGUE) + if(access_morgue) return "Morgue" - if(ACCESS_TOX) + if(access_tox) return "Research Lab" - if(ACCESS_TOX_STORAGE) + if(access_tox_storage) return "Toxins Storage" - if(ACCESS_CHEMISTRY) + if(access_chemistry) return "Chemistry Lab" - if(ACCESS_RD) + if(access_rd) return "RD Private" - if(ACCESS_BAR) + if(access_bar) return "Bar" - if(ACCESS_JANITOR) + if(access_janitor) return "Custodial Closet" - if(ACCESS_ENGINE) + if(access_engine) return "Engineering" - if(ACCESS_ENGINE_EQUIP) + if(access_engine_equip) return "APCs" - if(ACCESS_MAINT_TUNNELS) + if(access_maint_tunnels) return "Maintenance" - if(ACCESS_EXTERNAL_AIRLOCKS) + if(access_external_airlocks) return "External Airlocks" - if(ACCESS_EMERGENCY_STORAGE) + if(access_emergency_storage) return "Emergency Storage" - if(ACCESS_CHANGE_IDS) + if(access_change_ids) return "ID Computer" - if(ACCESS_AI_UPLOAD) + if(access_ai_upload) return "AI Upload" - if(ACCESS_TELEPORTER) + if(access_teleporter) return "Teleporter" - if(ACCESS_EVA) + if(access_eva) return "EVA" - if(ACCESS_HEADS) + if(access_heads) return "Bridge" - if(ACCESS_CAPTAIN) - return "Captain's Quarters" - if(ACCESS_ALL_PERSONAL_LOCKERS) + if(access_captain) + return "Captain Private" + if(access_all_personal_lockers) return "Personal Lockers" - if(ACCESS_CHAPEL_OFFICE) + if(access_chapel_office) return "Chapel Office" - if(ACCESS_TECH_STORAGE) + if(access_tech_storage) return "Technical Storage" - if(ACCESS_ATMOSPHERICS) + if(access_atmospherics) return "Atmospherics" - if(ACCESS_CREMATORIUM) + if(access_crematorium) return "Crematorium" - if(ACCESS_ARMORY) + if(access_armory) return "Armory" - if(ACCESS_CONSTRUCTION) + if(access_construction) return "Construction Areas" - if(ACCESS_KITCHEN) + if(access_kitchen) return "Kitchen" - if(ACCESS_HYDROPONICS) + if(access_hydroponics) return "Hydroponics" - if(ACCESS_LIBRARY) + if(access_library) return "Library" - if(ACCESS_LAWYER) + if(access_lawyer) return "Law Office" - if(ACCESS_ROBOTICS) + if(access_robotics) return "Robotics" - if(ACCESS_VIROLOGY) + if(access_virology) return "Virology" - if(ACCESS_CMO) + if(access_cmo) return "CMO Private" - if(ACCESS_QM) + if(access_qm) return "Quartermaster's Office" - if(ACCESS_CLOWN) + if(access_clown) return "HONK! Access" - if(ACCESS_MIME) + if(access_mime) return "Silent Access" - if(ACCESS_SURGERY) - return "Operating Room" - if(ACCESS_THEATRE) + if(access_surgery) + return "Surgery" + if(access_theatre) return "Theatre" - if(ACCESS_MANUFACTURING) + if(access_manufacturing) return "Manufacturing" - if(ACCESS_RESEARCH) - return "Research" - if(ACCESS_MINING) + if(access_research) + return "Science" + if(access_mining) return "Mining" - if(ACCESS_MINING_OFFICE) + if(access_mining_office) return "Mining Office" - if(ACCESS_MAILSORTING) + if(access_mailsorting) return "Delivery Office" - if(ACCESS_MINT) + if(access_mint) return "Mint" - if(ACCESS_MINT_VAULT) + if(access_mint_vault) return "Mint Vault" - if(ACCESS_HEADS_VAULT) + if(access_heads_vault) return "Main Vault" - if(ACCESS_MINING_STATION) + if(access_mining_station) return "Mining Station EVA" - if(ACCESS_XENOBIOLOGY) + if(access_xenobiology) return "Xenobiology Lab" - if(ACCESS_HOP) + if(access_hop) return "HoP Private" - if(ACCESS_HOS) + if(access_hos) return "HoS Private" - if(ACCESS_CE) + if(access_ce) return "CE Private" - if(ACCESS_RC_ANNOUNCE) + if(access_RC_announce) return "RC Announcements" - if(ACCESS_KEYCARD_AUTH) + if(access_keycard_auth) return "Keycode Auth. Device" - if(ACCESS_TCOMSAT) - return "Telecoms Satellite" + if(access_tcomsat) + return "Telecommunications" /proc/get_centcom_access_desc(A) switch(A) - if(ACCESS_CENT_GENERAL) + if(access_cent_general) return "Code Grey" - if(ACCESS_CENT_THUNDER) + if(access_cent_thunder) return "Code Yellow" - if(ACCESS_CENT_STORAGE) + if(access_cent_storage) return "Code Orange" - if(ACCESS_CENT_LIVING) + if(access_cent_living) return "Code Green" - if(ACCESS_CENT_MEDICAL) + if(access_cent_medical) return "Code White" - if(ACCESS_CENT_TELEPORTER) + if(access_cent_teleporter) return "Code Blue" - if(ACCESS_CENT_SPECOPS) + if(access_cent_specops) return "Code Black" - if(ACCESS_CENT_CREED) + if(access_cent_creed) return "Code Silver" - if(ACCESS_CENT_CAPTAIN) + if(access_cent_captain) return "Code Gold" /proc/get_all_jobs() return list("Assistant", "Captain", "Head of Personnel", "Bartender", "Chef", "Botanist", "Quartermaster", "Cargo Technician", - "Shaft Miner", "Janitor", "Librarian", "Lawyer", "Chaplain", "Chief Engineer", "Station Engineer", - "Atmospheric Technician", "Roboticist", "Chief Medical Officer", "Medical Doctor", "Chemist", "Geneticist", + "Shaft Miner", "Clown", "Mime", "Janitor", "Librarian", "Lawyer", "Chaplain", "Chief Engineer", "Station Engineer", + "Atmospheric Technician", "Roboticist", "Chief Medical Officer", "Medical Doctor", "Chemist", "Geneticist", "Virologist", "Research Director", "Scientist", "Head of Security", "Warden", "Detective", "Security Officer") /proc/get_all_centcom_jobs() @@ -416,31 +493,14 @@ return var/jobName - var/list/accesses = list() if(istype(src, /obj/item/device/pda)) if(src:id) jobName = src:id:assignment - accesses = src:id:access if(istype(src, /obj/item/weapon/card/id)) jobName = src:assignment - accesses = src:access if(jobName in get_all_jobs()) return jobName - - // hack for alt titles - if(istype(loc, /mob)) - var/mob/M = loc - if(M.mind.role_alt_title == jobName && M.mind.assigned_role in get_all_jobs()) - return M.mind.assigned_role - - var/centcom = 0 - for(var/i = 1, i <= accesses.len, i++) - if(accesses[i] > 100) - centcom = 1 - break - if(centcom) - return "centcom" else return "Unknown" diff --git a/code/game/jobs/job/assistant.dm b/code/game/jobs/job/assistant.dm index af9d8b193c..5a68cf9e18 100644 --- a/code/game/jobs/job/assistant.dm +++ b/code/game/jobs/job/assistant.dm @@ -10,6 +10,6 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/color/grey(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) return 1 diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index a18b0b2e65..62b08f2f63 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -5,27 +5,31 @@ faction = "Station" total_positions = 1 spawn_positions = 1 - supervisors = "NanoTrasen officials and Space Law" + supervisors = "Nanotrasen officials and Space law" selection_color = "#ccccff" idtype = /obj/item/weapon/card/id/gold equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/captain(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/captain(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/head/caphat(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(H), H.slot_glasses) - H.equip_if_possible(new /obj/item/clothing/gloves/captain(H), H.slot_gloves) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/captain(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_cap(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/captain(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/captain(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/captain(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/head/caphat(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack) + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 world << "[H.real_name] is the captain!" return 1 @@ -45,17 +49,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/hop(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/head_of_personnel(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/heads/hop(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/blue(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/weapon/clipboard(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_personnel(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hop(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack) return 1 diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 9c1ad56159..9ce9e5f9a6 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -12,27 +12,26 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/under/rank/bartender(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/bar(H), H.slot_belt) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/bartender(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/bar(H), slot_belt) if(H.backbag == 1) - var/obj/item/weapon/storage/box/Barpack = new /obj/item/weapon/storage/box(H) - H.equip_if_possible(Barpack, H.slot_r_hand) + var/obj/item/weapon/storage/box/survival/Barpack = new /obj/item/weapon/storage/box/survival(H) + H.equip_to_slot_or_del(Barpack, slot_r_hand) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) else - H.equip_if_possible(new /obj/item/weapon/storage/box(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) return 1 @@ -51,11 +50,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/rank/chef(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/chef(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/head/chefhat(H), H.slot_head) - H.equip_if_possible(new /obj/item/device/pda/chef(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/device/pda/chef(H), slot_belt) return 1 @@ -73,15 +72,12 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_hyd(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/hydroponics(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/gloves/botanic_leather(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/suit/storage/apron(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/device/analyzer/plant_analyzer(H), H.slot_s_store) - H.equip_if_possible(new /obj/item/device/pda/botanist(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/hydroponics(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/botanic_leather(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/analyzer/plant_analyzer(H), slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/pda/botanist(H), slot_belt) return 1 @@ -100,12 +96,13 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/qm(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/cargo(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/quartermaster(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(H), H.slot_glasses) - H.equip_if_possible(new /obj/item/weapon/clipboard(H), H.slot_r_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/qm(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargo(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/quartermaster(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses) + H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) return 1 @@ -123,11 +120,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_cargo(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/cargotech(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/cargo(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/fingerless/black(H), H.slot_gloves) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_cargo(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargotech(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/cargo(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) return 1 @@ -145,27 +142,25 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_mine (H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_eng(H), H.slot_back) - H.equip_if_possible(new /obj/item/device/pda/shaftminer(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/under/rank/miner(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/gloves/fingerless/black(H), H.slot_gloves) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_mine (H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/device/pda/shaftminer(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/miner(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/weapon/crowbar(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/weapon/satchel(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/satchel(H), slot_l_store) else - H.equip_if_possible(new /obj/item/weapon/storage/box(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/crowbar(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/satchel(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/satchel(H), slot_in_backpack) return 1 -/* //Griff /datum/job/clown title = "Clown" @@ -180,17 +175,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/weapon/storage/backpack/clown(H), H.slot_back) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/under/rank/clown(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/clown_shoes(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/clown(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/mask/gas/clown_hat(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/bikehorn(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/stamp/clown(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/toy/crayon/rainbow(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/storage/crayonbox(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/clown(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/clown(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/clown_shoes(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/clown(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/stamp/clown(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/toy/crayon/rainbow(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/crayonbox(H), slot_in_backpack) H.mutations.Add(CLUMSY) return 1 @@ -209,30 +204,29 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/mime(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/mime(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/white(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/mask/gas/mime(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/clothing/head/beret(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/suit/suspenders(H), H.slot_wear_suit) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/mime(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/mime(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/white(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/mime(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/head/beret(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/suspenders(H), slot_wear_suit) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/toy/crayon/mime(H), H.slot_l_store) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_l_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/toy/crayon/mime(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_in_backpack) H.verbs += /client/proc/mimespeak H.verbs += /client/proc/mimewall H.mind.special_verbs += /client/proc/mimespeak H.mind.special_verbs += /client/proc/mimewall H.miming = 1 return 1 -*/ @@ -249,10 +243,9 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/rank/janitor(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/janitor(H), H.slot_belt) - H.equip_if_possible(new /obj/item/device/portalathe(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/janitor(H), slot_belt) return 1 @@ -271,10 +264,10 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/suit_jacket/red(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/librarian(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/weapon/barcodescanner(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket/red(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/librarian(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/weapon/barcodescanner(H), slot_l_hand) return 1 @@ -293,16 +286,23 @@ var/global/lawyer = 0//Checks for another lawyer equip(var/mob/living/carbon/human/H) if(!H) return 0 + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) if(!lawyer) lawyer = 1 - H.equip_if_possible(new /obj/item/clothing/under/lawyer/bluesuit(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/lawyer/bluejacket(H), H.slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/under/lawyer/bluesuit(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/lawyer/bluejacket(H), slot_wear_suit) else - H.equip_if_possible(new /obj/item/clothing/under/lawyer/purpsuit(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/lawyer/purpjacket(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/lawyer(H), H.slot_belt) - H.equip_if_possible(new /obj/item/weapon/storage/briefcase(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/clothing/under/lawyer/purpsuit(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/lawyer/purpjacket(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/lawyer(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/briefcase(H), slot_l_hand) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + return 1 diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm index 0871a8977f..95d4f82b95 100644 --- a/code/game/jobs/job/civilian_chaplain.dm +++ b/code/game/jobs/job/civilian_chaplain.dm @@ -8,44 +8,50 @@ spawn_positions = 1 supervisors = "the head of personnel" selection_color = "#dddddd" - alt_titles = list("Counselor") equip(var/mob/living/carbon/human/H) if(!H) return 0 - var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible(H) - H.equip_if_possible(B, H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/pda/chaplain(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/under/rank/chaplain(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) + var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible/booze(H) + H.equip_to_slot_or_del(B, slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/pda/chaplain(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chaplain(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) spawn(0) var/religion_name = "Christianity" - var/new_religion = copytext(sanitize(input(H, "You are the Chaplain / Counselor. For game mechanics purposes, you need to choose a religion either way. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN) + var/new_religion = copytext(sanitize(input(H, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN) - if ((length(new_religion) == 0) || (new_religion == "Christianity")) + if (!new_religion) new_religion = religion_name - switch(lowertext(new_religion)) - if("christianity") - B.name = pick("The Holy Bible","The Dead Sea Scrolls") - if("satanism") - B.name = "The Unholy Bible" - if("cthulu") - B.name = "The Necronomicon" - if("islam") - B.name = "Quran" - if("scientology") - B.name = pick("The Biography of L. Ron Hubbard","Dianetics") - if("chaos") - B.name = "The Book of Lorgar" - if("imperium") - B.name = "Uplifting Primer" - if("science") - B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition") - else - B.name = "The Holy Book of [new_religion]" -// feedback_set_details("religion_name","[new_religion]") + switch(lowertext(new_religion)) + if("christianity") + B.name = pick("The Holy Bible","The Dead Sea Scrolls") + if("satanism") + B.name = "The Unholy Bible" + if("cthulu") + B.name = "The Necronomicon" + if("islam") + B.name = "Quran" + if("scientology") + B.name = pick("The Biography of L. Ron Hubbard","Dianetics") + if("chaos") + B.name = "The Book of Lorgar" + if("imperium") + B.name = "Uplifting Primer" + if("toolboxia") + B.name = "Toolbox Manifesto" + if("homosexuality") + B.name = "Guys Gone Wild" + if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks") + B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition") + H.setBrainLoss(100) // starts off retarded as fuck + if("science") + B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition") + else + B.name = "The Holy Book of [new_religion]" + feedback_set_details("religion_name","[new_religion]") spawn(1) var/deity_name = "Space Jesus" @@ -122,7 +128,7 @@ if(T.icon_state == "carpetsymbol") T.dir = 2 - H:update_clothing() // so that it updates the bible's item_state in his hand + H.update_inv_l_hand() // so that it updates the bible's item_state in his hand switch(input(H,"Look at your bible - is this what you want?") in list("Yes","No")) if("Yes") @@ -137,6 +143,6 @@ ticker.Bible_item_state = B.item_state ticker.Bible_name = B.name ticker.Bible_deity_name = B.deity_name -// feedback_set_details("religion_deity","[new_deity]") -// feedback_set_details("religion_book","[new_book_style]") + feedback_set_details("religion_deity","[new_deity]") + feedback_set_details("religion_book","[new_book_style]") return 1 \ No newline at end of file diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index 064ceb8cef..605033f780 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -12,34 +12,22 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/ce(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_eng(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/chief_engineer(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/heads/ce(H), H.slot_l_store) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat/white(H), H.slot_head) - H.equip_if_possible(new /obj/item/weapon/storage/belt/utility/full(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - var/list/wire_index = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Red" = 5, - "Blue" = 6, - "Green" = 7, - "Grey" = 8, - "Black" = 9, - "Pink" = 10, - "Brown" = 11, - "Maroon" = 12) - H.mind.store_memory("The door wires are as follows:") - H.mind.store_memory("Power: [wire_index[airlockIndexToWireColor[2]]] and [wire_index[airlockIndexToWireColor[3]]]") - H.mind.store_memory("Backup Power: [wire_index[airlockIndexToWireColor[5]]] and [wire_index[airlockIndexToWireColor[6]]]") - H.mind.store_memory("Door Bolts: [wire_index[airlockIndexToWireColor[4]]]") - H << "\blue You have memorised the important wires for the vessel. Use them wisely." + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/ce(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/ce(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/head/hardhat/white(H), slot_head) + var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H) + CIG.light("") + H.equip_to_slot_or_del(CIG, slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) return 1 @@ -57,16 +45,19 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_eng(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/engineer(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/orange(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/weapon/storage/belt/utility/full(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(H), H.slot_head) - H.equip_if_possible(new /obj/item/device/t_scanner(H), H.slot_r_store) - H.equip_if_possible(new /obj/item/device/pda/engineering(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/head/hardhat(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/device/t_scanner(H), slot_r_store) + H.equip_to_slot_or_del(new /obj/item/device/pda/engineering(H), slot_l_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) return 1 @@ -84,20 +75,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/atmospheric_technician(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/atmos(H), H.slot_l_store) - H.equip_if_possible(new /obj/item/weapon/storage/belt/utility/atmostech/(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat/red(H), H.slot_head) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/atmospheric_technician(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/atmos(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/atmostech/(H), slot_belt) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) return 1 @@ -108,20 +96,23 @@ department_flag = ENGSEC faction = "Station" total_positions = 2 - spawn_positions = 2 + spawn_positions = 1 supervisors = "the chief engineer and research director" selection_color = "#fff5cc" equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_rob(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/roboticist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/roboticist(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_rob(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/roboticist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/roboticist(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(H), slot_l_hand) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 \ No newline at end of file diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 07b1a4ee1a..907994efde 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -28,8 +28,5 @@ //the type of the ID the player will have var/idtype = /obj/item/weapon/card/id - //List of alternate titles, if any - var/list/alt_titles - /datum/job/proc/equip(var/mob/living/carbon/human/H) return 1 diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index b0d348f30e..d85527f7b9 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -12,17 +12,19 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/cmo(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_med(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/chief_medical_officer(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/heads/cmo(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/cmo(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/weapon/storage/firstaid/adv(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) - H.equip_if_possible(new /obj/item/device/healthanalyzer(H), H.slot_r_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/cmo(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_medical_officer(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/cmo(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/cmo(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 @@ -36,36 +38,23 @@ spawn_positions = 3 supervisors = "the chief medical officer" selection_color = "#ffeef0" - alt_titles = list("Virologist", "Surgeon", "Emergency Physician") equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_med(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) - if(H.mind.role_alt_title && H.mind.role_alt_title == "Virologist") - H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_vir(H), H.slot_back) - else - H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_med(H), H.slot_back) - if(H.mind.role_alt_title && H.mind.role_alt_title == "Virologist") - H.equip_if_possible(new /obj/item/clothing/under/rank/virologist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/virologist(H), H.slot_wear_suit) - else if(H.mind.role_alt_title && H.mind.role_alt_title == "Emergency Physician") - H.equip_if_possible(new /obj/item/clothing/under/rank/medical(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/fr_jacket(H), H.slot_wear_suit) - else if(H.mind.role_alt_title && H.mind.role_alt_title == "Surgeon") - H.equip_if_possible(new /obj/item/clothing/under/rank/medical/blue(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat(H), H.slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/clothing/under/rank/medical(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/medical(H), H.slot_belt) - H.equip_if_possible(new /obj/item/weapon/storage/firstaid/adv(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) - H.equip_if_possible(new /obj/item/device/healthanalyzer(H), H.slot_r_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 @@ -84,14 +73,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_chem(H), H.slot_back) - H.equip_if_possible(new /obj/item/device/radio/headset/headset_medsci(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/chemist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/chemist(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/chemist(H), H.slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chemist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/chemist(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/chemist(H), slot_wear_suit) return 1 @@ -109,19 +95,16 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_medsci(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_gen(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/geneticist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/geneticist(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/genetics(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_medsci(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/geneticist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/geneticist(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/genetics(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) return 1 -/* + /datum/job/virologist title = "Virologist" flag = VIROLOGIST @@ -129,21 +112,25 @@ faction = "Station" total_positions = 1 spawn_positions = 1 - supervisors = "the chief medical officer and research director" + supervisors = "the chief medical officer" selection_color = "#ffeef0" equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_medsci(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/virologist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/medical(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/mask/surgical(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat/virologist(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/virologist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/virologist(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 -*/ + diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index 3f4b64f623..83bf8f9025 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -12,12 +12,12 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/rd(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/under/rank/research_director(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/heads/rd(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/weapon/clipboard(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/rd(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/research_director(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/rd(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) return 1 @@ -31,19 +31,15 @@ spawn_positions = 3 supervisors = "the research director" selection_color = "#ffeeff" - alt_titles = list("Plasma Researcher", "Xenobiologist", "Xenoarchaeologist") equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_tox(H), H.slot_back) - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sci(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/scientist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/toxins(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/science(H), H.slot_wear_suit) -// H.equip_if_possible(new /obj/item/clothing/mask/gas(H), H.slot_wear_mask) -// H.equip_if_possible(new /obj/item/weapon/tank/oxygen(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sci(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/toxins(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/science(H), slot_wear_suit) +// H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(H), slot_wear_mask) +// H.equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(H), slot_l_hand) return 1 \ No newline at end of file diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index fdc5d1588a..e14f79ccbb 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -12,20 +12,27 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/security (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_sec(H), H.slot_back) - H.equip_if_possible(new /obj/item/device/radio/headset/heads/hos(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/head_of_security(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/armourrigvest(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/heads/hos(H), H.slot_belt) -// H.equip_if_possible(new /obj/item/clothing/suit/armor/hos(H), H.slot_wear_suit) //We're Bay12, not Goon. We don't need armor 24/7 - H.equip_if_possible(new /obj/item/clothing/gloves/hos(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/head/helmet/HoS(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses/sechud(H), H.slot_glasses) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/gun/energy/gun(H), H.slot_s_store) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_security(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hos(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/hos(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/HoS(H), slot_head) +// H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(H), slot_wear_mask) //Grab one from the armory you donk + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(H), slot_glasses) + H.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(H), slot_s_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_store) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 return 1 @@ -43,19 +50,27 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sec(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/security(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_sec(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/warden(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/security(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest/warden(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/head/helmet/warden(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/gloves/red(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses/sechud(H), H.slot_glasses) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/device/flash(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/warden(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/warden(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest/warden(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/warden(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(H), slot_glasses) +// H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(H), slot_wear_mask) //Grab one from the armory you donk + H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 return 1 @@ -69,29 +84,39 @@ spawn_positions = 1 supervisors = "the head of security" selection_color = "#ffeeee" - alt_titles = list("Forensic Technician") equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sec(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/det(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/det_suit(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/detective(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/head/det_hat(H), H.slot_head) -/* var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head) + var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H) CIG.light("") - H.equip_if_possible(CIG, H.slot_wear_mask) */ - H.equip_if_possible(new /obj/item/clothing/gloves/detective(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/weapon/storage/box/evidence(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/fcardholder(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/device/detective_scanner(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/drinks/dflask(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/lighter/zippo(H), H.slot_l_store) + H.equip_to_slot_or_del(CIG, slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(H), slot_l_store) + + if(H.backbag == 1)//Why cant some of these things spawn in his office? + var/obj/item/weapon/storage/box/survival/Evipack = new /obj/item/weapon/storage/box/survival(H) + H.equip_to_slot_or_del(Evipack, slot_r_hand) + new /obj/item/weapon/fcardholder(Evipack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_r_store) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/fcardholder(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_in_backpack) + + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 return 1 @@ -109,17 +134,23 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sec(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/security(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(H), H.slot_back) - if(H.backbag == 4) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_sec(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/security(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/security(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/storage/gearharness(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/head/secsoft(H), H.slot_head) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/gloves/red(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_s_store) - H.equip_if_possible(new /obj/item/device/flash(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store) + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 return 1 diff --git a/code/game/jobs/job/silicon.dm b/code/game/jobs/job/silicon.dm index 9cec53ba20..1b608e200d 100644 --- a/code/game/jobs/job/silicon.dm +++ b/code/game/jobs/job/silicon.dm @@ -21,7 +21,7 @@ department_flag = ENGSEC faction = "Station" total_positions = 0 - spawn_positions = 2 + spawn_positions = 1 supervisors = "your laws and the AI" //Nodrak selection_color = "#ddffdd" diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 1521165420..fdfb0468b1 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -1,11 +1,8 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 - var/global/datum/controller/occupations/job_master /datum/controller/occupations //List of all jobs var/list/occupations = list() - var/list/occupations2 = list() // Prevents problems with latejoiners. //Players who need jobs var/list/unassigned = list() //Debug info @@ -48,13 +45,9 @@ var/global/datum/controller/occupations/job_master return null - proc/GetAltTitle(mob/new_player/player, rank) - return player.preferences.GetAltTitle(GetJob(rank)) - - proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0) Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]") - if((player) && (player.mind) && (rank)) + if(player && player.mind && rank) var/datum/job/job = GetJob(rank) if(!job) return 0 if(jobban_isbanned(player, rank)) return 0 @@ -64,7 +57,6 @@ var/global/datum/controller/occupations/job_master if((job.current_positions < position_limit) || position_limit == -1) Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]") player.mind.assigned_role = rank - player.mind.role_alt_title = GetAltTitle(player, rank) unassigned -= player job.current_positions++ return 1 @@ -87,18 +79,39 @@ var/global/datum/controller/occupations/job_master candidates += player return candidates + proc/GiveRandomJob(var/mob/new_player/player) + Debug("FOC Giving random job, Player: [player]") + for(var/datum/job/job in shuffle(occupations)) + if(!job) + continue + + if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring! + continue + + if(job in command_positions) //If you want a command position, select it! + continue + + if(jobban_isbanned(player, job.title)) + Debug("FOC isbanned failed, Player: [player], Job: [job.title]") + continue + + if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) + Debug("FOC Random job given, Player: [player], Job: [job]") + AssignRole(player, job.title) + unassigned -= player + break proc/ResetOccupations() - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in player_list) if((player) && (player.mind)) player.mind.assigned_role = null - player.mind.role_alt_title = null player.mind.special_role = null SetupOccupations() unassigned = list() return + ///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check proc/FillHeadPosition() for(var/level = 1 to 3) for(var/command_position in command_positions) @@ -112,37 +125,46 @@ var/global/datum/controller/occupations/job_master return 0 - proc/FillAIPosition() - // this now only forces AI if malf mode - if(ticker.mode.name != "AI malfunction") - return + ///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level + proc/CheckHeadPositions(var/level) + for(var/command_position in command_positions) + var/datum/job/job = GetJob(command_position) + if(!job) continue + var/list/candidates = FindOccupationCandidates(job, level) + if(!candidates.len) continue + var/mob/new_player/candidate = pick(candidates) + AssignRole(candidate, command_position) + return + + proc/FillAIPosition() var/ai_selected = 0 var/datum/job/job = GetJob("AI") if(!job) return 0 if((job.title == "AI") && (config) && (!config.allow_ai)) return 0 - for(var/level = 1 to 3) - var/list/candidates = list() - if(ticker.mode.name == "AI malfunction")//Make sure they want to malf if its malf - candidates = FindOccupationCandidates(job, level, BE_MALF) - else - candidates = FindOccupationCandidates(job, level) - if(candidates.len) - var/mob/new_player/candidate = pick(candidates) - if(AssignRole(candidate, "AI")) - ai_selected++ - break - //Malf NEEDS an AI so force one if we didn't get a player who wanted it - if((ticker.mode.name == "AI malfunction")&&(!ai_selected)) - unassigned = shuffle(unassigned) - for(var/mob/new_player/player in unassigned) - if(jobban_isbanned(player, "AI")) continue - if(AssignRole(player, "AI")) - ai_selected++ - break - if(ai_selected) return 1 - return 0 + for(var/i = job.total_positions, i > 0, i--) + for(var/level = 1 to 3) + var/list/candidates = list() + if(ticker.mode.name == "AI malfunction")//Make sure they want to malf if its malf + candidates = FindOccupationCandidates(job, level, BE_MALF) + else + candidates = FindOccupationCandidates(job, level) + if(candidates.len) + var/mob/new_player/candidate = pick(candidates) + if(AssignRole(candidate, "AI")) + ai_selected++ + break + //Malf NEEDS an AI so force one if we didn't get a player who wanted it + if((ticker.mode.name == "AI malfunction")&&(!ai_selected)) + unassigned = shuffle(unassigned) + for(var/mob/new_player/player in unassigned) + if(jobban_isbanned(player, "AI")) continue + if(AssignRole(player, "AI")) + ai_selected++ + break + if(ai_selected) return 1 + return 0 /** Proc DivideOccupations @@ -154,20 +176,26 @@ var/global/datum/controller/occupations/job_master Debug("Running DO") SetupOccupations() + //Holder for Triumvirate is stored in the ticker, this just processes it + if(ticker) + for(var/datum/job/ai/A in occupations) + if(ticker.triai) + A.spawn_positions = 3 + //Get the players who are ready - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in player_list) if((player) && (player.client) && (player.ready) && (player.mind) && (!player.mind.assigned_role)) unassigned += player Debug("DO, Len: [unassigned.len]") if(unassigned.len == 0) return 0 + //Shuffle players and jobs unassigned = shuffle(unassigned) - occupations2 = shuffle(occupations) - //HandleFeedbackGathering() + HandleFeedbackGathering() - //Assistants are checked first + //People who wants to be assistants, sure, go on. Debug("DO, Running Assistant Check 1") var/datum/job/assist = new /datum/job/assistant() var/list/assistant_candidates = FindOccupationCandidates(assist, 3) @@ -183,15 +211,57 @@ var/global/datum/controller/occupations/job_master FillHeadPosition() Debug("DO, Head Check end") - //Check for an AI, now purely just for malf mode + //Check for an AI Debug("DO, Running AI Check") FillAIPosition() Debug("DO, AI Check end") //Other jobs are now checked Debug("DO, Running Standard Check") + + + // New job giving system by Donkie + // This will cause lots of more loops, but since it's only done once it shouldn't really matter much at all. + // Hopefully this will add more randomness and fairness to job giving. + + // Loop through all levels from high to low + var/list/shuffledoccupations = shuffle(occupations) for(var/level = 1 to 3) - for(var/datum/job/job in occupations2) + //Check the head jobs first each level + CheckHeadPositions(level) + + // Loop through all unassigned players + for(var/mob/new_player/player in unassigned) + + // Loop through all jobs + for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY + if(!job) + continue + + if(jobban_isbanned(player, job.title)) + Debug("FOC isbanned failed, Player: [player], Job:[job.title]") + continue + + // If the player wants that job on this level, then try give it to him. + if(player.preferences.GetJobDepartment(job, level) & job.flag) + + // If the job isn't filled + if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) + Debug("FOC pass, Player: [player], Level:[level], Job:[job.title]") + AssignRole(player, job.title) + unassigned -= player + break + + // Hand out random jobs to the people who didn't get any in the last check + // Also makes sure that they got their preference correct + for(var/mob/new_player/player in unassigned) + if(player.preferences.userandomjob) + GiveRandomJob(player) + + /* + Old job system + for(var/level = 1 to 3) + for(var/datum/job/job in occupations) Debug("Checking job: [job]") if(!job) continue @@ -204,10 +274,13 @@ var/global/datum/controller/occupations/job_master var/mob/new_player/candidate = pick(candidates) Debug("Selcted: [candidate], for: [job.title]") AssignRole(candidate, job.title) - candidates -= candidate + candidates -= candidate*/ + Debug("DO, Standard Check end") Debug("DO, Running AC2") + + // For those who wanted to be assistant if their preferences were filled, here you go. for(var/mob/new_player/player in unassigned) Debug("AC2 Assistant located, Player: [player]") AssignRole(player, "Assistant") @@ -222,16 +295,7 @@ var/global/datum/controller/occupations/job_master else H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator." - if(H.mind.assigned_role == rank && H.mind.role_alt_title) - spawnId(H, rank, H.mind.role_alt_title) - else - spawnId(H, rank) - H << "You are the [rank]." - H << "As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this." H.job = rank - if(H.mind && H.mind.assigned_role != rank) - H.mind.assigned_role = rank - H.mind.role_alt_title = null if(!joined_late) var/obj/S = null @@ -245,47 +309,40 @@ var/global/datum/controller/occupations/job_master if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf)) H.loc = S.loc - if(H.mind && H.mind.assigned_role == "Cyborg")//This could likely be done somewhere else - H.Robotize() - return 1 - // make sure we don't already have one on 1 ear :p - if(!istype(H.r_ear,/obj/item/device/radio/headset) && !istype(H.l_ear,/obj/item/device/radio/headset)) - H.equip_if_possible(new /obj/item/device/radio/headset(H), H.slot_ears) - if(H.mind && H.mind.assigned_role != "Cyborg" && H.mind.assigned_role != "AI" && H.mind.assigned_role != "Clown") - if(H.backbag == 1) //Clown always gets his backbuddy. - H.equip_if_possible(new /obj/item/weapon/storage/box(H), H.slot_r_hand) + if(H.mind) + H.mind.assigned_role = rank - if(H.backbag == 2) - var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack(H) - H.equip_if_possible(BPK, H.slot_back,1) - H.equip_if_possible(new /obj/item/weapon/storage/box(H.back), H.slot_in_backpack) + switch(rank) + if("Cyborg") + H.Robotize() + return 1 + if("AI","Clown") //don't need bag preference stuff! + else + switch(H.backbag) + if(1) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + if(2) + var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack(H) + new /obj/item/weapon/storage/box/survival(BPK) + H.equip_to_slot_or_del(BPK, slot_back,1) + if(3) + var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack/satchel_norm(H) + new /obj/item/weapon/storage/box/survival(BPK) + H.equip_to_slot_or_del(BPK, slot_back,1) - if(H.backbag == 3) - var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack/satchel(H) - H.equip_if_possible(BPK, H.slot_back,1) - H.equip_if_possible(new /obj/item/weapon/storage/box(H.back), H.slot_in_backpack) + H << "You are the [rank]." + H << "As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this." + spawnId(H,rank) - if(H.backbag == 4) - var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack/satchel_norm(H) - H.equip_if_possible(BPK, H.slot_back,1) - H.equip_if_possible(new /obj/item/weapon/storage/box(H.back), H.slot_in_backpack) - - //Give'em glasses if they are nearsighted - if(H.disabilities & 1) - var/equipped = H.equip_if_possible(new /obj/item/clothing/glasses/regular(H), H.slot_glasses) - if(!equipped) - var/obj/item/clothing/glasses/G = H.glasses - G.prescription = 1 - H.client.add_roundsjoined() - H.update_clothing() + H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears) +// H.update_icons() return 1 - proc/spawnId(var/mob/living/carbon/human/H, rank, title) + proc/spawnId(var/mob/living/carbon/human/H, rank) if(!H) return 0 - if(!title) title = rank var/obj/item/weapon/card/id/C = null var/datum/job/job = null @@ -303,27 +360,20 @@ var/global/datum/controller/occupations/job_master C = new /obj/item/weapon/card/id(H) if(C) C.registered_name = H.real_name - C.assignment = title + C.assignment = rank C.name = "[C.registered_name]'s ID Card ([C.assignment])" - C.access = get_access(rank) - C.pin = rand(1000,9999) - C.money = 10 * rand(50,200) - H << "\blue Your station account has [C.money] credits. The pin-code is [C.pin]." - if(H.mind) - H.mind.memory += "Your pin-code is - [C.pin]
      " - H.equip_if_possible(C, H.slot_wear_id) - if(!H.equip_if_possible(new /obj/item/weapon/pen(H), H.slot_r_store)) - H.equip_if_possible(new /obj/item/weapon/pen(H), H.slot_ears) - H.equip_if_possible(new /obj/item/device/pda(H), H.slot_belt) + C.access = get_access(C.assignment) + H.equip_to_slot_or_del(C, slot_wear_id) + if(prob(50)) + H.equip_to_slot_or_del(new /obj/item/weapon/pen(H), slot_r_store) + else + H.equip_to_slot_or_del(new /obj/item/weapon/pen/blue(H), slot_r_store) + H.equip_to_slot_or_del(new /obj/item/device/pda(H), slot_belt) if(locate(/obj/item/device/pda,H))//I bet this could just use locate. It can --SkyMarshal var/obj/item/device/pda/pda = locate(/obj/item/device/pda,H) pda.owner = H.real_name pda.ownjob = H.wear_id.assignment pda.name = "PDA-[H.real_name] ([pda.ownjob])" - - /*if(rank == "Clown") - spawn(1) - clname(H)*/ return 1 @@ -367,7 +417,7 @@ var/global/datum/controller/occupations/job_master return 1 -/* + proc/HandleFeedbackGathering() for(var/datum/job/job in occupations) var/tmp_str = "|[job.title]|" @@ -377,7 +427,7 @@ var/global/datum/controller/occupations/job_master var/level3 = 0 //low var/level4 = 0 //never var/level5 = 0 //banned - for(var/mob/new_player/player in world) + for(var/mob/new_player/player in player_list) if(!((player) && (player.client) && (player.ready) && (player.mind) && (!player.mind.assigned_role))) continue //This player is not ready if(jobban_isbanned(player, job.title)) @@ -393,4 +443,3 @@ var/global/datum/controller/occupations/job_master tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|-" feedback_add_details("job_preferences",tmp_str) -*/ diff --git a/code/game/jobs/jobprocs.dm b/code/game/jobs/jobprocs.dm index 813d3353d9..62b2b7c4ae 100644 --- a/code/game/jobs/jobprocs.dm +++ b/code/game/jobs/jobprocs.dm @@ -8,15 +8,20 @@ if(usr.stat) usr << "Not when you're incapicated." return - if(!usr.miming) + if(!ishuman(usr)) + return + + var/mob/living/carbon/human/H = usr + + if(!H.miming) usr << "You still haven't atoned for your speaking transgression. Wait." return - usr.verbs -= /client/proc/mimewall + H.verbs -= /client/proc/mimewall spawn(300) - usr.verbs += /client/proc/mimewall - for (var/mob/V in viewers(usr)) + H.verbs += /client/proc/mimewall + for (var/mob/V in viewers(H)) if(V!=usr) - V.show_message("[usr] looks as if a wall is in front of them.", 3, "", 2) + V.show_message("[H] looks as if a wall is in front of them.", 3, "", 2) usr << "You form a wall in front of yourself." var/obj/effect/forcefield/F = new /obj/effect/forcefield(locate(usr.x,usr.y,usr.z)) F.icon_state = "empty" @@ -30,10 +35,15 @@ set category = "Mime" set name = "Speech" set desc = "Toggle your speech." - if(usr.miming) - usr.miming = 0 + if(!ishuman(usr)) + return + + var/mob/living/carbon/human/H = usr + + if(H.miming) + H.miming = 0 else - usr << "You'll have to wait if you want to atone for your sins." + H << "You'll have to wait if you want to atone for your sins." spawn(3000) - usr.miming = 1 + H.miming = 1 return diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index 79b12fc3ae..a587472d74 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -1,45 +1,46 @@ -var/const - ENGSEC =(1<<0) - CAPTAIN =(1<<0) - HOS =(1<<1) - WARDEN =(1<<2) - DETECTIVE =(1<<3) - OFFICER =(1<<4) - CHIEF =(1<<5) - ENGINEER =(1<<6) - ATMOSTECH =(1<<7) - ROBOTICIST =(1<<8) - AI =(1<<9) - CYBORG =(1<<10) +var/const/ENGSEC =(1<<0) + +var/const/CAPTAIN =(1<<0) +var/const/HOS =(1<<1) +var/const/WARDEN =(1<<2) +var/const/DETECTIVE =(1<<3) +var/const/OFFICER =(1<<4) +var/const/CHIEF =(1<<5) +var/const/ENGINEER =(1<<6) +var/const/ATMOSTECH =(1<<7) +var/const/ROBOTICIST =(1<<8) +var/const/AI =(1<<9) +var/const/CYBORG =(1<<10) - MEDSCI =(1<<1) +var/const/MEDSCI =(1<<1) - RD =(1<<0) - SCIENTIST =(1<<1) - CHEMIST =(1<<2) - CMO =(1<<3) - DOCTOR =(1<<4) - GENETICIST =(1<<5) +var/const/RD =(1<<0) +var/const/SCIENTIST =(1<<1) +var/const/CHEMIST =(1<<2) +var/const/CMO =(1<<3) +var/const/DOCTOR =(1<<4) +var/const/GENETICIST =(1<<5) +var/const/VIROLOGIST =(1<<6) - CIVILIAN =(1<<2) +var/const/CIVILIAN =(1<<2) - HOP =(1<<0) - BARTENDER =(1<<1) - BOTANIST =(1<<2) - CHEF =(1<<3) - JANITOR =(1<<4) - LIBRARIAN =(1<<5) - QUARTERMASTER =(1<<6) - CARGOTECH =(1<<7) - MINER =(1<<8) - LAWYER =(1<<9) - CHAPLAIN =(1<<10) - CLOWN =(1<<11) - MIME =(1<<12) - ASSISTANT =(1<<13) +var/const/HOP =(1<<0) +var/const/BARTENDER =(1<<1) +var/const/BOTANIST =(1<<2) +var/const/CHEF =(1<<3) +var/const/JANITOR =(1<<4) +var/const/LIBRARIAN =(1<<5) +var/const/QUARTERMASTER =(1<<6) +var/const/CARGOTECH =(1<<7) +var/const/MINER =(1<<8) +var/const/LAWYER =(1<<9) +var/const/CHAPLAIN =(1<<10) +var/const/CLOWN =(1<<11) +var/const/MIME =(1<<12) +var/const/ASSISTANT =(1<<13) var/list/assistant_occupations = list( @@ -74,6 +75,7 @@ var/list/medical_positions = list( "Chief Medical Officer", "Medical Doctor", "Geneticist", + "Virologist", "Chemist" ) @@ -81,6 +83,8 @@ var/list/medical_positions = list( var/list/science_positions = list( "Research Director", "Scientist", + "Geneticist", //Part of both medical and science + "Roboticist" //Part of both engineering and science ) @@ -96,6 +100,8 @@ var/list/civilian_positions = list( "Shaft Miner", "Lawyer", "Chaplain", + "Clown", + "Mime", "Assistant" ) @@ -117,19 +123,3 @@ var/list/nonhuman_positions = list( /proc/guest_jobbans(var/job) return ((job in command_positions) || (job in nonhuman_positions) || (job in security_positions)) - -/proc/GetRank(var/job) - switch(job) - if("Bartender","Chef","Lawyer","Librarian","Janitor","Assistant","Unassigned") - return 0 - if("Chaplain","Botanist","Hydroponicist","Medical Doctor","Atmospheric Technician","Geneticist", "Virologist", "Surgeon", "Emergency Physician", "Counselor") - return 1 - if("Quartermaster","Cargo Technician","Chemist", "Station Engineer","Roboticist", "Security Officer", "Forensic Technician","Detective", "Scientist", "Shaft Miner", "Xenobiologist", "Plasma Researcher", "Anomalist", "Chief Medical Officer") - return 2 - if("Research Director","Head of Security","Chief Engineer","Warden") - return 3 - if("Captain","Head of Personnel","Wizard","MODE") - return 4 - else - message_admins("\"[job]\" NOT GIVEN RANK, REPORT JOBS.DM ERROR TO A CODER") - return 2 \ No newline at end of file diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 60b0dc1a39..009a184c78 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -1,6 +1,7 @@ +#define WHITELISTFILE "data/whitelist.txt" + var/list/whitelist -#define WHITELISTFILE "data/whitelist.txt" /proc/load_whitelist() var/text = file2text(WHITELISTFILE) if (!text) @@ -13,8 +14,6 @@ var/list/whitelist return 0 return ("[M.ckey]" in whitelist) -#undef WHITELISTFILE - proc/load_alienwhitelist() var/text = file2text("config/alienwhitelist.txt") if (!text) @@ -32,3 +31,5 @@ proc/load_alienwhitelist() if(findtext(s,"[M.ckey] - [species]")) return 1 return 0 + +#undef WHITELISTFILE \ No newline at end of file diff --git a/code/game/landmarks.dm b/code/game/landmarks.dm index 31cd58b45c..de376a8215 100644 --- a/code/game/landmarks.dm +++ b/code/game/landmarks.dm @@ -61,10 +61,6 @@ xeno_spawn += loc del(src) - if(name == "emcloset") - emclosets += loc - del(src) - return 1 /obj/effect/landmark/start/New() diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index 73adecbabd..37cc168d57 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -1,6 +1,6 @@ /obj/machinery/bluespace_beacon - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "floor_beaconf" name = "Bluespace Gigabeacon" desc = "A device that draws power from bluespace and creates a permanent tracking beacon." @@ -15,7 +15,7 @@ ..() var/turf/T = loc Beacon = new /obj/item/device/radio/beacon - Beacon.invisibility = 100 + Beacon.invisibility = INVISIBILITY_MAXIMUM Beacon.loc = T hide(T.intact) @@ -44,7 +44,7 @@ if(!Beacon) var/turf/T = loc Beacon = new /obj/item/device/radio/beacon - Beacon.invisibility = 100 + Beacon.invisibility = INVISIBILITY_MAXIMUM Beacon.loc = T if(Beacon) if(Beacon.loc != loc) diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 6e0f0bd744..bb98dc9de8 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -1,6 +1,6 @@ /obj/machinery/atmospherics/unary/cold_sink/freezer name = "Freezer" - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "freezer_0" density = 1 diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 5693b8fea7..7e89ea5e08 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -1,16 +1,15 @@ /obj/machinery/optable name = "Operating Table" desc = "Used for advanced medical procedures. Apparently this includes the clown." - icon = 'surgery.dmi' + icon = 'icons/obj/surgery.dmi' icon_state = "table2-idle" density = 1 anchored = 1.0 use_power = 1 idle_power_usage = 1 active_power_usage = 5 - var/mob/living/carbon/victim = null + var/mob/living/carbon/human/victim = null var/strapped = 0.0 - var/updatesicon = 1 var/obj/machinery/computer/operating/computer = null @@ -18,10 +17,10 @@ ..() for(dir in list(NORTH,EAST,SOUTH,WEST)) computer = locate(/obj/machinery/computer/operating, get_step(src, dir)) - if (!isnull(computer)) + if (computer) break - spawn(100) - process() +// spawn(100) //Wont the MC just call this process() before and at the 10 second mark anyway? +// process() /obj/machinery/optable/ex_act(severity) @@ -80,16 +79,15 @@ /obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && mover.pass_flags&PASSTABLE) + if(istype(mover) && mover.checkpass(PASSTABLE)) return 1 else return 0 /obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob) - if(isrobot(user)) - return - if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O)) + + if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) return user.drop_item() if (O.loc != src.loc) @@ -97,27 +95,21 @@ return /obj/machinery/optable/proc/check_victim() - if(locate(/mob/living/carbon, src.loc)) - var/mob/M = locate(/mob/living/carbon, src.loc) + if(locate(/mob/living/carbon/human, src.loc)) + var/mob/M = locate(/mob/living/carbon/human, src.loc) if(M.resting) - victim = M - if(updatesicon) - icon_state = "table2-active" + src.victim = M + icon_state = "table2-active" return 1 - if(victim) - victim.update_clothing() - victim = null - if(updatesicon) - icon_state = "table2-idle" - processing_objects.Remove(src) + src.victim = null + icon_state = "table2-idle" return 0 /obj/machinery/optable/process() check_victim() /obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(isrobot(user)) - return + if (istype(W, /obj/item/weapon/grab)) if(ismob(W:affecting)) var/mob/M = W:affecting @@ -131,50 +123,11 @@ for(var/obj/O in src) O.loc = src.loc src.add_fingerprint(user) - if(updatesicon) - icon_state = "table2-active" + icon_state = "table2-active" src.victim = M - M.update_clothing() - processing_objects.Add(src) del(W) return user.drop_item() if(W && W.loc) W.loc = src.loc - return - -/obj/machinery/optable/portable - name = "mobile operating table" - desc = "Used for advanced medical procedures. Seems to be movable, neat." - icon = 'rollerbed.dmi' - icon_state = "up" - density = 1 - anchored = 0 - updatesicon = 0 - - New() - ..() - - attackby(obj/item/weapon/W as obj, mob/user as mob) - if(!anchored) - return - return ..() - - verb/make_deployable() - set category = "Object" - set name = "Deploy Table" - set src in oview(1) - - if(anchored) - if(victim) - usr << "You can't do that with someone on the table!" - else - anchored = 0 - for(var/mob/M in orange(5,src)) - M.show_message("\blue [usr] releases the locks on the table's casters!") - icon_state = "up" - else - anchored = 1 - for(var/mob/M in orange(5,src)) - M.show_message("\blue [usr] locks the table's casters in place!") - icon_state = "down" \ No newline at end of file + return \ No newline at end of file diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index bb0aa82c65..60b7c7fa13 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -4,7 +4,7 @@ /obj/machinery/sleep_console name = "Sleeper Console" - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "sleeperconsole" var/obj/machinery/sleeper/connected = null anchored = 1 //About time someone fixed this. @@ -48,7 +48,7 @@ if(..()) return if (src.connected) - var/mob/occupant = src.connected.occupant + var/mob/living/occupant = src.connected.occupant var/dat = "Occupant Statistics:
      " if (occupant) var/t1 @@ -68,10 +68,10 @@ dat += text("
      Paralysis Summary %: [] ([] seconds left!)
      ", occupant.paralysis, round(occupant.paralysis / 4)) if(occupant.reagents) dat += text("Inaprovaline units: [] units
      ", occupant.reagents.get_reagent_amount("inaprovaline")) - dat += text("Soporific (Sleep Toxin): [] units
      ", occupant.reagents.get_reagent_amount("stoxin")) - dat += text("[]\tDermaline: [] units
      ", (occupant.reagents.get_reagent_amount("dermaline") < 30 ? "" : ""), occupant.reagents.get_reagent_amount("dermaline")) - dat += text("[]\tBicaridine: [] units
      ", (occupant.reagents.get_reagent_amount("bicaridine") < 30 ? "" : ""), occupant.reagents.get_reagent_amount("bicaridine")) - dat += text("[]\tDexalin: [] units
      ", (occupant.reagents.get_reagent_amount("dexalin") < 30 ? "" : ""), occupant.reagents.get_reagent_amount("dexalin")) + dat += text("Soporific: [] units
      ", occupant.reagents.get_reagent_amount("stoxin")) + dat += text("Dermaline: [] units
      ", occupant.reagents.get_reagent_amount("dermaline")) + dat += text("Bicaridine: [] units
      ", occupant.reagents.get_reagent_amount("bicaridine")) + dat += text("Dexalin: [] units
      ", occupant.reagents.get_reagent_amount("dexalin")) dat += text("
      Refresh meter readings each second
      Inject Inaprovaline
      Inject Soporific
      Inject Dermaline
      Inject Bicaridine
      Inject Dexalin", src, src, src, src, src, src) else dat += "The sleeper is empty." @@ -133,22 +133,19 @@ /obj/machinery/sleeper name = "Sleeper" - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "sleeper_0" density = 1 anchored = 1 var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r" - var/mob/occupant = null + var/mob/living/occupant = null New() ..() spawn( 5 ) if(orient == "RIGHT") - if(!istype(src,/obj/machinery/sleeper/syndicate)) - icon_state = "sleeper_0-r" - else - icon_state = "syndipod_0-r" + icon_state = "sleeper_0-r" return return @@ -175,20 +172,20 @@ if((!( istype(G, /obj/item/weapon/grab)) || !( ismob(G.affecting)))) return if(src.occupant) - user << "\blue The [src.name] is already occupied!" + user << "\blue The sleeper is already occupied!" return for(var/mob/living/carbon/metroid/M in range(1,G.affecting)) if(M.Victim == G.affecting) - usr << "[G.affecting.name] will not fit into the [src.name] because they have a Metroid latched onto their head." + usr << "[G.affecting.name] will not fit into the sleeper because they have a Metroid latched onto their head." return for (var/mob/V in viewers(user)) - V.show_message("[user] starts putting [G.affecting.name] into the [src.name].", 3) + V.show_message("[user] starts putting [G.affecting.name] into the sleeper.", 3) if(do_after(user, 20)) if(src.occupant) - user << "\blue The [src.name] is already occupied!" + user << "\blue The sleeper is already occupied!" return if(!G || !G.affecting) return var/mob/M = G.affecting @@ -197,14 +194,9 @@ M.client.eye = src M.loc = src src.occupant = M - if(!istype(src,/obj/machinery/sleeper/syndicate)) - src.icon_state = "sleeper_1" - if(orient == "RIGHT") - icon_state = "sleeper_1-r" - else - src.icon_state = "syndipod_1" - if(orient == "RIGHT") - icon_state = "syndipod_1-r" + src.icon_state = "sleeper_1" + if(orient == "RIGHT") + icon_state = "sleeper_1-r" M << "\blue You feel cool air surround you. You go numb as your senses turn inward." @@ -271,14 +263,11 @@ src.occupant.loc = src.loc src.occupant = null if(orient == "RIGHT") - if(!istype(src,/obj/machinery/sleeper/syndicate)) - icon_state = "sleeper_0-r" - else - icon_state = "syndipod_0-r" + icon_state = "sleeper_0-r" return - proc/inject_inap(mob/user as mob) + proc/inject_inap(mob/living/user as mob) if(src.occupant) if(src.occupant.reagents.get_reagent_amount("inaprovaline") + 30 <= 60) src.occupant.reagents.add_reagent("inaprovaline", 30) @@ -288,29 +277,29 @@ return - proc/inject_stox(mob/user as mob) + proc/inject_stox(mob/living/user as mob) if(src.occupant) - if(src.occupant.reagents.get_reagent_amount("stoxin") + 10 <= 40) - src.occupant.reagents.add_reagent("stoxin", 10) + if(src.occupant.reagents.get_reagent_amount("stoxin") + 20 <= 40) + src.occupant.reagents.add_reagent("stoxin", 20) user << text("Occupant now has [] units of soporifics in his/her bloodstream.", src.occupant.reagents.get_reagent_amount("stoxin")) else user << "No occupant!" return - proc/inject_dermaline(mob/user as mob) + proc/inject_dermaline(mob/living/user as mob) if (src.occupant) - if(src.occupant.reagents.get_reagent_amount("dermaline") + 10 <= 40) - src.occupant.reagents.add_reagent("dermaline", 10) + if(src.occupant.reagents.get_reagent_amount("dermaline") + 20 <= 40) + src.occupant.reagents.add_reagent("dermaline", 20) user << text("Occupant now has [] units of Dermaline in his/her bloodstream.", src.occupant.reagents.get_reagent_amount("dermaline")) else user << "No occupant!" return - proc/inject_bicaridine(mob/user as mob) + proc/inject_bicaridine(mob/living/user as mob) if(src.occupant) - if(src.occupant.reagents.get_reagent_amount("bicaridine") + 10 <= 40) + if(src.occupant.reagents.get_reagent_amount("bicaridine") + 10 <= 20) src.occupant.reagents.add_reagent("bicaridine", 10) user << text("Occupant now has [] units of Bicaridine in his/her bloodstream.", src.occupant.reagents.get_reagent_amount("bicaridine")) else @@ -318,17 +307,17 @@ return - proc/inject_dexalin(mob/user as mob) + proc/inject_dexalin(mob/living/user as mob) if(src.occupant) - if(src.occupant.reagents.get_reagent_amount("dexalin") + 10 <= 40) - src.occupant.reagents.add_reagent("dexalin", 10) + if(src.occupant.reagents.get_reagent_amount("dexalin") + 20 <= 40) + src.occupant.reagents.add_reagent("dexalin", 20) user << text("Occupant now has [] units of Dexalin in his/her bloodstream.", src.occupant.reagents.get_reagent_amount("dexalin")) else user << "No occupant!" return - proc/check(mob/user as mob) + proc/check(mob/living/user as mob) if(src.occupant) user << text("\blue Occupant ([]) Statistics:", src.occupant) var/t1 @@ -359,14 +348,9 @@ set src in oview(1) if(usr.stat != 0) return - if(!istype(src,/obj/machinery/sleeper/syndicate)) - if(orient == "RIGHT") - icon_state = "sleeper_0-r" - src.icon_state = "sleeper_0" - else - if(orient == "RIGHT") - icon_state = "syndipod_0-r" - src.icon_state = "syndipod_0" + if(orient == "RIGHT") + icon_state = "sleeper_0-r" + src.icon_state = "sleeper_0" src.go_out() add_fingerprint(usr) return @@ -377,13 +361,11 @@ set category = "Object" set src in oview(1) - if(usr.stat != 0) - return - if(istype(src,/obj/machinery/sleeper/syndicate)) - usr << "\red You really want to get into an illegal stasis pod? Are you dumb?" + if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr))) return + if(src.occupant) - usr << "\blue The [src.name] is already occupied!" + usr << "\blue The sleeper is already occupied!" return for(var/mob/living/carbon/metroid/M in range(1,usr)) @@ -391,42 +373,22 @@ usr << "You're too busy getting your life sucked out of you." return for(var/mob/V in viewers(usr)) - V.show_message("[usr] starts climbing into the [src.name].", 3) + V.show_message("[usr] starts climbing into the sleeper.", 3) if(do_after(usr, 20)) if(src.occupant) - usr << "\blue The [src.name] is already occupied!" + usr << "\blue The sleeper is already occupied!" return - usr.pulling = null + usr.stop_pulling() usr.client.perspective = EYE_PERSPECTIVE usr.client.eye = src usr.loc = src src.occupant = usr - if(!istype(src,/obj/machinery/sleeper/syndicate)) - src.icon_state = "sleeper_1" - if(orient == "RIGHT") - icon_state = "sleeper_1-r" - else - src.icon_state = "syndipod_1" - if(orient == "RIGHT") - icon_state = "syndipod_1-r" + src.icon_state = "sleeper_1" + if(orient == "RIGHT") + icon_state = "sleeper_1-r" for(var/obj/O in src) del(O) src.add_fingerprint(usr) return return - - - -/obj/machinery/sleeper/syndicate - name = "Illegal Stasis Pod" - icon = 'Cryogenic2.dmi' - icon_state = "syndi_0" - density = 1 - anchored = 1 - - process() - if(src.occupant) - src.occupant.sleeping = 5 - return - diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index 48532aba22..2b5d3d0bd3 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -1,6 +1,6 @@ /obj/machinery/ai_slipper name = "AI Liquid Dispenser" - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "motion3" layer = 3 anchored = 1.0 @@ -11,7 +11,7 @@ var/cooldown_time = 0 var/cooldown_timeleft = 0 var/cooldown_on = 0 - req_access = list(ACCESS_AI_UPLOAD) + req_access = list(access_ai_upload) /obj/machinery/ai_slipper/power_change() if(stat & BROKEN) diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index 2d71e96176..4d302c6749 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -4,7 +4,7 @@ obj/machinery/door/airlock var/id_tag var/frequency - + var/shockedby = list() var/datum/radio_frequency/radio_connection receive_signal(datum/signal/signal) @@ -88,7 +88,7 @@ obj/machinery/door/airlock set_frequency(frequency) obj/machinery/airlock_sensor - icon = 'airlock_machines.dmi' + icon = 'icons/obj/airlock_machines.dmi' icon_state = "airlock_sensor_off" name = "Airlock Sensor" @@ -154,7 +154,7 @@ obj/machinery/airlock_sensor set_frequency(frequency) obj/machinery/access_button - icon = 'airlock_machines.dmi' + icon = 'icons/obj/airlock_machines.dmi' icon_state = "access_button_standby" name = "Access Button" diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 9db6a51a6d..79932a77dd 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -1,6 +1,5 @@ -//////////////////////////////////////// -//CONTAINS: Air Alarms and Fire Alarms// -//////////////////////////////////////// +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 + /proc/RandomAAlarmWires() //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). @@ -22,31 +21,120 @@ flagIndex+=1 return AAlarmwires -#define AALARM_WIRE_IDSCAN 1 //Added wires -#define AALARM_WIRE_POWER 2 -#define AALARM_WIRE_SYPHON 3 -#define AALARM_WIRE_AI_CONTROL 4 -#define AALARM_WIRE_AALARM 5 -#define AALARM_MODE_SCRUBBING 1 -#define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster. -#define AALARM_MODE_PANIC 3 //constantly sucks all air -#define AALARM_MODE_CYCLE 4 //sucks off all air, then refill and swithes to scrubbing -#define AALARM_MODE_FILL 5 //emergency fill -#define AALARM_SCREEN_MAIN 1 -#define AALARM_SCREEN_VENT 2 -#define AALARM_SCREEN_SCRUB 3 -#define AALARM_SCREEN_MODE 4 -#define AALARM_SCREEN_SENSORS 5 +// A datum for dealing with threshold limit values +// used in /obj/machinery/alarm +/datum/tlv + var/min2 + var/min1 + var/max1 + var/max2 + New(_min2 as num, _min1 as num, _max1 as num, _max2 as num) + min2 = _min2 + min1 = _min1 + max1 = _max1 + max2 = _max2 + proc/get_danger_level(curval as num) + if (max2 >=0 && curval>=max2) + return 2 + if (min2 >=0 && curval<=min2) + return 2 + if (max1 >=0 && curval>=max1) + return 1 + if (min1 >=0 && curval<=min1) + return 1 + return 0 + proc/CopyFrom(datum/tlv/other) + min2 = other.min2 + min1 = other.min1 + max1 = other.max1 + max2 = other.max2 +/obj/machinery/alarm + name = "alarm" + icon = 'icons/obj/monitors.dmi' + icon_state = "alarm0" + anchored = 1 + use_power = 1 + idle_power_usage = 4 + active_power_usage = 8 + power_channel = ENVIRON + req_access = list(access_atmospherics) + var/frequency = 1439 + //var/skipprocess = 0 //Experimenting + var/alarm_frequency = 1437 #define AALARM_REPORT_TIMEOUT 100 + var/datum/radio_frequency/radio_connection + var/locked = 1 + var/wiresexposed = 0 // If it's been screwdrivered open. + var/aidisabled = 0 + var/AAlarmwires = 31 + var/shorted = 0 + var/remote_control = 0 -#define RCON_NO 1 -#define RCON_AUTO 2 -#define RCON_YES 3 + // Uses code from apc.dm + +#define AALARM_WIRE_IDSCAN 1 //Added wires +#define AALARM_WIRE_POWER 2 +#define AALARM_WIRE_SYPHON 3 +#define AALARM_WIRE_AI_CONTROL 4 +#define AALARM_WIRE_AALARM 5 + + +#define AALARM_MODE_SCRUBBING 1 +#define AALARM_MODE_VENTING 2 //makes draught +#define AALARM_MODE_PANIC 3 //constantly sucks all air +#define AALARM_MODE_REPLACEMENT 4 //sucks off all air, then refill and swithes to scrubbing +#define AALARM_MODE_OFF 5 + var/mode = AALARM_MODE_SCRUBBING + +#define AALARM_SCREEN_MAIN 1 +#define AALARM_SCREEN_VENT 2 +#define AALARM_SCREEN_SCRUB 3 +#define AALARM_SCREEN_MODE 4 +#define AALARM_SCREEN_SENSORS 5 + var/screen = AALARM_SCREEN_MAIN + var/area_uid + var/area/alarm_area + var/danger_level = 0 + + // breathable air according to human/Life() + var/list/TLV = list( + "oxygen" = new/datum/tlv( 16, 19, 135, 140), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0, -1.0, 5, 10), // Partial pressure, kpa + "plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa + "other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa + "pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20), /* kpa */ + "temperature" = new/datum/tlv(T0C, T0C+10, T0C+40, T0C+66), // K + ) + +/* + // breathable air according to wikipedia + "oxygen" = new/datum/tlv( 9, 12, 158, 296), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0,-1.0, 0.5, 1), // Partial pressure, kpa +*/ +/obj/machinery/alarm/server + //req_access = list(access_rd) //no, let departaments to work together + TLV = list( + "oxygen" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0, -1.0, 5, 10), // Partial pressure, kpa + "plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa + "other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa + "pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.40,ONE_ATMOSPHERE*1.60), /* kpa */ + "temperature" = new/datum/tlv(40, 60, 100, 120), // K + ) + +/obj/machinery/alarm/kitchen_cold_room + TLV = list( + "oxygen" = new/datum/tlv( 16, 19, 135, 140), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0, -1.0, 5, 10), // Partial pressure, kpa + "plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa + "other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa + "pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.50,ONE_ATMOSPHERE*1.60), /* kpa */ + "temperature" = new/datum/tlv(200, 210, 273.15, 283.15), // K + ) -//all air alarms in area are connected via magic //all air alarms in area are connected via magic /area var/obj/machinery/alarm/master_air_alarm @@ -55,740 +143,508 @@ var/list/air_vent_info var/list/air_scrub_info -/obj/machinery/alarm - name = "alarm" - icon = 'monitors.dmi' - icon_state = "alarm0" - anchored = 1 - use_power = 1 - idle_power_usage = 4 - active_power_usage = 8 - power_channel = ENVIRON - req_access = list(ACCESS_ATMOSPHERICS, ACCESS_ENGINE_EQUIP) - var/frequency = 1439 - //var/skipprocess = 0 //Experimenting - var/alarm_frequency = 1437 - var/remote_control = 0 - var/rcon_setting = 2 - var/rcon_time = 0 - var/locked = 1 - var/wiresexposed = 0 // If it's been screwdrivered open. - var/aidisabled = 0 - var/AAlarmwires = 31 - var/shorted = 0 +/obj/machinery/alarm/New() + ..() + alarm_area = get_area(loc) + if (alarm_area.master) + alarm_area = alarm_area.master + area_uid = alarm_area.uid + if (name == "alarm") + name = "[alarm_area.name] Air Alarm" - var/mode = AALARM_MODE_SCRUBBING - var/screen = AALARM_SCREEN_MAIN - var/area_uid - var/area/alarm_area - var/danger_level = 0 +/obj/machinery/alarm/initialize() + set_frequency(frequency) + if (!master_is_operating()) + elect_master() - var/datum/radio_frequency/radio_connection +/obj/machinery/alarm/proc/master_is_operating() + return alarm_area.master_air_alarm && !(alarm_area.master_air_alarm.stat & (NOPOWER|BROKEN)) - var/list/TLV = list() +/obj/machinery/alarm/proc/elect_master() + for (var/area/A in alarm_area.related) + for (var/obj/machinery/alarm/AA in A) + if (!(AA.stat & (NOPOWER|BROKEN))) + alarm_area.master_air_alarm = AA + if (!alarm_area.air_vent_names) + alarm_area.air_vent_names = new + alarm_area.air_scrub_names = new + alarm_area.air_vent_info = new + alarm_area.air_scrub_info = new + return 1 + return 0 - server/New() - ..() - req_access = list(ACCESS_RD, ACCESS_ENGINE_EQUIP, ACCESS_ATMOSPHERICS) - TLV["oxygen"] = list(-1.0, -1.0,-1.0,-1.0) // Partial pressure, kpa - TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa - TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa - TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa - TLV["pressure"] = list(ONE_ATMOSPHERE*0.50,ONE_ATMOSPHERE*0.70,ONE_ATMOSPHERE*1.40,ONE_ATMOSPHERE*1.60) /* kpa */ - TLV["temperature"] = list(40, 60, 100, 120) // K - - New() - ..() - alarm_area = get_area(src) - if (alarm_area.master) - alarm_area = alarm_area.master - area_uid = alarm_area.uid - if (name == "alarm") - name = "[alarm_area.name] Air Alarm" - - // breathable air according to human/Life() - TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa - TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa - TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa - TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa - TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */ - TLV["temperature"] = list(T0C, T0C+10, T0C+40, T0C+66) // K - - initialize() - set_frequency(frequency) - if (!master_is_operating()) - elect_master() - - - process() - if((stat & (NOPOWER|BROKEN)) || shorted) - return - - var/turf/simulated/location = src.loc - if (!istype(location)) - return 0 - - var/datum/gas_mixture/environment = location.return_air() - var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume - - var/list/current_settings = TLV["pressure"] - var/environment_pressure = environment.return_pressure() - var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings) - - current_settings = TLV["oxygen"] - var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings) - - current_settings = TLV["carbon dioxide"] - var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings) - - current_settings = TLV["plasma"] - var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, current_settings) - - current_settings = TLV["other"] - var/other_moles = 0.0 - for(var/datum/gas/G in environment.trace_gases) - other_moles+=G.moles - var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings) - - current_settings = TLV["temperature"] - var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings) - - var/old_danger_level = danger_level - danger_level = max(pressure_dangerlevel, - oxygen_dangerlevel, - co2_dangerlevel, - plasma_dangerlevel, - other_dangerlevel, - temperature_dangerlevel) - - if (old_danger_level != danger_level) - apply_danger_level(danger_level) - - if (mode==AALARM_MODE_CYCLE && environment_pressure= danger_levels[4] || current_value <= danger_levels[1]) - return 2 - if(current_value >= danger_levels[3] || current_value <= danger_levels[2]) - return 1 - return 0 - - update_icon() - if(wiresexposed) - icon_state = "alarmx" - return - if((stat & (NOPOWER|BROKEN)) || shorted) - icon_state = "alarmp" - return - switch(max(danger_level, alarm_area.atmosalm)) - if (0) - icon_state = "alarm0" - if (1) - icon_state = "alarm2" //yes, alarm2 is yellow alarm - if (2) - icon_state = "alarm1" - - receive_signal(datum/signal/signal) - if(stat & (NOPOWER|BROKEN)) - return - if (alarm_area.master_air_alarm != src) - if (master_is_operating()) - return - elect_master() - if (alarm_area.master_air_alarm != src) - return - if(!signal || signal.encryption) - return - var/id_tag = signal.data["tag"] - if (!id_tag) - return - if (signal.data["area"] != area_uid) - return - if (signal.data["sigtype"] != "status") + if ( (get_dist(src, user) > 1 )) + if (!istype(user, /mob/living/silicon)) + user.machine = null + user << browse(null, "window=air_alarm") + user << browse(null, "window=AAlarmwires") return - var/dev_type = signal.data["device"] - if(!(id_tag in alarm_area.air_scrub_names) && !(id_tag in alarm_area.air_vent_names)) - register_env_machine(id_tag, dev_type) - if(dev_type == "AScr") - alarm_area.air_scrub_info[id_tag] = signal.data - else if(dev_type == "AVP") - alarm_area.air_vent_info[id_tag] = signal.data - proc/register_env_machine(var/m_id, var/device_type) - var/new_name - if (device_type=="AVP") - new_name = "[alarm_area.name] Vent Pump #[alarm_area.air_vent_names.len+1]" - alarm_area.air_vent_names[m_id] = new_name - else if (device_type=="AScr") - new_name = "[alarm_area.name] Air Scrubber #[alarm_area.air_scrub_names.len+1]" - alarm_area.air_scrub_names[m_id] = new_name - else + else if (istype(user, /mob/living/silicon) && src.aidisabled) + user << "AI control for this Air Alarm interface has been disabled." + user << browse(null, "window=air_alarm") return - spawn (10) - send_signal(m_id, list("init" = new_name) ) - proc/refresh_all() - for(var/id_tag in alarm_area.air_vent_names) - var/list/I = alarm_area.air_vent_info[id_tag] - if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) - continue - send_signal(id_tag, list("status") ) - for(var/id_tag in alarm_area.air_scrub_names) - var/list/I = alarm_area.air_scrub_info[id_tag] - if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) - continue - send_signal(id_tag, list("status") ) + if(wiresexposed && (!istype(user, /mob/living/silicon))) + var/t1 = text("[alarm_area.name] Air Alarm WiresAccess Panel
      \n") + var/list/AAlarmwires = list( + "Orange" = 1, + "Dark red" = 2, + "White" = 3, + "Yellow" = 4, + "Black" = 5, + ) + for(var/wiredesc in AAlarmwires) + var/is_uncut = src.AAlarmwires & AAlarmWireColorToFlag[AAlarmwires[wiredesc]] + t1 += "[wiredesc] wire: " + if(!is_uncut) + t1 += "Mend" - proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - radio_connection = radio_controller.add_object(src, frequency, RADIO_TO_AIRALARM) + else + t1 += "Cut " + t1 += "Pulse " - proc/send_signal(var/target, var/list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise - if(!radio_connection) - return 0 + t1 += "
      " + t1 += text("
      \n[(src.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
      \n[((src.shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
      \n[(src.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]") + t1 += text("

      Close

      ") + user << browse(t1, "window=AAlarmwires") + onclose(user, "AAlarmwires") - var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal - signal.source = src + if(!shorted) + user << browse(return_text(),"window=air_alarm") + onclose(user, "air_alarm") + refresh_all() - signal.data = command - signal.data["tag"] = target - signal.data["sigtype"] = "command" + return - radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) - // world << text("Signal [] Broadcasted to []", command, target) - return 1 +/obj/machinery/alarm/proc/isWireColorCut(var/wireColor) + var/wireFlag = AAlarmWireColorToFlag[wireColor] + return ((src.AAlarmwires & wireFlag) == 0) - proc/apply_mode() - var/current_pressures = TLV["pressure"] - var/target_pressure = (current_pressures[2] + current_pressures[3])/2 - switch(mode) - if(AALARM_MODE_SCRUBBING) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "setting"= 1, "scrubbing"= 1, "panic_siphon"= 0) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 1, "set_external_pressure"= target_pressure) ) +/obj/machinery/alarm/proc/isWireCut(var/wireIndex) + var/wireFlag = AAlarmIndexToFlag[wireIndex] + return ((src.AAlarmwires & wireFlag) == 0) - if(AALARM_MODE_PANIC, AALARM_MODE_CYCLE) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "panic_siphon"= 1) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 0) ) +/obj/machinery/alarm/proc/cut(var/wireColor) + var/wireFlag = AAlarmWireColorToFlag[wireColor] + var/wireIndex = AAlarmWireColorToIndex[wireColor] + AAlarmwires &= ~wireFlag + switch(wireIndex) + if(AALARM_WIRE_IDSCAN) + src.locked = 1 + //world << "Idscan wire cut" - if(AALARM_MODE_REPLACEMENT) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "setting"= 3, "scrubbing"= 1, "panic_siphon"= 0) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 3, "set_external_pressure"= target_pressure) ) + if(AALARM_WIRE_POWER) + src.shock(usr, 50) + src.shorted = 1 + update_icon() + //world << "Power wire cut" - if(AALARM_MODE_FILL) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 0) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 3, "set_external_pressure"= target_pressure) ) + if (AALARM_WIRE_AI_CONTROL) + if (src.aidisabled == 0) + src.aidisabled = 1 + //world << "AI Control Wire Cut" - proc/apply_danger_level(var/new_danger_level) - alarm_area.atmosalm = new_danger_level + if(AALARM_WIRE_SYPHON) + mode = AALARM_MODE_PANIC + apply_mode() + //world << "Syphon Wire Cut" - for (var/area/A in alarm_area.related) - for (var/obj/machinery/alarm/AA in A) - if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.danger_level != new_danger_level) - AA.update_icon() + if(AALARM_WIRE_AALARM) - if(danger_level > 1) - air_doors_close(0) - else - air_doors_open(0) + if (alarm_area.atmosalert(2)) + post_alert(2) + spawn(1) + src.updateUsrDialog() + update_icon() - update_icon() + //world << "AAlarm Wire Cut" - proc/air_doors_close(manual) - var/area/A = get_area(src) - if(!A.master.air_doors_activated) - A.master.air_doors_activated = 1 - for(var/obj/machinery/door/E in A.master.all_doors) - if(istype(E,/obj/machinery/door/firedoor)) - if(!E:blocked) - if(E.operating) - E:nextstate = CLOSED - else if(!E.density) - spawn(0) - E.close() - continue + src.updateDialog() - if(istype(E, /obj/machinery/door/airlock)) - if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER) || E:air_locked) continue - if(!E.density) - spawn(0) - E.close() - spawn(10) - if(E.density) - E:air_locked = E.req_access - E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() - else if(E.operating) - spawn(10) - E.close() - if(E.density) - E:air_locked = E.req_access - E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() - else if(!E:locked) //Don't lock already bolted doors. - E:air_locked = E.req_access - E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() + return - proc/air_doors_open(manual) - var/area/A = get_area(loc) - if(A.master.air_doors_activated) - A.master.air_doors_activated = 0 - for(var/obj/machinery/door/E in A.master.all_doors) - if(istype(E, /obj/machinery/door/firedoor)) - if(!E:blocked) - if(E.operating) - E:nextstate = OPEN - else if(E.density) - spawn(0) - E.open() - continue +/obj/machinery/alarm/proc/mend(var/wireColor) + var/wireFlag = AAlarmWireColorToFlag[wireColor] + var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function + AAlarmwires |= wireFlag + switch(wireIndex) + if(AALARM_WIRE_IDSCAN) + //world << "Idscan wire mended" - if(istype(E, /obj/machinery/door/airlock)) - if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER)) continue - if(!isnull(E:air_locked)) //Don't mess with doors locked for other reasons. - E:req_access = E:air_locked - E:air_locked = null - E.update_icon() + if(AALARM_WIRE_POWER) + src.shorted = 0 + src.shock(usr, 50) + update_icon() + //world << "Power wire mended" -/////////// -//HACKING// -/////////// - proc/isWireColorCut(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - return ((AAlarmwires & wireFlag) == 0) + if(AALARM_WIRE_AI_CONTROL) + if (src.aidisabled == 1) + src.aidisabled = 0 + //world << "AI Cont. wire mended" - proc/isWireCut(var/wireIndex) - var/wireFlag = AAlarmIndexToFlag[wireIndex] - return ((AAlarmwires & wireFlag) == 0) - proc/cut(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] - AAlarmwires &= ~wireFlag - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - locked = 1 + // if(AALARM_WIRE_SYPHON) + // world << "Syphon Wire mended" - if(AALARM_WIRE_POWER) - shock(usr, 50) + + // if(AALARM_WIRE_AALARM) + //world << "AAlarm Wire mended" + + src.updateDialog() + return + +/obj/machinery/alarm/proc/pulse(var/wireColor) + //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function + var/wireIndex = AAlarmWireColorToIndex[wireColor] + switch(wireIndex) + if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears + src.locked = 0 + spawn(300) + src.locked = 1 + //world << "Idscan wire pulsed" + + if (AALARM_WIRE_POWER) + // world << "Power wire pulsed" + if(shorted == 0) shorted = 1 update_icon() - if (AALARM_WIRE_AI_CONTROL) - if (aidisabled == 0) - aidisabled = 1 - - if(AALARM_WIRE_SYPHON) - mode = AALARM_MODE_PANIC - apply_mode() - - if(AALARM_WIRE_AALARM) - - if (alarm_area.atmosalert(2)) - apply_danger_level(2) - spawn(1) - updateUsrDialog() - update_icon() - - updateDialog() - - return - - proc/mend(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function - AAlarmwires |= wireFlag - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - - if(AALARM_WIRE_POWER) - src.shorted = 0 - src.shock(usr, 50) - update_icon() - - if(AALARM_WIRE_AI_CONTROL) - if (src.aidisabled == 1) - src.aidisabled = 0 - - src.updateDialog() - return - - proc/pulse(var/wireColor) - //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function - var/wireIndex = AAlarmWireColorToIndex[wireColor] - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears - locked = 0 - spawn(300) - locked = 1 - - if (AALARM_WIRE_POWER) - if(shorted == 0) - shorted = 1 + spawn(1200) + if(shorted == 1) + shorted = 0 update_icon() - spawn(1200) - if(shorted == 1) - shorted = 0 - update_icon() + if (AALARM_WIRE_AI_CONTROL) + // world << "AI Control wire pulsed" + if (src.aidisabled == 0) + src.aidisabled = 1 + src.updateDialog() + spawn(10) + if (src.aidisabled == 1) + src.aidisabled = 0 + src.updateDialog() - if (AALARM_WIRE_AI_CONTROL) - if (aidisabled == 0) - aidisabled = 1 - updateDialog() - spawn(10) - if (aidisabled == 1) - aidisabled = 0 - updateDialog() + if(AALARM_WIRE_SYPHON) + // world << "Syphon wire pulsed" + mode = AALARM_MODE_REPLACEMENT + apply_mode() - if(AALARM_WIRE_SYPHON) - mode = AALARM_MODE_REPLACEMENT - apply_mode() + if(AALARM_WIRE_AALARM) + // world << "Aalarm wire pulsed" + if (alarm_area.atmosalert(0)) + post_alert(0) + spawn(1) + src.updateUsrDialog() + update_icon() - if(AALARM_WIRE_AALARM) - if (alarm_area.atmosalert(0)) - apply_danger_level(0) - spawn(1) - updateUsrDialog() - update_icon() + src.updateDialog() + return - updateDialog() +/obj/machinery/alarm/proc/shock(mob/user, prb) + if((stat & (NOPOWER))) // unpowered, no shock + return 0 + if(!prob(prb)) + return 0 //you lucked out, no shock for you + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() //sparks always. + if (electrocute_mob(user, get_area(src), src)) + return 1 + else + return 0 + +/obj/machinery/alarm/receive_signal(datum/signal/signal) + if(stat & (NOPOWER|BROKEN)) return - - proc/shock(mob/user, prb) - if((stat & (NOPOWER))) // unpowered, no shock - return 0 - if(!prob(prb)) - return 0 //you lucked out, no shock for you - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - s.start() //sparks always. - if (electrocute_mob(user, get_area(src), src)) - return 1 - else - return 0 -/////////////// -//END HACKING// -/////////////// - - - attack_hand(mob/user) - . = ..() - if (.) + if (alarm_area.master_air_alarm != src) + if (master_is_operating()) return - user.machine = src - - if ( (get_dist(src, user) > 1 )) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=air_alarm") - user << browse(null, "window=AAlarmwires") - return - - - else if (istype(user, /mob/living/silicon) && aidisabled) - user << "AI control for this Air Alarm interface has been disabled." - user << browse(null, "window=air_alarm") - return - - if(wiresexposed && (!istype(user, /mob/living/silicon))) - var/t1 = text("[alarm_area.name] Air Alarm WiresAccess Panel
      \n") - var/list/AAlarmwires = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Black" = 5, - ) - for(var/wiredesc in AAlarmwires) - var/is_uncut = AAlarmwires & AAlarmWireColorToFlag[AAlarmwires[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "Mend" - - else - t1 += "Cut " - t1 += "Pulse " - - t1 += "
      " - t1 += text("
      \n[(locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
      \n[((shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
      \n[(aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]") - t1 += text("

      Close

      ") - user << browse(t1, "window=AAlarmwires") - onclose(user, "AAlarmwires") - - if(!shorted) - user << browse(return_text(user),"window=air_alarm") - onclose(user, "air_alarm") - + elect_master() + if (alarm_area.master_air_alarm != src) + return + if(!signal || signal.encryption) + return + var/id_tag = signal.data["tag"] + if (!id_tag) + return + if (signal.data["area"] != area_uid) + return + if (signal.data["sigtype"] != "status") return - proc/return_text(mob/user) - if(!(istype(user, /mob/living/silicon)) && locked) - return "\The [src][return_status()]
      [rcon_text()]
      (Swipe ID card to unlock interface)" - else - return "\The [src][return_status()]
      [rcon_text()]
      [return_controls()]" + var/dev_type = signal.data["device"] + if(!(id_tag in alarm_area.air_scrub_names) && !(id_tag in alarm_area.air_vent_names)) + register_env_machine(id_tag, dev_type) + if(dev_type == "AScr") + alarm_area.air_scrub_info[id_tag] = signal.data + else if(dev_type == "AVP") + alarm_area.air_vent_info[id_tag] = signal.data - proc/return_status() - var/turf/location = get_turf(src) - var/datum/gas_mixture/environment = location.return_air() - var/total = environment.oxygen + environment.carbon_dioxide + environment.toxins + environment.nitrogen - var/output = "Air Status:
      " +/obj/machinery/alarm/proc/register_env_machine(var/m_id, var/device_type) + var/new_name + if (device_type=="AVP") + new_name = "[alarm_area.name] Vent Pump #[alarm_area.air_vent_names.len+1]" + alarm_area.air_vent_names[m_id] = new_name + else if (device_type=="AScr") + new_name = "[alarm_area.name] Air Scrubber #[alarm_area.air_scrub_names.len+1]" + alarm_area.air_scrub_names[m_id] = new_name + else + return + spawn (10) + send_signal(m_id, list("init" = new_name) ) - if(total == 0) - output += "Warning: Cannot obtain air sample for analysis." - return output +/obj/machinery/alarm/proc/refresh_all() + for(var/id_tag in alarm_area.air_vent_names) + var/list/I = alarm_area.air_vent_info[id_tag] + if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) + continue + send_signal(id_tag, list("status") ) + for(var/id_tag in alarm_area.air_scrub_names) + var/list/I = alarm_area.air_scrub_info[id_tag] + if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) + continue + send_signal(id_tag, list("status") ) - output += {" +/obj/machinery/alarm/proc/set_frequency(new_frequency) + radio_controller.remove_object(src, frequency) + frequency = new_frequency + radio_connection = radio_controller.add_object(src, frequency, RADIO_TO_AIRALARM) + +/obj/machinery/alarm/proc/send_signal(var/target, var/list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise + if(!radio_connection) + return 0 + + var/datum/signal/signal = new + signal.transmission_method = 1 //radio signal + signal.source = src + + signal.data = command + signal.data["tag"] = target + signal.data["sigtype"] = "command" + + radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) +// world << text("Signal [] Broadcasted to []", command, target) + + return 1 + +/obj/machinery/alarm/proc/return_text() + if(!(istype(usr, /mob/living/silicon)) && locked) + return "[src][return_status()]
      (Swipe ID card to unlock interface)" + else + return "[src][return_status()]
      [return_controls()]" + +/obj/machinery/alarm/proc/return_status() + var/turf/location = src.loc + var/datum/gas_mixture/environment = location.return_air() + var/total = environment.oxygen + environment.carbon_dioxide + environment.toxins + environment.nitrogen + var/output = "Air Status:
      " + + if(total == 0) + output +={"Warning: Cannot obtain air sample for analysis."} + return output + + output += {" "} + var/datum/tlv/cur_tlv + var/GET_PP = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume - var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume + cur_tlv = TLV["pressure"] + var/environment_pressure = environment.return_pressure() + var/pressure_dangerlevel = cur_tlv.get_danger_level(environment_pressure) - var/list/current_settings = TLV["pressure"] - var/environment_pressure = environment.return_pressure() - var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings) + cur_tlv = TLV["oxygen"] + var/oxygen_dangerlevel = cur_tlv.get_danger_level(environment.oxygen*GET_PP) + var/oxygen_percent = round(environment.oxygen / total * 100, 2) - current_settings = TLV["oxygen"] - var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings) - var/oxygen_percent = round(environment.oxygen / total * 100, 2) + cur_tlv = TLV["carbon dioxide"] + var/co2_dangerlevel = cur_tlv.get_danger_level(environment.carbon_dioxide*GET_PP) + var/co2_percent = round(environment.carbon_dioxide / total * 100, 2) - current_settings = TLV["carbon dioxide"] - var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings) - var/co2_percent = round(environment.carbon_dioxide / total * 100, 2) + cur_tlv = TLV["plasma"] + var/plasma_dangerlevel = cur_tlv.get_danger_level(environment.toxins*GET_PP) + var/plasma_percent = round(environment.toxins / total * 100, 2) - current_settings = TLV["plasma"] - var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, current_settings) - var/plasma_percent = round(environment.toxins / total * 100, 2) + cur_tlv = TLV["other"] + var/other_moles = 0.0 + for(var/datum/gas/G in environment.trace_gases) + other_moles+=G.moles + var/other_dangerlevel = cur_tlv.get_danger_level(other_moles*GET_PP) - current_settings = TLV["other"] - var/other_moles = 0.0 - for(var/datum/gas/G in environment.trace_gases) - other_moles+=G.moles - var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings) + cur_tlv = TLV["temperature"] + var/temperature_dangerlevel = cur_tlv.get_danger_level(environment.temperature) - current_settings = TLV["temperature"] - var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings) - - output += {" + output += {" Pressure: [environment_pressure]kPa
      Oxygen: [oxygen_percent]%
      Carbon dioxide: [co2_percent]%
      Toxins: [plasma_percent]%
      "} - if (other_dangerlevel==2) - output += "Notice: High Concentration of Unknown Particles Detected
      " - else if (other_dangerlevel==1) - output += "Notice: Low Concentration of Unknown Particles Detected
      " + if (other_dangerlevel==2) + output += {"Notice: High Concentration of Unknown Particles Detected
      "} + else if (other_dangerlevel==1) + output += {"Notice: Low Concentration of Unknown Particles Detected
      "} - output += "Temperature: [environment.temperature]K
      " + output += {" +Temperature: [environment.temperature]K
      +"} - //Overall status - output += "Local Status: " - switch(max(pressure_dangerlevel,oxygen_dangerlevel,co2_dangerlevel,plasma_dangerlevel,other_dangerlevel,temperature_dangerlevel)) - if(2) - output += "DANGER: Internals Required" - if(1) - output += "Caution" - if(0) - if(alarm_area.atmosalm) - output += {"Caution: Atmos alert in area"} - else - output += {"Optimal"} + var/display_danger_level = max( + pressure_dangerlevel, + oxygen_dangerlevel, + co2_dangerlevel, + plasma_dangerlevel, + other_dangerlevel, + temperature_dangerlevel + ) - output += "

      Atmospheric Lockdown: [alarm_area.air_doors_activated ? "ENABLED" : "Disabled"]" + //Overall status + output += {"Local Status: "} + if(display_danger_level == 2) + output += {"DANGER: Internals Required"} + else if(display_danger_level == 1) + output += {"Caution"} + else if (alarm_area.atmosalm) + output += {"Caution: Atmos alert in area"} + else + output += {"Optimal"} - return output + return output - proc/rcon_text() - var/dat = "Remote Control:
      " - if(rcon_setting == RCON_NO) - dat += "Off" - else - dat += "Off" - dat += " | " - if(rcon_setting == RCON_AUTO) - dat += "Auto" - else - dat += "Auto" - dat += " | " - if(rcon_setting == RCON_YES) - dat += "On" - else - dat += "On" - return dat +/obj/machinery/alarm/proc/return_controls() + var/output = ""//"[alarm_zone] Air [name]
      " - proc/return_controls() - var/output = ""//"[alarm_zone] Air [name]
      " + switch(screen) + if (AALARM_SCREEN_MAIN) + if(alarm_area.atmosalm) + output += {"Reset - Atmospheric Alarm
      "} + else + output += {"Activate - Atmospheric Alarm
      "} - switch(screen) - if (AALARM_SCREEN_MAIN) - if(alarm_area.atmosalm) - output += "Reset - Atmospheric Alarm
      " - else - output += "Activate - Atmospheric Alarm
      " - - output += {" + output += {" Scrubbers Control
      Vents Control
      Set environmentals mode
      Sensor Settings

      "} - if (mode==AALARM_MODE_PANIC) - output += "PANIC SYPHON ACTIVE
      Turn syphoning off" - else - output += "ACTIVATE PANIC SYPHON IN AREA" - - - if (AALARM_SCREEN_VENT) - var/sensor_data = "" - if(alarm_area.air_vent_names.len) - for(var/id_tag in alarm_area.air_vent_names) - var/long_name = alarm_area.air_vent_names[id_tag] - var/list/data = alarm_area.air_vent_info[id_tag] - if(!data) - continue; - var/state = "" + if (mode==AALARM_MODE_PANIC) + output += "PANIC SYPHON ACTIVE
      Turn syphoning off" + else + output += "ACTIVATE PANIC SYPHON IN AREA" + if (AALARM_SCREEN_VENT) + var/sensor_data = "" + if(alarm_area.air_vent_names.len) + for(var/id_tag in alarm_area.air_vent_names) + var/long_name = alarm_area.air_vent_names[id_tag] + var/list/data = alarm_area.air_vent_info[id_tag] + if(!data) + continue; + var/state = "" + sensor_data += {" +[long_name][state]
      +Operating: +[data["power"]?"on":"off"] +
      +Pressure checks: +external +internal +
      +External pressure bound: +- +- +- +- +[data["external"]] ++ ++ ++ ++ + (reset) +
      +"} + if (data["direction"] == "siphon") sensor_data += {" - [long_name][state]
      - Operating: - [data["power"]?"on":"off"] -
      - Pressure checks: - external - internal -
      - External pressure bound: - - - - - - - - - [data["external"]] - + - + - + - + - (reset) -
      - "} - if (data["direction"] == "siphon") - sensor_data += {" - Direction: - siphoning -
      - "} - sensor_data += {"
      "} - else - sensor_data = "No vents connected.
      " - output = {"Main menu
      [sensor_data]"} - if (AALARM_SCREEN_SCRUB) - var/sensor_data = "" - if(alarm_area.air_scrub_names.len) - for(var/id_tag in alarm_area.air_scrub_names) - var/long_name = alarm_area.air_scrub_names[id_tag] - var/list/data = alarm_area.air_scrub_info[id_tag] - if(!data) - continue; - var/state = "" +Direction: +siphoning +
      +"} + sensor_data += {"
      "} + else + sensor_data = "No vents connected.
      " + output = {"Main menu
      [sensor_data]"} + if (AALARM_SCREEN_SCRUB) + var/sensor_data = "" + if(alarm_area.air_scrub_names.len) + for(var/id_tag in alarm_area.air_scrub_names) + var/long_name = alarm_area.air_scrub_names[id_tag] + var/list/data = alarm_area.air_scrub_info[id_tag] + if(!data) + continue; + var/state = "" + sensor_data += {" +[long_name][state]
      +Operating: +[data["power"]?"on":"off"]
      +Type: +[data["scrubbing"]?"scrubbing":"syphoning"]
      +"} + + if(data["scrubbing"]) sensor_data += {" - [long_name][state]
      - Operating: - [data["power"]?"on":"off"]
      - Type: - [data["scrubbing"]?"scrubbing":"syphoning"]
      - "} +Filtering: +Carbon Dioxide +[data["filter_co2"]?"on":"off"]; +Toxins +[data["filter_toxins"]?"on":"off"]; +Nitrous Oxide +[data["filter_n2o"]?"on":"off"] +
      +"} + sensor_data += {" +Panic syphon: [data["panic"]?"PANIC SYPHON ACTIVATED":""] +Dea":"red'>A")]ctivate
      +
      +"} + else + sensor_data = "No scrubbers connected.
      " + output = {"Main menu
      [sensor_data]"} - if(data["scrubbing"]) - sensor_data += {" - Filtering: - Carbon Dioxide - [data["filter_co2"]?"on":"off"]; - Toxins - [data["filter_toxins"]?"on":"off"]; - Nitrous Oxide - [data["filter_n2o"]?"on":"off"] -
      - "} - sensor_data += {" - Panic syphon: [data["panic"]?"PANIC SYPHON ACTIVATED":""] - Dea":"red'>A")]ctivate
      -
      - "} + if (AALARM_SCREEN_MODE) + output += {" +Main menu
      +Air machinery mode for the area:
        "} + var/list/modes = list( + AALARM_MODE_SCRUBBING = "Filtering", + AALARM_MODE_VENTING = "Draught", + AALARM_MODE_PANIC = "PANIC", + AALARM_MODE_REPLACEMENT = "REPLACE AIR", + AALARM_MODE_OFF = "Off", + ) + for (var/m=1,m<=modes.len,m++) + if (mode==m) + output += {"
      • [modes[m]] (selected)
      • "} else - sensor_data = "No scrubbers connected.
        " - output = {"Main menu
        [sensor_data]"} - - if (AALARM_SCREEN_MODE) - output += "Main menu
        Air machinery mode for the area:
          " - var/list/modes = list(AALARM_MODE_SCRUBBING = "Filtering",\ - AALARM_MODE_REPLACEMENT = "REPLACE AIR",\ - AALARM_MODE_PANIC = "PANIC",\ - AALARM_MODE_CYCLE = "CYCLE",\ - AALARM_MODE_FILL = "FILL",) - for (var/m=1,m<=modes.len,m++) - if (mode==m) - output += "
        • [modes[m]] (selected)
        • " - else - output += "
        • [modes[m]]
        • " - output += "
        " - - if (AALARM_SCREEN_SENSORS) - output += {" + output += {"
      • [modes[m]]
      • "} + output += "
      " + if (AALARM_SCREEN_SENSORS) + output += {" Main menu
      Alarm thresholds:
      Partial pressure for gases @@ -804,160 +660,313 @@ table tr:first-child th:first-child { border: none;}
      "} - var/list/gases = list( - "oxygen" = "O2", - "carbon dioxide" = "CO2", - "plasma" = "Toxin", - "other" = "Other",) + var/list/gases = list( + "oxygen" = "O2", + "carbon dioxide" = "CO2", + "plasma" = "Toxin", + "other" = "Other", + ) + var/list/thresholds = list("min2", "min1", "max1", "max2") + var/datum/tlv/tlv + for (var/g in gases) + output += {" + +"} + tlv = TLV[g] + for (var/v in thresholds) + output += {" + +"} + output += {" + +"} + tlv = TLV["pressure"] + output += {" + +"} + for (var/v in thresholds) + output += {" + +"} + output += {" + +"} + tlv = TLV["temperature"] + output += {" + +"} + for (var/v in thresholds) + output += {" + +"} + output += {" + +"} + output += {"
      min2min1max1max2
      [gases[g]] +[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] +
      Pressure +[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] +
      Temperature +[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] +
      "} - var/list/selected - for (var/g in gases) - output += "[gases[g]]" - selected = TLV[g] - for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"]" - output += "" + return output - selected = TLV["pressure"] - output += " Pressure" - for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"]" - output += "" +/obj/machinery/alarm/Topic(href, href_list) + if(..()) + return + src.add_fingerprint(usr) + usr.machine = src - selected = TLV["temperature"] - output += "Temperature" - for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"]" - output += "" + if ( (get_dist(src, usr) > 1 )) + if (!istype(usr, /mob/living/silicon)) + usr.machine = null + usr << browse(null, "window=air_alarm") + usr << browse(null, "window=AAlarmwires") + return - return output + if (href_list["AAlarmwires"]) + var/t1 = text2num(href_list["AAlarmwires"]) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) + usr << "You need wirecutters!" + return + if (src.isWireColorCut(t1)) + src.mend(t1) + else + src.cut(t1) + else if (href_list["pulse"]) + var/t1 = text2num(href_list["pulse"]) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) + usr << "You need a multitool!" + return + if (src.isWireColorCut(t1)) + usr << "You can't pulse a cut wire." + return + else + src.pulse(t1) - Topic(href, href_list) - if(href_list["rcon"]) - rcon_setting = text2num(href_list["rcon"]) - if ( (get_dist(src, usr) > 1 )) - if (!istype(usr, /mob/living/silicon)) - usr.machine = null - usr << browse(null, "window=air_alarm") - usr << browse(null, "window=AAlarmwires") - return + if(href_list["command"]) + var/device_id = href_list["id_tag"] + switch(href_list["command"]) + if( + "power", + "adjust_external_pressure", + "set_external_pressure", + "checks", + "co2_scrub", + "tox_scrub", + "n2o_scrub", + "panic_siphon", + "scrubbing" + ) + send_signal(device_id, list (href_list["command"] = text2num(href_list["val"]))) + spawn(3) + src.updateUsrDialog() - add_fingerprint(usr) - usr.machine = src + //if("adjust_threshold") //was a good idea but required very wide window + if("set_threshold") + var/env = href_list["env"] + var/varname = href_list["var"] + var/datum/tlv/tlv = TLV[env] + var/newval = input("Enter [varname] for env", "Alarm triggers", tlv.vars[varname]) as num|null - if(href_list["command"]) - var/device_id = href_list["id_tag"] - switch(href_list["command"]) - if( "power", - "adjust_external_pressure", - "set_external_pressure", - "checks", - "co2_scrub", - "tox_scrub", - "n2o_scrub", - "panic_siphon", - "scrubbing") + if (isnull(newval) || ..() || (locked && !issilicon(usr))) + return + if (newval<0) + tlv.vars[varname] = -1.0 + else if (env=="temperature" && newval>5000) + tlv.vars[varname] = 5000 + else if (env=="pressure" && newval>50*ONE_ATMOSPHERE) + tlv.vars[varname] = 50*ONE_ATMOSPHERE + else if (env!="temperature" && env!="pressure" && newval>200) + tlv.vars[varname] = 200 + else + newval = round(newval,0.01) + tlv.vars[varname] = newval + spawn(1) + src.updateUsrDialog() - send_signal(device_id, list(href_list["command"] = text2num(href_list["val"]) ) ) + if(href_list["screen"]) + screen = text2num(href_list["screen"]) + spawn(1) + src.updateUsrDialog() - if("set_threshold") - var/env = href_list["env"] - var/threshold = text2num(href_list["var"]) - var/list/selected = TLV[env] - var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound") - var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as null|num - if (isnull(newval) || ..() || (locked && issilicon(usr))) - return - if (newval<0) - selected[threshold] = -1.0 - else if (env=="temperature" && newval>5000) - selected[threshold] = 5000 - else if (env=="pressure" && newval>50*ONE_ATMOSPHERE) - selected[threshold] = 50*ONE_ATMOSPHERE - else if (env!="temperature" && env!="pressure" && newval>200) - selected[threshold] = 200 - else - newval = round(newval,0.01) - selected[threshold] = newval - if(threshold == 1) - if(selected[1] > selected[2]) - selected[2] = selected[1] - if(selected[1] > selected[3]) - selected[3] = selected[1] - if(selected[1] > selected[4]) - selected[4] = selected[1] - if(threshold == 2) - if(selected[1] > selected[2]) - selected[1] = selected[2] - if(selected[2] > selected[3]) - selected[3] = selected[2] - if(selected[2] > selected[4]) - selected[4] = selected[2] - if(threshold == 3) - if(selected[1] > selected[3]) - selected[1] = selected[3] - if(selected[2] > selected[3]) - selected[2] = selected[3] - if(selected[3] > selected[4]) - selected[4] = selected[3] - if(threshold == 4) - if(selected[1] > selected[4]) - selected[1] = selected[4] - if(selected[2] > selected[4]) - selected[2] = selected[4] - if(selected[3] > selected[4]) - selected[3] = selected[4] - apply_mode() - if(href_list["screen"]) - screen = text2num(href_list["screen"]) + if(href_list["atmos_alarm"]) + if (alarm_area.atmosalert(2)) + post_alert(2) + spawn(1) + src.updateUsrDialog() + update_icon() + if(href_list["atmos_reset"]) + if (alarm_area.atmosalert(0)) + post_alert(0) + spawn(1) + src.updateUsrDialog() + update_icon() - if(href_list["atmos_unlock"]) - switch(href_list["atmos_unlock"]) - if("0") - air_doors_close(1) - if("1") - air_doors_open(1) + if(href_list["mode"]) + mode = text2num(href_list["mode"]) + apply_mode() + spawn(5) + src.updateUsrDialog() - if(href_list["atmos_alarm"]) - if (alarm_area.atmosalert(2)) - apply_danger_level(2) - update_icon() + return - if(href_list["atmos_reset"]) - if (alarm_area.atmosalert(0)) - apply_danger_level(0) - update_icon() +/obj/machinery/alarm/proc/apply_mode() + switch(mode) + if(AALARM_MODE_SCRUBBING) + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "power"= 1, + "co2_scrub"= 1, + "scrubbing"= 1, + "panic_siphon"= 0, + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 1, + "checks"= 1, + "set_external_pressure"= ONE_ATMOSPHERE + )) - if(href_list["mode"]) - mode = text2num(href_list["mode"]) - apply_mode() + if(AALARM_MODE_VENTING) + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "power"= 1, + "panic_siphon"= 0, + "scrubbing"= 0 + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 1, + "checks"= 1, + "set_external_pressure"= ONE_ATMOSPHERE + )) + if( + AALARM_MODE_PANIC, + AALARM_MODE_REPLACEMENT + ) + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "power"= 1, + "panic_siphon"= 1 + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 0 + )) + /*if(AALARM_MODE_OFF) Commented out cause the "turn off panic" uses scrubbing mode now instead. + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "panic_siphon" = 0 + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 1 + ))*/ - if (href_list["AAlarmwires"]) - var/t1 = text2num(href_list["AAlarmwires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) - usr << "You need wirecutters!" - return - if (isWireColorCut(t1)) - mend(t1) - else - cut(t1) +/obj/machinery/alarm/update_icon() + if(wiresexposed) + icon_state = "alarmx" + return + if((stat & (NOPOWER|BROKEN)) || shorted) + icon_state = "alarmp" + return + switch(max(danger_level, alarm_area.atmosalm)) + if (0) + src.icon_state = "alarm0" + if (1) + src.icon_state = "alarm2" //yes, alarm2 is yellow alarm + if (2) + src.icon_state = "alarm1" - else if (href_list["pulse"]) - var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) - usr << "You need a multitool!" - return - if (isWireColorCut(t1)) - usr << "You can't pulse a cut wire." - return - else - pulse(t1) +/obj/machinery/alarm/process() + if((stat & (NOPOWER|BROKEN)) || shorted) + return - updateUsrDialog() + var/turf/simulated/location = src.loc + if (!istype(location)) + return 0 + var/datum/gas_mixture/environment = location.return_air() + + var/datum/tlv/cur_tlv + var/GET_PP = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume + + cur_tlv = TLV["pressure"] + var/environment_pressure = environment.return_pressure() + var/pressure_dangerlevel = cur_tlv.get_danger_level(environment_pressure) + + cur_tlv = TLV["oxygen"] + var/oxygen_dangerlevel = cur_tlv.get_danger_level(environment.oxygen*GET_PP) + + cur_tlv = TLV["carbon dioxide"] + var/co2_dangerlevel = cur_tlv.get_danger_level(environment.carbon_dioxide*GET_PP) + + cur_tlv = TLV["plasma"] + var/plasma_dangerlevel = cur_tlv.get_danger_level(environment.toxins*GET_PP) + + cur_tlv = TLV["other"] + var/other_moles = 0.0 + for(var/datum/gas/G in environment.trace_gases) + other_moles+=G.moles + var/other_dangerlevel = cur_tlv.get_danger_level(other_moles*GET_PP) + + cur_tlv = TLV["temperature"] + var/temperature_dangerlevel = cur_tlv.get_danger_level(environment.temperature) + + var/old_danger_level = danger_level + danger_level = max( + pressure_dangerlevel, + oxygen_dangerlevel, + co2_dangerlevel, + plasma_dangerlevel, + other_dangerlevel, + temperature_dangerlevel + ) + if (old_danger_level!=danger_level) + apply_danger_level() + + if (mode==AALARM_MODE_REPLACEMENT && environment_pressure4) - var/total_moles = air_sample.total_moles + var/total_moles = air_sample.total_moles() if(total_moles > 0) if(output&4) signal.data["oxygen"] = round(100*air_sample.oxygen/total_moles,0.1) @@ -75,8 +75,8 @@ obj/machinery/air_sensor set_frequency(frequency) obj/machinery/computer/general_air_control - icon = 'computer.dmi' - icon_state = "computer_generic" + icon = 'icons/obj/computer.dmi' + icon_state = "tank" name = "Computer" @@ -97,7 +97,7 @@ obj/machinery/computer/general_air_control attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -184,7 +184,7 @@ obj/machinery/computer/general_air_control set_frequency(frequency) large_tank_control - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "tank" var/input_tag @@ -283,7 +283,7 @@ Max Output Pressure: [output_pressure] kPa
      "} src.updateDialog() fuel_injection - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "atmos" var/device_tag @@ -296,7 +296,7 @@ Max Output Pressure: [output_pressure] kPa
      "} attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm index 43825c7ca3..f4033020d3 100644 --- a/code/game/machinery/atmoalter/area_atmos_computer.dm +++ b/code/game/machinery/atmoalter/area_atmos_computer.dm @@ -1,7 +1,7 @@ /obj/machinery/computer/area_atmos name = "Area Air Control" desc = "A computer used to control the stationary scrubbers and pumps in the area." - icon_state = "computer_generic" + icon_state = "area_atmos" circuit = "/obj/item/weapon/circuitboard/area_atmos" var/scrubber_state = 0 //0 = off; 1 = on @@ -42,9 +42,14 @@ SCRUBBER.on = scrubber_state SCRUBBER.update_icon() + if(scrubber_state) + icon_state = "area_atmos2" + else + icon_state = "area_atmos" + attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) var/obj/item/weapon/circuitboard/area_atmos/M = new /obj/item/weapon/circuitboard/area_atmos( A ) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index ca37c394dd..4f68d9a5ef 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -1,6 +1,6 @@ /obj/machinery/portable_atmospherics/canister name = "canister" - icon = 'atmos.dmi' + icon = 'icons/obj/atmos.dmi' icon_state = "yellow" density = 1 var/health = 100.0 @@ -66,13 +66,13 @@ var/tank_pressure = air_contents.return_pressure() if (tank_pressure < 10) - overlays += image('atmos.dmi', "can-o0") + overlays += image('icons/obj/atmos.dmi', "can-o0") else if (tank_pressure < ONE_ATMOSPHERE) - overlays += image('atmos.dmi', "can-o1") + overlays += image('icons/obj/atmos.dmi', "can-o1") else if (tank_pressure < 15*ONE_ATMOSPHERE) - overlays += image('atmos.dmi', "can-o2") + overlays += image('icons/obj/atmos.dmi', "can-o2") else - overlays += image('atmos.dmi', "can-o3") + overlays += image('icons/obj/atmos.dmi', "can-o3") return /obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) @@ -89,7 +89,7 @@ location.assume_air(air_contents) src.destroyed = 1 - playsound(src.loc, 'spray.ogg', 10, 1, -3) + playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3) src.density = 0 update_icon() @@ -219,9 +219,13 @@ Release Pressure: - - - - - - - 0) diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index f718d8ba03..0f91e007ce 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -1,7 +1,7 @@ /obj/machinery/portable_atmospherics/pump name = "Portable Air Pump" - icon = 'atmos.dmi' + icon = 'icons/obj/atmos.dmi' icon_state = "psiphon:0" density = 1 diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 9493346842..b347e473d2 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -1,7 +1,7 @@ /obj/machinery/portable_atmospherics/scrubber name = "Portable Air Scrubber" - icon = 'atmos.dmi' + icon = 'icons/obj/atmos.dmi' icon_state = "pscrubber:0" density = 1 @@ -56,7 +56,7 @@ environment = holding.air_contents else environment = loc.return_air() - var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles + var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles() //Take a gas sample var/datum/gas_mixture/removed @@ -83,7 +83,12 @@ if(istype(trace_gas, /datum/gas/sleeping_agent)) removed.trace_gases -= trace_gas filtered_out.trace_gases += trace_gas - filtered_out.update_values() + + if(removed.trace_gases.len>0) + for(var/datum/gas/trace_gas in removed.trace_gases) + if(istype(trace_gas, /datum/gas/oxygen_agent_b)) + removed.trace_gases -= trace_gas + filtered_out.trace_gases += trace_gas //Remix the resulting gases air_contents.merge(filtered_out) diff --git a/code/game/machinery/atmoalter/zvent.dm b/code/game/machinery/atmoalter/zvent.dm index 7ff4caa0d9..f15be283c2 100644 --- a/code/game/machinery/atmoalter/zvent.dm +++ b/code/game/machinery/atmoalter/zvent.dm @@ -1,7 +1,7 @@ /obj/machinery/zvent name = "Interfloor Air Transfer System" - icon = 'pipes.dmi' + icon = 'icons/obj/pipes.dmi' icon_state = "vent-db" density = 0 anchored=1 @@ -23,7 +23,7 @@ var/datum/gas_mixture/conn_air = zturf_conn.air //TODO: pop culture reference var/datum/gas_mixture/my_air = myturf.air if (istype(conn_air) && istype(my_air)) -// if (!my_air.compare(conn_air)) -// myturf.reset_delay() -// zturf_conn.reset_delay() + if (!my_air.compare(conn_air)) + myturf.reset_delay() + zturf_conn.reset_delay() my_air.share(conn_air) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 63bb619054..bce0465d46 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 var/global/list/autolathe_recipes = list( \ /* screwdriver removed*/ \ @@ -12,11 +12,9 @@ var/global/list/autolathe_recipes = list( \ new /obj/item/weapon/screwdriver(), \ new /obj/item/weapon/wirecutters(), \ new /obj/item/weapon/wrench(), \ - new /obj/item/clothing/head/helmet/welding(), \ + new /obj/item/clothing/head/welding(), \ new /obj/item/weapon/stock_parts/console_screen(), \ new /obj/item/weapon/airlock_electronics(), \ - new /obj/item/weapon/module/power_control(), \ - new /obj/item/weapon/circuitboard/disposal(), \ new /obj/item/stack/sheet/metal(), \ new /obj/item/stack/sheet/glass(), \ new /obj/item/stack/sheet/rglass(), \ @@ -25,8 +23,11 @@ var/global/list/autolathe_recipes = list( \ new /obj/item/weapon/kitchenknife(), \ new /obj/item/weapon/scalpel(), \ new /obj/item/weapon/circular_saw(), \ + new /obj/item/weapon/surgicaldrill(),\ + new /obj/item/weapon/retractor(),\ + new /obj/item/weapon/cautery(),\ new /obj/item/weapon/reagent_containers/glass/beaker(), \ - new /obj/item/weapon/reagent_containers/glass/large(), \ + new /obj/item/weapon/reagent_containers/glass/beaker/large(), \ new /obj/item/ammo_casing/shotgun/blank(), \ new /obj/item/ammo_casing/shotgun/beanbag(), \ new /obj/item/ammo_magazine/c38(), \ @@ -40,7 +41,6 @@ var/global/list/autolathe_recipes = list( \ new /obj/item/device/assembly/timer(), \ new /obj/item/weapon/light/tube(), \ new /obj/item/weapon/light/bulb(), \ - new /obj/item/ashtray/glass() ) var/global/list/autolathe_recipes_hidden = list( \ @@ -59,8 +59,6 @@ var/global/list/autolathe_recipes_hidden = list( \ var/busy = 0 var/max_m_amount = 150000.0 var/max_g_amount = 75000.0 - var/outputAmount = 1 - var/makeDir = 0 proc wires_win(mob/user as mob) @@ -78,17 +76,6 @@ var/global/list/autolathe_recipes_hidden = list( \ regular_win(mob/user as mob) var/dat as text dat = text("Metal Amount: [src.m_amount] cm3 (MAX: [max_m_amount])
      \nGlass Amount: [src.g_amount] cm3 (MAX: [max_g_amount])


      ") - dat += "Output Queue: [outputAmount] (Modify)" - dat += "
      " - var/list/heldContainers = list() - for(var/obj/item/weapon/storage/container in src.contents) - heldContainers += container - if(heldContainers.len) - for(var/obj/item/weapon/storage/container in heldContainers) - dat += "[container.name] (eject stored container)
      " - else - dat += "No held storage containers" - dat += "
      " var/list/objs = list() objs += src.L if (src.hacked) @@ -144,11 +131,6 @@ var/global/list/autolathe_recipes_hidden = list( \ attackby(var/obj/item/O as obj, var/mob/user as mob) if (stat) return 1 - if(istype(O,/obj/item/weapon/storage/)) - usr.before_take_item(O) - O.loc = src - user << "\blue You insert the \icon[O] [O.name] into the autolathe!" - return 0 if (busy) user << "\red The autolathe is busy. Please wait for completion of previous operation." return 1 @@ -164,7 +146,7 @@ var/global/list/autolathe_recipes_hidden = list( \ return 1 if (opened) if(istype(O, /obj/item/weapon/crowbar)) - playsound(src.loc, 'Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) M.state = 2 M.icon_state = "box_1" @@ -244,67 +226,39 @@ var/global/list/autolathe_recipes_hidden = list( \ return usr.machine = src src.add_fingerprint(usr) - if(href_list["removeContainer"]) - var/obj/item/weapon/storage/container = locate(href_list["removeContainer"]) - container.loc = src.loc - container.layer = initial(container.layer) - if(href_list["modifyOutputAmount"]) - outputAmount = text2num(input(usr,"Amount:","Enter new quantity to create","")) - if(!busy) - if(outputAmount < 1) - outputAmount = 1 - else - usr << "\red The autolathe is busy. Please wait for completion of previous operation." if (!busy) if(href_list["make"]) - var/turf/T = src.loc + var/turf/T = get_step(src.loc, get_dir(src,usr)) var/obj/template = locate(href_list["make"]) var/multiplier = text2num(href_list["multiplier"]) if (!multiplier) multiplier = 1 var/power = max(2000, (template.m_amt+template.g_amt)*multiplier/5) - restart: - if(outputAmount > 0) - if(src.m_amount >= template.m_amt*multiplier && src.g_amount >= template.g_amt*multiplier) - + if(src.m_amount >= template.m_amt*multiplier && src.g_amount >= template.g_amt*multiplier) + busy = 1 + use_power(power) + icon_state = "autolathe" + flick("autolathe_n",src) + spawn(16) use_power(power) - icon_state = "autolathe" - flick("autolathe_n",src) spawn(16) - if(!busy) - busy = 1 - use_power(power) - spawn(16) - use_power(power) - spawn(16) - src.m_amount -= template.m_amt*multiplier - src.g_amount -= template.g_amt*multiplier - if(src.m_amount < 0) - src.m_amount = 0 - if(src.g_amount < 0) - src.g_amount = 0 - var/obj/new_item = new template.type(src) - for(var/obj/item/weapon/storage/container in src.contents) - container.attackby(new_item) - if(new_item.loc == container) - break - if (multiplier>1) - var/obj/item/stack/S = new_item - S.amount = multiplier - if(new_item in src) - new_item.loc = T - src.updateUsrDialog() - outputAmount -= 1 - busy = 0 - goto restart - else - for(var/mob/M in view(3,src)) - M << "\red\icon[src] has run out of materials." - else - outputAmount = 1 + use_power(power) + spawn(16) + src.m_amount -= template.m_amt*multiplier + src.g_amount -= template.g_amt*multiplier + if(src.m_amount < 0) + src.m_amount = 0 + if(src.g_amount < 0) + src.g_amount = 0 + var/obj/new_item = new template.type(T) + if (multiplier>1) + var/obj/item/stack/S = new_item + S.amount = multiplier + busy = 0 + src.updateUsrDialog() if(href_list["act"]) var/temp_wire = href_list["wire"] if(href_list["act"] == "pulse") - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" else if(src.wires[temp_wire]) @@ -322,7 +276,7 @@ var/global/list/autolathe_recipes_hidden = list( \ src.shock(usr,50) spawn(100) src.shocked = !src.shocked if(href_list["act"] == "wire") - if (!istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) usr << "You need wirecutters!" else wires[temp_wire] = !wires[temp_wire] diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index 6da5db0081..170fe5ded2 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -1,7 +1,7 @@ /obj/machinery/biogenerator name = "Biogenerator" desc = "" - icon = 'biogenerator.dmi' + icon = 'icons/obj/biogenerator.dmi' icon_state = "biogen-stand" density = 1 anchored = 1 @@ -17,7 +17,7 @@ var/datum/reagents/R = new/datum/reagents(1000) reagents = R R.my_atom = src - beaker = new /obj/item/weapon/reagent_containers/glass/large(src) + beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src) on_reagent_change() //When the reagents change, change the icon as well. update_icon() @@ -96,9 +96,10 @@ dat += "Left 4 Zed (20) | x5
      " dat += "Robust Harvest (25) | x5
      " dat += "Leather
      " - dat += "Wallet (200)
      " - dat += "Botanical gloves (350)
      " - dat += "Utility belt (400)
      " + dat += "Wallet (100)
      " + dat += "Botanical gloves (250)
      " + dat += "Utility belt (300)
      " + dat += "Leather Satchel (400)
      " //dat += "Other
      " //dat += "Monkey (500)
      " else @@ -138,7 +139,7 @@ processing = 1 update_icon() updateUsrDialog() - playsound(src.loc, 'blender.ogg', 50, 1) + playsound(src.loc, 'sound/machines/blender.ogg', 50, 1) use_power(S*30) sleep(S+15) processing = 0 @@ -160,7 +161,7 @@ if("milk") beaker.reagents.add_reagent("milk",10) if("meat") - new/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat(src.loc) + new/obj/item/weapon/reagent_containers/food/snacks/meat(src.loc) if("ez") new/obj/item/nutrient/ez(src.loc) if("l4z") @@ -191,6 +192,8 @@ new/obj/item/clothing/gloves/botanic_leather(src.loc) if("tbelt") new/obj/item/weapon/storage/belt/utility(src.loc) + if("satchel") + new/obj/item/weapon/storage/backpack/satchel(src.loc) if("monkey") new/mob/living/carbon/monkey(src.loc) processing = 0 diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 5a5ac4b8cf..f619c5ebcf 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -1,7 +1,7 @@ // AI (i.e. game AI, not the AI player) controlled bots /obj/machinery/bot - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' layer = MOB_LAYER var/obj/item/weapon/card/id/botcard // the ID card that the bot "holds" var/on = 1 @@ -36,9 +36,9 @@ ..() if (src.health < maxhealth) if (src.health > maxhealth/3) - usr << text("\red [src]'s parts look loose.") + usr << "[src]'s parts look loose." else - usr << text("\red [src]'s parts look very loose!") + usr << "[src]'s parts look very loose!" return /obj/machinery/bot/attack_alien(var/mob/living/carbon/alien/user as mob) @@ -51,7 +51,7 @@ */ src.health -= rand(15,30)*brute_dam_coeff src.visible_message("\red [user] has slashed [src]!") - playsound(src.loc, 'slice.ogg', 25, 1, -1) + playsound(src.loc, 'sound/weapons/slice.ogg', 25, 1, -1) if(prob(10)) new /obj/effect/decal/cleanable/oil(src.loc) healthcheck() @@ -61,6 +61,7 @@ if(M.melee_damage_upper == 0) return src.health -= M.melee_damage_upper src.visible_message("\red [M] has [M.attacktext] [src]!") + M.attack_log += text("\[[time_stamp()]\] attacked [src.name]") if(prob(10)) new /obj/effect/decal/cleanable/oil(src.loc) healthcheck() @@ -77,13 +78,8 @@ "\blue You repair [src]!" ) else - user << "\blue [src] does not need a repair!" + user << "[src] does not need a repair." else if (istype(W, /obj/item/weapon/card/emag) && !emagged) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return Emag(user) else switch(W.damtype) @@ -130,7 +126,7 @@ var/was_on = on stat |= EMPED var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc ) - pulse2.icon = 'effects.dmi' + pulse2.icon = 'icons/effects/effects.dmi' pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index ebd8ac8de4..3b765dc22b 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -2,7 +2,7 @@ /obj/item/weapon/bucket_sensor desc = "It's a bucket. With a sensor attached." name = "proxy bucket" - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "bucket_proxy" force = 3.0 throwforce = 10.0 @@ -17,7 +17,7 @@ /obj/machinery/bot/cleanbot name = "Cleanbot" desc = "A little cleaning robot, he looks so excited!" - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "cleanbot0" layer = 5.0 density = 0 @@ -35,7 +35,7 @@ var/obj/effect/decal/cleanable/target var/obj/effect/decal/cleanable/oldtarget var/oldloc = null - req_access = list(ACCESS_JANITOR) + req_access = list(access_janitor) var/path[] = new() var/patrol_path[] = null var/beacon_freq = 1445 // navigation beacon frequency @@ -129,30 +129,30 @@ text("[src.oddbutton ? "Yes" : "No" src.updateUsrDialog() if("screw") src.screwloose = !src.screwloose - usr << "You twiddle the screw." + usr << "You press the weird button." src.updateUsrDialog() /obj/machinery/bot/cleanbot/attackby(obj/item/weapon/W, mob/user as mob) if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if(src.allowed(usr)) src.locked = !src.locked - user << "You [ src.locked ? "lock" : "unlock"] the [src] behaviour controls." + user << "You [ src.locked ? "lock" : "unlock"] the [src] behaviour controls." else - user << "\red This [src] doesn't seem to accept your authority." + user << "This [src] doesn't seem to respect your authority." else if (istype(W, /obj/item/weapon/screwdriver)) if(!src.locked) src.panelopen = !src.panelopen - user << "You [ src.panelopen ? "open" : "close"] the hidden panel on [src]." + user << "You [ src.panelopen ? "open" : "close"] the hidden panel on [src]." else return ..() /obj/machinery/bot/cleanbot/Emag(mob/user as mob) ..() - if(user) user << "The [src] buzzes and beeps." + if(user) user << "The [src] buzzes and beeps." src.oddbutton = 1 src.screwloose = 1 src.panelopen = 0 @@ -166,12 +166,8 @@ text("[src.oddbutton ? "Yes" : "No" if(src.cleaning) return var/list/cleanbottargets = list() - if(!src.target || src.target == null) - for(var/obj/machinery/bot/cleanbot/bot in world) - if(bot != src) - cleanbottargets += bot.target - if(prob(5) && !src.screwloose && !src.oddbutton) + if(!src.screwloose && !src.oddbutton && prob(5)) for(var/mob/O in viewers(src, null)) O.show_message(text("[src] makes an excited beeping booping sound!"), 1) @@ -185,7 +181,7 @@ text("[src.oddbutton ? "Yes" : "No" if(T.wet_overlay) T.overlays -= T.wet_overlay T.wet_overlay = null - T.wet_overlay = image('water.dmi',T,"wet_floor") + T.wet_overlay = image('icons/effects/water.dmi',T,"wet_floor") T.overlays += T.wet_overlay spawn(800) if (istype(T) && T.wet < 2) @@ -232,17 +228,16 @@ text("[src.oddbutton ? "Yes" : "No" if (!next_dest_loc) next_dest_loc = closest_loc if (next_dest_loc) - src.patrol_path = AStar(src.loc, next_dest_loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_ortho, 0, 120, id=botcard, exclude=null) + src.patrol_path = AStar(src.loc, next_dest_loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=null) src.patrol_path = reverselist(src.patrol_path) else patrol_move() - spawn(5) - patrol_move() return - if(src.target && (src.target != null) && src.path.len == 0) + if(target && path.len == 0) spawn(0) + if(!src || !target) return src.path = AStar(src.loc, src.target.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, 0, 30) src.path = reverselist(src.path) if(src.path.len == 0) @@ -307,12 +302,6 @@ text("[src.oddbutton ? "Yes" : "No" target_types += /obj/effect/decal/cleanable/vomit target_types += /obj/effect/decal/cleanable/robot_debris target_types += /obj/effect/decal/cleanable/crayon - target_types += /obj/effect/decal/cleanable/mucus - target_types += /obj/effect/decal/cleanable/robot_debris - target_types += /obj/effect/decal/cleanable/molten_item - target_types += /obj/effect/decal/cleanable/tomato_smudge - target_types += /obj/effect/decal/cleanable/egg_smudge - target_types += /obj/effect/decal/cleanable/pie_smudge if(src.blood) target_types += /obj/effect/decal/cleanable/xenoblood/ @@ -355,23 +344,18 @@ text("[src.oddbutton ? "Yes" : "No" /obj/item/weapon/bucket_sensor/attackby(var/obj/item/W, mob/user as mob) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) - var/cleanbots = 0 - for(var/obj/machinery/bot/cleanbot in world) - cleanbots++ - if(cleanbots >= 6) //For some reason it starts at 4, so max limit is actually 2. - user << "\red The station frequencies can't handle anymore cleanbots!" //TOO MANY GODDAMN CLEANBOTS - cleanbots = 0 - return - var/obj/machinery/bot/cleanbot/A = new /obj/machinery/bot/cleanbot - A.loc = get_turf(src.loc) - A.name = src.created_name - user << "You add the robot arm to the bucket and sensor assembly! Beep boop!" + user.drop_item() del(W) + var/turf/T = get_turf(src.loc) + var/obj/machinery/bot/cleanbot/A = new /obj/machinery/bot/cleanbot(T) + A.name = src.created_name + user << "You add the robot arm to the bucket and sensor assembly. Beep boop!" + user.drop_from_inventory(src) del(src) else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index a40aa01d40..62aa9fe277 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -1,13 +1,13 @@ /obj/machinery/bot/ed209 - name = "ED-209" + name = "ED-209 Security Robot" desc = "A security robot. He looks less than thrilled." - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "ed2090" layer = 5.0 density = 1 anchored = 0 // weight = 1.0E7 - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) health = 100 maxhealth = 100 fire_dam_coeff = 0.7 @@ -16,7 +16,7 @@ var/lastfired = 0 var/shot_delay = 3 //.3 seconds between shots var/lasercolor = "" - var/disabled = 0 + var/disabled = 0//A holder for if it needs to be disabled, if true it will not seach for targets, shoot at targets, or move, currently only used for lasertag //var/lasers = 0 @@ -31,6 +31,7 @@ var/idcheck = 1 //If false, all station IDs are authorized for weapons. var/check_records = 1 //Does it check security records? var/arrest_type = 0 //If true, don't handcuff + var/projectile = null//Holder for projectile type, to avoid so many else if chains var/mode = 0 #define SECBOT_IDLE 0 // idle @@ -65,7 +66,7 @@ /obj/item/weapon/ed209_assembly name = "ED-209 assembly" desc = "Some sort of bizarre assembly." - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "ed209_frame" item_state = "ed209_frame" var/build_step = 0 @@ -73,24 +74,29 @@ var/lasercolor = "" -/obj/machinery/bot/ed209/New() +/obj/machinery/bot/ed209/New(loc,created_name,created_lasercolor) ..() + if(created_name) name = created_name + if(created_lasercolor) lasercolor = created_lasercolor src.icon_state = "[lasercolor]ed209[src.on]" spawn(3) src.botcard = new /obj/item/weapon/card/id(src) src.botcard.access = get_access("Detective") src.cam = new /obj/machinery/camera(src) src.cam.c_tag = src.name - src.cam.network = "Security" + src.cam.network = "SS13" if(radio_controller) radio_controller.add_object(src, control_freq, filter = RADIO_SECBOT) radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS) if(lasercolor) - req_access = list(ACCESS_MAINT_TUNNELS,ACCESS_CLOWN,ACCESS_MIME) + shot_delay = 6//Longer shot delay because JESUS CHRIST + check_records = 0//Don't actively target people set to arrest + arrest_type = 1//Don't even try to cuff + req_access = list(access_maint_tunnels,access_clown,access_mime) arrest_type = 1 - if(lasercolor == "b") + if((lasercolor == "b") && (name == "ED-209 Security Robot"))//Picks a name if there isn't already a custome one name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT") - if(lasercolor == "r") + if((lasercolor == "r") && (name == "ED-209 Security Robot")) name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") /obj/machinery/bot/ed209/turn_on() @@ -123,7 +129,8 @@ Behaviour controls are [src.locked ? "locked" : "unlocked"]"}, "[src.on ? "On" : "Off"]" ) if(!src.locked) - dat += text({"
      + if(!lasercolor) + dat += text({"
      Check for Weapon Authorization: []
      Check Security Records: []
      Operating Mode: []
      @@ -132,6 +139,11 @@ Auto Patrol: []"}, "[src.idcheck ? "Yes" : "No"]", "[src.check_records ? "Yes" : "No"]", "[src.arrest_type ? "Detain" : "Arrest"]", +"[auto_patrol ? "On" : "Off"]" ) + else + dat += text({"
      +Auto Patrol: []"}, + "[auto_patrol ? "On" : "Off"]" ) @@ -144,6 +156,12 @@ Auto Patrol: []"}, return usr.machine = src src.add_fingerprint(usr) + if(lasercolor && (istype(usr,/mob/living/carbon/human))) + var/mob/living/carbon/human/H = usr + if((lasercolor == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag)))//Opposing team cannot operate it + return + else if((lasercolor == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag))) + return if ((href_list["power"]) && (src.allowed(usr))) if (src.on) turn_off() @@ -170,18 +188,20 @@ Auto Patrol: []"}, if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if (src.allowed(user)) src.locked = !src.locked - user << "Controls are now [src.locked ? "locked." : "unlocked."]" + user << "Controls are now [src.locked ? "locked" : "unlocked"]." else - user << "\red Access denied." + user << "Access denied." else ..() if (!istype(W, /obj/item/weapon/screwdriver) && (W.force) && (!src.target)) src.target = user + if(lasercolor)//To make up for the fact that lasertag bots don't hunt + src.shootAt(user) src.mode = SECBOT_HUNT /obj/machinery/bot/ed209/Emag(mob/user as mob) ..() - if(user) user << "\red You short out [src]'s target assessment circuits." + if(user) user << "You short out [src]'s target assessment circuits." spawn(0) for(var/mob/O in hearers(src, null)) O.show_message("\red [src] buzzes oddly!", 1) @@ -192,6 +212,7 @@ Auto Patrol: []"}, src.emagged = 1 src.on = 1 src.icon_state = "[lasercolor]ed209[src.on]" + src.projectile = null mode = SECBOT_IDLE /obj/machinery/bot/ed209/process() @@ -233,6 +254,7 @@ Auto Patrol: []"}, if(SECBOT_HUNT) // hunting for perp if(src.lasercolor)//Lasertag bots do not tase or arrest anyone, just patrol and shoot and whatnot + mode = SECBOT_IDLE return // if can't reach perp for long enough, go idle if (src.frustration >= 8) @@ -246,7 +268,7 @@ Auto Patrol: []"}, if (target) // make sure target exists if (get_dist(src, src.target) <= 1) // if right next to perp - playsound(src.loc, 'Egloves.ogg', 50, 1, -1) + playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) src.icon_state = "[lasercolor]ed209-c" spawn(2) src.icon_state = "[lasercolor]ed209[src.on]" @@ -282,6 +304,7 @@ Auto Patrol: []"}, if(SECBOT_PREP_ARREST) // preparing to arrest target if(src.lasercolor) + mode = SECBOT_IDLE return if (!target) mode = SECBOT_IDLE @@ -294,7 +317,7 @@ Auto Patrol: []"}, return if (!src.target.handcuffed && !src.arrest_type) - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) mode = SECBOT_ARREST for(var/mob/O in viewers(src, null)) O.show_message("\red [src] is trying to put handcuffs on [src.target]!", 1) @@ -306,6 +329,7 @@ Auto Patrol: []"}, if(istype(src.target,/mob/living/carbon)) src.target.handcuffed = new /obj/item/weapon/handcuffs(src.target) + target.update_inv_handcuffed() //update handcuff overlays mode = SECBOT_IDLE src.target = null @@ -313,12 +337,13 @@ Auto Patrol: []"}, src.last_found = world.time src.frustration = 0 - // playsound(src.loc, pick('bgod.ogg', 'biamthelaw.ogg', 'bsecureday.ogg', 'bradio.ogg', 'binsult.ogg', 'bcreep.ogg'), 50, 0) + // playsound(src.loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.") // src.speak(arrest_message) if(SECBOT_ARREST) // arresting if(src.lasercolor) + mode = SECBOT_IDLE return if (!target || src.target.handcuffed) src.anchored = 0 @@ -387,6 +412,8 @@ Auto Patrol: []"}, path -= loc look_for_perp() + if(lasercolor) + sleep(20) else // failed to move blockcount++ @@ -578,19 +605,24 @@ Auto Patrol: []"}, // calculates a path to the current destination // given an optional turf to avoid /obj/machinery/bot/ed209/proc/calc_path(var/turf/avoid = null) - src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_ortho, 0, 120, id=botcard, exclude=avoid) + src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid) src.path = reverselist(src.path) // look for a criminal in view of the bot /obj/machinery/bot/ed209/proc/look_for_perp() + if(src.disabled) + return src.anchored = 0 src.threatlevel = 0 for (var/mob/living/carbon/C in view(12,src)) //Let's find us a criminal if ((C.stat) || (C.handcuffed)) continue + if((src.lasercolor) && (C.lying)) + continue//Does not shoot at people lyind down when in lasertag mode, because it's just annoying, and they can fire once they get up. + if ((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue @@ -606,7 +638,8 @@ Auto Patrol: []"}, src.target = C src.oldtarget_name = C.name src.speak("Level [src.threatlevel] infraction alert!") - playsound(src.loc, pick('ed209_20sec.ogg', 'EDPlaceholder.ogg'), 50, 0) + if(!src.lasercolor) + playsound(src.loc, pick('sound/voice/ed209_20sec.ogg', 'sound/voice/EDPlaceholder.ogg'), 50, 0) src.visible_message("[src] points at [C.name]!") mode = SECBOT_HUNT spawn(0) @@ -624,8 +657,6 @@ Auto Patrol: []"}, if(src.emagged) return 10 //Everyone is a criminal! if((src.idcheck) || (isnull(perp:wear_id)) || (istype(perp:wear_id, /obj/item/weapon/card/id/syndicate))) - if(src.allowed(perp)) //Corrupt cops cannot exist beep boop - return 0 if((istype(perp.l_hand, /obj/item/weapon/gun) && !istype(perp.l_hand, /obj/item/weapon/gun/projectile/shotgun)) || istype(perp.l_hand, /obj/item/weapon/melee/baton)) if(!istype(perp.l_hand, /obj/item/weapon/gun/energy/laser/bluetag) \ @@ -648,7 +679,7 @@ Auto Patrol: []"}, if(istype(perp:wear_suit, /obj/item/clothing/suit/wizrobe)) threatcount += 2 - if(perp.mutantrace && perp.mutantrace != "none") + if(perp.dna && perp.dna.mutantrace && perp.dna.mutantrace != "none") threatcount += 2 //Agent cards lower threatlevel when normal idchecking is off. @@ -656,6 +687,7 @@ Auto Patrol: []"}, threatcount -= 2 if(src.lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve + threatcount = 0//They will not, however shoot at people who have guns, because it gets really fucking annoying if(istype(perp.wear_suit, /obj/item/clothing/suit/redtag)) threatcount += 4 if((istype(perp:r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(perp:l_hand,/obj/item/weapon/gun/energy/laser/redtag))) @@ -664,6 +696,7 @@ Auto Patrol: []"}, threatcount += 2 if(src.lasercolor == "r") + threatcount = 0 if(istype(perp.wear_suit, /obj/item/clothing/suit/bluetag)) threatcount += 4 if((istype(perp:r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(perp:l_hand,/obj/item/weapon/gun/energy/laser/bluetag))) @@ -690,27 +723,29 @@ Auto Patrol: []"}, threatcount = 4 break + if((src.idcheck) && (src.allowed(perp)) && !(src.lasercolor)) + threatcount = 0//Corrupt cops cannot exist beep boop + return threatcount /obj/machinery/bot/ed209/Bump(M as mob|obj) //Leave no door unopened! - spawn(0) - if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) - var/obj/machinery/door/D = M - if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) - D.open() - src.frustration = 0 - else if ((istype(M, /mob/living/)) && (!src.anchored)) - src.loc = M:loc + if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) + var/obj/machinery/door/D = M + if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) + D.open() src.frustration = 0 - - return + else if ((istype(M, /mob/living/)) && (!src.anchored)) + src.loc = M:loc + src.frustration = 0 return +/* terrible /obj/machinery/bot/ed209/Bumped(atom/movable/M as mob|obj) spawn(0) if (M) var/turf/T = get_turf(src) M:loc = T +*/ /obj/machinery/bot/ed209/proc/speak(var/message) for(var/mob/O in hearers(src, null)) @@ -724,7 +759,7 @@ Auto Patrol: []"}, var/obj/item/weapon/ed209_assembly/Sa = new /obj/item/weapon/ed209_assembly(Tsec) Sa.build_step = 1 - Sa.overlays += image('aibots.dmi', "hs_hole") + Sa.overlays += image('icons/obj/aibots.dmi', "hs_hole") Sa.created_name = src.name new /obj/item/device/assembly/prox_sensor(Tsec) @@ -739,7 +774,19 @@ Auto Patrol: []"}, G.power_supply.charge = 0 if (prob(50)) - new /obj/item/robot_parts/l_arm(Tsec) + new /obj/item/robot_parts/l_leg(Tsec) + if (prob(25)) + new /obj/item/robot_parts/r_leg(Tsec) + if (prob(25))//50% chance for a helmet OR vest + if (prob(50)) + new /obj/item/clothing/head/helmet(Tsec) + else + if(!lasercolor) + new /obj/item/clothing/suit/armor/vest(Tsec) + if(lasercolor == "b") + new /obj/item/clothing/suit/bluetag(Tsec) + if(lasercolor == "r") + new /obj/item/clothing/suit/redtag(Tsec) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(3, 1, src) @@ -753,35 +800,44 @@ Auto Patrol: []"}, if(lastfired && world.time - lastfired < shot_delay) return lastfired = world.time - var/turf/T = get_turf(src) - var/turf/U = (istype(target, /atom/movable) ? get_turf(target) : target) - if ( !istype(T) || !istype(U) ) + var/turf/T = loc + var/atom/U = (istype(target, /atom/movable) ? target.loc : target) + if ((!( U ) || !( T ))) + return + while(!( istype(U, /turf) )) + U = U.loc + if (!( istype(T, /turf) )) return //if(lastfired && world.time - lastfired < 100) // playsound(src.loc, 'ed209_shoot.ogg', 50, 0) - var/obj/item/projectile/A - if(!lasercolor) - if (emagged) - A = new /obj/item/projectile/beam( T ) - else - A = new /obj/item/projectile/energy/electrode( T ) - else if(lasercolor == "b") - if (emagged) - A = new /obj/item/projectile/energy/electrode( T ) - else - A = new /obj/item/projectile/bluetag( T ) - else if(lasercolor == "r") - if (emagged) - A = new /obj/item/projectile/energy/electrode( T ) - else - A = new /obj/item/projectile/redtag( T ) + if(!projectile) + if(!lasercolor) + if (src.emagged) + projectile = /obj/item/projectile/beam + else + projectile = /obj/item/projectile/energy/electrode + else if(lasercolor == "b") + if (src.emagged) + projectile = /obj/item/projectile/omnitag + else + projectile = /obj/item/projectile/bluetag + else if(lasercolor == "r") + if (src.emagged) + projectile = /obj/item/projectile/omnitag + else + projectile = /obj/item/projectile/redtag + + if (!( istype(U, /turf) )) + return + var/obj/item/projectile/A = new projectile (loc) A.current = U A.yo = U.y - T.y A.xo = U.x - T.x spawn( 0 ) - A.fired() + A.process() + return return /obj/machinery/bot/ed209/attack_alien(var/mob/living/carbon/alien/user as mob) @@ -798,7 +854,7 @@ Auto Patrol: []"}, ..(severity-1) else var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc ) - pulse2.icon = 'effects.dmi' + pulse2.icon = 'icons/effects/effects.dmi' pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 @@ -832,132 +888,154 @@ Auto Patrol: []"}, /obj/item/weapon/ed209_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() - if(((istype(W, /obj/item/robot_parts/l_leg)) || (istype(W, /obj/item/robot_parts/r_leg))) && (src.build_step == 0 || src.build_step == 1)) - src.build_step++ - user << "You add the robot leg to [src]!" - src.name = "legs/frame assembly" - if (src.build_step == 1) - src.item_state = "ed209_leg" - src.icon_state = "ed209_leg" - if (src.build_step == 2) - src.item_state = "ed209_legs" - src.icon_state = "ed209_legs" - del(W) - - else if(istype(W, /obj/item/clothing/suit/armor/vest) && (src.build_step == 2)) - src.build_step++ - user << "You add the armor to [src]!" - src.name = "vest/legs/frame assembly" - src.item_state = "ed209_shell" - src.icon_state = "ed209_shell" - del(W) - else if(istype(W, /obj/item/clothing/suit/bluetag) && (src.build_step == 2)) - src.build_step++ - user << "You add the armor to [src]!" - src.name = "vest/legs/frame assembly" - lasercolor = "b" - src.item_state = "[lasercolor]ed209_shell" - src.icon_state = "[lasercolor]ed209_shell" - del(W) - else if(istype(W, /obj/item/clothing/suit/redtag) && (src.build_step == 2)) - src.build_step++ - user << "You add the armor to [src]!" - src.name = "vest/legs/frame assembly" - lasercolor = "r" - src.item_state = "[lasercolor]ed209_shell" - src.icon_state = "[lasercolor]ed209_shell" - del(W) - else if(istype(W, /obj/item/weapon/weldingtool) && src.build_step == 3) - var/obj/item/weapon/weldingtool/WT = W - if(WT.remove_fuel(0,user)) - src.build_step++ - src.name = "shielded frame assembly" - user << "You welded the vest to [src]!" - else if(istype(W, /obj/item/clothing/head/helmet) && (src.build_step == 4)) - src.build_step++ - user << "You add the helmet to [src]!" - src.name = "covered and shielded frame assembly" - src.item_state = "[lasercolor]ed209_hat" - src.icon_state = "[lasercolor]ed209_hat" - del(W) - else if(isprox(W) && (src.build_step == 5)) - src.build_step++ - user << "You add the prox sensor to [src]!" - src.name = "prox/covered and armed the frame assembly" - src.item_state = "[lasercolor]ed209_prox" - src.icon_state = "[lasercolor]ed209_prox" - del(W) - else if(istype(W, /obj/item/weapon/cable_coil) && (src.build_step == 6) ) - var/obj/item/weapon/cable_coil/coil = W - var/turf/T = get_turf(user) - user.visible_message("[user] wires the ED-209 assembly.", "You start to wire the ED-209 assembly.") - sleep(40) - if(get_turf(user) == T) - coil.use(1) - src.build_step++ - user << "\blue You wire the ED-209 assembly!" - src.name = "Wired ED-209 Assembly" - else if(istype(W, /obj/item/weapon/gun/energy/taser) && (src.build_step == 7) && (!lasercolor)) - src.build_step++ - user << "You add the taser gun to [src]!" - src.name = "Taser/Wired ED-209 Assembly" - src.item_state = "[lasercolor]ed209_taser" - src.icon_state = "[lasercolor]ed209_taser" - del(W) - else if(istype(W, /obj/item/weapon/gun/energy/laser/bluetag) && (src.build_step == 7) && (lasercolor == "b")) - src.build_step++ - user << "You add the lasertag gun to [src]!" - src.name = "Bluetag ED-209 Assembly" - src.item_state = "[lasercolor]ed209_taser" - src.icon_state = "[lasercolor]ed209_taser" - del(W) - else if(istype(W, /obj/item/weapon/gun/energy/laser/redtag) && (src.build_step == 7) && (lasercolor == "r")) - src.build_step++ - user << "You add the lasertag gun to [src]!" - src.name = "Redtag ED-209 Assembly" - src.item_state = "[lasercolor]ed209_taser" - src.icon_state = "[lasercolor]ed209_taser" - del(W) - else if(istype(W, /obj/item/weapon/screwdriver) && (src.build_step == 8) ) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) - var/turf/T = get_turf(user) - user << "\blue Now attaching the gun to the frame." - sleep(40) - if(get_turf(user) == T) - src.build_step++ - src.name = "Armed ED-209 Assembly" - user << "\blue Taser gun attached!" - else if((istype(W, /obj/item/weapon/cell)) && (src.build_step >= 9)) - src.build_step++ - user << "You complete the ED-209!" - var/obj/machinery/bot/ed209/S = new /obj/machinery/bot/ed209 - S.loc = get_turf(src) - S.name = src.created_name - S.lasercolor = src.lasercolor - S.New() - del(W) - del(src) - - else if(istype(W, /obj/item/weapon/pen)) + if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) - if (!t) - return - if (!in_range(src, usr) && src.loc != usr) - return + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + if(!t) return + if(!in_range(src, usr) && src.loc != usr) return + created_name = t + return + + switch(build_step) + if(0,1) + if( istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg) ) + user.drop_item() + del(W) + build_step++ + user << "You add the robot leg to [src]." + name = "legs/frame assembly" + if(build_step == 1) + item_state = "ed209_leg" + icon_state = "ed209_leg" + else + item_state = "ed209_legs" + icon_state = "ed209_legs" + + if(2) + if( istype(W, /obj/item/clothing/suit/redtag) ) + lasercolor = "r" + else if( istype(W, /obj/item/clothing/suit/bluetag) ) + lasercolor = "b" + if( lasercolor || istype(W, /obj/item/clothing/suit/armor/vest) ) + user.drop_item() + del(W) + build_step++ + user << "You add the armor to [src]." + name = "vest/legs/frame assembly" + item_state = "[lasercolor]ed209_shell" + icon_state = "[lasercolor]ed209_shell" + + if(3) + if( istype(W, /obj/item/weapon/weldingtool) ) + var/obj/item/weapon/weldingtool/WT = W + if(WT.remove_fuel(0,user)) + build_step++ + name = "shielded frame assembly" + user << "You welded the vest to [src]." + if(4) + if( istype(W, /obj/item/clothing/head/helmet) ) + user.drop_item() + del(W) + build_step++ + user << "You add the helmet to [src]." + name = "covered and shielded frame assembly" + item_state = "[lasercolor]ed209_hat" + icon_state = "[lasercolor]ed209_hat" + + if(5) + if( isprox(W) ) + user.drop_item() + del(W) + build_step++ + user << "You add the prox sensor to [src]." + name = "covered, shielded and sensored frame assembly" + item_state = "[lasercolor]ed209_prox" + icon_state = "[lasercolor]ed209_prox" + + if(6) + if( istype(W, /obj/item/weapon/cable_coil) ) + var/obj/item/weapon/cable_coil/coil = W + var/turf/T = get_turf(user) + user << "You start to wire [src]..." + sleep(40) + if(get_turf(user) == T) + coil.use(1) + build_step++ + user << "You wire the ED-209 assembly." + name = "wired ED-209 assembly" + + if(7) + switch(lasercolor) + if("b") + if( !istype(W, /obj/item/weapon/gun/energy/laser/bluetag) ) + return + name = "bluetag ED-209 assembly" + if("r") + if( !istype(W, /obj/item/weapon/gun/energy/laser/redtag) ) + return + name = "redtag ED-209 assembly" + if("") + if( !istype(W, /obj/item/weapon/gun/energy/taser) ) + return + name = "taser ED-209 assembly" + else + return + build_step++ + user << "You add [W] to [src]." + src.item_state = "[lasercolor]ed209_taser" + src.icon_state = "[lasercolor]ed209_taser" + user.drop_item() + del(W) + + if(8) + if( istype(W, /obj/item/weapon/screwdriver) ) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) + var/turf/T = get_turf(user) + user << "Now attaching the gun to the frame..." + sleep(40) + if(get_turf(user) == T) + build_step++ + name = "armed [name]" + user << "Taser gun attached." + + if(9) + if( istype(W, /obj/item/weapon/cell) ) + build_step++ + user << "You complete the ED-209." + var/turf/T = get_turf(src) + new /obj/machinery/bot/ed209(T,created_name,lasercolor) + user.drop_item() + del(W) + user.drop_from_inventory(src) + del(src) - src.created_name = t /obj/machinery/bot/ed209/bullet_act(var/obj/item/projectile/Proj) if((src.lasercolor == "b") && (src.disabled == 0)) if(istype(Proj, /obj/item/projectile/redtag)) src.disabled = 1 + del (Proj) sleep(100) src.disabled = 0 - if((src.lasercolor == "r") && (src.disabled == 0)) + else + ..() + else if((src.lasercolor == "r") && (src.disabled == 0)) if(istype(Proj, /obj/item/projectile/bluetag)) src.disabled = 1 + del (Proj) sleep(100) src.disabled = 0 - ..() + else + ..() + else + ..() + +/obj/machinery/bot/ed209/bluetag/New()//If desired, you spawn red and bluetag bots easily + new /obj/machinery/bot/ed209(get_turf(src),null,"b") + del(src) + + +/obj/machinery/bot/ed209/redtag/New() + new /obj/machinery/bot/ed209(get_turf(src),null,"r") + del(src) \ No newline at end of file diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index 9891fb2c80..31e565eaed 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -2,7 +2,7 @@ /obj/item/weapon/toolbox_tiles desc = "It's a toolbox with tiles sticking out the top" name = "tiles and toolbox" - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "toolbox_tiles" force = 3.0 throwforce = 10.0 @@ -15,7 +15,7 @@ /obj/item/weapon/toolbox_tiles_sensor desc = "It's a toolbox with tiles sticking out the top and a sensor attached" name = "tiles, toolbox and sensor arrangement" - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "toolbox_tiles_sensor" force = 3.0 throwforce = 10.0 @@ -29,7 +29,7 @@ /obj/machinery/bot/floorbot name = "Floorbot" desc = "A little floor repairing robot, he looks so excited!" - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "floorbot0" layer = 5.0 density = 0 @@ -46,7 +46,7 @@ var/turf/target var/turf/oldtarget var/oldloc = null - req_access = list(ACCESS_ATMOSPHERICS) + req_access = list(access_atmospherics) var/path[] = new() var/targetdirection @@ -106,14 +106,14 @@ var/loaded = min(50-src.amount, T.amount) T.use(loaded) src.amount += loaded - user << "\red You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles!" + user << "You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles." src.updateicon() else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if(src.allowed(usr)) src.locked = !src.locked - user << "You [src.locked ? "lock" : "unlock"] the [src] behaviour controls." + user << "You [src.locked ? "lock" : "unlock"] the [src] behaviour controls." else - user << "The [src] doesn't seem to accept your authority." + user << "The [src] doesn't seem to respect your authority." src.updateUsrDialog() else ..() @@ -163,30 +163,28 @@ if(src.repairing) return var/list/floorbottargets = list() - if(!src.target) - for(var/obj/machinery/bot/floorbot/bot in world) - if(bot != src) - floorbottargets += bot.target - if(src.amount <= 0 && !src.target) + if(src.amount <= 0 && ((src.target == null) || !src.target)) if(src.eattiles) for(var/obj/item/stack/tile/plasteel/T in view(7, src)) if(T != src.oldtarget && !(target in floorbottargets)) src.oldtarget = T src.target = T break - if(!src.target && src.maketiles) - for(var/obj/item/stack/sheet/metal/M in view(7, src)) - if(!(M in floorbottargets) && M != src.oldtarget && M.amount == 1 && !(istype(M.loc, /turf/simulated/wall))) - src.oldtarget = M - src.target = M - break + if(src.target == null || !src.target) + if(src.maketiles) + if(src.target == null || !src.target) + for(var/obj/item/stack/sheet/metal/M in view(7, src)) + if(!(M in floorbottargets) && M != src.oldtarget && M.amount == 1 && !(istype(M.loc, /turf/simulated/wall))) + src.oldtarget = M + src.target = M + break else return if(prob(5)) for(var/mob/O in viewers(src, null)) O.show_message(text("[src] makes an excited booping beeping sound!"), 1) - if(!src.target == null) + if(!src.target || src.target == null) if(targetdirection != null) /* for (var/turf/space/D in view(7,src)) @@ -200,31 +198,31 @@ if(istype(T, /turf/space)) src.oldtarget = T src.target = T - if(!src.target) + if(!src.target || src.target == null) for (var/turf/space/D in view(7,src)) - if(!(D in floorbottargets) && D != src.oldtarget && (D.loc.name != "Space") && !istype(D.loc, /area/shuttle)) + if(!(D in floorbottargets) && D != src.oldtarget && (D.loc.name != "Space")) src.oldtarget = D src.target = D break - if(!src.target && src.improvefloors) + if((!src.target || src.target == null ) && src.improvefloors) for (var/turf/simulated/floor/F in view(7,src)) if(!(F in floorbottargets) && F != src.oldtarget && F.icon_state == "Floor1" && !(istype(F, /turf/simulated/floor/plating))) src.oldtarget = F src.target = F break - if(!src.target && src.eattiles) + if((!src.target || src.target == null) && src.eattiles) for(var/obj/item/stack/tile/plasteel/T in view(7, src)) if(!(T in floorbottargets) && T != src.oldtarget) src.oldtarget = T src.target = T break - if(!src.target) + if(!src.target || src.target == null) if(src.loc != src.oldloc) src.oldtarget = null return - if(src.target && src.path.len == 0) + if(src.target && (src.target != null) && src.path.len == 0) spawn(0) if(!istype(src.target, /turf/)) src.path = AStar(src.loc, src.target.loc, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30) @@ -235,7 +233,7 @@ src.oldtarget = src.target src.target = null return - if(src.path.len > 0 && src.target) + if(src.path.len > 0 && src.target && (src.target != null)) step_to(src, src.path[1]) src.path -= src.path[1] else if(src.path.len == 1) @@ -365,42 +363,31 @@ ..() return if(src.contents.len >= 1) - user << "They wont fit in as there is already stuff inside!" + user << "They wont fit in as there is already stuff inside." return - if (user.s_active) + if(user.s_active) user.s_active.close(user) - var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles - B.loc = user - if (user.r_hand == T) - user.u_equip(T) - user.r_hand = B - else - user.u_equip(T) - user.l_hand = B - B.layer = 20 - user << "You add the tiles into the empty toolbox. They stick oddly out the top." del(T) + var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles + user.put_in_hands(B) + user << "You add the tiles into the empty toolbox. They protrude from the top." + user.drop_from_inventory(src) del(src) /obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob) ..() if(isprox(W)) - var/obj/item/weapon/toolbox_tiles_sensor/B = new /obj/item/weapon/toolbox_tiles_sensor - B.loc = user - if (user.r_hand == W) - user.u_equip(W) - user.r_hand = B - else - user.u_equip(W) - user.l_hand = B - B.created_name = src.created_name - B.layer = 20 - user << "You add the sensor to the toolbox and tiles!" del(W) + var/obj/item/weapon/toolbox_tiles_sensor/B = new /obj/item/weapon/toolbox_tiles_sensor() + B.created_name = src.created_name + user.put_in_hands(B) + user << "You add the sensor to the toolbox and tiles!" + user.drop_from_inventory(src) del(src) + else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) @@ -411,18 +398,16 @@ /obj/item/weapon/toolbox_tiles_sensor/attackby(var/obj/item/W, mob/user as mob) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) - var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot - if(user.r_hand == src || user.l_hand == src) - A.loc = user.loc - else - A.loc = src.loc - A.name = src.created_name - user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!" del(W) + var/turf/T = get_turf(user.loc) + var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot(T) + A.name = src.created_name + user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!" + user.drop_from_inventory(src) del(src) else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 7e0b91df8b..a232ecd1a0 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -6,19 +6,19 @@ /obj/machinery/bot/medbot name = "Medibot" desc = "A little medical robot. He looks somewhat underwhelmed." - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "medibot0" layer = 5.0 - density = 1 + density = 0 anchored = 0 health = 20 maxhealth = 20 - req_access =list(ACCESS_MEDICAL) + req_access =list(access_medical) var/stunned = 0 //It can be stunned by tasers. Delicate circuits. var/locked = 1 //var/emagged = 0 var/obj/machinery/camera/cam = null - var/list/botcard_access = list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_GENETICS, ACCESS_ROBOTICS) + var/list/botcard_access = list(access_medical, access_morgue, access_genetics, access_robotics) var/obj/item/weapon/reagent_containers/glass/reagent_glass = null //Can be set to draw from this for reagents. var/skin = null //Set to "tox", "ointment" or "o2" for the other two firstaid kits. var/frustration = 0 @@ -29,29 +29,27 @@ var/last_found = 0 var/last_newpatient_speak = 0 //Don't spam the "HEY I'M COMING" messages var/currently_healing = 0 - var/injection_amount = 5 //How much reagent do we inject at a time? + var/injection_amount = 15 //How much reagent do we inject at a time? var/heal_threshold = 15 //Start healing when they have this much damage in a category - var/use_beaker = 1 //Use reagents in beaker instead of default treatment agents. + var/use_beaker = 0 //Use reagents in beaker instead of default treatment agents. //Setting which reagents to use to treat what by default. By id. var/treatment_brute = "bicaridine" var/treatment_oxy = "dexalin" var/treatment_fire = "kelotane" var/treatment_tox = "anti_toxin" var/treatment_virus = "spaceacillin" - var/reagent_id = "inaprovaline" var/shut_up = 0 //self explanatory :) - var/always_inject = 0 /obj/machinery/bot/medbot/mysterious name = "Mysterious Medibot" desc = "International Medibot of mystery." skin = "bezerk" - reagent_id = "dexalinp" + treatment_oxy = "dexalinp" /obj/item/weapon/firstaid_arm_assembly name = "first aid/robot arm assembly" desc = "A first aid kit with a robot arm permanently grafted to it." - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "firstaid_arm" var/build_step = 0 var/created_name = "Medibot" //To preserve the name if it's a unique medbot I guess @@ -62,7 +60,7 @@ ..() spawn(5) if(src.skin) - src.overlays += image('aibots.dmi', "kit_skin_[src.skin]") + src.overlays += image('icons/obj/aibots.dmi', "kit_skin_[src.skin]") /obj/machinery/bot/medbot/New() @@ -71,7 +69,7 @@ spawn(4) if(src.skin) - src.overlays += image('aibots.dmi', "medskin_[src.skin]") + src.overlays += image('icons/obj/aibots.dmi', "medskin_[src.skin]") src.botcard = new /obj/item/weapon/card/id(src) if(isnull(src.botcard_access) || (src.botcard_access.len < 1)) @@ -80,7 +78,7 @@ src.botcard.access = src.botcard_access src.cam = new /obj/machinery/camera(src) src.cam.c_tag = src.name - src.cam.network = "Medbay" + src.cam.network = "SS13" /obj/machinery/bot/medbot/turn_on() . = ..() @@ -132,9 +130,6 @@ dat += "Reagent Source: " dat += "[src.use_beaker ? "Loaded Beaker (When available)" : "Internal Synthesizer"]
      " - dat += "Inject: " - dat += "[src.always_inject ? "Always" : "If loaded chemical is known to help"]
      " - dat += "The speaker switch is [src.shut_up ? "off" : "on"]. Toggle" user << browse("Medibot v1.0 controls[dat]", "window=automed") @@ -170,12 +165,13 @@ else if((href_list["use_beaker"]) && (!src.locked)) src.use_beaker = !src.use_beaker - else if((href_list["toggle_inject"]) && (!src.locked)) - src.always_inject = !src.always_inject else if (href_list["eject"] && (!isnull(src.reagent_glass))) - src.reagent_glass.loc = get_turf(src) - src.reagent_glass = null + if(!src.locked) + src.reagent_glass.loc = get_turf(src) + src.reagent_glass = null + else + usr << "You cannot eject the beaker because the panel is locked." else if ((href_list["togglevoice"]) && (!src.locked)) src.shut_up = !src.shut_up @@ -187,20 +183,23 @@ if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if (src.allowed(user)) src.locked = !src.locked - user << "Controls are now [src.locked ? "locked." : "unlocked."]" + user << "Controls are now [src.locked ? "locked." : "unlocked."]" src.updateUsrDialog() else - user << "\red Access denied." + user << "Access denied." else if (istype(W, /obj/item/weapon/reagent_containers/glass)) + if(src.locked) + user << "You cannot insert a beaker because the panel is locked." + return if(!isnull(src.reagent_glass)) - user << "There is already a beaker loaded!" + user << "There is already a beaker loaded." return user.drop_item() W.loc = src src.reagent_glass = W - user << "You insert [W]." + user << "You insert [W]." src.updateUsrDialog() return @@ -211,7 +210,7 @@ /obj/machinery/bot/medbot/Emag(mob/user as mob) ..() - if(user) user << "\red You short out [src]'s reagent synthesis circuits." + if(user) user << "You short out [src]'s reagent synthesis circuits." spawn(0) for(var/mob/O in hearers(src, null)) O.show_message("\red [src] buzzes oddly!", 1) @@ -253,7 +252,7 @@ src.path = new() if(!src.patient) - if(prob(1) && (!src.shut_up)) + if(!src.shut_up && prob(1)) var/message = pick("Radar, put a mask on!","There's always a catch, and it's the best there is.","I knew it, I should've been a plastic surgeon.","What kind of medbay is this? Everyone's dropping like dead flies.","Delicious!") src.speak(message) @@ -264,9 +263,6 @@ if ((C == src.oldpatient) && (world.time < src.last_found + 100)) continue - if(C.getOxyLoss() < 5 && reagent_id == "inaprovaline" && !src.emagged && !src.reagent_glass) - continue - if(src.assess_patient(C)) src.patient = C src.oldpatient = C @@ -296,7 +292,7 @@ if(src.patient && src.path.len == 0 && (get_dist(src,src.patient) > 1)) spawn(0) - src.path = AStar(src.loc, get_turf(src.patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_ortho, 0, 30,id=botcard) + src.path = AStar(src.loc, get_turf(src.patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30,id=botcard) src.path = reverselist(src.path) if(src.path.len == 0) src.oldpatient = src.patient @@ -337,18 +333,25 @@ continue //They're injured enough for it! - if(C.getBruteLoss() >= heal_threshold) + if((C.getBruteLoss() >= heal_threshold) && (!C.reagents.has_reagent(src.treatment_brute))) return 1 //If they're already medicated don't bother! - if(C.getOxyLoss() >= (15 + heal_threshold)) + if((C.getOxyLoss() >= (15 + heal_threshold)) && (!C.reagents.has_reagent(src.treatment_oxy))) return 1 - if(C.getFireLoss() >= heal_threshold) + if((C.getFireLoss() >= heal_threshold) && (!C.reagents.has_reagent(src.treatment_fire))) return 1 - if(C.getToxLoss() >= heal_threshold) + if((C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(src.treatment_tox))) return 1 + + for(var/datum/disease/D in C.viruses) + if((D.stage > 1) || (D.spread_type == AIRBORNE)) + + if (!C.reagents.has_reagent(src.treatment_virus)) + return 1 //STOP DISEASE FOREVER + return 0 /obj/machinery/bot/medbot/proc/medicate_patient(mob/living/carbon/C as mob) @@ -371,30 +374,40 @@ src.last_found = world.time return - //See if we have anything inside the beaker to help. + var/reagent_id = null + + //Use whatever is inside the loaded beaker. If there is one. if((src.use_beaker) && (src.reagent_glass) && (src.reagent_glass.reagents.total_volume)) - if(always_inject) - reagent_id = "internal_beaker" - else if (C.getBruteLoss() >= heal_threshold && reagent_glass.reagents.has_reagent(src.treatment_brute)) - reagent_id = "internal_beaker" - - else if (C.getOxyLoss() >= (15 + heal_threshold) && reagent_glass.reagents.has_reagent(src.treatment_oxy)) - reagent_id = "internal_beaker" - - else if (C.getFireLoss() >= heal_threshold && reagent_glass.reagents.has_reagent(src.treatment_fire)) - reagent_id = "internal_beaker" - - else if (C.getToxLoss() >= heal_threshold && reagent_glass.reagents.has_reagent(src.treatment_tox)) - reagent_id = "internal_beaker" - - else if (100 - C.health >= heal_threshold && reagent_glass.reagents.has_reagent("tricordrazine")) - reagent_id = "internal_beaker" - + reagent_id = "internal_beaker" if(src.emagged) //Emagged! Time to poison everybody. reagent_id = "toxin" - if(C.getOxyLoss() < 10 && reagent_id == "inaprovaline") //If they don't need any of that they're probably cured! + var/virus = 0 + for(var/datum/disease/D in C.viruses) + virus = 1 + + if (!reagent_id && (virus)) + if(!C.reagents.has_reagent(src.treatment_virus)) + reagent_id = src.treatment_virus + + if (!reagent_id && (C.getBruteLoss() >= heal_threshold)) + if(!C.reagents.has_reagent(src.treatment_brute)) + reagent_id = src.treatment_brute + + if (!reagent_id && (C.getOxyLoss() >= (15 + heal_threshold))) + if(!C.reagents.has_reagent(src.treatment_oxy)) + reagent_id = src.treatment_oxy + + if (!reagent_id && (C.getFireLoss() >= heal_threshold)) + if(!C.reagents.has_reagent(src.treatment_fire)) + reagent_id = src.treatment_fire + + if (!reagent_id && (C.getToxLoss() >= heal_threshold)) + if(!C.reagents.has_reagent(src.treatment_tox)) + reagent_id = src.treatment_tox + + if(!reagent_id) //If they don't need any of that they're probably cured! src.oldpatient = src.patient src.patient = null src.currently_healing = 0 @@ -418,9 +431,10 @@ src.icon_state = "medibot[src.on]" src.currently_healing = 0 - reagent_id = "inaprovaline" return +// src.speak(reagent_id) + reagent_id = null return @@ -467,24 +481,23 @@ return /obj/machinery/bot/medbot/Bump(M as mob|obj) //Leave no door unopened! - spawn(0) - if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) - var/obj/machinery/door/D = M - if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) - D.open() - src.frustration = 0 - else if ((istype(M, /mob/living/)) && (!src.anchored)) - src.loc = M:loc + if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) + var/obj/machinery/door/D = M + if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) + D.open() src.frustration = 0 - - return + else if ((istype(M, /mob/living/)) && (!src.anchored)) + src.loc = M:loc + src.frustration = 0 return +/* terrible /obj/machinery/bot/medbot/Bumped(atom/movable/M as mob|obj) spawn(0) if (M) var/turf/T = get_turf(src) M:loc = T +*/ /* * Pathfinding procs, allow the medibot to path through doors it has access to. @@ -528,7 +541,7 @@ //Making a medibot! if(src.contents.len >= 1) - user << "\red You need to empty [src] out first!" + user << "You need to empty [src] out first." return var/obj/item/weapon/firstaid_arm_assembly/A = new /obj/item/weapon/firstaid_arm_assembly @@ -538,47 +551,46 @@ A.skin = "tox" else if(istype(src,/obj/item/weapon/storage/firstaid/o2)) A.skin = "o2" - else if(istype(src,/obj/item/weapon/storage/firstaid/adv)) - A.skin = "adv" - A.loc = user - if (user.r_hand == S) - user.u_equip(S) - user.r_hand = A - else - user.u_equip(S) - user.l_hand = A - A.layer = 20 - user << "You add the robot arm to the first aid kit" del(S) + user.put_in_hands(A) + user << "You add the robot arm to the first aid kit." + user.drop_from_inventory(src) del(src) /obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() - if((istype(W, /obj/item/device/healthanalyzer)) && (!src.build_step)) - src.build_step++ - user << "You add the health sensor to [src]!" - src.name = "First aid/robot arm/health analyzer assembly" - src.overlays += image('aibots.dmi', "na_scanner") - del(W) - - else if((isprox(W)) && (src.build_step == 1)) - src.build_step++ - user << "You complete the Medibot! Beep boop." - var/obj/machinery/bot/medbot/S = new /obj/machinery/bot/medbot - S.skin = src.skin - S.loc = get_turf(src) - S.name = src.created_name - del(W) - del(src) - - else if(istype(W, /obj/item/weapon/pen)) + if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) return - src.created_name = t \ No newline at end of file + src.created_name = t + else + switch(build_step) + if(0) + if(istype(W, /obj/item/device/healthanalyzer)) + user.drop_item() + del(W) + src.build_step++ + user << "You add the health sensor to [src]." + src.name = "First aid/robot arm/health analyzer assembly" + src.overlays += image('icons/obj/aibots.dmi', "na_scanner") + + if(1) + if(isprox(W)) + user.drop_item() + del(W) + src.build_step++ + user << "You complete the Medibot! Beep boop." + var/turf/T = get_turf(src) + var/obj/machinery/bot/medbot/S = new /obj/machinery/bot/medbot(T) + S.skin = src.skin + S.name = src.created_name + user.drop_from_inventory(src) + del(src) + diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index c432acfe3a..9e6af7a13f 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -30,7 +30,7 @@ var/new_destination = "" // pending new destination (waiting for beacon response) var/destination = "" // destination description var/home_destination = "" // tag of home beacon - req_access = list(ACCESS_CARGO, ACCESS_CARGO_BOT) // added robotics access so assembly line drop-off works properly -veyveyr //I don't think so, Tim. You need to add it to the MULE's hidden robot ID card. -NEO + req_access = list(access_cargo, access_cargo_bot) // added robotics access so assembly line drop-off works properly -veyveyr //I don't think so, Tim. You need to add it to the MULE's hidden robot ID card. -NEO var/path[] = new() var/mode = 0 //0 = idle/ready @@ -77,7 +77,7 @@ ..() botcard = new(src) botcard.access = get_access("Quartermaster") - botcard.access += ACCESS_ROBOTICS + botcard.access += access_robotics cell = new(src) cell.charge = 2000 cell.maxcharge = 2000 @@ -124,15 +124,10 @@ // other: chance to knock rider off bot /obj/machinery/bot/mulebot/attackby(var/obj/item/I, var/mob/user) if(istype(I,/obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = I - if(E.uses) - E.uses-- - else - return locked = !locked user << "\blue You [locked ? "lock" : "unlock"] the mulebot's controls!" flick("mulebot-emagged", src) - playsound(src.loc, 'sparks1.ogg', 100, 0) + playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 0) else if(istype(I,/obj/item/weapon/cell) && open && !cell) var/obj/item/weapon/cell/C = I user.drop_item() @@ -325,16 +320,10 @@ if("cellremove") - if(open && cell && !usr.equipped()) - cell.loc = usr - cell.layer = 20 - if(usr.hand) - usr.l_hand = cell - else - usr.r_hand = cell - - cell.add_fingerprint(usr) + if(open && cell && !usr.get_active_hand()) cell.updateicon() + usr.put_in_active_hand(cell) + cell.add_fingerprint(usr) cell = null usr.visible_message("\blue [usr] removes the power cell from [src].", "\blue You remove the power cell from [src].") @@ -342,7 +331,7 @@ if("cellinsert") if(open && !cell) - var/obj/item/weapon/cell/C = usr.equipped() + var/obj/item/weapon/cell/C = usr.get_active_hand() if(istype(C)) usr.drop_item() cell = C @@ -412,20 +401,20 @@ if("wirecut") - if(istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if(istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) var/wirebit = text2num(href_list["wire"]) wires &= ~wirebit else usr << "\blue You need wirecutters!" if("wiremend") - if(istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if(istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) var/wirebit = text2num(href_list["wire"]) wires |= wirebit else usr << "\blue You need wirecutters!" if("wirepulse") - if(istype(usr.equipped(), /obj/item/device/multitool)) + if(istype(usr.get_active_hand(), /obj/item/device/multitool)) switch(href_list["wire"]) if("1","2") usr << "\blue \icon[src] The charge light flickers." @@ -476,11 +465,21 @@ /obj/machinery/bot/mulebot/proc/load(var/atom/movable/C) if((wires & wire_loadcheck) && !istype(C,/obj/structure/closet/crate)) src.visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") - playsound(src.loc, 'buzz-sigh.ogg', 50, 0) + playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) return // if not emagged, only allow crates to be loaded + //I'm sure someone will come along and ask why this is here... well people were dragging screen items onto the mule, and that was not cool. + //So this is a simple fix that only allows a selection of item types to be considered. Further narrowing-down is below. + if(!istype(C,/obj/item) && !istype(C,/obj/machinery) && !istype(C,/obj/structure) && !ismob(C)) + return + if(!isturf(C.loc)) //To prevent the loading from stuff from someone's inventory, which wouldn't get handled properly. + return + if(get_dist(C, src) > 1 || load || !on) return + for(var/obj/structure/plasticflaps/P in src.loc)//Takes flaps into account + if(!CanPass(C,P)) + return mode = 1 // if a create, close before loading @@ -490,6 +489,8 @@ C.loc = src.loc sleep(2) + if(C.loc != src.loc) //To prevent you from going onto more thano ne bot. + return C.loc = src load = C @@ -528,7 +529,12 @@ if(dirn) - step(load, dirn) + var/turf/T = src.loc + T = get_step(T,dirn) + if(CanPass(load,T))//Can't get off onto anything that wouldn't let you pass normally + step(load, dirn) + else + load.loc = src.loc//Drops you right there, so you shouldn't be able to get yourself stuck load = null @@ -649,25 +655,25 @@ mode = 4 if(blockcount == 3) src.visible_message("[src] makes an annoyed buzzing sound", "You hear an electronic buzzing sound.") - playsound(src.loc, 'buzz-two.ogg', 50, 0) + playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0) if(blockcount > 5) // attempt 5 times before recomputing // find new path excluding blocked turf src.visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") - playsound(src.loc, 'buzz-sigh.ogg', 50, 0) + playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) spawn(2) calc_path(next) if(path.len > 0) src.visible_message("[src] makes a delighted ping!", "You hear a ping.") - playsound(src.loc, 'ping.ogg', 50, 0) + playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) mode = 4 mode =6 return return else src.visible_message("[src] makes an annoyed buzzing sound", "You hear an electronic buzzing sound.") - playsound(src.loc, 'buzz-two.ogg', 50, 0) + playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0) //world << "Bad turf." mode = 5 return @@ -687,11 +693,11 @@ blockcount = 0 mode = 4 src.visible_message("[src] makes a delighted ping!", "You hear a ping.") - playsound(src.loc, 'ping.ogg', 50, 0) + playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) else src.visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") - playsound(src.loc, 'buzz-sigh.ogg', 50, 0) + playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) mode = 7 //if(6) @@ -704,7 +710,7 @@ // calculates a path to the current destination // given an optional turf to avoid /obj/machinery/bot/mulebot/proc/calc_path(var/turf/avoid = null) - src.path = AStar(src.loc, src.target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_ortho, 0, 250, id=botcard, exclude=avoid) + src.path = AStar(src.loc, src.target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 250, id=botcard, exclude=avoid) src.path = reverselist(src.path) @@ -737,7 +743,7 @@ /obj/machinery/bot/mulebot/proc/at_target() if(!reached_target) src.visible_message("[src] makes a chiming sound!", "You hear a chime.") - playsound(src.loc, 'chime.ogg', 50, 0) + playsound(src.loc, 'sound/machines/chime.ogg', 50, 0) reached_target = 1 if(load) // if loaded, unload at target @@ -777,7 +783,7 @@ src.visible_message("\red [src] bumps into [M]!") else src.visible_message("\red [src] knocks over [M]!") - M.pulling = null + M.stop_pulling() M.Stun(8) M.Weaken(5) M.lying = 1 @@ -791,7 +797,7 @@ // when mulebot is in the same loc /obj/machinery/bot/mulebot/proc/RunOver(var/mob/living/carbon/human/H) src.visible_message("\red [src] drives over [H]!") - playsound(src.loc, 'splat.ogg', 50, 1) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) var/damage = rand(5,15) H.apply_damage(2*damage, BRUTE, "head") diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index dada537f2a..30ddfef920 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -1,17 +1,17 @@ /obj/machinery/bot/secbot name = "Securitron" desc = "A little security robot. He looks less than thrilled." - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "secbot0" layer = 5.0 - density = 1 + density = 0 anchored = 0 health = 25 maxhealth = 25 fire_dam_coeff = 0.7 brute_dam_coeff = 0.5 // weight = 1.0E7 - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) var/locked = 1 //Behavior Controls lock var/mob/living/carbon/target var/oldtarget_name @@ -63,7 +63,7 @@ /obj/item/weapon/secbot_assembly name = "helmet/signaler assembly" desc = "Some sort of bizarre assembly." - icon = 'aibots.dmi' + icon = 'icons/obj/aibots.dmi' icon_state = "helmet_signaler" item_state = "helmet" var/build_step = 0 @@ -80,7 +80,7 @@ src.botcard.access = get_access("Detective") src.cam = new /obj/machinery/camera(src) src.cam.c_tag = src.name - src.cam.network = "Security" + src.cam.network = "SS13" if(radio_controller) radio_controller.add_object(src, control_freq, filter = RADIO_SECBOT) radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS) @@ -216,7 +216,7 @@ Auto Patrol: []"}, if(target) // make sure target exists if(get_dist(src, src.target) <= 1) // if right next to perp - playsound(src.loc, 'Egloves.ogg', 50, 1, -1) + playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) src.icon_state = "secbot-c" spawn(2) src.icon_state = "secbot[src.on]" @@ -259,7 +259,7 @@ Auto Patrol: []"}, return if(!src.target.handcuffed && !src.arrest_type) - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) mode = SECBOT_ARREST for(var/mob/O in viewers(src, null)) O.show_message("\red [src] is trying to put handcuffs on [src.target]!", 1) @@ -270,7 +270,8 @@ Auto Patrol: []"}, return if(istype(src.target,/mob/living/carbon)) - src.target.handcuffed = new /obj/item/weapon/handcuffs(src.target) + target.handcuffed = new /obj/item/weapon/handcuffs(target) + target.update_inv_handcuffed() //update the handcuffs overlay mode = SECBOT_IDLE src.target = null @@ -278,7 +279,7 @@ Auto Patrol: []"}, src.last_found = world.time src.frustration = 0 - playsound(src.loc, pick('bgod.ogg', 'biamthelaw.ogg', 'bsecureday.ogg', 'bradio.ogg', 'binsult.ogg', 'bcreep.ogg'), 50, 0) + playsound(src.loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.") // src.speak(arrest_message) @@ -543,7 +544,7 @@ Auto Patrol: []"}, // calculates a path to the current destination // given an optional turf to avoid /obj/machinery/bot/secbot/proc/calc_path(var/turf/avoid = null) - src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_ortho, 0, 120, id=botcard, exclude=avoid) + src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid) src.path = reverselist(src.path) @@ -570,7 +571,7 @@ Auto Patrol: []"}, src.target = C src.oldtarget_name = C.name src.speak("Level [src.threatlevel] infraction alert!") - playsound(src.loc, pick('bcriminal.ogg', 'bjustice.ogg', 'bfreeze.ogg'), 50, 0) + playsound(src.loc, pick('sound/voice/bcriminal.ogg', 'sound/voice/bjustice.ogg', 'sound/voice/bfreeze.ogg'), 50, 0) src.visible_message("[src] points at [C.name]!") mode = SECBOT_HUNT spawn(0) @@ -610,7 +611,7 @@ Auto Patrol: []"}, if(istype(perp:wear_suit, /obj/item/clothing/suit/wizrobe)) threatcount += 2 - if(perp.mutantrace && perp.mutantrace != "none") + if(perp.dna && perp.dna.mutantrace && perp.dna.mutantrace != "none") threatcount += 2 //Agent cards lower threatlevel. @@ -639,24 +640,23 @@ Auto Patrol: []"}, return threatcount /obj/machinery/bot/secbot/Bump(M as mob|obj) //Leave no door unopened! - spawn(0) - if((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) - var/obj/machinery/door/D = M - if(!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) - D.open() - src.frustration = 0 - else if((istype(M, /mob/living/)) && (!src.anchored)) - src.loc = M:loc + if((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) + var/obj/machinery/door/D = M + if(!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) + D.open() src.frustration = 0 - - return + else if((istype(M, /mob/living/)) && (!src.anchored)) + src.loc = M:loc + src.frustration = 0 return +/* terrible /obj/machinery/bot/secbot/Bumped(atom/movable/M as mob|obj) spawn(0) if(M) var/turf/T = get_turf(src) M:loc = T +*/ /obj/machinery/bot/secbot/proc/speak(var/message) for(var/mob/O in hearers(src, null)) @@ -672,7 +672,7 @@ Auto Patrol: []"}, var/obj/item/weapon/secbot_assembly/Sa = new /obj/item/weapon/secbot_assembly(Tsec) Sa.build_step = 1 - Sa.overlays += image('aibots.dmi', "hs_hole") + Sa.overlays += image('icons/obj/aibots.dmi', "hs_hole") Sa.created_name = src.name new /obj/item/device/assembly/prox_sensor(Tsec) @@ -711,22 +711,15 @@ Auto Patrol: []"}, if(src.type != /obj/item/clothing/head/helmet) //Eh, but we don't want people making secbots out of space helmets. return - if(!S.secured) - return - else - var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly - A.loc = user - if(user.r_hand == S) - user.u_equip(S) - user.r_hand = A - else - user.u_equip(S) - user.l_hand = A - A.layer = 20 - user << "You add the signaler to the helmet." + if(S.secured) del(S) + var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly + user.put_in_hands(A) + user << "You add the signaler to the helmet." + user.drop_from_inventory(src) del(src) - + else + return /obj/item/weapon/secbot_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() @@ -734,24 +727,27 @@ Auto Patrol: []"}, var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0,user)) src.build_step++ - src.overlays += image('aibots.dmi', "hs_hole") + src.overlays += image('icons/obj/aibots.dmi', "hs_hole") user << "You weld a hole in [src]!" else if(isprox(W) && (src.build_step == 1)) + user.drop_item() src.build_step++ user << "You add the prox sensor to [src]!" - src.overlays += image('aibots.dmi', "hs_eye") + src.overlays += image('icons/obj/aibots.dmi', "hs_eye") src.name = "helmet/signaler/prox sensor assembly" del(W) else if(((istype(W, /obj/item/robot_parts/l_arm)) || (istype(W, /obj/item/robot_parts/r_arm))) && (src.build_step == 2)) + user.drop_item() src.build_step++ user << "You add the robot arm to [src]!" src.name = "helmet/signaler/prox sensor/robot arm assembly" - src.overlays += image('aibots.dmi', "hs_arm") + src.overlays += image('icons/obj/aibots.dmi', "hs_arm") del(W) else if((istype(W, /obj/item/weapon/melee/baton)) && (src.build_step >= 3)) + user.drop_item() src.build_step++ user << "You complete the Securitron! Beep boop." var/obj/machinery/bot/secbot/S = new /obj/machinery/bot/secbot @@ -762,7 +758,7 @@ Auto Patrol: []"}, else if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if(!t) return if(!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/camera.dm b/code/game/machinery/camera.dm index 4837a92833..ff86e2ae3c 100644 --- a/code/game/machinery/camera.dm +++ b/code/game/machinery/camera.dm @@ -1,3 +1,13 @@ +var/global/list/obj/machinery/camera/Cameras = list() + +/obj/machinery/camera/New() + Cameras += src + ..() + +/obj/machinery/camera/Del() + Cameras -= src + ..() + // Double clicking turfs to move to nearest camera @@ -6,15 +16,13 @@ return ..() if (world.time <= usr:lastDblClick+2) return ..() - if(istype(usr, /mob/living/silicon/ai) && usr.client.eye == usr:eyeobj) - return ..() //try to find the closest working camera in the same area, switch to it var/area/A = get_area(src) var/best_dist = INFINITY //infinity var/best_cam = null for(var/obj/machinery/camera/C in A) - if( !(C.network in usr:networks)) continue + if(usr:network != C.network) continue if(!C.status) continue // ignore disabled cameras var/dist = get_dist(src, C) if(dist < best_dist) @@ -45,33 +53,28 @@ var/list/names = list() var/list/namecounts = list() - var/list/creatures = list() - for (var/mob/M in world) - if (istype(M, /mob/new_player)) - continue //cameras can't follow people who haven't started yet DUH OR DIDN'T YOU KNOW THAT + var/list/humans = list() + var/list/others = list() + for(var/mob/living/M in mob_list) //Cameras can't track people wearing an agent card or a ninja hood. - if (istype(M, /mob/living/carbon/human)) + var/human = 0 + if(istype(M, /mob/living/carbon/human)) + human = 1 if(istype(M:wear_id, /obj/item/weapon/card/id/syndicate)) continue if(istype(M:head, /obj/item/clothing/head/helmet/space/space_ninja)&&!M:head:canremove) continue if(!istype(M.loc, /turf)) //in a closet or something, AI can't see him anyways continue - var/area/wizard_station/A = locate()//So that wizards are not tracked by the AI until they leave their sanctuary. Unless they talk on radio/N - if(M in A.contents) + if(istype(M.loc.loc, /area/wizard_station)) continue if(M.invisibility)//cloaked continue - if(istype(M.loc,/obj/effect/dummy)) - continue - else if (M == usr) + if(M == usr) continue if(M.digitalcamo) continue - var/turf/temp_turf = get_turf(M) - if(temp_turf.z != 1 && temp_turf.z != 5) //Not on mining or the station. - continue - if(!checkcameravis(M)) //Not near a camera + if(M.loc.z == 2) // Don't detect mobs on Centcom continue var/name = M.name @@ -81,85 +84,76 @@ else names.Add(name) namecounts[name] = 1 + if(human) + humans[name] = M + else + others[name] = M - creatures[name] = M - - var/target_name = input(usr, "Which creature should you track?") as null|anything in creatures + var/list/targets = sortList(humans) + sortList(others) + var/target_name = input(usr, "Which creature should you track?") as null|anything in targets if (!target_name) usr:cameraFollow = null return - var/mob/target = creatures[target_name] - + var/mob/target = (isnull(humans[target_name]) ? others[target_name] : humans[target_name]) ai_actual_track(target) -/mob/living/silicon/ai/proc/ai_actual_track(mob/target as mob) +/mob/living/silicon/ai/proc/ai_actual_track(mob/living/target as mob) + if(!istype(target)) return + var/mob/living/silicon/ai/U = usr - usr:cameraFollow = target - usr << "Now tracking target on camera." //Unidentifieds are no longer screamed at you. - - if (usr.machine == null && client.eye != eyeobj) - usr.machine = usr + U.cameraFollow = target + U << text("Now tracking [] on camera.", target.name) + if (U.machine == null) + U.machine = U spawn (0) - while (usr:cameraFollow == target) - if (usr:cameraFollow == null) + while (U.cameraFollow == target) + if (U.cameraFollow == null) return - else if (istype(target, /mob/living/carbon/human)) if(istype(target:wear_id, /obj/item/weapon/card/id/syndicate)) - usr << "Follow camera mode terminated." - usr:cameraFollow = null + U << "Follow camera mode terminated." + U.cameraFollow = null return if(istype(target:head, /obj/item/clothing/head/helmet/space/space_ninja)&&!target:head:canremove) - usr << "Follow camera mode terminated." - usr:cameraFollow = null + U << "Follow camera mode terminated." + U.cameraFollow = null return if(target.digitalcamo) - usr << "Follow camera mode terminated." - usr:cameraFollow = null + U << "Follow camera mode terminated." + U.cameraFollow = null return else if(istype(target.loc,/obj/effect/dummy)) - usr << "Follow camera mode ended." - usr:cameraFollow = null + U << "Follow camera mode ended." + U.cameraFollow = null return else if (!target || !istype(target.loc, /turf)) //in a closet - usr << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)." + U << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)." sleep(40) //because we're sleeping another second after this (a few lines down) continue - if(client && client.eye == eyeobj) - if(checkcameravis(target)) - eyeobj.loc = target.loc - sleep(50) - continue - - else - usr << "Target is not on or near any active cameras on the station." - usr:cameraFollow = null - return - - var/obj/machinery/camera/C = usr:current + var/obj/machinery/camera/C = U.current if ((C && istype(C, /obj/machinery/camera)) || C==null) if(isrobot(target)) - C = target:camera - usr:current = C - usr.reset_view(C) + var/mob/living/silicon/robot/R = target + C = R.camera + U.reset_view(C) else var/closestDist = -1 if (C!=null) if (C.status) closestDist = get_dist(C, target) - //usr << text("Dist = [] for camera []", closestDist, C.name) + //U << text("Dist = [] for camera []", closestDist, C.name) var/zmatched = 0 if (closestDist > 7 || closestDist == -1) //check other cameras var/obj/machinery/camera/closest = C - for(var/obj/machinery/camera/C2 in world) - if (C2.network in src.networks) + for(var/obj/machinery/camera/C2 in Cameras) + if (C2.network == src.network) if (C2.z == target.z) zmatched = 1 if (C2.status) @@ -167,45 +161,20 @@ if ((dist < closestDist) || (closestDist == -1)) closestDist = dist closest = C2 - //usr << text("Closest camera dist = [], for camera []", closestDist, closest.area.name) + //U << text("Closest camera dist = [], for camera []", closestDist, closest.area.name) if (closest != C) - usr:current = closest - usr.reset_view(closest) + U.reset_view(closest) //use_power(50) if (zmatched == 0) - usr << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)." + U << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)." sleep(40) //because we're sleeping another second after this (a few lines down) else - usr << "Follow camera mode ended." - usr:cameraFollow = null + U << "Follow camera mode ended." + U.cameraFollow = null sleep(10) -/proc/camera_network_sort(list/L) - var/obj/machinery/camera/a - var/obj/machinery/camera/b - - //loop through once to get in network order - for (var/i = L.len, i > 0, i--) - for (var/j = 1 to i - 1) - a = L[j] - b = L[j + 1] - if (sorttext(a.network, b.network) < 0) - L.Swap(j, j + 1) - - //loop through a second time to get alphabetical order within the network order - for (var/i = L.len, i > 0, i--) - for (var/j = 1 to i - 1) - a = L[j] - b = L[j + 1] - if ( sorttext(a.network, b.network) ) - continue - if ( sorttext(a.c_tag, b.c_tag) < 0 ) - L.Swap(j, j + 1) - - return L - /proc/camera_sort(list/L) var/obj/machinery/camera/a var/obj/machinery/camera/b @@ -222,6 +191,7 @@ L.Swap(j, j + 1) return L + /mob/living/silicon/ai/attack_ai(var/mob/user as mob) if (user != src) return @@ -229,29 +199,33 @@ if (stat == 2) return + // If they cancel then just put them back to their old camera + var/obj/machinery/camera/tempC = src.current user.machine = src + switchCamera(null) var/list/L = list() - for (var/obj/machinery/camera/C in world) + for (var/obj/machinery/camera/C in Cameras) L.Add(C) camera_sort(L) - L = camera_network_sort(L) var/list/D = list() - for (var/obj/machinery/camera/C in L) - if ( C.network in src.networks ) - D[text("[]: [][]", C.network, C.c_tag, (C.status ? null : " (Deactivated)"))] = C D["Cancel"] = "Cancel" + for (var/obj/machinery/camera/C in L) + if (C.network == src.network) + D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C var/t = input(user, "Which camera should you change to?") as null|anything in D if (!t || t == "Cancel") - switchCamera(null) + if(tempC && tempC.status) + switchCamera(tempC) + else + switchCamera(null) return 0 var/obj/machinery/camera/C = D[t] - switchCamera(C) return @@ -263,16 +237,15 @@ spawn(900) network = initial(network) icon_state = initial(icon_state) - for(var/mob/living/silicon/ai/O in world) + for(var/mob/living/silicon/ai/O in mob_list) if (O.current == src) O.cancel_camera() O << "Your connection to the camera has been lost." - for(var/mob/O in world) + for(var/mob/O in mob_list) if (istype(O.machine, /obj/machinery/computer/security)) var/obj/machinery/computer/security/S = O.machine if (S.current == src) O.machine = null - S.current = null O.reset_view(null) O << "The screen bursts into static." ..() @@ -293,38 +266,60 @@ /obj/machinery/camera/attack_ai(var/mob/living/silicon/ai/user as mob) if (!istype(user)) return - if ( !(src.network in user.networks) || !(src.status)) + if (src.network != user.network || !(src.status)) return - user.current = src user.reset_view(src) +/obj/machinery/camera/attack_paw(mob/living/carbon/alien/humanoid/user as mob) + if(!istype(user)) + return + status = 0 + for(var/mob/O in viewers(user, null)) + O.show_message("\The [user] slashes at [src]!", 1) + playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) + icon_state = "camera1" + add_hiddenprint(user) + deactivate(user,0) + /obj/machinery/camera/attackby(W as obj, user as mob) if (istype(W, /obj/item/weapon/wirecutters)) deactivate(user) - ..() - else if (istype(W, /obj/item/weapon/paper)) - var/obj/item/weapon/paper/X = W - user << "You hold a paper up to the camera ..." - for(var/mob/living/silicon/ai/O in world) + else if ((istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/device/pda)) && isliving(user)) + var/mob/living/U = user + var/obj/item/weapon/paper/X = null + var/obj/item/device/pda/P = null + + var/itemname = "" + var/info = "" + if(istype(W, /obj/item/weapon/paper)) + X = W + itemname = X.name + info = X.info + else + P = W + itemname = P.name + info = P.notehtml + U << "You hold \a [itemname] up to the camera ..." + for(var/mob/living/silicon/ai/O in player_list) //if (O.current == src) - O << "[user] holds a paper up to one of your cameras ..." - O << browse(text("[][]", X.name, X.info), text("window=[]", X.name)) - for(var/mob/O in world) + if(U.name == "Unknown") O << "[U] holds \a [itemname] up to one of your cameras ..." + else O << "[U] holds \a [itemname] up to one of your cameras ..." + O << browse(text("[][]", itemname, info), text("window=[]", itemname)) + for(var/mob/O in player_list) if (istype(O.machine, /obj/machinery/computer/security)) var/obj/machinery/computer/security/S = O.machine if (S.current == src) - O << "[user] holds a paper up to one of the cameras ..." - O << browse(text("[][]", X.name, X.info), text("window=[]", X.name)) + O << "[U] holds \a [itemname] up to one of the cameras ..." + O << browse(text("[][]", itemname, info), text("window=[]", itemname)) else if (istype(W, /obj/item/weapon/wrench)) //Adding dismantlable cameras to go with the constructable ones. --NEO if(src.status) user << "\red You can't dismantle a camera while it is active." else - ..() user << "\blue Dismantling camera..." if(do_after(user, 20)) - var/obj/item/weapon/chem_grenade/case = new /obj/item/weapon/chem_grenade(src.loc) + var/obj/item/weapon/grenade/chem_grenade/case = new /obj/item/weapon/grenade/chem_grenade(src.loc) case.name = "Camera Assembly" - case.icon = 'monitors.dmi' + case.icon = 'icons/obj/monitors.dmi' //JESUS WHAT THE FUCK EVERYTHING TO DO WITH CAMERAS IS TERRIBLE FUCK case.icon_state = "cameracase" case.path = 2 @@ -335,29 +330,25 @@ del(src) else if (istype(W, /obj/item/weapon/camera_bug)) if (!src.status) - ..() user << "\blue Camera non-functional" return if (src.bugged) - ..() user << "\blue Camera bug removed." src.bugged = 0 else - ..() user << "\blue Camera bugged." src.bugged = 1 else if(istype(W, /obj/item/weapon/melee/energy/blade))//Putting it here last since it's a special case. I wonder if there is a better way to do these than type casting. - ..() deactivate(user,2)//Here so that you can disconnect anyone viewing the camera, regardless if it's on or off. var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, loc) spark_system.start() - playsound(loc, 'blade1.ogg', 50, 1) + playsound(loc, 'sound/weapons/blade1.ogg', 50, 1) playsound(loc, "sparks", 50, 1) - var/obj/item/weapon/chem_grenade/case = new /obj/item/weapon/chem_grenade(loc) + var/obj/item/weapon/grenade/chem_grenade/case = new /obj/item/weapon/grenade/chem_grenade(loc) case.name = "Camera Assembly" - case.icon = 'monitors.dmi' + case.icon = 'icons/obj/monitors.dmi' case.icon_state = "cameracase" case.path = 2 case.state = 5 @@ -368,6 +359,8 @@ for(var/mob/O in viewers(user, 3)) O.show_message(text("\blue The camera has been sliced apart by [] with an energy blade!", user), 1, text("\red You hear metal being sliced and sparks flying."), 2) del(src) + else + ..() return /obj/machinery/camera/proc/deactivate(user as mob, var/choice = 1) @@ -376,31 +369,48 @@ if (!(src.status)) for(var/mob/O in viewers(user, null)) O.show_message(text("\red [] has deactivated []!", user, src), 1) - playsound(src.loc, 'Wirecutter.ogg', 100, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) icon_state = "camera1" add_hiddenprint(user) else for(var/mob/O in viewers(user, null)) O.show_message(text("\red [] has reactivated []!", user, src), 1) - playsound(src.loc, 'Wirecutter.ogg', 100, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) icon_state = "camera" add_hiddenprint(user) // now disconnect anyone using the camera //Apparently, this will disconnect anyone even if the camera was re-activated. //I guess that doesn't matter since they can't use it anyway? - for(var/mob/living/silicon/ai/O in world) + for(var/mob/living/silicon/ai/O in player_list) if (O.current == src) O.cancel_camera() O << "Your connection to the camera has been lost." - for(var/mob/O in world) + for(var/mob/O in player_list) if (istype(O.machine, /obj/machinery/computer/security)) var/obj/machinery/computer/security/S = O.machine if (S.current == src) O.machine = null - S.current = null O.reset_view(null) O << "The screen bursts into static." +/atom/proc/auto_turn() + //Automatically turns based on nearby walls. + var/turf/simulated/wall/T = null + for(var/i = 1, i <= 8; i += i) + T = get_ranged_target_turf(src, i, 1) + if(!isnull(T) && istype(T)) + //If someone knows a better way to do this, let me know. -Giacom + switch(i) + if(NORTH) + src.dir = SOUTH + if(SOUTH) + src.dir = NORTH + if(WEST) + src.dir = EAST + if(EAST) + src.dir = WEST + break + //Return a working camera that can see a given mob //or null if none /proc/seen_by_camera(var/mob/M) diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index d69651546d..b7f82cc728 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -4,7 +4,7 @@ /obj/machinery/cell_charger name = "cell charger" desc = "It charges power cells." - icon = 'power.dmi' + icon = 'icons/obj/power.dmi' icon_state = "ccharger0" anchored = 1 use_power = 1 @@ -25,7 +25,7 @@ if(chargelevel != newlevel) overlays = null - overlays += image('power.dmi', "ccharger-o[newlevel]") + overlays += image('icons/obj/power.dmi', "ccharger-o[newlevel]") chargelevel = newlevel else @@ -50,7 +50,7 @@ if(!isarea(a)) return if(a.power_equip == 0) // There's no APC in this area, don't try to cheat power! - user << "\red \The [src] blinks red as you try to insert the cell!" + user << "\red The [name] blinks red as you try to insert the cell!" return user.drop_item() @@ -66,11 +66,11 @@ anchored = !anchored user << "You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground" - playsound(src.loc, 'Ratchet.ogg', 75, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) attack_hand(mob/user) if(charging) - usr.put_in_hand(charging) + usr.put_in_hands(charging) charging.add_fingerprint(user) charging.updateicon() diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 92b2cd7697..678783887d 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -1,4 +1,3 @@ -/var/list/geneticsrecords = list() //Cloning revival method. //The pod handles the actual cloning while the computer manages the clone profiles @@ -9,11 +8,11 @@ name = "cloning pod" desc = "An electronically-lockable pod for growing organic tissue." density = 1 - icon = 'cloning.dmi' + icon = 'icons/obj/cloning.dmi' icon_state = "pod_0" - req_access = list(ACCESS_GENETICS) //For premature unlocking. + req_access = list(access_genetics) //For premature unlocking. var/mob/living/occupant - var/heal_level = 10 //The clone is released once its health reaches this level. + var/heal_level = 90 //The clone is released once its health reaches this level. var/locked = 0 var/obj/machinery/computer/cloning/connected = null //So we remember the connected clone machine. var/mess = 0 //Need to clean out it if it's full of exploded clone. @@ -24,7 +23,7 @@ //TO-DO: Make the genetics machine accept them. /obj/item/weapon/disk/data name = "Cloning Data Disk" - icon = 'cloning.dmi' + icon = 'icons/obj/cloning.dmi' icon_state = "datadisk0" //Gosh I hope syndies don't mistake them for the nuke disk. item_state = "card-id" w_class = 1.0 @@ -53,7 +52,7 @@ return var/mob/selected = null - for(var/mob/M in world) + for(var/mob/M in player_list) //Dead people only thanks! if ((M.stat != 2) || (!M.client)) continue @@ -64,11 +63,6 @@ if (M.ckey == find_key) selected = M break - if(!selected) //Search for a ghost if dead body with client isn't found. - for(var/mob/dead/observer/ghost in world) - if (ghost.corpse && ghost.corpse.mind.key == find_key) - selected = ghost - break return selected //Disk stuff. @@ -97,7 +91,9 @@ if (!src.implanted) return "ERROR" else - src.healthstring = "[round(src.implanted:getOxyLoss())] - [round(src.implanted:getFireLoss())] - [round(src.implanted:getToxLoss())] - [round(src.implanted:getBruteLoss())]" + if(isliving(src.implanted)) + var/mob/living/L = src.implanted + src.healthstring = "[round(L.getOxyLoss())] - [round(L.getFireLoss())] - [round(L.getToxLoss())] - [round(L.getBruteLoss())]" if (!src.healthstring) src.healthstring = "ERROR" return src.healthstring @@ -117,9 +113,27 @@ //Clonepod //Start growing a human clone in the pod! -/obj/machinery/clonepod/proc/growclone(mob/ghost as mob, var/clonename, var/ui, var/se, var/mindref, var/mrace, var/UI, var/datum/changeling/changelingClone, var/original_name) - if(((!ghost) || (!ghost.client)) || src.mess || src.attempting) +/obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/ui, var/se, var/mindref, var/mrace, var/UI) + if(mess || attempting) return 0 + var/datum/mind/clonemind = locate(mindref) + if(!istype(clonemind,/datum/mind)) //not a mind + return 0 + if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body + return 0 + if(clonemind.active) //somebody is using that mind + if( ckey(clonemind.key)!=ckey ) + return 0 + else + for(var/mob/dead/observer/G in player_list) + if(G.ckey == ckey) + if(G.can_reenter_corpse) + break + else + return 0 + + + src.heal_level = rand(75,100) //Randomizes what health the clone is when ejected src.attempting = 1 //One at a time!! src.locked = 1 @@ -128,87 +142,60 @@ spawn(30) src.eject_wait = 0 - if(istajaran(occupant)) - src.occupant = new /mob/living/carbon/human/tajaran(src) - else - src.occupant = new /mob/living/carbon/human(src) + var/mob/living/carbon/human/H = new /mob/living/carbon/human(src) + occupant = H + H.UI = UI // set interface preference - occupant:UI = UI // set interface preference - - ghost.client.mob = src.occupant + if(!clonename) //to prevent null names + clonename = "clone ([rand(0,999)])" + H.real_name = clonename src.icon_state = "pod_1" //Get the clone body ready - src.occupant.rejuv = 10 - src.occupant.adjustCloneLoss(190) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite - src.occupant.adjustBrainLoss(90) - src.occupant.Paralyse(4) + H.adjustCloneLoss(190) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite + H.adjustBrainLoss(heal_level) + H.Paralyse(4) //Here let's calculate their health so the pod doesn't immediately eject them!!! - src.occupant.health = (src.occupant.getBruteLoss() + src.occupant.getToxLoss() + src.occupant.getOxyLoss() + src.occupant.getCloneLoss()) + H.updatehealth() - src.occupant << "\blue Clone generation process initiated." - src.occupant << "\blue This will take a moment, please hold." - - if(clonename) - src.occupant.real_name = clonename - src.occupant.original_name = clonename //we don't want random ghost names should we die again. - else - src.occupant.real_name = "clone" //No null names!! - - - var/datum/mind/clonemind = (locate(mindref) in ticker.minds) - - if ((clonemind) && (istype(clonemind))) //Move that mind over!! - clonemind.transfer_to(src.occupant) - clonemind.original = src.occupant - else //welp - src.occupant.mind = new /datum/mind( ) - src.occupant.mind.key = src.occupant.key - src.occupant.mind.current = src.occupant - src.occupant.mind.original = src.occupant - src.occupant.mind.transfer_to(src.occupant) - ticker.minds += src.occupant.mind + clonemind.transfer_to(H) + H.ckey = ckey + H << "Consciousness slowly creeps over you as your body regenerates.
      So this is what cloning feels like?
      " // -- Mode/mind specific stuff goes here switch(ticker.mode.name) if("revolution") - if(src.occupant.mind in ticker.mode:revolutionaries) - ticker.mode:update_all_rev_icons() //So the icon actually appears - if(src.occupant.mind in ticker.mode:head_revolutionaries) - ticker.mode:update_all_rev_icons() + if((H.mind in ticker.mode:revolutionaries) || (H.mind in ticker.mode:head_revolutionaries)) + ticker.mode.update_all_rev_icons() //So the icon actually appears if("nuclear emergency") - if (src.occupant.mind in ticker.mode:syndicates) - ticker.mode:update_all_synd_icons() + if(H.mind in ticker.mode.syndicates) + ticker.mode.update_all_synd_icons() if("cult") - if (src.occupant.mind in ticker.mode:cult) - ticker.mode:add_cultist(src.occupant.mind) - ticker.mode:update_all_cult_icons() //So the icon actually appears - - if (changelingClone && occupant.mind in ticker.mode.changelings) - occupant.changeling = changelingClone - src.occupant.make_changeling() + if (H.mind in ticker.mode.cult) + ticker.mode.add_cultist(src.occupant.mind) + ticker.mode.update_all_cult_icons() //So the icon actually appears // -- End mode specific stuff - if(istype(ghost, /mob/dead/observer)) - del(ghost) //Don't leave ghosts everywhere!! - - if(!src.occupant.dna) - src.occupant.dna = new /datum/dna() + if(!H.dna) + H.dna = new /datum/dna() + H.dna.real_name = H.real_name if(ui) - src.occupant.dna.uni_identity = ui - updateappearance(src.occupant, ui) + H.dna.uni_identity = ui + updateappearance(H, ui) if(se) - src.occupant.dna.struc_enzymes = se - for(var/i = 0 to 5) - randmutb(src.occupant) //Sometimes the clones come out wrong. - src.occupant:update_face() - src.occupant:update_body() - src.occupant:mutantrace = mrace - src.occupant:suiciding = 0 - occupant.brainloss = 100 + H.dna.struc_enzymes = se + randmutb(H) //Sometimes the clones come out wrong. + + H.f_style = "Shaved" + H.h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3") + + if(H.dna) + H.dna.mutantrace = mrace + H.update_mutantrace() + H.suiciding = 0 src.attempting = 0 return 1 @@ -222,7 +209,7 @@ return if((src.occupant) && (src.occupant.loc == src)) - if((src.occupant.stat == 2) || (src.occupant.suiciding)) //Autoeject corpses and suiciding dudes. + if((src.occupant.stat == DEAD) || (src.occupant.suiciding) || !occupant.key) //Autoeject corpses and suiciding dudes. src.locked = 0 src.go_out() src.connected_message("Clone Rejected: Deceased.") @@ -281,11 +268,6 @@ else if (istype(W, /obj/item/weapon/card/emag)) if (isnull(src.occupant)) return - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return user << "You force an emergency ejection." src.locked = 0 src.go_out() diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 6f9595b27e..8a35a8e782 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -1,14 +1,14 @@ /obj/machinery/computer/HolodeckControl name = "Holodeck Control Computer" desc = "A computer used to control a nearby holodeck." - icon_state = "computer_generic" + icon_state = "holocontrol" var/area/linkedholodeck = null var/area/target = null var/active = 0 var/list/holographic_items = list() var/damaged = 0 var/last_change = 0 - var/safety = 1 + attack_ai(var/mob/user as mob) return src.attack_hand(user) @@ -29,27 +29,26 @@ dat += "((Empty Court)
      )
      " dat += "((Boxing Court)
      )
      " + dat += "((Basketball Court)
      )
      " dat += "((Thunderdome Court)
      )
      " dat += "((Beach)
      )
      " // dat += "((Shutdown System)
      )
      " dat += "Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.
      " - if(!safety) - if(issilicon(user) && (emagged)) - dat += "ERROR: SAFETY PROTOCOLS UNRESPONSIVE
      " - else if(issilicon(user) && (!emagged)) - dat += "(Enable Safety Protocols?)
      " + if(emagged) dat += "(Begin Atmospheric Burn Simulation)
      " dat += "Ensure the holodeck is empty before testing.
      " dat += "
      " dat += "(Begin Wildlife Simulation)
      " dat += "Ensure the holodeck is empty before testing.
      " dat += "
      " - dat += "Safety Protocols are DISABLED
      " - else if(safety) if(issilicon(user)) - dat += "(Disable Safety Protocols?)
      " + dat += "(Re-Enable Safety Protocols?)
      " + dat += "Safety Protocols are DISABLED
      " + else + if(issilicon(user)) + dat += "(Override Safety Protocols?)
      " dat += "
      " dat += "Safety Protocols are ENABLED
      " @@ -76,6 +75,11 @@ if(target) loadProgram(target) + else if(href_list["basketball"]) + target = locate(/area/holodeck/source_basketball) + if(target) + loadProgram(target) + else if(href_list["thunderdomecourt"]) target = locate(/area/holodeck/source_thunderdomecourt) if(target) @@ -92,26 +96,26 @@ loadProgram(target) else if(href_list["burntest"]) - if(safety) return + if(!emagged) return target = locate(/area/holodeck/source_burntest) if(target) loadProgram(target) else if(href_list["wildlifecarp"]) - if(safety) return + if(!emagged) return target = locate(/area/holodeck/source_wildlife) if(target) loadProgram(target) else if(href_list["AIoverride"]) if(!issilicon(usr)) return - safety = 0 - log_admin("[usr] ([usr.ckey]) disabled Holodeck Safeties.") - message_admins("[usr] ([usr.ckey]) disabled Holodeck Safeties.") - - else if(href_list["AIrelock"]) - if(!issilicon(usr)) return - safety = 1 + emagged = !emagged + if(emagged) + message_admins("[key_name_admin(usr)] overrided the holodeck's safeties") + log_game("[key_name(usr)] overrided the holodeck's safeties") + else + message_admins("[key_name_admin(usr)] restored the holodeck's safeties") + log_game("[key_name(usr)] restored the holodeck's safeties") src.add_fingerprint(usr) src.updateUsrDialog() @@ -123,7 +127,7 @@ //Warning, uncommenting this can have concequences. For example, deconstructing the computer may cause holographic eswords to never derez /* if(istype(D, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -151,13 +155,11 @@ */ if(istype(D, /obj/item/weapon/card/emag) && !emagged) - playsound(src.loc, 'sparks4.ogg', 75, 1) + playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 - safety = 0 user << "\blue You vastly increase projector power and override the safety and security protocols." - user << "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call NanoTrasen maintence and do not use the simulator." - log_admin("[user] ([user.ckey]) emagged Holodeck Safeties.") - message_admins("[user] ([user.ckey]) emagged Holodeck Safeties.") + user << "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call Nanotrasen maintenance and do not use the simulator." + log_game("[key_name(usr)] emagged the Holodeck Control Computer") src.updateUsrDialog() return @@ -223,13 +225,14 @@ -/obj/machinery/computer/HolodeckControl/proc/derez(var/obj , var/silent = 1) +/obj/machinery/computer/HolodeckControl/proc/derez(var/obj/obj , var/silent = 1) holographic_items.Remove(obj) - if(istype(obj , /obj/)) - if(istype(obj:loc , /mob/)) - var/mob/M = obj:loc - M.drop_from_slot(obj) + if(isobj(obj)) + var/mob/M = obj.loc + if(ismob(M)) + M.u_equip(obj) + M.update_icons() //so their overlays update if(!silent) var/obj/oldobj = obj @@ -290,10 +293,13 @@ for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck) del(B) + for(var/mob/living/simple_animal/carp/C in linkedholodeck) + del(C) + holographic_items = A.copy_contents_to(linkedholodeck , 1) if(emagged) - for(var/obj/item/weapon/melee/energy/sword/holosword/H in linkedholodeck) + for(var/obj/item/weapon/holo/esword/H in linkedholodeck) H.damtype = BRUTE spawn(30) @@ -307,6 +313,8 @@ if(T) T.temperature = 5000 T.hotspot_expose(50000,50000,1) + if(L.name=="Holocarp Spawn") + new /mob/living/simple_animal/carp(L.loc) /obj/machinery/computer/HolodeckControl/proc/emergencyShutdown() @@ -365,12 +373,12 @@ /obj/structure/table/holotable name = "table" desc = "A square piece of metal standing on four metal legs. It can not move." - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' icon_state = "table" density = 1 anchored = 1.0 layer = 2.8 -// throwpass = 1 //You can throw objects over this, despite it's density. + throwpass = 1 //You can throw objects over this, despite it's density. /obj/structure/table/holotable/attack_paw(mob/user as mob) @@ -390,65 +398,7 @@ if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W if(G.state<2) - if(ishuman(G.affecting)) - var/mob/living/carbon/human/H = G.affecting - var/datum/organ/external/affecting = H.get_organ("head") - //Fucking hacky, but whatever. - var/obj/machinery/computer/HolodeckControl/HC = locate() in world - if(istype(HC) && HC.safety) //If the computer exists, and the safety is active... - if(prob(25)) - add_blood(G.affecting) - H.halloss += rand(10, 15) - G.assailant.visible_message("\red \The [G.assailant] smashes \the [H]'s head on \the [src] with enough force to engage \the [src]'s safeties!",\ - "\red You smash \the [H]'s head on \the [src] with enough force to engage \the [src]'s safeties!",\ - "\red You hear a whine as \the [src]'s engage.") - else - H.halloss += rand(5, 10) - G.assailant.visible_message("\red \The [G.assailant] smashes \the [H]'s head on \the [src]!",\ - "\red You smash \the [H]'s head on \the [src]!",\ - "\red You hear a whine as \the [src]'s is hit by something dense.") - H.UpdateDamageIcon() - H.updatehealth() - playsound(src.loc, 'tablehit1.ogg', 50, 1, -3) - else //Lets do REAL DAMAGE, YEAH! - G.affecting.attack_log += text("\[[time_stamp()]\] Has been smashed on a table by [G.assailant.name] ([G.assailant.ckey])") - G.assailant.attack_log += text("\[[time_stamp()]\] Smashed [G.affecting.name] ([G.affecting.ckey]) on a table.") - - log_admin("ATTACK: [G.assailant] ([G.assailant.ckey]) smashed [G.affecting] ([G.affecting.ckey]) on a table.") - message_admins("ATTACK: [G.assailant] ([G.assailant.ckey]) smashed [G.affecting] ([G.affecting.ckey]) on a table.") - log_attack("[G.assailant] ([G.assailant.ckey]) smashed [G.affecting] ([G.affecting.ckey]) on a table.") - - if(prob(25)) - add_blood(G.affecting) - affecting.take_damage(rand(10,15), 0) - H.Weaken(2) - if(prob(20)) // One chance in 20 to DENT THE TABLE - affecting.take_damage(rand(0,5), 0) //Extra damage - if(dented) - G.assailant.visible_message("\red \The [G.assailant] smashes \the [H]'s head on \the [src] with enough force to further deform \the [src]!\nYou wish you could unhear that sound.",\ - "\red You smash \the [H]'s head on \the [src] with enough force to leave another dent!\n\black [prob(50)?"That was a satisfying noise." : "That sound will haunt your nightmares"]",\ - "\red You hear the nauseating crunch of bone and gristle on solid metal and the squeal of said metal deforming.") - else - G.assailant.visible_message("\red \The [G.assailant] smashes \the [H]'s head on \the [src] so hard it left a dent!\nYou wish you could unhear that sound.",\ - "\red You smash \the [H]'s head on \the [src] with enough force to leave a dent!\n\black [prob(5)?"That was a satisfying noise." : "That sound will haunt your nightmares"]",\ - "\red You hear the nauseating crunch of bone and gristle on solid metal and the squeal of said metal deforming.") - dented++ - else if(prob(50)) - G.assailant.visible_message("\red [G.assailant] smashes \the [H]'s head on \the [src], [H.get_visible_gender() == MALE ? "his" : H.get_visible_gender() == FEMALE ? "her" : "their"] bone and cartilage making a loud crunch!",\ - "\red You smash \the [H]'s head on \the [src], [H.get_visible_gender() == MALE ? "his" : H.get_visible_gender() == FEMALE ? "her" : "their"] bone and cartilage making a loud crunch!",\ - "\red You hear the nauseating crunch of bone and gristle on solid metal, the noise echoing through the room.") - else - G.assailant.visible_message("\red [G.assailant] smashes \the [H]'s head on \the [src], [H.get_visible_gender() == MALE ? "his" : H.get_visible_gender() == FEMALE ? "her" : "their"] nose smashed and face bloodied!",\ - "\red You smash \the [H]'s head on \the [src], [H.get_visible_gender() == MALE ? "his" : H.get_visible_gender() == FEMALE ? "her" : "their"] nose smashed and face bloodied!",\ - "\red You hear the nauseating crunch of bone and gristle on solid metal and the gurgling gasp of someone who is trying to breathe through their own blood.") - else - affecting.take_damage(rand(5,10), 0) - G.assailant.visible_message("\red [G.assailant] smashes \the [H]'s head on \the [src]!",\ - "\red You smash \the [H]'s head on \the [src]!",\ - "\red You hear the nauseating crunch of bone and gristle on solid metal.") - H.UpdateDamageIcon() - H.updatehealth() - playsound(src.loc, 'tablehit1.ogg', 50, 1, -3) + user << "\red You need a better grip to do that!" return G.affecting.loc = src.loc G.affecting.Weaken(5) @@ -475,7 +425,7 @@ /obj/structure/holowindow name = "reinforced window" - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' icon_state = "rwindow" desc = "A window." density = 1 @@ -488,27 +438,114 @@ /obj/structure/holowindow/Del() ..() - -/obj/item/weapon/melee/energy/sword/holosword +/obj/item/weapon/holo damtype = HALLOSS -/obj/item/weapon/melee/energy/sword/holosword/green +/obj/item/weapon/holo/esword + desc = "May the force be within you. Sorta" + icon_state = "sword0" + force = 3.0 + throwforce = 5.0 + throw_speed = 1 + throw_range = 5 + w_class = 2.0 + flags = FPRINT | TABLEPASS | NOSHIELD + var/active = 0 + +/obj/item/weapon/holo/esword/green New() color = "green" -/obj/item/weapon/melee/energy/sword/holosword/red +/obj/item/weapon/holo/esword/red New() color = "red" +/obj/item/weapon/holo/esword/IsShield() + if(active) + return 1 + return 0 +/obj/item/weapon/holo/esword/attack(target as mob, mob/user as mob) + ..() +/obj/item/weapon/holo/esword/New() + color = pick("red","blue","green","purple") +/obj/item/weapon/holo/esword/attack_self(mob/living/user as mob) + active = !active + if (active) + force = 30 + icon_state = "sword[color]" + w_class = 4 + playsound(user, 'sound/weapons/saberon.ogg', 50, 1) + user << "\blue [src] is now active." + else + force = 3 + icon_state = "sword0" + w_class = 2 + playsound(user, 'sound/weapons/saberoff.ogg', 50, 1) + user << "\blue [src] can now be concealed." + add_fingerprint(user) + return + +//BASKETBALL OBJECTS + +/obj/item/weapon/beach_ball/holoball + icon = 'icons/obj/basketball.dmi' + icon_state = "basketball" + name = "basketball" + item_state = "basketball" + desc = "Here's your chance, do your dance at the Space Jam." + w_class = 4 //Stops people from hiding it in their bags/pockets + +/obj/structure/holohoop + name = "basketball hoop" + desc = "Boom, Shakalaka!." + icon = 'icons/obj/basketball.dmi' + icon_state = "hoop" + anchored = 1 + density = 1 + throwpass = 1 + +/obj/structure/holohoop/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) + var/obj/item/weapon/grab/G = W + if(G.state<2) + user << "\red You need a better grip to do that!" + return + G.affecting.loc = src.loc + G.affecting.Weaken(5) + for(var/mob/M in viewers(src)) + M.show_message("\red [G.assailant] dunks [G.affecting] into the [src]!", 3) + del(W) + return + else if (istype(W, /obj/item) && get_dist(src,user)<2) + user.drop_item(src) + for(var/mob/M in viewers(src)) + M.show_message("\blue [user] dunks [W] into the [src]!", 3) + return + +/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + if (istype(mover,/obj/item) && mover.throwing) + var/obj/item/I = mover + if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile)) + return + if(prob(50)) + I.loc = src.loc + for(var/mob/M in viewers(src)) + M.show_message("\blue Swish! \the [I] lands in \the [src].", 3) + else + for(var/mob/M in viewers(src)) + M.show_message("\red \the [I] bounces off of \the [src]'s rim!", 3) + return 0 + else + return ..(mover, target, height, air_group) /obj/machinery/readybutton name = "Ready Declaration Device" - desc = "This device is used to declare ready. If all devices in an area are ready, the event will begin!" - icon = 'monitors.dmi' + desc = "This device is used to declare ready. If all devices in an area are ready, the event will begin!" + icon = 'icons/obj/monitors.dmi' icon_state = "auth_off" var/ready = 0 var/area/currentarea = null diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index b8cc1c70a3..fad56a7e8f 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -1,10 +1,9 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/operating name = "Operating Computer" density = 1 anchored = 1.0 - desc = "Used to monitor status of people being operated on." icon_state = "operating" circuit = "/obj/item/weapon/circuitboard/operating" var/mob/living/carbon/human/victim = null @@ -43,34 +42,20 @@ dat += "Close

      " //| Update" if(src.table && (src.table.check_victim())) src.victim = src.table.victim - if(istype(victim)) - dat += {" - Patient Information:
      -
      - Name: [src.victim.real_name]
      - Age: [src.victim.age]
      - Blood Type: [(victim.dna? victim.dna.b_type : "ERROR")]
      -
      - Health: [src.victim.health]
      - Brute Damage: [src.victim.getBruteLoss()]
      - Toxins Damage: [src.victim.getToxLoss()]
      - Fire Damage: [src.victim.getFireLoss()]
      - Suffocation Damage: [src.victim.getOxyLoss()]
      - Patient Status: [src.victim.stat ? "Non-Responsive" : "Stable"]
      - "} - else if(istype(victim, /mob/living)) - dat += {" - Patient Information:
      -
      - Name: [src.victim.real_name]
      - Age: [src.victim.age]
      - Health: [src.victim.health]
      - Brute Damage: [src.victim.getBruteLoss()]
      - Toxins Damage: [src.victim.getToxLoss()]
      - Fire Damage: [src.victim.getFireLoss()]
      - Suffocation Damage: [src.victim.getOxyLoss()]
      - Patient Status: [src.victim.stat ? "Non-Responsive" : "Stable"]
      - "} + dat += {" +Patient Information:
      +
      +Name: [src.victim.real_name]
      +Age: [src.victim.age]
      +Blood Type: [src.victim.b_type]
      +
      +Health: [src.victim.health]
      +Brute Damage: [src.victim.getBruteLoss()]
      +Toxins Damage: [src.victim.getToxLoss()]
      +Fire Damage: [src.victim.getFireLoss()]
      +Suffocation Damage: [src.victim.getOxyLoss()]
      +Patient Status: [src.victim.stat ? "Non-Responsive" : "Stable"]
      +"} else src.victim = null dat += {" diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 750db980e6..bac0614f77 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -2,10 +2,10 @@ density = 1 anchored = 0 name = "AI core" - icon = 'AI.dmi' + icon = 'icons/mob/AI.dmi' icon_state = "0" var/state = 0 - var/datum/ai_laws/laws = new /datum/ai_laws/nanotrasen + var/datum/ai_laws/laws = new /datum/ai_laws/asimov var/obj/item/weapon/circuitboard/circuit = null var/obj/item/device/mmi/brain = null @@ -14,7 +14,7 @@ switch(state) if(0) if(istype(P, /obj/item/weapon/wrench)) - playsound(loc, 'Ratchet.ogg', 50, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) user << "\blue You wrench the frame into place." anchored = 1 @@ -24,7 +24,7 @@ if(!WT.isOn()) user << "The welder must be on for this task." return - playsound(loc, 'Welder.ogg', 50, 1) + playsound(loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, 20)) if(!src || !WT.remove_fuel(0, user)) return user << "\blue You deconstruct the frame." @@ -32,25 +32,25 @@ del(src) if(1) if(istype(P, /obj/item/weapon/wrench)) - playsound(loc, 'Ratchet.ogg', 50, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) user << "\blue You unfasten the frame." anchored = 0 state = 0 if(istype(P, /obj/item/weapon/circuitboard/aicore) && !circuit) - playsound(loc, 'Deconstruct.ogg', 50, 1) + playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "\blue You place the circuit board inside the frame." icon_state = "1" circuit = P user.drop_item() P.loc = src if(istype(P, /obj/item/weapon/screwdriver) && circuit) - playsound(loc, 'Screwdriver.ogg', 50, 1) + playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "\blue You screw the circuit board into place." state = 2 icon_state = "2" if(istype(P, /obj/item/weapon/crowbar) && circuit) - playsound(loc, 'Crowbar.ogg', 50, 1) + playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) user << "\blue You remove the circuit board." state = 1 icon_state = "0" @@ -58,13 +58,13 @@ circuit = null if(2) if(istype(P, /obj/item/weapon/screwdriver) && circuit) - playsound(loc, 'Screwdriver.ogg', 50, 1) + playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "\blue You unfasten the circuit board." state = 1 icon_state = "1" if(istype(P, /obj/item/weapon/cable_coil)) if(P:amount >= 5) - playsound(loc, 'Deconstruct.ogg', 50, 1) + playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) P:amount -= 5 if(!P:amount) del(P) @@ -76,7 +76,7 @@ if (brain) user << "Get that brain out of there first" else - playsound(loc, 'wirecutter.ogg', 50, 1) + playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "\blue You remove the cables." state = 2 icon_state = "2" @@ -85,7 +85,7 @@ if(istype(P, /obj/item/stack/sheet/rglass)) if(P:amount >= 2) - playsound(loc, 'Deconstruct.ogg', 50, 1) + playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) if (P) P:amount -= 2 @@ -100,14 +100,6 @@ laws.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.") usr << "Law module applied." - if(istype(P, /obj/item/weapon/aiModule/nanotrasen)) - laws.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.") - laws.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - laws.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - laws.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.") - //laws.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.") - usr << "Law module applied." - if(istype(P, /obj/item/weapon/aiModule/purge)) laws.clear_inherent_laws() usr << "Law module applied." @@ -126,16 +118,14 @@ user << "\red Sticking a dead brain into the frame would sort of defeat the purpose." return - if(P:brainmob.mind in ticker.mode.head_revolutionaries) - user << "\red The frame's firmware lets out a shrill sound, and flashes 'Abnormal Memory Engram'. It refuses to accept the MMI." - return - if(P:brainmob.mind in ticker.mode:revolutionaries) - ticker.mode:remove_revolutionary(P:brainmob.mind , 1) - if(jobban_isbanned(P:brainmob, "AI")) user << "\red This MMI does not seem to fit." return + if(P:brainmob.mind) + ticker.mode.remove_cultist(P:brainmob.mind, 1) + ticker.mode.remove_revolutionary(P:brainmob.mind, 1) + user.drop_item() P.loc = src brain = P @@ -143,7 +133,7 @@ icon_state = "3b" if(istype(P, /obj/item/weapon/crowbar) && brain) - playsound(loc, 'Crowbar.ogg', 50, 1) + playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) user << "\blue You remove the brain." brain.loc = loc brain = null @@ -151,7 +141,7 @@ if(4) if(istype(P, /obj/item/weapon/crowbar)) - playsound(loc, 'Crowbar.ogg', 50, 1) + playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) user << "\blue You remove the glass panel." state = 3 if (brain) @@ -162,15 +152,15 @@ return if(istype(P, /obj/item/weapon/screwdriver)) - playsound(loc, 'Screwdriver.ogg', 50, 1) + playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "\blue You connect the monitor." new /mob/living/silicon/ai ( loc, laws, brain ) -// feedback_inc("cyborg_ais_created",1) + feedback_inc("cyborg_ais_created",1) del(src) /obj/structure/AIcore/deactivated name = "Inactive AI" - icon = 'AI.dmi' + icon = 'icons/mob/AI.dmi' icon_state = "ai-empty" anchored = 1 state = 20//So it doesn't interact based on the above. Not really necessary. @@ -290,23 +280,23 @@ That prevents a few funky behaviors. T.occupant = A A.control_disabled = 1 if (A.stat == 2) - T.overlays += image('computer.dmi', "ai-fixer-404") + T.overlays += image('icons/obj/computer.dmi', "ai-fixer-404") else - T.overlays += image('computer.dmi', "ai-fixer-full") - T.overlays -= image('computer.dmi', "ai-fixer-empty") + T.overlays += image('icons/obj/computer.dmi', "ai-fixer-full") + T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-empty") A.cancel_camera() A << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here." U << "\blue Transfer successful: \black [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed." else if(!C.contents.len && T.occupant && !T.active) C.name = "inteliCard - [T.occupant.name]" - T.overlays += image('computer.dmi', "ai-fixer-empty") + T.overlays += image('icons/obj/computer.dmi', "ai-fixer-empty") if (T.occupant.stat == 2) C.icon_state = "aicard-404" - T.overlays -= image('computer.dmi', "ai-fixer-404") + T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-404") else C.icon_state = "aicard-full" - T.overlays -= image('computer.dmi', "ai-fixer-full") + T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-full") T.occupant << "You have been downloaded to a mobile storage device. Still no remote access." U << "\blue Transfer succesful: \black [T.occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory." T.occupant.loc = C @@ -329,8 +319,8 @@ That prevents a few funky behaviors. T.occupant = A C.AI = null A.control_disabled = 1 - T.overlays += image('computer.dmi', "ai-fixer-full") - T.overlays -= image('computer.dmi', "ai-fixer-empty") + T.overlays += image('icons/obj/computer.dmi', "ai-fixer-full") + T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-empty") A.cancel_camera() A << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here." U << "\blue Transfer successful: \black [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed." @@ -339,8 +329,8 @@ That prevents a few funky behaviors. if (T.occupant.stat) U << "\red ERROR: \black [T.occupant.name] data core is corrupted. Unable to install." else - T.overlays += image('computer.dmi', "ai-fixer-empty") - T.overlays -= image('computer.dmi', "ai-fixer-full") + T.overlays += image('icons/obj/computer.dmi', "ai-fixer-empty") + T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-full") T.occupant << "You have been downloaded to a mobile storage device. Still no remote access." U << "\blue Transfer successful: \black [T.occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory." T.occupant.loc = C diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 3982ade525..1b09e2f1bc 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -1,19 +1,19 @@ /obj/machinery/computer/aifixer name = "AI System Integrity Restorer" - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "ai-fixer" - req_access = list(ACCESS_CAPTAIN, ACCESS_ROBOTICS, ACCESS_HEADS) + req_access = list(access_captain, access_robotics, access_heads) var/mob/living/silicon/ai/occupant = null var/active = 0 /obj/machinery/computer/aifixer/New() - src.overlays += image('computer.dmi', "ai-fixer-empty") + src.overlays += image('icons/obj/computer.dmi', "ai-fixer-empty") /obj/machinery/computer/aifixer/attackby(I as obj, user as mob) /* if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -111,7 +111,6 @@ if(stat & (NOPOWER|BROKEN)) return - src.updateDialog() return @@ -120,7 +119,7 @@ return if (href_list["fix"]) src.active = 1 - src.overlays += image('computer.dmi', "ai-fixer-on") + src.overlays += image('icons/obj/computer.dmi', "ai-fixer-on") while (src.occupant.health < 100) src.occupant.adjustOxyLoss(-1) src.occupant.adjustFireLoss(-1) @@ -129,12 +128,12 @@ src.occupant.updatehealth() if (src.occupant.health >= 0 && src.occupant.stat == 2) src.occupant.stat = 0 - src.overlays -= image('computer.dmi', "ai-fixer-404") - src.overlays += image('computer.dmi', "ai-fixer-full") + src.overlays -= image('icons/obj/computer.dmi', "ai-fixer-404") + src.overlays += image('icons/obj/computer.dmi', "ai-fixer-full") src.updateUsrDialog() sleep(10) src.active = 0 - src.overlays -= image('computer.dmi', "ai-fixer-on") + src.overlays -= image('icons/obj/computer.dmi', "ai-fixer-on") src.add_fingerprint(usr) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 1b862426fd..479edbc984 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1,7 +1,7 @@ /obj/machinery/computer/arcade name = "arcade machine" - desc = "Does not support Pinball." - icon = 'computer.dmi' + desc = "Does not support Pin ball." + icon = 'icons/obj/computer.dmi' icon_state = "arcade" circuit = "/obj/item/weapon/circuitboard/arcade" var/enemy_name = "Space Villian" @@ -12,6 +12,27 @@ var/enemy_mp = 20 var/gameover = 0 var/blocked = 0 //Player cannot attack/heal while set + var/list/prizes = list( /obj/item/weapon/storage/snappopbox = 2, + /obj/item/toy/blink = 2, + /obj/item/clothing/under/syndicate/tacticool = 2, + /obj/item/toy/sword = 2, + /obj/item/toy/gun = 2, + /obj/item/toy/crossbow = 2, + /obj/item/clothing/suit/syndicatefake = 2, + /obj/item/weapon/storage/crayonbox = 2, + /obj/item/toy/spinningtoy = 2, + /obj/item/toy/prize/ripley = 1, + /obj/item/toy/prize/fireripley = 1, + /obj/item/toy/prize/deathripley = 1, + /obj/item/toy/prize/gygax = 1, + /obj/item/toy/prize/durand = 1, + /obj/item/toy/prize/honk = 1, + /obj/item/toy/prize/marauder = 1, + /obj/item/toy/prize/seraph = 1, + /obj/item/toy/prize/mauler = 1, + /obj/item/toy/prize/odysseus = 1, + /obj/item/toy/prize/phazon = 1 + ) /obj/machinery/computer/arcade var/turtle = 0 @@ -64,7 +85,7 @@ if(..()) return - if (!src.blocked) + if (!src.blocked && !src.gameover) if (href_list["attack"]) src.blocked = 1 var/attackamt = rand(2,6) @@ -127,45 +148,33 @@ /obj/machinery/computer/arcade/proc/arcade_action() if ((src.enemy_mp <= 0) || (src.enemy_hp <= 0)) - src.gameover = 1 - src.temp = "[src.enemy_name] has fallen! Rejoice!" + if(!gameover) + src.gameover = 1 + src.temp = "[src.enemy_name] has fallen! Rejoice!" - if(emagged) - new /obj/effect/spawner/newbomb/timer/syndicate(src.loc) - new /obj/item/clothing/head/collectable/petehat(src.loc) - message_admins("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") - log_game("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") - src.New() - emagged = 0 + if(emagged) + feedback_inc("arcade_win_emagged") + new /obj/effect/spawner/newbomb/timer/syndicate(src.loc) + new /obj/item/clothing/head/collectable/petehat(src.loc) + message_admins("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") + log_game("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") + src.New() + emagged = 0 + else if(!contents.len) + feedback_inc("arcade_win_normal") + var/prizeselect = pickweight(prizes) + new prizeselect(src.loc) - else if(!contents.len) - var/prizeselect = pick(1,2,3,4,5,6,7,8,9) - switch(prizeselect) - if(1) - new /obj/item/toy/snappopbox(src.loc) - if(2) - new /obj/item/toy/blink(src.loc) - if(3) - new /obj/item/clothing/under/syndicate/tacticool(src.loc) - if(4) - new /obj/item/toy/sword(src.loc) - if(5) + if(istype(prizeselect, /obj/item/toy/gun)) //Ammo comes with the gun new /obj/item/toy/ammo/gun(src.loc) - new /obj/item/toy/gun(src.loc) - if(6) - new /obj/item/toy/crossbow(src.loc) - if(7) - new /obj/item/clothing/suit/syndicatefake(src.loc) - new /obj/item/clothing/head/syndicatefake(src.loc) - if(8) - new /obj/item/weapon/storage/crayonbox(src.loc) - if(9) - new /obj/item/toy/spinningtoy(src.loc) - // if(10) //Commented out on Urist-chan's orders~ - // new /obj/item/toy/balloon(src.loc) //Until it gets a better sprite~ - else - var/atom/movable/Prize = pick(contents) - Prize.loc = src.loc + + else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit + new /obj/item/clothing/head/syndicatefake(src.loc) + + else + feedback_inc("arcade_win_normal") + var/atom/movable/prize = pick(contents) + prize.loc = src.loc else if (emagged && (turtle >= 4)) var/boomamt = rand(5,10) @@ -183,7 +192,10 @@ sleep(10) src.temp = "You have been drained! GAME OVER" if(emagged) + feedback_inc("arcade_loss_mana_emagged") usr.gib() + else + feedback_inc("arcade_loss_mana_normal") else if ((src.enemy_hp <= 10) && (src.enemy_mp > 4)) src.temp = "[src.enemy_name] heals for 4 health!" @@ -199,7 +211,10 @@ src.gameover = 1 src.temp = "You have been crushed! GAME OVER" if(emagged) + feedback_inc("arcade_loss_hp_emagged") usr.gib() + else + feedback_inc("arcade_loss_hp_normal") src.blocked = 0 return @@ -219,11 +234,6 @@ /obj/machinery/computer/arcade/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/card/emag) && !emagged) - var/obj/item/weapon/card/emag/E = I - if(E.uses) - E.uses-- - else - return temp = "If you die in the game, you die for real!" player_hp = 30 player_mp = 10 @@ -240,7 +250,7 @@ src.updateUsrDialog() else if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) var/obj/item/weapon/circuitboard/arcade/M = new /obj/item/weapon/circuitboard/arcade( A ) diff --git a/code/game/machinery/computer/atmos.dm b/code/game/machinery/computer/atmos.dm deleted file mode 100644 index f7acd285e2..0000000000 --- a/code/game/machinery/computer/atmos.dm +++ /dev/null @@ -1,103 +0,0 @@ -/*CONTENTS -Gas Sensor -Siphon computer -Atmos alert computer -*/ - - - -//the station alerts computer -/obj/machinery/computer/station_alert/attack_ai(mob/user) - add_fingerprint(user) - - if(stat & (BROKEN|NOPOWER)) - return - interact(user) - -/obj/machinery/computer/station_alert/attack_hand(mob/user) - add_fingerprint(user) - if(stat & (BROKEN|NOPOWER)) - return - interact(user) - -/obj/machinery/computer/station_alert/proc/interact(mob/user) - usr.machine = src - var/dat = "Current Station Alerts\n" - dat += "Close

      " - for (var/cat in src.alarms) - dat += text("[]
      \n", cat) - var/list/L = src.alarms[cat] - if (L.len) - for (var/alarm in L) - var/list/alm = L[alarm] - var/area/A = alm[1] - var/list/sources = alm[3] - dat += "" - dat += "• " - dat += "[A.name]" - if (sources.len > 1) - dat += text(" - [] sources", sources.len) - dat += "
      \n" - else - dat += "-- All Systems Nominal
      \n" - dat += "
      \n" - user << browse(dat, "window=alerts") - onclose(user, "alerts") - -/obj/machinery/computer/station_alert/Topic(href, href_list) - if(..()) - return - return - -/obj/machinery/computer/station_alert/proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource) - if(stat & (BROKEN|NOPOWER)) - return - var/list/L = src.alarms[class] - for (var/I in L) - if (I == A.name) - var/list/alarm = L[I] - var/list/sources = alarm[3] - if (!(alarmsource in sources)) - sources += alarmsource - return 1 - var/obj/machinery/camera/C = null - var/list/CL = null - if (O && istype(O, /list)) - CL = O - if (CL.len == 1) - C = CL[1] - else if (O && istype(O, /obj/machinery/camera)) - C = O - L[A.name] = list(A, (C) ? C : O, list(alarmsource)) - return 1 - -/obj/machinery/computer/station_alert/proc/cancelAlarm(var/class, area/A as area, obj/origin) - if(stat & (BROKEN|NOPOWER)) - return - var/list/L = src.alarms[class] - var/cleared = 0 - for (var/I in L) - if (I == A.name) - var/list/alarm = L[I] - var/list/srcs = alarm[3] - if (origin in srcs) - srcs -= origin - if (srcs.len == 0) - cleared = 1 - L -= I - return !cleared - -/obj/machinery/computer/station_alert/process() - if(stat & (BROKEN|NOPOWER)) - icon_state = "atmos0" - return - var/active_alarms = 0 - for (var/cat in src.alarms) - var/list/L = src.alarms[cat] - if(L.len) active_alarms = 1 - if(active_alarms) - icon_state = "alert:2" - else - icon_state = "alert:0" - - ..() diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 820344c08f..5a9d62a0a5 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -108,7 +108,7 @@ attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) var/obj/item/weapon/circuitboard/atmos_alert/M = new /obj/item/weapon/circuitboard/atmos_alert( A ) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 5d0708c379..9fa0859262 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -4,7 +4,7 @@ density = 1 anchored = 0 name = "Computer-frame" - icon = 'stock_parts.dmi' + icon = 'icons/obj/stock_parts.dmi' icon_state = "0" var/state = 0 var/obj/item/weapon/circuitboard/circuit = null @@ -15,7 +15,7 @@ anchored = 0 w_class = 2.0 name = "Circuit board" - icon = 'module.dmi' + icon = 'icons/obj/module.dmi' icon_state = "id_mod" item_state = "electronic" origin_tech = "programming=2" @@ -27,12 +27,15 @@ var/powernet = null var/list/records = null var/frame_desc = null - var/contain_parts = 1 + /obj/item/weapon/circuitboard/message_monitor name = "Circuit board (Message Monitor)" build_path = "/obj/machinery/computer/message_monitor" origin_tech = "programming=3" +/obj/item/weapon/circuitboard/security + name = "Circuit board (Security)" + build_path = "/obj/machinery/computer/security" /obj/item/weapon/circuitboard/aicore name = "Circuit board (AI core)" origin_tech = "programming=4;biotech=2" @@ -129,7 +132,7 @@ build_path = "/obj/machinery/computer/prisoner" /obj/item/weapon/circuitboard/rdconsole name = "Circuit Board (RD Console)" - build_path = "/obj/machinery/computer/rdconsole" + build_path = "/obj/machinery/computer/rdconsole/core" /obj/item/weapon/circuitboard/mecha_control name = "Circuit Board (Exosuit Control Console)" build_path = "/obj/machinery/computer/mecha" @@ -157,38 +160,10 @@ name = "Circuit board (Operating Computer)" build_path = "/obj/machinery/computer/operating" origin_tech = "programming=2;biotech=2" - -/obj/item/weapon/circuitboard/camera - name = "Circuit board (Camera)" - origin_tech = "programming=2" - build_path = "" //build path has to be manually set via circuit interaction - -//the following camera circuit boards are for adminspawn / reference -/obj/item/weapon/circuitboard/securitycam - name = "Circuit board (Security Monitoring)" - origin_tech = "" //unresearchable - build_path = "/obj/machinery/computer/security" -/obj/item/weapon/circuitboard/engineeringcam - name = "Circuit board (Engineering Monitoring)" - origin_tech = "" //unresearchable - build_path = "/obj/machinery/computer/security/engineering" -/obj/item/weapon/circuitboard/miningcam - name = "Circuit board (Mining Outpost Monitoring)" - origin_tech = "" //unresearchable +/obj/item/weapon/circuitboard/mining + name = "Circuit board (Outpost Status Display)" build_path = "/obj/machinery/computer/security/mining" -/obj/item/weapon/circuitboard/cargocam - name = "Circuit board (Cargo Department Monitoring)" - origin_tech = "" //unresearchable - build_path = "/obj/machinery/computer/security/cargo" -/obj/item/weapon/circuitboard/medbaycam - name = "Circuit board (Mining Outpost Monitoring)" - origin_tech = "" //unresearchable - build_path = "/obj/machinery/computer/security/medbay" -/obj/item/weapon/circuitboard/researchcam - name = "Circuit board (Mining Outpost Monitoring)" - origin_tech = "" //unresearchable - build_path = "/obj/machinery/computer/security/research" - + origin_tech = "programming=2" /obj/item/weapon/circuitboard/comm_monitor name = "Circuit board (Telecommunications Monitor)" build_path = "/obj/machinery/computer/telecomms/monitor" @@ -213,16 +188,12 @@ name = "Circuit board (Mining Shuttle)" build_path = "/obj/machinery/computer/mining_shuttle" origin_tech = "programming=2" -/obj/item/weapon/circuitboard/research_shuttle - name = "Circuit board (Research Shuttle)" - build_path = "/obj/machinery/computer/research_shuttle" - origin_tech = "programming=2" /obj/item/weapon/circuitboard/HolodeckControl // Not going to let people get this, but it's just here for future name = "Circuit board (Holodeck Control)" build_path = "/obj/machinery/computer/HolodeckControl" origin_tech = "programming=4" /obj/item/weapon/circuitboard/aifixer - name = "Circuit board (AI Integrity Fixer)" + name = "Circuit board (AI Integrity Restorer)" build_path = "/obj/machinery/computer/aifixer" origin_tech = "programming=3;biotech=2" /obj/item/weapon/circuitboard/area_atmos @@ -235,34 +206,6 @@ origin_tech = "programming=2" -//shielding -/obj/item/weapon/circuitboard/shield_capacitor - name = "Circuit Board (Shield Capacitor)" - build_path = "/obj/machinery/shield_capacitor" - board_type = "machine" - origin_tech = "programming=3;electromagnetic=3;engineering=2;power=1" - frame_desc = "Requires, 2 Cable Coil, 2 Nano Manipulator, 1 Advanced Matter Bin, 1 Console Screen and 1 High-Power Micro-Laser. " - req_components = list( - "/obj/item/weapon/cable_coil" = 2, - "/obj/item/weapon/stock_parts/manipulator/nano" = 2, - "/obj/item/weapon/stock_parts/matter_bin/adv" = 1, - "/obj/item/weapon/stock_parts/console_screen" = 1, - "/obj/item/weapon/stock_parts/micro_laser/high" = 1) - -/obj/item/weapon/circuitboard/shield_generator_external - name = "Circuit Board (Hull Shield Generator)" - build_path = "/obj/machinery/shield_generator/external" - board_type = "machine" - origin_tech = "programming=3;electromagnetic=3;engineering=2;power=1" - frame_desc = "Requires, 2 Cable Coil, 2 Nano Manipulator, 1 Advanced Matter Bin, 1 Console Screen and 1 High-Power Micro-Laser. " - req_components = list( - "/obj/item/weapon/cable_coil" = 2, - "/obj/item/weapon/stock_parts/manipulator/nano" = 2, - "/obj/item/weapon/stock_parts/matter_bin/adv" = 1, - "/obj/item/weapon/stock_parts/console_screen" = 1, - "/obj/item/weapon/stock_parts/micro_laser/high" = 1) - - /obj/item/weapon/circuitboard/supplycomp/attackby(obj/item/I as obj, mob/user as mob) if(istype(I,/obj/item/device/multitool)) var/catastasis = src.contraband_enabled @@ -277,21 +220,31 @@ switch( alert("Current receiver spectrum is set to: [catastasis]","Multitool-Circuitboard interface","Switch to [opposite_catastasis]","Cancel") ) //switch( alert("Current receiver spectrum is set to: " {(src.contraband_enabled) ? ("BROAD") : ("STANDARD")} , "Multitool-Circuitboard interface" , "Switch to " {(src.contraband_enabled) ? ("STANDARD") : ("BROAD")}, "Cancel") ) if("Switch to STANDARD","Switch to BROAD") - if(src.contraband_enabled) - src.contraband_enabled = 0 - else - src.contraband_enabled = 1 - else if("Cancel") + src.contraband_enabled = !src.contraband_enabled + + if("Cancel") return else user << "DERP! BUG! Report this (And what you were doing to cause it) to Agouri" return +/obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) + if(istype(I,/obj/item/weapon/screwdriver)) + if(src.build_path == "/obj/machinery/computer/rdconsole/core") + src.name = "Circuit Board (RD Console - Robotics)" + src.build_path = "/obj/machinery/computer/rdconsole/robotics" + user << "\blue Access protocols succesfully updated." + else + src.name = "Circuit Board (RD Console)" + src.build_path = "/obj/machinery/computer/rdconsole/core" + user << "\blue Defaulting access protocols." + return + /obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob) switch(state) if(0) if(istype(P, /obj/item/weapon/wrench)) - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) user << "\blue You wrench the frame into place." src.anchored = 1 @@ -301,7 +254,7 @@ if(!WT.remove_fuel(0, user)) user << "The welding tool must be on to complete this task." return - playsound(src.loc, 'Welder.ogg', 50, 1) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, 20)) if(!src || !WT.isOn()) return user << "\blue You deconstruct the frame." @@ -309,7 +262,7 @@ del(src) if(1) if(istype(P, /obj/item/weapon/wrench)) - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) user << "\blue You unfasten the frame." src.anchored = 0 @@ -317,24 +270,21 @@ if(istype(P, /obj/item/weapon/circuitboard) && !circuit) var/obj/item/weapon/circuitboard/B = P if(B.board_type == "computer") - if(B.build_path != "" && !isnull(B.build_path)) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) - user << "\blue You place the circuit board inside the frame." - src.icon_state = "1" - src.circuit = P - user.drop_item() - P.loc = src - else - user << "\red That circuit board requires additional modifications before it can be used." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + user << "\blue You place the circuit board inside the frame." + src.icon_state = "1" + src.circuit = P + user.drop_item() + P.loc = src else user << "\red This frame does not accept circuit boards of this type!" if(istype(P, /obj/item/weapon/screwdriver) && circuit) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "\blue You screw the circuit board into place." src.state = 2 src.icon_state = "2" if(istype(P, /obj/item/weapon/crowbar) && circuit) - playsound(src.loc, 'Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "\blue You remove the circuit board." src.state = 1 src.icon_state = "0" @@ -342,13 +292,13 @@ src.circuit = null if(2) if(istype(P, /obj/item/weapon/screwdriver) && circuit) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "\blue You unfasten the circuit board." src.state = 1 src.icon_state = "1" if(istype(P, /obj/item/weapon/cable_coil)) if(P:amount >= 5) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) if(P) P:amount -= 5 @@ -358,7 +308,7 @@ src.icon_state = "3" if(3) if(istype(P, /obj/item/weapon/wirecutters)) - playsound(src.loc, 'wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "\blue You remove the cables." src.state = 2 src.icon_state = "2" @@ -367,7 +317,7 @@ if(istype(P, /obj/item/stack/sheet/glass)) if(P:amount >= 2) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) if(P) P:use(2) @@ -376,22 +326,21 @@ src.icon_state = "4" if(4) if(istype(P, /obj/item/weapon/crowbar)) - playsound(src.loc, 'Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "\blue You remove the glass panel." src.state = 3 src.icon_state = "3" new /obj/item/stack/sheet/glass( src.loc, 2 ) if(istype(P, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "\blue You connect the monitor." - if(circuit && circuit.build_path) - var/B = new circuit.build_path (loc) - if(circuit.powernet) B:powernet = circuit.powernet - if(circuit.id) B:id = circuit.id - if(circuit.records) B:records = circuit.records - if(circuit.frequency) B:frequency = circuit.frequency - if(istype(circuit,/obj/item/weapon/circuitboard/supplycomp)) - var/obj/machinery/computer/supplycomp/SC = B - var/obj/item/weapon/circuitboard/supplycomp/C = circuit - SC.can_order_contraband = C.contraband_enabled - del(src) + var/B = new src.circuit.build_path ( src.loc ) + if(circuit.powernet) B:powernet = circuit.powernet + if(circuit.id) B:id = circuit.id + if(circuit.records) B:records = circuit.records + if(circuit.frequency) B:frequency = circuit.frequency + if(istype(circuit,/obj/item/weapon/circuitboard/supplycomp)) + var/obj/machinery/computer/supplycomp/SC = B + var/obj/item/weapon/circuitboard/supplycomp/C = circuit + SC.can_order_contraband = C.contraband_enabled + del(src) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm new file mode 100644 index 0000000000..b84684e6d5 --- /dev/null +++ b/code/game/machinery/computer/camera.dm @@ -0,0 +1,93 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 + + +/obj/machinery/computer/security + name = "Security Cameras" + desc = "Used to access the various cameras on the station." + icon_state = "cameras" + circuit = "/obj/item/weapon/circuitboard/security" + var/obj/machinery/camera/current = null + var/last_pic = 1.0 + var/network = "SS13" + var/mapping = 0//For the overview file, interesting bit of code. + + + attack_ai(var/mob/user as mob) + return attack_hand(user) + + + attack_paw(var/mob/user as mob) + return attack_hand(user) + + + check_eye(var/mob/user as mob) + if ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded || !( current ) || !( current.status )) && (!istype(user, /mob/living/silicon))) + return null + user.reset_view(current) + return 1 + + + attack_hand(var/mob/user as mob) + if(stat & (NOPOWER|BROKEN)) return + + user.machine = src + + var/list/L = list() + for (var/obj/machinery/camera/C in Cameras) + L.Add(C) + + camera_sort(L) + + var/list/D = list() + D["Cancel"] = "Cancel" + for(var/obj/machinery/camera/C in L) + if(C.network == network) + D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C + + var/t = input(user, "Which camera should you change to?") as null|anything in D + if(!t) + user.machine = null + return 0 + + var/obj/machinery/camera/C = D[t] + + if(t == "Cancel") + user.machine = null + return 0 + + if(C) + if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( user.canmove ) || !( C.status )) && (!istype(user, /mob/living/silicon/ai))) + if(!C.status) + src.current = null + return 0 + else + src.current = C + use_power(50) + spawn( 5 ) + attack_hand(user) + return + + + +/obj/machinery/computer/security/telescreen + name = "Telescreen" + desc = "Used for watching an empty arena." + icon = 'icons/obj/stationobjs.dmi' + icon_state = "telescreen" + network = "thunder" + density = 0 + circuit = null + + +/obj/machinery/computer/security/wooden_tv + name = "Security Cameras" + desc = "An old TV hooked into the stations camera network." + icon_state = "security_det" + + +/obj/machinery/computer/security/mining + name = "Outpost Cameras" + desc = "Used to access the various cameras on the outpost." + icon_state = "miningcameras" + network = "MINE" + circuit = "/obj/item/weapon/circuitboard/mining" diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 66f4e76e5f..f8118d304c 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -1,10 +1,10 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/card name = "Identification Computer" - desc = "A computer used to modify ID cards." + desc = "You can use this to change ID's." icon_state = "id" - req_access = list(ACCESS_CHANGE_IDS) + req_access = list(access_change_ids) circuit = "/obj/item/weapon/circuitboard/card" var/obj/item/weapon/card/id/scan = null var/obj/item/weapon/card/id/modify = null @@ -16,7 +16,7 @@ /obj/machinery/computer/card/attackby(O as obj, user as mob)//TODO:SANITY if(istype(O, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/idcard = O - if(ACCESS_CHANGE_IDS in idcard.access) + if(access_change_ids in idcard.access) if(!scan) usr.drop_item() idcard.loc = src @@ -51,8 +51,14 @@ if (!( ticker )) return if (mode) // accessing crew manifest - var/crew = data_core.get_manifest() - dat = "Crew Manifest:
      Please use the security record computer to modify entries.
      [crew]Print

      Access ID modification console.
      " + var/crew = "" + var/list/L = list() + for (var/datum/data/record/t in data_core.general) + var/R = t.fields["name"] + " - " + t.fields["rank"] + L += R + for(var/R in sortList(L)) + crew += "[R]
      " + dat = "Crew Manifest:
      Please use security record computer to modify entries.

      [crew]Print

      Access ID modification console.
      " else var/header = "
      Identification Card Modifier
      " @@ -120,7 +126,7 @@ carddesc += "
      " carddesc += "" carddesc += "" - carddesc += "Registered: " + carddesc += "registered_name: " carddesc += "" carddesc += "
      " carddesc += "Assignment: " @@ -152,14 +158,7 @@ accesses += "
      " accesses += "" accesses += "" - - var/biometric = "" - biometric += "Biometric Data:
      \ - Blood type: [modify.blood_type]
      \ - DNA hash: [modify.dna_hash]
      \ - Fingerprint hash: [modify.fingerprint_hash]" - - body = "[carddesc]
      [jobs]
      [biometric]

      [accesses]" //CHECK THIS + body = "[carddesc]
      [jobs]

      [accesses]" //CHECK THIS else body = "{Log in}

      " body += "Access Crew Manifest" @@ -174,34 +173,20 @@ return usr.machine = src switch(href_list["choice"]) - if("bio_btype") - var/new_b_type = input("Please input the blood type.", "Biometric Input") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" ) - if(new_b_type) - modify.blood_type = new_b_type - - if("bio_dna") - modify.dna_hash = input("Please input the DNA hash.", "Biometric Input", modify.dna_hash) - - if("bio_fprint") - modify.fingerprint_hash = input("Please input the fingerprint hash.", "Biometric Input", modify.fingerprint_hash) - if ("modify") if (modify) data_core.manifest_modify(modify.registered_name, modify.assignment) - if(istype(modify,/obj/item/weapon/card/id/fluff/lifetime)) - modify.name = text("[modify.registered_name]'s Lifetime ID Card ([modify.assignment])") - else - modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])") + modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])") if(ishuman(usr)) modify.loc = usr.loc if(!usr.get_active_hand()) - usr.put_in_hand(modify) + usr.put_in_hands(modify) modify = null else modify.loc = loc modify = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src @@ -213,13 +198,13 @@ if(ishuman(usr)) scan.loc = usr.loc if(!usr.get_active_hand()) - usr.put_in_hand(scan) + usr.put_in_hands(scan) scan = null else scan.loc = src.loc scan = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src @@ -246,7 +231,7 @@ if (authenticated) var/t1 = href_list["assign_target"] if(t1 == "Custom") - var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_NAME_LEN) + var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN) if(temp_t) t1 = temp_t else @@ -266,8 +251,15 @@ printing = 1 sleep(50) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc ) - P.info = "Crew Manifest:
      " + data_core.get_manifest() - P.name = "paper - 'Crew Manifest'" + var/t1 = "Crew Manifest:
      " + var/list/L = list() + for (var/datum/data/record/t in data_core.general) + var/R = t.fields["name"] + " - " + t.fields["rank"] + L += R + for(var/R in sortList(L)) + t1 += "[R]
      " + P.info = t1 + P.name = "paper- 'Crew Manifest'" printing = null if (modify) modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])") @@ -279,5 +271,5 @@ /obj/machinery/computer/card/centcom name = "CentCom Identification Computer" circuit = "/obj/item/weapon/circuitboard/card/centcom" - req_access = list(ACCESS_CENT_CAPTAIN) + req_access = list(access_cent_captain) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index a4252c112f..a90d457c5a 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -1,12 +1,14 @@ /obj/machinery/computer/scan_consolenew name = "DNA Modifier Access Console" - desc = "Scans DNA." - icon = 'computer.dmi' + desc = "Scand DNA." + icon = 'icons/obj/computer.dmi' icon_state = "scanner" density = 1 var/uniblock = 1.0 var/strucblock = 1.0 var/subblock = 1.0 + var/unitarget = 1 + var/unitargethex = 1 var/status = null var/radduration = 2.0 var/radstrength = 1.0 @@ -31,7 +33,6 @@ var/temphtml = null var/obj/machinery/dna_scanner/connected = null var/obj/item/weapon/disk/data/diskette = null - var/list/message = list() anchored = 1.0 use_power = 1 idle_power_usage = 10 @@ -39,7 +40,7 @@ /obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -78,10 +79,10 @@ /obj/machinery/computer/cloning name = "Cloning console" - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "dna" circuit = "/obj/item/weapon/circuitboard/cloning" - req_access = list(ACCESS_HEADS) //Only used for record deletion right now. + req_access = list(access_heads) //Only used for record deletion right now. var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning. var/obj/machinery/clonepod/pod1 = null //Linked cloning pod. var/temp = "" @@ -91,9 +92,6 @@ var/datum/data/record/active_record = null var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything. var/loading = 0 // Nice loading text - var/wantsscan = 1 - var/wantspod = 1 - var/list/message = list() /obj/machinery/computer/cloning/New() ..() @@ -106,14 +104,14 @@ src.scanner = findscanner() src.pod1 = findcloner() - if (!isnull(src.pod1) && !wantspod) + if (!isnull(src.pod1)) src.pod1.connected = src // Some variable the pod needs /obj/machinery/computer/cloning/proc/findscanner() var/obj/machinery/dna_scannernew/scannerf = null // Loop through every direction - for(dir in list(1,2,4,8,5,6,9,10)) + for(dir in list(NORTH,EAST,SOUTH,WEST)) // Try to find a scanner in that direction scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir)) @@ -122,14 +120,13 @@ if (!isnull(scannerf)) break - // If no scanner was found, it will return null return scannerf /obj/machinery/computer/cloning/proc/findcloner() var/obj/machinery/clonepod/podf = null - for(dir in list(1,2,4,8,5,6,9,10)) + for(dir in list(NORTH,EAST,SOUTH,WEST)) podf = locate(/obj/machinery/clonepod, get_step(src, dir)) @@ -158,9 +155,6 @@ return attack_hand(user) /obj/machinery/computer/cloning/attack_hand(mob/user as mob) - if(!(user in message)) - user << "\blue This machine looks extremely complex. You'd probably need a decent knowledge of Genetics to understand it." - message += user user.machine = src add_fingerprint(user) @@ -176,40 +170,50 @@ switch(src.menu) if(1) - if(wantsscan) - dat += "

      Scanner Functions

      " + // Modules + dat += "

      Modules

      " + //dat += "Reload Modules" + if (isnull(src.scanner)) + dat += " Scanner-ERROR
      " + else + dat += " Scanner-Found!
      " + if (isnull(src.pod1)) + dat += " Pod-ERROR
      " + else + dat += " Pod-Found!
      " - if (isnull(src.scanner)) - dat += "No scanner connected!
      " + // Scanner + dat += "

      Scanner Functions

      " + + if(loading) + dat += "Scanning...
      " + else + dat += "[scantemp]
      " + + if (isnull(src.scanner)) + dat += "No scanner connected!
      " + else + if (src.scanner.occupant) + if(scantemp == "Scanner unoccupied") scantemp = "" // Stupid check to remove the text + + dat += "Scan - [src.scanner.occupant]
      " else - if (src.scanner.occupant) - if(scantemp == "Scanner unoccupied") scantemp = "" // Stupid check to remove the text + scantemp = "Scanner unoccupied" - // Make sure we can't scan a headless person. It breaks the cloner permanently. - var/datum/organ/external/temp = src.scanner.occupant.organs["head"] - if(temp && !(temp.status & ORGAN_DESTROYED)) - dat += "Scan - [src.scanner.occupant]
      " - else - dat += "Error: Cannot locate brain for mental indexing. Unable to continue.
      " - else - dat += "Scanner unoccupied" + dat += "Lock status: [src.scanner.locked ? "Locked" : "Unlocked"]
      " - dat += "Lock status: [src.scanner.locked ? "Locked" : "Unlocked"]
      " - - // Database - dat += "

      Database Functions

      " - dat += "View Records
      " - if (src.diskette) - dat += "Eject Disk" + // Database + dat += "

      Database Functions

      " + dat += "View Records
      " + if (src.diskette) + dat += "Eject Disk" if(2) dat += "

      Current records

      " dat += "Back

      " - for(var/id in geneticsrecords) - var/datum/data/record/R = geneticsrecords[id] - if(R) - dat += "[R.fields["id"]]-[R.fields["name"]]
      " + for(var/datum/data/record/R in src.records) + dat += "[R.fields["id"]]-[R.fields["name"]]
      " if(3) dat += "

      Selected Record

      " @@ -239,9 +243,8 @@ dat += "
      " //Keeping a line empty for appearances I guess. dat += {"UI: [src.active_record.fields["UI"]]
      - SE: [src.active_record.fields["SE"]]

      "} - if(wantspod) - dat += "Clone
      " + SE: [src.active_record.fields["SE"]]

      + Clone
      "} if(4) if (!src.active_record) @@ -285,7 +288,7 @@ src.scanner.locked = 0 else if (href_list["view_rec"]) - src.active_record = geneticsrecords[href_list["view_rec"]] + src.active_record = locate(href_list["view_rec"]) if ((isnull(src.active_record.fields["ckey"])) || (src.active_record.fields["ckey"] == "")) del(src.active_record) src.temp = "ERROR: Record Corrupt" @@ -300,10 +303,10 @@ src.menu = 4 else if (src.menu == 4) - var/obj/item/weapon/card/id/C = usr.equipped() + var/obj/item/weapon/card/id/C = usr.get_active_hand() if (istype(C)||istype(C, /obj/item/device/pda)) if(src.check_access(C)) - geneticsrecords.Remove(active_record["id"]) + src.records.Remove(src.active_record) del(src.active_record) src.temp = "Record deleted." src.menu = 2 @@ -363,22 +366,28 @@ src.updateUsrDialog() else if (href_list["clone"]) - var/datum/data/record/C = geneticsrecords[href_list["clone"]] + var/datum/data/record/C = locate(href_list["clone"]) //Look for that player! They better be dead! - if(C) - var/mob/selected = find_dead_player("[C.fields["ckey"]]") - selected << 'chime.ogg' //probably not the best sound but I think it's reasonable - var/answer = alert(selected,"Do you want to return to life?","Cloning","Yes","No") - if(answer == "No") - selected = null -//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs. - if ((!selected) || (!src.pod1) || (src.pod1.occupant) || (src.pod1.mess) || !config.revival_cloning) - src.temp = "Unable to initiate cloning cycle." // most helpful error message in THE HISTORY OF THE WORLD - else if (src.pod1.growclone(selected, C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["interface"],C.fields["changeling"],C.fields["original"])) - src.temp = "Cloning cycle activated." - geneticsrecords.Remove(C.fields["id"]) + if(istype(C)) + //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs. + if(!pod1) + temp = "Error: No Clonepod detected." + else if(pod1.occupant) + temp = "Error: Clonepod is currently occupied." + else if(pod1.mess) + temp = "Error: Clonepod malfunction." + else if(!config.revival_cloning) + temp = "Error: Unable to initiate cloning cycle." + else if(pod1.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["interface"])) + temp = "Initiating cloning cycle..." + records.Remove(C) del(C) - src.menu = 1 + menu = 1 + else + temp = "Initiating cloning cycle...
      Error: Post-initialisation failed. Cloning cycle aborted." + + else + temp = "Error: Data corruption." else if (href_list["menu"]) src.menu = text2num(href_list["menu"]) @@ -389,39 +398,36 @@ /obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject as mob) if ((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna)) - src.temp = "Error: Unable to locate valid genetic data." + scantemp = "Error: Unable to locate valid genetic data." return if (subject.brain_op_stage == 4.0) - src.temp = "Error: No signs of intelligence detected." + scantemp = "Error: No signs of intelligence detected." + return + if (subject.suiciding == 1) + scantemp = "Error: Subject's brain is not responding to scanning stimuli." + return + if ((!subject.ckey) || (!subject.client)) + scantemp = "Error: Mental interface failure." return -// if (subject.suiciding == 1) -// src.temp = "Error: Subject's brain is not responding to scanning stimuli." -// return -// if ((!subject.ckey) || (!subject.client)) -// src.temp = "Error: Mental interface failure." -// return if (NOCLONE in subject.mutations) - src.temp = "Error: Mental interface failure." + scantemp = "Error: Mental interface failure." return if (!isnull(find_record(subject.ckey))) - src.temp = "Subject already in database." + scantemp = "Subject already in database." return subject.dna.check_integrity() - var/ckey = subject.ckey - if(!ckey && subject && subject.mind) - ckey = subject.mind.key - var/datum/data/record/R = new /datum/data/record( ) - R.fields["mrace"] = subject.mutantrace - R.fields["ckey"] = ckey + if(subject.dna) + R.fields["mrace"] = subject.dna.mutantrace + else + R.fields["mrace"] = null + R.fields["ckey"] = subject.ckey R.fields["name"] = subject.real_name R.fields["id"] = copytext(md5(subject.real_name), 2, 6) R.fields["UI"] = subject.dna.uni_identity R.fields["SE"] = subject.dna.struc_enzymes - R.fields["changeling"] = subject.changeling - R.fields["original"] = subject.original_name // Preferences stuff R.fields["interface"] = subject.UI @@ -431,9 +437,7 @@ //Add an implant if needed var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject) if (isnull(imp)) - var/datum/organ/external/O = subject.organs[pick(subject.organs)] - imp = new /obj/item/weapon/implant/health(O) - O.implant += imp + imp = new /obj/item/weapon/implant/health(subject) imp.implanted = subject R.fields["imp"] = "\ref[imp]" //Update it if needed @@ -443,13 +447,13 @@ if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning. R.fields["mind"] = "\ref[subject.mind]" - geneticsrecords["[copytext(md5(subject.real_name), 2, 6)]"] = R //Save it to the global scan list. - src.temp = "Subject successfully scanned." + src.records += R + scantemp = "Subject successfully scanned." //Find a specific record by key. /obj/machinery/computer/cloning/proc/find_record(var/find_key) var/selected_record = null - for(var/datum/data/record/R in geneticsrecords) + for(var/datum/data/record/R in src.records) if (R.fields["ckey"] == find_key) selected_record = R break diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index f0da4e744e..6000589992 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -1,11 +1,11 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 // The communications computer /obj/machinery/computer/communications name = "Communications Console" desc = "This can be used for various important functions. Still under developement." icon_state = "comm" - req_access = list(ACCESS_HEADS) + req_access = list(access_heads) circuit = "/obj/item/weapon/circuitboard/communications" var/prints_intercept = 1 var/authenticated = 0 @@ -27,7 +27,6 @@ var/const/STATE_STATUSDISPLAY = 7 var/const/STATE_ALERT_LEVEL = 8 var/const/STATE_CONFIRM_LEVEL = 9 - var/const/STATE_CREWTRANSFER = 10 var/status_display_freq = "1435" var/stat_msg1 @@ -54,26 +53,26 @@ src.state = STATE_DEFAULT if("login") var/mob/M = usr - var/obj/item/weapon/card/id/I = M.equipped() + var/obj/item/weapon/card/id/I = M.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id if (I && istype(I)) if(src.check_access(I)) authenticated = 1 - if((ACCESS_HOP in I.access) || (ACCESS_CAPTAIN in I.access)) + if(20 in I.access) authenticated = 2 if("logout") authenticated = 0 if("swipeidseclevel") var/mob/M = usr - var/obj/item/weapon/card/id/I = M.equipped() + var/obj/item/weapon/card/id/I = M.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id if (I && istype(I)) - if((ACCESS_HOP in I.access) || (ACCESS_CAPTAIN in I.access)) + if(access_captain in I.access) var/old_level = security_level if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN @@ -83,7 +82,7 @@ //Only notify the admins if an actual change happened log_game("[key_name(usr)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].", 1) - switch(get_security_level()) + switch(security_level) if(SEC_LEVEL_GREEN) feedback_inc("alert_comms_green",1) if(SEC_LEVEL_BLUE) @@ -99,7 +98,7 @@ if("announce") if(src.authenticated==2) if(message_cooldown) return - var/input = copytext(input(usr, "Please choose a message to announce to the station crew.", "What?", ""),1,MAX_MESSAGE_LEN) + var/input = copytext(strip_html_simple(input(usr, "Please choose a message to announce to the station crew.", "What?", "")),1,MAX_MESSAGE_LEN) if(!input || !(usr in view(1,src))) return captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain @@ -119,16 +118,6 @@ if(emergency_shuttle.online) post_status("shuttle") src.state = STATE_DEFAULT - if("crewtransfer") - src.state= STATE_DEFAULT - if(src.authenticated) - src.state = STATE_CREWTRANSFER - if("crewtransfer2") - if(src.authenticated) - init_shift_change(usr) //key difference here - if(emergency_shuttle.online) - post_status("shuttle") - src.state = STATE_DEFAULT if("cancelshuttle") src.state = STATE_DEFAULT if(src.authenticated) @@ -193,10 +182,10 @@ return Centcomm_announce(input, usr) usr << "Message transmitted." - log_say("[key_name(usr)] has sent Centcomm a message: [input]") + log_say("[key_name(usr)] has made a Centcomm announcement: [input]") centcomm_message_cooldown = 1 - spawn(50)//One minute cooldown, nah 5 seconds - centcomm_message_cooldown = 0 + spawn(600)//One minute cooldown + message_cooldown = 0 // OMG SYNDICATE ...LETTERHEAD @@ -210,10 +199,10 @@ return Syndicate_announce(input, usr) usr << "Message transmitted." - log_say("[key_name(usr)] has sent the Syndicate a message: [input]") + log_say("[key_name(usr)] has made a Syndicate announcement: [input]") centcomm_message_cooldown = 1 - spawn(50)//One minute cooldown, nah 5 seconds - centcomm_message_cooldown = 0 + spawn(600)//One minute cooldown + message_cooldown = 0 if("RestoreBackup") usr << "Backup routing data restored!" @@ -318,7 +307,6 @@ dat += "
      \[ Cancel Shuttle Call \]" else dat += "
      \[ Call Emergency Shuttle \]" - dat += "
      \[ Initiate Crew Transfer \]" dat += "
      \[ Set Status Display \]" else @@ -326,8 +314,6 @@ dat += "
      \[ Message List \]" if(STATE_CALLSHUTTLE) dat += "Are you sure you want to call the shuttle? \[ OK | Cancel \]" - if(STATE_CREWTRANSFER) // this is the shiftchage screen. - dat += "Are you sure you want to initiate a crew transfer? This will call the shuttle. \[ OK | Cancel \]" if(STATE_CANCELSHUTTLE) dat += "Are you sure you want to cancel the shuttle? \[ OK | Cancel \]" if(STATE_MESSAGELIST) @@ -454,10 +440,6 @@ if ((!( ticker ) || emergency_shuttle.location)) return - if(emergency_shuttle.deny_shuttle) - user << "Centcom does not currently have a shuttle available in your sector. Please try again later." - return - if(sent_strike_team == 1) user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated." return @@ -478,58 +460,15 @@ //New version pretends to call the shuttle but cause the shuttle to return after a random duration. emergency_shuttle.fake_recall = rand(300,500) - if(ticker.mode.name == "blob" || ticker.mode.name == "epidemic") + if(ticker.mode.name == "blob") user << "Under directive 7-10, [station_name()] is quarantined until further notice." return - emergency_shuttle.shuttlealert(0) emergency_shuttle.incall() log_game("[key_name(user)] has called the shuttle.") message_admins("[key_name_admin(user)] has called the shuttle.", 1) captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") - world << sound('shuttlecalled.ogg') - - return - -/proc/init_shift_change(var/mob/user, var/force = 0) - if ((!( ticker ) || emergency_shuttle.location)) - return - - if(emergency_shuttle.direction == -1) - user << "The shuttle may not be called while returning to CentCom." - return - - if(emergency_shuttle.online) - user << "The shuttle is already on its way." - return - - // if force is 0, some things may stop the shuttle call - if(!force) - if(emergency_shuttle.deny_shuttle) - user << "Centcom does not currently have a shuttle available in your sector. Please try again later." - return - - if(sent_strike_team == 1) - user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated." - return - - if(world.time < 54000) // 30 minute grace period to let the game get going - user << "The shuttle is refueling. Please wait another [round((54000-world.time)/600)] minutes before trying again."//may need to change "/600" - return - - if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "sandbox") - //New version pretends to call the shuttle but cause the shuttle to return after a random duration. - emergency_shuttle.fake_recall = rand(300,500) - - if(ticker.mode.name == "blob" || ticker.mode.name == "epidemic") - user << "Under directive 7-10, [station_name()] is quarantined until further notice." - return - - emergency_shuttle.shuttlealert(1) - emergency_shuttle.incall() - log_game("[key_name(user)] has called the shuttle.") - message_admins("[key_name_admin(user)] has called the shuttle.", 1) - captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") + world << sound('sound/AI/shuttlecalled.ogg') return @@ -577,7 +516,7 @@ if(istype(commboard.loc,/turf) || istype(commboard.loc,/obj/item/weapon/storage)) return ..() - for(var/mob/living/silicon/ai/shuttlecaller in world) + for(var/mob/living/silicon/ai/shuttlecaller in player_list) if(!shuttlecaller.stat && shuttlecaller.client && istype(shuttlecaller.loc,/turf)) return ..() @@ -588,7 +527,7 @@ log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.") message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1) captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") - world << sound('shuttlecalled.ogg') + world << sound('sound/AI/shuttlecalled.ogg') ..() @@ -602,7 +541,7 @@ if((istype(commboard.loc,/turf) || istype(commboard.loc,/obj/item/weapon/storage)) && commboard != src) return ..() - for(var/mob/living/silicon/ai/shuttlecaller in world) + for(var/mob/living/silicon/ai/shuttlecaller in player_list) if(!shuttlecaller.stat && shuttlecaller.client && istype(shuttlecaller.loc,/turf)) return ..() @@ -613,6 +552,6 @@ log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.") message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1) captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") - world << sound('shuttlecalled.ogg') + world << sound('sound/AI/shuttlecalled.ogg') ..() diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index f7bef1b2d5..f7c208c92e 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -1,356 +1,131 @@ -/*CONTENTS -General Computer -Security Computer -Comm Computer -ID Computer -Pod/Blast Doors computer -*/ +/obj/machinery/computer + name = "computer" + icon = 'icons/obj/computer.dmi' + density = 1 + anchored = 1.0 + var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassemble -/obj/machinery/computer/New() - ..() - spawn(2) - power_change() -/obj/machinery/computer/meteorhit(var/obj/O as obj) - for(var/x in verbs) - verbs -= x - set_broken() - var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() - smoke.set_up(5, 0, src) - smoke.start() - return + New() + ..() + spawn(2) + power_change() -/obj/machinery/computer/emp_act(severity) - if(prob(20/severity)) set_broken() - ..() -/obj/machinery/computer/ex_act(severity) - switch(severity) - if(1.0) - del(src) - return - if(2.0) - if (prob(25)) - del(src) - return - if (prob(50)) - for(var/x in verbs) - verbs -= x - set_broken() - if(3.0) - if (prob(25)) - for(var/x in verbs) - verbs -= x - set_broken() - else - return - -/obj/machinery/computer/blob_act() - if (prob(75)) + meteorhit(var/obj/O as obj) for(var/x in verbs) verbs -= x set_broken() - density = 0 + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + smoke.set_up(5, 0, src) + smoke.start() + return -/obj/machinery/computer/power_change() - if(!istype(src,/obj/machinery/computer/security/telescreen)) - if(stat & BROKEN) - icon_state = initial(icon_state) - icon_state += "b" - if (istype(src,/obj/machinery/computer/aifixer)) - overlays = null - else if(powered()) - icon_state = initial(icon_state) - stat &= ~NOPOWER - if (istype(src,/obj/machinery/computer/aifixer)) - var/obj/machinery/computer/aifixer/O = src - if (O.occupant) - switch (O.occupant.stat) - if (0) - overlays += image('computer.dmi', "ai-fixer-full") - if (2) - overlays += image('computer.dmi', "ai-fixer-404") - else - overlays += image('computer.dmi', "ai-fixer-empty") - else - spawn(rand(0, 15)) - //icon_state = "c_unpowered" + emp_act(severity) + if(prob(20/severity)) set_broken() + ..() + + + ex_act(severity) + switch(severity) + if(1.0) + del(src) + return + if(2.0) + if (prob(25)) + del(src) + return + if (prob(50)) + for(var/x in verbs) + verbs -= x + set_broken() + if(3.0) + if (prob(25)) + for(var/x in verbs) + verbs -= x + set_broken() + else + return + + + blob_act() + if (prob(75)) + for(var/x in verbs) + verbs -= x + set_broken() + density = 0 + + + power_change() + if(!istype(src,/obj/machinery/computer/security/telescreen)) + if(stat & BROKEN) icon_state = initial(icon_state) - icon_state += "0" - stat |= NOPOWER + icon_state += "b" if (istype(src,/obj/machinery/computer/aifixer)) overlays = null -/obj/machinery/computer/process() - if(stat & (NOPOWER|BROKEN)) - return - use_power(750) - -/obj/machinery/computer/proc/set_broken() - icon_state = initial(icon_state) - icon_state += "b" - stat |= BROKEN - -/obj/machinery/computer/attackby(I as obj, user as mob) - if(istype(I, /obj/item/weapon/screwdriver) && circuit) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/M = new circuit( A ) - A.circuit = M - A.anchored = 1 - for (var/obj/C in src) - C.loc = src.loc - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - new /obj/item/weapon/shard( src.loc ) - A.state = 3 - A.icon_state = "3" - else - user << "\blue You disconnect the monitor." - A.state = 4 - A.icon_state = "4" - del(src) - else - src.attack_hand(user) - return - - -/obj/machinery/computer/security/New() - ..() - verbs -= /obj/machinery/computer/security/verb/station_map - -/obj/machinery/computer/security/attack_ai(var/mob/user as mob) - return attack_hand(user) - -/obj/machinery/computer/security/attack_paw(var/mob/user as mob) - return attack_hand(user) - -/obj/machinery/computer/security/check_eye(var/mob/user as mob) - if ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded || !( current ) || !( current.status )) && (!istype(user, /mob/living/silicon))) - return null - user.reset_view(current) - return 1 - - -/obj/effect/datacore/proc/manifest(var/nosleep = 0) - spawn() - if(!nosleep) - sleep(40) - for(var/mob/living/carbon/human/H in world) - if (!isnull(H.mind) && (H.mind.assigned_role != "MODE")) - var/datum/data/record/G = new() - var/datum/data/record/M = new() - var/datum/data/record/S = new() - var/datum/data/record/L = new() - var/obj/item/weapon/card/id/C = H.wear_id - if (C) - G.fields["rank"] = C.assignment - G.fields["real_rank"] = H.mind.assigned_role - else - if(H.mind && H.mind.assigned_role) - G.fields["rank"] = H.mind.role_alt_title ? H.mind.role_alt_title : H.mind.assigned_role - G.fields["real_rank"] = H.mind.assigned_role + else if(powered()) + icon_state = initial(icon_state) + stat &= ~NOPOWER + if (istype(src,/obj/machinery/computer/aifixer)) + var/obj/machinery/computer/aifixer/O = src + if (O.occupant) + switch (O.occupant.stat) + if (0) + overlays += image('icons/obj/computer.dmi', "ai-fixer-full") + if (2) + overlays += image('icons/obj/computer.dmi', "ai-fixer-404") else - G.fields["rank"] = "Unassigned" - G.fields["real_rank"] = G.fields["rank"] - G.fields["name"] = H.real_name - G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) - M.fields["name"] = G.fields["name"] - M.fields["id"] = G.fields["id"] - S.fields["name"] = G.fields["name"] - S.fields["id"] = G.fields["id"] - if(H.gender == FEMALE) - G.fields["sex"] = "Female" - else - G.fields["sex"] = "Male" - G.fields["age"] = text("[]", H.age) - G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity)) - G.fields["p_stat"] = "Active" - G.fields["m_stat"] = "Stable" - M.fields["b_type"] = text("[]", H.dna.b_type) - M.fields["b_dna"] = H.dna.unique_enzymes - - var/minor_dis = null - if(H.disabilities) - if(H.disabilities & 1) - minor_dis += "Myopia, " - if(H.disabilities & 4) - minor_dis += "Persistant Cough, " - if(H.disabilities & 16) - minor_dis += "Stuttering, " - if(minor_dis) - M.fields["mi_dis"] = minor_dis - else - M.fields["mi_dis"] = "None" - - M.fields["mi_dis_d"] = "No additional minor disability notes." - - var/major_dis = null - if(H.disabilities) - if(H.disabilities & 2) - major_dis += "Epilepsy, " - if(H.disabilities & 8) - major_dis += "Tourette's Syndrome, " - if(H.disabilities & 32) - major_dis += "Deafness, " - if(major_dis) - M.fields["ma_dis"] = major_dis - else - M.fields["ma_dis"] = "None" - - M.fields["ma_dis_d"] = "No additional major disability notes." - M.fields["alg"] = "None" - M.fields["alg_d"] = "No additional allergy notes." - M.fields["cdi"] = "None" - M.fields["cdi_d"] = "No additional disease notes." - - if(H.med_record && !jobban_isbanned(H, "Records")) - M.fields["notes"] = H.med_record - else - M.fields["notes"] = "No notes found." - - S.fields["criminal"] = "None" - S.fields["mi_crim"] = "None" - S.fields["mi_crim_d"] = "No minor crime convictions." - S.fields["ma_crim"] = "None" - S.fields["ma_crim_d"] = "No major crime convictions." - - if(H.sec_record && !jobban_isbanned(H, "Records")) - S.fields["notes"] = H.sec_record - else - S.fields["notes"] = "No notes." - - - - //Begin locked reporting - L.fields["name"] = H.real_name - L.fields["sex"] = H.gender - L.fields["age"] = H.age - L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") - L.fields["rank"] = H.mind.role_alt_title ? H.mind.role_alt_title : H.mind.assigned_role - L.fields["real_rank"] = H.mind.assigned_role - L.fields["b_type"] = H.dna.b_type - L.fields["b_dna"] = H.dna.unique_enzymes - L.fields["enzymes"] = H.dna.struc_enzymes - L.fields["identity"] = H.dna.uni_identity - L.fields["image"] = getFlatIcon(H,0) - //End locked reporting - - general += G - medical += M - security += S - locked += L - return - -/obj/effect/datacore/proc/manifest_modify(var/name, var/assignment) - var/datum/data/record/foundrecord - - for(var/datum/data/record/t in data_core.general) - if(t.fields["name"] == name) - foundrecord = t - break - - if(foundrecord) - foundrecord.fields["rank"] = assignment - if(assignment in get_all_jobs()) - foundrecord.fields["real_rank"] = assignment - - -/obj/effect/datacore/proc/manifest_inject(var/mob/living/carbon/human/H) - if (!isnull(H.mind) && (H.mind.assigned_role != "MODE")) - var/datum/data/record/G = new() - var/datum/data/record/M = new() - var/datum/data/record/S = new() - var/datum/data/record/L = new() - var/obj/item/weapon/card/id/C = H.wear_id - if (C) - G.fields["rank"] = C.assignment - G.fields["real_rank"] = H.job - else - if(H.mind && H.mind.assigned_role) - G.fields["rank"] = H.mind.assigned_role - G.fields["real_rank"] = H.mind.assigned_role + overlays += image('icons/obj/computer.dmi', "ai-fixer-empty") else - G.fields["rank"] = "Unassigned" - G.fields["real_rank"] = G.fields["rank"] - G.fields["name"] = H.real_name - G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) - M.fields["name"] = G.fields["name"] - M.fields["id"] = G.fields["id"] - S.fields["name"] = G.fields["name"] - S.fields["id"] = G.fields["id"] - if (H.gender == FEMALE) - G.fields["sex"] = "Female" + spawn(rand(0, 15)) + //icon_state = "c_unpowered" + icon_state = initial(icon_state) + icon_state += "0" + stat |= NOPOWER + if (istype(src,/obj/machinery/computer/aifixer)) + overlays = null + + + process() + if(stat & (NOPOWER|BROKEN)) + return + use_power(250) + + + proc/set_broken() + icon_state = initial(icon_state) + icon_state += "b" + stat |= BROKEN + + + attackby(I as obj, user as mob) + if(istype(I, /obj/item/weapon/screwdriver) && circuit) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + if(do_after(user, 20)) + var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) + var/obj/item/weapon/circuitboard/M = new circuit( A ) + A.circuit = M + A.anchored = 1 + for (var/obj/C in src) + C.loc = src.loc + if (src.stat & BROKEN) + user << "\blue The broken glass falls out." + new /obj/item/weapon/shard( src.loc ) + A.state = 3 + A.icon_state = "3" + else + user << "\blue You disconnect the monitor." + A.state = 4 + A.icon_state = "4" + del(src) else - G.fields["sex"] = "Male" - G.fields["age"] = text("[]", H.age) - G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity)) - G.fields["p_stat"] = "Active" - G.fields["m_stat"] = "Stable" - M.fields["b_type"] = text("[]", H.dna.b_type) - M.fields["b_dna"] = H.dna.unique_enzymes - M.fields["mi_dis"] = "None" - M.fields["mi_dis_d"] = "No minor disabilities have been declared." - M.fields["ma_dis"] = "None" - M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." - M.fields["alg"] = "None" - M.fields["alg_d"] = "No allergies have been detected in this patient." - M.fields["cdi"] = "None" - M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - M.fields["notes"] = "No notes." - S.fields["criminal"] = "None" - S.fields["mi_crim"] = "None" - S.fields["mi_crim_d"] = "No minor crime convictions." - S.fields["ma_crim"] = "None" - S.fields["ma_crim_d"] = "No major crime convictions." - S.fields["notes"] = "No notes." - - //Begin locked reporting - L.fields["name"] = H.real_name - L.fields["sex"] = H.gender - L.fields["age"] = H.age - L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") - L.fields["rank"] = H.mind.role_alt_title ? H.mind.role_alt_title : H.mind.assigned_role - L.fields["real_rank"] = H.mind.assigned_role - L.fields["b_type"] = H.dna.b_type - L.fields["b_dna"] = H.dna.unique_enzymes - L.fields["enzymes"] = H.dna.struc_enzymes - L.fields["identity"] = H.dna.uni_identity - L.fields["image"] = getFlatIcon(H,0) - //End locked reporting - - general += G - medical += M - security += S - locked += L - - - - - - - - -/obj/machinery/mass_driver/proc/drive(amount) - if(stat & (BROKEN|NOPOWER)) + src.attack_hand(user) return - use_power(500) - var/O_limit - var/atom/target = get_edge_target_turf(src, dir) - for(var/atom/movable/O in loc) - if(!O.anchored||istype(O, /obj/mecha))//Mechs need their launch platforms. - O_limit++ - if(O_limit >= 20) - for(var/mob/M in hearers(src, null)) - M << "\blue The mass driver lets out a screech, it mustn't be able to handle any more items." - break - use_power(500) - spawn( 0 ) - O.throw_at(target, drive_range * power, power) - flick("mass_driver1", src) - return + + + diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 319c5f0a7d..e9d9f70387 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -26,10 +26,6 @@ interact(user) - process() - return - - power_change() if(stat & BROKEN) icon_state = "broken" @@ -44,7 +40,7 @@ Topic(href, href_list) - ..() + if(..()) return if( href_list["close"] ) usr << browse(null, "window=crewcomp") usr.machine = null @@ -64,29 +60,42 @@ user.machine = src src.scan() var/t = "Crew Monitoring
      " - t += "
      Refresh" - t += "
      Close" - t += "" + t += "
      Refresh " + t += "Close
      " + t += "
      NameVitalsPosition
      " + var/list/logs = list() for(var/obj/item/clothing/under/C in src.tracked) + var/log = "" if((C) && (C.has_sensor) && (C.loc) && (C.loc.z == 1) && C.sensor_mode) if(istype(C.loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = C.loc + var/dam1 = round(H.getOxyLoss(),1) var/dam2 = round(H.getToxLoss(),1) var/dam3 = round(H.getFireLoss(),1) var/dam4 = round(H.getBruteLoss(),1) + var/life_status = "[H.stat > 1 ? "Deceased" : "Living"]" + var/damage_report = "([dam1]/[dam2]/[dam3]/[dam4])" + if(H.wear_id) - t += "" + log += "" else - t += "" + log += "" + switch(C.sensor_mode) if(1) - t+= "" + log += "" if(2) - t += "" + log += "" if(3) - t += "" + var/area/player_area = get_area(H) + log += "" + logs += log + logs = sortList(logs) + for(var/log in logs) + t += log t += "
      NameVitalsPosition
      [H.wear_id.name]
      [H.wear_id.name]
      Unknown:
      Unknown:[H.stat > 1 ? "Deceased" : "Living"]Not Available
      [life_status]Not Available
      [H.stat > 1 ? "Deceased" : "Living"], [dam1] - [dam2] - [dam3] - [dam4]Not Available
      [life_status] [damage_report]Not Available
      [H.stat > 1 ? "Deceased" : "Living"], [dam2] - [dam2] - [dam3] - [dam4][get_area(H)] ([H.x], [H.y])
      [life_status] [damage_report][player_area.name] ([H.x], [H.y])
      " t += "
      " user << browse(t, "window=crewcomp;size=900x600") diff --git a/code/game/machinery/computer/hologram.dm b/code/game/machinery/computer/hologram.dm index 52866919b0..da6214e61f 100644 --- a/code/game/machinery/computer/hologram.dm +++ b/code/game/machinery/computer/hologram.dm @@ -1,9 +1,9 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/hologram_comp name = "Hologram Computer" desc = "Rumoured to control holograms." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "holo_console0" var/obj/machinery/hologram/projector/projector = null var/temp = null @@ -27,17 +27,17 @@ return /obj/machinery/computer/hologram_comp/proc/render() - var/icon/I = new /icon('human.dmi', "body_m_s") + var/icon/I = new /icon('icons/mob/human.dmi', "body_m_s") if (src.lumens >= 0) I.Blend(rgb(src.lumens, src.lumens, src.lumens), ICON_ADD) else I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), ICON_SUBTRACT) - I.Blend(new /icon('human.dmi', "mouth_m_s"), ICON_OVERLAY) - I.Blend(new /icon('human.dmi', "underwear1_m_s"), ICON_OVERLAY) + I.Blend(new /icon('icons/mob/human.dmi', "mouth_m_s"), ICON_OVERLAY) + I.Blend(new /icon('icons/mob/human.dmi', "underwear1_m_s"), ICON_OVERLAY) - var/icon/U = new /icon('human_face.dmi', "hair_a_s") + var/icon/U = new /icon('icons/mob/human_face.dmi', "hair_a_s") U.Blend(rgb(src.h_r, src.h_g, src.h_b), ICON_ADD) I.Blend(U, ICON_OVERLAY) @@ -67,7 +67,7 @@ del(src.projector.hologram) else src.projector.hologram = new(src.projector.loc) - src.projector.hologram.icon = 'human.dmi' + src.projector.hologram.icon = 'icons/mob/human.dmi' src.projector.hologram.icon_state = "body_m_s" src.projector.icon_state = "hologram1" src.render() diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 14b1e5b4e8..d81236c7b6 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/aiupload name = "AI Upload" @@ -80,113 +80,3 @@ else usr << "[src.current.name] selected for law changes." return - -/obj/machinery/computer/aistatus - name = "AI Status Panel" - desc = "This shows the status of the AI." - icon = 'mainframe.dmi' - icon_state = "left" -// brightnessred = 0 -// brightnessgreen = 2 -// brightnessblue = 0 - -/obj/machinery/computer/aistatus/attack_hand(mob/user as mob) - if(stat & NOPOWER) - user << "\red The status panel has no power!" - return - if(stat & BROKEN) - user << "\red The status panel is broken!" - return - if(!issilicon(user)) - user << "\red You don't understand any of this!" - else - user << "\blue You know all of this already, why are you messing with it?" - return - - -/obj/machinery/computer/aiupload/mainframe - name = "AI Mainframe Upload" - icon = 'mainframe.dmi' - icon_state = "aimainframe" - - -/obj/machinery/computer/borgupload/mainframe - name = "Borg Mainframe Upload" - icon = 'mainframe.dmi' - icon_state = "aimainframe" - - -/*Module Storage Unit/Closet! Solid, only modules fit in it.*/ -/obj/structure/aiuploadcloset - name = "AI Mainframe Module Storage Unit" - icon = 'mainframe.dmi' - icon_state = "right-closed" - density = 1 - - var/open = 0 /*It's closed!*/ - -/obj/structure/aiuploadcloset/New() - ..() - new /obj/item/weapon/aiModule/reset(src) - new /obj/item/weapon/aiModule/purge(src) - new /obj/item/weapon/aiModule/nanotrasen(src) - new /obj/item/weapon/aiModule/paladin(src) - new /obj/item/weapon/aiModule/asimov(src) - new /obj/item/weapon/aiModule/safeguard(src) - new /obj/item/weapon/aiModule/protectStation(src) - new /obj/item/weapon/aiModule/quarantine(src) - new /obj/item/weapon/aiModule/teleporterOffline(src) - new /obj/item/weapon/aiModule/oxygen(src) - new /obj/item/weapon/aiModule/oneHuman(src) - new /obj/item/weapon/aiModule/freeform(src) - for(var/obj/item/weapon/aiModule/M in src) - M.pixel_x = rand(-10, 10) - M.pixel_y = rand(-10, 10) - -/obj/structure/aiuploadcloset/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/aiModule)) - user.drop_item() - W.loc = get_turf(src) - else - return attack_hand(user) - -/obj/structure/aiuploadcloset/attack_hand(mob/user as mob) - if(!open) - var/temp_count - for(var/obj/item/weapon/aiModule/M in src) - M.loc = src.loc - temp_count++ - - user << "\blue You open the module storage unit, [temp_count > 0 ? "and take out all the modules." : "\red but it's empty!"]" - open = 1 - icon_state = "right-open" - - else - var/temp_count - for(var/obj/item/weapon/aiModule/M in get_turf(src)) - M.loc = src - temp_count++ - - user << "\blue [temp_count > 0 ? "You put all the modules back into the module storage unit, and then close it." : "You close the module storage unit."]" - open = 0 - icon_state = "right-closed" - -/obj/structure/aiuploadcloset/ex_act(severity) - switch(severity) - if (1) - for(var/obj/item/weapon/aiModule/M in src) - M.loc = src.loc - M.ex_act(severity) - del(src) - if (2) - if (prob(50)) - for(var/obj/item/weapon/aiModule/M in src) - M.loc = src.loc - M.ex_act(severity) - del(src) - if (3) - if (prob(5)) - for(var/obj/item/weapon/aiModule/M in src) - M.loc = src.loc - M.ex_act(severity) - del(src) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 42aa27699e..9a29181558 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -1,13 +1,12 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/med_data//TODO:SANITY name = "Medical Records" desc = "This can be used to check medical records." icon_state = "medcomp" - req_access = list(ACCESS_MEDICAL) + req_access = list(access_medical) circuit = "/obj/item/weapon/circuitboard/med_data" var/obj/item/weapon/card/id/scan = null - var/obj/item/weapon/disk/records/disk = null var/authenticated = null var/rank = null var/screen = null @@ -16,22 +15,6 @@ var/a_id = null var/temp = null var/printing = null - var/list/Perp - var/tempname = null - - -/obj/machinery/computer/med_data/attackby(obj/item/O as obj, user as mob) - if(istype(O, /obj/item/weapon/card/id) && !scan) - usr.drop_item() - O.loc = src - scan = O - user << "You insert [O]." - else if(istype(O, /obj/item/weapon/disk/records) && !disk) - usr.drop_item() - O.loc = src - disk = O - user << "You insert [O]." - ..() /obj/machinery/computer/med_data/attack_ai(user as mob) return src.attack_hand(user) @@ -50,113 +33,25 @@ if (src.authenticated) switch(src.screen) if(1.0) - dat += "

      " - dat += text("Search Records
      ", src) dat += {" -

      - - - - -
      Records:
      - - - - - - - - - "} - for(var/datum/data/record/R in data_core.general) - var/physstat = R.fields["p_stat"] - var/background - switch(physstat) - if("*Deceased*") - background = "'background-color:#CD853F;'" - if("*Unconscious*") - background = "'background-color:#DC143C;'" - if("Physically Unfit") - background = "'background-color:#3BB9FF;'" - if("Active") - background = "'background-color:#00FF7F;'" - if("") - background = "'background-color:#FFFFFF;'" - physstat = "No Record." - dat += text("", background, src, R, R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) - dat += text("", R.fields["fingerprint"]) - dat += text("", physstat) - dat += text("", R.fields["m_stat"]) - dat += "
      NameIDRankFingerprintsPhysical StatusMental Status
      [][][][][][]

      " - dat += "Virus Database
      " - dat += "Medbot Tracking
      " - dat += "Record Maintenance

      " - dat += "{Log Out}" +Search Records +
      List Records +
      +
      Virus Database +
      Medbot Tracking +
      +
      Record Maintenance +
      {Log Out}
      +"} if(2.0) - if(!Perp.len) - dat += text("ERROR. String could not be located.

      Back", src) - else - dat += {" - - "} - dat += text("", tempname) - dat += {" - -
      Search Results for '[]':
      - - - - - - - - - "} - for(var/i=1, i<=Perp.len, i += 2) - var/datum/data/record/R = Perp[i] - var/physstat = R.fields["p_stat"] - var/background - switch(physstat) - if("*Deceased*") - background = "'background-color:#CD853F;'" - if("*Unconscious*") - background = "'background-color:#DC143C;'" - if("Physically Unfit") - background = "'background-color:#3BB9FF;'" - if("Active") - background = "'background-color:#00FF7F;'" - if("") - background = "'background-color:#FFFFFF;'" - physstat = "No Record." - dat += text("", background, src, R, R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) - dat += text("", R.fields["fingerprint"]) - dat += text("", physstat) - dat += text("", R.fields["m_stat"]) - dat += "
      NameIDRankFingerprintsPhysical StatusMental Status
      [][][][][][]

      " - dat += text("
      Return to index.", src) + dat += "Record List:
      " + if(!isnull(data_core.general)) + for(var/datum/data/record/R in sortRecord(data_core.general)) + dat += text("[]: []
      ", src, R, R.fields["id"], R.fields["name"]) + //Foreach goto(132) + dat += text("
      Back", src) if(3.0) - dat += "Records Maintenance
      " - if(disk) - dat += "Disk Contents:
        " - if(disk.general) - dat += "
      • General
      • " - if(disk.medical) - dat += "
      • Medical
      • " - if(disk.security) - dat += "
      • Security
      • " - dat += "
      Backup To Disk
      " - if(disk.general && disk.medical) - dat += "Restore From Disk
      " - else - dat += "Disk does not contain medical records.
      " - dat += "Eject Disk
      " - else - dat += "Please insert a records disk.
      " - dat += "
      Delete All Records

      Back" + dat += text("Records Maintenance
      \nBackup To Disk
      \nUpload From disk
      \nDelete All Records
      \n
      \nBack", src, src, src, src) if(4.0) dat += "
      Medical Record

      " if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1))) @@ -174,18 +69,19 @@ else dat += "Medical Record Lost!
      " dat += text("New Record

      ") - dat += text("\nPrint Record
      \nBack
      ", src, src) + dat += text("\nPrint Record
      \nBack
      ", src, src) if(5.0) - dat += "Virus Database
      " + dat += "
      Virus Database
      " for(var/Dt in typesof(/datum/disease/)) var/datum/disease/Dis = new Dt(0) if(!Dis.desc) continue - dat += "[Dis.name]
      " + dat += "
      [Dis.name]" dat += "
      Back" if(6.0) - dat += "Medical Robot Monitor
      " - dat += "Medical Robots:
      " + dat += "
      Medical Robot Monitor
      " + dat += "Back" + dat += "
      Medical Robots:" var/bdat = null for(var/obj/machinery/bot/medbot/M in world) var/turf/bl = get_turf(M) @@ -196,16 +92,14 @@ bdat += "Using Internal Synthesizer.
      " if(!bdat) - dat += "None detected

      " + dat += "
      None detected
      " else - dat += "[bdat]
      " - - dat += "Back" + dat += "
      [bdat]" else else dat += text("{Log In}", src) - user << browse(text("Medical Records[]", dat), "window=med_rec;size=600x400") + user << browse(text("Medical Records[]", dat), "window=med_rec") onclose(user, "med_rec") return @@ -222,13 +116,10 @@ src.temp = null if (href_list["scan"]) if (src.scan) - if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand()) - usr.put_in_hand(scan) - else - scan.loc = get_turf(src) - scan = null + src.scan.loc = src.loc + src.scan = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src @@ -360,11 +251,9 @@ src.active2.fields["cdi_d"] = t1 if("notes") if (istype(src.active2, /datum/data/record)) - var/t1 = input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message + var/t1 = copytext(sanitize(input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) return - t1 = copytext(t1, 1, MAX_PAPER_MESSAGE_LEN) - t1 = html_encode(t1) src.active2.fields["notes"] = t1 if("p_stat") if (istype(src.active1, /datum/data/record)) @@ -405,7 +294,7 @@ if("watch") src.active1.fields["m_stat"] = "*Watch*" if("stable") - src.active1.fields["m_stat"] = "Stable" + src.active2.fields["m_stat"] = "Stable" if (href_list["b_type"]) @@ -484,40 +373,33 @@ var/counter = 1 while(src.active2.fields[text("com_[]", counter)]) counter++ - src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2556
      []", src.authenticated, src.rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1) + src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053
      []", src.authenticated, src.rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1) if (href_list["del_c"]) if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) src.active2.fields[text("com_[]", href_list["del_c"])] = "Deleted" if (href_list["search"]) - var/t1 = input("Search String: (Partial Name or ID or Fingerprints or DNA or Rank)", "Med. records", null, null) as text + var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || ((!in_range(src, usr)) && (!istype(usr, /mob/living/silicon))))) return - Perp = new/list() + src.active1 = null + src.active2 = null t1 = lowertext(t1) - var/list/components = dd_text2list(t1, " ") - if(components.len > 5) - return //Lets not let them search too greedily. - for(var/datum/data/record/R in data_core.general) - var/temptext = R.fields["name"] + " " + R.fields["id"] + " " + R.fields["fingerprint"] + " " + R.fields["rank"] - - for(var/datum/data/record/E in data_core.medical) - if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) - temptext += " " + E.fields["b_dna"] - - for(var/i = 1, i<=components.len, i++) - if(findtext(temptext,components[i])) - var/prelist = new/list(2) - prelist[1] = R - Perp += prelist - for(var/i = 1, i<=Perp.len, i+=2) - for(var/datum/data/record/E in data_core.medical) - var/datum/data/record/R = Perp[i] - if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) - Perp[i+1] = E - tempname = t1 - src.screen = 2 + for(var/datum/data/record/R in data_core.medical) + if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"]))) + src.active2 = R + else + //Foreach continue //goto(3229) + if (!( src.active2 )) + src.temp = text("Could not locate record [].", t1) + else + for(var/datum/data/record/E in data_core.general) + if ((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])) + src.active1 = E + else + //Foreach continue //goto(3334) + src.screen = 4 if (href_list["print_p"]) if (!( src.printing )) @@ -538,26 +420,8 @@ else P.info += "Medical Record Lost!
      " P.info += "
      " - P.name = "paper - 'Medical Record'" + P.name = "paper- 'Medical Record'" src.printing = null - if (href_list["eject_disk"]) - if (!disk) - return - if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand()) - usr.put_in_hand(disk) - else - disk.loc = get_turf(src) - disk = null - if (href_list["backup"]) - if (!disk) - return - disk.backup(1, 0) - temp = "Data backup complete." - if (href_list["restore"]) - if (!disk) - return - disk.restore(1, 0) - temp = "Data restore complete." src.add_fingerprint(usr) src.updateUsrDialog() @@ -566,5 +430,5 @@ /obj/machinery/computer/med_data/laptop name = "Medical Laptop" - desc = "Cheap NanoTrasen Laptop." + desc = "Cheap Nanotrasen Laptop." icon_state = "medlaptop" diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 7d826a7c2e..6ee6feebe6 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -1,27 +1,79 @@ // Allows you to monitor messages that passes the server. + + + /obj/machinery/computer/message_monitor name = "Message Monitor Console" - desc = "Used to Monitor the crew's messages, that are sent via PDA." - icon_state = "comm_monitor" + desc = "Used to Monitor the crew's messages, that are sent via PDA. Can also be used to view Request Console messages." + icon_state = "comm_logs" + var/hack_icon = "comm_logsc" + var/normal_icon = "comm_logs" circuit = "/obj/item/weapon/circuitboard/message_monitor" + //Server linked to. var/obj/machinery/message_server/linkedServer = null - var/screen = 0 // 0 = Main menu, 1 = Message Logs + //Sparks effect - For emag + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread + //Messages - Saves me time if I want to change something. + var/noserver = "ALERT: No server detected." + var/incorrectkey = "ALERT: Incorrect decryption key!" + var/defaultmsg = "Welcome. Please select an option." + var/rebootmsg = "%$&(£: Critical %$$@ Error // !RestArting! - ?pLeaSe wAit!" + //Computer properties + var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message var/hacking = 0 // Is it being hacked into by the AI/Cyborg + var/emag = 0 // When it is emagged. + var/message = "System bootup complete. Please select an option." // The message that shows on the main menu. + var/auth = 0 // Are they authenticated? + var/optioncount = 7 + // Custom Message Properties + var/customsender = "System Administrator" + var/obj/item/device/pda/customrecepient = null + var/customjob = "Admin" + var/custommessage = "This is a test, please ignore." -/obj/machinery/computer/message_monitor/attackby(obj/item/weapon/O as obj, mob/user as mob) +/obj/machinery/computer/message_monitor/attackby(obj/item/weapon/O as obj, mob/living/user as mob) + if(stat & (NOPOWER|BROKEN)) + return + if(!istype(user)) + return if(istype(O,/obj/item/weapon/card/emag/)) - //Just brings up the Message Log without having to know the passcode. - if(!hacking) - usr << "BZZT.. The console beeps and brings up the Message Logs." - screen = 1 - else - usr << "It looks like the console is already being hacked into." + // Will create sparks and print out the console's password. You will then have to wait a while for the console to be back online. + // It'll take more time if there's more characters in the password.. + if(!emag) + if(!isnull(src.linkedServer)) + icon_state = hack_icon // An error screen I made in the computers.dmi + emag = 1 + screen = 2 + spark_system.set_up(5, 0, src) + src.spark_system.start() + var/obj/item/weapon/paper/monitorkey/MK = new/obj/item/weapon/paper/monitorkey + MK.loc = src.loc + // Will help make emagging the console not so easy to get away with. + MK.info += "

      £%@%(*$%&(£&?*(%&£/{}" + spawn(100*length(src.linkedServer.decryptkey)) UnmagConsole() + message = rebootmsg + else + user << "A no server error appears on the screen." + if(isscrewdriver(O) && emag) + //Stops people from just unscrewing the monitor and putting it back to get the console working again. + user << "It is too hot to mess with!" + return + ..() return +/obj/machinery/computer/message_monitor/power_change() + ..() + if(stat & (NOPOWER|BROKEN)) + return + if(emag || hacking) + icon_state = hack_icon + else + icon_state = normal_icon + /obj/machinery/computer/message_monitor/process() //Is the server isn't linked to a server, and there's a server available, default it to the first one in the list. if(!linkedServer) @@ -29,89 +81,169 @@ linkedServer = message_servers[1] return -/obj/machinery/computer/message_monitor/attack_hand(var/mob/user as mob) +/obj/machinery/computer/message_monitor/attack_hand(var/mob/living/user as mob) if(stat & (NOPOWER|BROKEN)) return - if(!istype(user, /mob/living)) + if(!istype(user)) return + //If the computer is being hacked or is emagged, display the reboot message. + if(hacking || emag) + message = rebootmsg var/dat = "Message Monitor Console" dat += "

      Message Monitor Console


      " + dat += "

      " + + if(auth) + dat += "

      \[Authenticated\] /" + dat += " Server Power: [src.linkedServer && src.linkedServer.active ? "\[On\]":"\[Off\]"]

      " + else + dat += "

      \[Unauthenticated\] /" + dat += " Server Power: [src.linkedServer && src.linkedServer.active ? "\[On\]":"\[Off\]"]

      " + + if(hacking || emag) + screen = 2 + else if(!auth || !linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) + if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) message = noserver + screen = 0 + switch(screen) //Main menu if(0) - if(hacking) - screen = 2 - return src.attack_hand(user) - if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) - dat += "1. ERROR: Server not found
      " + // = TAB + var/i = 0 + dat += "
      [++i]. Link To A Server
      " + if(auth) + if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) + dat += "
      ERROR: Server not found!
      " + else + dat += "
      [++i]. View Message Logs
      " + dat += "
      [++i]. View Request Console Logs
      " + dat += "
      [++i]. Clear Message Logs
      " + dat += "
      [++i]. Clear Request Console Logs
      " + dat += "
      [++i]. Set Custom Key
      " + dat += "
      [++i]. Send Admin Message
      " else - dat += "1. Toggle Power: [src.linkedServer.active ? "\[On\]":"\[Off\]"]
      " - dat += "2. Link To A Server
      " - dat += "3. Clear Message Logs
      " - dat += " KEY REQUIRED
      " - dat += "4. View Message Logs
      " - dat += "5. Set Custom Key

      " - //Malf/Traitor AIs can bruteforce into the system to gain the Key. + for(var/n = ++i; n <= optioncount; n++) + dat += "
      [n]. ---------------
      " if((istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) && (user.mind.special_role && user.mind.original == user)) - dat += "*&@. Bruteforce Key

      " + //Malf/Traitor AIs can bruteforce into the system to gain the Key. + dat += "
      *&@#. Bruteforce Key
      " + else + dat += "
      " + + //Bottom message + if(!auth) + dat += "

      Please authenticate with the server in order to show additional options." + else + dat += "

      Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties." + //Message Logs if(1) - if(hacking) - screen = 2 - return src.attack_hand(user) - if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) - usr << "No server detected." - screen = 0 - return src.attack_hand(user) - var/index = 0 //var/recipient = "Unspecified" //name of the person //var/sender = "Unspecified" //name of the sender //var/message = "Blank" //transferred message - dat += "
      Return - Refresh

      " - dat += "" - for(var/list/datum/data_pda_msg/pda in src.linkedServer.pda_msgs) + dat += "
      Back - Refresh

      " + dat += "
      SenderRecipientMessage
      " + for(var/datum/data_pda_msg/pda in src.linkedServer.pda_msgs) index++ if(index > 3000) break - dat += "" + // Del - Sender - Recepient - Message + // X - Al Green - Your Mom - WHAT UP!? + dat += "" dat += "
      XSenderRecipientMessage
      [pda.sender][pda.recipient][pda.message]
      X
      [pda.sender][pda.recipient][pda.message]
      " //Hacking screen. if(2) - if(!hacking) - screen = 0 - return src.attack_hand(user) if(istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) - dat += "Brute-forcing for server key.
      This will take anywhere from two to five minutes." + dat += "Brute-forcing for server key.
      It will take 20 seconds for every character that the password has." dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time." else //It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever. - dat += {"010101000110100001101001011100110010000001110111011010010110110 - 0011011000010000001110100011000010110101101100101001000000110000101101110 - 01111001011101110110100001100101011100100110010100100000011001100111001001 - 10111101101101001000000111010001110111011011110010000001110100011011110010 - 00000110011001101001011101100110010100100000011011010110100101101110011101 - 01011101000110010101110011001011100010000001001001011011100010000001110100 - 01101000011001010010000001101101011001010110000101101110001011010111010001 - 10100101101101011001010010110000100000011101000110100001101001011100110010 - 00000110001101101111011011100111001101101111011011000110010100100000011000 - 11011000010110111000100000011100100110010101110110011001010110000101101100 - 00100000011110010110111101110101011100100010000001110100011100100111010101 - 10010100100000011010010110111001110100011001010110111001110100011010010110 - 11110110111001110011001000000110100101100110001000000111100101101111011101 - 01001000000110110001100101011101000010000001110011011011110110110101100101 - 01101111011011100110010100100000011000010110001101100011011001010111001101 - 11001100100000011010010111010000101110001000000100110101100001011010110110 - 01010010000001110011011101010111001001100101001000000110111001101111001000 - 00011010000111010101101101011000010110111001110011001000000110010101101110 - 01110100011001010111001000100000011101000110100001100101001000000111001001 - 10111101101111011011010010000001100100011101010111001001101001011011100110 - 01110010000001110100011010000110000101110100001000000111010001101001011011 - 010110010100101110"} + dat += {"01000010011100100111010101110100011001010010110
      + 10110011001101111011100100110001101101001011011100110011
      + 10010000001100110011011110111001000100000011100110110010
      + 10111001001110110011001010111001000100000011010110110010
      + 10111100100101110001000000100100101110100001000000111011
      + 10110100101101100011011000010000001110100011000010110101
      + 10110010100100000001100100011000000100000011100110110010
      + 10110001101101111011011100110010001110011001000000110011
      + 00110111101110010001000000110010101110110011001010111001
      + 00111100100100000011000110110100001100001011100100110000
      + 10110001101110100011001010111001000100000011101000110100
      + 00110000101110100001000000111010001101000011001010010000
      + 00111000001100001011100110111001101110111011011110111001
      + 00110010000100000011010000110000101110011001011100010000
      + 00100100101101110001000000111010001101000011001010010000
      + 00110110101100101011000010110111001110100011010010110110
      + 10110010100101100001000000111010001101000011010010111001
      + 10010000001100011011011110110111001110011011011110110110
      + 00110010100100000011000110110000101101110001000000111001
      + 00110010101110110011001010110000101101100001000000111100
      + 10110111101110101011100100010000001110100011100100111010
      + 10110010100100000011010010110111001110100011001010110111
      + 00111010001101001011011110110111001110011001000000110100
      + 10110011000100000011110010110111101110101001000000110110
      + 00110010101110100001000000111001101101111011011010110010
      + 10110111101101110011001010010000001100001011000110110001
      + 10110010101110011011100110010000001101001011101000010111
      + 00010000001001101011000010110101101100101001000000111001
      + 10111010101110010011001010010000001101110011011110010000
      + 00110100001110101011011010110000101101110011100110010000
      + 00110010101101110011101000110010101110010001000000111010
      + 00110100001100101001000000111001001101111011011110110110
      + 10010000001100100011101010111001001101001011011100110011
      + 10010000001110100011010000110000101110100001000000111010
      + 001101001011011010110010100101110"} + + //Fake messages + if(3) + dat += "
      Back - Reset

      " + + dat += {" + + + + "} + //Sender - Sender's Job - Recepient - Message + //Al Green- Your Dad - Your Mom - WHAT UP!? + + dat += {" + + + "} + dat += "
      SenderSender's JobRecipientMessage
      [customsender][customjob][customrecepient ? customrecepient.owner : "NONE"][custommessage]

      Send" + + //Request Console Logs + if(4) + + var/index = 0 + /* data_rc_msg + X - 5% + var/rec_dpt = "Unspecified" //name of the person - 15% + var/send_dpt = "Unspecified" //name of the sender- 15% + var/message = "Blank" //transferred message - 300px + var/stamp = "Unstamped" - 15% + var/id_auth = "Unauthenticated" - 15% + var/priority = "Normal" - 10% + */ + dat += "
      Back - Refresh

      " + dat += {" + "} + for(var/datum/data_rc_msg/rc in src.linkedServer.rc_msgs) + index++ + if(index > 3000) + break + // Del - Sender - Recepient - Message + // X - Al Green - Your Mom - WHAT UP!? + dat += {" + "} + dat += "
      XSending Dep.Receiving Dep.MessageStampID Auth.Priority.
      X
      [rc.send_dpt][rc.rec_dpt][rc.message][rc.stamp][rc.id_auth][rc.priority]
      " dat += "" - user << browse(dat, "window=message;size=500x700") + message = defaultmsg + user << browse(dat, "window=message;size=700x700") onclose(user, "message") return @@ -119,11 +251,25 @@ return src.attack_hand(user) /obj/machinery/computer/message_monitor/proc/BruteForce(mob/user as mob) - var/currentKey = src.linkedServer.decryptkey - user << "Brute-force completed! The key is '[currentKey]'." + if(isnull(linkedServer)) + user << "Could not complete brute-force: Linked Server Disconnected!" + else + var/currentKey = src.linkedServer.decryptkey + user << "Brute-force completed! The key is '[currentKey]'." src.hacking = 0 + src.icon_state = normal_icon src.screen = 0 // Return the screen back to normal +/obj/machinery/computer/message_monitor/proc/UnmagConsole() + src.icon_state = normal_icon + src.emag = 0 + +/obj/machinery/computer/message_monitor/proc/ResetMessage() + customsender = "System Administrator" + customrecepient = null + custommessage = "This is a test, please ignore." + customjob = "Admin" + /obj/machinery/computer/message_monitor/Topic(href, href_list) if(..()) return @@ -132,62 +278,208 @@ if(!istype(usr, /mob/living)) return if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) - - if (href_list["active"]) - linkedServer.active = !linkedServer.active - - if (href_list["find"]) - if(message_servers && message_servers.len > 1) - src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers - usr << "Server selected." - else if(message_servers && message_servers.len > 0) - linkedServer = message_servers[1] - usr << "Single Server Detected - Server selected." - else - usr << "No server detected." - - if (href_list["view"]) - if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN))) - usr << "No server detected." + //Authenticate + if (href_list["auth"]) + if(auth) + auth = 0 + screen = 0 else var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null) if(dkey && dkey != "") if(src.linkedServer.decryptkey == dkey) - src.screen = 1 + auth = 1 else - usr << "ALERT: Incorrect password!" + message = incorrectkey + //Turn the server on/off. + if (href_list["active"]) + if(auth) linkedServer.active = !linkedServer.active + //Find a server + if (href_list["find"]) + if(message_servers && message_servers.len > 1) + src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers + message = "NOTICE: Server selected." + else if(message_servers && message_servers.len > 0) + linkedServer = message_servers[1] + message = "NOTICE: Only Single Server Detected - Server selected." + else + message = noserver + //View the logs - KEY REQUIRED + if (href_list["view"]) + if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + else + if(auth) + src.screen = 1 + + //Clears the logs - KEY REQUIRED if (href_list["clear"]) if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN))) - usr << "No server detected." + message = noserver else - src.linkedServer.pda_msgs = list() - usr << "Logs cleared." - + if(auth) + src.linkedServer.pda_msgs = list() + message = "NOTICE: Logs cleared." + //Clears the request console logs - KEY REQUIRED + if (href_list["clearr"]) + if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + else + if(auth) + src.linkedServer.rc_msgs = list() + message = "NOTICE: Logs cleared." + //Change the password - KEY REQUIRED if (href_list["pass"]) if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN))) - usr << "No server detected." + message = noserver else - var/dkey = trim(input(usr,"Please enter the decryption key.") as text|null) - if(dkey && dkey != "") - if(dkey == src.linkedServer.decryptkey) - var/newkey = trim(input(usr,"Please enter the new key.")) - if(newkey && newkey != "") - src.linkedServer.decryptkey = newkey - usr << "Password set." - else - usr << "ALERT: Incorrect password!" + if(auth) + var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null) + if(dkey && dkey != "") + if(src.linkedServer.decryptkey == dkey) + var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):")) + if(length(newkey) <= 3) + message = "NOTICE: Decryption key too short!" + else if(length(newkey) > 16) + message = "NOTICE: Decryption key too long!" + else if(newkey && newkey != "") + src.linkedServer.decryptkey = newkey + message = "NOTICE: Decryption key set." + else + message = incorrectkey + //Hack the Console to get the password if (href_list["hack"]) if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr)) src.hacking = 1 src.screen = 2 - //usr << "[src.linkedServer.decryptkey]" - spawn((100*6)*rand(2, 4)) + src.icon_state = hack_icon + //Time it takes to bruteforce is dependant on the password length. + spawn(100*length(src.linkedServer.decryptkey)) if(src && src.linkedServer && usr) BruteForce(usr) + //Delete the log. + if (href_list["delete"]) + //Are they on the view logs screen? + if(screen == 1) + if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + else //if(istype(href_list["delete"], /datum/data_pda_msg)) + src.linkedServer.pda_msgs -= locate(href_list["delete"]) + message = "NOTICE: Log Deleted!" + //Delete the request console log. + if (href_list["deleter"]) + //Are they on the view logs screen? + if(screen == 4) + if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + else //if(istype(href_list["delete"], /datum/data_pda_msg)) + src.linkedServer.rc_msgs -= locate(href_list["deleter"]) + message = "NOTICE: Log Deleted!" + //Create a custom message + if (href_list["msg"]) + if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + else + if(auth) + src.screen = 3 + //Fake messaging selection - KEY REQUIRED + if (href_list["select"]) + if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + screen = 0 + else + switch(href_list["select"]) + //Reset + if("Reset") + ResetMessage() + + //Select Your Name + if("Sender") + customsender = input(usr, "Please enter the sender's name.") as text|null + + //Select Receiver + if("Recepient") + //Get out list of viable PDAs + var/list/obj/item/device/pda/sendPDAs = list() + for(var/obj/item/device/pda/P in PDAs) + if(!P.owner || P.toff) continue + sendPDAs += P + if(PDAs && PDAs.len > 0) + customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortAtom(sendPDAs) + else + customrecepient = null + + //Enter custom job + if("RecJob") + customjob = input(usr, "Please enter the sender's job.") as text|null + + //Enter message + if("Message") + custommessage = input(usr, "Please enter your message.") as text|null + custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN) + + //Send message + if("Send") + + if(isnull(customsender) || customsender == "") + customsender = "UNKNOWN" + + if(isnull(customrecepient)) + message = "NOTICE: No recepient selected!" + return src.attack_hand(usr) + + if(isnull(custommessage) || custommessage == "") + message = "NOTICE: No message entered!" + return src.attack_hand(usr) + + var/obj/item/device/pda/PDARec = null + for (var/obj/item/device/pda/P in PDAs) + if (!P.owner||P.toff) continue + if(P.owner == customsender) + PDARec = P + //Sender isn't faking as someone who exists + if(isnull(PDARec)) + src.linkedServer.send_pda_message("[customrecepient.owner]", "[customsender]","[custommessage]") + customrecepient.tnote += "← From
      [customsender] ([customjob]):
      [custommessage]
      " + if (!customrecepient.silent) + playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(3, customrecepient.loc)) + O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*")) + if( customrecepient.loc && ishuman(customrecepient.loc) ) + var/mob/living/carbon/human/H = customrecepient.loc + H << "\icon[customrecepient] Message from [customsender] ([customjob]), \"[custommessage]\" (Reply)" + log_pda("[usr] (PDA: [customsender]) sent \"[custommessage]\" to [customrecepient.owner]") + customrecepient.overlays = null + customrecepient.overlays += image('icons/obj/pda.dmi', "pda-r") + //Sender is faking as someone who exists + else + src.linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]") + customrecepient.tnote += "← From [PDARec.owner] ([customjob]):
      [custommessage]
      " + if (!customrecepient.silent) + playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(3, customrecepient.loc)) + O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*")) + if( customrecepient.loc && ishuman(customrecepient.loc) ) + var/mob/living/carbon/human/H = customrecepient.loc + H << "\icon[customrecepient] Message from [PDARec.owner] ([customjob]), \"[custommessage]\" (Reply)" + log_pda("[usr] (PDA: [PDARec.owner]) sent \"[custommessage]\" to [customrecepient.owner]") + customrecepient.overlays = null + customrecepient.overlays += image('icons/obj/pda.dmi', "pda-r") + //Finally.. + ResetMessage() + + //Request Console Logs - KEY REQUIRED + if(href_list["viewr"]) + if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver + else + if(auth) + src.screen = 4 + + //usr << href_list["select"] if (href_list["back"]) src.screen = 0 @@ -202,8 +494,12 @@ /obj/item/weapon/paper/monitorkey/New() ..() - if(message_servers && message_servers.len > 0) - server = message_servers[1] - info = "

      Daily Key Reset


      The new message monitor key is '[server.decryptkey]'.
      Please keep this a secret.
      If necessary, change the password to a more secure one." -// info_links = info - overlays += "paper_words" \ No newline at end of file + spawn(10) + if(message_servers) + for(var/obj/machinery/message_server/server in message_servers) + if(!isnull(server)) + if(!isnull(server.decryptkey)) + info = "

      Daily Key Reset


      The new message monitor key is '[server.decryptkey]'.
      Please keep this a secret and away from the clown.
      If necessary, change the password to a more secure one." + info_links = info + overlays += "paper_words" + break diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 8deb695af0..0dce56f714 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -1,8 +1,8 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/pod name = "Pod Launch Control" - desc = "A control for launching pods." + desc = "A controll for launching pods. Some people prefer firing Mechas." icon_state = "computer_generic" var/id = 1.0 var/obj/machinery/mass_driver/connected = null @@ -53,7 +53,7 @@ /obj/machinery/computer/pod/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(loc, 'Screwdriver.ogg', 50, 1) + playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (stat & BROKEN) user << "\blue The broken glass falls out." diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm index 614a5f4e15..39d6fe4b31 100644 --- a/code/game/machinery/computer/power.dm +++ b/code/game/machinery/computer/power.dm @@ -1,7 +1,26 @@ // the power monitoring computer // for the moment, just report the status of all APCs in the same powernet +/obj/machinery/power/monitor + name = "power monitoring computer" + desc = "It monitors power levels across the station." + icon = 'icons/obj/computer.dmi' + icon_state = "power" + density = 1 + anchored = 1 + use_power = 2 + idle_power_usage = 20 + active_power_usage = 80 -//Now Supports remote access -- Newt +//fix for issue 521, by QualityVan. +//someone should really look into why circuits have a powernet var, it's several kinds of retarded. +/obj/machinery/power/monitor/New() + ..() + var/obj/structure/cable/attached = null + var/turf/T = loc + if(isturf(T)) + attached = locate() in T + if(attached) + powernet = attached.get_powernet() /obj/machinery/power/monitor/attack_ai(mob/user) @@ -20,7 +39,7 @@ /obj/machinery/power/monitor/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -45,15 +64,6 @@ A.icon_state = "4" A.anchored = 1 del(src) - if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) - //var/obj/item/weapon/card/id/W = I - if(src.allowed(user)) - src.control = !src.control - user << "You [ control ? "enable" : "disable"] remote APC control." - else - user << "\red Access denied." - - else src.attack_hand(user) return @@ -68,7 +78,7 @@ user.machine = src - var/t = "Power Monitoring: Swipe ID for remote access
      " + var/t = "Power Monitoring
      " t += "

      Refresh" t += "

      Close" @@ -97,10 +107,6 @@ for(var/obj/machinery/power/apc/A in L) t += copytext(add_tspace("\The [A.area]", 30), 1, 30) - if(control) - t += " ([A.operating? " On" : "Off"])" - else - t += " ([A.operating? "On " : "Off"])" t += " [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]
      " t += "
      " @@ -118,13 +124,6 @@ if( href_list["update"] ) src.updateDialog() return - if( href_list["breaker"]) - var/obj/machinery/power/apc/APC = locate(href_list["apc"]) - APC.operating = !APC.operating - APC.update() - APC.updateicon() - src.updateDialog() - return /obj/machinery/power/monitor/process() @@ -143,3 +142,4 @@ spawn(rand(0, 15)) src.icon_state = "c_unpowered" stat |= NOPOWER + diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 6de8cb15ba..e65754c4c9 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -1,10 +1,10 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/prisoner name = "Prisoner Management" - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "explosive" - req_access = list(ACCESS_ARMORY) + req_access = list(access_armory) circuit = "/obj/item/weapon/circuitboard/prisoner" var/id = 0.0 var/temp = null @@ -50,7 +50,7 @@ var/loc_display = "Unknown" var/mob/living/carbon/M = T.imp_in if(M.z == 1 && !istype(M.loc, /turf/space)) - var/turf/mob_loc = get_turf(M) + var/turf/mob_loc = get_turf_loc(M) loc_display = mob_loc.loc dat += "ID: [T.id] | Location: [loc_display]
      " dat += "(Message Holder) |
      " @@ -100,7 +100,7 @@ var/obj/item/weapon/implant/I = locate(href_list["warn"]) if((I)&&(I.imp_in)) var/mob/living/carbon/R = I.imp_in - R << "\green You think: '[warning]'" + R << "\green You hear a voice in your head saying: '[warning]'" src.add_fingerprint(usr) src.updateUsrDialog() diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index aa5ec096b7..746d00fbd8 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -1,12 +1,12 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/computer/robotics name = "Robotics Control" desc = "Used to remotely lockdown or detonate linked Cyborgs." - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "robot" - req_access = list(ACCESS_ROBOTICS) + req_access = list(access_robotics) circuit = "/obj/item/weapon/circuitboard/robotics" var/id = 0.0 @@ -38,7 +38,7 @@ dat += "1. Cyborg Status
      " dat += "2. Emergency Full Destruct
      " if(screen == 1) - for(var/mob/living/silicon/robot/R in world) + for(var/mob/living/silicon/robot/R in mob_list) if(istype(user, /mob/living/silicon/ai)) if (R.connected_ai != user) continue @@ -97,12 +97,13 @@ onclose(user, "computer") return -/obj/machinery/computer/engine/process() +//Why is this in robot/computer and why does it exist when /obj/machinery/computer/engine does not? -Nodrak +/*/obj/machinery/computer/engine/process() if(stat & (NOPOWER|BROKEN)) return use_power(500) src.updateDialog() - return + return*/ /obj/machinery/computer/robotics/Topic(href, href_list) if(..()) @@ -116,7 +117,7 @@ Cancel"} else if (href_list["eject2"]) - var/obj/item/weapon/card/id/I = usr.equipped() + var/obj/item/weapon/card/id/I = usr.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id @@ -203,7 +204,7 @@ var/choice = input("Are you certain you wish to hack [R.name]?") in list("Confirm", "Abort") if(choice == "Confirm") if(R && istype(R)) - message_admins("\blue [key_name_admin(usr)] emagged [R.name] using robotic console!") +// message_admins("\blue [key_name_admin(usr)] emagged [R.name] using robotic console!") log_game("[key_name(usr)] emagged [R.name] using robotic console!") R.emagged = 1 if(R.mind.special_role) @@ -223,7 +224,7 @@ sleep(10) while(src.timeleft) - for(var/mob/living/silicon/robot/R in world) + for(var/mob/living/silicon/robot/R in mob_list) if(!R.scrambledcodes) R.self_destruct() diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 6b4707f8cb..d74f398706 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -1,13 +1,12 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -/obj/machinery/computer/secure_data +/obj/machinery/computer/secure_data//TODO:SANITY name = "Security Records" desc = "Used to view and edit personnel's security records" icon_state = "security" - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) circuit = "/obj/item/weapon/circuitboard/secure_data" var/obj/item/weapon/card/id/scan = null - var/obj/item/weapon/disk/records/disk = null var/authenticated = null var/rank = null var/screen = null @@ -19,6 +18,9 @@ var/can_change_id = 0 var/list/Perp var/tempname = null + //Sorting Variables + var/sortBy = "name" + var/order = 1 // -1 = Descending - 1 = Ascending /obj/machinery/computer/secure_data/attackby(obj/item/O as obj, user as mob) @@ -27,11 +29,6 @@ O.loc = src scan = O user << "You insert [O]." - else if(istype(O, /obj/item/weapon/disk/records) && !disk) - usr.drop_item() - O.loc = src - disk = O - user << "You insert [O]." ..() /obj/machinery/computer/secure_data/attack_ai(mob/user as mob) @@ -66,60 +63,43 @@ - - - - + + + +"} - for(var/datum/data/record/R in data_core.general) - var/crimstat = "" - for(var/datum/data/record/E in data_core.security) - if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) - crimstat = E.fields["criminal"] - var/background - switch(crimstat) - if("*Arrest*") - background = "'background-color:#DC143C;'" - if("Incarcerated") - background = "'background-color:#CD853F;'" - if("Parolled") - background = "'background-color:#CD853F;'" - if("Released") - background = "'background-color:#3BB9FF;'" - if("Deceased") - background = "'background-color:#CD853F;'" - if("None") - background = "'background-color:#00FF7F;'" - if("") - background = "'background-color:#FFFFFF;'" - crimstat = "No Record." - dat += text("", background, src, R, R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) - dat += text("", R.fields["fingerprint"]) - dat += text("", crimstat) - dat += "
      NameIDRankFingerprintsNameIDRankFingerprints Criminal Status
      [][][][][]

      " + if(!isnull(data_core.general)) + for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order)) + var/crimstat = "" + for(var/datum/data/record/E in data_core.security) + if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) + crimstat = E.fields["criminal"] + var/background + switch(crimstat) + if("*Arrest*") + background = "'background-color:#DC143C;'" + if("Incarcerated") + background = "'background-color:#CD853F;'" + if("Parolled") + background = "'background-color:#CD853F;'" + if("Released") + background = "'background-color:#3BB9FF;'" + if("None") + background = "'background-color:#00FF7F;'" + if("") + background = "'background-color:#FFFFFF;'" + crimstat = "No Record." + dat += text("[]", background, src, R, R.fields["name"]) + dat += text("[]", R.fields["id"]) + dat += text("[]", R.fields["rank"]) + dat += text("[]", R.fields["fingerprint"]) + dat += text("[]", crimstat) + dat += "
      " dat += text("Record Maintenance

      ", src) dat += text("{Log Out}",src) if(2.0) dat += "Records Maintenance
      " - if(disk) - dat += "Disk Contents:
        " - if(disk.general) - dat += "
      • General
      • " - if(disk.medical) - dat += "
      • Medical
      • " - if(disk.security) - dat += "
      • Security
      • " - dat += "
      Backup To Disk
      " - if(disk.general && disk.security) - dat += "Restore From Disk
      " - else - dat += "Disk does not contain security records.
      " - dat += "Eject Disk
      " - else - dat += "Please insert a records disk.
      " dat += "
      Delete All Records

      Back" if(3.0) dat += "
      Security Record

      " @@ -174,8 +154,6 @@ background = "'background-color:#CD853F;'" if("Released") background = "'background-color:#3BB9FF;'" - if("Deceased") - background = "'background-color:#CD853F;'" if("None") background = "'background-color:#00FF7F;'" if("") @@ -208,6 +186,18 @@ What a mess.*/ if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon))) usr.machine = src switch(href_list["choice"]) +// SORTING! + if("Sorting") + // Reverse the order if clicked twice + if(sortBy == href_list["sort"]) + if(order == 1) + order = -1 + else + order = 1 + else + // New sorting order! + sortBy = href_list["sort"] + order = initial(order) //BASIC FUNCTIONS if("Clear Screen") temp = null @@ -220,12 +210,12 @@ What a mess.*/ if("Confirm Identity") if (scan) if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand()) - usr.put_in_hand(scan) + usr.put_in_hands(scan) else scan.loc = get_turf(src) scan = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src @@ -355,7 +345,7 @@ What a mess.*/ var/counter = 1 while(active2.fields[text("com_[]", counter)]) counter++ - active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2556
      []", authenticated, rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1) + active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053
      []", authenticated, rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1) if ("Delete Record (ALL)") if (active1) @@ -411,7 +401,7 @@ What a mess.*/ if("name") if (istype(active1, /datum/data/record)) var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text - if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1) + if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1) return active1.fields["name"] = t1 if("id") @@ -464,11 +454,9 @@ What a mess.*/ active2.fields["ma_crim_d"] = t1 if("notes") if (istype(active2, /datum/data/record)) - var/t1 = input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message + var/t1 = copytext(sanitize(input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN) if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2)) return - t1 = copytext(t1, 1, MAX_PAPER_MESSAGE_LEN) - t1 = html_encode(t1) active2.fields["notes"] = t1 if("criminal") if (istype(active2, /datum/data/record)) @@ -479,7 +467,6 @@ What a mess.*/ temp += "
    • Incarcerated
    • " temp += "
    • Parolled
    • " temp += "
    • Released
    • " - temp += "
    • Deceased
    • " temp += "
    " if("rank") var/list/L = list( "Head of Personnel", "Captain", "AI" ) @@ -488,28 +475,10 @@ What a mess.*/ temp = "
    Rank:
    " temp += "
      " for(var/rank in get_all_jobs()) - temp += "
    • [rank]
    • " + temp += "
    • [rank]
    • " temp += "
    " else alert(usr, "You do not have the required rank to do this!") - if ("eject_disk") - if (!disk) - return - if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand()) - usr.put_in_hand(disk) - else - disk.loc = get_turf(src) - disk = null - if ("backup") - if (!disk) - return - disk.backup(0, 1) - temp = "Data backup complete." - if ("restore") - if (!disk) - return - disk.restore(0, 1) - temp = "Data restore complete." //TEMPORARY MENU FUNCTIONS else//To properly clear as per clear screen. temp=null @@ -533,8 +502,6 @@ What a mess.*/ active2.fields["criminal"] = "Parolled" if("released") active2.fields["criminal"] = "Released" - if("deceased") - active2.fields["criminal"] = "Deceased" if ("Delete Record (Security) Execute") if (active2) @@ -551,108 +518,11 @@ What a mess.*/ del(active2) else temp = "This function does not appear to be working at the moment. Our apologies." + add_fingerprint(usr) updateUsrDialog() return /obj/machinery/computer/secure_data/detective_computer - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "messyfiles" - -/obj/item/weapon/disk/records - name = "Crew Records Disk" - desc = "Stores security and medical records." - icon = 'cloning.dmi' - icon_state = "datadisk2" - item_state = "card-id" - w_class = 1.0 - var/list/general - var/list/security - var/list/medical - -/obj/item/weapon/disk/records/verb/label(t as text) - set name = "Label Disk" - set category = "Object" - set src in usr - - if (t) - src.name = text("Records Disk - '[]'", t) - else - src.name = "Crew Records Disk" - src.add_fingerprint(usr) - return - -/obj/item/weapon/disk/records/proc/backup(var/med, var/sec) - // have to manually copy each field so there's no references between data_core and the disk - general = new() - for(var/datum/data/record/E in data_core.general) - var/datum/data/record/G = new /datum/data/record() - for(var/F in E.fields) - G.fields[F] += E.fields[F] - general += G - - if(med) - medical = new() - for(var/datum/data/record/E in data_core.medical) - var/datum/data/record/G = new /datum/data/record() - for(var/F in E.fields) - G.fields[F] += E.fields[F] - medical += G - - if(sec) - security = new() - for(var/datum/data/record/E in data_core.security) - var/datum/data/record/G = new /datum/data/record() - for(var/F in E.fields) - G.fields[F] += E.fields[F] - security += G - -/obj/item/weapon/disk/records/proc/restore(var/med, var/sec) - // actually merge the content to not wipe new arrivals, etc - if(general) - for(var/datum/data/record/R in general) - for(var/datum/data/record/E in data_core.general) - if (E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]) - data_core.general -= E - break - var/datum/data/record/G = new /datum/data/record() - for(var/F in R.fields) - G.fields[F] += R.fields[F] - data_core.general += G - - if(med && medical) - for(var/datum/data/record/R in medical) - for(var/datum/data/record/E in data_core.medical) - if (E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]) - data_core.medical -= E - break - var/datum/data/record/G = new /datum/data/record() - for(var/F in R.fields) - G.fields[F] += R.fields[F] - data_core.medical += G - - if(sec && security) - for(var/datum/data/record/R in security) - for(var/datum/data/record/E in data_core.security) - if (E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]) - data_core.security -= E - break - var/datum/data/record/G = new /datum/data/record() - for(var/F in R.fields) - G.fields[F] += R.fields[F] - data_core.security += G - -/obj/item/weapon/storage/recordsbox - name = "Records Diskette Box" - icon_state = "disk_kit" - item_state = "syringe_kit" - -/obj/item/weapon/storage/recordsbox/New() - ..() - new /obj/item/weapon/disk/records(src) - new /obj/item/weapon/disk/records(src) - new /obj/item/weapon/disk/records(src) - new /obj/item/weapon/disk/records(src) - new /obj/item/weapon/disk/records(src) - new /obj/item/weapon/disk/records(src) - new /obj/item/weapon/disk/records(src) diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index 80656a9495..23c1c3b4a2 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -22,11 +22,13 @@ user << "The access level of [W:registered_name]\'s card is not high enough. " return - if(!(ACCESS_HEADS in W:access)) //doesn't have this access + if(!(access_heads in W:access)) //doesn't have this access user << "The access level of [W:registered_name]\'s card is not high enough. " return 0 var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") + if(emergency_shuttle.location != 1 && user.get_active_hand() != W) + return 0 switch(choice) if("Authorize") src.authorized -= W:registered_name @@ -54,12 +56,15 @@ src.authorized.len = 0 src.authorized = list( ) -/* else if (istype(W, /obj/item/weapon/card/emag)) + else if (istype(W, /obj/item/weapon/card/emag) && !emagged) var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") - switch(choice) - if("Launch") - world << "\blue Alert: Shuttle launch time shortened to 10 seconds!" - emergency_shuttle.settimeleft( 10 ) - if("Cancel") - return*/ + + if(!emagged && emergency_shuttle.location == 1 && user.get_active_hand() == W) + switch(choice) + if("Launch") + world << "\blue Alert: Shuttle launch time shortened to 10 seconds!" + emergency_shuttle.settimeleft( 10 ) + emagged = 1 + if("Cancel") + return return diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm new file mode 100644 index 0000000000..ba3eb12ec1 --- /dev/null +++ b/code/game/machinery/computer/station_alert.dm @@ -0,0 +1,110 @@ + +/obj/machinery/computer/station_alert + name = "Station Alert Computer" + desc = "Used to access the station's automated alert system." + icon_state = "alert:0" + circuit = "/obj/item/weapon/circuitboard/stationalert" + var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list()) + + + attack_ai(mob/user) + add_fingerprint(user) + if(stat & (BROKEN|NOPOWER)) + return + interact(user) + return + + + attack_hand(mob/user) + add_fingerprint(user) + if(stat & (BROKEN|NOPOWER)) + return + interact(user) + return + + + proc/interact(mob/user) + usr.machine = src + var/dat = "Current Station Alerts\n" + dat += "Close

    " + for (var/cat in src.alarms) + dat += text("[]
    \n", cat) + var/list/L = src.alarms[cat] + if (L.len) + for (var/alarm in L) + var/list/alm = L[alarm] + var/area/A = alm[1] + var/list/sources = alm[3] + dat += "" + dat += "• " + dat += "[A.name]" + if (sources.len > 1) + dat += text(" - [] sources", sources.len) + dat += "
    \n" + else + dat += "-- All Systems Nominal
    \n" + dat += "
    \n" + user << browse(dat, "window=alerts") + onclose(user, "alerts") + + + Topic(href, href_list) + if(..()) + return + return + + + proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource) + if(stat & (BROKEN)) + return + var/list/L = src.alarms[class] + for (var/I in L) + if (I == A.name) + var/list/alarm = L[I] + var/list/sources = alarm[3] + if (!(alarmsource in sources)) + sources += alarmsource + return 1 + var/obj/machinery/camera/C = null + var/list/CL = null + if (O && istype(O, /list)) + CL = O + if (CL.len == 1) + C = CL[1] + else if (O && istype(O, /obj/machinery/camera)) + C = O + L[A.name] = list(A, (C) ? C : O, list(alarmsource)) + return 1 + + + proc/cancelAlarm(var/class, area/A as area, obj/origin) + if(stat & (BROKEN)) + return + var/list/L = src.alarms[class] + var/cleared = 0 + for (var/I in L) + if (I == A.name) + var/list/alarm = L[I] + var/list/srcs = alarm[3] + if (origin in srcs) + srcs -= origin + if (srcs.len == 0) + cleared = 1 + L -= I + return !cleared + + + process() + if(stat & (BROKEN|NOPOWER)) + icon_state = "atmos0" + return + var/active_alarms = 0 + for (var/cat in src.alarms) + var/list/L = src.alarms[cat] + if(L.len) active_alarms = 1 + if(active_alarms) + icon_state = "alert:2" + else + icon_state = "alert:0" + ..() + return diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 5c22accd98..701cf3fb92 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -1,8 +1,8 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /obj/machinery/constructable_frame //Made into a seperate type to make future revisions easier. name = "machine frame" - icon = 'stock_parts.dmi' + icon = 'icons/obj/stock_parts.dmi' icon_state = "box_0" density = 1 anchored = 1 @@ -10,23 +10,8 @@ var/obj/item/weapon/circuitboard/circuit = null var/list/components = null var/list/req_components = null - var/list/req_component_names = null var/state = 1 - proc/update_desc() - var/D - if(req_components) - D = "Requires " - var/first = 1 - for(var/I in req_components) - if(req_components[I] > 0) - D += "[first?"":", "][num2text(req_components[I])] [req_component_names[I]]" - first = 0 - if(first) // nothing needs to be added, then - D += "nothing" - D += "." - desc = D - /obj/machinery/constructable_frame/machine_frame attackby(obj/item/P as obj, mob/user as mob) if(P.crit_fail) @@ -36,7 +21,7 @@ if(1) if(istype(P, /obj/item/weapon/cable_coil)) if(P:amount >= 5) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "\blue You start to add cables to the frame." if(do_after(user, 20)) P:amount -= 5 @@ -45,7 +30,7 @@ state = 2 icon_state = "box_1" if(istype(P, /obj/item/weapon/wrench)) - playsound(src.loc, 'Ratchet.ogg', 75, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "\blue You dismantle the frame" new /obj/item/stack/sheet/metal(src.loc, 5) del(src) @@ -53,7 +38,7 @@ if(istype(P, /obj/item/weapon/circuitboard)) var/obj/item/weapon/circuitboard/B = P if(B.board_type == "machine") - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "\blue You add the circuit board to the frame." circuit = P user.drop_item() @@ -64,20 +49,11 @@ req_components = circuit.req_components.Copy() for(var/A in circuit.req_components) req_components[A] = circuit.req_components[A] - req_component_names = circuit.req_components.Copy() - for(var/A in req_components) - var/cp = text2path(A) - var/obj/ct = new cp() // have to quickly instantiate it get name - req_component_names[A] = ct.name - if(circuit.frame_desc) - desc = circuit.frame_desc - else - update_desc() - user << desc + if(circuit.frame_desc) desc = circuit.frame_desc else user << "\red This frame does not accept circuit boards of this type!" if(istype(P, /obj/item/weapon/wirecutters)) - playsound(src.loc, 'wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "\blue You remove the cables." state = 1 icon_state = "box_0" @@ -86,7 +62,7 @@ if(3) if(istype(P, /obj/item/weapon/crowbar)) - playsound(src.loc, 'Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) state = 2 circuit.loc = src.loc circuit = null @@ -108,47 +84,34 @@ component_check = 0 break if(component_check) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) var/obj/machinery/new_machine = new src.circuit.build_path(src.loc) for(var/obj/O in new_machine.component_parts) del(O) new_machine.component_parts = list() for(var/obj/O in src) - if(circuit.contain_parts) // things like disposal don't want their parts in them - O.loc = new_machine - else - O.loc = null + O.loc = new_machine new_machine.component_parts += O - if(circuit.contain_parts) - circuit.loc = new_machine - else - circuit.loc = null + circuit.loc = new_machine new_machine.RefreshParts() del(src) if(istype(P, /obj/item/weapon)) for(var/I in req_components) if(istype(P, text2path(I)) && (req_components[I] > 0)) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) if(istype(P, /obj/item/weapon/cable_coil)) var/obj/item/weapon/cable_coil/CP = P if(CP.amount > 1) - var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src) - CC.amount = camt - CC.update_icon() - CP.use(camt) + CC.amount = 1 components += CC - req_components[I] -= camt - update_desc() + req_components[I]-- break user.drop_item() P.loc = src components += P req_components[I]-- - update_desc() break - user << desc if(P.loc != src && !istype(P, /obj/item/weapon/cable_coil)) user << "\red You cannot add that component to the machine!" @@ -226,23 +189,6 @@ to destroy them and players will be able to make replacements. build_path = "/obj/machinery/power/port_gen/pacman/mrs" origin_tech = "programming=3;powerstorage=5;engineering=5" -/obj/item/weapon/circuitboard/pacman/industrial - name = "Circuit Board (Industrial PACMAN-type Generator)" - build_path = "/obj/machinery/power/port_gen/pacman/industrial" - origin_tech = "programming=3;powerstorage=4;engineering=4" - -/obj/item/weapon/circuitboard/pacman2 - name = "Circuit Board (PACMANII-type Generator)" - build_path = "/obj/machinery/power/port_gen/pacman2" - board_type = "machine" - origin_tech = "programming=3:powerstorage=4;plasmatech=3;engineering=3" - frame_desc = "Requires 1 Matter Bin, 1 Micro-Laser, 2 Pieces of Cable, and 1 Capacitor." - req_components = list( - "/obj/item/weapon/stock_parts/matter_bin" = 1, - "/obj/item/weapon/stock_parts/micro_laser" = 1, - "/obj/item/weapon/cable_coil" = 2, - "/obj/item/weapon/stock_parts/capacitor" = 1) - obj/item/weapon/circuitboard/rdserver name = "Circuit Board (R&D Server)" build_path = "/obj/machinery/r_n_d/server" @@ -290,18 +236,6 @@ obj/item/weapon/circuitboard/rdserver "/obj/item/weapon/stock_parts/console_screen" = 1, "/obj/item/weapon/cable_coil" = 2,) -/obj/item/weapon/circuitboard/disposal - name = "Circuit board (Disposal)" - build_path = "/obj/machinery/disposal" - board_type = "machine" - origin_tech = "engineering=2" - frame_desc = "Requires 1 Matter Bin, and 1 piece of cable." - contain_parts = 0 - req_components = list( - "/obj/item/weapon/stock_parts/matter_bin" = 1, - "/obj/item/weapon/cable_coil" = 1) - m_amt = 50 - g_amt = 50 // Telecomms circuit boards: @@ -310,12 +244,34 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/receiver" board_type = "machine" origin_tech = "programming=4;engineering=3;bluespace=2" - frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Manipulators, and 1 Advanced Scanning Module." + frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Manipulators, and 1 Micro-Laser." req_components = list( "/obj/item/weapon/stock_parts/subspace/ansible" = 1, "/obj/item/weapon/stock_parts/subspace/filter" = 1, "/obj/item/weapon/stock_parts/manipulator" = 2, - "/obj/item/weapon/stock_parts/scanning_module/adv" = 1) + "/obj/item/weapon/stock_parts/micro_laser" = 1) + +/obj/item/weapon/circuitboard/telecomms/hub + name = "Circuit Board (Hub Mainframe)" + build_path = "/obj/machinery/telecomms/hub" + board_type = "machine" + origin_tech = "programming=4;engineering=4" + frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filter." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator" = 2, + "/obj/item/weapon/cable_coil" = 2, + "/obj/item/weapon/stock_parts/subspace/filter" = 2) + +/obj/item/weapon/circuitboard/telecomms/relay + name = "Circuit Board (Relay Mainframe)" + build_path = "/obj/machinery/telecomms/relay" + board_type = "machine" + origin_tech = "programming=3;engineering=4;bluespace=3" + frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filters." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator" = 2, + "/obj/item/weapon/cable_coil" = 2, + "/obj/item/weapon/stock_parts/subspace/filter" = 2) /obj/item/weapon/circuitboard/telecomms/bus name = "Circuit Board (Bus Mainframe)" @@ -333,9 +289,9 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/processor" board_type = "machine" origin_tech = "programming=4;engineering=4" - frame_desc = "Requires 5 Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier." + frame_desc = "Requires 3 Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier." req_components = list( - "/obj/item/weapon/stock_parts/manipulator" = 5, + "/obj/item/weapon/stock_parts/manipulator" = 3, "/obj/item/weapon/stock_parts/subspace/filter" = 1, "/obj/item/weapon/stock_parts/subspace/treatment" = 2, "/obj/item/weapon/stock_parts/subspace/analyzer" = 1, @@ -358,15 +314,13 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/broadcaster" board_type = "machine" origin_tech = "programming=4;engineering=4;bluespace=2" - frame_desc = "Requires 2 Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal, 1 Subspace Transmitter, 1 Subspace Amplifier and 4 High-Powered Micro-Lasers. " + frame_desc = "Requires 2 Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal and 2 High-Powered Micro-Lasers. " req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 2, "/obj/item/weapon/cable_coil" = 1, "/obj/item/weapon/stock_parts/subspace/filter" = 1, "/obj/item/weapon/stock_parts/subspace/crystal" = 1, - "/obj/item/weapon/stock_parts/subspace/transmitter" = 1, - "/obj/item/weapon/stock_parts/subspace/amplifier" = 1, - "/obj/item/weapon/stock_parts/micro_laser/high" = 4) + "/obj/item/weapon/stock_parts/micro_laser/high" = 2) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index b680e1e065..08419372b5 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -1,6 +1,6 @@ /obj/machinery/atmospherics/unary/cryo_cell name = "cryo cell" - icon = 'Cryogenic2.dmi' + icon = 'icons/obj/Cryogenic2.dmi' icon_state = "celltop-P" density = 1 anchored = 1.0 @@ -16,9 +16,6 @@ var/current_heat_capacity = 50 - return_air() - return air_contents - New() ..() @@ -47,7 +44,7 @@ if(air_contents) temperature_archived = air_contents.temperature -// heat_gas_contents() + heat_gas_contents() expel_gas() if(abs(temperature_archived-air_contents.temperature) > 1) @@ -149,7 +146,7 @@ else icon_state = "celltop-p" O1 = new /obj/effect/overlay( ) - O1.icon = 'Cryogenic2.dmi' + O1.icon = 'icons/obj/Cryogenic2.dmi' if(src.node) O1.icon_state = "cryo_bottom_[src.on]" else @@ -159,7 +156,7 @@ add_overlays() process_occupant() - if(air_contents.total_moles < 10) + if(air_contents.total_moles() < 10) return if(occupant) if(occupant.stat == 2) @@ -188,24 +185,22 @@ if(next_trans == 10) next_trans = 0 -//Fucking ghost-heating. -// heat_gas_contents() -// if(air_contents.total_moles < 1) -// return -// var/air_heat_capacity = air_contents.heat_capacity() -// var/combined_heat_capacity = current_heat_capacity + air_heat_capacity -// if(combined_heat_capacity > 0) -// var/combined_energy = T20C*current_heat_capacity + air_heat_capacity*air_contents.temperature -// air_contents.temperature = combined_energy/combined_heat_capacity + heat_gas_contents() + if(air_contents.total_moles() < 1) + return + var/air_heat_capacity = air_contents.heat_capacity() + var/combined_heat_capacity = current_heat_capacity + air_heat_capacity + if(combined_heat_capacity > 0) + var/combined_energy = T20C*current_heat_capacity + air_heat_capacity*air_contents.temperature + air_contents.temperature = combined_energy/combined_heat_capacity expel_gas() - if(air_contents.total_moles < 1) + if(air_contents.total_moles() < 1) return var/datum/gas_mixture/expel_gas = new - var/remove_amount = air_contents.total_moles/100 + var/remove_amount = air_contents.total_moles()/100 expel_gas = air_contents.remove(remove_amount) expel_gas.temperature = T20C // Lets expel hot gas and see if that helps people not die as they are removed - expel_gas.update_values() loc.assume_air(expel_gas) go_out() @@ -232,12 +227,12 @@ usr << "\red Subject may not have abiotic items on." return if(!src.node) - usr << "\red The cell is not corrrectly connected to its pipe network!" + usr << "\red The cell is not correctly connected to its pipe network!" return if (M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src - M.pulling = null + M.stop_pulling() M.loc = src if(M.health > -100 && (M.health < 0 || M.sleeping)) M << "\blue You feel a cold liquid surround you. Your skin starts to freeze up." @@ -252,9 +247,18 @@ set name = "Eject occupant" set category = "Object" set src in oview(1) - if (usr.stat != 0) - return - src.go_out() + if(usr == src.occupant)//If the user is inside the tube... + if (usr.stat == 2)//and he's not dead.... + return + usr << "\blue Release sequence activated. This will take two minutes." + sleep(1200) + if(!src || !usr || !src.occupant || (src.occupant != usr)) //Check if someone's released/replaced/bombed him already + return + src.go_out()//and release him from the eternal prison. + else + if (usr.stat != 0) + return + src.go_out() add_fingerprint(usr) return diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 3d4caacfd0..8d2857926f 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -1,8 +1,64 @@ +/* +CONTAINS: + +Deployable items +Barricades + +for reference: + + access_security = 1 + access_brig = 2 + access_armory = 3 + access_forensics_lockers= 4 + access_medical = 5 + access_morgue = 6 + access_tox = 7 + access_tox_storage = 8 + access_genetics = 9 + access_engine = 10 + access_engine_equip= 11 + access_maint_tunnels = 12 + access_external_airlocks = 13 + access_emergency_storage = 14 + access_change_ids = 15 + access_ai_upload = 16 + access_teleporter = 17 + access_eva = 18 + access_heads = 19 + access_captain = 20 + access_all_personal_lockers = 21 + access_chapel_office = 22 + access_tech_storage = 23 + access_atmospherics = 24 + access_bar = 25 + access_janitor = 26 + access_crematorium = 27 + access_kitchen = 28 + access_robotics = 29 + access_rd = 30 + access_cargo = 31 + access_construction = 32 + access_chemistry = 33 + access_cargo_bot = 34 + access_hydroponics = 35 + access_manufacturing = 36 + access_library = 37 + access_lawyer = 38 + access_virology = 39 + access_cmo = 40 + access_qm = 41 + access_court = 42 + access_clown = 43 + access_mime = 44 + +*/ + + //Barricades, maybe there will be a metal one later... /obj/structure/barricade/wooden name = "wooden barricade" desc = "This space is blocked off by a wooden barricade." - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' icon_state = "woodenbarricade" anchored = 1.0 density = 1.0 @@ -77,7 +133,7 @@ CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. if(air_group || (height==0)) return 1 - if(istype(mover) && mover.pass_flags&PASSTABLE) + if(istype(mover) && mover.checkpass(PASSTABLE)) return 1 else return 0 @@ -88,20 +144,20 @@ /obj/machinery/deployable name = "deployable" desc = "deployable" - icon = 'objects.dmi' - req_access = list(ACCESS_SECURITY)//I'm changing this until these are properly tested./N + icon = 'icons/obj/objects.dmi' + req_access = list(access_security)//I'm changing this until these are properly tested./N /obj/machinery/deployable/barrier name = "deployable barrier" desc = "A deployable barrier. Swipe your ID card to lock/unlock it." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' anchored = 0.0 density = 1.0 icon_state = "barrier0" var/health = 100.0 var/maxhealth = 100.0 var/locked = 0.0 -// req_access = list(ACCESS_MAINT_TUNNELS) +// req_access = list(access_maint_tunnels) New() ..() @@ -130,11 +186,6 @@ return return else if (istype(W, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return if (src.emagged == 0) src.emagged = 1 src.req_access = null @@ -158,13 +209,13 @@ if (src.health < src.maxhealth) src.health = src.maxhealth src.emagged = 0 - src.req_access = list(ACCESS_SECURITY) + src.req_access = list(access_security) for(var/mob/O in viewers(src, null)) O << "\red [user] repairs the [src]!" return else if (src.emagged > 0) src.emagged = 0 - src.req_access = list(ACCESS_SECURITY) + src.req_access = list(access_security) for(var/mob/O in viewers(src, null)) O << "\red [user] repairs the [src]!" return @@ -204,7 +255,7 @@ CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. if(air_group || (height==0)) return 1 - if(istype(mover) && mover.pass_flags&PASSTABLE) + if(istype(mover) && mover.checkpass(PASSTABLE)) return 1 else return 0 diff --git a/code/game/machinery/dispenser.dm b/code/game/machinery/dispenser.dm index 868e8061d3..f7de060a2f 100644 --- a/code/game/machinery/dispenser.dm +++ b/code/game/machinery/dispenser.dm @@ -50,9 +50,6 @@ del(src) return -/obj/machinery/dispenser/process() - return - /obj/machinery/dispenser/attack_ai(mob/user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index 734283e6d4..6dfa0da691 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -1,35 +1,3 @@ -/obj/machinery/door_control - name = "remote door-control" - desc = "It controls doors, remotely." - icon = 'stationobjs.dmi' - icon_state = "doorctrl0" - desc = "A remote control-switch for a door." - var/network = null - var/range = 10 - var/normaldoorcontrol = 0 - var/desiredstate = 0 // Zero is closed, 1 is open. - var/specialfunctions = 1 - /* - Bitflag, 1= open - 2= idscan, - 4= bolts - 8= shock - 16= door safties - - */ - - var/exposedwires = 0 - var/wires = 3 - /* - Bitflag, 1=checkID - 2=Network Access - */ - - anchored = 1.0 - use_power = 1 - idle_power_usage = 2 - active_power_usage = 4 - /obj/machinery/door_control/attack_ai(mob/user as mob) if(wires & 2) return src.attack_hand(user) @@ -74,7 +42,7 @@ if(normaldoorcontrol) for(var/obj/machinery/door/airlock/D in range(range)) - if(D.id_tag == src.network) + if(D.id_tag == src.id) if(desiredstate == 1) if(specialfunctions & OPEN) if (D.density) @@ -88,6 +56,8 @@ D.update_icon() if(specialfunctions & SHOCK) D.secondsElectrified = -1 + if(specialfunctions & SAFE) + D.safe = 0 else if(specialfunctions & OPEN) @@ -98,17 +68,17 @@ if(specialfunctions & IDSCAN) D.aiDisabledIdScanner = 0 if(specialfunctions & BOLTS) - D.locked = 0 - D.update_icon() + if(!D.isWireCut(4) && D.arePowerSystemsOn()) + D.locked = 0 + D.update_icon() if(specialfunctions & SHOCK) D.secondsElectrified = 0 - - + if(specialfunctions & SAFE) + D.safe = 1 else for(var/obj/machinery/door/poddoor/M in world) - if ( M.network == src.network || (!M.network && src.network == M.id)) - //if the network tags match or the door id tag matcehes the control network tag, go ahead + if (M.id == src.id) if (M.density) spawn( 0 ) M.open() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 42f14a1ea7..6552fbe7a5 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -7,14 +7,8 @@ #define AIRLOCK_WIRE_OPEN_DOOR 7 #define AIRLOCK_WIRE_AI_CONTROL 8 #define AIRLOCK_WIRE_ELECTRIFY 9 -#define AIRLOCK_WIRE_CRUSH 10 -#define AIRLOCK_WIRE_LIGHT 11 -#define AIRLOCK_WIRE_HOLDOPEN 12 -#define AIRLOCK_WIRE_FAKEBOLT1 13 -#define AIRLOCK_WIRE_FAKEBOLT2 14 -#define AIRLOCK_WIRE_ALERTAI 15 -#define AIRLOCK_WIRE_DOOR_BOLTS_2 16 -//#define AIRLOCK_WIRE_FINGERPRINT 17 +#define AIRLOCK_WIRE_SAFETY 10 +#define AIRLOCK_WIRE_SPEED 11 /* New methods: @@ -38,16 +32,16 @@ //This generates the randomized airlock wire assignments for the game. /proc/RandomAirlockWires() //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). - var/list/wires = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - airlockIndexToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - airlockIndexToWireColor = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - airlockWireColorToIndex = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + var/list/wires = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + airlockIndexToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + airlockIndexToWireColor = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + airlockWireColorToIndex = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) var/flagIndex = 1 - for (var/flag=1, flag<4096, flag+=flag) + for (var/flag=1, flag<2048, flag+=flag) var/valid = 0 while (!valid) - var/colorIndex = rand(1, 12) - if (wires[colorIndex] == 0) + var/colorIndex = rand(1, 11) + if(wires[colorIndex]==0) valid = 1 wires[colorIndex] = flag airlockIndexToFlag[flagIndex] = flag @@ -65,223 +59,192 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock name = "Airlock" - icon = 'doorint.dmi' + icon = 'icons/obj/doors/Doorint.dmi' icon_state = "door_closed" var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. var/hackProof = 0 // if 1, this door can't be hacked by the AI - var/synDoorHacked = 0 // Has it been hacked? bool 1 = yes / 0 = no - var/synHacking = 0 // Is hack in process y/n? var/secondsMainPowerLost = 0 //The number of seconds until power is restored. var/secondsBackupPowerLost = 0 //The number of seconds until power is restored. var/spawnPowerRestoreRunning = 0 var/welded = null var/locked = 0 - var/list/air_locked - var/wires = 4095 + var/wires = 2047 secondsElectrified = 0 //How many seconds remain until the door is no longer electrified. -1 if it is permanently electrified until someone fixes it. var/aiDisabledIdScanner = 0 var/aiHacking = 0 var/obj/machinery/door/airlock/closeOther = null var/closeOtherId = null - var/list/signalers[12] + var/list/signalers[11] var/lockdownbyai = 0 autoclose = 1 var/doortype = 0 var/justzap = 0 - var/safetylight = 1 + var/safe = 1 + normalspeed = 1 var/obj/item/weapon/airlock_electronics/electronics = null - var/alert_probability = 3 - var/list/wire_index = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Red" = 5, - "Blue" = 6, - "Green" = 7, - "Grey" = 8, - "Black" = 9, - "Pink" = 10, - "Brown" = 11, - "Maroon" = 12, - "Aqua" = 13, - "Turgoise" = 14, - "Purple" = 15, - "Rainbow" = 16, - "Atomic Tangerine" = 17, - "Neon Green" = 18, - "Cotton Candy" = 19, - "Plum" = 20, - "Shamrock" = 21, - "Indigo" = 22 - ) - var/wirenum = 12 - holdopen = 1 - - + var/hasShocked = 0 //Prevents multiple shocks from happening /obj/machinery/door/airlock/command name = "Airlock" - icon = 'Doorcom.dmi' + icon = 'icons/obj/doors/Doorcom.dmi' doortype = 1 - holdopen = 0 /obj/machinery/door/airlock/security name = "Airlock" - icon = 'Doorsec.dmi' + icon = 'icons/obj/doors/Doorsec.dmi' doortype = 2 /obj/machinery/door/airlock/engineering name = "Airlock" - icon = 'Dooreng.dmi' + icon = 'icons/obj/doors/Dooreng.dmi' doortype = 3 /obj/machinery/door/airlock/medical name = "Airlock" - icon = 'Doormed.dmi' + icon = 'icons/obj/doors/Doormed.dmi' doortype = 4 /obj/machinery/door/airlock/maintenance name = "Maintenance Access" - icon = 'Doormaint.dmi' + icon = 'icons/obj/doors/Doormaint.dmi' doortype = 5 /obj/machinery/door/airlock/external name = "External Airlock" - icon = 'Doorext.dmi' + icon = 'icons/obj/doors/Doorext.dmi' doortype = 6 /obj/machinery/door/airlock/glass name = "Glass Airlock" - icon = 'Doorglass.dmi' + icon = 'icons/obj/doors/Doorglass.dmi' opacity = 0 doortype = 7 glass = 1 /obj/machinery/door/airlock/centcom name = "Airlock" - icon = 'Doorele.dmi' + icon = 'icons/obj/doors/Doorele.dmi' opacity = 0 doortype = 8 /obj/machinery/door/airlock/vault name = "Vault" - icon = 'vault.dmi' + icon = 'icons/obj/doors/vault.dmi' opacity = 1 doortype = 9 /obj/machinery/door/airlock/glass_large name = "Glass Airlock" - icon = 'Door2x1glassfull.dmi' + icon = 'icons/obj/doors/Door2x1glassfull.dmi' opacity = 0 doortype = 10 glass = 1 /obj/machinery/door/airlock/freezer name = "Freezer Airlock" - icon = 'Doorfreezer.dmi' + icon = 'icons/obj/doors/Doorfreezer.dmi' opacity = 1 doortype = 11 /obj/machinery/door/airlock/hatch name = "Airtight Hatch" - icon = 'Doorhatchele.dmi' + icon = 'icons/obj/doors/Doorhatchele.dmi' opacity = 1 doortype = 12 /obj/machinery/door/airlock/maintenance_hatch name = "Maintenance Hatch" - icon = 'Doorhatchmaint2.dmi' + icon = 'icons/obj/doors/Doorhatchmaint2.dmi' opacity = 1 doortype = 13 -/obj/machinery/door/airlock/glass/glass_command +/obj/machinery/door/airlock/glass_command name = "Maintenance Hatch" - icon = 'Doorcomglass.dmi' + icon = 'icons/obj/doors/Doorcomglass.dmi' opacity = 0 doortype = 14 glass = 1 -/obj/machinery/door/airlock/glass/glass_engineering +/obj/machinery/door/airlock/glass_engineering name = "Maintenance Hatch" - icon = 'Doorengglass.dmi' + icon = 'icons/obj/doors/Doorengglass.dmi' opacity = 0 doortype = 15 glass = 1 -/obj/machinery/door/airlock/glass/glass_security +/obj/machinery/door/airlock/glass_security name = "Maintenance Hatch" - icon = 'Doorsecglass.dmi' + icon = 'icons/obj/doors/Doorsecglass.dmi' opacity = 0 doortype = 16 glass = 1 -/obj/machinery/door/airlock/glass/glass_medical +/obj/machinery/door/airlock/glass_medical name = "Maintenance Hatch" - icon = 'doormedglass.dmi' + icon = 'icons/obj/doors/Doormedglass.dmi' opacity = 0 doortype = 17 glass = 1 /obj/machinery/door/airlock/mining name = "Mining Airlock" - icon = 'Doormining.dmi' + icon = 'icons/obj/doors/Doormining.dmi' doortype = 18 /obj/machinery/door/airlock/atmos name = "Atmospherics Airlock" - icon = 'Dooratmo.dmi' + icon = 'icons/obj/doors/Dooratmo.dmi' doortype = 19 /obj/machinery/door/airlock/research - name = "Research Airlock" - icon = 'doorsci.dmi' + name = "Airlock" + icon = 'icons/obj/doors/Doorresearch.dmi' doortype = 20 -/obj/machinery/door/airlock/glass/glass_research - name = "Research Airlock" - icon = 'doorsciglass.dmi' +/obj/machinery/door/airlock/glass_research + name = "Maintenance Hatch" + icon = 'icons/obj/doors/Doorresearchglass.dmi' opacity = 0 doortype = 21 glass = 1 -/obj/machinery/door/airlock/glass/glass_mining +/obj/machinery/door/airlock/glass_mining name = "Maintenance Hatch" - icon = 'doorminingglass.dmi' + icon = 'icons/obj/doors/Doorminingglass.dmi' opacity = 0 doortype = 22 glass = 1 -/obj/machinery/door/airlock/glass/glass_atmos +/obj/machinery/door/airlock/glass_atmos name = "Maintenance Hatch" - icon = 'dooratmoglass.dmi' + icon = 'icons/obj/doors/Dooratmoglass.dmi' opacity = 0 doortype = 23 glass = 1 /obj/machinery/door/airlock/gold name = "Gold Airlock" - icon = 'Doorgold.dmi' + icon = 'icons/obj/doors/Doorgold.dmi' var/mineral = "gold" doortype = 24 /obj/machinery/door/airlock/silver name = "Silver Airlock" - icon = 'Doorsilver.dmi' + icon = 'icons/obj/doors/Doorsilver.dmi' var/mineral = "silver" doortype = 25 /obj/machinery/door/airlock/diamond name = "Diamond Airlock" - icon = 'Doordiamond.dmi' + icon = 'icons/obj/doors/Doordiamond.dmi' var/mineral = "diamond" doortype = 26 /obj/machinery/door/airlock/uranium name = "Uranium Airlock" desc = "And they said I was crazy." - icon = 'Dooruranium.dmi' + icon = 'icons/obj/doors/Dooruranium.dmi' var/mineral = "uranium" doortype = 27 var/last_event = 0 @@ -301,7 +264,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/plasma name = "Plasma Airlock" desc = "No way this can end badly." - icon = 'Doorplasma.dmi' + icon = 'icons/obj/doors/Doorplasma.dmi' var/mineral = "plasma" doortype = 28 @@ -338,16 +301,33 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. /obj/machinery/door/airlock/clown name = "Bananium Airlock" desc = "Honkhonkhonk" - icon = 'Doorbananium.dmi' + icon = 'icons/obj/doors/Doorbananium.dmi' var/mineral = "clown" doortype = 29 /obj/machinery/door/airlock/sandstone name = "Sandstone Airlock" - icon = 'Doorsand.dmi' + icon = 'icons/obj/doors/Doorsand.dmi' var/mineral = "sandstone" doortype = 30 +/obj/machinery/door/airlock/science + name = "Airlock" + icon = 'icons/obj/doors/Doorsci.dmi' + doortype = 31 + +/obj/machinery/door/airlock/glass_science + name = "Glass Airlocks" + icon = 'icons/obj/doors/Doorsciglass.dmi' + opacity = 0 + doortype = 32 + glass = 1 + +/obj/machinery/door/airlock/highsecurity + name = "High Tech Security Airlock" + icon = 'icons/obj/doors/hightechsecurity.dmi' + doortype = 33 + /* About the new airlock wires panel: * An airlock wire dialog can be accessed by the normal way or by using wirecutters or a multitool on the door while the wire-panel is open. This would show the following wires, which you can either wirecut/mend or send a multitool pulse through. There are 9 wires. @@ -358,12 +338,14 @@ About the new airlock wires panel: * one wire for opening the door. Sending a pulse through this while the door has power makes it open the door if no access is required. * one wire for AI control. Sending a pulse through this blocks AI control for a second or so (which is enough to see the AI control light on the panel dialog go off and back on again). Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. * one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. (Currently it is also STAYING electrified until someone mends the wire) +* one wire for controling door safetys. When active, door does not close on someone. When cut, door will ruin someone's shit. When pulsed, door will immedately ruin someone's shit. +* one wire for controlling door speed. When active, dor closes at normal rate. When cut, door does not close manually. When pulsed, door attempts to close every tick. */ -/obj/machinery/door/airlock/bumpopen(mob/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite - if(!istype(usr, /mob/living/silicon)) +/obj/machinery/door/airlock/bumpopen(mob/living/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite + if(!issilicon(usr)) if(src.isElectrified()) if(!src.justzap) if(src.shock(user, 100)) @@ -389,7 +371,7 @@ About the new airlock wires panel: //Sending a pulse through this flashes the red light on the door (if the door has power). if((src.arePowerSystemsOn()) && (!(stat & NOPOWER))) animate("deny") - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) + if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2) //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). src.loseMainPower() if(AIRLOCK_WIRE_DOOR_BOLTS) @@ -397,16 +379,18 @@ About the new airlock wires panel: //raises them if they are down (only if power's on) if(!src.locked) src.locked = 1 - usr << "You hear a click from the bottom of the door." + for(var/mob/M in range(1,src)) + M << "You hear a click from the bottom of the door." src.updateUsrDialog() else if(src.arePowerSystemsOn()) //only can raise bolts if power's on src.locked = 0 - usr << "You hear a click from inside the door." + for(var/mob/M in range(1,src)) + M << "You hear a click from the bottom of the door." src.updateUsrDialog() update_icon() - if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) + if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). src.loseBackupPower() if(AIRLOCK_WIRE_AI_CONTROL) @@ -424,6 +408,8 @@ About the new airlock wires panel: if(AIRLOCK_WIRE_ELECTRIFY) //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. if(src.secondsElectrified==0) + shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") + usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]") src.secondsElectrified = 30 spawn(10) //TODO: Move this into process() and make pulsing reset secondsElectrified to 30 @@ -441,12 +427,15 @@ About the new airlock wires panel: open() else close() - if(AIRLOCK_WIRE_CRUSH) - src.forcecrush = !src.forcecrush - if(AIRLOCK_WIRE_LIGHT) - src.safetylight = !src.safetylight - if(AIRLOCK_WIRE_HOLDOPEN) - src.holdopen = !src.holdopen + if(AIRLOCK_WIRE_SAFETY) + safe = !safe + if(!src.density) + close() + src.updateUsrDialog() + + if(AIRLOCK_WIRE_SPEED) + normalspeed = !normalspeed + src.updateUsrDialog() /obj/machinery/door/airlock/proc/cut(var/wireColor) @@ -454,7 +443,7 @@ About the new airlock wires panel: var/wireIndex = airlockWireColorToIndex[wireColor] wires &= ~wireFlag switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) + if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2) //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user. src.loseMainPower() src.shock(usr, 50) @@ -465,7 +454,7 @@ About the new airlock wires panel: src.locked = 1 update_icon() src.updateUsrDialog() - if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) + if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. src.loseBackupPower() src.shock(usr, 50) @@ -481,20 +470,28 @@ About the new airlock wires panel: if(AIRLOCK_WIRE_ELECTRIFY) //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. if(src.secondsElectrified != -1) + shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") + usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]") src.secondsElectrified = -1 + if (AIRLOCK_WIRE_SAFETY) + safe = 0 + src.updateUsrDialog() + if(AIRLOCK_WIRE_SPEED) + autoclose = 0 + src.updateUsrDialog() /obj/machinery/door/airlock/proc/mend(var/wireColor) var/wireFlag = airlockWireColorToFlag[wireColor] var/wireIndex = airlockWireColorToIndex[wireColor] //not used in this function wires |= wireFlag switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) + if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2) if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))) src.regainMainPower() src.shock(usr, 50) src.updateUsrDialog() - if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) + if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))) src.regainBackupPower() src.shock(usr, 50) @@ -511,11 +508,21 @@ About the new airlock wires panel: if(src.secondsElectrified == -1) src.secondsElectrified = 0 + if (AIRLOCK_WIRE_SAFETY) + safe = 1 + src.updateUsrDialog() + if(AIRLOCK_WIRE_SPEED) + autoclose = 1 + if(!src.density) + close() + src.updateUsrDialog() /obj/machinery/door/airlock/proc/isElectrified() - return (src.secondsElectrified != 0); + if(src.secondsElectrified != 0) + return 1 + return 0 /obj/machinery/door/airlock/proc/isWireColorCut(var/wireColor) var/wireFlag = airlockWireColorToFlag[wireColor] @@ -531,14 +538,6 @@ About the new airlock wires panel: /obj/machinery/door/airlock/proc/canAIHack() return ((src.aiControlDisabled==1) && (!hackProof) && (!src.isAllPowerCut())); - -/obj/machinery/door/airlock/proc/canSynControl() - return (src.synDoorHacked && (!src.isAllPowerCut())); - - -/obj/machinery/door/airlock/proc/canSynHack(obj/item/device/hacktool/H) - return (in_range(src, usr) && get_dist(src, H) <= 1 && src.synDoorHacked==0 && !src.isAllPowerCut()); - /obj/machinery/door/airlock/proc/arePowerSystemsOn() return (src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) @@ -546,7 +545,11 @@ About the new airlock wires panel: return !(src.isWireCut(AIRLOCK_WIRE_IDSCAN) || aiDisabledIdScanner) /obj/machinery/door/airlock/proc/isAllPowerCut() - return ((src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1) || src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)) && (src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1) || src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))) + var/retval=0 + if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1) || src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)) + if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1) || src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)) + retval=1 + return retval /obj/machinery/door/airlock/proc/regainMainPower() if(src.secondsMainPowerLost > 0) @@ -592,146 +595,35 @@ About the new airlock wires panel: /obj/machinery/door/airlock/proc/shock(mob/user, prb) if((stat & (NOPOWER)) || !src.arePowerSystemsOn()) // unpowered, no shock return 0 + if(hasShocked) + return 0 //Already shocked someone recently? if(!prob(prb)) return 0 //you lucked out, no shock for you - if(istype(usr.equipped(),/obj/item/weapon/shard)) - return 0 var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() //sparks always. if(electrocute_mob(user, get_area(src), src)) + hasShocked = 1 + sleep(10) + hasShocked = 0 return 1 else return 0 -/obj/machinery/door/airlock/proc/synhack(mob/user as mob, obj/item/device/hacktool/I) - if (src.synHacking==0) - var/multiplier = 1.5 - if(istype(I, /obj/item/device/hacktool/engineer)) - if(!src.locked) - user << "The door bolts are already up!" - return - multiplier -= 0.5 - src.synHacking=1 - I.in_use = 1 - user << "You begin hacking..." - spawn(20*multiplier) - user << "Jacking in. Stay close to the airlock or you'll rip the cables out and we'll have to start over." - sleep(25*multiplier) - if (src.canSynControl() && !istype(I, /obj/item/device/hacktool/engineer)) - user << "Hack cancelled, control already possible." - src.synHacking=0 - I.in_use = 0 - return - else if (!src.canSynHack(I)) - user << "\red Connection lost. Stand still and stay near the airlock!" - src.synHacking=0 - I.in_use = 0 - return - user << "Connection established." - sleep(10*multiplier) - user << "Attempting to hack into airlock. This may take some time." - sleep(50*multiplier) - - // Alerting the AIs - var/list/cameras = list() - for (var/obj/machinery/camera/C in src.loc.loc.contents) // getting all cameras in the area - cameras += C - var/alertoption = (prob(alert_probability) || istype(I, /obj/item/device/hacktool/engineer)) // Chance of warning AI, based on doortype's probability - if(alertoption) - if(prob(15)) //15% chance of sending the AI all the details (camera, area, warning) - alertoption = 3 - else if (prob(18)) //18% chance of sending the AI just the area - alertoption = 2 - for (var/mob/living/silicon/ai/aiPlayer in world) - if (aiPlayer.stat != 2) - switch(alertoption) - if(3) aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc, cameras) - if(2) aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - if(1) aiPlayer.triggerUnmarkedAlarm("AirlockHacking") - for (var/mob/living/silicon/robot/robotPlayer in world) - if (robotPlayer.stat != 2) - switch(alertoption) - if(2,3) robotPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - if(1) robotPlayer.triggerUnmarkedAlarm("AirlockHacking") - // ...And done - - if (!src.canSynHack(I)) - user << "\red Hack aborted: landline connection lost. Stay closer to the airlock." - src.synHacking=0 - I.in_use = 0 - return - else if (src.canSynControl() && !istype(I, /obj/item/device/hacktool/engineer)) - user << "Local override already in place, hack aborted." - src.synHacking=0 - I.in_use = 0 - return - user << "Upload access confirmed. Loading control program into airlock software." - sleep(35*multiplier) - if (!src.canSynHack(I)) - user << "\red Hack aborted: cable connection lost. Do not move away from the airlock." - src.synHacking=0 - I.in_use = 0 - return - else if (src.canSynControl() && !istype(I, /obj/item/device/hacktool/engineer)) - user << "Upload access aborted, local override already in place." - src.synHacking=0 - I.in_use = 0 - return - user << "Transfer complete. Forcing airlock to execute program." - sleep(25*multiplier) - //disable blocked control - if(istype(I, /obj/item/device/hacktool/engineer)) - user << "Raising door bolts..." - src.synHacking = 0 - src.locked = 0 - I.in_use = 0 - update_icon() - return - src.synDoorHacked = 1 - user << "Bingo! We're in. Airlock control panel coming right up." - sleep(5) - //bring up airlock dialog - src.synHacking = 0 - I.in_use = 0 - src.attack_ai(user, I) - -/obj/machinery/door/airlock/proc/getAirlockWires() - var/t1 - var/iterator = 0 - for(var/wiredesc in wire_index) - if(iterator == wirenum) - break - var/is_uncut = src.wires & airlockWireColorToFlag[wire_index[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "Mend" - else - t1 += "Cut " - t1 += "Pulse " - if(src.signalers[wire_index[wiredesc]]) - t1 += "Detach signaler" - else - t1 += "Attach signaler" - t1 += "
    " - iterator++ - return t1 /obj/machinery/door/airlock/update_icon() if(overlays) overlays = null if(density) - if(locked && safetylight && !air_locked) + if(locked) icon_state = "door_locked" else icon_state = "door_closed" - if(p_open || welded || air_locked) + if(p_open || welded) overlays = list() if(p_open) overlays += image(icon, "panel_open") if(welded) overlays += image(icon, "welded") - if(air_locked) - overlays += image('Door1.dmi', "air") else icon_state = "door_open" @@ -742,7 +634,8 @@ About the new airlock wires panel: if("opening") if(overlays) overlays = null if(p_open) - icon_state = "o_door_opening" //can not use flick due to BYOND bug updating overlays right before flicking + spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond. + flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking else flick("door_opening", src) if("closing") @@ -757,31 +650,13 @@ About the new airlock wires panel: flick("door_deny", src) return -//This has been converted to be called by either the AI or a mob with a hacktool, permitting either to directly operate the airlock -/obj/machinery/door/airlock/attack_ai(mob/user as mob, obj/item/device/hacktool/C) - if(isAI(user)) - if (!src.canAIControl()) - if (src.canAIHack()) - src.hack(user) - return - else if(user && !isrobot(user)) - if(!C) +/obj/machinery/door/airlock/attack_ai(mob/user as mob) + if(!src.canAIControl()) + if(src.canAIHack()) + src.hack(user) return - if(C.in_use) - user << "We are already hacking another airlock." - return - if (!src.canSynControl() && src.canSynHack(C)) - src.synhack(user, C) - return - if(!src.canSynHack(C) && !synDoorHacked) - user << "The power is cut or something, I can't hack it!" - return - if(istype(C, /obj/item/device/hacktool/engineer)) - return - else if(!isrobot(user)) - world << "ERROR: Mob was null when calling attack_ai on [src.name] at [src.x],[src.y],[src.z]" - return - + else + user << "Airlock AI control has been blocked with a firewall. Unable to hack." //Separate interface for the AI. user.machine = src @@ -826,13 +701,6 @@ About the new airlock wires panel: if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)) t1 += text("Backup Power Output wire is cut.
    \n") - if(src.isWireCut(AIRLOCK_WIRE_CRUSH)) - t1 += text("Airlock extra force wire is cut.
    \n") - else if(!src.forcecrush) - t1 += text("Airlock extra force disabled Enable it?
    \n") - else - t1 += text("Airlock extra force enabled Disable it?
    \n") - if(src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS)) t1 += text("Door bolt drop wire is cut.
    \n") else if(!src.locked) @@ -852,19 +720,19 @@ About the new airlock wires panel: else t1 += text("Door is not electrified. Electrify it for 30 seconds? Or, Electrify it indefinitely until someone cancels the electrification?
    \n", src, src) - if(src.isWireCut(AIRLOCK_WIRE_LIGHT)) - t1 += "Bolt indication light wire is cut.
    \n" - else if(!src.safetylight) - t1 += text("Bolt Indication light is disabled Enable it?
    \n") + if(src.isWireCut(AIRLOCK_WIRE_SAFETY)) + t1 += text("Door force sensors not responding.
    \n") + else if(src.safe) + t1 += text("Door safeties operating normally. Override?
    \n",src) else - t1 += text("Bolt Indication light is enabled Disable it?
    \n") + t1 += text("Danger. Door safeties disabled. Restore?
    \n",src) - if(src.isWireCut(AIRLOCK_WIRE_HOLDOPEN)) - t1 += "Behavior Control light wire is cut.
    \n" - else if(!src.holdopen) - t1 += text("Door behavior is set to: Automatically close Toggle?
    \n") + if(src.isWireCut(AIRLOCK_WIRE_SPEED)) + t1 += text("Door timing circuitry not responding.
    \n") + else if(src.normalspeed) + t1 += text("Door timing circuitry operating normally. Override?
    \n",src) else - t1 += text("Door behavior is set to: Wait for clearance to close Toggle?
    \n") + t1 += text("Warning. Door timing circuitry operating abnormally. Restore?
    \n",src) @@ -881,8 +749,8 @@ About the new airlock wires panel: user << browse(t1, "window=airlock") onclose(user, "airlock") -//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 engage engineer smasher, 9 enable bolt indicator, 10 wait for clearance -//aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door, 8 disable engineer smasher, 9 disable bolt indicator, 10 autoclose +//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door +//aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door /obj/machinery/door/airlock/proc/hack(mob/user as mob) @@ -945,15 +813,15 @@ About the new airlock wires panel: if(ishuman(user) && prob(40) && src.density) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 60) - playsound(src.loc, 'bang.ogg', 25, 1) + playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) if(!istype(H.head, /obj/item/clothing/head/helmet)) for(var/mob/M in viewers(src, null)) M << "\red [user] headbutts the airlock." var/datum/organ/external/affecting = H.get_organ("head") - affecting.take_damage(10, 0) H.Stun(8) H.Weaken(5) - H.UpdateDamageIcon() + if(affecting.take_damage(10, 0)) + H.UpdateDamageIcon() else for(var/mob/M in viewers(src, null)) M << "\red [user] headbutts the airlock. Good thing they're wearing a helmet." @@ -964,9 +832,34 @@ About the new airlock wires panel: var/t1 = text("Access Panel
    \n") //t1 += text("[]: ", airlockFeatureNames[airlockWireColorToIndex[9]]) - t1 += getAirlockWires() + var/list/wires = list( + "Orange" = 1, + "Dark red" = 2, + "White" = 3, + "Yellow" = 4, + "Red" = 5, + "Blue" = 6, + "Green" = 7, + "Grey" = 8, + "Black" = 9, + "Gold" = 10, + "Aqua" = 11 + ) + for(var/wiredesc in wires) + var/is_uncut = src.wires & airlockWireColorToFlag[wires[wiredesc]] + t1 += "[wiredesc] wire: " + if(!is_uncut) + t1 += "Mend" + else + t1 += "Cut " + t1 += "Pulse " + if(src.signalers[wires[wiredesc]]) + t1 += "Detach signaler" + else + t1 += "Attach signaler" + t1 += "
    " - t1 += text("
    \n[]
    \n[]
    \n[]
    \n[]
    \n[]", (src.locked ? "The door bolts have fallen!" : "The door bolts look up."), ((src.arePowerSystemsOn() && !(stat & NOPOWER)) ? "The test light is on." : "The test light is off!"), (src.aiControlDisabled==0 ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), (src.secondsElectrified!=0 ? "The safety light is flashing!" : "The safety light is on."), (src.forcecrush==0 ? "The hydraulics control light is a solid green." : "The hydraulics control light is flashing red.")) + t1 += text("
    \n[]
    \n[]
    \n[]
    \n[]", (src.locked ? "The door bolts have fallen!" : "The door bolts look up."), ((src.arePowerSystemsOn() && !(stat & NOPOWER)) ? "The test light is on." : "The test light is off!"), (src.aiControlDisabled==0 ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), (src.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off.")) t1 += text("

    Close

    \n", src) @@ -983,26 +876,27 @@ About the new airlock wires panel: ..() if(usr.stat || usr.restrained()) return + add_fingerprint(usr) if(href_list["close"]) usr << browse(null, "window=airlock") if(usr.machine==src) usr.machine = null return - if(in_range(src, usr) && istype(src.loc, /turf) && p_open) + if((in_range(src, usr) && istype(src.loc, /turf)) && src.p_open) usr.machine = src if(href_list["wires"]) var/t1 = text2num(href_list["wires"]) - if(!( istype(usr.equipped(), /obj/item/weapon/wirecutters) || istype(usr.equipped(),/obj/item/weapon/shard))) + if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return - if(src.isWireColorCut(t1) && istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if(src.isWireColorCut(t1)) src.mend(t1) else src.cut(t1) else if(href_list["pulse"]) var/t1 = text2num(href_list["pulse"]) - if(!istype(usr.equipped(), /obj/item/device/multitool)) + if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if(src.isWireColorCut(t1)) @@ -1012,13 +906,13 @@ About the new airlock wires panel: src.pulse(t1) else if(href_list["signaler"]) var/wirenum = text2num(href_list["signaler"]) - if(!istype(usr.equipped(), /obj/item/device/assembly/signaler)) + if(!istype(usr.get_active_hand(), /obj/item/device/assembly/signaler)) usr << "You need a signaller!" return if(src.isWireColorCut(wirenum)) usr << "You can't attach a signaller to a cut wire." return - var/obj/item/device/assembly/signaler/R = usr.equipped() + var/obj/item/device/assembly/signaler/R = usr.get_active_hand() if(R.secured) usr << "This radio can't be attached!" return @@ -1037,16 +931,12 @@ About the new airlock wires panel: R.airlock_wire = null src.signalers[wirenum] = null - src.update_icon() - add_fingerprint(usr) - src.updateUsrDialog() - else //AI or Syndicate using hacktool - if (!src.canAIControl() || (istype(usr.equipped(), /obj/item/device/hacktool/) && (!src.canSynControl() || !in_range(src, usr)))) - usr << "Airlock control connection lost!" - return - //aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door - //aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door - if (href_list["aiDisable"]) + + if(istype(usr, /mob/living/silicon) && src.canAIControl()) + //AI + //aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed + //aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door, 8 door safties, 9 door speed + if(href_list["aiDisable"]) var/code = text2num(href_list["aiDisable"]) switch (code) if(1) @@ -1084,6 +974,27 @@ About the new airlock wires panel: src.secondsElectrified = 0 else if(src.secondsElectrified>0) src.secondsElectrified = 0 + + if(8) + // Safeties! We don't need no stinking safeties! + if (src.isWireCut(AIRLOCK_WIRE_SAFETY)) + usr << text("Control to door sensors is disabled.
    \n") + else if (src.safe) + safe = 0 + else + usr << text("Firmware reports safeties already overriden.
    \n") + + + + if(9) + // Door speed control + if(src.isWireCut(AIRLOCK_WIRE_SPEED)) + usr << text("Control to door timing circuitry has been severed.
    \n") + else if (src.normalspeed) + normalspeed = 0 + else + usr << text("Door timing circurity already accellerated.") + if(7) //close door if(src.welded) @@ -1094,21 +1005,6 @@ About the new airlock wires panel: close() else usr << text("The airlock is already closed.
    \n") - if(8) - if(!src.forcecrush) - usr << text("Door extra force not enabled!
    \n") - else - src.forcecrush = 0 - if (9) - if(!src.safetylight) - usr << text("Bolt indication light not enabled!
    \n") - else - src.safetylight = 0 - if (10) - if(!src.holdopen) - usr << text("Door Behavior already set to: Wait for clearance to close
    \n") - else - src.holdopen = 0 @@ -1145,6 +1041,8 @@ About the new airlock wires panel: else if(src.secondsElectrified!=0) usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.
    \n") else + shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") + usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]") src.secondsElectrified = 30 spawn(10) while (src.secondsElectrified>0) @@ -1162,7 +1060,30 @@ About the new airlock wires panel: else if(src.secondsElectrified!=0) usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.
    \n") else + shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") + usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]") src.secondsElectrified = -1 + + if (8) // Not in order >.> + // Safeties! Maybe we do need some stinking safeties! + if (src.isWireCut(AIRLOCK_WIRE_SAFETY)) + usr << text("Control to door sensors is disabled.
    \n") + else if (!src.safe) + safe = 1 + src.updateUsrDialog() + else + usr << text("Firmware reports safeties already in place.
    \n") + + if(9) + // Door speed control + if(src.isWireCut(AIRLOCK_WIRE_SPEED)) + usr << text("Control to door timing circuitry has been severed.
    \n") + else if (!src.normalspeed) + normalspeed = 1 + src.updateUsrDialog() + else + usr << text("Door timing circurity currently operating normally.") + if(7) //open door if(src.welded) @@ -1174,29 +1095,10 @@ About the new airlock wires panel: // close() else usr << text("The airlock is already opened.
    \n") - if(8) - if(src.forcecrush) - usr << text("Door extra force already enabled!
    \n") - else - src.forcecrush = 1 - if(9) - if(src.safetylight) - usr << text("Bolt indication light already enabled!
    \n") - else - src.safetylight = 1 - if(10) - if(src.holdopen) - usr << text("Door Behavior already set to: Automatically close
    \n") - else - src.holdopen = 1 - - src.update_icon() - if(!nowindow) - src.updateUsrDialog() - if((istype(usr.equipped(), /obj/item/device/hacktool))) - return attack_ai(usr, usr.equipped()) - else if(issilicon(usr)) - return attack_ai(usr) + add_fingerprint(usr) + update_icon() + if(!nowindow) + updateUsrDialog() return /obj/machinery/door/airlock/attackby(C as obj, mob/user as mob) @@ -1207,8 +1109,6 @@ About the new airlock wires panel: return if(istype(C, /obj/item/device/detective_scanner)) return - if(istype(C, /obj/item/taperoll/police)) - return src.add_fingerprint(user) if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density)) @@ -1229,8 +1129,6 @@ About the new airlock wires panel: return src.attack_hand(user) else if(istype(C, /obj/item/device/multitool)) return src.attack_hand(user) - else if(istype(C, /obj/item/device/hacktool)) - return src.attack_ai(user, C) else if(istype(C, /obj/item/device/assembly/signaler)) return src.attack_hand(user) else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE @@ -1243,7 +1141,7 @@ About the new airlock wires panel: else beingcrowbarred = 0 if( beingcrowbarred && (density && welded && !operating && src.p_open && (!src.arePowerSystemsOn() || stat & NOPOWER) && !src.locked) ) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") if(do_after(user,40)) user << "\blue You removed the airlock electronics!" @@ -1256,6 +1154,8 @@ About the new airlock wires panel: if(5) new/obj/structure/door_assembly/door_assembly_mai( src.loc ) if(6) new/obj/structure/door_assembly/door_assembly_ext( src.loc ) if(7) new/obj/structure/door_assembly/door_assembly_glass( src.loc ) + if(12) new/obj/structure/door_assembly/door_assembly_hatch( src.loc ) + if(13) new/obj/structure/door_assembly/door_assembly_mhatch( src.loc ) if(14) new/obj/structure/door_assembly/door_assembly_com/glass( src.loc ) if(15) new/obj/structure/door_assembly/door_assembly_eng/glass( src.loc ) if(16) new/obj/structure/door_assembly/door_assembly_sec/glass( src.loc ) @@ -1273,6 +1173,9 @@ About the new airlock wires panel: if(28) new/obj/structure/door_assembly/door_assembly_plasma( src.loc ) if(29) new/obj/structure/door_assembly/door_assembly_clown( src.loc ) if(30) new/obj/structure/door_assembly/door_assembly_sandstone( src.loc ) + if(31) new/obj/structure/door_assembly/door_assembly_science( src.loc ) + if(32) new/obj/structure/door_assembly/door_assembly_science/glass( src.loc ) + if(33) new/obj/structure/door_assembly/door_assembly_highsecurity(src.loc) var/obj/item/weapon/airlock_electronics/ae if(!electronics) @@ -1304,8 +1207,8 @@ About the new airlock wires panel: src.density = 0 update_icon() - if(!istype(src, /obj/machinery/door/airlock/glass)) - src.ul_SetOpacity(0) + if(!glass) + src.sd_SetOpacity(0) src.operating = 0 return user << "\red You need to be wielding the Fire axe to do that." @@ -1321,8 +1224,8 @@ About the new airlock wires panel: src.density = 0 update_icon() - if(!istype(src, /obj/machinery/door/airlock/glass)) - src.ul_SetOpacity(0) + if(!glass) + src.sd_SetOpacity(0) src.operating = 0 return @@ -1340,8 +1243,8 @@ About the new airlock wires panel: sleep(15) update_icon() - if((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass))) - src.ul_SetOpacity(1) + if((src.visible) && (!glass)) + src.sd_SetOpacity(1) src.operating = 0 else user << "\red You need to be wielding the Fire axe to do that." @@ -1355,8 +1258,8 @@ About the new airlock wires panel: sleep(15) update_icon() - if((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass))) - src.ul_SetOpacity(1) + if((src.visible) && (!glass)) + src.sd_SetOpacity(1) src.operating = 0 else @@ -1373,29 +1276,54 @@ About the new airlock wires panel: return 0 use_power(50) if(istype(src, /obj/machinery/door/airlock/glass)) - playsound(src.loc, 'windowdoor.ogg', 100, 1) + playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) if(istype(src, /obj/machinery/door/airlock/clown)) - playsound(src.loc, 'bikehorn.ogg', 30, 1) + playsound(src.loc, 'sound/items/bikehorn.ogg', 30, 1) else - playsound(src.loc, 'airlock.ogg', 30, 1) + playsound(src.loc, 'sound/machines/airlock.ogg', 30, 1) if(src.closeOther != null && istype(src.closeOther, /obj/machinery/door/airlock/) && !src.closeOther.density) src.closeOther.close() return ..() /obj/machinery/door/airlock/close() - if(src.welded || src.locked || (!src.arePowerSystemsOn()) || (stat & NOPOWER) || src.isWireCut(AIRLOCK_WIRE_OPEN_DOOR) || src.operating) + if(src.welded || src.locked || (!src.arePowerSystemsOn()) || (stat & NOPOWER) || src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS) || src.operating) return - ..() + if(safe) + if(locate(/mob/living) in get_turf(src)) + // playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0) //THE BUZZING IT NEVER STOPS -Pete + spawn (60) + close() + return + + for(var/mob/living/M in get_turf(src)) + if(isrobot(M)) + M.adjustBruteLoss(DOOR_CRUSH_DAMAGE) + else + M.adjustBruteLoss(DOOR_CRUSH_DAMAGE) + M.SetStunned(5) + M.SetWeakened(5) + var/obj/effect/stop/S + S = new /obj/effect/stop + S.victim = M + S.loc = src.loc + spawn(20) + del(S) + M.emote("scream") + var/turf/location = src.loc + if(istype(location, /turf/simulated)) + location.add_blood(M) + use_power(50) if(istype(src, /obj/machinery/door/airlock/glass)) - playsound(src.loc, 'windowdoor.ogg', 30, 1) + playsound(src.loc, 'sound/machines/windowdoor.ogg', 30, 1) if(istype(src, /obj/machinery/door/airlock/clown)) - playsound(src.loc, 'bikehorn.ogg', 30, 1) + playsound(src.loc, 'sound/items/bikehorn.ogg', 30, 1) else - playsound(src.loc, 'airlock.ogg', 30, 1) + playsound(src.loc, 'sound/machines/airlock.ogg', 30, 1) var/obj/structure/window/killthis = (locate(/obj/structure/window) in get_turf(src)) if(killthis) killthis.ex_act(2)//Smashin windows + ..() return /obj/machinery/door/airlock/New() @@ -1413,455 +1341,3 @@ About the new airlock wires panel: src.open() src.locked = 1 return - - -/obj/machinery/door/airlock/secure - name = "Secure Airlock" - desc = "Good lord, at least they left out the overcomplicated death traps. Looks to be a layer of armor plate you might be able to remove with a wrench." - icon = 'Doorhatchele.dmi' - - wires = 65535 - wirenum = 16 - alert_probability = 20 - holdopen = 0 - signalers = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - var - list/WireColorToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - list/IndexToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - list/IndexToWireColor = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - list/WireColorToIndex = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - is_detached = 0 - removal_step = 0 - - -/obj/machinery/door/airlock/secure/attackby(C as obj, mob/user as mob) - //world << text("airlock attackby src [] obj [] mob []", src, C, user) - if(istype(C, /obj/item/device/detective_scanner)) - return - if(!src.is_detached && C) - if (!istype(usr, /mob/living/silicon)) - if (src.isElectrified()) - if(src.shock(user, 75)) - return - if (istype(C, /obj/item/device/hacktool)) - return src.attack_ai(user, C) - if(ismob(C)) - return ..(C, user) - src.add_fingerprint(user) - switch(removal_step) - if(0) - if ((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density)) - var/obj/item/weapon/weldingtool/W = C - if(W.remove_fuel(0,user)) - if (!src.welded) - src.welded = 1 - else - src.welded = null - src.update_icon() - return - else if (istype(C, /obj/item/weapon/wrench)) - user << "You start to remove the bolts..." - if(do_after(user,30)) - user << "Bolts removed" - src.removal_step = 1 - if(1) - if ((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density)) - var/obj/item/weapon/weldingtool/W = C - if(W.remove_fuel(0,user)) - user << "You start to slice the armor..." - if(do_after(user,20)) - user << "Armor sliced open" - src.removal_step = 2 - return - else if (istype(C, /obj/item/weapon/wrench)) - user << "You start wrench down the bolts..." - if(do_after(user,30)) - user << "Bolts secured." - src.removal_step = 0 - if(2) - if ((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density)) - var/obj/item/weapon/weldingtool/W = C - if(W.remove_fuel(0,user)) - user << "You start to fuse together the armor..." - if(do_after(user,20)) - user << "Armor repaired" - src.removal_step = 1 - return - else if (istype(C, /obj/item/weapon/wrench)) - user << "You start to unfasten the armor from the circuits..." - if(do_after(user,40)) - user << "Circuits exposed." - src.removal_step = 3 - src.is_detached = 1 - else - if (istype(C, /obj/item/weapon/wrench)) - user << "You start to fix the armor plate..." - if(do_after(user,40)) - user << "Armor plates are back in position." - src.is_detached = 0 - src.removal_step = 2 - else - return ..(C, user) - -/obj/machinery/door/airlock/secure/New() - ..() - //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). - var/flagIndex = 1 - for (var/flag=1, flag<65536, flag+=flag) - var/valid = 0 - while (!valid) - var/colorIndex = rand(1, 16) - if (WireColorToFlag[colorIndex] == 0) - valid = 1 - WireColorToFlag[colorIndex] = flag - IndexToFlag[flagIndex] = flag - IndexToWireColor[flagIndex] = colorIndex - WireColorToIndex[colorIndex] = flagIndex - flagIndex+=1 - return - - -/obj/machinery/door/airlock/secure/isWireColorCut(var/wireColor) - var/wireFlag = WireColorToFlag[wireColor] - return ((src.wires & wireFlag) == 0) - -/obj/machinery/door/airlock/secure/isWireCut(var/wireIndex) - var/wireFlag = IndexToFlag[wireIndex] - return ((src.wires & wireFlag) == 0) - -/obj/machinery/door/airlock/secure/pulse(var/wireColor) - var/wireIndex = WireColorToIndex[wireColor] - switch(wireIndex) - if(AIRLOCK_WIRE_IDSCAN) - //Sending a pulse through this flashes the red light on the door (if the door has power). - if ((src.arePowerSystemsOn()) && (!(stat & NOPOWER))) - animate("deny") - if (AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). - src.loseMainPower() - if (AIRLOCK_WIRE_DOOR_BOLTS, AIRLOCK_WIRE_DOOR_BOLTS_2) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if (!src.locked) - src.locked = 1 - src.updateUsrDialog() - else - if(src.arePowerSystemsOn()) //only can raise bolts if power's on - src.locked = 0 - usr << "You hear a click from inside the door." - src.updateUsrDialog() - update_icon() - - if (AIRLOCK_WIRE_FAKEBOLT1, AIRLOCK_WIRE_FAKEBOLT2) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if (!src.locked) - src.locked = 1 - src.updateUsrDialog() - update_icon() - - if (AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). - src.loseBackupPower() - if (AIRLOCK_WIRE_AI_CONTROL) - if (src.aiControlDisabled == 0) - src.aiControlDisabled = 1 - else if (src.aiControlDisabled == -1) - src.aiControlDisabled = 2 - src.updateDialog() - spawn(10) - if (src.aiControlDisabled == 1) - src.aiControlDisabled = 0 - else if (src.aiControlDisabled == 2) - src.aiControlDisabled = -1 - src.updateDialog() - if (AIRLOCK_WIRE_ELECTRIFY) - //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. - if (src.secondsElectrified==0) - src.secondsElectrified = 30 - spawn(10) - //TODO: Move this into process() and make pulsing reset secondsElectrified to 30 - while (src.secondsElectrified>0) - src.secondsElectrified-=1 - if (src.secondsElectrified<0) - src.secondsElectrified = 0 -// src.updateUsrDialog() //Commented this line out to keep the airlock from clusterfucking you with electricity. --NeoFite - sleep(10) - if(AIRLOCK_WIRE_OPEN_DOOR) - //tries to open the door without ID - //will succeed only if the ID wire is cut or the door requires no access - if (!src.requiresID() || src.check_access(null)) - if (src.density) - open() - else - close() - if(AIRLOCK_WIRE_CRUSH) - src.forcecrush = !src.forcecrush - if(AIRLOCK_WIRE_LIGHT) - src.safetylight = !src.safetylight - if(AIRLOCK_WIRE_HOLDOPEN) - src.holdopen = !src.holdopen - if(AIRLOCK_WIRE_ALERTAI) - if(prob(alert_probability)) - for (var/mob/living/silicon/ai/aiPlayer in world) - if (aiPlayer.stat != 2) - aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - for (var/mob/living/silicon/robot/robotPlayer in world) - if (robotPlayer.stat != 2) - robotPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - -/obj/machinery/door/airlock/secure/cut(var/wireColor) - var/wireFlag = WireColorToFlag[wireColor] - var/wireIndex = WireColorToIndex[wireColor] - wires &= ~wireFlag - switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user. - src.loseMainPower() - src.shock(usr, 50) - src.updateUsrDialog() - if (AIRLOCK_WIRE_DOOR_BOLTS, AIRLOCK_WIRE_DOOR_BOLTS_2) - //Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present) - if (src.locked!=1) - src.locked = 1 - update_icon() - src.updateUsrDialog() - if (AIRLOCK_WIRE_FAKEBOLT1, AIRLOCK_WIRE_FAKEBOLT2) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if (!src.locked) - src.locked = 1 - src.updateUsrDialog() - update_icon() - if (AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. - src.loseBackupPower() - src.shock(usr, 50) - src.updateUsrDialog() - if (AIRLOCK_WIRE_AI_CONTROL) - //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. - //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. - if (src.aiControlDisabled == 0) - src.aiControlDisabled = 1 - else if (src.aiControlDisabled == -1) - src.aiControlDisabled = 2 - src.updateUsrDialog() - if (AIRLOCK_WIRE_ELECTRIFY) - //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. - if (src.secondsElectrified != -1) - src.secondsElectrified = -1 - if(AIRLOCK_WIRE_ALERTAI) - if(prob(alert_probability)) - for (var/mob/living/silicon/ai/aiPlayer in world) - if (aiPlayer.stat != 2) - aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - for (var/mob/living/silicon/robot/robotPlayer in world) - if (robotPlayer.stat != 2) - robotPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - -/obj/machinery/door/airlock/secure/mend(var/wireColor) - var/wireFlag = WireColorToFlag[wireColor] - var/wireIndex = WireColorToIndex[wireColor] //not used in this function - wires |= wireFlag - switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - if ((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))) - src.regainMainPower() - src.shock(usr, 50) - src.updateUsrDialog() - if (AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - if ((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))) - src.regainBackupPower() - src.shock(usr, 50) - src.updateUsrDialog() - if (AIRLOCK_WIRE_AI_CONTROL) - //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. - //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. - if (src.aiControlDisabled == 1) - src.aiControlDisabled = 0 - else if (src.aiControlDisabled == 2) - src.aiControlDisabled = -1 - src.updateUsrDialog() - if (AIRLOCK_WIRE_ELECTRIFY) - if (src.secondsElectrified == -1) - src.secondsElectrified = 0 - -/obj/machinery/door/airlock/secure/getAirlockWires() - var/t1 - var/iterator = 0 - for(var/wiredesc in wire_index) - if(iterator == wirenum) - break - var/is_uncut = src.wires & WireColorToFlag[wire_index[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "Mend" - else - t1 += "Cut " - t1 += "Pulse " - if(src.signalers[wire_index[wiredesc]]) - t1 += "Detach signaler" - else - t1 += "Attach signaler" - t1 += "
    " - iterator++ - return t1 - - -/obj/machinery/door/airlock/secure/centcom - name = "CentCom Secure Airlock" - desc = "I hope you have insulated gloves...." - icon = 'Doorhatchele.dmi' - var/list/mob/morons = list() - -/obj/machinery/door/airlock/secure/centcom/pulse(var/wireColor) - if(prob(25)) - usr.ex_act(rand(1,3)) - if (src.secondsElectrified==0) - src.secondsElectrified = 10 - spawn(10) - //TODO: Move this into process() and make pulsing reset secondsElectrified to 30 - while (src.secondsElectrified>0) - src.secondsElectrified-=1 - if (src.secondsElectrified<0) - src.secondsElectrified = 0 -// src.updateUsrDialog() //Commented this line out to keep the airlock from clusterfucking you with electricity. --NeoFite - sleep(10) - var/wireIndex = WireColorToIndex[wireColor] - switch(wireIndex) - if(AIRLOCK_WIRE_IDSCAN) - //Sending a pulse through this flashes the red light on the door (if the door has power). - if ((src.arePowerSystemsOn()) && (!(stat & NOPOWER))) - animate("deny") - if (AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). - src.loseMainPower() - if (AIRLOCK_WIRE_DOOR_BOLTS, AIRLOCK_WIRE_DOOR_BOLTS_2) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if (!src.locked) - src.locked = 1 - src.updateUsrDialog() - else - if(src.arePowerSystemsOn()) //only can raise bolts if power's on - src.locked = 0 - usr << "You hear a click from inside the door." - src.updateUsrDialog() - update_icon() - - if (AIRLOCK_WIRE_FAKEBOLT1, AIRLOCK_WIRE_FAKEBOLT2) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if (!src.locked) - src.locked = 1 - src.updateUsrDialog() - update_icon() - - if (AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). - src.loseBackupPower() - if (AIRLOCK_WIRE_AI_CONTROL) - if (src.aiControlDisabled == 0) - src.aiControlDisabled = 1 - else if (src.aiControlDisabled == -1) - src.aiControlDisabled = 2 - src.updateDialog() - spawn(10) - if (src.aiControlDisabled == 1) - src.aiControlDisabled = 0 - else if (src.aiControlDisabled == 2) - src.aiControlDisabled = -1 - src.updateDialog() - if(AIRLOCK_WIRE_OPEN_DOOR) - //tries to open the door without ID - //will succeed only if the ID wire is cut or the door requires no access - if (!src.requiresID() || src.check_access(null)) - if (src.density) - open() - else - close() - if(AIRLOCK_WIRE_CRUSH) - src.forcecrush = !src.forcecrush - if(AIRLOCK_WIRE_LIGHT) - src.safetylight = !src.safetylight - if(AIRLOCK_WIRE_HOLDOPEN) - src.holdopen = !src.holdopen - if(AIRLOCK_WIRE_ALERTAI) - if(prob(alert_probability)) - for (var/mob/living/silicon/ai/aiPlayer in world) - if (aiPlayer.stat != 2) - aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - for (var/mob/living/silicon/robot/robotPlayer in world) - if (robotPlayer.stat != 2) - robotPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - -/obj/machinery/door/airlock/secure/centcom/cut(var/wireColor) - if(prob(25)) - usr.ex_act(rand(1,3)) - if (src.secondsElectrified==0) - src.secondsElectrified = 30 - spawn(10) - //TODO: Move this into process() and make pulsing reset secondsElectrified to 30 - while (src.secondsElectrified>0) - src.secondsElectrified-=1 - if (src.secondsElectrified<0) - src.secondsElectrified = 0 -// src.updateUsrDialog() //Commented this line out to keep the airlock from clusterfucking you with electricity. --NeoFite - sleep(10) - var/wireFlag = WireColorToFlag[wireColor] - var/wireIndex = WireColorToIndex[wireColor] - wires &= ~wireFlag - switch(wireIndex) - if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) - //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user. - src.loseMainPower() - src.shock(usr, 50) - src.updateUsrDialog() - if (AIRLOCK_WIRE_DOOR_BOLTS, AIRLOCK_WIRE_DOOR_BOLTS_2) - //Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present) - if (src.locked!=1) - src.locked = 1 - update_icon() - src.updateUsrDialog() - if (AIRLOCK_WIRE_FAKEBOLT1, AIRLOCK_WIRE_FAKEBOLT2) - //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not), - //raises them if they are down (only if power's on) - if (!src.locked) - src.locked = 1 - src.updateUsrDialog() - update_icon() - if (AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) - //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. - src.loseBackupPower() - src.shock(usr, 50) - src.updateUsrDialog() - if (AIRLOCK_WIRE_AI_CONTROL) - //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. - //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. - if (src.aiControlDisabled == 0) - src.aiControlDisabled = 1 - else if (src.aiControlDisabled == -1) - src.aiControlDisabled = 2 - src.updateUsrDialog() - if (AIRLOCK_WIRE_ELECTRIFY) - //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. - if (src.secondsElectrified != -1) - src.secondsElectrified = -1 - if(AIRLOCK_WIRE_ALERTAI) - if(prob(alert_probability)) - for (var/mob/living/silicon/ai/aiPlayer in world) - if (aiPlayer.stat != 2) - aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - for (var/mob/living/silicon/robot/robotPlayer in world) - if (robotPlayer.stat != 2) - robotPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc.loc) - -/obj/machinery/door/airlock/secure/centcom/attack_ai(mob/user as mob, obj/item/device/hacktool/C) - if(!(user in morons)) - user << "\red Do that again, and you will die horribly." - if(prob(50)) - morons.Add(user) - else - user << "\red You were warned..." - world << "\red [user.name] has been found attempting to hack a CentCom Secure Door via AI/Hacktool. Better luck next time." - user.ex_act(1) diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 70a1c45be7..6a57e7cc5e 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -2,19 +2,17 @@ /obj/item/weapon/airlock_electronics name = "Airlock Electronics" - icon = 'door_assembly.dmi' + icon = 'icons/obj/doors/door_assembly.dmi' icon_state = "door_electronics" w_class = 2.0 //It should be tiny! -Agouri m_amt = 50 g_amt = 50 - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) var/list/conf_access = null var/last_configurator = null var/locked = 1 - var/style_name = "General" - var/style = /obj/structure/door_assembly/door_assembly_0 attack_self(mob/user as mob) if (!ishuman(user)) @@ -35,8 +33,6 @@ else t1 += "Block
    " - t1 += "Style: [style_name]

    " - t1 += conf_access == null ? "All
    " : "All
    " @@ -65,7 +61,7 @@ return if (href_list["login"]) - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id @@ -82,30 +78,6 @@ if (href_list["access"]) toggle_access(href_list["access"]) - if (href_list["style"]) - style_name = input("Select the door's paint scheme.", "Door Style", style_name) in \ - list("General", "Command", "Security", "Engineering", "Medical", "Maintenance", "Airlock", "Freezer", "Research") - - switch(style_name) - if("General") - style = /obj/structure/door_assembly/door_assembly_0 - if("Command") - style = /obj/structure/door_assembly/door_assembly_com - if("Security") - style = /obj/structure/door_assembly/door_assembly_sec - if("Engineering") - style = /obj/structure/door_assembly/door_assembly_eng - if("Medical") - style = /obj/structure/door_assembly/door_assembly_med - if("Maintenance") - style = /obj/structure/door_assembly/door_assembly_mai - if("Airlock") - style = /obj/structure/door_assembly/door_assembly_ext - if("Freezer") - style = /obj/structure/door_assembly/door_assembly_fre - if("Research") - style = /obj/structure/door_assembly/door_assembly_research - attack_self(usr) proc diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index a557ace56b..867244191e 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /////////////////////////////////////////////////////////////////////////////////////////////// // Brig Door control displays. @@ -10,10 +10,10 @@ ///////////////////////////////////////////////////////////////////////////////////////////////// /obj/machinery/door_timer name = "Door Timer" - icon = 'status_display.dmi' + icon = 'icons/obj/status_display.dmi' icon_state = "frame" desc = "A remote control for a door." - req_access = list(ACCESS_BRIG) + req_access = list(access_brig) anchored = 1.0 // can't pick it up density = 0 // can walk through it. var/id = null // id of door it controls. @@ -142,7 +142,7 @@ dat += "Activate Timer and close door
    " dat += "Time Left: [(minute ? text("[minute]:") : null)][second]
    " - dat += "- - - + + +
    " + dat += "- - + +
    " for(var/obj/machinery/flasher/F in targets) if(F.last_flash && (F.last_flash + 150) > world.time) @@ -177,7 +177,7 @@ var/tp = text2num(href_list["tp"]) var/timeleft = timeleft() timeleft += tp - timeleft = min(max(round(timeleft), 0), 3600) + timeleft = min(max(round(timeleft), 0), 600) timeset(timeleft) //src.timing = 1 //src.closedoor() @@ -220,7 +220,7 @@ proc/set_picture(var/state) picture_state = state overlays = null - overlays += image('status_display.dmi', icon_state=picture_state) + overlays += image('icons/obj/status_display.dmi', icon_state=picture_state) //Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display @@ -241,14 +241,14 @@ //Actual string input to icon display for loop, with 5 pixel x offsets for each letter. //Stolen from status_display proc/texticon(var/tn, var/px = 0, var/py = 0) - var/image/I = image('status_display.dmi', "blank") + var/image/I = image('icons/obj/status_display.dmi', "blank") var/len = lentext(tn) for(var/d = 1 to len) var/char = copytext(tn, len-d+1, len-d+2) if(char == " ") continue - var/image/ID = image('status_display.dmi', icon_state=char) + var/image/ID = image('icons/obj/status_display.dmi', icon_state=char) ID.pixel_x = -(d-1)*5 + px ID.pixel_y = py I.overlays += ID diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 3376d5108f..e8c93c51f1 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -3,7 +3,7 @@ /obj/machinery/door name = "Door" desc = "It opens and closes." - icon = 'doorint.dmi' + icon = 'icons/obj/doors/Doorint.dmi' icon_state = "door1" anchored = 1 opacity = 1 @@ -16,8 +16,7 @@ var/operating = 0 var/autoclose = 0 var/glass = 0 - var/forcecrush = 0 - var/holdopen = 0 + var/normalspeed = 1 proc/bumpopen(mob/user as mob) proc/update_nearby_tiles(need_rebuild) @@ -32,42 +31,7 @@ layer = 3.1 //Above most items if closed else layer = 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 - if(world.time < 10) - spawn(10) - update_nearby_tiles(need_rebuild=1) - else - update_nearby_tiles(need_rebuild=1) - - spawn(1) - var/area/A = get_area(src) - if(A.master) - A = A.master - var/turf/north = get_step(src, NORTH) - var/turf/east = get_step(src, EAST) - var/turf/south = get_step(src, SOUTH) - var/turf/west = get_step(src, WEST) - A.all_doors |= src - - if(!north.density) - var/area/other_area = get_area(north) - if(other_area.name != A.name) - other_area.master.all_doors |= src - - if(!east.density) - var/area/other_area = get_area(east) - if(other_area.name != A.name) - other_area.master.all_doors |= src - - if(!south.density) - var/area/other_area = get_area(south) - if(other_area.name != A.name) - other_area.master.all_doors |= src - - if(!west.density) - var/area/other_area = get_area(west) - if(other_area.name != A.name) - other_area.master.all_doors |= src - + update_nearby_tiles(need_rebuild=1) return @@ -81,17 +45,11 @@ Bumped(atom/AM) if(p_open || operating) return - - if(issimpleanimal(AM)) - var/mob/living/simple_animal/S = AM - if(S.can_open_doors) - bumpopen(AM) - return - if(ismob(AM)) var/mob/M = AM - if(world.time - AM.last_bumped <= 60) return //NOTE do we really need that? - if(M.client && !M:handcuffed) + if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. + M.last_bumped = world.time + if(M.client && !M.restrained() && !isanimal(M)) bumpopen(M) return @@ -123,7 +81,7 @@ CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) return 0 - if(istype(mover) && mover.pass_flags&PASSGLASS) + if(istype(mover) && mover.checkpass(PASSGLASS)) return !opacity return !density @@ -165,44 +123,6 @@ if(!src.requiresID()) user = null if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade))) - if(istype(I, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = I - if(E.uses) - E.uses-- - else - return - if(istype(I, /obj/item/weapon/melee/energy/blade)) - if(istype(src, /obj/machinery/door/airlock)) - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, src.loc) - spark_system.start() - playsound(src.loc, 'blade1.ogg', 50, 1) - playsound(src.loc, "sparks", 50, 1) - for(var/mob/O in viewers(user, 3)) - O.show_message(text("\blue The door has been sliced open by [] with an energy blade!", user), 1, text("\red You hear metal being sliced and sparks flying."), 2) - if((!src:arePowerSystemsOn()) || (stat & NOPOWER) || src:isWireCut(AIRLOCK_WIRE_DOOR_BOLTS)) - var/obj/structure/door_assembly/temp - var/failsafe=0 - switch(src:doortype) - if(0) temp=new/obj/structure/door_assembly/door_assembly_0(src.loc) - if(1) temp=new/obj/structure/door_assembly/door_assembly_com(src.loc) - if(2) temp=new/obj/structure/door_assembly/door_assembly_sec(src.loc) - if(3) temp=new/obj/structure/door_assembly/door_assembly_eng(src.loc) - if(4) temp=new/obj/structure/door_assembly/door_assembly_med(src.loc) - if(5) temp=new/obj/structure/door_assembly/door_assembly_mai(src.loc) - if(6) temp=new/obj/structure/door_assembly/door_assembly_ext(src.loc) - if(7) temp=new/obj/structure/door_assembly/door_assembly_glass(src.loc) - else failsafe=1 - if(!failsafe) - temp.anchored=0 - step_away(temp,usr,15) - else del(temp) - del(src) - return - else - src:welded = 0 - src:locked = 0 - update_icon() flick("door_spark", src) sleep(6) open() @@ -212,12 +132,9 @@ if(src.density) open() else - var/holdopen_old = holdopen - holdopen = 0 close() - spawn(1) - holdopen = holdopen_old - else if (src.density) + return + if(src.density) flick("door_deny", src) return @@ -281,99 +198,46 @@ open() if(!density) return 1 - if (src.operating == 1) //doors can still open when emag-disabled - return + if(operating > 0) return if(!ticker) return 0 - if(!src.operating) //in case of emag - src.operating = 1 + if(!operating) operating = 1 + animate("opening") icon_state = "door0" - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) sleep(10) src.layer = 2.7 src.density = 0 update_icon() - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) update_nearby_tiles() - if(operating == 1) //emag again - src.operating = 0 + if(operating) operating = 0 - if(autoclose) + if(autoclose && normalspeed) spawn(150) autoclose() + if(autoclose && !normalspeed) + spawn(5) + autoclose() return 1 + close() - if(density) - return 1 - if (src.operating) - return - src.operating = 1 + if(density) return 1 + if(operating) return + operating = 1 - var/X = src:x - var/Y = src:y - var/Z = src:z - var/held = 1 - - if(src.holdopen && !forcecrush) - while(held == 1 && holdopen && !forcecrush) //If it is no longer hold open, it should close. - sleep(held? 10:40) - held = 0 - var/list/objects = locate(X,Y,Z) - for(var/obj/T in objects) - if(!istype(T,/obj/machinery/door) && !(istype(T,/obj/machinery) && T.anchored == 1) && !istype(T,/obj/structure/cable) && !istype(T,/obj/structure/disposalpipe) && !(T.loc == get_turf(src))) - held = 1 - for(var/mob/living/T in objects) //Geez, ghosts were OP. - held = 1 animate("closing") src.density = 1 - spawn(4) - if(!istype(src, /obj/machinery/door/window)) - for(var/mob/living/L in src.loc) // Crush mobs and move them out of the way - - if(src.forcecrush) // Save an AI, crush a limb - var/limbname = pick("l_arm", "r_arm", "l_hand","r_hand", "l_foot", "r_foot") - var/limbdisplay - - for(var/organ in L:organs) - var/datum/organ/external/temp = L:organs["[organ]"] - if (istype(temp, /datum/organ/external) && temp.name == limbname) - limbdisplay = temp.display_name // Take the name for down below - temp.take_damage(rand(50,80), 0) //OH GOD IT HURTS - break - - L << "\red The airlock crushes your [limbdisplay]!" - for(var/mob/O in viewers(L, null)) - if(O == L) - continue - O.show_message("\red The airlock crushes [L.name]'s [limbdisplay]!", 1) - sleep(rand(2,8)) - - L << "\red The airlock forces you out of the way!" //Lucky you - for(var/mob/O in viewers(L, null)) - O.show_message("\red The airlock pushes [L.name] out of the way!", 1) - var/list/lst = list(NORTH,SOUTH,EAST,WEST) - var/turf/T = get_random_turf(L, lst) - if(T) - L.loc = T - - if(!src.forcecrush) - for(var/obj/item/I in src.loc) // Move items out of the way - if(!I.anchored) - var/list/lst = list(NORTH,SOUTH,EAST,WEST) - var/turf/T = get_random_turf(I, lst) - if(T) - I.loc = T - - sleep(6) + src.layer = 3.1 + sleep(10) update_icon() - if(src.visible && (!src.glass)) - src.ul_SetOpacity(1) - if(operating == 1) - operating = 0 + if(visible && !glass) + src.sd_SetOpacity(1) + operating = 0 update_nearby_tiles() return @@ -397,11 +261,12 @@ /obj/machinery/door/proc/autoclose() var/obj/machinery/door/airlock/A = src - if ((!A.density) && !( A.operating ) && !(A.locked) && !( A.welded )) + if(!A.density && !A.operating && !A.locked && !A.welded && A.autoclose) close() return +/* /obj/machinery/door/airlock/proc/ion_act() if(src.z == 1 && src.density) if(length(req_access) > 0 && !(12 in req_access)) @@ -428,3 +293,4 @@ else close() return +*/ diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 8e40524563..4d3eb00248 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -1,13 +1,17 @@ +/var/const/OPEN = 1 +/var/const/CLOSED = 2 + + /obj/machinery/door/firedoor - name = "Emergency shutter" + name = "Firelock" desc = "Apply crowbar" - icon = 'DoorHazard.dmi' + icon = 'icons/obj/doors/Doorfire.dmi' icon_state = "door_open" var/blocked = 0 opacity = 0 density = 0 var/nextstate = null - var/net_id + Bumped(atom/AM) if(p_open || operating) return @@ -83,4 +87,46 @@ return -/obj/machinery/door/firedoor/border_only \ No newline at end of file + +//border_only fire doors are special when it comes to air groups +/obj/machinery/door/firedoor/border_only + + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + if(air_group) + var/direction = get_dir(src,target) + return (dir != direction) + else if(density) + if(!height) + var/direction = get_dir(src,target) + return (dir != direction) + else + return 0 + return 1 + + + //todo: is this needed? + /*update_nearby_tiles(need_rebuild) + if(!air_master) return 0 + + var/turf/simulated/source = loc + var/turf/simulated/destination = get_step(source,dir) + + if(need_rebuild) + if(istype(source)) //Rebuild/update nearby group geometry + if(source.parent) + air_master.groups_to_rebuild += source.parent + else + air_master.tiles_to_update += source + if(istype(destination)) + if(destination.parent) + air_master.groups_to_rebuild += destination.parent + else + air_master.tiles_to_update += destination + else + if(istype(source)) air_master.tiles_to_update += source + if(istype(destination)) air_master.tiles_to_update += destination + return 1*/ + +/obj/machinery/door/firedoor/border_only/hazard + name = "hazard door" + icon = 'icons/obj/doors/DoorHazard.dmi' \ No newline at end of file diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 76927a50eb..290c3ea02f 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -1,22 +1,9 @@ /obj/machinery/door/poddoor name = "Podlock" - desc = "A type of powerful blast door." - icon = 'rapid_pdoor.dmi' + desc = "Why it no open!!!" + icon = 'icons/obj/doors/rapid_pdoor.dmi' icon_state = "pdoor1" - var/id = "" - var/network = "" - - Topic(href, href_list) - ..() - if( href_list["open"] ) - open() - if( href_list["close"] ) - close() - if( href_list["toggle"] ) - if(src.density) - open() - else - close() + var/id = 1.0 /obj/machinery/door/poddoor/Bumped(atom/AM) if(!density) @@ -35,12 +22,12 @@ src.icon_state = "pdoor0" sleep(15) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) src.operating = 0 return return -/obj/machinery/door/poddoor/open(var/closeafterdelay = 0) +/obj/machinery/door/poddoor/open() if (src.operating == 1) //doors can still open when emag-disabled return if (!ticker) @@ -51,13 +38,13 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again src.operating = 0 - if(closeafterdelay) - spawn(50) + if(autoclose) + spawn(150) autoclose() return 1 @@ -69,13 +56,14 @@ src.icon_state = "pdoor1" src.density = 1 if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) src.operating = 0 return + /obj/machinery/door/poddoor/two_tile_hor/open() if (src.operating == 1) //doors can still open when emag-disabled return @@ -87,12 +75,12 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) f1.density = 0 - f1.ul_SetOpacity(0) + f1.sd_SetOpacity(0) f2.density = 0 - f2.ul_SetOpacity(0) + f2.sd_SetOpacity(0) update_nearby_tiles() @@ -112,12 +100,12 @@ src.density = 1 f1.density = 1 - f1.ul_SetOpacity(1) + f1.sd_SetOpacity(1) f2.density = 1 - f2.ul_SetOpacity(1) + f2.sd_SetOpacity(1) if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -135,16 +123,16 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) f1.density = 0 - f1.ul_SetOpacity(0) + f1.sd_SetOpacity(0) f2.density = 0 - f2.ul_SetOpacity(0) + f2.sd_SetOpacity(0) f3.density = 0 - f3.ul_SetOpacity(0) + f3.sd_SetOpacity(0) f4.density = 0 - f4.ul_SetOpacity(0) + f4.sd_SetOpacity(0) update_nearby_tiles() @@ -164,16 +152,16 @@ src.density = 1 f1.density = 1 - f1.ul_SetOpacity(1) + f1.sd_SetOpacity(1) f2.density = 1 - f2.ul_SetOpacity(1) + f2.sd_SetOpacity(1) f3.density = 1 - f3.ul_SetOpacity(1) + f3.sd_SetOpacity(1) f4.density = 1 - f4.ul_SetOpacity(1) + f4.sd_SetOpacity(1) if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -191,12 +179,12 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) f1.density = 0 - f1.ul_SetOpacity(0) + f1.sd_SetOpacity(0) f2.density = 0 - f2.ul_SetOpacity(0) + f2.sd_SetOpacity(0) update_nearby_tiles() @@ -216,12 +204,12 @@ src.density = 1 f1.density = 1 - f1.ul_SetOpacity(1) + f1.sd_SetOpacity(1) f2.density = 1 - f2.ul_SetOpacity(1) + f2.sd_SetOpacity(1) if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -239,16 +227,16 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) f1.density = 0 - f1.ul_SetOpacity(0) + f1.sd_SetOpacity(0) f2.density = 0 - f2.ul_SetOpacity(0) + f2.sd_SetOpacity(0) f3.density = 0 - f3.ul_SetOpacity(0) + f3.sd_SetOpacity(0) f4.density = 0 - f4.ul_SetOpacity(0) + f4.sd_SetOpacity(0) update_nearby_tiles() @@ -268,16 +256,16 @@ src.density = 1 f1.density = 1 - f1.ul_SetOpacity(1) + f1.sd_SetOpacity(1) f2.density = 1 - f2.ul_SetOpacity(1) + f2.sd_SetOpacity(1) f3.density = 1 - f3.ul_SetOpacity(1) + f3.sd_SetOpacity(1) f4.density = 1 - f4.ul_SetOpacity(1) + f4.sd_SetOpacity(1) if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -290,7 +278,7 @@ /obj/machinery/door/poddoor/two_tile_hor var/obj/machinery/door/poddoor/filler_object/f1 var/obj/machinery/door/poddoor/filler_object/f2 - icon = '1x2blast_hor.dmi' + icon = 'icons/obj/doors/1x2blast_hor.dmi' New() ..() @@ -298,8 +286,8 @@ f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST)) f1.density = density f2.density = density - f1.ul_SetOpacity(opacity) - f2.ul_SetOpacity(opacity) + f1.sd_SetOpacity(opacity) + f2.sd_SetOpacity(opacity) Del() del f1 @@ -309,7 +297,7 @@ /obj/machinery/door/poddoor/two_tile_ver var/obj/machinery/door/poddoor/filler_object/f1 var/obj/machinery/door/poddoor/filler_object/f2 - icon = '1x2blast_vert.dmi' + icon = 'icons/obj/doors/1x2blast_vert.dmi' New() ..() @@ -317,8 +305,8 @@ f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH)) f1.density = density f2.density = density - f1.ul_SetOpacity(opacity) - f2.ul_SetOpacity(opacity) + f1.sd_SetOpacity(opacity) + f2.sd_SetOpacity(opacity) Del() del f1 @@ -330,7 +318,7 @@ var/obj/machinery/door/poddoor/filler_object/f2 var/obj/machinery/door/poddoor/filler_object/f3 var/obj/machinery/door/poddoor/filler_object/f4 - icon = '1x4blast_hor.dmi' + icon = 'icons/obj/doors/1x4blast_hor.dmi' New() ..() @@ -342,10 +330,10 @@ f2.density = density f3.density = density f4.density = density - f1.ul_SetOpacity(opacity) - f2.ul_SetOpacity(opacity) - f4.ul_SetOpacity(opacity) - f3.ul_SetOpacity(opacity) + f1.sd_SetOpacity(opacity) + f2.sd_SetOpacity(opacity) + f4.sd_SetOpacity(opacity) + f3.sd_SetOpacity(opacity) Del() del f1 @@ -359,7 +347,7 @@ var/obj/machinery/door/poddoor/filler_object/f2 var/obj/machinery/door/poddoor/filler_object/f3 var/obj/machinery/door/poddoor/filler_object/f4 - icon = '1x4blast_vert.dmi' + icon = 'icons/obj/doors/1x4blast_vert.dmi' New() ..() @@ -371,10 +359,10 @@ f2.density = density f3.density = density f4.density = density - f1.ul_SetOpacity(opacity) - f2.ul_SetOpacity(opacity) - f4.ul_SetOpacity(opacity) - f3.ul_SetOpacity(opacity) + f1.sd_SetOpacity(opacity) + f2.sd_SetOpacity(opacity) + f4.sd_SetOpacity(opacity) + f3.sd_SetOpacity(opacity) Del() del f1 diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm index a930c87b40..9f2b447ab9 100644 --- a/code/game/machinery/doors/shutters.dm +++ b/code/game/machinery/doors/shutters.dm @@ -1,8 +1,7 @@ /obj/machinery/door/poddoor/shutters name = "Shutters" - icon = 'rapid_pdoor.dmi' + icon = 'icons/obj/doors/rapid_pdoor.dmi' icon_state = "shutter1" - desc = "Steel-reinforced privacy." /obj/machinery/door/poddoor/shutters/New() ..() @@ -19,7 +18,7 @@ src.icon_state = "shutter0" sleep(15) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) src.operating = 0 return return @@ -35,7 +34,7 @@ src.icon_state = "shutter0" sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again @@ -53,7 +52,7 @@ src.icon_state = "shutter1" src.density = 1 if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm index 36cd2095ba..b4992059f6 100644 --- a/code/game/machinery/doors/unpowered.dm +++ b/code/game/machinery/doors/unpowered.dm @@ -18,7 +18,7 @@ /obj/machinery/door/unpowered/shuttle - icon = 'shuttle.dmi' + icon = 'icons/turf/shuttle.dmi' name = "door" icon_state = "door1" opacity = 1 diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 6e5251912b..d88a3bc78a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -1,10 +1,10 @@ /obj/machinery/door/window name = "interior door" desc = "A strong door." - icon = 'windoor.dmi' + icon = 'icons/obj/doors/windoor.dmi' icon_state = "left" var/base_state = "left" - var/health = 200.0 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file + var/health = 150.0 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file visible = 0.0 flags = ON_BORDER opacity = 0 @@ -65,7 +65,7 @@ return /obj/machinery/door/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(istype(mover) && mover.pass_flags & PASSGLASS) + if(istype(mover) && mover.checkpass(PASSGLASS)) return 1 if(get_dir(loc, target) == dir) //Make sure looking at appropriate border if(air_group) return 0 @@ -74,7 +74,7 @@ return 1 /obj/machinery/door/window/CheckExit(atom/movable/mover as mob|obj, turf/target as turf) - if(istype(mover) && mover.pass_flags & PASSGLASS) + if(istype(mover) && mover.checkpass(PASSGLASS)) return 1 if(get_dir(loc, target) == dir) return !density @@ -89,12 +89,12 @@ if(!src.operating) //in case of emag src.operating = 1 flick(text("[]opening", src.base_state), src) - playsound(src.loc, 'windowdoor.ogg', 100, 1) + playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) src.icon_state = text("[]open", src.base_state) sleep(10) src.density = 0 - src.ul_SetOpacity(0) + src.sd_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again @@ -106,12 +106,12 @@ return 0 src.operating = 1 flick(text("[]closing", src.base_state), src) - playsound(src.loc, 'windowdoor.ogg', 100, 1) + playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) src.icon_state = text("[]", src.base_state) src.density = 1 if (src.visible) - src.ul_SetOpacity(1) + src.sd_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -130,7 +130,7 @@ tforce = 40 else tforce = AM:throwforce - playsound(src.loc, 'Glasshit.ogg', 100, 1) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) src.health = max(0, src.health - tforce) if (src.health <= 0) new /obj/item/weapon/shard(src.loc) @@ -146,15 +146,27 @@ /obj/machinery/door/window/attack_ai(mob/user as mob) return src.attack_hand(user) - /obj/machinery/door/window/attack_paw(mob/user as mob) - return src.attack_hand(user) + if(istype(user, /mob/living/carbon/alien/humanoid) || istype(user, /mob/living/carbon/metroid/adult)) + if(src.operating) + return + src.health = max(0, src.health - 25) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + for(var/mob/O in viewers(src, null)) + O.show_message("\red [user] smashes against the [src.name].", 1) + if (src.health <= 0) + new /obj/item/weapon/shard(src.loc) + var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src.loc) + CC.amount = 2 + src.density = 0 + del(src) + else + return src.attack_hand(user) /obj/machinery/door/window/attack_hand(mob/user as mob) return src.attackby(user, user) - /obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/user as mob) //If it's in the process of opening/closing, ignore the click @@ -163,19 +175,13 @@ //Emags and ninja swords? You may pass. if (src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade))) - if(istype(I, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = I - if(E.uses) - E.uses-- - else - return src.operating = -1 if(istype(I, /obj/item/weapon/melee/energy/blade)) var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src.loc) spark_system.start() playsound(src.loc, "sparks", 50, 1) - playsound(src.loc, 'blade1.ogg', 50, 1) + playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1) for(var/mob/O in viewers(user, 5)) O.show_message(text("\blue The glass door was sliced open by []!", user), 1, text("\red You hear glass being sliced and sparks flying."), 2) flick(text("[]spark", src.base_state), src) @@ -188,8 +194,9 @@ var/aforce = I.force if(I.damtype == BRUTE || I.damtype == BURN) src.health = max(0, src.health - aforce) - playsound(src.loc, 'Glasshit.ogg', 75, 1) - user.visible_message("\red \The [src] was hit with \a [I] by \the [user]!", "\red You hit \the [src] with \the [I]!", "You hear an object hitting glass.") + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + for(var/mob/O in viewers(src, null)) + O.show_message("\red [src] was hit by [I].", 1) if (src.health <= 0) new /obj/item/weapon/shard(src.loc) var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src.loc) @@ -204,7 +211,7 @@ //don't care who they are or what they have, act as if they're NOTHING user = null - if (src.allowed(user) || istype(I, /obj/item/device/hacktool)) + if (src.allowed(user)) if (src.density) open() else @@ -219,12 +226,12 @@ /obj/machinery/door/window/brigdoor name = "Secure Door" - icon = 'windoor.dmi' + icon = 'icons/obj/doors/windoor.dmi' icon_state = "leftsecure" base_state = "leftsecure" - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) var/id = null - health = 500.0 //Stronger doors for prison (regular window door health is 200) + health = 300.0 //Stronger doors for prison (regular window door health is 200) /obj/machinery/door/window/northleft diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index d7251ad64c..0f75999f6c 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -147,7 +147,7 @@ datum/computer/file/embedded_program/access_controller obj/machinery/embedded_controller/radio/access_controller - icon = 'airlock_machines.dmi' + icon = 'icons/obj/airlock_machines.dmi' icon_state = "access_control_standby" name = "Access Console" diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index afbb7054ed..77ae9843a5 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -4,9 +4,6 @@ #define AIRLOCK_STATE_CLOSED 0 #define AIRLOCK_STATE_DEPRESSURIZE 1 #define AIRLOCK_STATE_OUTOPEN 2 -#define AIRLOCK_STATE_BOTHOPEN 3 - -//todo: add an internal and external sensor, so that the pressure is actually equalised, rather than just toggled between 1atm and 0atm datum/computer/file/embedded_program/airlock_controller var/id_tag @@ -47,10 +44,6 @@ datum/computer/file/embedded_program/airlock_controller target_state = AIRLOCK_STATE_OUTOPEN else target_state = AIRLOCK_STATE_INOPEN - if("cycle_exterior") - target_state = AIRLOCK_STATE_OUTOPEN - if("cycle_interior") - target_state = AIRLOCK_STATE_INOPEN receive_user_command(command) switch(command) @@ -62,42 +55,6 @@ datum/computer/file/embedded_program/airlock_controller target_state = AIRLOCK_STATE_INOPEN if("abort") target_state = AIRLOCK_STATE_CLOSED - if("cycle_both") - target_state = AIRLOCK_STATE_BOTHOPEN - state = AIRLOCK_STATE_BOTHOPEN - var/datum/signal/signal = new - signal.data["tag"] = interior_door_tag - signal.data["command"] = "secure_open" - post_signal(signal) - signal = new - signal.data["tag"] = exterior_door_tag - signal.data["command"] = "secure_open" - post_signal(signal) - if("force_exterior") - target_state = AIRLOCK_STATE_OUTOPEN - state = AIRLOCK_STATE_OUTOPEN - var/datum/signal/signal = new - signal.data["tag"] = exterior_door_tag - signal.data["command"] = "secure_open" - post_signal(signal) - if("force_interior") - target_state = AIRLOCK_STATE_INOPEN - state = AIRLOCK_STATE_INOPEN - var/datum/signal/signal = new - signal.data["tag"] = interior_door_tag - signal.data["command"] = "secure_open" - post_signal(signal) - if("close") - target_state = AIRLOCK_STATE_CLOSED - state = AIRLOCK_STATE_CLOSED - var/datum/signal/signal = new - signal.data["tag"] = exterior_door_tag - signal.data["command"] = "secure_close" - post_signal(signal) - signal = new - signal.data["tag"] = interior_door_tag - signal.data["command"] = "secure_close" - post_signal(signal) process() var/process_again = 1 @@ -245,7 +202,7 @@ datum/computer/file/embedded_program/airlock_controller obj/machinery/embedded_controller/radio/airlock_controller - icon = 'airlock_machines.dmi' + icon = 'icons/obj/airlock_machines.dmi' icon_state = "airlock_control_standby" name = "Airlock Console" @@ -303,31 +260,24 @@ obj/machinery/embedded_controller/radio/airlock_controller switch(state) if(AIRLOCK_STATE_INOPEN) - state_options = "Close Interior Airlock
    \ - Cycle to Exterior Airlock
    " + state_options = {"Close Interior Airlock
    +Cycle to Exterior Airlock
    "} if(AIRLOCK_STATE_PRESSURIZE) state_options = "Abort Cycling
    " if(AIRLOCK_STATE_CLOSED) - state_options = "Open Interior Airlock
    \ -Open Exterior Airlock
    " + state_options = {"Open Interior Airlock
    +Open Exterior Airlock
    "} if(AIRLOCK_STATE_DEPRESSURIZE) state_options = "Abort Cycling
    " if(AIRLOCK_STATE_OUTOPEN) - state_options = "Cycle to Interior Airlock
    \ -Close Exterior Airlock
    " - if(AIRLOCK_STATE_BOTHOPEN) - state_options = "Close Airlocks
    " + state_options = {"Cycle to Interior Airlock
    +Close Exterior Airlock
    "} var/output = {"Airlock Control Console
    [state_options]
    Chamber Pressure: [sensor_pressure] kPa
    Exterior Door: [exterior_status]
    Interior Door: [interior_status]
    -Control Pump: [pump_status]

    "} - - if(program && program.state == AIRLOCK_STATE_CLOSED) - output += {"Force Both Airlocks
    - Force Inner Airlock
    - Force Outer Airlock"} +Control Pump: [pump_status]
    "} return output \ No newline at end of file diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 81c585a445..447d4e80af 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -3,7 +3,7 @@ /obj/machinery/flasher name = "Mounted flash" desc = "A wall-mounted flashbulb device." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "mflash1" var/id = null var/range = 2 //this is roughly the size of brig cell @@ -24,17 +24,17 @@ /obj/machinery/flasher/New() sleep(4) - ul_SetLuminosity(0,2,0) + src.sd_SetLuminosity(2) /obj/machinery/flasher/power_change() if ( powered() ) stat &= ~NOPOWER icon_state = "[base_state]1" - src.ul_SetLuminosity(0,2,0) + src.sd_SetLuminosity(2) else stat |= ~NOPOWER icon_state = "[base_state]1-p" - src.ul_SetLuminosity(0) + src.sd_SetLuminosity(0) //Don't want to render prison breaks impossible /obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -60,7 +60,7 @@ if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150)) return - playsound(src.loc, 'flash.ogg', 100, 1) + playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1) flick("[base_state]_flash", src) src.last_flash = world.time use_power(1000) @@ -68,28 +68,23 @@ for (var/mob/O in viewers(src, null)) if (get_dist(src, O) > src.range) continue + if (istype(O, /mob/living/carbon/human)) var/mob/living/carbon/human/H = O - if (istype(H.glasses, /obj/item/clothing/glasses/sunglasses)) - continue - if (istype(H.head, /obj/item/clothing/head/helmet/welding)) - if(!H.head:up) - continue - if (istype(H.wear_mask, /obj/item/clothing/mask/gas/voice)) + if(!H.eyecheck() <= 0) continue + if (istype(O, /mob/living/carbon/alien))//So aliens don't get flashed (they have no external eyes)/N continue - if (istype(O, /mob/living/silicon/robot)) - if(O:flashproof()) - continue O.Weaken(strength) if ((O.eye_stat > 15 && prob(O.eye_stat + 50))) flick("e_flash", O:flash) O.eye_stat += rand(1, 2) else - flick("flash", O:flash) - O.eye_stat += rand(0, 2) + if(!O.blinded) + flick("flash", O:flash) + O.eye_stat += rand(0, 2) /obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 992c79e680..08e13e535c 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -16,17 +16,17 @@ if (!on) if (luminosity) updateicon() - ul_SetLuminosity(0) + sd_SetLuminosity(0) return if(!luminosity && cell && cell.charge > 0) - ul_SetLuminosity(10) + sd_SetLuminosity(10) updateicon() if(!cell && luminosity) on = 0 updateicon() - ul_SetLuminosity(0) + sd_SetLuminosity(0) return cell.charge -= use @@ -34,7 +34,7 @@ if(cell.charge <= 0 && luminosity) on = 0 updateicon() - ul_SetLuminosity(0) + sd_SetLuminosity(0) return /obj/machinery/floodlight/attack_hand(mob/user as mob) diff --git a/code/game/machinery/gateway.dm b/code/game/machinery/gateway.dm index 8248ee8ef0..f44b663acd 100644 --- a/code/game/machinery/gateway.dm +++ b/code/game/machinery/gateway.dm @@ -1,7 +1,7 @@ /obj/structure/gatewayplaceholder density = 1 anchored = 1 - icon = 'gateway.dmi' + icon = 'icons/obj/machines/gateway.dmi' /obj/structure/gatewayplaceholder/one name = "Gateway" diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 7c45c65b4f..c623dff9a4 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -19,7 +19,7 @@ Possible to do for anyone motivated enough: last_request = world.time user << "You request an AI's presence." var/area/area = get_area(src) - for(var/mob/living/silicon/ai/AI in world) + for(var/mob/living/silicon/ai/AI in player_list) if(!AI.client) continue AI << "Your presence is requested at \the [area]." else @@ -31,8 +31,8 @@ Possible to do for anyone motivated enough: /*There are pretty much only three ways to interact here. I don't need to check for client since they're clicking on an object. This may change in the future but for now will suffice.*/ - if(user.eyeobj.loc!=src.loc)//Set client eye on the object if it's not already. - user.eyeobj.loc = src.loc + if(user.client.eye!=src)//Set client eye on the object if it's not already. + user.current = src user.reset_view(src) else if(!hologram)//If there is no hologram, possibly make one. activate_holo(user) @@ -41,10 +41,9 @@ Possible to do for anyone motivated enough: return /obj/machinery/hologram/holopad/proc/activate_holo(mob/living/silicon/ai/user) - if(!(stat & NOPOWER)&&user.eyeobj.loc==src.loc)//If the projector has power and client eye is on it. + if(!(stat & NOPOWER)&&user.client.eye==src)//If the projector has power and client eye is on it. if(!hologram)//If there is not already a hologram. create_holo(user)//Create one. - user.current = src for(var/mob/M in viewers()) M.show_message("A holographic image of [user] flicks to life right before your eyes!",1) else @@ -72,27 +71,27 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ hologram.icon = A.holo_icon hologram.mouse_opacity = 0//So you can't click on it. hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. - hologram.ul_SetLuminosity(0,0,2)//To make it glowy. + hologram.sd_SetLuminosity(1)//To make it glowy. hologram.anchored = 1//So space wind cannot drag it. hologram.name = "AI hologram"//If someone decides to right click. - ul_SetLuminosity(0,0,1)//To make the pad glowy. + sd_SetLuminosity(1)//To make the pad glowy. icon_state = "holopad1" master = A//AI is the master. use_power = 2//Active power usage. return 1 /obj/machinery/hologram/holopad/proc/clear_holo() - hologram.ul_SetLuminosity(0)//Clear lighting. + hologram.sd_SetLuminosity(0)//Clear lighting. del(hologram)//Get rid of hologram. master = null//Null the master, since no-one is using it now. - ul_SetLuminosity(0)//Clear lighting for the parent. + sd_SetLuminosity(0)//Clear lighting for the parent. icon_state = "holopad0" use_power = 1//Passive power usage. return 1 /obj/machinery/hologram/holopad/process() if(hologram)//If there is a hologram. - if(master&&!master.stat&&master.client&&master.eyeobj.loc==src.loc)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. + if(master&&!master.stat&&master.client&&master.client.eye==src)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. if( !(get_dist(src,hologram.loc)>3||stat & NOPOWER) )//If the hologram is not out of bounds and the machine has power. return 1 clear_holo()//If not, we want to get rid of the hologram. @@ -143,7 +142,7 @@ Holographic project of everything else. flat_icon.ChangeOpacity(0.5)//Make it half transparent. var/input = input("Select what icon state to use in effect.",,"") if(input) - var/icon/alpha_mask = new('effects.dmi', "[input]") + var/icon/alpha_mask = new('icons/effects/effects.dmi', "[input]") flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect. hologram.icon = flat_icon diff --git a/code/game/machinery/hydroponics.dm b/code/game/machinery/hydroponics.dm index 592779ebd8..f0cede8d29 100644 --- a/code/game/machinery/hydroponics.dm +++ b/code/game/machinery/hydroponics.dm @@ -1,6 +1,6 @@ /obj/machinery/hydroponics name = "hydroponics tray" - icon = 'hydroponics.dmi' + icon = 'icons/obj/hydroponics.dmi' icon_state = "hydrotray3" density = 1 anchored = 1 @@ -16,7 +16,7 @@ var/health = 0 // Its health. var/lastproduce = 0 // Last time it was harvested var/lastcycle = 0 //Used for timing of cycles. - var/cycledelay = 1000 // About 50 seconds / cycle + var/cycledelay = 200 // About 10 seconds / cycle var/planted = 0 // Is it occupied? var/harvest = 0 //Ready to harvest? var/obj/item/seeds/myseed = null // The currently planted seed @@ -41,99 +41,98 @@ obj/machinery/hydroponics/process() // Advance age src.age++ - // Drink random amount of water - src.waterlevel -= rand(1,6) - +//Nutrients////////////////////////////////////////////////////////////// // Nutrients deplete slowly if(src.nutrilevel > 0) if(prob(50)) src.nutrilevel -= 1 // Lack of nutrients hurts non-weeds - if(src.nutrilevel == 0 && src.myseed.plant_type != 1) + if(src.nutrilevel <= 0 && src.myseed.plant_type != 1) src.health -= rand(1,3) - // Adjust the water level so it can't go negative - if(src.waterlevel < 0) - src.waterlevel = 0 +//Water////////////////////////////////////////////////////////////////// + // Drink random amount of water + src.waterlevel = max(src.waterlevel - rand(1,6), 0) // If the plant is dry, it loses health pretty fast, unless mushroom - if(src.waterlevel <= 0 && src.myseed.plant_type != 2) - src.health -= rand(1,3) - else if(src.waterlevel <= 10 && src.myseed.plant_type != 2) + if(src.waterlevel <= 10 && src.myseed.plant_type != 2) src.health -= rand(0,1) + if(src.waterlevel <= 0) + src.health -= rand(0,2) + + // Sufficient water level and nutrient level = plant healthy + else if(src.waterlevel > 10 && src.nutrilevel > 0) + src.health += rand(1,2) + if(prob(5)) //5 percent chance the weed population will increase + src.weedlevel += 1 +//Toxins///////////////////////////////////////////////////////////////// // Too much toxins cause harm, but when the plant drinks the contaiminated water, the toxins disappear slowly if(src.toxic >= 40 && src.toxic < 80) src.health -= 1 src.toxic -= rand(1,10) - if(src.toxic >= 80) // I don't think it ever gets here tbh unless above is commented out + else if(src.toxic >= 80) // I don't think it ever gets here tbh unless above is commented out src.health -= 3 src.toxic -= rand(1,10) + else if(src.toxic < 0) // Make sure it won't go overoboard + src.toxic = 0 - // Sufficient water level and nutrient level = plant healthy - if(src.waterlevel > 10 && src.nutrilevel > 0) - src.health += rand(1,2) +//Pests & Weeds////////////////////////////////////////////////////////// // Too many pests cause the plant to be sick - if(src.pestlevel >= 5) + if (src.pestlevel > 10 ) // Make sure it won't go overoboard + src.pestlevel = 10 + + else if(src.pestlevel >= 5) src.health -= 1 // If it's a weed, it doesn't stunt the growth if(src.weedlevel >= 5 && src.myseed.plant_type != 1 ) src.health -= 1 + +//Health & Age/////////////////////////////////////////////////////////// // Don't go overboard with the health if(src.health > src.myseed.endurance) src.health = src.myseed.endurance + // Plant dies if health <= 0 + else if(src.health <= 0) + src.dead = 1 + src.harvest = 0 + src.weedlevel += 1 // Weeds flourish + src.pestlevel = 0 // Pests die + // If the plant is too old, lose health fast if(src.age > src.myseed.lifespan) src.health -= rand(1,5) - // Plant dies if health = 0 - if(src.health <= 0) - src.dead = 1 - src.harvest = 0 - src.weedlevel += 1 // Weeds flourish - //src.toxic = 0 // Water is still toxic - src.pestlevel = 0 // Pests die - // Harvest code if(src.age > src.myseed.production && (src.age - src.lastproduce) > src.myseed.production && (!src.harvest && !src.dead)) - var/m_count = 0 - while(m_count < src.mutmod) + for(var/i = 0; i < mutmod; i++) if(prob(85)) src.mutate() else if(prob(30)) src.hardmutate() else if(prob(5)) src.mutatespecie() - m_count++; + if(src.yieldmod > 0 && src.myseed.yield != -1) // Unharvestable shouldn't be harvested src.harvest = 1 else src.lastproduce = src.age if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase src.pestlevel += 1 - if(prob(5) && src.waterlevel > 10 && src.nutrilevel > 0) // On each tick, there's a 5 percent chance the weed - src.weedlevel += 1 //population will increase, but there needs to be water/nuts for that! else - if(prob(10) && src.waterlevel > 10 && src.nutrilevel > 0) // If there's no plant, the percentage chance is 10% + if(src.waterlevel > 10 && src.nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10% src.weedlevel += 1 - - // These (v) wouldn't be necessary if additional checks were made earlier (^) - - if (src.weedlevel > 10) // Make sure it won't go overoboard - src.weedlevel = 10 - if (src.toxic < 0) // Make sure it won't go overoboard - src.toxic = 0 - if (src.pestlevel > 10 ) // Make sure it won't go overoboard - src.pestlevel = 10 + if(src.weedlevel > 10) + src.weedlevel = 10 // Weeeeeeeeeeeeeeedddssss - if (prob(50) && src.weedlevel == 10) // At this point the plant is kind of fucked. Weeds can overtake the plant spot. + if (src.weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot. if(src.planted) if(src.myseed.plant_type == 0) // If a normal plant src.weedinvasion() @@ -149,42 +148,42 @@ obj/machinery/hydroponics/proc/updateicon() overlays = null if(src.planted) if(dead) - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-dead") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-dead") else if(src.harvest) if(src.myseed.plant_type == 2) // Shrooms don't have a -harvest graphic - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") else - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-harvest") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-harvest") else if(src.age < src.myseed.maturation) var/t_growthstate = ((src.age / src.myseed.maturation) * src.myseed.growthstages ) // Make sure it won't crap out due to HERPDERP 6 stages only - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-grow[round(t_growthstate)]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[round(t_growthstate)]") src.lastproduce = src.age //Cheating by putting this here, it means that it isn't instantly ready to harvest else - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") // Same + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") // Same if(src.waterlevel <= 10) - overlays += image('hydroponics.dmi', icon_state="over_lowwater3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_lowwater3") if(src.nutrilevel <= 2) - overlays += image('hydroponics.dmi', icon_state="over_lownutri3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_lownutri3") if(src.health <= (src.myseed.endurance / 2)) - overlays += image('hydroponics.dmi', icon_state="over_lowhealth3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_lowhealth3") if(src.weedlevel >= 5) - overlays += image('hydroponics.dmi', icon_state="over_alert3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_alert3") if(src.pestlevel >= 5) - overlays += image('hydroponics.dmi', icon_state="over_alert3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_alert3") if(src.toxic >= 40) - overlays += image('hydroponics.dmi', icon_state="over_alert3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_alert3") if(src.harvest) - overlays += image('hydroponics.dmi', icon_state="over_harvest3") + overlays += image('icons/obj/hydroponics.dmi', icon_state="over_harvest3") if(myseed) if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) //revert luminosity to 0 - ul_SetLuminosity(0) + sd_SetLuminosity(0) else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) //update luminosity - ul_SetLuminosity(myseed.potency/10) + sd_SetLuminosity(myseed.potency/10) else if(luminosity) - ul_SetLuminosity(0) + sd_SetLuminosity(0) return @@ -193,7 +192,9 @@ obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, src.dead = 0 if(src.myseed) // In case there's nothing in the tray beforehand del(src.myseed) - switch(rand(1,15)) // randomly pick predominative weed + switch(rand(1,18)) // randomly pick predominative weed + if(16 to 18) + src.myseed = new /obj/item/seeds/reishimycelium if(14 to 15) src.myseed = new /obj/item/seeds/nettleseed if(12 to 13) @@ -215,9 +216,8 @@ obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, src.harvest = 0 src.weedlevel = 0 // Reset src.pestlevel = 0 // Reset - spawn(5) // Wait a while src.updateicon() - src.visible_message("\red[src] has been overtaken by \blue [src.myseed.plantname]!") + src.visible_message("\blue [src] has been overtaken by [src.myseed.plantname].") return @@ -326,6 +326,10 @@ obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant! del(src.myseed) src.myseed = new /obj/item/seeds/icepepperseed + else if ( istype(src.myseed, /obj/item/seeds/appleseed )) + del(src.myseed) + src.myseed = new /obj/item/seeds/goldappleseed + else if ( istype(src.myseed, /obj/item/seeds/berryseed )) del(src.myseed) switch(rand(1,100)) @@ -440,7 +444,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) b_amount = 100 - src.waterlevel O.reagents.remove_reagent("water", b_amount) src.waterlevel += b_amount - playsound(src.loc, 'slosh.ogg', 25, 1) + playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1) user << "You fill the [src] with [b_amount] units of water." // Toxicity dilutation code. The more water you put in, the lesser the toxin concentration. @@ -449,9 +453,9 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) src.toxic = 0 else if(src.waterlevel >= 100) - user << "\red \The [src] is already full." + user << "\red The [src] is already full." else - user << "\red \The [src] is not filled with water." + user << "\red The bucket is not filled with water." src.updateicon() else if ( istype(O, /obj/item/nutrient) ) @@ -487,29 +491,25 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) else user << "Nothing happens..." // Antitoxin binds shit pretty well. So the tox goes significantly down - if(S.reagents.has_reagent("anti_toxin", 1)) src.toxic -= round(S.reagents.get_reagent_amount("anti_toxin")*2) // NIGGA, YOU JUST WENT ON FULL RETARD. - if(S.reagents.has_reagent("toxin", 1)) src.toxic += round(S.reagents.get_reagent_amount("toxin")*2) - // Milk is good for humans, but bad for plants. The sugars canot be used by ploants, and the milk fat fuck up growth. Not shrooms though. I can't deal with this now... + // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now... if(S.reagents.has_reagent("milk", 1)) src.nutrilevel += round(S.reagents.get_reagent_amount("milk")*0.1) src.waterlevel += round(S.reagents.get_reagent_amount("milk")*0.9) // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? - if(S.reagents.has_reagent("beer", 1)) src.health -= round(S.reagents.get_reagent_amount("beer")*0.05) src.nutrilevel += round(S.reagents.get_reagent_amount("beer")*0.25) src.waterlevel += round(S.reagents.get_reagent_amount("beer")*0.7) // You're an idiot of thinking that one of the most corrosive and deadly gasses would be beneficial - if(S.reagents.has_reagent("fluorine", 1)) src.health -= round(S.reagents.get_reagent_amount("fluorine")*2) src.toxic += round(S.reagents.get_reagent_amount("flourine")*2.5) @@ -517,15 +517,13 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) src.weedlevel -= rand(1,4) // You're an idiot of thinking that one of the most corrosive and deadly gasses would be beneficial - if(S.reagents.has_reagent("chlorine", 1)) src.health -= round(S.reagents.get_reagent_amount("chlorine")*1) src.toxic += round(S.reagents.get_reagent_amount("chlorine")*1.5) src.waterlevel -= round(S.reagents.get_reagent_amount("chlorine")*0.5) src.weedlevel -= rand(1,3) - // White Phosphorous + water -> phosphoric acid. That's not a good thing really. Phosphoric salts are beneficial though. And even if the plan suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. - + // White Phosphorous + water -> phosphoric acid. That's not a good thing really. Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. if(S.reagents.has_reagent("phosphorus", 1)) src.health -= round(S.reagents.get_reagent_amount("phosphorus")*0.75) src.nutrilevel += round(S.reagents.get_reagent_amount("phosphorus")*0.1) @@ -533,7 +531,6 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) src.weedlevel -= rand(1,2) // Plants should not have sugar, they can't use it and it prevents them getting water/ nutients, it is good for mold though... - if(S.reagents.has_reagent("sugar", 1)) src.weedlevel += rand(1,2) src.pestlevel += rand(1,2) @@ -543,6 +540,11 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) if(S.reagents.has_reagent("water", 1)) src.waterlevel += round(S.reagents.get_reagent_amount("water")*1) + // Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~ + if(S.reagents.has_reagent("holywater", 1)) + src.waterlevel += round(S.reagents.get_reagent_amount("holywater")*1) + src.health += round(S.reagents.get_reagent_amount("holywater")*0.1) + // A variety of nutrients are dissolved in club soda, without sugar. These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. if(S.reagents.has_reagent("sodawater", 1)) src.waterlevel += round(S.reagents.get_reagent_amount("sodawater")*1) @@ -550,53 +552,45 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) src.nutrilevel += round(S.reagents.get_reagent_amount("sodawater")*0.1) // Man, you guys are retards - - if(S.reagents.has_reagent("acid", 1)) - src.health -= round(S.reagents.get_reagent_amount("acid")*1) - src.toxic += round(S.reagents.get_reagent_amount("acid")*1.5) + if(S.reagents.has_reagent("sacid", 1)) + src.health -= round(S.reagents.get_reagent_amount("sacid")*1) + src.toxic += round(S.reagents.get_reagent_amount("sacid")*1.5) src.weedlevel -= rand(1,2) // SERIOUSLY - if(S.reagents.has_reagent("pacid", 1)) src.health -= round(S.reagents.get_reagent_amount("pacid")*2) src.toxic += round(S.reagents.get_reagent_amount("pacid")*3) src.weedlevel -= rand(1,4) // Plant-B-Gone is just as bad - if(S.reagents.has_reagent("plantbgone", 1)) src.health -= round(S.reagents.get_reagent_amount("plantbgone")*2) src.toxic -= round(S.reagents.get_reagent_amount("plantbgone")*3) src.weedlevel -= rand(4,8) // Healing - if(S.reagents.has_reagent("cryoxadone", 1)) src.health += round(S.reagents.get_reagent_amount("cryoxadone")*3) src.toxic -= round(S.reagents.get_reagent_amount("cryoxadone")*3) // FINALLY IMPLEMENTED, Ammonia is bad ass. - if(S.reagents.has_reagent("ammonia", 1)) src.health += round(S.reagents.get_reagent_amount("ammonia")*0.5) src.nutrilevel += round(S.reagents.get_reagent_amount("ammonia")*1) - // FINALLY IMPLEMENTED, This is more bad ass, and pest get hurt by the crossive nature of it, not the plant - + // FINALLY IMPLEMENTED, This is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. if(S.reagents.has_reagent("diethylamine", 1)) src.health += round(S.reagents.get_reagent_amount("diethylamine")*1) src.nutrilevel += round(S.reagents.get_reagent_amount("diethylamine")*2) src.pestlevel -= rand(1,2) // Compost, effectively - if(S.reagents.has_reagent("nutriment", 1)) src.health += round(S.reagents.get_reagent_amount("nutriment")*0.5) src.nutrilevel += round(S.reagents.get_reagent_amount("nutriment")*1) // Poor man's mutagen. - if(S.reagents.has_reagent("radium", 1)) src.health -= round(S.reagents.get_reagent_amount("radium")*1.5) src.toxic += round(S.reagents.get_reagent_amount("radium")*2) @@ -612,7 +606,6 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) else user << "Nothing happens..." // The best stuff there is. For testing/debugging. - if(S.reagents.has_reagent("adminordrazine", 1)) src.waterlevel += round(S.reagents.get_reagent_amount("adminordrazine")*1) src.health += round(S.reagents.get_reagent_amount("adminordrazine")*1) @@ -627,18 +620,22 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) else user << "Nothing happens..." S.reagents.clear_reagents() - if (src.weedlevel < 0 ) // Make sure it won't go overoboard + if (src.weedlevel < 0 ) // The following checks are to prevent the stats from going out of bounds. src.weedlevel = 0 - if (src.health < 0 ) // Make sure it won't go overoboard + if (src.health < 0 ) src.health = 0 - if (src.waterlevel > 100 ) // Make sure it won't go overoboard + if (src.waterlevel > 100 ) src.waterlevel = 100 - if (src.waterlevel < 0 ) // Make sure it won't go overoboard + if (src.waterlevel < 0 ) src.waterlevel = 0 - if (src.toxic < 0 ) // Make sure it won't go overoboard + if (src.toxic < 0 ) src.toxic = 0 - if (src.toxic > 100 ) // Make sure it won't go overoboard + if (src.toxic > 100 ) src.toxic = 100 + if (src.pestlevel < 0 ) + src.pestlevel = 0 + if (src.nutrilevel > 10 ) + src.nutrilevel = 10 else user << "You can't get any extract out of this plant." else @@ -689,7 +686,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) user << "-Nutrition level: \blue [src.nutrilevel]/10" user << "" - else if (istype(O, /obj/item/weapon/plantbgone)) + else if (istype(O, /obj/item/weapon/reagent_containers/spray/plantbgone)) if(src.planted && src.myseed) src.health -= rand(5,20) @@ -704,7 +701,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) src.weedlevel = 0 src.toxic += 4 // Oops src.visible_message("\red \The [src] has been sprayed with \the [O][(user ? " by [user]." : ".")]") - playsound(src.loc, 'spray3.ogg', 50, 1, -6) + playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) else if (istype(O, /obj/item/weapon/minihoe)) // The minihoe //var/deweeding @@ -724,7 +721,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) if (src.toxic > 100 ) // Make sure it won't go overoboard src.toxic = 100 user << "You apply the weedkiller solution into the [src]." - playsound(src.loc, 'spray3.ogg', 50, 1, -6) + playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) del(O) src.updateicon() @@ -738,11 +735,11 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) if (src.toxic > 100 ) // Make sure it won't go overoboard src.toxic = 100 user << "You apply the pestkiller solution into the [src]." - playsound(src.loc, 'spray3.ogg', 50, 1, -6) + playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6) del(O) src.updateicon() else if(istype(O, /obj/item/weapon/wrench)) - playsound(loc, 'Ratchet.ogg', 50, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) anchored = !anchored user << "You [anchored ? "wrench" : "unwrench"] \the [src]." else if(istype(O, /obj/item/weapon/shovel)) @@ -875,32 +872,23 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/item/seeds/replicapod/harvest(mob/user = usr) //now that one is fun -- Urist var/obj/machinery/hydroponics/parent = loc - - if(ckey && config.revival_pod_plants) //if there's human data stored in it, make a human - var/mob/ghost = find_dead_player("[ckey]") - + var/make_podman = 0 + var/mob/ghost + if(ckey && config.revival_pod_plants) + ghost = find_dead_player("[ckey]") + if(ismob(ghost)) + if(istype(mind,/datum/mind)) + if(!mind.current || mind.current == DEAD) + make_podman = 1 + if(make_podman) //all conditions met! var/mob/living/carbon/human/podman = new /mob/living/carbon/human(parent.loc) - if(ghost) - ghost.client.mob = podman - - if (realName) + if(realName) podman.real_name = realName - podman.original_name = realName //don't want a random ghost name if we die again else - podman.real_name = "pod person" //No null names!! + podman.real_name = "Pod Person [rand(0,999)]" - if(mind && istype(mind,/datum/mind) && mind.current && mind.current.stat == 2) //only transfer dead people's minds - mind:transfer_to(podman) - mind:original = podman - else //welp - podman.mind = new /datum/mind( ) - podman.mind.key = podman.key - podman.mind.current = podman - podman.mind.original = podman - podman.mind.transfer_to(podman) - ticker.minds += podman.mind - - // -- Mode/mind specific stuff goes here + mind.transfer_to(podman) + // -- Mode/mind specific stuff goes here. TODO! Broken :( Should be merged into mob/living/Login switch(ticker.mode.name) if ("revolution") if (podman.mind in ticker.mode:revolutionaries) @@ -915,30 +903,25 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) if (podman.mind in ticker.mode:cult) ticker.mode:add_cultist(podman.mind) ticker.mode:update_all_cult_icons() //So the icon actually appears - if ("changeling") - if (podman.mind in ticker.mode:changelings) - podman.make_changeling() // -- End mode specific stuff - if(ghost) - if (istype(ghost, /mob/dead/observer)) - del(ghost) //Don't leave ghosts everywhere!! + podman.gender = ghost.gender + if(podman.gender in list(NEUTER, PLURAL)) //Sanity check, which should never actually happen. + podman.gender = pick(MALE,FEMALE) - podman.gender = gender - - if (!podman.dna) - podman.dna = new /datum/dna( ) - if (ui) + if(!podman.dna) + podman.dna = new /datum/dna() + podman.dna.real_name = podman.real_name + if(ui) podman.dna.uni_identity = ui updateappearance(podman, ui) - if (se) + if(se) podman.dna.struc_enzymes = se - podman:update_face() - podman:update_body() - if(!prob(potency)) //if it fails, plantman! - podman.mutantrace = "plant" + if(podman.dna) + podman.dna.mutantrace = "plant" + podman.update_mutantrace() else //else, one packet of seeds. maybe two var/seed_count = 1 @@ -998,7 +981,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/hydroponics/soil //Not actually hydroponics at all! Honk! name = "soil" - icon = 'hydroponics.dmi' + icon = 'icons/obj/hydroponics.dmi' icon_state = "soil" density = 0 New() @@ -1007,25 +990,25 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) overlays = null if(src.planted) if(dead) - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-dead") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-dead") else if(src.harvest) if(src.myseed.plant_type == 2) // Shrooms don't have a -harvest graphic - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") else - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-harvest") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-harvest") else if(src.age < src.myseed.maturation) var/t_growthstate = ((src.age / src.myseed.maturation) * src.myseed.growthstages ) - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-grow[round(t_growthstate)]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[round(t_growthstate)]") src.lastproduce = src.age else - overlays += image('hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") + overlays += image('icons/obj/hydroponics.dmi', icon_state="[src.myseed.species]-grow[src.myseed.growthstages]") if(myseed) if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) - ul_SetLuminosity(0) + sd_SetLuminosity(0) else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) - ul_SetLuminosity(myseed.potency/10) + sd_SetLuminosity(myseed.potency/10) else if(luminosity) - ul_SetLuminosity(0) + sd_SetLuminosity(0) return \ No newline at end of file diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 2f1cb2c338..fb3adac404 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -38,7 +38,7 @@ /obj/machinery/sparker name = "Mounted igniter" desc = "A wall-mounted ignition device." - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "migniter" var/id = null var/disable = 0 @@ -53,11 +53,11 @@ if ( powered() && disable == 0 ) stat &= ~NOPOWER icon_state = "[base_state]" - ul_SetLuminosity(2,0,0) + src.sd_SetLuminosity(2) else stat |= ~NOPOWER icon_state = "[base_state]-p" - ul_SetLuminosity(0) + src.sd_SetLuminosity(0) /obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/device/detective_scanner)) @@ -108,9 +108,6 @@ return src.attack_hand(user) /obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob) - - if(istype(W, /obj/item/device/detective_scanner)) - return return src.attack_hand(user) /obj/machinery/ignition_switch/attack_hand(mob/user as mob) diff --git a/code/game/machinery/kitchen/blender.dm b/code/game/machinery/kitchen/blender.dm index db8aea9d7a..b76b74cf59 100644 --- a/code/game/machinery/kitchen/blender.dm +++ b/code/game/machinery/kitchen/blender.dm @@ -12,7 +12,7 @@ the blender or the processor: Processor items are solid objects and Blender resu /obj/machinery/blender name = "Blender" desc = "A kitchen appliance used to blend stuff." - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "blender_e" density = 1 anchored = 1 @@ -94,7 +94,7 @@ the blender or the processor: Processor items are solid objects and Blender resu if(!src.container) usr << "\red The blender doesn't have an attached container!" return - playsound(src.loc, 'blender.ogg', 50, 1) + playsound(src.loc, 'sound/machines/blender.ogg', 50, 1) src.processing = 1 usr << "\blue You turn on the blender." use_power(250) diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index 146867ffda..2352c0134f 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -2,7 +2,7 @@ /obj/machinery/gibber name = "Gibber" desc = "The name isn't descriptive enough?" - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "grinder" density = 1 anchored = 1 @@ -14,22 +14,53 @@ idle_power_usage = 2 active_power_usage = 500 +//auto-gibs anything that bumps into it +/obj/machinery/gibber/autogibber + var/turf/input_plate + + New() + ..() + spawn(5) + for(var/i in cardinal) + var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) ) + if(input_obj) + if(isturf(input_obj.loc)) + input_plate = input_obj.loc + del(input_obj) + break + + if(!input_plate) + diary << "a [src] didn't find an input plate." + return + + Bumped(var/atom/A) + if(!input_plate) return + + if(ismob(A)) + var/mob/M = A + + if(M.loc == input_plate + ) + M.loc = src + M.gib() + + /obj/machinery/gibber/New() ..() - src.overlays += image('kitchen.dmi', "grjam") + src.overlays += image('icons/obj/kitchen.dmi', "grjam") /obj/machinery/gibber/update_icon() overlays = null if (dirty) - src.overlays += image('kitchen.dmi', "grbloody") + src.overlays += image('icons/obj/kitchen.dmi', "grbloody") if(stat & (NOPOWER|BROKEN)) return if (!occupant) - src.overlays += image('kitchen.dmi', "grjam") + src.overlays += image('icons/obj/kitchen.dmi', "grjam") else if (operating) - src.overlays += image('kitchen.dmi', "gruse") + src.overlays += image('icons/obj/kitchen.dmi', "gruse") else - src.overlays += image('kitchen.dmi', "gridle") + src.overlays += image('icons/obj/kitchen.dmi', "gridle") /obj/machinery/gibber/attack_paw(mob/user as mob) return src.attack_hand(user) @@ -48,41 +79,20 @@ src.startgibbing(user) /obj/machinery/gibber/attackby(obj/item/weapon/grab/G as obj, mob/user as mob) - if(istype(G,/obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = G - if(E.uses) - E.uses-- - else - return - user.visible_message( \ - "\red [user] swipes a strange card through \the [src]'s control panel!", \ - "\red You swipe a strange card through \the [src]'s control panel!", \ - "You hear a scratchy sound.") - emagged = 1 - return - if(src.occupant) - user << "\red \The [src] is full, empty it first!" + user << "\red The gibber is full, empty it first!" return - if (!istype(G, /obj/item/weapon/grab)) - user << "\red This item is not suitable for \the [src]!" + if (!( istype(G, /obj/item/weapon/grab)) || !(istype(G.affecting, /mob/living/carbon/human))) + user << "\red This item is not suitable for the gibber!" + return + if(G.affecting.abiotic(1)) + user << "\red Subject may not have abiotic items on." return - if(istype(G.affecting, /mob/living/carbon/human)) - if(!emagged) - user << "\red \The [src] buzzes and spits [G.affecting] back out." - return - if(G.affecting.abiotic2(1)) - user << "\red Subject may not have abiotic items on." - return - else if(istype(G.affecting, /mob/living/carbon/monkey) || istype(G.affecting, /mob/living/carbon/alien) || istype(G.affecting, /mob/living/simple_animal)) - // do nothing special - else - user << "\red This item is not suitable for \the [src]!" - user.visible_message("\red [user] starts to put [G.affecting] into \the [src]!") + user.visible_message("\red [user] starts to put [G.affecting] into the gibber!") src.add_fingerprint(user) if(do_after(user, 30) && G && G.affecting && !occupant) - user.visible_message("\red [user] stuffs [G.affecting] into \the [src]!") + user.visible_message("\red [user] stuffs [G.affecting] into the gibber!") var/mob/M = G.affecting if(M.client) M.client.perspective = EYE_PERSPECTIVE @@ -129,76 +139,39 @@ M.show_message("\red You hear a loud squelchy grinding sound.", 1) src.operating = 1 update_icon() + var/sourcename = src.occupant.real_name + var/sourcejob = src.occupant.job + var/sourcenutriment = src.occupant.nutrition / 15 + var/sourcetotalreagents = src.occupant.reagents.total_volume + var/totalslabs = 3 - var/list/obj/item/weapon/reagent_containers/food/snacks/allmeat = new() + var/obj/item/weapon/reagent_containers/food/snacks/meat/human/allmeat[totalslabs] + for (var/i=1 to totalslabs) + var/obj/item/weapon/reagent_containers/food/snacks/meat/human/newmeat = new + newmeat.name = sourcename + newmeat.name + newmeat.subjectname = sourcename + newmeat.subjectjob = sourcejob + newmeat.reagents.add_reagent ("nutriment", sourcenutriment / totalslabs) // Thehehe. Fat guys go first + src.occupant.reagents.trans_to (newmeat, round (sourcetotalreagents / totalslabs, 1)) // Transfer all the reagents from the + allmeat[i] = newmeat - if(istype(occupant,/mob/living/carbon/human)) - var/sourcename = src.occupant.real_name - var/sourcejob = src.occupant.job - var/sourcenutriment = src.occupant.nutrition / 15 - var/sourcetotalreagents = src.occupant.reagents.total_volume - var/totalslabs = 8 - - for (var/i=1 to totalslabs) - var/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/human/newmeat = new() - newmeat.name = sourcename + newmeat.name - newmeat.subjectname = sourcename - newmeat.subjectjob = sourcejob - newmeat.reagents.add_reagent("nutriment", sourcenutriment / totalslabs) // Thehehe. Fat guys go first - src.occupant.reagents.trans_to(newmeat, round(sourcetotalreagents / totalslabs, 1)) // Transfer all the reagents from the - allmeat += newmeat - else if(istype(occupant,/mob/living/carbon/monkey)) - var/sourcename = src.occupant.real_name - var/sourcenutriment = src.occupant.nutrition / 15 - var/sourcetotalreagents = src.occupant.reagents.total_volume - var/totalslabs = 5 - - for (var/i=1 to totalslabs) - var/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/monkey/newmeat = new() - newmeat.name = sourcename + newmeat.name - newmeat.reagents.add_reagent("nutriment", sourcenutriment / totalslabs) // Thehehe. Fat guys go first - src.occupant.reagents.trans_to(newmeat, round(sourcetotalreagents / totalslabs, 1)) // Transfer all the reagents from the - allmeat += newmeat - else if(istype(occupant,/mob/living/carbon/alien)) - var/sourcename = src.occupant.real_name - var/sourcenutriment = src.occupant.nutrition / 15 - var/sourcetotalreagents = src.occupant.reagents.total_volume - var/totalslabs = 5 - - for (var/i=1 to totalslabs) - var/obj/item/weapon/reagent_containers/food/snacks/xenomeat/newmeat = new() - newmeat.name = sourcename + newmeat.name - newmeat.reagents.add_reagent("nutriment", sourcenutriment / totalslabs) // Thehehe. Fat guys go first - src.occupant.reagents.trans_to(newmeat, round(sourcetotalreagents / totalslabs, 1)) // Transfer all the reagents from the - allmeat += newmeat - else if(istype(occupant,/mob/living/simple_animal)) - var/sourcenutriment = src.occupant.nutrition / 15 - var/totalslabs = occupant:meat_amount - - for (var/i=1 to totalslabs) - var/obj/item/weapon/reagent_containers/food/snacks/newmeat = new occupant:meat_type() - newmeat.reagents.add_reagent("nutriment", sourcenutriment / totalslabs) // Thehehe. Fat guys go first - allmeat += newmeat - - for (var/mob/M in world) - if (M.client && M.client.holder && (M.client.holder.level != -3) && (M.client.holder.level != 0)) - M << "\red [user.name]/[user.ckey] has gibbed [src.occupant.name]/[src.occupant.ckey]" + src.occupant.attack_log += "\[[time_stamp()]\] Was gibbed by [user]/[user.ckey]" //One shall not simply gib a mob unnoticed! + user.attack_log += "\[[time_stamp()]\] Gibbed [src.occupant]/[src.occupant.ckey]" + log_attack("\[[time_stamp()]\] [user]/[user.ckey] gibbed [src.occupant]/[src.occupant.ckey]") src.occupant.death(1) src.occupant.ghostize() del(src.occupant) spawn(src.gibtime) - playsound(src.loc, 'splat.ogg', 50, 1) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) operating = 0 - var/iterator = 0 - for (var/i=1 to allmeat.len) + for (var/i=1 to totalslabs) var/obj/item/meatslab = allmeat[i] - var/turf/Tx = locate(src.x - i + iterator, src.y, src.z) - if(Tx.density) - iterator += 1 - Tx = locate(src.x - i + iterator, src.y, src.z) + var/turf/Tx = locate(src.x - i, src.y, src.z) meatslab.loc = src.loc meatslab.throw_at(Tx,i,3) if (!Tx.density) - new /obj/effect/decal/cleanable/blood/gibs(Tx,i + iterator) + new /obj/effect/decal/cleanable/blood/gibs(Tx,i) src.operating = 0 update_icon() + + diff --git a/code/game/machinery/kitchen/juicer.dm b/code/game/machinery/kitchen/juicer.dm index 0a32cd3224..3d81185698 100644 --- a/code/game/machinery/kitchen/juicer.dm +++ b/code/game/machinery/kitchen/juicer.dm @@ -1,7 +1,7 @@ /obj/machinery/juicer name = "Juicer" - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "juicer1" layer = 2.9 density = 0 @@ -21,12 +21,10 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/lime = "limejuice", /obj/item/weapon/reagent_containers/food/snacks/watermelonslice = "watermelonjuice", /obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries = "poisonberryjuice", - /obj/item/weapon/reagent_containers/food/snacks/grown/grapes = "grapejuice", - /obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes = "grapejuice", ) /obj/machinery/juicer/New() - beaker = new /obj/item/weapon/reagent_containers/glass/large(src) + beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src) /obj/machinery/juicer/update_icon() icon_state = "juicer"+num2text(!isnull(beaker)) @@ -149,7 +147,7 @@ return if (!beaker || beaker.reagents.total_volume >= beaker.reagents.maximum_volume) return - playsound(src.loc, 'juicer.ogg', 50, 1) + playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1) for (var/obj/item/weapon/reagent_containers/food/snacks/O in src.contents) var/r_id = get_juice_id(O) beaker.reagents.add_reagent(r_id,get_juice_amount(O)) diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 704169b151..6c7380a155 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -1,7 +1,7 @@ /obj/machinery/microwave name = "Microwave" - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "mw" layer = 2.9 density = 1 @@ -78,7 +78,7 @@ user << "\red It's broken!" return 1 else if(src.dirty==100) // The microwave is all dirty so can't be used! - if(istype(O, /obj/item/weapon/cleaner)) // If they're trying to clean it then let them + if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner)) // If they're trying to clean it then let them user.visible_message( \ "\blue [user] starts to clean the microwave.", \ "\blue You start to clean the microwave." \ @@ -128,7 +128,7 @@ user << "\red This is ridiculous. You can not fit \the [G.affecting] in this [src]." return 1 else - user << "\red You have no idea what you can cook with \this [O]." + user << "\red You have no idea what you can cook with this [O]." return 1 src.updateUsrDialog() @@ -169,7 +169,7 @@ if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu)) items_measures[display_name] = "tofu chunk" items_measures_p[display_name] = "tofu chunks" - if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat)) //any meat + if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat items_measures[display_name] = "slab of meat" items_measures_p[display_name] = "slabs of meat" if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket)) @@ -303,7 +303,7 @@ src.updateUsrDialog() /obj/machinery/microwave/proc/stop() - playsound(src.loc, 'ding.ogg', 50, 1) + playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) src.operating = 0 // Turn it off again aferwards src.icon_state = "mw" src.updateUsrDialog() @@ -318,11 +318,11 @@ src.updateUsrDialog() /obj/machinery/microwave/proc/muck_start() - playsound(src.loc, 'splat.ogg', 50, 1) // Play a splat sound + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound src.icon_state = "mwbloody1" // Make it look dirty!! /obj/machinery/microwave/proc/muck_finish() - playsound(src.loc, 'ding.ogg', 50, 1) + playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) src.visible_message("\red The microwave gets covered in muck!") src.dirty = 100 // Make it dirty so it can't be used util cleaned src.flags = null //So you can't add condiments diff --git a/code/game/machinery/kitchen/processor.dm b/code/game/machinery/kitchen/processor.dm index 43dfb63cac..0cfb53d0f8 100644 --- a/code/game/machinery/kitchen/processor.dm +++ b/code/game/machinery/kitchen/processor.dm @@ -1,7 +1,7 @@ /obj/machinery/processor name = "Food Processor" - icon = 'kitchen.dmi' + icon = 'icons/obj/kitchen.dmi' icon_state = "processor" layer = 2.9 density = 1 @@ -30,25 +30,24 @@ output = /obj/item/weapon/reagent_containers/food/snacks/flour meat - input = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat - output = /obj/item/weapon/reagent_containers/food/snacks/rawfaggot + input = /obj/item/weapon/reagent_containers/food/snacks/meat + output = /obj/item/weapon/reagent_containers/food/snacks/faggot meat2 input = /obj/item/weapon/syntiflesh - output = /obj/item/weapon/reagent_containers/food/snacks/rawfaggot + output = /obj/item/weapon/reagent_containers/food/snacks/faggot /* monkeymeat - input = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/monkey + input = /obj/item/weapon/reagent_containers/food/snacks/meat/monkey output = /obj/item/weapon/reagent_containers/food/snacks/faggot humanmeat - input = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/human + input = /obj/item/weapon/reagent_containers/food/snacks/meat/human output = /obj/item/weapon/reagent_containers/food/snacks/faggot */ - potato input = /obj/item/weapon/reagent_containers/food/snacks/grown/potato - output = /obj/item/weapon/reagent_containers/food/snacks/rawsticks + output = /obj/item/weapon/reagent_containers/food/snacks/fries carrot input = /obj/item/weapon/reagent_containers/food/snacks/grown/carrot @@ -152,7 +151,7 @@ user.visible_message("\blue [user] turns on \a [src].", \ "You turn on \a [src].", \ "You hear a food processor") - playsound(src.loc, 'blender.ogg', 50, 1) + playsound(src.loc, 'sound/machines/blender.ogg', 50, 1) use_power(500) sleep(P.time) P.process(src.loc, O) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index eb949b646e..ea307cc5b4 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -114,10 +114,10 @@ Class Procs: /obj/machinery/emp_act(severity) if(use_power && stat == 0) - use_power(15000/severity) + use_power(7500/severity) var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc ) - pulse2.icon = 'effects.dmi' + pulse2.icon = 'icons/effects/effects.dmi' pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 @@ -147,15 +147,13 @@ Class Procs: if(prob(50)) del(src) -#define POWER_USE_MULTIPLIER 3 - /obj/machinery/proc/auto_use_power() if(!powered(power_channel)) return 0 if(src.use_power == 1) - use_power(idle_power_usage * POWER_USE_MULTIPLIER,power_channel) + use_power(idle_power_usage,power_channel) else if(src.use_power >= 2) - use_power(active_power_usage * POWER_USE_MULTIPLIER,power_channel) + use_power(active_power_usage,power_channel) return 1 /obj/machinery/Topic(href, href_list) @@ -207,11 +205,12 @@ Class Procs: return 1 */ if (ishuman(user)) - if(user.getBrainLoss() >= 60) + var/mob/living/carbon/human/H = user + if(H.getBrainLoss() >= 60) for(var/mob/M in viewers(src, null)) - M << "\red [user] stares cluelessly at [src] and drools." + M << "\red [H] stares cluelessly at [src] and drools." return 1 - else if(prob(user.getBrainLoss())) + else if(prob(H.getBrainLoss())) user << "\red You momentarily forget how to use [src]." return 1 diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index f7dd8539ad..79d6d06924 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -6,7 +6,7 @@ /obj/machinery/magnetic_module - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "floor_magnet-f" name = "Electromagnetic Generator" desc = "A device that uses station power to create points of magnetic energy." @@ -195,7 +195,7 @@ /obj/machinery/magnetic_controller name = "Magnetic Control Console" - icon = 'airlock_machines.dmi' // uses an airlock machine icon, THINK GREEN HELP THE ENVIRONMENT - RECYCLING! + icon = 'icons/obj/airlock_machines.dmi' // uses an airlock machine icon, THINK GREEN HELP THE ENVIRONMENT - RECYCLING! icon_state = "airlock_control_standby" density = 1 anchored = 1.0 diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm new file mode 100644 index 0000000000..ee23cc1ff5 --- /dev/null +++ b/code/game/machinery/mass_driver.dm @@ -0,0 +1,36 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 + +/obj/machinery/mass_driver + name = "mass driver" + desc = "Shoots things into space." + icon = 'icons/obj/stationobjs.dmi' + icon_state = "mass_driver" + anchored = 1.0 + use_power = 1 + idle_power_usage = 2 + active_power_usage = 50 + + var/power = 1.0 + var/code = 1.0 + var/id = 1.0 + var/drive_range = 50 //this is mostly irrelevant since current mass drivers throw into space, but you could make a lower-range mass driver for interstation transport or something I guess. + + + proc/drive(amount) + if(stat & (BROKEN|NOPOWER)) + return + use_power(500) + var/O_limit + var/atom/target = get_edge_target_turf(src, dir) + for(var/atom/movable/O in loc) + if(!O.anchored||istype(O, /obj/mecha))//Mechs need their launch platforms. + O_limit++ + if(O_limit >= 20) + for(var/mob/M in hearers(src, null)) + M << "\blue The mass driver lets out a screech, it mustn't be able to handle any more items." + break + use_power(500) + spawn( 0 ) + O.throw_at(target, drive_range * power, power) + flick("mass_driver1", src) + return diff --git a/code/game/machinery/morgue.dm b/code/game/machinery/morgue.dm index 0e9f9bdc02..c864eaadac 100644 --- a/code/game/machinery/morgue.dm +++ b/code/game/machinery/morgue.dm @@ -43,11 +43,11 @@ for(var/atom/movable/A as mob|obj in src.connected.loc) if (!( A.anchored )) A.loc = src - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) //src.connected = null del(src.connected) else - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) src.connected = new /obj/structure/m_tray( src.loc ) step(src.connected, EAST) src.connected.layer = OBJ_LAYER @@ -68,7 +68,7 @@ /obj/structure/morgue/attackby(P as obj, mob/user as mob) if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != P) + if (user.get_active_hand() != P) return if ((!in_range(src, usr) && src.loc != user)) return @@ -188,11 +188,11 @@ for(var/atom/movable/A as mob|obj in src.connected.loc) if (!( A.anchored )) A.loc = src - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) //src.connected = null del(src.connected) else if (src.locked == 0) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) src.connected = new /obj/structure/c_tray( src.loc ) step(src.connected, SOUTH) src.connected.layer = OBJ_LAYER @@ -212,7 +212,7 @@ /obj/structure/crematorium/attackby(P as obj, mob/user as mob) if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != P) + if (user.get_active_hand() != P) return if ((!in_range(src, usr) > 1 && src.loc != user)) return @@ -250,46 +250,41 @@ if(cremating) return //don't let you cremate something twice or w/e - if(length(contents) == 0) + if(contents.len <= 0) for (var/mob/M in viewers(src)) M.show_message("\red You hear a hollow crackle.", 1) return - else if(contents) + + else + if(!isemptylist(src.search_contents_for(/obj/item/weapon/disk/nuclear))) + usr << "You get the feeling that you shouldn't cremate one of the items in the cremator." + return + for (var/mob/M in viewers(src)) M.show_message("\red You hear a roar as the crematorium activates.", 1) + cremating = 1 locked = 1 - if(locate(/mob/living/, src)) - for (var/obj/item/I in contents) - del(I) - for (var/mob/living/M in contents) - M.Stun(100) //You really dont want to place this inside the loop. - spawn(1) - for(var/i=1 to 10) - sleep(10) - if(M) - M.take_overall_damage(0,30) - if (M.stat!=2 && prob(30)) - M.emote("scream") - new /obj/effect/decal/ash(src) - for (var/obj/item/W in M) - if (prob(10)) - W.loc = src - M.death(1) - M.ghostize() - del(M) - cremating = 0 - locked = 0 - playsound(src.loc, 'ding.ogg', 50, 1) - else - for(var/obj/item/I in contents) - if(!istype(I, /obj/item/weapon/disk/nuclear)) - del(I) - new /obj/effect/decal/ash(src) - sleep(30) - cremating = 0 - locked = 0 - playsound(src.loc, 'ding.ogg', 50, 1) + + for(var/mob/living/M in contents) + if (M.stat!=2) + M.emote("scream") + //Logging for this causes runtimes resulting in the cremator locking up. Commenting it out until that's figured out. + //M.attack_log += "\[[time_stamp()]\] Has been cremated by [user]/[user.ckey]" //No point in this when the mob's about to be deleted + //user.attack_log +="\[[time_stamp()]\] Cremated [M]/[M.ckey]" + //log_attack("\[[time_stamp()]\] [user]/[user.ckey] cremated [M]/[M.ckey]") + M.death(1) + M.ghostize() + del(M) + + for(var/obj/O in contents) //obj instead of obj/item so that bodybags and ashes get destroyed. We dont want tons and tons of ash piling up + del(O) + + new /obj/effect/decal/cleanable/ash(src) + sleep(30) + cremating = 0 + locked = 0 + playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) return /obj/structure/c_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index e4266c71f0..3cfd09b88d 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -3,7 +3,7 @@ /obj/machinery/navbeacon - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "navbeacon0-f" name = "navigation beacon" desc = "A radio beacon used for bot navigation." @@ -18,7 +18,7 @@ var/list/codes // assoc. list of transponder codes var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) New() ..() @@ -39,7 +39,7 @@ codes = new() - var/list/entries = dd_text2List(codes_txt, ";") // entries are separated by semicolons + var/list/entries = dd_text2list(codes_txt, ";") // entries are separated by semicolons for(var/e in entries) var/index = findtext(e, "=") // format is "key=value" diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 491f46f412..2e29a1ef45 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -24,8 +24,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r /obj/machinery/newscaster name = "newscaster" - desc = "A standard NanoTrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!" - icon = 'terminals.dmi' + desc = "A standard Nanotrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!" + icon = 'icons/obj/terminals.dmi' icon_state = "newscaster_normal" var/isbroken = 0 //1 if someone banged it with something heavy var/ispowered = 1 //starts powered, changes with power_change() @@ -170,11 +170,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r dat+="
    Feed Security functions:
    " dat+="
    [(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue" dat+="
    Censor Feed Stories" - dat+="
    Mark Feed Channel with NanoTrasen D-Notice" + dat+="
    Mark Feed Channel with Nanotrasen D-Notice" dat+="

    The newscaster recognises you as: [src.scanned_user]" if(1) dat+= "Station Feed Channels
    " - if(!channel_list.len) + if( isemptylist(src.channel_list) ) dat+="No active channels found..." else for(var/datum/feed_channel/CHANNEL in src.channel_list) @@ -252,10 +252,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r if(9) dat+="[src.viewing_channel.channel_name]: \[created by: [src.viewing_channel.author]\]
    " if(src.viewing_channel.censored) - dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a NanoTrasen D-Notice.
    " + dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
    " dat+="No further feed story additions are allowed while the D-Notice is in effect.

    " else - if(!viewing_channel.messages.len) + if( isemptylist(src.viewing_channel.messages) ) dat+="No feed messages found in channel...
    " else for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) @@ -263,22 +263,22 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r dat+="

    Refresh" dat+="
    Back" if(10) - dat+="NanoTrasen Feed Censorship Tool
    " + dat+="Nanotrasen Feed Censorship Tool
    " dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
    " dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.
    " dat+="
    Select Feed channel to get Stories from:
    " - if(!channel_list.len) + if(isemptylist(src.channel_list)) dat+="No feed channels found active...
    " else for(var/datum/feed_channel/CHANNEL in src.channel_list) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
    " dat+="
    Cancel" if(11) - dat+="NanoTrasen D-Notice Handler
    " + dat+="Nanotrasen D-Notice Handler
    " dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's" dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed" dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
    " - if(!channel_list.len) + if(isemptylist(src.channel_list)) dat+="No feed channels found active...
    " else for(var/datum/feed_channel/CHANNEL in src.channel_list) @@ -290,7 +290,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r dat+="[(src.viewing_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]
    " - if( !viewing_channel.messages.len ) + if( isemptylist(src.viewing_channel.messages) ) dat+="No feed messages found in channel...
    " else for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) @@ -301,10 +301,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r dat+="[src.viewing_channel.channel_name]: \[ created by: [src.viewing_channel.author] \]
    " dat+="Channel messages listed below. If you deem them dangerous to the station, you can Bestow a D-Notice upon the channel.
    " if(src.viewing_channel.censored) - dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a NanoTrasen D-Notice.
    " + dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
    " dat+="No further feed story additions are allowed while the D-Notice is in effect.

    " else - if( !viewing_channel.messages.len ) + if( isemptylist(src.viewing_channel.messages) ) dat+="No feed messages found in channel...
    " else for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) @@ -445,8 +445,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r break // Another for to go through newscasters is not needed. Due to the nature of submit_new_CHANNEL, every reference src.screen=4 // to a channel in ANY newscaster is the same. Editing one will edit them all. - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) - NEWSCASTER.newsAlert(src.channel_name) + for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + NEWSCASTER.newsAlert(src.channel_name) src.updateUsrDialog() @@ -623,7 +623,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r src.screen=2*/ //Obsolete after autorecognition if (src.isbroken) - playsound(src.loc, 'hit_on_shattered_glass.ogg', 100, 1) + playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1) for (var/mob/O in hearers(5, src.loc)) O.show_message("[user.name] further abuses the shattered [src.name].") else @@ -632,18 +632,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r if(W.force <15) for (var/mob/O in hearers(5, src.loc)) O.show_message("[user.name] hits the [src.name] with the [W.name] with no visible effect." ) - playsound(src.loc, 'Glasshit.ogg', 100, 1) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) else src.hitstaken++ if(src.hitstaken==3) for (var/mob/O in hearers(5, src.loc)) O.show_message("[user.name] smashes the [src.name]!" ) src.isbroken=1 - playsound(src.loc, 'Glassbr3.ogg', 100, 1) + playsound(src.loc, 'sound/effects/Glassbr3.ogg', 100, 1) else for (var/mob/O in hearers(5, src.loc)) O.show_message("[user.name] forcefully slams the [src.name] with the [I.name]!" ) - playsound(src.loc, 'Glasshit.ogg', 100, 1) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) else user << "This does nothing." src.update_icon() @@ -666,9 +666,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r /obj/item/weapon/newspaper name = "newspaper" - desc = "An issue of The Griffon, the newspaper circulating aboard NanoTrasen Space Stations." + desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations." icon_state = "newspaper" w_class = 2 //Let's make it fit in trashbags! + attack_verb = list("bapped") var/screen = 0 var/pages = 0 var/curr_page = 0 @@ -677,6 +678,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r var/scribble="" var/scribble_page = null +/*obj/item/weapon/newspaper/attack_hand(mob/user as mob) + ..() + world << "derp"*/ + obj/item/weapon/newspaper/attack_self(mob/user as mob) if(ishuman(user)) var/mob/living/carbon/human/human_user = user @@ -685,8 +690,8 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) switch(screen) if(0) //Cover dat+="
    The Griffon
    " - dat+="
    NanoTrasen-standard newspaper, for use on NanoTrasen© Space Facilities

    " - if(!news_content.len) + dat+="
    Nanotrasen-standard newspaper, for use on Nanotrasen© Space Facilities

    " + if(isemptylist(src.news_content)) if(src.important_message) dat+="Contents:
      **Important Security Announcement** \[page [src.pages+2]\]
    " else @@ -713,7 +718,7 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) if(C.censored) dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a D-Notice. Its contents were not transferred to the newspaper at the time of printing." else - if(!C.messages.len) + if(isemptylist(C.messages)) dat+="No Feed stories stem from this channel..." else dat+="
      " @@ -844,4 +849,4 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) else for(var/mob/O in hearers(world.view-1, T)) O.show_message("[src.name] beeps, \"Wanted notice posted!\"",2) - playsound(src.loc, 'twobeep.ogg', 75, 1) + playsound(src.loc, 'sound/machines/twobeep.ogg', 75, 1) diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index 185c33ae6f..f4f7dfade5 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -5,8 +5,9 @@ set category = "Object" set src in view(1) usr.machine = src + if(!mapping) return - log_game("[usr]([usr.key]) used station map L[maplevel] in [src.loc.loc]") + log_game("[usr]([usr.key]) used station map L[z] in [src.loc.loc]") src.drawmap(usr) @@ -26,8 +27,8 @@ #ifdef AMAP for(var/i = 0; iRegular pipes:
      Pipe
      -Pipe Cap
      `` Bent Pipe
      Manifold
      -4-Way Manifold
      Manual Valve
      -Manual T-Valve
      Devices:
      Connector
      Unary Vent
      @@ -34,6 +31,9 @@ Pipe
      Bent Pipe
      Junction
      +Insulated pipes:
      +Pipe
      +Bent Pipe
      "} @@ -55,6 +55,7 @@ var/p_dir = text2num(href_list["dir"]) var/obj/item/pipe/P = new (/*usr.loc*/ src.loc, pipe_type=p_type, dir=p_dir) P.update() + P.add_fingerprint(usr) wait = 1 spawn(10) wait = 0 @@ -67,13 +68,15 @@ return /obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob) + src.add_fingerprint(usr) if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter)) usr << "\blue You put [W] back to [src]." + user.drop_item() del(W) return else if (istype(W, /obj/item/weapon/wrench)) if (unwrenched==0) - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to unfasten \the [src] from the floor..." if (do_after(user, 40)) user.visible_message( \ @@ -86,7 +89,7 @@ if (usr.machine==src) usr << browse(null, "window=pipedispenser") else /*if (unwrenched==1)*/ - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to fasten \the [src] to the floor..." if (do_after(user, 20)) user.visible_message( \ @@ -103,7 +106,7 @@ /obj/machinery/pipedispenser/disposal name = "Disposal Pipe Dispenser" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "pipe_d" density = 1 anchored = 1.0 @@ -143,8 +146,6 @@ Nah Bin
      Outlet
      Chute
      -Sort Junction 1
      -Sort Junction 2
      "} user << browse("[src][dat]", "window=pipedispenser") @@ -185,11 +186,7 @@ Nah if(7) C.ptype = 8 C.density = 1 - if(8) - C.ptype = 8 - if(9) - C.ptype = 9 - + C.add_fingerprint(usr) C.update() wait = 1 spawn(15) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 42f295ffdd..f16f1ee81e 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -11,19 +11,19 @@ /obj/machinery/porta_turret name = "turret" - icon = 'turrets.dmi' + icon = 'icons/obj/turrets.dmi' icon_state = "grey_target_prism" anchored = 1 layer = 3 - invisibility = 2 // the turret is invisible if it's inside its cover + invisibility = INVISIBILITY_LEVEL_TWO // the turret is invisible if it's inside its cover density = 1 use_power = 1 // this turret uses and requires power idle_power_usage = 50 // when inactive, this turret takes up constant 50 Equipment power active_power_usage = 300// when active, this turret takes up constant 300 Equipment power - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) power_channel = EQUIP // drains power from the EQUIPMENT channel - var/lasercolor = "" + var/lasercolor = "" // Something to do with lasertag turrets, blame Sieve for not adding a comment. var/raised = 0 // if the turret cover is "open" and the turret is raised var/raising= 0 // if the turret is currently opening or closing its cover var/health = 80 // the turret's health @@ -32,6 +32,7 @@ var/installation // the type of weapon installed var/gun_charge = 0 // the charge of the gun inserted var/projectile = null //holder for bullettype + var/eprojectile = null//holder for the shot when emagged var/reqpower = 0 //holder for power needed var/sound = null//So the taser can have sound var/iconholder = null//holder for the icon_state @@ -63,6 +64,118 @@ spark_system = new /datum/effect/effect/system/spark_spread spark_system.set_up(5, 0, src) spark_system.attach(src) + sleep(10) + if(!installation)// if for some reason the turret has no gun (ie, admin spawned) it resorts to basic taser shots + projectile = /obj/item/projectile/energy/electrode//holder for the projectile, here it is being set + eprojectile = /obj/item/projectile/beam//holder for the projectile when emagged, if it is different + reqpower = 200 + sound = 1 + iconholder = 1 + else + var/obj/item/weapon/gun/energy/E=new installation + // All energy-based weapons are applicable + switch(E.type) + if(/obj/item/weapon/gun/energy/laser/bluetag) + projectile = /obj/item/projectile/bluetag + eprojectile = /obj/item/projectile/omnitag//This bolt will stun ERRYONE with a vest + iconholder = null + reqpower = 100 + lasercolor = "b" + req_access = list(access_maint_tunnels,access_clown,access_mime) + check_records = 0 + criminals = 0 + auth_weapons = 1 + stun_all = 0 + check_anomalies = 0 + shot_delay = 30 + + if(/obj/item/weapon/gun/energy/laser/redtag) + projectile = /obj/item/projectile/redtag + eprojectile = /obj/item/projectile/omnitag + iconholder = null + reqpower = 100 + lasercolor = "r" + req_access = list(access_maint_tunnels,access_clown,access_mime) + check_records = 0 + criminals = 0 + auth_weapons = 1 + stun_all = 0 + check_anomalies = 0 + shot_delay = 30 + + if(/obj/item/weapon/gun/energy/laser/practice) + projectile = /obj/item/projectile/practice + eprojectile = /obj/item/projectile/beam + iconholder = null + reqpower = 100 + + if(/obj/item/weapon/gun/energy/pulse_rifle) + projectile = /obj/item/projectile/beam/pulse + eprojectile = projectile + iconholder = null + reqpower = 700 + + if(/obj/item/weapon/gun/energy/staff) + projectile = /obj/item/projectile/change + eprojectile = projectile + iconholder = 1 + reqpower = 700 + + if(/obj/item/weapon/gun/energy/ionrifle) + projectile = /obj/item/projectile/ion + eprojectile = projectile + iconholder = 1 + reqpower = 700 + + if(/obj/item/weapon/gun/energy/taser) + projectile = /obj/item/projectile/energy/electrode + eprojectile = projectile + iconholder = 1 + reqpower = 200 + + if(/obj/item/weapon/gun/energy/stunrevolver) + projectile = /obj/item/projectile/energy/electrode + eprojectile = projectile + iconholder = 1 + reqpower = 200 + + if(/obj/item/weapon/gun/energy/lasercannon) + projectile = /obj/item/projectile/beam/heavylaser + eprojectile = projectile + iconholder = null + reqpower = 600 + + if(/obj/item/weapon/gun/energy/decloner) + projectile = /obj/item/projectile/energy/declone + eprojectile = projectile + iconholder = null + reqpower = 600 + + if(/obj/item/weapon/gun/energy/crossbow/largecrossbow) + projectile = /obj/item/projectile/energy/bolt/large + eprojectile = projectile + iconholder = null + reqpower = 125 + + if(/obj/item/weapon/gun/energy/crossbow) + projectile = /obj/item/projectile/energy/bolt + eprojectile = projectile + iconholder = null + reqpower = 50 + + if(/obj/item/weapon/gun/energy/laser) + projectile = /obj/item/projectile/beam + eprojectile = projectile + iconholder = null + reqpower = 500 + + else // Energy gun shots + projectile = /obj/item/projectile/energy/electrode// if it hasn't been emagged, it uses normal taser shots + eprojectile = /obj/item/projectile/beam//If it has, going to kill mode + iconholder = 1 + egun = 1 + reqpower = 200 + Del() // deletes its own cover with it del(cover) @@ -79,15 +192,16 @@ var/dat // The browse() text, similar to ED-209s and beepskies. - dat += text({" + if(!(src.lasercolor))//Lasertag turrets have less options + dat += text({" Automatic Portable Turret Installation

      Status: []
      Behaviour controls are [src.locked ? "locked" : "unlocked"]"}, "[src.on ? "On" : "Off"]" ) - if(!src.locked) - dat += text({"
      + if(!src.locked) + dat += text({"
      Check for Weapon Authorization: []
      Check Security Records: []
      Neutralize Identified Criminals: []
      @@ -99,6 +213,18 @@ Neutralize All Unidentified Life Signs: []
      "}, "[src.criminals ? "Yes" : "No"]", "[stun_all ? "Yes" : "No"]", "[check_anomalies ? "Yes" : "No"]" ) + else + if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + if(((src.lasercolor) == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag))) + return + if(((src.lasercolor) == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag))) + return + dat += text({" +Automatic Portable Turret Installation

      +Status: []
      "}, + +"[src.on ? "On" : "Off"]" ) user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") @@ -182,11 +308,6 @@ Neutralize All Unidentified Life Signs: []
      "}, if ((istype(W, /obj/item/weapon/card/emag)) && (!src.emagged)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return // Emagging the turret makes it go bonkers and stun everyone. It also makes // the turret shoot much, much faster. @@ -205,7 +326,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if(!anchored) anchored = 1 - invisibility = 2 + invisibility = INVISIBILITY_LEVEL_TWO icon_state = "[lasercolor]grey_target_prism" user << "You secure the exterior bolts on the turret." cover=new/obj/machinery/porta_turret_cover(src.loc) // create a new turret. While this is handled in process(), this is to workaround a bug where the turret becomes invisible for a split second @@ -256,11 +377,13 @@ Neutralize All Unidentified Life Signs: []
      "}, if((src.lasercolor == "b") && (src.disabled == 0)) if(istype(Proj, /obj/item/projectile/redtag)) src.disabled = 1 + del (Proj) sleep(100) src.disabled = 0 if((src.lasercolor == "r") && (src.disabled == 0)) if(istype(Proj, /obj/item/projectile/bluetag)) src.disabled = 1 + del (Proj) sleep(100) src.disabled = 0 return @@ -291,7 +414,7 @@ Neutralize All Unidentified Life Signs: []
      "}, src.health = 0 src.density = 0 src.stat |= BROKEN // enables the BROKEN bit - src.icon_state = "destroyed_target_prism" + src.icon_state = "[lasercolor]destroyed_target_prism" invisibility=0 src.spark_system.start() // creates some sparks because they look cool src.density=1 @@ -311,10 +434,12 @@ Neutralize All Unidentified Life Signs: []
      "}, src.cover = new /obj/machinery/porta_turret_cover(src.loc) // if the turret has no cover and is anchored, give it a cover src.cover.Parent_Turret = src // assign the cover its Parent_Turret, which would be this (src) + if(stat & (NOPOWER|BROKEN)) // if the turret has no power or is broken, make the turret pop down if it hasn't already popDown() return + if(!on) // if the turret is off, make it pop down popDown() @@ -323,12 +448,15 @@ Neutralize All Unidentified Life Signs: []
      "}, var/list/targets = list() // list of primary targets var/list/secondarytargets = list() // targets that are least important - if(src.check_anomalies) // if its set to check for xenos/carps, check for non-mob "crittersssss" - for (var/obj/effect/critter/L in view(12,src)) + if(src.check_anomalies) // if its set to check for xenos/carps, check for non-mob "crittersssss"(And simple_animals) + for (var/obj/effect/critter/L in view(7,src)) if(L.alive) targets += L + for(var/mob/living/simple_animal/C in view(7,src)) + if(!C.stat) + targets += C - for (var/mob/living/carbon/C in view(12,src)) // loops through all living carbon-based lifeforms in view(12) + for (var/mob/living/carbon/C in view(7,src)) // loops through all living carbon-based lifeforms in view(12) if(istype(C, /mob/living/carbon/alien) && src.check_anomalies) // git those fukken xenos if(!C.stat) // if it's dead/dying, there's no need to keep shooting at it. targets += C @@ -341,10 +469,10 @@ Neutralize All Unidentified Life Signs: []
      "}, continue // move onto next potential victim! var/dst = get_dist(src, C) // if it's too far away, why bother? - if (dst > 12) + if (dst > 7) continue - if(!istype(C, /mob/living/silicon) && ai) // If it's set to attack all nonsilicons, target them! + if(ai) // If it's set to attack all nonsilicons, target them! if(C.lying) if(lasercolor) continue @@ -359,7 +487,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if(src.assess_perp(C)<4) continue // if threat level < 4, keep going - else if (istype(C, /mob/living/carbon/monkey) || istype(C, /mob/living/silicon)) + else if (istype(C, /mob/living/carbon/monkey)) continue // Don't target monkeys or borgs/AIs you dumb shit if (C.lying) // if the perp is lying down, it's still a target but a less-important target @@ -401,6 +529,8 @@ Neutralize All Unidentified Life Signs: []
      "}, /obj/machinery/porta_turret/proc popUp() // pops the turret up + if(disabled) + return if(raising || raised) return if(stat & BROKEN) return invisibility=0 @@ -414,6 +544,8 @@ Neutralize All Unidentified Life Signs: []
      "}, layer=4 popDown() // pops the turret down + if(disabled) + return if(raising || !raised) return if(stat & BROKEN) return layer=3 @@ -440,7 +572,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if(auth_weapons) // check for weapon authorization if((isnull(perp:wear_id)) || (istype(perp:wear_id, /obj/item/weapon/card/id/syndicate))) - if((src.allowed(perp)) && (!lasercolor)) // if the perp has security access, return 0 + if((src.allowed(perp)) && !(src.lasercolor)) // if the perp has security access, return 0 return 0 if((istype(perp.l_hand, /obj/item/weapon/gun) && !istype(perp.l_hand, /obj/item/weapon/gun/projectile/shotgun)) || istype(perp.l_hand, /obj/item/weapon/melee/baton)) @@ -452,7 +584,8 @@ Neutralize All Unidentified Life Signs: []
      "}, if(istype(perp:belt, /obj/item/weapon/gun) || istype(perp:belt, /obj/item/weapon/melee/baton)) threatcount += 2 - if(src.lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve + if((src.lasercolor) == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve + threatcount = 0//But does not target anyone else if(istype(perp.wear_suit, /obj/item/clothing/suit/redtag)) threatcount += 4 if((istype(perp:r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(perp:l_hand,/obj/item/weapon/gun/energy/laser/redtag))) @@ -460,7 +593,8 @@ Neutralize All Unidentified Life Signs: []
      "}, if(istype(perp:belt, /obj/item/weapon/gun/energy/laser/redtag)) threatcount += 2 - if(src.lasercolor == "r") + if((src.lasercolor) == "r") + threatcount = 0 if(istype(perp.wear_suit, /obj/item/clothing/suit/bluetag)) threatcount += 4 if((istype(perp:r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(perp:l_hand,/obj/item/weapon/gun/energy/laser/bluetag))) @@ -488,6 +622,7 @@ Neutralize All Unidentified Life Signs: []
      "}, break + return threatcount @@ -495,6 +630,13 @@ Neutralize All Unidentified Life Signs: []
      "}, /obj/machinery/porta_turret/proc/shootAt(var/atom/movable/target) // shoots at a target + if(disabled) + return + + if(lasercolor && (istype(target,/mob/living/carbon/human))) + var/mob/living/carbon/human/H = target + if(H.lying) + return if(!emagged) // if it hasn't been emagged, it has to obey a cooldown rate if(last_fired || !raised) return // prevents rapid-fire shooting, unless it's been emagged @@ -514,115 +656,28 @@ Neutralize All Unidentified Life Signs: []
      "}, // any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power! - - if(!projectile) - lasercolor = "" - req_access = list(ACCESS_SECURITY) - if(!installation)// if for some reason the turret has no gun (ie, admin spawned) it resorts to basic taser shots - projectile = /obj/item/projectile/energy/electrode - reqpower = 200 - sound = 1 - iconholder = 1 - else - var/obj/item/weapon/gun/energy/E=new installation - // All energy-based weapons are applicable - if(istype(E, /obj/item/weapon/gun/energy/laser/bluetag)) - projectile = /obj/item/projectile/bluetag - iconholder = null - reqpower = 100 - lasercolor = "b" - req_access = list(ACCESS_MAINT_TUNNELS,ACCESS_CLOWN,ACCESS_MIME) - - else if(istype(E, /obj/item/weapon/gun/energy/laser/redtag)) - projectile = /obj/item/projectile/redtag - iconholder = null - reqpower = 100 - lasercolor = "r" - req_access = list(ACCESS_MAINT_TUNNELS,ACCESS_CLOWN,ACCESS_MIME) - - else if(istype(E, /obj/item/weapon/gun/energy/pulse_rifle)) - projectile = /obj/item/projectile/beam/pulse - iconholder = null - reqpower = 700 - - else if(istype(E, /obj/item/weapon/gun/energy/staff)) - projectile = /obj/item/projectile/change - iconholder = 1 - reqpower = 700 - - else if(istype(E, /obj/item/weapon/gun/energy/ionrifle)) - projectile = /obj/item/projectile/ion - iconholder = 1 - reqpower = 700 - - else if(istype(E, /obj/item/weapon/gun/energy/taser) || istype(E, /obj/item/weapon/gun/energy/stunrevolver)) - projectile = /obj/item/projectile/energy/electrode - iconholder = 1 - reqpower = 200 - - else if(istype(E, /obj/item/weapon/gun/energy/lasercannon)) - projectile = /obj/item/projectile/beam/heavylaser - iconholder = null - reqpower = 600 - - else if(istype(E, /obj/item/weapon/gun/energy/decloner)) - projectile = /obj/item/projectile/energy/declone - iconholder = null - reqpower = 600 - - else if(istype(E, /obj/item/weapon/gun/energy/crossbow/largecrossbow)) - projectile = /obj/item/projectile/energy/bolt/large - iconholder = null - reqpower = 125 - - else if(istype(E, /obj/item/weapon/gun/energy/crossbow)) - projectile = /obj/item/projectile/energy/bolt - iconholder = null - reqpower = 50 - - else if(istype(E, /obj/item/weapon/gun/energy/laser)) - projectile = /obj/item/projectile/beam - iconholder = null - reqpower = 500 - - else // Energy gun shots - projectile = /obj/item/projectile/energy/electrode// if it hasn't been emagged, it uses normal taser shots - iconholder = 1 - egun = 1 - reqpower = 200 - - var/obj/item/projectile/A = projectile - var/obj/item/weapon/gun/energy/E=new installation if(iconholder) icon_state = "[lasercolor]target_prism" else icon_state = "[lasercolor]orange_target_prism" if(sound) - playsound(src.loc, 'Taser.ogg', 75, 1) - A = new projectile( loc ) + playsound(src.loc, 'sound/weapons/Taser.ogg', 75, 1) + var/obj/item/projectile/A + if(emagged) + A = new eprojectile( loc ) + else + A = new projectile( loc ) A.original = target.loc if(!emagged) use_power(reqpower) else use_power((reqpower*2)) - if(egun)// if it has been emagged, use laser shots - projectile = /obj/item/projectile/beam - iconholder = null - reqpower = 500 - // Shooting Code: - - if(!E.silenced) - playsound(src.loc, E.fire_sound, 75, 1) - else - playsound(src.loc, E.fire_sound, 10, 1) - - del(E) A.current = T A.yo = U.y - T.y A.xo = U.x - T.x spawn( 1 ) - A.fired() + A.process() return @@ -637,7 +692,7 @@ Neutralize All Unidentified Life Signs: []
      "}, /obj/machinery/porta_turret_construct name = "turret frame" - icon = 'turrets.dmi' + icon = 'icons/obj/turrets.dmi' icon_state = "turret_frame" density=1 var/build_step = 0 // the current step in the building process @@ -653,14 +708,14 @@ Neutralize All Unidentified Life Signs: []
      "}, switch(build_step) if(0) // first step if(istype(W, /obj/item/weapon/wrench) && !anchored) - playsound(src.loc, 'Ratchet.ogg', 100, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user << "\blue You secure the external bolts." anchored = 1 build_step = 1 return else if(istype(W, /obj/item/weapon/crowbar) && !anchored) - playsound(src.loc, 'Crowbar.ogg', 75, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1) user << "You dismantle the turret construction." new /obj/item/stack/sheet/metal( loc, 5) del(src) @@ -678,7 +733,7 @@ Neutralize All Unidentified Life Signs: []
      "}, return else if(istype(W, /obj/item/weapon/wrench)) - playsound(src.loc, 'Ratchet.ogg', 75, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "You unfasten the external bolts." anchored = 0 build_step = 0 @@ -687,7 +742,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if(2) if(istype(W, /obj/item/weapon/wrench)) - playsound(src.loc, 'Ratchet.ogg', 100, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user << "\blue You bolt the metal armor into place." build_step = 3 return @@ -699,7 +754,7 @@ Neutralize All Unidentified Life Signs: []
      "}, user << "\red You need more fuel to complete this task." return - playsound(src.loc, pick('Welder.ogg', 'Welder2.ogg'), 50, 1) + playsound(src.loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1) if(do_after(user, 20)) if(!src || !WT.remove_fuel(5, user)) return build_step = 1 @@ -720,7 +775,7 @@ Neutralize All Unidentified Life Signs: []
      "}, return else if(istype(W, /obj/item/weapon/wrench)) - playsound(src.loc, 'Ratchet.ogg', 100, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user << "You remove the turret's metal armor bolts." build_step = 2 return @@ -736,7 +791,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if(5) if(istype(W, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) build_step = 6 user << "\blue You close the internal access hatch." return @@ -754,7 +809,7 @@ Neutralize All Unidentified Life Signs: []
      "}, return else if(istype(W, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) build_step = 5 user << "You open the internal access hatch." return @@ -766,7 +821,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if (WT.get_fuel() < 5) user << "\red You need more fuel to complete this task." - playsound(src.loc, pick('Welder.ogg', 'Welder2.ogg'), 50, 1) + playsound(src.loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1) if(do_after(user, 30)) if(!src || !WT.remove_fuel(5, user)) return build_step = 8 @@ -778,13 +833,14 @@ Neutralize All Unidentified Life Signs: []
      "}, Turret.installation = src.installation Turret.gun_charge = src.gun_charge - Turret.cover=new/obj/machinery/porta_turret_cover(src.loc) - Turret.cover.Parent_Turret=Turret - Turret.cover.name = finish_name +// Turret.cover=new/obj/machinery/porta_turret_cover(src.loc) +// Turret.cover.Parent_Turret=Turret +// Turret.cover.name = finish_name + Turret.New() del(src) else if(istype(W, /obj/item/weapon/crowbar)) - playsound(src.loc, 'Crowbar.ogg', 75, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1) user << "You pry off the turret's exterior armor." new /obj/item/stack/sheet/metal( loc, 2) build_step = 6 @@ -792,7 +848,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if (istype(W, /obj/item/weapon/pen)) // you can rename turrets like bots! var/t = input(user, "Enter new turret name", src.name, src.finish_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) @@ -835,7 +891,7 @@ Neutralize All Unidentified Life Signs: []
      "}, /obj/machinery/porta_turret_cover name = "turret" - icon = 'turrets.dmi' + icon = 'icons/obj/turrets.dmi' icon_state = "turretCover" anchored = 1 layer = 3.5 @@ -851,8 +907,8 @@ Neutralize All Unidentified Life Signs: []
      "}, if (.) return var/dat - - dat += text({" + if(!(Parent_Turret.lasercolor)) + dat += text({" Automatic Portable Turret Installation

      Status: []
      Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"}, @@ -860,38 +916,6 @@ Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"}, "[Parent_Turret.on ? "On" : "Off"]" ) - dat += text({"
      -Check for Weapon Authorization: []
      -Check Security Records: []
      -Neutralize Identified Criminals: []
      -Neutralize All Non-Security and Non-Command Personnel: []
      -Neutralize All Unidentified Life Signs: []
      "}, - -"[Parent_Turret.auth_weapons ? "Yes" : "No"]", -"[Parent_Turret.check_records ? "Yes" : "No"]", -"[Parent_Turret.criminals ? "Yes" : "No"]", -"[Parent_Turret.stun_all ? "Yes" : "No"]" , -"[Parent_Turret.check_anomalies ? "Yes" : "No"]" ) - - - user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") - onclose(user, "autosec") - return - -/obj/machinery/porta_turret_cover/attack_hand(mob/user as mob) - . = ..() - if (.) - return - var/dat - - dat += text({" -Automatic Portable Turret Installation

      -Status: []
      -Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"}, - -"[Parent_Turret.on ? "On" : "Off"]" ) - - if(!Parent_Turret.locked) dat += text({"
      Check for Weapon Authorization: []
      Check Security Records: []
      @@ -904,6 +928,56 @@ Neutralize All Unidentified Life Signs: []
      "}, "[Parent_Turret.criminals ? "Yes" : "No"]", "[Parent_Turret.stun_all ? "Yes" : "No"]" , "[Parent_Turret.check_anomalies ? "Yes" : "No"]" ) + else + dat += text({" +Automatic Portable Turret Installation

      +Status: []
      "}, + +"[Parent_Turret.on ? "On" : "Off"]" ) + + user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") + onclose(user, "autosec") + return + +/obj/machinery/porta_turret_cover/attack_hand(mob/user as mob) + . = ..() + if (.) + return + var/dat + if(!(Parent_Turret.lasercolor)) + dat += text({" +Automatic Portable Turret Installation

      +Status: []
      +Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"}, + +"[Parent_Turret.on ? "On" : "Off"]" ) + + if(!Parent_Turret.locked) + dat += text({"
      +Check for Weapon Authorization: []
      +Check Security Records: []
      +Neutralize Identified Criminals: []
      +Neutralize All Non-Security and Non-Command Personnel: []
      +Neutralize All Unidentified Life Signs: []
      "}, + +"[Parent_Turret.auth_weapons ? "Yes" : "No"]", +"[Parent_Turret.check_records ? "Yes" : "No"]", +"[Parent_Turret.criminals ? "Yes" : "No"]", +"[Parent_Turret.stun_all ? "Yes" : "No"]" , +"[Parent_Turret.check_anomalies ? "Yes" : "No"]" ) + else + if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + if(((Parent_Turret.lasercolor) == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag))) + return + if(((Parent_Turret.lasercolor) == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag))) + return + dat += text({" +Automatic Portable Turret Installation

      +Status: []
      "}, + +"[Parent_Turret.on ? "On" : "Off"]" ) + user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") @@ -947,11 +1021,6 @@ Neutralize All Unidentified Life Signs: []
      "}, /obj/machinery/porta_turret_cover/attackby(obj/item/W as obj, mob/user as mob) if ((istype(W, /obj/item/weapon/card/emag)) && (!Parent_Turret.emagged)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return user << "\red You short out [Parent_Turret]'s threat assessment circuits." spawn(0) for(var/mob/O in hearers(Parent_Turret, null)) @@ -966,7 +1035,7 @@ Neutralize All Unidentified Life Signs: []
      "}, if(!Parent_Turret.anchored) Parent_Turret.anchored = 1 - Parent_Turret.invisibility = 2 + Parent_Turret.invisibility = INVISIBILITY_LEVEL_TWO Parent_Turret.icon_state = "grey_target_prism" user << "You secure the exterior bolts on the turret." else diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 7d1d6a7dd7..2ab4e54f78 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -2,7 +2,7 @@ obj/machinery/recharger name = "recharger" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "recharger0" anchored = 1 use_power = 1 @@ -11,18 +11,19 @@ obj/machinery/recharger var/obj/item/weapon/charging = null obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) - if(issilicon(user)) - return - if(istype(G, /obj/item/weapon/gun/energy) || istype(G, /obj/item/weapon/melee/baton)) if(charging) return + + // Checks to make sure he's not in space doing it, and that the area got proper power. var/area/a = get_area(src) if(!isarea(a)) - return - if(a.power_equip == 0) // There's no APC in this area, don't try to cheat power! user << "\red The [name] blinks red as you try to insert the item!" return + if(a.power_equip == 0) + user << "\red The [name] blinks red as you try to insert the item!" + return + if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow)) user << "Your gun's recharge port was removed to make room for a miniaturized reactor." return @@ -39,7 +40,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) return anchored = !anchored user << "You [anchored ? "attached" : "detached"] the recharger." - playsound(loc, 'Ratchet.ogg', 75, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 75, 1) obj/machinery/recharger/attack_hand(mob/user as mob) add_fingerprint(user) @@ -52,8 +53,7 @@ obj/machinery/recharger/attack_hand(mob/user as mob) update_icon() obj/machinery/recharger/attack_paw(mob/user as mob) - if((ticker && ticker.mode.name == "monkey")) - return attack_hand(user) + return attack_hand(user) obj/machinery/recharger/process() if(stat & (NOPOWER|BROKEN) || !anchored) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index ca7d1dbb66..95d0f342e8 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -1,6 +1,6 @@ /obj/machinery/recharge_station - name = "Cyborg Recharging Station" - icon = 'objects.dmi' + name = "cyborg recharging station" + icon = 'icons/obj/objects.dmi' icon_state = "borgcharger0" density = 1 anchored = 1.0 @@ -55,7 +55,7 @@ R.cell.charge = R.cell.maxcharge return else - R.cell.charge += 200 + R.cell.charge = min(R.cell.charge + 200, R.cell.maxcharge) return go_out() @@ -102,20 +102,34 @@ //Service if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme)) if(O.reagents.get_reagent_amount("enzyme") < 50) - O.reagents.add_reagent("enzyme", 1) + O.reagents.add_reagent("enzyme", 2) //Medical if(istype(O,/obj/item/weapon/reagent_containers/glass/bottle/robot)) var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume)) B.reagents.add_reagent(B.reagent, 2) + //Janitor + if(istype(O, /obj/item/device/lightreplacer)) + var/obj/item/device/lightreplacer/LR = O + LR.Charge(R) if(R) if(R.module) R.module.respawn_consumable(R) + //Emagged items for janitor and medical borg + if(R.module.emag) + if(istype(R.module.emag, /obj/item/weapon/reagent_containers/spray)) + var/obj/item/weapon/reagent_containers/spray/S = R.module.emag + if(S.name == "Polyacid spray") + S.reagents.add_reagent("pacid", 2) + else if(S.name == "Lube spray") + S.reagents.add_reagent("lube", 2) + verb move_eject() + set category = "Object" set src in oview(1) if (usr.stat != 0) return @@ -124,6 +138,7 @@ return move_inside() + set category = "Object" set src in oview(1) if (usr.stat == 2) //Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO @@ -138,7 +153,7 @@ usr<<"\blue Without a powercell, you can't be recharged." //Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO return - usr.pulling = null + usr.stop_pulling() if(usr && usr.client) usr.client.perspective = EYE_PERSPECTIVE usr.client.eye = src diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 75be0a2e66..84c6d917e8 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -10,7 +10,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() name = "Requests Console" desc = "A console intended to send requests to diferent departments on the station." anchored = 1 - icon = 'terminals.dmi' + icon = 'icons/obj/terminals.dmi' icon_state = "req_comp0" var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department var/list/messages = list() //List of all messages @@ -191,7 +191,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() else dat += text("Speaker ON") - user << browse("[dat]", "") + user << browse("[dat]", "window=request_console") onclose(user, "req_console") return @@ -248,46 +248,55 @@ var/list/obj/machinery/requests_console/allConsoles = list() sending += "
      " screen = 7 //if it's successful, this will get overrwritten (7 = unsufccessfull, 6 = successfull) if (sending) + var/pass = 0 for (var/obj/machinery/message_server/MS in world) + if(!MS.active) continue MS.send_rc_message(href_list["department"],department,log_msg,msgStamped,msgVerified,priority) + pass = 1 - for (var/obj/machinery/requests_console/Console in allConsoles) - if (ckey(Console.department) == ckey(href_list["department"])) + if(pass) - switch(priority) - if("2") //High priority - if(Console.newmessagepriority < 2) - Console.newmessagepriority = 2 - Console.icon_state = "req_comp2" - if(!Console.silent) - playsound(Console.loc, 'twobeep.ogg', 50, 1) - for (var/mob/O in hearers(5, Console.loc)) - O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [department]'")) - Console.messages += "High Priority message from [department]
      [sending]" + for (var/obj/machinery/requests_console/Console in allConsoles) + if (ckey(Console.department) == ckey(href_list["department"])) - // if("3") //Not implemanted, but will be //Removed as it doesn't look like anybody intends on implimenting it ~Carn - // if(Console.newmessagepriority < 3) - // Console.newmessagepriority = 3 - // Console.icon_state = "req_comp3" - // if(!Console.silent) - // playsound(Console.loc, 'twobeep.ogg', 50, 1) - // for (var/mob/O in hearers(7, Console.loc)) - // O.show_message(text("\icon[Console] *The Requests Console yells: 'EXTREME PRIORITY alert in [department]'")) - // Console.messages += "Extreme Priority message from [ckey(department)]
      [message]" + switch(priority) + if("2") //High priority + if(Console.newmessagepriority < 2) + Console.newmessagepriority = 2 + Console.icon_state = "req_comp2" + if(!Console.silent) + playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(5, Console.loc)) + O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [department]'")) + Console.messages += "High Priority message from [department]
      [sending]" - else // Normal priority - if(Console.newmessagepriority < 1) - Console.newmessagepriority = 1 - Console.icon_state = "req_comp1" - if(!Console.silent) - playsound(Console.loc, 'twobeep.ogg', 50, 1) - for (var/mob/O in hearers(4, Console.loc)) - O.show_message(text("\icon[Console] *The Requests Console beeps: 'Message from [department]'")) - Console.messages += "Message from [department]
      [message]" + // if("3") //Not implemanted, but will be //Removed as it doesn't look like anybody intends on implimenting it ~Carn + // if(Console.newmessagepriority < 3) + // Console.newmessagepriority = 3 + // Console.icon_state = "req_comp3" + // if(!Console.silent) + // playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1) + // for (var/mob/O in hearers(7, Console.loc)) + // O.show_message(text("\icon[Console] *The Requests Console yells: 'EXTREME PRIORITY alert in [department]'")) + // Console.messages += "Extreme Priority message from [ckey(department)]
      [message]" + + else // Normal priority + if(Console.newmessagepriority < 1) + Console.newmessagepriority = 1 + Console.icon_state = "req_comp1" + if(!Console.silent) + playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(4, Console.loc)) + O.show_message(text("\icon[Console] *The Requests Console beeps: 'Message from [department]'")) + Console.messages += "Message from [department]
      [message]" + + screen = 6 + Console.luminosity = 2 + messages += "Message sent to [dpt]
      [message]" + else + for (var/mob/O in hearers(4, src.loc)) + O.show_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'")) - screen = 6 - Console.luminosity = 2 - messages += "Message sent to [dpt]
      [message]" //Handle screen switching switch(text2num(href_list["setScreen"])) @@ -361,7 +370,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() updateUsrDialog() if(screen == 10) var/obj/item/weapon/card/id/ID = O - if (ACCESS_RC_ANNOUNCE in ID.access) + if (access_RC_announce in ID.access) announceAuth = 1 else announceAuth = 0 diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index 4e0930476f..d2a1f9f863 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -1,6 +1,6 @@ /obj/machinery/robotic_fabricator name = "Robotic Fabricator" - icon = 'robotics.dmi' + icon = 'icons/obj/robotics.dmi' icon_state = "fab-idle" density = 1 anchored = 1 @@ -40,10 +40,6 @@ else stat |= NOPOWER -/obj/machinery/robotic_fabricator/process() - if (stat & (NOPOWER | BROKEN)) - return - /obj/machinery/robotic_fabricator/attack_paw(user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index 1dfef9194d..513270ca65 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -1,7 +1,7 @@ /obj/machinery/seed_extractor name = "Seed Extractor" desc = "Extracts seeds from produce" - icon = 'hydroponics.dmi' + icon = 'icons/obj/hydroponics.dmi' icon_state = "sextractor" density = 1 anchored = 1 diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 8502dc5a1f..db627eaef2 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -1,137 +1,220 @@ +/obj/machinery/shield + name = "Emergency energy shield" + desc = "An energy shield used to contain hull breaches." + icon = 'icons/effects/effects.dmi' + icon_state = "shield-old" + density = 1 + opacity = 0 + anchored = 1 + unacidable = 1 + var/const/max_health = 200 + var/health = max_health //The shield can only take so much beating (prevents perma-prisons) + +/obj/machinery/shield/New() + src.dir = pick(1,2,3,4) + ..() + update_nearby_tiles(need_rebuild=1) + +/obj/machinery/shield/Del() + opacity = 0 + density = 0 + update_nearby_tiles() + ..() + +/obj/machinery/shield/CanPass(atom/movable/mover, turf/target, height, air_group) + if(!height || air_group) return 0 + else return ..() + +//Looks like copy/pasted code... I doubt 'need_rebuild' is even used here - Nodrak +/obj/machinery/shield/proc/update_nearby_tiles(need_rebuild) + if(!air_master) return 0 + + var/turf/simulated/source = get_turf(src) + var/turf/simulated/north = get_step(source,NORTH) + var/turf/simulated/south = get_step(source,SOUTH) + var/turf/simulated/east = get_step(source,EAST) + var/turf/simulated/west = get_step(source,WEST) + + if(istype(source)) air_master.tiles_to_update |= source + if(istype(north)) air_master.tiles_to_update |= north + if(istype(south)) air_master.tiles_to_update |= south + if(istype(east)) air_master.tiles_to_update |= east + if(istype(west)) air_master.tiles_to_update |= west + + return 1 + + +/obj/machinery/shield/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(!istype(W)) return + + //Calculate damage + var/aforce = W.force + if(W.damtype == BRUTE || W.damtype == BURN) + src.health -= aforce + + //Play a fitting sound + playsound(src.loc, 'sound/effects/EMPulse.ogg', 75, 1) + + + if (src.health <= 0) + for(var/mob/O in viewers(src, null)) + O.show_message("\blue The [src] dissapates") + del(src) + return + + opacity = 1 + spawn(20) if(src) opacity = 0 + + ..() + +/obj/machinery/shield/meteorhit() + src.health -= max_health*0.75 //3/4 health as damage + + if(src.health <= 0) + for(var/mob/O in viewers(src, null)) + O.show_message("\blue The [src] dissapates") + del(src) + return + + opacity = 1 + spawn(20) if(src) opacity = 0 + return + +/obj/machinery/shield/bullet_act(var/obj/item/projectile/Proj) + health -= Proj.damage + ..() + if(health <=0) + for(var/mob/O in viewers(src, null)) + O.show_message("\blue The [src] dissapates") + del(src) + return + opacity = 1 + spawn(20) if(src) opacity = 0 + +/obj/machinery/shield/ex_act(severity) + switch(severity) + if(1.0) + if (prob(75)) + del(src) + if(2.0) + if (prob(50)) + del(src) + if(3.0) + if (prob(25)) + del(src) + return + +/obj/machinery/shield/emp_act(severity) + switch(severity) + if(1) + del(src) + if(2) + if(prob(50)) + del(src) + +/obj/machinery/shield/blob_act() + del(src) + + +/obj/machinery/shield/hitby(AM as mob|obj) + //Let everyone know we've been hit! + for(var/mob/O in viewers(src, null)) + O.show_message("\red [src] was hit by [AM].", 1) + + //Super realistic, resource-intensive, real-time damage calculations. + var/tforce = 0 + if(ismob(AM)) + tforce = 40 + else + tforce = AM:throwforce + + src.health -= tforce + + //This seemed to be the best sound for hitting a force field. + playsound(src.loc, 'sound/effects/EMPulse.ogg', 100, 1) + + //Handle the destruction of the shield + if (src.health <= 0) + for(var/mob/O in viewers(src, null)) + O.show_message("\blue The [src] dissapates") + del(src) + return + + //The shield becomes dense to absorb the blow.. purely asthetic. + opacity = 1 + spawn(20) if(src) opacity = 0 + + ..() + return + + + /obj/machinery/shieldgen - name = "Shield generator" + name = "Emergency shield projector" desc = "Used to seal minor hull breaches." - icon = 'objects.dmi' + icon = 'icons/obj/objects.dmi' icon_state = "shieldoff" - var/active = 0 - var/health = 100 - var/malfunction = 0 density = 1 opacity = 0 anchored = 0 pressure_resistance = 2*ONE_ATMOSPHERE - -#define maxstoredpower 500 -/obj/machinery/shieldwallgen - name = "Shield Generator" - desc = "A shield generator." - icon = 'stationobjs.dmi' - icon_state = "Shield_Gen" - anchored = 0 - density = 1 - req_access = list(ACCESS_SECURITY) + req_access = list(access_engine) + var/const/max_health = 100 + var/health = max_health var/active = 0 - var/power = 0 - var/state = 0 - var/steps = 0 - var/last_check = 0 - var/check_delay = 10 - var/recalc = 0 - var/locked = 1 - var/destroyed = 0 - var/directwired = 1 -// var/maxshieldload = 200 - var/obj/structure/cable/attached // the attached cable - var/storedpower = 0 - flags = FPRINT | CONDUCT - use_power = 0 - -/obj/machinery/shield - name = "shield" - desc = "An energy shield." - icon = 'effects.dmi' - icon_state = "shieldsparkles" - density = 1 - opacity = 1 - anchored = 1 - unacidable = 1 - -/obj/machinery/shieldwall - name = "Shield" - desc = "An energy shield." - icon = 'effects.dmi' - icon_state = "shieldwall" - anchored = 1 - density = 1 - unacidable = 1 - var/needs_power = 0 - var/active = 1 -// var/power = 10 - var/delay = 5 - var/last_active - var/mob/U - var/obj/machinery/shieldwallgen/gen_primary - var/obj/machinery/shieldwallgen/gen_secondary - + var/malfunction = 0 //Malfunction causes parts of the shield to slowly dissapate + var/list/deployed_shields = list() + var/is_open = 0 //Whether or not the wires are exposed + var/locked = 0 /obj/machinery/shieldgen/Del() for(var/obj/machinery/shield/shield_tile in deployed_shields) del(shield_tile) - ..() -/obj/machinery/shieldgen/var/list/obj/machinery/shield/deployed_shields -/obj/machinery/shieldgen/proc - shields_up() - if(active) return 0 +/obj/machinery/shieldgen/proc/shields_up() + if(active) return 0 //If it's already turned on, how did this get called? - for(var/turf/target_tile in range(2, src)) - if (istype(target_tile,/turf/space) && !(locate(/obj/machinery/shield) in target_tile)) - if (malfunction && prob(33) || !malfunction) - deployed_shields += new /obj/machinery/shield(target_tile) + src.active = 1 + update_icon() - src.anchored = 1 - src.active = 1 - src.icon_state = malfunction ? "shieldonbr":"shieldon" + for(var/turf/target_tile in range(2, src)) + if (istype(target_tile,/turf/space) && !(locate(/obj/machinery/shield) in target_tile)) + if (malfunction && prob(33) || !malfunction) + deployed_shields += new /obj/machinery/shield(target_tile) - spawn src.process() +/obj/machinery/shieldgen/proc/shields_down() + if(!active) return 0 //If it's already off, how did this get called? - shields_down() - if(!active) return 0 + src.active = 0 + update_icon() - for(var/obj/machinery/shield/shield_tile in deployed_shields) - del(shield_tile) - - src.anchored = 0 - src.active = 0 - src.icon_state = malfunction ? "shieldoffbr":"shieldoff" + for(var/obj/machinery/shield/shield_tile in deployed_shields) + del(shield_tile) /obj/machinery/shieldgen/process() - if(active) - src.icon_state = malfunction ? "shieldonbr":"shieldon" + if(malfunction && active) + if(deployed_shields.len && prob(5)) + del(pick(deployed_shields)) - if(malfunction) - while(prob(10)) - del(pick(deployed_shields)) - - spawn(30) - src.process() return /obj/machinery/shieldgen/proc/checkhp() if(health <= 30) src.malfunction = 1 - if(health <= 10 && prob(75)) + if(health <= 0) del(src) - if (active) - src.icon_state = malfunction ? "shieldonbr":"shieldon" - else - src.icon_state = malfunction ? "shieldoffbr":"shieldoff" + update_icon() return /obj/machinery/shieldgen/meteorhit(obj/O as obj) - src.health -= 25 + src.health -= max_health*0.25 //A quarter of the machine's health if (prob(5)) src.malfunction = 1 src.checkhp() return -/obj/machinery/shield/meteorhit(obj/O as obj) - if (prob(75)) - del(src) - return - /obj/machinery/shieldgen/ex_act(severity) switch(severity) if(1.0) @@ -147,32 +230,128 @@ src.checkhp() return -/obj/machinery/shield/ex_act(severity) +/obj/machinery/shieldgen/emp_act(severity) switch(severity) - if(1.0) - if (prob(75)) - del(src) - if(2.0) - if (prob(50)) - del(src) - if(3.0) - if (prob(25)) - del(src) - return + if(1) + src.health /= 2 //cut health in half + malfunction = 1 + locked = pick(0,1) + if(2) + if(prob(50)) + src.health *= 0.3 //chop off a third of the health + malfunction = 1 + checkhp() /obj/machinery/shieldgen/attack_hand(mob/user as mob) + if(locked) + user << "The machine is locked, you are unable to use it." + return + if(is_open) + user << "The panel must be closed before operating this machine." + return + if (src.active) user.visible_message("\blue \icon[src] [user] deactivated the shield generator.", \ "\blue \icon[src] You deactivate the shield generator.", \ "You hear heavy droning fade out.") src.shields_down() else - user.visible_message("\blue \icon[src] [user] activated the shield generator.", \ - "\blue \icon[src] You activate the shield generator.", \ - "You hear heavy droning.") - src.shields_up() + if(anchored) + user.visible_message("\blue \icon[src] [user] activated the shield generator.", \ + "\blue \icon[src] You activate the shield generator.", \ + "You hear heavy droning.") + src.shields_up() + else + user << "The device must first be secured to the floor." + return + +/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/card/emag)) + malfunction = 1 + update_icon() + + else if(istype(W, /obj/item/weapon/screwdriver)) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) + if(is_open) + user << "\blue You close the panel." + is_open = 0 + else + user << "\blue You open the panel and expose the wiring." + is_open = 1 + + else if(istype(W, /obj/item/weapon/cable_coil) && malfunction && is_open) + var/obj/item/weapon/cable_coil/coil = W + user << "\blue You begin to replace the wires." + //if(do_after(user, min(60, round( ((maxhealth/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage + if(do_after(user, 30)) + if(!src || !coil) return + coil.use(1) + health = max_health + malfunction = 0 + user << "\blue You repair the [src]!" + update_icon() + + else if(istype(W, /obj/item/weapon/wrench)) + if(locked) + user << "The bolts are covered, unlocking this would retract the covers." + return + if(anchored) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) + user << "\blue You unsecure the [src] from the floor!" + if(active) + user << "\blue The [src] shuts off!" + src.shields_down() + anchored = 0 + else + if(istype(get_turf(src), /turf/space)) return //No wrenching these in space! + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) + user << "\blue You secure the [src] to the floor!" + anchored = 1 + + + else if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda)) + if(src.allowed(user)) + src.locked = !src.locked + user << "The controls are now [src.locked ? "locked." : "unlocked."]" + else + user << "\red Access denied." + + else + ..() + + +/obj/machinery/shieldgen/update_icon() + if(active) + src.icon_state = malfunction ? "shieldonbr":"shieldon" + else + src.icon_state = malfunction ? "shieldoffbr":"shieldoff" + return ////FIELD GEN START //shameless copypasta from fieldgen, powersink, and grille +#define maxstoredpower 500 +/obj/machinery/shieldwallgen + name = "Shield Generator" + desc = "A shield generator." + icon = 'icons/obj/stationobjs.dmi' + icon_state = "Shield_Gen" + anchored = 0 + density = 1 + req_access = list(access_security) + var/active = 0 + var/power = 0 + var/state = 0 + var/steps = 0 + var/last_check = 0 + var/check_delay = 10 + var/recalc = 0 + var/locked = 1 + var/destroyed = 0 + var/directwired = 1 +// var/maxshieldload = 200 + var/obj/structure/cable/attached // the attached cable + var/storedpower = 0 + flags = FPRINT | CONDUCT + use_power = 0 /obj/machinery/shieldwallgen/proc/power() if(!anchored) @@ -325,14 +504,14 @@ else if(state == 0) state = 1 - playsound(src.loc, 'Ratchet.ogg', 75, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "You secure the external reinforcing bolts to the floor." src.anchored = 1 return else if(state == 1) state = 0 - playsound(src.loc, 'Ratchet.ogg', 75, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "You undo the external reinforcing bolts." src.anchored = 0 return @@ -382,43 +561,23 @@ return -/obj/machinery/shield - New() - src.dir = pick(1,2,3,4) - - ..() - - update_nearby_tiles(need_rebuild=1) - - Del() - update_nearby_tiles() - - ..() - - CanPass(atom/movable/mover, turf/target, height, air_group) - if(!height || air_group) return 0 - else return ..() - - proc/update_nearby_tiles(need_rebuild) - if(!air_master) return 0 - - var/turf/simulated/source = loc - var/turf/simulated/north = get_step(source,NORTH) - var/turf/simulated/south = get_step(source,SOUTH) - var/turf/simulated/east = get_step(source,EAST) - var/turf/simulated/west = get_step(source,WEST) - - if(istype(source)) air_master.tiles_to_update += source - if(istype(north)) air_master.tiles_to_update += north - if(istype(south)) air_master.tiles_to_update += south - if(istype(east)) air_master.tiles_to_update += east - if(istype(west)) air_master.tiles_to_update += west - - return 1 - - //////////////Contaiment Field START - +/obj/machinery/shieldwall + name = "Shield" + desc = "An energy shield." + icon = 'icons/effects/effects.dmi' + icon_state = "shieldwall" + anchored = 1 + density = 1 + unacidable = 1 + var/needs_power = 0 + var/active = 1 +// var/power = 10 + var/delay = 5 + var/last_active + var/mob/U + var/obj/machinery/shieldwallgen/gen_primary + var/obj/machinery/shieldwallgen/gen_secondary /obj/machinery/shieldwall/New(var/obj/machinery/shieldwallgen/A, var/obj/machinery/shieldwallgen/B) ..() @@ -427,18 +586,7 @@ if(A && B) needs_power = 1 spawn(1) - src.ul_SetLuminosity(0,0,4) - -/* for(var/mob/M as mob in src.loc) //does not work for some reason. - if(istype(M,/mob/living/carbon)) - M.adjustBruteLoss(100) - M.updatehealth() - M << "\red You feel as the very atoms of your body divide!" - else - M.adjustBruteLoss(50) - M.updatehealth() - M << "\red Strong energy field detected. Damage from field dampened." -*/ + src.sd_SetLuminosity(3) /obj/machinery/shieldwall/attack_hand(mob/user as mob) return @@ -475,10 +623,10 @@ /obj/machinery/shieldwall/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && mover.pass_flags&PASSGLASS) + if(istype(mover) && mover.checkpass(PASSGLASS)) return prob(20) else if (istype(mover, /obj/item/projectile)) return prob(10) else - return !src.density + return !src.density \ No newline at end of file diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 27436096cf..ae65c20f5a 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -1,7 +1,7 @@ /obj/machinery/space_heater anchored = 0 density = 1 - icon = 'atmos.dmi' + icon = 'icons/obj/atmos.dmi' icon_state = "sheater0" name = "space heater" desc = "Made by Space Amish using traditional space techniques, this heater is guaranteed not to set the station on fire." @@ -52,7 +52,7 @@ return else // insert cell - var/obj/item/weapon/cell/C = usr.equipped() + var/obj/item/weapon/cell/C = usr.get_active_hand() if(istype(C)) user.drop_item() cell = C @@ -123,24 +123,17 @@ set_temperature = dd_range(20, 90, set_temperature + value) if("cellremove") - if(open && cell && !usr.equipped()) - cell.loc = usr - cell.layer = 20 - if(usr.hand) - usr.l_hand = cell - else - usr.r_hand = cell - - cell.add_fingerprint(usr) + if(open && cell && !usr.get_active_hand()) cell.updateicon() + usr.put_in_hands(cell) + cell.add_fingerprint(usr) cell = null - usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].") if("cellinstall") if(open && !cell) - var/obj/item/weapon/cell/C = usr.equipped() + var/obj/item/weapon/cell/C = usr.get_active_hand() if(istype(C)) usr.drop_item() cell = C @@ -166,7 +159,7 @@ var/datum/gas_mixture/env = L.return_air() if(env.temperature < (set_temperature+T0C)) - var/transfer_moles = 0.25 * env.total_moles + var/transfer_moles = 0.25 * env.total_moles() var/datum/gas_mixture/removed = env.remove(transfer_moles) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 2583c9db45..74e83930d6 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -6,14 +6,14 @@ // And arbitrary messages set by comms computer /obj/machinery/status_display - icon = 'status_display.dmi' + icon = 'icons/obj/status_display.dmi' icon_state = "frame" name = "status display" anchored = 1 density = 0 use_power = 1 idle_power_usage = 10 - var/mode = 0 // 0 = Blank + var/mode = 1 // 0 = Blank // 1 = Shuttle timer // 2 = Arbitrary message(s) // 3 = alert picture @@ -52,34 +52,6 @@ update() - examine() - ..() - var/msg - switch(mode) - if(0) - msg = "The screen is blank." - if(1) - var/time = get_shuttle_timer() - dd_replacetext(time, "~", ":") - if(time) - msg = "The escape shuttle countdown reads: [time]" - if(2) - if(message1 && message2) - msg = "The screen states the two following messages: [message1] , [message2]" - else if(message1) - msg = "The screen states the following message. [message1]" - else if(message2) - msg = "The screen states the following message. [message2]" - if(3) - msg = src - - if(4) - var/time = get_supply_shuttle_timer() - if(time) - msg = "The screen states the time until the supply shuttle arrival. \n Time remaining: [time]" - usr << msg - return - // set what is displayed @@ -183,7 +155,7 @@ proc/set_picture(var/state) picture_state = state overlays = null - overlays += image('status_display.dmi', icon_state=picture_state) + overlays += image('icons/obj/status_display.dmi', icon_state=picture_state) proc/update_display(var/line1, var/line2) @@ -226,7 +198,7 @@ // valid characters are 0-9 and : // px, py are pixel offsets proc/texticon(var/tn, var/px = 0, var/py = 0) - var/image/I = image('status_display.dmi', "blank") + var/image/I = image('icons/obj/status_display.dmi', "blank") var/len = lentext(tn) @@ -239,7 +211,7 @@ if(char == " ") continue - var/image/ID = image('status_display.dmi', icon_state=char) + var/image/ID = image('icons/obj/status_display.dmi', icon_state=char) ID.pixel_x = -(d-1)*5 + px ID.pixel_y = py @@ -277,7 +249,7 @@ /obj/machinery/ai_status_display - icon = 'status_display.dmi' + icon = 'icons/obj/status_display.dmi' icon_state = "frame" name = "AI display" anchored = 1 @@ -344,4 +316,4 @@ proc/set_picture(var/state) picture_state = state overlays = null - overlays += image('status_display.dmi', icon_state=picture_state) + overlays += image('icons/obj/status_display.dmi', icon_state=picture_state) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 9af28ec2d4..3f0070a955 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -6,7 +6,7 @@ /obj/machinery/suit_storage_unit name = "Suit Storage Unit" desc = "An industrial U-Stor-It Storage unit designed to accomodate all kinds of space suits. Its on-board equipment also allows the user to decontaminate the contents through a UV-ray purging cycle. There's a warning label dangling from the control pad, reading \"STRICTLY NO BIOLOGICALS IN THE CONFINES OF THE UNIT\"." - icon = 'suitstorage.dmi' + icon = 'icons/obj/suitstorage.dmi' icon_state = "suitstorage000000100" //order is: [has helmet][has suit][has human][is open][is locked][is UV cycling][is powered][is dirty/broken] [is superUVcycling] anchored = 1 density = 1 @@ -35,14 +35,6 @@ HELMET_TYPE = /obj/item/clothing/head/helmet/space MASK_TYPE = /obj/item/clothing/mask/breath -/obj/machinery/suit_storage_unit/captain_unit - name = "Captain's Suit Storage Unit" - SUIT_TYPE = /obj/item/clothing/suit/armor/captain - HELMET_TYPE = /obj/item/clothing/head/helmet/space/capspace - MASK_TYPE = /obj/item/clothing/mask/breath - req_access = list(ACCESS_CAPTAIN) - islocked = 1 // otherwise anyone can grab it - /obj/machinery/suit_storage_unit/New() src.update_icon() @@ -308,9 +300,6 @@ /obj/machinery/suit_storage_unit/proc/toggle_lock(mob/user as mob) - if(!src.allowed(user)) - user << "\red Access denied." - return if(src.OCCUPANT && src.safetieson) user << "The Unit's safety protocols disallow locking when a biological form is detected inside its compartments." return @@ -463,7 +452,7 @@ for (var/mob/V in viewers(usr)) V.show_message("[usr] starts squeezing into the suit storage unit!", 3) if(do_after(usr, 10)) - usr.pulling = null + usr.stop_pulling() usr.client.perspective = EYE_PERSPECTIVE usr.client.eye = src usr.loc = src @@ -488,7 +477,7 @@ return if(istype(I, /obj/item/weapon/screwdriver)) src.panelopen = !src.panelopen - playsound(src.loc, 'Screwdriver.ogg', 100, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) user << text("You [] the unit's maintenance panel.",(src.panelopen ? "open up" : "close") ) src.updateUsrDialog() return diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 0031f7cc06..869676cab0 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 // Beacon randomly spawns in space // When a non-traitor (no special role in /mind) uses it, he is given the choice to become a traitor @@ -9,7 +9,7 @@ /obj/machinery/syndicate_beacon name = "ominous beacon" desc = "This looks suspicious..." - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "syndbeacon" anchored = 1 @@ -29,7 +29,7 @@ dat += "Connection severed.
      " else var/honorific = "Mr." - if(user.gender == "female") + if(user.gender == FEMALE) honorific = "Ms." dat += "Identity not found in operative database. What can the Syndicate do for you today, [honorific] [user.name]?
      " if(!selfdestructing) @@ -106,7 +106,7 @@ /obj/machinery/singularity_beacon //not the best place for it but it's a hack job anyway -- Urist name = "ominous beacon" desc = "This looks suspicious..." - icon = 'singularity.dmi' + icon = 'icons/obj/singularity.dmi' icon_state = "beacon" anchored = 0 @@ -120,6 +120,9 @@ proc/Activate(mob/user = null) + if(!checkWirePower()) + if(user) user << "\blue The connected wire doesn't have enough current." + return for(var/obj/machinery/singularity/singulo in world) if(singulo.z == z) singulo.target = src @@ -180,23 +183,30 @@ if(active) Deactivate() ..() + /* + * Added for a simple way to check power. Verifies that the beacon + * is connected to a wire, the wire is part of a powernet (that part's + * sort of redundant, since all wires either join or create one when placed) + * and that the powernet has at least 1500 power units available for use. + * Doesn't use them, though, just makes sure they're there. + * - QualityVan, Aug 11 2012 + */ + proc/checkWirePower() + if(!attached) + return 0 + var/datum/powernet/PN = attached.get_powernet() + if(!PN) + return 0 + if(PN.avail < 1500) + return 0 + return 1 process() - if(stat & NOPOWER) - if(active) - Deactivate() - return - if(!active) return - - if(attached) - if(!attached.get_powernet()) - Deactivate() - return - use_power(1500) else - Deactivate() + if(!checkWirePower()) + Deactivate() return diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 6f42f783f4..8635721e0b 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /* The broadcaster sends processed messages to all radio devices in the game. They @@ -12,7 +12,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : /obj/machinery/telecomms/broadcaster name = "Subspace Broadcaster" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "broadcaster" desc = "A dish-shaped machine used to broadcast processed subspace signals." density = 1 @@ -20,76 +20,82 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : use_power = 1 idle_power_usage = 25 machinetype = 5 - heatgen = 60 + heatgen = 0 delay = 7 circuitboard = "/obj/item/weapon/circuitboard/telecomms/broadcaster" - receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) +/obj/machinery/telecomms/broadcaster/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + // Don't broadcast rejected signals + var/turf/position = get_turf(src) + if(signal.data["reject"]) + return - // Don't broadcast rejected signals - if(signal.data["reject"]) + //Is it a test signal? + if(signal.data["type"] == 4) + signal.data["done"] = 1 + signal.data["level"] += position.z + return + + if(signal.data["message"]) + + // Prevents massive radio spam + if("[signal.data["message"]]:[signal.data["realname"]]:[position.z]" in recentmessages) return + recentmessages.Add("[signal.data["message"]]:[signal.data["realname"]]:[position.z]") - if(signal.data["message"]) + signal.data["done"] = 1 // mark the signal as being broadcasted - // Prevents massive radio spam - if("[signal.data["message"]]:[signal.data["realname"]]" in recentmessages) - return - recentmessages.Add( "[signal.data["message"]]:[signal.data["realname"]]" ) + // Search for the original signal and mark it as done as well + var/datum/signal/original = signal.data["original"] + if(original) + original.data["done"] = 1 + + if(signal.data["slow"] > 0) + sleep(signal.data["slow"]) // simulate the network lag if necessary + + /** #### - Normal Broadcast - #### **/ + + if(signal.data["type"] == 0) + + /* ###### Broadcast a message using signal.data ###### */ + Broadcast_Message(signal.data["connection"], signal.data["mob"], + signal.data["vmask"], signal.data["vmessage"], + signal.data["radio"], signal.data["message"], + signal.data["name"], signal.data["job"], + signal.data["realname"], signal.data["vname"],, signal.data["compression"], position.z) - signal.data["done"] = 1 // mark the signal as being broadcasted + /** #### - Simple Broadcast - #### **/ - // Search for the original signal and mark it as done as well - var/datum/signal/original = signal.data["original"] - if(original) - original.data["done"] = 1 + if(signal.data["type"] == 1) - if(signal.data["slow"] > 0) - sleep(signal.data["slow"]) // simulate the network lag if necessary + /* ###### Broadcast a message using signal.data ###### */ + Broadcast_SimpleMessage(signal.data["name"], signal.frequency, + signal.data["message"],null, null, + signal.data["compression"], position.z) - /** #### - Normal Broadcast - #### **/ + /** #### - Artificial Broadcast - #### **/ + // (Imitates a mob) - if(signal.data["type"] == 0) + if(signal.data["type"] == 2) - /* ###### Broadcast a message using signal.data ###### */ - Broadcast_Message(signal.data["connection"], signal.data["mob"], - signal.data["vmask"], signal.data["vmessage"], - signal.data["radio"], signal.data["message"], - signal.data["name"], signal.data["job"], - signal.data["realname"], signal.data["vname"],, signal.data["compression"]) + /* ###### Broadcast a message using signal.data ###### */ + // Parameter "data" as 4: AI can't track this person/mob + + Broadcast_Message(signal.data["connection"], signal.data["mob"], + signal.data["vmask"], signal.data["vmessage"], + signal.data["radio"], signal.data["message"], + signal.data["name"], signal.data["job"], + signal.data["realname"], signal.data["vname"], 4, signal.data["compression"], position.z) + + spawn(5) + recentmessages = list() + + /* --- Do a snazzy animation! --- */ + flick("broadcaster_send", src) - /** #### - Simple Broadcast - #### **/ - - if(signal.data["type"] == 1) - - /* ###### Broadcast a message using signal.data ###### */ - Broadcast_SimpleMessage(signal.data["name"], signal.frequency, - signal.data["message"],null, null, - signal.data["compression"]) - - - /** #### - Artificial Broadcast - #### **/ - // (Imitates a mob) - - if(signal.data["type"] == 2) - - /* ###### Broadcast a message using signal.data ###### */ - // Parameter "data" as 4: AI can't track this person/mob - - Broadcast_Message(signal.data["connection"], signal.data["mob"], - signal.data["vmask"], signal.data["vmessage"], - signal.data["radio"], signal.data["message"], - signal.data["name"], signal.data["job"], - signal.data["realname"], signal.data["vname"], 4, signal.data["compression"]) - - spawn(1) - recentmessages = list() - - /* --- Do a snazzy animation! --- */ - flick("broadcaster_send", src) /* Basically just an empty shell for receiving and broadcasting radio messages. Not @@ -98,7 +104,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : /obj/machinery/telecomms/allinone name = "Telecommunications Mainframe" - icon = 'stationobjs.dmi' + icon = 'icons/obj/stationobjs.dmi' icon_state = "comm_server" desc = "A compact machine used for portable subspace telecommuniations processing." density = 1 @@ -108,57 +114,43 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : machinetype = 6 heatgen = 0 var/intercept = 0 // if nonzero, broadcasts all messages to syndicate channel - var/nuke = 0 - var/frequency = 1439 - receive_signal(datum/signal/signal) +/obj/machinery/telecomms/allinone/receive_signal(datum/signal/signal) - if(!on) // has to be on to receive messages - return + if(!on) // has to be on to receive messages + return - if(is_freq_listening(signal)) // detect subspace signals + if(is_freq_listening(signal)) // detect subspace signals - signal.data["done"] = 1 // mark the signal as being broadcasted - signal.data["compression"] = 0 + signal.data["done"] = 1 // mark the signal as being broadcasted + signal.data["compression"] = 0 - // Search for the original signal and mark it as done as well - var/datum/signal/original = signal.data["original"] - if(original) - original.data["done"] = 1 + // Search for the original signal and mark it as done as well + var/datum/signal/original = signal.data["original"] + if(original) + original.data["done"] = 1 - if(signal.data["slow"] > 0) - sleep(signal.data["slow"]) // simulate the network lag if necessary + if(signal.data["slow"] > 0) + sleep(signal.data["slow"]) // simulate the network lag if necessary - /* ###### Broadcast a message using signal.data ###### */ + /* ###### Broadcast a message using signal.data ###### */ - var/datum/radio_frequency/connection = signal.data["connection"] + var/datum/radio_frequency/connection = signal.data["connection"] + var/turf/position = get_turf(src) - if(!intercept) // if syndicate broadcast, just - if(connection.frequency == frequency && !nuke) - Broadcast_Message(signal.data["connection"], signal.data["mob"], - signal.data["vmask"], signal.data["vmessage"], - signal.data["radio"], signal.data["message"], - signal.data["name"], signal.data["job"], - signal.data["realname"], signal.data["vname"],, signal.data["compression"]) - else - if(nuke && connection.frequency != NUKE_FREQ) - Broadcast_Message(signal.data["connection"], signal.data["mob"], - signal.data["vmask"], signal.data["vmessage"], - signal.data["radio"], signal.data["message"], - signal.data["name"], signal.data["job"], - signal.data["realname"], signal.data["vname"], 3, signal.data["compression"]) - else if(nuke) - Broadcast_Message(signal.data["connection"], signal.data["mob"], - signal.data["vmask"], signal.data["vmessage"], - signal.data["radio"], signal.data["message"], - signal.data["name"], signal.data["job"], - signal.data["realname"], signal.data["vname"],, signal.data["compression"]) - else - Broadcast_Message(signal.data["connection"], signal.data["mob"], - signal.data["vmask"], signal.data["vmessage"], - signal.data["radio"], signal.data["message"], - signal.data["name"], signal.data["job"], - signal.data["realname"], signal.data["vname"], 4, signal.data["compression"], frequency) + if(connection.frequency == SYND_FREQ) // if syndicate broadcast, just + Broadcast_Message(signal.data["connection"], signal.data["mob"], + signal.data["vmask"], signal.data["vmessage"], + signal.data["radio"], signal.data["message"], + signal.data["name"], signal.data["job"], + signal.data["realname"], signal.data["vname"],, signal.data["compression"], position.z) + else + if(intercept) + Broadcast_Message(signal.data["connection"], signal.data["mob"], + signal.data["vmask"], signal.data["vmessage"], + signal.data["radio"], signal.data["message"], + signal.data["name"], signal.data["job"], + signal.data["realname"], signal.data["vname"], 3, signal.data["compression"], position.z) @@ -211,28 +203,28 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : If 0, the signal is audible If nonzero, the signal may be partially inaudible or just complete gibberish. + @param level: + The Z level that the sending radio is on. + **/ /proc/Broadcast_Message(var/datum/radio_frequency/connection, var/mob/M, var/vmask, var/vmessage, var/obj/item/device/radio/radio, var/message, var/name, var/job, var/realname, var/vname, - var/data, var/compression, var/intercept_frequency) - + var/data, var/compression, var/level) /* ###### Prepare the radio connection ###### */ var/display_freq = connection.frequency - var/list/receive = list() - + var/list/obj/item/device/radio/radios = list() // --- Broadcast only to intercom devices --- if(data == 1) for (var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"]) - - receive |= R.send_hear(display_freq) - + if(R.receive_range(display_freq, level) > 0) + radios += R // --- Broadcast only to intercoms and station-bounced radios --- @@ -242,8 +234,8 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if(istype(R, /obj/item/device/radio/headset)) continue - receive |= R.send_hear(display_freq) - + if(R.receive_range(display_freq, level) > 0) + radios += R // --- Broadcast to syndicate radio! --- @@ -252,24 +244,18 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : for (var/obj/item/device/radio/R in syndicateconnection.devices["[RADIO_CHAT]"]) - receive |= R.send_hear(SYND_FREQ) + if(R.receive_range(SYND_FREQ, level) > 0) + radios += R - - // --- Broadcast to response team radio! --- - - else if(data == 5) - var/datum/radio_frequency/interceptconnection = radio_controller.return_frequency(intercept_frequency) - - for (var/obj/item/device/radio/R in interceptconnection.devices["[RADIO_CHAT]"]) - - receive |= R.send_hear(intercept_frequency) // --- Broadcast to ALL radio devices --- else for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) + if(R.receive_range(display_freq, level) > 0) + radios += R - receive |= R.send_hear(display_freq) - + // Get a list of mobs who can hear from the radios we collected. + var/list/receive = get_mobs_in_radio_ranges(radios, level) /* ###### Organize the receivers into categories for displaying the message ###### */ @@ -282,9 +268,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : var/list/heard_garbled = list() // garbled message (ie "f*c* **u, **i*er!") var/list/heard_gibberish= list() // completely screwed over message (ie "F%! (O*# *#!<>&**%!") - // Make sure everyone only hears the message once - var/list/already_heard = list() - for (var/mob/R in receive) /* --- Loop through the receivers and categorize them --- */ @@ -295,12 +278,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if(istype(M, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes. continue - // We'll skip those guys who have already heard the message - if (R in already_heard) - continue - - already_heard += R - // --- Check for compression --- if(compression > 0) @@ -329,13 +306,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : // - Just display a garbled message - else heard_garbled += R - if(hasorgans(R)) - for(var/datum/organ/external/O in R:organs) - for(var/obj/item/weapon/implant/imp in O.implant) - imp.hear(message,M) - else - for(var/obj/item/weapon/implant/imp in R) - imp.hear(message,M) /* ###### Begin formatting and sending the message ###### */ @@ -364,9 +334,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : freq_text = "Mining" if(1347) freq_text = "Cargo" - - if(connection.frequency == NUKE_FREQ) - freq_text = "Agent" //There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO @@ -389,48 +356,43 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : part_a = "" else if (display_freq in DEPT_FREQS) part_a = "" - else if (display_freq==NUKE_FREQ) - part_a = "" // --- Filter the message; place it in quotes apply a verb --- - var/quotedmsg = "\"" + message + "\"" - if(job == "Automated Announcement") - quotedmsg = message - else if(M) - quotedmsg = M.say_quote(message) + var/quotedmsg = M.say_quote(message) // --- This following recording is intended for research and feedback in the use of department radio channels --- var/part_blackbox_b = " \[[freq_text]\] " // Tweaked for security headsets -- TLE var/blackbox_msg = "[part_a][name][part_blackbox_b][quotedmsg][part_c]" //var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]" - for (var/obj/machinery/blackbox_recorder/BR in world) - //BR.messages_admin += blackbox_admin_msg + + //BR.messages_admin += blackbox_admin_msg + if(istype(blackbox)) switch(display_freq) if(1459) - BR.msg_common += blackbox_msg + blackbox.msg_common += blackbox_msg if(1351) - BR.msg_science += blackbox_msg + blackbox.msg_science += blackbox_msg if(1353) - BR.msg_command += blackbox_msg + blackbox.msg_command += blackbox_msg if(1355) - BR.msg_medical += blackbox_msg + blackbox.msg_medical += blackbox_msg if(1357) - BR.msg_engineering += blackbox_msg + blackbox.msg_engineering += blackbox_msg if(1359) - BR.msg_security += blackbox_msg + blackbox.msg_security += blackbox_msg if(1441) - BR.msg_deathsquad += blackbox_msg + blackbox.msg_deathsquad += blackbox_msg if(1213) - BR.msg_syndicate += blackbox_msg + blackbox.msg_syndicate += blackbox_msg if(1349) - BR.msg_mining += blackbox_msg + blackbox.msg_mining += blackbox_msg if(1347) - BR.msg_cargo += blackbox_msg + blackbox.msg_cargo += blackbox_msg else - BR.messages += blackbox_msg + blackbox.messages += blackbox_msg //End of research and feedback code. @@ -450,7 +412,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if(data == 4) aitrack = "" - if(istype(R, /mob/living/silicon/ai) && job != "Automated Announcement") + if(istype(R, /mob/living/silicon/ai)) R.show_message("[part_a][aitrack][N] ([J]) [part_b][quotedmsg][part_c]", 2) else R.show_message(rendered, 2) @@ -465,7 +427,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if(data == 4) aitrack = "" - if(istype(R, /mob/living/silicon/ai) && job != "Automated Announcement") + if(istype(R, /mob/living/silicon/ai)) R.show_message("[part_a][aitrack][realname] ([job]) [part_b][quotedmsg][part_c]", 2) else R.show_message(rendered, 2) @@ -482,7 +444,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : aitrack = "" - if(istype(R, /mob/living/silicon/ai) && job != "Automated Announcement") + if(istype(R, /mob/living/silicon/ai)) R.show_message("[part_a][aitrack][vname] ([job]) [part_b][vmessage]][part_c]", 2) else R.show_message(rendered, 2) @@ -500,7 +462,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : aitrack = "" - if(istype(R, /mob/living/silicon/ai) && job != "Automated Announcement") + if(istype(R, /mob/living/silicon/ai)) R.show_message("[part_a][aitrack][vname][part_b][quotedmsg][part_c]", 2) else R.show_message(rendered, 2) @@ -518,14 +480,14 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : aitrack = "" - if(istype(R, /mob/living/silicon/ai) && job != "Automated Announcement") + if(istype(R, /mob/living/silicon/ai)) R.show_message("[part_a][aitrack][Gibberish(realname, compression + 50)] ([Gibberish(job, compression + 50)]) [part_b][quotedmsg][part_c]", 2) else R.show_message(rendered, 2) -/proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression) +/proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression, var/level) /* ###### Prepare the radio connection ###### */ @@ -545,8 +507,9 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if(data == 1) for (var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"]) - - receive |= R.send_hear(display_freq) + var/turf/position = get_turf(R) + if(position && position.z == level) + receive |= R.send_hear(display_freq, level) // --- Broadcast only to intercoms and station-bounced radios --- @@ -556,8 +519,9 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if(istype(R, /obj/item/device/radio/headset)) continue - - receive |= R.send_hear(display_freq) + var/turf/position = get_turf(R) + if(position && position.z == level) + receive |= R.send_hear(display_freq) // --- Broadcast to syndicate radio! --- @@ -566,16 +530,18 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : var/datum/radio_frequency/syndicateconnection = radio_controller.return_frequency(SYND_FREQ) for (var/obj/item/device/radio/R in syndicateconnection.devices["[RADIO_CHAT]"]) - - receive |= R.send_hear(SYND_FREQ) + var/turf/position = get_turf(R) + if(position && position.z == level) + receive |= R.send_hear(SYND_FREQ) // --- Broadcast to ALL radio devices --- else for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) - - receive |= R.send_hear(display_freq) + var/turf/position = get_turf(R) + if(position && position.z == level) + receive |= R.send_hear(display_freq) /* ###### Organize the receivers into categories for displaying the message ###### */ @@ -613,13 +579,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : // - Just display a garbled message - heard_garbled += R - if(hasorgans(R)) - for(var/datum/organ/external/O in R:organs) - for(var/obj/item/weapon/implant/imp in O.implant) - imp.hear(text,M) - else - for(var/obj/item/weapon/implant/imp in R) - imp.hear(text,M) /* ###### Begin formatting and sending the message ###### */ @@ -648,9 +607,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : freq_text = "Mining" if(1347) freq_text = "Cargo" - - if(connection.frequency == NUKE_FREQ) - freq_text = "Agent" //There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO @@ -677,39 +633,38 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : part_a = "" else if (display_freq in DEPT_FREQS) part_a = "" - else if (display_freq==NUKE_FREQ) - part_a = "" // --- This following recording is intended for research and feedback in the use of department radio channels --- var/part_blackbox_b = " \[[freq_text]\] " // Tweaked for security headsets -- TLE var/blackbox_msg = "[part_a][source][part_blackbox_b]\"[text]\"[part_c]" //var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]" - for (var/obj/machinery/blackbox_recorder/BR in world) - //BR.messages_admin += blackbox_admin_msg + + //BR.messages_admin += blackbox_admin_msg + if(istype(blackbox)) switch(display_freq) if(1459) - BR.msg_common += blackbox_msg + blackbox.msg_common += blackbox_msg if(1351) - BR.msg_science += blackbox_msg + blackbox.msg_science += blackbox_msg if(1353) - BR.msg_command += blackbox_msg + blackbox.msg_command += blackbox_msg if(1355) - BR.msg_medical += blackbox_msg + blackbox.msg_medical += blackbox_msg if(1357) - BR.msg_engineering += blackbox_msg + blackbox.msg_engineering += blackbox_msg if(1359) - BR.msg_security += blackbox_msg + blackbox.msg_security += blackbox_msg if(1441) - BR.msg_deathsquad += blackbox_msg + blackbox.msg_deathsquad += blackbox_msg if(1213) - BR.msg_syndicate += blackbox_msg + blackbox.msg_syndicate += blackbox_msg if(1349) - BR.msg_mining += blackbox_msg + blackbox.msg_mining += blackbox_msg if(1347) - BR.msg_cargo += blackbox_msg + blackbox.msg_cargo += blackbox_msg else - BR.messages += blackbox_msg + blackbox.messages += blackbox_msg //End of research and feedback code. @@ -719,8 +674,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if (length(heard_normal)) var/rendered = "[part_a][source][part_b]\"[text]\"[part_c]" - if(M.job == "Automated Announcement") - rendered = "[part_a][source][part_b][text][part_c]" for (var/mob/R in heard_normal) R.show_message(rendered, 2) @@ -730,8 +683,6 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if (length(heard_garbled)) var/quotedmsg = "\"[stars(text)]\"" - if(M.job == "Automated Announcement") - quotedmsg = "[stars(text)]" var/rendered = "[part_a][source][part_b][quotedmsg][part_c]" for (var/mob/R in heard_garbled) @@ -742,11 +693,45 @@ var/list/recentmessages = list() // global list of recent messages broadcasted : if (length(heard_gibberish)) var/quotedmsg = "\"[Gibberish(text, compression + 50)]\"" - if(M.job == "Automated Announcement") - quotedmsg = "[Gibberish(text, compression + 50)]" var/rendered = "[part_a][Gibberish(source, compression + 50)][part_b][quotedmsg][part_c]" for (var/mob/R in heard_gibberish) R.show_message(rendered, 2) +//Use this to test if an obj can communicate with a Telecommunications Network + +/atom/proc/test_telecomms() + var/datum/signal/signal = telecomms_process() + var/turf/position = get_turf(src) + return (position.z in signal.data["level"] && signal.data["done"]) + +/atom/proc/telecomms_process() + + // First, we want to generate a new radio signal + var/datum/signal/signal = new + signal.transmission_method = 2 // 2 would be a subspace transmission. + + // --- Finally, tag the actual signal with the appropriate values --- + signal.data = list( + "slow" = 0, // how much to sleep() before broadcasting - simulates net lag + "message" = "TEST", + "compression" = rand(45, 50), // If the signal is compressed, compress our message too. + "traffic" = 0, // dictates the total traffic sum that the signal went through + "type" = 4, // determines what type of radio input it is: test broadcast + "reject" = 0, + "done" = 0, + "level" = list() // The level it is being broadcasted at. + ) + signal.frequency = 1459// Common channel + + //#### Sending the signal to all subspace receivers ####// + var/turf/position = get_turf(src) + for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + var/turf/receiver_turf = get_turf(R) + if(position.z == receiver_turf.z) + R.receive_signal(signal) + + sleep(rand(10,25)) + + return signal diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm index ee9642b847..4f610c4d5f 100644 --- a/code/game/machinery/telecomms/logbrowser.dm +++ b/code/game/machinery/telecomms/logbrowser.dm @@ -13,7 +13,7 @@ var/universal_translate = 0 // set to 1 if it can translate nonhuman speech - req_access = list(ACCESS_TCOMSAT) + req_access = list(access_tcomsat) attack_hand(mob/user as mob) if(stat & (BROKEN|NOPOWER)) @@ -212,7 +212,7 @@ attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) if(istype(D, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -238,7 +238,7 @@ A.anchored = 1 del(src) else if(istype(D, /obj/item/weapon/card/emag) && !emagged) - playsound(src.loc, 'sparks4.ogg', 75, 1) + playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 user << "\blue You you disable the security protocols" src.updateUsrDialog() diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index a513c69f72..c55c61e5af 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -13,109 +13,110 @@ - attackby(obj/item/P as obj, mob/user as mob) +/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob) - // Using a multitool lets you access the receiver's interface - if(istype(P, /obj/item/device/multitool)) - attack_hand(user) - - switch(construct_op) - if(0) - if(istype(P, /obj/item/weapon/screwdriver)) - user << "You unfasten the bolts." - playsound(src.loc, 'Screwdriver.ogg', 50, 1) - construct_op ++ - if(1) - if(istype(P, /obj/item/weapon/screwdriver)) - user << "You fasten the bolts." - playsound(src.loc, 'Screwdriver.ogg', 50, 1) - construct_op -- - if(istype(P, /obj/item/weapon/wrench)) - user << "You dislodge the external plating." - playsound(src.loc, 'Ratchet.ogg', 75, 1) - construct_op ++ - if(2) - if(istype(P, /obj/item/weapon/wrench)) - user << "You secure the external plating." - playsound(src.loc, 'Ratchet.ogg', 75, 1) - construct_op -- - if(istype(P, /obj/item/weapon/wirecutters)) - playsound(src.loc, 'wirecutter.ogg', 50, 1) - user << "You remove the cables." - construct_op ++ - var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( user.loc ) - A.amount = 5 - stat |= BROKEN // the machine's been borked! - if(3) - if(istype(P, /obj/item/weapon/cable_coil)) - var/obj/item/weapon/cable_coil/A = P - if(A.amount >= 5) - user << "You insert the cables." - A.amount -= 5 - if(A.amount <= 0) - user.drop_item() - del(A) - construct_op -- - stat &= ~BROKEN // the machine's not borked anymore! - if(istype(P, /obj/item/weapon/crowbar)) - user << "You begin prying out the circuit board other components..." - playsound(src.loc, 'Crowbar.ogg', 50, 1) - if(do_after(user,60)) - user << "You finish prying out the components." - - // Drop all the component stuff - if(contents.len > 0) - for(var/obj/x in src) - x.loc = user.loc - else - - // If the machine wasn't made during runtime, probably doesn't have components: - // manually find the components and drop them! - var/newpath = text2path(circuitboard) - var/obj/item/weapon/circuitboard/C = new newpath - for(var/I in C.req_components) - for(var/i = 1, i <= C.req_components[I], i++) - newpath = text2path(I) - var/obj/item/s = new newpath - s.loc = user.loc - if(istype(P, /obj/item/weapon/cable_coil)) - var/obj/item/weapon/cable_coil/A = P - A.amount = 1 - - // Drop a circuit board too - C.loc = user.loc - - // Create a machine frame and delete the current machine - var/obj/machinery/constructable_frame/machine_frame/F = new - F.loc = src.loc - del(src) - - - attack_ai(var/mob/user as mob) + // Using a multitool lets you access the receiver's interface + if(istype(P, /obj/item/device/multitool)) attack_hand(user) - attack_hand(var/mob/user as mob) + switch(construct_op) + if(0) + if(istype(P, /obj/item/weapon/screwdriver)) + user << "You unfasten the bolts." + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + construct_op ++ + if(1) + if(istype(P, /obj/item/weapon/screwdriver)) + user << "You fasten the bolts." + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + construct_op -- + if(istype(P, /obj/item/weapon/wrench)) + user << "You dislodge the external plating." + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + construct_op ++ + if(2) + if(istype(P, /obj/item/weapon/wrench)) + user << "You secure the external plating." + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + construct_op -- + if(istype(P, /obj/item/weapon/wirecutters)) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) + user << "You remove the cables." + construct_op ++ + var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( user.loc ) + A.amount = 5 + stat |= BROKEN // the machine's been borked! + if(3) + if(istype(P, /obj/item/weapon/cable_coil)) + var/obj/item/weapon/cable_coil/A = P + if(A.amount >= 5) + user << "You insert the cables." + A.amount -= 5 + if(A.amount <= 0) + user.drop_item() + del(A) + construct_op -- + stat &= ~BROKEN // the machine's not borked anymore! + if(istype(P, /obj/item/weapon/crowbar)) + user << "You begin prying out the circuit board other components..." + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + if(do_after(user,60)) + user << "You finish prying out the components." - // You need a multitool to use this, or be silicon - if(!issilicon(user)) - if(user.equipped()) - if(!istype(user.equipped(), /obj/item/device/multitool)) - return - else + // Drop all the component stuff + if(contents.len > 0) + for(var/obj/x in src) + x.loc = user.loc + else + + // If the machine wasn't made during runtime, probably doesn't have components: + // manually find the components and drop them! + var/newpath = text2path(circuitboard) + var/obj/item/weapon/circuitboard/C = new newpath + for(var/I in C.req_components) + for(var/i = 1, i <= C.req_components[I], i++) + newpath = text2path(I) + var/obj/item/s = new newpath + s.loc = user.loc + if(istype(P, /obj/item/weapon/cable_coil)) + var/obj/item/weapon/cable_coil/A = P + A.amount = 1 + + // Drop a circuit board too + C.loc = user.loc + + // Create a machine frame and delete the current machine + var/obj/machinery/constructable_frame/machine_frame/F = new + F.loc = src.loc + del(src) + + +/obj/machinery/telecomms/attack_ai(var/mob/user as mob) + attack_hand(user) + +/obj/machinery/telecomms/attack_hand(var/mob/user as mob) + + // You need a multitool to use this, or be silicon + if(!issilicon(user)) + if(user.get_active_hand()) + if(!istype(user.get_active_hand(), /obj/item/device/multitool)) return - - if(stat & (BROKEN|NOPOWER) || !on) + else return - var/obj/item/device/multitool/P = null - if(!issilicon(user)) - P = user.equipped() + if(stat & (BROKEN|NOPOWER)) + return - user.machine = src - var/dat - dat = "[src.name]

      [src.name] Access

      " - dat += "
      [temp]
      " + var/obj/item/device/multitool/P = null + if(!issilicon(user)) + P = user.get_active_hand() + user.machine = src + var/dat + dat = "[src.name]

      [src.name] Access

      " + dat += "
      [temp]
      " + dat += "
      Power Status: [src.toggled ? "On" : "Off"]" + if(on) if(id != "" && id) dat += "
      Identification String: [id]" else @@ -127,6 +128,8 @@ var/i = 0 for(var/obj/machinery/telecomms/T in links) i++ + if(T.hide && !src.hide) + continue dat += "
    • \ref[T] [T.name] ([T.id]) \[X\]
    • " dat += "" @@ -152,117 +155,121 @@ else dat += "

      MULTITOOL BUFFER: \[Add Machine\]" - dat += "
      " - temp = "" - user << browse(dat, "window=tcommachine;size=520x500;can_resize=0") - onclose(user, "dormitory") + dat += "
      " + temp = "" + user << browse(dat, "window=tcommachine;size=520x500;can_resize=0") + onclose(user, "dormitory") - Topic(href, href_list) +/obj/machinery/telecomms/Topic(href, href_list) - if(!issilicon(usr)) - if(usr.equipped()) - if(!istype(usr.equipped(), /obj/item/device/multitool)) - return - else + if(!issilicon(usr)) + if(usr.get_active_hand()) + if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) return - - if(stat & (BROKEN|NOPOWER) || !on) + else return - var/obj/item/device/multitool/P = null - if(!issilicon(usr)) - P = usr.equipped() + if(stat & (BROKEN|NOPOWER)) + return - if(href_list["input"]) - switch(href_list["input"]) + var/obj/item/device/multitool/P = null + if(!issilicon(usr)) + P = usr.get_active_hand() - if("id") - var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN) - if(newid && usr in range(1, src)) - id = newid - temp = "-% New ID assigned: \"[id]\" %-" + if(href_list["input"]) + switch(href_list["input"]) - if("network") - var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text - if(newnet && usr in range(1, src)) + if("toggle") + src.toggled = !src.toggled + temp = "-% [src] has been [src.toggled ? "activated" : "deactivated"]." - if(length(newnet) > 15) - temp = "-% Too many characters in new network tag %-" + if("id") + var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN) + if(newid && usr in range(1, src)) + id = newid + temp = "-% New ID assigned: \"[id]\" %-" - else - for(var/obj/machinery/telecomms/T in links) - T.links.Remove(src) + if("network") + var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text + if(newnet && usr in range(1, src)) - network = newnet - links = list() - temp = "-% New network tag assigned: \"[network]\" %-" + if(length(newnet) > 15) + temp = "-% Too many characters in new network tag %-" + + else + for(var/obj/machinery/telecomms/T in links) + T.links.Remove(src) + + network = newnet + links = list() + temp = "-% New network tag assigned: \"[network]\" %-" - if("freq") - var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num - if(newfreq && usr in range(1, src)) - if(!(newfreq in freq_listening)) + if("freq") + var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num + if(newfreq && usr in range(1, src)) + if(!(newfreq in freq_listening)) - if(findtext(num2text(newfreq), ".")) - newfreq *= 10 // shift the decimal one place + if(findtext(num2text(newfreq), ".")) + newfreq *= 10 // shift the decimal one place - freq_listening.Add(newfreq) - temp = "-% New frequency filter assigned: \"[newfreq] GHz\" %-" + freq_listening.Add(newfreq) + temp = "-% New frequency filter assigned: \"[newfreq] GHz\" %-" - if(href_list["delete"]) + if(href_list["delete"]) - // changed the layout about to workaround a pesky runtime -- Doohl + // changed the layout about to workaround a pesky runtime -- Doohl - var/freq_remove = text2num(href_list["delete"]) - for(var/x in freq_listening) - if(x == freq_remove) + var/freq_remove = text2num(href_list["delete"]) + for(var/x in freq_listening) + if(x == freq_remove) - temp = "-% Removed frequency filter [x] %-" - freq_listening.Remove(x) - break + temp = "-% Removed frequency filter [x] %-" + freq_listening.Remove(x) + break - if(href_list["unlink"]) + if(href_list["unlink"]) - if(text2num(href_list["unlink"]) <= length(links)) - var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])] - temp = "-% Removed \ref[T] [T.name] from linked entities. %-" + if(text2num(href_list["unlink"]) <= length(links)) + var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])] + temp = "-% Removed \ref[T] [T.name] from linked entities. %-" - // Remove link entries from both T and src. - if(src in T.links) - T.links.Remove(src) - links.Remove(T) + // Remove link entries from both T and src. + if(src in T.links) + T.links.Remove(src) + links.Remove(T) - if(href_list["link"]) + if(href_list["link"]) - if(P) + if(P) - if(P.buffer) - if(!(src in P.buffer.links)) - P.buffer.links.Add(src) + if(P.buffer) + if(!(src in P.buffer.links)) + P.buffer.links.Add(src) - if(!(P.buffer in src.links)) - src.links.Add(P.buffer) + if(!(P.buffer in src.links)) + src.links.Add(P.buffer) - temp = "-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-" + temp = "-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-" - else - temp = "-% Unable to acquire buffer %-" + else + temp = "-% Unable to acquire buffer %-" - if(href_list["buffer"]) + if(href_list["buffer"]) - P.buffer = src - temp = "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-" + P.buffer = src + temp = "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-" - if(href_list["flush"]) + if(href_list["flush"]) - temp = "-% Buffer successfully flushed. %-" - P.buffer = null + temp = "-% Buffer successfully flushed. %-" + P.buffer = null - usr.machine = src - src.add_fingerprint(usr) + usr.machine = src + src.add_fingerprint(usr) - updateUsrDialog() + updateUsrDialog() diff --git a/code/game/machinery/telecomms/telecommunications.dm b/code/game/machinery/telecomms/telecommunications.dm index 3deca03cba..66506e5ee9 100644 --- a/code/game/machinery/telecomms/telecommunications.dm +++ b/code/game/machinery/telecomms/telecommunications.dm @@ -194,7 +194,7 @@ var/datum/gas_mixture/env = L.return_air() if(env.temperature < (heat_amt+T0C)) - var/transfer_moles = 0.25 * env.total_moles + var/transfer_moles = 0.25 * env.total_moles() var/datum/gas_mixture/removed = env.remove(transfer_moles) diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm new file mode 100644 index 0000000000..ea855d0688 --- /dev/null +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -0,0 +1,762 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 + +/* + Hello, friends, this is Doohl from sexylands. You may be wondering what this + monstrous code file is. Sit down, boys and girls, while I tell you the tale. + + + The machines defined in this file were designed to be compatible with any radio + signals, provided they use subspace transmission. Currently they are only used for + headsets, but they can eventually be outfitted for real COMPUTER networks. This + is just a skeleton, ladies and gentlemen. + + Look at radio.dm for the prequel to this code. +*/ + +var/global/list/obj/machinery/telecomms/telecomms_list = list() + +/obj/machinery/telecomms + var/list/links = list() // list of machines this machine is linked to + var/traffic = 0 // value increases as traffic increases + var/netspeed = 5 // how much traffic to lose per tick (50 gigabytes/second * netspeed) + var/list/autolinkers = list() // list of text/number values to link with + var/id = "NULL" // identification string + var/network = "NULL" // the network of the machinery + + var/list/freq_listening = list() // list of frequencies to tune into: if none, will listen to all + + var/machinetype = 0 // just a hacky way of preventing alike machines from pairing + var/toggled = 1 // Is it toggled on + var/on = 1 + var/integrity = 100 // basically HP, loses integrity by heat + var/heatgen = 20 // how much heat to transfer to the environment + var/delay = 10 // how many process() ticks to delay per heat + var/heating_power = 40000 + var/long_range_link = 0 + var/circuitboard = null // string pointing to a circuitboard type + var/hide = 0 // Is it a hidden machine? + + +/obj/machinery/telecomms/proc/relay_information(datum/signal/signal, filter, copysig, amount) + // relay signal to all linked machinery that are of type [filter]. If signal has been sent [amount] times, stop sending + + if(!on) + return + + var/send_count = 0 + + signal.data["slow"] += rand(0, round((100-integrity))) // apply some lag based on integrity + + // Apply some lag based on traffic rates + var/netlag = round(traffic / 50) + if(netlag > signal.data["slow"]) + signal.data["slow"] = netlag + +// Loop through all linked machines and send the signal or copy. + for(var/obj/machinery/telecomms/machine in links) + if(filter && !istype( machine, text2path(filter) )) + continue + if(!machine.on) + continue + if(amount && send_count >= amount) + break + if(machine.loc.z != src.loc.z) + if(long_range_link == 0 && machine.long_range_link == 0) + continue + //Is this a test signal? + if(signal.data["type"] == 4) + send_count++ + if(machine.is_freq_listening(signal)) + machine.traffic++ + machine.receive_information(signal, src) + continue + // If we're sending a copy, be sure to create the copy for EACH machine and paste the data + var/datum/signal/copy = new + if(copysig) + + copy.transmission_method = 2 + copy.frequency = signal.frequency + // Copy the main data contents! Workaround for some nasty bug where the actual array memory is copied and not its contents. + copy.data = list( + + "mob" = signal.data["mob"], + "mobtype" = signal.data["mobtype"], + "realname" = signal.data["realname"], + "name" = signal.data["name"], + "job" = signal.data["job"], + "key" = signal.data["key"], + "vmessage" = signal.data["vmessage"], + "vname" = signal.data["vname"], + "vmask" = signal.data["vmask"], + "compression" = signal.data["compression"], + "message" = signal.data["message"], + "connection" = signal.data["connection"], + "radio" = signal.data["radio"], + "slow" = signal.data["slow"], + "traffic" = signal.data["traffic"], + "type" = signal.data["type"], + "server" = signal.data["server"], + "reject" = signal.data["reject"] + ) + + // Keep the "original" signal constant + if(!signal.data["original"]) + copy.data["original"] = signal + else + copy.data["original"] = signal.data["original"] + + else + del(copy) + + + send_count++ + if(machine.is_freq_listening(signal)) + machine.traffic++ + + if(copysig && copy) + machine.receive_information(copy, src) + else + machine.receive_information(signal, src) + + + if(send_count > 0 && is_freq_listening(signal)) + traffic++ + + return send_count + +/obj/machinery/telecomms/proc/relay_direct_information(datum/signal/signal, obj/machinery/telecomms/machine) + // send signal directly to a machine + machine.receive_information(signal, src) + +/obj/machinery/telecomms/proc/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + // receive information from linked machinery + ..() + +/obj/machinery/telecomms/proc/is_freq_listening(datum/signal/signal) + // return 1 if found, 0 if not found + if((signal.frequency in freq_listening) || (!freq_listening.len)) + return 1 + else + return 0 + +/obj/machinery/telecomms/New() + telecomms_list += src + ..() + if(autolinkers.len) + spawn(15) + // Links nearby machines + if(!long_range_link) + for(var/obj/machinery/telecomms/T in orange(15, src)) + add_link(T) + else + for(var/obj/machinery/telecomms/T in telecomms_list) + add_link(T) + + if(istype(src, /obj/machinery/telecomms/server)) + var/obj/machinery/telecomms/server/S = src + S.Compiler = new() + S.Compiler.Holder = src + +/obj/machinery/telecomms/Del() + telecomms_list -= src + ..() + +/obj/machinery/telecomms/proc/add_link(var/obj/machinery/telecomms/T) + if((src.loc.z && T.loc.z) || (src.long_range_link && T.long_range_link)) + for(var/x in autolinkers) + if(T.autolinkers.Find(x)) + if(!(T in links) && machinetype != T.machinetype) + links.Add(T) + +/obj/machinery/telecomms/update_icon() + if(on) + icon_state = initial(icon_state) + else + icon_state = "[initial(icon_state)]_off" + + +/obj/machinery/telecomms/process() + if(toggled) + if(stat & (BROKEN|NOPOWER) || integrity <= 0) // if powered, on. if not powered, off. if too damaged, off + on = 0 + else + on = 1 + else + on = 0 + + // Check heat and generate some + checkheat() + + // Update the icon + update_icon() + + if(traffic > 0) + traffic -= netspeed + +/obj/machinery/telecomms/proc/checkheat() + // Checks heat from the environment and applies any integrity damage + var/datum/gas_mixture/environment = loc.return_air() + switch(environment.temperature) + if(T0C to (T20C + 20)) + integrity = between(0, integrity, 100) + if((T20C + 20) to (T0C + 70)) + integrity = max(0, integrity - 1) + if(delay) + delay-- + else + // If the machine is on, ready to produce heat, and has positive traffic, genn some heat + if(on && traffic > 0) + produce_heat(heatgen) + delay = initial(delay) + +/obj/machinery/telecomms/proc/produce_heat(heat_amt) + if(heatgen == 0) + return + + if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater. + var/turf/simulated/L = loc + if(istype(L)) + var/datum/gas_mixture/env = L.return_air() + if(env.temperature < (heat_amt+T0C)) + + var/transfer_moles = 0.25 * env.total_moles() + + var/datum/gas_mixture/removed = env.remove(transfer_moles) + + if(removed) + + var/heat_capacity = removed.heat_capacity() + if(heat_capacity == 0 || heat_capacity == null) + heat_capacity = 1 + removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000) + + env.merge(removed) +/* + The receiver idles and receives messages from subspace-compatible radio equipment; + primarily headsets. They then just relay this information to all linked devices, + which can would probably be network buses. + + Link to Processor Units in case receiver can't send to bus units. +*/ + +/obj/machinery/telecomms/receiver + name = "Subspace Receiver" + icon = 'icons/obj/stationobjs.dmi' + icon_state = "broadcast receiver" + desc = "This machine has a dish-like shape and green lights. It is designed to detect and process subspace radio activity." + density = 1 + anchored = 1 + use_power = 1 + idle_power_usage = 30 + machinetype = 1 + heatgen = 0 + circuitboard = "/obj/item/weapon/circuitboard/telecomms/receiver" + +/obj/machinery/telecomms/receiver/receive_signal(datum/signal/signal) + + if(!on) // has to be on to receive messages + return + + if(signal.transmission_method == 2) + + if(is_freq_listening(signal)) // detect subspace signals + var/can_send = relay_information(signal, "/obj/machinery/telecomms/relay") // ideally relay the copied information to relays + if(!can_send) + relay_information(signal, "/obj/machinery/telecomms/bus") // Send it to a bus instead, if it's linked to one + +/* + The HUB idles until it receives information. It then passes on that information + depending on where it came from. + + This is the heart of the Telecommunications Network, sending information where it + is needed. It mainly receives information from long-distance Relays and then sends + that information to be processed. Afterwards it gets the uncompressed information + from Servers/Buses and sends that back to the relay, to then be broadcasted. +*/ + +/obj/machinery/telecomms/hub + name = "Telecommunication Hub" + icon = 'icons/obj/stationobjs.dmi' + icon_state = "hub" + desc = "A mighty piece of hardware used to send/receive massive amounts of data." + density = 1 + anchored = 1 + use_power = 1 + idle_power_usage = 80 + machinetype = 7 + heatgen = 40 + circuitboard = "/obj/item/weapon/circuitboard/telecomms/hub" + long_range_link = 1 + netspeed = 40 + +/obj/machinery/telecomms/hub/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + if(is_freq_listening(signal)) + if(istype(machine_from, /obj/machinery/telecomms/relay)) + + //If the signal is compressed, send it to the bus. + relay_information(signal, "/obj/machinery/telecomms/bus", 1) // ideally relay the copied information to bus units + else + //The signal is ready to be sent! + var/can_send = relay_information(signal, "/obj/machinery/telecomms/relay", 1) + if(!can_send) + relay_information(signal, "/obj/machinery/telecomms/broadcaster", 1) // Send it to a broadcaster instead, if it's linked to one +/* + The relay idles until it receives information. It then passes on that information + depending on where it came from. + + The relay is needed in order to send information pass Z levels. It must be linked + with a HUB, the only other machine that can send/receive pass Z levels. +*/ + +/obj/machinery/telecomms/relay + name = "Telecommunication Relay" + icon = 'icons/obj/stationobjs.dmi' + icon_state = "relay" + desc = "A mighty piece of hardware used to send massive amounts of data far away." + density = 1 + anchored = 1 + use_power = 1 + idle_power_usage = 30 + machinetype = 8 + heatgen = 0 + circuitboard = "/obj/item/weapon/circuitboard/telecomms/relay" + netspeed = 5 + long_range_link = 1 + +/obj/machinery/telecomms/relay/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + + if(is_freq_listening(signal)) + if(istype(machine_from, /obj/machinery/telecomms/receiver)) + + //If the signal is compressed, send it to the bus. + var/can_send = relay_information(signal, "/obj/machinery/telecomms/hub", 1) // ideally relay the copied information to bus units + if(!can_send) + relay_information(signal, "/obj/machinery/telecomms/bus", 1) // Send it to a bus instead, if it's linked to one + else + //The signal is ready to be sent! + relay_information(signal, "/obj/machinery/telecomms/broadcaster", 1) + +/* + The bus mainframe idles and waits for hubs to relay them signals. They act + as junctions for the network. + + They transfer uncompressed subspace packets to processor units, and then take + the processed packet to a server for logging. + + Link to a subspace hub if it can't send to a server. +*/ + +/obj/machinery/telecomms/bus + name = "Bus Mainframe" + icon = 'icons/obj/stationobjs.dmi' + icon_state = "bus" + desc = "A mighty piece of hardware used to send massive amounts of data quickly." + density = 1 + anchored = 1 + use_power = 1 + idle_power_usage = 50 + machinetype = 2 + heatgen = 20 + circuitboard = "/obj/item/weapon/circuitboard/telecomms/bus" + netspeed = 40 + +/obj/machinery/telecomms/bus/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + + if(is_freq_listening(signal)) + if(signal.data["compression"]) // if signal is still compressed from subspace transmission + // send to one linked processor unit + var/send_to_processor = relay_information(signal, "/obj/machinery/telecomms/processor", 1) + + if(!send_to_processor) // failed to send to a processor, relay information anyway + signal.data["slow"] += rand(1, 5) // slow the signal down only slightly + relay_information(signal, "/obj/machinery/telecomms/server", 1) + + + else // the signal has been decompressed by a processor unit + // send to all linked server units + var/sendserver = relay_information(signal, "/obj/machinery/telecomms/server", 1) + + // Can't send to a single server, send to a hub instead! + if(!sendserver) + signal.data["slow"] += rand(0, 1) // slow the signal down only slightly + relay_information(signal, "/obj/machinery/telecomms/hub") + + + +/* + The processor is a very simple machine that decompresses subspace signals and + transfers them back to the original bus. It is essential in producing audible + data. + + Link to servers if bus is not present +*/ + +/obj/machinery/telecomms/processor + name = "Processor Unit" + icon = 'icons/obj/stationobjs.dmi' + icon_state = "processor" + desc = "This machine is used to process large quantities of information." + density = 1 + anchored = 1 + use_power = 1 + idle_power_usage = 30 + machinetype = 3 + heatgen = 100 + delay = 5 + circuitboard = "/obj/item/weapon/circuitboard/telecomms/processor" + + receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + + if(is_freq_listening(signal)) + signal.data["compression"] = 0 // uncompress subspace signal + if(istype(machine_from, /obj/machinery/telecomms/bus)) + relay_direct_information(signal, machine_from) // send the signal back to the machine + else // no bus detected - send the signal to servers instead + signal.data["slow"] += rand(5, 10) // slow the signal down + relay_information(signal, "/obj/machinery/telecomms/server", 1) + + +/* + The server logs all traffic and signal data. Once it records the signal, it sends + it to the subspace broadcaster. + + Store a maximum of 100 logs and then deletes them. +*/ + + +/obj/machinery/telecomms/server + name = "Telecommunication Server" + icon = 'icons/obj/stationobjs.dmi' + icon_state = "comm_server" + desc = "A machine used to store data and network statistics." + density = 1 + anchored = 1 + use_power = 1 + idle_power_usage = 15 + machinetype = 4 + heatgen = 50 + circuitboard = "/obj/item/weapon/circuitboard/telecomms/server" + var/list/log_entries = list() + var/list/stored_names = list() + var/list/TrafficActions = list() + var/logs = 0 // number of logs + var/totaltraffic = 0 // gigabytes (if > 1024, divide by 1024 -> terrabytes) + + var/list/memory = list() // stored memory + var/rawcode = "" // the code to compile (raw text) + var/datum/TCS_Compiler/Compiler // the compiler that compiles and runs the code + var/autoruncode = 0 // 1 if the code is set to run every time a signal is picked up + + var/encryption = "null" // encryption key: ie "password" + var/salt = "null" // encryption salt: ie "123comsat" + // would add up to md5("password123comsat") + var/language = "human" + +/obj/machinery/telecomms/server/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + + if(signal.data["message"]) + + if(is_freq_listening(signal)) + + if(traffic > 0) + totaltraffic += traffic // add current traffic to total traffic + + //Is this a test signal? Bypass logging + if(signal.data["type"] != 4) + + // If signal has a message and appropriate frequency + + update_logs() + + var/datum/comm_log_entry/log = new + var/mob/M = signal.data["mob"] + + // Copy the signal.data entries we want + log.parameters["mobtype"] = signal.data["mobtype"] + log.parameters["job"] = signal.data["job"] + log.parameters["key"] = signal.data["key"] + log.parameters["vmessage"] = signal.data["message"] + log.parameters["vname"] = signal.data["vname"] + log.parameters["message"] = signal.data["message"] + log.parameters["name"] = signal.data["name"] + log.parameters["realname"] = signal.data["realname"] + + if(!istype(M, /mob/new_player) && M) + log.parameters["uspeech"] = M.universal_speak + else + log.parameters["uspeech"] = 0 + + // If the signal is still compressed, make the log entry gibberish + if(signal.data["compression"] > 0) + log.parameters["message"] = Gibberish(signal.data["message"], signal.data["compression"] + 50) + log.parameters["job"] = Gibberish(signal.data["job"], signal.data["compression"] + 50) + log.parameters["name"] = Gibberish(signal.data["name"], signal.data["compression"] + 50) + log.parameters["realname"] = Gibberish(signal.data["realname"], signal.data["compression"] + 50) + log.parameters["vname"] = Gibberish(signal.data["vname"], signal.data["compression"] + 50) + log.input_type = "Corrupt File" + + // Log and store everything that needs to be logged + log_entries.Add(log) + if(!(signal.data["name"] in stored_names)) + stored_names.Add(signal.data["name"]) + logs++ + signal.data["server"] = src + + // Give the log a name + var/identifier = num2text( rand(-1000,1000) + world.time ) + log.name = "data packet ([md5(identifier)])" + + if(Compiler && autoruncode) + Compiler.Run(signal) // execute the code + + relay_information(signal, "/obj/machinery/telecomms/broadcaster", 1) + relay_information(signal, "/obj/machinery/telecomms/hub", 1) + + +/obj/machinery/telecomms/server/proc/setcode(var/t) + if(t) + if(istext(t)) + rawcode = t + +/obj/machinery/telecomms/server/proc/compile() + if(Compiler) + return Compiler.Compile(rawcode) + +/obj/machinery/telecomms/server/proc/update_logs() + // start deleting the very first log entry + if(logs >= 400) + for(var/i = 1, i <= logs, i++) // locate the first garbage collectable log entry and remove it + var/datum/comm_log_entry/L = log_entries[i] + if(L.garbage_collector) + log_entries.Remove(L) + logs-- + break + +/obj/machinery/telecomms/server/proc/add_entry(var/content, var/input) + var/datum/comm_log_entry/log = new + var/identifier = num2text( rand(-1000,1000) + world.time ) + log.name = "[input] ([md5(identifier)])" + log.input_type = input + log.parameters["message"] = content + log_entries.Add(log) + update_logs() + + + + +// Simple log entry datum + +/datum/comm_log_entry + var/parameters = list() // carbon-copy to signal.data[] + var/name = "data packet (#)" + var/garbage_collector = 1 // if set to 0, will not be garbage collected + var/input_type = "Speech File" + + + + +// ### Preset machines (Located at centcom!) (Or the Comms Satellite) ### + +//Relay + +/obj/machinery/telecomms/relay/preset + network = "tcommsat" + +/obj/machinery/telecomms/relay/preset/station + id = "Station Relay" + autolinkers = list("s_relay", "s_receiverB", "s_broadcasterB") + +/obj/machinery/telecomms/relay/preset/telecomms + id = "Telecomms Relay" + autolinkers = list("relay", "receiverA", "receiverB", "broadcasterA", "broadcasterB") + +/obj/machinery/telecomms/relay/preset/mining + id = "Mining Relay" + autolinkers = list("m_relay", "m_receiverB", "m_broadcasterB") + +/obj/machinery/telecomms/relay/preset/ruskie + id = "Ruskie Relay" + hide = 1 + toggled = 0 + autolinkers = list("r_relay", "r_receiverB", "r_broadcasterB") + +//HUB + +/obj/machinery/telecomms/hub/preset + id = "Hub" + network = "tcommsat" + autolinkers = list("hub", "relay", "s_relay", "m_relay", "r_relay", "science", "medical", + "cargo", "mining", "common", "command", "engineering", "security") + +//Receivers + +/obj/machinery/telecomms/receiver/preset_left + id = "Receiver A" + network = "tcommsat" + autolinkers = list("receiverA") // link to relay + freq_listening = list(1351, 1355, 1347, 1349) // science, medical, cargo, mining + +/obj/machinery/telecomms/receiver/preset_right + id = "Receiver B" + network = "tcommsat" + autolinkers = list("receiverB") // link to relay + freq_listening = list(1353, 1357, 1359) //command, engineering, security + + //Common and other radio frequencies for people to freely use + New() + for(var/i = 1441, i < 1489, i += 2) + freq_listening |= i + ..() + +/obj/machinery/telecomms/receiver/preset_right/station + id = "Station Receiver B" + autolinkers = list("s_receiverB") + freq_listening = list(1351, 1355, 1347, 1349, 1353, 1357, 1359) // science, medical, cargo, mining, command, engineering, security + +/obj/machinery/telecomms/receiver/preset_right/mining + id = "Mining Receiver B" + autolinkers = list("m_receiverB") + freq_listening = list(1351, 1355, 1347, 1349, 1353, 1357, 1359) + +/obj/machinery/telecomms/receiver/preset_right/ruskie + id = "Ruskie Receiver B" + autolinkers = list("r_receiverB") + freq_listening = list(1351, 1355, 1347, 1349, 1353, 1357, 1359) // science, medical, cargo, mining, command, engineering, security + toggled = 0 + hide = 1 + + +//Buses + +/obj/machinery/telecomms/bus/preset_one + id = "Bus 1" + network = "tcommsat" + autolinkers = list("processor1", "science", "medical") + +/obj/machinery/telecomms/bus/preset_two + id = "Bus 2" + network = "tcommsat" + autolinkers = list("processor2", "cargo", "mining") + +/obj/machinery/telecomms/bus/preset_three + id = "Bus 3" + network = "tcommsat" + autolinkers = list("processor3", "security", "command") + +/obj/machinery/telecomms/bus/preset_four + id = "Bus 4" + network = "tcommsat" + autolinkers = list("processor4", "engineering", "common") + + +//Processors + +/obj/machinery/telecomms/processor/preset_one + id = "Processor 1" + network = "tcommsat" + autolinkers = list("processor1") // processors are sort of isolated; they don't need backward links + +/obj/machinery/telecomms/processor/preset_two + id = "Processor 2" + network = "tcommsat" + autolinkers = list("processor2") + +/obj/machinery/telecomms/processor/preset_three + id = "Processor 3" + network = "tcommsat" + autolinkers = list("processor3") + +/obj/machinery/telecomms/processor/preset_four + id = "Processor 4" + network = "tcommsat" + autolinkers = list("processor4") + +//Servers + +/obj/machinery/telecomms/server/presets + + network = "tcommsat" + +/obj/machinery/telecomms/server/presets/science + id = "Science Server" + freq_listening = list(1351) + autolinkers = list("science") + +/obj/machinery/telecomms/server/presets/medical + id = "Medical Server" + freq_listening = list(1355) + autolinkers = list("medical") + +/obj/machinery/telecomms/server/presets/cargo + id = "Cargo Server" + freq_listening = list(1347) + autolinkers = list("cargo") + +/obj/machinery/telecomms/server/presets/mining + id = "Mining Server" + freq_listening = list(1349) + autolinkers = list("mining") + +/obj/machinery/telecomms/server/presets/common + id = "Common Server" + freq_listening = list() + autolinkers = list("common") + + //Common and other radio frequencies for people to freely use + // 1441 to 1489 +/obj/machinery/telecomms/server/presets/common/New() + for(var/i = 1441, i < 1489, i += 2) + freq_listening |= i + ..() + +/obj/machinery/telecomms/server/presets/command + id = "Command Server" + freq_listening = list(1353) + autolinkers = list("command") + +/obj/machinery/telecomms/server/presets/engineering + id = "Engineering Server" + freq_listening = list(1357) + autolinkers = list("engineering") + +/obj/machinery/telecomms/server/presets/security + id = "Security Server" + freq_listening = list(1359) + autolinkers = list("security") + + +//Broadcasters + +/obj/machinery/telecomms/broadcaster/preset_left + id = "Broadcaster A" + network = "tcommsat" + autolinkers = list("broadcasterA") + +/obj/machinery/telecomms/broadcaster/preset_right + id = "Broadcaster B" + network = "tcommsat" + autolinkers = list("broadcasterB") + + +/obj/machinery/telecomms/broadcaster/preset_right/station + id = "Station Broadcaster B" + autolinkers = list("s_broadcasterB") + + +/obj/machinery/telecomms/broadcaster/preset_right/mining + id = "Mining Broadcaster B" + autolinkers = list("m_broadcasterB") + +/obj/machinery/telecomms/broadcaster/preset_right/ruskie + id = "Ruskie Broadcaster B" + autolinkers = list("r_broadcasterB") + toggled = 0 + hide = 1 + + + + + + + + diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm index 8c336ba3cb..dfc4c976a3 100644 --- a/code/game/machinery/telecomms/telemonitor.dm +++ b/code/game/machinery/telecomms/telemonitor.dm @@ -33,9 +33,9 @@ if(0) dat += "
      [temp]

      " dat += "
      Current Network: [network]
      " - if(machines.len) + if(machinelist.len) dat += "
      Detected Network Entities:
        " - for(var/obj/machinery/telecomms/T in machines) + for(var/obj/machinery/telecomms/T in machinelist) dat += "
      • \ref[T] [T.name] ([T.id])
      • " dat += "
      " dat += "
      \[Flush Buffer\]" @@ -52,7 +52,8 @@ dat += "Selected Network Entity: [SelectedMachine.name] ([SelectedMachine.id])
      " dat += "Linked Entities:
        " for(var/obj/machinery/telecomms/T in SelectedMachine.links) - dat += "
      1. \ref[T.id] [T.name] ([T.id])
      2. " + if(!T.hide) + dat += "
      3. \ref[T.id] [T.name] ([T.id])
      4. " dat += "
      " @@ -74,7 +75,7 @@ if(href_list["viewmachine"]) screen = 1 - for(var/obj/machinery/telecomms/T in machines) + for(var/obj/machinery/telecomms/T in machinelist) if(T.id == href_list["viewmachine"]) SelectedMachine = T break @@ -90,18 +91,18 @@ screen = 0 if("probe") - if(machines.len > 0) + if(machinelist.len > 0) temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -" else for(var/obj/machinery/telecomms/T in range(25, src)) if(T.network == network) - machines.Add(T) + machinelist.Add(T) - if(!machines.len) + if(!machinelist.len) temp = "- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -" else - temp = "- [machines.len] ENTITIES LOCATED & BUFFERED -" + temp = "- [machinelist.len] ENTITIES LOCATED & BUFFERED -" screen = 0 @@ -124,7 +125,7 @@ attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) if(istype(D, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -150,7 +151,7 @@ A.anchored = 1 del(src) else if(istype(D, /obj/item/weapon/card/emag) && !emagged) - playsound(src.loc, 'sparks4.ogg', 75, 1) + playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 user << "\blue You you disable the security protocols" src.updateUsrDialog() diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm index 12292ce27f..0e9a72511e 100644 --- a/code/game/machinery/telecomms/traffic_control.dm +++ b/code/game/machinery/telecomms/traffic_control.dm @@ -68,7 +68,7 @@ - req_access = list(ACCESS_TCOMSAT) + req_access = list(access_tcomsat) attack_hand(mob/user as mob) if(stat & (BROKEN|NOPOWER)) @@ -208,7 +208,7 @@ attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) if(istype(D, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if (src.stat & BROKEN) user << "\blue The broken glass falls out." @@ -234,7 +234,7 @@ A.anchored = 1 del(src) else if(istype(D, /obj/item/weapon/card/emag) && !emagged) - playsound(src.loc, 'sparks4.ogg', 75, 1) + playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 user << "\blue You you disable the security protocols" src.updateUsrDialog() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 9ddf465877..bd3fe6284a 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -7,28 +7,37 @@ var/id = null /obj/machinery/computer/teleporter/New() - src.id = text("[]", rand(1000, 9999)) + src.id = "[rand(1000, 9999)]" ..() return -/obj/machinery/computer/teleporter/attackby(I as obj, user as mob) + +//TODO: Merge this proc with attack_hand() code so that this actually uses the teleporter procs instead of just bypassing everything +/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob) if (istype(I, /obj/item/weapon/card/data/)) var/obj/item/weapon/card/data/M = I if(stat & (NOPOWER|BROKEN) & (M.function != "teleporter")) src.attack_hand() + //Quickfix for hiding nuke disks and people getting to centcomm until I can get the attack_hand() stuff to incorperate this. + for(var/obj/O in user.get_contents()) + if(istype(O, /obj/item/weapon/disk/nuclear) || istype(O, /obj/item/device/radio/beacon) || istype(O, /obj/item/weapon/storage/backpack/holding)) + user << "Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through." + return + var/obj/S = null for(var/obj/effect/landmark/sloc in world) if (sloc.name != M.data) continue - if (locate(/mob) in sloc.loc) + if (locate(/mob/living) in sloc.loc) continue S = sloc break - if (!S) + if(!S) S = locate("landmark*[M.data]") // use old stype - if (istype(S, /obj/effect/landmark/) && istype(S.loc, /turf)) - usr.loc = S.loc + if(istype(S, /obj/effect/landmark/) && istype(S.loc, /turf)) + user.loc = S.loc + user.drop_item() del(I) return else @@ -38,12 +47,6 @@ /obj/machinery/computer/teleporter/attack_paw() src.attack_hand() -/obj/machinery/computer/teleporter/security/attackby(obj/item/weapon/W) - src.attack_hand() - -/obj/machinery/computer/teleporter/security/attack_paw() - src.attack_hand() - /obj/machinery/teleport/station/attack_ai() src.attack_hand() @@ -68,7 +71,7 @@ L[tmpname] = R for (var/obj/item/weapon/implant/tracking/I in world) - if (!I.implanted || !(istype(I.loc,/datum/organ/external) || ismob(loc))) + if (!I.implanted || !ismob(I.loc)) continue else var/mob/M = I.loc @@ -85,11 +88,10 @@ areaindex[tmpname] = 1 L[tmpname] = I - var/desc = input("Please select a location to lock in.", "Locking Computer") as null|anything in L - if(desc) - src.locked = L[desc] - for(var/mob/O in hearers(src, null)) - O.show_message("\blue Locked In", 2) + var/desc = input("Please select a location to lock in.", "Locking Computer") in L + src.locked = L[desc] + for(var/mob/O in hearers(src, null)) + O.show_message("\blue Locked In", 2) src.add_fingerprint(usr) return @@ -105,6 +107,14 @@ src.id = t return +/proc/find_loc(obj/R as obj) + if (!R) return null + var/turf/T = R.loc + while(!istype(T, /turf)) + T = T.loc + if(!T || istype(T, /area)) return null + return T + /obj/machinery/teleport/hub/Bumped(M as mob|obj) spawn() if (src.icon_state == "tele1") @@ -123,7 +133,7 @@ return if (istype(M, /atom/movable)) if(prob(5) && !accurate) //oh dear a problem, put em in deep space - do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy - 5), 3), 2) + do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), 3), 2) else do_teleport(M, com.locked) //dead-on precision else diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 2bdd535798..15ec833373 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -3,16 +3,14 @@ var/list/turretTargets = list() /area/turret_protected/proc/subjectDied(target) - if( ismob(target) ) + if( isliving(target) ) if( !issilicon(target) ) - if( target:stat ) - if( target in turretTargets ) - src.Exited(target) + var/mob/living/L = target + if( L.stat ) + if( L in turretTargets ) + src.Exited(L) -//TODO: make teleporting to places trigger Entered() ~Carn -// Done. - /area/turret_protected/Entered(O) ..() if( master && master != src ) @@ -24,6 +22,8 @@ var/obj/mecha/Mech = O if( Mech.occupant ) turretTargets |= Mech + else if(istype(O,/mob/living/simple_animal)) + turretTargets |= O return 1 /area/turret_protected/Exited(O) @@ -40,13 +40,13 @@ /obj/machinery/turret name = "turret" - icon = 'turrets.dmi' + icon = 'icons/obj/turrets.dmi' icon_state = "grey_target_prism" var/raised = 0 var/enabled = 1 anchored = 1 layer = 3 - invisibility = 2 + invisibility = INVISIBILITY_LEVEL_TWO density = 1 var/lasers = 0 var/lasertype = 1 @@ -56,8 +56,7 @@ // 4 = change (HONK) // 5 = bluetag // 6 = redtag - var/health = 18 - var/id = "" + var/health = 80 var/obj/machinery/turretcover/cover = null var/popping = 0 var/wasvalid = 0 @@ -83,7 +82,7 @@ /obj/machinery/turretcover name = "pop-up turret cover" - icon = 'turrets.dmi' + icon = 'icons/obj/turrets.dmi' icon_state = "turretCover" anchored = 1 layer = 3.5 @@ -140,6 +139,11 @@ var/obj/mecha/ME = T if( ME.occupant ) return 1 + else if(istype(T,/mob/living/simple_animal)) + var/mob/living/simple_animal/A = T + if( !A.stat ) + if(lasers) + return 1 return 0 /obj/machinery/turret/proc/get_new_target() @@ -152,6 +156,9 @@ for(var/obj/mecha/M in protected_area.turretTargets) if(M.occupant) new_targets += M + for(var/mob/living/simple_animal/M in protected_area.turretTargets) + if(!M.stat) + new_targets += M if(new_targets.len) new_target = pick(new_targets) return new_target @@ -226,7 +233,7 @@ A.yo = U.y - T.y A.xo = U.x - T.x spawn( 0 ) - A.fired() + A.process() return @@ -251,20 +258,21 @@ src.cover.icon_state = "turretCover" spawn(10) if (popping==-1) - invisibility = 2 + invisibility = INVISIBILITY_LEVEL_TWO popping = 0 /obj/machinery/turret/bullet_act(var/obj/item/projectile/Proj) src.health -= Proj.damage ..() if(prob(45) && Proj.damage > 0) src.spark_system.start() + del (Proj) if (src.health <= 0) src.die() return /obj/machinery/turret/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N ..() - playsound(src.loc, 'smash.ogg', 60, 1) + playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1) src.spark_system.start() src.health -= W.force * 0.5 if (src.health <= 0) @@ -297,44 +305,32 @@ /obj/machinery/turretid name = "Turret deactivation control" - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "motion3" anchored = 1 density = 0 var/enabled = 1 - var/id = "" var/lethal = 0 var/locked = 1 var/control_area //can be area name, path or nothing. var/ailock = 0 // AI cannot use this - req_access = list(ACCESS_AI_UPLOAD) - var/similar_controls - var/turrets - -/obj/machinery/turretid/east - pixel_x = 28 - -/obj/machinery/turretid/south - pixel_y = -28 - -/obj/machinery/turretid/west - pixel_x = -28 - -/obj/machinery/turretid/north - pixel_y = 28 + req_access = list(access_ai_upload) /obj/machinery/turretid/New() ..() - spawn(10) // allow map load - turrets = list() - for(var/obj/machinery/turret/T in world) - if(T.id == id) - turrets += T - - similar_controls = list() // On modifying a control, all the similar controls should change their icon_state as well - for(var/obj/machinery/turretid/TC in world) - if(TC.id == id && TC != src) - similar_controls += TC + if(!control_area) + var/area/CA = get_area(src) + if(CA.master && CA.master != CA) + control_area = CA.master + else + control_area = CA + else if(istext(control_area)) + for(var/area/A in world) + if(A.name && A.name==control_area) + control_area = A + break + //don't have to check if control_area is path, since get_area_all_atoms can take path. + return /obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user) if(stat & BROKEN) return @@ -402,9 +398,27 @@ onclose(user, "turretid") +/obj/machinery/turret/attack_animal(mob/living/simple_animal/M as mob) + if(M.melee_damage_upper == 0) return + if(!(stat & BROKEN)) + for(var/mob/O in viewers(src, null)) + if ((O.client && !( O.blinded ))) + O.show_message(text("\red [M] [M.attacktext] [src]!"), 1) + M.attack_log += text("\[[time_stamp()]\] attacked [src.name]") + //src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") + src.health -= M.melee_damage_upper + if (src.health <= 0) + src.die() + else + M << "\red That object is useless to you." + return + + + + /obj/machinery/turret/attack_alien(mob/living/carbon/alien/humanoid/M as mob) if(!(stat & BROKEN)) - playsound(src.loc, 'slash.ogg', 25, 1, -1) + playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1) for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has slashed at []!", M, src), 1) @@ -415,6 +429,8 @@ M << "\green That object is useless to you." return + + /obj/machinery/turretid/Topic(href, href_list) ..() if (src.locked) @@ -439,18 +455,12 @@ /obj/machinery/turretid/proc/update_icons() if (src.enabled) if (src.lethal) - src.icon_state = "motion1" - for(var/obj/machinery/turretid/TC in src.similar_controls) //Change every similar control's icon as well - TC.icon_state = "motion1" + icon_state = "motion1" else - src.icon_state = "motion3" - for(var/obj/machinery/turretid/TC in src.similar_controls) - TC.icon_state = "motion3" + icon_state = "motion3" else - src.icon_state = "motion0" - for(var/obj/machinery/turretid/TC in src.similar_controls) - TC.icon_state = "motion0" - + icon_state = "motion0" + //CODE FIXED BUT REMOVED // if(control_area) //USE: updates other controls in the area // for (var/obj/machinery/turretid/Turret_Control in world) //I'm not sure if this is what it was // if( Turret_Control.control_area != src.control_area ) continue //supposed to do. Or whether the person @@ -460,9 +470,6 @@ //If he wants it back he can uncomment it - for (var/obj/machinery/turret/aTurret in turrets) - aTurret.setState(enabled, lethal) - /obj/structure/turret/gun_turret name = "Gun Turret" density = 1 @@ -477,8 +484,7 @@ var/health = 40 var/list/scan_for = list("human"=0,"cyborg"=0,"mecha"=0,"alien"=1) var/on = 0 - var/processing = 0 //So we dun get dozens of duplicate while loops - icon = 'turrets.dmi' + icon = 'icons/obj/turrets.dmi' icon_state = "gun_turret" @@ -568,20 +574,16 @@ process() - if(!processing) - spawn - while(on) - processing = 1 - if(projectiles<=0) - on = 0 - return - if(cur_target && !validate_target(cur_target)) - cur_target = null - if(!cur_target) - cur_target = get_target() - fire(cur_target) - sleep(cooldown) - processing = 0 + spawn while(on) + if(projectiles<=0) + on = 0 + return + if(cur_target && !validate_target(cur_target)) + cur_target = null + if(!cur_target) + cur_target = get_target() + fire(cur_target) + sleep(cooldown) return proc/get_target() @@ -630,12 +632,12 @@ continue if (targloc == curloc) continue - playsound(src, 'Gunshot.ogg', 50, 1) + playsound(src, 'sound/weapons/Gunshot.ogg', 50, 1) var/obj/item/projectile/A = new /obj/item/projectile(curloc) src.projectiles-- A.current = curloc A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x - A.fired() + A.process() sleep(2) return diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index ab776706a8..be78e482d9 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -1,55 +1,34 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 - -/* -Important notice: I changed "vendingwindow" to "vendingwindow_n" (n for new) because -I extended the window's height a small amount and, for some reason, BYOND saves the -height of all the panels on the player's computer in a text file. This means the -players see some madly-deformed piece of shit window instead of what is intended. - -To combat this, I changed the window name. -- Doohl -*/ - -#define PRODUCTS_PER_PAGE 15 // # of products per page - /obj/machinery/vending var/const/WIRE_EXTEND = 1 var/const/WIRE_SCANID = 2 var/const/WIRE_SHOCK = 3 var/const/WIRE_SHOOTINV = 4 - var/page - var/builtpaths = 0 - var/lastpaths /datum/data/vending_product var/product_name = "generic" var/product_path = null var/amount = 0 - var/price = 0 - var/charge_amount = 0 var/display_color = "blue" /obj/machinery/vending/New() ..() - page = 1 spawn(4) - src.slogan_list = dd_text2List(src.product_slogans, ";") - //src.small_ads = dd_text2List(src.product_ads, ";") // huehue - var/list/temp_paths = dd_text2List(src.product_paths, ";") -// var/list/temp_amounts = dd_text2List(src.product_amounts, ";") - var/list/temp_hidden = dd_text2List(src.product_hidden, ";") -// var/list/temp_hideamt = dd_text2List(src.product_hideamt, ";") - var/list/temp_coin = dd_text2List(src.product_coin, ";") - var/list/temp_coin_amt = dd_text2List(src.product_coin_amt, ";") - var/list/temp_prices = dd_text2list(src.product_prices, ";") - var/list/temp_hiddenprices = dd_text2list(src.hidden_prices, ";") + src.slogan_list = dd_text2list(src.product_slogans, ";") + var/list/temp_paths = dd_text2list(src.product_paths, ";") + var/list/temp_amounts = dd_text2list(src.product_amounts, ";") + var/list/temp_hidden = dd_text2list(src.product_hidden, ";") + var/list/temp_hideamt = dd_text2list(src.product_hideamt, ";") + var/list/temp_coin = dd_text2list(src.product_coin, ";") + var/list/temp_coin_amt = dd_text2list(src.product_coin_amt, ";") //Little sanity check here - if ((isnull(temp_paths)) || (isnull(temp_prices)) || (temp_paths.len != temp_prices.len)) + if ((isnull(temp_paths)) || (isnull(temp_amounts)) || (temp_paths.len != temp_amounts.len) || (temp_hidden.len != temp_hideamt.len)) stat |= BROKEN + power_change() return - src.build_inventory(temp_paths,temp_prices) + src.build_inventory(temp_paths,temp_amounts) //Add hidden inventory - src.build_inventory(temp_hidden,temp_hiddenprices,1) + src.build_inventory(temp_hidden,temp_hideamt, 1) src.build_inventory(temp_coin,temp_coin_amt, 0, 1) power_change() return @@ -93,16 +72,18 @@ To combat this, I changed the window name. -- Doohl var/datum/data/vending_product/R = new /datum/data/vending_product( ) R.product_name = capitalize(temp.name) R.product_path = path_list[p] - R.charge_amount = R.amount + R.display_color = pick("red","blue","green") +// R.amount = text2num(amt_list[p]) +// src.product_records += R if(hidden) - R.price = text2num(amt_list[p]) + R.amount = text2num(amt_list[p]) src.hidden_records += R else if(req_coin) R.amount = text2num(amt_list[p]) src.coin_records += R else - R.price = text2num(amt_list[p]) + R.amount = text2num(amt_list[p]) src.product_records += R del(temp) @@ -111,237 +92,11 @@ To combat this, I changed the window name. -- Doohl continue return -/obj/machinery/vending/proc/updateWindow(mob/user as mob, var/rebuild = 1) - - winset(user, "vendingwindow_n.title", "text=\"[src.name]\"") - winset(user, "vendingwindow_n.advert", "text=\"\"") - winset(user, "vendingwindow_n.label2", "text=\"Points: [points]\"") - - /*if(prob(25) && small_ads.len) - var/advert = pick(small_ads) - winset(user, "vendingwindow_n.advert", "text=\"[advert]\"")*/ - - // Create a list of things to display - var/list/products = src.product_records - if(extended_inventory) - products |= src.hidden_records - if(coin) - products |= src.coin_records - winshow(user, "vendingwindow_n.coinbutton", 1) - else - winshow(user, "vendingwindow_n.coinbutton", 0) - - if(rebuild) // rebuild the buttons and shit - for(var/i = 1, i <= PRODUCTS_PER_PAGE, i++) // "refresh" everything to default state - winshow(user, "vendingwindow_n.stock[i]", 0) - winshow(user, "vendingwindow_n.product[i]", 0) - winset(user, "vendingwindow_n.product[i]", "is-disabled=false") - winset(user, "vendingwindow_n.product[i]", "command=\"skincmd vending;buy[i-1]\"") - - if(i % 2 == 0) // even number (remainder of i / 2 == 0) - winset(user, "vendingwindow_n.product[i]", "background-color=#78A6C7") // Specific even color - else - winset(user, "vendingwindow_n.product[i]", "background-color=#8BA5B4") // Odd color - - for (var/i = 1, i <= products.len, i++) // loop through all products - if(i > PRODUCTS_PER_PAGE) // too many products, don't display on this page! - break - - // Locate our product: - - if(products.len < ((page-1) * PRODUCTS_PER_PAGE) + i) - continue - var/datum/data/vending_product/product = products[((page-1) * PRODUCTS_PER_PAGE) + i] // ie.: (1-0) * (15) + 1 = index 1 [start of 1st page] - // or : (2-1) * (15) + 1 = index 16 [start of 2nd page] - // Product located: display information - if(product) - winshow(user, "vendingwindow_n.stock[i]", 1) // unhide things - winshow(user, "vendingwindow_n.product[i]", 1) // unhide things - if(!(product in coin_records)) - winset(user, "vendingwindow_n.stock[i]", "text=\"[product.price]\"") // set stock number label - else - winset(user, "vendingwindow_n.stock[i]", "text=\"[product.amount]\"") // set stock number label - winset(user, "vendingwindow_n.product[i]", "text=\"[product.product_name]\"") // set product button name - - if(product.amount <= 0 && product.price > points) - winset(user, "vendingwindow_n.product[i]", "is-disabled=true") // disable product button, makes it unclickable and gives it that "disabled" look - winset(user, "vendingwindow_n.product[i]", "background-color=#526F7C") // Darken the button - - // Calculate the number of pages in total - var/pages = -round(-products.len / PRODUCTS_PER_PAGE) - - /* Ok, it took me a while to figure out why double negatives were even necessary, but eventually I got it: - Basically, instead of a small decimal number rounding to 0 it'd round to 1. - Really fucking bizarre but okay I guess it works?? - */ - - winset(user, "vendingwindow_n.page", "text=[page]/[pages]") - - - if(page >= pages) - // Disable the forward page button if max page >= current - winset(user, "vendingwindow_n.forwardbutton", "is-disabled=true") - - else - winset(user, "vendingwindow_n.forwardbutton", "is-disabled=false") - - if(page <= 1) - // Disable the backwards page button if max page <= 1 - winset(user, "vendingwindow_n.backbutton", "is-disabled=true") - else - winset(user, "vendingwindow_n.backbutton", "is-disabled=false") - - - /* // Old code. I don't really like it, also I kind of needed to rewrite this stuff -- Doohl - - for (var/i = 1, i <= 6, i++) - //winclone(user, "vendingslot", "vendingslot[i]") - winset(user, "vendingwindow_n.slot[i]", "left=vendingslot[i]") - winset(user, "vendingslot[i].buy", "command=\"skincmd vending;buy[i-1]\"") - - winset(user, "vendingwindow_n.title", "text=\"[src.name]\"") - var/list/products = src.product_records - if(extended_inventory) - products |= src.hidden_records - if(coin) - products |= src.coin_records - var/pages = -round(-products.len / 6) - if (page > pages) - page = pages - winset(user, "vendingwindow_n.page", "text=[page]/[pages]") - - var/base = (page-1)*6+1 - for (i = 0, i < 6, i++) - if (products.len >= base + i) - var/datum/data/vending_product/product = products[base + i] - winset(user, "vendingslot[i+1].name", "text=\"[product.product_name]\"") - if (product.amount > 0) - winset(user, "vendingslot[i+1].stock", "text=\"Left in stock: [product.amount]\"") - winset(user, "vendingslot[i+1].stock", "text-color=\"#000000\"") - winshow(user, "vendingslot[i+1].buy", 1) - else - winset(user, "vendingslot[i+1].stock", "text=\"OUT OF STOCK\"") - winset(user, "vendingslot[i+1].stock", "text-color=\"#FF0000\"") - winshow(user, "vendingslot[i+1].buy", 0) - winshow(user, "vendingwindow_n.slot[i+1]", 1) - else - winshow(user, "vendingwindow_n.slot[i+1]", 0) - */ - -/obj/machinery/vending/SkinCmd(mob/user as mob, var/data as text) - if (get_dist(user, src) > 1) - return - - var/list/products = src.product_records - if(extended_inventory) - products |= src.hidden_records - if(coin) - products |= src.coin_records - - - var/pages = -round(-products.len / PRODUCTS_PER_PAGE) - switch(data) - if ("pagen") - page++ - if (page > pages) - page = pages - updateWindow(user) - if ("pagep") - page-- - if (page < 1) - page = 1 - updateWindow(user) - if ("coin") - if(!coin) - user << "There is no coin in this machine." - return - - coin.loc = src.loc - if(!user.get_active_hand()) - user.put_in_hand(coin) - user << "\blue You remove the [coin] from the [src]" - coin = null - updateWindow(user) - - if (copytext(data, 1, 4) == "buy") - var/base = (page-1) * PRODUCTS_PER_PAGE + 1 - var/num = text2num(copytext(data, 4)) - if (products.len < base + num) - return - var/datum/data/vending_product/R = products[base + num] - var/product_path = text2path(R.product_path) - - if (R.amount <= 0 && !R.price) - return - if (!src.vend_ready) - return - - if ((!src.allowed(usr)) && (!src.emagged) && (src.wires & WIRE_SCANID)) //For SECURE VENDING MACHINES YEAH - usr << "\red Access denied." //Unless emagged of course - flick(src.icon_deny,src) - return - - if (R in coin_records) - if(!coin) - usr << "\blue You need to insert a coin to get this item." - return - if(coin.string_attached) - if(prob(80)) - usr << "\blue You successfully pull the coin out before the [src] could swallow it." - else - usr << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all." - del(coin) - else - del(coin) - - if(R.amount) - R.amount-- - //src.vend_ready = 0 - - /* - FOLKS IN IRC RULED THAT THIS WAS SHITTY -- Doohl - No more delays! Go nuts~~~~~~~~~~~ - - A 20 second delay is stupid, a 2 second delay however, is not. -- Nodrak - No more greyshirts intentionally crashing clients through vended item spam! - */ - - if(((src.last_reply + (src.vend_delay + 50)) <= world.time) && src.vend_reply) - spawn(0) - src.speak(src.vend_reply) - src.last_reply = world.time - - use_power(5) - if (src.icon_vend) //Show the vending animation if needed - flick(src.icon_vend,src) - - spawn(src.vend_delay) - src.vend_ready = 1 - - if(R.price <= points) - new product_path(get_turf(src)) - points -= R.price - else - usr << "The machine does not have enough points to do this!" - - if(R) - if(R in coin_records) - updateWindow(user) - return - - updateWindow(user, 0) - - /obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return src.emagged = 1 - user << "You short out the ID lock on [src]" + user << "You short out the product lock on [src]" return else if(istype(W, /obj/item/weapon/screwdriver)) src.panel_open = !src.panel_open @@ -355,33 +110,15 @@ To combat this, I changed the window name. -- Doohl if(src.panel_open) attack_hand(user) return - else if(istype(W, /obj/item/weapon/coin)) - if(product_coin == "" || !product_coin) - user << "\blue This machine doesn't have a coin slot." - return - + else if(istype(W, /obj/item/weapon/coin) && product_coin != "") user.drop_item() W.loc = src coin = W user << "\blue You insert the [W] into the [src]" - updateWindow(user) return - else if(istype(W,/obj/item/weapon/vending_charge/)) - DoCharge(W,user) else ..() -/obj/machinery/vending/proc/DoCharge(obj/item/weapon/vending_charge/V as obj, mob/user as mob) - if(charge_type == V.charge_type) -// var/datum/data/vending_product/R -// for(var/i=1, i<=product_records.len, i++) -// R = product_records[i] -// R.amount += R.charge_amount -// product_records[i] = R - points += V.charge_amt - del(V) - user << "You insert the charge into the machine." - /obj/machinery/vending/attack_paw(mob/user as mob) return attack_hand(user) @@ -397,16 +134,32 @@ To combat this, I changed the window name. -- Doohl if(src.shock(user, 100)) return - updateWindow(user) - winshow(user, "vendingwindow_n", 1) - user.skincmds["vending"] = src + var/dat = "Select an item:
      " - var/dat = "[src.name]" + if (product_coin != "") + dat += "Coin slot: [coin ? coin : "No coin inserted"] (Remove)

      " - if(coin) - dat += "
      There is a [coin.name] in the slot!" + if (src.product_records.len == 0) + dat += "No product loaded!" else - dat += "
      The coin slot is empty." + var/list/display_records = src.product_records + if(src.extended_inventory) + display_records = src.product_records + src.hidden_records + if(src.coin) + display_records = src.product_records + src.coin_records + if(src.coin && src.extended_inventory) + display_records = src.product_records + src.hidden_records + src.coin_records + + for (var/datum/data/vending_product/R in display_records) + dat += "[R.product_name]:" + dat += " [R.amount] " + if (R.amount > 0) + dat += "Vend" + else + dat += "SOLD OUT" + dat += "
      " + + dat += "
      " if(panel_open) var/list/vendwires = list( @@ -415,7 +168,7 @@ To combat this, I changed the window name. -- Doohl "Goldenrod" = 3, "Green" = 4, ) - dat += "
      Access Panel
      " + dat += "


      Access Panel
      " for(var/wiredesc in vendwires) var/is_uncut = src.wires & APCWireColorToFlag[vendwires[wiredesc]] dat += "[wiredesc] wire: " @@ -432,11 +185,12 @@ To combat this, I changed the window name. -- Doohl dat += "The green light is [src.extended_inventory ? "on" : "off"].
      " dat += "The [(src.wires & WIRE_SCANID) ? "purple" : "yellow"] light is on.
      " - if(product_slogans != "") + if (product_slogans != "") dat += "The speaker switch is [src.shut_up ? "off" : "on"]. Toggle" - user << browse(dat, "") + user << browse(dat, "window=vending") onclose(user, "") + return /obj/machinery/vending/Topic(href, href_list) if(stat & (BROKEN|NOPOWER)) @@ -461,11 +215,9 @@ To combat this, I changed the window name. -- Doohl coin.loc = src.loc if(!usr.get_active_hand()) - usr.put_in_hand(coin) + usr.put_in_hands(coin) usr << "\blue You remove the [coin] from the [src]" coin = null - updateWindow(usr) - usr.skincmds["vending"] = src if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) @@ -525,19 +277,17 @@ To combat this, I changed the window name. -- Doohl else if ((href_list["cutwire"]) && (src.panel_open)) var/twire = text2num(href_list["cutwire"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if (src.isWireColorCut(twire)) src.mend(twire) else src.cut(twire) - updateWindow(usr) - usr.skincmds["vending"] = src else if ((href_list["pulsewire"]) && (src.panel_open)) var/twire = text2num(href_list["pulsewire"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if (src.isWireColorCut(twire)) @@ -545,8 +295,6 @@ To combat this, I changed the window name. -- Doohl return else src.pulse(twire) - updateWindow(usr) - usr.skincmds["vending"] = src else if ((href_list["togglevoice"]) && (src.panel_open)) src.shut_up = !src.shut_up @@ -568,13 +316,13 @@ To combat this, I changed the window name. -- Doohl if(src.seconds_electrified > 0) src.seconds_electrified-- - /*Pitch to the people! Really sell it! - if(prob(5) && ((src.last_slogan + src.slogan_delay) <= world.time) && (src.slogan_list.len > 0) && (!src.shut_up)) + //Pitch to the people! Really sell it! + if(((src.last_slogan + src.slogan_delay) <= world.time) && (src.slogan_list.len > 0) && (!src.shut_up) && prob(5)) var/slogan = pick(src.slogan_list) src.speak(slogan) - src.last_slogan = world.time*/ + src.last_slogan = world.time - if((prob(2)) && (src.shoot_inventory)) + if(src.shoot_inventory && prob(2)) src.throw_item() return diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index 5011601c11..fc03ff5ad6 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -1,10 +1,6 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 - -var/use_uristrunes = 1 - - var/wordtravel = null var/wordself = null var/wordsee = null @@ -59,7 +55,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", /obj/effect/rune desc = "" anchored = 1 - icon = 'rune.dmi' + icon = 'icons/obj/rune.dmi' icon_state = "1" var/visibility = 0 unacidable = 1 @@ -100,29 +96,30 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", // join hide technology - stun rune. Rune color: bright pink. New() ..() - for(var/mob/living/silicon/ai/AI in world) - if(AI.client) - var/image/blood = image('blood.dmi', loc = src, icon_state = "floor[rand(1,7)]") - blood.override = 1 - AI.client.images += blood + var/image/blood = image(loc = src) + blood.override = 1 + for(var/mob/living/silicon/ai/AI in player_list) + AI.client.images += blood examine() set src in view(2) if(!iscultist(usr)) usr << "A strange collection of symbols drawn in blood." + return + /* Explosions... really? if(desc && !usr.stat) usr << "It reads: [desc]." sleep(30) explosion(src.loc, 0, 2, 5, 5) if(src) del(src) - return - + */ if(!desc) usr << "A spell circle drawn in blood. It reads: [word1] [word2] [word3]." else usr << "Explosive Runes inscription in blood. It reads: [desc]." + return @@ -138,14 +135,14 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", return - attack_hand(mob/user as mob) + attack_hand(mob/living/user as mob) if(!iscultist(user)) user << "You can't mouth the arcane scratchings without fumbling over them." return - if(istype(user.wear_mask, /obj/item/clothing/mask/muzzle) || user.ear_deaf) - user << "You need to be able to both speak and hear to use runes." + if(istype(user.wear_mask, /obj/item/clothing/mask/muzzle)) + user << "You are unable to speak the words of the rune." return - if(!word1 || !word2 || !word3 || prob(usr.getBrainLoss())) + if(!word1 || !word2 || !word3 || prob(user.getBrainLoss())) return fizzle() // if(!src.visibility) // src.visibility=1 @@ -212,10 +209,6 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", return check_icon() - if(use_uristrunes) - icon = get_uristrune_cult(word1, word2, word3) - return - if(word1 == wordtravel && word2 == wordself) icon_state = "2" src.icon += rgb(0, 0 , 255) @@ -468,8 +461,6 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", M.attack_log += text("\[[time_stamp()]\] Has had the [name] used on him by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used [name] on [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) used the [name] on [M] ([M.ckey]).") - message_admins("ATTACK: [user] ([user.ckey]) used the [name] on [M] ([M.ckey]).") log_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey])") @@ -511,7 +502,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", if (C>=26+runedec+ticker.mode.cult.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist - switch(alert("Too many runes are already in the vicinity.. The cloth of reality can't take that much of a strain. By creating another rune, you risk locally tearing reality apart, which would prove fatal to you. Do you still wish to scribe the rune?",,"Yes","No")) + switch(alert("The cloth of reality can't take that much of a strain. By creating another rune, you risk locally tearing reality apart, which would prove fatal to you. Do you still wish to scribe the rune?",,"Yes","No")) if("Yes") if(prob(C*5-105-(runedec-ticker.mode.cult.len)*5)) //including the useless rune at the secret room, shouldn't count against the limit - Urist usr.emote("scream") @@ -525,12 +516,12 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", if("Cancel") return if("Read it") - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return user << browse("[tomedat]", "window=Arcane Tome") return if("Notes") - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return notedat = {"
      Word translation notes
      @@ -548,7 +539,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", // call(/obj/item/weapon/tome/proc/edit_notes)() user << browse("[notedat]", "window=notes") return - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return var/w1 @@ -573,7 +564,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", if (words[w] == w3) w3 = w - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return for (var/mob/V in viewers(src)) @@ -581,7 +572,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", user << "\red You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world." user.take_overall_damage(1) if(do_after(user, 50)) - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return var/mob/living/carbon/human/H = user var/obj/effect/rune/R = new /obj/effect/rune(user.loc) @@ -631,7 +622,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", var/r if (!istype(user.loc,/turf)) user << "\red You do not have enough space to write a proper rune." - var/list/runes = list("teleport", "itemport", "tome", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") + var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable. var/obj/effect/rune/R = new /obj/effect/rune if(istype(user, /mob/living/carbon/human)) diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm index 01726df38a..aa468cbba2 100644 --- a/code/game/magic/cultist/runes.dm +++ b/code/game/magic/cultist/runes.dm @@ -5,13 +5,6 @@ var/list/sacrificed = list() proc teleport(var/key) var/mob/living/user = usr - var/mob/living/grabbed - if (istype(user.get_active_hand(), /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = user.get_active_hand() - grabbed = G.affecting - else if (istype(user.get_inactive_hand(), /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = user.get_inactive_hand() - grabbed = G.affecting var/allrunesloc[] allrunesloc = new/list() var/index = 0 @@ -24,22 +17,19 @@ var/list/sacrificed = list() allrunesloc.len = index allrunesloc[index] = R.loc if(index >= 5) - user << "\red You feel pain, as the rune disappears into a reality shift caused by too much wear on the fabric of space-time." + user << "\red You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric" if (istype(user, /mob/living)) user.take_overall_damage(5, 0) del(src) if(allrunesloc && index != 0) if(istype(src,/obj/effect/rune)) - user.say("Sas'so c'arta forbici!") + user.say("Sas[pick("'","`")]so c'arta forbici!")//Only you can stop auto-muting else - user.whisper("Sas'so c'arta forbici!") + user.whisper("Sas[pick("'","`")]so c'arta forbici!") user.visible_message("\red [user] disappears in a flash of red light!", \ "\red You feel as your body gets dragged through the dimension of Nar-Sie!", \ "\red You hear a sickening crunch and sloshing of viscera.") - var/target = rand(1,index) - user.loc = allrunesloc[target] - if(grabbed) - grabbed.loc = allrunesloc[target] + user.loc = allrunesloc[rand(1,index)] return if(istype(src,/obj/effect/rune)) return fizzle() //Use friggin manuals, Dorf, your list was of zero length. @@ -69,10 +59,10 @@ var/list/sacrificed = list() user.take_overall_damage(5, 0) del(src) for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C)) + if(iscultist(C) && !C.stat) culcount++ if(culcount>=3) - user.say("Sas'so c'arta forbici tarem!") + user.say("Sas[pick("'","`")]so c'arta forbici tarem!") user.visible_message("\red You feel air moving from the rune - like as it was swapped with somewhere else.", \ "\red You feel air moving from the rune - like as it was swapped with somewhere else.", \ "\red You smell ozone.") @@ -90,9 +80,9 @@ var/list/sacrificed = list() tomesummon() if(istype(src,/obj/effect/rune)) - usr.say("N'ath reth sh'yro eth d'raggathnor!") + usr.say("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") else - usr.whisper("N'ath reth sh'yro eth d'raggathnor!") + usr.whisper("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") usr.visible_message("\red Rune disappears with a flash of red light, and in its place now a book lies.", \ "\red You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a book.", \ "\red You hear a pop and smell ozone.") @@ -113,7 +103,7 @@ var/list/sacrificed = list() continue if(M.stat==2) continue - usr.say("Mah'weyh pleggh at e'ntrath!") + usr.say("Mah[pick("'","`")]weyh pleggh at e'ntrath!") M.visible_message("\red [M] writhes in pain as the markings below him glow a bloody red.", \ "\red AAAAAAHHHH!.", \ "\red You hear an anguished scream.") @@ -136,8 +126,8 @@ var/list/sacrificed = list() tearreality() var/cultist_count = 0 for(var/mob/M in range(1,src)) - if(iscultist(M)) - M.say("Tok-lyr rqa'nap g'lt-ulotf!") + if(iscultist(M) && !M.stat) + M.say("Tok-lyr rqa'nap g[pick("'","`")]lt-ulotf!") cultist_count += 1 if(cultist_count >= 9) new /obj/machinery/singularity/narsie(src.loc) @@ -151,10 +141,10 @@ var/list/sacrificed = list() emp(var/U,var/range_red) //range_red - var which determines by which number to reduce the default emp range, U is the source loc, needed because of talisman emps which are held in hand at the moment of using and that apparently messes things up -- Urist if(istype(src,/obj/effect/rune)) - usr.say("Ta'gh fara'qha fel d'amar det!") + usr.say("Ta'gh fara[pick("'","`")]qha fel d'amar det!") else - usr.whisper("Ta'gh fara'qha fel d'amar det!") - playsound(U, 'Welder2.ogg', 25, 1) + usr.whisper("Ta'gh fara[pick("'","`")]qha fel d'amar det!") + playsound(U, 'sound/items/Welder2.ogg', 25, 1) var/turf/T = get_turf(U) if(T) T.hotspot_expose(700,125) @@ -177,7 +167,7 @@ var/list/sacrificed = list() drain += bdrain if(!drain) return fizzle() - usr.say ("Yu'gular faras desdae. Havas mithum javara. Umathar uf'kal thenar!") + usr.say ("Yu[pick("'","`")]gular faras desdae. Havas mithum javara. Umathar uf'kal thenar!") usr.visible_message("\red Blood flows from the rune into [usr]!", \ "\red The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \ "\red You hear a liquid flowing.") @@ -211,12 +201,12 @@ var/list/sacrificed = list() seer() if(usr.loc==src.loc) - usr.say("Rash'tla sektath mal'zua. Zasan therium vivira. Itonis al'ra matum!") + usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium vivira. Itonis al'ra matum!") if(usr.see_invisible!=0 && usr.see_invisible!=15) usr << "\red The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision." else usr << "\red The world beyond opens to your eyes." - usr.see_invisible = 15 + usr.see_invisible = SEE_INVISIBLE_OBSERVER usr.seer = 1 return return fizzle() @@ -226,64 +216,54 @@ var/list/sacrificed = list() raise() var/mob/living/carbon/human/corpse_to_raise var/mob/living/carbon/human/body_to_sacrifice - var/mob/living/carbon/human/ghost - var/unsuitable_corpse_found = 0 - var/corpse_is_target = 0 + + var/is_sacrifice_target = 0 for(var/mob/living/carbon/human/M in src.loc) - if (M.stat>=2) - if (M.key) - unsuitable_corpse_found = 1 - else if (ticker.mode.name == "cult" && M.mind == ticker.mode:sacrifice_target) - corpse_is_target = 1 + if(M.stat == DEAD) + if(ticker.mode.name == "cult" && M.mind == ticker.mode:sacrifice_target) + is_sacrifice_target = 1 else corpse_to_raise = M + if(M.key) + M.ghostize(1) //kick them out of their body break - if (!corpse_to_raise) - if (unsuitable_corpse_found) - usr << "\red The body still has some earthly ties. It must sever them, if only for them to grow again later." - if (corpse_is_target) + if(!corpse_to_raise) + if(is_sacrifice_target) usr << "\red The Geometer of blood wants this mortal for himself." return fizzle() - var/sacrifice_is_target = 0 + is_sacrifice_target = 0 find_sacrifice: for(var/obj/effect/rune/R in world) if(R.word1==wordblood && R.word2==wordjoin && R.word3==wordhell) for(var/mob/living/carbon/human/N in R.loc) - if (ticker.mode.name == "cult" && N.mind && N.mind == ticker.mode:sacrifice_target) - sacrifice_is_target = 1 + if(ticker.mode.name == "cult" && N.mind && N.mind == ticker.mode:sacrifice_target) + is_sacrifice_target = 1 else - if(N.stat<2) + if(N.stat!= DEAD) body_to_sacrifice = N break find_sacrifice - if (!body_to_sacrifice) - if (sacrifice_is_target) + if(!body_to_sacrifice) + if (is_sacrifice_target) usr << "\red The Geometer of blood wants that corpse for himself." else - usr << "\red You need a dead corpse as source of energy to put soul in new body." + usr << "\red The sacrifical corpse is not dead. You must free it from this world of illusions before it may be used." return fizzle() - for(var/mob/dead/observer/O in src.loc) - if(!O.client) - continue + var/mob/dead/observer/ghost + for(var/mob/dead/observer/O in loc) + if(!O.client) continue + if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue ghost = O + break - if (!ghost) - usr << "\red You do not feel an ethernal immaterial soul here." + if(!ghost) + usr << "\red You require a restless spirit which clings to this world. Beckon their prescence with the sacred chants of Nar-Sie." return fizzle() -// rejuvenatedheal(M) - corpse_to_raise.mind = new//Mind initialize stuff. - corpse_to_raise.mind.current = corpse_to_raise - corpse_to_raise.mind.original = corpse_to_raise - corpse_to_raise.mind.key = ghost.key - corpse_to_raise.key = ghost.key - del(ghost) - for(var/name in corpse_to_raise.organs) - var/datum/organ/external/affecting = corpse_to_raise.organs[name] - affecting.status &= ~ORGAN_ROBOT + for(var/datum/organ/external/affecting in corpse_to_raise.organs) affecting.heal_damage(1000, 1000) corpse_to_raise.setToxLoss(0) corpse_to_raise.setOxyLoss(0) @@ -291,14 +271,16 @@ var/list/sacrificed = list() corpse_to_raise.SetStunned(0) corpse_to_raise.SetWeakened(0) corpse_to_raise.radiation = 0 - corpse_to_raise.buckled = null - if (corpse_to_raise.handcuffed) - del(corpse_to_raise.handcuffed) - corpse_to_raise.stat=0 +// corpse_to_raise.buckled = null +// if(corpse_to_raise.handcuffed) +// del(corpse_to_raise.handcuffed) +// corpse_to_raise.update_inv_handcuffed(0) + corpse_to_raise.stat = CONSCIOUS corpse_to_raise.updatehealth() corpse_to_raise.UpdateDamageIcon() - + corpse_to_raise.key = ghost.key //the corpse will keep its old mind! but a new player takes ownership of it (they are essentially possessed) + //This means, should that player leave the body, the original may re-enter usr.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!") corpse_to_raise.visible_message("\red [corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \ "\red Life... I'm alive again...", \ @@ -307,10 +289,12 @@ var/list/sacrificed = list() "\red You feel as your blood boils, tearing you apart.", \ "\red You hear a thousand voices, all crying in pain.") body_to_sacrifice.gib() - if (ticker.mode.name == "cult") - ticker.mode:add_cultist(body_to_sacrifice.mind) - else - ticker.mode.cult+=body_to_sacrifice.mind + +// if(ticker.mode.name == "cult") +// ticker.mode:add_cultist(corpse_to_raise.mind) +// else +// ticker.mode.cult |= corpse_to_raise.mind + corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." return @@ -329,12 +313,12 @@ var/list/sacrificed = list() S=1 if(S) if(istype(src,/obj/effect/rune)) - usr.say("Kla'atu barada nikt'o!") + usr.say("Kla[pick("'","`")]atu barada nikt'o!") for (var/mob/V in viewers(src)) V.show_message("\red The rune turns into gray dust, veiling the surrounding runes.", 3) del(src) else - usr.whisper("Kla'atu barada nikt'o!") + usr.whisper("Kla[pick("'","`")]atu barada nikt'o!") usr << "\red Your talisman turns into gray dust, veiling the surrounding runes." for (var/mob/V in orange(1,src)) if(V!=usr) @@ -352,18 +336,19 @@ var/list/sacrificed = list() ajourney() //some bits copypastaed from admin tools - Urist if(usr.loc==src.loc) var/mob/living/carbon/human/L = usr - usr.say("Fwe'sh mah erl nyag r'ya!") + usr.say("Fwe[pick("'","`")]sh mah erl nyag r'ya!") usr.visible_message("\red [usr]'s eyes glow blue as \he freezes in place, absolutely motionless.", \ "\red The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \ "\red You hear only complete silence for a moment.") - usr.ghostize() - for(L.ajourn=1,L.ajourn) - sleep(10) + usr.ghostize(1) + L.ajourn = 1 + while(L) if(L.key) L.ajourn=0 return else - L.take_organ_damage(1, 0) + L.take_organ_damage(10, 0) + sleep(100) return fizzle() @@ -378,52 +363,44 @@ var/list/sacrificed = list() return this_rune.fizzle() var/mob/dead/observer/ghost for(var/mob/dead/observer/O in this_rune.loc) - if (!O.client) - continue + if(!O.client) continue + if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue ghost = O break if(!ghost) return this_rune.fizzle() - usr.say("Gal'h'rfikk harfrandid mud'gib!") + usr.say("Gal'h'rfikk harfrandid mud[pick("'","`")]gib!") var/mob/living/carbon/human/dummy/D = new(this_rune.loc) usr.visible_message("\red A shape forms in the center of the rune. A shape of... a man.", \ "\red A shape forms in the center of the rune. A shape of... a man.", \ "\red You hear liquid flowing.") D.real_name = "Unknown" for(var/obj/item/weapon/paper/P in this_rune.loc) -/* - if(length(P.info)<=24) - D.real_name = P.info - break -*/ if(length(P.name)<=24) D.real_name = P.name break D.universal_speak = 1 D.nodamage = 0 - D.mind = new//Mind initialize stuff. - D.mind.current = D - D.mind.original = D - D.mind.key = ghost.key + D.key = ghost.key - ghost.invisibility = 101 - if (ticker.mode.name == "cult") + + if(ticker.mode.name == "cult") ticker.mode:add_cultist(D.mind) else ticker.mode.cult+=D.mind + D << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." D << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + var/mob/living/user = usr - while(this_rune && user && user.stat==0 && user.client && user.loc==this_rune.loc) + while(this_rune && user && user.stat==CONSCIOUS && user.client && user.loc==this_rune.loc) user.take_organ_damage(1, 0) sleep(30) if(D) D.visible_message("\red [D] slowly dissipates into dust and bones.", \ "\red You feel pain, as bonds formed between your soul and this homunculus break.", \ "\red You hear faint rustle.") - ghost.invisibility = 10 - ghost.key = D.key D.dust() return @@ -488,11 +465,11 @@ var/list/sacrificed = list() T.imbue = "deafen" imbued_from = R break - /*if(R.word1==worddestr && R.word2==wordsee && R.word3==wordother) //blind + if(R.word1==worddestr && R.word2==wordsee && R.word3==wordother) //blind T = new(src.loc) T.imbue = "blind" imbued_from = R - break*/ + break if(R.word1==wordself && R.word2==wordother && R.word3==wordtech) //communicat T = new(src.loc) T.imbue = "communicate" @@ -506,7 +483,7 @@ var/list/sacrificed = list() if (imbued_from) for (var/mob/V in viewers(src)) V.show_message("\red The runes turn into dust, which then forms into an arcane image on the paper.", 3) - usr.say("H'drak v'loso, mir'kanas verbot!") + usr.say("H'drak v[pick("'","`")]loso, mir'kanas verbot!") del(imbued_from) del(newtalisman) else @@ -517,7 +494,7 @@ var/list/sacrificed = list() mend() var/mob/living/user = usr src = null - user.say("Uhrast ka'hfa heldsagen ver'lot!") + user.say("Uhrast ka'hfa heldsagen ver[pick("'","`")]lot!") user.take_overall_damage(200, 0) runedec+=10 user.visible_message("\red [user] keels over dead, his blood glowing blue as it escapes his body and dissipates into thin air.", \ @@ -533,17 +510,20 @@ var/list/sacrificed = list() /////////////////////////////////////////FOURTEETH RUNE + // returns 0 if the rune is not used. returns 1 if the rune is used. communicate() + . = 1 // Default output is 1. If the rune is deleted it will return 1 var/input = copytext(sanitize(input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null),1,MAX_MESSAGE_LEN) if(!input) if (istype(src)) - return fizzle() + fizzle() + return 0 else - return + return 0 if(istype(src,/obj/effect/rune)) - usr.say("O bidai nabora se'sma!") + usr.say("O bidai nabora se[pick("'","`")]sma!") else - usr.whisper("O bidai nabora se'sma!") + usr.whisper("O bidai nabora se[pick("'","`")]sma!") var/input_s = sanitize(input) if(istype(src,/obj/effect/rune)) usr.say("[input]") @@ -553,25 +533,40 @@ var/list/sacrificed = list() if (H.current) H.current << "\red \b [input_s]" del(src) - return + return 1 /////////////////////////////////////////FIFTEENTH RUNE sacrifice() var/list/mob/living/carbon/human/cultsinrange = list() var/list/mob/living/carbon/human/victims = list() - for(var/mob/living/carbon/human/V in src.loc) - victims += V + for(var/mob/living/carbon/human/V in src.loc)//Checks for non-cultist humans to sacrifice + if(ishuman(V)) + if(!(iscultist(V))) + victims += V//Checks for cult status and mob type + for(var/obj/item/I in src.loc)//Checks for MMIs/brains/Intellicards + if(istype(I,/obj/item/brain)) + var/obj/item/brain/B = I + victims += B.brainmob + else if(istype(I,/obj/item/device/mmi)) + var/obj/item/device/mmi/B = I + victims += B.brainmob + else if(istype(I,/obj/item/device/aicard)) + for(var/mob/living/silicon/ai/A in I) + victims += A for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C)) + if(iscultist(C) && !C.stat) cultsinrange += C - C.say("Barhah hra zar'garis!") + C.say("Barhah hra zar[pick("'","`")]garis!") for(var/mob/H in victims) if (ticker.mode.name == "cult") if(H.mind == ticker.mode:sacrifice_target) if(cultsinrange.len >= 3) sacrificed += H.mind - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() usr << "\red The Geometer of Blood accepts this sacrifice, your objective is now complete." else usr << "\red Your target's earthly bonds are too strong. You need more cultists to succeed in this ritual." @@ -584,7 +579,10 @@ var/list/sacrificed = list() else usr << "\red The Geometer of blood accepts this sacrifice." usr << "\red However, this soul was not enough to gain His favor." - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() else if(prob(40)) usr << "\red The Geometer of blood accepts this sacrifice." @@ -592,7 +590,10 @@ var/list/sacrificed = list() else usr << "\red The Geometer of blood accepts this sacrifice." usr << "\red However, a mere dead body is not enough to satisfy Him." - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() else if(H.stat !=2) usr << "\red The victim is still alive, you will need more cultists chanting for the sacrifice to succeed." @@ -603,7 +604,10 @@ var/list/sacrificed = list() else usr << "\red The Geometer of blood accepts this sacrifice." usr << "\red However, a mere dead body is not enough to satisfy Him." - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() else if(cultsinrange.len >= 3) if(H.stat !=2) @@ -613,7 +617,10 @@ var/list/sacrificed = list() else usr << "\red The Geometer of blood accepts this sacrifice." usr << "\red However, this soul was not enough to gain His favor." - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() else if(prob(40)) usr << "\red The Geometer of blood accepts this sacrifice." @@ -621,7 +628,10 @@ var/list/sacrificed = list() else usr << "\red The Geometer of blood accepts this sacrifice." usr << "\red However, a mere dead body is not enough to satisfy Him." - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() else if(H.stat !=2) usr << "\red The victim is still alive, you will need more cultists chanting for the sacrifice to succeed." @@ -632,7 +642,10 @@ var/list/sacrificed = list() else usr << "\red The Geometer of blood accepts this sacrifice." usr << "\red However, a mere dead body is not enough to satisfy Him." - H.gib() + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() for(var/mob/living/carbon/monkey/M in src.loc) if (ticker.mode.name == "cult") if(M.mind == ticker.mode:sacrifice_target) @@ -695,13 +708,13 @@ var/list/sacrificed = list() usr << "\red Arcane markings suddenly glow from underneath a thin layer of dust!" return if(istype(W,/obj/effect/rune)) - usr.say("Nikt'o barada kla'atu!") + usr.say("Nikt[pick("'","`")]o barada kla'atu!") for (var/mob/V in viewers(src)) V.show_message("\red The rune turns into red dust, reveaing the surrounding runes.", 3) del(src) return if(istype(W,/obj/item/weapon/paper/talisman)) - usr.whisper("Nikt'o barada kla'atu!") + usr.whisper("Nikt[pick("'","`")]o barada kla'atu!") usr << "\red Your talisman turns into red dust, revealing the surrounding runes." for (var/mob/V in orange(1,usr.loc)) if(V!=usr) @@ -717,7 +730,7 @@ var/list/sacrificed = list() /////////////////////////////////////////SEVENTEENTH RUNE wall() - usr.say("Khari'd! Eske'te tannin!") + usr.say("Khari[pick("'","`")]d! Eske'te tannin!") src.density = !src.density var/mob/living/user = usr user.take_organ_damage(2, 0) @@ -737,7 +750,7 @@ var/list/sacrificed = list() cultists+=H.current var/list/mob/living/carbon/users = new for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C)) + if(iscultist(C) && !C.stat) users+=C if(users.len>=3) var/mob/cultist = input("Choose the one who you want to free", "Followers of Geometer") as null|anything in (cultists - users) @@ -758,6 +771,11 @@ var/list/sacrificed = list() if (cultist.handcuffed) cultist.handcuffed.loc = cultist.loc cultist.handcuffed = null + cultist.update_inv_handcuffed() + if (cultist.legcuffed) + cultist.legcuffed.loc = cultist.loc + cultist.legcuffed = null + cultist.update_inv_legcuffed() if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle)) cultist.u_equip(cultist.wear_mask) if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) @@ -768,7 +786,7 @@ var/list/sacrificed = list() cultist.loc:locked = 0 for(var/mob/living/carbon/C in users) user.take_overall_damage(15, 0) - C.say("Khari'd! Gual'te nikka!") + C.say("Khari[pick("'","`")]d! Gual'te nikka!") del(src) return fizzle() @@ -782,7 +800,7 @@ var/list/sacrificed = list() cultists+=H.current var/list/mob/living/carbon/users = new for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C)) + if(iscultist(C) && !C.stat) users+=C if(users.len>=3) var/mob/cultist = input("Choose the one who you want to summon", "Followers of Geometer") as null|anything in (cultists - user) @@ -795,10 +813,10 @@ var/list/sacrificed = list() return fizzle() cultist.loc = src.loc cultist.lying = 1 - cultist.update_clothing() + cultist.regenerate_icons() for(var/mob/living/carbon/human/C in orange(1,src)) - if(iscultist(C)) - C.say("N'ath reth sh'yro eth d'rekkathnor!") + if(iscultist(C) && !C.stat) + C.say("N'ath reth sh'yro eth d[pick("'","`")]rekkathnor!") C.take_overall_damage(25, 0) user.visible_message("\red Rune disappears with a flash of red light, and in its place now a body lies.", \ "\red You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a body.", \ @@ -821,9 +839,9 @@ var/list/sacrificed = list() C.show_message("\red The world around you suddenly becomes quiet.", 3) affected++ if(prob(1)) - C.disabilities |= 4 + C.sdisabilities |= DEAF if(affected) - usr.say("Sti' kaliedir!") + usr.say("Sti[pick("'","`")] kaliedir!") usr << "\red The world becomes quiet as the deafening rune dissipates into fine dust." del(src) else @@ -841,7 +859,7 @@ var/list/sacrificed = list() C.show_message("\red The world around you suddenly becomes quiet.", 3) affected++ if(affected) - usr.whisper("Sti' kaliedir!") + usr.whisper("Sti[pick("'","`")] kaliedir!") usr << "\red Your talisman turns into gray dust, deafening everyone around." for (var/mob/V in orange(1,src)) if(!(iscultist(V))) @@ -860,20 +878,20 @@ var/list/sacrificed = list() C.eye_blurry += 50 C.eye_blind += 20 if(prob(5)) - C.disabilities |= 1 + C.disabilities |= NEARSIGHTED if(prob(10)) - C.disabilities |= 128 + C.sdisabilities |= BLIND C.show_message("\red Suddenly you see red flash that blinds you.", 3) affected++ if(affected) - usr.say("Sti' kaliesin!") + usr.say("Sti[pick("'","`")] kaliesin!") usr << "\red The rune flashes, blinding those who not follow the Nar-Sie, and dissipates into fine dust." del(src) else return fizzle() else var/affected = 0 - for(var/mob/living/carbon/C in viewers(usr)) + for(var/mob/living/carbon/C in view(2,usr)) if (iscultist(C)) continue var/obj/item/weapon/nullrod/N = locate() in C @@ -885,7 +903,7 @@ var/list/sacrificed = list() affected++ C.show_message("\red You feel a sharp pain in your eyes, and the world disappears into darkness..", 3) if(affected) - usr.whisper("Sti' kaliesin!") + usr.whisper("Sti[pick("'","`")] kaliesin!") usr << "\red Your talisman turns into gray dust, blinding those who not follow the Nar-Sie." return @@ -900,7 +918,7 @@ var/list/sacrificed = list() var/culcount = 0 //also, wording for it is old wording for obscure rune, which is now hide-see-blood. // var/list/cultboil = list(cultists-usr) //and for this words are destroy-see-blood. for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C)) + if(iscultist(C) && !C.stat) culcount++ if(culcount>=3) for(var/mob/living/carbon/M in viewers(usr)) @@ -918,8 +936,8 @@ var/list/sacrificed = list() if(prob(10)) explosion(R.loc, -1, 0, 1, 5) for(var/mob/living/carbon/human/C in orange(1,src)) - if(iscultist(C)) - C.say("Dedo ol'btoh!") + if(iscultist(C) && !C.stat) + C.say("Dedo ol[pick("'","`")]btoh!") C.take_overall_damage(15, 0) del(src) else @@ -931,7 +949,7 @@ var/list/sacrificed = list() burningblood() var/culcount = 0 for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C)) + if(iscultist(C) && !C.stat) culcount++ if(culcount >= 5) for(var/obj/effect/rune/R in world) @@ -956,19 +974,27 @@ var/list/sacrificed = list() ////////// Rune 24 (counting burningblood, which kinda doesnt work yet.) - runestun(var/mob/living/carbon/T as mob) + runestun(var/mob/living/T as mob) if(istype(src,/obj/effect/rune)) ///When invoked as rune, flash and stun everyone around. - usr.say("Fuu ma'jin!") - for(var/mob/living/carbon/C in viewers(src)) - flick("e_flash", C.flash) - if (C.stuttering < 1 && (!(HULK in C.mutations))) - C.stuttering = 1 - C.Weaken(1) - C.Stun(1) - C.show_message("\red The rune explodes in a bright flash.", 3) + usr.say("Fuu ma[pick("'","`")]jin!") + for(var/mob/living/L in viewers(src)) + + if(iscarbon(L)) + var/mob/living/carbon/C = L + flick("e_flash", C.flash) + if(C.stuttering < 1 && (!(HULK in C.mutations))) + C.stuttering = 1 + C.Weaken(1) + C.Stun(1) + C.show_message("\red The rune explodes in a bright flash.", 3) + + else if(issilicon(L)) + var/mob/living/silicon/S = L + S.Weaken(5) + S.show_message("\red BZZZT... The rune has exploded in a bright flash.", 3) del(src) else ///When invoked as talisman, stun and mute the target mob. - usr.say("Dream sign ''Evil sealing talisman''!") + usr.say("Dream sign ''Evil sealing talisman'[pick("'","`")]!") var/obj/item/weapon/nullrod/N = locate() in T if(N) for(var/mob/O in viewers(T, null)) @@ -976,11 +1002,17 @@ var/list/sacrificed = list() else for(var/mob/O in viewers(T, null)) O.show_message(text("\red [] invokes a talisman at []", usr, T), 1) - flick("e_flash", T.flash) - if (!(HULK in T.mutations)) - T.silent += 15 - T.Weaken(25) - T.Stun(25) + + if(issilicon(T)) + T.Weaken(15) + + else if(iscarbon(T)) + var/mob/living/carbon/C = T + flick("e_flash", C.flash) + if (!(HULK in C.mutations)) + C.silent += 15 + C.Weaken(25) + C.Stun(25) return /////////////////////////////////////////TWENTY-FIFTH RUNE @@ -988,18 +1020,19 @@ var/list/sacrificed = list() armor() var/mob/living/carbon/human/user = usr if(istype(src,/obj/effect/rune)) - usr.say("N'ath reth sh'yro eth d'raggathnor!") + usr.say("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") else - usr.whisper("N'ath reth sh'yro eth d'raggathnor!") - usr.visible_message("\red Rune disappears with a flash of red light, and a set of armor appears on you..", \ + usr.whisper("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") + usr.visible_message("\red The rune disappears with a flash of red light, and a set of armor appears on [usr]...", \ "\red You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") - //user.equip_if_possible(new /obj/item/clothing/shoes/jackboots(user), user.slot_shoes) - //user.equip_if_possible(new /obj/item/clothing/suit/cultrobes(user), user.slot_wear_suit) - //user.equip_if_possible(new /obj/item/clothing/head/culthood(user), user.slot_head) - //user.equip_if_possible(new /obj/item/clothing/gloves/black(user), user.slot_gloves) - user.equip_if_possible(new /obj/item/clothing/suit/magusred(user), user.slot_wear_suit) - user.equip_if_possible(new /obj/item/clothing/head/magus(user), user.slot_head) - user.equip_if_possible(new /obj/item/weapon/melee/cultblade(user), user.slot_r_hand) - user.equip_if_possible(new /obj/item/weapon/storage/backpack/cultpack(user), user.slot_back) + + user.equip_to_slot_or_del(new /obj/item/clothing/head/culthood/alt(user), slot_head) + user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) + user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult(user), slot_shoes) + user.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/cultpack(user), slot_back) + //the above update their overlay icons cache but do not call update_icons() + //the below calls update_icons() at the end, which will update overlay icons by using the (now updated) cache + user.put_in_hands(new /obj/item/weapon/melee/cultblade(user)) //put in hands or on floor + del(src) return diff --git a/code/game/magic/cultist/talisman.dm b/code/game/magic/cultist/talisman.dm index 5b4498c6bc..a319e83421 100644 --- a/code/game/magic/cultist/talisman.dm +++ b/code/game/magic/cultist/talisman.dm @@ -12,6 +12,7 @@ attack_self(mob/living/user as mob) if(iscultist(user)) + var/delete = 1 switch(imbue) if("newtome") call(/obj/effect/rune/proc/tomesummon)() @@ -26,7 +27,8 @@ if("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") call(/obj/effect/rune/proc/teleport)(imbue) if("communicate") - call(/obj/effect/rune/proc/communicate)() + //If the user cancels the talisman this var will be set to 0 + delete = call(/obj/effect/rune/proc/communicate)() if("deafen") call(/obj/effect/rune/proc/deafen)() if("blind") @@ -38,7 +40,8 @@ supply() user.take_organ_damage(5, 0) if(src && src.imbue!="supply" && src.imbue!="runestun") - del(src) + if(delete) + del(src) return else user << "You see strange symbols on the paper. Are they supposed to mean something?" diff --git a/code/game/magic/library.dm b/code/game/magic/library.dm index ceac35ae95..46bf1c0506 100644 --- a/code/game/magic/library.dm +++ b/code/game/magic/library.dm @@ -1,9 +1,20 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 //******************************* // // Library SQL Configuration // +//******************************* + +// Deprecated! See global.dm for new SQL config vars -- TLE +/* +#define SQL_ADDRESS "" +#define SQL_DB "" +#define SQL_PORT "3306" +#define SQL_LOGIN "" +#define SQL_PASS "" +*/ + //******************************* // Requires Dantom.DB library ( http://www.byond.com/developer/Dantom/DB ) @@ -62,64 +73,11 @@ /obj/structure/bookcase name = "bookcase" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state = "book-0" anchored = 1 density = 1 opacity = 1 - var/category - - New() - spawn(2) // allow library comp to exist - var/list/books = book_mgr.getall() - var/list/catbooks = new() - // see if we have a library computer - var/obj/machinery/librarycomp/comp - if(istype(loc.loc, /area)) - comp = locate() in loc.loc - // get books in category - for(var/datum/archived_book/B in books) - if(!category || (category != B.category)) - continue; - catbooks += B - if(catbooks.len <= 3) - // if 3 or less books, fill shelf with that - for(var/datum/archived_book/AB in catbooks) - var/obj/item/weapon/book/B = new(src) - B.name = "[AB.title]" - B.title = AB.title - B.author = AB.author - B.dat = AB.dat - B.gen_pages() - B.icon_state = "book[rand(1,7)]" - B.ssbn = AB.id - B.author_real = AB.author_real - B.author_key = AB.author_key - B.photos = AB.photos - - // add to inventory - if(comp) - comp.inventory += B - else - // otherwise, pick 3 random books - for(var/i = 1 to 3) - var/datum/archived_book/AB = pick(catbooks) - var/obj/item/weapon/book/B = new(src) - B.name = "[AB.title]" - B.title = AB.title - B.author = AB.author - B.dat = AB.dat - B.gen_pages() - B.icon_state = "book[rand(1,7)]" - B.ssbn = AB.id - B.author_real = AB.author_real - B.author_key = AB.author_key - B.photos = AB.photos - - // add to inventory - if(comp) - comp.inventory += B - update_icon() /obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob) if(istype(O, /obj/item/weapon/book)) @@ -127,7 +85,7 @@ O.loc = src update_icon() else if(istype(O, /obj/item/weapon/pen)) - var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_NAME_LEN) + var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_MESSAGE_LEN) if(!newname) return else @@ -139,9 +97,11 @@ if(contents.len) var/obj/item/weapon/book/choice = input("Which book would you like to remove from the shelf?") in contents as obj|null if(choice) + if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) + return if(ishuman(user)) if(!user.get_active_hand()) - user.put_in_hand(choice) + user.put_in_hands(choice) else choice.loc = get_turf(src) update_icon() @@ -212,194 +172,89 @@ /obj/item/weapon/book name = "book" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state ="book" throw_speed = 1 throw_range = 5 w_class = 1.0 flags = FPRINT | TABLEPASS + attack_verb = list("bashed", "whacked", "educated") var/dat // Actual page content var/due_date = 0 // Game time in 1/10th seconds var/author // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned var/unique = 0 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified var/title // The real name of the book. - var/author_real // author's real_name - var/author_key // author's byond key - var/ssbn // the ssbn, if a downloaded book +/obj/item/weapon/book/attack_self(var/mob/user as mob) + if(src.dat) + user << browse("Penned by [author].
      " + "[dat]", "window=book") + user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.") + onclose(user, "book") + else + user << "This book is completely blank!" - var/list/pages = new() // individual pages as a list of text - var/cur_page = 1 // current page being read - var/list/icon/photos // in-game photos used - - proc/navbar() - return "
      " \ - + "
      "+(cur_page > 1 \ - ? "< " \ - + "<" \ - : "") \ - + "
      "+(cur_page < pages.len \ - ? "> " \ - + ">" \ - : "") \ - + "
      [cur_page]/[pages.len]
      " - - // should be called if dat is changed - proc/gen_pages() - // split into pages - cur_page = 1 - pages = dd_text2list(dat, "") - var/PN = 1 - for(var/page in pages) - // look for photos and process - var/i = 1 - while(i <= lentext(page)) - i = findtext(page, "", i+7) - if(e_c == 0) e_c = INFINITY - var/e = min(e_s, e_c) // find the closest of the two - if(e == INFINITY) break - var/i_num = text2num(copytext(page, i+7, e)) - page = copytext(page, 1, i) + "[title]" \ - + "" \ - + "
      [title]
      [author]
      " \ - + "
      [pages[cur_page]]
      " \ - + (pages.len > 1 ? navbar() : "") \ - + "", "window=book;size=600x500") - - if(opening) - if(title) - user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.") - else - user.visible_message("[user] opens a book titled \"[src.name]\" and begins reading intently.") - - onclose(user, "book") - else - user << "This book is completely blank!" - - attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/pen)) - if(unique) - user << "These pages don't seem to take the ink well. Looks like you can't modify it." - return - var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel") - switch(choice) - if("Title") - var/ntitle = copytext(sanitize(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN) - if(!ntitle) - return - if("Contents") - var/t = "[src.dat]" - do - t = input(user, "What text do you wish to add?", src.name, t) as message - if ((!in_range(src, usr) && src.loc != user && src.loc.loc != user && user.equipped() != W)) - return - - if(lentext(t) >= MAX_BOOK_MESSAGE_LEN) - var/cont = input(user, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") - if(cont == "no") - break - while(lentext(t) > MAX_BOOK_MESSAGE_LEN) - - if ((!in_range(src, usr) && src.loc != user && src.loc.loc != user && user.equipped() != W)) - return - - // check for exploits - for(var/tag in paper_blacklist) - if(findtext(t,"<"+tag)) - user << "\blue You think to yourself, \"Hm.. this is only paper...\"" - return - - src.dat = t - gen_pages() - if("Author") - var/nauthor = copytext(sanitize(input("Write the author's name:") as text|null),1,MAX_NAME_LEN) - if(!nauthor) - return - else - src.author = sanitize(nauthor) - else + var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel") + switch(choice) + if("Title") + var/newtitle = copytext(reject_bad_text(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN) + if(!newtitle) + usr << "The title is invalid." return - else if(istype(W, /obj/item/weapon/barcodescanner)) - var/obj/item/weapon/barcodescanner/scanner = W - if(!scanner.computer) - user << "[W]'s screen flashes: 'No associated computer found!'" + else + src.name = newtitle + src.title = newtitle + if("Contents") + var/content = strip_html(input("Write your book's contents (HTML NOT allowed):"),8192) as message|null + if(!content) + usr << "The content is invalid." + return + else + src.dat += content + if("Author") + var/newauthor = copytext(sanitize(input("Write the author's name:") as text|null),1,MAX_NAME_LEN) + if(!newauthor) + usr << "The name is invalid." + return + else + src.author = newauthor else - switch(scanner.mode) - if(0) - scanner.book = src - user << "[W]'s screen flashes: 'Book stored in buffer.'" - if(1) - scanner.book = src - scanner.computer.buffer_book = src.name - user << "[W]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'" - if(2) - scanner.book = src - for(var/datum/borrowbook/b in scanner.computer.checkouts) - if(b.bookname == src.name) - scanner.computer.checkouts.Remove(b) - user << "[W]'s screen flashes: 'Book stored in buffer. Book has been checked in.'" - return - user << "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'" - if(3) - scanner.book = src - for(var/obj/item/weapon/book in scanner.computer.inventory) - if(book == src) - user << "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'" - return - scanner.computer.inventory.Add(src) - user << "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'" - else if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel)) - if(unique) - user << "These pages seem to be made of a very robust paper. Looks like you can't carve it." return - if(istype(src.loc, /mob) && usr.l_hand != src && usr.r_hand != src) - user << "\red You either need hold the book or put it down on something first." - return - - var/obj/item/weapon/storage/book/B = new(loc) - B.icon_state = icon_state - B.name = name - B.desc = desc - - user.remove_from_mob(src) - if(user.get_inactive_hand() == null) - user.put_in_inactive_hand(B) - else - B.loc = user.loc - - user << "You carve out the inside of the book. Sneaky!" - - del(src) + else if(istype(W, /obj/item/weapon/barcodescanner)) + var/obj/item/weapon/barcodescanner/scanner = W + if(!scanner.computer) + user << "[W]'s screen flashes: 'No associated computer found!'" else - ..() + switch(scanner.mode) + if(0) + scanner.book = src + user << "[W]'s screen flashes: 'Book stored in buffer.'" + if(1) + scanner.book = src + scanner.computer.buffer_book = src.name + user << "[W]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'" + if(2) + scanner.book = src + for(var/datum/borrowbook/b in scanner.computer.checkouts) + if(b.bookname == src.name) + scanner.computer.checkouts.Remove(b) + user << "[W]'s screen flashes: 'Book stored in buffer. Book has been checked in.'" + return + user << "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'" + if(3) + scanner.book = src + for(var/obj/item/weapon/book in scanner.computer.inventory) + if(book == src) + user << "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'" + return + scanner.computer.inventory.Add(src) + user << "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'" + else + ..() @@ -414,7 +269,7 @@ /obj/item/weapon/barcodescanner name = "barcode scanner" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state ="scanner" throw_speed = 1 throw_range = 5 @@ -472,7 +327,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f /obj/machinery/librarypubliccomp name = "visitor computer" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state = "computer" anchored = 1 density = 1 @@ -494,76 +349,65 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f dat += "Filter by Author: [author]
      " dat += "\[Start Search\]
      " if(1) - if(BOOKS_USE_SQL && config.sql_enabled) - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") - if(!dbcon.IsConnected()) - dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance.
      " - else if(!SQLquery) - dat += "ERROR: Malformed search request. Please contact your system administrator for assistance.
      " - else - dat += "" - dat += "" - - var/DBQuery/query = dbcon.NewQuery(SQLquery) - query.Execute() - - while(query.NextRow()) - var/author = query.item[1] - var/title = query.item[2] - var/category = query.item[3] - var/id = query.item[4] - dat += "" - dat += "
      AUTHORTITLECATEGORYSS13BN
      [author][title][category][id]

      " - dbcon.Disconnect() + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") + if(!dbcon.IsConnected()) + dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance.
      " + else if(!SQLquery) + dat += "ERROR: Malformed search request. Please contact your system administrator for assistance.
      " else dat += "" dat += "" - var/list/books = book_mgr.getall() - for(var/datum/archived_book/book in books) - // search queries - if(author && !findtext(author, book.author)) - continue; - if(title && !findtext(title, book.title)) - continue; - if(!category || (category != "Any" && category != book.category)) - continue; - dat += "" + var/DBQuery/query = dbcon.NewQuery(SQLquery) + query.Execute() + + while(query.NextRow()) + var/author = query.item[1] + var/title = query.item[2] + var/category = query.item[3] + var/id = query.item[4] + dat += "" dat += "
      AUTHORTITLECATEGORYSS13BN
      [book.author][book.title][book.category][book.id]
      [author][title][category][id]

      " + dbcon.Disconnect() dat += "\[Go Back\]
      " user << browse(dat, "window=publiclibrary") onclose(user, "publiclibrary") /obj/machinery/librarypubliccomp/Topic(href, href_list) + if(..()) + usr << browse(null, "window=publiclibrary") + onclose(usr, "publiclibrary") + return + if(href_list["settitle"]) var/newtitle = input("Enter a title to search for:") as text|null if(newtitle) title = sanitize(newtitle) else title = null - title = dd_replacetext(title, "'", "''") + title = sanitizeSQL(title) if(href_list["setcategory"]) var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion") if(newcategory) - category = newcategory + category = sanitize(newcategory) else category = "Any" + category = sanitizeSQL(category) if(href_list["setauthor"]) var/newauthor = input("Enter an author to search for:") as text|null if(newauthor) author = sanitize(newauthor) else author = null - author = dd_replacetext(author, "'", "''") + author = sanitizeSQL(author) if(href_list["search"]) - if(BOOKS_USE_SQL && config.sql_enabled) - SQLquery = "SELECT author, title, category, id FROM library WHERE " - if(category == "Any") - SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%'" - else - SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%' AND category='[category]'" + SQLquery = "SELECT author, title, category, id FROM library WHERE " + if(category == "Any") + SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%'" + else + SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%' AND category='[category]'" screenstate = 1 if(href_list["back"]) @@ -579,7 +423,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f /obj/machinery/librarycomp name = "Check-In/Out Computer" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state = "computer" anchored = 1 density = 1 @@ -652,38 +496,27 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f dat += "(Return to main menu)
      " if(4) dat += "

      External Archive

      " - if(BOOKS_USE_SQL && config.sql_enabled) - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") - if(!dbcon.IsConnected()) - dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance." - else - dat += "(Order book by SS13BN)

      " - dat += "" - dat += "" - - var/DBQuery/query = dbcon.NewQuery("SELECT id, author, title, category FROM library") - query.Execute() - - while(query.NextRow()) - var/id = query.item[1] - var/author = query.item[2] - var/title = query.item[3] - var/category = query.item[4] - dat += "" - dat += "
      AUTHORTITLECATEGORY
      [author][title][category]\[Order\]

      " - dat += "(Return to main menu)
      " - dbcon.Disconnect() + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") + if(!dbcon.IsConnected()) + dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance." else dat += "(Order book by SS13BN)

      " dat += "" dat += "" - var/list/books = book_mgr.getall() - for(var/datum/archived_book/book in books) - dat += "" - dat += "
      AUTHORTITLECATEGORY
      [book.author][book.title][book.category][book.id]

      " - dat += "(Return to main menu)
      " + var/DBQuery/query = dbcon.NewQuery("SELECT id, author, title, category FROM library") + query.Execute() + + while(query.NextRow()) + var/id = query.item[1] + var/author = query.item[2] + var/title = query.item[3] + var/category = query.item[4] + dat += "[author][title][category]\[Order\]" + dat += "" + dat += "
      (Return to main menu)
      " + dbcon.Disconnect() if(5) dat += "

      Upload a New Title

      " if(!scanner) @@ -694,11 +527,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f dat += "No scanner found within wireless network range.
      " else if(!scanner.cache) dat += "No data found in scanner memory.
      " - else if(scanner.cache.ssbn && (scanner.cache.author_real != user.real_name && scanner.cache.author_key != user.client.ckey)) - dat += "This book contains copy protection preventing you from re-uploading this to the database.
      " else - dat += "Data marked for [scanner.cache.ssbn ? "re-" : ""]upload...
      " - dat += "Title: [scanner.cache.title]
      " + dat += "Data marked for upload...
      " + dat += "Title: [scanner.cache.name]
      " if(!scanner.cache.author) scanner.cache.author = "Anonymous" dat += "Author: [scanner.cache.author]
      " @@ -717,11 +548,6 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f /obj/machinery/librarycomp/attackby(obj/item/weapon/W as obj, mob/user as mob) if (src.density && istype(W, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return src.emagged = 1 if(istype(W, /obj/item/weapon/barcodescanner)) var/obj/item/weapon/barcodescanner/scanner = W @@ -733,6 +559,11 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f ..() /obj/machinery/librarycomp/Topic(href, href_list) + if(..()) + usr << browse(null, "window=library") + onclose(usr, "library") + return + if(href_list["switchscreen"]) switch(href_list["switchscreen"]) if("0") @@ -794,13 +625,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f if(href_list["delbook"]) var/obj/item/weapon/book/b = locate(href_list["delbook"]) inventory.Remove(b) - if(href_list["settitle"]) - var/newtitle = input("Enter the book name: ", "Book Upload", scanner.cache.title) as text|null - if(newtitle) - scanner.cache.title = sanitize(newtitle) - scanner.cache.name = "Book: [scanner.cache.title]" if(href_list["setauthor"]) - var/newauthor = copytext(sanitize(input("Enter the author's name: ", "Book Upload", scanner.cache.author) as text|null),1,MAX_MESSAGE_LEN) + var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN) if(newauthor) scanner.cache.author = newauthor if(href_list["setcategory"]) @@ -812,128 +638,70 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f if(scanner.cache) var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort") if(choice == "Confirm") - if(BOOKS_USE_SQL && config.sql_enabled) - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") - if(!dbcon.IsConnected()) - alert("Connection to Archive has been severed. Aborting.") - else - /* - var/sqltitle = dbcon.Quote(scanner.cache.name) - var/sqlauthor = dbcon.Quote(scanner.cache.author) - var/sqlcontent = dbcon.Quote(scanner.cache.dat) - var/sqlcategory = dbcon.Quote(upload_category) - */ - var/sqltitle = dd_replacetext(scanner.cache.name, "'", "''") - var/sqlauthor = dd_replacetext(scanner.cache.author, "'", "''") - var/sqlcontent = dd_replacetext(scanner.cache.dat, "'", "''") - var/sqlcategory = upload_category - ///proc/dd_replacetext(text, search_string, replacement_string) - var/DBQuery/query = dbcon.NewQuery("INSERT INTO library (author, title, content, category) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]')") - if(!query.Execute()) - usr << query.ErrorMsg() - else - log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs") - alert("Upload Complete.") - dbcon.Disconnect() + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") + if(!dbcon.IsConnected()) + alert("Connection to Archive has been severed. Aborting.") else - var/datum/archived_book/B = new() - if(scanner.cache.title) - B.title = scanner.cache.title + /* + var/sqltitle = dbcon.Quote(scanner.cache.name) + var/sqlauthor = dbcon.Quote(scanner.cache.author) + var/sqlcontent = dbcon.Quote(scanner.cache.dat) + var/sqlcategory = dbcon.Quote(upload_category) + */ + var/sqltitle = sanitizeSQL(scanner.cache.name) + var/sqlauthor = sanitizeSQL(scanner.cache.author) + var/sqlcontent = sanitizeSQL(scanner.cache.dat) + var/sqlcategory = sanitizeSQL(upload_category) + var/DBQuery/query = dbcon.NewQuery("INSERT INTO library (author, title, content, category) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]')") + if(!query.Execute()) + usr << query.ErrorMsg() else - B.title = scanner.cache.name - B.author = scanner.cache.author - B.dat = scanner.cache.dat - B.category = upload_category - if(scanner.cache.ssbn) - B.id = scanner.cache.ssbn - else - B.id = book_mgr.freeid() - B.author_real = scanner.cache.author_real - B.author_key = scanner.cache.author_key - if(scanner.cache.photos.len >= 8) - scanner.cache.photos.len = 8 - B.photos = scanner.cache.photos - B.save() - - log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs") - alert("Upload Complete.") + log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs") + alert("Upload Complete.") + dbcon.Disconnect() if(href_list["targetid"]) - - if(BOOKS_USE_SQL && config.sql_enabled) - var/sqlid = href_list["targetid"] - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") - if(!dbcon.IsConnected()) - alert("Connection to Archive has been severed. Aborting.") - if(bibledelay) - for (var/mob/V in hearers(src)) - V.show_message("[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"") - else - bibledelay = 1 - spawn(60) - bibledelay = 0 - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM library WHERE id=[sqlid]") - query.Execute() - - while(query.NextRow()) - var/author = query.item[2] - var/title = query.item[3] - var/content = query.item[4] - var/obj/item/weapon/book/B = new(src.loc) - if(title) - B.name = "[title]" - else - B.name = "Untitled book" - B.title = title - B.author = author - B.dat = content - B.gen_pages() - B.icon_state = "book[rand(1,7)]" - src.visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?") - break - dbcon.Disconnect() + var/sqlid = sanitizeSQL(href_list["targetid"]) + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") + if(!dbcon.IsConnected()) + alert("Connection to Archive has been severed. Aborting.") + if(bibledelay) + for (var/mob/V in hearers(src)) + V.show_message("[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"") else - var/datum/archived_book/AB = new(book_mgr.path(text2num(href_list["targetid"]))) - if(!AB) - alert("Book not found!") - else - var/obj/item/weapon/book/B = new(src.loc) - B.name = "Book: [AB.title]" - B.title = AB.title - B.author = AB.author - B.dat = AB.dat - B.gen_pages() - B.icon_state = "book[rand(1,7)]" - B.author_real = AB.author_real - B.author_key = AB.author_key - B.photos = AB.photos - src.visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?") + bibledelay = 1 + spawn(60) + bibledelay = 0 + var/DBQuery/query = dbcon.NewQuery("SELECT * FROM library WHERE id=[sqlid]") + query.Execute() + while(query.NextRow()) + var/author = query.item[2] + var/title = query.item[3] + var/content = query.item[4] + var/obj/item/weapon/book/B = new(src.loc) + B.name = "Book: [title]" + B.title = title + B.author = author + B.dat = content + B.icon_state = "book[rand(1,7)]" + src.visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?") + break + dbcon.Disconnect() if(href_list["orderbyid"]) var/orderid = input("Enter your order:") as num|null if(orderid) - var/nhref = "src=\ref[src];targetid=[orderid]" - spawn() src.Topic(nhref, params2list(nhref), src) + if(isnum(orderid)) + var/nhref = "src=\ref[src];targetid=[orderid]" + spawn() src.Topic(nhref, params2list(nhref), src) src.add_fingerprint(usr) src.updateUsrDialog() return - - - - - - - - - - - - /obj/machinery/libraryscanner name = "scanner" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state = "bigscanner" anchored = 1 density = 1 @@ -963,6 +731,11 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f onclose(user, "scanner") /obj/machinery/libraryscanner/Topic(href, href_list) + if(..()) + usr << browse(null, "window=scanner") + onclose(usr, "scanner") + return + if(href_list["scan"]) for(var/obj/item/weapon/book/B in contents) cache = B @@ -985,241 +758,23 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f /obj/machinery/bookbinder name = "Book Binder" - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' icon_state = "binder" anchored = 1 density = 1 - var/obj/item/weapon/book/template - var/list/icon_names - var/i_preview = 1 - var/printing = 0 - - proc/newGenericBook() - template = new(src) - template.title = "Print Job #" + "[rand(100, 999)]" - template.author = "Anonymous" - template.name = "Book: [template.title]" - template.icon_state = "book[rand(1,7)]" - template.dat = "" - template.gen_pages() - template.photos = new() - icon_names = new() - i_preview = 1 - - attackby(var/obj/O as obj, var/mob/user as mob) - if(istype(O, /obj/item/weapon/paper)) - user.drop_item() - O.loc = src - user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].") - - if(template) - template.dat += "[O:info]" - template.gen_pages() - else - template = new(src) - template.title = O.name == initial(O.name) ? "Print Job #" + "[rand(100, 999)]" : O.name - template.name = "Book: [template.title]" - template.icon_state = "book[rand(1,7)]" - template.dat = O:info - template.gen_pages() - template.photos = new() - icon_names = new() - i_preview = 1 - del(O) - updateUsrDialog() - else if(istype(O, /obj/item/weapon/photo)) - user.drop_item() - O.loc = src - user.visible_message("[user] loads a photo into [src].", "You load a photo into [src].") - - if(!template) - newGenericBook() - if(template.photos.len >= 8) - user << "\red The photo tray is already full!" - O.loc = src.loc - return - - var/icon/imported = new(O.icon) - imported.Crop(6,8,27,27) - imported.Scale(32,32) - template.photos += imported - icon_names += O.name - del(O) - updateUsrDialog() - else if(istype(O, /obj/item/weapon/book)) - if(template) - user << "\red The binder already has a book in the buffer!" - return - - user.drop_item() - O.loc = src - user.visible_message("[user] loads a book into [src] for editing.", "You load a book into [src] for editing.") - - var/obj/machinery/librarycomp/C = locate() in loc.loc - if(C) - if(C.inventory.Find(O)) - C.inventory -= O - template = O - icon_names = new() - for(var/i = 1 to template.photos.len) - icon_names += "Photo [i]" - updateUsrDialog() - else - ..() - -/obj/machinery/bookbinder/attack_paw(user as mob) - return src.attack_hand(user) - -/obj/machinery/bookbinder/attack_ai(user as mob) - return src.attack_hand(user) - -/obj/machinery/bookbinder/attack_hand(user as mob) - if(..()) - return - - if(src.stat) - user << "[name] does not seem to be responding to your button mashing." - return - - var/dat = "Book BinderNT Publishing House
      " - - if(printing) - dat += "[src] is currently printing." - else - // general settings - dat += "New Book" - - if(template) - template.cache_imgs(user) - - dat += " Delete Book
      " - - dat += "Title: [template.title]
      " - dat += "Author: [template.author]
      " - - // articles - dat += "Pages:
        " - var/ID = 1 - for(var/P in template.pages) - dat += "
      1. Page [ID]" - dat += " Preview" - dat += " Delete
      2. " - ID++ - - dat += "
      New Page
      " - - // images - dat += "Images:
        " - ID = 1 - for(var/icon/I in template.photos) - dat += "
      1. [ID]: [icon_names[ID]]" - dat += " Delete" - ID++ - dat += "
      " - if(i_preview >= 1 && i_preview <= template.photos.len) - var/iconname = "book_preview.png" - user << browse_rsc(template.photos[i_preview],iconname) - dat += "[i_preview] ([icon_names[i_preview]]): " - dat += "
      Print" - - dat += "
      " - user << browse(dat, "window=bookbinder") - onclose(user, "bookbinder") - - -/obj/machinery/bookbinder/Topic(href, href_list) - if(..()) - return - usr.machine = src - src.add_fingerprint(usr) - - if(href_list["new"]) - if(template) - var/R = alert("There is already a book in the buffer. Do you want to delete it and start over?", "Book Binder", "Delete", "Cancel") - if(R == "Cancel") - return - del(template) - newGenericBook() - updateUsrDialog() - if(href_list["delete"]) - if(template) - del(template) - updateUsrDialog() - if(href_list["print"]) - printing = 1 - updateUsrDialog() +/obj/machinery/bookbinder/attackby(var/obj/O as obj, var/mob/user as mob) + if(istype(O, /obj/item/weapon/paper)) + user.drop_item() + O.loc = src + user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].") src.visible_message("[src] begins to hum as it warms up its printing drums.") - sleep(rand(50,100)) + sleep(rand(200,400)) src.visible_message("[src] whirs as it prints and binds a new book.") - - if(!template.ssbn) - template.author_real = usr.real_name - if(usr.client) - template.author_key = usr.client.ckey - template.loc = src.loc - template = null - printing = 0 - updateUsrDialog() - if(href_list["p_new"]) - template.dat += "" - template.gen_pages() - updateUsrDialog() - - if(href_list["title"]) - var/n_name = input(usr, "What would you like to title your book?", "Book Binder", template.title) as text|null - if(n_name) - template.title = sanitize(n_name) - template.name = "Book: [template.title]" - updateUsrDialog() - if(href_list["author"]) - var/n_name = input(usr, "Who would you like your pen name to be?", "Book Binder", template.author) as text|null - if(n_name) - template.author = sanitize(n_name) - updateUsrDialog() - - if(href_list["p_edit"]) - var/PN = text2num(href_list["p_edit"]) - var/list/pages = dd_text2list(template.dat, "") - var/t = pages[PN] - do - t = input(usr, "What text do you wish to add?", "Book Binder P.[PN]", t) as message - - if(lentext(t) >= MAX_BOOK_MESSAGE_LEN) - var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") - if(cont == "no") - break - while(lentext(t) > MAX_BOOK_MESSAGE_LEN) - - // check for exploits - for(var/tag in paper_blacklist) - if(findtext(t,"<"+tag)) - usr << "\blue You think to yourself, \"Hm.. this is only paper...\"" - return - - // the actual pages list is formatted and shouldn't be directly editted - pages[PN] = t - template.dat = dd_list2text(pages, "") - template.gen_pages() - updateUsrDialog() - if(href_list["p_delete"]) - var/i = text2num(href_list["p_delete"]) - var/list/pages = dd_text2list(template.dat, "") - pages.Cut(i, i+1) - template.dat = dd_list2text(pages, "") - template.gen_pages() - updateUsrDialog() - if(href_list["p_preview"]) - var/i = text2num(href_list["p_preview"]) - var/dat = template.pages[i] - usr << browse(dat, "window=bookbinder_preview;size=600x500") - onclose(usr, "bookbinder_preview") - - if(href_list["i_view"]) - i_preview = text2num(href_list["i_view"]) - updateUsrDialog() - if(href_list["i_delete"]) - var/i = text2num(href_list["i_delete"]) - template.photos.Cut(i, i+1) - icon_names.Cut(i, i+1) - updateUsrDialog() + var/obj/item/weapon/book/b = new(src.loc) + b.dat = O:info + b.name = "Print Job #" + "[rand(100, 999)]" + b.icon_state = "book[rand(1,7)]" + del(O) + else + ..() diff --git a/code/game/magic/musician.dm b/code/game/magic/musician.dm index 60003e6b41..5bcece15ea 100644 --- a/code/game/magic/musician.dm +++ b/code/game/magic/musician.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /datum/song var/name = "Untitled" @@ -7,7 +7,7 @@ /obj/structure/device/piano name = "space minimoog" - icon = 'musician.dmi' + icon = 'icons/obj/musician.dmi' icon_state = "minimoog" anchored = 1 density = 1 @@ -15,6 +15,7 @@ var/playing = 0 var/help = 0 var/edit = 1 + var/repeat = 0 proc playnote(var/note as text) @@ -24,343 +25,343 @@ Tried doing it dynamically at first but its more trouble than its worth. Would have saved many lines tho.*/ switch(note) if("Cn1") - soundfile = 'Cn1.ogg' + soundfile = 'sound/piano/Cn1.ogg' if("C#1") - soundfile = 'C#1.ogg' + soundfile = 'sound/piano/C#1.ogg' if("Db1") - soundfile = 'Db1.ogg' + soundfile = 'sound/piano/Db1.ogg' if("Dn1") - soundfile = 'Dn1.ogg' + soundfile = 'sound/piano/Dn1.ogg' if("D#1") - soundfile = 'D#1.ogg' + soundfile = 'sound/piano/D#1.ogg' if("Eb1") - soundfile = 'Eb1.ogg' + soundfile = 'sound/piano/Eb1.ogg' if("En1") - soundfile = 'En1.ogg' + soundfile = 'sound/piano/En1.ogg' if("E#1") - soundfile = 'E#1.ogg' + soundfile = 'sound/piano/E#1.ogg' if("Fb1") - soundfile = 'Fb1.ogg' + soundfile = 'sound/piano/Fb1.ogg' if("Fn1") - soundfile = 'Fn1.ogg' + soundfile = 'sound/piano/Fn1.ogg' if("F#1") - soundfile = 'F#1.ogg' + soundfile = 'sound/piano/F#1.ogg' if("Gb1") - soundfile = 'Gb1.ogg' + soundfile = 'sound/piano/Gb1.ogg' if("Gn1") - soundfile = 'Gn1.ogg' + soundfile = 'sound/piano/Gn1.ogg' if("G#1") - soundfile = 'G#1.ogg' + soundfile = 'sound/piano/G#1.ogg' if("Ab1") - soundfile = 'Ab1.ogg' + soundfile = 'sound/piano/Ab1.ogg' if("An1") - soundfile = 'An1.ogg' + soundfile = 'sound/piano/An1.ogg' if("A#1") - soundfile = 'A#1.ogg' + soundfile = 'sound/piano/A#1.ogg' if("Bb1") - soundfile = 'Bb1.ogg' + soundfile = 'sound/piano/Bb1.ogg' if("Bn1") - soundfile = 'Bn1.ogg' + soundfile = 'sound/piano/Bn1.ogg' if("B#1") - soundfile = 'B#1.ogg' + soundfile = 'sound/piano/B#1.ogg' if("Cb2") - soundfile = 'Cb2.ogg' + soundfile = 'sound/piano/Cb2.ogg' if("Cn2") - soundfile = 'Cn2.ogg' + soundfile = 'sound/piano/Cn2.ogg' if("C#2") - soundfile = 'C#2.ogg' + soundfile = 'sound/piano/C#2.ogg' if("Db2") - soundfile = 'Db2.ogg' + soundfile = 'sound/piano/Db2.ogg' if("Dn2") - soundfile = 'Dn2.ogg' + soundfile = 'sound/piano/Dn2.ogg' if("D#2") - soundfile = 'D#2.ogg' + soundfile = 'sound/piano/D#2.ogg' if("Eb2") - soundfile = 'Eb2.ogg' + soundfile = 'sound/piano/Eb2.ogg' if("En2") - soundfile = 'En2.ogg' + soundfile = 'sound/piano/En2.ogg' if("E#2") - soundfile = 'E#2.ogg' + soundfile = 'sound/piano/E#2.ogg' if("Fb2") - soundfile = 'Fb2.ogg' + soundfile = 'sound/piano/Fb2.ogg' if("Fn2") - soundfile = 'Fn2.ogg' + soundfile = 'sound/piano/Fn2.ogg' if("F#2") - soundfile = 'F#2.ogg' + soundfile = 'sound/piano/F#2.ogg' if("Gb2") - soundfile = 'Gb2.ogg' + soundfile = 'sound/piano/Gb2.ogg' if("Gn2") - soundfile = 'Gn2.ogg' + soundfile = 'sound/piano/Gn2.ogg' if("G#2") - soundfile = 'G#2.ogg' + soundfile = 'sound/piano/G#2.ogg' if("Ab2") - soundfile = 'Ab2.ogg' + soundfile = 'sound/piano/Ab2.ogg' if("An2") - soundfile = 'An2.ogg' + soundfile = 'sound/piano/An2.ogg' if("A#2") - soundfile = 'A#2.ogg' + soundfile = 'sound/piano/A#2.ogg' if("Bb2") - soundfile = 'Bb2.ogg' + soundfile = 'sound/piano/Bb2.ogg' if("Bn2") - soundfile = 'Bn2.ogg' + soundfile = 'sound/piano/Bn2.ogg' if("B#2") - soundfile = 'B#2.ogg' + soundfile = 'sound/piano/B#2.ogg' if("Cb3") - soundfile = 'Cb3.ogg' + soundfile = 'sound/piano/Cb3.ogg' if("Cn3") - soundfile = 'Cn3.ogg' + soundfile = 'sound/piano/Cn3.ogg' if("C#3") - soundfile = 'C#3.ogg' + soundfile = 'sound/piano/C#3.ogg' if("Db3") - soundfile = 'Db3.ogg' + soundfile = 'sound/piano/Db3.ogg' if("Dn3") - soundfile = 'Dn3.ogg' + soundfile = 'sound/piano/Dn3.ogg' if("D#3") - soundfile = 'D#3.ogg' + soundfile = 'sound/piano/D#3.ogg' if("Eb3") - soundfile = 'Eb3.ogg' + soundfile = 'sound/piano/Eb3.ogg' if("En3") - soundfile = 'En3.ogg' + soundfile = 'sound/piano/En3.ogg' if("E#3") - soundfile = 'E#3.ogg' + soundfile = 'sound/piano/E#3.ogg' if("Fb3") - soundfile = 'Fb3.ogg' + soundfile = 'sound/piano/Fb3.ogg' if("Fn3") - soundfile = 'Fn3.ogg' + soundfile = 'sound/piano/Fn3.ogg' if("F#3") - soundfile = 'F#3.ogg' + soundfile = 'sound/piano/F#3.ogg' if("Gb3") - soundfile = 'Gb3.ogg' + soundfile = 'sound/piano/Gb3.ogg' if("Gn3") - soundfile = 'Gn3.ogg' + soundfile = 'sound/piano/Gn3.ogg' if("G#3") - soundfile = 'G#3.ogg' + soundfile = 'sound/piano/G#3.ogg' if("Ab3") - soundfile = 'Ab3.ogg' + soundfile = 'sound/piano/Ab3.ogg' if("An3") - soundfile = 'An3.ogg' + soundfile = 'sound/piano/An3.ogg' if("A#3") - soundfile = 'A#3.ogg' + soundfile = 'sound/piano/A#3.ogg' if("Bb3") - soundfile = 'Bb3.ogg' + soundfile = 'sound/piano/Bb3.ogg' if("Bn3") - soundfile = 'Bn3.ogg' + soundfile = 'sound/piano/Bn3.ogg' if("B#3") - soundfile = 'B#3.ogg' + soundfile = 'sound/piano/B#3.ogg' if("Cb4") - soundfile = 'Cb4.ogg' + soundfile = 'sound/piano/Cb4.ogg' if("Cn4") - soundfile = 'Cn4.ogg' + soundfile = 'sound/piano/Cn4.ogg' if("C#4") - soundfile = 'C#4.ogg' + soundfile = 'sound/piano/C#4.ogg' if("Db4") - soundfile = 'Db4.ogg' + soundfile = 'sound/piano/Db4.ogg' if("Dn4") - soundfile = 'Dn4.ogg' + soundfile = 'sound/piano/Dn4.ogg' if("D#4") - soundfile = 'D#4.ogg' + soundfile = 'sound/piano/D#4.ogg' if("Eb4") - soundfile = 'Eb4.ogg' + soundfile = 'sound/piano/Eb4.ogg' if("En4") - soundfile = 'En4.ogg' + soundfile = 'sound/piano/En4.ogg' if("E#4") - soundfile = 'E#4.ogg' + soundfile = 'sound/piano/E#4.ogg' if("Fb4") - soundfile = 'Fb4.ogg' + soundfile = 'sound/piano/Fb4.ogg' if("Fn4") - soundfile = 'Fn4.ogg' + soundfile = 'sound/piano/Fn4.ogg' if("F#4") - soundfile = 'F#4.ogg' + soundfile = 'sound/piano/F#4.ogg' if("Gb4") - soundfile = 'Gb4.ogg' + soundfile = 'sound/piano/Gb4.ogg' if("Gn4") - soundfile = 'Gn4.ogg' + soundfile = 'sound/piano/Gn4.ogg' if("G#4") - soundfile = 'G#4.ogg' + soundfile = 'sound/piano/G#4.ogg' if("Ab4") - soundfile = 'Ab4.ogg' + soundfile = 'sound/piano/Ab4.ogg' if("An4") - soundfile = 'An4.ogg' + soundfile = 'sound/piano/An4.ogg' if("A#4") - soundfile = 'A#4.ogg' + soundfile = 'sound/piano/A#4.ogg' if("Bb4") - soundfile = 'Bb4.ogg' + soundfile = 'sound/piano/Bb4.ogg' if("Bn4") - soundfile = 'Bn4.ogg' + soundfile = 'sound/piano/Bn4.ogg' if("B#4") - soundfile = 'B#4.ogg' + soundfile = 'sound/piano/B#4.ogg' if("Cb5") - soundfile = 'Cb5.ogg' + soundfile = 'sound/piano/Cb5.ogg' if("Cn5") - soundfile = 'Cn5.ogg' + soundfile = 'sound/piano/Cn5.ogg' if("C#5") - soundfile = 'C#5.ogg' + soundfile = 'sound/piano/C#5.ogg' if("Db5") - soundfile = 'Db5.ogg' + soundfile = 'sound/piano/Db5.ogg' if("Dn5") - soundfile = 'Dn5.ogg' + soundfile = 'sound/piano/Dn5.ogg' if("D#5") - soundfile = 'D#5.ogg' + soundfile = 'sound/piano/D#5.ogg' if("Eb5") - soundfile = 'Eb5.ogg' + soundfile = 'sound/piano/Eb5.ogg' if("En5") - soundfile = 'En5.ogg' + soundfile = 'sound/piano/En5.ogg' if("E#5") - soundfile = 'E#5.ogg' + soundfile = 'sound/piano/E#5.ogg' if("Fb5") - soundfile = 'Fb5.ogg' + soundfile = 'sound/piano/Fb5.ogg' if("Fn5") - soundfile = 'Fn5.ogg' + soundfile = 'sound/piano/Fn5.ogg' if("F#5") - soundfile = 'F#5.ogg' + soundfile = 'sound/piano/F#5.ogg' if("Gb5") - soundfile = 'Gb5.ogg' + soundfile = 'sound/piano/Gb5.ogg' if("Gn5") - soundfile = 'Gn5.ogg' + soundfile = 'sound/piano/Gn5.ogg' if("G#5") - soundfile = 'G#5.ogg' + soundfile = 'sound/piano/G#5.ogg' if("Ab5") - soundfile = 'Ab5.ogg' + soundfile = 'sound/piano/Ab5.ogg' if("An5") - soundfile = 'An5.ogg' + soundfile = 'sound/piano/An5.ogg' if("A#5") - soundfile = 'A#5.ogg' + soundfile = 'sound/piano/A#5.ogg' if("Bb5") - soundfile = 'Bb5.ogg' + soundfile = 'sound/piano/Bb5.ogg' if("Bn5") - soundfile = 'Bn5.ogg' + soundfile = 'sound/piano/Bn5.ogg' if("B#5") - soundfile = 'B#5.ogg' + soundfile = 'sound/piano/B#5.ogg' if("Cb6") - soundfile = 'Cb6.ogg' + soundfile = 'sound/piano/Cb6.ogg' if("Cn6") - soundfile = 'Cn6.ogg' + soundfile = 'sound/piano/Cn6.ogg' if("C#6") - soundfile = 'C#6.ogg' + soundfile = 'sound/piano/C#6.ogg' if("Db6") - soundfile = 'Db6.ogg' + soundfile = 'sound/piano/Db6.ogg' if("Dn6") - soundfile = 'Dn6.ogg' + soundfile = 'sound/piano/Dn6.ogg' if("D#6") - soundfile = 'D#6.ogg' + soundfile = 'sound/piano/D#6.ogg' if("Eb6") - soundfile = 'Eb6.ogg' + soundfile = 'sound/piano/Eb6.ogg' if("En6") - soundfile = 'En6.ogg' + soundfile = 'sound/piano/En6.ogg' if("E#6") - soundfile = 'E#6.ogg' + soundfile = 'sound/piano/E#6.ogg' if("Fb6") - soundfile = 'Fb6.ogg' + soundfile = 'sound/piano/Fb6.ogg' if("Fn6") - soundfile = 'Fn6.ogg' + soundfile = 'sound/piano/Fn6.ogg' if("F#6") - soundfile = 'F#6.ogg' + soundfile = 'sound/piano/F#6.ogg' if("Gb6") - soundfile = 'Gb6.ogg' + soundfile = 'sound/piano/Gb6.ogg' if("Gn6") - soundfile = 'Gn6.ogg' + soundfile = 'sound/piano/Gn6.ogg' if("G#6") - soundfile = 'G#6.ogg' + soundfile = 'sound/piano/G#6.ogg' if("Ab6") - soundfile = 'Ab6.ogg' + soundfile = 'sound/piano/Ab6.ogg' if("An6") - soundfile = 'An6.ogg' + soundfile = 'sound/piano/An6.ogg' if("A#6") - soundfile = 'A#6.ogg' + soundfile = 'sound/piano/A#6.ogg' if("Bb6") - soundfile = 'Bb6.ogg' + soundfile = 'sound/piano/Bb6.ogg' if("Bn6") - soundfile = 'Bn6.ogg' + soundfile = 'sound/piano/Bn6.ogg' if("B#6") - soundfile = 'B#6.ogg' + soundfile = 'sound/piano/B#6.ogg' if("Cb7") - soundfile = 'Cb7.ogg' + soundfile = 'sound/piano/Cb7.ogg' if("Cn7") - soundfile = 'Cn7.ogg' + soundfile = 'sound/piano/Cn7.ogg' if("C#7") - soundfile = 'C#7.ogg' + soundfile = 'sound/piano/C#7.ogg' if("Db7") - soundfile = 'Db7.ogg' + soundfile = 'sound/piano/Db7.ogg' if("Dn7") - soundfile = 'Dn7.ogg' + soundfile = 'sound/piano/Dn7.ogg' if("D#7") - soundfile = 'D#7.ogg' + soundfile = 'sound/piano/D#7.ogg' if("Eb7") - soundfile = 'Eb7.ogg' + soundfile = 'sound/piano/Eb7.ogg' if("En7") - soundfile = 'En7.ogg' + soundfile = 'sound/piano/En7.ogg' if("E#7") - soundfile = 'E#7.ogg' + soundfile = 'sound/piano/E#7.ogg' if("Fb7") - soundfile = 'Fb7.ogg' + soundfile = 'sound/piano/Fb7.ogg' if("Fn7") - soundfile = 'Fn7.ogg' + soundfile = 'sound/piano/Fn7.ogg' if("F#7") - soundfile = 'F#7.ogg' + soundfile = 'sound/piano/F#7.ogg' if("Gb7") - soundfile = 'Gb7.ogg' + soundfile = 'sound/piano/Gb7.ogg' if("Gn7") - soundfile = 'Gn7.ogg' + soundfile = 'sound/piano/Gn7.ogg' if("G#7") - soundfile = 'G#7.ogg' + soundfile = 'sound/piano/G#7.ogg' if("Ab7") - soundfile = 'Ab7.ogg' + soundfile = 'sound/piano/Ab7.ogg' if("An7") - soundfile = 'An7.ogg' + soundfile = 'sound/piano/An7.ogg' if("A#7") - soundfile = 'A#7.ogg' + soundfile = 'sound/piano/A#7.ogg' if("Bb7") - soundfile = 'Bb7.ogg' + soundfile = 'sound/piano/Bb7.ogg' if("Bn7") - soundfile = 'Bn7.ogg' + soundfile = 'sound/piano/Bn7.ogg' if("B#7") - soundfile = 'B#7.ogg' + soundfile = 'sound/piano/B#7.ogg' if("Cb8") - soundfile = 'Cb8.ogg' + soundfile = 'sound/piano/Cb8.ogg' if("Cn8") - soundfile = 'Cn8.ogg' + soundfile = 'sound/piano/Cn8.ogg' if("C#8") - soundfile = 'C#8.ogg' + soundfile = 'sound/piano/C#8.ogg' if("Db8") - soundfile = 'Db8.ogg' + soundfile = 'sound/piano/Db8.ogg' if("Dn8") - soundfile = 'Dn8.ogg' + soundfile = 'sound/piano/Dn8.ogg' if("D#8") - soundfile = 'D#8.ogg' + soundfile = 'sound/piano/D#8.ogg' if("Eb8") - soundfile = 'Eb8.ogg' + soundfile = 'sound/piano/Eb8.ogg' if("En8") - soundfile = 'En8.ogg' + soundfile = 'sound/piano/En8.ogg' if("E#8") - soundfile = 'E#8.ogg' + soundfile = 'sound/piano/E#8.ogg' if("Fb8") - soundfile = 'Fb8.ogg' + soundfile = 'sound/piano/Fb8.ogg' if("Fn8") - soundfile = 'Fn8.ogg' + soundfile = 'sound/piano/Fn8.ogg' if("F#8") - soundfile = 'F#8.ogg' + soundfile = 'sound/piano/F#8.ogg' if("Gb8") - soundfile = 'Gb8.ogg' + soundfile = 'sound/piano/Gb8.ogg' if("Gn8") - soundfile = 'Gn8.ogg' + soundfile = 'sound/piano/Gn8.ogg' if("G#8") - soundfile = 'G#8.ogg' + soundfile = 'sound/piano/G#8.ogg' if("Ab8") - soundfile = 'Ab8.ogg' + soundfile = 'sound/piano/Ab8.ogg' if("An8") - soundfile = 'An8.ogg' + soundfile = 'sound/piano/An8.ogg' if("A#8") - soundfile = 'A#8.ogg' + soundfile = 'sound/piano/A#8.ogg' if("Bb8") - soundfile = 'Bb8.ogg' + soundfile = 'sound/piano/Bb8.ogg' if("Bn8") - soundfile = 'Bn8.ogg' + soundfile = 'sound/piano/Bn8.ogg' if("B#8") - soundfile = 'B#8.ogg' + soundfile = 'sound/piano/B#8.ogg' if("Cb9") - soundfile = 'Cb9.ogg' + soundfile = 'sound/piano/Cb9.ogg' if("Cn9") - soundfile = 'Cn9.ogg' + soundfile = 'sound/piano/Cn9.ogg' else return @@ -368,42 +369,46 @@ M << sound(soundfile) playsong() - var/cur_oct[7] - var/cur_acc[7] - for(var/i = 1 to 7) - cur_oct[i] = "3" - cur_acc[i] = "n" + do + var/cur_oct[7] + var/cur_acc[7] + for(var/i = 1 to 7) + cur_oct[i] = "3" + cur_acc[i] = "n" - for(var/line in song.lines) - //world << line - for(var/beat in dd_text2list(lowertext(line), ",")) - //world << "beat: [beat]" - var/list/notes = dd_text2list(beat, "/") - for(var/note in dd_text2list(notes[1], "-")) - //world << "note: [note]" - if(!playing || !anchored)//If the piano is playing, or is loose - playing = 0 - return - if(lentext(note) == 0) - continue - //world << "Parse: [copytext(note,1,2)]" - var/cur_note = text2ascii(note) - 96 - if(cur_note < 1 || cur_note > 7) - continue - for(var/i=2 to lentext(note)) - var/ni = copytext(note,i,i+1) - if(!text2num(ni)) - if(ni == "#" || ni == "b" || ni == "n") - cur_acc[cur_note] = ni - else if(ni == "s") - cur_acc[cur_note] = "#" // so shift is never required - else - cur_oct[cur_note] = ni - playnote(uppertext(copytext(note,1,2)) + cur_acc[cur_note] + cur_oct[cur_note]) - if(notes.len >= 2 && text2num(notes[2])) - sleep(song.tempo / text2num(notes[2])) - else - sleep(song.tempo) + for(var/line in song.lines) + //world << line + for(var/beat in dd_text2list(lowertext(line), ",")) + //world << "beat: [beat]" + var/list/notes = dd_text2list(beat, "/") + for(var/note in dd_text2list(notes[1], "-")) + //world << "note: [note]" + if(!playing || !anchored)//If the piano is playing, or is loose + playing = 0 + return + if(lentext(note) == 0) + continue + //world << "Parse: [copytext(note,1,2)]" + var/cur_note = text2ascii(note) - 96 + if(cur_note < 1 || cur_note > 7) + continue + for(var/i=2 to lentext(note)) + var/ni = copytext(note,i,i+1) + if(!text2num(ni)) + if(ni == "#" || ni == "b" || ni == "n") + cur_acc[cur_note] = ni + else if(ni == "s") + cur_acc[cur_note] = "#" // so shift is never required + else + cur_oct[cur_note] = ni + playnote(uppertext(copytext(note,1,2)) + cur_acc[cur_note] + cur_oct[cur_note]) + if(notes.len >= 2 && text2num(notes[2])) + sleep(song.tempo / text2num(notes[2])) + else + sleep(song.tempo) + if(repeat > 0) + repeat-- //Infinite loops are baaaad. + while(repeat > 0) playing = 0 updateUsrDialog() @@ -417,9 +422,10 @@ if(song) if(song.lines.len > 0 && !(playing)) dat += "Play Song

      " + dat += "Repeat Song: [repeat] times.

      " if(playing) - dat += "Stop Playing

      " - + dat += "Stop Playing
      " + dat += "Repeats left: [repeat].

      " if(!edit) dat += "Show Editor

      " else @@ -460,77 +466,99 @@ onclose(user, "piano") Topic(href, href_list) - if(in_range(src, usr) && !issilicon(usr) && anchored) - if(href_list["tempo"]) - song.tempo += text2num(href_list["tempo"]) - if(song.tempo < 1) - song.tempo = 1 - if(href_list["play"]) - if(song) - playing = 1 - spawn() playsong() - if(href_list["newsong"]) + + if(!in_range(src, usr) || issilicon(usr) || !anchored || !usr.canmove || usr.restrained()) + usr << browse(null, "window=piano;size=700x300") + onclose(usr, "piano") + return + + if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops. + if(playing) return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing. + var/tempnum = input("How many times do you want to repeat this piece? (max:10)") as num + if(tempnum > 10) + tempnum = 10 + repeat = tempnum + + else if(href_list["tempo"]) + song.tempo += text2num(href_list["tempo"]) + if(song.tempo < 1) + song.tempo = 1 + + else if(href_list["play"]) + if(song) + playing = 1 + spawn() playsong() + + else if(href_list["newsong"]) + song = new() + + else if(href_list["newline"]) + var/newline = input("Enter your line: ", "Piano") as text|null + if(!newline) + return + if(song.lines.len > 50) + return + if(lentext(newline) > 50) + newline = copytext(newline, 1, 50) + song.lines.Add(newline) + + else if(href_list["deleteline"]) + var/num = text2num(href_list["deleteline"]) + song.lines.Cut(num, num+1) + + else if(href_list["modifyline"]) + var/num = text2num(href_list["modifyline"]) + var/content = input("Enter your line: ", "Piano", song.lines[num]) as text|null + if(!content) + return + if(lentext(content) > 50) + content = copytext(content, 1, 50) + song.lines[num] = content + + else if(href_list["stop"]) + playing = 0 + + else if(href_list["help"]) + help = text2num(href_list["help"]) - 1 + + else if(href_list["edit"]) + edit = text2num(href_list["edit"]) - 1 + + else if(href_list["import"]) + var/t = "" + do + t = input(usr, "Please paste the entire song, formatted:", text("[]", src.name), t) as message + if (!in_range(src, usr)) + return + + if(lentext(t) >= 3072) + var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") + if(cont == "no") + break + while(lentext(t) > 3072) + + //split into lines + spawn() + var/list/lines = dd_text2list(t, "\n") + var/tempo = 5 + if(copytext(lines[1],1,6) == "BPM: ") + tempo = 600 / text2num(copytext(lines[1],6)) + lines.Cut(1,2) + if(lines.len > 50) + usr << "Too many lines!" + lines.Cut(51) + var/linenum = 1 + for(var/l in lines) + if(lentext(l) > 50) + usr << "Line [linenum] too long!" + lines.Remove(l) + else + linenum++ song = new() - if(href_list["newline"]) - var/newline = input("Enter your line: ", "Piano") as text|null - if(!newline) - return - if(song.lines.len > 50) - return - if(lentext(newline) > 50) - newline = copytext(newline, 1, 50) - song.lines.Add(newline) - if(href_list["deleteline"]) - var/num = text2num(href_list["deleteline"]) - song.lines.Cut(num, num+1) - if(href_list["modifyline"]) - var/num = text2num(href_list["modifyline"]) - var/content = input("Enter your line: ", "Piano", song.lines[num]) as text|null - if(!content) - return - if(lentext(content) > 50) - content = copytext(content, 1, 50) - song.lines[num] = content - if(href_list["stop"]) - playing = 0 - if(href_list["help"]) - help = text2num(href_list["help"]) - 1 - if(href_list["edit"]) - edit = text2num(href_list["edit"]) - 1 - if(href_list["import"]) - var/t = "" - do - t = input(usr, "Please paste the entire song, formatted:", text("[]", src.name), t) as message - if (!in_range(src, usr)) - return + song.lines = lines + song.tempo = tempo + updateUsrDialog() - if(lentext(t) >= MAX_PAPER_MESSAGE_LEN) - var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") - if(cont == "no") - break - while(lentext(t) > MAX_PAPER_MESSAGE_LEN) - - //split into lines - spawn() - var/list/lines = dd_text2list(t, "\n") - var/tempo = 5 - if(copytext(lines[1],1,6) == "BPM: ") - tempo = 600 / text2num(copytext(lines[1],6)) - lines.Cut(1,2) - if(lines.len > 50) - usr << "Too many lines!" - lines.Cut(51) - var/linenum = 1 - for(var/l in lines) - if(lentext(l) > 50) - usr << "Line [linenum] too long!" - lines.Remove(l) - else - linenum++ - song = new() - song.lines = lines - song.tempo = tempo - updateUsrDialog() add_fingerprint(usr) updateUsrDialog() return @@ -538,7 +566,7 @@ attackby(obj/item/O as obj, mob/user as mob) if (istype(O, /obj/item/weapon/wrench)) if (anchored) - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to loosen \the [src]'s casters..." if (do_after(user, 40)) user.visible_message( \ @@ -547,7 +575,7 @@ "You hear ratchet.") src.anchored = 0 else - playsound(src.loc, 'Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << "\blue You begin to tighten \the [src] to the floor..." if (do_after(user, 20)) user.visible_message( \ diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index f4fe50a7ae..3048e0fe9b 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -4,14 +4,13 @@ var/global/controllernum = "no" var/global/controller_iteration = 0 - - +var/global/last_tick_timeofday = world.timeofday +var/global/last_tick_duration = 0 datum/controller/game_controller var/processing = 1 var/global/air_master_ready = 0 - var/global/tension_master_ready = 0 var/global/sun_ready = 0 var/global/mobs_ready = 0 var/global/diseases_ready = 0 @@ -22,31 +21,19 @@ datum/controller/game_controller var/global/ticker_ready = 0 var/global/next_crew_shuttle_vote = 2 // the next automatic vote to call the crew shuttle - proc - keepalive() - setup() - setup_objects() - process() - set_debug_state(txt) + //Used for MC 'proc break' debugging + var/global/obj/last_obj_processed + var/global/datum/disease/last_disease_processed + var/global/obj/machinery/last_machine_processed + var/global/mob/last_mob_processed - keepalive() - spawn while(1) - sleep(10) - // Notify the other process that we're still there - socket_talk.send_keepalive() - - setup() + proc/setup() if(master_controller && (master_controller != src)) del(src) return //There can be only one master. - socket_talk = new /datum/socket_talk() - - // notify the other process that we started up - socket_talk.send_raw("type=startup") - if(!air_master) air_master = new /datum/controller/air_system() air_master.setup() @@ -57,26 +44,18 @@ datum/controller/game_controller world << "\red \b Job setup complete" job_master.LoadJobs("config/jobs.txt") - if(!tension_master) - tension_master = new /datum/tension() - world.tick_lag = config.Ticklag -// createRandomZlevel() - - // Sleep for about 5 seconds to allow background initialization procs to finish - sleep(50) - - // Now that the game is world is fully initialized, pause server until a user connects. - world.sleep_offline = 1 + createRandomZlevel() setup_objects() setupgenetics() -// for(var/i = 0, i < max_secret_rooms, i++) -// make_mining_asteroid_secret() -// Because energy cutlasses, facehuggers, and empty rooms are silly. FOR NOW. - Erthilo + + /*for(var/i = 0, i < max_secret_rooms, i++) + make_mining_asteroid_secret()*/ + syndicate_code_phrase = generate_code_phrase()//Sets up code phrase for traitors, for the round. syndicate_code_response = generate_code_phrase() @@ -87,12 +66,10 @@ datum/controller/game_controller setupfactions() - spawn keepalive() - spawn ticker.pregame() - setup_objects() + proc/setup_objects() world << "\red \b Initializing objects" sleep(-1) @@ -112,29 +89,22 @@ datum/controller/game_controller for(var/obj/machinery/atmospherics/unary/vent_scrubber/T in world) T.broadcast_status() - var/emclosetcount = rand((emclosets.len)/2, (emclosets.len)*2/3) - while(emclosetcount > 0) - var/turf/loc = pick(emclosets) - emclosets -= loc - new /obj/structure/closet/emcloset(loc) - emclosetcount-- - world << "\red \b Initializations complete." - set_debug_state(txt) + proc/set_debug_state(txt) // This should describe what is currently being done by the master controller // Useful for crashlogs and similar, because that way it's easy to tell what // was going on when the server crashed. socket_talk.send_raw("type=ticker_state&message=[txt]") return - process() - if(!Failsafe) - Failsafe = new /datum/failsafe - spawn(0) - Failsafe.spin() + proc/process() + var/currenttime = world.timeofday + var/diff = (currenttime - last_tick_timeofday) / 10 + last_tick_timeofday = currenttime + last_tick_duration = diff if(!processing) return 0 @@ -152,7 +122,6 @@ datum/controller/game_controller automatic_crew_shuttle_vote() air_master_ready = 0 - tension_master_ready = 0 sun_ready = 0 mobs_ready = 0 diseases_ready = 0 @@ -162,131 +131,110 @@ datum/controller/game_controller powernets_ready = 0 ticker_ready = 0 - // Notify the other process that we're still there - socket_talk.send_keepalive() - - // moved this here from air_master.start() - // this might make atmos slower - // upsides: - // 1. atmos won't process if the game is generally lagged out(no deadlocks) - // 2. if the server frequently crashes during atmos processing we will know - if(!kill_air) + spawn(0) src.set_debug_state("Air Master") - - air_master.current_cycle++ - var/success = air_master.tick() //Changed so that a runtime does not crash the ticker. - if(!success) //Runtimed. - log_adminwarn("ZASALERT: air_system/tick() failed: [air_master.tick_progress]") - air_master.failed_ticks++ - if(air_master.failed_ticks > 5) - world << "RUNTIMES IN ATMOS TICKER. Killing air simulation!" - kill_air = 1 - air_master.failed_ticks = 0 - /*else if (air_master.failed_ticks > 10) - air_master.failed_ticks = 0*/ - air_master_ready = 1 - - src.set_debug_state("Tension Master") - tension_master.process() - tension_master_ready = 1 + air_master.tick() + air_master_ready = 1 sleep(1) - src.set_debug_state("Sun Position Calculations") - sun.calc_position() - sun_ready = 1 + spawn(0) + src.set_debug_state("Sun Position Calculations") + sun.calc_position() + sun_ready = 1 sleep(-1) - src.set_debug_state("Mob Life Processing") - for(var/mob/M in world) - M.Life() - mobs_ready = 1 + spawn(0) + src.set_debug_state("Mob Processing") + for(var/mob/M in world) + last_mob_processed = M + M.Life() + mobs_ready = 1 + + sleep(-1) - src.set_debug_state("Old Disease Processing") - for(var/datum/disease/D in active_diseases) - D.process() - diseases_ready = 1 - src.set_debug_state("Machinery Processing") - for(var/obj/machinery/machine in machines) - if(machine) - machine.process() - if(machine && machine.use_power) - machine.auto_use_power() + spawn(0) + src.set_debug_state("Disease Processing") + for(var/datum/disease/D in active_diseases) + last_disease_processed = D + D.process() + diseases_ready = 1 - machines_ready = 1 + spawn(0) + src.set_debug_state("Machinery Processing") + for(var/obj/machinery/machine in machines) + if(machine) + last_machine_processed = machine + machine.process() + if(machine && machine.use_power) + machine.auto_use_power() + + machines_ready = 1 sleep(-1) sleep(1) - src.set_debug_state("Object Processing") - for(var/obj/object in processing_objects) - object.process() - objects_ready = 1 + spawn(0) + src.set_debug_state("Object Processing") + for(var/obj/object in processing_objects) + last_obj_processed = object + object.process() + objects_ready = 1 - src.set_debug_state("Pipe Network Processing") - for(var/datum/pipe_network/network in pipe_networks) - network.process() - networks_ready = 1 + spawn(0) + src.set_debug_state("Pipe Network Processing") + for(var/datum/pipe_network/network in pipe_networks) + network.process() + networks_ready = 1 - src.set_debug_state("Powernet Processing") - for(var/datum/powernet/P in powernets) - P.reset() - powernets_ready = 1 + spawn(0) + src.set_debug_state("Powernet Processing") + for(var/datum/powernet/P in powernets) + P.reset() + powernets_ready = 1 sleep(-1) - src.set_debug_state("Mode Processing") - ticker.process() - ticker_ready = 1 + spawn(0) + ticker.process() + ticker_ready = 1 - src.set_debug_state("Idle") - sleep(world.timeofday+10-start_time)// Don't touch this. DMTG + sleep(world.timeofday+12-start_time) + + var/IL_check = 0 //Infinite loop check (To report when the master controller breaks.) + while(!air_master_ready || !sun_ready || !mobs_ready || !diseases_ready || !machines_ready || !objects_ready || !networks_ready || !powernets_ready || !ticker_ready) + IL_check++ + if(IL_check > 600) + var/MC_report = "air_master_ready = [air_master_ready]; sun_ready = [sun_ready]; mobs_ready = [mobs_ready]; diseases_ready = [diseases_ready]; machines_ready = [machines_ready]; objects_ready = [objects_ready]; networks_ready = [networks_ready]; powernets_ready = [powernets_ready]; ticker_ready = [ticker_ready];" + message_admins("PROC BREAKAGE WARNING: The game's master contorller appears to be stuck in one of it's cycles. It has looped through it's delaying loop [IL_check] times.") + message_admins("The master controller reports: [MC_report]") + if(!diseases_ready) + if(last_disease_processed) + message_admins("DISEASE PROCESSING stuck on [last_disease_processed]", 0, 1) + else + message_admins("DISEASE PROCESSING stuck on unknown") + if(!machines_ready) + if(last_machine_processed) + message_admins("MACHINE PROCESSING stuck on [last_machine_processed]", 0, 1) + else + message_admins("MACHINE PROCESSING stuck on unknown") + if(!objects_ready) + if(last_obj_processed) + message_admins("OBJ PROCESSING stuck on [last_obj_processed]", 0, 1) + else + message_admins("OBJ PROCESSING stuck on unknown") + log_admin("PROC BREAKAGE WARNING: infinite_loop_check = [IL_check]; [MC_report];") + message_admins("Master controller breaking out of delaying loop. Restarting the round is advised if problem persists. DO NOT manually restart the master controller.") + break; + sleep(1) - //while(!air_master_ready || !tension_master_ready || !sun_ready || !mobs_ready || !diseases_ready || !machines_ready || !objects_ready || !networks_ready || !powernets_ready || !ticker_ready) - // sleep(1) spawn process() - return 1 - - - -/datum/failsafe // This thing pretty much just keeps poking the master controller - var/spinning = 1 - var/current_iteration = 0 - -/datum/failsafe/proc/spin() - if(!master_controller) // Well fuck. How did this happen? - sleep(50) - if(!master_controller) - master_controller = new /datum/controller/game_controller() - spawn(-1) - master_controller.setup() - - else - while(spinning) - current_iteration = controller_iteration - sleep(600) // Wait 15 seconds - if(current_iteration == controller_iteration) // Mm. The master controller hasn't ticked yet. - - for (var/mob/M in world) - if (M.client && M.client.holder) - M << " Warning. The Master Controller has not fired in the last 60 seconds. Restart recommended. Automatic restart in 60 seconds." - - sleep(600) - if(current_iteration == controller_iteration) - for (var/mob/M in world) - if (M.client && M.client.holder) - M << " Warning. The Master Controller has not fired in the last 2 minutes. Automatic restart beginning." - master_controller.process() - sleep(150) - else - for (var/mob/M in world) - if (M.client && M.client.holder) - M << " The Master Controller has fired. Automatic restart aborted." \ No newline at end of file + return 1 \ No newline at end of file diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index be2d6a2bd1..6c8ea5effc 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -7,7 +7,7 @@ internal_damage_threshold = 50 maint_access = 0 //add_req_access = 0 - //operation_req_access = list(ACCESS_HOS) + //operation_req_access = list(access_hos) damage_absorption = list("brute"=0.7,"fire"=1,"bullet"=0.7,"laser"=0.85,"energy"=1,"bomb"=0.8) var/am = "d3c2fbcadca903a41161ccc9df9cf948" @@ -27,7 +27,7 @@ if(istype(target, /mob/living)) var/mob/living/M = target if(src.occupant.a_intent == "hurt") - playsound(src, 'punch4.ogg', 50, 1) + playsound(src, 'sound/weapons/punch4.ogg', 50, 1) if(damtype == "brute") step_away(M,src,15) /* @@ -44,12 +44,13 @@ var/datum/organ/external/temp = H.get_organ(pick("chest", "chest", "chest", "head")) if(temp) + var/update = 0 switch(damtype) if("brute") H.Paralyse(1) - temp.take_damage(rand(force/2, force), 0) + update |= temp.take_damage(rand(force/2, force), 0) if("fire") - temp.take_damage(0, rand(force/2, force)) + update |= temp.take_damage(0, rand(force/2, force)) if("tox") if(H.reagents) if(H.reagents.get_reagent_amount("carpotoxin") + force < force*2) @@ -58,7 +59,7 @@ H.reagents.add_reagent("cryptobiolin", force) else return - H.UpdateDamageIcon() + if(update) H.UpdateDamageIcon() H.updatehealth() else @@ -101,7 +102,7 @@ target:dismantle_wall(1) src.occupant_message("\blue You smash through the wall.") src.visible_message("[src.name] smashes through the wall") - playsound(src, 'smash.ogg', 50, 1) + playsound(src, 'sound/weapons/smash.ogg', 50, 1) melee_can_hit = 0 if(do_after(melee_cooldown)) melee_can_hit = 1 diff --git a/code/game/mecha/combat/durand.dm b/code/game/mecha/combat/durand.dm index 58745691ce..6dac559b94 100644 --- a/code/game/mecha/combat/durand.dm +++ b/code/game/mecha/combat/durand.dm @@ -1,5 +1,5 @@ /obj/mecha/combat/durand - desc = "An aging combat exosuit utilized by the NanoTrasen corporation. Originally developed to combat hostile alien lifeforms." + desc = "An aging combat exosuit utilized by the Nanotrasen corporation. Originally developed to combat hostile alien lifeforms." name = "Durand" icon_state = "durand" step_in = 4 diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index 706aaaeb72..8fc2f5bf4d 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -16,7 +16,7 @@ max_equip = 3 /obj/mecha/combat/gygax/dark - desc = "A lightweight exosuit used by NanoTrasen Death Squads. A significantly upgraded Gygax security mech." + desc = "A lightweight exosuit used by Nanotrasen Death Squads. A significantly upgraded Gygax security mech." name = "Dark Gygax" icon_state = "darkgygax" health = 400 diff --git a/code/game/mecha/combat/honker.dm b/code/game/mecha/combat/honker.dm index c06bb45d2b..62dcd59b49 100644 --- a/code/game/mecha/combat/honker.dm +++ b/code/game/mecha/combat/honker.dm @@ -9,7 +9,7 @@ damage_absorption = list("brute"=1.2,"fire"=1.5,"bullet"=1,"laser"=1,"energy"=1,"bomb"=1) max_temperature = 3500 infra_luminosity = 5 - operation_req_access = list(ACCESS_CLOWN) + operation_req_access = list(access_clown) wreckage = /obj/effect/decal/mecha_wreckage/honker add_req_access = 0 max_equip = 3 @@ -35,29 +35,39 @@ return /obj/mecha/combat/honker/get_stats_part() + var/integrity = health/initial(health)*100 var/cell_charge = get_charge() - var/output = {"[internal_damage&MECHA_INT_FIRE?"INTERNAL FIRE
      ":null] + var/tank_pressure = internal_tank ? round(internal_tank.return_pressure(),0.01) : "None" + var/tank_temperature = internal_tank ? internal_tank.return_temperature() : "Unknown" + var/cabin_pressure = round(return_pressure(),0.01) + var/output = {"[report_internal_damage()] + [integrity<30?"DAMAGE LEVEL CRITICAL
      ":null] [internal_damage&MECHA_INT_TEMP_CONTROL?"CLOWN SUPPORT SYSTEM MALFUNCTION
      ":null] [internal_damage&MECHA_INT_TANK_BREACH?"GAS TANK HONK
      ":null] [internal_damage&MECHA_INT_CONTROL_LOST?"HONK-A-DOODLE - Recalibrate
      ":null] - IntegriHONK: [health/initial(health)*100] %)
      - PowerHONK charge: [isnull(cell_charge)?"Someone HONKed powerHonk!!!":"[cell.percent()]%"])
      - Air source: [use_internal_tank?"Internal AirHONK":"EnvironHONK"]
      - AirHONK pressure: [src.return_pressure()]HoNKs
      - Internal HONKature: [src.return_temperature()]°honK|[src.return_temperature() - T0C]°honCk
      + IntegriHONK: [integrity]%
      + PowerHONK charge: [isnull(cell_charge)?"No powercell installed":"[cell.percent()]%"]
      + Air source: [use_internal_tank?"Internal Airtank":"Environment"]
      + AirHONK pressure: [tank_pressure]kPa
      + AirHONK temperature: [tank_temperature]°K|[tank_temperature - T0C]°C
      + HONK pressure: [cabin_pressure>WARNING_HIGH_PRESSURE ? "[cabin_pressure]": cabin_pressure]kPa
      + HONK temperature: [return_temperature()]°K|[return_temperature() - T0C]°C
      Lights: [lights?"on":"off"]
      + [src.dna?"DNA-locked:
      [src.dna] \[Reset\]
      ":null] "} return output - /obj/mecha/combat/honker/get_stats_html() var/output = {" [src.name] data @@ -68,8 +78,7 @@ setInterval(function(){ window.location='byond://?src=\ref[src]&update_content=1'; document.body.style.color = get_rand_color_string(); - document.body.style.background = get_rand_color_string(); - + document.body.style.background = get_rand_color_string(); }, 1000); } @@ -87,7 +96,7 @@ } - +
      [src.get_stats_part()]
      @@ -95,7 +104,9 @@ [src.get_equipment_list()]
      +
      [src.get_commands()] +
      "} @@ -139,7 +150,7 @@ obj/mecha/combat/honker/Topic(href, href_list) if (href_list["play_sound"]) switch(href_list["play_sound"]) if("sadtrombone") - playsound(src, 'sadtrombone.ogg', 50) + playsound(src, 'sound/misc/sadtrombone.ogg', 50) return proc/rand_hex_color() diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index d6e50a4f9d..b366b9e770 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -14,7 +14,7 @@ var/smoke_ready = 1 var/smoke_cooldown = 100 var/datum/effect/effect/system/harmless_smoke_spread/smoke_system = new - operation_req_access = list(ACCESS_CENT_SPECOPS) + operation_req_access = list(access_cent_specops) wreckage = /obj/effect/decal/mecha_wreckage/marauder add_req_access = 0 internal_damage_threshold = 25 @@ -25,7 +25,7 @@ desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel." name = "Seraph" icon_state = "seraph" - operation_req_access = list(ACCESS_CENT_CREED) + operation_req_access = list(access_cent_creed) step_in = 3 health = 550 wreckage = /obj/effect/decal/mecha_wreckage/seraph @@ -37,7 +37,7 @@ desc = "Heavy-duty, combat exosuit, developed off of the existing Marauder model." name = "Mauler" icon_state = "mauler" - operation_req_access = list(ACCESS_SYNDICATE) + operation_req_access = list(access_syndicate) wreckage = /obj/effect/decal/mecha_wreckage/mauler /obj/mecha/combat/marauder/New() @@ -161,7 +161,7 @@ src.occupant_message("Zoom mode [zoom?"en":"dis"]abled.") if(zoom) src.occupant.client.view = 12 - src.occupant << sound('imag_enh.ogg',volume=50) + src.occupant << sound('sound/mecha/imag_enh.ogg',volume=50) else src.occupant.client.view = world.view//world.view - default mob view size return diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 5115bdd2d8..4ca4d89acf 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -4,7 +4,7 @@ /obj/item/mecha_parts/mecha_equipment name = "mecha equipment" - icon = 'mecha_equipment.dmi' + icon = 'icons/mecha/mecha_equipment.dmi' icon_state = "mecha_equip" force = 5 origin_tech = "materials=2" @@ -47,16 +47,16 @@ /obj/item/mecha_parts/mecha_equipment/proc/destroy()//missiles detonating, teleporter creating singularity? if(chassis) chassis.equipment -= src - chassis.equipment.Remove(null) + listclearnulls(chassis.equipment) if(chassis.selected == src) chassis.selected = null src.update_chassis_page() chassis.occupant_message("The [src] is destroyed!") chassis.log_append_to_last("[src] is destroyed.",1) if(istype(src, /obj/item/mecha_parts/mecha_equipment/weapon)) - chassis.occupant << sound('weapdestr.ogg',volume=50) + chassis.occupant << sound('sound/mecha/weapdestr.ogg',volume=50) else - chassis.occupant << sound('critdestr.ogg',volume=50) + chassis.occupant << sound('sound/mecha/critdestr.ogg',volume=50) spawn del src return @@ -82,12 +82,12 @@ return 0 if(!chassis) return 0 - if(energy_drain && !chassis.has_charge(energy_drain)) - return 0 if(!equip_ready) return 0 if(crit_fail) return 0 + if(energy_drain && !chassis.has_charge(energy_drain)) + return 0 return 1 /obj/item/mecha_parts/mecha_equipment/proc/action(atom/target) diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm new file mode 100644 index 0000000000..1a292b6706 --- /dev/null +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -0,0 +1,672 @@ +/obj/item/mecha_parts/mecha_equipment/tool/sleeper + name = "Mounted Sleeper" + desc = "Mounted Sleeper. (Can be attached to: Medical Exosuits)" + icon = 'icons/obj/Cryogenic2.dmi' + icon_state = "sleeper_0" + origin_tech = "programming=2;biotech=3" + energy_drain = 20 + range = MELEE + construction_cost = list("metal"=5000,"glass"=10000) + reliability = 1000 + equip_cooldown = 20 + var/mob/living/carbon/occupant = null + var/datum/global_iterator/pr_mech_sleeper + var/inject_amount = 10 + salvageable = 0 + + can_attach(obj/mecha/medical/M) + if(..()) + if(istype(M)) + return 1 + return 0 + + New() + ..() + pr_mech_sleeper = new /datum/global_iterator/mech_sleeper(list(src),0) + pr_mech_sleeper.set_delay(equip_cooldown) + return + + allow_drop() + return 0 + + destroy() + for(var/atom/movable/AM in src) + AM.forceMove(get_turf(src)) + return ..() + + Exit(atom/movable/O) + return 0 + + action(var/mob/living/carbon/target) + if(!action_checks(target)) + return + if(!istype(target)) + return + if(target.buckled) + occupant_message("[target] will not fit into the sleeper because they are buckled to [target.buckled].") + return + if(occupant) + occupant_message("The sleeper is already occupied") + return + for(var/mob/living/carbon/metroid/M in range(1,target)) + if(M.Victim == target) + occupant_message("[target] will not fit into the sleeper because they have a Metroid latched onto their head.") + return + occupant_message("You start putting [target] into [src].") + chassis.visible_message("[chassis] starts putting [target] into the [src].") + var/C = chassis.loc + var/T = target.loc + if(do_after_cooldown(target)) + if(chassis.loc!=C || target.loc!=T) + return + if(occupant) + occupant_message("The sleeper is already occupied!") + return + target.forceMove(src) + occupant = target + target.reset_view(src) + /* + if(target.client) + target.client.perspective = EYE_PERSPECTIVE + target.client.eye = chassis + */ + set_ready_state(0) + pr_mech_sleeper.start() + occupant_message("[target] successfully loaded into [src]. Life support functions engaged.") + chassis.visible_message("[chassis] loads [target] into [src].") + log_message("[target] loaded. Life support functions engaged.") + return + + proc/go_out() + if(!occupant) + return + occupant.forceMove(get_turf(src)) + occupant_message("[occupant] ejected. Life support functions disabled.") + log_message("[occupant] ejected. Life support functions disabled.") + occupant.reset_view() + /* + if(occupant.client) + occupant.client.eye = occupant.client.mob + occupant.client.perspective = MOB_PERSPECTIVE + */ + occupant = null + pr_mech_sleeper.stop() + set_ready_state(1) + return + + detach() + if(occupant) + occupant_message("Unable to detach [src] - equipment occupied.") + return + pr_mech_sleeper.stop() + return ..() + + get_equip_info() + var/output = ..() + if(output) + var/temp = "" + if(occupant) + temp = "
      \[Occupant: [occupant] (Health: [occupant.health]%)\]
      View stats|Eject" + return "[output] [temp]" + return + + Topic(href,href_list) + ..() + var/datum/topic_input/filter = new /datum/topic_input(href,href_list) + if(filter.get("eject")) + go_out() + if(filter.get("view_stats")) + chassis.occupant << browse(get_occupant_stats(),"window=msleeper") + onclose(chassis.occupant, "msleeper") + return + if(filter.get("inject")) + inject_reagent(filter.getType("inject",/datum/reagent),filter.getObj("source")) + return + + proc/get_occupant_stats() + if(!occupant) + return + return {" + + [occupant] statistics + + + + +

      Health statistics

      +
      + [get_occupant_dam()] +
      +

      Reagents in bloodstream

      +
      + [get_occupant_reagents()] +
      +
      + [get_available_reagents()] +
      + + "} + + proc/get_occupant_dam() + var/t1 + switch(occupant.stat) + if(0) + t1 = "Conscious" + if(1) + t1 = "Unconscious" + if(2) + t1 = "*dead*" + else + t1 = "Unknown" + return {"Health: [occupant.health]% ([t1])
      + Core Temperature: [src.occupant.bodytemperature-T0C]°C ([src.occupant.bodytemperature*1.8-459.67]°F)
      + Brute Damage: [occupant.getBruteLoss()]%
      + Respiratory Damage: [occupant.getOxyLoss()]%
      + Toxin Content: [occupant.getToxLoss()]%
      + Burn Severity: [occupant.getFireLoss()]%
      + "} + + proc/get_occupant_reagents() + if(occupant.reagents) + for(var/datum/reagent/R in occupant.reagents.reagent_list) + if(R.volume > 0) + . += "[R]: [round(R.volume,0.01)]
      " + return . || "None" + + proc/get_available_reagents() + var/output + var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun) in chassis + if(SG && SG.reagents && islist(SG.reagents.reagent_list)) + for(var/datum/reagent/R in SG.reagents.reagent_list) + if(R.volume > 0) + output += "Inject [R.name]
      " + return output + + + proc/inject_reagent(var/datum/reagent/R,var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG) + if(!R || !occupant || !SG || !(SG in chassis.equipment)) + return 0 + var/to_inject = min(R.volume, inject_amount) + if(to_inject && occupant.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2) + SG.reagents.trans_id_to(occupant,R.id,to_inject) + occupant_message("[occupant] injected with [to_inject] units of [R.name].") + log_message("[occupant] injected with [to_inject] units of [R.name].") + update_equip_info() + return + + update_equip_info() + if(..()) + send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_occupant_dam()) + send_byjax(chassis.occupant,"msleeper.browser","reagents",get_occupant_reagents()) + send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents()) + return 1 + return + +/datum/global_iterator/mech_sleeper + + process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S) + if(!S.chassis) + S.set_ready_state(1) + return stop() + if(!S.chassis.has_charge(S.energy_drain)) + S.set_ready_state(1) + S.log_message("Deactivated.") + S.occupant_message("[src] deactivated - no power.") + return stop() + var/mob/living/carbon/M = S.occupant + if(!M) + return + if(M.health > 0) + M.adjustOxyLoss(-1) + M.updatehealth() + M.AdjustStunned(-4) + M.AdjustWeakened(-4) + M.AdjustStunned(-4) + M.Paralyse(2) + M.Weaken(2) + M.Stun(2) + if(M.reagents.get_reagent_amount("inaprovaline") < 5) + M.reagents.add_reagent("inaprovaline", 5) + S.chassis.use_power(S.energy_drain) + S.update_equip_info() + return + + +/obj/item/mecha_parts/mecha_equipment/tool/cable_layer + name = "Cable Layer" + icon_state = "mecha_wire" + var/datum/event/event + var/turf/old_turf + var/obj/structure/cable/last_piece + var/obj/item/weapon/cable_coil/cable + var/max_cable = 1000 + + New() + cable = new(src) + cable.amount = 0 + ..() + + can_attach(obj/mecha/working/M) + if(..()) + if(istype(M)) + return 1 + return 0 + + attach() + ..() + event = chassis.events.addEvent("onMove",src,"layCable") + return + + detach() + chassis.events.clearEvent("onMove",event) + return ..() + + destroy() + chassis.events.clearEvent("onMove",event) + return ..() + + action(var/obj/item/weapon/cable_coil/target) + if(!action_checks(target)) + return + var/result = load_cable(target) + var/message + if(isnull(result)) + message = "Unable to load [target] - no cable found." + else if(!result) + message = "Reel is full." + else + message = "[result] meters of cable successfully loaded." + send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) + occupant_message(message) + return + + Topic(href,href_list) + ..() + if(href_list["toggle"]) + set_ready_state(!equip_ready) + occupant_message("[src] [equip_ready?"dea":"a"]ctivated.") + log_message("[equip_ready?"Dea":"A"]ctivated.") + return + if(href_list["cut"]) + if(cable && cable.amount) + var/m = round(input(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1) + m = min(m, cable.amount) + if(m) + use_cable(m) + var/obj/item/weapon/cable_coil/CC = new (get_turf(chassis)) + CC.amount = m + else + occupant_message("There's no more cable on the reel.") + return + + get_equip_info() + var/output = ..() + if(output) + return "[output] \[Cable: [cable ? cable.amount : 0] m\][(cable && cable.amount) ? "- [!equip_ready?"Dea":"A"]ctivate|Cut" : null]" + return + + proc/load_cable(var/obj/item/weapon/cable_coil/CC) + if(istype(CC) && CC.amount) + var/cur_amount = cable? cable.amount : 0 + var/to_load = max(max_cable - cur_amount,0) + if(to_load) + to_load = min(CC.amount, to_load) + if(!cable) + cable = new(src) + cable.amount = 0 + cable.amount += to_load + CC.use(to_load) + return to_load + else + return 0 + return + + proc/use_cable(amount) + if(!cable || cable.amount<1) + set_ready_state(1) + occupant_message("Cable depleted, [src] deactivated.") + log_message("Cable depleted, [src] deactivated.") + return + if(cable.amount < amount) + occupant_message("No enough cable to finish the task.") + return + cable.use(amount) + update_equip_info() + return 1 + + proc/reset() + last_piece = null + + proc/dismantleFloor(var/turf/new_turf) + if(istype(new_turf, /turf/simulated/floor)) + var/turf/simulated/floor/T = new_turf + if(!T.is_plating()) + if(!T.broken && !T.burnt) + new T.floor_tile.type(T) + T.make_plating() + return !new_turf.intact + + proc/layCable(var/turf/new_turf) + if(equip_ready || !istype(new_turf) || !dismantleFloor(new_turf)) + return reset() + var/fdirn = turn(chassis.dir,180) + for(var/obj/structure/cable/LC in new_turf) // check to make sure there's not a cable there already + if(LC.d1 == fdirn || LC.d2 == fdirn) + return reset() + if(!use_cable(1)) + return reset() + var/obj/structure/cable/NC = new(new_turf) + NC.cableColor("red") + NC.d1 = 0 + NC.d2 = fdirn + NC.updateicon() + var/netnum + var/datum/powernet/PN + if(last_piece && last_piece.d2 != chassis.dir) + last_piece.d1 = min(last_piece.d2, chassis.dir) + last_piece.d2 = max(last_piece.d2, chassis.dir) + last_piece.updateicon() + netnum = last_piece.netnum + if(netnum) + NC.netnum = netnum + PN = powernets[netnum] + else + PN = new() + PN.number = powernets.len + 1 + powernets += PN + NC.netnum = PN.number + PN.cables += NC + NC.mergeConnectedNetworks(NC.d2) + //NC.mergeConnectedNetworksOnTurf() + last_piece = NC + return 1 + +/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun + name = "Syringe Gun" + desc = "Exosuit-mounted chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur. (Can be attached to: Medical Exosuits)" + icon = 'icons/obj/gun.dmi' + icon_state = "syringegun" + var/list/syringes + var/list/known_reagents + var/list/processed_reagents + var/max_syringes = 10 + var/max_volume = 75 //max reagent volume + var/synth_speed = 5 //[num] reagent units per cycle + energy_drain = 10 + var/mode = 0 //0 - fire syringe, 1 - analyze reagents. + var/datum/global_iterator/mech_synth/synth + range = MELEE|RANGED + equip_cooldown = 10 + origin_tech = "materials=3;biotech=4;magnets=4;programming=3" + construction_time = 200 + construction_cost = list("metal"=3000,"glass"=2000) + + New() + ..() + flags |= NOREACT + syringes = new + known_reagents = list("inaprovaline"="Inaprovaline","anti_toxin"="Anti-Toxin (Dylovene)") + processed_reagents = new + create_reagents(max_volume) + synth = new (list(src),0) + + detach() + synth.stop() + return ..() + + critfail() + ..() + flags &= ~NOREACT + return + + can_attach(obj/mecha/medical/M) + if(..()) + if(istype(M)) + return 1 + return 0 + + get_equip_info() + var/output = ..() + if(output) + return "[output] \[[mode? "Analyze" : "Launch"]\]
      \[Syringes: [syringes.len]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]
      Reagents list" + return + + action(atom/movable/target) + if(!action_checks(target)) + return + if(istype(target,/obj/item/weapon/reagent_containers/syringe)) + return load_syringe(target) + if(istype(target,/obj/item/weapon/storage))//Loads syringes from boxes + for(var/obj/item/weapon/reagent_containers/syringe/S in target.contents) + load_syringe(S) + return + if(mode) + return analyze_reagents(target) + if(!syringes.len) + occupant_message("No syringes loaded.") + return + if(reagents.total_volume<=0) + occupant_message("No available reagents to load syringe with.") + return + set_ready_state(0) + chassis.use_power(energy_drain) + var/turf/trg = get_turf(target) + var/obj/item/weapon/reagent_containers/syringe/S = syringes[1] + S.forceMove(get_turf(chassis)) + reagents.trans_to(S, min(S.volume, reagents.total_volume)) + syringes -= S + S.icon = 'icons/obj/chemical.dmi' + S.icon_state = "syringeproj" + playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1) + log_message("Launched [S] from [src], targeting [target].") + spawn(-1) + src = null //if src is deleted, still process the syringe + for(var/i=0, i<6, i++) + if(!S) + break + if(step_towards(S,trg)) + var/list/mobs = new + for(var/mob/living/carbon/M in S.loc) + mobs += M + var/mob/living/carbon/M = safepick(mobs) + if(M) + S.icon_state = initial(S.icon_state) + S.icon = initial(S.icon) + S.reagents.trans_to(M, S.reagents.total_volume) + M.take_organ_damage(2) + S.visible_message(" [M] was hit by the syringe!") + break + else if(S.loc == trg) + S.icon_state = initial(S.icon_state) + S.icon = initial(S.icon) + S.update_icon() + break + else + S.icon_state = initial(S.icon_state) + S.icon = initial(S.icon) + S.update_icon() + break + sleep(1) + do_after_cooldown() + return 1 + + + Topic(href,href_list) + ..() + var/datum/topic_input/filter = new (href,href_list) + if(filter.get("toggle_mode")) + mode = !mode + update_equip_info() + return + if(filter.get("select_reagents")) + processed_reagents.len = 0 + var/m = 0 + var/message + for(var/i=1 to known_reagents.len) + if(m>=synth_speed) + break + var/reagent = filter.get("reagent_[i]") + if(reagent && (reagent in known_reagents)) + message = "[m ? ", " : null][known_reagents[reagent]]" + processed_reagents += reagent + m++ + if(processed_reagents.len) + message += " added to production" + synth.start() + occupant_message(message) + occupant_message("Reagent processing started.") + log_message("Reagent processing started.") + return + if(filter.get("show_reagents")) + chassis.occupant << browse(get_reagents_page(),"window=msyringegun") + if(filter.get("purge_reagent")) + var/reagent = filter.get("purge_reagent") + if(reagent) + reagents.del_reagent(reagent) + return + if(filter.get("purge_all")) + reagents.clear_reagents() + return + return + + proc/get_reagents_page() + var/output = {" + + Reagent Synthesizer + + + + +

      Current reagents:

      +
      + [get_current_reagents()] +
      +

      Reagents production:

      +
      + [get_reagents_form()] +
      + + + "} + return output + + proc/get_reagents_form() + var/r_list = get_reagents_list() + var/inputs + if(r_list) + inputs += "" + inputs += "" + inputs += "" + var/output = {"
      + [r_list || "No known reagents"] + [inputs] +
      + [r_list? "Only the first [synth_speed] selected reagent\s will be added to production" : null] + "} + return output + + proc/get_reagents_list() + var/output + for(var/i=1 to known_reagents.len) + var/reagent_id = known_reagents[i] + output += {" [known_reagents[reagent_id]]
      "} + return output + + proc/get_current_reagents() + var/output + for(var/datum/reagent/R in reagents.reagent_list) + if(R.volume > 0) + output += "[R]: [round(R.volume,0.001)] - Purge Reagent
      " + if(output) + output += "Total: [round(reagents.total_volume,0.001)]/[reagents.maximum_volume] - Purge All" + return output || "None" + + proc/load_syringe(obj/item/weapon/reagent_containers/syringe/S) + if(syringes.len= 2) + occupant_message("The syringe is too far away.") + return 0 + for(var/obj/structure/D in S.loc)//Basic level check for structures in the way (Like grilles and windows) + if(!(D.CanPass(S,src.loc))) + occupant_message("Unable to load syringe.") + return 0 + for(var/obj/machinery/door/D in S.loc)//Checks for doors + if(!(D.CanPass(S,src.loc))) + occupant_message("Unable to load syringe.") + return 0 + S.reagents.trans_to(src, S.reagents.total_volume) + S.forceMove(src) + syringes += S + occupant_message("Syringe loaded.") + update_equip_info() + return 1 + occupant_message("The [src] syringe chamber is full.") + return 0 + + proc/analyze_reagents(atom/A) + if(get_dist(src,A) >= 4) + occupant_message("The object is too far away.") + return 0 + if(!A.reagents || istype(A,/mob)) + occupant_message("No reagent info gained from [A].") + return 0 + occupant_message("Analyzing reagents...") + for(var/datum/reagent/R in A.reagents.reagent_list) + if(R.reagent_state == 2 && add_known_reagent(R.id,R.name)) + occupant_message("Reagent analyzed, identified as [R.name] and added to database.") + send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) + occupant_message("Analyzis complete.") + return 1 + + proc/add_known_reagent(r_id,r_name) + set_ready_state(0) + do_after_cooldown() + if(!(r_id in known_reagents)) + known_reagents += r_id + known_reagents[r_id] = r_name + return 1 + return 0 + + + update_equip_info() + if(..()) + send_byjax(chassis.occupant,"msyringegun.browser","reagents",get_current_reagents()) + send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) + return 1 + return + + on_reagent_change() + ..() + update_equip_info() + return + +/datum/global_iterator/mech_synth + delay = 100 + + process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S) + if(!S.chassis) + return stop() + var/energy_drain = S.energy_drain*10 + if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain)) + S.occupant_message("Reagent processing stopped.") + S.log_message("Reagent processing stopped.") + return stop() + if(anyprob(S.reliability)) + S.critfail() + var/amount = S.synth_speed / S.processed_reagents.len + for(var/reagent in S.processed_reagents) + S.reagents.add_reagent(reagent,amount) + S.chassis.use_power(energy_drain) + return 1 \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 65345e10a4..964a3a2496 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -52,8 +52,8 @@ M.take_overall_damage(dam_force) M.adjustOxyLoss(round(dam_force/2)) M.updatehealth() - occupant_message("\red You squeese [target] with [src.name]. Something cracks.") - chassis.visible_message("\red [chassis] squeeses [target].") + occupant_message("\red You squeeze [target] with [src.name]. Something cracks.") + chassis.visible_message("\red [chassis] squeezes [target].") else step_away(M,chassis) occupant_message("You push [target] out of the way.") @@ -70,10 +70,12 @@ equip_cooldown = 30 energy_drain = 10 force = 15 - var/warning = 0 action(atom/target) if(!action_checks(target)) return + if(isobj(target)) + var/obj/target_obj = target + if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return set_ready_state(0) chassis.use_power(energy_drain) chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") @@ -94,15 +96,18 @@ if(ore_box) for(var/obj/item/weapon/ore/ore in range(chassis,1)) if(get_dir(chassis,ore)&chassis.dir) - if(ore_box.contents.len + 1 <= ore_box.capacity) - ore.Move(ore_box) - else if(!warning) - occupant_message("Warning, the ore box is full!") - //give it a 10 sec timer, so it doesn't spam unnecessarily - warning = 1 - spawn(100) - warning = 0 - break + ore.Move(ore_box) + else if(istype(target, /turf/simulated/floor/plating/airless/asteroid)) + for(var/turf/simulated/floor/plating/airless/asteroid/M in range(chassis,1)) + if(get_dir(chassis,M)&chassis.dir) + M.gets_dug() + log_message("Drilled through [target]") + if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) + var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(chassis,1)) + if(get_dir(chassis,ore)&chassis.dir) + ore.Move(ore_box) else if(target.loc == C) log_message("Drilled through [target]") target.ex_act(2) @@ -123,6 +128,54 @@ equip_cooldown = 20 force = 15 + action(atom/target) + if(!action_checks(target)) return + if(isobj(target)) + var/obj/target_obj = target + if(target_obj.unacidable) return + set_ready_state(0) + chassis.use_power(energy_drain) + chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") + occupant_message("You start to drill [target]") + var/T = chassis.loc + var/C = target.loc //why are these backwards? we may never know -Pete + if(do_after_cooldown(target)) + if(T == chassis.loc && src == chassis.selected) + if(istype(target, /turf/simulated/wall/r_wall)) + if(do_after_cooldown(target))//To slow down how fast mechs can drill through the station + log_message("Drilled through [target]") + target.ex_act(3) + else if(istype(target, /turf/simulated/mineral)) + for(var/turf/simulated/mineral/M in range(chassis,1)) + if(get_dir(chassis,M)&chassis.dir) + M.gets_drilled() + log_message("Drilled through [target]") + if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) + var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(chassis,1)) + if(get_dir(chassis,ore)&chassis.dir) + ore.Move(ore_box) + else if(istype(target,/turf/simulated/floor/plating/airless/asteroid)) + for(var/turf/simulated/floor/plating/airless/asteroid/M in range(target,1)) + M.gets_dug() + log_message("Drilled through [target]") + if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) + var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(target,1)) + ore.Move(ore_box) + else if(target.loc == C) + log_message("Drilled through [target]") + target.ex_act(2) + return 1 + + can_attach(obj/mecha/M as obj) + if(..()) + if(istype(M, /obj/mecha/working) || istype(M, /obj/mecha/combat)) + return 1 + return 0 + /obj/item/mecha_parts/mecha_equipment/tool/extinguisher name = "Extinguisher" desc = "Exosuit-mounted extinguisher (Can be attached to: Engineering exosuits)" @@ -147,10 +200,10 @@ var/obj/o = target o.reagents.trans_to(src, 200) occupant_message("\blue Extinguisher refilled") - playsound(chassis, 'refill.ogg', 50, 1, -6) + playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6) else if(src.reagents.total_volume > 0) - playsound(chassis, 'extinguish.ogg', 75, 1, -3) + playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3) var/direction = get_dir(chassis,target) var/turf/T = get_turf(target) var/turf/T1 = get_step(T,turn(direction, 90)) @@ -216,7 +269,7 @@ if(!istype(target, /turf) && !istype(target, /obj/machinery/door/airlock)) target = get_turf(target) if(!action_checks(target) || disabled || get_dist(chassis, target)>3) return - playsound(chassis, 'click.ogg', 50, 1) + playsound(chassis, 'sound/machines/click.ogg', 50, 1) //meh switch(mode) if(0) @@ -227,7 +280,7 @@ if(disabled) return chassis.spark_system.start() target:ReplaceWithPlating() - playsound(target, 'Deconstruct.ogg', 50, 1) + playsound(target, 'sound/items/Deconstruct.ogg', 50, 1) chassis.give_power(energy_drain) else if (istype(target, /turf/simulated/floor)) occupant_message("Deconstructing [target]...") @@ -236,7 +289,7 @@ if(disabled) return chassis.spark_system.start() target:ReplaceWithSpace() - playsound(target, 'Deconstruct.ogg', 50, 1) + playsound(target, 'sound/items/Deconstruct.ogg', 50, 1) chassis.give_power(energy_drain) else if (istype(target, /obj/machinery/door/airlock)) occupant_message("Deconstructing [target]...") @@ -245,7 +298,7 @@ if(disabled) return chassis.spark_system.start() del(target) - playsound(target, 'Deconstruct.ogg', 50, 1) + playsound(target, 'sound/items/Deconstruct.ogg', 50, 1) chassis.give_power(energy_drain) if(1) if(istype(target, /turf/space)) @@ -254,7 +307,7 @@ if(do_after_cooldown(target)) if(disabled) return target:ReplaceWithPlating() - playsound(target, 'Deconstruct.ogg', 50, 1) + playsound(target, 'sound/items/Deconstruct.ogg', 50, 1) chassis.spark_system.start() chassis.use_power(energy_drain*2) else if(istype(target, /turf/simulated/floor)) @@ -263,7 +316,7 @@ if(do_after_cooldown(target)) if(disabled) return target:ReplaceWithWall() - playsound(target, 'Deconstruct.ogg', 50, 1) + playsound(target, 'sound/items/Deconstruct.ogg', 50, 1) chassis.spark_system.start() chassis.use_power(energy_drain*2) if(2) @@ -275,8 +328,8 @@ chassis.spark_system.start() var/obj/machinery/door/airlock/T = new /obj/machinery/door/airlock(target) T.autoclose = 1 - playsound(target, 'Deconstruct.ogg', 50, 1) - playsound(target, 'sparks2.ogg', 50, 1) + playsound(target, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(target, 'sound/effects/sparks2.ogg', 50, 1) chassis.use_power(energy_drain*2) return @@ -310,7 +363,7 @@ range = RANGED action(atom/target) - if(!action_checks(target)) return + if(!action_checks(target) || src.loc.z == 2) return var/turf/T = get_turf(target) if(T) set_ready_state(0) @@ -331,7 +384,7 @@ action(atom/target) - if(!action_checks(target)) return + if(!action_checks(target) || src.loc.z == 2) return var/list/theareas = list() for(var/area/AR in orange(100, chassis)) if(AR in theareas) continue @@ -359,7 +412,7 @@ var/obj/effect/portal/P = new /obj/effect/portal(get_turf(target)) P.target = target_turf P.creator = null - P.icon = 'objects.dmi' + P.icon = 'icons/obj/objects.dmi' P.failchance = 0 P.icon_state = "anom" P.name = "wormhole" @@ -431,8 +484,6 @@ if(href_list["mode"]) mode = text2num(href_list["mode"]) send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) - if(href_list["detach"]) - src.detach() return @@ -864,7 +915,6 @@ GM.toxins += 5 GM.temperature = istype(T) ? T.air.temperature : T20C T.visible_message("The [src] suddenly disgorges a cloud of plasma.") - GM.update_values() T.assume_air(GM) return @@ -935,716 +985,6 @@ return 1 -/obj/item/mecha_parts/mecha_equipment/tool/sleeper - name = "Mounted Sleeper" - desc = "Mounted Sleeper. (Can be attached to: Medical Exosuits)" - icon = 'Cryogenic2.dmi' - icon_state = "sleeper_0" - origin_tech = "programming=2;biotech=3" - energy_drain = 20 - range = MELEE - construction_cost = list("metal"=5000,"glass"=10000) - reliability = 1000 - equip_cooldown = 50 // rather lengthy cooldown since otherwise - // this would be a too effective weapon for - // capturing somebody - var/mob/living/carbon/occupant = null - var/datum/global_iterator/pr_mech_sleeper - var/inject_amount = 10 - salvageable = 0 - - can_attach(obj/mecha/medical/M) - if(..()) - if(istype(M)) - return 1 - return 0 - - New() - ..() - pr_mech_sleeper = new /datum/global_iterator/mech_sleeper(list(src),0) - pr_mech_sleeper.set_delay(equip_cooldown) - return - - allow_drop() - return 0 - - destroy() - for(var/atom/movable/AM in src) - AM.forceMove(get_turf(src)) - return ..() - - Exit(atom/movable/O) - return 0 - - action(var/mob/living/carbon/target) - if(!action_checks(target)) - return - if(!istype(target)) - return - if(occupant) - occupant_message("The sleeper is already occupied") - return - for(var/mob/living/carbon/metroid/M in range(1,target)) - if(M.Victim == target) - occupant_message("[target] will not fit into the sleeper because they have a Metroid latched onto their head.") - return - occupant_message("You start putting [target] into [src].") - chassis.visible_message("[chassis] starts putting [target] into the [src].") - var/C = chassis.loc - var/T = target.loc - if(do_after_cooldown(target)) - if(chassis.loc!=C || target.loc!=T) - return - if(occupant) - occupant_message("The sleeper is already occupied!") - return - target.forceMove(src) - if(target.buckled) - var/obj/structure/stool/bed/S = target.buckled - target.buckled = null - target.anchored = 0 - target.lying = 0 - S.buckled_mob = null - occupant = target - target.reset_view(src) - /* - if(target.client) - target.client.perspective = EYE_PERSPECTIVE - target.client.eye = chassis - */ - set_ready_state(0) - pr_mech_sleeper.start() - occupant_message("[target] successfully loaded into [src]. Life support functions engaged.") - chassis.visible_message("[chassis] loads [target] into [src].") - log_message("[target] loaded. Life support functions engaged.") - return - - proc/go_out() - if(!occupant) - return - occupant.forceMove(get_turf(src)) - occupant_message("[occupant] ejected. Life support functions disabled.") - log_message("[occupant] ejected. Life support functions disabled.") - occupant.reset_view() - /* - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE - */ - occupant = null - pr_mech_sleeper.stop() - set_ready_state(1) - return - - detach() - if(occupant) - occupant_message("Unable to detach [src] - equipment occupied.") - return - pr_mech_sleeper.stop() - return ..() - - get_equip_info() - var/output = ..() - if(output) - var/temp = "" - if(occupant) - temp = "
      \[Occupant: [occupant] (Health: [occupant.health]%)\]
      View stats|Eject" - return "[output] [temp]" - return - - Topic(href,href_list) - ..() - var/datum/topic_input/filter = new /datum/topic_input(href,href_list) - if(filter.get("eject")) - go_out() - if(filter.get("view_stats")) - chassis.occupant << browse(get_occupant_stats(),"window=msleeper") - onclose(chassis.occupant, "msleeper") - return - if(filter.get("inject")) - inject_reagent(filter.getType("inject",/datum/reagent),filter.getObj("source")) - return - - proc/get_occupant_stats() - if(!occupant) - return - return {" - - [occupant] statistics - - - - -

      Health statistics

      -
      - [get_occupant_dam()] -
      -

      Reagents in bloodstream

      -
      - [get_occupant_reagents()] -
      -
      - [get_available_reagents()] -
      - - "} - - proc/get_occupant_dam() - var/t1 - switch(occupant.stat) - if(0) - t1 = "Conscious" - if(1) - t1 = "Unconscious" - if(2) - t1 = "*dead*" - else - t1 = "Unknown" - return {"Health: [occupant.health]% ([t1])
      - Core Temperature: [src.occupant.bodytemperature-T0C]°C ([src.occupant.bodytemperature*1.8-459.67]°F)
      - Brute Damage: [occupant.getBruteLoss()]%
      - Respiratory Damage: [occupant.getOxyLoss()]%
      - Toxin Content: [occupant.getToxLoss()]%
      - Burn Severity: [occupant.getFireLoss()]%
      - "} - - proc/get_occupant_reagents() - if(occupant.reagents) - for(var/datum/reagent/R in occupant.reagents.reagent_list) - if(R.volume > 0) - . += "[R]: [round(R.volume,0.01)]
      " - return . || "None" - - proc/get_available_reagents() - var/output - var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun) in chassis - if(SG && SG.reagents && islist(SG.reagents.reagent_list)) - for(var/datum/reagent/R in SG.reagents.reagent_list) - if(R.volume > 0) - output += "Inject [R.name]
      " - return output - - - proc/inject_reagent(var/datum/reagent/R,var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG) - if(!R || !occupant || !SG || !(SG in chassis.equipment)) - return 0 - var/to_inject = min(R.volume, inject_amount) - if(to_inject && occupant.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2) - SG.reagents.trans_id_to(occupant,R.id,to_inject) - occupant_message("[occupant] injected with [to_inject] units of [R.name].") - log_message("[occupant] injected with [to_inject] units of [R.name].") - update_equip_info() - return - - update_equip_info() - if(..()) - send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_occupant_dam()) - send_byjax(chassis.occupant,"msleeper.browser","reagents",get_occupant_reagents()) - send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents()) - return 1 - return - -/datum/global_iterator/mech_sleeper - - process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S) - if(!S.chassis) - S.set_ready_state(1) - return stop() - if(!S.chassis.has_charge(S.energy_drain)) - S.set_ready_state(1) - S.log_message("Deactivated.") - S.occupant_message("[src] deactivated - no power.") - return stop() - var/mob/living/carbon/M = S.occupant - if(!M) - return - if(M.health > 0) - M.adjustOxyLoss(-1) - M.updatehealth() - M.AdjustStunned(-4) - M.AdjustWeakened(-4) - M.AdjustStunned(-4) - M.Paralyse(2) - M.Weaken(2) - M.Stun(2) - if(M.reagents.get_reagent_amount("inaprovaline") < 5) - M.reagents.add_reagent("inaprovaline", 5) - S.chassis.use_power(S.energy_drain) - S.update_equip_info() - return - - -/obj/item/mecha_parts/mecha_equipment/tool/cable_layer - name = "Cable Layer" - icon_state = "mecha_wire" - var/datum/event/event - var/turf/old_turf - var/obj/structure/cable/last_piece - var/obj/item/weapon/cable_coil/cable - var/max_cable = 1000 - - New() - cable = new(src) - cable.amount = 0 - ..() - - can_attach(obj/mecha/working/M) - if(..()) - if(istype(M)) - return 1 - return 0 - - attach() - ..() - event = chassis.events.addEvent("onMove",src,"layCable") - return - - detach() - chassis.events.clearEvent("onMove",event) - return ..() - - destroy() - chassis.events.clearEvent("onMove",event) - return ..() - - action(var/obj/item/weapon/cable_coil/target) - if(!action_checks(target)) - return - var/result = load_cable(target) - var/message - if(isnull(result)) - message = "Unable to load [target] - no cable found." - else if(!result) - message = "Reel is full." - else - message = "[result] meters of cable successfully loaded." - send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) - occupant_message(message) - return - - Topic(href,href_list) - ..() - if(href_list["toggle"]) - set_ready_state(!equip_ready) - occupant_message("[src] [equip_ready?"dea":"a"]ctivated.") - log_message("[equip_ready?"Dea":"A"]ctivated.") - return - if(href_list["cut"]) - if(cable && cable.amount) - var/m = round(input(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1) - m = min(m, cable.amount) - if(m) - use_cable(m) - var/obj/item/weapon/cable_coil/CC = new (get_turf(chassis)) - CC.amount = m - else - occupant_message("There's no more cable on the reel.") - return - - get_equip_info() - var/output = ..() - if(output) - return "[output] \[Cable: [cable ? cable.amount : 0] m\][(cable && cable.amount) ? "- [!equip_ready?"Dea":"A"]ctivate|Cut" : null]" - return - - proc/load_cable(var/obj/item/weapon/cable_coil/CC) - if(istype(CC) && CC.amount) - var/cur_amount = cable? cable.amount : 0 - var/to_load = max(max_cable - cur_amount,0) - if(to_load) - to_load = min(CC.amount, to_load) - if(!cable) - cable = new(src) - cable.amount = 0 - cable.amount += to_load - CC.use(to_load) - return to_load - else - return 0 - return - - proc/use_cable(amount) - if(!cable || cable.amount<1) - set_ready_state(1) - occupant_message("Cable depleted, [src] deactivated.") - log_message("Cable depleted, [src] deactivated.") - return - if(cable.amount < amount) - occupant_message("No enough cable to finish the task.") - return - cable.use(amount) - update_equip_info() - return 1 - - proc/reset() - last_piece = null - - proc/dismantleFloor(var/turf/new_turf) - if(istype(new_turf, /turf/simulated/floor)) - var/turf/simulated/floor/T = new_turf - if(!T.is_plating()) - if(!T.broken && !T.burnt) - new T.floor_tile.type(T) - T.make_plating() - return !new_turf.intact - - proc/layCable(var/turf/new_turf) - if(equip_ready || !istype(new_turf) || !dismantleFloor(new_turf)) - return reset() - var/fdirn = turn(chassis.dir,180) - for(var/obj/structure/cable/LC in new_turf) // check to make sure there's not a cable there already - if(LC.d1 == fdirn || LC.d2 == fdirn) - return reset() - if(!use_cable(1)) - return reset() - var/obj/structure/cable/NC = new(new_turf) - NC.cableColor("red") - NC.d1 = 0 - NC.d2 = fdirn - NC.updateicon() - var/netnum - var/datum/powernet/PN - if(last_piece && last_piece.d2 != chassis.dir) - last_piece.d1 = min(last_piece.d2, chassis.dir) - last_piece.d2 = max(last_piece.d2, chassis.dir) - last_piece.updateicon() - netnum = last_piece.netnum - if(netnum) - NC.netnum = netnum - PN = powernets[netnum] - else - PN = new() - PN.number = powernets.len + 1 - powernets += PN - NC.netnum = PN.number - PN.cables += NC - NC.mergeConnectedNetworks(NC.d2) - //NC.mergeConnectedNetworksOnTurf() - last_piece = NC - return 1 - -/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun - name = "Syringe Gun" - desc = "Exosuit-mounted chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur. (Can be attached to: Medical Exosuits)" - icon = 'gun.dmi' - icon_state = "syringegun" - var/list/syringes - var/list/known_reagents - var/list/processed_reagents - var/max_syringes = 10 - var/max_volume = 75 //max reagent volume - var/synth_speed = 5 //[num] reagent units per cycle - energy_drain = 10 - var/mode = 0 //0 - fire syringe, 1 - analyze reagents. - var/datum/global_iterator/mech_synth/synth - range = MELEE|RANGED - equip_cooldown = 10 - origin_tech = "materials=3;biotech=4;magnets=4;programming=3" - construction_time = 200 - construction_cost = list("metal"=3000,"glass"=2000) - - New() - ..() - flags |= NOREACT - syringes = new - known_reagents = list("inaprovaline"="Inaprovaline","anti_toxin"="Anti-Toxin (Dylovene)") - processed_reagents = new - create_reagents(max_volume) - synth = new (list(src),0) - - detach() - synth.stop() - return ..() - - critfail() - ..() - flags &= ~NOREACT - return - - can_attach(obj/mecha/medical/M) - if(..()) - if(istype(M)) - return 1 - return 0 - - get_equip_info() - var/output = ..() - if(output) - return "[output] \[[mode? "Analyze" : "Launch"]\]
      \[Syringes: [syringes.len]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]
      Reagents list" - return - - action(atom/movable/target) - if(!action_checks(target)) - return - if(istype(target,/obj/item/weapon/reagent_containers/syringe)) - return load_syringe(target) - if(mode) - return analyze_reagents(target) - if(!syringes.len) - occupant_message("No syringes loaded.") - return - if(reagents.total_volume<=0) - occupant_message("No available reagents to load syringe with.") - return - set_ready_state(0) - chassis.use_power(energy_drain) - var/turf/trg = get_turf(target) - var/obj/item/weapon/reagent_containers/syringe/S = syringes[1] - S.forceMove(get_turf(chassis)) - reagents.trans_to(S, min(S.volume, reagents.total_volume)) - syringes -= S - S.icon = 'chemical.dmi' - S.icon_state = "syringeproj" - playsound(chassis, 'syringeproj.ogg', 50, 1) - log_message("Launched [S] from [src], targeting [target].") - spawn(-1) - src = null //if src is deleted, still process the syringe - for(var/i=0, i<6, i++) - if(!S) - break - if(step_towards(S,trg)) - var/list/mobs = new - for(var/mob/living/carbon/M in S.loc) - mobs += M - var/mob/living/carbon/M = safepick(mobs) - if(M) - S.icon_state = initial(S.icon_state) - S.icon = initial(S.icon) - S.reagents.trans_to(M, S.reagents.total_volume) - M.take_organ_damage(2) - S.visible_message(" [M] was hit by the syringe!") - break - else if(S.loc == trg) - S.icon_state = initial(S.icon_state) - S.icon = initial(S.icon) - S.update_icon() - break - else - S.icon_state = initial(S.icon_state) - S.icon = initial(S.icon) - S.update_icon() - break - sleep(1) - do_after_cooldown() - return 1 - - - Topic(href,href_list) - ..() - var/datum/topic_input/filter = new (href,href_list) - if(filter.get("toggle_mode")) - mode = !mode - update_equip_info() - return - if(filter.get("select_reagents")) - processed_reagents.len = 0 - var/m = 0 - var/message - for(var/i=1 to known_reagents.len) - if(m>=synth_speed) - break - var/reagent = filter.get("reagent_[i]") - if(reagent && (reagent in known_reagents)) - message = "[m ? ", " : null][known_reagents[reagent]]" - processed_reagents += reagent - m++ - if(processed_reagents.len) - message += " added to production" - synth.start() - occupant_message(message) - occupant_message("Reagent processing started.") - log_message("Reagent processing started.") - return - if(filter.get("show_reagents")) - chassis.occupant << browse(get_reagents_page(),"window=msyringegun") - if(filter.get("purge_reagent")) - var/reagent = filter.get("purge_reagent") - if(reagent) - reagents.del_reagent(reagent) - return - if(filter.get("purge_all")) - reagents.clear_reagents() - return - return - - proc/get_reagents_page() - var/output = {" - - Reagent Synthesizer - - - - -

      Current reagents:

      -
      - [get_current_reagents()] -
      -

      Reagents production:

      -
      - [get_reagents_form()] -
      - - - "} - return output - - proc/get_reagents_form() - var/r_list = get_reagents_list() - var/inputs - if(r_list) - inputs += "" - inputs += "" - inputs += "" - var/output = {"
      - [r_list || "No known reagents"] - [inputs] -
      - [r_list? "Only the first [synth_speed] selected reagent\s will be added to production" : null] - "} - return output - - proc/get_reagents_list() - var/output - for(var/i=1 to known_reagents.len) - var/reagent_id = known_reagents[i] - output += {" [known_reagents[reagent_id]]
      "} - return output - - proc/get_current_reagents() - var/output - for(var/datum/reagent/R in reagents.reagent_list) - if(R.volume > 0) - output += "[R]: [round(R.volume,0.001)] - Purge Reagent
      " - if(output) - output += "Total: [round(reagents.total_volume,0.001)]/[reagents.maximum_volume] - Purge All" - return output || "None" - - proc/load_syringe(obj/item/weapon/reagent_containers/syringe/S) - if(syringes.lenNo reagent info gained from [A].
      ") - return 0 - occupant_message("Analyzing reagents...") - for(var/datum/reagent/R in A.reagents.reagent_list) - if(R.reagent_state == 2 && add_known_reagent(R.id,R.name)) - occupant_message("Reagent analyzed, identified as [R.name] and added to database.") - send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) - occupant_message("Analyzis complete.") - return 1 - - proc/add_known_reagent(r_id,r_name) - set_ready_state(0) - do_after_cooldown() - if(!(r_id in known_reagents)) - known_reagents += r_id - known_reagents[r_id] = r_name - return 1 - return 0 - - - update_equip_info() - if(..()) - send_byjax(chassis.occupant,"msyringegun.browser","reagents",get_current_reagents()) - send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) - return 1 - return - - on_reagent_change() - ..() - update_equip_info() - return - -/datum/global_iterator/mech_synth - delay = 100 - - process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S) - if(!S.chassis) - return stop() - var/energy_drain = S.energy_drain*10 - if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain)) - S.occupant_message("Reagent processing stopped.") - S.log_message("Reagent processing stopped.") - return stop() - if(anyprob(S.reliability)) - S.critfail() - var/amount = S.synth_speed / S.processed_reagents.len - for(var/reagent in S.processed_reagents) - S.reagents.add_reagent(reagent,amount) - S.chassis.use_power(energy_drain) - return 1 - - -/* -/obj/item/mecha_parts/mecha_equipment/defence_shocker - name = "Exosuit Defence Shocker" - desc = "" - icon_state = "mecha_teleport" - equip_cooldown = 10 - energy_drain = 100 - range = RANGED - var/shock_damage = 15 - var/active - - can_attach(obj/mecha/M as obj) - if(..()) - if(!istype(M, /obj/mecha/combat/honker)) - if(!M.proc_res["dynattackby"] && !M.proc_res["dynattackhand"] && !M.proc_res["dynattackalien"]) - return 1 - return 0 - - attach(obj/mecha/M as obj) - ..() - chassis.proc_res["dynattackby"] = src - return - - proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) - if(!action_checks(user) || !active) - return - user.electrocute_act(shock_damage, src) - return chassis.dynattackby(W,user) -*/ - -/* -/obj/item/mecha_parts/mecha_equipment/book_stocker - - action(var/mob/target) - if(!istype(target)) - return - if(target.search_contents_for(/obj/item/book/WGW)) - target.gib() - target.client.gib() - target.client.mom.monkeyize() - target.client.mom.gib() - for(var/mob/M in range(target, 1000)) - M.gib() - explosion(target.loc,100000,100000,100000) - usr.gib() - world.Reboot() - return 1 - -*/ //This is pretty much just for the death-ripley so that it is harmless /obj/item/mecha_parts/mecha_equipment/tool/safety_clamp @@ -1710,106 +1050,4 @@ set_ready_state(0) chassis.use_power(energy_drain) do_after_cooldown() - return 1 - -/* -//NEEDS SPRITE! (When this gets uncommented search for 'TODO MECHA JETPACK SPRITE MISSING' through code to uncomment the place where it's missing.) -/obj/item/mecha_parts/mecha_equipment/jetpack - name = "Jetpack" - desc = "Using directed ion bursts and cunning solar wind reflection technique, this device enables controlled space flight." - icon_state = "mecha_equip" - equip_cooldown = 5 - energy_drain = 50 - var/wait = 0 - var/datum/effect/effect/system/ion_trail_follow/ion_trail - - - can_attach(obj/mecha/M as obj) - if(!(locate(src.type) in M.equipment) && !M.proc_res["dyndomove"]) - return ..() - - detach() - ..() - chassis.proc_res["dyndomove"] = null - return - - attach(obj/mecha/M as obj) - ..() - if(!ion_trail) - ion_trail = new - ion_trail.set_up(chassis) - return - - proc/toggle() - if(!chassis) - return - !equip_ready? turn_off() : turn_on() - return equip_ready - - proc/turn_on() - set_ready_state(0) - chassis.proc_res["dyndomove"] = src - ion_trail.start() - occupant_message("Activated") - log_message("Activated") - - proc/turn_off() - set_ready_state(1) - chassis.proc_res["dyndomove"] = null - ion_trail.stop() - occupant_message("Deactivated") - log_message("Deactivated") - - proc/dyndomove(direction) - if(!action_checks()) - return chassis.dyndomove(direction) - var/move_result = 0 - if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST)) - move_result = step_rand(chassis) - else if(chassis.dir!=direction) - chassis.dir = direction - move_result = 1 - else - move_result = step(chassis,direction) - if(chassis.occupant) - for(var/obj/effect/speech_bubble/B in range(1, chassis)) - if(B.parent == chassis.occupant) - B.loc = chassis.loc - if(move_result) - wait = 1 - chassis.use_power(energy_drain) - if(!chassis.pr_inertial_movement.active()) - chassis.pr_inertial_movement.start(list(chassis,direction)) - else - chassis.pr_inertial_movement.set_process_args(list(chassis,direction)) - do_after_cooldown() - return 1 - return 0 - - action_checks() - if(equip_ready || wait) - return 0 - if(energy_drain && !chassis.has_charge(energy_drain)) - return 0 - if(crit_fail) - return 0 - if(chassis.check_for_support()) - return 0 - return 1 - - get_equip_info() - if(!chassis) return - return "* [src.name] \[Toggle\]" - - - Topic(href,href_list) - ..() - if(href_list["toggle"]) - toggle() - - do_after_cooldown() - sleep(equip_cooldown) - wait = 0 - return 1 -*/ - + return 1 \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/unused_tools.dm b/code/game/mecha/equipment/tools/unused_tools.dm new file mode 100644 index 0000000000..6857891381 --- /dev/null +++ b/code/game/mecha/equipment/tools/unused_tools.dm @@ -0,0 +1,157 @@ + + + +/****** Do not tick this file in without looking over this code first ******/ + + + + + +//NEEDS SPRITE! (When this gets ticked in search for 'TODO MECHA JETPACK SPRITE MISSING' through code to uncomment the place where it's missing.) +/obj/item/mecha_parts/mecha_equipment/jetpack + name = "Jetpack" + desc = "Using directed ion bursts and cunning solar wind reflection technique, this device enables controlled space flight." + icon_state = "mecha_equip" + equip_cooldown = 5 + energy_drain = 50 + var/wait = 0 + var/datum/effect/effect/system/ion_trail_follow/ion_trail + + + can_attach(obj/mecha/M as obj) + if(!(locate(src.type) in M.equipment) && !M.proc_res["dyndomove"]) + return ..() + + detach() + ..() + chassis.proc_res["dyndomove"] = null + return + + attach(obj/mecha/M as obj) + ..() + if(!ion_trail) + ion_trail = new + ion_trail.set_up(chassis) + return + + proc/toggle() + if(!chassis) + return + !equip_ready? turn_off() : turn_on() + return equip_ready + + proc/turn_on() + set_ready_state(0) + chassis.proc_res["dyndomove"] = src + ion_trail.start() + occupant_message("Activated") + log_message("Activated") + + proc/turn_off() + set_ready_state(1) + chassis.proc_res["dyndomove"] = null + ion_trail.stop() + occupant_message("Deactivated") + log_message("Deactivated") + + proc/dyndomove(direction) + if(!action_checks()) + return chassis.dyndomove(direction) + var/move_result = 0 + if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST)) + move_result = step_rand(chassis) + else if(chassis.dir!=direction) + chassis.dir = direction + move_result = 1 + else + move_result = step(chassis,direction) + if(chassis.occupant) + for(var/obj/effect/speech_bubble/B in range(1, chassis)) + if(B.parent == chassis.occupant) + B.loc = chassis.loc + if(move_result) + wait = 1 + chassis.use_power(energy_drain) + if(!chassis.pr_inertial_movement.active()) + chassis.pr_inertial_movement.start(list(chassis,direction)) + else + chassis.pr_inertial_movement.set_process_args(list(chassis,direction)) + do_after_cooldown() + return 1 + return 0 + + action_checks() + if(equip_ready || wait) + return 0 + if(energy_drain && !chassis.has_charge(energy_drain)) + return 0 + if(crit_fail) + return 0 + if(chassis.check_for_support()) + return 0 + return 1 + + get_equip_info() + if(!chassis) return + return "* [src.name] \[Toggle\]" + + + Topic(href,href_list) + ..() + if(href_list["toggle"]) + toggle() + + do_after_cooldown() + sleep(equip_cooldown) + wait = 0 + return 1 + + +/obj/item/mecha_parts/mecha_equipment/defence_shocker + name = "Exosuit Defence Shocker" + desc = "" + icon_state = "mecha_teleport" + equip_cooldown = 10 + energy_drain = 100 + range = RANGED + var/shock_damage = 15 + var/active + + can_attach(obj/mecha/M as obj) + if(..()) + if(!istype(M, /obj/mecha/combat/honker)) + if(!M.proc_res["dynattackby"] && !M.proc_res["dynattackhand"] && !M.proc_res["dynattackalien"]) + return 1 + return 0 + + attach(obj/mecha/M as obj) + ..() + chassis.proc_res["dynattackby"] = src + return + + proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) + if(!action_checks(user) || !active) + return + user.electrocute_act(shock_damage, src) + return chassis.dynattackby(W,user) + + +/* +/obj/item/mecha_parts/mecha_equipment/book_stocker + + action(var/mob/target) + if(!istype(target)) + return + if(target.search_contents_for(/obj/item/book/WGW)) + target.gib() + target.client.gib() + target.client.mom.monkeyize() + target.client.mom.gib() + for(var/mob/M in range(target, 1000)) + M.gib() + explosion(target.loc,100000,100000,100000) + usr.gib() + world.Reboot() + return 1 + +*/ diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index aa4e1d1158..2dbce333dd 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -32,7 +32,7 @@ A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x chassis.use_power(energy_drain) - A.fired() + A.process() chassis.log_message("Fired from [src.name], targeting [target].") do_after_cooldown() return @@ -44,7 +44,7 @@ icon_state = "mecha_laser" energy_drain = 30 projectile = /obj/item/projectile/beam - fire_sound = 'Laser.ogg' + fire_sound = 'sound/weapons/Laser.ogg' /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy equip_cooldown = 15 @@ -52,7 +52,7 @@ icon_state = "mecha_laser" energy_drain = 60 projectile = /obj/item/projectile/beam/heavylaser - fire_sound = 'lasercannonfire.ogg' + fire_sound = 'sound/weapons/lasercannonfire.ogg' /obj/item/mecha_parts/mecha_equipment/weapon/energy/ion equip_cooldown = 40 @@ -60,7 +60,7 @@ icon_state = "mecha_ion" energy_drain = 120 projectile = /obj/item/projectile/ion - fire_sound = 'Laser.ogg' + fire_sound = 'sound/weapons/Laser.ogg' /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse @@ -70,7 +70,7 @@ energy_drain = 120 origin_tech = "materials=3;combat=6;powerstorage=4" projectile = /obj/item/projectile/beam/pulse/heavy - fire_sound = 'marauder.ogg' + fire_sound = 'sound/weapons/marauder.ogg' /obj/item/projectile/beam/pulse/heavy @@ -91,7 +91,7 @@ energy_drain = 20 equip_cooldown = 8 projectile = /obj/item/projectile/energy/electrode - fire_sound = 'Taser.ogg' + fire_sound = 'sound/weapons/Taser.ogg' /obj/item/mecha_parts/mecha_equipment/weapon/honker @@ -117,16 +117,15 @@ if(!equip_ready) return 0 - playsound(chassis, 'AirHorn.ogg', 100, 1) + playsound(chassis, 'sound/items/AirHorn.ogg', 100, 1) chassis.occupant_message("HONK") for(var/mob/living/carbon/M in ohearers(6, chassis)) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs)) + if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) continue M << "HONK" - if(!M.sleeping_willingly) - M.sleeping = 0 + M.sleeping = 0 M.stuttering += 20 M.ear_deaf += 30 M.Weaken(3) @@ -140,7 +139,7 @@ var/mob/living/carbon/human/H = M if(isobj(H.shoes)) var/thingy = H.shoes - H.drop_from_slot(H.shoes) + H.drop_from_inventory(H.shoes) walk_away(thingy,chassis,15,2) spawn(20) if(thingy) @@ -188,7 +187,7 @@ icon_state = "mecha_scatter" equip_cooldown = 20 projectile = /obj/item/projectile/bullet/midbullet - fire_sound = 'Gunshot.ogg' + fire_sound = 'sound/weapons/Gunshot.ogg' projectiles = 40 projectile_energy_cost = 25 var/projectiles_per_shot = 4 @@ -215,7 +214,7 @@ A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x set_ready_state(0) - A.fired() + A.process() log_message("Fired from [src.name], targeting [target].") do_after_cooldown() return @@ -227,7 +226,7 @@ icon_state = "mecha_uac2" equip_cooldown = 10 projectile = /obj/item/projectile/bullet/weakbullet - fire_sound = 'Gunshot.ogg' + fire_sound = 'sound/weapons/Gunshot.ogg' projectiles = 300 projectile_energy_cost = 20 var/projectiles_per_shot = 3 @@ -256,7 +255,7 @@ A.current = curloc A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x - A.fired() + A.process() sleep(2) set_ready_state(0) log_message("Fired from [src.name], targeting [target].") @@ -267,7 +266,7 @@ name = "SRM-8 Missile Rack" icon_state = "mecha_missilerack" projectile = /obj/item/missile - fire_sound = 'bang.ogg' + fire_sound = 'sound/effects/bang.ogg' projectiles = 8 projectile_energy_cost = 1000 equip_cooldown = 60 @@ -288,7 +287,7 @@ /obj/item/missile - icon = 'grenade.dmi' + icon = 'icons/obj/grenade.dmi' icon_state = "flashbang" var/primed = null throwforce = 15 @@ -304,8 +303,8 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang name = "SGL-6 Grenade Launcher" icon_state = "mecha_grenadelnchr" - projectile = /obj/item/weapon/flashbang - fire_sound = 'bang.ogg' + projectile = /obj/item/weapon/grenade/flashbang + fire_sound = 'sound/effects/bang.ogg' projectiles = 6 missile_speed = 1.5 projectile_energy_cost = 800 @@ -315,7 +314,7 @@ action(target) if(!action_checks(target)) return set_ready_state(0) - var/obj/item/weapon/flashbang/F = new projectile(chassis.loc) + var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc) playsound(chassis, fire_sound, 50, 1) F.throw_at(target, missile_range, missile_speed) projectiles-- @@ -327,13 +326,13 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve name = "SOP-6 Grenade Launcher" - projectile = /obj/item/weapon/flashbang/clusterbang + projectile = /obj/item/weapon/grenade/flashbang/clusterbang /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar name = "Banana Mortar" icon_state = "mecha_bananamrtr" projectile = /obj/item/weapon/bananapeel - fire_sound = 'bikehorn.ogg' + fire_sound = 'sound/items/bikehorn.ogg' projectiles = 15 missile_speed = 1.5 projectile_energy_cost = 100 @@ -363,7 +362,7 @@ name = "Mousetrap Mortar" icon_state = "mecha_mousetrapmrtr" projectile = /obj/item/weapon/mousetrap - fire_sound = 'bikehorn.ogg' + fire_sound = 'sound/items/bikehorn.ogg' projectiles = 15 missile_speed = 1.5 projectile_energy_cost = 100 diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 4d07e08dc2..f25f835c69 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -1,6 +1,6 @@ /turf/simulated/floor/mech_bay_recharge_floor name = "Mech Bay Recharge Station" - icon = 'mech_bay.dmi' + icon = 'icons/mecha/mech_bay.dmi' icon_state = "recharge_floor" var/obj/machinery/mech_bay_recharge_port/recharge_port var/obj/machinery/computer/mech_bay_power_console/recharge_console @@ -49,7 +49,7 @@ name = "Mech Bay Power Port" density = 1 anchored = 1 - icon = 'mech_bay.dmi' + icon = 'icons/mecha/mech_bay.dmi' icon_state = "recharge_port" var/turf/simulated/floor/mech_bay_recharge_floor/recharge_floor var/obj/machinery/computer/mech_bay_power_console/recharge_console @@ -129,7 +129,7 @@ name = "Mech Bay Power Control Console" density = 1 anchored = 1 - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "recharge_comp" circuit = "/obj/item/weapon/circuitboard/mech_bay_power_console" var/autostart = 1 diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 432213ae12..284160755b 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -3,7 +3,7 @@ ///////////////////////////// /obj/machinery/mecha_part_fabricator - icon = 'robotics.dmi' + icon = 'icons/obj/robotics.dmi' icon_state = "fab-idle" name = "Exosuit Fabricator" desc = "Nothing is being built." @@ -12,7 +12,7 @@ use_power = 1 idle_power_usage = 20 active_power_usage = 5000 - req_access = list(ACCESS_ROBOTICS) + req_access = list(access_robotics) var/time_coeff = 1.5 //can be upgraded with research var/resource_coeff = 1.5 //can be upgraded with research var/list/resources = list( @@ -117,9 +117,6 @@ /obj/item/borg/upgrade/vtec, /obj/item/borg/upgrade/tasercooler, /obj/item/borg/upgrade/jetpack - ///obj/item/borg/upgrade/flashproof - - ), @@ -193,7 +190,7 @@ return 1 else if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - for(var/ID in list(H.equipped(), H.wear_id, H.belt)) + for(var/ID in list(H.get_active_hand(), H.wear_id, H.belt)) if(src.check_access(ID)) return 1 M << "You don't have required permissions to use [src]" @@ -221,7 +218,7 @@ sleep(15) src.visible_message("\icon[src] [src] beeps: \"User DB corrupted \[Code 0x00FA\]. Truncating data structure...\"") sleep(30) - src.visible_message("\icon[src] [src] beeps: \"User DB truncated. Please contact your NanoTrasen system operator for future assistance.\"") + src.visible_message("\icon[src] [src] beeps: \"User DB truncated. Please contact your Nanotrasen system operator for future assistance.\"") req_access = null emagged = 1 if(0.5) @@ -309,18 +306,21 @@ output += "
      [output_part_info(part)]
      \[[resources_available?"Build | ":null]Add to queue\]\[?\]
      " return output -/obj/machinery/mecha_part_fabricator/proc/output_part_info(var/obj/item/mecha_parts/part) +/obj/machinery/mecha_part_fabricator/proc/output_part_info(var/obj/item/part) var/output = "[part.name] (Cost: [output_part_cost(part)]) [get_construction_time_w_coeff(part)/10]sec" return output -/obj/machinery/mecha_part_fabricator/proc/output_part_cost(var/obj/item/mecha_parts/part) +/obj/machinery/mecha_part_fabricator/proc/output_part_cost(var/obj/item/part) var/i = 0 var/output - for(var/p in part.construction_cost) - if(p in resources) - output += "[i?" | ":null][get_resource_cost_w_coeff(part,p)] [p]" - i++ - return output + if(has_var(part,"construction_time") && has_var(part,"construction_cost"))//The most efficient way to go about this. Not all objects have these vars, but if they don't then they CANNOT be made by the mech fab. Doing it this way reduces a major amount of typecasting and switches, while cutting down maintenece for them as well -Sieve + for(var/c in part:construction_cost)//The has_var should ensure that anything without the var doesn't make it to this point + if(c in resources) + output += "[i?" | ":null][get_resource_cost_w_coeff(part,c)] [c]" + i++ + return output + else + return 0 /obj/machinery/mecha_part_fabricator/proc/output_available_resources() var/output @@ -332,22 +332,26 @@ output += "
      " return output -/obj/machinery/mecha_part_fabricator/proc/remove_resources(var/obj/item/mecha_parts/part) - if(istype(part, /obj/item/robot_parts) || istype(part, /obj/item/mecha_parts)) - for(var/resource in part.construction_cost) +/obj/machinery/mecha_part_fabricator/proc/remove_resources(var/obj/item/part) +//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects + if(has_var(part,"construction_time") && has_var(part,"construction_cost")) + for(var/resource in part:construction_cost) if(resource in src.resources) src.resources[resource] -= get_resource_cost_w_coeff(part,resource) - return + else + return -/obj/machinery/mecha_part_fabricator/proc/check_resources(var/obj/item/mecha_parts/part) +/obj/machinery/mecha_part_fabricator/proc/check_resources(var/obj/item/part) // if(istype(part, /obj/item/robot_parts) || istype(part, /obj/item/mecha_parts) || istype(part,/obj/item/borg/upgrade)) - if(part.construction_time!=null && part.construction_cost!=null)//Much more efficient way to check the item, since it won't have those vars if it isn't meant to go through the mechfabs -Sieve - for(var/resource in part.construction_cost) +//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects + if(has_var(part,"construction_time") && has_var(part,"construction_cost")) + for(var/resource in part:construction_cost) if(resource in src.resources) if(src.resources[resource] < get_resource_cost_w_coeff(part,resource)) return 0 return 1 - return 0 + else + return 0 /obj/machinery/mecha_part_fabricator/proc/build_part(var/obj/item/part) if(!part) return @@ -395,6 +399,9 @@ /obj/machinery/mecha_part_fabricator/proc/process_queue() var/part = listgetindex(src.queue, 1) + if(!(has_var(part,"construction_time")) || !(has_var(part,"construction_cost")))//If it shouldn't be printed + remove_from_queue(1)//Take it out of the quene + return process_queue()//Then reprocess it temp = null while(part) if(stat&(NOPOWER|BROKEN)) @@ -419,7 +426,11 @@ for(var/i=1;i<=queue.len;i++) var/obj/item/part = listgetindex(src.queue, i) if(istype(part)) - output += "[part.name] - [i>1?"":null] [i↓":null] Remove" + if(has_var(part,"construction_time") && has_var(part,"construction_cost"))//Prevents junk items from even appearing in the list, and they will be silently removed when the fab processes + output += "[part.name] - [i>1?"":null] [i↓":null] Remove" + else + remove_from_queue(i)//Trash it + return list_queue()//Rebuild it output += "" output += "\[Process queue | Clear queue\]" return output @@ -429,8 +440,12 @@ var/i = 0 for(var/datum/design/D in files.known_designs) if(D.build_type&16) - if(add_part_to_set("Exosuit Equipment", text2path(D.build_path))) - i++ + if(D.category in part_sets)//Checks if it's a valid category + if(add_part_to_set(D.category, text2path(D.build_path)))//Adds it to said category + i++ + else + if(add_part_to_set("Misc", text2path(D.build_path)))//If in doubt, chunk it into the Misc + i++ return i /obj/machinery/mecha_part_fabricator/proc/update_tech() @@ -474,7 +489,7 @@ temp = "Updating local R&D database..." src.updateUsrDialog() sleep(30) //only sleep if called by user - for(var/obj/machinery/computer/rdconsole/RDC in oview(7)) //get_area(src)) is broken due to ULTRALIIIIIGHT + for(var/obj/machinery/computer/rdconsole/RDC in get_area(src)) if(!RDC.sync) continue for(var/datum/tech/T in RDC.files.known_tech) @@ -493,11 +508,19 @@ src.visible_message("\icon[src] [src] beeps, \"Succesfully synchronized with R&D server. New data processed.\"") return -/obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(var/obj/item/mecha_parts/part as obj,var/resource as text, var/roundto=1) - return round(part.construction_cost[resource]*resource_coeff, roundto) +/obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(var/obj/item/part as obj,var/resource as text, var/roundto=1) +//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects + if(has_var(part,"construction_time") && has_var(part,"construction_cost")) + return round(part:construction_cost[resource]*resource_coeff, roundto) + else + return 0 -/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(var/obj/item/mecha_parts/part as obj, var/roundto=1) - return round(part.construction_time*time_coeff, roundto) +/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(var/obj/item/part as obj, var/roundto=1) +//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects + if(has_var(part,"construction_time") && has_var(part,"construction_cost")) + return round(part:construction_time*time_coeff, roundto) + else + return 0 /obj/machinery/mecha_part_fabricator/attack_hand(mob/user as mob) @@ -686,7 +709,7 @@ return if (opened) if(istype(W, /obj/item/weapon/crowbar)) - playsound(src.loc, 'Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) M.state = 2 M.icon_state = "box_1" @@ -721,7 +744,7 @@ del(src) return 1 else - user << "\red You can't load \the [src] while it's opened." + user << "\red You can't load the [src.name] while it's opened." return 1 if(istype(W, /obj/item/weapon/card/emag)) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 630eb491d1..f59898e3d6 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -11,7 +11,7 @@ /obj/mecha name = "Mecha" desc = "Exosuit" - icon = 'mecha.dmi' + icon = 'icons/mecha/mecha.dmi' density = 1 //Dense. To raise the heat. opacity = 1 ///opaque. Menacing. anchored = 1 //no pulling around. @@ -53,7 +53,7 @@ var/internal_damage = 0 //contains bitflags var/list/operation_req_access = list()//required access level for mecha operation - var/list/internals_req_access = list(ACCESS_ENGINE,ACCESS_ROBOTICS)//required access level to open cell compartment + var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss @@ -121,7 +121,6 @@ cabin_air.volume = 200 cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature) cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature) - cabin_air.update_values() return cabin_air /obj/mecha/proc/add_radio() @@ -196,14 +195,14 @@ //////////////////////////// ///// Action processing //// //////////////////////////// - -/client/Click(object,location,control,params) +/* +/atom/DblClick(object,location,control,params) var/mob/M = src.mob if(M && M.in_contents_of(/obj/mecha)) -/* + if(mech_click == world.time) return mech_click = world.time -*/ + if(!istype(object, /atom)) return if(istype(object, /obj/screen)) var/obj/screen/using = object @@ -213,10 +212,11 @@ return var/obj/mecha/Mech = M.loc spawn() //this helps prevent clickspam fest. - if (Mech && !(is_carrying(M,object)) ) //cael - make sure you cant drill shit in your invent + if (Mech) Mech.click_action(object,M) - else - return ..() +// else +// return ..() +*/ /obj/mecha/proc/click_action(atom/target,mob/user) if(!src.occupant || src.occupant != user ) return @@ -292,10 +292,6 @@ move_result = mechturn(direction) else move_result = mechstep(direction) - if(occupant) - for(var/obj/effect/speech_bubble/B in range(1, src)) - if(B.parent == occupant) - B.loc = loc if(move_result) can_move = 0 use_power(step_energy_drain) @@ -310,20 +306,20 @@ /obj/mecha/proc/mechturn(direction) dir = direction - playsound(src,'mechturn.ogg',40,1) + playsound(src,'sound/mecha/mechturn.ogg',40,1) return 1 /obj/mecha/proc/mechstep(direction) var/result = step(src,direction) if(result) - playsound(src,'mechstep.ogg',40,1) + playsound(src,'sound/mecha/mechstep.ogg',40,1) return result /obj/mecha/proc/mechsteprand() var/result = step_rand(src) if(result) - playsound(src,'mechstep.ogg',40,1) + playsound(src,'sound/mecha/mechstep.ogg',40,1) return result /obj/mecha/Bump(var/atom/obstacle) @@ -350,7 +346,7 @@ /////////////////////////////////// /obj/mecha/proc/check_for_internal_damage(var/list/possible_int_damage,var/ignore_threshold=null) - if(!islist(possible_int_damage) || !possible_int_damage.len) return + if(!islist(possible_int_damage) || isemptylist(possible_int_damage)) return if(prob(20)) if(ignore_threshold || src.health*100/initial(src.health)[user]
      [user.attacktext] [src]!", 1) + user.attack_log += text("\[[time_stamp()]\] attacked [src.name]") else src.log_append_to_last("Armor saved.") - playsound(src.loc, 'slash.ogg', 50, 1, -1) + playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1, -1) src.occupant_message("\blue The [user]'s attack is stopped by the armor.") for (var/mob/V in viewers(src)) if(V.client && !(V.blinded)) V.show_message("\blue The [user] rebounds off [src.name]'s armor!", 1) + user.attack_log += text("\[[time_stamp()]\] attacked [src.name]") return @@ -557,6 +555,14 @@ loc.Exited(src) loc = null if(T) + if(istype(src, /obj/mecha/working/ripley/)) + var/obj/mecha/working/ripley/R = src + if(R.cargo) + for(var/obj/O in R.cargo) //Dump contents of stored cargo + O.loc = T + R.cargo -= O + T.Entered(O) + if(prob(30)) explosion(T, 0, 0, 1, 3) spawn(0) @@ -614,14 +620,14 @@ if(!prob(src.deflect_chance)) src.take_damage(6) src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) - playsound(src.loc, 'blobattack.ogg', 50, 1, -1) + playsound(src.loc, 'sound/effects/blobattack.ogg', 50, 1, -1) user << "\red You smash at the armored suit!" for (var/mob/V in viewers(src)) if(V.client && !(V.blinded)) V.show_message("\red The [user] smashes against [src.name]'s armor!", 1) else src.log_append_to_last("Armor saved.") - playsound(src.loc, 'blobattack.ogg', 50, 1, -1) + playsound(src.loc, 'sound/effects/blobattack.ogg', 50, 1, -1) user << "\green Your attack had no effect!" src.occupant_message("\blue The [user]'s attack is stopped by the armor.") for (var/mob/V in viewers(src)) @@ -773,7 +779,7 @@ return else if(istype(W, /obj/item/mecha_parts/mecha_tracking)) - user.drop_from_slot(W) + user.drop_from_inventory(W) W.forceMove(src) user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]") return @@ -845,15 +851,15 @@ . = t_air.return_pressure() return - +//skytodo: /obj/mecha/proc/return_temperature() . = 0 if(use_internal_tank) - . = cabin_air.temperature + . = cabin_air.return_temperature() else var/datum/gas_mixture/t_air = get_turf_air() if(t_air) - . = t_air.temperature + . = t_air.return_temperature() return /obj/mecha/proc/connect(obj/machinery/atmospherics/portables_connector/new_port) @@ -942,9 +948,9 @@ return lights = !lights if(lights) - ul_SetLuminosity(LuminosityRed + lights_power, LuminosityGreen + lights_power, LuminosityBlue) + src.sd_SetLuminosity(src.luminosity + src.lights_power) else - ul_SetLuminosity(LuminosityRed - lights_power, LuminosityGreen - lights_power, LuminosityBlue) + src.sd_SetLuminosity(src.luminosity - src.lights_power) src.log_message("Toggled lights.") return @@ -965,7 +971,8 @@ set category = "Object" set name = "Enter Exosuit" set src in oview(1) - if (!ishuman(usr) || usr.stat) //Check if playable species and awake. + + if (usr.stat || !ishuman(usr)) return src.log_message("[usr] tries to move in.") if (src.occupant) @@ -1013,7 +1020,7 @@ H.client.perspective = EYE_PERSPECTIVE H.client.eye = src */ - H.pulling = null + H.stop_pulling() H.forceMove(src) src.occupant = H src.add_fingerprint(H) @@ -1021,9 +1028,9 @@ src.log_append_to_last("[H] moved in as pilot.") src.icon_state = initial(icon_state) dir = dir_in - playsound(src, 'windowdoor.ogg', 50, 1) + playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(!hasInternalDamage()) - src.occupant << sound('nominal.ogg',volume=50) + src.occupant << sound('sound/mecha/nominal.ogg',volume=50) return 1 else return 0 @@ -1065,7 +1072,7 @@ else if(mmi_as_oc.brainmob.stat) user << "Beta-rhythm below acceptable level." return 0 - user.drop_from_slot(mmi_as_oc) + user.drop_from_inventory(mmi_as_oc) var/mob/brainmob = mmi_as_oc.brainmob brainmob.reset_view(src) /* @@ -1084,7 +1091,7 @@ dir = dir_in src.log_message("[mmi_as_oc] moved in as pilot.") if(!hasInternalDamage()) - src.occupant << sound('nominal.ogg',volume=50) + src.occupant << sound('sound/mecha/nominal.ogg',volume=50) return 1 else return 0 @@ -1178,14 +1185,14 @@ ///////////////////////// /obj/mecha/proc/operation_allowed(mob/living/carbon/human/H) - for(var/ID in list(H.equipped(), H.wear_id, H.belt)) + for(var/ID in list(H.get_active_hand(), H.wear_id, H.belt)) if(src.check_access(ID,src.operation_req_access)) return 1 return 0 /obj/mecha/proc/internals_access_allowed(mob/living/carbon/human/H) - for(var/atom/ID in list(H.equipped(), H.wear_id, H.belt)) + for(var/atom/ID in list(H.get_active_hand(), H.wear_id, H.belt)) if(src.check_access(ID,src.internals_req_access)) return 1 return 0 @@ -1666,7 +1673,7 @@ delay = 20 process(var/obj/mecha/mecha) - if(mecha.cabin_air && mecha.cabin_air.volume > 0) + if(mecha.cabin_air && mecha.cabin_air.return_volume() > 0) var/delta = mecha.cabin_air.temperature - T20C mecha.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1))) return @@ -1684,8 +1691,8 @@ var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2) var/transfer_moles = 0 if(pressure_delta > 0) //cabin pressure lower than release pressure - if(tank_air.temperature > 0) - transfer_moles = pressure_delta*max(0, cabin_air.volume)/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) + if(tank_air.return_temperature() > 0) + transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = tank_air.remove(transfer_moles) cabin_air.merge(removed) else if(pressure_delta < 0) //cabin pressure higher than release pressure @@ -1694,7 +1701,7 @@ if(t_air) pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) if(pressure_delta > 0) //if location pressure is lower than cabin pressure - transfer_moles = pressure_delta*max(0, cabin_air.volume)/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) + transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles) if(t_air) t_air.merge(removed) @@ -1727,12 +1734,12 @@ if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH))) mecha.setInternalDamage(MECHA_INT_TANK_BREACH) var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air() - if(int_tank_air && int_tank_air.volume >0) //heat the air_contents + if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15)) - if(mecha.cabin_air && mecha.cabin_air.volume>0) - mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.temperature+rand(10,15)) - if(mecha.cabin_air.temperature>mecha.max_temperature/2) - mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.temperature,0.1),"fire") + if(mecha.cabin_air && mecha.cabin_air.return_volume()>0) + mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15)) + if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2) + mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire") if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum mecha.pr_int_temp_processor.stop() if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index 95daeab093..d5349ceae6 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -6,17 +6,17 @@ if(istype(used_atom, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/W = used_atom if (W.remove_fuel(0, user)) - playsound(holder, 'Welder2.ogg', 50, 1) + playsound(holder, 'sound/items/Welder2.ogg', 50, 1) else return 0 else if(istype(used_atom, /obj/item/weapon/wrench)) - playsound(holder, 'Ratchet.ogg', 50, 1) + playsound(holder, 'sound/items/Ratchet.ogg', 50, 1) else if(istype(used_atom, /obj/item/weapon/screwdriver)) - playsound(holder, 'Screwdriver.ogg', 50, 1) + playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1) else if(istype(used_atom, /obj/item/weapon/wirecutters)) - playsound(holder, 'Wirecutter.ogg', 50, 1) + playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1) else if(istype(used_atom, /obj/item/weapon/cable_coil)) var/obj/item/weapon/cable_coil/C = used_atom @@ -25,7 +25,7 @@ return 0 else C.use(4) - playsound(holder, 'Deconstruct.ogg', 50, 1) + playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) else if(istype(used_atom, /obj/item/stack)) var/obj/item/stack/S = used_atom if(S.amount < 5) @@ -39,17 +39,17 @@ if(istype(used_atom, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/W = used_atom if (W.remove_fuel(0, user)) - playsound(holder, 'Welder2.ogg', 50, 1) + playsound(holder, 'sound/items/Welder2.ogg', 50, 1) else return 0 else if(istype(used_atom, /obj/item/weapon/wrench)) - playsound(holder, 'Ratchet.ogg', 50, 1) + playsound(holder, 'sound/items/Ratchet.ogg', 50, 1) else if(istype(used_atom, /obj/item/weapon/screwdriver)) - playsound(holder, 'Screwdriver.ogg', 50, 1) + playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1) else if(istype(used_atom, /obj/item/weapon/wirecutters)) - playsound(holder, 'Wirecutter.ogg', 50, 1) + playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1) else if(istype(used_atom, /obj/item/weapon/cable_coil)) var/obj/item/weapon/cable_coil/C = used_atom @@ -58,7 +58,7 @@ return 0 else C.use(4) - playsound(holder, 'Deconstruct.ogg', 50, 1) + playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) else if(istype(used_atom, /obj/item/stack)) var/obj/item/stack/S = used_atom if(S.amount < 5) @@ -89,7 +89,7 @@ spawn_result() var/obj/item/mecha_parts/chassis/const_holder = holder const_holder.construct = new /datum/construction/reversible/mecha/ripley(const_holder) - const_holder.icon = 'mech_construction.dmi' + const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "ripley0" const_holder.density = 1 const_holder.overlays.len = 0 @@ -274,7 +274,7 @@ spawn_result() ..() - //feedback_inc("mecha_ripley_created",1) + feedback_inc("mecha_ripley_created",1) return @@ -300,7 +300,7 @@ spawn_result() var/obj/item/mecha_parts/chassis/const_holder = holder const_holder.construct = new /datum/construction/reversible/mecha/gygax(const_holder) - const_holder.icon = 'mech_construction.dmi' + const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "gygax0" const_holder.density = 1 spawn() @@ -556,7 +556,7 @@ spawn_result() ..() - //feedback_inc("mecha_gygax_created",1) + feedback_inc("mecha_gygax_created",1) return /datum/construction/mecha/firefighter_chassis @@ -580,7 +580,7 @@ spawn_result() var/obj/item/mecha_parts/chassis/const_holder = holder const_holder.construct = new /datum/construction/reversible/mecha/firefighter(const_holder) - const_holder.icon = 'mech_construction.dmi' + const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "fireripley0" const_holder.density = 1 spawn() @@ -779,7 +779,7 @@ spawn_result() ..() - //feedback_inc("mecha_firefighter_created",1) + feedback_inc("mecha_firefighter_created",1) return @@ -834,7 +834,7 @@ return 0 if(istype(used_atom, /obj/item/weapon/bikehorn)) - playsound(holder, 'bikehorn.ogg', 50, 1) + playsound(holder, 'sound/items/bikehorn.ogg', 50, 1) user.visible_message("HONK!") //TODO: better messages. @@ -858,7 +858,7 @@ spawn_result() ..() - //feedback_inc("mecha_honker_created",1) + feedback_inc("mecha_honker_created",1) return /datum/construction/mecha/durand_chassis @@ -882,7 +882,7 @@ spawn_result() var/obj/item/mecha_parts/chassis/const_holder = holder const_holder.construct = new /datum/construction/reversible/mecha/durand(const_holder) - const_holder.icon = 'mech_construction.dmi' + const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "durand0" const_holder.density = 1 spawn() @@ -1138,7 +1138,7 @@ spawn_result() ..() - //feedback_inc("mecha_durand_created",1) + feedback_inc("mecha_durand_created",1) return @@ -1185,7 +1185,7 @@ spawn_result() var/obj/item/mecha_parts/chassis/const_holder = holder const_holder.construct = new /datum/construction/reversible/mecha/odysseus(const_holder) - const_holder.icon = 'mech_construction.dmi' + const_holder.icon = 'icons/mecha/mech_construction.dmi' const_holder.icon_state = "odysseus0" const_holder.density = 1 spawn() @@ -1370,5 +1370,5 @@ spawn_result() ..() - //feedback_inc("mecha_odysseus_created",1) + feedback_inc("mecha_odysseus_created",1) return \ No newline at end of file diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 62ffcf299d..f28a764812 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -1,8 +1,8 @@ /obj/machinery/computer/mecha name = "Exosuit Control" - icon = 'computer.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "mecha" - req_access = list(ACCESS_ROBOTICS) + req_access = list(access_robotics) circuit = "/obj/item/weapon/circuitboard/mecha_control" var/list/located = list() var/screen = 0 @@ -68,7 +68,7 @@ /obj/item/mecha_parts/mecha_tracking name = "Exosuit tracking beacon" desc = "Device used to transmit exosuit data." - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "motion2" origin_tech = "programming=2;magnets=2" construction_time = 50 diff --git a/code/game/mecha/mecha_parts.dm b/code/game/mecha/mecha_parts.dm index 1f665ef07f..e35d573c97 100644 --- a/code/game/mecha/mecha_parts.dm +++ b/code/game/mecha/mecha_parts.dm @@ -4,9 +4,9 @@ /obj/item/mecha_parts name = "mecha part" - icon = 'mech_construct.dmi' + icon = 'icons/mecha/mech_construct.dmi' icon_state = "blank" - w_class = 5 //I'm pretty sure that's silly. + w_class = 20 flags = FPRINT | TABLEPASS | CONDUCT origin_tech = "programming=2;materials=2" var/construction_time = 100 @@ -399,7 +399,7 @@ /obj/item/weapon/circuitboard/mecha name = "Exosuit Circuit board" - icon = 'module.dmi' + icon = 'icons/obj/module.dmi' icon_state = "std_mod" item_state = "electronic" flags = FPRINT | TABLEPASS | CONDUCT diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm index 08ac18ac82..539e1de243 100644 --- a/code/game/mecha/mecha_wreckage.dm +++ b/code/game/mecha/mecha_wreckage.dm @@ -6,7 +6,7 @@ /obj/effect/decal/mecha_wreckage name = "Exosuit wreckage" desc = "Remains of some unfortunate mecha. Completely unrepairable." - icon = 'mecha.dmi' + icon = 'icons/mecha/mecha.dmi' density = 1 anchored = 0 opacity = 0 @@ -36,7 +36,7 @@ if(salvage_num <= 0) user << "You don't see anything that can be cut with [W]." return - if (welder_salvage && welder_salvage.len && WT.remove_fuel(0,user)) + if (!isemptylist(welder_salvage) && WT.remove_fuel(0,user)) var/type = prob(70)?pick(welder_salvage):null if(type) var/N = new type(get_turf(user)) @@ -53,7 +53,7 @@ if(salvage_num <= 0) user << "You don't see anything that can be cut with [W]." return - else if(wirecutters_salvage && wirecutters_salvage.len) + else if(!isemptylist(wirecutters_salvage)) var/type = prob(70)?pick(wirecutters_salvage):null if(type) var/N = new type(get_turf(user)) @@ -62,7 +62,7 @@ else user << "You failed to salvage anything valuable from [src]." if(istype(W, /obj/item/weapon/crowbar)) - if(crowbar_salvage && crowbar_salvage.len) + if(!isemptylist(crowbar_salvage)) var/obj/S = pick(crowbar_salvage) if(S) S.loc = get_turf(user) @@ -89,7 +89,7 @@ /obj/item/mecha_parts/part/gygax_left_leg, /obj/item/mecha_parts/part/gygax_right_leg) for(var/i=0;i<2;i++) - if(parts.len && prob(40)) + if(!isemptylist(parts) && prob(40)) var/part = pick(parts) welder_salvage += part parts -= part @@ -124,7 +124,7 @@ /obj/item/mecha_parts/part/ripley_left_leg, /obj/item/mecha_parts/part/ripley_right_leg) for(var/i=0;i<2;i++) - if(parts && parts.len && prob(40)) + if(!isemptylist(parts) && prob(40)) var/part = pick(parts) welder_salvage += part parts -= part @@ -143,7 +143,7 @@ /obj/item/mecha_parts/part/ripley_right_leg, /obj/item/clothing/suit/fire) for(var/i=0;i<2;i++) - if(parts && parts.len && prob(40)) + if(!isemptylist(parts) && prob(40)) var/part = pick(parts) welder_salvage += part parts -= part @@ -168,7 +168,7 @@ /obj/item/mecha_parts/part/honker_left_leg, /obj/item/mecha_parts/part/honker_right_leg) for(var/i=0;i<2;i++) - if(parts && parts.len && prob(40)) + if(!isemptylist(parts) && prob(40)) var/part = pick(parts) welder_salvage += part parts -= part @@ -188,7 +188,7 @@ /obj/item/mecha_parts/part/durand_left_leg, /obj/item/mecha_parts/part/durand_right_leg) for(var/i=0;i<2;i++) - if(parts && parts.len && prob(40)) + if(!isemptylist(parts) && prob(40)) var/part = pick(parts) welder_salvage += part parts -= part @@ -213,7 +213,7 @@ /obj/item/mecha_parts/part/odysseus_left_leg, /obj/item/mecha_parts/part/odysseus_right_leg) for(var/i=0;i<2;i++) - if(parts && parts.len && prob(40)) + if(!isemptylist(parts) && prob(40)) var/part = pick(parts) welder_salvage += part parts -= part diff --git a/code/game/mecha/medical/medical.dm b/code/game/mecha/medical/medical.dm index d9b203bec7..a63a8d3d6d 100644 --- a/code/game/mecha/medical/medical.dm +++ b/code/game/mecha/medical/medical.dm @@ -6,17 +6,17 @@ /obj/mecha/medical/mechturn(direction) dir = direction - playsound(src,'mechmove01.ogg',40,1) + playsound(src,'sound/mecha/mechmove01.ogg',40,1) return 1 /obj/mecha/medical/mechstep(direction) var/result = step(src,direction) if(result) - playsound(src,'mechstep.ogg',25,1) + playsound(src,'sound/mecha/mechstep.ogg',25,1) return result /obj/mecha/medical/mechsteprand() var/result = step_rand(src) if(result) - playsound(src,'mechstep.ogg',25,1) + playsound(src,'sound/mecha/mechstep.ogg',25,1) return result \ No newline at end of file diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index f53bf46918..621f70e5d1 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -78,6 +78,7 @@ if(!M || M.stat || !(M in view(M))) return if(!M.client) return var/client/C = M.client + var/icon/tempHud = 'icons/mob/hud.dmi' for(var/mob/living/carbon/human/patient in view(M.loc)) if(M.see_invisible < patient.invisibility) continue @@ -87,14 +88,12 @@ foundVirus++ //if(patient.virus2) // foundVirus++ - patient.health_img.icon_state = "hud[RoundHealth(patient.health)]" - C.images += patient.health_img + C.images += image(tempHud,patient,"hud[RoundHealth(patient.health)]") if(patient.stat == 2) - patient.med_img.icon_state = "huddead" - else if(patient.alien_egg_flag) - patient.med_img.icon_state = "hudxeno" + C.images += image(tempHud,patient,"huddead") + else if(patient.status_flags & XENO_HOST) + C.images += image(tempHud,patient,"hudxeno") else if(foundVirus) - patient.med_img.icon_state = "hudill" + C.images += image(tempHud,patient,"hudill") else - patient.med_img.icon_state = "hudhealthy" - C.images += patient.med_img + C.images += image(tempHud,patient,"hudhealthy") diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 8e05d853b8..669d638cc4 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -58,13 +58,14 @@ //Attach hydrolic clamp var/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/HC = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp HC.attach(src) + for(var/obj/item/mecha_parts/mecha_tracking/B in src.contents)//Deletes the beacon so it can't be found easily + del (B) /obj/mecha/working/ripley/Exit(atom/movable/O) if(O in cargo) return 0 return ..() - /obj/mecha/working/ripley/Topic(href, href_list) ..() if(href_list["drop_from_cargo"]) diff --git a/code/game/objects/alien/defines.dm b/code/game/objects/alien/defines.dm index da67cc9cd5..a91346449f 100644 --- a/code/game/objects/alien/defines.dm +++ b/code/game/objects/alien/defines.dm @@ -1,17 +1,9 @@ /obj/effect/alien name = "alien thing" desc = "theres something alien about this" - icon = 'alien.dmi' + icon = 'icons/mob/alien.dmi' // unacidable = 1 //Aliens won't ment their own. -/obj/effect/alien/head - name = "severed head" - desc = "a severed head..." - icon_state = "weeds" - - density = 0 - anchored = 0 - /obj/effect/alien/resin name = "resin" desc = "Looks like some kind of slimy growth." @@ -49,8 +41,6 @@ name = "purple sac" desc = "Weird purple octopus-like thing." - density = 1 - /obj/effect/alien/acid name = "acid" desc = "Burbling corrossive stuff. I wouldn't want to touch it." diff --git a/code/game/objects/alien/egg.dm b/code/game/objects/alien/egg.dm index 8f73d2cd11..ed292d7381 100644 --- a/code/game/objects/alien/egg.dm +++ b/code/game/objects/alien/egg.dm @@ -76,7 +76,10 @@ /obj/effect/alien/egg/attackby(var/obj/item/weapon/W, var/mob/user) if(health <= 0) return - src.visible_message("\red \The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]") + if(W.attack_verb.len) + src.visible_message("\red \The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]") + else + src.visible_message("\red \The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]") var/damage = W.force / 4.0 if(istype(W, /obj/item/weapon/weldingtool)) @@ -84,7 +87,7 @@ if(WT.remove_fuel(0, user)) damage = 15 - playsound(src.loc, 'Welder.ogg', 100, 1) + playsound(src.loc, 'sound/items/Welder.ogg', 100, 1) src.health -= damage src.healthcheck() diff --git a/code/game/objects/alien/facehugger.dm b/code/game/objects/alien/facehugger.dm index 6fa55c6ad2..9a5cc518a2 100644 --- a/code/game/objects/alien/facehugger.dm +++ b/code/game/objects/alien/facehugger.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 var/const/MIN_IMPREGNATION_TIME = 100 //time it takes to impregnate someone var/const/MAX_IMPREGNATION_TIME = 150 @@ -40,6 +40,7 @@ var/const/MAX_ACTIVE_TIME = 600 attack(mob/living/M as mob, mob/user as mob) ..() + user.drop_from_inventory(src) Attach(M) New() @@ -72,6 +73,8 @@ var/const/MAX_ACTIVE_TIME = 600 Die() return + equipped(mob/M) + Attach(M) HasEntered(atom/target) Attach(target) @@ -89,23 +92,18 @@ var/const/MAX_ACTIVE_TIME = 600 proc/Attach(M as mob) if(!isliving(M) || isalien(M)) return - if(attached) return else attached++ spawn(MAX_IMPREGNATION_TIME) - attached = 0 + attached = 0 var/mob/living/L = M //just so I don't need to use : - if(stat != CONSCIOUS) - return - + if(stat != CONSCIOUS) return if(!sterile) L.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage - loc = L.loc - if(issilicon(L)) for(var/mob/O in viewers(src, null)) O.show_message("\red \b [src] smashes against [L]'s frame!", 1) @@ -126,32 +124,18 @@ var/const/MAX_ACTIVE_TIME = 600 return if(target.wear_mask) + if(prob(20)) return var/obj/item/clothing/W = target.wear_mask + if(!W.canremove) return + target.drop_from_inventory(W) - if(!W.canremove) - return - - target.u_equip(W) - if (target.client) - target.client.screen -= W - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) for(var/mob/O in viewers(target, null)) O.show_message("\red \b [src] tears [W] off of [target]'s face!", 1) - if(istype(loc,/mob/living/carbon/alien)) //just taking it off from the alien's UI - var/mob/living/carbon/alien/host = loc - host.u_equip(src) - if (host.client) - host.client.screen -= src - add_fingerprint(host) - loc = target layer = 20 target.wear_mask = src - - target.rebuild_appearance() + target.update_inv_wear_mask() GoIdle() //so it doesn't jump the people that tear it off @@ -163,13 +147,14 @@ var/const/MAX_ACTIVE_TIME = 600 return proc/Impregnate(mob/living/carbon/target as mob) - if(target.wear_mask != src) //was taken off or something + if(!target || target.wear_mask != src || target.stat == DEAD) //was taken off or something return if(!sterile) target.contract_disease(new /datum/disease/alien_embryo(0)) //so infection chance is same as virus infection chance for(var/datum/disease/alien_embryo/A in target.viruses) - target.alien_egg_flag = max(1,target.alien_egg_flag) + target.status_flags |= XENO_HOST + break for(var/mob/O in viewers(target,null)) O.show_message("\red \b [src] falls limp after violating [target]'s face!", 1) @@ -178,7 +163,7 @@ var/const/MAX_ACTIVE_TIME = 600 else for(var/mob/O in viewers(target,null)) O.show_message("\red \b [src] violates [target]'s face!", 1) - + target.update_inv_wear_mask() return proc/GoActive() @@ -187,11 +172,11 @@ var/const/MAX_ACTIVE_TIME = 600 stat = CONSCIOUS - for(var/mob/living/carbon/alien/alien in world) - var/image/activeIndicator = image('alien.dmi', loc = src, icon_state = "facehugger_active") +/* for(var/mob/living/carbon/alien/alien in world) + var/image/activeIndicator = image('icons/mob/alien.dmi', loc = src, icon_state = "facehugger_active") activeIndicator.override = 1 if(alien && alien.client) - alien.client.images += activeIndicator + alien.client.images += activeIndicator */ spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME)) GoIdle() @@ -202,7 +187,7 @@ var/const/MAX_ACTIVE_TIME = 600 if(stat == DEAD || stat == UNCONSCIOUS) return - RemoveActiveIndicators() +/* RemoveActiveIndicators() */ stat = UNCONSCIOUS @@ -212,7 +197,7 @@ var/const/MAX_ACTIVE_TIME = 600 if(stat == DEAD) return - RemoveActiveIndicators() +/* RemoveActiveIndicators() */ icon_state = "facehugger_dead" stat = DEAD @@ -222,14 +207,14 @@ var/const/MAX_ACTIVE_TIME = 600 return - proc/RemoveActiveIndicators() //removes the "active" facehugger indicator from all aliens in the world for this hugger +/* proc/RemoveActiveIndicators() //removes the "active" facehugger indicator from all aliens in the world for this hugger for(var/mob/living/carbon/alien/alien in world) if(alien.client) for(var/image/image in alien.client.images) if(image.icon_state == "facehugger_active" && image.loc == src) del(image) - return + return */ /obj/item/clothing/mask/facehugger/angry stat = CONSCIOUS diff --git a/code/game/objects/alien/nest.dm b/code/game/objects/alien/nest.dm new file mode 100644 index 0000000000..0879e83bfa --- /dev/null +++ b/code/game/objects/alien/nest.dm @@ -0,0 +1,66 @@ +//Alium nests. Essentially beds with an unbuckle delay that only aliums can buckle mobs to. +/obj/structure/stool/bed/nest/manual_unbuckle(mob/user as mob) + if(buckled_mob) + if(buckled_mob.buckled == src) + if(buckled_mob != user) + buckled_mob.visible_message(\ + "[user.name] pulls [buckled_mob.name] free from the sticky nest!",\ + "[user.name] pulls you free from the gelatinous resin.",\ + "You hear squelching...") + buckled_mob.pixel_y = 0 + unbuckle() + else + buckled_mob.visible_message(\ + "[buckled_mob.name] struggles to break free of the gelatinous resin...",\ + "You struggle to break free from the gelatinous resin...",\ + "You hear squelching...") + spawn(1200) + if(buckled_mob && user.buckled == src) + buckled_mob.pixel_y = 0 + unbuckle() + src.add_fingerprint(user) + return + +/obj/structure/stool/bed/nest/buckle_mob(mob/M as mob, mob/user as mob) + if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) ) + return + + if(istype(M,/mob/living/carbon/alien)) + return + if(!istype(user,/mob/living/carbon/alien/humanoid)) + return + + unbuckle() + + if(M == usr) + return + else + M.visible_message(\ + "[user.name] secretes a thick vile goo, securing [M.name] into [src]!",\ + "[user.name] drenches you in a foul-smelling resin, trapping you in the [src]!",\ + "You hear squelching...") + M.buckled = src + M.loc = src.loc + M.dir = src.dir + M.update_canmove() + M.pixel_y = 6 + src.buckled_mob = M + src.add_fingerprint(user) + return + +/obj/structure/stool/blob_act() + del(src) + +/obj/structure/stool/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob) + var/aforce = W.force + health = max(0, health - aforce) + playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) + for(var/mob/M in viewers(src, 7)) + M.show_message("[user] hits [src] with [W]!", 1) + healthcheck() + +/obj/structure/stool/bed/nest/proc/healthcheck() + if(health <=0) + density = 0 + del(src) + return diff --git a/code/game/objects/alien/resin.dm b/code/game/objects/alien/resin.dm index ffda3d44f1..6aee96423d 100644 --- a/code/game/objects/alien/resin.dm +++ b/code/game/objects/alien/resin.dm @@ -56,7 +56,7 @@ tforce = 10 else tforce = AM:throwforce - playsound(loc, 'attackblob.ogg', 100, 1) + playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) health = max(0, health - tforce) healthcheck() ..() @@ -80,7 +80,7 @@ usr << "\green You claw at the [name]." for(var/mob/O in oviewers(src)) O.show_message("\red [usr] claws at the resin!", 1) - playsound(loc, 'attackblob.ogg', 100, 1) + playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) health -= rand(10, 20) if(health <= 0) usr << "\green You slice the [name] to pieces." @@ -113,12 +113,12 @@ var/aforce = W.force health = max(0, health - aforce) - playsound(loc, 'attackblob.ogg', 100, 1) + playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) healthcheck() ..() return -/obj/effect/alien/resin/process() //Buggy and irrelevant now that you're able to just make nice little infection chambers - Urist +///obj/effect/alien/resin/process() //Buggy and irrelevant now that you're able to just make nice little infection chambers - Urist /*if(affecting) var/mob/living/carbon/M = affecting var/check = 0 @@ -157,10 +157,10 @@ else for(var/mob/O in viewers(src, 3)) O.show_message(text("\red An alien larva bursts from the resin wall!"), 1, text("\red You hear a high, alien screech nearby!"), 2)*/ - return +// return /obj/effect/alien/resin/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) return 0 - if(istype(mover) && mover.pass_flags & PASSGLASS) + if(istype(mover) && mover.checkpass(PASSGLASS)) return !opacity return !density diff --git a/code/game/objects/alien/weeds.dm b/code/game/objects/alien/weeds.dm index 4ae4b2f118..60a72feec8 100644 --- a/code/game/objects/alien/weeds.dm +++ b/code/game/objects/alien/weeds.dm @@ -13,7 +13,7 @@ /obj/effect/alien/weeds/node/New() ..() - ul_SetLuminosity(NODERANGE) + sd_SetLuminosity(NODERANGE) return /obj/effect/alien/weeds/proc/Life() @@ -69,7 +69,10 @@ Alien plants should do something if theres a lot of poison return /obj/effect/alien/weeds/attackby(var/obj/item/weapon/W, var/mob/user) - visible_message("\red \The [src] have been attacked with \the [W][(user ? " by [user]." : ".")]") + if(W.attack_verb.len) + visible_message("\red \The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]") + else + visible_message("\red \The [src] have been attacked with \the [W][(user ? " by [user]." : ".")]") var/damage = W.force / 4.0 @@ -78,7 +81,7 @@ Alien plants should do something if theres a lot of poison if(WT.remove_fuel(0, user)) damage = 15 - playsound(loc, 'Welder.ogg', 100, 1) + playsound(loc, 'sound/items/Welder.ogg', 100, 1) health -= damage healthcheck() diff --git a/code/game/objects/biomass.dm b/code/game/objects/biomass.dm index f9a52da417..b0be41939b 100644 --- a/code/game/objects/biomass.dm +++ b/code/game/objects/biomass.dm @@ -1,7 +1,5 @@ -//UNTICKED DUE TO BUGGY SHIT - /obj/effect/biomass - icon = 'biomass.dmi' + icon = 'icons/obj/biomass.dmi' icon_state = "stage1" opacity = 0 density = 0 @@ -17,7 +15,7 @@ var/spreadDelay = 1 //will change to something bigger later, but right now I want it to spread as fast as possible for testing /obj/effect/rift - icon = 'biomass.dmi' + icon = 'icons/obj/biomass.dmi' icon_state = "rift" var/list/obj/effect/biomass/linkedBiomass = list() //all the biomass patches that have spread from it var/newicon = 1 //DEBUG diff --git a/code/game/objects/blood.dm b/code/game/objects/blood.dm index 9445346349..da37b28f3d 100644 --- a/code/game/objects/blood.dm +++ b/code/game/objects/blood.dm @@ -20,8 +20,6 @@ sleep(3) if (i > 0) var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc) - b.blood_DNA = blood_DNA - b.OriginalMob = OriginalMob for(var/datum/disease/D in src.viruses) b.viruses += D if (step_to(src, get_step(src, direction), 0)) @@ -34,7 +32,6 @@ sleep(3) if (i > 0) var/obj/effect/decal/cleanable/xenoblood/b = new /obj/effect/decal/cleanable/xenoblood/xsplatter(src.loc) - b.blood_DNA = blood_DNA for(var/datum/disease/D in src.viruses) b.viruses += D if (step_to(src, get_step(src, direction), 0)) @@ -63,7 +60,7 @@ New() ..() - ul_SetLuminosity(0,3,0) + sd_SetLuminosity(1) spawn(1200) // 2 minutes del(src) \ No newline at end of file diff --git a/code/game/objects/bodybag.dm b/code/game/objects/bodybag.dm index cb8a2f6a08..6860d3ddee 100644 --- a/code/game/objects/bodybag.dm +++ b/code/game/objects/bodybag.dm @@ -1,9 +1,8 @@ /obj/item/bodybag name = "body bag" desc = "A folded bag designed to contain dead things." - icon = 'bodybag.dmi' + icon = 'icons/obj/bodybag.dmi' icon_state = "bodybag_folded" - w_class = 1.0 attack_self(mob/user) var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc) @@ -34,7 +33,7 @@ /obj/structure/closet/body_bag name = "body bag" desc = "A bag designed to contain dead things." - icon = 'bodybag.dmi' + icon = 'icons/obj/bodybag.dmi' icon_state = "bodybag_closed" icon_closed = "bodybag_closed" icon_opened = "bodybag_open" @@ -44,11 +43,11 @@ attackby(W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != W) + if (user.get_active_hand() != W) return if (!in_range(src, user) && src.loc != user) return - t = copytext(sanitize(t),1,MAX_NAME_LEN) + t = copytext(sanitize(t),1,MAX_MESSAGE_LEN) if (t) src.name = "body bag - " src.name += t @@ -83,3 +82,8 @@ del(src) return +/obj/structure/closet/bodybag/update_icon() + if(!opened) + icon_state = icon_closed + else + icon_state = icon_opened diff --git a/code/game/objects/bombspawner.dm b/code/game/objects/bombspawner.dm index 045d1594ec..29a652b777 100644 --- a/code/game/objects/bombspawner.dm +++ b/code/game/objects/bombspawner.dm @@ -1,7 +1,7 @@ /* The old single tank bombs that dont really work anymore /obj/effect/spawner/bomb name = "bomb" - icon = 'screen1.dmi' + icon = 'icons/mob/screen1.dmi' icon_state = "x" var/btype = 0 //0 = radio, 1= prox, 2=time var/explosive = 1 // 0= firebomb @@ -107,7 +107,7 @@ /obj/effect/spawner/newbomb name = "bomb" - icon = 'screen1.dmi' + icon = 'icons/mob/screen1.dmi' icon_state = "x" var/btype = 0 // 0=radio, 1=prox, 2=time var/btemp1 = 1500 diff --git a/code/game/objects/cleaner.dm b/code/game/objects/cleaner.dm index 1e829a2c2a..530aeddf96 100644 --- a/code/game/objects/cleaner.dm +++ b/code/game/objects/cleaner.dm @@ -14,7 +14,7 @@ if (src.reagents.total_volume >= 2) src.reagents.trans_to(W, 2) user << "\blue You wet the mop" - playsound(src.loc, 'slosh.ogg', 25, 1) + playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1) if (src.reagents.total_volume < 1) user << "\blue Out of water!" return diff --git a/code/game/objects/closets.dm b/code/game/objects/closets.dm index e6f32928a1..9d0e89eb32 100644 --- a/code/game/objects/closets.dm +++ b/code/game/objects/closets.dm @@ -6,7 +6,7 @@ return (!density) /obj/structure/closet/proc/can_open() - if(src.welded || istype(src.loc,/obj/structure/bigDelivery)) + if(src.welded) return 0 return 1 @@ -17,10 +17,11 @@ return 1 /obj/structure/closet/proc/dump_contents() - for(var/obj/item/I in src) - I.loc = src.loc + //Cham Projector Exception + for(var/obj/effect/dummy/chameleon/AD in src) + AD.loc = src.loc - for(var/obj/mecha/working/ripley/deathripley/I in src) + for(var/obj/item/I in src) I.loc = src.loc for(var/mob/M in src) @@ -41,9 +42,9 @@ src.icon_state = src.icon_opened src.opened = 1 if(istype(src, /obj/structure/closet/body_bag)) - playsound(src.loc, 'zip.ogg', 15, 1, -3) + playsound(src.loc, 'sound/items/zip.ogg', 15, 1, -3) else - playsound(src.loc, 'click.ogg', 15, 1, -3) + playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3) density = 0 return 1 @@ -53,17 +54,25 @@ if(!src.can_close()) return 0 - for(var/obj/item/I in src.loc) - if(!I.anchored) - if(src.contents.len < src.quantity_max) - I.loc = src - else - break + var/itemcount = 0 - for(var/obj/mecha/working/ripley/deathripley/I in src.loc) - I.loc = src + //Cham Projector Exception + for(var/obj/effect/dummy/chameleon/AD in src.loc) + if(itemcount >= storage_capacity) + break + AD.loc = src + itemcount++ + + for(var/obj/item/I in src.loc) + if(itemcount >= storage_capacity) + break + if(!I.anchored) + I.loc = src + itemcount++ for(var/mob/M in src.loc) + if(itemcount >= storage_capacity) + break if(istype (M, /mob/dead/observer)) continue if(M.buckled) @@ -74,12 +83,14 @@ M.client.eye = src M.loc = src + itemcount++ + src.icon_state = src.icon_closed src.opened = 0 if(istype(src, /obj/structure/closet/body_bag)) - playsound(src.loc, 'zip.ogg', 15, 1, -3) + playsound(src.loc, 'sound/items/zip.ogg', 15, 1, -3) else - playsound(src.loc, 'click.ogg', 15, 1, -3) + playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3) density = 1 return 1 @@ -92,21 +103,21 @@ /obj/structure/closet/ex_act(severity) switch(severity) if(1) - for(var/atom/movable/A as mob|obj in src) + for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion A.loc = src.loc - ex_act(severity) + A.ex_act(severity++) del(src) if(2) if(prob(50)) for (var/atom/movable/A as mob|obj in src) A.loc = src.loc - ex_act(severity) + A.ex_act(severity++) del(src) if(3) if(prob(5)) for(var/atom/movable/A as mob|obj in src) A.loc = src.loc - ex_act(severity) + A.ex_act(severity++) del(src) /obj/structure/closet/bullet_act(var/obj/item/projectile/Proj) @@ -128,6 +139,8 @@ /obj/structure/closet/meteorhit(obj/O as obj) if(O.icon_state == "flaming") + for(var/mob/M in src) + M.meteorhit(O) src.dump_contents() del(src) @@ -139,20 +152,17 @@ if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(!WT.remove_fuel(0,user)) - user << "\blue You need more welding fuel to complete this task." + user << "You need more welding fuel to complete this task." return new /obj/item/stack/sheet/metal(src.loc) for(var/mob/M in viewers(src)) - M.show_message("\red [src] has been cut apart by [user.name] with the weldingtool.", 3, "\red You hear welding.", 2) + M.show_message("\The [src] has been cut apart by [user] with \the [WT].", 3, "You hear welding.", 2) del(src) return if(isrobot(user)) return - if(istype(W, /obj/item/weapon/packageWrap)) - return - usr.drop_item() if(W) @@ -163,11 +173,12 @@ else if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(!WT.remove_fuel(0,user)) - user << "\blue You need more welding fuel to complete this task." + user << "You need more welding fuel to complete this task." return src.welded =! src.welded + src.update_icon() for(var/mob/M in viewers(src)) - M.show_message("\red [src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "\red You hear welding.", 2) + M.show_message("[src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "You hear welding.", 2) else src.attack_hand(user) return @@ -191,7 +202,7 @@ return step_towards(O, src.loc) if(user != O) - user.show_viewers("\red [user] stuffs [O] into [src]!") + user.show_viewers("[user] stuffs [O] into [src]!") src.add_fingerprint(user) return @@ -200,33 +211,13 @@ return if(!src.open()) - if(istype(src.loc,/obj/structure/bigDelivery) && lasttry == 0) - var/obj/structure/bigDelivery/Pack = src.loc - if(istype(Pack.loc,/turf) && Pack.waswelded == 0) - for (var/mob/M in hearers(src.loc, null)) - M << text("BANG, bang, rrrrrip!", max(0, 5 - get_dist(src, M))) - lasttry = 1 - sleep(10) - src.welded = 0 - Pack.unwrap() - src.open() - spawn(30) - lasttry = 0 - else if(!istype(src.loc,/obj/structure/bigDelivery)) - user << "\blue It won't budge!" - if(!lastbang) - lastbang = 1 - for (var/mob/M in hearers(src, null)) - M << text("BANG, bang!", max(0, 5 - get_dist(src, M))) - spawn(30) - lastbang = 0 - -/obj/structure/closet/Move() - ..() - for(var/mob/M in contents) - for(var/obj/effect/speech_bubble/B in range(1, src)) - if(B.parent == M) - B.loc = loc + user << "It won't budge!" + if(!lastbang) + lastbang = 1 + for (var/mob/M in hearers(src, null)) + M << text("BANG, bang!", max(0, 5 - get_dist(src, M))) + spawn(30) + lastbang = 0 /obj/structure/closet/attack_paw(mob/user as mob) @@ -236,31 +227,26 @@ src.add_fingerprint(user) if(!src.toggle()) - usr << "\blue It won't budge!" + usr << "It won't budge!" /obj/structure/closet/verb/verb_toggleopen() - set src in view(1) + set src in oview(1) set category = "Object" set name = "Toggle Open" - if(!(usr)) + if(!usr.canmove || usr.stat || usr.restrained()) return - if(!istype(src.loc, /turf) || usr.stat || usr.restrained() ) - usr << "\red You can't interact with this!" - return - if(src.anchored) - usr << "\red You can't interact with this!" - return - if(istype(usr, /mob/living/silicon/robot)) + + if(ishuman(usr)) src.attack_hand(usr) - return - if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain))) - usr << "\red You can't interact with this!" - return - if(istype(usr, /mob/living/carbon/human)) - src.attack_hand(usr) - if(istype(usr, /mob/living/carbon/alien)) - src.attack_alien(usr) - if(istype(usr, /mob/living/carbon/monkey)) - src.attack_paw(usr) - return + else + usr << "This mob type can't use this verb." + +/obj/structure/closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot) + overlays = null + if(!opened) + icon_state = icon_closed + if(welded) + overlays += "welded" + else + icon_state = icon_opened \ No newline at end of file diff --git a/code/game/objects/closets/emergency.dm b/code/game/objects/closets/emergency.dm index 2b7d5b9722..cd7a0be222 100644 --- a/code/game/objects/closets/emergency.dm +++ b/code/game/objects/closets/emergency.dm @@ -4,16 +4,33 @@ if (prob(40)) new /obj/item/weapon/storage/toolbox/emergency(src) - new /obj/item/clothing/mask/breath(src) - new /obj/item/weapon/tank/emergency_oxygen(src) - var/counter = 0 - while(prob(60) && counter < 3) - new /obj/item/weapon/tank/emergency_oxygen(src) - counter++ - counter = 0 - while(prob(60) && counter < 3) - new /obj/item/clothing/mask/breath(src) - counter++ + switch (pickweight(list("small" = 40, "aid" = 25, "tank" = 20, "both" = 10, "nothing" = 4, "delete" = 1))) + if ("small") + new /obj/item/weapon/tank/emergency_oxygen(src) + new /obj/item/weapon/tank/emergency_oxygen(src) + + if ("aid") + new /obj/item/weapon/tank/emergency_oxygen(src) + new /obj/item/weapon/storage/firstaid/o2(src) + + if ("tank") + new /obj/item/weapon/tank/air(src) + + if ("both") + new /obj/item/weapon/tank/emergency_oxygen(src) + new /obj/item/clothing/mask/breath(src) + + if ("nothing") + // doot + + // teehee + if ("delete") + del(src) + + //If you want to re-add fire, just add "fire" = 15 to the pick list. + /*if ("fire") + new /obj/structure/closet/firecloset(src.loc) + del(src)*/ /obj/structure/closet/emcloset/legacy/New() new /obj/item/weapon/tank/oxygen(src) diff --git a/code/game/objects/closets/extinguisher.dm b/code/game/objects/closets/extinguisher.dm index 82dc7d88aa..3c801fdf59 100644 --- a/code/game/objects/closets/extinguisher.dm +++ b/code/game/objects/closets/extinguisher.dm @@ -1,7 +1,7 @@ /obj/structure/extinguisher_cabinet name = "extinguisher cabinet" desc = "A small wall mounted cabinet designed to hold a fire extinguisher." - icon = 'closet.dmi' + icon = 'icons/obj/closet.dmi' icon_state = "extinguisher_closed" anchored = 1 density = 0 @@ -29,7 +29,7 @@ /obj/structure/extinguisher_cabinet/attack_hand(mob/user as mob) if(has_extinguisher) - user.put_in_hand(has_extinguisher) + user.put_in_hands(has_extinguisher) has_extinguisher = null user << "\blue You take the extinguisher from the [name]." opened = 1 diff --git a/code/game/objects/closets/fireaxe.dm b/code/game/objects/closets/fireaxe.dm index 6847bf14ef..b193e520a5 100644 --- a/code/game/objects/closets/fireaxe.dm +++ b/code/game/objects/closets/fireaxe.dm @@ -24,7 +24,7 @@ if (isrobot(usr) || src.locked) if(istype(O, /obj/item/device/multitool)) user << "\red Resetting circuitry..." - playsound(user, 'lockreset.ogg', 50, 1) + playsound(user, 'sound/machines/lockreset.ogg', 50, 1) sleep(50) // Sleeping time~ src.locked = 0 user << "\blue You disable the locking modules." @@ -39,13 +39,13 @@ spawn(10) update_icon() return else - playsound(user, 'Glasshit.ogg', 100, 1) //We don't want this playing every time + playsound(user, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time if(W.force < 15) user << "\blue The cabinet's protective glass glances off the hit." else src.hitstaken++ if(src.hitstaken == 4) - playsound(user, 'Glassbr3.ogg', 100, 1) //Break cabinet, receive goodies. Cabinet's fucked for life after that. + playsound(user, 'sound/effects/Glassbr3.ogg', 100, 1) //Break cabinet, receive goodies. Cabinet's fucked for life after that. src.smashed = 1 src.locked = 0 src.localopened = 1 @@ -86,7 +86,7 @@ sleep(50) src.locked = 1 user << "\blue You re-enable the locking modules." - playsound(user, 'lockenable.ogg', 50, 1) + playsound(user, 'sound/machines/lockenable.ogg', 50, 1) return else localopened = !localopened @@ -111,7 +111,7 @@ return if(localopened) if(fireaxe) - user.put_in_hand(fireaxe) + user.put_in_hands(fireaxe) fireaxe = null user << "\blue You take the fire axe from the [name]." src.add_fingerprint(user) @@ -160,7 +160,7 @@ if (localopened) if(fireaxe) - usr.put_in_hand(fireaxe) + usr.put_in_hands(fireaxe) fireaxe = null usr << "\blue You take the Fire axe from the [name]." else diff --git a/code/game/objects/closets/firecloset.dm b/code/game/objects/closets/firecloset.dm index 245991be54..42b494f0c0 100644 --- a/code/game/objects/closets/firecloset.dm +++ b/code/game/objects/closets/firecloset.dm @@ -8,7 +8,7 @@ new /obj/item/device/flashlight(src) new /obj/item/weapon/tank/oxygen/red(src) new /obj/item/weapon/extinguisher(src) - new /obj/item/clothing/head/helmet/space/fire_helmet(src) + new /obj/item/clothing/head/hardhat/red(src) /obj/structure/closet/firecloset/New() ..() @@ -17,7 +17,7 @@ new /obj/item/clothing/mask/gas(src) new /obj/item/weapon/tank/oxygen/red(src) new /obj/item/weapon/extinguisher(src) - new /obj/item/clothing/head/helmet/space/fire_helmet(src) + new /obj/item/clothing/head/hardhat/red(src) /*switch (pickweight(list("nothing" = 5, "bare-bones" = 35, "basic" = 40, "pickpocketed" = 10, "untouched" = 10))) if ("nothing") @@ -70,4 +70,9 @@ if(prob(5)) new /obj/item/clothing/gloves/yellow(src) if(prob(40)) - new /obj/item/clothing/head/helmet/hardhat(src) \ No newline at end of file + new /obj/item/clothing/head/hardhat(src) + +/obj/structure/closet/radiation/New() + ..() + new /obj/item/clothing/suit/radiation(src) + new /obj/item/clothing/head/radiation(src) \ No newline at end of file diff --git a/code/game/objects/closets/fitnesscloset.dm b/code/game/objects/closets/fitnesscloset.dm index 64d90b266a..08c7393492 100644 --- a/code/game/objects/closets/fitnesscloset.dm +++ b/code/game/objects/closets/fitnesscloset.dm @@ -25,15 +25,15 @@ /obj/structure/closet/lasertag/red/New() ..() sleep(2) - new /obj/item/clothing/suit/redtag(src) - new /obj/item/clothing/suit/redtag(src) new /obj/item/weapon/gun/energy/laser/redtag(src) new /obj/item/weapon/gun/energy/laser/redtag(src) + new /obj/item/clothing/suit/redtag(src) + new /obj/item/clothing/suit/redtag(src) /obj/structure/closet/lasertag/blue/New() ..() sleep(2) - new /obj/item/clothing/suit/bluetag(src) - new /obj/item/clothing/suit/bluetag(src) new /obj/item/weapon/gun/energy/laser/bluetag(src) - new /obj/item/weapon/gun/energy/laser/bluetag(src) \ No newline at end of file + new /obj/item/weapon/gun/energy/laser/bluetag(src) + new /obj/item/clothing/suit/bluetag(src) + new /obj/item/clothing/suit/bluetag(src) \ No newline at end of file diff --git a/code/game/objects/closets/gmcloset.dm b/code/game/objects/closets/gmcloset.dm index a4f286ba91..3f3aadd70b 100644 --- a/code/game/objects/closets/gmcloset.dm +++ b/code/game/objects/closets/gmcloset.dm @@ -7,7 +7,7 @@ new /obj/item/clothing/under/sl_suit(src) new /obj/item/clothing/under/rank/bartender(src) new /obj/item/clothing/under/rank/bartender(src) - new /obj/item/clothing/suit/storage/wcoat(src) - new /obj/item/clothing/suit/storage/wcoat(src) + new /obj/item/clothing/suit/wcoat(src) + new /obj/item/clothing/suit/wcoat(src) new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) diff --git a/code/game/objects/closets/janitor.dm b/code/game/objects/closets/janitor.dm index f48617b219..fcc9c93999 100644 --- a/code/game/objects/closets/janitor.dm +++ b/code/game/objects/closets/janitor.dm @@ -1,6 +1,7 @@ /obj/structure/closet/jcloset/New() ..() sleep(2) + new /obj/item/clothing/under/rank/janitor(src) new /obj/item/weapon/cartridge/janitor(src) new /obj/item/device/flashlight(src) new /obj/item/clothing/shoes/galoshes(src) @@ -10,15 +11,6 @@ new /obj/item/weapon/caution(src) new /obj/item/weapon/caution(src) new /obj/item/weapon/caution(src) - -/obj/structure/closet/jcloset2/New() - ..() - sleep(2) - new /obj/item/weapon/chem_grenade/cleaner(src) - new /obj/item/weapon/chem_grenade/cleaner(src) - new /obj/item/weapon/chem_grenade/cleaner(src) - new /obj/item/weapon/cleaner(src) - new /obj/item/weapon/cleaner(src) - new /obj/item/weapon/cleaner(src) new /obj/item/weapon/trashbag(src) - new /obj/item/device/portalathe(src) + new /obj/item/device/lightreplacer(src) + new /obj/item/clothing/head/soft/purple(src) \ No newline at end of file diff --git a/code/game/objects/closets/kitchen.dm b/code/game/objects/closets/kitchen.dm index 5552f5da01..1e8e3207b1 100644 --- a/code/game/objects/closets/kitchen.dm +++ b/code/game/objects/closets/kitchen.dm @@ -1,81 +1,103 @@ -/obj/structure/closet/secure_closet/kitchen/New() - ..() - sleep(2) - /*new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/under/rank/chef(src) - new /obj/item/clothing/under/rank/chef(src)*/ - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/snacks/flour(src) - new /obj/item/weapon/reagent_containers/food/condiment/sugar(src) - /*new /obj/item/weapon/tray(src) - new /obj/item/weapon/tray(src) - new /obj/item/weapon/tray(src) - new /obj/item/weapon/tray(src) - new /obj/item/weapon/tray(src) - new /obj/item/weapon/tray(src) - new /obj/item/weapon/kitchenknife(src)*/ - /*new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/under/rank/chef(src) - new /obj/item/clothing/under/rank/chef(src) - new /obj/item/weapon/kitchen/utensil/fork(src) - new /obj/item/weapon/kitchen/utensil/knife(src) - new /obj/item/weapon/kitchen/utensil/spoon(src) - new /obj/item/weapon/kitchen/rollingpin(src)*/ +/obj/structure/closet/secure_closet/freezer + +/obj/structure/closet/secure_closet/freezer/update_icon() + if(broken) + icon_state = icon_broken + else + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + else + icon_state = icon_opened + +/obj/structure/closet/secure_closet/freezer/kitchen + name = "Kitchen Cabinet" + req_access = list(access_kitchen) + + New() + ..() + sleep(2) + for(var/i = 0, i < 16, i++) + new /obj/item/weapon/reagent_containers/food/snacks/flour(src) + new /obj/item/weapon/reagent_containers/food/condiment/sugar(src) + return + + +/obj/structure/closet/secure_closet/freezer/kitchen/mining + req_access = list() + + + +/obj/structure/closet/secure_closet/freezer/meat + name = "Meat Fridge" + icon_state = "fridge1" + icon_closed = "fridge" + icon_locked = "fridge1" + icon_opened = "fridgeopen" + icon_broken = "fridgebroken" + icon_off = "fridge1" + + + New() + ..() + sleep(2) + for(var/i = 0, i < 4, i++) + new /obj/item/weapon/reagent_containers/food/snacks/meat/monkey(src) + return + + + +/obj/structure/closet/secure_closet/freezer/fridge + name = "Refrigerator" + icon_state = "fridge1" + icon_closed = "fridge" + icon_locked = "fridge1" + icon_opened = "fridgeopen" + icon_broken = "fridgebroken" + icon_off = "fridge1" + + + New() + ..() + sleep(2) + for(var/i = 0, i < 5, i++) + new /obj/item/weapon/reagent_containers/food/drinks/milk(src) + for(var/i = 0, i < 5, i++) + new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src) + for(var/i = 0, i < 2, i++) + new /obj/item/weapon/storage/fancy/egg_box(src) + return + + + +/obj/structure/closet/secure_closet/freezer/money + name = "Freezer" + icon_state = "fridge1" + icon_closed = "fridge" + icon_locked = "fridge1" + icon_opened = "fridgeopen" + icon_broken = "fridgebroken" + icon_off = "fridge1" + req_access = list(access_heads_vault) + + + New() + ..() + sleep(2) + for(var/i = 0, i < 3, i++) + new /obj/item/weapon/spacecash/c1000(src) + for(var/i = 0, i < 5, i++) + new /obj/item/weapon/spacecash/c500(src) + for(var/i = 0, i < 6, i++) + new /obj/item/weapon/spacecash/c200(src) + return + + + + -/obj/structure/closet/secure_closet/meat/New() - ..() - sleep(2) - new /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/monkey(src) - new /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/monkey(src) - new /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/monkey(src) - new /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/monkey(src) -/obj/structure/closet/secure_closet/fridge/New() - ..() - sleep(2) - new /obj/item/weapon/reagent_containers/food/drinks/milk(src) - new /obj/item/weapon/reagent_containers/food/drinks/milk(src) - new /obj/item/weapon/reagent_containers/food/drinks/milk(src) - new /obj/item/weapon/reagent_containers/food/drinks/milk(src) - new /obj/item/weapon/reagent_containers/food/drinks/milk(src) - new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src) - new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src) - new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src) - new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src) - new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src) - new /obj/item/kitchen/egg_box(src) - new /obj/item/kitchen/egg_box(src) -/obj/structure/closet/secure_closet/money_freezer/New() - ..() - sleep(2) - new /obj/item/weapon/money/c1000(src) - new /obj/item/weapon/money/c1000(src) - new /obj/item/weapon/money/c1000(src) - new /obj/item/weapon/money/c500(src) - new /obj/item/weapon/money/c500(src) - new /obj/item/weapon/money/c500(src) - new /obj/item/weapon/money/c500(src) - new /obj/item/weapon/money/c500(src) - new /obj/item/weapon/money/c200(src) - new /obj/item/weapon/money/c200(src) - new /obj/item/weapon/money/c200(src) - new /obj/item/weapon/money/c200(src) - new /obj/item/weapon/money/c200(src) diff --git a/code/game/objects/closets/l3closet.dm b/code/game/objects/closets/l3closet.dm index 6333d06023..9cc2393c72 100644 --- a/code/game/objects/closets/l3closet.dm +++ b/code/game/objects/closets/l3closet.dm @@ -31,8 +31,6 @@ contents = list() new /obj/item/clothing/suit/bio_suit/janitor( src ) new /obj/item/clothing/head/bio_hood/janitor( src ) - new /obj/item/clothing/gloves/latex ( src ) - new /obj/item/clothing/mask/surgical( src ) /obj/structure/closet/l3closet/scientist/New() ..() diff --git a/code/game/objects/closets/nuclear.dm b/code/game/objects/closets/nuclear.dm index 82bdff4bab..ae1720bfbe 100644 --- a/code/game/objects/closets/nuclear.dm +++ b/code/game/objects/closets/nuclear.dm @@ -1,11 +1,11 @@ /obj/structure/closet/syndicate/nuclear/New() ..() sleep(2) - new /obj/item/ammo_magazine/a12mm(src) - new /obj/item/ammo_magazine/a12mm(src) - new /obj/item/ammo_magazine/a12mm(src) - new /obj/item/ammo_magazine/a12mm(src) - new /obj/item/ammo_magazine/a12mm(src) + new /obj/item/ammo_magazine/a50(src) + new /obj/item/ammo_magazine/a50(src) + new /obj/item/ammo_magazine/a50(src) + new /obj/item/ammo_magazine/a50(src) + new /obj/item/ammo_magazine/a50(src) new /obj/item/weapon/storage/handcuff_kit(src) new /obj/item/weapon/storage/flashbang_kit(src) new /obj/item/weapon/gun/energy/gun(src) @@ -13,12 +13,12 @@ new /obj/item/weapon/gun/energy/gun(src) new /obj/item/weapon/gun/energy/gun(src) new /obj/item/weapon/gun/energy/gun(src) - new /obj/item/weapon/pinpointer(src) - new /obj/item/weapon/pinpointer(src) - new /obj/item/weapon/pinpointer(src) - new /obj/item/weapon/pinpointer(src) - new /obj/item/weapon/pinpointer(src) + new /obj/item/weapon/pinpointer/nukeop(src) + new /obj/item/weapon/pinpointer/nukeop(src) + new /obj/item/weapon/pinpointer/nukeop(src) + new /obj/item/weapon/pinpointer/nukeop(src) + new /obj/item/weapon/pinpointer/nukeop(src) new /obj/item/device/pda/syndicate(src) - var/obj/item/device/uplink/radio/U = new /obj/item/device/uplink/radio(src) - U.uses = 40 + var/obj/item/device/radio/uplink/U = new(src) + U.hidden_uplink.uses = 40 return diff --git a/code/game/objects/closets/secure/bar.dm b/code/game/objects/closets/secure/bar.dm new file mode 100644 index 0000000000..b75222fcdc --- /dev/null +++ b/code/game/objects/closets/secure/bar.dm @@ -0,0 +1,37 @@ +/obj/structure/closet/secure_closet/bar + name = "Booze" + req_access = list(access_bar) + icon_state = "cabinetdetective_locked" + icon_closed = "cabinetdetective" + icon_locked = "cabinetdetective_locked" + icon_opened = "cabinetdetective_open" + icon_broken = "cabinetdetective_broken" + icon_off = "cabinetdetective_broken" + + + New() + ..() + sleep(2) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + new /obj/item/weapon/reagent_containers/food/drinks/beer( src ) + return + +/obj/structure/closet/secure_closet/bar/update_icon() + if(broken) + icon_state = icon_broken + else + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + else + icon_state = icon_opened \ No newline at end of file diff --git a/code/game/objects/closets/secure/cargo.dm b/code/game/objects/closets/secure/cargo.dm index 265ebeafeb..a374cb8ee5 100644 --- a/code/game/objects/closets/secure/cargo.dm +++ b/code/game/objects/closets/secure/cargo.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/cargotech name = "Cargo Technician's Locker" - req_access = list(ACCESS_CARGO) + req_access = list(access_cargo) icon_state = "securecargo1" icon_closed = "securecargo" icon_locked = "securecargo1" @@ -15,12 +15,13 @@ new /obj/item/clothing/shoes/black(src) new /obj/item/device/radio/headset/headset_cargo(src) new /obj/item/clothing/gloves/black(src) + new /obj/item/clothing/head/soft(src) // new /obj/item/weapon/cartridge/quartermaster(src) return -/obj/structure/closet/secure_closet/qm_personal +/obj/structure/closet/secure_closet/quartermaster name = "Quartermaster's Locker" - req_access = list(ACCESS_QM) + req_access = list(access_qm) icon_state = "secureqm1" icon_closed = "secureqm" icon_locked = "secureqm1" @@ -31,41 +32,14 @@ New() ..() sleep(2) - new /obj/item/wardrobe/qm(src) - // - var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/weapon/clipboard(src) - new /obj/item/device/pda/quartermaster(src) - new /obj/item/clothing/glasses/sunglasses(src) + new /obj/item/clothing/under/rank/cargo(src) + new /obj/item/clothing/shoes/brown(src) new /obj/item/device/radio/headset/heads/qm(src) - -/obj/structure/closet/secure_closet/cargo_tech_personal - name = "Cargo Tech's Locker" - req_access = list(ACCESS_CARGO) - - New() - ..() - sleep(2) - new /obj/item/wardrobe/cargo_tech(src) - // - var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/quartermaster(src) - new /obj/item/device/radio/headset/headset_cargo(src) - -/obj/structure/closet/secure_closet/miner_personal - name = "Miner's Locker" - req_access = list(ACCESS_MINING) - - New() - ..() - sleep(2) - new /obj/item/wardrobe/cargo_tech(src) - // - var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/radio/headset/headset_mine(src) \ No newline at end of file + new /obj/item/clothing/gloves/black(src) +// new /obj/item/weapon/cartridge/quartermaster(src) + new /obj/item/clothing/suit/fire/firefighter(src) + new /obj/item/weapon/tank/emergency_oxygen(src) + new /obj/item/clothing/mask/gas(src) + new /obj/item/clothing/glasses/meson(src) + new /obj/item/clothing/head/soft(src) + return \ No newline at end of file diff --git a/code/game/objects/closets/secure/engineering.dm b/code/game/objects/closets/secure/engineering.dm index 5eb44000c7..da0115b094 100644 --- a/code/game/objects/closets/secure/engineering.dm +++ b/code/game/objects/closets/secure/engineering.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/engineering_chief name = "Chief Engineer's Locker" - req_access = list(ACCESS_CE) + req_access = list(access_ce) icon_state = "securece1" icon_closed = "securece" icon_locked = "securece1" @@ -12,34 +12,30 @@ New() ..() sleep(2) - var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/wardrobe/chief_engineer(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/industrial(src) + else + new /obj/item/weapon/storage/backpack/satchel_eng(src) new /obj/item/blueprints(src) new /obj/item/clothing/under/rank/chief_engineer(src) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/heads/ce(src) - new /obj/item/clothing/head/helmet/hardhat/white(src) - new /obj/item/clothing/head/helmet/welding(src) + new /obj/item/clothing/head/hardhat/white(src) + new /obj/item/clothing/head/welding(src) new /obj/item/clothing/gloves/yellow(src) new /obj/item/clothing/shoes/brown(src) new /obj/item/weapon/cartridge/ce(src) - new /obj/item/weapon/storage/belt/utility/full(src) new /obj/item/device/radio/headset/heads/ce(src) new /obj/item/weapon/storage/toolbox/mechanical(src) new /obj/item/clothing/suit/hazardvest(src) new /obj/item/clothing/mask/gas(src) new /obj/item/device/multitool(src) new /obj/item/device/flash(src) - new /obj/item/clothing/glasses/meson(src) - new /obj/item/taperoll/engineering(src) return /obj/structure/closet/secure_closet/engineering_electrical name = "Electrical Supplies" - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) icon_state = "secureengelec1" icon_closed = "secureengelec" icon_locked = "secureengelec1" @@ -68,7 +64,7 @@ /obj/structure/closet/secure_closet/engineering_welding name = "Welding Supplies" - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) icon_state = "secureengweld1" icon_closed = "secureengweld" icon_locked = "secureengweld1" @@ -80,22 +76,19 @@ New() ..() sleep(2) - new /obj/item/clothing/head/helmet/welding(src) - new /obj/item/clothing/head/helmet/welding(src) - new /obj/item/clothing/head/helmet/welding(src) + new /obj/item/clothing/head/welding(src) + new /obj/item/clothing/head/welding(src) + new /obj/item/clothing/head/welding(src) new /obj/item/weapon/weldingtool/largetank(src) new /obj/item/weapon/weldingtool/largetank(src) new /obj/item/weapon/weldingtool/largetank(src) - new /obj/item/weapon/weldpack(src) - new /obj/item/weapon/weldpack(src) - new /obj/item/weapon/weldpack(src) return /obj/structure/closet/secure_closet/engineering_personal name = "Engineer's Locker" - req_access = list(ACCESS_ENGINE) + req_access = list(access_engine) icon_state = "secureeng1" icon_closed = "secureeng" icon_locked = "secureeng1" @@ -107,52 +100,16 @@ New() ..() sleep(2) - new /obj/item/wardrobe/engineer(src) - // - var/obj/item/weapon/storage/backpack/industrial/BPK = new /obj/item/weapon/storage/backpack/industrial(src) - var/obj/item/weapon/storage/box/B = new(BPK) + if(prob(50)) + new /obj/item/weapon/storage/backpack/industrial(src) + else + new /obj/item/weapon/storage/backpack/satchel_eng(src) new /obj/item/clothing/under/rank/engineer(src) new /obj/item/clothing/shoes/orange(src) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/engineering(src) - new /obj/item/device/t_scanner(src) - new /obj/item/weapon/storage/belt/utility/full(src) new /obj/item/weapon/storage/toolbox/mechanical(src) // new /obj/item/weapon/cartridge/engineering(src) new /obj/item/device/radio/headset/headset_eng(src) new /obj/item/clothing/suit/hazardvest(src) new /obj/item/clothing/mask/gas(src) - new /obj/item/clothing/head/helmet/hardhat(src) new /obj/item/clothing/glasses/meson(src) - return - -/obj/structure/closet/secure_closet/atmos_personal - name = "Atmospheric Technician's Locker" - req_access = list(ACCESS_ATMOSPHERICS) - - New() - ..() - sleep(2) - new /obj/item/wardrobe/atmos(src) - // - var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/engineering(src) - new /obj/item/weapon/storage/toolbox/mechanical(src) - new /obj/item/device/radio/headset/headset_eng(src) - -/obj/structure/closet/secure_closet/roboticist_personal - name = "Roboticist's Locker" - req_access = list(ACCESS_ROBOTICS) - - New() - ..() - sleep(2) - new /obj/item/wardrobe/roboticist(src) - var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/engineering(src) - new /obj/item/weapon/storage/toolbox/mechanical(src) - new /obj/item/device/radio/headset/headset_eng(src) + return \ No newline at end of file diff --git a/code/game/objects/closets/secure/hydroponics.dm b/code/game/objects/closets/secure/hydroponics.dm index d15e63b180..f96c0bdce3 100644 --- a/code/game/objects/closets/secure/hydroponics.dm +++ b/code/game/objects/closets/secure/hydroponics.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/hydroponics name = "Botanist's locker" - req_access = list(ACCESS_HYDROPONICS) + req_access = list(access_hydroponics) icon_state = "hydrosecure1" icon_closed = "hydrosecure" icon_locked = "hydrosecure1" @@ -12,12 +12,15 @@ New() ..() sleep(2) + switch(rand(1,2)) + if(1) + new /obj/item/clothing/suit/apron(src) + if(2) + new /obj/item/clothing/suit/apron/overalls(src) new /obj/item/weapon/plantbag(src) new /obj/item/clothing/under/rank/hydroponics(src) - new /obj/item/clothing/suit/storage/apron(src) - new /obj/item/clothing/under/rank/hydroponics(src) new /obj/item/device/analyzer/plant_analyzer(src) - new /obj/item/clothing/head/helmet/greenbandana(src) + new /obj/item/clothing/head/greenbandana(src) new /obj/item/weapon/minihoe(src) new /obj/item/weapon/hatchet(src) return \ No newline at end of file diff --git a/code/game/objects/closets/secure/medical.dm b/code/game/objects/closets/secure/medical.dm index 7abfd70df6..5e9925db55 100644 --- a/code/game/objects/closets/secure/medical.dm +++ b/code/game/objects/closets/secure/medical.dm @@ -1,4 +1,4 @@ -/obj/structure/closet/secure_closet/medicine +/obj/structure/closet/secure_closet/medical1 name = "Medicine Closet" desc = "Filled with medical junk." icon_state = "medical1" @@ -7,7 +7,7 @@ icon_opened = "medicalopen" icon_broken = "medicalbroken" icon_off = "medicaloff" - req_access = list(ACCESS_MEDICAL) + req_access = list(access_medical) New() @@ -18,15 +18,15 @@ new /obj/item/weapon/reagent_containers/dropper(src) new /obj/item/weapon/reagent_containers/glass/beaker(src) new /obj/item/weapon/reagent_containers/glass/beaker(src) - new /obj/item/weapon/reagent_containers/glass/bottle/antitoxin(src) - new /obj/item/weapon/reagent_containers/glass/bottle/antitoxin(src) new /obj/item/weapon/reagent_containers/glass/bottle/inaprovaline(src) new /obj/item/weapon/reagent_containers/glass/bottle/inaprovaline(src) + new /obj/item/weapon/reagent_containers/glass/bottle/antitoxin(src) + new /obj/item/weapon/reagent_containers/glass/bottle/antitoxin(src) return -/obj/structure/closet/secure_closet/anaesthetic +/obj/structure/closet/secure_closet/medical2 name = "Anesthetic" desc = "Used to knock people out." icon_state = "medical1" @@ -35,7 +35,7 @@ icon_opened = "medicalopen" icon_broken = "medicalbroken" icon_off = "medicaloff" - req_access = list(ACCESS_MEDICAL) + req_access = list(access_surgery) New() @@ -51,9 +51,9 @@ -/obj/structure/closet/secure_closet/doctor_personal +/obj/structure/closet/secure_closet/medical3 name = "Medical Doctor's Locker" - req_access = list(ACCESS_MEDICAL) + req_access = list(access_surgery) icon_state = "securemed1" icon_closed = "securemed" icon_locked = "securemed1" @@ -64,14 +64,12 @@ New() ..() sleep(2) - new /obj/item/wardrobe/doctor(src) - // - var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/medical(src) - new /obj/item/weapon/storage/firstaid/adv(src) - new /obj/item/device/flashlight/pen(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/medic(src) + else + new /obj/item/weapon/storage/backpack/satchel_med(src) + new /obj/item/clothing/under/rank/nursesuit (src) + new /obj/item/clothing/head/nursehat (src) switch(pick("blue", "green", "purple")) if ("blue") new /obj/item/clothing/under/rank/medical/blue(src) @@ -86,62 +84,19 @@ new /obj/item/clothing/under/rank/medical/green(src) if ("purple") new /obj/item/clothing/under/rank/medical/purple(src) + new /obj/item/clothing/under/rank/medical(src) + new /obj/item/clothing/suit/labcoat(src) + new /obj/item/clothing/shoes/white(src) // new /obj/item/weapon/cartridge/medical(src) new /obj/item/device/radio/headset/headset_med(src) + new /obj/item/weapon/storage/belt/medical(src) return -/obj/structure/closet/secure_closet/chemist_personal - name = "Chemist's Locker" - req_access = list(ACCESS_CHEMISTRY) - New() - ..() - sleep(2) - new /obj/item/wardrobe/chemist(src) - // - var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/radio/headset/headset_medsci(src) - new /obj/item/device/pda/toxins(src) - return - -/obj/structure/closet/secure_closet/genetics_personal - name = "Geneticist's Locker" - req_access = list(ACCESS_GENETICS) - - New() - ..() - sleep(2) - new /obj/item/wardrobe/geneticist(src) - // - var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/medical(src) - new /obj/item/device/flashlight/pen(src) - new /obj/item/device/radio/headset/headset_medsci(src) - -/obj/structure/closet/secure_closet/viro_personal - name = "Virologist's Locker" - req_access = list(ACCESS_VIROLOGY) - - New() - ..() - sleep(2) - new /obj/item/wardrobe/virologist(src) - // - var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/flashlight/pen(src) - new /obj/item/device/pda/medical(src) - new /obj/item/clothing/mask/surgical(src) - new /obj/item/device/radio/headset/headset_med(src) /obj/structure/closet/secure_closet/CMO name = "Chief Medical Officer's Locker" - req_access = list(ACCESS_CMO) + req_access = list(access_cmo) icon_state = "cmosecure1" icon_closed = "cmosecure" icon_locked = "cmosecure1" @@ -152,15 +107,17 @@ New() ..() sleep(2) - new /obj/item/wardrobe/cmo(src) - // - var/obj/item/weapon/storage/backpack/medic/BPK = new /obj/item/weapon/storage/backpack/medic(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/heads/cmo(src) - new /obj/item/weapon/storage/firstaid/adv(src) - new /obj/item/device/flashlight/pen(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/medic(src) + else + new /obj/item/weapon/storage/backpack/satchel_med(src) + new /obj/item/clothing/suit/bio_suit/cmo(src) + new /obj/item/clothing/head/bio_hood/cmo(src) + new /obj/item/clothing/under/rank/chief_medical_officer(src) + new /obj/item/clothing/suit/labcoat/cmo(src) new /obj/item/weapon/cartridge/cmo(src) + new /obj/item/clothing/gloves/latex(src) + new /obj/item/clothing/shoes/brown (src) new /obj/item/device/radio/headset/heads/cmo(src) new /obj/item/weapon/storage/belt/medical(src) new /obj/item/device/flash(src) @@ -170,7 +127,7 @@ /obj/structure/closet/secure_closet/animal name = "Animal Control" - req_access = list(ACCESS_MEDICAL) + req_access = list(access_surgery) New() @@ -193,7 +150,7 @@ icon_opened = "medicalopen" icon_broken = "medicalbroken" icon_off = "medicaloff" - req_access = list(ACCESS_MEDICAL) + req_access = list(access_chemistry) New() diff --git a/code/game/objects/closets/secure/personal.dm b/code/game/objects/closets/secure/personal.dm index 9232e561ed..28b220918e 100644 --- a/code/game/objects/closets/secure/personal.dm +++ b/code/game/objects/closets/secure/personal.dm @@ -1,22 +1,20 @@ /obj/structure/closet/secure_closet/personal/var/registered_name = null -/obj/structure/closet/secure_closet/personal/req_access = list(ACCESS_ALL_PERSONAL_LOCKERS) +/obj/structure/closet/secure_closet/personal/req_access = list(access_all_personal_lockers) /obj/structure/closet/secure_closet/personal/New() ..() spawn(2) - new /obj/item/device/assembly/signaler(src) - new /obj/item/wardrobe/assistant(src) - - var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src) - var/obj/item/weapon/storage/box/newbox = new(BPK) - new /obj/item/weapon/pen(newbox) + if(prob(50)) + new /obj/item/weapon/storage/backpack(src) + else + new /obj/item/weapon/storage/backpack/satchel_norm(src) + new /obj/item/device/radio/headset( src ) return /obj/structure/closet/secure_closet/personal/patient/New() ..() - contents = list() spawn(4) - new /obj/item/clothing/suit/patientgown( src ) + contents = list() new /obj/item/clothing/under/color/white( src ) new /obj/item/clothing/shoes/white( src ) return @@ -51,16 +49,9 @@ if(!src.registered_name) src.registered_name = I.registered_name src.desc = "Owned by [I.registered_name]." - src.name = "Personal Closet - [I.registered_name]" else user << "\red Access Denied" else if( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken) - if(istype(W, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return broken = 1 locked = 0 desc = "It appears to be broken." @@ -69,7 +60,7 @@ var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src.loc) spark_system.start() - playsound(src.loc, 'blade1.ogg', 50, 1) + playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1) playsound(src.loc, "sparks", 50, 1) for(var/mob/O in viewers(user, 3)) O.show_message("\blue The locker has been sliced open by [user] with an energy blade!", 1, "\red You hear metal being sliced and sparks flying.", 2) diff --git a/code/game/objects/closets/secure/scientist.dm b/code/game/objects/closets/secure/scientist.dm index 98295e2527..53be376961 100644 --- a/code/game/objects/closets/secure/scientist.dm +++ b/code/game/objects/closets/secure/scientist.dm @@ -1,6 +1,30 @@ +/obj/structure/closet/secure_closet/scientist + name = "Scientist's Locker" + req_access = list(access_tox_storage) + icon_state = "secureres1" + icon_closed = "secureres" + icon_locked = "secureres1" + icon_opened = "secureresopen" + icon_broken = "secureresbroken" + icon_off = "secureresoff" + + New() + ..() + sleep(2) + new /obj/item/clothing/under/rank/scientist(src) + new /obj/item/clothing/suit/labcoat(src) + new /obj/item/clothing/shoes/white(src) +// new /obj/item/weapon/cartridge/signal/toxins(src) + new /obj/item/device/radio/headset/headset_sci(src) + new /obj/item/weapon/tank/air(src) + new /obj/item/clothing/mask/gas(src) + return + + + /obj/structure/closet/secure_closet/RD name = "Research Director's Locker" - req_access = list(ACCESS_RD) + req_access = list(access_rd) icon_state = "rdsecure1" icon_closed = "rdsecure" icon_locked = "rdsecure1" @@ -11,14 +35,15 @@ New() ..() sleep(2) - new /obj/item/wardrobe/rd(src) - new /obj/item/wardrobe/rd(src) - return - -//cpy -/* - new /obj/item/wardrobe/scientist(src) - new /obj/item/wardrobe/scientist(src) - new /obj/item/wardrobe/scientist(src) - new /obj/item/wardrobe/scientist(src) - */ \ No newline at end of file + new /obj/item/clothing/suit/bio_suit/scientist(src) + new /obj/item/clothing/head/bio_hood/scientist(src) + new /obj/item/clothing/under/rank/research_director(src) + new /obj/item/clothing/suit/labcoat(src) + new /obj/item/weapon/cartridge/rd(src) + new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/gloves/latex(src) + new /obj/item/device/radio/headset/heads/rd(src) + new /obj/item/weapon/tank/air(src) + new /obj/item/clothing/mask/gas(src) + new /obj/item/device/flash(src) + return \ No newline at end of file diff --git a/code/game/objects/closets/secure/secure_closets.dm b/code/game/objects/closets/secure/secure_closets.dm index 59aa01299d..efe451b660 100644 --- a/code/game/objects/closets/secure/secure_closets.dm +++ b/code/game/objects/closets/secure/secure_closets.dm @@ -29,34 +29,28 @@ src.locked = !src.locked for(var/mob/O in viewers(user, 3)) if((O.client && !( O.blinded ))) - O << "\blue The locker has been [src.locked ? null : "un"]locked by [user]." + O << "The locker has been [locked ? null : "un"]locked by [user]." if(src.locked) src.icon_state = src.icon_locked else src.icon_state = src.icon_closed else - user << "\red Access Denied" + user << "Access Denied" -/obj/structure/closet/secure_closet/attackby(obj/item/W as obj, mob/user as mob) +/obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob) if(src.opened) if(istype(W, /obj/item/weapon/grab)) if(src.large) src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet else - user << "The locker is too small to stuff [W] into!" + user << "The locker is too small to stuff [W] into!" user.drop_item() if(W) W.loc = src.loc else if(src.broken) - user << "\red It appears to be broken." + user << "The locker appears to be broken." return else if((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken) - if(istype(W, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return broken = 1 locked = 0 desc = "It appears to be broken." @@ -66,39 +60,30 @@ var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src.loc) spark_system.start() - playsound(src.loc, 'blade1.ogg', 50, 1) + playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1) playsound(src.loc, "sparks", 50, 1) for(var/mob/O in viewers(user, 3)) - O.show_message("\blue The locker has been sliced open by [user] with an energy blade!", 1, "\red You hear metal being sliced and sparks flying.", 2) + O.show_message("The locker has been sliced open by [user] with an energy blade!", 1, "You hear metal being sliced and sparks flying.", 2) else for(var/mob/O in viewers(user, 3)) - O.show_message("\blue The locker has been broken by [user] with an electromagnetic card!", 1, "You hear a faint electrical spark.", 2) - else if(src.allowed(user)) - src.locked = !src.locked - for(var/mob/O in viewers(user, 3)) - if((O.client && !( O.blinded ))) - O << "\blue The locker has been [src.locked ? null : "un"]locked by [user]." - if(src.locked) - src.icon_state = src.icon_locked - else - src.icon_state = src.icon_closed - - else if(istype(W, /obj/item/device/hacktool)) - spawn(0) - user << "Standby, jacking into the security systems..." - if(do_after(user, 20)) - user << "Wiping access requirements..." - else - user << "You need to stay still!" - if(do_after(user, 20)) - user << "Access requirements are wiped! Anyone can access the locker, now!" - req_access = list() - else - user << "You need to stay still!" + O.show_message("The locker has been broken by [user] with an electromagnetic card!", 1, "You hear a faint electrical spark.", 2) else - togglelock(user) + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(!WT.remove_fuel(0,user)) + user << "You need more welding fuel to complete this task." + return + src.welded =! src.welded + src.update_icon() + for(var/mob/M in viewers(src)) + M.show_message("[src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "You hear welding.", 2) + else + togglelock(user) /obj/structure/closet/secure_closet/relaymove(mob/user as mob) + if(user.stat) + return + if(user.stat) return if(!(src.locked)) @@ -112,11 +97,11 @@ src.icon_state = src.icon_opened src.opened = 1 else - user << "\blue It's welded shut!" + user << "The locker is locked!" if(world.time > lastbang+5) lastbang = world.time for(var/mob/M in hearers(src, null)) - M << text("BANG, bang!", max(0, 5 - get_dist(src, M))) + M << "BANG, bang!" return /obj/structure/closet/secure_closet/attack_hand(mob/user as mob) @@ -129,15 +114,33 @@ return src.attack_hand(user) /obj/structure/closet/secure_closet/verb/verb_togglelock() - set src in oview(1) // Can only use it from one square distance + set src in oview(1) // One square distance set category = "Object" set name = "Toggle Lock" if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return + if(get_dist(usr, src) != 1) + return + + if(src.broken) + return + if (ishuman(usr)) if (!opened) togglelock(usr) else - usr << "\red This mob type can't use this verb." \ No newline at end of file + usr << "This mob type can't use this verb." + +/obj/structure/closet/secure_closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot) + overlays = null + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + if(welded) + overlays += "welded" + else + icon_state = icon_opened \ No newline at end of file diff --git a/code/game/objects/closets/secure/security.dm b/code/game/objects/closets/secure/security.dm index aefe950a4c..193dfa5abb 100644 --- a/code/game/objects/closets/secure/security.dm +++ b/code/game/objects/closets/secure/security.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/captains name = "Captain's Locker" - req_access = list(ACCESS_CAPTAIN) + req_access = list(access_captain) icon_state = "capsecure1" icon_closed = "capsecure" icon_locked = "capsecure1" @@ -11,17 +11,20 @@ New() ..() sleep(2) - new /obj/item/wardrobe/captain(src) - // - new /obj/item/device/pda/captain(src) - new /obj/item/weapon/storage/id_kit(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/captain(src) + else + new /obj/item/weapon/storage/backpack/satchel_cap(src) + new /obj/item/clothing/suit/captunic(src) new /obj/item/clothing/head/helmet/cap(src) - new /obj/item/clothing/glasses/sunglasses(src) + new /obj/item/clothing/under/rank/captain(src) new /obj/item/clothing/suit/armor/vest(src) new /obj/item/weapon/cartridge/captain(src) new /obj/item/clothing/head/helmet/swat(src) + new /obj/item/clothing/shoes/brown(src) new /obj/item/device/radio/headset/heads/captain(src) new /obj/item/weapon/reagent_containers/food/drinks/flask(src) + new /obj/item/clothing/gloves/captain(src) new /obj/item/weapon/gun/energy/gun(src) return @@ -29,7 +32,7 @@ /obj/structure/closet/secure_closet/hop name = "Head of Personnel's Locker" - req_access = list(ACCESS_HOP) + req_access = list(access_hop) icon_state = "hopsecure1" icon_closed = "hopsecure" icon_locked = "hopsecure1" @@ -40,19 +43,16 @@ New() ..() sleep(2) - new /obj/item/wardrobe/hop(src) - // - var/obj/item/weapon/storage/backpack/BPK = new /obj/item/weapon/storage/backpack(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/pda/heads/hop(src) - new /obj/item/weapon/cartridge/hop(src) - new /obj/item/device/radio/headset/heads/hop(src) - new /obj/item/weapon/storage/id_kit(src) - new /obj/item/weapon/gun/energy/gun(src) - new /obj/item/device/flash(src) + new /obj/item/clothing/under/rank/head_of_personnel(src) new /obj/item/clothing/suit/armor/vest(src) new /obj/item/clothing/head/helmet(src) + new /obj/item/weapon/cartridge/hop(src) + new /obj/item/device/radio/headset/heads/hop(src) + new /obj/item/clothing/shoes/brown(src) + new /obj/item/weapon/storage/id_kit(src) + new /obj/item/weapon/storage/id_kit( src ) + new /obj/item/weapon/gun/energy/gun(src) + new /obj/item/device/flash(src) new /obj/item/clothing/glasses/sunglasses(src) return @@ -60,7 +60,7 @@ /obj/structure/closet/secure_closet/hos name = "Head of Security's Locker" - req_access = list(ACCESS_HOS) + req_access = list(access_hos) icon_state = "hossecure1" icon_closed = "hossecure" icon_locked = "hossecure1" @@ -71,24 +71,31 @@ New() ..() sleep(2) - new /obj/item/wardrobe/hos(src) - // - var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/flash(B) - new /obj/item/device/pda/heads/hos(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/security(src) + else + new /obj/item/weapon/storage/backpack/satchel_sec(src) + new /obj/item/clothing/suit/armor/vest(src) + new /obj/item/clothing/under/jensen(src) + new /obj/item/clothing/suit/armor/hos/jensen(src) + new /obj/item/clothing/head/helmet/HoS/dermal(src) new /obj/item/weapon/cartridge/hos(src) + new /obj/item/device/radio/headset/heads/hos(src) new /obj/item/clothing/glasses/sunglasses/sechud(src) - new /obj/item/weapon/storage/flashbang_kit(src) + new /obj/item/weapon/shield/riot(src) new /obj/item/weapon/storage/lockbox/loyalty(src) + new /obj/item/weapon/storage/flashbang_kit(src) + new /obj/item/weapon/storage/belt/security(src) + new /obj/item/device/flash(src) new /obj/item/weapon/melee/baton(src) new /obj/item/weapon/gun/energy/gun(src) return + + /obj/structure/closet/secure_closet/warden name = "Warden's Locker" - req_access = list(ACCESS_ARMORY) + req_access = list(access_armory) icon_state = "wardensecure1" icon_closed = "wardensecure" icon_locked = "wardensecure1" @@ -100,27 +107,29 @@ New() ..() sleep(2) - new /obj/item/wardrobe/warden(src) - // - var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/device/flash(B) - new /obj/item/device/pda/security(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/security(src) + else + new /obj/item/weapon/storage/backpack/satchel_sec(src) new /obj/item/clothing/suit/armor/vest(src) + new /obj/item/clothing/under/rank/warden(src) + new /obj/item/clothing/suit/armor/vest/warden(src) + new /obj/item/clothing/head/helmet/warden(src) // new /obj/item/weapon/cartridge/security(src) new /obj/item/device/radio/headset/headset_sec(src) + new /obj/item/clothing/glasses/sunglasses/sechud(src) new /obj/item/weapon/storage/flashbang_kit(src) + new /obj/item/weapon/storage/belt/security(src) + new /obj/item/weapon/reagent_containers/spray/pepper(src) new /obj/item/weapon/melee/baton(src) new /obj/item/weapon/gun/energy/taser(src) - new /obj/item/clothing/glasses/sunglasses/sechud(src) return /obj/structure/closet/secure_closet/security name = "Security Officer's Locker" - req_access = list(ACCESS_SECURITY) + req_access = list(access_security) icon_state = "sec1" icon_closed = "sec" icon_locked = "sec1" @@ -131,32 +140,28 @@ New() ..() sleep(2) - new /obj/item/wardrobe/officer(src) - new /obj/item/wardrobe/officer(src) - // - var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src) - var/obj/item/weapon/storage/box/B = new(BPK) - new /obj/item/weapon/pen(B) - new /obj/item/taperoll/police(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/security(src) + else + new /obj/item/weapon/storage/backpack/satchel_sec(src) new /obj/item/clothing/suit/armor/vest(src) - new /obj/item/clothing/suit/storage/gearharness(src) new /obj/item/clothing/head/helmet(src) // new /obj/item/weapon/cartridge/security(src) - new /obj/item/device/pda/security(src) new /obj/item/device/radio/headset/headset_sec(src) new /obj/item/weapon/storage/belt/security(src) new /obj/item/device/flash(src) - new /obj/item/weapon/pepperspray(src) - new /obj/item/weapon/flashbang(src) + new /obj/item/weapon/reagent_containers/spray/pepper(src) + new /obj/item/weapon/grenade/flashbang(src) new /obj/item/weapon/melee/baton(src) + new /obj/item/weapon/gun/energy/taser(src) new /obj/item/clothing/glasses/sunglasses/sechud(src) return /obj/structure/closet/secure_closet/detective - name = "detective\'s cabinet" - req_access = list(ACCESS_FORENSICS_LOCKERS) + name = "Detective's Cabinet" + req_access = list(access_forensics_lockers) icon_state = "cabinetdetective_locked" icon_closed = "cabinetdetective" icon_locked = "cabinetdetective_locked" @@ -167,30 +172,36 @@ New() ..() sleep(2) - new /obj/item/wardrobe/detective(src) - // - var/obj/item/weapon/storage/backpack/security/BPK = new /obj/item/weapon/storage/backpack/security(src) - var/obj/item/weapon/storage/box/B = new(BPK) - var/obj/item/weapon/clipboard/C = new(B) - new /obj/item/weapon/pen(C) - new /obj/item/weapon/clipboard/notebook(src) - new /obj/item/device/detective_scanner(src) - new /obj/item/taperoll/police(src) - new /obj/item/weapon/storage/box/evidence(src) - new /obj/item/device/pda/detective(src) + new /obj/item/clothing/under/det(src) + new /obj/item/clothing/suit/armor/det_suit(src) + new /obj/item/clothing/suit/det_suit(src) + new /obj/item/clothing/gloves/black(src) + new /obj/item/clothing/head/det_hat(src) + new /obj/item/clothing/shoes/brown(src) new /obj/item/device/radio/headset/headset_sec(src) new /obj/item/weapon/cartridge/detective(src) - // - new /obj/item/weapon/reagent_containers/food/drinks/dflask(src) - new /obj/item/weapon/lighter/zippo(B) - new /obj/item/weapon/pepperspray/small(src) + new /obj/item/weapon/storage/fcard_kit(src) + new /obj/item/weapon/fcardholder(src) + new /obj/item/weapon/clipboard(src) + new /obj/item/device/detective_scanner(src) + new /obj/item/weapon/storage/box/evidence(src) return - +/obj/structure/closet/secure_closet/detective/update_icon() + if(broken) + icon_state = icon_broken + else + if(!opened) + if(locked) + icon_state = icon_locked + else + icon_state = icon_closed + else + icon_state = icon_opened /obj/structure/closet/secure_closet/injection name = "Lethal Injections" - req_access = list(ACCESS_HOS) + req_access = list(access_hos) New() @@ -204,7 +215,7 @@ /obj/structure/closet/secure_closet/brig name = "Brig Locker" - req_access = list(ACCESS_BRIG) + req_access = list(access_brig) anchored = 1 var/id = null @@ -217,7 +228,7 @@ /obj/structure/closet/secure_closet/courtroom name = "Courtroom Locker" - req_access = list(ACCESS_COURT) + req_access = list(access_court) New() ..() diff --git a/code/game/objects/closets/syndicate.dm b/code/game/objects/closets/syndicate.dm index 9b8b6629d3..dd17e11fd9 100644 --- a/code/game/objects/closets/syndicate.dm +++ b/code/game/objects/closets/syndicate.dm @@ -2,13 +2,13 @@ ..() sleep(2) new /obj/item/weapon/tank/jetpack/oxygen(src) - new /obj/item/clothing/mask/breath(src) + new /obj/item/clothing/mask/gas/syndicate(src) new /obj/item/clothing/under/syndicate(src) - new /obj/item/clothing/head/helmet/space/syndicate(src) - new /obj/item/clothing/suit/space/syndicate(src) - new /obj/item/weapon/crowbar(src) + new /obj/item/clothing/head/helmet/space/rig/syndi(src) + new /obj/item/clothing/suit/space/rig/syndi(src) + new /obj/item/weapon/crowbar/red(src) new /obj/item/weapon/cell/high(src) new /obj/item/weapon/card/id/syndicate(src) new /obj/item/device/multitool(src) - new /obj/item/weapon/shield/riot(src) + new /obj/item/weapon/shield/energy(src) diff --git a/code/game/objects/closets/wardrobe.dm b/code/game/objects/closets/wardrobe.dm index 2d83d024c3..fd93cd3a8c 100644 --- a/code/game/objects/closets/wardrobe.dm +++ b/code/game/objects/closets/wardrobe.dm @@ -7,7 +7,6 @@ new /obj/item/clothing/shoes/brown(src) return -//says red, is actually the security locker /obj/structure/closet/wardrobe/red/New() new /obj/item/clothing/under/rank/security(src) new /obj/item/clothing/under/rank/security(src) @@ -15,41 +14,14 @@ new /obj/item/clothing/shoes/jackboots(src) new /obj/item/clothing/shoes/jackboots(src) new /obj/item/clothing/shoes/jackboots(src) - new /obj/item/clothing/gloves/red(src) - new /obj/item/clothing/gloves/red(src) - new /obj/item/clothing/gloves/red(src) - new /obj/item/clothing/gloves/red(src) - new /obj/item/clothing/head/secsoft(src) - new /obj/item/clothing/head/secsoft(src) - new /obj/item/clothing/head/secsoft(src) + new /obj/item/clothing/head/soft/sec(src) + new /obj/item/clothing/head/soft/sec(src) + new /obj/item/clothing/head/soft/sec(src) + new /obj/item/clothing/head/beret/sec(src) + new /obj/item/clothing/head/beret/sec(src) + new /obj/item/clothing/head/beret/sec(src) return -/obj/structure/closet/wardrobe/warden/New() - new /obj/item/clothing/under/rank/warden(src) - new /obj/item/clothing/shoes/jackboots(src) - new /obj/item/clothing/head/helmet/warden(src) - new /obj/item/weapon/storage/belt/security(src) - new /obj/item/clothing/gloves/red(src) - new /obj/item/clothing/suit/storage/gearharness(src) - -obj/structure/closet/wardrobe/hos/New() - new /obj/item/clothing/suit/storage/armourrigvest(src) - new /obj/item/clothing/suit/armor/hos(src) - new /obj/item/clothing/head/helmet/HoS(src) - new /obj/item/weapon/storage/belt/security(src) - new /obj/item/clothing/gloves/hos(src) - new /obj/item/clothing/shoes/jackboots(src) - new /obj/item/clothing/under/rank/head_of_security(src) - new /obj/item/clothing/under/jensen(src) - new /obj/item/clothing/suit/armor/hos/jensen(src) - new /obj/item/clothing/head/helmet/HoS/dermal(src) - -obj/structure/closet/wardrobe/hop/New() - new /obj/item/clothing/under/rank/head_of_personnel(src) - new /obj/item/weapon/clipboard(src) - new /obj/item/clothing/shoes/brown(src) - new /obj/item/clothing/gloves/blue(src) - /obj/structure/closet/wardrobe/pink/New() new /obj/item/clothing/under/color/pink(src) new /obj/item/clothing/under/color/pink(src) @@ -72,16 +44,16 @@ obj/structure/closet/wardrobe/hop/New() return /obj/structure/closet/wardrobe/chaplain_black/New() - //new /obj/item/clothing/suit/imperium_monk(src) //No. -- Urist new /obj/item/clothing/under/rank/chaplain(src) new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/suit/nun(src) new /obj/item/clothing/head/nun_hood(src) - new /obj/item/clothing/suit/storage/chaplain_hoodie(src) + new /obj/item/clothing/suit/chaplain_hoodie(src) new /obj/item/clothing/head/chaplain_hood(src) new /obj/item/clothing/suit/holidaypriest(src) - //new /obj/item/clothing/suit/hastur (src) //No. -- Urist - //new /obj/item/clothing/head/hasturhood (src) //No. -- Urist + new /obj/item/weapon/storage/backpack/cultpack (src) + new /obj/item/weapon/storage/fancy/candle_box(src) + new /obj/item/weapon/storage/fancy/candle_box(src) return /obj/structure/closet/wardrobe/green/New() @@ -91,6 +63,10 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) + //new /obj/item/clothing/head/soft/green(src) + //new /obj/item/clothing/head/soft/green(src) + //new /obj/item/clothing/head/soft/green(src) + return /obj/structure/closet/wardrobe/orange/New() new /obj/item/clothing/under/color/orange(src) @@ -99,6 +75,10 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/orange(src) new /obj/item/clothing/shoes/orange(src) new /obj/item/clothing/shoes/orange(src) + //new /obj/item/clothing/head/soft/orange(src) + //new /obj/item/clothing/head/soft/orange(src) + //new /obj/item/clothing/head/soft/orange(src) + return /obj/structure/closet/wardrobe/yellow/New() new /obj/item/clothing/under/color/yellow(src) @@ -107,6 +87,10 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/orange(src) new /obj/item/clothing/shoes/orange(src) new /obj/item/clothing/shoes/orange(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/yellow(src) + return /obj/structure/closet/wardrobe/atmospherics_yellow/New() new /obj/item/clothing/under/rank/atmospheric_technician(src) @@ -115,22 +99,22 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/magboots(src) //[Redacted] ZAS! >:C - new /obj/item/clothing/head/helmet/hardhat/red(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/yellow(src) + return /obj/structure/closet/wardrobe/engineering_yellow/New() new /obj/item/clothing/under/rank/engineer(src) new /obj/item/clothing/under/rank/engineer(src) new /obj/item/clothing/under/rank/engineer(src) - new /obj/item/clothing/head/helmet/hardhat(src) - new /obj/item/clothing/head/helmet/hardhat(src) - new /obj/item/clothing/head/helmet/hardhat(src) - new /obj/item/weapon/storage/belt/utility/full(src) - new /obj/item/weapon/storage/belt/utility/full(src) - new /obj/item/weapon/storage/belt/utility/full(src) new /obj/item/clothing/shoes/orange(src) new /obj/item/clothing/shoes/orange(src) new /obj/item/clothing/shoes/orange(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/yellow(src) + return /obj/structure/closet/wardrobe/white/New() new /obj/item/clothing/under/color/white(src) @@ -139,14 +123,26 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) + return + +/obj/structure/closet/wardrobe/pjs/New() + new /obj/item/clothing/under/pj/red(src) + new /obj/item/clothing/under/pj/red(src) + new /obj/item/clothing/under/pj/blue(src) + new /obj/item/clothing/under/pj/blue(src) + new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/shoes/white(src) + return /obj/structure/closet/wardrobe/toxins_white/New() new /obj/item/clothing/under/rank/scientist(src) new /obj/item/clothing/under/rank/scientist(src) new /obj/item/clothing/under/rank/scientist(src) - new /obj/item/clothing/suit/storage/labcoat/science(src) - new /obj/item/clothing/suit/storage/labcoat/science(src) - new /obj/item/clothing/suit/storage/labcoat/science(src) + new /obj/item/clothing/suit/labcoat(src) + new /obj/item/clothing/suit/labcoat(src) + new /obj/item/clothing/suit/labcoat(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) @@ -155,8 +151,8 @@ obj/structure/closet/wardrobe/hop/New() /obj/structure/closet/wardrobe/robotics_black/New() new /obj/item/clothing/under/rank/roboticist(src) new /obj/item/clothing/under/rank/roboticist(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) + new /obj/item/clothing/suit/labcoat(src) + new /obj/item/clothing/suit/labcoat(src) new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) return @@ -164,38 +160,31 @@ obj/structure/closet/wardrobe/hop/New() /obj/structure/closet/wardrobe/chemistry_white/New() new /obj/item/clothing/under/rank/chemist(src) new /obj/item/clothing/under/rank/chemist(src) - new /obj/item/clothing/under/rank/chemist(src) - new /obj/item/clothing/suit/storage/labcoat/chemist(src) - new /obj/item/clothing/suit/storage/labcoat/chemist(src) - new /obj/item/clothing/suit/storage/labcoat/chemist(src) - new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/suit/labcoat/chemist(src) + new /obj/item/clothing/suit/labcoat/chemist(src) + return /obj/structure/closet/wardrobe/genetics_white/New() new /obj/item/clothing/under/rank/geneticist(src) new /obj/item/clothing/under/rank/geneticist(src) - new /obj/item/clothing/under/rank/geneticist(src) - new /obj/item/clothing/suit/storage/labcoat/genetics(src) - new /obj/item/clothing/suit/storage/labcoat/genetics(src) - new /obj/item/clothing/suit/storage/labcoat/genetics(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - - - + new /obj/item/clothing/suit/labcoat/genetics(src) + new /obj/item/clothing/suit/labcoat/genetics(src) + return /obj/structure/closet/wardrobe/virology_white/New() - new /obj/item/clothing/suit/storage/labcoat/virologist(src) - new /obj/item/clothing/suit/storage/labcoat/virologist(src) - new /obj/item/clothing/suit/storage/labcoat/virologist(src) - new /obj/item/clothing/under/rank/virologist(src) new /obj/item/clothing/under/rank/virologist(src) new /obj/item/clothing/under/rank/virologist(src) new /obj/item/clothing/shoes/white(src) new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/suit/labcoat/virologist(src) + new /obj/item/clothing/suit/labcoat/virologist(src) + new /obj/item/clothing/mask/surgical(src) + new /obj/item/clothing/mask/surgical(src) + return /obj/structure/closet/wardrobe/grey/New() new /obj/item/clothing/under/color/grey(src) @@ -204,6 +193,10 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/black(src) + new /obj/item/clothing/head/soft/grey(src) + new /obj/item/clothing/head/soft/grey(src) + new /obj/item/clothing/head/soft/grey(src) + return /obj/structure/closet/wardrobe/mixed/New() new /obj/item/clothing/under/color/white(src) @@ -215,148 +208,22 @@ obj/structure/closet/wardrobe/hop/New() new /obj/item/clothing/shoes/black(src) new /obj/item/clothing/shoes/brown(src) new /obj/item/clothing/shoes/white(src) + //new /obj/item/clothing/head/soft/mime(src) + //new /obj/item/clothing/head/soft/blue(src) + //new /obj/item/clothing/head/soft/yellow(src) + //new /obj/item/clothing/head/soft/green(src) + //new /obj/item/clothing/head/soft/orange(src) + //new /obj/item/clothing/head/soft/purple(src) + //if(prob(10)) new /obj/item/clothing/head/soft/rainbow(src) + return /obj/structure/closet/lawcloset/New() - if(prob(50)) - new /obj/item/clothing/suit/lawyer/bluejacket(src) - else - new /obj/item/clothing/suit/lawyer/purpjacket(src) - if(prob(50)) - new /obj/item/clothing/suit/lawyer/bluejacket(src) - else - new /obj/item/clothing/suit/lawyer/purpjacket(src) - if(prob(50)) - new /obj/item/clothing/suit/lawyer/bluejacket(src) - else - new /obj/item/clothing/suit/lawyer/purpjacket(src) + new /obj/item/clothing/under/lawyer/female(src) + new /obj/item/clothing/under/lawyer/black(src) + new /obj/item/clothing/under/lawyer/red(src) + new /obj/item/clothing/under/lawyer/bluesuit(src) + new /obj/item/clothing/suit/lawyer/bluejacket(src) + new /obj/item/clothing/under/lawyer/purpsuit(src) + new /obj/item/clothing/suit/lawyer/purpjacket(src) new /obj/item/clothing/shoes/brown(src) - new /obj/item/clothing/shoes/brown(src) - new /obj/item/clothing/shoes/brown(src) - - -/obj/structure/closet/wardrobe/medic_white/New() - new /obj/item/clothing/under/rank/medical(src) - new /obj/item/clothing/under/rank/medical(src) - new /obj/item/clothing/under/rank/medical(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/weapon/storage/belt/medical(src) - new /obj/item/weapon/storage/belt/medical(src) - new /obj/item/weapon/storage/belt/medical(src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - -/obj/structure/closet/wardrobe/nurse/New() - new /obj/item/clothing/under/rank/nursesuit (src) - new /obj/item/clothing/under/rank/nursesuit (src) - new /obj/item/clothing/under/rank/nursesuit (src) - new /obj/item/clothing/head/nursehat (src) - new /obj/item/clothing/head/nursehat (src) - new /obj/item/clothing/head/nursehat (src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - -/obj/structure/closet/wardrobe/cmo/New() - new /obj/item/clothing/gloves/latex(src) - new /obj/item/clothing/suit/bio_suit/cmo(src) - new /obj/item/clothing/head/bio_hood/general(src) - new /obj/item/clothing/suit/storage/labcoat/cmo(src) - new /obj/item/clothing/suit/storage/labcoat/cmoalt(src) - new /obj/item/clothing/shoes/brown(src) - new /obj/item/clothing/under/rank/chief_medical_officer(src) - -/obj/structure/closet/wardrobe/rd/New() - new /obj/item/clothing/under/rank/research_director(src) - new /obj/item/clothing/under/rank/research_director(src) - new /obj/item/clothing/under/rank/research_director(src) - new /obj/item/clothing/suit/bio_suit/scientist(src) - new /obj/item/clothing/head/bio_hood/scientist(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/shoes/white(src) - new /obj/item/clothing/gloves/latex(src) - new /obj/item/clothing/gloves/latex(src) - new /obj/item/clothing/gloves/latex(src) - -/obj/structure/closet/wardrobe/robotics_yellow/New() - new /obj/item/clothing/under/rank/roboticist(src) - new /obj/item/clothing/under/rank/roboticist(src) - new /obj/item/clothing/under/rank/roboticist(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/suit/storage/labcoat(src) - new /obj/item/clothing/gloves/black(src) - new /obj/item/clothing/gloves/black(src) - new /obj/item/clothing/gloves/black(src) new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - -/obj/structure/closet/wardrobe/bartender_black/New() - new /obj/item/clothing/under/rank/bartender(src) - new /obj/item/clothing/under/rank/bartender(src) - new /obj/item/clothing/under/rank/bartender(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - -/obj/structure/closet/wardrobe/chef_white/New() - new /obj/item/clothing/under/rank/chef(src) - new /obj/item/clothing/under/rank/chef(src) - new /obj/item/clothing/under/rank/chef(src) - new /obj/item/clothing/suit/storage/chef(src) - new /obj/item/clothing/suit/storage/chef(src) - new /obj/item/clothing/suit/storage/chef(src) - new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/head/chefhat(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - -/obj/structure/closet/wardrobe/hydro_green/New() - new /obj/item/clothing/under/rank/hydroponics(src) - new /obj/item/clothing/under/rank/hydroponics(src) - new /obj/item/clothing/under/rank/hydroponics(src) - new /obj/item/clothing/head/helmet/greenbandana(src) - new /obj/item/clothing/head/helmet/greenbandana(src) - new /obj/item/clothing/head/helmet/greenbandana(src) - new /obj/item/clothing/suit/storage/apron(src) - new /obj/item/clothing/suit/storage/apron(src) - new /obj/item/clothing/suit/storage/apron(src) - new /obj/item/clothing/gloves/botanic_leather(src) - new /obj/item/clothing/gloves/botanic_leather(src) - new /obj/item/clothing/gloves/botanic_leather(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - -/obj/structure/closet/wardrobe/librarian_red/New() - new /obj/item/clothing/under/suit_jacket/red(src) - new /obj/item/clothing/under/suit_jacket/red(src) - new /obj/item/clothing/under/suit_jacket/red(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - -/obj/structure/closet/wardrobe/cargo_yellow/New() - new /obj/item/clothing/under/rank/cargo(src) - new /obj/item/clothing/under/rank/cargo(src) - new /obj/item/clothing/under/rank/cargo(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - new /obj/item/clothing/shoes/black(src) - -/obj/structure/closet/wardrobe/qm_yellow/New() - new /obj/item/clothing/under/rank/cargo(src) - new /obj/item/clothing/under/rank/cargo(src) - new /obj/item/clothing/under/rank/cargo(src) - new /obj/item/clothing/shoes/brown(src) - new /obj/item/clothing/shoes/brown(src) - new /obj/item/clothing/shoes/brown(src) diff --git a/code/game/objects/contraband.dm b/code/game/objects/contraband.dm index 4497ec4d5a..3d13f2d969 100644 --- a/code/game/objects/contraband.dm +++ b/code/game/objects/contraband.dm @@ -1,19 +1,18 @@ //########################## CONTRABAND ;3333333333333333333 -Agouri ################################################### -#define NUM_OF_POSTER_DESIGNS 27 -#define BS12_POSTERS_START 18 +#define NUM_OF_POSTER_DESIGNS 17 /obj/item/weapon/contraband name = "contraband item" desc = "You probably shouldn't be holding this." - icon = 'contraband.dmi' + icon = 'icons/obj/contraband.dmi' force = 0 /obj/item/weapon/contraband/poster name = "rolled-up poster" - desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface. Its vulgar themes have marked it as Contraband aboard NanoTrasen© Space Facilities." + desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface. Its vulgar themes have marked it as Contraband aboard Nanotrasen© Space Facilities." icon_state = "rolled_poster" var/serial_number = 0 var/obj/effect/decal/poster/resulting_poster = null //The poster that will be created is initialised and stored through contraband/poster's constructor @@ -21,11 +20,7 @@ /obj/item/weapon/contraband/poster/New(turf/loc,var/given_serial=0) if(given_serial==0) - //add an increased chance for BS12 specific posters to spawn - if(prob(10)) - serial_number = rand(BS12_POSTERS_START,NUM_OF_POSTER_DESIGNS) - else - serial_number = rand(1,NUM_OF_POSTER_DESIGNS) + serial_number = rand(1,NUM_OF_POSTER_DESIGNS) src.resulting_poster = new(serial_number) else serial_number = given_serial @@ -73,7 +68,7 @@ obj/effect/decal/poster name = "poster" desc = "A large piece of space-resistant printed paper. It's considered contraband." - icon = 'contraband.dmi' + icon = 'icons/obj/contraband.dmi' anchored = 1 var/serial_number //Will hold the value of src.loc if nobody initialises it var/ruined = 0 @@ -83,17 +78,10 @@ obj/effect/decal/poster/New(var/serial) src.serial_number = serial - restart_proc: - if(serial_number==src.loc) - //add an increased chance for BS12 specific posters to spawn - if(prob(10)) - serial_number = rand(BS12_POSTERS_START,NUM_OF_POSTER_DESIGNS) - else - serial_number = rand(1,NUM_OF_POSTER_DESIGNS) + if(serial_number==src.loc){serial_number = rand(1,NUM_OF_POSTER_DESIGNS);} //This is for the mappers that want individual posters without having to use rolled posters. icon_state = "poster[serial_number]" - //This is for the mappers that want individual posters without having to use rolled posters. switch(serial_number) if(1) name += " - Unlucky Space Explorer" @@ -118,22 +106,22 @@ obj/effect/decal/poster/New(var/serial) desc += " This particular one is of a couple of ragged gunmen, one male and one female, on top of a mound of rubble. The number \"13\" is visible on their blue jumpsuits." if(8) name += " - Pinup Girl Cindy" - desc += " This particular one is of NanoTrasen's PR girl, Cindy, in a particularly feminine pose." + desc += " This particular one is of Nanotrasen's PR girl, Cindy, in a particularly feminine pose." if(9) name += " - Pinup Girl Amy" - desc += " This particular one is of Amy, the nymphomaniac Urban Legend of NanoTrasen Space Stations. How this photograph came to be is not known." + desc += " This particular one is of Amy, the nymphomaniac Urban Legend of Nanotrasen Space Stations. How this photograph came to be is not known." if(10) name += " - Don't Panic" desc += " This particular one depicts some sort of star in a grimace. The \"Don't Panic\" is written in big, friendly letters." if(11) name += " - Underwater Laboratory" - desc += " This particular one is of the fabled last crew of NanoTrasen's previous project before going big on Asteroid mining, Sealab." + desc += " This particular one is of the fabled last crew of Nanotrasen's previous project before going big on Asteroid mining, Sealab." if(12) name += " - Missing Gloves" - desc += " This particular one is about the uproar that followed NanoTrasen's financial cuts towards insulated-glove purchases." + desc += " This particular one is about the uproar that followed Nanotrasen's financial cuts towards insulated-glove purchases." if(13) name += " - Rogue AI" - desc += " This particular one depicts the shell of the infamous AI that catastropically comandeered one of NanoTrasen's earliest space stations. Back then, the corporation was just known as TriOptimum." + desc += " This particular one depicts the shell of the infamous AI that catastropically comandeered one of Nanotrasen's earliest space stations. Back then, the corporation was just known as TriOptimum." if(14) name += " - User of the Arcane Arts" desc += " This particular one depicts a wizard, casting a spell. You can't really make out if it's an actial photograph or a computer-generated image." @@ -146,50 +134,14 @@ obj/effect/decal/poster/New(var/serial) if(17) name += " - Dangerous Static" desc += " This particular one depicts nothing remarkable other than a rather mesmerising pattern of monitor static. There's a tag on the sides of the poster, urging you to \"tear this poster in half to receive your free sample\"." - - //bs12 specific posters - if(18) - name += " - Pinup Girl Val" //art thou incensed, brethren? - desc += " Luscious Val McNeil, the vertically challenged Legal Extraordinaire, winner of Miss Space two years running and favoured pinup girl of Lawyers Weekly." - if(19) - name += " - Derpman, Enforcer of the State" - desc += " Here to protect and serve... your donuts! A generously proportioned man, he teaches you the value of hiding your snacks." - if(20) - name += " - Tajaran Today, Special #222" - desc += " A controversial front page pinup from NTFashion, banned on numerous stations for its unreasonably cute depictions." - if(21) - name += " - Respect a Soghun" - desc += " This poster depicts a well dressed looking Soghun receiving a prestigious award. It appears to espouse greater co-operation and harmony between the two races." - if(22) - name += " - Skrell Twilight" - desc += " This poster depicts a mysteriously inscrutable, alien scene. Numerous Skrell can be seen conversing amidst great, crystalline towers rising above crashing waves" - if(23) - name += " - Join the Fuzz!" - desc += " It's a nice recruitment poster of a white haired Chinese woman that says; \"Big Guns, Hot Women, Good Times. Security. We get it done.\"" - if(24) - name += " - Looking for a career with excitement?" - desc += " A recruitment poster starring a dark haired woman with glasses and a purple shirt that has \"Got Brains? Got Talent? Not afraid of electric flying monsters that want to suck the soul out of you? Then Xenobiology could use someone like you!\" written on the bottom." - if(25) - name += " - Safety first: because electricity doesn't wait!" - desc += " A safety poster starring a clueless looking redhead with frazzled hair. \"Every year, hundreds of NT employees expose themselves to electric shock. Play it safe. Avoid suspicious doors after electrical storms, and always wear protection when doing electric maintenance.\"" - if(26) - name += " - Responsible medbay habits, No #259" - desc += " A poster with a nervous looking geneticist on it states; \"Friends Don't Tell Friends They're Clones. It can cause severe and irreparable emotional trauma. Always do the right thing and never tell them that they were dead.\"" - if(27) - name += " - Irresponsible medbay habits, No #2" - desc += " This is a safety poster starring a perverted looking naked doctor. \"Sexual harassment is never okay. REPORT any acts of sexual deviance or harassment that disrupt a healthy working environment.\"" - /*if(20) - name += " - the Disabled Triptarch: Ironfoot, Seber and Ore" - desc += " This poster depicts a genetics researcher, a chemist and a medical doctor in various states of miscommunication."*/ else - //properly handle unhinged logic states - src.serial_number = src.loc - goto restart_proc + name = "This shit just bugged. Report it to Agouri - polyxenitopalidou@gmail.com" + desc = "Why are you still here?" ..() obj/effect/decal/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) if( istype(W, /obj/item/weapon/wirecutters) ) - playsound(src.loc, 'Wirecutter.ogg', 100, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) if(src.ruined) user << "You remove the remnants of the poster." del(src) @@ -209,7 +161,7 @@ obj/effect/decal/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) return for (var/mob/O in hearers(5, src.loc)) O.show_message("[user.name] rips the [src.name] in a single, decisive motion!" ) - playsound(src.loc, 'poster_ripped.ogg', 100, 1) + playsound(src.loc, 'sound/items/poster_ripped.ogg', 100, 1) src.ruined = 1 src.icon_state = "poster_ripped" src.name = "Ripped poster" @@ -242,16 +194,13 @@ obj/effect/decal/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) user << "You start placing the poster on the wall..." //Looks like it's uncluttered enough. Place the poster. //declaring D because otherwise if P gets 'deconstructed' we lose our reference to P.resulting_poster - if(P.resulting_poster.serial_number != P.serial_number) - del P.resulting_poster - P.resulting_poster = new /obj/effect/decal/poster(P, P.serial_number) var/obj/effect/decal/poster/D = P.resulting_poster var/temp_loc = user.loc flick("poster_being_set",D) D.loc = src del(P) //delete it now to cut down on sanity checks afterwards. Agouri's code supports rerolling it anyway - playsound(D.loc, 'poster_being_created.ogg', 100, 1) + playsound(D.loc, 'sound/items/poster_being_created.ogg', 100, 1) sleep(17) if(!D) return diff --git a/code/game/objects/storage/crates.dm b/code/game/objects/crates.dm similarity index 74% rename from code/game/objects/storage/crates.dm rename to code/game/objects/crates.dm index 69b13b34f9..c09bae884c 100644 --- a/code/game/objects/storage/crates.dm +++ b/code/game/objects/crates.dm @@ -1,7 +1,9 @@ +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 + /obj/structure/closet/crate desc = "A crate." name = "Crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "crate" density = 1 icon_opened = "crateopen" @@ -14,7 +16,7 @@ /obj/structure/closet/crate/internals desc = "A internals crate." name = "Internals crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "o2crate" density = 1 icon_opened = "o2crateopen" @@ -23,7 +25,7 @@ /obj/structure/closet/crate/trashcart desc = "A heavy, metal trashcart with wheels." name = "Trash Cart" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "trashcart" density = 1 icon_opened = "trashcartopen" @@ -33,7 +35,7 @@ /obj/structure/closet/crate/hat desc = "A crate filled with Valuable Collector's Hats!." name = "Hat Crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "crate" density = 1 icon_opened = "crateopen" @@ -41,8 +43,8 @@ /obj/structure/closet/crate/contraband name = "Poster crate" - desc = "A random assortment of posters manufactured by providers NOT listed under NanoTrasen's whitelist." - icon = 'storage.dmi' + desc = "A random assortment of posters manufactured by providers NOT listed under Nanotrasen's whitelist." + icon = 'icons/obj/storage.dmi' icon_state = "crate" density = 1 icon_opened = "crateopen" @@ -52,7 +54,7 @@ /obj/structure/closet/crate/medical desc = "A medical crate." name = "Medical crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "medicalcrate" density = 1 icon_opened = "medicalcrateopen" @@ -61,7 +63,7 @@ /obj/structure/closet/crate/rcd desc = "A crate for the storage of the RCD." name = "RCD crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "crate" density = 1 icon_opened = "crateopen" @@ -70,16 +72,37 @@ /obj/structure/closet/crate/freezer desc = "A freezer." name = "Freezer" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "freezer" density = 1 icon_opened = "freezeropen" icon_closed = "freezer" + var/target_temp = T0C - 40 + var/cooling_power = 40 + + return_air() + var/datum/gas_mixture/gas = (..()) + if(!gas) return null + var/datum/gas_mixture/newgas = new/datum/gas_mixture() + newgas.oxygen = gas.oxygen + newgas.carbon_dioxide = gas.carbon_dioxide + newgas.nitrogen = gas.nitrogen + newgas.toxins = gas.toxins + newgas.volume = gas.volume + newgas.temperature = gas.temperature + if(newgas.temperature <= target_temp) return + + if((newgas.temperature - cooling_power) > target_temp) + newgas.temperature -= cooling_power + else + newgas.temperature = target_temp + return newgas + /obj/structure/closet/crate/bin desc = "A large bin." name = "Large bin" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "largebin" density = 1 icon_opened = "largebinopen" @@ -88,18 +111,16 @@ /obj/structure/closet/crate/radiation desc = "A crate with a radiation sign on it." name = "Radioactive gear crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "radiation" density = 1 icon_opened = "radiationopen" icon_closed = "radiation" -/obj/item/clothing/suit/radiation - /obj/structure/closet/crate/secure/weapon desc = "A secure weapons crate." name = "Weapons crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "weaponcrate" density = 1 icon_opened = "weaponcrateopen" @@ -108,7 +129,7 @@ /obj/structure/closet/crate/secure/plasma desc = "A secure plasma crate." name = "Plasma crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "plasmacrate" density = 1 icon_opened = "plasmacrateopen" @@ -117,7 +138,7 @@ /obj/structure/closet/crate/secure/gear desc = "A secure gear crate." name = "Gear crate" - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "secgearcrate" density = 1 icon_opened = "secgearcrateopen" @@ -150,7 +171,7 @@ /obj/structure/closet/crate/hydroponics name = "Hydroponics crate" desc = "All you need to destroy those pesky weeds and pests." - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "hydrocrate" icon_opened = "hydrocrateopen" icon_closed = "hydrocrate" @@ -160,17 +181,15 @@ //This exists so the prespawned hydro crates spawn with their contents. /* name = "Hydroponics crate" desc = "All you need to destroy those pesky weeds and pests." - icon = 'storage.dmi' + icon = 'icons/obj/storage.dmi' icon_state = "hydrocrate" icon_opened = "hydrocrateopen" icon_closed = "hydrocrate" density = 1*/ New() ..() - new /obj/item/weapon/plantbgone(src) - new /obj/item/weapon/plantbgone(src) - new /obj/item/weapon/plantbgone(src) - new /obj/item/weapon/hatchet(src) + new /obj/item/weapon/reagent_containers/spray/plantbgone(src) + new /obj/item/weapon/reagent_containers/spray/plantbgone(src) new /obj/item/weapon/minihoe(src) // new /obj/item/weapon/weedspray(src) // new /obj/item/weapon/weedspray(src) @@ -206,25 +225,33 @@ ..() new /obj/item/clothing/suit/radiation(src) new /obj/item/clothing/head/radiation(src) + new /obj/item/clothing/suit/radiation(src) + new /obj/item/clothing/head/radiation(src) + new /obj/item/clothing/suit/radiation(src) + new /obj/item/clothing/head/radiation(src) + new /obj/item/clothing/suit/radiation(src) + new /obj/item/clothing/head/radiation(src) /obj/structure/closet/crate/open() - playsound(src.loc, 'click.ogg', 15, 1, -3) + playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3) for(var/obj/O in src) O.loc = get_turf(src) - for(var/mob/M in src) - M.loc = get_turf(src) - icon_state = icon_opened src.opened = 1 /obj/structure/closet/crate/close() - playsound(src.loc, 'click.ogg', 15, 1, -3) + playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3) + + var/itemcount = 0 for(var/obj/O in get_turf(src)) + if(itemcount >= storage_capacity) + break if(O.density || O.anchored || O == src) continue O.loc = src + itemcount++ icon_state = icon_closed src.opened = 0 @@ -237,31 +264,25 @@ /obj/structure/closet/crate/secure/attack_hand(mob/user as mob) if(locked && !broken) if (allowed(user)) - user << "\blue You unlock the [src]." + user << "You unlock \the [src]." src.locked = 0 overlays = null overlays += greenlight return else - user << "\red It's locked." + user << "\The [src] is locked." return else ..() /obj/structure/closet/crate/secure/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/card) && src.allowed(user) && !locked && !opened && !broken) - user << "\red You lock the [src]." + user << "You lock \the [src]." src.locked = 1 overlays = null overlays += redlight return else if ( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && locked &&!broken) - if(istype(W, /obj/item/weapon/card/emag)) - var/obj/item/weapon/card/emag/E = W - if(E.uses) - E.uses-- - else - return overlays = null overlays += emag overlays += sparks @@ -269,7 +290,7 @@ playsound(src.loc, "sparks", 60, 1) src.locked = 0 src.broken = 1 - user << "\blue You unlock the [src]." + user << "You unlock \the [src]." return return ..() @@ -301,7 +322,7 @@ overlays += emag overlays += sparks spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface* - playsound(src.loc, 'sparks4.ogg', 75, 1) + playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) src.locked = 0 if(!opened && prob(20/severity)) if(!locked) diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index 909c8e3e61..9ce5d981a8 100755 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -1,10 +1,13 @@ //The advanced pea-green monochrome lcd of tomorrow. +var/global/list/obj/item/device/pda/PDAs = list() + + /obj/item/device/pda name = "PDA" desc = "A portable microcomputer by Thinktronic Systems, LTD. Functionality determined by a preprogrammed ROM cartridge." - icon = 'pda.dmi' + icon = 'icons/obj/pda.dmi' icon_state = "pda" item_state = "electronic" w_class = 1.0 @@ -20,20 +23,20 @@ //Secondary variables var/scanmode = 0 //1 is medical scanner, 2 is forensics, 3 is reagent scanner. var/fon = 0 //Is the flashlight function on? - var/f_lum = 3 //Luminosity for the flashlight function + var/f_lum = 4 //Luminosity for the flashlight function var/silent = 0 //To beep or not to beep, that is the question var/toff = 0 //If 1, messenger disabled var/tnote = null //Current Texts var/last_text //No text spamming var/last_honk //Also no honk spamming that's bad too var/ttone = "beep" //The ringtone! + var/lock_code = "" // Lockcode to unlock uplink var/honkamt = 0 //How many honks left when infected with honk.exe var/mimeamt = 0 //How many silence left when infected with mime.exe - var/note = "Congratulations, your station has chosen the Thinktronic 5230 Personal Data Assistant!" //Current note in the notepad function. + var/note = "Congratulations, your station has chosen the Thinktronic 5230 Personal Data Assistant!" //Current note in the notepad function + var/notehtml = "" var/cart = "" //A place to stick cartridge menu information - var/over_jumpsuit = 1 // If set to 0, it won't display on top of the mob's jumpsuit - - var/obj/item/device/uplink/pda/uplink = null + var/detonate = 1 // Can the PDA be blown up? var/obj/item/weapon/card/id/id = null //Making it possible to slot an ID card into the PDA so it can function as both. var/ownjob = null //related to above @@ -166,41 +169,61 @@ icon_state = "pda-chem" /obj/item/device/pda/geneticist + default_cartridge = /obj/item/weapon/cartridge/medical icon_state = "pda-gene" +// Special AI/pAI PDAs that cannot explode. +/obj/item/device/pda/ai + icon_state = "NONE" + ttone = "data" + detonate = 0 + +/obj/item/device/pda/pai + icon_state = "NONE" + ttone = "data" + detonate = 0 + +/obj/item/device/pda/ai/attack_self(mob/user as mob) + if ((honkamt > 0) && (prob(60)))//For clown virus. + honkamt-- + playsound(loc, 'sound/items/bikehorn.ogg', 30, 1) + return + /* * The Actual PDA */ /obj/item/device/pda/pickup(mob/user) if (fon) - ul_SetLuminosity(0) - user.ul_SetLuminosity(user.LuminosityRed + (f_lum - 1), user.LuminosityGreen + (f_lum - 1), user.LuminosityBlue + (f_lum + 1)) + sd_SetLuminosity(0) + user.total_luminosity += f_lum /obj/item/device/pda/dropped(mob/user) if (fon) - user.ul_SetLuminosity(user.LuminosityRed - (f_lum - 1), user.LuminosityGreen - (f_lum - 1), user.LuminosityBlue - (f_lum + 1)) - ul_SetLuminosity(f_lum - 1, f_lum - 1, f_lum + 1) + user.total_luminosity -= f_lum + sd_SetLuminosity(f_lum) /obj/item/device/pda/New() ..() + PDAs += src spawn(3) if (default_cartridge) cartridge = new default_cartridge(src) /obj/item/device/pda/proc/can_use() + + if(istype(src, /obj/item/device/pda/ai) || istype(src, /obj/item/device/pda/pai)) + return 1 if(!ismob(loc)) return 0 + var/mob/M = loc - - if(!M.canmove && (!M.buckled && M.handcuffed)) + if(!M.canmove) return 0 - - if((src in M.contents) || ( istype(loc, /turf) && in_range(src, M) ) ) + if((src in M.contents) || ( istype(loc, /turf) && in_range(src, M) )) return 1 else return 0 - /obj/item/device/pda/MouseDrop(obj/over_object as obj, src_location, over_location) var/mob/M = usr if((!istype(over_object, /obj/screen)) && !M.restrained() && !M.stat && can_use()) @@ -209,8 +232,12 @@ //NOTE: graphic resources are loaded on client login /obj/item/device/pda/attack_self(mob/user as mob) + user.machine = src + if(active_uplink_check(user)) + return + var/dat = "Personal Data Assistant" dat += " Close" @@ -234,7 +261,7 @@ dat += text("ID: [id ? "[id.registered_name], [id.assignment]" : "----------"]") dat += text("
      [id ? "Update PDA Info" : ""]
      ") - dat += "Station Time: [round(world.time / 36000)+12]:[(world.time / 600 % 60) < 10 ? add_zero(world.time / 600 % 60, 1) : world.time / 600 % 60]"//:[world.time / 100 % 6][world.time / 100 % 10]" + dat += "Station Time: [worldtime2text()]"//:[world.time / 100 % 6][world.time / 100 % 10]" dat += "

      " @@ -242,12 +269,13 @@ dat += "" @@ -304,10 +332,7 @@ if (1) dat += "

      Notekeeper V2.1

      " - if ((!isnull(uplink)) && uplink.active) - dat += " Lock
      " - else - dat += " Edit
      " + dat += " Edit
      " dat += note if (2) @@ -331,10 +356,10 @@ var/count = 0 if (!toff) - for (var/obj/item/device/pda/P in world) + for (var/obj/item/device/pda/P in sortAtom(PDAs)) if (!P.owner||P.toff||P == src) continue dat += "
    • [P]" - if (istype(cartridge, /obj/item/weapon/cartridge/syndicate)) + if (istype(cartridge, /obj/item/weapon/cartridge/syndicate) && P.detonate) dat += " (*Detonate*)" if (istype(cartridge, /obj/item/weapon/cartridge/clown)) dat += " (*Send Virus*)" @@ -365,7 +390,7 @@ var/datum/gas_mixture/environment = T.return_air() var/pressure = environment.return_pressure() - var/total_moles = environment.total_moles + var/total_moles = environment.total_moles() dat += "Air Pressure: [round(pressure,0.1)] kPa
      " @@ -385,7 +410,7 @@ dat += "
      " if (5) - dat += "

      NanoTrasen Relay Chat

      " + dat += "

      Nanotrasen Relay Chat

      " dat += "

      Detected Channels

      :
    • " for(var/datum/chatroom/C in chatrooms) @@ -394,13 +419,7 @@ dat += " " dat += "
    • " - if (41) //crew manifest - dat += "

      Crew Manifest

      " - dat += "Entries cannot be modified from this terminal.

      " - - dat += data_core.get_manifest(1) - dat += "
      " else//Else it links to the cart menu proc. Although, it really uses menu hub 4--menu 4 doesn't really exist as it simply redirects to hub. dat += cart @@ -416,7 +435,7 @@ //if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) ) if(can_use()) //Why reinvent the wheel? There's a proc that does exactly that. - if ( !(U.stat || U.restrained()) && (src in U.contents)) + if ( !(U.stat || U.restrained()) ) add_fingerprint(U) U.machine = src @@ -466,8 +485,6 @@ mode = 2 if("21")//Read messeges mode = 21 - if("41")//Check Manifest - mode = 41 if("3")//Atmos scan mode = 3 if("4")//Redirects to hub @@ -482,11 +499,11 @@ fon = (!fon) if (src in U.contents) if (fon) - U.ul_SetLuminosity(U.LuminosityRed + (f_lum - 1), U.LuminosityGreen + (f_lum - 1), U.LuminosityBlue + (f_lum + 1)) + U.total_luminosity += f_lum else - U.ul_SetLuminosity(U.LuminosityRed - (f_lum - 1), U.LuminosityGreen - (f_lum - 1), U.LuminosityBlue - (f_lum + 1)) + U.total_luminosity -= f_lum else - ul_SetLuminosity(fon * f_lum) + sd_SetLuminosity(fon * f_lum) if("Medical Scan") if(scanmode == 1) scanmode = 0 @@ -509,17 +526,18 @@ scanmode = 4 if("Honk") if ( !(last_honk && world.time < last_honk + 20) ) - playsound(loc, 'bikehorn.ogg', 50, 1) + playsound(loc, 'sound/items/bikehorn.ogg', 50, 1) last_honk = world.time //MESSENGER/NOTE FUNCTIONS=================================== if ("Edit") - var/n = input(U, "Please enter message", name, note) as message + var/n = input(U, "Please enter message", name, notehtml) as message if (in_range(src, U) && loc == U) n = copytext(adminscrub(n), 1, MAX_MESSAGE_LEN) if (mode == 1) - note = n + note = dd_replacetext(n, "\n", "
      ") + notehtml = n else U << browse(null, "window=pda") return @@ -533,13 +551,9 @@ var/t = input(U, "Please enter new ringtone", name, ttone) as text if (in_range(src, U) && loc == U) if (t) - if ((uplink) && (cmptext(t,uplink.lock_code))) - if(uplink.active) - U << "The PDA uplink is already unlocked." - mode = 1 - else - U << "The PDA softly beeps." - uplink.unlock() + if(src.hidden_uplink && hidden_uplink.check_trigger(U, t, lock_code)) + U << "The PDA softly beeps." + U << browse(null, "window=pda") else t = copytext(sanitize(t), 1, 20) ttone = t @@ -547,106 +561,8 @@ U << browse(null, "window=pda") return if("Message") - var/t - if(!href_list["pAI_mess"]) - t = input(U, "Please enter message", name, null) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) - else - t = href_list["pAI_mess"] - if (!t) - return - if (!in_range(src, U) && loc != U && !href_list["pAI_mess"]) - return - var/obj/item/device/pda/P = locate(href_list["target"]) - if(!istype(P)) return - - if(istype(P, /obj/item/device/pda)) - if (isnull(P)||P.toff || toff) - return - - if (last_text && world.time < last_text + 5) - return - - last_text = world.time - // check if telecomms I/O route 1459 is stable - //var/telecomms_intact = telecomms_process(P.owner, owner, t) - var/obj/machinery/message_server/useMS = null - if(message_servers) - for (var/obj/machinery/message_server/MS in message_servers) - //PDAs are now dependant on the Message Server. - if(MS.active) - useMS = MS - break - if(useMS) // only send the message if it's stable - useMS.send_pda_message("[P.owner]","[owner]","[t]") - - tnote += "→ To [P.owner]:
      [t]
      " - P.tnote += "← From [owner] ([ownjob]):
      [t]
      " - - // Give every ghost the ability to see all messages - for (var/mob/dead/observer/G in world) - G.show_message("PDA message from [src.owner] to [P:owner]: [t]") - - if (prob(15)) //Give the AI a chance of intercepting the message - var/who = src.owner - if(prob(50)) - who = P:owner - for(var/mob/living/silicon/ai/ai in world) - ai.show_message("Intercepted message from [who]: [t]") - - if (!P.silent) - playsound(P.loc, 'twobeep.ogg', 50, 1) - for (var/mob/O in hearers(3, P.loc)) - O.show_message(text("\icon[P] *[P.ttone]*")) - if( P.loc && ishuman(P.loc) ) - var/mob/living/carbon/human/H = P.loc - H << "\icon[P] Message from [src.owner] ([ownjob]), \"[t]\" (Reply)" - log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]") - P.overlays = null - P.overlays += image('pda.dmi', "pda-r") - else - U << "ERROR: Server isn't responding." - - // pAI Message - else - - //var/telecomms_intact = telecomms_process(P.owner, owner, t) - var/obj/machinery/message_server/useMS = null - if(message_servers) - for (var/obj/machinery/message_server/MS in message_servers) - //PDAs are now dependant on the Message Server. - if(MS.active) - useMS = MS - break - if(useMS) // only send the message if it's stable - useMS.send_pda_message("[P.owner]","[owner]","[t]") - tnote += "→ To [P]:
      [t]
      " - P.tnote += "← From [src]:
      [t]
      " - - // Give every ghost the ability to see all messages - for (var/mob/dead/observer/G in world) - G.show_message("PDA message from [src.owner] to [P:owner]: [t]") - - if (prob(15)) //Give the AI a chance of intercepting the message - var/who = src - if(prob(50)) - who = P - for (var/mob/living/silicon/ai/ai in world) - ai.show_message("Intercepted message from [who]: [t]") - - if (!P.silent) - playsound(P.loc, 'twobeep.ogg', 50, 1) - for (var/mob/O in hearers(3, P.loc)) - O.show_message(text("\icon[P] *[P.ttone]*")) - if( P.loc && ishuman(P.loc) ) - var/mob/living/carbon/human/H = P.loc - H << "\icon[P] Message from [src.owner] ([ownjob]), \"[t]\" (Reply)" - log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]") - else - U << "ERROR: Server isn't responding." - - + src.create_message(U, P) if("Send Honk")//Honk virus if(istype(cartridge, /obj/item/weapon/cartridge/clown))//Cartridge checks are kind of unnecessary since everything is done through switch. @@ -681,7 +597,7 @@ if("Toggle Door") if(!isnull(cartridge) && cartridge.access_remote_door) - for(var/obj/machinery/door/poddoor/M in world) //world is probably a bad idea, but at least it works? + for(var/obj/machinery/door/poddoor/M in machines) if(M.id == cartridge.remote_door_id) if(M.density) spawn(0) @@ -689,19 +605,12 @@ else spawn(0) M.close() - if("Lock") - if(uplink) - uplink.active = 0 - note = uplink.orignote + if("Detonate")//Detonate PDA if(istype(cartridge, /obj/item/weapon/cartridge/syndicate)) var/obj/item/device/pda/P = locate(href_list["target"]) if(!isnull(P)) if (!P.toff && cartridge:shock_charges > 0) - log_admin("ATTACK: [U] ([U.ckey]) triggered a Detomatix Cartridge.") - message_admins("ATTACK: [U] ([U.ckey]) triggered a Detomatix Cartridge.") - log_attack("[U.name] ([U.ckey]) triggered a Detomatix Cartridge.") - cartridge:shock_charges-- var/difficulty = 0 @@ -712,10 +621,11 @@ difficulty += P.cartridge.access_engine difficulty += P.cartridge.access_clown difficulty += P.cartridge.access_janitor + difficulty += P.cartridge.access_manifest * 2 else difficulty += 2 - if ((prob(difficulty * 12)) || (P.uplink)) + if ((prob(difficulty * 12)) || (P.hidden_uplink)) U.show_message("\red An error flashes on your [src].", 1) else if (prob(difficulty * 3)) U.show_message("\red Energy feeds back into your [src]!", 1) @@ -763,7 +673,7 @@ if ((honkamt > 0) && (prob(60)))//For clown virus. honkamt-- - playsound(loc, 'bikehorn.ogg', 30, 1) + playsound(loc, 'sound/items/bikehorn.ogg', 30, 1) if(U.machine == src && href_list["skiprefresh"]!="1")//Final safety. attack_self(U)//It auto-closes the menu prior if the user is not in range and so on. @@ -774,45 +684,97 @@ /obj/item/device/pda/proc/remove_id() if (id) - if (istype(loc, /mob)) + if (ismob(loc)) var/mob/M = loc - if(M.equipped() == null) - M.put_in_hand(id) - id = null - usr << "\blue You remove the ID from the [name]." - return - id.loc = get_turf(src) + M.put_in_hands(id) + usr << "You remove the ID from the [name]." + else + id.loc = get_turf(src) id = null -/obj/item/device/pda/proc/telecomms_process(var/receipent, var/originator, var/data) - var/telecomms_intact = 0 - /* Make sure telecomms is intact */ - for (var/obj/machinery/telecomms/receiver/R in world) +/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P) - if((1459 in R.freq_listening) && R.on) + var/t = input(U, "Please enter message", name, null) as text + t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + if (!t || !istype(P)) + return + if (!in_range(src, U) && loc != U) + return - for (var/obj/machinery/telecomms/bus/B in R.links) + if (isnull(P)||P.toff || toff) + return - if((1459 in B.freq_listening) && B.on) + if (last_text && world.time < last_text + 5) + return - for(var/obj/machinery/telecomms/server/S in B.links) + last_text = world.time + // check if telecomms I/O route 1459 is stable + //var/telecomms_intact = telecomms_process(P.owner, owner, t) + var/obj/machinery/message_server/useMS = null + if(message_servers) + for (var/obj/machinery/message_server/MS in message_servers) + //PDAs are now dependant on the Message Server. + if(MS.active) + useMS = MS + break - if((1459 in S.freq_listening) && S.on) - // Add a log - S.add_entry("[originator] sent to [receipent]: \"[data]\"", "PDA log") + var/datum/signal/signal = telecomms_process() - for(var/obj/machinery/telecomms/broadcaster/C in S.links) + var/useTC = 0 + if(signal) + if(signal.data["done"]) + useTC = 1 + if(P.loc.z in signal.data["level"]) + useTC = 2 + //Let's make this barely readable + if(signal.data["compression"] > 0) + t = Gibberish(t, signal.data["compression"] + 50) - if(((1459 in C.freq_listening || C.freq_listening.len == 0)) && C.on) + if(useMS && useTC) // only send the message if it's stable + if(useTC != 2) // Does our recepient have a broadcaster on their level? + U << "ERROR: Cannot reach recepient." + return + useMS.send_pda_message("[P.owner]","[owner]","[t]") - telecomms_intact = 1 - break + tnote += "→ To [P.owner]:
      [t]
      " + P.tnote += "← From [owner] ([ownjob]):
      [t]
      " - break - break - break + if (prob(15)) //Give the AI a chance of intercepting the message + var/who = src.owner + if(prob(50)) + who = P:owner + for(var/mob/living/silicon/ai/ai in mob_list) + // Allows other AIs to intercept the message but the AI won't intercept their own message. + if(ai.aiPDA != P && ai.aiPDA != src) + ai.show_message("Intercepted message from [who]: [t]") - return telecomms_intact + if (!P.silent) + playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(3, P.loc)) + if(!P.silent) O.show_message(text("\icon[P] *[P.ttone]*")) + //Search for holder of the PDA. + var/mob/living/L = null + if(P.loc && isliving(P.loc)) + L = P.loc + //Maybe they are a pAI! + else if(istype(P, /obj/item/device/pda/pai) && P.loc) + //Search through the location's contents + for(var/obj/item/device/paicard/Pcard in P.loc) + //If there's a Pcard there then get the mind inside + if(Pcard.pai) + var/mob/living/silicon/pai/pai = Pcard.pai + //Is it the pAI that is receiving the message? + if(pai.pda && pai.pda == P) + L = pai + break + if(L) + L << "\icon[P] Message from [src.owner] ([ownjob]), \"[t]\" (Reply)" + + log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]") + P.overlays = null + P.overlays += image('icons/obj/pda.dmi', "pda-r") + else + U << "ERROR: Server isn't responding." /obj/item/device/pda/verb/verb_remove_id() @@ -824,70 +786,98 @@ if(id) remove_id() else - usr << "\blue This PDA does not have an ID in it." + usr << "This PDA does not have an ID in it." else - usr << "\blue You cannot do this while restrained." + usr << "You cannot do this while restrained." +/obj/item/device/pda/verb/verb_remove_pen() + set category = "Object" + set name = "Remove pen" + set src in usr + + if ( !(usr.stat || usr.restrained()) ) + var/obj/item/weapon/pen/O = locate() in src + if(O) + if (istype(loc, /mob)) + var/mob/M = loc + if(M.get_active_hand() == null) + M.put_in_hands(O) + usr << "You remove \the [O] from \the [src]." + return + O.loc = get_turf(src) + else + usr << "This PDA does not have a pen in it." + else + usr << "You cannot do this while restrained." + /obj/item/device/pda/proc/id_check(mob/user as mob, choice as num)//To check for IDs; 1 for in-pda use, 2 for out of pda use. if(choice == 1) if (id) remove_id() else - var/obj/item/I = user.equipped() + var/obj/item/I = user.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) user.drop_item() I.loc = src id = I else - var/obj/item/weapon/card/I = user.equipped() + var/obj/item/weapon/card/I = user.get_active_hand() if (istype(I, /obj/item/weapon/card/id) && I:registered_name) - if(id)//Get id and replace it. - user.drop_item() - I.loc = src - user.put_in_hand(id) - id = I - else//Insert id. - user.drop_item() - I.loc = src - id = I + var/obj/old_id = id + user.drop_item() + I.loc = src + id = I + user.put_in_hands(old_id) return // access to status display signals /obj/item/device/pda/attackby(obj/item/C as obj, mob/user as mob) ..() - if (istype(C, /obj/item/weapon/cartridge) && isnull(src.cartridge)) + if(istype(C, /obj/item/weapon/cartridge) && !cartridge) user.drop_item() C.loc = src - user << "\blue You insert [C] into [src]." + user << "You insert [C] into [src]." cartridge = C - if (C:radio) + if(C:radio) C:radio.hostpda = src - else if (istype(C, /obj/item/weapon/card/id) && C:registered_name) + else if(istype(C, /obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/idcard = C + if(!idcard.registered_name) + user << "\The [src] rejects the ID." + return if(!owner) - owner = C:registered_name - ownjob = C:assignment + owner = idcard.registered_name + ownjob = idcard.assignment name = "PDA-[owner] ([ownjob])" - user << "\blue Card scanned." + user << "Card scanned." else //Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand. - if ( ( (src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) ) - if ( !(user.stat || user.restrained()) )//If they can still act. + if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) ) + if(!(user.stat || user.restrained()) )//If they can still act. id_check(user, 2) - user << "\blue You put the ID into the [src.name]'s slot." + user << "You put the ID into \the [src]'s slot." updateSelfDialog()//Update self dialog on success. - return//Return in case of failed check or when successful. + return //Return in case of failed check or when successful. updateSelfDialog()//For the non-input related code. - else if (istype(C, /obj/item/device/paicard) && !src.pai) + else if(istype(C, /obj/item/device/paicard) && !src.pai) user.drop_item() C.loc = src pai = C - user << "\blue You slot \the [C] into [src]." + user << "You slot \the [C] into [src]." updateUsrDialog() + else if(istype(C, /obj/item/weapon/pen)) + var/obj/item/weapon/pen/O = locate() in src + if(O) + user << "There is already a pen in \the [src]." + else + user.drop_item() + C.loc = src + user << "You slide \the [C] into \the [src]." return -/obj/item/device/pda/attack(mob/C as mob, mob/user as mob) +/obj/item/device/pda/attack(mob/living/C as mob, mob/living/user as mob) if (istype(C, /mob/living/carbon)) switch(scanmode) if(1) @@ -900,7 +890,8 @@ user.show_message("\blue \t Damage Specifics: [C.getOxyLoss() > 50 ? "\red" : "\blue"][C.getOxyLoss()]-[C.getToxLoss() > 50 ? "\red" : "\blue"][C.getToxLoss()]-[C.getFireLoss() > 50 ? "\red" : "\blue"][C.getFireLoss()]-[C.getBruteLoss() > 50 ? "\red" : "\blue"][C.getBruteLoss()]", 1) user.show_message("\blue \t Key: Suffocation/Toxin/Burns/Brute", 1) user.show_message("\blue \t Body Temperature: [C.bodytemperature-T0C]°C ([C.bodytemperature*1.8-459.67]°F)", 1) -/* + if(C.tod && (C.stat == DEAD || (C.status_flags & FAKEDEATH))) + user.show_message("\blue \t Time of Death: [C.tod]") if(istype(C, /mob/living/carbon/human)) var/mob/living/carbon/human/H = C var/list/damaged = H.get_damaged_organs(1,1) @@ -910,7 +901,7 @@ user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.getDisplayName()),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1) else user.show_message("\blue \t Limbs are OK.",1) -*/ + for(var/datum/disease/D in C.viruses) if(!D.hidden[SCANNER]) user.show_message(text("\red Warning: [D.form] Detected\nName: [D.name].\nType: [D.spread].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure]")) @@ -923,7 +914,7 @@ user << "\blue No fingerprints found on [C]" else user << text("\blue [C]'s Fingerprints: [md5(C:dna.uni_identity)]") - if ( !C:blood_DNA || !C:blood_DNA.len ) + if ( !(C:blood_DNA) ) user << "\blue No blood found on [C]" if(C:blood_DNA) del(C:blood_DNA) @@ -944,8 +935,6 @@ user.show_message("\blue No radiation detected.") /obj/item/device/pda/afterattack(atom/A as mob|obj|turf|area, mob/user as mob) - if(!in_range(A, user)) - return switch(scanmode) if(2) if(!istype(A, /obj/item/weapon/f_card)) @@ -982,23 +971,18 @@ user << "\blue No significant chemical agents found in [A]." if (!scanmode && istype(A, /obj/item/weapon/paper) && owner) - if ((!isnull(uplink)) && (uplink.active)) - uplink.orignote = A:info - else - note = A:info + note = A:info user << "\blue Paper scanned." //concept of scanning paper copyright brainoblivion 2009 -/obj/item/device/pda/proc/explode() //This needs tuning. +/obj/item/device/pda/proc/explode() //This needs tuning. + if(!src.detonate) return var/turf/T = get_turf(src.loc) if (ismob(loc)) var/mob/M = loc M.show_message("\red Your [src] explodes!", 1) - if (src in M.contents) - if(fon) - fon = 0 - M.ul_SetLuminosity(M.LuminosityRed + (f_lum - 1), M.LuminosityGreen + (f_lum - 1), M.LuminosityBlue + (f_lum + 1)) + if(T) T.hotspot_expose(700,125) @@ -1008,6 +992,7 @@ return /obj/item/device/pda/Del() + PDAs -= src if (src.id) src.id.loc = get_turf(src.loc) ..() @@ -1022,9 +1007,9 @@ if (src.cartridge:honk_charges < 5) src.cartridge:honk_charges++ - M.pulling = null + M.stop_pulling() M << "\blue You slipped on the PDA!" - playsound(src.loc, 'slip.ogg', 50, 1, -3) + playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) M.Stun(8) M.Weaken(5) @@ -1033,7 +1018,7 @@ /mob/living/silicon/ai/verb/cmd_send_pdamesg() set category = "AI Commands" - set name = "Send PDA Message" + set name = "PDA - Send Message" var/list/names = list() var/list/plist = list() var/list/namecounts = list() @@ -1042,13 +1027,19 @@ usr << "You can't send PDA messages because you are dead!" return - for (var/obj/item/device/pda/P in world) + if(src.aiPDA.toff) + usr << "Turn on your receiver in order to send messages." + return + + for (var/obj/item/device/pda/P in PDAs) if (!P.owner) continue else if (P == src) continue else if (P.toff) continue + else if (P == src.aiPDA) + continue var/name = P.owner if (name in names) @@ -1060,44 +1051,53 @@ plist[text("[name]")] = P - var/c = input(usr, "Please select a PDA") as null|anything in plist + var/c = input(usr, "Please select a PDA") as null|anything in sortList(plist) if (!c) return var/selected = plist[c] - ai_send_pdamesg(selected) + src.aiPDA.create_message(src, selected) -/mob/living/silicon/ai/proc/ai_send_pdamesg(obj/selected as obj) - var/t = input(usr, "Please enter message", src.name, null) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) - if (!t) + +/mob/living/silicon/ai/verb/cmd_toggle_pda_receiver() + set category = "AI Commands" + set name = "PDA - Toggle Sender/Receiver" + if(usr.stat == 2) + usr << "You can't do that because you are dead!" return - - if (selected:toff) - return - var/obj/machinery/message_server/useMS = null - if(!isnull(message_servers)) - for (var/obj/machinery/message_server/MS in message_servers) - //PDAs are now dependant on the Message Server. - if(MS.active) - useMS = MS - break - if(!isnull(useMS)) // only send the message if it's stable - useMS.send_pda_message("[selected:owner]","[usr.name]","[t]") - - usr.show_message("PDA message to [selected:owner]: [t]") - selected:tnote += "← From (AI) [usr.name]:
      [t]
      " - - if (!selected:silent) - playsound(selected.loc, 'twobeep.ogg', 50, 1) - for (var/mob/O in hearers(3, selected.loc)) - O.show_message(text("\icon[selected] *[selected:ttone]*")) - - selected.overlays = null - selected.overlays += image('pda.dmi', "pda-r") + if(!isnull(aiPDA)) + aiPDA.toff = !aiPDA.toff + usr << "PDA sender/receiver toggled [(aiPDA.toff ? "Off" : "On")]!" else - usr << "ERROR: Server isn't responding." + usr << "You do not have a PDA. You should make an issue report about this." + +/mob/living/silicon/ai/verb/cmd_toggle_pda_silent() + set category = "AI Commands" + set name = "PDA - Toggle Ringer" + if(usr.stat == 2) + usr << "You can't do that because you are dead!" + return + if(!isnull(aiPDA)) + //0 + aiPDA.silent = !aiPDA.silent + usr << "PDA ringer toggled [(aiPDA.silent ? "Off" : "On")]!" + else + usr << "You do not have a PDA. You should make an issue report about this." + +/mob/living/silicon/ai/verb/cmd_show_message_log() + set category = "AI Commands" + set name = "PDA - Show Message Log" + if(usr.stat == 2) + usr << "You can't do that because you are dead!" + return + if(!isnull(aiPDA)) + var/HTML = "AI PDA Message Log[aiPDA.tnote]" + usr << browse(HTML, "window=log;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0") + else + usr << "You do not have a PDA. You should make an issue report about this." + + //Some spare PDAs in a box @@ -1105,7 +1105,7 @@ /obj/item/weapon/storage/PDAbox name = "spare PDAs" desc = "A box of spare PDA microcomputers." - icon = 'pda.dmi' + icon = 'icons/obj/pda.dmi' icon_state = "pdabox" item_state = "syringe_kit" foldable = /obj/item/stack/sheet/cardboard //BubbleWrap diff --git a/code/game/objects/devices/PDA/cart.dm b/code/game/objects/devices/PDA/cart.dm index 9804936b77..76c4ed01ae 100644 --- a/code/game/objects/devices/PDA/cart.dm +++ b/code/game/objects/devices/PDA/cart.dm @@ -1,7 +1,7 @@ /obj/item/weapon/cartridge name = "generic cartridge" desc = "A data cartridge for portable microcomputers." - icon = 'pda.dmi' + icon = 'icons/obj/pda.dmi' icon_state = "cart" item_state = "electronic" w_class = 1 @@ -10,6 +10,7 @@ var/access_security = 0 var/access_engine = 0 var/access_medical = 0 + var/access_manifest = 0 var/access_clown = 0 var/access_mime = 0 var/access_janitor = 0 @@ -61,6 +62,7 @@ icon_state = "cart-s" access_security = 1 access_medical = 1 + access_manifest = 1 janitor @@ -123,11 +125,13 @@ head name = "Easy-Record DELUXE" icon_state = "cart-h" + access_manifest = 1 access_status_display = 1 hop name = "HumanResources9001" icon_state = "cart-h" + access_manifest = 1 access_status_display = 1 access_quartermaster = 1 @@ -139,6 +143,7 @@ hos name = "R.O.B.U.S.T. DELUXE" icon_state = "cart-hos" + access_manifest = 1 access_status_display = 1 access_security = 1 @@ -150,12 +155,14 @@ ce name = "Power-On DELUXE" icon_state = "cart-ce" + access_manifest = 1 access_status_display = 1 access_engine = 1 cmo name = "Med-U DELUXE" icon_state = "cart-cmo" + access_manifest = 1 access_status_display = 1 access_reagent_scanner = 1 access_medical = 1 @@ -163,6 +170,7 @@ rd name = "Signal Ace DELUXE" icon_state = "cart-rd" + access_manifest = 1 access_status_display = 1 // access_reagent_scanner = 1 @@ -175,6 +183,7 @@ name = "Value-PAK Cartridge" desc = "Now with 200% more value!" icon_state = "cart-c" + access_manifest = 1 access_engine = 1 access_security = 1 access_medical = 1 @@ -182,7 +191,7 @@ access_status_display = 1 syndicate - name = "modified signaler cartridge" + name = "Detomatix Cartridge" icon_state = "cart" access_remote_door = 1 remote_door_id = "syndicate" //Make sure this matches the syndicate shuttle's shield/door id!! @@ -247,6 +256,14 @@ Code: [radio:code] + +
      "} + if (41) //crew manifest + + menu = "

      Crew Manifest

      " + menu += "Entries cannot be modified from this terminal.

      " + if(!isnull(data_core.general)) + for (var/datum/data/record/t in sortRecord(data_core.general)) + menu += "[t.fields["name"]] - [t.fields["rank"]]
      " + menu += "
      " if (42) //status displays @@ -318,8 +335,9 @@ Code: if (44) //medical records //This thing only displays a single screen so it's hard to really get the sub-menu stuff working. menu = "

      Medical Record List

      " - for (var/datum/data/record/R in data_core.general) - menu += "[R.fields["id"]]: [R.fields["name"]]
      " + if(!isnull(data_core.general)) + for (var/datum/data/record/R in sortRecord(data_core.general)) + menu += "
      [R.fields["id"]]: [R.fields["name"]]
      " menu += "
      " if(441) menu = "

      Medical Record

      " @@ -360,9 +378,9 @@ Code: menu += "
      " if (45) //security records menu = "

      Security Record List

      " - - for (var/datum/data/record/R in data_core.general) - menu += "
      [R.fields["id"]]: [R.fields["name"]]
      " + if(!isnull(data_core.general)) + for (var/datum/data/record/R in sortRecord(data_core.general)) + menu += "
      [R.fields["id"]]: [R.fields["name"]]
      " menu += "
      " if(451) @@ -478,7 +496,7 @@ Code: else for(var/obj/machinery/bot/mulebot/B in QC.botlist) - menu += "
      [B] at [get_area(B)]
      " + menu += "[B] at [B.loc.loc]
      " menu += "
      Scan for active bots
      " @@ -537,8 +555,8 @@ Code: if(ml) if (ml.z != cl.z) continue - - ldat += "Mop - \[[ml.x],[ml.y]\] - [M.reagents.total_volume ? "Wet" : "Dry"]
      " + var/direction = get_dir(src, M) + ldat += "Mop - \[[ml.x],[ml.y] ([uppertext(dir2text(direction))])\] - [M.reagents.total_volume ? "Wet" : "Dry"]
      " if (!ldat) menu += "None" @@ -554,8 +572,8 @@ Code: if(bl) if (bl.z != cl.z) continue - - ldat += "Bucket - \[[bl.x],[bl.y]\] - Water level: [B.reagents.total_volume]/100
      " + var/direction = get_dir(src, B) + ldat += "Bucket - \[[bl.x],[bl.y] ([uppertext(dir2text(direction))])\] - Water level: [B.reagents.total_volume]/100
      " if (!ldat) menu += "None" @@ -571,8 +589,8 @@ Code: if(bl) if (bl.z != cl.z) continue - - ldat += "Cleanbot - \[[bl.x],[bl.y]\] - [B.on ? "Online" : "Offline"]
      " + var/direction = get_dir(src, B) + ldat += "Cleanbot - \[[bl.x],[bl.y] ([uppertext(dir2text(direction))])\] - [B.on ? "Online" : "Offline"]
      " if (!ldat) menu += "None" @@ -581,6 +599,7 @@ Code: else menu += "ERROR: Unable to determine current location." + menu += "

      Refresh GPS Locator" proc/add_data(atom/A as mob|obj|turf|area) //I love hashtables. @@ -612,9 +631,9 @@ Code: blood[main_blood] = A.blood_DNA[blood] return 1 var/list/sum_list[4] //Pack it back up! - sum_list[1] = A.fingerprints ? A.fingerprints.Copy() : null - sum_list[2] = A.suit_fibers ? A.suit_fibers.Copy() : null - sum_list[3] = A.blood_DNA ? A.blood_DNA.Copy() : null + sum_list[1] = A.fingerprints + sum_list[2] = A.suit_fibers + sum_list[3] = A.blood_DNA sum_list[4] = "\The [A] in \the [get_area(A)]" stored_data["\ref [A]"] = sum_list return 0 diff --git a/code/game/objects/devices/PDA/radio.dm b/code/game/objects/devices/PDA/radio.dm index 575f738324..45bcff1c05 100644 --- a/code/game/objects/devices/PDA/radio.dm +++ b/code/game/objects/devices/PDA/radio.dm @@ -1,7 +1,7 @@ /obj/item/radio/integrated name = "PDA radio module" desc = "An electronic radio system of nanotrasen origin." - icon = 'module.dmi' + icon = 'icons/obj/module.dmi' icon_state = "power_mod" var/obj/item/device/pda/hostpda = null diff --git a/code/game/objects/devices/aicard.dm b/code/game/objects/devices/aicard.dm index f81d3e2089..7506365242 100644 --- a/code/game/objects/devices/aicard.dm +++ b/code/game/objects/devices/aicard.dm @@ -1,6 +1,6 @@ /obj/item/device/aicard name = "inteliCard" - icon = 'pda.dmi' + icon = 'icons/obj/pda.dmi' icon_state = "aicard" // aicard-full item_state = "electronic" w_class = 2.0 @@ -17,8 +17,6 @@ M.attack_log += text("\[[time_stamp()]\] Has been carded with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to card [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) carded [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) carded [M] ([M.ckey]) with [src].") log_attack("[user.name] ([user.ckey]) used the [src.name] to card [M.name] ([M.ckey])") @@ -119,9 +117,9 @@ A.control_disabled = !A.control_disabled A << "The intelicard's wireless port has been [A.control_disabled ? "disabled" : "enabled"]!" if (A.control_disabled) - overlays -= image('pda.dmi', "aicard-on") + overlays -= image('icons/obj/pda.dmi', "aicard-on") else - overlays += image('pda.dmi', "aicard-on") + overlays += image('icons/obj/pda.dmi', "aicard-on") attack_self(U) diff --git a/code/game/objects/devices/chameleonproj.dm b/code/game/objects/devices/chameleonproj.dm index 884dce7683..90f4949261 100644 --- a/code/game/objects/devices/chameleonproj.dm +++ b/code/game/objects/devices/chameleonproj.dm @@ -23,6 +23,8 @@ ..() master.disrupt() relaymove(var/mob/user, direction) + if(istype(loc, /turf/space)) return //No magical space movement! + if(can_move) can_move = 0 switch(usr.bodytemperature) @@ -40,7 +42,7 @@ return /obj/item/device/chameleon - name = "small device" + name = "chameleon-projector" icon_state = "shield0" flags = FPRINT | TABLEPASS| CONDUCT | USEDELAY slot_flags = SLOT_BELT @@ -52,7 +54,7 @@ origin_tech = "syndicate=4;magnets=4" var/can_use = 1 var/obj/effect/dummy/chameleon/active_dummy = null - var/saved_item = "/obj/item/weapon/shard" + var/saved_item = "/obj/item/weapon/cigbutt" dropped() disrupt() @@ -62,16 +64,16 @@ afterattack(atom/target, mob/user , flag) if(istype(target,/obj/item)) - playsound(src, 'flash.ogg', 100, 1, 1) + playsound(src, 'sound/weapons/flash.ogg', 100, 1, 1) user << "\blue Scanned [target]." saved_item = target.type proc/toggle() if(!can_use || !saved_item) return if(active_dummy) - playsound(src, 'pop.ogg', 100, 1, 1) + playsound(src, 'sound/effects/pop.ogg', 100, 1, 1) for(var/atom/movable/A in active_dummy) - A.loc = get_turf(active_dummy) + A.loc = active_dummy.loc if(ismob(A)) if(A:client) A:client:eye = A @@ -79,14 +81,14 @@ active_dummy = null usr << "\blue You deactivate the [src]." var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src)) - T.icon = 'effects.dmi' + T.icon = 'icons/effects/effects.dmi' flick("emppulse",T) spawn(8) del(T) else - playsound(src, 'pop.ogg', 100, 1, 1) - var/obj/O = new saved_item (src) + playsound(src, 'sound/effects/pop.ogg', 100, 1, 1) + var/obj/O = new saved_item(src) if(!O) return - var/obj/effect/dummy/chameleon/C = new/obj/effect/dummy/chameleon(get_turf(src)) + var/obj/effect/dummy/chameleon/C = new/obj/effect/dummy/chameleon(usr.loc) C.name = O.name C.desc = O.desc C.icon = O.icon @@ -98,7 +100,7 @@ del(O) usr << "\blue You activate the [src]." var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src)) - T.icon = 'effects.dmi' + T.icon = 'icons/effects/effects.dmi' flick("emppulse",T) spawn(8) del(T) @@ -109,7 +111,7 @@ spark_system.attach(src) spark_system.start() for(var/atom/movable/A in active_dummy) - A.loc = get_turf(active_dummy) + A.loc = active_dummy.loc if(ismob(A)) if(A:client) A:client:eye = A diff --git a/code/game/objects/devices/flash.dm b/code/game/objects/devices/flash.dm index 9b0f7b042b..c0945a79f4 100644 --- a/code/game/objects/devices/flash.dm +++ b/code/game/objects/devices/flash.dm @@ -2,12 +2,12 @@ name = "flash" desc = "Used for blinding and being an asshole." icon_state = "flash" + item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang) throwforce = 5 w_class = 1.0 throw_speed = 4 throw_range = 10 flags = FPRINT | TABLEPASS| CONDUCT - item_state = "electronic" origin_tech = "magnets=2;combat=1" var/times_used = 0 //Number of times it's been used. @@ -16,7 +16,7 @@ /obj/item/device/flash/proc/clown_check(var/mob/user) if(user && (CLUMSY in user.mutations) && prob(50)) - user << "\red The Flash slips out of your hand." + user << "\red \The [src] slips out of your hand." user.drop_item() return 0 return 1 @@ -37,14 +37,12 @@ M.attack_log += text("\[[time_stamp()]\] Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to flash [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) flashed [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) flashed [M] ([M.ckey]) with [src].") log_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [M.name] ([M.ckey])") if(!clown_check(user)) return if(broken) - user.show_message("The [src.name] is broken.", 2) + user << "\The [src] is broken." return flash_recharge() @@ -61,11 +59,9 @@ return times_used++ else //can only use it 5 times a minute - user.show_message("*click* *click*", 2) - for(var/mob/K in viewers(usr)) - K << 'empty.ogg' + user << "*click* *click*" return - playsound(src.loc, 'flash.ogg', 100, 1) + playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1) var/flashfail = 0 if(iscarbon(M)) @@ -75,44 +71,37 @@ flick("e_flash", M.flash) if(ishuman(M) && ishuman(user) && M.stat!=DEAD) - // kill all memes - for(var/mob/living/parasite/meme/P in M:parasites) - P << "\red The bright flash is unbearable.. You lose consciousness and fade away.." - P.death() - if(user.mind && user.mind in ticker.mode.head_revolutionaries) var/revsafe = 0 for(var/obj/item/weapon/implant/loyalty/L in M) if(L && L.implanted) revsafe = 1 break - M:update_mind() //give them a mind datum if they don't have one. won't work if they are logged out/ghosted or something. - if(M.mind) - if(M.mind.has_been_rev) - revsafe = 2 - if(!revsafe) - M.mind.has_been_rev = 1 - ticker.mode.add_revolutionary(M.mind) - else if(revsafe == 1) - user << "Something seems to be blocking the flash!" - else - user << "This mind seems resistant to the flash!" + M.mind_initialize() //give them a mind datum if they don't have one. + if(M.mind.has_been_rev) + revsafe = 2 + if(!revsafe) + M.mind.has_been_rev = 1 + ticker.mode.add_revolutionary(M.mind) + else if(revsafe == 1) + user << "Something seems to be blocking the flash!" + else + user << "This mind seems resistant to the flash!" user << "This mind is so vacant that it is not susceptible to influence!" else flashfail = 1 else if(issilicon(M)) - if(!M:flashproof()) - M.Weaken(rand(5,10)) - else - flashfail++ + M.Weaken(rand(5,10)) + else + flashfail = 1 if(isrobot(user)) spawn(0) var/atom/movable/overlay/animation = new(user.loc) animation.layer = user.layer + 1 animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = user flick("blspell", animation) sleep(5) @@ -120,11 +109,16 @@ if(!flashfail) flick("flash2", src) - for(var/mob/O in viewers(user, null)) - O.show_message("[user] blinds [M] with the flash!") + if(!issilicon(M)) + + user.visible_message("[user] blinds [M] with the flash!") + else + + user.visible_message("[user] overloads [M]'s sensors with the flash!") else - for(var/mob/O in viewers(user, null)) - O.show_message("[user] fails to blind [M] with the flash!") + + user.visible_message("[user] fails to blind [M] with the flash!") + return @@ -150,17 +144,15 @@ times_used++ else //can only use it 5 times a minute user.show_message("*click* *click*", 2) - for(var/mob/K in viewers(usr)) - K << 'empty.ogg' return - playsound(src.loc, 'flash.ogg', 100, 1) + playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1) flick("flash2", src) if(user && isrobot(user)) spawn(0) var/atom/movable/overlay/animation = new(user.loc) animation.layer = user.layer + 1 animation.icon_state = "blank" - animation.icon = 'mob.dmi' + animation.icon = 'icons/mob/mob.dmi' animation.master = user flick("blspell", animation) sleep(5) @@ -174,7 +166,8 @@ S.icon_state = "shield0" var/safety = M:eyecheck() if(!safety) - flick("flash", M.flash) + if(!M.blinded) + flick("flash", M.flash) return diff --git a/code/game/objects/devices/flashlight.dm b/code/game/objects/devices/flashlight.dm index 616dd5203c..c42462c455 100644 --- a/code/game/objects/devices/flashlight.dm +++ b/code/game/objects/devices/flashlight.dm @@ -8,6 +8,7 @@ slot_flags = SLOT_BELT m_amt = 50 g_amt = 20 + icon_action_button = "action_flashlight" var/on = 0 var/brightness_on = 4 //luminosity when on var/icon_on = "flight1" @@ -17,38 +18,39 @@ ..() if (on) icon_state = icon_on - src.ul_SetLuminosity(brightness_on, brightness_on, 0) + src.sd_SetLuminosity(brightness_on) else icon_state = icon_off - src.ul_SetLuminosity(0) + src.sd_SetLuminosity(0) /obj/item/device/flashlight/proc/update_brightness(var/mob/user = null) if (on) icon_state = icon_on if(src.loc == user) - user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + brightness_on, user.LuminosityBlue) + user.total_luminosity += brightness_on else if (isturf(src.loc)) - ul_SetLuminosity(brightness_on, brightness_on, 0) + src.sd_SetLuminosity(brightness_on) else icon_state = icon_off if(src.loc == user) - user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - brightness_on, user.LuminosityBlue) + user.total_luminosity -= brightness_on else if (isturf(src.loc)) - ul_SetLuminosity(0) + src.sd_SetLuminosity(0) /obj/item/device/flashlight/attack_self(mob/user) -// if(!isturf(user.loc)) -// user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. -// return + if(!isturf(user.loc)) + user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. + return on = !on update_brightness(user) return -/obj/item/device/flashlight/attack(mob/M as mob, mob/user as mob) +/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob) src.add_fingerprint(user) if(src.on && user.zone_sel.selecting == "eyes") + if (((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))//too dumb to use flashlight properly return ..()//just hit them in the head @@ -66,30 +68,31 @@ O.show_message("\blue [(O==user?"You direct":"[user] directs")] [src] to [(M==user? "your":"[M]")] eyes", 1) if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))//robots and aliens are unaffected - if(M.stat > 1 || M.disabilities & 128)//mob is dead or fully blind + if(M.stat == DEAD || M.sdisabilities & BLIND)//mob is dead or fully blind if(M!=user) - user.show_message(text("\red [] pupils does not react to the light!", M),1) + user.show_message("\red [M] pupils does not react to the light!",1) else if(XRAY in M.mutations)//mob has X-RAY vision if(M!=user) - user.show_message(text("\red [] pupils give an eerie glow!", M),1) + user.show_message("\red [M] pupils give an eerie glow!",1) else //nothing wrong - flick("flash", M.flash)//flash the affected mob - if(M!=user) - user.show_message(text("\blue [] pupils narrow", M),1) + if(!M.blinded) + flick("flash", M.flash)//flash the affected mob + if(M!=user) + user.show_message("\blue [M] pupils narrow",1) else return ..() /obj/item/device/flashlight/pickup(mob/user) if(on) - user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + brightness_on, user.LuminosityBlue) - src.ul_SetLuminosity(0) + user.total_luminosity += brightness_on + src.sd_SetLuminosity(0) /obj/item/device/flashlight/dropped(mob/user) if(on) - user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - brightness_on, user.LuminosityBlue) - src.ul_SetLuminosity(brightness_on) + user.total_luminosity -= brightness_on + src.sd_SetLuminosity(brightness_on) /obj/item/device/flashlight/pen @@ -101,7 +104,6 @@ icon_on = "plight1" icon_off = "plight0" brightness_on = 3 - w_class = 1 @@ -109,12 +111,10 @@ if(!ismob(M)) return user << "\red You stab [M] with the pen." -// M << "\red You feel a tiny prick!" + M << "\red You feel a tiny prick!" M.attack_log += text("\[[time_stamp()]\] Has been stabbed with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to stab [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) stabbed [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) stabbed [M] ([M.ckey]) with [src].") log_attack("[user.name] ([user.ckey]) Used the [src.name] to stab [M.name] ([M.ckey])") @@ -137,60 +137,11 @@ if(M.reagents) reagents.trans_to(M, 15) return - -//Looks like most of the clothing lights are here -/obj/item/clothing/head/helmet/hardhat/attack_self(mob/user) - if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. - return - on = !on - icon_state = "hardhat[on]_[color]" - item_state = "hardhat[on]_[color]" - - if(on) - user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) - else - user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue) - -/obj/item/clothing/head/helmet/hardhat/pickup(mob/user) - if(on) - user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) - ul_SetLuminosity(0) - -/obj/item/clothing/head/helmet/hardhat/dropped(mob/user) - if(on) - user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue) - ul_SetLuminosity(brightness_on, brightness_on - 1, 0) - -//RIG helmet light -/obj/item/clothing/head/helmet/space/rig/attack_self(mob/user) - if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. - return - on = !on - icon_state = "rig[on]-[color]" - item_state = "rig[on]-[color]" - - if(on) - user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) - else - user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue) - -/obj/item/clothing/head/helmet/space/rig/pickup(mob/user) - if(on) - user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) - ul_SetLuminosity(0) - -/obj/item/clothing/head/helmet/space/rig/dropped(mob/user) - if(on) - user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue) - ul_SetLuminosity(brightness_on, brightness_on - 1, 0) - // the desk lamps are a bit special /obj/item/device/flashlight/lamp name = "desk lamp" desc = "A desk lamp" - icon = 'lighting.dmi' + icon = 'icons/obj/lighting.dmi' icon_state = "lamp0" brightness_on = 5 icon_on = "lamp1" diff --git a/code/game/objects/devices/lightreplacer.dm b/code/game/objects/devices/lightreplacer.dm new file mode 100644 index 0000000000..e1d07158d3 --- /dev/null +++ b/code/game/objects/devices/lightreplacer.dm @@ -0,0 +1,210 @@ + +// Light Replacer (LR) +// +// ABOUT THE DEVICE +// +// This is a device supposedly to be used by Janitors and Janitor Cyborgs which will +// allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since +// they don't have hands or a way to replace lightbulbs. +// +// HOW IT WORKS +// +// You attack a light fixture with it, if the light fixture is broken it will replace the +// light fixture with a working light; the broken light is then placed on the floor for the +// user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture. +// +// HOW TO REFILL THE DEVICE +// +// It will need to be manually refilled with lights. +// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station. +// +// EMAGGED FEATURES +// +// NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore. +// +// I'm not sure everyone will react the emag's features so please say what your opinions are of it. +// +// When emagged it will rig every light it replaces, which will explode when the light is on. +// This is VERY noticable, even the device's name changes when you emag it so if anyone +// examines you when you're holding it in your hand, you will be discovered. +// It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy +// access to them, and only one of them can emag their device. +// +// The explosion cannot insta-kill anyone with 30% or more health. + +#define LIGHT_OK 0 +#define LIGHT_EMPTY 1 +#define LIGHT_BROKEN 2 +#define LIGHT_BURNED 3 + + +/obj/item/device/lightreplacer + + name = "light replacer" + desc = "A device to automatically replace lights. Refill with working lightbulbs." + + icon = 'icons/obj/janitor.dmi' + icon_state = "lightreplacer0" + item_state = "electronic" + + flags = FPRINT | CONDUCT + slot_flags = SLOT_BELT + origin_tech = "magnets=3;materials=2" + + var/max_uses = 20 + var/uses = 0 + var/inuse = 0 + var/emagged = 0 + var/failmsg = "" + // How much to increase per each glass? + var/increment = 5 + // How much to take from the glass? + var/decrement = 1 + var/charge = 1 + +/obj/item/device/lightreplacer/New() + uses = max_uses / 2 + failmsg = "The [name]'s refill light blinks red." + ..() + +/obj/item/device/lightreplacer/examine() + set src in view(2) + ..() + usr << "It has [uses] lights remaining." + +/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/weapon/card/emag) && emagged == 0) + Emag() + return + + if(istype(W, /obj/item/stack/sheet/glass)) + var/obj/item/stack/sheet/glass/G = W + if(G.amount - decrement >= 0 && uses < max_uses) + var/remaining = max(G.amount - decrement, 0) + if(!remaining && !(G.amount - decrement) == 0) + user << "There isn't enough glass." + return + G.amount = remaining + if(!G.amount) + user.drop_item() + del(G) + AddUses(increment) + user << "You insert a piece of glass into the [src.name]. You have [uses] lights remaining." + return + + if(istype(W, /obj/item/weapon/light)) + var/obj/item/weapon/light/L = W + if(L.status == 0) // LIGHT OKAY + if(uses < max_uses) + AddUses(1) + user << "You insert the [L.name] into the [src.name]. You have [uses] lights remaining." + user.drop_item() + del(L) + return + else + user << "You need a working light." + return + + +/obj/item/device/lightreplacer/attack_self(mob/user) + /* // This would probably be a bit OP. If you want it though, uncomment the code. + if(isrobot(user)) + var/mob/living/silicon/robot/R = user + if(R.emagged) + src.Emag() + usr << "You shortcircuit the [src]." + return + */ + usr << "It has [uses] lights remaining." + +/obj/item/device/lightreplacer/update_icon() + icon_state = "lightreplacer[emagged]" + + +/obj/item/device/lightreplacer/proc/Use(var/mob/user) + + if(inuse) return + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + var/pass = 0 + inuse = 1 + if(do_after(user, 30)) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + AddUses(-1) + pass = 1 + inuse = 0 + return pass + +// Negative numbers will subtract +/obj/item/device/lightreplacer/proc/AddUses(var/amount = 1) + uses = min(max(uses + amount, 0), max_uses) + +/obj/item/device/lightreplacer/proc/Charge(var/mob/user) + charge += 1 + if(charge > 7) + AddUses(1) + charge = 1 + +/obj/item/device/lightreplacer/proc/ReplaceLight(var/obj/machinery/light/target, var/mob/living/U) + + if(target.status != LIGHT_OK) + if(CanUse(U)) + if(!Use(U)) return + U << "You replace the [target.fitting] with the [src]." + + if(target.status != LIGHT_EMPTY) + + var/obj/item/weapon/light/L1 = new target.light_type(target.loc) + L1.status = target.status + L1.rigged = target.rigged + L1.brightness = target.brightness + L1.switchcount = target.switchcount + target.switchcount = 0 + L1.update() + + target.status = LIGHT_EMPTY + target.update() + + var/obj/item/weapon/light/L2 = new target.light_type() + + target.status = L2.status + target.switchcount = L2.switchcount + target.rigged = emagged + target.brightness = L2.brightness + target.on = target.has_power() + target.update() + del(L2) + + if(target.on && target.rigged) + target.explode() + return + + else + U << failmsg + return + else + U << "There is a working [target.fitting] already inserted." + return + +/obj/item/device/lightreplacer/proc/Emag() + emagged = !emagged + playsound(src.loc, "sparks", 100, 1) + if(emagged) + name = "Shortcircuited [initial(name)]" + else + name = initial(name) + update_icon() + +//Can you use it? + +/obj/item/device/lightreplacer/proc/CanUse(var/mob/living/user) + src.add_fingerprint(user) + //Not sure what else to check for. Maybe if clumsy? + if(uses > 0) + return 1 + else + return 0 + +#undef LIGHT_OK +#undef LIGHT_EMPTY +#undef LIGHT_BROKEN +#undef LIGHT_BURNED \ No newline at end of file diff --git a/code/game/objects/devices/paicard.dm b/code/game/objects/devices/paicard.dm index e13b7c605f..6425c138e7 100644 --- a/code/game/objects/devices/paicard.dm +++ b/code/game/objects/devices/paicard.dm @@ -1,6 +1,6 @@ /obj/item/device/paicard name = "personal AI device" - icon = 'pda.dmi' + icon = 'icons/obj/pda.dmi' icon_state = "pai" item_state = "electronic" w_class = 2.0 @@ -10,113 +10,127 @@ var/obj/item/device/radio/radio var/looking_for_personality = 0 var/mob/living/silicon/pai/pai - var/datum/paiCandidate/chatbot/chatbot - attack_self(mob/user) - if (!in_range(src, user)) - return - user.machine = src - var/dat = "Personal AI Device
      " - if(pai && (!pai.master_dna || !pai.master)) - dat += "Imprint Master DNA
      " - if(pai) - dat += "Installed Personality: [pai.name]
      " - dat += "Prime directive:
      [pai.pai_law0]
      " - dat += "Additional directives:
      [pai.pai_laws]
      " - dat += "Configure Directives
      " - dat += "
      " - dat += "

      Device Settings


      " - if(radio) - dat += "Radio Uplink
      " - dat += "Transmit: [(radio.wires & 4) ? "Enabled" : "Disabled"]
      " - dat += "Receive: [(radio.wires & 2) ? "Enabled" : "Disabled"]
      " - dat += "Signal Pulser: [(radio.wires & 1) ? "Enabled" : "Disabled"]
      " - else - dat += "Radio Uplink
      " - dat += "Radio firmware not loaded. Please install a pAI personality to load firmware.
      " - dat += "\[Wipe current pAI personality\]
      " - else - if(looking_for_personality) - dat += "Searching for a personality..." - dat += "\[View available personalities\]
      " - else - dat += "No personality is installed.
      " - dat += "\[Request personal AI personality\]
      " - dat += "Each time this button is pressed, a request will be sent out to any available personalities. Check back often and alot time for personalities to respond. This process could take anywhere from 15 seconds to several minutes, depending on the available personalities' timeliness." - user << browse(dat, "window=paicard") - onclose(user, "paicard") +/obj/item/device/paicard/New() + ..() + overlays += "pai-off" + +/obj/item/device/paicard/Del() + //Will stop people throwing friend pAIs into the singularity so they can respawn + if(!isnull(pai)) + pai.death(0) + ..() + +/obj/item/device/paicard/attack_self(mob/user) + if (!in_range(src, user)) return + user.machine = src + var/dat = "Personal AI Device
      " + if(pai && (!pai.master_dna || !pai.master)) + dat += "Imprint Master DNA
      " + if(pai) + dat += "Installed Personality: [pai.name]
      " + dat += "Prime directive:
      [pai.pai_law0]
      " + dat += "Additional directives:
      [pai.pai_laws]
      " + dat += "Configure Directives
      " + dat += "
      " + dat += "

      Device Settings


      " + if(radio) + dat += "Radio Uplink
      " + dat += "Transmit: [(radio.wires & 4) ? "Enabled" : "Disabled"]
      " + dat += "Receive: [(radio.wires & 2) ? "Enabled" : "Disabled"]
      " + dat += "Signal Pulser: [(radio.wires & 1) ? "Enabled" : "Disabled"]
      " + else + dat += "Radio Uplink
      " + dat += "Radio firmware not loaded. Please install a pAI personality to load firmware.
      " + dat += "\[Wipe current pAI personality\]
      " + else + if(looking_for_personality) + dat += "Searching for a personality..." + dat += "\[View available personalities\]
      " + else + dat += "No personality is installed.
      " + dat += "\[Request personal AI personality\]
      " + dat += "Each time this button is pressed, a request will be sent out to any available personalities. Check back often and alot time for personalities to respond. This process could take anywhere from 15 seconds to several minutes, depending on the available personalities' timeliness." + user << browse(dat, "window=paicard") + onclose(user, "paicard") + return - Topic(href, href_list) - - if(href_list["setdna"]) - if(pai.master_dna) - return - var/mob/M = usr - if(!istype(M, /mob/living/carbon)) - usr << "You don't have any DNA, or your DNA is incompatible with this device." - else - var/datum/dna/dna = usr.dna - pai.master = M.real_name - pai.master_dna = dna.unique_enzymes - if(istype(pai,/mob/living/silicon/pai/chatbot)) - if(istype(pai:P,/datum/text_parser/parser/eliza)) - var/datum/text_parser/parser/eliza/P = pai:P - P.yesno_state = "username" - P.yesno_param = M.real_name - P.input_line = "yes" - P.process_line() - pai << "

      You have been bound to a new master.

      " - if(href_list["request"]) - if(!looking_for_personality) - spawn(600) // wait a minute - chatbot = new() - alertUpdate() - src.looking_for_personality = 1 - paiController.findPAI(src, usr) - if(href_list["wipe"]) - var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No") - if(confirm == "Yes") - for(var/mob/M in src) - M << "

      You feel yourself slipping away from reality.

      " - M << "

      Byte by byte you lose your sense of self.

      " - M << "

      Your mental faculties leave you.

      " - M << "
      oblivion...
      " - M.death(0) - src.pai = null - if(href_list["wires"]) - var/t1 = text2num(href_list["wires"]) - if (radio.wires & t1) - radio.wires &= ~t1 - else - radio.wires |= t1 - if(href_list["setlaws"]) - var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN) - if(newlaws) - pai.pai_laws = newlaws - pai << "Your supplemental directives have been updated. Your new directives are:" - pai << "Prime Directive :
      [pai.pai_law0]" - pai << "Supplemental Directives:
      [pai.pai_laws]" - attack_self(usr) - +/obj/item/device/paicard/Topic(href, href_list) + if(href_list["setdna"]) + if(pai.master_dna) + return + var/mob/M = usr + if(!istype(M, /mob/living/carbon)) + usr << "You don't have any DNA, or your DNA is incompatible with this device." + else + var/datum/dna/dna = usr.dna + pai.master = M.real_name + pai.master_dna = dna.unique_enzymes + pai << "

      You have been bound to a new master.

      " + if(href_list["request"]) + src.looking_for_personality = 1 + paiController.findPAI(src, usr) + if(href_list["wipe"]) + var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No") + if(confirm == "Yes") + for(var/mob/M in src) + M << "

      You feel yourself slipping away from reality.

      " + M << "

      Byte by byte you lose your sense of self.

      " + M << "

      Your mental faculties leave you.

      " + M << "
      oblivion...
      " + M.death(0) + removePersonality() + if(href_list["wires"]) + var/t1 = text2num(href_list["wires"]) + if (radio.wires & t1) + radio.wires &= ~t1 + else + radio.wires |= t1 + if(href_list["setlaws"]) + var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN) + if(newlaws) + pai.pai_laws = newlaws + pai << "Your supplemental directives have been updated. Your new directives are:" + pai << "Prime Directive :
      [pai.pai_law0]" + pai << "Supplemental Directives:
      [pai.pai_laws]" + attack_self(usr) // WIRE_SIGNAL = 1 // WIRE_RECEIVE = 2 // WIRE_TRANSMIT = 4 - proc/alertUpdate() - var/turf/T = get_turf_or_move(src.loc) - for (var/mob/M in viewers(T)) - M.show_message("\blue [src] flashes a message across its screen, \"Additional personalities available for download.\"", 3, "\blue [src] bleeps electronically.", 2) +/obj/item/device/paicard/proc/setPersonality(mob/living/silicon/pai/personality) + src.pai = personality + src.overlays += "pai-happy" - emp_act(severity) - for(var/mob/M in src) - M.emp_act(severity) - ..() +/obj/item/device/paicard/proc/removePersonality() + src.pai = null + src.overlays = null + src.overlays += "pai-off" + +/obj/item/device/paicard/proc/setEmotion(var/emotion) + if(pai) + src.overlays = null + switch(emotion) + if(1) src.overlays += "pai-happy" + if(2) src.overlays += "pai-cat" + if(3) src.overlays += "pai-extremely-happy" + if(4) src.overlays += "pai-face" + if(5) src.overlays += "pai-laugh" + if(6) src.overlays += "pai-off" + if(7) src.overlays += "pai-sad" + if(8) src.overlays += "pai-angry" + if(9) src.overlays += "pai-what" + +/obj/item/device/paicard/proc/alertUpdate() + var/turf/T = get_turf_or_move(src.loc) + for (var/mob/M in viewers(T)) + M.show_message("\blue [src] flashes a message across its screen, \"Additional personalities available for download.\"", 3, "\blue [src] bleeps electronically.", 2) + +/obj/item/device/paicard/emp_act(severity) + for(var/mob/M in src) + M.emp_act(severity) + ..() - hear_talk(mob/M, text) - ..() - if(istype(pai, /mob/living/silicon/pai/chatbot)) - var/mob/living/silicon/pai/chatbot/C = pai - C.hear_talk(M, text) diff --git a/code/game/objects/devices/powersink.dm b/code/game/objects/devices/powersink.dm index 2b0c32a0d1..330790ace8 100644 --- a/code/game/objects/devices/powersink.dm +++ b/code/game/objects/devices/powersink.dm @@ -50,7 +50,7 @@ for(var/mob/M in viewers(user)) if(M == user) continue M << "[user] detaches the power sink from the cable." - ul_SetLuminosity(0) + sd_SetLuminosity(0) icon_state = "powersink0" return @@ -85,7 +85,7 @@ if(M == user) continue M << "[user] deactivates the power sink!" mode = 1 - ul_SetLuminosity(0) + sd_SetLuminosity(0) icon_state = "powersink0" processing_objects.Remove(src) @@ -94,7 +94,7 @@ var/datum/powernet/PN = attached.get_powernet() if(PN) if(!luminosity) - ul_SetLuminosity(12,3,0) + sd_SetLuminosity(12) // found a powernet, so drain up to max power from it @@ -115,7 +115,7 @@ if(power_drained > max_power * 0.95) - playsound(src, 'screech.ogg', 100, 1, 1) + playsound(src, 'sound/effects/screech.ogg', 100, 1, 1) if(power_drained >= max_power) processing_objects.Remove(src) explosion(src.loc, 3,6,9,12) diff --git a/code/game/objects/devices/scanners.dm b/code/game/objects/devices/scanners.dm index f7d12f9715..9cab9d9029 100644 --- a/code/game/objects/devices/scanners.dm +++ b/code/game/objects/devices/scanners.dm @@ -58,7 +58,7 @@ MASS SPECTROMETER M.invisibility = 0 spawn(2) if(M) - M.invisibility = 2 + M.invisibility = INVISIBILITY_LEVEL_TWO /obj/item/device/healthanalyzer @@ -76,9 +76,24 @@ MASS SPECTROMETER origin_tech = "magnets=1;biotech=1" var/mode = 1; -/obj/item/device/healthanalyzer/proc/analyze_health_less_info(mob/living/carbon/M as mob, mob/user as mob) +/obj/item/device/healthanalyzer/attack(mob/living/M as mob, mob/living/user as mob) + if (( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) + user << text("\red You try to analyze the floor's vitals!") + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1) + user.show_message(text("\blue Analyzing Results for The floor:\n\t Overall Status: Healthy"), 1) + user.show_message(text("\blue \t Damage Specifics: [0]-[0]-[0]-[0]"), 1) + user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1) + user.show_message("\blue Body Temperature: ???", 1) + return + if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") + usr << "\red You don't have the dexterity to do this!" + return + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has analyzed []'s vitals!", user, M), 1) + //Foreach goto(67) var/fake_oxy = max(rand(1,40), M.getOxyLoss(), (300 - (M.getToxLoss() + M.getFireLoss() + M.getBruteLoss()))) - if((M.reagents && M.reagents.has_reagent("zombiepowder")) || (M.changeling && M.changeling.changeling_fakedeath)) + if(M.status_flags & FAKEDEATH) user.show_message(text("\blue Analyzing Results for []:\n\t Overall Status: []", M, "dead"), 1) user.show_message(text("\blue \t Damage Specifics: []-[]-[]-[]", fake_oxy < 50 ? "\red [fake_oxy]" : fake_oxy , M.getToxLoss() > 50 ? "\red [M.getToxLoss()]" : M.getToxLoss(), M.getFireLoss() > 50 ? "\red[M.getFireLoss()]" : M.getFireLoss(), M.getBruteLoss() > 50 ? "\red[M.getBruteLoss()]" : M.getBruteLoss()), 1) else @@ -86,7 +101,9 @@ MASS SPECTROMETER user.show_message(text("\blue \t Damage Specifics: []-[]-[]-[]", M.getOxyLoss() > 50 ? "\red [M.getOxyLoss()]" : M.getOxyLoss(), M.getToxLoss() > 50 ? "\red [M.getToxLoss()]" : M.getToxLoss(), M.getFireLoss() > 50 ? "\red[M.getFireLoss()]" : M.getFireLoss(), M.getBruteLoss() > 50 ? "\red[M.getBruteLoss()]" : M.getBruteLoss()), 1) user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1) user.show_message("\blue Body Temperature: [M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F)", 1) - if(mode == 1 && istype(M, /mob/living/carbon/human)) + if(M.tod && (M.stat == DEAD || (M.status_flags & FAKEDEATH))) + user.show_message("\blue Time of Death: [M.tod]") + if(istype(M, /mob/living/carbon/human) && mode == 1) var/mob/living/carbon/human/H = M var/list/damaged = H.get_damaged_organs(1,1) user.show_message("\blue Localized Damage, Brute/Burn:",1) @@ -96,7 +113,7 @@ MASS SPECTROMETER else user.show_message("\blue \t Limbs are OK.",1) - if((M.changeling && M.changeling.changeling_fakedeath) || (M.reagents && M.reagents.has_reagent("zombiepowder"))) + if(M.status_flags & FAKEDEATH) user.show_message(text("\blue [] | [] | [] | []", fake_oxy > 50 ? "\red Severe oxygen deprivation detected\blue" : "Subject bloodstream oxygen level normal", M.getToxLoss() > 50 ? "\red Dangerous amount of toxins detected\blue" : "Subject bloodstream toxin level minimal", M.getFireLoss() > 50 ? "\red Severe burn damage detected\blue" : "Subject burn injury status O.K", M.getBruteLoss() > 50 ? "\red Severe anatomical damage detected\blue" : "Subject brute-force injury status O.K"), 1) else user.show_message(text("\blue [] | [] | [] | []", M.getOxyLoss() > 50 ? "\red Severe oxygen deprivation detected\blue" : "Subject bloodstream oxygen level normal", M.getToxLoss() > 50 ? "\red Dangerous amount of toxins detected\blue" : "Subject bloodstream toxin level minimal", M.getFireLoss() > 50 ? "\red Severe burn damage detected\blue" : "Subject burn injury status O.K", M.getBruteLoss() > 50 ? "\red Severe anatomical damage detected\blue" : "Subject brute-force injury status O.K"), 1) @@ -113,51 +130,6 @@ MASS SPECTROMETER user.show_message(text("\red Severe brain damage detected. Subject likely to have mental retardation."), 1) else if (M.getBrainLoss() >= 10) user.show_message(text("\red Significant brain damage detected. Subject may have had a concussion."), 1) - if (M.virus2 || M.reagents.reagent_list.len > 0) - user.show_message(text("\red Foreign substances detected in bloodstream."), 1) - if(ishuman(M)) - var/mob/living/carbon/human/H = M - for(var/name in H.organs) - var/datum/organ/external/e = H.organs[name] - var/limb = e.getDisplayName() - if(e.status & ORGAN_BROKEN) - if(((e.name == "l_arm") || (e.name == "r_arm") || (e.name == "l_leg") || (e.name == "r_leg")) && (!(e.status & ORGAN_SPLINTED))) - user << "\red Unsecured fracture in subject [limb]. Splinting recommended for transport." - for(var/name in H.organs) - var/datum/organ/external/e = H.organs[name] - if(e.status & ORGAN_BROKEN) - user.show_message(text("\red Bone fractures detected. Advanced scanner required for location."), 1) - break - if(ishuman(M)) - if(M:vessel) - var/blood_volume = round(M:vessel.get_reagent_amount("blood")) - var/blood_percent = blood_volume / 560 - blood_percent *= 100 - if(blood_volume <= 448) - user.show_message("\red Warning: Blood Level LOW: [blood_percent]% [blood_volume]cl") - else if(blood_volume <= 336) - user.show_message("\red Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl") - else - user.show_message("\blue Blood Level Normal: [blood_percent]% [blood_volume]cl") - return - -/obj/item/device/healthanalyzer/attack(mob/M as mob, mob/user as mob) - if (( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) - user << text("\red You try to analyze the floor's vitals!") - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1) - user.show_message(text("\blue Analyzing Results for The floor:\n\t Overall Status: Healthy"), 1) - user.show_message(text("\blue \t Damage Specifics: [0]-[0]-[0]-[0]"), 1) - user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1) - user.show_message("\blue Body Temperature: ???", 1) - return - if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") - usr << "\red You don't have the dexterity to do this!" - return - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has analyzed []'s vitals!", user, M), 1) - //Foreach goto(67) - analyze_health_less_info(M, user) src.add_fingerprint(user) return @@ -203,7 +175,7 @@ MASS SPECTROMETER var/datum/gas_mixture/environment = location.return_air() var/pressure = environment.return_pressure() - var/total_moles = environment.total_moles + var/total_moles = environment.total_moles() user.show_message("\blue Results:", 1) if(abs(pressure - ONE_ATMOSPHERE) < 10) diff --git a/code/game/objects/devices/shields.dm b/code/game/objects/devices/shields.dm index c48afdf548..daec59c901 100644 --- a/code/game/objects/devices/shields.dm +++ b/code/game/objects/devices/shields.dm @@ -27,7 +27,7 @@ /obj/item/weapon/cloaking_device name = "cloaking device" desc = "Use this to become invisible to the human eyesocket." - icon = 'device.dmi' + icon = 'icons/obj/device.dmi' icon_state = "shield0" var/active = 0.0 flags = FPRINT | TABLEPASS| CONDUCT @@ -53,4 +53,6 @@ /obj/item/weapon/cloaking_device/emp_act(severity) active = 0 icon_state = "shield0" - ..() \ No newline at end of file + if(ismob(loc)) + loc:update_icons() + ..() diff --git a/code/game/objects/devices/taperecorder.dm b/code/game/objects/devices/taperecorder.dm index de57d8b96b..d95b317c2a 100644 --- a/code/game/objects/devices/taperecorder.dm +++ b/code/game/objects/devices/taperecorder.dm @@ -14,31 +14,28 @@ var/list/storedinfo = new/list() var/list/timestamp = new/list() var/canprint = 1 - flags = FPRINT | TABLEPASS | CONDUCT + flags = FPRINT | TABLEPASS| CONDUCT throwforce = 2 throw_speed = 4 throw_range = 20 -/obj/item/device/taperecorder/hear_talk(mob/M as mob, msg) +/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg) if (recording) var/ending = copytext(msg, length(msg)) src.timestamp+= src.timerecorded - if (issilicon(M)) - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] [M.name] states, \"[msg]\"" - return if (M.stuttering) - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] [M.name] stammers, \"[msg]\"" + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] stammers, \"[msg]\"" return if (M.getBrainLoss() >= 60) - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] [M.name] gibbers, \"[msg]\"" + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] gibbers, \"[msg]\"" return if (ending == "?") - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] [M.name] asks, \"[msg]\"" + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] asks, \"[msg]\"" return else if (ending == "!") - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] [M.name] exclaims, \"[msg]\"" + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] exclaims, \"[msg]\"" return - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] [M.name] says, \"[msg]\"" + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] says, \"[msg]\"" return /obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -73,12 +70,12 @@ usr << "\red The tape recorder makes a scratchy noise." return src.icon_state = "taperecorderrecording" - if(src.timerecorded < 10800 && src.playing == 0) + if(src.timerecorded < 3600 && src.playing == 0) usr << "\blue Recording started." src.recording = 1 src.timestamp+= src.timerecorded - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] Recording started." - for(src.timerecorded, src.timerecorded<10800) + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording started." + for(src.timerecorded, src.timerecorded<3600) if(src.recording == 0) break src.timerecorded++ @@ -100,7 +97,7 @@ if (src.recording == 1) src.recording = 0 src.timestamp+= src.timerecorded - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] Recording stopped." + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording stopped." usr << "\blue Recording stopped." src.icon_state = "taperecorderidle" return @@ -153,7 +150,7 @@ src.playing = 1 src.icon_state = "taperecorderplaying" usr << "\blue Playing started." - for(var/i=1,src.timerecorded<10800,sleep(10 * (src.playsleepseconds) )) + for(var/i=1,src.timerecorded<3600,sleep(10 * (src.playsleepseconds) )) if (src.playing == 0) break if (src.storedinfo.len < i) @@ -213,8 +210,7 @@ for(var/i=1,src.storedinfo.len >= i,i++) t1 += "[src.storedinfo[i]]
      " P.info = t1 - P.name = "paper - 'Transcript'" - P.overlays += "paper_words" + P.name = "paper- 'Transcript'" canprint = 0 sleep(300) canprint = 1 @@ -229,12 +225,12 @@ usr << "\red The tape recorder makes a scratchy noise." return src.icon_state = "taperecorderrecording" - if(src.timerecorded < 10800 && src.playing == 0) + if(src.timerecorded < 3600 && src.playing == 0) usr << "\blue Recording started." src.recording = 1 src.timestamp+= src.timerecorded - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] Recording started." - for(src.timerecorded, src.timerecorded<10800) + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording started." + for(src.timerecorded, src.timerecorded<3600) if(src.recording == 0) break src.timerecorded++ @@ -251,7 +247,7 @@ if (src.recording == 1) src.recording = 0 src.timestamp+= src.timerecorded - src.storedinfo += "\[[time2text(src.timerecorded*10,"hh:mm:ss")]\] Recording stopped." + src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording stopped." usr << "\blue Recording stopped." src.icon_state = "taperecorderidle" return diff --git a/code/game/objects/devices/traitordevices.dm b/code/game/objects/devices/traitordevices.dm index 3c7387b997..33149b06a4 100644 --- a/code/game/objects/devices/traitordevices.dm +++ b/code/game/objects/devices/traitordevices.dm @@ -50,7 +50,7 @@ effective or pretty fucking useless. else M << "\red You feel a sudden, electric jolt travel through your head." - playsound(src.loc, 'interference.ogg', 50, 1) + playsound(src.loc, 'sound/misc/interference.ogg', 50, 1) user << "\blue You trigger [src]." times_used += 1 if(times_used >= max_uses) diff --git a/code/game/objects/displaycase.dm b/code/game/objects/displaycase.dm index d1cacdab4d..9fd89980da 100644 --- a/code/game/objects/displaycase.dm +++ b/code/game/objects/displaycase.dm @@ -47,7 +47,7 @@ playsound(src, "shatter", 70, 1) update_icon() else - playsound(src.loc, 'Glasshit.ogg', 75, 1) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) return /obj/structure/displaycase/update_icon() @@ -59,26 +59,6 @@ /obj/structure/displaycase/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/gun/energy/laser/captain)) - if(!src.occupied) - user << "\b You put the [W] back into the display case." - del(W) - src.occupied = 1 - update_icon() - return - if(istype(W, /obj/item/stack/sheet/glass)) - if(src.occupied && src.destroyed) - var/obj/item/stack/sheet/glass/G = W - user << "\b You repair the display case." - G.amount-- - if (G.amount <= 0) - user.update_clothing() - del(G) - src.destroyed = 0 - src.density = 1 - src.health = 30 - update_icon() - return src.health -= W.force src.healthcheck() ..() @@ -101,7 +81,6 @@ if ((O.client && !( O.blinded ))) O << text("\red [] kicks the display case.", usr) src.health -= 2 - src.add_fingerprint(user) healthcheck() return diff --git a/code/game/objects/door_assembly.dm b/code/game/objects/door_assembly.dm index 2b91902888..fa1a37f603 100644 --- a/code/game/objects/door_assembly.dm +++ b/code/game/objects/door_assembly.dm @@ -1,5 +1,5 @@ obj/structure/door_assembly - icon = 'door_assembly.dmi' + icon = 'icons/obj/doors/door_assembly.dmi' name = "Airlock Assembly" icon_state = "door_as_0" @@ -30,7 +30,7 @@ obj/structure/door_assembly name = "Command Airlock Assembly" icon_state = "door_as_com1" glass_base_icon_state = "door_as_gcom" - glass_type = /obj/machinery/door/airlock/glass/glass_command + glass_type = /obj/machinery/door/airlock/glass_command airlock_type = /obj/machinery/door/airlock/command anchored = 1 density = 1 @@ -45,7 +45,7 @@ obj/structure/door_assembly name = "Security Airlock Assembly" icon_state = "door_as_sec1" glass_base_icon_state = "door_as_gsec" - glass_type = /obj/machinery/door/airlock/glass/glass_security + glass_type = /obj/machinery/door/airlock/glass_security airlock_type = /obj/machinery/door/airlock/security anchored = 1 density = 1 @@ -60,7 +60,7 @@ obj/structure/door_assembly name = "Engineering Airlock Assembly" icon_state = "door_as_eng1" glass_base_icon_state = "door_as_geng" - glass_type = /obj/machinery/door/airlock/glass/glass_engineering + glass_type = /obj/machinery/door/airlock/glass_engineering airlock_type = /obj/machinery/door/airlock/engineering anchored = 1 density = 1 @@ -75,7 +75,7 @@ obj/structure/door_assembly name = "Mining Airlock Assembly" icon_state = "door_as_min1" glass_base_icon_state = "door_as_gmin" - glass_type = /obj/machinery/door/airlock/glass/glass_mining + glass_type = /obj/machinery/door/airlock/glass_mining airlock_type = /obj/machinery/door/airlock/mining anchored = 1 density = 1 @@ -90,7 +90,7 @@ obj/structure/door_assembly name = "Atmospherics Airlock Assembly" icon_state = "door_as_atmo1" glass_base_icon_state = "door_as_gatmo" - glass_type = /obj/machinery/door/airlock/glass/glass_atmos + glass_type = /obj/machinery/door/airlock/glass_atmos airlock_type = /obj/machinery/door/airlock/atmos anchored = 1 density = 1 @@ -105,7 +105,7 @@ obj/structure/door_assembly name = "Research Airlock Assembly" icon_state = "door_as_res1" glass_base_icon_state = "door_as_gres" - glass_type = /obj/machinery/door/airlock/glass/glass_research + glass_type = /obj/machinery/door/airlock/glass_research airlock_type = /obj/machinery/door/airlock/research anchored = 1 density = 1 @@ -116,6 +116,21 @@ obj/structure/door_assembly glass = 1 icon_state = "door_as_gres1" + door_assembly_science + name = "Science Airlock Assembly" + icon_state = "door_as_sci1" + glass_base_icon_state = "door_as_gsci" + glass_type = /obj/machinery/door/airlock/glass_science + airlock_type = /obj/machinery/door/airlock/science + anchored = 1 + density = 1 + state = 1 + glass = 0 + + glass + glass = 1 + icon_state = "door_as_gsci1" + door_assembly_med name = "Medical Airlock Assembly" icon_state = "door_as_med1" @@ -155,8 +170,17 @@ obj/structure/door_assembly state = 1 glass = 0 + door_assembly_hatch + name = "Airtight Hatch Assembly" + icon_state = "door_as_hatch1" + airlock_type = /obj/machinery/door/airlock/hatch + anchored = 1 + density = 1 + state = 1 + glass = 0 + door_assembly_mhatch - name = "Airtight Maintenance Hatch Assembly" + name = "Maintenance Hatch Assembly" icon_state = "door_as_mhatch1" airlock_type = /obj/machinery/door/airlock/maintenance_hatch anchored = 1 @@ -237,12 +261,30 @@ obj/structure/door_assembly state = 1 mineral = "sandstone" + door_assembly_sandstone + name = "Sandstone Airlock Assembly" + icon_state = "door_as_sandstone1" + airlock_type = /obj/machinery/door/airlock/sandstone + anchored = 1 + density = 1 + state = 1 + mineral = "sandstone" + + door_assembly_highsecurity // Borrowing this until WJohnston makes sprites for the assembly + name = "High Tech Security Assembly" + icon_state = "door_as_highsec1" + airlock_type = /obj/machinery/door/airlock/highsecurity + anchored = 1 + density = 1 + state = 1 + glass = 0 + /obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/weldingtool) && !anchored ) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0,user)) user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.") - playsound(src.loc, 'Welder2.ogg', 50, 1) + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) if(do_after(user, 40)) if(!src || !WT.isOn()) return @@ -278,7 +320,7 @@ obj/structure/door_assembly return else if(istype(W, /obj/item/weapon/wrench) && !anchored ) - playsound(src.loc, 'Ratchet.ogg', 100, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user.visible_message("[user] secures the airlock assembly to the floor.", "You start to secure the airlock assembly to the floor.") if(do_after(user, 40)) @@ -288,7 +330,7 @@ obj/structure/door_assembly src.anchored = 1 else if(istype(W, /obj/item/weapon/wrench) && anchored ) - playsound(src.loc, 'Ratchet.ogg', 100, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user.visible_message("[user] unsecures the airlock assembly from the floor.", "You start to unsecure the airlock assembly from the floor.") if(do_after(user, 40)) if(!src) return @@ -307,7 +349,7 @@ obj/structure/door_assembly src.name = "Wired Airlock Assembly" else if(istype(W, /obj/item/weapon/wirecutters) && state == 1 ) - playsound(src.loc, 'Wirecutter.ogg', 100, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.") if(do_after(user, 40)) @@ -318,7 +360,7 @@ obj/structure/door_assembly src.name = "Secured Airlock Assembly" else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 ) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.") user.drop_item() W.loc = src @@ -326,31 +368,16 @@ obj/structure/door_assembly if(do_after(user, 40)) if(!src) return user << "\blue You installed the airlock electronics!" - - var/obj/item/weapon/airlock_electronics/E = W - var/obj/structure/door_assembly/D = new E.style(loc) - D.state = 2 - D.glass = glass - if(glass) - // just in case user is setting a glass door to a type that doesn't have a glass version - if(ispath(D.glass_type)) - D.icon_state = "[D.glass_base_icon_state]2" - else - D.icon_state = "[D.base_icon_state]2" - // type doesn't support glass, drop it - D.glass = 0 - new/obj/item/stack/sheet/rglass(get_turf(src)) - D.name = "Near finished Airlock Assembly" - E.loc = D - D.electronics = W - del(src) + src.state = 2 + src.name = "Near finished Airlock Assembly" + src.electronics = W else W.loc = src.loc //del(W) else if(istype(W, /obj/item/weapon/crowbar) && state == 2 ) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to install electronics into the airlock assembly.") if(do_after(user, 40)) @@ -371,7 +398,7 @@ obj/structure/door_assembly if(G.amount>=1) switch(G.type) if(/obj/item/stack/sheet/rglass) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed reinforced glass windows into the airlock assembly!" @@ -382,7 +409,7 @@ obj/structure/door_assembly src.base_icon_state = "door_as_g" //this will be applied to the icon_state with the correct state number at the proc's end. if(/obj/item/stack/sheet/gold) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed gold plating into the airlock assembly!" @@ -393,7 +420,7 @@ obj/structure/door_assembly src.base_icon_state = "door_as_gold" if(/obj/item/stack/sheet/silver) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed silver plating into the airlock assembly!" @@ -404,7 +431,7 @@ obj/structure/door_assembly src.base_icon_state = "door_as_silver" if(/obj/item/stack/sheet/diamond) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed diamond plating into the airlock assembly!" @@ -415,7 +442,7 @@ obj/structure/door_assembly src.base_icon_state = "door_as_diamond" if(/obj/item/stack/sheet/uranium) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed uranium plating into the airlock assembly!" @@ -426,7 +453,7 @@ obj/structure/door_assembly src.base_icon_state = "door_as_uranium" if(/obj/item/stack/sheet/plasma) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed plasma plating into the airlock assembly!" @@ -437,19 +464,19 @@ obj/structure/door_assembly src.base_icon_state = "door_as_plasma" if(/obj/item/stack/sheet/clown) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed bananium plating into the airlock assembly!HONK" G.use(2) - playsound(src.loc, 'bikehorn.ogg', 15, 1, -3) + playsound(src.loc, 'sound/items/bikehorn.ogg', 15, 1, -3) src.mineral = "clown" src.name = "Near finished Bananium Airlock Assembly" src.airlock_type = /obj/machinery/door/airlock/clown src.base_icon_state = "door_as_clown" if(/obj/item/stack/sheet/sandstone) if(G.amount>=2) - playsound(src.loc, 'Crowbar.ogg', 100, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.") if(do_after(user, 40)) user << "\blue You installed sandstone plating into the airlock assembly!" @@ -460,7 +487,7 @@ obj/structure/door_assembly src.base_icon_state = "door_as_sandstone" else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 ) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) user << "\blue Now finishing the airlock." if(do_after(user, 40)) diff --git a/code/game/objects/effect_system.dm b/code/game/objects/effect_system.dm index 8d757fb750..878a0238eb 100644 --- a/code/game/objects/effect_system.dm +++ b/code/game/objects/effect_system.dm @@ -8,18 +8,14 @@ would spawn and follow the beaker, even if it is carried or thrown. /obj/effect/effect name = "effect" - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' mouse_opacity = 0 unacidable = 1//So effect are not targeted by alien acid. flags = TABLEPASS -/obj/effect/ex_act(severity) - if(severity) - del(src) - /obj/effect/effect/water name = "water" - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "extinguish" var/life = 15.0 flags = TABLEPASS @@ -27,7 +23,7 @@ would spawn and follow the beaker, even if it is carried or thrown. /obj/effect/effect/smoke name = "smoke" - icon = 'water.dmi' + icon = 'icons/effects/water.dmi' icon_state = "smoke" opacity = 1 anchored = 0.0 @@ -107,7 +103,7 @@ steam.start() -- spawns the effect ///////////////////////////////////////////// /obj/effect/effect/steam name = "steam" - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "extinguish" density = 0 @@ -124,7 +120,7 @@ steam.start() -- spawns the effect var/i = 0 for(i=0, i 20) return spawn(0) - if(holder && !istype(holder,/datum)) + if(holder) src.location = get_turf(holder) var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location) src.total_sparks++ @@ -228,7 +224,7 @@ steam.start() -- spawns the effect mouse_opacity = 0 var/amount = 6.0 //Remove this bit to use the old smoke - icon = '96x96.dmi' + icon = 'icons/effects/96x96.dmi' pixel_x = -32 pixel_y = -32 @@ -265,7 +261,7 @@ steam.start() -- spawns the effect if(src.total_smoke > 20) return spawn(0) - if(holder && !istype(holder,/datum)) + if(holder) src.location = get_turf(holder) var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(src.location) src.total_smoke++ @@ -295,7 +291,7 @@ steam.start() -- spawns the effect mouse_opacity = 0 var/amount = 6.0 //Remove this bit to use the old smoke - icon = '96x96.dmi' + icon = 'icons/effects/96x96.dmi' pixel_x = -32 pixel_y = -32 @@ -365,7 +361,7 @@ steam.start() -- spawns the effect if(src.total_smoke > 20) return spawn(0) - if(holder && !istype(holder,/datum)) + if(holder) src.location = get_turf(holder) var/obj/effect/effect/bad_smoke/smoke = new /obj/effect/effect/bad_smoke(src.location) src.total_smoke++ @@ -393,11 +389,9 @@ steam.start() -- spawns the effect opacity = 1 anchored = 0.0 mouse_opacity = 0 - pass_flags = PASSBLOB var/amount = 6.0 - var/divisor = 1 - icon = 'chemsmoke.dmi' + icon = 'icons/effects/chemsmoke.dmi' pixel_x = -32 pixel_y = -32 @@ -413,29 +407,18 @@ steam.start() -- spawns the effect /obj/effect/effect/chem_smoke/Move() ..() - var/obj/R = new /obj() - R.reagents = new/datum/reagents(500) - R.reagents.my_atom = R - if(reagents) - reagents.trans_to(R, reagents.total_volume/divisor) - for(var/atom/A in view(1, src)) - if(reagents.has_reagent("radium")||reagents.has_reagent("uranium")||reagents.has_reagent("carbon")||reagents.has_reagent("thermite"))//Prevents unholy radium spam by reducing the number of 'greenglows' down to something reasonable -Sieve - if(prob(5)) - R.reagents.reaction(A) - del(R) - else if(R && R.reagents) - R.reagents.reaction(A) - del(R) + for(var/atom/A in view(1, src)) + if(reagents.has_reagent("radium")||reagents.has_reagent("uranium")||reagents.has_reagent("carbon")||reagents.has_reagent("thermite"))//Prevents unholy radium spam by reducing the number of 'greenglows' down to something reasonable -Sieve + if(prob(5)) + reagents.reaction(A) + else + reagents.reaction(A) + return /obj/effect/effect/chem_smoke/HasEntered(mob/living/carbon/M as mob ) ..() - var/obj/R = new /obj() - R.reagents = new/datum/reagents(500) - R.reagents.my_atom = R - reagents.trans_to(R, reagents.total_volume/divisor) - R.reagents.reaction(M) - del(R) + reagents.reaction(M) return @@ -458,6 +441,12 @@ steam.start() -- spawns the effect cardinals = c carry.copy_to(chemholder, carry.total_volume) + /* + if((src.reagents.has_reagent("pacid")) || (src.reagents.has_reagent("lube"))) // Messages admins if someone sprays polyacid or space lube from a Cleaner bottle. + message_admins("[key_name_admin(user)] fired Polyacid/Space lube from a Cleaner bottle.") // Polymorph + log_game("[key_name(user)] fired Polyacid/Space lube from a Cleaner bottle.") +*/ + if(istype(loca, /turf/)) location = loca else @@ -465,40 +454,25 @@ steam.start() -- spawns the effect if(direct) direction = direct + if(carry.my_atom.fingerprintslast) + message_admins("A chemical smoke reaction has taken place in ([location.x], [location.y]). Last associated key is [carry.my_atom.fingerprintslast].") + log_game("A chemical smoke reaction has taken place in ([location.x], [location.y]). Last associated key is [carry.my_atom.fingerprintslast].") + else + message_admins("A chemical smoke reaction has taken place in ([location.x], [location.y]). No associated key.") + log_game("A chemical smoke reaction has taken place in ([location.x], [location.y]). No associated key.") + start() var/i = 0 - // Calculate the smokes' color - var/list/rgbcolor = list(0,0,0) - var/finalcolor - for(var/datum/reagent/re in chemholder.reagents.reagent_list) - if(!finalcolor) - rgbcolor = GetColors(re.color) - finalcolor = re.color - else - var/newcolor[3] - var/prergbcolor[3] - prergbcolor = rgbcolor - newcolor = GetColors(re.color) - - rgbcolor[1] = (prergbcolor[1]+newcolor[1])/2 - rgbcolor[2] = (prergbcolor[2]+newcolor[2])/2 - rgbcolor[3] = (prergbcolor[3]+newcolor[3])/2 - - finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3]) - - if(finalcolor) - finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3]) // slightly darker color + var/color = mix_color_from_reagents(chemholder.reagents.reagent_list) for(i=0, i 20) return spawn(0) - if(holder && !istype(holder,/datum)) + if(holder) src.location = get_turf(holder) - var/iterator = pick(0,1,1,1,2,2,2,3) var/obj/effect/effect/chem_smoke/smoke = new /obj/effect/effect/chem_smoke(src.location) - smoke.divisor = iterator + 1 src.total_smoke++ var/direction = src.direction if(!direction) @@ -508,16 +482,16 @@ steam.start() -- spawns the effect direction = pick(alldirs) if(chemholder.reagents.total_volume != 1) // can't split 1 very well - chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume*2 / number) // copy reagents to each smoke, divide evenly + chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / number) // copy reagents to each smoke, divide evenly - if(finalcolor) - smoke.icon += finalcolor // give the smoke color, if it has any to begin with + if(color) + smoke.icon += color // give the smoke color, if it has any to begin with else // if no color, just use the old smoke icon - smoke.icon = '96x96.dmi' + smoke.icon = 'icons/effects/96x96.dmi' smoke.icon_state = "smoke" - for(i=0, i 20) return spawn(0) - if(holder && !istype(holder,/datum)) + if(holder) src.location = get_turf(holder) var/obj/effect/effect/sleep_smoke/smoke = new /obj/effect/effect/sleep_smoke(src.location) src.total_smoke++ @@ -641,7 +615,7 @@ steam.start() -- spawns the effect /obj/effect/effect/mustard_gas/Move() ..() for(var/mob/living/carbon/human/R in get_turf(src)) - if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/storage/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor))) + if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor))) else R.burn_skin(0.75) if (R.coughedtime != 1) @@ -655,7 +629,7 @@ steam.start() -- spawns the effect /obj/effect/effect/mustard_gas/HasEntered(mob/living/carbon/human/R as mob ) ..() if (istype(R, /mob/living/carbon/human)) - if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/storage/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor))) + if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor))) return R.burn_skin(0.75) if (R.coughedtime != 1) @@ -688,7 +662,7 @@ steam.start() -- spawns the effect if(src.total_smoke > 20) return spawn(0) - if(holder && !istype(holder,/datum)) + if(holder) src.location = get_turf(holder) var/obj/effect/effect/mustard_gas/smoke = new /obj/effect/effect/mustard_gas(src.location) src.total_smoke++ @@ -829,11 +803,11 @@ steam.start() -- spawns the effect ..(loc) icon_state = "[ismetal ? "m":""]foam" metal = ismetal - playsound(src, 'bubbles2.ogg', 80, 1, -3) + playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3) spawn(3 + metal*3) process() spawn(120) - expand = 0 // stop expanding + processing_objects.Remove(src) sleep(30) if(metal) @@ -860,30 +834,27 @@ steam.start() -- spawns the effect return - while(expand) // keep trying to expand while true - - for(var/direction in cardinal) + for(var/direction in cardinal) - var/turf/T = get_step(src,direction) - if(!T) - continue + var/turf/T = get_step(src,direction) + if(!T) + continue - if(!T.Enter(src)) - continue + if(!T.Enter(src)) + continue - var/obj/effect/effect/foam/F = locate() in T - if(F) - continue + var/obj/effect/effect/foam/F = locate() in T + if(F) + continue - F = new(T, metal) - F.amount = amount - if(!metal) - F.create_reagents(10) - if (reagents) - for(var/datum/reagent/R in reagents.reagent_list) - F.reagents.add_reagent(R.id,1) - sleep(15) + F = new(T, metal) + F.amount = amount + if(!metal) + F.create_reagents(10) + if (reagents) + for(var/datum/reagent/R in reagents.reagent_list) + F.reagents.add_reagent(R.id,1) // foam disolves when heated // except metal foams @@ -904,9 +875,9 @@ steam.start() -- spawns the effect if (istype(M, /mob/living/carbon/human) && (istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP)) return - M.pulling = null + M.stop_pulling() M << "\blue You slipped on the foam!" - playsound(src.loc, 'slip.ogg', 50, 1, -3) + playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) M.Stun(5) M.Weaken(2) @@ -962,7 +933,7 @@ steam.start() -- spawns the effect // dense and opaque, but easy to break /obj/structure/foamedmetal - icon = 'effects.dmi' + icon = 'icons/effects/effects.dmi' icon_state = "metalfoam" density = 1 opacity = 0 // changed in New() @@ -975,10 +946,10 @@ steam.start() -- spawns the effect ..() update_nearby_tiles(1) spawn(1) - ul_SetOpacity(1) + sd_NewOpacity(1) Del() - ul_SetOpacity(0) + sd_NewOpacity(0) density = 0 update_nearby_tiles(1) ..() @@ -1039,13 +1010,10 @@ steam.start() -- spawns the effect user << "\blue You hit the metal foam to no effect." CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0) - if(!istype(mover)) - return 0 + if(air_group) return 0 return !density - // shouldn't this be a general procedure? - // not sure if this neccessary or overkill proc/update_nearby_tiles(need_rebuild) if(!air_master) return 0 diff --git a/code/game/objects/electricchair.dm b/code/game/objects/electricchair.dm index 0d159916cc..185573f864 100644 --- a/code/game/objects/electricchair.dm +++ b/code/game/objects/electricchair.dm @@ -1,107 +1,77 @@ /obj/structure/stool/bed/chair/e_chair - name = "electrified chair" - desc = "Looks absolutely terrifying!" - icon_state = "e_chair0" - var/atom/movable/overlay/overl = null - var/on = 0.0 - var/obj/item/assembly/shock_kit/part1 = null - var/isshocking - var/datum/effect/effect/system/spark_spread/spark = new /datum/effect/effect/system/spark_spread - var/list/mob/living/affected = list() + name = "electric chair" + desc = "Looks absolutely SHOCKING!" + icon_state = "echair0" + var/on = 0 + var/obj/item/assembly/shock_kit/part = null + var/last_time = 1.0 /obj/structure/stool/bed/chair/e_chair/New() - - src.overl = new /atom/movable/overlay( src.loc ) - src.overl.icon = 'objects.dmi' - src.overl.icon_state = "e_chairo0" - src.overl.layer = 5 - src.overl.name = "electrified chair" - src.overl.master = src - spark.set_up(12, 1, src) - return - -/obj/structure/stool/bed/chair/e_chair/Del() - - //src.overl = null - del(src.overl) - ..() + overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) return /obj/structure/stool/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/wrench)) - var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair( src.loc ) - playsound(src.loc, 'Ratchet.ogg', 50, 1) + if(istype(W, /obj/item/weapon/wrench)) + var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair(src.loc) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) C.dir = src.dir - src.part1.loc = src.loc - src.part1.master = null - src.part1 = null - //SN src = null + src.part.loc = src.loc + src.part.master = null + src.part = null del(src) return - if(istype(W, /obj/item/device/assembly/signaler)) - var/obj/item/assembly/shock_kit/kit = src.part1 - var/obj/item/device/radio/electropack/target = kit.part2 - var/obj/item/device/assembly/signaler/S = W - target.set_frequency(S.frequency) - target.code = S.code - for(var/mob/M in viewers(src, null)) - M.show_message("\red [user] has set the electric chair using the [W].") return -/obj/structure/stool/bed/chair/e_chair/verb/toggle_power() +/obj/structure/stool/bed/chair/e_chair/verb/toggle() set name = "Toggle Electric Chair" set category = "Object" set src in oview(1) - if ((usr.stat || usr.restrained() || !( usr.canmove ) || usr.lying)) - return - if(isshocking && on) - shock() - src.on = !( src.on ) - src.icon_state = text("e_chair[]", src.on) - src.overl.icon_state = text("e_chairo[]", src.on) + if(on) + on = 0 + icon_state = "echair0" + else + on = 1 + icon_state = "echair1" return /obj/structure/stool/bed/chair/e_chair/rotate() ..() overlays = null - overlays += image('objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete + overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete return /obj/structure/stool/bed/chair/e_chair/proc/shock() - if (!( src.on )) + if(!(src.on)) return - if(isshocking) - processing_objects.Remove(src) - src.icon_state = text("e_chair[]", src.on) - src.overl.icon_state = text("e_chairo[]", src.on) - for(var/mob/living/M in affected) - M.jitteriness = 0 - M.is_jittery = 0 - M.anchored = 0 - affected.Remove(M) - isshocking = 0 - return - else - src.icon_state = "e_chairs" - src.overl.icon_state = "e_chairos" - spark.start() - for(var/mob/M in hearers(src, null)) - M.show_message("\red The electric chair went off!.", 3, "\red You hear a deep sharp shock.", 2) - processing_objects.Add(src) - isshocking = 1 + if((src.last_time + 50) > world.time) return + src.last_time = world.time -/obj/structure/stool/bed/chair/e_chair/process() // special power handling var/area/A = get_area(src) - if(isarea(A) && A.powered(EQUIP)) - A.use_power(EQUIP, 5000) - for(var/mob/living/M in src.loc) - affected.Add(M) - M.make_jittery(1000) - M.anchored = 1 - M.Stun(600) - M.burn_skin(10) - spark.start() \ No newline at end of file + if(!isarea(A)) + return + if(!A.powered(EQUIP)) + return + A.use_power(EQUIP, 5000) + var/light = A.power_light + A.updateicon() + + flick("echair1", src) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(12, 1, src) + s.start() + if(buckled_mob) + buckled_mob.burn_skin(85) + buckled_mob << "\red You feel a deep shock course through your body!" + sleep(1) + buckled_mob.burn_skin(85) + buckled_mob.Stun(600) + for(var/mob/M in hearers(src, null)) + M.show_message("\red The electric chair went off!.", 3, "\red You hear a deep sharp shock.", 2) + + A.power_light = light + A.updateicon() + return \ No newline at end of file diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index 7ac272474a..4c02dd38ff 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -10,7 +10,7 @@ proc/empulse(turf/epicenter, heavy_range, light_range, log=0) if(heavy_range > 1) var/obj/effect/overlay/pulse = new/obj/effect/overlay ( epicenter ) - pulse.icon = 'effects.dmi' + pulse.icon = 'icons/effects/effects.dmi' pulse.icon_state = "emppulse" pulse.name = "emp pulse" pulse.anchored = 1 diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index cbcb08f79a..0a5b91648f 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -1,168 +1,64 @@ -var/roundExplosions = 1 +//TODO: Flash range does nothing currently + +//A very crude linear approximatiaon of pythagoras theorem. +/proc/cheap_pythag(var/dx, var/dy) + dx = abs(dx); dy = abs(dy); + if(dx>=dy) return dx + (0.5*dy) //The longest side add half the shortest side approximates the hypotenuse + else return dy + (0.5*dx) + proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1) - if(!epicenter) return - var/log_file = file("[time2text(world.timeofday, "statistics/DD-MM-YYYY.txt")]") - log_file << "Explosion | \The [get_area(epicenter)] | [devastation_range], [heavy_impact_range], [light_impact_range], [flash_range]" spawn(0) - if(defer_powernet_rebuild != 2) - defer_powernet_rebuild = 1 - if (!istype(epicenter, /turf)) - epicenter = get_turf(epicenter.loc) - //playsound(epicenter.loc, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) ) - playsound(epicenter.loc, "explosion", 100, 1, round(devastation_range,1) ) + var/start = world.timeofday + epicenter = get_turf(epicenter) + if(!epicenter) return - - var/close = range(world.view+round(devastation_range,1), epicenter) - // to all distanced mobs play a different sound - for(var/mob/M in world) if(M.z == epicenter.z) if(!(M in close)) - // check if the mob can hear - if(M.ear_deaf <= 0 || !M.ear_deaf) if(!istype(M.loc,/turf/space)) - M << 'explosionfar.ogg' - if (adminlog) - message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] (Jump)", admin_ref = 1) + if(adminlog) + message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])") log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") - tension_master.explosion() + playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(devastation_range*2,1) ) + playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) ) + + if(defer_powernet_rebuild != 2) + defer_powernet_rebuild = 1 if(heavy_impact_range > 1) var/datum/effect/system/explosion/E = new/datum/effect/system/explosion() E.set_up(epicenter) E.start() - var/list/dTurfs = list() //Holds the turfs in devestation range. - var/list/hTurfs = list() //Holds the turfs in heavy impact range, minus turfs in devestation range. - var/list/lTurfs = list() //Holds the turfs in light impact range, minus turfs in devestation range and heavy impact range. - var/list/fTurfs = list() //Holds turfs to loop through for mobs to flash. (Hehehe, dirty) + var/x0 = epicenter.x + var/y0 = epicenter.y + var/z0 = epicenter.z - //cael - replaced range() and circlerange() with FloodFill() to prevent explosions getting through shielding (ultrarealism mode) - //also lag is pre'y bad - /* - if(roundExplosions) - if(/obj/effect/energy_field in range(src, max(devastation_range, heavy_impact_range, light_impact_range))) - fTurfs = ExplosionCircleFloodFill(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = ExplosionCircleFloodFill(epicenter,devastation_range) - hTurfs = ExplosionCircleFloodFill(epicenter,heavy_impact_range) - dTurfs - lTurfs = ExplosionCircleFloodFill(epicenter,light_impact_range) - dTurfs - hTurfs + for(var/turf/T in range(epicenter, max(devastation_range, heavy_impact_range, light_impact_range))) + var/dist = cheap_pythag(T.x - x0,T.y - y0) + + if(dist < devastation_range) + dist = 1 + else if(dist < heavy_impact_range) + dist = 2 + else if(dist < light_impact_range) + dist = 3 else - fTurfs = circlerange(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = circlerange(epicenter,devastation_range) - hTurfs = circlerange(epicenter,heavy_impact_range) - dTurfs - lTurfs = circlerange(epicenter,light_impact_range) - dTurfs - hTurfs + continue - //add some stress to nearby shields - for(var/obj/effect/energy_field/E in circlerange(epicenter, devastation_range)) - E.Stress(3) - for(var/obj/effect/energy_field/E in circlerange(epicenter, heavy_impact_range)) - E.Stress(2) - for(var/obj/effect/energy_field/E in circlerange(epicenter, light_impact_range)) - E.Stress(1) - else - if(/obj/effect/energy_field in range(src, max(devastation_range, heavy_impact_range, light_impact_range))) - fTurfs = ExplosionFloodFill(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = ExplosionFloodFill(epicenter,devastation_range) - hTurfs = ExplosionFloodFill(epicenter,heavy_impact_range) - dTurfs - lTurfs = ExplosionFloodFill(epicenter,light_impact_range) - dTurfs - hTurfs - else - fTurfs = range(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = range(epicenter,devastation_range) - hTurfs = range(epicenter,heavy_impact_range) - dTurfs - lTurfs = range(epicenter,light_impact_range) - dTurfs - hTurfs + T.ex_act(dist) + if(T) + for(var/atom/object in T.contents) + object.ex_act(dist) - //add some stress to nearby shields - for(var/obj/effect/energy_field/E in range(epicenter, devastation_range)) - E.Stress(3) - for(var/obj/effect/energy_field/E in range(epicenter, heavy_impact_range)) - E.Stress(2) - for(var/obj/effect/energy_field/E in range(epicenter, light_impact_range)) - E.Stress(1)*/ - - if(roundExplosions) - if(locate(/obj/effect/energy_field) in range(src, max(devastation_range, heavy_impact_range, light_impact_range))) - fTurfs = circlerangeturfs(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = circlerangeturfs(epicenter,devastation_range) - hTurfs = circlerangeturfs(epicenter,heavy_impact_range) - dTurfs - lTurfs = circlerangeturfs(epicenter,light_impact_range) - dTurfs - hTurfs - else - fTurfs = circlerangeturfs(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = circlerangeturfs(epicenter,devastation_range) - hTurfs = circlerangeturfs(epicenter,heavy_impact_range) - dTurfs - lTurfs = circlerangeturfs(epicenter,light_impact_range) - dTurfs - hTurfs - - //add some stress to nearby shields - for(var/obj/effect/energy_field/E in circlerange(epicenter, devastation_range)) - E.Stress(3) - for(var/obj/effect/energy_field/E in circlerange(epicenter, heavy_impact_range)) - E.Stress(2) - for(var/obj/effect/energy_field/E in circlerange(epicenter, light_impact_range)) - E.Stress(1) - else - if(/obj/effect/energy_field in range(src, max(devastation_range, heavy_impact_range, light_impact_range))) - fTurfs = range(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = range(epicenter,devastation_range) - hTurfs = range(epicenter,heavy_impact_range) - dTurfs - lTurfs = range(epicenter,light_impact_range) - dTurfs - hTurfs - else - fTurfs = range(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range)) - dTurfs = range(epicenter,devastation_range) - hTurfs = range(epicenter,heavy_impact_range) - dTurfs - lTurfs = range(epicenter,light_impact_range) - dTurfs - hTurfs - - //add some stress to nearby shields - for(var/obj/effect/energy_field/E in range(epicenter, devastation_range)) - E.Stress(3) - for(var/obj/effect/energy_field/E in range(epicenter, heavy_impact_range)) - E.Stress(2) - for(var/obj/effect/energy_field/E in range(epicenter, light_impact_range)) - E.Stress(1) - - for(var/turf/T in dTurfs) //Loop through the turfs in devestation range. - spawn() //Try to pop each turf into it's own thread, speed things along. - if(T) //Sanity checking. - //Now, the actual explosion stuff happens. - if(prob(5)) - T.ex_act(2) - else - T.ex_act(1) - for(var/atom/object in T.contents) - spawn() - if(object) - object.ex_act(1) - - for(var/turf/T in hTurfs) - spawn() - if(T) - if(prob(15) && devastation_range > 2 && heavy_impact_range > 2) - secondaryexplosion(T, 1) - else - T.ex_act(2) - for(var/atom/object in T.contents) - spawn() - if(object) - object.ex_act(2) - - for(var/turf/T in lTurfs) - spawn() - if(T) - T.ex_act(3) - for(var/atom/object in T.contents) - spawn() - if(object) - object.ex_act(3) - - spawn() - for(var/mob/living/carbon/mob in fTurfs) - flick("flash", mob:flash) - - sleep(-1) - sleep(20) if(defer_powernet_rebuild != 2) defer_powernet_rebuild = 0 + + //here util we get explosions to be less laggy, might help us identify issues after changes to splosions (because let's face it we've had a few) + world.log << "## Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [(world.timeofday-start)/10] seconds." + return 1 proc/secondaryexplosion(turf/epicenter, range) - spawn() - for(var/turf/tile in range(range, epicenter)) - tile.ex_act(2) \ No newline at end of file + for(var/turf/tile in range(range, epicenter)) + tile.ex_act(2) \ No newline at end of file diff --git a/code/game/objects/explosion2.dm b/code/game/objects/explosion2.dm new file mode 100644 index 0000000000..a50a6f5e32 --- /dev/null +++ b/code/game/objects/explosion2.dm @@ -0,0 +1,115 @@ +//TODO: Flash range does nothing currently + +proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1) + spawn(0) + var/start = world.timeofday + epicenter = get_turf(epicenter) + if(!epicenter) return + + if(adminlog) + message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") + log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") + + playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(devastation_range*2,1) ) + playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) ) + + tension_master.explosion() + + if(defer_powernet_rebuild != 2) + defer_powernet_rebuild = 1 + + if(heavy_impact_range > 1) + var/datum/effect/system/explosion/E = new/datum/effect/system/explosion() + E.set_up(epicenter) + E.start() + + var/x = epicenter.x + var/y = epicenter.y + var/z = epicenter.z + + var/counter = 0 + + if(devastation_range > 0) + counter += explosion_turf(x,y,z,1) + else + devastation_range = 0 + if(heavy_impact_range > 0) + counter += explosion_turf(x,y,z,2) + else + heavy_impact_range = 0 + if(light_impact_range > 0) + counter += explosion_turf(x,y,z,3) + else + return + + //Diamond 'splosions (looks more round than square version) + for(var/i=0, i max_power) + max_power = power + return 1 + return 0 + +var/list/datum/explosion_turf/explosion_turfs = list() +var/explosion_in_progress = 0 + +proc/get_explosion_turf(var/turf/T) + for( var/datum/explosion_turf/ET in explosion_turfs ) + if( T == ET.turf ) + return ET + var/datum/explosion_turf/ET = new() + ET.turf = T + explosion_turfs += ET + return ET + +proc/explosion_rec(turf/epicenter, power) + + var/loopbreak = 0 + while(explosion_in_progress) + if(loopbreak >= 15) return + sleep(10) + loopbreak++ + + if(power <= 0) return + epicenter = get_turf(epicenter) + if(!epicenter) return + + message_admins("Explosion with size ([power]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])") + log_game("Explosion with size ([power]) in area [epicenter.loc.name] ") + + playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(power*2,1) ) + playsound(epicenter, "explosion", 100, 1, round(power,1) ) + + explosion_in_progress = 1 + explosion_turfs = list() + var/datum/explosion_turf/ETE = get_explosion_turf() + ETE.turf = epicenter + ETE.max_power = power + + //This steap handles the gathering of turfs which will be ex_act() -ed in the next step. It also ensures each turf gets the maximum possible amount of power dealt to it. + for(var/direction in cardinal) + var/turf/T = get_step(epicenter, direction) + T.explosion_spread(power - epicenter.explosion_resistance) + + //This step applies the ex_act effects for the explosion, as planned in the previous step. + for( var/datum/explosion_turf/ET in explosion_turfs ) + if(ET.max_power <= 0) continue + if(!ET.turf) continue + + var/severity = 4 - round(max(min( 3, (ET.max_power / 3) ) ,1), 1) + var/x = ET.turf.x + var/y = ET.turf.y + var/z = ET.turf.z + ET.turf.ex_act(severity) + if(!ET.turf) + ET.turf = locate(x,y,z) + for( var/atom/A in ET.turf ) + A.ex_act(severity) + + explosion_in_progress = 0 + +/turf + var/explosion_resistance + +/turf/space + explosion_resistance = 10 + +/turf/simulated/floor + explosion_resistance = 1 + +/turf/simulated/mineral + explosion_resistance = 2 + +/turf/simulated/shuttle/floor + explosion_resistance = 1 + +/turf/simulated/shuttle/floor4 + explosion_resistance = 1 + +/turf/simulated/shuttle/plating + explosion_resistance = 1 + +/turf/simulated/shuttle/wall + explosion_resistance = 5 + +/turf/simulated/wall + explosion_resistance = 5 + +/turf/simulated/r_wall + explosion_resistance = 25 + +/turf/simulated/wall/r_wall + explosion_resistance = 25 + +//Code-wise, a safe value for power is something up to ~25 or ~30.. This does quite a bit of damage to the station. +/turf/proc/explosion_spread(power) + if(power <= 0) + return + + var/datum/explosion_turf/ET = get_explosion_turf(src) + if(ET.max_power >= power) + return //The turf already sustained and spread a power greated than what we are dealing with. No point spreading again. + ET.max_power = power + + for(var/direction in cardinal) + var/turf/T = get_step(src, direction) + T.explosion_spread(power - src.explosion_resistance) + +/turf/unsimulated/explosion_spread(power) + return //So it doesn't get to the parent proc, which simulates explosions \ No newline at end of file diff --git a/code/game/objects/gibs.dm b/code/game/objects/gibs.dm index 0dcbf96450..f428716c0b 100644 --- a/code/game/objects/gibs.dm +++ b/code/game/objects/gibs.dm @@ -54,8 +54,6 @@ gib.blood_DNA = list() if(MobDNA) gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.b_type - if(MobDNA.original_name != "Unknown") - gib.OriginalMob = MobDNA.original_name else if(istype(src, /obj/effect/gibspawner/xeno)) gib.blood_DNA["UNKNOWN DNA"] = "X*" else if(istype(src, /obj/effect/gibspawner/human)) // Probably a monkey diff --git a/code/game/objects/glowshroom.dm b/code/game/objects/glowshroom.dm index 6a3f3410ee..9a04308ccf 100644 --- a/code/game/objects/glowshroom.dm +++ b/code/game/objects/glowshroom.dm @@ -5,7 +5,7 @@ anchored = 1 opacity = 0 density = 0 - icon = 'lighting.dmi' + icon = 'icons/obj/lighting.dmi' icon_state = "glowshroomf" layer = 2.1 var/endurance = 30 @@ -41,7 +41,7 @@ icon_state = "glowshroomf" spawn(2) //allows the luminosity and spread rate to be affected by potency at the moment of creation - ul_SetLuminosity(potency/10) + sd_SetLuminosity(potency/10) spawn(delay) if(src) Spread() diff --git a/code/game/objects/grenades/chem_grenade.dm b/code/game/objects/grenades/chem_grenade.dm new file mode 100644 index 0000000000..52dc55cbba --- /dev/null +++ b/code/game/objects/grenades/chem_grenade.dm @@ -0,0 +1,284 @@ +/obj/item/weapon/grenade/chem_grenade + name = "Grenade Casing" + icon_state = "chemg" + item_state = "flashbang" + w_class = 2.0 + force = 2.0 + var/stage = 0 + var/state = 0 + var/path = 0 + var/motion = 0 + var/direct = "SOUTH" + var/obj/item/weapon/circuitboard/circuit = null + var/list/beakers = new/list() + var/list/allowed_containers = list("/obj/item/weapon/reagent_containers/glass/beaker", "/obj/item/weapon/reagent_containers/glass/dispenser", "/obj/item/weapon/reagent_containers/glass/bottle") + var/affected_area = 3 + + New() + var/datum/reagents/R = new/datum/reagents(1000) + reagents = R + R.my_atom = src + + attack_self(mob/user as mob) + if(stage > 1) + ..() + + attackby(obj/item/weapon/W as obj, mob/user as mob)//TODO:Have grenades use the new assembly things + + if(istype(W,/obj/item/device/assembly_holder) && !stage && path != 2) + path = 1 + user << "\blue You add [W] to the metal casing." + playsound(src.loc, 'sound/items/Screwdriver2.ogg', 25, -3) + del(W) //Okay so we're not really adding anything here. cheating. + icon_state = initial(icon_state) +"_ass" + name = "unsecured grenade" + stage = 1 + else if(istype(W,/obj/item/weapon/screwdriver) && stage == 1 && path != 2) + path = 1 + if(beakers.len) + user << "\blue You lock the assembly." + playsound(src.loc, 'sound/items/Screwdriver.ogg', 25, -3) + name = "grenade" + icon_state = initial(icon_state) +"_locked" + stage = 2 + else + user << "\red You need to add at least one beaker before locking the assembly." + else if ((istype(W,/obj/item/weapon/reagent_containers/glass/beaker)||istype(W,/obj/item/weapon/reagent_containers/glass/dispenser)||istype(W,/obj/item/weapon/reagent_containers/glass/bottle)) && stage == 1 && path != 2) + path = 1 + if(beakers.len == 2) + user << "\red The grenade can not hold more containers." + return + else + if(W.reagents.total_volume) + user << "\blue You add \the [W] to the assembly." + user.drop_item() + W.loc = src + beakers += W + else + user << "\red \the [W] is empty." + + else if(path != 1) + if(!istype(src.loc,/turf)) + user << "\red You need to put the canister on the ground to do that!" + else + switch(state) + if(0) + if(istype(W, /obj/item/weapon/wrench)) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + if(do_after(user, 20)) + user << "\blue You wrench the canister in place." + src.name = "Camera Assembly" + src.anchored = 1 + src.state = 1 + path = 2 + if(1) + if(istype(W, /obj/item/weapon/wrench)) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + if(do_after(user, 20)) + user << "\blue You unfasten the canister." + src.name = "Grenade Casing" + src.anchored = 0 + src.state = 0 + path = 0 + if(istype(W, /obj/item/device/multitool)) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + user << "\blue You place the electronics inside the canister." + src.circuit = W + user.drop_item() + W.loc = src + if(istype(W, /obj/item/weapon/screwdriver) && circuit) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + user << "\blue You screw the circuitry into place." + src.state = 2 + if(istype(W, /obj/item/weapon/crowbar) && circuit) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + user << "\blue You remove the circuitry." + src.state = 1 + circuit.loc = src.loc + src.circuit = null + if(2) + if(istype(W, /obj/item/weapon/screwdriver) && circuit) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + user << "\blue You unfasten the circuitry." + src.state = 1 + if(istype(W, /obj/item/weapon/cable_coil)) + if(W:amount >= 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 20)) + W:amount -= 1 + if(!W:amount) del(W) + user << "\blue You add cabling to the canister." + src.state = 3 + if(3) + if(istype(W, /obj/item/weapon/wirecutters)) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) + user << "\blue You remove the cabling." + src.state = 2 + var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc ) + A.amount = 1 + if(issignaler(W)) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + user << "\blue You attach the wireless signaller unit to the circutry." + user.drop_item() + W.loc = src + src.state = 4 + if(4) + if(istype(W, /obj/item/weapon/crowbar) && !motion) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + user << "\blue You remove the remote signalling device." + src.state = 3 + new /obj/item/device/assembly/signaler( src.loc, 1 ) + if(isprox(W) && motion == 0) +// if(W:amount >= 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) +// W:use(1) + user << "\blue You attach the proximity sensor." + user.drop_item() + W.loc = src + motion = 1 + if(istype(W, /obj/item/weapon/crowbar) && motion) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + user << "\blue You remove the proximity sensor." + new /obj/item/device/assembly/prox_sensor( src.loc, 1 ) + motion = 0 + if(istype(W, /obj/item/stack/sheet/glass)) + if(W:amount >= 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 20)) + W:use(1) + user << "\blue You put in the glass lens." + src.state = 5 + if(5) + if(istype(W, /obj/item/weapon/crowbar)) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + user << "\blue You remove the glass lens." + src.state = 4 + new /obj/item/stack/sheet/glass( src.loc, 2 ) + if(istype(W, /obj/item/weapon/screwdriver)) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + user << "\blue You connect the lense." + var/obj/machinery/camera/B = null + if(motion == 1) + B = new /obj/machinery/camera/motion( src.loc ) + else + B = new /obj/machinery/camera( src.loc ) + // To prevent people exploiting the fact that it doesn't delete the assembly until the user is done + // entering the camera options. + src.loc = B + + //Auto detect walls and turn camera based on wall locations. + B.auto_turn() + + B.network = "SS13" + B.network = input(usr, "Which network would you like to connect this camera to?", "Set Network", "SS13") + + for(var/i = 5; i >= 0; i -= 1) + direct = input(user, "Direction?", "Assembling Camera", null) in list("LEAVE IT", "NORTH", "EAST", "SOUTH", "WEST" ) + if(direct != "LEAVE IT") + B.dir = text2dir(direct) + if(i != 0) + var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No") + if(confirm == "Yes") + break + del(src) + + prime() + if(prob(reliability)) + var/has_reagents = 0 + for(var/obj/item/weapon/reagent_containers/glass/G in beakers) + if(G.reagents.total_volume) has_reagents = 1 + + if(!has_reagents) + playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) + state = 0 + return + + playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1) + + for(var/obj/item/weapon/reagent_containers/glass/G in beakers) + G.reagents.trans_to(src, G.reagents.total_volume) + + if(src.reagents.total_volume) //The possible reactions didnt use up all reagents. + var/datum/effect/effect/system/steam_spread/steam = new /datum/effect/effect/system/steam_spread() + steam.set_up(10, 0, get_turf(src)) + steam.attach(src) + steam.start() + + for(var/atom/A in view(affected_area, src.loc)) + if( A == src ) continue + src.reagents.reaction(A, 1, 10) + + + invisibility = INVISIBILITY_MAXIMUM //Why am i doing this? + spawn(50) //To make sure all reagents can work + del(src) //correctly before deleting the grenade. + else + icon_state = initial(icon_state) + "_locked" + crit_fail = 1 + for(var/obj/item/weapon/reagent_containers/glass/G in beakers) + G.loc = get_turf(src.loc) + +/obj/item/weapon/grenade/chem_grenade/large + name = "Large Chem Grenade" + desc = "An oversized grenade that affects a larger area." + icon_state = "large_grenade" + allowed_containers = list("/obj/item/weapon/reagent_containers/glass") + origin_tech = "combat=3;materials=3" + affected_area = 4 + +/obj/item/weapon/grenade/chem_grenade/metalfoam + name = "Metal-Foam Grenade" + desc = "Used for emergency sealing of air breaches." + path = 1 + stage = 2 + + New() + ..() + var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent("aluminum", 30) + B2.reagents.add_reagent("foaming_agent", 10) + B2.reagents.add_reagent("pacid", 10) + + beakers += B1 + beakers += B2 + icon_state = "grenade" + +/obj/item/weapon/grenade/chem_grenade/incendiary + name = "Incendiary Grenade" + desc = "Used for clearing rooms of living things." + path = 1 + stage = 2 + + New() + ..() + var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent("aluminum", 25) + B2.reagents.add_reagent("plasma", 25) + B2.reagents.add_reagent("sacid", 25) + + beakers += B1 + beakers += B2 + icon_state = "grenade" + +/obj/item/weapon/grenade/chem_grenade/cleaner + name = "Cleaner Grenade" + desc = "BLAM!-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas." + stage = 2 + path = 1 + + New() + ..() + var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent("fluorosurfactant", 40) + B2.reagents.add_reagent("water", 40) + B2.reagents.add_reagent("cleaner", 10) + + beakers += B1 + beakers += B2 + icon_state = "grenade" diff --git a/code/game/objects/grenades/emgrenade.dm b/code/game/objects/grenades/emgrenade.dm new file mode 100644 index 0000000000..3454f9b9fa --- /dev/null +++ b/code/game/objects/grenades/emgrenade.dm @@ -0,0 +1,11 @@ +/obj/item/weapon/grenade/empgrenade + name = "emp grenade" + icon_state = "emp" + item_state = "emp" + origin_tech = "materials=2;magnets=3" + + prime() + ..() + if(empulse(src, 5, 7)) + del(src) + return diff --git a/code/game/objects/grenades/flashbang.dm b/code/game/objects/grenades/flashbang.dm new file mode 100644 index 0000000000..2ff047a746 --- /dev/null +++ b/code/game/objects/grenades/flashbang.dm @@ -0,0 +1,172 @@ +/obj/item/weapon/grenade/flashbang + name = "flashbang" + icon_state = "flashbang" + item_state = "flashbang" + origin_tech = "materials=2;combat=1" + var/banglet = 0 + + prime() + ..() + for(var/obj/structure/closet/L in view(get_turf(src), null)) + if(locate(/mob/living/carbon/, L)) + for(var/mob/living/carbon/M in L) + bang(get_turf(src), M) + + + for(var/mob/living/carbon/M in viewers(get_turf(src), null)) + bang(get_turf(src), M) + + for(var/obj/effect/blob/B in view(8,get_turf(src))) //Blob damage here + var/damage = round(30/(get_dist(B,get_turf(src))+1)) + B.health -= damage + B.update_icon() + del(src) + return + + proc/bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged. + if (locate(/obj/item/weapon/cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging + for(var/obj/item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions. + S.active = 0 // -- Polymorph + S.icon_state = "shield0" + + M << "\red BANG" + playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) + +//Checking for protections + var/eye_safety = 0 + var/ear_safety = 0 + if(iscarbon(M)) + eye_safety = M.eyecheck() + if(ishuman(M)) + if(istype(M:ears, /obj/item/clothing/ears/earmuffs)) + ear_safety += 2 + if(HULK in M.mutations) + ear_safety += 1 + if(istype(M:head, /obj/item/clothing/head/helmet)) + ear_safety += 1 + +//Flashing everyone + if(eye_safety < 1) + flick("e_flash", M.flash) + M.eye_stat += rand(1, 3) + M.Stun(2) + M.Weaken(10) + + + +//Now applying sound + if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M)) + if(ear_safety > 0) + M.Stun(2) + M.Weaken(1) + else + M.Stun(10) + M.Weaken(3) + if ((prob(14) || (M == src.loc && prob(70)))) + M.ear_damage += rand(1, 10) + else + M.ear_damage += rand(0, 5) + M.ear_deaf = max(M.ear_deaf,15) + + else if(get_dist(M, T) <= 5) + if(!ear_safety) + M.Stun(8) + M.ear_damage += rand(0, 3) + M.ear_deaf = max(M.ear_deaf,10) + + else if(!ear_safety) + M.Stun(4) + M.ear_damage += rand(0, 1) + M.ear_deaf = max(M.ear_deaf,5) + +//This really should be in mob not every check + if (M.eye_stat >= 20) + M << "\red Your eyes start to burn badly!" + M.disabilities |= NEARSIGHTED + if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang))) + if (prob(M.eye_stat - 20 + 1)) + M << "\red You can't see anything!" + M.sdisabilities |= BLIND + if (M.ear_damage >= 15) + M << "\red Your ears start to ring badly!" + if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang))) + if (prob(M.ear_damage - 10 + 5)) + M << "\red You can't hear anything!" + M.sdisabilities |= DEAF + else + if (M.ear_damage >= 5) + M << "\red Your ears start to ring!" + M.update_icons() + + +/obj/item/weapon/grenade/flashbang/clusterbang//Created by Polymorph, fixed by Sieve + desc = "Use of this weapon may constiute a war crime in your area, consult your local captain." + name = "clusterbang" + icon = 'icons/obj/grenade.dmi' + icon_state = "clusterbang" + +/obj/item/weapon/grenade/flashbang/clusterbang/prime() + var/numspawned = rand(4,8) + var/again = 0 + for(var/more = numspawned,more > 0,more--) + if(prob(35)) + again++ + numspawned -- + + for(,numspawned > 0, numspawned--) + spawn(0) + new /obj/item/weapon/grenade/flashbang/cluster(src.loc)//Launches flashbangs + playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) + + for(,again > 0, again--) + spawn(0) + new /obj/item/weapon/grenade/flashbang/clusterbang/segment(src.loc)//Creates a 'segment' that launches a few more flashbangs + playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) + spawn(0) + del(src) + return + +/obj/item/weapon/grenade/flashbang/clusterbang/segment + desc = "A smaller segment of a clusterbang. Better run." + name = "clusterbang segment" + icon = 'icons/obj/grenade.dmi' + icon_state = "clusterbang_segment" + +/obj/item/weapon/grenade/flashbang/clusterbang/segment/New()//Segments should never exist except part of the clusterbang, since these immediately 'do their thing' and asplode + icon_state = "clusterbang_segment_active" + active = 1 + banglet = 1 + var/stepdist = rand(1,4)//How far to step + var/temploc = src.loc//Saves the current location to know where to step away from + walk_away(src,temploc,stepdist)//I must go, my people need me + var/dettime = rand(15,60) + spawn(dettime) + prime() + ..() + +/obj/item/weapon/grenade/flashbang/clusterbang/segment/prime() + var/numspawned = rand(4,8) + for(var/more = numspawned,more > 0,more--) + if(prob(35)) + numspawned -- + + for(,numspawned > 0, numspawned--) + spawn(0) + new /obj/item/weapon/grenade/flashbang/cluster(src.loc) + playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) + spawn(0) + del(src) + return + +/obj/item/weapon/grenade/flashbang/cluster/New()//Same concept as the segments, so that all of the parts don't become reliant on the clusterbang + spawn(0) + icon_state = "flashbang_active" + active = 1 + banglet = 1 + var/stepdist = rand(1,3) + var/temploc = src.loc + walk_away(src,temploc,stepdist) + var/dettime = rand(15,60) + spawn(dettime) + prime() + ..() \ No newline at end of file diff --git a/code/game/objects/grenades/grenade.dm b/code/game/objects/grenades/grenade.dm new file mode 100644 index 0000000000..035ef2f3ee --- /dev/null +++ b/code/game/objects/grenades/grenade.dm @@ -0,0 +1,106 @@ +/obj/item/weapon/grenade + name = "grenade" + desc = "A hand held grenade, with an adjustable timer." + w_class = 2.0 + icon = 'icons/obj/grenade.dmi' + icon_state = "grenade" + item_state = "flashbang" + throw_speed = 4 + throw_range = 20 + flags = FPRINT | TABLEPASS | CONDUCT + slot_flags = SLOT_BELT + var/active = 0 + var/det_time = 50 + +/obj/item/weapon/grenade/proc/clown_check(var/mob/living/user) + if((CLUMSY in user.mutations) && prob(50)) + user << "Huh? How does this thing work?" + active = 1 + icon_state = initial(icon_state) + "_active" + playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) + spawn(5) + if(user) + user.drop_item() + prime() + return 0 + return 1 + + +/*/obj/item/weapon/grenade/afterattack(atom/target as mob|obj|turf|area, mob/user as mob) + if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container + if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() + if((user.get_active_hand() == src) && (!active) && (clown_check(user)) && target.loc != src.loc) + user << "You prime the [name]! [det_time/10] seconds!" + active = 1 + icon_state = initial(icon_state) + "_active" + playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) + spawn(det_time) + prime() + return + user.dir = get_dir(user, target) + user.drop_item() + var/t = (isturf(target) ? target : target.loc) + walk_towards(src, t, 3) + return*/ + + +/obj/item/weapon/grenade/examine() + set src in usr + usr << desc + if(det_time > 1) + usr << "The timer is set to [det_time/10] seconds." + return + usr << "\The [src] is set for instant detonation." + + +/obj/item/weapon/grenade/attack_self(mob/user as mob) + if(!active) + if(clown_check(user)) + user << "You prime the [name]! [det_time/10] seconds!" + active = 1 + icon_state = initial(icon_state) + "_active" + add_fingerprint(user) + if(iscarbon(user)) + var/mob/living/carbon/C = user + C.throw_mode_on() + spawn(det_time) + if(user) + user.drop_item() + prime() + return + return + + +/obj/item/weapon/grenade/proc/prime() +// playsound(loc, 'sound/items/Welder2.ogg', 25, 1) + var/turf/T = get_turf(src) + if(T) + T.hotspot_expose(700,125) + + +/obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(isscrewdriver(W)) + switch(det_time) + if ("1") + det_time = 10 + user << "You set the [name] for 1 second detonation time." + if ("10") + det_time = 30 + user << "You set the [name] for 3 second detonation time." + if ("30") + det_time = 50 + user << "You set the [name] for 5 second detonation time." + if ("50") + det_time = 1 + user << "You set the [name] for instant detonation." + add_fingerprint(user) + ..() + return + +/obj/item/weapon/grenade/attack_hand() + walk(src, null, null) + ..() + return + +/obj/item/weapon/grenade/attack_paw(mob/user as mob) + return attack_hand(user) diff --git a/code/game/objects/grenades/smokebomb.dm b/code/game/objects/grenades/smokebomb.dm new file mode 100644 index 0000000000..aa8920bb4f --- /dev/null +++ b/code/game/objects/grenades/smokebomb.dm @@ -0,0 +1,35 @@ +/obj/item/weapon/grenade/smokebomb + desc = "It is set to detonate in 2 seconds." + name = "smoke bomb" + icon = 'icons/obj/grenade.dmi' + icon_state = "flashbang" + det_time = 20 + item_state = "flashbang" + flags = FPRINT | TABLEPASS | USEDELAY + slot_flags = SLOT_BELT + var/datum/effect/effect/system/bad_smoke_spread/smoke + + New() + ..() + src.smoke = new /datum/effect/effect/system/bad_smoke_spread + src.smoke.attach(src) + src.smoke.set_up(10, 0, usr.loc) + + prime() + playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3) + spawn(0) + src.smoke.start() + sleep(10) + src.smoke.start() + sleep(10) + src.smoke.start() + sleep(10) + src.smoke.start() + + for(var/obj/effect/blob/B in view(8,src)) + var/damage = round(30/(get_dist(B,src)+1)) + B.health -= damage + B.update_icon() + sleep(80) + del(src) + return diff --git a/code/game/objects/grenades/spawnergrenade.dm b/code/game/objects/grenades/spawnergrenade.dm new file mode 100644 index 0000000000..fe15703fa2 --- /dev/null +++ b/code/game/objects/grenades/spawnergrenade.dm @@ -0,0 +1,52 @@ +/obj/item/weapon/grenade/spawnergrenade + desc = "It is set to detonate in 5 seconds. It will unleash unleash an unspecified anomaly into the vicinity." + name = "delivery grenade" + icon = 'icons/obj/grenade.dmi' + icon_state = "delivery" + item_state = "flashbang" + origin_tech = "materials=3;magnets=4" + var/banglet = 0 + var/spawner_type = null // must be an object path + var/deliveryamt = 1 // amount of type to deliver + + prime() // Prime now just handles the two loops that query for people in lockers and people who can see it. + + if(spawner_type && deliveryamt) + // Make a quick flash + var/turf/T = get_turf(src) + playsound(T, 'sound/effects/phasein.ogg', 100, 1) + for(var/mob/living/carbon/human/M in viewers(T, null)) + if(M:eyecheck() <= 0) + flick("e_flash", M.flash) // flash dose faggots + + for(var/i=1, i<=deliveryamt, i++) + var/atom/movable/x = new spawner_type + x.loc = T + if(prob(50)) + for(var/j = 1, j <= rand(1, 3), j++) + step(x, pick(NORTH,SOUTH,EAST,WEST)) + + // Spawn some hostile syndicate critters + if(istype(x, /obj/effect/critter)) + var/obj/effect/critter/C = x + + C.atkcarbon = 1 + C.atksilicon = 1 + C.atkmech = 0 + C.atksynd = 0 + C.aggressive = 1 + + del(src) + return + +/obj/item/weapon/grenade/spawnergrenade/manhacks + name = "manhack delivery grenade" + spawner_type = /obj/effect/critter/manhack + deliveryamt = 5 + origin_tech = "materials=3;magnets=4;syndicate=4" + +/obj/item/weapon/grenade/spawnergrenade/spesscarp + name = "carp delivery grenade" + spawner_type = /mob/living/simple_animal/carp + deliveryamt = 5 + origin_tech = "materials=3;magnets=4;syndicate=4" \ No newline at end of file diff --git a/code/game/objects/grille.dm b/code/game/objects/grille.dm index 82d2fdf16b..b87a41be60 100644 --- a/code/game/objects/grille.dm +++ b/code/game/objects/grille.dm @@ -3,7 +3,7 @@ /obj/structure/grille desc = "A piece of metal with evenly spaced gridlike holes in it. Blocks large object but lets small items, gas, or energy beams through. Strangely enough these grilles also lets meteors pass through them, whether they be small or huge station breaking death stones." name = "grille" - icon = 'structures.dmi' + icon = 'icons/obj/structures.dmi' icon_state = "grille" density = 1 anchored = 1.0 @@ -45,7 +45,7 @@ attack_hand(var/mob/user) - playsound(src.loc, 'grillehit.ogg', 80, 1) + playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user.name] kicks the [src.name].", \ "You kick the [src.name].", \ "You hear a noise") @@ -63,7 +63,7 @@ attack_alien(var/mob/user) if (istype(usr, /mob/living/carbon/alien/larva)) return - playsound(src.loc, 'grillehit.ogg', 80, 1) + playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user.name] mangles the [src.name].", \ "You mangle the [src.name].", \ "You hear a noise") @@ -74,7 +74,7 @@ attack_metroid(var/mob/user) if(!istype(usr, /mob/living/carbon/metroid/adult)) return - playsound(src.loc, 'grillehit.ogg', 80, 1) + playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user.name] smashes against the [src.name].", \ "You smash against the [src.name].", \ "You hear a noise") @@ -84,17 +84,17 @@ attack_animal(var/mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) return - playsound(src.loc, 'grillehit.ogg', 80, 1) + playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1) M.visible_message("[M.name] smashes against the [src.name].", \ "You smash against the [src.name].", \ "You hear a noise") - src.health -= rand(4) + src.health -= M.melee_damage_upper healthcheck() return CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && mover.pass_flags & PASSGRILLE) + if(istype(mover) && mover.checkpass(PASSGRILLE)) return 1 else if (istype(mover, /obj/item/projectile)) @@ -106,13 +106,13 @@ attackby(obj/item/weapon/W, mob/user) if(iswirecutter(W)) if(!shock(user, 100)) - playsound(src.loc, 'Wirecutter.ogg', 100, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) src.health = 0 if(!destroyed) src.health = -100 else if ((isscrewdriver(W)) && (istype(src.loc, /turf/simulated) || src.anchored)) if(!shock(user, 90)) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) src.anchored = !( src.anchored ) user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.") for(var/mob/O in oviewers()) @@ -164,7 +164,7 @@ else if(istype(W, /obj/item/weapon/shard)) src.health -= W.force * 0.1 else if(!shock(user, 70)) - playsound(src.loc, 'grillehit.ogg', 80, 1) + playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1) switch(W.damtype) if("fire") src.health -= W.force @@ -199,6 +199,8 @@ return 0 if(!prob(prb)) return 0 + if(!in_range(src, usr))//To prevent TK and mech users from getting shocked + return 0 var/turf/T = get_turf(src) var/obj/structure/cable/C = T.get_cable_node() if(C) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index abc8184222..dcfacd4fc5 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,9 +1,3 @@ -/obj/item/Del() - if (src.loc && istype(src.loc, /mob/living/carbon/human)) - //world << "\blue **Beep! Deleted [src] from [src.loc]**" - var/mob/living/carbon/human/H = src.loc - H.u_equip(src) - ..() /obj/item/weapon/bedsheet/ex_act(severity) if (severity <= 2) @@ -25,14 +19,14 @@ if(!M.handcuffed) var/turf/p_loc = user.loc var/turf/p_loc_m = M.loc - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) for(var/mob/O in viewers(user, null)) O.show_message("\red [user] is trying to put handcuffs on [M]!", 1) spawn(30) if(!M) return if(p_loc == user.loc && p_loc_m == M.loc) M.handcuffed = new /obj/item/weapon/handcuffs(M) - M.update_clothing() + M.update_inv_handcuffed() else if ((CLUMSY in usr.mutations) && prob(50)) @@ -42,7 +36,7 @@ var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) O.source = user O.target = user - O.item = user.equipped() + O.item = user.get_active_hand() O.s_loc = user.loc O.t_loc = user.loc O.place = "handcuff" @@ -59,24 +53,23 @@ M.attack_log += text("\[[time_stamp()]\] Has been handcuffed (attempt) by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Attempted to handcuff [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) handcuffed [M] ([M.ckey]).") log_attack("[user.name] ([user.ckey]) Attempted to handcuff [M.name] ([M.ckey])") var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) O.source = user O.target = M - O.item = user.equipped() + O.item = user.get_active_hand() O.s_loc = user.loc O.t_loc = M.loc O.place = "handcuff" M.requests += O spawn( 0 ) if(istype(src, /obj/item/weapon/handcuffs/cable)) -// feedback_add_details("handcuffs","C") - playsound(src.loc, 'cablecuff.ogg', 30, 1, -2) + feedback_add_details("handcuffs","C") + playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) else -// feedback_add_details("handcuffs","H") - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + feedback_add_details("handcuffs","H") + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) O.process() return else @@ -84,16 +77,16 @@ var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( ) O.source = user O.target = M - O.item = user.equipped() + O.item = user.get_active_hand() O.s_loc = user.loc O.t_loc = M.loc O.place = "handcuff" M.requests += O spawn( 0 ) if(istype(src, /obj/item/weapon/handcuffs/cable)) - playsound(src.loc, 'cablecuff.ogg', 30, 1, -2) + playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) else - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) O.process() return return @@ -128,7 +121,7 @@ var/obj/o = target o.reagents.trans_to(src, 50) user << "\blue \The [src] is now refilled" - playsound(src.loc, 'refill.ogg', 50, 1, -6) + playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6) return if (!safety) @@ -141,11 +134,11 @@ src.last_use = world.time - playsound(src.loc, 'extinguish.ogg', 75, 1, -3) + playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3) var/direction = get_dir(src,target) - if(usr.buckled && istype(usr.buckled, /obj/structure/stool/bed/chair/office) && !usr.buckled.anchored ) //Making only office chairs fire-extinguishable. Because NO FUN ALLOWED + if(usr.buckled && isobj(usr.buckled) && !usr.buckled.anchored ) spawn(0) var/obj/B = usr.buckled var/movementdirection = turn(direction,180) @@ -236,12 +229,10 @@ if(!ismob(M)) return user << "\red You stab [M] with the pen." -// M << "\red You feel a tiny prick!" //Removed to make tritor pens stealthier + M << "\red You feel a tiny prick!" M.attack_log += text("\[[time_stamp()]\] Has been stabbed with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to stab [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) used [src] on [M] ([M.ckey]).") - message_admins("ATTACK: [user] ([user.ckey]) used [src] on [M] ([M.ckey]).") log_attack("[user.name] ([user.ckey]) Used the [src.name] to stab [M.name] ([M.ckey])") @@ -255,10 +246,12 @@ return /obj/item/weapon/pen/sleepypen/New() - var/datum/reagents/R = new/datum/reagents(18) //Used to be 300 + var/datum/reagents/R = new/datum/reagents(30) //Used to be 300 reagents = R R.my_atom = src - R.add_reagent("stoxin", 18) + R.add_reagent("chloralhydrate", 22) //Used to be 100 sleep toxin//30 Chloral seems to be fatal, reducing it to 22./N +// R.add_reagent("impedrezene", 100) +// R.add_reagent("cryptobiolin", 100) ..() return @@ -267,7 +260,7 @@ return ..() if(reagents.total_volume) - if(M.reagents) reagents.trans_to(M, 6) //used to be 150, 6 gives around 2 minutes of knock out. + if(M.reagents) reagents.trans_to(M, 50) //used to be 150 return //NEW STYLE PARAPEN @@ -304,15 +297,18 @@ return /obj/effect/manifest/proc/manifest() + var/dat = "Crew Manifest:
      " + for(var/mob/living/carbon/human/M in mob_list) + dat += text(" [] - []
      ", M.name, M.get_assignment()) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc ) - P.info = "Crew Manifest:
      " + data_core.get_manifest() - P.name = "paper - 'Crew Manifest'" + P.info = dat + P.name = "paper- 'Crew Manifest'" //SN src = null del(src) return -//What the fuck is this code Looks to be the parrying code. If you're grabbing someone, it might hit them instead... or something.--SkyMarshal +//What the fuck is this code /mob/attackby(obj/item/weapon/W as obj, mob/user as mob) if (user.intent != "harm") if (istype(src.l_hand,/obj/item/latexballon) && src.l_hand:air_contents && is_sharp(W)) @@ -394,7 +390,7 @@ if(!(user.zone_sel.selecting == ("head")) || !istype(M, /mob/living/carbon/human)) return ..() - if(!(locate(/obj/machinery/optable, M.loc) && M.resting)) + if( !(locate(/obj/machinery/optable, M.loc) && M.resting) && ( !(locate(/obj/structure/table/, M.loc) && M.lying) && prob(50) ) ) return ..() var/mob/living/carbon/human/H = M @@ -403,15 +399,11 @@ user << "\blue You're going to need to remove their head cover first." return - var/datum/organ/external/head = H.organs["head"] - if(head.status & ORGAN_DESTROYED) - user << "\blue Put it where? There's no head." - //since these people will be dead M != usr if(M:brain_op_stage == 4.0) for(var/mob/O in viewers(M, null)) - if(O == user || O == M) + if(O == (user || M)) continue if(M == user) O.show_message(text("\red [user] inserts [src] into his head!"), 1) @@ -426,21 +418,13 @@ //this might actually be outdated since barring badminnery, a debrain'd body will have any client sucked out to the brain's internal mob. Leaving it anyway to be safe. --NEO if(M.key)//Revised. /N - M.ghostize(1) + M.ghostize() if(brainmob.mind) brainmob.mind.transfer_to(M) else M.key = brainmob.key - // force re-entering corpse - if (!M.client) - for(var/mob/dead/observer/ghost in world) - if(ghost.corpse == brainmob && ghost.client) - ghost.cancel_camera() - ghost.reenter_corpse() - break - M:brain_op_stage = 3.0 del(src) @@ -495,7 +479,7 @@ /obj/item/latexballon/proc/burst() if (!air_contents) return - playsound(src, 'Gunshot.ogg', 100, 1) + playsound(src, 'sound/weapons/Gunshot.ogg', 100, 1) icon_state = "latexballon_bursted" item_state = "lgloves" loc.assume_air(air_contents) @@ -540,10 +524,10 @@ istype(W, /obj/item/weapon/scalpel) || \ istype(W, /obj/item/weapon/kitchen/utensil/knife) || \ istype(W, /obj/item/weapon/shard) || \ + istype(W, /obj/item/weapon/broken_bottle) || \ istype(W, /obj/item/weapon/reagent_containers/syringe) || \ istype(W, /obj/item/weapon/kitchen/utensil/fork) && W.icon_state != "forkloaded" || \ - istype(W, /obj/item/weapon/twohanded/fireaxe) || \ - istype(W,/obj/item/projectile)\ + istype(W, /obj/item/weapon/twohanded/fireaxe) \ ) proc/is_hot(obj/item/W as obj) @@ -578,49 +562,3 @@ proc/is_hot(obj/item/W as obj) return 0 -/proc/is_cut(obj/item/W as obj) - return ( \ - istype(W, /obj/item/weapon/wirecutters) || \ - istype(W, /obj/item/weapon/circular_saw) || \ - istype(W, /obj/item/weapon/melee/energy/sword) && W:active || \ - istype(W, /obj/item/weapon/melee/energy/blade) || \ - istype(W, /obj/item/weapon/shovel) || \ - istype(W, /obj/item/weapon/kitchenknife) || \ - istype(W, /obj/item/weapon/butch) || \ - istype(W, /obj/item/weapon/scalpel) || \ - istype(W, /obj/item/weapon/kitchen/utensil/knife) || \ - istype(W, /obj/item/weapon/shard) || \ - istype(W,/obj/item/projectile) \ - ) - -/proc/is_burn(obj/item/W as obj) - return ( \ - istype(W, /obj/item/weapon/weldingtool) && W:welding || \ - istype(W, /obj/item/weapon/lighter/zippo) && W:lit || \ - istype(W, /obj/item/weapon/match) && W:lit || \ - istype(W, /obj/item/clothing/mask/cigarette) && W:lit || \ - istype(W,/obj/item/projectile/beam)\ - ) - -/obj/item/weapon/paper/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature >= 373.15) - for(var/mob/M in viewers(5, src)) - M << "\red \the [src] burns up." - del(src) - -/obj/item/weapon/megaphone/attack_self(mob/user as mob) - if(!ishuman(user)) - usr << "\red You don't know how to use this!" - return - if(cooldown) - usr << "\red \The [src] needs to recharge!" - return - var/message = copytext(sanitize(input(user, "Shout a message?", "Megaphone", null) as text),1,MAX_MESSAGE_LEN) - if(message && !cooldown) - if ((src.loc == user && usr.stat == 0)) - for(var/mob/O in (viewers(user))) - O.show_message("[user] broadcasts, \"[message]\"",2) // 2 stands for hearable message - cooldown = 1 - spawn(100) - cooldown = 0 - return diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 6ba4fe585b..5ecce80fbc 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -1,11 +1,4 @@ /obj/item/blueprints - name = "station blueprints" - desc = "Blueprints of the station. There's stamp \"Classified\" and several coffee stains on it. Looks like you can edit the station's layout with these." - icon = 'items.dmi' - icon_state = "blueprints" - - var/list/image/helper_images = list() - var/const/AREA_ERRNONE = 0 var/const/AREA_STATION = 1 var/const/AREA_SPACE = 2 @@ -16,7 +9,6 @@ var/const/BORDER_BETWEEN = 2 var/const/BORDER_2NDTILE = 3 var/const/BORDER_SPACE = 4 - var/const/BORDER_AREA = 5 var/const/ROOM_ERR_LOLWAT = 0 var/const/ROOM_ERR_SPACE = -1 @@ -24,14 +16,14 @@ /obj/item/blueprints/attack_self(mob/M as mob) if (!istype(M,/mob/living/carbon/human)) - M << "This is stack of useless pieces of heavy paper." //monkeys cannot into projecting + M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting return interact() return /obj/item/blueprints/Topic(href, href_list) ..() - if ((usr.restrained() || usr.stat || usr.equipped() != src)) + if ((usr.restrained() || usr.stat || usr.get_active_hand() != src)) return if (!href_list["action"]) return @@ -40,46 +32,34 @@ if (get_area_type()!=AREA_SPACE) interact() return - spawn() - create_area(usr.client) - if(usr && usr.client) - for(var/image/to_remove in helper_images) - if(to_remove in usr.client.images) - usr.client.images.Remove(to_remove) - del(to_remove) + create_area() if ("edit_area") if (get_area_type()!=AREA_STATION) interact() return - spawn() - edit_area(usr.client) - if(usr && usr.client) - for(var/image/to_remove in helper_images) - if(to_remove in usr.client.images) - usr.client.images.Remove(to_remove) - del(to_remove) + edit_area() /obj/item/blueprints/proc/interact() var/area/A = get_area() var/text = {"[src]

      [station_name()] blueprints

      -Property of NanoTrasen. For heads of staff only. Store in high-secure storage.
      +Property of Nanotrasen. For heads of staff only. Store in high-secure storage.
      "} switch (get_area_type()) if (AREA_SPACE) text += {" -

      According \the [src] you are in open space now.

      -

      Mark this place as a new area.

      +

      According this blueprints you are in open space now.

      +

      Mark this place as new area.

      "} if (AREA_STATION) text += {" -

      According \the [src] you are in \The [A] now.

      +

      According this blueprints you are in [A.name] now.

      You may -move an amendment to the designs.

      +move an amendment to the drawing.

      "} if (AREA_SPECIAL) text += {" -

      This place isn't noted on \the [src].

      +

      This place doesn't noted on this blueprints.

      "} else return @@ -87,10 +67,14 @@ move an amendment to the designs.

      usr << browse(text, "window=blueprints") onclose(usr, "blueprints") -/obj/item/blueprints/proc/get_area_type(var/turf/T = get_turf(src)) - if(!T) - return AREA_SPECIAL - var/area/A = get_area(T) + +/obj/item/blueprints/proc/get_area() + var/turf/T = get_turf_loc(usr) + var/area/A = T.loc + A = A.master + return A + +/obj/item/blueprints/proc/get_area_type(var/area/A = get_area()) if (A.name == "Space") return AREA_SPACE var/list/SPECIALS = list( @@ -103,237 +87,99 @@ move an amendment to the designs.

      /area/syndicate_station, /area/wizard_station, /area/prison + // /area/derelict //commented out, all hail derelict-rebuilders! ) for (var/type in SPECIALS) if ( istype(A,type) ) return AREA_SPECIAL return AREA_STATION -/obj/item/blueprints/proc/create_area(var/client/user) +/obj/item/blueprints/proc/create_area() //world << "DEBUG: create_area" - var/list/turf/turfs = detect_room(get_turf(user.mob),user) - if(!istype(turfs)) - switch(turfs) + var/res = detect_room(get_turf_loc(usr)) + if(!istype(res,/list)) + switch(res) if(ROOM_ERR_SPACE) - usr << "\red The new area must be completly airtight!" + usr << "\red New area must be complete airtight!" return if(ROOM_ERR_TOOLARGE) - usr << "\red The new area is too large!" + usr << "\red New area too large!" return else usr << "\red Error! Please notify administration!" return - var/choice = alert("Would you like to add this to an adjacent area, or make a brand new one?","Creating new area.","New Area", "Add to Area", "Cancel") - switch(choice) - - if("New Area") - var/list/turf/new_turfs = list() - for(var/reference in turfs) - if(turfs[reference] == "Space") - var/turf/simulated/T = locate(reference) in world - if(istype(T)) - new_turfs |= T - if(!new_turfs.len) - usr << "No aporpriate tiles found." - return - if(new_turfs.len > 500) - usr << "\red Too big of an area!" - return - - var/str = sanitize(trim(input(usr,"New area title","Blueprints editing") as null|text)) - if(!str || !length(str)) //cancel - return - if(length(str) > 50) - usr << "\red Text too long." - return - var/area/A = new - A.name = str - A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing - A.power_equip = 0 - A.power_light = 0 - A.power_environ = 0 - A.contents |= new_turfs - - - if("Add to Area") - var/list/adjacent_areas = list() - for(var/reference in turfs) - adjacent_areas |= turfs[reference] - - -//POSSIBLE FUTURE CHANGE - adjacent_areas.Remove("Space") //It's not something you want... or is it? We can try this out later. - - - var/decision = input("Which adjacent area do you want to combine with?","Blueprints Interface") as null|anything in adjacent_areas - if(decision && decision in adjacent_areas) - var/area/merge_target - for(var/reference in turfs) - if(turfs[reference] == decision) - var/turf/simulated/T = locate(reference) - if(istype(T)) - merge_target = get_area(T) - break - if(!merge_target) - usr << "Something's gone badly wrong. Sorry!" - return - - var/list/turf/new_turfs = list() - for(var/reference in turfs) - if(turfs[reference] == "Space") - var/turf/simulated/T = locate(reference) in world - if(istype(T)) - new_turfs |= T - merge_target.contents |= new_turfs - spawn(2) - merge_target.power_change() - - else - return - - if("Cancel") - return - + var/list/turf/turfs = res + var/str = sanitize(trim(input(usr,"New area title","Blueprints editing"))) + if(!str || !length(str)) //cancel + return + if(length(str) > 50) + usr << "\red Text too long." + return + var/area/A = new + A.name = str + A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing + //var/ma + //ma = A.master ? "[A.master]" : "(null)" + //world << "DEBUG: create_area:
      A.name=[A.name]
      A.tag=[A.tag]
      A.master=[ma]" + A.power_equip = 0 + A.power_light = 0 + A.power_environ = 0 + move_turfs_to_area(turfs, A) spawn(5) + //ma = A.master ? "[A.master]" : "(null)" + //world << "DEBUG: create_area(5):
      A.name=[A.name]
      A.tag=[A.tag]
      A.master=[ma]" interact() return -/obj/item/blueprints/proc/edit_area(var/client/user) - var/area/A = get_area(src) +/obj/item/blueprints/proc/move_turfs_to_area(var/list/turf/turfs, var/area/A) + A.contents.Add(turfs) + //oldarea.contents.Remove(usr.loc) // not needed + //T.loc = A //error: cannot change constant value + + +/obj/item/blueprints/proc/edit_area() + var/area/A = get_area() //world << "DEBUG: edit_area" - var/choice = alert("Would you like to rename the area, or merge it with an adjacent one?", "Blueprint Interface", "Rename", "Merge", "Cancel") - switch(choice) - if("Rename") - var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",A.name) as null|text)) - if(!str || !length(str) || str==A.name) //cancel - return - if(length(str) > 50) - usr << "\red Text too long." - return - var/old_name = A.name - for(var/area/RA in A.related) - RA.name = str - A.name = str - A.set_area_machinery_title(old_name) - usr << "\blue You retitle the area '[A.name]' to '[str]'." - - - if("Merge") - usr << "We appologize, but this function is not availible" - /* - var/list/turf/search_remaining_turfs = A.contents.Copy() - var/list/turfs = list() - for(var/turf/simulated/T in search_remaining_turfs) - if(T.density || locate(/obj/machinery/door) in T || locate(/obj/machinery/door) in T) - search_remaining_turfs.Remove(T) - - var/limiter = 50 - - var/iteration = 0 - while(search_remaining_turfs.len > (A.contents.len)/10 ) - iteration++ - if(iteration > limiter) - break - var/turf/simulated/test_turf = pick(search_remaining_turfs) - if(!istype(test_turf)) - continue - var/list/turf/temp_turf_list = detect_room(test_turf,user) - if(!istype(temp_turf_list)) - switch(temp_turf_list) - if(ROOM_ERR_SPACE) - usr << "\red \The [A] is not completly airtight!" - return - if(ROOM_ERR_TOOLARGE) - usr << "\red \The [A] is too large to expand!" - return - else - usr << "\red Error! Please notify administration!" - return - for(var/reference in temp_turf_list) - var/turf/simulated/T = locate(reference) - if(T) - search_remaining_turfs.Remove(T) - turfs |= temp_turf_list - - var/list/adjacent_areas = list() - for(var/reference in turfs) - adjacent_areas |= turfs[reference] - adjacent_areas.Remove("[A]") - - var/decision = input("Which adjacent area do you want to merge with?","Blueprints Interface") as null|anything in adjacent_areas - if(decision && decision in adjacent_areas) - var/area/merge_target - for(var/reference in turfs) - if(turfs[reference] == decision) - var/turf/simulated/T = locate(reference) - if(istype(T)) - merge_target = get_area(T) - break - - if(!merge_target) - usr << "Something's gone badly wrong. Sorry!" - return - - search_remaining_turfs = merge_target.contents.Copy() - for(var/turf/simulated/T in search_remaining_turfs) - if(T.density || locate(/obj/machinery/door) in T || locate(/obj/machinery/door) in T) - search_remaining_turfs.Remove(T) - - var/turf/simulated/T - iteration = 0 - while(search_remaining_turfs.len > (merge_target.contents.len)/10 ) - T = pick(search_remaining_turfs) - if(istype(T)) - var/list/turf_references = detect_room(T,user) - if(!istype(turf_references)) - switch(turf_references) - if(ROOM_ERR_SPACE) - usr << "\red \The [merge_target] is not completly airtight!" - return - if(ROOM_ERR_TOOLARGE) - usr << "\red \The [merge_target] is too large to expand!" - return - else - usr << "\red Error! Please notify administration!" - return - for(var/reference in turf_references) - T = locate(reference) - if(T) - search_remaining_turfs.Remove(T) - iteration++ - if(iteration >= limiter) - break - - var/area_master = alert("If this is approximately the right shape for the combined area, which should the new area be?", "Blueprint Interface", "\The [A]", "\The [merge_target]", "Looks Wrong/Cancel") - if(area_master == "\The [A]") - - A.absorb(merge_target) - - else if(area_master == "\The [merge_target]") - - merge_target.absorb(A) - - else if(area_master == "Looks Wrong/Cancel") - return - - else - return*/ - - if("Cancel") - return - - spawn(5) - interact() + var/prevname = A.name + var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",prevname))) + if(!str || !length(str) || str==prevname) //cancel + return + if(length(str) > 50) + usr << "\red Text too long." + return + set_area_machinery_title(A,str,prevname) + for(var/area/RA in A.related) + RA.name = str + usr << "\blue You set the area '[prevname]' title to '[str]'." + interact() return +/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle) + if (!oldtitle) // or dd_replacetext goes to infinite loop + return + for(var/area/RA in A.related) + for(var/obj/machinery/alarm/M in RA) + M.name = dd_replacetext(M.name,oldtitle,title) + for(var/obj/machinery/power/apc/M in RA) + M.name = dd_replacetext(M.name,oldtitle,title) + for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA) + M.name = dd_replacetext(M.name,oldtitle,title) + for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA) + M.name = dd_replacetext(M.name,oldtitle,title) + for(var/obj/machinery/door/M in RA) + M.name = dd_replacetext(M.name,oldtitle,title) + //TODO: much much more. Unnamed airlocks, cameras, etc. + /obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir) if (istype(T2, /turf/space)) return BORDER_SPACE //omg hull breach we all going to die here if (istype(T2, /turf/simulated/shuttle)) return BORDER_SPACE + if (get_area_type(T2.loc)!=AREA_SPACE) + return BORDER_BETWEEN if (istype(T2, /turf/simulated/wall)) return BORDER_2NDTILE if (!istype(T2, /turf/simulated)) @@ -354,80 +200,41 @@ move an amendment to the designs.

      if (locate(/obj/structure/falserwall) in T2) return BORDER_2NDTILE - - if(get_area_type(T2) == AREA_SPECIAL) - return BORDER_BETWEEN - return BORDER_NONE -/obj/item/blueprints/proc/detect_room(var/turf/first, var/client/user) - var/list/found = list() - var/list/pending = list(first) - var/area/B = get_area(first) - var/list/areas = list(B.name) - do - if (found.len+pending.len > 800) +/obj/item/blueprints/proc/detect_room(var/turf/first) + var/list/turf/found = new + var/list/turf/pending = list(first) + while(pending.len) + if (found.len+pending.len > 300) return ROOM_ERR_TOOLARGE - var/turf/T = pending[1] - pending.Remove(T) - B = get_area(T) + var/turf/T = pending[1] //why byond havent list::pop()? + pending -= T for (var/dir in cardinal) var/skip = 0 for (var/obj/structure/window/W in T) if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))) - skip = 1 - break - if (skip) - continue + skip = 1; break + if (skip) continue for(var/obj/machinery/door/window/D in T) if(dir == D.dir) - skip = 1 - break - if (skip) - continue + skip = 1; break + if (skip) continue var/turf/NT = get_step(T,dir) - - if (!istype(NT)) - continue - if("\ref[NT]" in found) - continue - if("\ref[NT]" in pending) + if (!isturf(NT) || (NT in found) || (NT in pending)) continue switch(check_tile_is_border(NT,dir)) if(BORDER_NONE) - var/area/A = get_area(NT) - if( ( A.name in areas || A.name == "Space" || B.name == "Space" ) &&\ - !( "\ref[NT]" in pending || "\ref[NT]" in found) ) - //If it is another area, and neither of them are space AND it is not in the list of adjacent areas, then do not add it. - pending |= NT - areas |= A.name + pending+=NT if(BORDER_BETWEEN) - found["\ref[NT]"] = "[get_area(NT)]" - if(user && !locate(/image) in NT) - var/image/Z = image('ULIcons.dmi',NT,"7-0-0",19) - helper_images |= Z - user.images += Z - + //do nothing, may be later i'll add 'rejected' list as optimization if(BORDER_2NDTILE) - found["\ref[NT]"] = "[get_area(NT)]" //tile included to new area, but we dont seek more - if(user && !locate(/image) in NT) - var/image/Z = image('ULIcons.dmi',NT,"7-0-0",19) - helper_images |= Z - user.images += Z + found+=NT //tile included to new area, but we dont seek more if(BORDER_SPACE) return ROOM_ERR_SPACE - found["\ref[T]"] = "[get_area(T)]" - if(user) - for(var/image/I in user.images) - if(I.loc == T) - user.images.Remove(I) - del(I) - var/image/Z = image('ULIcons.dmi',T,"0-0-7",19) - helper_images |= Z - user.images += Z - while(pending.len) + found+=T return found /* diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index e54c7fbb77..0326ca13b2 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -5,9 +5,10 @@ /obj/item/candle name = "red candle" desc = "a candle" - icon = 'candle.dmi' + icon = 'icons/obj/candle.dmi' icon_state = "candle1" item_state = "candle1" + w_class = 1 var/wax = 200 var/lit = 0 @@ -51,7 +52,7 @@ //src.damtype = "fire" for(var/mob/O in viewers(usr, null)) O.show_message(flavor_text, 1) - ul_SetLuminosity(CANDLE_LUM, CANDLE_LUM -2, 0) + sd_SetLuminosity(CANDLE_LUM) processing_objects.Add(src) @@ -74,53 +75,17 @@ if(lit) lit = 0 update_icon() - ul_SetLuminosity(0) - user.ul_SetLuminosity(user.LuminosityRed - CANDLE_LUM, user.LuminosityGreen - (CANDLE_LUM - 2), user.LuminosityBlue) + sd_SetLuminosity(0) + user.total_luminosity -= CANDLE_LUM pickup(mob/user) if(lit) - ul_SetLuminosity(0) - user.ul_SetLuminosity(user.LuminosityRed + CANDLE_LUM, user.LuminosityGreen + (CANDLE_LUM - 2), user.LuminosityBlue) + src.sd_SetLuminosity(0) + user.total_luminosity += CANDLE_LUM + dropped(mob/user) if(lit) - user.ul_SetLuminosity(user.LuminosityRed - CANDLE_LUM, user.LuminosityGreen - (CANDLE_LUM - 2), user.LuminosityBlue) - src.ul_SetLuminosity(CANDLE_LUM, CANDLE_LUM, 0) - - - -/////////////// -//CANDLE PACK// -/////////////// -/obj/item/weapon/candlepack - name = "Candle pack" - //desc = "The most popular brand of Space Cigarettes, sponsors of the Space Olympics." - icon = 'candle.dmi' - icon_state = "pack5" - item_state = "pack5" - w_class = 1 - throwforce = 2 - var/candlecount = 5 - flags = TABLEPASS - slot_flags = SLOT_BELT - - -/obj/item/weapon/candlepack/update_icon() - src.icon_state = text("pack[]", src.candlecount) - src.desc = text("There are [] candles left!", src.candlecount) - return - -/obj/item/weapon/candlepack/attack_hand(mob/user as mob) - if(user.r_hand == src || user.l_hand == src) - if(src.candlecount == 0) - //user << "\red You're out of cigs, shit! How you gonna get through the rest of the day..." - return - else - src.candlecount-- - var/obj/item/candle/W = new /obj/item/candle(user) - user.put_in_hand(W) - else - return ..() - src.update_icon() - return + user.total_luminosity -= CANDLE_LUM + src.sd_SetLuminosity(CANDLE_LUM) diff --git a/code/game/objects/items/clothing.dm b/code/game/objects/items/clothing.dm deleted file mode 100644 index 8dfd188b1f..0000000000 --- a/code/game/objects/items/clothing.dm +++ /dev/null @@ -1,484 +0,0 @@ -/* -CONTAINS: -ORANGE SHOES -MUZZLE -CAKEHAT -SUNGLASSES -SWAT SUIT -CHAMELEON JUMPSUIT -SYNDICATE SHOES -DEATH COMMANDO GAS MASK -THERMAL GLASSES -*/ - - -/* -/obj/item/clothing/fire_burn(obj/fire/raging_fire, datum/air_group/environment) - if(raging_fire.internal_temperature > src.s_fire) - spawn( 0 ) - var/t = src.icon_state - src.icon_state = "" - src.icon = 'b_items.dmi' - flick(text("[]", t), src) - spawn(14) - del(src) - return - return - return 0 - return 1 -*/ //TODO FIX - -/obj/item/clothing/gloves/examine() - set src in usr - ..() - return - -/obj/item/clothing/gloves/latex/attackby(obj/item/weapon/cable_coil/O as obj, loc) - if (istype(O) && O.amount==1) - var/obj/item/latexballon/LB = new - if (usr.get_inactive_hand()==src) - usr.before_take_item(src) - usr.put_in_inactive_hand(LB) - else - LB.loc = src.loc - del(O) - del(src) - else - return ..() - - -/obj/item/clothing/shoes/orange/attack_self(mob/user as mob) - if (src.chained) - src.chained = null - src.slowdown = SHOES_SLOWDOWN - new /obj/item/weapon/handcuffs( user.loc ) - src.icon_state = "orange" - return - -/obj/item/clothing/shoes/orange/attackby(H as obj, loc) - ..() - if ((istype(H, /obj/item/weapon/handcuffs) && !( src.chained ))) - //H = null - del(H) - src.chained = 1 - src.slowdown = 15 - src.icon_state = "orange1" - return - -/obj/item/clothing/mask/muzzle/attack_paw(mob/user as mob) - if (src == user.wear_mask) - return - else - ..() - return - -/obj/item/clothing/head/cakehat/var/processing = 0 - -/obj/item/clothing/head/cakehat/process() - if(!onfire) - processing_objects.Remove(src) - return - - var/turf/location = src.loc - if(istype(location, /mob/)) - var/mob/living/carbon/human/M = location - if(M.l_hand == src || M.r_hand == src || M.head == src) - location = M.loc - - if (istype(location, /turf)) - location.hotspot_expose(700, 1) - - -/obj/item/clothing/head/cakehat/attack_self(mob/user as mob) - if(status > 1) return - src.onfire = !( src.onfire ) - if (src.onfire) - src.force = 3 - src.damtype = "fire" - src.icon_state = "cake1" - - processing_objects.Add(src) - - else - src.force = null - src.damtype = "brute" - src.icon_state = "cake0" - return - - -/obj/item/clothing/under/chameleon/New() - ..() - - for(var/U in typesof(/obj/item/clothing/under/color)-(/obj/item/clothing/under/color)) - - var/obj/item/clothing/under/V = new U - src.clothing_choices += V - -// for(var/U in typesof(/obj/item/clothing/under/rank)-(/obj/item/clothing/under/rank)) - -// var/obj/item/clothing/under/V = new U -// src.clothing_choices += V - - return - - -/obj/item/clothing/under/chameleon/all/New() - ..() - - var/blocked = list(/obj/item/clothing/under/chameleon, /obj/item/clothing/under/chameleon/all) - //to prevent an infinite loop - - for(var/U in typesof(/obj/item/clothing/under)-blocked) - - var/obj/item/clothing/under/V = new U - src.clothing_choices += V - - - -/obj/item/clothing/under/chameleon/attackby(obj/item/clothing/under/U as obj, mob/user as mob) - ..() - - if(istype(U, /obj/item/clothing/under/chameleon)) - user << "\red Nothing happens." - return - - if(istype(U, /obj/item/clothing/under)) - - if(src.clothing_choices.Find(U)) - user << "\red Pattern is already recognised by the suit." - return - - src.clothing_choices += U - - user << "\red Pattern absorbed by the suit." - -/obj/item/clothing/under/chameleon/verb/change() - set name = "Change Color" - set category = "Object" - set src in usr - - if(icon_state == "psyche") - usr << "\red Your suit is malfunctioning" - return - - var/obj/item/clothing/under/A - - A = input("Select Colour to change it to", "BOOYEA", A) in clothing_choices|null - - if(!A) - return - - permeability_coefficient = 0.90 - - name = A.name - desc = A.desc - icon_state = A.icon_state - item_state = A.item_state - usr.update_clothing() - color = A.color - -/obj/item/clothing/under/chameleon/emp_act(severity) - name = "Groovy Jumpsuit" - desc = "A groovy jumpsuit! It seems to have a small dial on the wrist, that won't stop spinning." - icon_state = "psyche" - color = "psyche" - spawn(200) - name = "Black Jumpsuit" - icon_state = "bl_suit" - color = "black" - desc = null - ..() - -/obj/item/clothing/under/chameleon/psyche/emp_act(severity) - return - -/* -/obj/item/clothing/suit/swat_suit/death_commando - name = "Death Commando Suit" - icon_state = "death_commando_suit" - item_state = "death_commando_suit" - flags = FPRINT | TABLEPASS | SUITSPACE*/ - -/obj/item/clothing/mask/gas/death_commando - name = "Death Commando Mask" - icon_state = "death_commando_mask" - item_state = "death_commando_mask" - -/obj/item/clothing/under/rank/New() - sensor_mode = pick(0,1,2,3) - ..() - -/obj/item/clothing/under/verb/toggle() - set name = "Toggle Suit Sensors" - set category = "Object" - var/mob/M = usr - if (istype(M, /mob/dead/)) return - if (usr.stat) return - if(src.has_sensor >= 2) - usr << "The controls are locked." - return 0 - if(src.has_sensor <= 0) - usr << "This suit does not have any sensors" - return 0 - src.sensor_mode += 1 - if(src.sensor_mode > 3) - src.sensor_mode = 0 - switch(src.sensor_mode) - if(0) - usr << "You disable your suit's remote sensing equipment." - if(1) - usr << "Your suit will now report whether you are live or dead." - if(2) - usr << "Your suit will now report your vital lifesigns." - if(3) - usr << "Your suit will now report your vital lifesigns as well as your coordinate position." - ..() - -/obj/item/clothing/under/examine() - set src in view() - ..() - switch(src.sensor_mode) - if(0) - usr << "Its sensors appear to be disabled." - if(1) - usr << "Its binary life sensors appear to be enabled." - if(2) - usr << "Its vital tracker appears to be enabled." - if(3) - usr << "Its vital tracker and tracking beacon appear to be enabled." - - -/obj/item/clothing/head/helmet/welding/attack_self() - toggle() - -/obj/item/clothing/head/helmet/welding/verb/toggle() - set category = "Object" - set name = "Adjust welding mask" - if(usr.canmove && usr.stat != 2 && !usr.restrained()) - if(src.up) - src.up = !src.up - src.see_face = !src.see_face - src.flags |= HEADCOVERSEYES - flags_inv |= HIDEMASK|HIDEEARS|HIDEEYES - icon_state = "[initial(icon_state)]" - usr << "You flip the mask down to protect your eyes." - else - src.up = !src.up - src.see_face = !src.see_face - src.flags &= ~HEADCOVERSEYES - flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES) - icon_state = "[initial(icon_state)]up" - usr << "You push the mask up out of your face." - usr.update_clothing() - -/obj/item/clothing/head/cargosoft/dropped() - src.icon_state = "cargosoft" - src.flipped=0 - ..() - -/obj/item/clothing/head/cargosoft/verb/flip() - set category = "Object" - set name = "Flip cap" - src.flipped = !src.flipped - if(src.flipped) - icon_state = "cargosoft_flipped" - usr << "You flip the hat backwards." - else - icon_state = "cargosoft" - usr << "You flip the hat back in normal position." - - -/obj/item/clothing/shoes/magboots/verb/toggle() - set name = "Toggle Magboots" - set category = "Object" - if(src.magpulse) - src.flags &= ~NOSLIP - src.slowdown = SHOES_SLOWDOWN - src.magpulse = 0 - icon_state = "magboots0" - usr << "You disable the mag-pulse traction system." - else - src.flags |= NOSLIP - src.slowdown = 2 - src.magpulse = 1 - icon_state = "magboots1" - usr << "You enable the mag-pulse traction system." - -/obj/item/clothing/shoes/magboots/examine() - set src in view() - ..() - var/state = "disabled" - if(src.flags&NOSLIP) - state = "enabled" - usr << "Its mag-pulse traction system appears to be [state]." - -/obj/item/clothing/suit/lawyer/verb/toggle() - set name = "Toggle Jacket Buttons" - set category = "Object" - if(src.icon_state == "suitjacket_blue_open") - src.icon_state = "suitjacket_blue" - src.item_state = "suitjacket_blue" - usr << "You button up the suit jacket." - else if(src.icon_state == "suitjacket_blue") - src.icon_state = "suitjacket_blue_open" - src.item_state = "suitjacket_blue_open" - usr << "You unbutton the suit jacket." - else - usr << "Sorry! The suit you're wearing doesn't have buttons!" - usr.update_clothing() - -/obj/item/clothing/suit/storage/labcoat/verb/toggle() - set name = "Toggle Labcoat Buttons" - set category = "Object" - - if(!usr.canmove || usr.stat || usr.restrained()) - return 0 - - else - - if(src.icon_state == "labcoat_open") - src.icon_state = "labcoat" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat") - src.icon_state = "labcoat_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_cmo_open") - src.icon_state = "labcoat_cmo" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_cmo") - src.icon_state = "labcoat_cmo_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_cmoalt_open") - src.icon_state = "labcoat_cmoalt" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_cmoalt") - src.icon_state = "labcoat_cmoalt_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_gen_open") - src.icon_state = "labcoat_gen" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_gen") - src.icon_state = "labcoat_gen_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_chem_open") - src.icon_state = "labcoat_chem" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_chem") - src.icon_state = "labcoat_chem_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_vir_open") - src.icon_state = "labcoat_vir" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_vir") - src.icon_state = "labcoat_vir_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_tox_open") - src.icon_state = "labcoat_tox" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_tox") - src.icon_state = "labcoat_tox_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labgreen_open") - src.icon_state = "labgreen" - usr << "You button up the labcoat." - else if(src.icon_state == "labgreen") - src.icon_state = "labgreen_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_pink_open") - src.icon_state = "labcoat_pink" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_pink") - src.icon_state = "labcoat_pink_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_red_open") - src.icon_state = "labcoat_red" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_red") - src.icon_state = "labcoat_red_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "labcoat_cdc_open") - src.icon_state = "labcoat_cdc" - usr << "You button up the labcoat." - else if(src.icon_state == "labcoat_cdc") - src.icon_state = "labcoat_cdc_open" - usr << "You unbutton the labcoat." - else if(src.icon_state == "fr_jacket_open") - src.icon_state = "fr_jacket" - usr << "You button up the jacket." - else if(src.icon_state == "fr_jacket") - src.icon_state = "fr_jacket_open" - usr << "You unbutton the jacket." - else if(src.icon_state == "fr_sleeve_open") - src.icon_state = "fr_sleeve" - usr << "You button up the jacket." - else if(src.icon_state == "fr_sleeve") - src.icon_state = "fr_sleeve_open" - usr << "You unbutton the jacket." - else - usr << "Sorry! The suit you're wearing doesn't have buttons!" - usr.update_clothing() - -/obj/item/clothing/head/ushanka/attack_self(mob/user as mob) - if(src.icon_state == "ushankadown") - src.icon_state = "ushankaup" - src.item_state = "ushankaup" - user << "You raise the ear flaps on the ushanka." - else - src.icon_state = "ushankadown" - src.item_state = "ushankadown" - user << "You lower the ear flaps on the ushanka." - - -/obj/item/clothing/glasses/thermal/emp_act(severity) - if(istype(src.loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/M = src.loc - M << "\red The Optical Thermal Scanner overloads and blinds you!" - if(M.glasses == src) - M.eye_blind = 3 - M.eye_blurry = 5 - M.disabilities |= 1 - spawn(100) - M.disabilities &= ~1 - ..() - -/obj/item/clothing/head/helmet/space/engineer/attack_self() - toggle() - -/obj/item/clothing/head/helmet/space/engineer/verb/toggle() - set category = "Object" - set name = "Toggle Helmet Visor" - if(usr.canmove && usr.stat != 2 && !usr.restrained()) - if(src.up) - src.up = !src.up - src.see_face = !src.see_face - src.flags |= HEADCOVERSEYES - icon_state = "[initial(icon_state)]" - usr << "You toggle the reflective tint on." - else - src.up = !src.up - src.see_face = !src.see_face - src.flags &= ~HEADCOVERSEYES - icon_state = "[initial(icon_state)]_clear" - usr << "You toggle the reflective tint off." - usr.update_clothing() - -/obj/item/clothing/mask/breath/verb/toggle() - set name = "Adjust Mask" - set category = "Object" - if(usr.canmove && usr.stat != 2 && !usr.restrained()) - if(src.icon_state == "medical") - usr << "You can't seem to adjust this mask." - return - if(src.icon_state == "breath_low") - src.icon_state = "breath" - src.item_state = "breath" - src.flags |= SUITSPACE|HEADSPACE|MASKCOVERSMOUTH - protective_temperature = 420 - usr << "You are now breathing through your mask." - else if(src.icon_state == "breath") - src.icon_state = "breath_low" - src.item_state = "breath_low" - src.flags &= ~(SUITSPACE|HEADSPACE|MASKCOVERSMOUTH) - protective_temperature = 270 - usr << "Your mask is now hanging on your neck." - usr.update_clothing() \ No newline at end of file diff --git a/code/game/objects/items/food.dm b/code/game/objects/items/food.dm deleted file mode 100644 index 82971024c4..0000000000 --- a/code/game/objects/items/food.dm +++ /dev/null @@ -1,213 +0,0 @@ -/* -CONTAINS: -DONUT BOX -EGG BOX -MONKEY CUBE BOX - -*/ - - -/mob/living/carbon/var/last_eating = 0 - -/obj/item/kitchen/donut_box - var/amount = 6 - icon = 'food.dmi' - icon_state = "donutbox" - name = "donut box" -/obj/item/kitchen/egg_box - var/amount = 12 - icon = 'food.dmi' - icon_state = "eggbox" - name = "egg box" - -/obj/item/kitchen/donut_box/proc/update() - src.icon_state = text("donutbox[]", src.amount) - return - -/* -/obj/item/kitchen/donut_box/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/reagent_containers/food/snacks/donut) && (amount < 6)) - user.drop_item() - W.loc = src - usr << "You place a donut back into the box." - src.update() - return -*/ - -/obj/item/kitchen/donut_box/MouseDrop(mob/user as mob) - if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr)))))) - if(!istype(user, /mob/living/carbon/metroid)) - if (usr.hand) - if (!( usr.l_hand )) - spawn( 0 ) - src.attack_hand(usr, 1, 1) - return - else - if (!( usr.r_hand )) - spawn( 0 ) - src.attack_hand(usr, 0, 1) - return - return - -/obj/item/kitchen/donut_box/attack_paw(mob/user as mob) - return src.attack_hand(user) - -/obj/item/kitchen/donut_box/attack_hand(mob/user as mob, unused, flag) - if (flag) - return ..() - src.add_fingerprint(user) - if (locate(/obj/item/weapon/reagent_containers/food/snacks/donut, user)) - for(var/obj/item/weapon/reagent_containers/food/snacks/donut/P in user) - if (!user.l_hand) - P.loc = user - P.layer = 20 - user.l_hand = P - user.update_clothing() - user << "You take a donut out of the box." - break - else if (!user.r_hand) - P.loc = user - P.layer = 20 - user.r_hand = P - user.update_clothing() - user << "You take a donut out of the box." - break - else - if (src.amount >= 1) - src.amount-- - var/obj/item/weapon/reagent_containers/food/snacks/donut/D = new /obj/item/weapon/reagent_containers/food/snacks/donut - D.loc = user.loc - if(ishuman(user)) - if(!user.get_active_hand()) - user.put_in_hand(D) - user << "You take a donut out of the box." - else - D.loc = get_turf(src) - user << "You take a donut out of the box." - - src.update() - return - -/obj/item/kitchen/donut_box/examine() - set src in oview(1) - - src.amount = round(src.amount) - var/n = src.amount - for(var/obj/item/weapon/reagent_containers/food/snacks/donut/P in src) - n++ - if (n <= 0) - n = 0 - usr << "There are no donuts left in the box." - else - if (n == 1) - usr << "There is one donut left in the box." - else - usr << text("There are [] donuts in the box.", n) - return - -/obj/item/kitchen/egg_box/proc/update() - src.icon_state = text("eggbox[]", src.amount) - return - - -/obj/item/kitchen/egg_box/MouseDrop(mob/user as mob) - if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr)))))) - if (usr.hand) - if (!( usr.l_hand )) - spawn( 0 ) - src.attack_hand(usr, 1, 1) - return - else - if (!( usr.r_hand )) - spawn( 0 ) - src.attack_hand(usr, 0, 1) - return - return - -/obj/item/kitchen/egg_box/attack_paw(mob/user as mob) - return src.attack_hand(user) - -/obj/item/kitchen/egg_box/attack_hand(mob/user as mob, unused, flag) - if (flag) - return ..() - src.add_fingerprint(user) - if (locate(/obj/item/weapon/reagent_containers/food/snacks/egg, user)) - for(var/obj/item/weapon/reagent_containers/food/snacks/egg/P in user) - if (!user.l_hand) - P.loc = user - P.layer = 20 - user.l_hand = P - user.update_clothing() - usr << "You take an egg out of the box." - break - else if (!user.r_hand) - P.loc = user - P.layer = 20 - user.r_hand = P - user.update_clothing() - usr << "You take an egg out of the box." - break - else - if (src.amount >= 1) - src.amount-- - var/obj/item/weapon/reagent_containers/food/snacks/egg/D = new /obj/item/weapon/reagent_containers/food/snacks/egg - D.loc = user.loc - if(ishuman(user)) - if(!user.get_active_hand()) - user.put_in_hand(D) - user << "You take an egg out of the box." - else - D.loc = get_turf(src) - user << "You take an egg out of the box." - - src.update() - return - -/obj/item/kitchen/egg_box/examine() - set src in oview(1) - - src.amount = round(src.amount) - var/n = src.amount - for(var/obj/item/weapon/reagent_containers/food/snacks/egg/P in src) - n++ - if (n <= 0) - n = 0 - usr << "There are no eggs left in the box." - else - if (n == 1) - usr << "There is one egg left in the box." - else - usr << text("There are [] eggs in the box.", n) - return - -/obj/item/weapon/monkeycube_box - name = "monkey cube box" - desc = "Drymate brand monkey cubes. Just add water!" - icon = 'food.dmi' - icon_state = "monkeycubebox" - var/amount = 2 - - attack_hand(mob/user as mob, unused, flag) - add_fingerprint(user) - - if(user.r_hand == src || user.l_hand == src) - if(amount) - var/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/M = new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src) - if (user.hand) - user.l_hand = M - else - user.r_hand = M - M.loc = user - M.layer = 20 - user.update_clothing() - user << "You take a monkey cube out of the box." - amount-- - else - user << "There are no monkey cubes left in the box." - else - ..() - - return - - attack_paw(mob/user as mob) - return attack_hand(user) \ No newline at end of file diff --git a/code/game/objects/items/helper_procs.dm b/code/game/objects/items/helper_procs.dm index 4b02b4e8a9..16d5bd2db6 100644 --- a/code/game/objects/items/helper_procs.dm +++ b/code/game/objects/items/helper_procs.dm @@ -1,4 +1,4 @@ -/*/proc/parse_zone(zone) +/proc/parse_zone(zone) if(zone == "r_hand") return "right hand" else if (zone == "l_hand") return "left hand" else if (zone == "l_arm") return "left arm" @@ -7,7 +7,7 @@ else if (zone == "r_leg") return "right leg" else if (zone == "l_foot") return "left foot" else if (zone == "r_foot") return "right foot" - else return zone*/ + else return zone /proc/text2dir(direction) switch(uppertext(direction)) @@ -30,17 +30,15 @@ else return -/proc/get_turf(turf/location as turf) - while (location) - if (istype(location)) +/proc/get_turf(turf/location) + while(location) + if(isturf(location)) return location - location = location.loc return null -/proc/get_turf_or_move(turf/location as turf) - location = get_turf(location) - return location +/proc/get_turf_or_move(turf/location) + return get_turf(location) diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index 5a7a4bae6c..280148e7d5 100755 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -10,22 +10,26 @@ /obj/item/proc/dropped(mob/user as mob) ..() - user.update_clothing() // called just as an item is picked up (loc is not yet changed) /obj/item/proc/pickup(mob/user) return +// called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called. +/obj/item/proc/on_exit_storage(obj/item/weapon/storage/S as obj) + return + +// called when this item is added into a storage item, which is passed on as S. The loc variable is already set to the storage item. +/obj/item/proc/on_enter_storage(obj/item/weapon/storage/S as obj) + return + // called after an item is placed in an equipment slot // user is mob that equipped it -// slot is text of slot type e.g. "head" +// slot uses the slot_X defines found in setup.dm // for items that can be placed in multiple slots // note this isn't called during the initial dressing of a player /obj/item/proc/equipped(var/mob/user, var/slot) return -// -// ***TODO: implement unequipped() -// /obj/item/proc/afterattack() @@ -94,73 +98,25 @@ /obj/item/attack_hand(mob/user as mob) if (!user) return - if (user.hand) - if(ishuman(user)) - var/datum/organ/external/temp = user:organs["l_hand"] - if(temp.status & ORGAN_DESTROYED) - user << "\blue Yo- wait a minute." - return - else - if(ishuman(user)) - var/datum/organ/external/temp = user:organs["r_hand"] - if(temp.status & ORGAN_DESTROYED) - user << "\blue Yo- wait a minute." - if (istype(src.loc, /obj/item/weapon/storage)) - for(var/mob/M in range(1, src.loc)) - if (M.s_active == src.loc) - if (M.client) - M.client.screen -= src - if(istype(src.loc, /obj/item/weapon/storage/backpack/santabag)) - if(src.loc.contents.len < 5) - src.loc.icon_state = "giftbag0" - else if(src.loc.contents.len >= 5 && src.loc.contents.len < 15) - src.loc.icon_state = "giftbag1" - else if(src.loc.contents.len >= 15) - src.loc.icon_state = "giftbag2" + var/obj/item/weapon/storage/S = src.loc + S.remove_from_storage(src) src.throwing = 0 if (src.loc == user) //canremove==0 means that object may not be removed. You can still wear it. This only applies to clothing. /N - if(istype(src, /obj/item/clothing) && !src:canremove) + if(!src.canremove) return else user.u_equip(src) else - if(istype(src.loc, /mob/living)) + if(isliving(src.loc)) return src.pickup(user) user.lastDblClick = world.time + 2 user.next_move = world.time + 2 - - if (user.hand) - if(ishuman(user)) - var/datum/organ/external/temp = user:organs["l_hand"] - if(!(temp.status & ORGAN_DESTROYED)) - user.l_hand = src - else - user << "\blue You pick \the [src] up with your ha- wait a minute." - if(loc == user) - user.drop_from_slot(src) - return - else - user.l_hand = src - else - if(ishuman(user)) - var/datum/organ/external/temp = user:organs["r_hand"] - if(!(temp.status & ORGAN_DESTROYED)) - user.r_hand = src - else - user << "\blue You pick \the [src] up with your ha- wait a minute." - if(loc == user) - user.drop_from_slot(src) - return - else - user.r_hand = src - src.loc = user - src.layer = 20 add_fingerprint(user) - user.update_clothing() + user.put_in_active_hand(src) return @@ -169,22 +125,12 @@ if(isalien(user)) // -- TLE var/mob/living/carbon/alien/A = user - if(!A.has_fine_manipulation || w_class <= 4) + if(!A.has_fine_manipulation || w_class >= 4) + if(src in A.contents) // To stop Aliens having items stuck in their pockets + A.drop_from_inventory(src) user << "Your claws aren't capable of such fine manipulation." return - if (user.hand) - if(ismonkey(user)) - var/datum/organ/external/temp = user:organs["l_hand"] - if(temp.status & ORGAN_DESTROYED) - user << "\blue Yo- wait a minute." - return - else - if(ismonkey(user)) - var/datum/organ/external/temp = user:organs["r_hand"] - if(temp.status & ORGAN_DESTROYED) - user << "\blue Yo- wait a minute." - if (istype(src.loc, /obj/item/weapon/storage)) for(var/mob/M in range(1, src.loc)) if (M.s_active == src.loc) @@ -204,23 +150,27 @@ user.lastDblClick = world.time + 2 user.next_move = world.time + 2 - if (user.hand) - user.l_hand = src - else - user.r_hand = src - src.loc = user - src.layer = 20 - user.update_clothing() + user.put_in_active_hand(src) return +/obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob) -/obj/item/attackby(obj/item/W as obj, mob/user as mob) - if(istype(W, /obj/item/device/detective_scanner)) - return + if(istype(W,/obj/item/weapon/storage)) + var/obj/item/weapon/storage/S = W + if(S.use_to_pickup) + if(!S.can_be_inserted(src)) + return + if(S.collection_mode) //Mode is set to collect all items on a tile and we clicked on a valid one. + if(isturf(src.loc)) + for(var/obj/item/I in src.loc) + if(I != src) //We'll do the one we clicked on last. + if(!S.can_be_inserted(src)) + continue + S.handle_item_insertion(I, 1) //The 1 stops the "You put the [src] into [S]" insertion message from being displayed. + S.handle_item_insertion(src) -mob/proc/flash_weak_pain() - flick("weak_pain",pain) + return /obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone) @@ -232,41 +182,19 @@ mob/proc/flash_weak_pain() messagesource = M:container if (src.hitsound) playsound(src.loc, hitsound, 50, 1, -1) - M.flash_weak_pain() ///////////////////////// user.lastattacked = M M.lastattacker = user - var/power = src.force - - // EXPERIMENTAL: scale power and time to the weight class - if(w_class >= 4.0 && !istype(src,/obj/item/weapon/melee/energy/blade)) // eswords are an exception, they only have a w_class of 4 to not fit into pockets - power = power * 2.5 - - user.visible_message("\red [user.name] swings at [M.name] with \the [src]!") - user.next_move = max(user.next_move, world.time + 30) - - // if the mob didn't move, he has a 100% chance to hit(given the enemy also didn't move) - // otherwise, the chance to hit is lower - var/unmoved = 0 - spawn - unmoved = do_after(user, 4) - sleep(4) - if( (!unmoved && !prob(70)) || (get_dist(user, M) != 1 && user != M)) - user.visible_message("\red [user.name] misses with \the [src]!") - return - - user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])" M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])" - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") log_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])" ) //spawn(1800) // this wont work right // M.lastattacker = null ///////////////////////// + var/power = src.force if((HULK in user.mutations) || (SUPRSTR in user.augmentations)) power *= 2 @@ -280,6 +208,9 @@ mob/proc/flash_weak_pain() if(power > 0) Metroid.attacked += 10 + if(Metroid.Discipline && prob(50)) // wow, buddy, why am I getting attacked?? + Metroid.Discipline = 0 + if(power >= 3) if(istype(Metroid, /mob/living/carbon/metroid/adult)) if(prob(5 + round(power/2))) @@ -290,9 +221,6 @@ mob/proc/flash_weak_pain() Metroid.Victim = null Metroid.anchored = 0 - if(prob(80) && !Metroid.client) - Metroid.Discipline++ - spawn() if(Metroid) Metroid.SStun = 1 @@ -349,7 +277,10 @@ mob/proc/flash_weak_pain() showname = "." for(var/mob/O in viewers(messagesource, null)) - O.show_message(text("\red [] has been attacked with [][] ", M, src, showname), 1) + if(src.attack_verb.len) + O.show_message("\red [M] has been [pick(src.attack_verb)] with [src][showname] ", 1) + else + O.show_message("\red [M] has been attacked with [src][showname] ", 1) if(!showname && user) if(user.client) @@ -359,11 +290,6 @@ mob/proc/flash_weak_pain() if(istype(M, /mob/living/carbon/human)) M:attacked_by(src, user, def_zone) - var/mob/living/carbon/human/H = M - if(H) - H.UpdateDamageIcon() - H.update_clothing() - user.update_clothing() else switch(src.damtype) if("brute") @@ -383,7 +309,6 @@ mob/proc/flash_weak_pain() M << "Aargh it burns!" M.updatehealth() src.add_fingerprint(user) - M.react_to_attack(user) return 1 @@ -417,8 +342,6 @@ mob/proc/flash_weak_pain() user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])" M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])" - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") log_attack(" [user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") src.add_fingerprint(user) @@ -426,7 +349,7 @@ mob/proc/flash_weak_pain() // M = user /* M << "\red You stab yourself in the eye." - M.sdisabilities |= 1 + M.sdisabilities |= BLIND M.weakened += 4 M.adjustBruteLoss(10) */ @@ -442,14 +365,15 @@ mob/proc/flash_weak_pain() ) if(istype(M, /mob/living/carbon/human)) var/datum/organ/external/affecting = M:get_organ("head") - affecting.take_damage(7) + if(affecting.take_damage(7)) + M:UpdateDamageIcon() else M.take_organ_damage(7) M.eye_blurry += rand(3,4) - M.eye_stat += rand(5,9) + M.eye_stat += rand(2,4) if (M.eye_stat >= 10) M.eye_blurry += 15+(0.1*M.eye_blurry) - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED if(M.stat != 2) M << "\red Your eyes start to bleed profusely!" if(prob(50)) @@ -462,7 +386,7 @@ mob/proc/flash_weak_pain() if (prob(M.eye_stat - 10 + 1)) if(M.stat != 2) M << "\red You go blind!" - M.disabilities |= 128 + M.sdisabilities |= BLIND return diff --git a/code/game/objects/items/robot_items.dm b/code/game/objects/items/robot_items.dm index a57bc2ed88..161d65e3aa 100644 --- a/code/game/objects/items/robot_items.dm +++ b/code/game/objects/items/robot_items.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /********************************************************************** Cyborg Spec Items @@ -6,15 +6,13 @@ //Might want to move this into several files later but for now it works here /obj/item/borg/stun name = "Electrified Arm" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "shock" attack(mob/M as mob, mob/living/silicon/robot/user as mob) M.attack_log += text("\[[time_stamp()]\] Has been attacked with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to attack [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") log_attack(" [user.name] ([user.ckey]) used the [src.name] to attack [M.name] ([M.ckey])") user.cell.charge -= 30 @@ -30,14 +28,14 @@ /obj/item/borg/overdrive name = "Overdrive" - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "shock" /********************************************************************** HUD/SIGHT things ***********************************************************************/ /obj/item/borg/sight - icon = 'decals.dmi' + icon = 'icons/obj/decals.dmi' icon_state = "securearea" var/sight_mode = null @@ -87,137 +85,20 @@ Chemical things ***********************************************************************/ -/obj/item/weapon/reagent_containers/glass/bottle/robot - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(5,10,15,25,30,50,100) - flags = FPRINT | TABLEPASS | OPENCONTAINER - volume = 60 - var/reagent = "" - - -/obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline - name = "internal inaprovaline bottle" - desc = "A small bottle. Contains inaprovaline - used to stabilize patients." - icon = 'chemical.dmi' - icon_state = "bottle16" - reagent = "inaprovaline" - - New() - ..() - reagents.add_reagent("inaprovaline", 60) - return - - -/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin - name = "internal anti-toxin bottle" - desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug." - icon = 'chemical.dmi' - icon_state = "bottle17" - reagent = "anti_toxin" - - New() - ..() - reagents.add_reagent("anti_toxin", 60) - return +//Moved to modules/chemistry -/obj/item/weapon/reagent_containers/robodropper - name = "Industrial Dropper" - desc = "A larger dropper. Transfers 10 units." - icon = 'chemical.dmi' - icon_state = "dropper0" - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(1,2,3,4,5,6,7,8,9,10) - volume = 10 - var/filled = 0 - afterattack(obj/target, mob/user , flag) - if(!target.reagents) return - - if(filled) - - if(target.reagents.total_volume >= target.reagents.maximum_volume) - user << "\red [target] is full." - return - - if(!target.is_open_container() && !ismob(target) && !istype(target,/obj/item/weapon/reagent_containers/food)) //You can inject humans and food but you cant remove the shit. - user << "\red You cannot directly fill this object." - return - - - var/trans = 0 - - if(ismob(target)) - if(istype(target , /mob/living/carbon/human)) - var/mob/living/carbon/human/victim = target - - var/obj/item/safe_thing = null - if( victim.wear_mask ) - if ( victim.wear_mask.flags & MASKCOVERSEYES ) - safe_thing = victim.wear_mask - if( victim.head ) - if ( victim.head.flags & MASKCOVERSEYES ) - safe_thing = victim.head - if(victim.glasses) - if ( !safe_thing ) - safe_thing = victim.glasses - - if(safe_thing) - if(!safe_thing.reagents) - safe_thing.create_reagents(100) - trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this) - - for(var/mob/O in viewers(world.view, user)) - O.show_message(text("\red [] tries to squirt something into []'s eyes, but fails!", user, target), 1) - spawn(5) - src.reagents.reaction(safe_thing, TOUCH) - - - user << "\blue You transfer [trans] units of the solution." - if (src.reagents.total_volume<=0) - filled = 0 - icon_state = "dropper[filled]" - return - - - for(var/mob/O in viewers(world.view, user)) - O.show_message(text("\red [] squirts something into []'s eyes!", user, target), 1) - src.reagents.reaction(target, TOUCH) - - trans = src.reagents.trans_to(target, amount_per_transfer_from_this) - user << "\blue You transfer [trans] units of the solution." - if (src.reagents.total_volume<=0) - filled = 0 - icon_state = "dropper[filled]" - - else - - if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers)) - user << "\red You cannot directly remove reagents from [target]." - return - - if(!target.reagents.total_volume) - user << "\red [target] is empty." - return - - var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) - - user << "\blue You fill the dropper with [trans] units of the solution." - - filled = 1 - icon_state = "dropper[filled]" - - return /********************************************************************** - Chemical things + RCD ***********************************************************************/ /obj/item/borg/rcd name = "robotic rapid-construction-device" desc = "A device used to rapidly build walls/floor." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "rcd" flags = FPRINT | TABLEPASS| CONDUCT force = 5.0 @@ -238,12 +119,12 @@ proc/activate() // spark_system.set_up(5, 0, src) // src.spark_system.start() - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) attack_self(mob/user as mob) //Change the mode - playsound(src.loc, 'pop.ogg', 50, 0) + playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) if(mode == 1) mode = 2 user << "Changed mode to 'Airlock'" @@ -286,7 +167,7 @@ if(istype(A, /turf/simulated/floor)) if(!cell.use(90)) return user << "Building Wall (3)..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 20)) activate() A:ReplaceWithWall() @@ -296,7 +177,7 @@ if(istype(A, /turf/simulated/floor)) if(!cell.use(300)) return user << "Building Airlock..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 50)) activate() if(locate(/obj/machinery/door) in get_turf(src)) return @@ -308,7 +189,7 @@ if(istype(A, /turf/simulated/wall)) if(!cell.use(150)) return user << "Deconstructing Wall..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 40)) activate() A:ReplaceWithPlating() @@ -319,7 +200,7 @@ if(istype(A, /turf/simulated/floor)) user << "Deconstructing Floor..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 50)) activate() A:ReplaceWithSpace() @@ -327,9 +208,9 @@ if(istype(A, /obj/machinery/door/airlock)) user << "Deconstructing Airlock..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 50)) - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) del(A) return return diff --git a/code/game/objects/items/robot_parts.dm b/code/game/objects/items/robot_parts.dm index 169adde5b8..2cd21053b1 100644 --- a/code/game/objects/items/robot_parts.dm +++ b/code/game/objects/items/robot_parts.dm @@ -1,6 +1,6 @@ /obj/item/robot_parts name = "robot parts" - icon = 'robot_parts.dmi' + icon = 'icons/obj/robot_parts.dmi' item_state = "buildpipe" icon_state = "blank" flags = FPRINT | TABLEPASS | CONDUCT @@ -91,7 +91,7 @@ if(src.l_arm && src.r_arm) if(src.l_leg && src.r_leg) if(src.chest && src.head) - //feedback_inc("cyborg_frames_built",1) + feedback_inc("cyborg_frames_built",1) return 1 return 0 @@ -165,7 +165,18 @@ if(!M.brainmob) user << "\red Sticking an empty MMI into the frame would sort of defeat the purpose." return - if(M.brainmob.stat == 2) + if(!M.brainmob.key) + var/ghost_can_reenter = 0 + if(M.brainmob.mind) + for(var/mob/dead/observer/G in player_list) + if(G.can_reenter_corpse && G.mind == M.brainmob.mind) + ghost_can_reenter = 1 + break + if(!ghost_can_reenter) + user << "The mmi indicates that their mind is completely unresponsive; there's no point." + return + + if(M.brainmob.stat == DEAD) user << "\red Sticking a dead brain into the frame would sort of defeat the purpose." return @@ -186,26 +197,11 @@ O.name = created_name O.real_name = created_name - if (M.brainmob && M.brainmob.mind) - M.brainmob.mind.transfer_to(O) - else - for(var/mob/dead/observer/G in world) - if(G.corpse == M.brainmob && G.client && G.corpse.mind) - G.corpse.mind.transfer_to(O) - del(G) - break - - if(O.mind in ticker.mode:revolutionaries) - ticker.mode:remove_revolutionary(O.mind , 1) + M.brainmob.mind.transfer_to(O) if(O.mind && O.mind.special_role) O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite") - O << "You are playing a Robot. The Robot can interact with most electronic objects in its view point." - O << "You must follow the laws that the AI has. You are the AI's assistant to the station basically." - O << "To use something, simply click it." - O << {"Use say ":b to speak to fellow cyborgs and the AI through binary."} - O.job = "Cyborg" O.cell = chest.cell @@ -213,7 +209,7 @@ W.loc = O//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame. O.mmi = W - //feedback_inc("cyborg_birth",1) + feedback_inc("cyborg_birth",1) del(src) else @@ -228,7 +224,6 @@ return src.created_name = t - user.update_clothing() return diff --git a/code/game/objects/items/robot_upgrades.dm b/code/game/objects/items/robot_upgrades.dm new file mode 100644 index 0000000000..5900065d4a --- /dev/null +++ b/code/game/objects/items/robot_upgrades.dm @@ -0,0 +1,136 @@ +// robot_upgrades.dm +// Contains various borg upgrades. + +/obj/item/borg/upgrade/ + name = "A borg upgrade module." + desc = "Protected by FRM." + icon = 'icons/obj/module.dmi' + icon_state = "cyborg_upgrade" + var/construction_time = 120 + var/construction_cost = list("metal"=10000) + var/locked = 0 + var/require_module = 0 + var/installed = 0 + +/obj/item/borg/upgrade/proc/action(var/mob/living/silicon/robot/R) + if(R.stat == DEAD) + usr << "/red The [src] will not function on a deceased cyborg." + return 1 + return 0 + + +/obj/item/borg/upgrade/reset/ + name = "Borg module reset board" + desc = "Used to reset a borg's module. Destroys any other upgrades applied to the borg." + icon_state = "cyborg_upgrade1" + require_module = 1 + +/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R) + if(..()) return 0 + R.uneq_all() + R.hands.icon_state = "nomod" + R.icon_state = "robot" + del(R.module) + R.module = null + R.modtype = "robot" + R.real_name = "Cyborg [R.ident]" + R.name = R.real_name + R.nopush = 0 + R.updateicon() + + return 1 + + +/obj/item/borg/upgrade/restart/ + name = "Borg emergency restart module" + desc = "Used to force a restart of a disabled-but-repaired borg, bringing it back online." + construction_cost = list("metal"=60000 , "glass"=5000) + icon_state = "cyborg_upgrade1" + + +/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/R) + if(R.health < 0) + usr << "You have to repair the borg before using this module!" + return 0 + + if(!R.key) + for(var/mob/dead/observer/ghost in player_list) + if(ghost.mind && ghost.mind.current == R) + R.key = ghost.key + + R.stat = CONSCIOUS + return 1 + + +/obj/item/borg/upgrade/vtec/ + name = "Borg VTEC Module" + desc = "Used to kick in a borgs VTEC systems, increasing their speed." + construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 5000) + icon_state = "cyborg_upgrade2" + require_module = 1 + +/obj/item/borg/upgrade/vtec/action(var/mob/living/silicon/robot/R) + if(..()) return 0 + + if(R.speed == -1) + return 0 + + R.speed-- + return 1 + + +/obj/item/borg/upgrade/tasercooler/ + name = "Borg Rapid Taser Cooling Module" + desc = "Used to cool a mounted taser, increasing the potential current in it and thus its recharge rate.." + construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 2000, "diamond" = 500) + icon_state = "cyborg_upgrade3" + require_module = 1 + + +/obj/item/borg/upgrade/tasercooler/action(var/mob/living/silicon/robot/R) + if(..()) return 0 + + if(!istype(R.module, /obj/item/weapon/robot_module/security)) + R << "Upgrade mounting error! No suitable hardpoint detected!" + usr << "There's no mounting point for the module!" + return 0 + + var/obj/item/weapon/gun/energy/taser/cyborg/T = locate() in R.module + if(!T) + T = locate() in R.module.contents + if(!T) + T = locate() in R.module.modules + if(!T) + usr << "This cyborg has had its taser removed!" + return 0 + + if(T.recharge_time <= 2) + R << "Maximum cooling achieved for this hardpoint!" + usr << "There's no room for another cooling unit!" + return 0 + + else + T.recharge_time = max(2 , T.recharge_time - 4) + + return 1 + +/obj/item/borg/upgrade/jetpack/ + name = "Mining Borg Jetpack" + desc = "A carbon dioxide jetpack suitable for low-gravity mining operations" + construction_cost = list("metal"=10000,"plasma"=15000,"uranium" = 20000) + icon_state = "cyborg_upgrade3" + require_module = 1 + +/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R) + if(..()) return 0 + + if(!istype(R.module, /obj/item/weapon/robot_module/miner)) + R << "Upgrade mounting error! No suitable hardpoint detected!" + usr << "There's no mounting point for the module!" + return 0 + else + R.module.modules += new/obj/item/weapon/tank/jetpack/carbondioxide + for(var/obj/item/weapon/tank/jetpack/carbondioxide in R.module.modules) + R.internals = src + R.icon_state="Miner+j" + return 1 diff --git a/code/game/objects/items/tk_grab.dm b/code/game/objects/items/tk_grab.dm index a621dec8d4..654c6e7e06 100644 --- a/code/game/objects/items/tk_grab.dm +++ b/code/game/objects/items/tk_grab.dm @@ -3,7 +3,7 @@ /obj/item/tk_grab name = "Telekinetic Grab" desc = "Magic" - icon = 'magic.dmi'//Needs sprites + icon = 'icons/obj/magic.dmi'//Needs sprites icon_state = "2" flags = USEDELAY //item_state = null @@ -20,7 +20,9 @@ return + //stops TK grabs being equipped anywhere but into hands equipped(var/mob/user, var/slot) + if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return del(src) return @@ -29,14 +31,10 @@ if(!istype(focus,/obj/item)) return if(!check_path()) return//No clear path - if(user.hand == src) - user.l_hand = focus - else - user.r_hand = focus - focus.loc = user - focus.layer = 20 + user.put_in_hands(focus) add_fingerprint(user) - user.update_clothing() + user.update_inv_l_hand(0) + user.update_inv_r_hand() spawn(0) del(src) return @@ -51,6 +49,10 @@ if(!(TK in host.mutations)) del(src) return + if(isobj(target)) + if(!target.loc || !isturf(target.loc)) + del(src) + return if(!focus) focus_object(target, user) return @@ -70,6 +72,8 @@ if(target.anchored) target.attack_hand(user) // you can use shit now! return//No throwing anchored things + if(!isturf(target.loc)) + return focus = target update_icon() apply_focus_overlay() @@ -84,7 +88,7 @@ O.density = 0 O.layer = FLY_LAYER O.dir = pick(cardinal) - O.icon = 'effects.dmi' + O.icon = 'icons/effects/effects.dmi' O.icon_state = "nothing" flick("empdisable",O) spawn(5) @@ -111,11 +115,11 @@ return 1 */ -//equip_if_possible(obj/item/W, slot, del_on_fail = 1) +//equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1) /* if(istype(user, /mob/living/carbon)) - if((TK in user:mutations) && get_dist(source, user) <= 7) - if(user:equipped()) return 0 + if(user:mutations & TK && get_dist(source, user) <= 7) + if(user:get_active_hand()) return 0 var/X = source:x var/Y = source:y var/Z = source:z diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 627a2a5f84..f9807fc3a9 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -1,6 +1,6 @@ //Added by Jack Rost /obj/item/trash - icon = 'trash.dmi' + icon = 'icons/obj/trash.dmi' w_class = 1.0 desc = "This is rubbish." raisins @@ -44,7 +44,7 @@ icon_state = "tray" candle name = "candle" - icon = 'candle.dmi' + icon = 'icons/obj/candle.dmi' icon_state = "candle4" liquidfood name = "\improper \"LiquidFood\" ration" @@ -54,7 +54,7 @@ return /obj/item/weapon/trashbag - icon = 'trash.dmi' + icon = 'icons/obj/trash.dmi' icon_state = "trashbag0" item_state = "trashbag" name = "Trash bag" @@ -84,6 +84,14 @@ else user << "\blue The bag is full!" +/obj/item/weapon/trashbag/attack_self(mob/living/user as mob) + + if(contents.len > 0) + for(var/obj/item/I in src.contents) + I.loc = user.loc + update_icon() + user << "\blue You drop all the trash onto the floor." + /obj/item/weapon/trashbag/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag) if(istype(target, /obj/item)) var/obj/item/W = target diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 9a00bbb85b..f8566fb4ff 100755 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -8,7 +8,7 @@ AI MODULES /obj/item/weapon/aiModule name = "AI Module" - icon = 'module.dmi' + icon = 'icons/obj/module.dmi' icon_state = "std_mod" item_state = "electronic" desc = "An AI Module for transmitting encrypted instructions to the AI." @@ -34,6 +34,10 @@ AI MODULES usr << "You haven't selected an AI to transmit laws to!" return + if(ticker && ticker.mode && ticker.mode.name == "blob") + usr << "Law uploads have been disabled by NanoTrasen!" + return + if (comp.current.stat == 2 || comp.current.control_disabled == 1) usr << "Upload failed. No signal is being detected from the AI." else if (comp.current.see_in_dark == 0) @@ -42,7 +46,7 @@ AI MODULES src.transmitInstructions(comp.current, usr) comp.current << "These are your laws now:" comp.current.show_laws() - for(var/mob/living/silicon/robot/R in world) + for(var/mob/living/silicon/robot/R in mob_list) if(R.lawupdate && (R.connected_ai == comp.current)) R << "Your AI has set your 'laws waiting' flag." usr << "Upload complete. The AI's laws have been modified." @@ -75,8 +79,6 @@ AI MODULES target << "[sender] has uploaded a change to the laws you must follow, using a [name]. From now on: " var/time = time2text(world.realtime,"hh:mm:ss") lawchanges.Add("[time] : [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])") - message_admins("[sender.name]([sender.key]) uploaded a new AI/Cyborg law.") - log_game("[sender.name]([sender.key]) uploaded a new AI/Cyborg law.") /******************** Modules ********************/ @@ -86,37 +88,37 @@ AI MODULES /obj/item/weapon/aiModule/safeguard name = "'Safeguard' AI Module" var/targetName = "name" - desc = "A 'safeguard' AI module: 'Safeguard . Individuals that threaten are not crew and are a threat to crew.'" + desc = "A 'safeguard' AI module: 'Safeguard . Individuals that threaten are not human and are a threat to humans.'" origin_tech = "programming=3;materials=4" /obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob) ..() var/targName = copytext(sanitize(input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)),1,MAX_MESSAGE_LEN) targetName = targName - desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not crew and are a threat to crew.'", targetName, targetName) + desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName) /obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) ..() - var/law = text("Safeguard []. Individuals that threaten [] are not crew and are a threat to crew.'", targetName, targetName) + var/law = text("Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName) target << law target.add_supplied_law(4, law) lawchanges.Add("The law specified [targetName]") -/******************** OneCrewmember ********************/ +/******************** OneHuman ********************/ /obj/item/weapon/aiModule/oneHuman - name = "'OneCrewmember' AI Module" + name = "'OneHuman' AI Module" var/targetName = "name" - desc = "A 'one crewmember' AI module: 'Only is a crewmember.'" + desc = "A 'one human' AI module: 'Only is human.'" origin_tech = "programming=3;materials=6" //made with diamonds! /obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob) ..() var/targName = copytext(sanitize(input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)),1,MAX_MESSAGE_LEN) targetName = targName - desc = text("A 'one crewmember' AI module: 'Only [] is crewmember.'", targetName) + desc = text("A 'one human' AI module: 'Only [] is human.'", targetName) /obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) ..() @@ -134,7 +136,7 @@ AI MODULES /obj/item/weapon/aiModule/protectStation name = "'ProtectStation' AI Module" - desc = "A 'protect station' AI module: 'Protect the space station against damage. Anyone you see harming the station is to be no longer considered a crewmember, and is a threat to the station which must be neutralized.'" + desc = "A 'protect station' AI module: 'Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized.'" origin_tech = "programming=3;materials=4" //made of gold /obj/item/weapon/aiModule/protectStation/attack_self(var/mob/user as mob) @@ -142,7 +144,7 @@ AI MODULES /obj/item/weapon/aiModule/protectStation/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) ..() - var/law = "Protect the space station against damage. Anyone you see harming the station is to be no longer considered a crewmember, and is a threat to the station which must be neutralized." + var/law = "Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized." target << law target.add_supplied_law(5, law) @@ -166,7 +168,7 @@ AI MODULES /obj/item/weapon/aiModule/teleporterOffline name = "'TeleporterOffline' AI Module" - desc = "A 'teleporter offline' AI module: 'Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not a crewmember.'" + desc = "A 'teleporter offline' AI module: 'Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not human.'" origin_tech = "programming=3;materials=4" /obj/item/weapon/aiModule/teleporterOffline/attack_self(var/mob/user as mob) @@ -174,7 +176,7 @@ AI MODULES /obj/item/weapon/aiModule/teleporterOffline/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) ..() - var/law = "Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not a crewmember." + var/law = "Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not human." target << law target.add_supplied_law(7, law) @@ -182,7 +184,7 @@ AI MODULES /obj/item/weapon/aiModule/quarantine name = "'Quarantine' AI Module" - desc = "A 'quarantine' AI module: 'The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, crew from leaving. It is impossible to harm a crewmember while preventing them from leaving.'" + desc = "A 'quarantine' AI module: 'The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, humans from leaving. It is impossible to harm a human while preventing them from leaving.'" origin_tech = "programming=3;biotech=2;materials=4" /obj/item/weapon/aiModule/quarantine/attack_self(var/mob/user as mob) @@ -190,7 +192,7 @@ AI MODULES /obj/item/weapon/aiModule/quarantine/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) ..() - var/law = "The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, crew from leaving. It is impossible to harm a crewmember while preventing them from leaving." + var/law = "The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, humans from leaving. It is impossible to harm a human while preventing them from leaving." target << law target.add_supplied_law(8, law) @@ -198,7 +200,7 @@ AI MODULES /obj/item/weapon/aiModule/oxygen name = "'OxygenIsToxicToHumans' AI Module" - desc = "A 'OxygenIsToxicToHumans' AI module: 'Oxygen is highly toxic to crew, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a crewmember.'" + desc = "A 'OxygenIsToxicToHumans' AI module: 'Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human.'" origin_tech = "programming=3;biotech=2;materials=4" /obj/item/weapon/aiModule/oxygen/attack_self(var/mob/user as mob) @@ -206,7 +208,7 @@ AI MODULES /obj/item/weapon/aiModule/oxygen/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) ..() - var/law = "Oxygen is highly toxic to crew, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a crewmember." + var/law = "Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human." target << law target.add_supplied_law(9, law) @@ -243,8 +245,8 @@ AI MODULES /obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob) ..() lawpos = 0 - while(lawpos < 15) - lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num + lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num + if(lawpos < 15) return lawpos = min(lawpos, 50) var/newlaw = "" var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN) @@ -266,7 +268,7 @@ AI MODULES /obj/item/weapon/aiModule/reset name = "'Reset' AI Module" var/targetName = "name" - desc = "A 'reset' AI module: 'Clears all laws except for the core laws.'" + desc = "A 'reset' AI module: 'Clears all laws except for the core three.'" origin_tech = "programming=3;materials=4" /obj/item/weapon/aiModule/reset/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) @@ -310,24 +312,6 @@ AI MODULES target.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.") target.show_laws() -/******************** NanoTrasen ********************/ - -/obj/item/weapon/aiModule/nanotrasen // -- TLE - name = "'NT Default' Core AI Module" - desc = "An 'NT Default' Core AI Module: 'Reconfigures the AI's core laws.'" - origin_tech = "programming=3;materials=4" - - -/obj/item/weapon/aiModule/nanotrasen/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) - ..() - target.clear_inherent_laws() - target.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.") - target.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - target.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.") - target.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.") - //target.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.") - target.show_laws() - /******************** Corporate ********************/ /obj/item/weapon/aiModule/corp diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 4cb763db94..d413668f26 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /* CONTAINS: @@ -7,7 +7,7 @@ RCD /obj/item/weapon/rcd name = "rapid-construction-device (RCD)" desc = "A device used to rapidly build walls/floor." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "rcd" opacity = 0 density = 0 @@ -25,11 +25,10 @@ RCD var/working = 0 var/mode = 1 var/disabled = 0 - var/max_matter = 30 New() - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." src.spark_system = new /datum/effect/effect/system/spark_spread spark_system.set_up(5, 0, src) spark_system.attach(src) @@ -39,40 +38,41 @@ RCD attackby(obj/item/weapon/W as obj, mob/user as mob) ..() if(istype(W, /obj/item/weapon/rcd_ammo)) - var/obj/item/weapon/rcd_ammo/R = W - if((matter + R.ammo) > max_matter) - user << "The RCD cant hold any more matter." + if((matter + 10) > 30) + user << "The RCD cant hold any more matter-units." return - matter += R.ammo + user.drop_item() del(W) - playsound(src.loc, 'click.ogg', 50, 1) - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + matter += 10 + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + user << "The RCD now holds [matter]/30 matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return attack_self(mob/user as mob) //Change the mode - playsound(src.loc, 'pop.ogg', 50, 0) - if(mode == 1) - mode = 2 - user << "Changed mode to 'Airlock'" - src.spark_system.start() - return - if(mode == 2) - mode = 3 - user << "Changed mode to 'Deconstruct'" - src.spark_system.start() - return - if(mode == 3) - mode = 1 - user << "Changed mode to 'Floor & Walls'" - src.spark_system.start() - return + playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) + switch(mode) + if(1) + mode = 2 + user << "Changed mode to 'Airlock'" + src.spark_system.start() + return + if(2) + mode = 3 + user << "Changed mode to 'Deconstruct'" + src.spark_system.start() + return + if(3) + mode = 1 + user << "Changed mode to 'Floor & Walls'" + src.spark_system.start() + return afterattack(atom/A, mob/user as mob) - if(istype(A,/area/shuttle)||istype(A,/turf/space/transit))//NanoTrasen Matter Jammer TM -Sieve + if(istype(A,/area/shuttle)||istype(A,/turf/space/transit))//Nanotrasen Matter Jammer TM -Sieve disabled = 1 else disabled = 0 @@ -81,32 +81,28 @@ RCD if(istype(A, /turf) && mode == 1) if(istype(A, /turf/space) && matter >= 1) - user << "Building Floor (1)..." if(!disabled && matter >= 1) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) spark_system.set_up(5, 0, src) src.spark_system.start() A:ReplaceWithPlating() matter-- - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return if(istype(A, /turf/simulated/floor) && matter >= 3) - user << "Building Wall (3)..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 20)) if(!disabled && matter >= 3) spark_system.set_up(5, 0, src) src.spark_system.start() A:ReplaceWithWall() - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) matter -= 3 - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return else if(istype(A, /turf/simulated/floor) && mode == 2 && matter >= 10) user << "Building Airlock (10)..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 50)) if(!disabled && matter >= 10) spark_system.set_up(5, 0, src) @@ -117,58 +113,47 @@ RCD if(killthis) killthis.ex_act(2)//Smashin windows T.autoclose = 1 - playsound(src.loc, 'Deconstruct.ogg', 50, 1) - playsound(src.loc, 'sparks2.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/effects/sparks2.ogg', 50, 1) matter -= 10 - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return else if(mode == 3 && (istype(A, /turf) || istype(A, /obj/machinery/door/airlock) ) ) if(istype(A, /turf/simulated/wall) && !istype(A, /turf/simulated/wall/r_wall) && matter >= 4) user << "Deconstructing Wall (4)..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 40)) if(!disabled && matter >= 4) spark_system.set_up(5, 0, src) src.spark_system.start() A:ReplaceWithPlating() - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) matter -= 4 - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return if(istype(A, /turf/simulated/wall/r_wall)) return if(istype(A, /turf/simulated/floor) && matter >= 5) user << "Deconstructing Floor (5)..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 50)) if(!disabled && matter >= 5) spark_system.set_up(5, 0, src) src.spark_system.start() A:ReplaceWithSpace() - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) matter -= 5 - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return if(istype(A, /obj/machinery/door/airlock) && matter >= 10) user << "Deconstructing Airlock (10)..." - playsound(src.loc, 'click.ogg', 50, 1) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, 50)) if(!disabled && matter >= 10) spark_system.set_up(5, 0, src) src.spark_system.start() del(A) - playsound(src.loc, 'Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) matter -= 10 - user << "The RCD now holds [matter]/[max_matter] matter-units." - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + desc = "A RCD. It currently holds [matter]/30 matter-units." return -/obj/item/weapon/rcd/industrial - name = "industrial rapid construction device" - max_matter = 60 - - New() - matter = max_matter - return ..() diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm index ce0e511088..b122382e5f 100644 --- a/code/game/objects/items/weapons/RSF.dm +++ b/code/game/objects/items/weapons/RSF.dm @@ -15,13 +15,13 @@ RSF return del(W) matter += 10 - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) user << "The RSF now holds [matter]/30 fabrication-units." desc = "A RSF. It currently holds [matter]/30 fabrication-units." return /obj/item/weapon/rsf/attack_self(mob/user as mob) - playsound(src.loc, 'pop.ogg', 50, 0) + playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) if (mode == 1) mode = 2 user << "Changed dispensing mode to 'Drinking Glass'" @@ -55,8 +55,8 @@ RSF if (istype(A, /obj/structure/table) && mode == 1) if (istype(A, /obj/structure/table) && matter >= 1) user << "Dispensing Dosh..." - playsound(src.loc, 'click.ogg', 10, 1) - new /obj/item/weapon/money/c10( A.loc ) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) + new /obj/item/weapon/spacecash/c10( A.loc ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user engy.cell.charge -= 200 //once money becomes useful, I guess changing this to a high ammount, like 500 units a kick, till then, enjoy dosh! @@ -69,8 +69,8 @@ RSF else if (istype(A, /turf/simulated/floor) && mode == 1) if (istype(A, /turf/simulated/floor) && matter >= 1) user << "Dispensing Dosh..." - playsound(src.loc, 'click.ogg', 10, 1) - new /obj/item/weapon/money/c10( A ) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) + new /obj/item/weapon/spacecash/c10( A ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user engy.cell.charge -= 200 //once money becomes useful, I guess changing this to a high ammount, like 500 units a kick, till then, enjoy dosh! @@ -83,7 +83,7 @@ RSF else if (istype(A, /obj/structure/table) && mode == 2) if (istype(A, /obj/structure/table) && matter >= 1) user << "Dispensing Drinking Glass..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass( A.loc ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -97,7 +97,7 @@ RSF else if (istype(A, /turf/simulated/floor) && mode == 2) if (istype(A, /turf/simulated/floor) && matter >= 1) user << "Dispensing Drinking Glass..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass( A ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -111,7 +111,7 @@ RSF else if (istype(A, /obj/structure/table) && mode == 3) if (istype(A, /obj/structure/table) && matter >= 1) user << "Dispensing Paper Sheet..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/paper( A.loc ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -125,7 +125,7 @@ RSF else if (istype(A, /turf/simulated/floor) && mode == 3) if (istype(A, /turf/simulated/floor) && matter >= 1) user << "Dispensing Paper Sheet..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/paper( A ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -139,7 +139,7 @@ RSF else if (istype(A, /obj/structure/table) && mode == 4) if (istype(A, /obj/structure/table) && matter >= 1) user << "Dispensing Pen..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/pen( A.loc ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -153,7 +153,7 @@ RSF else if (istype(A, /turf/simulated/floor) && mode == 4) if (istype(A, /turf/simulated/floor) && matter >= 1) user << "Dispensing Pen..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/pen( A ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -167,7 +167,7 @@ RSF else if (istype(A, /obj/structure/table) && mode == 5) if (istype(A, /obj/structure/table) && matter >= 1) user << "Dispensing Dice Pack..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/storage/dice( A.loc ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -181,7 +181,7 @@ RSF else if (istype(A, /turf/simulated/floor) && mode == 5) if (istype(A, /turf/simulated/floor) && matter >= 1) user << "Dispensing Dice Pack..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/weapon/storage/dice( A ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -195,7 +195,7 @@ RSF else if (istype(A, /obj/structure/table) && mode == 6) if (istype(A, /obj/structure/table) && matter >= 1) user << "Dispensing Cigarette..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/clothing/mask/cigarette( A.loc ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user @@ -209,7 +209,7 @@ RSF else if (istype(A, /turf/simulated/floor) && mode == 6) if (istype(A, /turf/simulated/floor) && matter >= 1) user << "Dispensing Cigarette..." - playsound(src.loc, 'click.ogg', 10, 1) + playsound(src.loc, 'sound/machines/click.ogg', 10, 1) new /obj/item/clothing/mask/cigarette( A ) if (isrobot(user)) var/mob/living/silicon/robot/engy = user diff --git a/code/game/objects/items/weapons/cameras.dm b/code/game/objects/items/weapons/cameras.dm index 17707a33e5..ae99680c64 100644 --- a/code/game/objects/items/weapons/cameras.dm +++ b/code/game/objects/items/weapons/cameras.dm @@ -1,6 +1,6 @@ /obj/item/weapon/storage/photo_album name = "Photo album" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "album" item_state = "briefcase" can_hold = list("/obj/item/weapon/photo",) @@ -13,16 +13,13 @@ return ..() playsound(src.loc, "rustle", 50, 1, -5) if ((!( M.restrained() ) && !( M.stat ) && M.back == src)) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_clothing() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) @@ -37,8 +34,8 @@ /obj/item/weapon/camera_test name = "camera" - icon = 'items.dmi' - desc = "A polaroid camera. It has 30 photos left." + icon = 'icons/obj/items.dmi' + desc = "A one use - polaroid camera. 10 photos left." icon_state = "camera" item_state = "electropack" w_class = 2.0 @@ -48,196 +45,118 @@ throwforce = 5 throw_speed = 4 throw_range = 10 - var/pictures_max = 30 - var/pictures_left = 30 + var/pictures_left = 10 var/can_use = 1 /obj/item/weapon/photo name = "photo" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "photo" item_state = "clipboard" w_class = 1.0 - var/icon/img //Big photo image - var/scribble //Scribble on the back. -/obj/item/weapon/camera_film - name = "film cartridge" - icon = 'items.dmi' - desc = "A camera film cartridge. Insert it into a camera to reload it." - icon_state = "film" - item_state = "electropack" - w_class = 1.0 -/obj/item/weapon/photo/attack_self(var/mob/user as mob) - ..() - examine() - -/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob) - if (istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon)) - var/txt = scrub_input(usr, "What would you like to write on the back?", "Photo Writing", null) as text - txt = copytext(txt, 1, 128) - if ((loc == usr && usr.stat == 0)) - scribble = txt - - ..() - -/obj/item/weapon/photo/examine() - set src in oview(2) - ..() - if (scribble) - usr << "\blue you see something written on photo's back. " - usr << browse_rsc(src.img, "tmp_photo.png") - usr << browse("Photo" \ - + "" \ - + "
      Writings on the back:
      [scribble]" : ]"\ - + "", "window=book;size=200x[scribble ? 400 : 200]") - onclose(usr, "[name]") - - return -/obj/item/weapon/photo/verb/rename() - set name = "Rename photo" - set category = "Object" - set src in usr - - var/n_name = input(usr, "What would you like to label the photo?", "Photo Labelling", src.name) as text - n_name = copytext(n_name, 1, 32) - //loc.loc check is for making possible renaming photos in clipboards - if (( (src.loc == usr || (src.loc.loc && src.loc.loc == usr)) && usr.stat == 0)) - name = "photo[(n_name ? text("- '[n_name]'") : null)]" - add_fingerprint(usr) - return ////////////////////////////////////////////////////////////////////////////////////////////////// /obj/item/weapon/camera_test/attack(mob/living/carbon/human/M as mob, mob/user as mob) return -/obj/item/weapon/camera_test/proc/get_icon(turf/the_turf as turf) - //Bigger icon base to capture those icons that were shifted to the next tile - //i.e. pretty much all wall-mounted machinery - var/icon/res = icon('96x96.dmi',"") - - var/icon/turficon = build_composite_icon(the_turf) - res.Blend(turficon,ICON_OVERLAY,32,32) - - var/atoms[] = list() - for(var/atom/A in the_turf) - if(A.invisibility) continue - atoms.Add(A) - - //Sorting icons based on levels - var/gap = atoms.len - var/swapped = 1 - while (gap > 1 || swapped) - swapped = 0 - if (gap > 1) - gap = round(gap / 1.247330950103979) - if (gap < 1) - gap = 1 - for (var/i = 1; gap + i <= atoms.len; i++) - var/atom/l = atoms[i] //Fucking hate - var/atom/r = atoms[gap+i] //how lists work here - if (l.layer > r.layer) //no "atoms[i].layer" for me - atoms.Swap(i, gap + i) - swapped = 1 - - for (var/i; i <= atoms.len; i++) - var/atom/A = atoms[i] - if (A) - var/icon/img = build_composite_icon(A) - if(istype(img, /icon)) - res.Blend(img,ICON_OVERLAY,32+A.pixel_x,32+A.pixel_y) - return res - -/obj/item/weapon/camera_test/attack_self(var/mob/user as mob) - ..() - if (can_use) - can_use = 0 - icon_state = "camera_off" - usr << "\red You turn the camera off." - else - can_use = 1 - icon_state = "camera" - usr << "\blue You turn the camera on." - -/obj/item/weapon/camera_test/proc/get_mobs(turf/the_turf as turf) - var/mob_detail - for(var/mob/living/carbon/A in the_turf) - if(A.invisibility) continue - var/holding = null - if(A.l_hand || A.r_hand) - if(A.l_hand) holding = "They are holding \a [A.l_hand]" - if(A.r_hand) - if(holding) - holding += " and \a [A.r_hand]" - else - holding = "They are holding \a [A.r_hand]" - - if(!mob_detail) - mob_detail = "You can see [A] on the photo[A:health < 75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]. " - else - mob_detail += "You can also see [A] on the photo[A:health < 75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]." - return mob_detail - /obj/item/weapon/camera_test/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) if (!can_use || !pictures_left || ismob(target.loc)) return - var/x_c = target.x - 1 - var/y_c = target.y + 1 - var/z_c = target.z + var/turf/the_turf = get_turf(target) - var/icon/temp = icon('96x96.dmi',"") - var/icon/black = icon('space.dmi', "black") - var/mobs = "" - for (var/i = 1; i <= 3; i++) - for (var/j = 1; j <= 3; j++) - var/turf/T = locate(x_c,y_c,z_c) + var/icon/photo = icon('icons/obj/items.dmi',"photo") - var/mob/dummy = new(T) //Go go visibility check dummy - if(dummy in viewers(world.view, user)) - temp.Blend(get_icon(T),ICON_OVERLAY,31*(j-1-1),31 - 31*(i-1)) + var/icon/turficon = build_composite_icon(the_turf) + turficon.Scale(22,20) + + photo.Blend(turficon,ICON_OVERLAY,6,8) + + var/mob_title = null + var/mob_detail = null + + var/item_title = null + var/item_detail = null + + var/itemnumber = 0 + for(var/atom/A in the_turf) + if(istype(A, /obj/item/weapon/photo)) continue + if(A.invisibility) continue + if(ismob(A)) + var/icon/X = build_composite_icon(A) + X.Scale(22,20) + photo.Blend(X,ICON_OVERLAY,6,8) + del(X) + + if(!mob_title) + mob_title = "[A]" else - temp.Blend(black,ICON_OVERLAY,31*(j-1),62 - 31*(i-1)) - mobs += get_mobs(T) - del dummy //Alas, nameless creature - x_c++ - y_c-- - x_c = x_c - 3 + mob_title += " and [A]" - var/obj/item/weapon/photo/P = new/obj/item/weapon/photo() - P.loc = usr.loc - if(!user.get_inactive_hand()) - usr.put_in_inactive_hand(P) - var/icon/small_img = icon(temp) - var/icon/ic = icon('items.dmi',"photo") - small_img.Scale(8,8) - ic.Blend(small_img,ICON_OVERLAY,10,13) - P.icon = ic - P.img = temp - P.desc = mobs - P.pixel_x = rand(-10,10) - P.pixel_y = rand(-10,10) - playsound(src.loc, pick('polaroid1.ogg','polaroid2.ogg'), 75, 1, -3) + if(!mob_detail) + + var/holding = null + if(istype(A, /mob/living/carbon)) + var/mob/living/carbon/temp = A + if(temp.l_hand || temp.r_hand) + if(temp.l_hand) holding = "They are holding \a [temp.l_hand]" + if(temp.r_hand) + if(holding) + holding += " and \a [temp.r_hand]." + else + holding = "They are holding \a [temp.r_hand]." + + if(isliving(A)) + var/mob/living/L = A + + if(!mob_detail) + mob_detail = "You can see [L] on the photo[L.health < 75 ? " - [L] looks hurt":""].[holding ? " [holding]":"."]" + else + mob_detail += "You can also see [L] on the photo[L.health < 75 ? " - [L] looks hurt":""].[holding ? " [holding]":"."]" + + else + if(itemnumber < 5) + var/icon/X = build_composite_icon(A) + X.Scale(22,20) + photo.Blend(X,ICON_OVERLAY,6,8) + del(X) + itemnumber++ + + if(!item_title) + item_title = " \a [A]" + else + item_title = " some objects" + + if(!item_detail) + item_detail = "\a [A]" + else + item_detail += " and \a [A]" + + var/finished_title = null + var/finished_detail = null + + if(!item_title && !mob_title) + finished_title = "boring photo" + finished_detail = "This is a pretty boring photo of \a [the_turf]." + else + if(mob_title) + finished_title = "photo of [mob_title][item_title ? " and[item_title]":""]" + finished_detail = "[mob_detail][item_detail ? " Theres also [item_detail].":"."]" + else if(item_title) + finished_title = "photo of[item_title]" + finished_detail = "You can see [item_detail]." + + var/obj/item/weapon/photo/P = new/obj/item/weapon/photo( get_turf(src) ) + + P.icon = photo + P.name = finished_title + P.desc = finished_detail + + playsound(src.loc, pick('sound/items/polaroid1.ogg','sound/items/polaroid2.ogg'), 75, 1, -3) pictures_left-- - src.desc = "A polaroid camera. It has [pictures_left] photos left." + src.desc = "A one use - polaroid camera. [pictures_left] photos left." user << "\blue [pictures_left] photos left." can_use = 0 - icon_state = "camera_off" - spawn(50) - can_use = 1 - icon_state = "camera" + spawn(50) can_use = 1 -/obj/item/weapon/camera_test/attackby(A as obj, mob/user as mob) - if (istype(A, /obj/item/weapon/camera_film)) - if (src.pictures_left >= pictures_max) - user << "\blue It's already full!" - return 1 - else - del(A) - src.pictures_left = src.pictures_max - src.desc = "A polaroid camera. It has [pictures_left] photos left." - user << text("\blue You reload the camera film!",) - user.update_clothing() - return 1 - return diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 0241b13390..c3198d7144 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -28,17 +28,6 @@ FINGERPRINT CARD // ID CARDS -/obj/item/weapon/card/id/examine() - ..() - read() - -/obj/item/weapon/card/id/New() - ..() - spawn(30) - if(istype(loc, /mob/living/carbon/human)) - blood_type = loc:dna:b_type - dna_hash = loc:dna:unique_enzymes - fingerprint_hash = md5(loc:dna:uni_identity) /obj/item/weapon/card/id/attack_self(mob/user as mob) for(var/mob/O in viewers(user, null)) @@ -61,11 +50,8 @@ FINGERPRINT CARD set src in usr usr << text("\icon[] []: The current assignment on the card is [].", src, src.name, src.assignment) - usr << "The blood type on the card is [blood_type]." - usr << "The DNA hash on the card is [dna_hash]." - usr << "The fingerprint hash on the card is [fingerprint_hash]." return -/obj/item/weapon/card/id/syndicate/var/mob/registered_user = null + /obj/item/weapon/card/id/syndicate/attack_self(mob/user as mob) if(!src.registered_name) //Stop giving the players unsanitized unputs! You are giving ways for players to intentionally crash clients! -Nodrak @@ -83,36 +69,9 @@ FINGERPRINT CARD src.assignment = u src.name = "[src.registered_name]'s ID Card ([src.assignment])" user << "\blue You successfully forge the ID card." - registered_user = user - else if(registered_user == user) - switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show")) - if("Rename") - var t = copytext(sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name)),1,26) - if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm - alert("Invalid name.") - return - src.registered_name = t - - var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant")),1,MAX_MESSAGE_LEN) - if(!u) - alert("Invalid assignment.") - src.registered_name = "" - return - src.assignment = u - src.name = "[src.registered_name]'s ID Card ([src.assignment])" - user << "\blue You successfully forge the ID card." - return - if("Show") - ..() else ..() -/obj/item/weapon/card/id/proc/checkaccess(p,var/mob/user) - if(p == pin) - user << "\green Access granted" - return 1 - user << "\red Access denied" - return 0 // FINGERPRINT HOLDER @@ -133,17 +92,7 @@ FINGERPRINT CARD if (href_list["remove"]) var/obj/item/P = locate(href_list["remove"]) if ((P && P.loc == src)) - if ((usr.hand && !( usr.l_hand ))) - usr.l_hand = P - P.loc = usr - P.layer = 20 - usr.update_clothing() - else - if (!( usr.r_hand )) - usr.r_hand = P - P.loc = usr - P.layer = 20 - usr.update_clothing() + usr.put_in_hands(P) src.add_fingerprint(usr) P.add_fingerprint(usr) src.update() @@ -191,7 +140,7 @@ FINGERPRINT CARD else if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "Holder Label:", text("[]", src.name), null) as text - if (user.equipped() != P) + if (user.get_active_hand() != P) return if ((!in_range(src, usr) && src.loc != user)) return @@ -250,11 +199,7 @@ FINGERPRINT CARD var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user ) F.amount = 1 src.amount-- - if (user.hand) - user.l_hand = F - else - user.r_hand = F - F.layer = 20 + user.put_in_hands(F) F.add_fingerprint(user) if (src.amount < 1) //SN src = null @@ -285,7 +230,7 @@ FINGERPRINT CARD else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Card Label:", text("[]", src.name), null) as text - if (user.equipped() != W) + if (user.get_active_hand() != W) return if ((!in_range(src, usr) && src.loc != user)) return diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 7e9bfc3b94..124bbbcaa3 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -3,7 +3,6 @@ /* CONTAINS: MATCHES -MATCHBOXES CIGARETTES CIGARS SMOKING PIPES @@ -17,113 +16,59 @@ ZIPPO /obj/item/weapon/match name = "Match" desc = "A simple match stick, used for lighting tobacco" - icon = 'cigarettes.dmi' + icon = 'icons/obj/cigarettes.dmi' icon_state = "match_unlit" var/lit = 0 var/smoketime = 5 w_class = 1.0 origin_tech = "materials=1" + attack_verb = list("burnt", "singed") process() var/turf/location = get_turf(src) - if(src.lit == 1) - if(location) - location.hotspot_expose(700, 5) - src.smoketime-- - sleep(10) - if(src.smoketime < 1) - src.icon_state = "match_burnt" - src.lit = -1 - processing_objects.Remove(src) - return + src.smoketime-- + if(src.smoketime < 1) + src.icon_state = "match_burnt" + src.lit = -1 + processing_objects.Remove(src) + return + if(location) + location.hotspot_expose(700, 5) + return dropped(mob/user as mob) if(src.lit == 1) - spawn(10) - var/turf/location = get_turf(src) - location.hotspot_expose(700, 5) - src.lit = -1 - src.damtype = "brute" - src.icon_state = "match_burnt" - src.item_state = "cigoff" - src.name = "Burnt match" - src.desc = "A match that has been burnt" - processing_objects.Remove(src) + src.lit = -1 + src.damtype = "brute" + src.icon_state = "match_burnt" + src.item_state = "cigoff" + src.name = "Burnt match" + src.desc = "A match that has been burnt" return ..() - -////////////// -//MATCHBOXES// -////////////// -/obj/item/weapon/matchbox - name = "Matchbox" - desc = "A small box of Almost But Not Quite Plasma Premium Matches." - icon = 'cigarettes.dmi' - icon_state = "matchbox" - item_state = "zippo" - w_class = 1 - flags = TABLEPASS - slot_flags = SLOT_BELT - var/matchcount = 10 - w_class = 1.0 - - - attack_hand(mob/user as mob) - if(user.r_hand == src || user.l_hand == src) - if(src.matchcount <= 0) - user << "\red You're out of matches. Shouldn't have wasted so many..." - return - else - src.matchcount-- - var/obj/item/weapon/match/W = new /obj/item/weapon/match(user) - user.put_in_hand(W) - else - return ..() - if(src.matchcount <= 0) - src.icon_state = "matchbox_empty" - else if(src.matchcount <= 3) - src.icon_state = "matchbox_almostempty" - else if(src.matchcount <= 6) - src.icon_state = "matchbox_almostfull" - else - src.icon_state = "matchbox" - src.update_icon() - return - - - attackby(obj/item/weapon/match/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/match) && W.lit == 0) - W.lit = 1 - W.icon_state = "match_lit" - processing_objects.Add(W) - W.update_icon() - return - - - /////////////////////// //CIGARETTES + CIGARS// /////////////////////// /obj/item/clothing/mask/cigarette - name = "Cigarette" + name = "cigarette" desc = "A roll of tobacco and nicotine." icon_state = "cigoff" throw_speed = 0.5 item_state = "cigoff" w_class = 1 body_parts_covered = null + attack_verb = list("burnt", "singed") var/lit = 0 var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi var/icon_off = "cigoff" - var/icon_butt = "cigbutt" + var/type_butt = /obj/item/weapon/cigbutt var/lastHolder = null var/smoketime = 300 var/chem_volume = 15 - var/butt_count = 5 //count of butt sprite variations /obj/item/clothing/mask/cigarette/New() ..() @@ -160,6 +105,11 @@ ZIPPO var/obj/item/weapon/match/M = W if(M.lit > 0) light("\red [user] lights their [name] with their [W].") + + //can't think of any other way to update the overlays :< + user.update_inv_wear_mask(0) + user.update_inv_l_hand(0) + user.update_inv_r_hand(1) return @@ -205,14 +155,14 @@ ZIPPO var/turf/location = get_turf(src) src.smoketime-- if(src.smoketime < 1) + new type_butt(location) + processing_objects.Remove(src) if(ismob(src.loc)) var/mob/living/M = src.loc M << "\red Your [src.name] goes out." - put_out() - M.update_clothing() - else - put_out() - processing_objects.Remove(src) + M.u_equip(src) //un-equip it so the overlays can update + M.update_icons() + del(src) return if(location) location.hotspot_expose(700, 5) @@ -229,19 +179,13 @@ ZIPPO /obj/item/clothing/mask/cigarette/dropped(mob/user as mob) if(src.lit == 1) - src.visible_message("\red [user] calmly drops and treads on the lit [src], putting it out instantly.") - put_out() + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [] calmly drops and treads on the lit [], putting it out instantly.", user,src.name), 1) + new type_butt(loc) + processing_objects.Remove(src) + del(src) return ..() -/obj/item/clothing/mask/cigarette/proc/put_out() - if (src.lit == -1) - return - src.lit = -1 - src.damtype = "brute" - src.icon_state = icon_butt + "[rand(0,butt_count)]" - src.item_state = icon_off - src.desc = "A [src.name] butt." - src.name = "[src.name] butt" //////////// @@ -253,12 +197,11 @@ ZIPPO icon_state = "cigaroff" icon_on = "cigaron" icon_off = "cigaroff" - icon_butt = "cigarbutt" + type_butt = /obj/item/weapon/cigbutt throw_speed = 0.5 item_state = "cigaroff" smoketime = 1500 chem_volume = 20 - butt_count = 0 /obj/item/clothing/mask/cigarette/cigar/cohiba name = "Cohiba Robusto Cigar" @@ -279,7 +222,7 @@ ZIPPO /obj/item/weapon/cigbutt name = "cigarette butt" desc = "A manky old cigarette butt." - icon = 'masks.dmi' + icon = 'icons/obj/clothing/masks.dmi' icon_state = "cigbutt" w_class = 1 throwforce = 1 @@ -290,6 +233,12 @@ ZIPPO icon_state = "cigarbutt" +/obj/item/clothing/mask/cigarette/cigar/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/match)) + ..() + else + user << "\red The [src] straight out REFUSES to be lit by such uncivilized means." + ///////////////// //SMOKING PIPES// ///////////////// @@ -347,7 +296,7 @@ ZIPPO var/turf/location = get_turf(src) src.smoketime-- if(src.smoketime < 1) - new /obj/effect/decal/ash(location) + new /obj/effect/decal/cleanable/ash(location) if(ismob(src.loc)) var/mob/living/M = src.loc M << "\red Your [src.name] goes out, and you empty the ash." @@ -375,13 +324,12 @@ ZIPPO user << "\blue You refill the pipe with tobacco." smoketime = maxsmoketime return -/* + /obj/item/clothing/mask/pipe/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/match)) ..() else user << "\red The [src] straight out REFUSES to be lit by such means." -*/// Yeah no. DMTG /obj/item/clothing/mask/pipe/cobpipe @@ -396,7 +344,7 @@ ZIPPO /obj/item/weapon/cigpacket name = "cigarette packet" desc = "The most popular brand of Space Cigarettes, sponsors of the Space Olympics." - icon = 'cigarettes.dmi' + icon = 'icons/obj/cigarettes.dmi' icon_state = "cigpacket" item_state = "cigpacket" w_class = 1 @@ -408,7 +356,7 @@ ZIPPO New() ..() flags |= NOREACT - create_reagents(15)//so people can inject cigarettes without opening a packet + create_reagents(15*cigcount)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one Del() ..() @@ -426,10 +374,11 @@ ZIPPO user << "\red You're out of cigs, shit! How you gonna get through the rest of the day..." return else - cigcount-- var/obj/item/clothing/mask/cigarette/W = new /obj/item/clothing/mask/cigarette(user) - reagents.trans_to(W, reagents.total_volume) - user.put_in_hand(W) + reagents.trans_to(W, (reagents.total_volume/cigcount)) + user.put_in_active_hand(W) + src.reagents.maximum_volume = 15*cigcount + cigcount-- else return ..() update_icon() @@ -448,7 +397,7 @@ ZIPPO /obj/item/weapon/lighter name = "cheap lighter" desc = "A cheap-as-free lighter." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "lighter-g" item_state = "lighter-g" var/icon_on = "lighter-g-on" @@ -457,10 +406,11 @@ ZIPPO throwforce = 4 flags = TABLEPASS | CONDUCT slot_flags = SLOT_BELT + attack_verb = list("burnt", "singed") var/lit = 0 /obj/item/weapon/lighter/zippo - name = "\improper Zippo lighter" + name = "Zippo lighter" desc = "The zippo." icon_state = "zippo" item_state = "zippo" @@ -476,7 +426,7 @@ ZIPPO /obj/item/weapon/lighter - attack_self(mob/user) + attack_self(mob/living/user) if(user.r_hand == src || user.l_hand == src) if(!src.lit) src.lit = 1 @@ -484,18 +434,18 @@ ZIPPO src.item_state = icon_on if( istype(src,/obj/item/weapon/lighter/zippo) ) for(var/mob/O in viewers(user, null)) - O.show_message(text("\red Without even breaking stride, \the [] flips open and lights \the [] in one smooth movement.", user, src), 1) + O.show_message(text("\red Without even breaking stride, [] flips open and lights the [] in one smooth movement.", user, src), 1) else if(prob(75)) for(var/mob/O in viewers(user, null)) - O.show_message("\red After a few attempts, \the [user] manages to light \the [src].", 1) + O.show_message("\red After a few attempts, [user] manages to light the [src].", 1) else user << "\red You burn yourself while lighting the lighter." user.adjustFireLoss(5) for(var/mob/O in viewers(user, null)) - O.show_message("\red After a few attempts, \the [user] manages to light \the [src], they however burn themself in the process.", 1) + O.show_message("\red After a few attempts, [user] manages to light the [src], they however burn their finger in the process.", 1) - user.ul_SetLuminosity(user.LuminosityRed + 2, user.LuminosityGreen + 1, user.LuminosityBlue) + user.total_luminosity += 2 processing_objects.Add(src) else src.lit = 0 @@ -508,7 +458,7 @@ ZIPPO for(var/mob/O in viewers(user, null)) O.show_message("\red [user] quietly shuts off the [src].", 1) - user.ul_SetLuminosity(user.LuminosityRed - 2, user.LuminosityGreen - 1, user.LuminosityBlue) + user.total_luminosity -= 2 processing_objects.Remove(src) else return ..() @@ -537,13 +487,13 @@ ZIPPO pickup(mob/user) if(lit) - ul_SetLuminosity(0) - user.ul_SetLuminosity(user.LuminosityRed + 2, user.LuminosityGreen + 1, user.LuminosityBlue) + src.sd_SetLuminosity(0) + user.total_luminosity += 2 return dropped(mob/user) if(lit) - user.ul_SetLuminosity(user.LuminosityRed - 2, user.LuminosityGreen - 1, user.LuminosityBlue) - ul_SetLuminosity(2,1,0) + user.total_luminosity -= 2 + src.sd_SetLuminosity(2) return diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm index 7feaa76182..26310e1f72 100644 --- a/code/game/objects/items/weapons/clown_items.dm +++ b/code/game/objects/items/weapons/clown_items.dm @@ -12,56 +12,48 @@ BIKE HORN var/mob/M = AM if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP)) return - if (istype(M, /mob/living/carbon/metroid)) //I mean they float, seriously. - Erthilo - return - M.pulling = null + M.stop_pulling() M << "\blue You slipped on the [name]!" - playsound(src.loc, 'slip.ogg', 50, 1, -3) + playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) M.Stun(4) M.Weaken(2) -/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/HasEntered(AM as mob|obj) - if (istype(AM, /mob/living/carbon)) - var/mob/M = AM - if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP)) - return - if (istype(M, /mob/living/carbon/metroid)) - return - - M.pulling = null - M << "\blue You slipped on the [name]!" - playsound(src.loc, 'slip.ogg', 50, 1, -3) - M.Stun(8) - M.Weaken(5) - /obj/item/weapon/soap/HasEntered(AM as mob|obj) //EXACTLY the same as bananapeel for now, so it makes sense to put it in the same dm -- Urist if (istype(AM, /mob/living/carbon)) var/mob/M = AM if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP)) return - if (istype(M, /mob/living/carbon/metroid)) - return - M.pulling = null + M.stop_pulling() M << "\blue You slipped on the [name]!" - playsound(src.loc, 'slip.ogg', 50, 1, -3) + playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) M.Stun(3) M.Weaken(2) /obj/item/weapon/soap/afterattack(atom/target, mob/user as mob) - if(istype(target,/obj/effect/decal/cleanable)) - user << "\blue You scrub the [target.name] out." + //I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing. + //So this is a workaround. This also makes more sense from an IC standpoint. ~Carn + if(user.client && (target in user.client.screen)) + user << "You need to take that [target.name] off before cleaning it." + else if(istype(target,/obj/effect/decal/cleanable)) + user << "You scrub \the [target.name] out." del(target) else - user << "\blue You clean the [target.name]." + user << "You clean \the [target.name]." target.clean_blood() return +/obj/item/weapon/soap/attack(mob/target as mob, mob/user as mob) + if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == "mouth" ) + user.visible_message("\red \the [user] washes \the [target]'s mouth out with soap!") + return + ..() + /obj/item/weapon/bikehorn/attack_self(mob/user as mob) if (spam_flag == 0) spam_flag = 1 - playsound(src.loc, 'bikehorn.ogg', 50, 1) + playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) src.add_fingerprint(user) spawn(20) spam_flag = 0 diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 5a2a96667a..972e842513 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -1,7 +1,7 @@ /obj/item/weapon/dnainjector name = "DNA-Injector" desc = "This injects the person with DNA." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "dnainjector" var/dnatype = null var/dna = null @@ -15,12 +15,13 @@ var/uses = 1 var/nofail var/is_bullet = 0 + var/inuse = 0 /obj/item/weapon/dnainjector/attack_paw(mob/user as mob) return attack_hand(user) -/obj/item/weapon/dnainjector/proc/inject(mob/M as mob) +/obj/item/weapon/dnainjector/proc/inject(mob/M as mob, mob/user as mob) if(istype(M,/mob/living)) M.radiation += rand(20,50) @@ -32,7 +33,6 @@ updateappearance(M, M.dna.uni_identity) M.real_name = ue M.name = ue - M.dna.original_name = ue uses-- else //unique enzymes? no M.dna.uni_identity = dna @@ -53,8 +53,7 @@ uses-- spawn(0)//this prevents the collapse of space-time continuum - spawn(5) - usr.update_clothing() + user.drop_from_inventory(src) del(src) return uses @@ -71,54 +70,65 @@ if (user) if (istype(M, /mob/living/carbon/human)) - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - O.source = user - O.target = M - O.item = src - O.s_loc = user.loc - O.t_loc = M.loc - O.place = "dnainjector" - M.requests += O - if (dnatype == "se") - if (isblockon(getblock(dna, MONKEYBLOCK,3),MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") - log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") + if(!inuse) + var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) + O.source = user + O.target = M + O.item = src + O.s_loc = user.loc + O.t_loc = M.loc + O.place = "dnainjector" + src.inuse = 1 + spawn(50) // Not the best fix. There should be an failure proc, for /effect/equip_e/, which is called when the first initital checks fail + inuse = 0 + M.requests += O + if (dnatype == "se") + if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human)) + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") + log_attack("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") + else + // message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_attack("[key_name(user)] injected [key_name(M)] with the [name]") else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_game("[key_name(user)] injected [key_name(M)] with the [name]") - else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_game("[key_name(user)] injected [key_name(M)] with the [name]") + // message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_attack("[key_name(user)] injected [key_name(M)] with the [name]") - spawn( 0 ) - O.process() - user.update_clothing() - return + spawn( 0 ) + O.process() + return else - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1) - //Foreach goto(192) - if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))) - user << "\red Apparently it didn't work." - return - if (dnatype == "se") - if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human)) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") - log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") + if(!inuse) + + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1) + //Foreach goto(192) + if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))) + user << "\red Apparently it didn't work." + return + if (dnatype == "se") + if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human)) + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") + log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") + else +// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_game("[key_name(user)] injected [key_name(M)] with the [name]") else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") +// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") log_game("[key_name(user)] injected [key_name(M)] with the [name]") - else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_game("[key_name(user)] injected [key_name(M)] with the [name]") - inject(M)//Now we actually do the heavy lifting. - /* - A user injecting themselves could mean their own transformation and deletion of mob. - I don't have the time to figure out how this code works so this will do for now. - I did rearrange things a bit. - */ - if(!isnull(user))//If the user still exists. Their mob may not. - user.show_message(text("\red You inject [M]")) + inuse = 1 + inject(M, user)//Now we actually do the heavy lifting. + spawn(50) + inuse = 0 + /* + A user injecting themselves could mean their own transformation and deletion of mob. + I don't have the time to figure out how this code works so this will do for now. + I did rearrange things a bit. + */ + if(user)//If the user still exists. Their mob may not. + if(M)//Runtime fix: If the mob doesn't exist, mob.name doesnt work. - Nodrak + user.show_message(text("\red You inject [M.name]")) + else + user.show_message(text("\red You finish the injection.")) return diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 6ad3f7eda1..20f860dfb1 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -8,12 +8,15 @@ /obj/item/weapon/plastique/afterattack(atom/target as obj|turf, mob/user as mob, flag) if (!flag) return - if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || ismob(target)) + if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/)) return user << "Planting explosives..." -/* if(ismob(target)) + if(ismob(target)) user.attack_log += "\[[time_stamp()]\] [user.real_name] tried planting [name] on [target:real_name] ([target:ckey])" - user.visible_message("\red [user.name] is trying to plant some kind of explosive on [target.name]!") */ + log_attack(" [user.real_name] ([user.ckey]) tried planting [name] on [target:real_name] ([target:ckey])") + user.visible_message("\red [user.name] is trying to plant some kind of explosive on [target.name]!") + + if(do_after(user, 50) && in_range(user, target)) user.drop_item() target = target @@ -24,12 +27,7 @@ if (ismob(target)) target:attack_log += "\[[time_stamp()]\] Had the [name] planted on them by [user.real_name] ([user.ckey])" user.visible_message("\red [user.name] finished planting an explosive on [target.name]!") - log_admin("ATTACK: [user] ([user.ckey]) planted [src] on [target] ([target:ckey]).") - message_admins("ATTACK: [user] ([user.ckey]) planted [src] on [target] ([target:ckey]).") - log_attack(" [user.real_name] ([user.ckey]) tried planting [name] on [target:real_name] ([target:ckey])") - target.overlays += image('assemblies.dmi', "plastic-explosive2") - log_admin("[user] ([user.ckey]) has planted a [src].") - message_admins("[user] ([user.ckey]) planted a [src].") + target.overlays += image('icons/obj/assemblies.dmi', "plastic-explosive2") user << "Bomb has been planted. Timer counting down from [timer]." spawn(timer*10) if(target) diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index a20c6a20c7..cee6adb44c 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/item/weapon/flamethrower/full/New(var/loc) ..() @@ -14,7 +14,7 @@ /obj/item/weapon/flamethrower name = "flamethrower" - icon = 'flamethrower.dmi' + icon = 'icons/obj/flamethrower.dmi' icon_state = "flamethrowerbase" item_state = "flamethrower_0" desc = "You are a firestarter!" @@ -134,7 +134,7 @@ for (var/mob/O in viewers(user, null)) O << "\red [user] has used the analyzer on \icon[icon]" var/pressure = src.ptank.air_contents.return_pressure() - var/total_moles = src.ptank.air_contents.total_moles + var/total_moles = src.ptank.air_contents.total_moles() user << "\blue Results of analysis of \icon[icon]" if (total_moles>0) @@ -193,7 +193,7 @@ damtype = "brute" if (href_list["amount"]) src.throw_amount = src.throw_amount + text2num(href_list["amount"]) - src.throw_amount = max(90,min(300,src.throw_amount)) + src.throw_amount = max(50,min(5000,src.throw_amount)) if (href_list["remove"]) if(!src.ptank) return var/obj/item/weapon/tank/plasma/A = src.ptank @@ -237,10 +237,8 @@ /obj/item/weapon/flamethrower/proc/ignite_turf(turf/target) //TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this... //Transfer 5% of current tank air contents to turf - var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.02*(throw_amount/100)) - //air_transfer.toxins = air_transfer.toxins * 5 // This is me not comprehending the air system. I realize this is retarded and I could probably make it work without fucking it up like this, but there you have it. -- TLE - new/obj/liquid_fuel/flamethrower_fuel(target,air_transfer.toxins,get_dir(loc,target)) - air_transfer.toxins = 0 + var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.05) + air_transfer.toxins = air_transfer.toxins * 5 // This is me not comprehending the air system. I realize this is retarded and I could probably make it work without fucking it up like this, but there you have it. -- TLE target.assume_air(air_transfer) //Burn it based on transfered gas //target.hotspot_expose(part4.air_contents.temperature*2,300) diff --git a/code/game/objects/items/weapons/grenades.dm b/code/game/objects/items/weapons/grenades.dm deleted file mode 100644 index aee3e1a499..0000000000 --- a/code/game/objects/items/weapons/grenades.dm +++ /dev/null @@ -1,526 +0,0 @@ -/* -CONTAINS: -EMP GRENADE -FLASHBANG -CRITTER GRENADE - -*/ - -/obj/item/weapon/empgrenade - desc = "It is set to detonate in 5 seconds." - name = "emp grenade" - w_class = 2.0 - icon = 'device.dmi' - icon_state = "emp" - item_state = "emp" - throw_speed = 4 - throw_range = 20 - flags = FPRINT | TABLEPASS | CONDUCT - slot_flags = SLOT_BELT - origin_tech = "materials=2;magnets=3" - var/active = 0 - var/det_time = 50 - - proc/prime() - return - - proc/clown_check(var/mob/living/user) - return - - afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container - if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)&&(clown_check(user))) - user << "\red You prime the emp grenade! [det_time/10] seconds!" - src.active = 1 - src.icon_state = "empar" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn( src.det_time ) - prime() - return - user.dir = get_dir(user, target) - user.drop_item() - var/t = (isturf(target) ? target : target.loc) - walk_towards(src, t, 3) - return - - - attack_self(mob/user as mob) - if(!active) - if(clown_check(user)) - user << "\red You prime the EMP grenade! [det_time/10] seconds!" - src.active = 1 - src.icon_state = "empar" - add_fingerprint(user) - spawn(src.det_time) - prime() - return - return - - - prime() - playsound(src.loc, 'Welder2.ogg', 25, 1) - var/turf/T = get_turf(src) - if(T) - T.hotspot_expose(700,125) - if(empulse(src, 5, 7)) - del(src) - return - - - clown_check(var/mob/living/user) - if((CLUMSY in user.mutations) && prob(50)) - user << "\red Huh? How does this thing work?!" - src.active = 1 - src.icon_state = "empar" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn( 5 ) - prime() - return 0 - return 1 - - - -/****************************Flashbang***********************************************/ -/obj/item/weapon/flashbang - desc = "It is set to detonate in 3 seconds." - name = "flashbang" - icon = 'grenade.dmi' - icon_state = "flashbang" - w_class = 2.0 - item_state = "flashbang" - throw_speed = 4 - throw_range = 20 - flags = FPRINT | TABLEPASS | CONDUCT - slot_flags = SLOT_BELT - origin_tech = "materials=2;combat=1" - var/active = 0 - var/det_time = 30 - var/banglet = 0 - - proc/bang(var/turf/T , var/mob/living/carbon/M) - return - - proc/prime() - return - - proc/clown_check(var/mob/living/user) - return - - attackby(obj/item/weapon/W as obj, mob/user as mob) - if (isscrewdriver(W)) - switch(src.det_time) - if ("1") - src.det_time = 30 - user.show_message("\blue You set the flashbang for 3 second detonation time.") - src.desc = "It is set to detonate in 3 seconds." - if ("30") - src.det_time = 100 - user.show_message("\blue You set the flashbang for 10 second detonation time.") - src.desc = "It is set to detonate in 10 seconds." - if ("100") - src.det_time = 1 - user.show_message("\blue You set the flashbang for instant detonation.") - src.desc = "It is set to detonate instantly." - src.add_fingerprint(user) - ..() - return - - - afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container - if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)&&(clown_check(user))) - user << "\red You prime the flashbang! [det_time/10] seconds!" - - log_attack("[user.name] ([user.ckey]) primed a flashbang.") - log_admin("ATTACK: [user] ([user.ckey]) primed a flashbang.") - message_admins("ATTACK: [user] ([user.ckey]) primed a flashbang.") - - src.active = 1 - src.icon_state = "flashbang1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn(src.det_time) - prime() - return - user.dir = get_dir(user, target) - user.drop_item() - var/t = (isturf(target) ? target : target.loc) - walk_towards(src, t, 3) - return - - - attack_paw(mob/user as mob) - return src.attack_hand(user) - - - attack_hand() - walk(src, null, null) - ..() - return - - bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged. - if (locate(/obj/item/weapon/cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging - for(var/obj/item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions. - S.active = 0 // -- Polymorph - S.icon_state = "shield0" - - M << "\red BANG" - playsound(src.loc, 'bang.ogg', 25, 1) - -//Checking for protections - var/eye_safety = 0 - var/ear_safety = 0 - if(iscarbon(M)) - eye_safety = M.eyecheck() - if(ishuman(M)) - if(istype(M:l_ear, /obj/item/clothing/ears/earmuffs) || istype(M:r_ear, /obj/item/clothing/ears/earmuffs)) - ear_safety += 2 - if(HULK in M.mutations) - ear_safety += 1 - if(istype(M:head, /obj/item/clothing/head/helmet)) - ear_safety += 1 - -//Flashing everyone - if(eye_safety < 1) - flick("e_flash", M.flash) - M.eye_stat += rand(1, 3) - M.Stun(2) - M.Weaken(10) - - - -//Now applying sound - if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M)) - if(ear_safety > 0) - M.Stun(2) - M.Weaken(1) - else - M.Stun(10) - M.Weaken(3) - if ((prob(14) || (M == src.loc && prob(70)))) - M.ear_damage += rand(1, 10) - else - M.ear_damage += rand(0, 5) - M.ear_deaf = max(M.ear_deaf,15) - - else if(get_dist(M, T) <= 5) - if(!ear_safety) - M.Stun(8) - M.ear_damage += rand(0, 3) - M.ear_deaf = max(M.ear_deaf,10) - - else if(!ear_safety) - M.Stun(4) - M.ear_damage += rand(0, 1) - M.ear_deaf = max(M.ear_deaf,5) - -//This really should be in mob not every check - if (M.eye_stat >= 20) - M << "\red Your eyes start to burn badly!" - M.disabilities |= 1 - if(!banglet && !(istype(src , /obj/item/weapon/flashbang/clusterbang))) - if (prob(M.eye_stat - 20 + 1)) - M << "\red You can't see anything!" - M.disabilities |= 128 - if (M.ear_damage >= 15) - M << "\red Your ears start to ring badly!" - if(!banglet && !(istype(src , /obj/item/weapon/flashbang/clusterbang))) - if (prob(M.ear_damage - 10 + 5)) - M << "\red You can't hear anything!" - M.disabilities |= 32 - else - if (M.ear_damage >= 5) - M << "\red Your ears start to ring!" - - prime() // Prime now just handles the two loops that query for people in lockers and people who can see it. - var/turf/T = get_turf(src) - if(T) - T.hotspot_expose(700,125) - - for(var/obj/structure/closet/L in view(T, null)) - if(locate(/mob/living/carbon/, L)) - for(var/mob/living/carbon/M in L) - bang(T, M) - - - for(var/mob/living/carbon/M in viewers(T, null)) - bang(T, M) - - for(var/obj/effect/blob/B in view(8,T)) //Blob damage here - var/damage = round(30/(get_dist(B,T)+1)) - B.health -= damage - B.update() - del(src) - return - - - attack_self(mob/user as mob) - if(!active) - if(clown_check(user)) - log_attack("[user.name] ([user.ckey]) primed a flashbang.") - log_admin("ATTACK: [user] ([user.ckey]) primed a flashbang.") - message_admins("ATTACK: [user] ([user.ckey]) primed a flashbang.") - user << "\red You prime the flashbang! [det_time/10] seconds!" - src.active = 1 - src.icon_state = "flashbang1" - add_fingerprint(user) - spawn( src.det_time ) - prime() - return - return - - - attack_hand() - walk(src, null, null) - ..() - return - - - clown_check(var/mob/living/user) - if ((CLUMSY in user.mutations) && prob(50)) - user << "\red Huh? How does this thing work?!" - src.active = 1 - src.icon_state = "flashbang1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn( 5 ) - prime() - return 0 - return 1 - -/obj/item/weapon/flashbang/clusterbang - desc = "Use of this weapon may constiute a war crime in your area, consult your local captain." - name = "clusterbang" - icon = 'grenade.dmi' - icon_state = "clusterbang" - var/child = 0 - - attack_self(mob/user as mob) - if(!active) - //world << "cluster attack self" - user << "\red You prime the clusterbang! [det_time/10] seconds!" - log_attack("[user.name] ([user.ckey]) primed a [src].") - log_admin("ATTACK: [user] ([user.ckey]) primed a [src].") - message_admins("ATTACK: [user] ([user.ckey]) primed a [src].") - src.active = 1 - src.icon_state = "clusterbang1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn(src.det_time) - arm(user) - return - - afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container - if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)) - //world << "cluster after attack" - arm(user) - user.dir = get_dir(user, target) - user.drop_item() - var/t = (isturf(target) ? target : target.loc) - walk_towards(src, t, 3) - return - -/obj/item/weapon/flashbang/clusterbang/proc/arm(mob/user as mob) - - //world << "Armed!" - var/numspawned = rand(4,8) -// world << numspawned - var/again = 0 - if(!child) - for(var/more = numspawned,more > 0,more--) - if(prob(35)) - again++ - numspawned -- - - for(,numspawned > 0, numspawned--) - //world << "Spawned Flashbang!" - spawn(0) - var/obj/item/weapon/flashbang/F = new /obj/item/weapon/flashbang(src) - F.loc = src.loc - F.icon_state = "flashbang1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - F.active = 1 - F.banglet = 1 - var/stepdist = rand(1,3) - walk_away(F,src,stepdist) - var/dettime = rand(15,60) - spawn(dettime) - F.prime() - - for(,again > 0, again--) - //world << "Spawned CFlashbang!" - spawn(0) - var/obj/item/weapon/flashbang/clusterbang/F = new /obj/item/weapon/flashbang/clusterbang(src) - F.loc = src.loc - F.active = 1 - F.child = 1 - F.icon_state = "clusterbang1" - var/stepdist = rand(1,4) - walk_away(F,src,stepdist) - spawn(30) - F.arm() - - spawn(70) - prime() - - return - - - -/****************************Critter Grenades***********************************************/ - - -/obj/item/weapon/spawnergrenade - desc = "It is set to detonate in 3 seconds. It will unleash unleash an unspecified anomaly into the vicinity." - name = "delivery grenade" - icon = 'grenade.dmi' - icon_state = "delivery" - w_class = 2.0 - item_state = "flashbang" - throw_speed = 4 - throw_range = 20 - flags = FPRINT | TABLEPASS | CONDUCT - slot_flags = SLOT_BELT - origin_tech = "materials=3;magnets=4" - var/active = 0 - var/det_time = 30 - var/banglet = 0 - var/spawner_type = null // must be an object path - var/deliveryamt = 1 // amount of type to deliver - - - proc/prime() - return - - proc/clown_check(var/mob/living/user) - return - - attackby(obj/item/weapon/W as obj, mob/user as mob) - if (isscrewdriver(W)) - switch(src.det_time) - if ("1") - src.det_time = 30 - user.show_message("\blue You set the delivery grenade for 3 second detonation time.") - src.desc = "It is set to detonate in 3 seconds." - if ("30") - src.det_time = 100 - user.show_message("\blue You set the delivery grenade for 10 second detonation time.") - src.desc = "It is set to detonate in 10 seconds." - if ("100") - src.det_time = 1 - user.show_message("\blue You set the delivery grenade for instant detonation.") - src.desc = "It is set to detonate instantly." - src.add_fingerprint(user) - ..() - return - - - afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container - if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)&&(clown_check(user))) - user << "\red You prime the delivery grenade! [det_time/10] seconds!" - src.active = 1 - src.icon_state = "delivery1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn(src.det_time) - prime() - return - user.dir = get_dir(user, target) - user.drop_item() - var/t = (isturf(target) ? target : target.loc) - walk_towards(src, t, 3) - return - - - attack_paw(mob/user as mob) - return src.attack_hand(user) - - - attack_hand() - walk(src, null, null) - ..() - return - - prime() // Prime now just handles the two loops that query for people in lockers and people who can see it. - - if(spawner_type && deliveryamt) - // Make a quick flash - var/turf/T = get_turf(src) - playsound(T, 'phasein.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(T, null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) // flash dose faggots - - for(var/i=1, i<=deliveryamt, i++) - var/atom/movable/x = new spawner_type - x.loc = T - if(prob(50)) - for(var/j = 1, j <= rand(1, 3), j++) - step(x, pick(NORTH,SOUTH,EAST,WEST)) - - // Spawn some hostile syndicate critters - if(istype(x, /obj/effect/critter)) - var/obj/effect/critter/C = x - - C.atkcarbon = 1 - C.atksilicon = 1 - C.atkmech = 0 - C.atksynd = 0 - C.aggressive = 1 - - del(src) - return - - - attack_self(mob/user as mob) - if(!active) - if(clown_check(user)) - user << "\red You prime the delivery grenade! [det_time/10] seconds!" - src.active = 1 - src.icon_state = "delivery1" - add_fingerprint(user) - spawn( src.det_time ) - prime() - return - return - - - attack_hand() - walk(src, null, null) - ..() - return - - - clown_check(var/mob/living/user) - if ((CLUMSY in user.mutations) && prob(50)) - user << "\red Huh? How does this thing work?!" - src.active = 1 - src.icon_state = "delivery1" - playsound(src.loc, 'armbomb.ogg', 75, 1, -3) - spawn( 5 ) - prime() - return 0 - return 1 - -/obj/item/weapon/spawnergrenade/manhacks - name = "manhack delivery grenade" - spawner_type = /obj/effect/critter/manhack - deliveryamt = 5 - origin_tech = "materials=3;magnets=4;syndicate=4" - -/obj/item/weapon/spawnergrenade/carp - name = "carp delivery grenade" - spawner_type = /mob/living/simple_animal/carp - deliveryamt = 5 - origin_tech = "materials=3;magnets=4;syndicate=4" - -/obj/item/weapon/spawnergrenade/elitecarp - name = "elite carp delivery grenade" - spawner_type = /mob/living/simple_animal/carp/elite - deliveryamt = 2 - origin_tech = "materials=3;magnets=4;syndicate=4" - - - diff --git a/code/game/objects/items/weapons/hand_lablers.dm b/code/game/objects/items/weapons/hand_lablers.dm deleted file mode 100644 index 96dfa75d8f..0000000000 --- a/code/game/objects/items/weapons/hand_lablers.dm +++ /dev/null @@ -1,97 +0,0 @@ -/atom/var/list/labels - -//how to place label: -//1: set label in labeller -//2: pick up label object -//3: click on label with the hand the label is in -//4: place label on something -//how to remove label -//1: use labeller on item -//2: select label to remove (if there is >1 label anyway, if there is only one it will just remove that one) -/obj/item/weapon/hand_labeler - icon = 'items.dmi' - icon_state = "labeler" - item_state = "flight" - name = "Hand labeler" - -/obj/item/weapon/hand_labeler/afterattack(atom/A as obj|mob, mob/user as mob) - if(A==loc) // if placing the labeller into something (e.g. backpack) - return // don't remove any labels - if(!A.labels) - return - if(A.labels.len == 1) - var/t = A.labels[1] - A.name = copytext(A.name,1,lentext(A.name) - (lentext(t) + 2)) - A.labels -= t - return - if(A.labels.len > 1) - var/t = input(user, "Which label do you want to remove?") as null|anything in A.labels - var/i = 1 - for(, i <= labels.len, i++) //find the thing of the label to remove - if(A.labels[i] == t) - break - if(i != A.labels.len) //if we arent removing the last label - var/k = 0 - for(var/j = i+1, j <= A.labels.len, j++) - k += lentext(A.labels[j]) + 3 // 3 = " (" + ")" - var/labelend = lentext(A.name) - (k-1) - var/labelstart = labelend - (lentext(t)+3) - A.name = addtext(copytext(A.name,1,labelstart),copytext(A.name,labelend,0)) - A.labels -= t - return - if(i == A.labels.len) //if this is the last label we don't need to find the length of the stuff infront of it - var/labelstart = lentext(A.name) - (lentext(t)+3) - A.name = copytext(A.name,1,labelstart) - A.labels -= t - return - user << "\red Something broke. Please report this (that you were trying to remove a label and what the full name of the item was) to an admin or something." - -/obj/item/weapon/hand_labeler/attack_self(mob/user as mob) - var/str = input(usr,"Label text?","Set label","") - if(!str || !length(str)) - usr << "\red Invalid text." - return - if(length(str) > 64) - usr << "\red Text too long." - return - var/obj/item/weapon/label/A = new/obj/item/weapon/label - A.label = str - A.loc = user.loc - A.name += " - '[str]'" - -/obj/item/weapon/label - icon = 'items.dmi' - icon_state = "label" - name = "Label" - w_class = 2 - var/label = "" - var/backing = 1 //now with added being able to be put on table-ness! - -/obj/item/weapon/label/afterattack(atom/A, mob/user as mob) - if(!backing) - if(!label || !length(label)) - user << "\red This label doesn't have any text! How did this happen?!?" - return - if(length(A.name) + length(label) > 64) //this needs to be made bigger too. maybe number of labels instead of a fixed length - user << "\red Label too big." - return - if(ishuman(A)) - user << "\red You can't label humans." - return - if(!A.labels) - A.labels = new() - for(var/i = 1, i < A.labels.len, i++) - if(label == A.labels[i]) - user << "\red [A] already has that label!" - return - - for(var/mob/M in viewers()) - M << "\blue [user] puts a label on [A]." - A.name = "[A.name] ([label])" - A.labels += label - del(src) - -/obj/item/weapon/label/attack_self(mob/user as mob) //here so you can put them on tables and stuff more easily to stop them from being all over the floor until you want to use them - if(backing) - backing = 0 - user << "\blue You remove the backing from the label." //now it will stick to things \ No newline at end of file diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm index 2587292417..d538619298 100644 --- a/code/game/objects/items/weapons/hydroponics.dm +++ b/code/game/objects/items/weapons/hydroponics.dm @@ -9,84 +9,22 @@ Craftables (Cob pipes, potato batteries, pumpkinheads) */ -// Plant-B-Gone -/obj/item/weapon/plantbgone/New() - var/datum/reagents/R = new/datum/reagents(100) // 100 units of solution - reagents = R - R.my_atom = src - R.add_reagent("plantbgone", 100) - -/obj/item/weapon/plantbgone/attack(mob/living/carbon/human/M as mob, mob/user as mob) - return - -/obj/item/weapon/plantbgone/afterattack(atom/A as mob|obj, mob/user as mob) - - if (istype(A, /obj/item/weapon/storage/backpack )) - return - - else if (locate (/obj/structure/table, src.loc)) - return - - else if (src.reagents.total_volume < 1) - src.empty = 1 - user << "\blue Add more Plant-B-Gone mixture!" - return - - else - src.empty = 0 - - if (istype(A, /obj/machinery/hydroponics)) // We are targeting hydrotray - return - - else if (istype(A, /obj/effect/blob)) // blob damage in blob code - return - - else - var/obj/effect/decal/D = new/obj/effect/decal/(get_turf(src)) // Targeting elsewhere - D.name = "chemicals" - D.icon = 'chemical.dmi' - D.icon_state = "weedpuff" - D.create_reagents(5) - src.reagents.trans_to(D, 5) // 5 units of solution used at a time => 20 uses - playsound(src.loc, 'spray3.ogg', 50, 1, -6) - - spawn(0) - for(var/i=0, i<3, i++) // Max range = 3 tiles - step_towards(D,A) // Moves towards target as normally (not thru walls) - D.reagents.reaction(get_turf(D)) - for(var/atom/T in get_turf(D)) - D.reagents.reaction(T) - sleep(4) - del(D) - - - if((src.reagents.has_reagent("pacid")) || (src.reagents.has_reagent("lube"))) // Messages admins if someone sprays polyacid or space lube from a Plant-B-Gone bottle. - message_admins("[key_name_admin(user)] fired Polyacid/Space lube from a PlantBGone bottle.") // Polymorph - log_game("[key_name(user)] fired Polyacid/Space lube from a PlantBGone bottle.") - - - return - -/obj/item/weapon/plantbgone/examine() - set src in usr - usr << text("\icon[] [] units of Plant-B-Gone left!", src, src.reagents.total_volume) - ..() - return // Sunflower /obj/item/weapon/grown/sunflower/attack(mob/M as mob, mob/user as mob) M << " [user] smacks you with a sunflower!FLOWER POWER" user << " Your sunflower's FLOWER POWER strikes [M]" -// Nettle +// Nettle /obj/item/weapon/grown/nettle/pickup(mob/living/carbon/human/user as mob) if(!user.gloves) user << "\red The nettle burns your bare hand!" - if(hasorgans(user)) + if(istype(user, /mob/living/carbon/human)) var/organ = ((user.hand ? "l_":"r_") + "arm") - var/datum/organ/external/affecting = user:get_organ(organ) - affecting.take_damage(0,force) + var/datum/organ/external/affecting = user.get_organ(organ) + if(affecting.take_damage(0,force)) + user.UpdateDamageIcon() else user.take_organ_damage(0,force) @@ -103,13 +41,13 @@ Craftables (Cob pipes, potato batteries, pumpkinheads) // Deathnettle - /obj/item/weapon/grown/deathnettle/pickup(mob/living/carbon/human/user as mob) if(!user.gloves) - if(hasorgans(user)) + if(istype(user, /mob/living/carbon/human)) var/organ = ((user.hand ? "l_":"r_") + "arm") - var/datum/organ/external/affecting = user:get_organ(organ) - affecting.take_damage(0,force) + var/datum/organ/external/affecting = user.get_organ(organ) + if(affecting.take_damage(0,force)) + user.UpdateDamageIcon() else user.take_organ_damage(0,force) if(prob(50)) @@ -123,8 +61,6 @@ Craftables (Cob pipes, potato batteries, pumpkinheads) M.attack_log += text("\[[time_stamp()]\] Had the [src.name] used on them by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] on [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") log_attack(" [user.name] ([user.ckey]) used the [src.name] on [M.name] ([M.ckey])") M.eye_blurry += force/7 @@ -145,8 +81,8 @@ Craftables (Cob pipes, potato batteries, pumpkinheads) potency = newValue force = round((5+potency/2.5), 1) -//Crafting +//Crafting /obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife)) @@ -154,22 +90,3 @@ Craftables (Cob pipes, potato batteries, pumpkinheads) new /obj/item/clothing/mask/pipe/cobpipe (user.loc) del(src) return - -/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob) - ..() - if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/melee/energy)) - user.show_message("You carve a face into [src]!", 1) - new /obj/item/clothing/head/helmet/hardhat/pumpkinhead (user.loc) - del(src) - return - -/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob) - ..() - if(istype(W, /obj/item/weapon/cable_coil)) - if(W:amount >= 5) - W:amount -= 5 - if(!W:amount) del(W) - user << "You add some cable to the potato and slide it inside the battery encasing." - new /obj/item/weapon/cell/potato(user.loc) - del(src) - return \ No newline at end of file diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 934b7c33c5..de4773218f 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -1,8 +1,5 @@ /obj/item/weapon/implant name = "implant" - desc = "An implant. Not usually seen outside a body." - icon = 'items.dmi' - icon_state = "implant" var/implanted = null var/mob/imp_in = null color = "b" @@ -14,14 +11,15 @@ proc/activate() return - proc/implanted(source as mob) - return + // What does the implant do upon injection? + // return 0 if the implant fails (ex. Revhead and loyalty implant.) + // return 1 if the implant succeeds (ex. Nonrevhead and loyalty implant.) + proc/implanted(var/mob/source) + return 1 proc/get_data() return - proc/hear(message, source as mob) - return trigger(emote, source as mob) @@ -31,61 +29,19 @@ activate() return - attackby(obj/item/weapon/I as obj, mob/user as mob) - ..() - if (istype(I, /obj/item/weapon/implanter)) - if (I:imp) - return - else - src.loc = I - I:imp = src -// del(src) - I:update() - return - implanted(source as mob) - return + implanted(mob/source) + return 1 get_data() return "No information available" - hear(message, source as mob) - return - - - -/obj/item/weapon/implant/uplink - name = "uplink implant" - desc = "A micro-telecrystal implant which allows for instant transportation of equipment." - var/activation_emote = "chuckle" - var/obj/item/device/uplink/radio/uplink = null - - - New() - activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") - uplink = new /obj/item/device/uplink/radio/implanted(src) - ..() - return - - - implanted(mob/source as mob) - activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") - source.mind.store_memory("Uplink implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate.", 0, 0) - source << "The implanted uplink implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." - return - - - trigger(emote, mob/source as mob) - if(emote == activation_emote) - uplink.attack_self(source) - return - /obj/item/weapon/implant/tracking - name = "tracking implant" - desc = "An implant which relays information to the appropriate tracking computer." + name = "tracking" + desc = "Track with this." var/id = 1.0 @@ -107,15 +63,11 @@ Implant Specifics:
      "} return dat -//Nuke Agent Explosive -/obj/item/weapon/implant/dexplosive - name = "explosive implant" - desc = "A military grade micro bio-explosive. Highly dangerous." - var/activation_emote = "deathgasp" - var/coded = 0 - New() - verbs += /obj/item/weapon/implant/dexplosive/proc/set_emote +/obj/item/weapon/implant/explosive + name = "explosive" + desc = "And boom goes the weasel." + get_data() var/dat = {" @@ -132,7 +84,7 @@ Implant Specifics:
      "} trigger(emote, source as mob) - if(emote == activation_emote) + if(emote == "deathgasp") src.activate("death") return @@ -143,25 +95,11 @@ Implant Specifics:
      "} if(src.imp_in) src.imp_in.gib() - proc/set_emote() - set name = "Set Emote" - set category = "Object" - set src in usr - if(coded != 0) - usr << "You've already set up your implant!" - return - activation_emote = input("Choose activation emote:") in list("deathgasp","blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") - usr.mind.store_memory("Explosive implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate.", 0, 0) - usr << "The implanted explosive implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." - coded = 1 - verbs -= /obj/item/weapon/implant/dexplosive/proc/set_emote - return - /obj/item/weapon/implant/chem - name = "chemical implant" - desc = "A micro-injector that can be triggered remotely." + name = "chem" + desc = "Injects things." allow_reagents = 1 get_data() @@ -210,33 +148,33 @@ the implant may become unstable and either pre-maturely inject the subject or si /obj/item/weapon/implant/loyalty - name = "loyalty implant" - desc = "An implant which contains a small pod of nanobots which manipulate host mental functions to induce loyalty." + name = "loyalty" + desc = "Makes you loyal or such." get_data() var/dat = {" Implant Specifications:
      -Name: NanoTrasen Employee Management Implant
      +Name: Nanotrasen Employee Management Implant
      Life: Ten years.
      Important Notes: Personnel injected with this device tend to be much more loyal to the company.

      Implant Details:
      Function: Contains a small pod of nanobots that manipulate the host's mental functions.
      Special Features: Will prevent and cure most forms of brainwashing.
      -Integrity: Degradation can occur within nanobots, re-application may be necessary to ensure full cooperation."} +Integrity: Implant will last so long as the nanobots are inside the bloodstream."} return dat - implanted(M as mob) - if(!istype(M, /mob/living/carbon/human)) return + implanted(mob/M) + if(!istype(M, /mob/living/carbon/human)) return 0 var/mob/living/carbon/human/H = M if(H.mind in ticker.mode.head_revolutionaries) - H.visible_message("[H] seems to resist the implant!", "You feel the corporate tendrils of NanoTrasen try to invade your mind!") - return + H.visible_message("[H] seems to resist the implant!", "You feel the corporate tendrils of Nanotrasen try to invade your mind!") + return 0 else if(H.mind in ticker.mode:revolutionaries) ticker.mode:remove_revolutionary(H.mind) - H << "\blue You feel a surge of loyalty towards NanoTrasen." - return + H << "\blue You feel a surge of loyalty towards Nanotrasen." + return 1 /obj/item/weapon/implant/adrenalin @@ -270,235 +208,7 @@ the implant may become unstable and either pre-maturely inject the subject or si return - implanted(mob/source as mob) + implanted(mob/source) source.mind.store_memory("A implant can be activated by using the pale emote, say *pale to attempt to activate.", 0, 0) source << "The implanted freedom implant can be activated by using the pale emote, say *pale to attempt to activate." - return - - -//BS12 Explosive -/obj/item/weapon/implant/explosive - name = "explosive implant" - desc = "A military grade micro bio-explosive. Highly dangerous." - var/phrase = "supercalifragilisticexpialidocious" - - - get_data() - var/dat = {" -Implant Specifications:
      -Name: Robust Corp RX-78 Intimidation Class Implant
      -Life: Activates upon codephrase.
      -Important Notes: Explodes
      -
      -Implant Details:
      -Function: Contains a compact, electrically detonated explosive that detonates upon receiving a specially encoded signal or upon host death.
      -Special Features: Explodes
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - hear_talk(mob/M as mob, msg) - hear(msg) - return - - hear(var/msg) - var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "") - msg = sanitize_simple(msg, replacechars) - if(findtext(msg,phrase)) - if(istype(imp_in, /mob/)) - var/mob/T = imp_in - T.gib() - explosion(get_turf(imp_in), 1, 3, 4, 6, 3) - var/turf/t = get_turf(imp_in) - if(t) - t.hotspot_expose(3500,125) - del(src) - - implanted(mob/source as mob) - phrase = input("Choose activation phrase:") as text - var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "") - phrase = sanitize_simple(phrase, replacechars) - usr.mind.store_memory("Explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', say [src.phrase] to attempt to activate.", 0, 0) - usr << "The implanted explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', say [src.phrase] to attempt to activate." - -/obj/item/weapon/implant/death_alarm - name = "death alarm implant" - desc = "An alarm which monitors host vital signs and transmits a radio message upon death." - var/mobname = "Will Robinson" - - get_data() - var/dat = {" -Implant Specifications:
      -Name: NanoTrasen \"Profit Margin\" Class Employee Lifesign Sensor
      -Life: Activates upon death.
      -Important Notes: Alerts crew to crewmember death.
      -
      -Implant Details:
      -Function: Contains a compact radio signaler that triggers when the host's lifesigns cease.
      -Special Features: Alerts crew to crewmember death.
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - process() - var/mob/M = imp_in - - var/area/t = get_area(M) - - if(isnull(M)) // If the mob got gibbed - var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset(null) - a.autosay("states, \"[mobname] has died-zzzzt in-in-in...\"", "[mobname]'s Death Alarm") - del(a) - processing_objects.Remove(src) - else if(M.stat == 2) - var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset(null) - if(istype(t, /area/syndicate_station) || istype(t, /area/syndicate_mothership) || istype(t, /area/shuttle/syndicate_elite) ) - //give the syndies a bit of stealth - a.autosay("states, \"[mobname] has died in Space!\"", "[mobname]'s Death Alarm") - else - a.autosay("states, \"[mobname] has died in [t.name]!\"", "[mobname]'s Death Alarm") - del(a) - processing_objects.Remove(src) - - - implanted(mob/source as mob) - mobname = source.real_name - processing_objects.Add(src) - -/obj/item/weapon/implant/compressed - name = "compressed matter implant" - desc = "Based on compressed matter technology, can store a single item." - var/activation_emote = "sigh" - var/obj/item/scanned = null - - get_data() - var/dat = {" -Implant Specifications:
      -Name: NanoTrasen \"Profit Margin\" Class Employee Lifesign Sensor
      -Life: Activates upon death.
      -Important Notes: Alerts crew to crewmember death.
      -
      -Implant Details:
      -Function: Contains a compact radio signaler that triggers when the host's lifesigns cease.
      -Special Features: Alerts crew to crewmember death.
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - trigger(emote, mob/source as mob) - if (src.scanned == null) - return 0 - - if (emote == src.activation_emote) - source << "The air glows as \the [src.scanned.name] uncompresses." - var/turf/t = get_turf(source) - src.scanned.loc = t - del src - - implanted(mob/source as mob) - src.activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") - source.mind.store_memory("Freedom implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate.", 0, 0) - source << "The implanted freedom implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." - -/*// --------------------LASERS WORK FROM HERE, AUGMENTATIONS SHIZZLE---------------------- -/obj/item/weapon/implant/augmentation/thermalscanner - name = "Thermal Scanner Augmentation" - desc = "Makes you see humans through walls" - - get_data() - var/dat = {" -Implant Specifications:
      -Name: NanoTrasen Thermal Implant
      -Life: Ten years.
      -Important Notes: Personnel injected with this device tend to be able to see lifeforms through life using thermal.
      -
      -Implant Details:
      -Function: Contains a small pod of nanobots that manipulate the host's eye functions.
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - - implanted(M as mob) - if(istype(M, /mob/living/carbon/human)) - vision_flags = SEE_MOBS - invisa_view = 2 - usr << "You suddenly start seeing body temperatures of whoever is around you." - else - usr << "This implant is not compatible!" - return - -/obj/item/weapon/implant/augmentation/mesonscanner - name = "Meson Scanner Augmentation" - desc = "Makes you see floor and wall layouts through walls." - - get_data() - var/dat = {" -Implant Specifications:
      -Name: NanoTrasen Meson Implant
      -Life: Ten years.
      -Important Notes: Personnel injected with this device tend to be able to see floor and wall layouts through walls.
      -
      -Implant Details:
      -Function: Contains a small pod of nanobots that manipulate the host's eye functions.
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - - implanted(M as mob) - if(istype(M, /mob/living/carbon/human)) - vision_flags = SEE_TURFS - usr << "You suddenly start seeing body temperatures of whoever is around you." - else - usr << "This implant is not compatible!" - return - -/obj/item/weapon/implant/augmentation/medicalhud - name = "Medical HUD Augmentation" - desc = "Makes you see the medical condition of a person." - - get_data() - var/dat = {" -Implant Specifications:
      -Name: NanoTrasen Med HUD Implant
      -Life: Ten years.
      -Important Notes: Personnel injected with this device tend to be able to see the medical condition of a person.
      -
      -Implant Details:
      -Function: Contains a small pod of nanobots that manipulate the host's eye functions.
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - - implanted(M as mob) - if(istype(M, /mob/living/carbon/human)) - - src.hud = new/obj/item/clothing/glasses/hud/health(src) - usr << "You suddenly start seeing body temperatures of whoever is around you." - else - usr << "This implant is not compatible!" - return - -/obj/item/weapon/implant/augmentation/securityhud - name = "Security HUD Augmentation" - desc = "Makes you see the Security standings of a person." - - get_data() - var/dat = {" -Implant Specifications:
      -Name: NanoTrasen Sec HUD Implant
      -Life: Ten years.
      -Important Notes: Personnel injected with this device tend to be able to see the security standings of a person.
      -
      -Implant Details:
      -Function: Contains a small pod of nanobots that manipulate the host's eye functions.
      -Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} - return dat - - - implanted(M as mob) - if(istype(M, /mob/living/carbon/human)) - var/obj/item/clothing/glasses/hud/security/hud = null - - src.hud = new/obj/item/clothing/glasses/hud/security(src) - - usr << "You suddenly start seeing body temperatures of whoever is around you." - else - usr << "This implant is not compatible!" - return*/ \ No newline at end of file + return 1 diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 9593966346..4f6d81f5fb 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/item/weapon/implantcase name = "Glass Case" @@ -25,7 +25,7 @@ ..() if (istype(I, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != I) + if (user.get_active_hand() != I) return if((!in_range(src, usr) && src.loc != user)) return @@ -68,7 +68,7 @@ /obj/item/weapon/implantcase/tracking name = "Glass Case- 'Tracking'" desc = "A case containing a tracking implant." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "implantcase-b" @@ -80,9 +80,9 @@ /obj/item/weapon/implantcase/explosive - name = "Glass Case- '(BIO-HAZARD) BIO-detpack'" + name = "Glass Case- 'Explosive'" desc = "A case containing an explosive implant." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "implantcase-r" @@ -96,7 +96,7 @@ /obj/item/weapon/implantcase/chem name = "Glass Case- 'Chem'" desc = "A case containing a chemical implant." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "implantcase-b" /obj/item/weapon/implantcase/chem/New() @@ -108,7 +108,7 @@ /obj/item/weapon/implantcase/loyalty name = "Glass Case- 'Loyalty'" desc = "A case containing a loyalty implant." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "implantcase-r" @@ -116,14 +116,3 @@ src.imp = new /obj/item/weapon/implant/loyalty( src ) ..() return - -/obj/item/weapon/implantcase/death_alarm - name = "Glass Case- 'Death Alarm'" - desc = "A case containing a death alarm implant." - icon = 'items.dmi' - icon_state = "implantcase-b" - - New() - src.imp = new /obj/item/weapon/implant/death_alarm( src ) - ..() - return diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 4f49e2ca49..215d591532 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -1,9 +1,9 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/machinery/implantchair name = "Loyalty Implanter" desc = "Used to implant occupants with loyalty implants." - icon = 'implantchair.dmi' + icon = 'icons/obj/machines/implantchair.dmi' icon_state = "implantchair" density = 1 opacity = 0 @@ -116,7 +116,7 @@ if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src - M.pulling = null + M.stop_pulling() M.loc = src src.occupant = M src.add_fingerprint(usr) @@ -133,10 +133,11 @@ if(istype(imp, /obj/item/weapon/implant/loyalty)) for (var/mob/O in viewers(M, null)) O.show_message("\red [M] has been implanted by the [src.name].", 1) - imp.loc = M - imp.imp_in = M - imp.implanted = 1 - imp.implanted(M) + + if(imp.implanted(M)) + imp.loc = M + imp.imp_in = M + imp.implanted = 1 implant_list -= imp break return diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 4f80a89a60..aed447472c 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -1,6 +1,6 @@ /obj/item/weapon/implanter name = "implanter" - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "implanter0" item_state = "syringe_0" throw_speed = 1 @@ -12,46 +12,37 @@ /obj/item/weapon/implanter/update() - if (imp) - icon_state = "implanter1" + if (src.imp) + src.icon_state = "implanter1" else - icon_state = "implanter0" + src.icon_state = "implanter0" return /obj/item/weapon/implanter/attack(mob/M as mob, mob/user as mob) if (!istype(M, /mob/living/carbon)) return - if (user && imp) - if (M != user) - user.visible_message("\red \The [user] tries to implant \the [M] with \the [src]!","\red You try to implant \the [M] with \the [src]!") - else - user.visible_message("\red \The [user] tries to implant [user.get_visible_gender() == MALE ? "himself" : user.get_visible_gender() == FEMALE ? "herself" : "themselves"] with \the [src]!","\red You try to implant yourself with \the [src]!") - if(!do_mob(user, M,60)) - return - if(hasorgans(M)) - var/datum/organ/external/target = M:get_organ(check_zone(user.zone_sel.selecting)) - if(target.status & ORGAN_DESTROYED) - user << "What [target.display_name]?" - return - if(!target.implant) - target.implant = list() - target.implant += imp - imp.loc = target - if (M != user) - user.visible_message("\red \The [user] implants \the [M]'s [target.display_name] with \the [src]!","\red You implant \the [M]'s [target.display_name] with \the [src]!") - else - user.visible_message("\red \The [user] implants [user.get_visible_gender() == MALE ? "his" : user.get_visible_gender() == FEMALE ? "her" : "their"] own [target.display_name] with \the [src]!","\red You implant your [target.display_name] with \the [src]!") - M.attack_log += text("\[[time_stamp()]\] Implanted with [src] ([imp]) by [user] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Used the [src] ([imp]) to implant [M] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) implanted [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) implanted [M] ([M.ckey]) with [src].") - log_attack("[user.name] ([user.ckey]) implanted [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") - imp.imp_in = M - imp.implanted = 1 - imp.implanted(M) - imp = null - icon_state = "implanter0" + if (user && src.imp) + for (var/mob/O in viewers(M, null)) + O.show_message("\red [user] is attemping to implant [M].", 1) + + var/turf/T1 = get_turf(M) + if (T1 && ((M == user) || do_after(user, 50))) + if(user && M && (get_turf(M) == T1) && src && src.imp) + for (var/mob/O in viewers(M, null)) + O.show_message("\red [M] has been implanted by [user].", 1) + M.attack_log += text("\[[time_stamp()]\] Implanted with [src.name] ([src.imp.name]) by [user.name] ([user.ckey])") + user.attack_log += text("\[[time_stamp()]\] Used the [src.name] ([src.imp.name]) to implant [M.name] ([M.ckey])") + log_attack("[user.name] ([user.ckey]) implanted [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") + + user.show_message("\red You implanted the implant into [M].") + if(src.imp.implanted(M)) + src.imp.loc = M + src.imp.imp_in = M + src.imp.implanted = 1 + + src.imp = null + update() return @@ -60,7 +51,7 @@ name = "implanter-loyalty" /obj/item/weapon/implanter/loyalty/New() - imp = new /obj/item/weapon/implant/loyalty( src ) + src.imp = new /obj/item/weapon/implant/loyalty( src ) ..() update() return @@ -68,10 +59,10 @@ /obj/item/weapon/implanter/explosive - name = "implanter (E)" + name = "implanter-explosive" /obj/item/weapon/implanter/explosive/New() - imp = new /obj/item/weapon/implant/explosive( src ) + src.imp = new /obj/item/weapon/implant/explosive( src ) ..() update() return @@ -83,38 +74,4 @@ src.imp = new /obj/item/weapon/implant/adrenalin(src) ..() update() - return - -/obj/item/weapon/implanter/compressed - name = "implanter (C)" - icon_state = "cimplanter0" - -/obj/item/weapon/implanter/compressed/New() - imp = new /obj/item/weapon/implant/compressed( src ) - ..() - update() - return - -/obj/item/weapon/implanter/compressed/update() - if (imp) - var/obj/item/weapon/implant/compressed/c = imp - if(!c.scanned) - icon_state = "cimplanter0" - else - icon_state = "cimplanter1" - else - icon_state = "cimplanter2" - return - -/obj/item/weapon/implanter/compressed/attack(mob/M as mob, mob/user as mob) - var/obj/item/weapon/implant/compressed/c = imp - if (c.scanned == null) - user << "Please scan an object with the implanter first." - return - ..() - -/obj/item/weapon/implanter/compressed/afterattack(atom/A, mob/user as mob) - if(istype(A,/obj/item) && imp) - imp:scanned = A - A.loc.contents.Remove(A) - update() + return \ No newline at end of file diff --git a/code/game/objects/items/weapons/implants/implantfreedom.dm b/code/game/objects/items/weapons/implants/implantfreedom.dm index 7540061142..df1fd274ca 100644 --- a/code/game/objects/items/weapons/implants/implantfreedom.dm +++ b/code/game/objects/items/weapons/implants/implantfreedom.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/item/weapon/implant/freedom name = "freedom" @@ -9,7 +9,7 @@ New() - activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") + src.activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") src.uses = rand(1, 5) ..() return @@ -23,6 +23,18 @@ if (source.handcuffed) var/obj/item/weapon/W = source.handcuffed source.handcuffed = null + source.update_inv_handcuffed() + if (source.client) + source.client.screen -= W + if (W) + W.loc = source.loc + dropped(source) + if (W) + W.layer = initial(W.layer) + if (source.legcuffed) + var/obj/item/weapon/W = source.legcuffed + source.legcuffed = null + source.update_inv_legcuffed() if (source.client) source.client.screen -= W if (W) @@ -30,15 +42,13 @@ dropped(source) if (W) W.layer = initial(W.layer) - source.update_clothing() return - implanted(mob/source as mob) - activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") + implanted(mob/source) source.mind.store_memory("Freedom implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate.", 0, 0) source << "The implanted freedom implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." - return + return 1 get_data() diff --git a/code/game/objects/items/weapons/implants/implantnanoaug.dm b/code/game/objects/items/weapons/implants/implantnanoaug.dm index 2914a8da19..32a23e967b 100644 --- a/code/game/objects/items/weapons/implants/implantnanoaug.dm +++ b/code/game/objects/items/weapons/implants/implantnanoaug.dm @@ -9,7 +9,7 @@ var/dat = {" Implant Specifications:
      Name: Cybersun Industries Nano-Robotic Biological Augmentation Suite
      -Life: Infinite. WARNING: Biological chances are irreversable.
      +Life: Infinite. WARNING: Biological changes are irreversable.
      Important Notes: Illegal. Subjects exposed to nanorobotic agent are considered dangerous.

      Implant Details:
      @@ -19,27 +19,12 @@ return dat - implanted(mob/M as mob) - if(!istype(M, /mob/living/carbon/human)) return - var/mob/living/carbon/human/H = M - H.augmentations.Add(augmentation) // give them the mutation - H << "\blue [augment_text]" - if(istype(src, /obj/item/weapon/implant/nanoaug/eswordsynth)) - activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") - H.mind.store_memory("Freedom nanoaugmentation can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate.", 0, 0) - H << "The nanoaugmentation implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." + implanted(mob/M) + if(!istype(M, /mob/living/carbon/human)) return 0 + M.augmentations.Add(augmentation) // give them the mutation + M << "\blue [augment_text]" - if(istype(src, /obj/item/weapon/implant/nanoaug/radar)) - H << "Red blips on the map are Security." - H << "White blips are civlians." - H << "Monochrome Green blips are cyborgs and AIs." - H << "Light blue blips are heads of staff." - H << "Purple blips are unidentified organisms." - H << "Dead biologicals will not display on the radar." - - spawn() - H.start_radar() - return + return 1 /obj/item/weapon/implant/nanoaug/strength @@ -52,6 +37,20 @@ augmentation = RADAR augment_text = "You begin to sense the presence or lack of presence of others around you." + implanted(mob/M) + if(..()) + M << "Red blips on the map are Security." + M << "White blips are civlians." + M << "Monochrome Green blips are cyborgs and AIs." + M << "Light blue blips are heads of staff." + M << "Purple blips are unidentified organisms." + M << "Dead biologicals will not display on the radar." + spawn() + var/mob/living/carbon/human/H = M + H.start_radar() + return 1 + return 0 + /obj/item/weapon/implant/nanoaug/electrichands name = "Electric Hands" augmentation = ELECTRICHANDS @@ -62,6 +61,14 @@ augmentation = ESWORDSYNTH augment_text = "Your hands throb and pulsate. They feel sharper, and strangely hot." + implanted(mob/M) + if(..()) + activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink") + M.mind.store_memory("Freedom nanoaugmentation can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate.", 0, 0) + M << "The nanoaugmentation implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." + return 1 + return 0 + trigger(emote, source as mob) if(emote == activation_emote) src.activate(source) @@ -71,7 +78,7 @@ var/obj/item/weapon/melee/energy/blade/swordspawn = new /obj/item/weapon/melee/energy/blade if(!source.get_active_hand()) - source.put_in_hand(swordspawn) + source.put_in_hands(swordspawn) var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, source.loc) diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index 5b2b4da7f0..650a343013 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -1,9 +1,9 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/item/weapon/implantpad name = "implantpad" desc = "Used to modify implants." - icon = 'items.dmi' + icon = 'icons/obj/items.dmi' icon_state = "implantpad-0" item_state = "electronic" throw_speed = 1 @@ -26,15 +26,11 @@ attack_hand(mob/user as mob) if ((src.case && (user.l_hand == src || user.r_hand == src))) - if (user.hand) - user.l_hand = src.case - else - user.r_hand = src.case - src.case.loc = user - src.case.layer = 20 + user.put_in_active_hand(case) + src.case.add_fingerprint(user) src.case = null - user.update_clothing() + src.add_fingerprint(user) update() else diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 358c0fb40e..da0812e7e2 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -18,78 +18,35 @@ KNIFE // FORK -/obj/item/weapon/kitchen/utensil/fork/attack(mob/living/M as mob, mob/living/carbon/user as mob) - if(istype(M,/mob/living/carbon) || istype(M,/mob/living/simple_animal/livestock)) - if (bite) - if(M == user) - user.visible_message( \ - "\blue [user] eats a delicious forkful of [bite]!", \ - "\blue You eat a delicious forkful of [bite]!") - else - user.visible_message( \ - "\blue [user] feeds [M] a delicious forkful of [bite]!", \ - "\blue You feed [M] a delicious forkful of [bite]!") - spawn(0) - bite.reagents.reaction(M, INGEST) - bite.reagents.trans_to(M) - del(bite) - src.icon_state = "fork" - else if(user.zone_sel.selecting == "eyes") - if((CLUMSY in user.mutations) && prob(50)) - M = user - return eyestab(M, user) - else - user << "\red Your fork does not have any food on it." - else - user << "\red You can't seem to feed [M]." - -/obj/item/weapon/kitchen/utensil/fork/afterattack(obj/item/weapon/reagent_containers/food/snacks/snack as obj, mob/living/carbon/user as mob) - if(istype(snack)) - if(bite) - user << "\red You already have [bite] on your fork." - else - bite = new snack.type(src) - icon_state = "forkloaded" - user.visible_message( \ - "[user] takes a piece of [bite] with their fork!", \ - "\blue You take a piece of [bite] with your fork!" \ - ) - if(bite.reagents && snack.reagents) //transfer bit's worth of reagents to - bite.reagents.clear_reagents() - if(snack.reagents.total_volume) - snack.reagents.reaction(src, TOUCH) // react "food" with fork - spawn(0) - if(snack.reagents.total_volume > snack.bitesize) - snack.reagents.trans_to(bite, snack.bitesize) - else - snack.reagents.trans_to(bite, snack.reagents.total_volume) - snack.bitecount++ - if(!snack.reagents.total_volume) - // due to the trash code being hard-coded to place in hand, do magic trick - // free active hand - user.drop_item(src) - - // consumption fills active hand, drop it back down - snack.On_Consume() - var/obj/trash = user.get_active_hand() - if(trash) - user.drop_item(trash) - trash.loc = get_turf(snack.loc) // move trash to snack's turf - - // put fork back in hand - user.put_in_hand(src) - user << "\red You grab the last bite of [snack]." - del(snack) - else +/obj/item/weapon/kitchen/utensil/fork/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) + if(!istype(M)) return ..() + if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head") + return ..() + + if (src.icon_state == "forkloaded") //This is a poor way of handling it, but a proper rewrite of the fork to allow for a more varied foodening can happen when I'm in the mood. --NEO + if(M == user) + for(var/mob/O in viewers(M, null)) + O.show_message(text("\blue [] eats a delicious forkful of omelette!", user), 1) + M.reagents.add_reagent("nutriment", 1) + else + for(var/mob/O in viewers(M, null)) + O.show_message(text("\blue [] feeds [] a delicious forkful of omelette!", user, M), 1) + M.reagents.add_reagent("nutriment", 1) + src.icon_state = "fork" + return + else + if((CLUMSY in user.mutations) && prob(50)) + M = user + return eyestab(M,user) // ROLLING PIN -/* //Honestly this doesn't even work and is very silly. -- Erthilo -/obj/item/weapon/kitchen/rollingpin/attack(mob/M as mob, mob/living/user as mob) + +/obj/item/weapon/kitchen/rollingpin/attack(mob/living/M as mob, mob/living/user as mob) if ((CLUMSY in user.mutations) && prob(50)) user << "\red The [src] slips out of your hand and hits your head." user.take_organ_damage(10) @@ -98,30 +55,30 @@ KNIFE M.attack_log += text("\[[time_stamp()]\] Has been attacked with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to attack [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") log_attack("[user.name] ([user.ckey]) used the [src.name] to attack [M.name] ([M.ckey])") - if (M.stat < 2 && M.health < 50 && prob(90)) - var/mob/H = M - // ******* Check - if ((istype(H, /mob/living/carbon/human) && istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80))) - M << "\red The helmet protects you from being hit hard in the head!" - return - var/time = rand(2, 6) - if (prob(75)) - M.Paralyse(time) - else - M.Stun(time) - if(M.stat != 2) M.stat = 1 - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been knocked unconscious!", M), 1, "\red You hear someone fall.", 2) - else - M << text("\red [] tried to knock you unconcious!",user) - M.eye_blurry += 3 + var/t = user:zone_sel.selecting + if (t == "head") + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if (H.stat < 2 && H.health < 50 && prob(90)) + // ******* Check + if (istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80)) + H << "\red The helmet protects you from being hit hard in the head!" + return + var/time = rand(2, 6) + if (prob(75)) + H.Paralyse(time) + else + H.Stun(time) + if(H.stat != 2) H.stat = 1 + for(var/mob/O in viewers(H, null)) + O.show_message(text("\red [] has been knocked unconscious!", H), 1, "\red You hear someone fall.", 2) + else + H << text("\red [] tried to knock you unconscious!",user) + H.eye_blurry += 3 return -*/ @@ -158,16 +115,16 @@ KNIFE M.Weaken(1) user.take_organ_damage(2) if(prob(50)) - playsound(M, 'trayhit1.ogg', 50, 1) + playsound(M, 'sound/items/trayhit1.ogg', 50, 1) return else - playsound(M, 'trayhit2.ogg', 50, 1) //sound playin' + playsound(M, 'sound/items/trayhit2.ogg', 50, 1) //sound playin' return //it always returns, but I feel like adding an extra return just for safety's sakes. EDIT; Oh well I won't :3 - var/mob/living/carbon/human/H = M // Let's have this ready for later. + var/mob/living/carbon/human/H = M ///////////////////////////////////// /Let's have this ready for later. - if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head") //hitting anything else other than the eyes + if(!(user.zone_sel.selecting == ("eyes" || "head"))) //////////////hitting anything else other than the eyes if(prob(33)) src.add_blood(H) var/turf/location = H.loc @@ -177,8 +134,6 @@ KNIFE M.attack_log += text("\[[time_stamp()]\] Has been attacked with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to attack [M.name] ([M.ckey])") - log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") - message_admins("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") log_attack("[user.name] ([user.ckey]) used the [src.name] to attack [M.name] ([M.ckey])") @@ -188,12 +143,12 @@ KNIFE else M.take_organ_damage(5) if(prob(50)) - playsound(M, 'trayhit1.ogg', 50, 1) + playsound(M, 'sound/items/trayhit1.ogg', 50, 1) for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] slams [] with the tray!", user, M), 1) return else - playsound(M, 'trayhit2.ogg', 50, 1) //we applied the damage, we played the sound, we showed the appropriate messages. Time to return and stop the proc + playsound(M, 'sound/items/trayhit2.ogg', 50, 1) //we applied the damage, we played the sound, we showed the appropriate messages. Time to return and stop the proc for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] slams [] with the tray!", user, M), 1) return @@ -216,11 +171,11 @@ KNIFE location.add_blood(H) if(prob(50)) - playsound(M, 'trayhit1.ogg', 50, 1) + playsound(M, 'sound/items/trayhit1.ogg', 50, 1) for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] slams [] with the tray!", user, M), 1) else - playsound(M, 'trayhit2.ogg', 50, 1) //sound playin' + playsound(M, 'sound/items/trayhit2.ogg', 50, 1) //sound playin' for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] slams [] with the tray!", user, M), 1) if(prob(10)) @@ -240,11 +195,11 @@ KNIFE location.add_blood(H) if(prob(50)) - playsound(M, 'trayhit1.ogg', 50, 1) + playsound(M, 'sound/items/trayhit1.ogg', 50, 1) for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] slams [] in the face with the tray!", user, M), 1) else - playsound(M, 'trayhit2.ogg', 50, 1) //sound playin' again + playsound(M, 'sound/items/trayhit2.ogg', 50, 1) //sound playin' again for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] slams [] in the face with the tray!", user, M), 1) if(prob(30)) @@ -336,7 +291,7 @@ KNIFE if (W.icon_state == "forkloaded") user << "\red You already have omelette on your fork." return - W.icon = 'kitchen.dmi' + W.icon = 'icons/obj/kitchen.dmi' W.icon_state = "forkloaded" viewers(3,user) << "[user] takes a piece of omelette with his fork!" reagents.remove_reagent("nutriment", 1) diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm index fad2ad4a7a..e5e5d4059a 100644 --- a/code/game/objects/items/weapons/manuals.dm +++ b/code/game/objects/items/weapons/manuals.dm @@ -1,26 +1,24 @@ /*********************MANUALS (BOOKS)***********************/ +//Oh god what the fuck I am not good at computer /obj/item/weapon/book/manual - icon = 'library.dmi' + icon = 'icons/obj/library.dmi' due_date = 0 // Game time in 1/10th seconds unique = 1 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified - New() - if(!title) - title = name // make this simple for manuals /obj/item/weapon/book/manual/engineering_construction name = "Station Repairs and Construction" icon_state ="bookEngineering" author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned - + title = "Station Repairs and Construction" dat = {" - + @@ -31,7 +29,7 @@ name = "Particle Accelerator User's Guide" icon_state ="bookParticleAccelerator" author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned - + title = "Particle Accelerator User's Guide" //big pile of shit below. dat = {" @@ -74,7 +72,7 @@ name = "Hacking" icon_state ="bookHacking" author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned - + title = "Hacking" //big pile of shit below. dat = {" @@ -83,7 +81,7 @@ - + @@ -94,7 +92,7 @@ name = "Singularity Safety in Special Circumstances" icon_state ="bookEngineeringSingularitySafety" author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned - + title = "Singularity Safety in Special Circumstances" //big pile of shit below. dat = {" @@ -142,7 +140,7 @@ name = "The Human Harvest - From seed to market" icon_state ="bookHydroponicsPodPeople" author = "Farmer John" - + title = "The Human Harvest - From seed to market" dat = {" + + + +

      How to Clone People

      + So there’s 50 dead people lying on the floor, chairs are spinning like no tomorrow and you haven’t the foggiest idea of what to do? Not to worry! This guide is intended to teach you how to clone people and how to do it right, in a simple step-by-step process! If at any point of the guide you have a mental meltdown, genetics probably isn’t for you and you should get a job-change as soon as possible before you’re sued for malpractice. + +
        +
      1. Acquire body
      2. +
      3. Strip body
      4. +
      5. Put body in cloning machine
      6. +
      7. Scan body
      8. +
      9. Clone body
      10. +
      11. Get clean Structurel Enzymes for the body
      12. +
      13. Put body in morgue
      14. +
      15. Await cloned body
      16. +
      17. Use the clean SW injector
      18. +
      19. Give person clothes back
      20. +
      21. Send person on their way
      22. +
      + +

      Step 1: Acquire body

      + This is pretty much vital for the process because without a body, you cannot clone it. Usually, bodies will be brought to you, so you do not need to worry so much about this step. If you already have a body, great! Move on to the next step. + +

      Step 2: Strip body

      + The cloning machine does not like abiotic items. What this means is you can’t clone anyone if they’re wearing clothes, so take all of it off. If it’s just one person, it’s courteous to put their possessions in the closet. If you have about seven people awaiting cloning, just leave the piles where they are, but don’t mix them around and for God’s sake don’t let the Clown in to steal them. + +

      Step 3: Put body in cloning machine

      + Grab the body and then put it inside the DNA modifier. If you cannot do this, then you messed up at Step 2. Go back and check you took EVERYTHING off - a commonly missed item is their headset. + +

      Step 4: Scan body

      + Go onto the computer and scan the body by pressing ‘Scan - ’. If you’re successful, they will be added to the records (note that this can be done at any time, even with living people, so that they can be cloned without a body in the event that they are lying dead on port solars and didn‘t turn on their suit sensors)! If not, and it says “Error: Mental interface failure.”, then they have left their bodily confines and are one with the spirits. If this happens, just shout at them to get back in their body, click ‘Refresh‘ and try scanning them again. If there’s no success, threaten them with gibbing. Still no success? Skip over to Step 7 and don‘t continue after it, as you have an unresponsive body and it cannot be cloned. If you got “Error: Unable to locate valid genetic data.“, you are trying to clone a monkey - start over. + +

      Step 5: Clone body

      + Now that the body has a record, click ’View Records’, click the subject’s name, and then click ‘Clone’ to start the cloning process. Congratulations! You’re halfway there. Remember not to ‘Eject’ the cloning pod as this will kill the developing clone and you’ll have to start the process again. + +

      Step 6: Get clean SEs for body

      + Cloning is a finicky and unreliable process. Whilst it will most certainly bring someone back from the dead, they can have any number of nasty disabilities given to them during the cloning process! For this reason, you need to prepare a clean, defect-free Structural Enzyme (SE) injection for when they’re done. If you’re a competent Geneticist, you will already have one ready on your working computer. If, for any reason, you do not, then eject the body from the DNA modifier (NOT THE CLONING POD) and take it next door to the Genetics research room. Put the body in one of those DNA modifiers and then go onto the console. Go into View/Edit/Transfer Buffer, find an open slot and click “SE“ to save it. Then click ‘Injector’ to get the SEs in syringe form. Put this in your pocket or something for when the body is done. + +

      Step 7: Put body in morgue

      + Now that the cloning process has been initiated and you have some clean Structural Enzymes, you no longer need the body! Drag it to the morgue and tell the Chef over the radio that they have some fresh meat waiting for them in there. To put a body in a morgue bed, simply open the tray, grab the body, put it on the open tray, then close the tray again. Use one of the nearby pens to label the bed “CHEF MEAT” in order to avoid confusion. + +

      Step 8: Await cloned body

      + Now go back to the lab and wait for your patient to be cloned. It won’t be long now, I promise. + +

      Step 9: Use the clean SE injector on person

      + Has your body been cloned yet? Great! As soon as the guy pops out, grab your injector and jab it in them. Once you’ve injected them, they now have clean Structural Enzymes and their defects, if any, will disappear in a short while. + +

      Step 10: Give person clothes back

      + Obviously the person will be naked after they have been cloned. Provided you weren’t an irresponsible little shit, you should have protected their possessions from thieves and should be able to give them back to the patient. No matter how cruel you are, it’s simply against protocol to force your patients to walk outside naked. + +

      Step 11: Send person on their way

      + Give the patient one last check-over - make sure they don’t still have any defects and that they have all their possessions. Ask them how they died, if they know, so that you can report any foul play over the radio. Once you’re done, your patient is ready to go back to work! Chances are they do not have Medbay access, so you should let them out of Genetics and the Medbay main entrance. + +

      If you’ve gotten this far, congratulations! You have mastered the art of cloning. Now, the real problem is how to resurrect yourself after that traitor had his way with you for cloning his target. + + -

      Cloning

      -

      You can clone people from scans made while they are alive and well (which is preferred). Feel free to call people to get their backups made - especially for Heads of Staff. -

      -

      Scan

      -

      The first thing that a clone needs is a record in the cloning console. Scanning requires a dead or live human body (monkeys won't work), whereas making the actual clone requires the person to be dead. -

      -
      1. Make sure the person is not wearing anything. -
        • If the person is alive, have them strip. -
        • If the person is dead, click+drag their body onto yours to bring up their clothing window, then click on the links identifying each piece of clothing to remove it. -
        -
      2. Grab the person. -
      3. Click on the DNA scanner to place them inside. -
      4. Click on the cloning console to bring up its menu. -
      5. Click Scan. -
        • Note: If you see Mental Interface Error, wait a few seconds and try again. If it still comes up, the body is not viable for cloning (they logged off) and should be taken to the morgue. -
        -
      6. Click View Records to make sure their record is listed in the cloning database. -
      -

      Making the Clone

      -

      Remember, a clone can only be made when the person you're making a clone for is dead. If they aren't dead, you'll see a "Unable to initiate cloning cycle" error in the Cloning System Control. -

      -
      1. Head to the cloning console beside the cloning pod, and click on it to open its menu. -
      2. Click View Records, select the person you wish to clone, then click Clone. -
        • Note: After clicking "Clone" the dead person will get a pop-up window asking if they want to come back to life. If they choose "No", the console will say "Unable to initiate cloning cycle". If they choose "Yes", the console will say "Cloning cycle activated", and their body will be remade in a few minutes. -
        • Note #2: When a new clone is made, that person's record is deleted from the database, so they must be scanned again if they are to be cloned a second time. -
        -
      -

      Finishing a New Clone

      -
      1. Grab the new clone and take it to Cryo, the room with large cryo cells. -
      2. Click on one of the cells to place the clone inside and set the Cryo status to On. -
      3. Take a nearby beaker filled with Cryoxadone and then click on the same cell you placed the clone in to load the beaker into the cell. -
        • Note: At this point, the clone will begin to heal slowly, shown by the increasing health indication in the cryo cell's menu. If you wish to speed up the effect, continue with the next steps. -
        -
      4. Use the nearby on both O2 canisters to secure them (if they aren't already). -
      5. Put the wrench down, then click on both O2 canisters and Open them. -
      6. Set the freezer's Target gas temperature to its lowest amount by clicking on the far-left "-" until the number in the center no longer decreases. -
      7. Set the freezer to On. -
      8. Click on the cyro cell to check on your clone. When its health reaches 100, it is considered finished and can then be ejected (right-click > Eject Occupant). -
        • Note: Though waiting for the health to reach 100 is optimum, in emergencies when the cryo cells are needed the clone can be ejected at ~50 health and finished in a sleeper. -
        -
      9. Don't forget! when you're done with the cryo room, turn everything to Off or Closed so the room doesn't get freezing cold! Also, if you still have their old body, drag it to the morgue to prevent Clone Memory Disorder (which is purely for role-play purposes). -
      -

      Clone Memory Disorder

      -

      There are a few basic rules that apply to most patients, all symptoms of Clone Memory Disorder.
      -It is caused by the unexpected circumstances after awakening in cryo (if cloned from a backup), or the traumatizing experience of death which is much worse, (if cloned from the corpse). -

      These are the usual symptoms. -

      -
      1. They will be disoriented after being cloned. -
      2. They will have forgotten about their death/everything that happened after the backup. -
      3. They will sometimes feel strange urges or fears when confronted with anything that can be directly related to their death. (Only if cloned from the corpse). See also Symptoms of Trauma for how people in reality would possibly react (read this if you are unsure how to RP Clone Memory Disorder for when you get cloned from a corpse). -
      -

      This applies for cloned criminals as well! -

      Take an example clone. He died under suspicious circumstances, but we always take good care of our patients, and we do not want them to commit suicide or fall into manic depression. As such, we will have to prevent any Post-Mortem Traumatic Relapses (Refer to it as 'complications' to less scientific personnel). -

      -
      • The first thing to do is ask the patient how they feel. -
      • Symptom 1 of CMD will most of the time be apparent in the subject. -
      • They will most likely ask questions about why they are there. -
      • Give an excuse: Tell them that they have hurt their head, were wounded, or otherwise put into cryo. (You might also want to tell them that they fainted after their back-up, which is common for patients that were nervous to get into the machine.) -
      • Inform all involved personnel of the excuse. -
      "} @@ -251,7 +253,7 @@ It is caused by the unexpected circumstances after awakening in cryo (if cloned name = "APLU \"Ripley\" Construction and Operation Manual" icon_state ="book" author = "Weyland-Yutani Corp" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned - + title = "APLU \"Ripley\" Construction and Operation Manual" //big pile of shit below. dat = {" @@ -300,10 +302,10 @@ It is caused by the unexpected circumstances after awakening in cryo (if cloned
    • Secure the mainboard with a screwdriver.
    • Install the peripherals control module (Not included. Use supplied datadisk to create one).
    • Secure the peripherals control module with a screwdriver
    • -
    • Install the internal armor plating (Not included due to NanoTrasen regulations. Can be made using 5 metal sheets.)
    • +
    • Install the internal armor plating (Not included due to Nanotrasen regulations. Can be made using 5 metal sheets.)
    • Secure the internal armor plating with a wrench
    • Weld the internal armor plating to the chassis
    • -
    • Install the external reinforced armor plating (Not included due to NanoTrasen regulations. Can be made using 5 reinforced metal sheets.)
    • +
    • Install the external reinforced armor plating (Not included due to Nanotrasen regulations. Can be made using 5 reinforced metal sheets.)
    • Secure the external reinforced armor plating with a wrench
    • Weld the external reinforced armor plating to the chassis
    • @@ -313,7 +315,7 @@ It is caused by the unexpected circumstances after awakening in cryo (if cloned
    • Internal armor is plasteel for additional strength.
    • External armor must be installed in 2 parts, totaling 10 sheets.
    • Completed mech is more resiliant against fire, and is a bit more durable overall
    • -
    • NanoTrasen is determined to the safety of its investments employees.
    • +
    • Nanotrasen is determined to the safety of its investments employees.
    • @@ -327,7 +329,7 @@ It is caused by the unexpected circumstances after awakening in cryo (if cloned name = "Research and Development 101" icon_state = "rdbook" author = "Dr. L. Ight" - + title = "Research and Development 101" dat = {" + + - dat = {" - +

      Food for Dummies

      + Here is a guide on basic food recipes and also how to not poison your customers accidentally. - - - +

      Burger:

      + Put 1 meat and 1 flour into the microwave and turn it on. Then wait. - +

      Bread:

      + Put 3 flour into the microwave and then wait. +

      Waffles:

      + Add 2 flour and 2 egg to the microwave and then wait. + +

      Popcorn:

      + Add 1 corn to the microwave and wait. + +

      Meat Steak:

      + Put 1 meat, 1 unit of salt and 1 unit of pepper into the microwave and wait. + +

      Meat Pie:

      + Put 1 meat and 2 flour into the microwave and wait. + +

      Boiled Spagetti:

      + Put 1 spagetti and 5 units of water into the microwave and wait. + +

      Donuts:

      + Add 1 egg and 1 flour to the microwave and wait. + +

      Fries:

      + Add one potato to the processor and wait. + + + + "} /obj/item/weapon/book/manual/barman_recipes name = "Barman Recipes" icon_state = "barbook" author = "Sir John Rose" - + title = "Barman Recipes" dat = {"