diff --git a/baystation12.dme b/baystation12.dme index 1e8466f5f3..bd80a424a3 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -6,232 +6,15 @@ // BEGIN_FILE_DIR #define FILE_DIR . #define FILE_DIR "code" -#define FILE_DIR "code/__HELPERS" -#define FILE_DIR "code/ATMOSPHERICS" -#define FILE_DIR "code/ATMOSPHERICS/components" -#define FILE_DIR "code/ATMOSPHERICS/components/binary_devices" -#define FILE_DIR "code/ATMOSPHERICS/components/trinary_devices" -#define FILE_DIR "code/ATMOSPHERICS/components/unary" -#define FILE_DIR "code/controllers" -#define FILE_DIR "code/datums" -#define FILE_DIR "code/datums/diseases" -#define FILE_DIR "code/datums/diseases/advance" -#define FILE_DIR "code/datums/diseases/advance/symptoms" -#define FILE_DIR "code/datums/helper_datums" -#define FILE_DIR "code/datums/organs" -#define FILE_DIR "code/datums/spells" -#define FILE_DIR "code/defines" -#define FILE_DIR "code/defines/obj" -#define FILE_DIR "code/defines/procs" -#define FILE_DIR "code/FEA" -#define FILE_DIR "code/game" -#define FILE_DIR "code/game/area" -#define FILE_DIR "code/game/events" -#define FILE_DIR "code/game/events/EventProcs" -#define FILE_DIR "code/game/events/Events" -#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" -#define FILE_DIR "code/game/gamemodes/meteor" -#define FILE_DIR "code/game/gamemodes/nuclear" -#define FILE_DIR "code/game/gamemodes/revolution" -#define FILE_DIR "code/game/gamemodes/sandbox" -#define FILE_DIR "code/game/gamemodes/traitor" -#define FILE_DIR "code/game/gamemodes/wizard" -#define FILE_DIR "code/game/jobs" -#define FILE_DIR "code/game/jobs/job" -#define FILE_DIR "code/game/machinery" -#define FILE_DIR "code/game/machinery/atmoalter" -#define FILE_DIR "code/game/machinery/bots" -#define FILE_DIR "code/game/machinery/camera" -#define FILE_DIR "code/game/machinery/computer" -#define FILE_DIR "code/game/machinery/doors" -#define FILE_DIR "code/game/machinery/embedded_controller" -#define FILE_DIR "code/game/machinery/kitchen" -#define FILE_DIR "code/game/machinery/pipe" -#define FILE_DIR "code/game/machinery/telecomms" -#define FILE_DIR "code/game/magic" -#define FILE_DIR "code/game/mecha" -#define FILE_DIR "code/game/mecha/combat" -#define FILE_DIR "code/game/mecha/equipment" -#define FILE_DIR "code/game/mecha/equipment/tools" -#define FILE_DIR "code/game/mecha/equipment/weapons" -#define FILE_DIR "code/game/mecha/medical" -#define FILE_DIR "code/game/mecha/working" -#define FILE_DIR "code/game/objects" -#define FILE_DIR "code/game/objects/closets" -#define FILE_DIR "code/game/objects/closets/secure" -#define FILE_DIR "code/game/objects/effects" -#define FILE_DIR "code/game/objects/effects/decals" -#define FILE_DIR "code/game/objects/effects/decals/Cleanable" -#define FILE_DIR "code/game/objects/effects/spawners" -#define FILE_DIR "code/game/objects/items" -#define FILE_DIR "code/game/objects/items/devices" -#define FILE_DIR "code/game/objects/items/devices/PDA" -#define FILE_DIR "code/game/objects/items/devices/radio" -#define FILE_DIR "code/game/objects/items/robot" -#define FILE_DIR "code/game/objects/items/stacks" -#define FILE_DIR "code/game/objects/items/stacks/sheets" -#define FILE_DIR "code/game/objects/items/stacks/tiles" -#define FILE_DIR "code/game/objects/items/weapons" -#define FILE_DIR "code/game/objects/items/weapons/grenades" -#define FILE_DIR "code/game/objects/items/weapons/implants" -#define FILE_DIR "code/game/objects/items/weapons/melee" -#define FILE_DIR "code/game/objects/items/weapons/storage" -#define FILE_DIR "code/game/objects/items/weapons/tanks" -#define FILE_DIR "code/game/objects/storage" -#define FILE_DIR "code/game/objects/structures" -#define FILE_DIR "code/game/objects/structures/crates_lockers" -#define FILE_DIR "code/game/objects/structures/crates_lockers/closets" -#define FILE_DIR "code/game/objects/structures/crates_lockers/closets/secure" -#define FILE_DIR "code/game/objects/structures/stool_bed_chair_nest" -#define FILE_DIR "code/game/structure" -#define FILE_DIR "code/game/turfs" -#define FILE_DIR "code/game/turfs/simulated" -#define FILE_DIR "code/game/turfs/space" -#define FILE_DIR "code/game/turfs/unsimulated" -#define FILE_DIR "code/game/vehicles" -#define FILE_DIR "code/game/verbs" -#define FILE_DIR "code/js" -#define FILE_DIR "code/modules" -#define FILE_DIR "code/modules/admin" -#define FILE_DIR "code/modules/admin/DB ban" -#define FILE_DIR "code/modules/admin/permissionverbs" -#define FILE_DIR "code/modules/admin/verbs" -#define FILE_DIR "code/modules/assembly" -#define FILE_DIR "code/modules/awaymissions" -#define FILE_DIR "code/modules/awaymissions/maploader" -#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/customitems" -#define FILE_DIR "code/modules/destilery" -#define FILE_DIR "code/modules/DetectiveWork" -#define FILE_DIR "code/modules/events" -#define FILE_DIR "code/modules/flufftext" -#define FILE_DIR "code/modules/food" -#define FILE_DIR "code/modules/genetics" -#define FILE_DIR "code/modules/icon generation" -#define FILE_DIR "code/modules/library" -#define FILE_DIR "code/modules/liquid" -#define FILE_DIR "code/modules/maps" -#define FILE_DIR "code/modules/mining" -#define FILE_DIR "code/modules/mob" -#define FILE_DIR "code/modules/mob/dead" -#define FILE_DIR "code/modules/mob/dead/observer" -#define FILE_DIR "code/modules/mob/living" -#define FILE_DIR "code/modules/mob/living/blob" -#define FILE_DIR "code/modules/mob/living/carbon" -#define FILE_DIR "code/modules/mob/living/carbon/alien" -#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid" -#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid/caste" -#define FILE_DIR "code/modules/mob/living/carbon/alien/larva" -#define FILE_DIR "code/modules/mob/living/carbon/alien/special" -#define FILE_DIR "code/modules/mob/living/carbon/brain" -#define FILE_DIR "code/modules/mob/living/carbon/human" -#define FILE_DIR "code/modules/mob/living/carbon/metroid" -#define FILE_DIR "code/modules/mob/living/carbon/monkey" -#define FILE_DIR "code/modules/mob/living/silicon" -#define FILE_DIR "code/modules/mob/living/silicon/ai" -#define FILE_DIR "code/modules/mob/living/silicon/ai/freelook" -#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/living/simple_animal/friendly" -#define FILE_DIR "code/modules/mob/living/simple_animal/hostile" -#define FILE_DIR "code/modules/mob/living/simple_animal/hostile/retaliate" -#define FILE_DIR "code/modules/mob/new_player" -#define FILE_DIR "code/modules/paperwork" -#define FILE_DIR "code/modules/power" -#define FILE_DIR "code/modules/power/antimatter" -#define FILE_DIR "code/modules/power/singularity" -#define FILE_DIR "code/modules/power/singularity/particle_accelerator" -#define FILE_DIR "code/modules/projectiles" -#define FILE_DIR "code/modules/projectiles/ammunition" -#define FILE_DIR "code/modules/projectiles/guns" -#define FILE_DIR "code/modules/projectiles/guns/energy" -#define FILE_DIR "code/modules/projectiles/guns/projectile" -#define FILE_DIR "code/modules/projectiles/projectile" -#define FILE_DIR "code/modules/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" -#define FILE_DIR "code/modules/scripting" -#define FILE_DIR "code/modules/scripting/AST" -#define FILE_DIR "code/modules/scripting/AST/Operators" -#define FILE_DIR "code/modules/scripting/Implementations" -#define FILE_DIR "code/modules/scripting/Interpreter" -#define FILE_DIR "code/modules/scripting/Parser" -#define FILE_DIR "code/modules/scripting/Scanner" -#define FILE_DIR "code/modules/security levels" -#define FILE_DIR "code/modules/surgery" #define FILE_DIR "code/TriDimension" -#define FILE_DIR "code/unused" -#define FILE_DIR "code/unused/beast" -#define FILE_DIR "code/unused/computer2" -#define FILE_DIR "code/unused/disease2" -#define FILE_DIR "code/unused/gamemodes" -#define FILE_DIR "code/unused/hivebot" -#define FILE_DIR "code/unused/mining" -#define FILE_DIR "code/unused/optics" -#define FILE_DIR "code/unused/pda2" -#define FILE_DIR "code/unused/powerarmor" -#define FILE_DIR "code/unused/spacecraft" #define FILE_DIR "code/WorkInProgress" -#define FILE_DIR "code/WorkInProgress/AI_Visibility" -#define FILE_DIR "code/WorkInProgress/animusstation" -#define FILE_DIR "code/WorkInProgress/Apples" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn" -#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Economy" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Jungle" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust" +#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/ShieldGen" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter" -#define FILE_DIR "code/WorkInProgress/carn" -#define FILE_DIR "code/WorkInProgress/Chinsky" -#define FILE_DIR "code/WorkInProgress/Cib" -#define FILE_DIR "code/WorkInProgress/Cib/amorph" -#define FILE_DIR "code/WorkInProgress/Mini" -#define FILE_DIR "code/WorkInProgress/Mloc" -#define FILE_DIR "code/WorkInProgress/organs" -#define FILE_DIR "code/WorkInProgress/Ported" -#define FILE_DIR "code/WorkInProgress/Ported/Abi79" -#define FILE_DIR "code/WorkInProgress/Ported/Bureaucracy" -#define FILE_DIR "code/WorkInProgress/Ported/Spawners" -#define FILE_DIR "code/WorkInProgress/Sigyn" -#define FILE_DIR "code/WorkInProgress/Sigyn/Department Sec" -#define FILE_DIR "code/WorkInProgress/Sigyn/Softcurity" -#define FILE_DIR "code/WorkInProgress/SkyMarshal" #define FILE_DIR "code/WorkInProgress/Susan" -#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 "code/WorkInProgress/Uristqwerty" #define FILE_DIR "html" #define FILE_DIR "icons" #define FILE_DIR "icons/48x48" @@ -253,13 +36,11 @@ #define FILE_DIR "icons/Testing" #define FILE_DIR "icons/turf" #define FILE_DIR "icons/vending_icons" -#define FILE_DIR "interface" -#define FILE_DIR "maps" -#define FILE_DIR "maps/RandomZLevels" #define FILE_DIR "sound" #define FILE_DIR "sound/AI" #define FILE_DIR "sound/ambience" #define FILE_DIR "sound/effects" +#define FILE_DIR "sound/effects/turret" #define FILE_DIR "sound/effects/wind" #define FILE_DIR "sound/hallucinations" #define FILE_DIR "sound/items" @@ -271,14 +52,10 @@ #define FILE_DIR "sound/violin" #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\global.dm" #include "code\hub.dm" @@ -465,6 +242,7 @@ #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\power_failure.dm" #include "code\game\gamemodes\events\space_ninja.dm" #include "code\game\gamemodes\events\spacevines.dm" #include "code\game\gamemodes\events\wormholes.dm" @@ -661,6 +439,7 @@ #include "code\game\objects\weapons.dm" #include "code\game\objects\closets\walllocker.dm" #include "code\game\objects\effects\aliens.dm" +#include "code\game\objects\effects\barsign.dm" #include "code\game\objects\effects\bump_teleporter.dm" #include "code\game\objects\effects\effect_system.dm" #include "code\game\objects\effects\gibs.dm" @@ -903,6 +682,7 @@ #include "code\modules\admin\verbs\adminsay.dm" #include "code\modules\admin\verbs\atmosdebug.dm" #include "code\modules\admin\verbs\BrokenInhands.dm" +#include "code\modules\admin\verbs\check_customitem_activity.dm" #include "code\modules\admin\verbs\cinematic.dm" #include "code\modules\admin\verbs\custom_event.dm" #include "code\modules\admin\verbs\deadsay.dm" @@ -971,6 +751,7 @@ #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\alien.dm" #include "code\modules\clothing\spacesuits\captain.dm" #include "code\modules\clothing\spacesuits\ert.dm" #include "code\modules\clothing\spacesuits\miscellaneous.dm" @@ -978,6 +759,7 @@ #include "code\modules\clothing\spacesuits\rig.dm" #include "code\modules\clothing\spacesuits\syndi.dm" #include "code\modules\clothing\spacesuits\void.dm" +#include "code\modules\clothing\suits\alien.dm" #include "code\modules\clothing\suits\armor.dm" #include "code\modules\clothing\suits\bio.dm" #include "code\modules\clothing\suits\jobs.dm" @@ -1002,6 +784,33 @@ #include "code\modules\DetectiveWork\evidence.dm" #include "code\modules\DetectiveWork\footprints_and_rag.dm" #include "code\modules\DetectiveWork\scanner.dm" +#include "code\modules\events\alien_infestation.dm" +#include "code\modules\events\blob.dm" +#include "code\modules\events\brand_intelligence.dm" +#include "code\modules\events\carp_migration.dm" +#include "code\modules\events\comms_blackout.dm" +#include "code\modules\events\communications_blackout.dm" +#include "code\modules\events\disease_outbreak.dm" +#include "code\modules\events\electrical_storm.dm" +#include "code\modules\events\event.dm" +#include "code\modules\events\event_dynamic.dm" +#include "code\modules\events\event_manager.dm" +#include "code\modules\events\grid_check.dm" +#include "code\modules\events\infestation.dm" +#include "code\modules\events\ion_storm.dm" +#include "code\modules\events\meteors.dm" +#include "code\modules\events\money_hacker.dm" +#include "code\modules\events\money_lotto.dm" +#include "code\modules\events\money_spam.dm" +#include "code\modules\events\prison_break.dm" +#include "code\modules\events\radiation_storm.dm" +#include "code\modules\events\rogue_drones.dm" +#include "code\modules\events\space_ninja.dm" +#include "code\modules\events\spacevine.dm" +#include "code\modules\events\spider_infestation.dm" +#include "code\modules\events\spontaneous_appendicitis.dm" +#include "code\modules\events\viral_infection.dm" +#include "code\modules\events\viral_outbreak.dm" #include "code\modules\flufftext\Dreaming.dm" #include "code\modules\flufftext\Hallucination.dm" #include "code\modules\flufftext\TextFilters.dm" @@ -1190,6 +999,7 @@ #include "code\modules\mob\living\simple_animal\friendly\mouse.dm" #include "code\modules\mob\living\simple_animal\friendly\mushroom.dm" #include "code\modules\mob\living\simple_animal\friendly\slime.dm" +#include "code\modules\mob\living\simple_animal\friendly\spiderbot.dm" #include "code\modules\mob\living\simple_animal\friendly\tomato.dm" #include "code\modules\mob\living\simple_animal\hostile\alien.dm" #include "code\modules\mob\living\simple_animal\hostile\bear.dm" @@ -1205,6 +1015,7 @@ #include "code\modules\mob\living\simple_animal\hostile\syndicate.dm" #include "code\modules\mob\living\simple_animal\hostile\tree.dm" #include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm" +#include "code\modules\mob\living\simple_animal\hostile\retaliate\drone.dm" #include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm" #include "code\modules\mob\new_player\hud.dm" #include "code\modules\mob\new_player\login.dm" @@ -1285,6 +1096,7 @@ #include "code\modules\reagents\Chemistry-Holder.dm" #include "code\modules\reagents\Chemistry-Machinery.dm" #include "code\modules\reagents\Chemistry-Readme.dm" +#include "code\modules\reagents\Chemistry-Reagents-Antidepressants.dm" #include "code\modules\reagents\Chemistry-Reagents.dm" #include "code\modules\reagents\Chemistry-Recipes.dm" #include "code\modules\reagents\grenade_launcher.dm" @@ -1371,6 +1183,7 @@ #include "code\modules\surgery\eye.dm" #include "code\modules\surgery\face.dm" #include "code\modules\surgery\generic.dm" +#include "code\modules\surgery\implant.dm" #include "code\modules\surgery\other.dm" #include "code\modules\surgery\ribcage.dm" #include "code\modules\surgery\robolimbs.dm" @@ -1378,12 +1191,15 @@ #include "code\WorkInProgress\autopsy.dm" #include "code\WorkInProgress\buildmode.dm" #include "code\WorkInProgress\explosion_particles.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\Economy\Accounts.dm" +#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy.dm" +#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events.dm" +#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events_Mundane.dm" +#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_TradeDestinations.dm" +#include "code\WorkInProgress\Cael_Aislinn\Economy\EFTPOS.dm" +#include "code\WorkInProgress\Cael_Aislinn\Economy\Job_Departments.dm" #include "code\WorkInProgress\Cael_Aislinn\Jungle\falsewall.dm" #include "code\WorkInProgress\Cael_Aislinn\Jungle\jungle.dm" #include "code\WorkInProgress\Cael_Aislinn\Jungle\jungle_animals.dm" @@ -1393,25 +1209,37 @@ #include "code\WorkInProgress\Cael_Aislinn\Jungle\jungle_turfs.dm" #include "code\WorkInProgress\Cael_Aislinn\Jungle\misc_helpers.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\areas.dm" +#include "code\WorkInProgress\Cael_Aislinn\Rust\circuits_and_design.dm" +#include "code\WorkInProgress\Cael_Aislinn\Rust\core_control.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\core_field.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\core_gen.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\core_monitor.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_assembly.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_assembly_port.dm" +#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_assembly_port_construction.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_compressor.dm" +#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_compressor_construction.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_control.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_injector.dm" #include "code\WorkInProgress\Cael_Aislinn\Rust\gyrotron.dm" #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\ShieldGen\circuits_and_designs.dm" +#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\energy_field.dm" +#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_capacitor.dm" +#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_gen.dm" +#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_gen_external.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\Chinsky\ashtray.dm" +#include "code\WorkInProgress\Cib\MedicalSideEffects.dm" +#include "code\WorkInProgress\Mini\ATM.dm" #include "code\WorkInProgress\Ported\policetape.dm" #include "code\WorkInProgress\SkyMarshal\Ultralight_procs.dm" #include "code\WorkInProgress\Susan\susan_desert_turfs.dm" +#include "code\WorkInProgress\Uristqwerty\transit_tubes.dm" #include "code\WorkInProgress\virus2\analyser.dm" #include "code\WorkInProgress\virus2\antibodies.dm" #include "code\WorkInProgress\virus2\base.dm" diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index 4144fbb66d..26dc82033a 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -5,62 +5,113 @@ name = "circulator/heat exchanger" desc = "A gas circulator pump and heat exchanger." icon = 'icons/obj/pipes.dmi' - icon_state = "circ1-off" + icon_state = "circ-off" + anchored = 0 - var/side = 1 // 1=left 2=right + //var/side = 1 // 1=left 2=right var/status = 0 var/last_pressure_delta = 0 - anchored = 1.0 density = 1 - proc/return_transfer_air() - var/output_starting_pressure = air2.return_pressure() - var/input_starting_pressure = air1.return_pressure() +/obj/machinery/atmospherics/binary/circulator/New() + ..() + desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." - if(output_starting_pressure >= input_starting_pressure-10) - //Need at least 10 KPa difference to overcome friction in the mechanism - last_pressure_delta = 0 - return null +/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air() + if(!anchored) + return null - //Calculate necessary moles to transfer using PV = nRT - if(air1.temperature>0) - var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2 + var/output_starting_pressure = air2.return_pressure() + var/input_starting_pressure = air1.return_pressure() - var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION) + if(output_starting_pressure >= input_starting_pressure-10) + //Need at least 10 KPa difference to overcome friction in the mechanism + last_pressure_delta = 0 + return null - last_pressure_delta = pressure_delta + //Calculate necessary moles to transfer using PV = nRT + if(air1.temperature>0) + var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2 - //world << "pressure_delta = [pressure_delta]; transfer_moles = [transfer_moles];" + var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION) - //Actually transfer the gas - var/datum/gas_mixture/removed = air1.remove(transfer_moles) + last_pressure_delta = pressure_delta - if(network1) - network1.update = 1 + //world << "pressure_delta = [pressure_delta]; transfer_moles = [transfer_moles];" - if(network2) - network2.update = 1 + //Actually transfer the gas + var/datum/gas_mixture/removed = air1.remove(transfer_moles) - return removed + if(network1) + network1.update = 1 - else - last_pressure_delta = 0 + if(network2) + network2.update = 1 - process() - ..() - update_icon() + return removed + else + last_pressure_delta = 0 + +/obj/machinery/atmospherics/binary/circulator/process() + ..() update_icon() - if(stat & (BROKEN|NOPOWER)) - icon_state = "circ[side]-p" - else if(last_pressure_delta > 0) - if(last_pressure_delta > ONE_ATMOSPHERE) - icon_state = "circ[side]-run" - else - icon_state = "circ[side]-slow" - else - icon_state = "circ[side]-off" - return 1 \ No newline at end of file +/obj/machinery/atmospherics/binary/circulator/update_icon() + if(stat & (BROKEN|NOPOWER) || !anchored) + icon_state = "circ-p" + else if(last_pressure_delta > 0) + if(last_pressure_delta > ONE_ATMOSPHERE) + icon_state = "circ-run" + else + icon_state = "circ-slow" + else + icon_state = "circ-off" + + return 1 + +/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/wrench)) + anchored = !anchored + user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor." + + if(anchored) + if(dir & (NORTH|SOUTH)) + initialize_directions = NORTH|SOUTH + else if(dir & (EAST|WEST)) + initialize_directions = EAST|WEST + + initialize() + build_network() + if (node1) + node1.initialize() + node1.build_network() + if (node2) + node2.initialize() + node2.build_network() + else + if(node1) + node1.disconnect(src) + del(network1) + if(node2) + node2.disconnect(src) + del(network2) + + node1 = null + node2 = null + + else + ..() + +/obj/machinery/atmospherics/binary/circulator/verb/rotate() + set category = "Object" + set name = "Rotate Circulator" + set src in view(1) + + if (usr.stat || usr.restrained() || anchored) + return + + src.dir = turn(src.dir, 90) + desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm index 5d0159b394..3c07e1f206 100644 --- a/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm +++ b/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm @@ -1,7 +1,9 @@ var/global/current_date_string var/global/num_financial_terminals = 1 var/global/datum/money_account/station_account +var/global/list/datum/money_account/department_accounts = list() var/global/next_account_number = 0 +var/global/obj/machinery/account_database/centcomm_account_db /proc/create_station_account() if(!station_account) @@ -11,13 +13,13 @@ var/global/next_account_number = 0 station_account.owner_name = "[station_name()] Station Account" station_account.account_number = rand(111111, 999999) station_account.remote_access_pin = rand(1111, 111111) - station_account.money = 10000 + station_account.money = 75000 //create an entry in the account transaction log for when it was created var/datum/transaction/T = new() T.target_name = station_account.owner_name T.purpose = "Account creation" - T.amount = 10000 + T.amount = 75000 T.date = "2nd April, 2555" T.time = "11:24" T.source_terminal = "Biesel GalaxyNet Terminal #277" @@ -27,6 +29,31 @@ var/global/next_account_number = 0 for(var/obj/machinery/account_database/A in world) A.accounts.Add(station_account) +/proc/create_department_account(department) + next_account_number = rand(111111, 999999) + + var/datum/money_account/department_account = new() + department_account.owner_name = "[department] Account" + department_account.account_number = rand(111111, 999999) + department_account.remote_access_pin = rand(1111, 111111) + department_account.money = 5000 + + //create an entry in the account transaction log for when it was created + var/datum/transaction/T = new() + T.target_name = department_account.owner_name + T.purpose = "Account creation" + T.amount = department_account.money + T.date = "2nd April, 2555" + T.time = "11:24" + T.source_terminal = "Biesel GalaxyNet Terminal #277" + + //add the account + department_account.transaction_log.Add(T) + for(var/obj/machinery/account_database/A in world) + A.accounts.Add(department_account) + + department_accounts[department] = department_account + //the current ingame time (hh:mm) can be obtained by calling: //worldtime2text() @@ -62,12 +89,17 @@ var/global/next_account_number = 0 var/access_level = 0 var/datum/money_account/detailed_account_view var/creating_new_account = 0 + var/activated = 1 /obj/machinery/account_database/New() ..() if(!station_account) create_station_account() + if(department_accounts.len == 0) + for(var/department in station_departments) + create_department_account(department) + if(!current_date_string) current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557" @@ -80,6 +112,7 @@ var/global/next_account_number = 0 dat += "Confirm identity: [held_card ? held_card : "-----"]
" if(access_level > 0) + dat += "[activated ? "Disable" : "Enable"] remote access
" dat += "You may not edit accounts at this terminal, only create and view them.
" if(creating_new_account) dat += "
" @@ -150,6 +183,10 @@ var/global/next_account_number = 0 ..() /obj/machinery/account_database/Topic(var/href, var/href_list) + + if(href_list["toggle_activated"]) + activated = !activated + if(href_list["choice"]) switch(href_list["choice"]) if("sync_accounts") @@ -160,7 +197,7 @@ var/global/next_account_number = 0 for(var/datum/money_account/M in A.accounts) if(!src.accounts.Find(M)) src.accounts.Add(M) - usr << "\icon[src] Accounts synched across all databases in range." + usr << "\icon[src] Accounts synched across all NanoTrasen financial databases." if("create_account") creating_new_account = 1 @@ -214,6 +251,15 @@ var/global/next_account_number = 0 src.attack_hand(usr) +/obj/machinery/account_database/proc/add_account_across_all(var/new_owner_name = "Default user", var/starting_funds = 0, var/pre_existing = 0) + var/datum/money_account/M = add_account(new_owner_name, starting_funds, pre_existing) + for(var/obj/machinery/account_database/D in world) + if(D == src) + continue + D.accounts.Add(M) + + return M + /obj/machinery/account_database/proc/add_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/pre_existing = 0) //create a new account @@ -266,12 +312,15 @@ var/global/next_account_number = 0 R.overlays += stampoverlay R.stamps += "
This paper has been stamped by the Accounts Database." - //add the account M.transaction_log.Add(T) accounts.Add(M) + return M + /obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount) + if(!activated) + return 0 for(var/datum/money_account/D in accounts) if(D.account_number == attempt_account_number) D.money += amount @@ -295,6 +344,8 @@ var/global/next_account_number = 0 //this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account /obj/machinery/account_database/proc/attempt_account_access(var/attempt_account_number, var/attempt_pin_number, var/security_level_passed = 0) + if(!activated) + return 0 for(var/datum/money_account/D in accounts) if(D.account_number == attempt_account_number) if( D.security_level <= security_level_passed && (!D.security_level || D.remote_access_pin == attempt_pin_number) ) diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm b/code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm index 5fc619755a..eace14de51 100644 --- a/code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm +++ b/code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm @@ -1,8 +1,8 @@ -/obj/item/weapon/eftpos +/obj/item/device/eftpos name = "EFTPOS scanner" - desc = "Swipe your ID card to pay electronically." - icon = 'icons/obj/library.dmi' - icon_state = "scanner" + desc = "Swipe your ID card to make purchases electronically." + icon = 'icons/obj/device.dmi' + icon_state = "eftpos" var/machine_id = "" var/eftpos_name = "Default EFTPOS scanner" var/transaction_locked = 0 @@ -13,23 +13,24 @@ var/obj/machinery/account_database/linked_db var/datum/money_account/linked_account -/obj/item/weapon/eftpos/New() +/obj/item/device/eftpos/New() ..() machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]" access_code = rand(1111,111111) reconnect_database() - print_reference() + spawn(0) + print_reference() //by default, connect to the station account //the user of the EFTPOS device can change the target account though, and no-one will be the wiser (except whoever's being charged) linked_account = station_account -/obj/item/weapon/eftpos/proc/print_reference() - var/obj/item/weapon/paper/R = new(get_turf(src)) +/obj/item/device/eftpos/proc/print_reference() + var/obj/item/weapon/paper/R = new(src.loc) R.name = "Reference: [eftpos_name]" R.info = "[eftpos_name] reference

" R.info += "Access code: [access_code]

" - R.info += "Do not lose this code, or the device will have to be replaced.
" + R.info += "Do not lose or misplace this code.
" //stamp the paper var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') @@ -39,14 +40,18 @@ R.stamped += /obj/item/weapon/stamp R.overlays += stampoverlay R.stamps += "
This paper has been stamped by the EFTPOS device." + var/obj/item/smallDelivery/D = new(R.loc) + R.loc = D + D.wrapped = R + D.name = "small parcel - 'EFTPOS access code'" -/obj/item/weapon/eftpos/proc/reconnect_database() +/obj/item/device/eftpos/proc/reconnect_database() for(var/obj/machinery/account_database/DB in world) if(DB.z == src.z) linked_db = DB break -/obj/item/weapon/eftpos/attack_self(mob/user as mob) +/obj/item/device/eftpos/attack_self(mob/user as mob) if(get_dist(src,user) <= 1) var/dat = "[eftpos_name]
" dat += "This terminal is [machine_id]. Report this code when contacting NanoTrasen IT Support
" @@ -67,48 +72,62 @@ dat += "Transaction purpose: [transaction_purpose]
" dat += "Value: $[transaction_amount]
" dat += "Linked account: [linked_account ? linked_account.owner_name : "None"]
" - dat += "Change access code" + dat += "Change access code
" + dat += "Change EFTPOS ID
" + dat += "Scan card to reset access code \[------\]" user << browse(dat,"window=eftpos") else user << browse(null,"window=eftpos") -/obj/item/weapon/eftpos/attackby(O as obj, user as mob) +/obj/item/device/eftpos/attackby(O as obj, user as mob) if(istype(O, /obj/item/weapon/card)) //attempt to connect to a new db, and if that doesn't work then fail if(!linked_db) reconnect_database() - if(linked_db && linked_account) - var/obj/item/weapon/card/I = O - scan_card(I) + if(linked_db) + if(linked_account) + var/obj/item/weapon/card/I = O + scan_card(I) + else + usr << "\icon[src]Unable to connect to linked account." else usr << "\icon[src]Unable to connect to accounts database." else ..() -/obj/item/weapon/eftpos/Topic(var/href, var/href_list) +/obj/item/device/eftpos/Topic(var/href, var/href_list) if(href_list["choice"]) switch(href_list["choice"]) if("change_code") - var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm old EFTPOS code")) + var/attempt_code = input("Re-enter the current EFTPOS access code", "Confirm old EFTPOS code") as num if(attempt_code == access_code) - access_code = text2num(input("Enter a new access code for this device", "Enter new EFTPOS code")) + access_code = input("Enter a new access code for this device", "Enter new EFTPOS code") as num + print_reference() + else + usr << "\icon[src]Incorrect code entered." + if("change_id") + var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm EFTPOS code")) + if(attempt_code == access_code) + eftpos_name = input("Enter a new terminal ID for this device", "Enter new EFTPOS ID") + " EFTPOS scanner" print_reference() else usr << "\icon[src]Incorrect code entered." if("link_account") + if(!linked_db) + reconnect_database() if(linked_db) - var/attempt_account_num = text2num(input("Enter account number to pay EFTPOS charges into", "New account number")) - var/attempt_pin = text2num(input("Enter pin code", "Account pin")) + var/attempt_account_num = input("Enter account number to pay EFTPOS charges into", "New account number") as num + var/attempt_pin = input("Enter pin code", "Account pin") as num linked_account = linked_db.attempt_account_access(attempt_account_num, attempt_pin, 1) else - usr << "Unable to connect to accounts database." + usr << "\icon[src]Unable to connect to accounts database." if("trans_purpose") transaction_purpose = input("Enter reason for EFTPOS transaction", "Transaction purpose") if("trans_value") - transaction_amount = max(text2num(input("Enter amount for EFTPOS transaction", "Transaction amount")),0) + transaction_amount = input("Enter amount for EFTPOS transaction", "Transaction amount") as num if("toggle_lock") if(transaction_locked) - var/attempt_code = text2num(input("Enter EFTPOS access code", "Reset Transaction")) + var/attempt_code = input("Enter EFTPOS access code", "Reset Transaction") as num if(attempt_code == access_code) transaction_locked = 0 transaction_paid = 0 @@ -126,16 +145,27 @@ scan_card(I) else usr << "\icon[src]Unable to link accounts." + if("reset") + //reset the access code - requires HoP/captain access + var/obj/item/I = usr.get_active_hand() + if (istype(I, /obj/item/weapon/card)) + var/obj/item/weapon/card/id/C = I + if(access_cent_captain in C.access || access_hop in C.access || access_captain in C.access) + access_code = 0 + usr << "\icon[src]Access code reset to 0." + else if (istype(I, /obj/item/weapon/card/emag)) + access_code = 0 + usr << "\icon[src]Access code reset to 0." src.attack_self(usr) -/obj/item/weapon/eftpos/proc/scan_card(var/obj/item/weapon/card/I) +/obj/item/device/eftpos/proc/scan_card(var/obj/item/weapon/card/I) if (istype(I, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/C = I visible_message("[usr] swipes a card through [src].") if(transaction_locked && !transaction_paid) if(linked_account) - var/attempt_pin = text2num(input("Enter pin code", "EFTPOS transaction")) + var/attempt_pin = input("Enter pin code", "EFTPOS transaction") as num var/datum/money_account/D = linked_db.attempt_account_access(C.associated_account_number, attempt_pin, 2) if(D) if(transaction_amount <= D.money) @@ -149,9 +179,12 @@ //create entries in the two account transaction logs var/datum/transaction/T = new() - T.target_name = "[linked_account.owner_name] ([eftpos_name])" + T.target_name = "[linked_account.owner_name] (via [eftpos_name])" T.purpose = transaction_purpose - T.amount = "([transaction_amount])" + if(transaction_amount > 0) + T.amount = "([transaction_amount])" + else + T.amount = "[transaction_amount]" T.source_terminal = machine_id T.date = current_date_string T.time = worldtime2text() @@ -168,9 +201,9 @@ else usr << "\icon[src]You don't have that much money!" else - usr << "\icon[src]EFTPOS is not connected to an account." + usr << "\icon[src]Unable to access account. Check security settings and try again." else - usr << "\icon[src]Unable to access account. Check security settings and try again." + usr << "\icon[src]EFTPOS is not connected to an account." else ..() diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm index 95163f043c..84000d1b46 100644 --- a/code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm +++ b/code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm @@ -14,6 +14,17 @@ #define ANIMAL_RIGHTS_RAID 13 #define FESTIVAL 14 +#define RESEARCH_BREAKTHROUGH 15 +#define BARGAINS 16 +#define SONG_DEBUT 17 +#define MOVIE_RELEASE 18 +#define BIG_GAME_HUNTERS 19 +#define ELECTION 20 +#define GOSSIP 21 +#define TOURISM 22 +#define CELEBRITY_DEATH 23 +#define RESIGNATION 24 + #define DEFAULT 1 #define ADMINISTRATIVE 2 @@ -54,10 +65,25 @@ var/setup_economy = 0 /proc/setup_economy() + if(setup_economy) + return var/datum/feed_channel/newChannel = new /datum/feed_channel newChannel.channel_name = "Tau Ceti Daily" newChannel.author = "CentComm Minister of Information" newChannel.locked = 1 newChannel.is_admin_channel = 1 news_network.network_channels += newChannel - setup_economy = 1 + + newChannel = new /datum/feed_channel + newChannel.channel_name = "The Gibson Gazette" + newChannel.author = "Editor Mike Hammers" + newChannel.locked = 1 + newChannel.is_admin_channel = 1 + news_network.network_channels += newChannel + + for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination) + var/datum/trade_destination/D = new loc_type + weighted_randomevent_locations[D] = D.viable_random_events.len + weighted_mundaneevent_locations[D] = D.viable_mundane_events.len + + setup_economy = 1 \ No newline at end of file diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm index a93a469029..2aa5cc42d1 100644 --- a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm +++ b/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm @@ -11,11 +11,14 @@ if(!setup_economy) setup_economy() - var/type = pick(tradeable_destinations) - affected_dest = new type() + affected_dest = pickweight(weighted_randomevent_locations) if(affected_dest.viable_random_events.len) endWhen = rand(60,300) event_type = pick(affected_dest.viable_random_events) + + if(!event_type) + return + switch(event_type) if(RIOTS) dearer_goods = list(SECURITY) @@ -54,39 +57,42 @@ /datum/event/economic_event/announce() //copy-pasted from the admin verbs to submit new newscaster messages var/datum/feed_message/newMsg = new /datum/feed_message - newMsg.author = "NanoTrasen Editor" + newMsg.author = "Tau Ceti Daily" newMsg.is_admin_message = 1 - switch(event_type) - if(RIOTS) - newMsg.body = "[pick("Riots have","Unrest has")] broken out on planet [affected_dest.name]. Authorities call for calm, as [pick("various parties","rebellious elements","peacekeeping forces","\'REDACTED\'")] begin stockpiling weaponry and armour. Meanwhile, food and mineral prices are dropping as local industries attempt empty their stocks in expectation of looting." - if(WILD_ANIMAL_ATTACK) - newMsg.body = "Local [pick("wildlife","animal life","fauna")] on planet [affected_dest.name] has been increasing in agression and raiding outlying settlements for food. Big game hunters have been called in to help alleviate the problem, but numerous injuries have already occurred." - if(INDUSTRIAL_ACCIDENT) - newMsg.body = "[pick("An industrial accident","A smelting accident","A malfunction","A malfunctioning piece of machinery","Negligent maintenance","A cooleant leak","A ruptured conduit")] at a [pick("factory","installation","power plant","dockyards")] on [affected_dest.name] resulted in severe structural damage and numerous injuries. Repairs are ongoing." - if(BIOHAZARD_OUTBREAK) - newMsg.body = "[pick("A \'REDACTED\'","A biohazard","An outbreak","A virus")] on [affected_dest.name] has resulted in quarantine, stopping much shipping in the area. Although the quarantine is now lifted, authorities are calling for deliveries of medical supplies to treat the infected, and gas to replace contaminated stocks." - if(PIRATES) - newMsg.body = "[pick("Pirates","Criminal elements","A [pick("Syndicate","Donk Co.","Waffle Co.","\'REDACTED\'")] strike force")] have [pick("raided","blockaded","attempted to blackmail","attacked")] [affected_dest.name] today. Security has been tightened, but many valuable minerals were taken." - if(CORPORATE_ATTACK) - newMsg.body = "A small [pick("pirate","Cybersun Industries","Gorlex Marauders","Syndicate")] fleet has precise-jumped into proximity with [affected_dest.name], [pick("for a smash-and-grab operation","in a hit and run attack","in an overt display of hostilities")]. Much damage was done, and security has been tightened since the incident." - if(ALIEN_RAIDERS) - if(prob(20)) - newMsg.body = "The Tiger Co-operative have raided [affected_dest.name] today, no doubt on orders from their enigmatic masters. Stealing wildlife, farm animals, medical research materials and kidnapping civilians. NanoTrasen authorities are standing by to counter attempts at bio-terrorism." - else - newMsg.body = "[pick("The alien species designated \'United Exolitics\'","The alien species designated \'REDACTED\'","An unknown alien species")] have raided [affected_dest.name] today, stealing wildlife, farm animals, medical research materials and kidnapping civilians. It seems they desire to learn more about us, so the Navy will be standing by to accomodate them next time they try." - if(AI_LIBERATION) - newMsg.body = "A [pick("\'REDACTED\' was detected on","S.E.L.F operative infiltrated","malignant computer virus was detected on","rogue [pick("slicer","hacker")] was apprehended on")] [affected_dest.name] today, and managed to infect [pick("\'REDACTED\'","a sentient sub-system","a class one AI","a sentient defence installation")] before it could be stopped. Many lives were lost as it systematically begin murdering civilians, and considerable work must be done to repair the affected areas." - if(MOURNING) - newMsg.body = "[pick("The popular","The well-liked","The eminent","The well-known")] [pick("professor","entertainer","singer","researcher","public servant","administrator","ship captain","\'REDACTED\'")], [pick( random_name(pick(MALE,FEMALE)), 40; "\'REDACTED\'" )] has [pick("passed away","committed suicide","been murdered","died in a freakish accident")] on [affected_dest.name] today. The entire planet is in mourning, and prices have dropped for industrial goods as worker morale drops." - if(CULT_CELL_REVEALED) - newMsg.body = "A [pick("dastardly","blood-thirsty","villanous","crazed")] cult of [pick("The Elder Gods","Nar'sie","an apocalyptic sect","\'REDACTED\'")] has [pick("been discovered","been revealed","revealed themselves","gone public")] on [affected_dest.name] earlier today. Public morale has been shaken due to [pick("certain","several","one or two")] [pick("high-profile","well known","popular")] individuals [pick("performing \'REDACTED\'","claiming allegiance to the cult","swearing loyalty to the cult leader","promising to aid to the cult")] before those involved could be brought to justice. The editor reminds all personnel that supernatural myths will not be tolerated on NanoTrasen facilities." - if(SECURITY_BREACH) - newMsg.body = "There was [pick("a security breach in","an unauthorised access in","an attempted theft in","an anarchist attack in","violent sabotage of")] a [pick("high-security","restricted access","classified","\'REDACTED\'")] [pick("\'REDACTED\'","section","zone","area")] this morning. Security was tightened on [affected_dest.name] after the incident, and the editor reassures all NanoTrasen personnel that such lapses are rare." - if(ANIMAL_RIGHTS_RAID) - newMsg.body = "[pick("Militant animal rights activists","Members of the terrorist group Animal Rights Consortium","Members of the terrorist group \'REDACTED\'")] have [pick("launched a campaign of terror","unleashed a swathe of destruction","raided farms and pastures","forced entry to \'REDACTED\'")] on [affected_dest.name] earlier today, freeing numerous [pick("farm animals","animals","\'REDACTED\'")]. Prices for tame and breeding animals have spiked as a result." - if(FESTIVAL) - newMsg.body = "A [pick("festival","week long celebration","day of revelry","planet-wide holiday")] has been delcared on [affected_dest.name] by [pick("Governor","Commissioner","General","Commandant","Administrator")] [random_name(pick(MALE,FEMALE))] to celebrate [pick("the birth of their [pick("son","daughter")]","coming of age of their [pick("son","daughter")]","the pacification of rogue military cell","the apprehension of a violent criminal who had been terrorising the planet")]. Massive stocks of food and meat have been bought driving up prices across the planet." + //see if our location has custom event info for this event + newMsg.body = affected_dest.get_custom_eventstring() + if(!newMsg.body) + switch(event_type) + if(RIOTS) + newMsg.body = "[pick("Riots have","Unrest has")] broken out on planet [affected_dest.name]. Authorities call for calm, as [pick("various parties","rebellious elements","peacekeeping forces","\'REDACTED\'")] begin stockpiling weaponry and armour. Meanwhile, food and mineral prices are dropping as local industries attempt empty their stocks in expectation of looting." + if(WILD_ANIMAL_ATTACK) + newMsg.body = "Local [pick("wildlife","animal life","fauna")] on planet [affected_dest.name] has been increasing in agression and raiding outlying settlements for food. Big game hunters have been called in to help alleviate the problem, but numerous injuries have already occurred." + if(INDUSTRIAL_ACCIDENT) + newMsg.body = "[pick("An industrial accident","A smelting accident","A malfunction","A malfunctioning piece of machinery","Negligent maintenance","A cooleant leak","A ruptured conduit")] at a [pick("factory","installation","power plant","dockyards")] on [affected_dest.name] resulted in severe structural damage and numerous injuries. Repairs are ongoing." + if(BIOHAZARD_OUTBREAK) + newMsg.body = "[pick("A \'REDACTED\'","A biohazard","An outbreak","A virus")] on [affected_dest.name] has resulted in quarantine, stopping much shipping in the area. Although the quarantine is now lifted, authorities are calling for deliveries of medical supplies to treat the infected, and gas to replace contaminated stocks." + if(PIRATES) + newMsg.body = "[pick("Pirates","Criminal elements","A [pick("Syndicate","Donk Co.","Waffle Co.","\'REDACTED\'")] strike force")] have [pick("raided","blockaded","attempted to blackmail","attacked")] [affected_dest.name] today. Security has been tightened, but many valuable minerals were taken." + if(CORPORATE_ATTACK) + newMsg.body = "A small [pick("pirate","Cybersun Industries","Gorlex Marauders","Syndicate")] fleet has precise-jumped into proximity with [affected_dest.name], [pick("for a smash-and-grab operation","in a hit and run attack","in an overt display of hostilities")]. Much damage was done, and security has been tightened since the incident." + if(ALIEN_RAIDERS) + if(prob(20)) + newMsg.body = "The Tiger Co-operative have raided [affected_dest.name] today, no doubt on orders from their enigmatic masters. Stealing wildlife, farm animals, medical research materials and kidnapping civilians. NanoTrasen authorities are standing by to counter attempts at bio-terrorism." + else + newMsg.body = "[pick("The alien species designated \'United Exolitics\'","The alien species designated \'REDACTED\'","An unknown alien species")] have raided [affected_dest.name] today, stealing wildlife, farm animals, medical research materials and kidnapping civilians. It seems they desire to learn more about us, so the Navy will be standing by to accomodate them next time they try." + if(AI_LIBERATION) + newMsg.body = "A [pick("\'REDACTED\' was detected on","S.E.L.F operative infiltrated","malignant computer virus was detected on","rogue [pick("slicer","hacker")] was apprehended on")] [affected_dest.name] today, and managed to infect [pick("\'REDACTED\'","a sentient sub-system","a class one AI","a sentient defence installation")] before it could be stopped. Many lives were lost as it systematically begin murdering civilians, and considerable work must be done to repair the affected areas." + if(MOURNING) + newMsg.body = "[pick("The popular","The well-liked","The eminent","The well-known")] [pick("professor","entertainer","singer","researcher","public servant","administrator","ship captain","\'REDACTED\'")], [pick( random_name(pick(MALE,FEMALE)), 40; "\'REDACTED\'" )] has [pick("passed away","committed suicide","been murdered","died in a freakish accident")] on [affected_dest.name] today. The entire planet is in mourning, and prices have dropped for industrial goods as worker morale drops." + if(CULT_CELL_REVEALED) + newMsg.body = "A [pick("dastardly","blood-thirsty","villanous","crazed")] cult of [pick("The Elder Gods","Nar'sie","an apocalyptic sect","\'REDACTED\'")] has [pick("been discovered","been revealed","revealed themselves","gone public")] on [affected_dest.name] earlier today. Public morale has been shaken due to [pick("certain","several","one or two")] [pick("high-profile","well known","popular")] individuals [pick("performing \'REDACTED\' acts","claiming allegiance to the cult","swearing loyalty to the cult leader","promising to aid to the cult")] before those involved could be brought to justice. The editor reminds all personnel that supernatural myths will not be tolerated on NanoTrasen facilities." + if(SECURITY_BREACH) + newMsg.body = "There was [pick("a security breach in","an unauthorised access in","an attempted theft in","an anarchist attack in","violent sabotage of")] a [pick("high-security","restricted access","classified","\'REDACTED\'")] [pick("\'REDACTED\'","section","zone","area")] this morning. Security was tightened on [affected_dest.name] after the incident, and the editor reassures all NanoTrasen personnel that such lapses are rare." + if(ANIMAL_RIGHTS_RAID) + newMsg.body = "[pick("Militant animal rights activists","Members of the terrorist group Animal Rights Consortium","Members of the terrorist group \'REDACTED\'")] have [pick("launched a campaign of terror","unleashed a swathe of destruction","raided farms and pastures","forced entry to \'REDACTED\'")] on [affected_dest.name] earlier today, freeing numerous [pick("farm animals","animals","\'REDACTED\'")]. Prices for tame and breeding animals have spiked as a result." + if(FESTIVAL) + newMsg.body = "A [pick("festival","week long celebration","day of revelry","planet-wide holiday")] has been declared on [affected_dest.name] by [pick("Governor","Commissioner","General","Commandant","Administrator")] [random_name(pick(MALE,FEMALE))] to celebrate [pick("the birth of their [pick("son","daughter")]","coming of age of their [pick("son","daughter")]","the pacification of rogue military cell","the apprehension of a violent criminal who had been terrorising the planet")]. Massive stocks of food and meat have been bought driving up prices across the planet." for(var/datum/feed_channel/FC in news_network.network_channels) if(FC.channel_name == "Tau Ceti Daily") diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm new file mode 100644 index 0000000000..60f9f3bb99 --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm @@ -0,0 +1,233 @@ + +/datum/event/mundane_news + endWhen = 10 + +/datum/event/mundane_news/announce() + var/datum/trade_destination/affected_dest = pickweight(weighted_mundaneevent_locations) + var/event_type = 0 + if(affected_dest.viable_mundane_events.len) + event_type = pick(affected_dest.viable_mundane_events) + + if(!event_type) + return + + //copy-pasted from the admin verbs to submit new newscaster messages + var/datum/feed_message/newMsg = new /datum/feed_message + newMsg.author = "Tau Ceti Daily" + newMsg.is_admin_message = 1 + + //see if our location has custom event info for this event + newMsg.body = affected_dest.get_custom_eventstring() + if(!newMsg.body) + newMsg.body = "" + switch(event_type) + if(RESEARCH_BREAKTHROUGH) + newMsg.body = "A major breakthough in the field of [pick("plasma research","super-compressed materials","nano-augmentation","bluespace research","volatile power manipulation")] \ + was announced [pick("yesterday","a few days ago","last week","earlier this month")] by a private firm on [affected_dest.name]. \ + NanoTrasen declined to comment as to whether this could impinge on profits." + + if(ELECTION) + newMsg.body = "The pre-selection of an additional candidates was announced for the upcoming [pick("supervisors council","advisory board","governership","board of inquisitors")] \ + election on [affected_dest.name] was announced earlier today, \ + [pick("media mogul","web celebrity", "industry titan", "superstar", "famed chef", "popular gardener", "ex-army officer", "multi-billionaire")] \ + [random_name(pick(MALE,FEMALE))]. In a statement to the media they said '[pick("My only goal is to help the [pick("sick","poor","children")]",\ + "I will maintain NanoTrasen's record profits","I believe in our future","We must return to our moral core","Just like... chill out dudes")]'." + + if(RESIGNATION) + newMsg.body = "NanoTrasen regretfully announces the resignation of [pick("Sector Admiral","Division Admiral","Ship Admiral","Vice Admiral")] [random_name(pick(MALE,FEMALE))]." + if(prob(25)) + var/locstring = pick("Segunda","Salusa","Cepheus","Andromeda","Gruis","Corona","Aquila","Asellus") + " " + pick("I","II","III","IV","V","VI","VII","VIII") + newMsg.body += " In a ceremony on [affected_dest.name] this afternoon, they will be awarded the \ + [pick("Red Star of Sacrifice","Purple Heart of Heroism","Blue Eagle of Loyalty","Green Lion of Ingenuity")] for " + if(prob(33)) + newMsg.body += "their actions at the Battle of [pick(locstring,"REDACTED")]." + else if(prob(50)) + newMsg.body += "their contribution to the colony of [locstring]." + else + newMsg.body += "their loyal service over the years." + else if(prob(33)) + newMsg.body += " They are expected to settle down in [affected_dest.name], where they have been granted a handsome pension." + else if(prob(50)) + newMsg.body += " The news was broken on [affected_dest.name] earlier today, where they cited reasons of '[pick("health","family","REDACTED")]'" + else + newMsg.body += " Administration Aerospace wishes them the best of luck in their retirement ceremony on [affected_dest.name]." + + if(CELEBRITY_DEATH) + newMsg.body = "It is with regret today that we announce the sudden passing of the " + if(prob(33)) + newMsg.body += "[pick("distinguished","decorated","veteran","highly respected")] \ + [pick("Ship's Captain","Vice Admiral","Colonel","Lieutenant Colonel")] " + else if(prob(50)) + newMsg.body += "[pick("award-winning","popular","highly respected","trend-setting")] \ + [pick("comedian","singer/songwright","artist","playwright","TV personality","model")] " + else + newMsg.body += "[pick("successful","highly respected","ingenious","esteemed")] \ + [pick("academic","Professor","Doctor","Scientist")] " + + newMsg.body += "[random_name(pick(MALE,FEMALE))] on [affected_dest.name] [pick("last week","yesterday","this morning","two days ago","three days ago")]\ + [pick(". Assassination is suspected, but the perpetrators have not yet been brought to justice",\ + " due to Syndicate infiltrators (since captured)",\ + " during an industrial accident",\ + " due to [pick("heart failure","kidney failure","liver failure","brain hemorrhage")]")]" + + if(BARGAINS) + newMsg.body += "BARGAINS! BARGAINS! BARGAINS! Commerce Control on [affected_dest.name] wants you to know that everything must go! Across all retail centres, \ + all goods are being slashed, and all retailors are onboard - so come on over for the \[shopping\] time of your life." + + if(SONG_DEBUT) + newMsg.body += "[pick("Singer","Singer/songwriter","Saxophonist","Pianist","Guitarist","TV personality","Star")] [random_name(pick(MALE,FEMALE))] \ + announced the debut of their new [pick("single","album","EP","label")] '[pick("Everyone's","Look at the","Baby don't eye those","All of those","Dirty nasty")] \ + [pick("roses","three stars","starships","nanobots","cyborgs","Skrell","Sren'darr")] \ + [pick("on Venus","on Reade","on Moghes","in my hand","slip through my fingers","die for you","sing your heart out","fly away")]' \ + with [pick("pre-puchases available","a release tour","cover signings","a launch concert")] on [affected_dest.name]." + + if(MOVIE_RELEASE) + newMsg.body += "From the [pick("desk","home town","homeworld","mind")] of [pick("acclaimed","award-winning","popular","stellar")] \ + [pick("playwright","author","director","actor","TV star")] [random_name(pick(MALE,FEMALE))] comes the latest sensation: '\ + [pick("Deadly","The last","Lost","Dead")] [pick("Starships","Warriors","outcasts","Tajarans","Unathi","Skrell")] \ + [pick("of","from","raid","go hunting on","visit","ravage","pillage","destroy")] \ + [pick("Moghes","Earth","Biesel","Ahdomai","S'randarr","the Void","the Edge of Space")]'.\ + . Own it on webcast today, or visit the galactic premier on [affected_dest.name]!" + + if(BIG_GAME_HUNTERS) + newMsg.body += "Game hunters on [affected_dest.name] " + if(prob(33)) + newMsg.body += "were surprised when an unusual species experts have since identified as \ + [pick("a subclass of mammal","a divergent abhuman species","an intelligent species of lemur","organic/cyborg hybrids")] turned up. Believed to have been brought in by \ + [pick("alien smugglers","early colonists","syndicate raiders","unwitting tourists")], this is the first such specimen discovered in the wild." + else if(prob(50)) + newMsg.body += "were attacked by a vicious [pick("nas'r","diyaab","samak","predator which has not yet been identified")]\ + . Officials urge caution, and locals are advised to stock up on armaments." + else + newMsg.body += "brought in an unusually [pick("valuable","rare","large","vicious","intelligent")] [pick("mammal","predator","farwa","samak")] for inspection \ + [pick("today","yesterday","last week")]. Speculators suggest they may be tipped to break several records." + + if(GOSSIP) + newMsg.body += "[pick("TV host","Webcast personality","Superstar","Model","Actor","Singer")] [random_name(pick(MALE,FEMALE))] " + if(prob(33)) + newMsg.body += "and their partner announced the birth of their [pick("first","second","third")] child on [affected_dest.name] early this morning. \ + Doctors say the child is well, and the parents are considering " + if(prob(50)) + newMsg.body += capitalize(pick(first_names_female)) + else + newMsg.body += capitalize(pick(first_names_male)) + newMsg.body += " for the name." + else if(prob(50)) + newMsg.body += "announced their [pick("split","break up","marriage","engagement")] with [pick("TV host","webcast personality","superstar","model","actor","singer")] \ + [random_name(pick(MALE,FEMALE))] at [pick("a society ball","a new opening","a launch","a club")] on [affected_dest.name] yesterday, pundits are shocked." + else + newMsg.body += "is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to " + newMsg.body += "[pick("unkind comments by an ex","rumours started by jealous friends",\ + "the decision to be dropped by a major sponsor","a disasterous interview on Tau Ceti Tonight")]." + if(TOURISM) + newMsg.body += "Tourists are flocking to [affected_dest.name] after the surprise announcement of [pick("major shopping bargains by a wily retailer",\ + "a huge new ARG by a popular entertainment company","a secret tour by popular artiste [random_name(pick(MALE,FEMALE))]")]. \ + Tau Ceti Daily is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage." + + for(var/datum/feed_channel/FC in news_network.network_channels) + if(FC.channel_name == "Tau Ceti Daily") + FC.messages += newMsg + break + for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + NEWSCASTER.newsAlert("Tau Ceti Daily") + +/datum/event/trivial_news + endWhen = 10 + +/datum/event/trivial_news/announce() + //copy-pasted from the admin verbs to submit new newscaster messages + var/datum/feed_message/newMsg = new /datum/feed_message + newMsg.author = "Editor Mike Hammers" + //newMsg.is_admin_message = 1 + var/datum/trade_destination/affected_dest = pick(weighted_mundaneevent_locations) + newMsg.body = pick( + "Tree stuck in tajaran; firefighters baffled.",\ + "Armadillos want aardvarks removed from dictionary claims 'here first'.",\ + "Angel found dancing on pinhead ordered to stop; cited for public nuisance.",\ + "Letters claim they are better than number; 'Always have been'.",\ + "Pens proclaim pencils obsolete, 'lead is dead'.",\ + "Rock and paper sues scissors for discrimination.",\ + "Steak tell-all book reveals he never liked sitting by potato.",\ + "Woodchuck stops counting how many times he’s chucked 'Never again'.",\ + "[affected_dest.name] clerk first person able to pronounce '@*$%!'.",\ + "[affected_dest.name] delis serving boiled paperback dictionaries, 'Adjectives chewy' customers declare.",\ + "[affected_dest.name] weather deemed 'boring'; meteors and rad storms to be imported.",\ + "Most [affected_dest.name] security officers prefer cream over sugar.",\ + "Palindrome speakers conference in [affected_dest.name]; 'Wow!' says Otto.",\ + "Question mark worshipped as deity by ancient [affected_dest.name] dwellers.",\ + "Spilled milk causes whole [affected_dest.name] populace to cry.",\ + "World largest carp patty at display on [affected_dest.name].",\ + "'Here kitty kitty' no longer preferred tajaran retrieval technique.",\ + "Man travels 7000 light years to retrieve lost hankie, 'It was my favourite'.",\ + "New bowling lane that shoots mini-meteors at bowlers very popular.",\ + "[pick("Unathi","Spacer")] gets tattoo of Tau Ceti on chest '[pick("CentComm","star","starship","asteroid")] tickles most'.",\ + "Skrell marries computer; wedding attended by 100 modems.",\ + "Chef reports successfully using harmonica as cheese grater.",\ + "NanoTrasen invents handkerchief that says 'Bless you' after sneeze.",\ + "Clone accused of posing for other clones’s school photo.",\ + "Clone accused of stealing other clones’s employee of the month award.",\ + "Woman robs station with hair dryer; crewmen love new style.",\ + "This space for rent.",\ + "[affected_dest.name] Baker Wins Pickled Crumpet Toss Three Years Running",\ + "Skrell Scientist Discovers Abacus Can Be Used To Dry Towels",\ + "Survey: 'Cheese Louise' Voted Best Pizza Restaurant In Tau Ceti",\ + "I Was Framed, jokes [affected_dest.name] artist",\ + "Mysterious Loud Rumbling Noises In [affected_dest.name] Found To Be Mysterious Loud Rumblings",\ + "Alien ambassador becomes lost on [affected_dest.name], refuses to ask for directions",\ + "Swamp Gas Verified To Be Exhalations Of Stars--Movie Stars--Long Passed",\ + "Tainted Broccoli Weapon Of Choice For Syndicate Assassins",\ + "Chefs Find Broccoli Effective Tool For Cutting Cheese",\ + "Broccoli Found To Cause Grumpiness In Monkeys",\ + "Survey: 80% Of People on [affected_dest.name] Love Clog-Dancing",\ + "Giant Hairball Has Perfect Grammar But Rolls rr's Too Much, Linguists Say",\ + "[affected_dest.name] Phonebooks Print All Wrong Numbers; Results In 15 New Marriages",\ + "Tajaran Burglar Spotted on [affected_dest.name], Mistaken For Dalmatian",\ + "Gibson Gazette Updates Frequently Absurd, Poll Indicates",\ + "Esoteric Verbosity Culminates In Communicative Ennui, [affected_dest.name] Academics Note",\ + "Taj Demand Longer Breaks, Cleaner Litter, Slower Mice",\ + "Survey: 3 Out Of 5 Skrell Loathe Modern Art",\ + "Skrell Scientist Discovers Gravity While Falling Down Stairs",\ + "Boy Saves Tajaran From Tree on [affected_dest.name], Thousands Cheer",\ + "Shipment Of Apples Overturns, [affected_dest.name] Diner Offers Applesauce Special",\ + "Spotted Owl Spotted on [affected_dest.name]",\ + "Humans Everywhere Agree: Purring Tajarans Are Happy Tajarans",\ + "From The Desk Of Wise Guy Sammy: One Word In This Gazette Is Sdrawkcab",\ + "From The Desk Of Wise Guy Sammy: It's Hard To Have Too Much Shelf Space",\ + "From The Desk Of Wise Guy Sammy: Wine And Friendships Get Better With Age",\ + "From The Desk Of Wise Guy Sammy: The Insides Of Golf Balls Are Mostly Rubber Bands",\ + "From The Desk Of Wise Guy Sammy: You Don't Have To Fool All The People, Just The Right Ones",\ + "From The Desk Of Wise Guy Sammy: If You Made The Mess, You Clean It Up",\ + "From The Desk Of Wise Guy Sammy: It Is Easier To Get Forgiveness Than Permission",\ + "From The Desk Of Wise Guy Sammy: Check Your Facts Before Making A Fool Of Yourself",\ + "From The Desk Of Wise Guy Sammy: You Can't Outwait A Bureaucracy",\ + "From The Desk Of Wise Guy Sammy: It's Better To Yield Right Of Way Than To Demand It",\ + "From The Desk Of Wise Guy Sammy: A Person Who Likes Cats Can't Be All Bad",\ + "From The Desk Of Wise Guy Sammy: Help Is The Sunny Side Of Control",\ + "From The Desk Of Wise Guy Sammy: Two Points Determine A Straight Line",\ + "From The Desk Of Wise Guy Sammy: Reading Improves The Mind And Lifts The Spirit",\ + "From The Desk Of Wise Guy Sammy: Better To Aim High And Miss Then To Aim Low And Hit",\ + "From The Desk Of Wise Guy Sammy: Meteors Often Strike The Same Place More Than Once",\ + "Tommy B. Saif Sez: Look Both Ways Before Boarding The Shuttle",\ + "Tommy B. Saif Sez: Hold On; Sudden Stops Sometimes Necessary",\ + "Tommy B. Saif Sez: Keep Fingers Away From Moving Panels",\ + "Tommy B. Saif Sez: No Left Turn, Except Shuttles",\ + "Tommy B. Saif Sez: Return Seats And Trays To Their Proper Upright Position",\ + "Tommy B. Saif Sez: Eating And Drinking In Docking Bays Is Prohibited",\ + "Tommy B. Saif Sez: Accept No Substitutes, And Don't Be Fooled By Imitations",\ + "Tommy B. Saif Sez: Do Not Remove This Tag Under Penalty Of Law",\ + "Tommy B. Saif Sez: Always Mix Thoroughly When So Instructed",\ + "Tommy B. Saif Sez: Try To Keep Six Month's Expenses In Reserve",\ + "Tommy B. Saif Sez: Change Not Given Without Purchase",\ + "Tommy B. Saif Sez: If You Break It, You Buy It",\ + "Tommy B. Saif Sez: Reservations Must Be Cancelled 48 Hours Prior To Event To Obtain Refund",\ + "Doughnuts: Is There Anything They Can't Do",\ + "If Tin Whistles Are Made Of Tin, What Do They Make Foghorns Out Of?",\ + "Broccoli discovered to be colonies of tiny aliens with murder on their minds"\ + ) + + for(var/datum/feed_channel/FC in news_network.network_channels) + if(FC.channel_name == "The Gibson Gazette") + FC.messages += newMsg + break + for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + NEWSCASTER.newsAlert("The Gibson Gazette") diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_TradeDestinations.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Economy_TradeDestinations.dm index 1e5ed65be6..6778a1b6b1 100644 --- a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_TradeDestinations.dm +++ b/code/WorkInProgress/Cael_Aislinn/Economy/Economy_TradeDestinations.dm @@ -1,4 +1,7 @@ +var/list/weighted_randomevent_locations = list() +var/list/weighted_mundaneevent_locations = list() + /datum/trade_destination var/name = "" var/description = "" @@ -8,6 +11,10 @@ var/can_shuttle_here = 0 //one day crew from the exodus will be able to travel to this destination var/list/viable_random_events = list() var/list/temp_price_change[BIOMEDICAL] + var/list/viable_mundane_events = list() + +/datum/trade_destination/proc/get_custom_eventstring(var/event_type) + return null //distance is measured in AU and co-relates to travel time /datum/trade_destination/centcomm @@ -17,6 +24,7 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(SECURITY_BREACH, CORPORATE_ATTACK, AI_LIBERATION) + viable_mundane_events = list(ELECTION, RESIGNATION, CELEBRITY_DEATH) /datum/trade_destination/anansi name = "NSS Anansi" @@ -25,6 +33,13 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(SECURITY_BREACH, CULT_CELL_REVEALED, BIOHAZARD_OUTBREAK, PIRATES, ALIEN_RAIDERS) + viable_mundane_events = list(RESEARCH_BREAKTHROUGH, RESEARCH_BREAKTHROUGH, BARGAINS, GOSSIP) + +/datum/trade_destination/anansi/get_custom_eventstring(var/event_type) + if(event_type == RESEARCH_BREAKTHROUGH) + return "Thanks to research conducted on the NSS Anansi, Second Red Cross Society wishes to announce a major breakthough in the field of \ + [pick("mind-machine interfacing","neuroscience","nano-augmentation","genetics")]. NanoTrasen is expected to announce a co-exploitation deal within the fortnight." + return null /datum/trade_destination/icarus name = "NMV Icarus" @@ -41,6 +56,13 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(INDUSTRIAL_ACCIDENT, PIRATES, CORPORATE_ATTACK) + viable_mundane_events = list(RESEARCH_BREAKTHROUGH, RESEARCH_BREAKTHROUGH) + +/datum/trade_destination/redolant/get_custom_eventstring(var/event_type) + if(event_type == RESEARCH_BREAKTHROUGH) + return "Thanks to research conducted on the OAV Redolant, Osiris Atmospherics wishes to announce a major breakthough in the field of \ + [pick("plasma research","high energy flux capacitance","super-compressed materials","theoretical particle physics")]. NanoTrasen is expected to announce a co-exploitation deal within the fortnight." + return null /datum/trade_destination/beltway name = "Beltway mining chain" @@ -49,6 +71,7 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(PIRATES, INDUSTRIAL_ACCIDENT) + viable_mundane_events = list(TOURISM) /datum/trade_destination/biesel name = "Biesel" @@ -57,6 +80,7 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING) + viable_mundane_events = list(BARGAINS, GOSSIP, SONG_DEBUT, MOVIE_RELEASE, ELECTION, TOURISM, RESIGNATION, CELEBRITY_DEATH) /datum/trade_destination/new_gibson name = "New Gibson" @@ -65,6 +89,7 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING) + viable_mundane_events = list(ELECTION, TOURISM, RESIGNATION) /datum/trade_destination/luthien name = "Luthien" @@ -73,6 +98,7 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(WILD_ANIMAL_ATTACK, CULT_CELL_REVEALED, FESTIVAL, MOURNING, ANIMAL_RIGHTS_RAID, ALIEN_RAIDERS) + viable_mundane_events = list(ELECTION, TOURISM, BIG_GAME_HUNTERS, RESIGNATION) /datum/trade_destination/reade name = "Reade" @@ -81,5 +107,4 @@ willing_to_buy = list() willing_to_sell = list() viable_random_events = list(WILD_ANIMAL_ATTACK, CULT_CELL_REVEALED, FESTIVAL, MOURNING, ANIMAL_RIGHTS_RAID, ALIEN_RAIDERS) - -var/list/tradeable_destinations = typesof(/datum/trade_destination) - /datum/trade_destination + viable_mundane_events = list(ELECTION, TOURISM, BIG_GAME_HUNTERS, RESIGNATION) diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Job_Departments.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Job_Departments.dm new file mode 100644 index 0000000000..64abe66acc --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/Economy/Job_Departments.dm @@ -0,0 +1,70 @@ +var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Civilian") + +// The department the job belongs to. +/datum/job/var/department = null + +// Whether this is a head position +/datum/job/var/head_position = 0 + +/datum/job/captain/department = "Command" +/datum/job/captain/head_position = 1 + +/datum/job/hop/department = "Civilian" +/datum/job/hop/head_position = 1 + +/datum/job/assistant/department = "Civilian" + +/datum/job/bartender/department = "Civilian" + +/datum/job/chef/department = "Civilian" + +/datum/job/hydro/department = "Civilian" + +/datum/job/mining/department = "Civilian" + +/datum/job/janitor/department = "Civilian" + +/datum/job/librarian/department = "Civilian" + +/datum/job/lawyer/department = "Civilian" + +/datum/job/chaplain/department = "Civilian" + +/datum/job/qm/department = "Cargo" +/datum/job/qm/head_position = 1 + +/datum/job/cargo_tech/department = "Cargo" + +/datum/job/chief_engineer/department = "Engineering" +/datum/job/chief_engineer/head_position = 1 + +/datum/job/engineer/department = "Engineering" + +/datum/job/atmos/department = "Engineering" + +/datum/job/cmo/department = "Medical" +/datum/job/cmo/head_position = 1 + +/datum/job/doctor/department = "Medical" + +/datum/job/chemist/department = "Medical" + +/datum/job/geneticist/department = "Medical" + +/datum/job/psychiatrist/department = "Medical" + +/datum/job/rd/department = "Science" +/datum/job/rd/head_position = 1 + +/datum/job/scientist/department = "Science" + +/datum/job/roboticist/department = "Science" + +/datum/job/hos/department = "Security" +/datum/job/hos/head_position = 1 + +/datum/job/warden/department = "Security" + +/datum/job/detective/department = "Security" + +/datum/job/officer/department = "Security" \ No newline at end of file diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/areas.dm b/code/WorkInProgress/Cael_Aislinn/Rust/areas.dm index a8822acb60..6183ed04f6 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/areas.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/areas.dm @@ -2,6 +2,8 @@ //reactor areas /area/engine + icon_state = "engine" + fore name = "\improper Fore" @@ -13,49 +15,63 @@ atmos_storage name = "\improper Atmos storage" + icon_state = "engine_storage" control name = "\improper Control" + icon_state = "engine_control" electrical_storage name = "\improper Electrical storage" + engine_monitoring + name = "\improper Electrical storage" + icon_state = "engine_monitoring" + reactor_core name = "\improper Reactor Core" - icon_state = "engine_core" + //icon_state = "engine_core" reactor_gas name = "Reactor Gas Storage" - icon_state = "engine_atmos" + //icon_state = "engine_atmos" aux_control name = "Reactor Auxiliary Control" - icon_state = "engine_aux" + //icon_state = "engine_aux" turbine_control name = "Turbine Control" - icon_state = "engine_turbine" + //icon_state = "engine_turbine" reactor_airlock name = "\improper Reactor Primary Entrance" - icon_state = "engine_airlock" + //icon_state = "engine_airlock" reactor_fuel_storage name = "Reactor Fuel Storage" - icon_state = "engine_fuel" + //icon_state = "engine_fuel" reactor_fuel_ports name = "\improper Reactor Fuel Ports" - icon_state = "engine_port" + //icon_state = "engine_port" generators name = "\improper Generator Room" - icon_state = "engine_generators" + //icon_state = "engine_generators" port_gyro_bay name = "\improper Port Gyrotron Bay" - icon_state = "engine_starboardgyro" + //icon_state = "engine_starboardgyro" starboard_gyro_bay name = "\improper Starboard Gyrotron Bay" - icon_state = "engine_portgyro" + //icon_state = "engine_portgyro" + + storage + name = "\improper Engineering hallway" + icon_state = "engine_storage" + + hallway + name = "\improper Engineering storage" + icon_state = "engine_hallway" diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/circuits_and_design.dm b/code/WorkInProgress/Cael_Aislinn/Rust/circuits_and_design.dm new file mode 100644 index 0000000000..f9c6259001 --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/Rust/circuits_and_design.dm @@ -0,0 +1,120 @@ + +////////////////////////////////////// +// RUST Core Control computer + +/obj/item/weapon/circuitboard/rust_core_control + name = "Circuit board (RUST core controller)" + build_path = "/obj/machinery/computer/rust_core_control" + origin_tech = "programming=4;engineering=4" + +datum/design/rust_core_control + name = "Circuit Design (RUST core controller)" + desc = "Allows for the construction of circuit boards used to build a core control console for the RUST fusion engine." + id = "rust_core_control" + req_tech = list("programming" = 4, "engineering" = 4) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20) + build_path = "/obj/item/weapon/circuitboard/rust_core_control" + +////////////////////////////////////// +// RUST Fuel Control computer + +/obj/item/weapon/circuitboard/rust_fuel_control + name = "Circuit board (RUST fuel controller)" + build_path = "/obj/machinery/computer/rust_fuel_control" + origin_tech = "programming=4;engineering=4" + +datum/design/rust_fuel_control + name = "Circuit Design (RUST fuel controller)" + desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine." + id = "rust_fuel_control" + req_tech = list("programming" = 4, "engineering" = 4) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20) + build_path = "/obj/item/weapon/circuitboard/rust_fuel_control" + +////////////////////////////////////// +// RUST Fuel Port board + +/obj/item/weapon/module/rust_fuel_port + name = "Internal circuitry (RUST fuel port)" + icon_state = "card_mod" + origin_tech = "engineering=4;materials=5" + +datum/design/rust_fuel_port + name = "Internal circuitry (RUST fuel port)" + desc = "Allows for the construction of circuit boards used to build a fuel injection port for the RUST fusion engine." + id = "rust_fuel_port" + req_tech = list("engineering" = 4, "materials" = 5) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20, "$uranium" = 3000) + build_path = "/obj/item/weapon/module/rust_fuel_port" + +////////////////////////////////////// +// RUST Fuel Compressor board + +/obj/item/weapon/module/rust_fuel_compressor + name = "Internal circuitry (RUST fuel compressor)" + icon_state = "card_mod" + origin_tech = "materials=6;plasmatech=4" + +datum/design/rust_fuel_compressor + name = "Circuit Design (RUST fuel compressor)" + desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine." + id = "rust_fuel_compressor" + req_tech = list("materials" = 6, "plasmatech" = 4) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 1000) + build_path = "/obj/item/weapon/module/rust_fuel_compressor" + +////////////////////////////////////// +// RUST Tokamak Core board + +/obj/item/weapon/circuitboard/rust_core + name = "Internal circuitry (RUST tokamak core)" + build_path = "/obj/machinery/power/rust_core" + board_type = "machine" + origin_tech = "bluespace=3;plasmatech=4;magnets=5;powerstorage=6" + frame_desc = "Requires 2 Pico Manipulators, 1 Ultra Micro-Laser, 5 Pieces of Cable, 1 Subspace Crystal and 1 Console Screen." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator/pico" = 2, + "/obj/item/weapon/stock_parts/micro_laser/ultra" = 1, + "/obj/item/weapon/stock_parts/subspace/crystal" = 1, + "/obj/item/weapon/stock_parts/console_screen" = 1, + "/obj/item/weapon/cable_coil" = 5) + +datum/design/rust_core + name = "Internal circuitry (RUST tokamak core)" + desc = "The circuit board that for a RUST-pattern tokamak fusion core." + id = "pacman" + req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, powerstorage = 6) + build_type = IMPRINTER + reliability_base = 79 + materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 2000) + build_path = "/obj/item/weapon/circuitboard/rust_core" + +////////////////////////////////////// +// RUST Fuel Injector board + +/obj/item/weapon/circuitboard/rust_injector + name = "Internal circuitry (RUST fuel injector)" + build_path = "/obj/machinery/power/rust_fuel_injector" + board_type = "machine" + origin_tech = "powerstorage=3;engineering=4;plasmatech=4;materials=6" + frame_desc = "Requires 2 Pico Manipulators, 1 Phasic Scanning Module, 1 Super Matter Bin, 1 Console Screen and 5 Pieces of Cable." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator/pico" = 2, + "/obj/item/weapon/stock_parts/scanning_module/phasic" = 1, + "/obj/item/weapon/stock_parts/matter_bin/super" = 1, + "/obj/item/weapon/stock_parts/console_screen" = 1, + "/obj/item/weapon/cable_coil" = 5) + +datum/design/rust_injector + name = "Internal circuitry (RUST tokamak core)" + desc = "The circuit board that for a RUST-pattern particle accelerator." + id = "pacman" + req_tech = list(powerstorage = 3, engineering = 4, plasmatech = 4, materials = 6) + build_type = IMPRINTER + reliability_base = 79 + materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$uranium" = 2000) + build_path = "/obj/item/weapon/circuitboard/rust_core" diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/core.dmi deleted file mode 100644 index 3fa8c9a369..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/core.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core_control.dm b/code/WorkInProgress/Cael_Aislinn/Rust/core_control.dm new file mode 100644 index 0000000000..f20f33a7ac --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/Rust/core_control.dm @@ -0,0 +1,143 @@ + +/obj/machinery/computer/rust_core_control + name = "RUST Core Control" + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "core_control" + var/list/connected_devices = list() + var/id_tag = "allan remember to update this before you leave" + var/scan_range = 25 + + //currently viewed + var/obj/machinery/power/rust_core/cur_viewed_device + +/obj/machinery/computer/rust_core_control/process() + if(stat & (BROKEN|NOPOWER)) + return + +/obj/machinery/computer/rust_core_control/attack_ai(mob/user) + attack_hand(user) + +/obj/machinery/computer/rust_core_control/attack_hand(mob/user) + add_fingerprint(user) + interact(user) + +/obj/machinery/computer/rust_core_control/interact(mob/user) + if(stat & BROKEN) + user.unset_machine() + user << browse(null, "window=core_control") + return + if (!istype(user, /mob/living/silicon) && (get_dist(src, user) > 1 )) + user.unset_machine() + user << browse(null, "window=core_control") + return + + var/dat = "" + if(stat & NOPOWER) + dat += "The console is dark and nonresponsive." + else + dat += "Reactor Core Primary Monitor
" + if(cur_viewed_device && cur_viewed_device.stat & (BROKEN|NOPOWER)) + cur_viewed_device = null + if(cur_viewed_device && !cur_viewed_device.remote_access_enabled) + cur_viewed_device = null + + if(cur_viewed_device) + dat += "Device tag: [cur_viewed_device.id_tag ? cur_viewed_device.id_tag : "UNSET"]
" + dat += "Device [cur_viewed_device.owned_field ? "activated" : "deactivated"].
" + dat += "\[Bring field [cur_viewed_device.owned_field ? "offline" : "online"]\]
" + dat += "Device [cur_viewed_device.anchored ? "secured" : "unsecured"].
" + dat += "
" + dat += "Field encumbrance: [cur_viewed_device.owned_field ? 0 : "NA"]
" + dat += "Field strength: [cur_viewed_device.field_strength] Wm^3
" + dat += "\[----\] \ + \[--- \] \ + \[-- \] \ + \[- \] \ + \[+ \] \ + \[++ \] \ + \[+++ \] \ + \[++++\]
" + dat += "Field frequency: [cur_viewed_device.field_frequency] MHz
" + dat += "\[----\] \ + \[--- \] \ + \[-- \] \ + \[- \] \ + \[+ \] \ + \[++ \] \ + \[+++ \] \ + \[++++\]
" + + var/power_stat = "Good" + if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage) + power_stat = "Insufficient" + else if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage * 2) + power_stat = "Check" + dat += "Power status: [power_stat]
" + else + dat += "\[Refresh device list\]

" + if(connected_devices.len) + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + for(var/obj/machinery/power/rust_core/C in connected_devices) + if(!check_core_status(C)) + connected_devices.Remove(C) + continue + + dat += "" + dat += "" + dat += "" + dat += "" + dat += "
Device tag
[C.id_tag]\[Manage\]
" + else + dat += "No devices connected.
" + + dat += "
" + dat += "Refresh " + dat += "Close" + + user << browse(dat, "window=core_control;size=500x400") + onclose(user, "core_control") + user.set_machine(src) + +/obj/machinery/computer/rust_core_control/Topic(href, href_list) + ..() + + if( href_list["goto_scanlist"] ) + cur_viewed_device = null + + if( href_list["manage_individual"] ) + cur_viewed_device = locate(href_list["manage_individual"]) + + if( href_list["scan"] ) + connected_devices = list() + for(var/obj/machinery/power/rust_core/C in range(scan_range, src)) + if(check_core_status(C)) + connected_devices.Add(C) + + if( href_list["startup"] ) + if(cur_viewed_device) + cur_viewed_device.Startup() + + if( href_list["shutdown"] ) + if(cur_viewed_device) + cur_viewed_device.Shutdown() + + if( href_list["close"] ) + usr << browse(null, "window=core_control") + usr.unset_machine() + + updateDialog() + +/obj/machinery/computer/rust_core_control/proc/check_core_status(var/obj/machinery/power/rust_core/C) + if(!C) + return 0 + + if(C.stat & (BROKEN|NOPOWER) || !C.remote_access_enabled || !C.id_tag) + if(connected_devices.Find(C)) + connected_devices.Remove(C) + return 0 + + return 1 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm b/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm index ec887bc1cc..666d6cb355 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm @@ -6,23 +6,21 @@ Deuterium-tritium fusion: 4.5 x 10^7 K //#DEFINE MAX_STORED_ENERGY (held_plasma.toxins * held_plasma.toxins * SPECIFIC_HEAT_TOXIN) -/obj/machinery/rust/em_field +/obj/effect/rust_em_field name = "EM Field" desc = "A coruscating, barely visible field of energy. It is shaped like a slightly flattened torus." - icon = 'emfield.dmi' + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' icon_state = "emfield_s1" - density = 0 - layer = 3.1 - anchored = 1 // var/major_radius = 0 //longer radius in meters = field_strength * 0.21875, max = 8.75 var/minor_radius = 0 //shorter radius in meters = field_strength * 0.2125, max = 8.625 var/size = 1 //diameter in tiles var/volume_covered = 0 //atmospheric volume covered // - var/obj/machinery/rust/core/owned_core + var/obj/machinery/power/rust_core/owned_core var/list/dormant_reactant_quantities = new - luminosity = 1 + //luminosity = 1 + layer = 3.1 // var/energy = 0 var/mega_energy = 0 @@ -34,420 +32,412 @@ Deuterium-tritium fusion: 4.5 x 10^7 K var/datum/gas_mixture/held_plasma = new var/particle_catchers[13] - New() - ..() - //create radiator - for(var/obj/machinery/rust/rad_source/rad in range(0)) - radiator = rad - if(!radiator) - radiator = new() + var/emp_overload = 0 - //make sure there's a field generator - for(var/obj/machinery/rust/core/em_core in loc) - owned_core = em_core +/obj/effect/rust_em_field/New() + ..() + //create radiator + for(var/obj/machinery/rust/rad_source/rad in range(0)) + radiator = rad + if(!radiator) + radiator = new() - if(!owned_core) - del(src) - if(!owned_core.on) - del(src) + //make sure there's a field generator + for(var/obj/machinery/power/rust_core/core in loc) + owned_core = core - //create the gimmicky things to handle field collisions - var/obj/machinery/rust/particle_catcher/catcher + if(!owned_core) + del(src) + + //create the gimmicky things to handle field collisions + var/obj/effect/rust_particle_catcher/catcher + // + catcher = new (locate(src.x,src.y,src.z)) + catcher.parent = src + catcher.SetSize(1) + particle_catchers.Add(catcher) + // + catcher = new (locate(src.x-1,src.y,src.z)) + catcher.parent = src + catcher.SetSize(3) + particle_catchers.Add(catcher) + catcher = new (locate(src.x+1,src.y,src.z)) + catcher.parent = src + catcher.SetSize(3) + particle_catchers.Add(catcher) + catcher = new (locate(src.x,src.y+1,src.z)) + catcher.parent = src + catcher.SetSize(3) + particle_catchers.Add(catcher) + catcher = new (locate(src.x,src.y-1,src.z)) + catcher.parent = src + catcher.SetSize(3) + particle_catchers.Add(catcher) + // + catcher = new (locate(src.x-2,src.y,src.z)) + catcher.parent = src + catcher.SetSize(5) + particle_catchers.Add(catcher) + catcher = new (locate(src.x+2,src.y,src.z)) + catcher.parent = src + catcher.SetSize(5) + particle_catchers.Add(catcher) + catcher = new (locate(src.x,src.y+2,src.z)) + catcher.parent = src + catcher.SetSize(5) + particle_catchers.Add(catcher) + catcher = new (locate(src.x,src.y-2,src.z)) + catcher.parent = src + catcher.SetSize(5) + particle_catchers.Add(catcher) + // + catcher = new (locate(src.x-3,src.y,src.z)) + catcher.parent = src + catcher.SetSize(7) + particle_catchers.Add(catcher) + catcher = new (locate(src.x+3,src.y,src.z)) + catcher.parent = src + catcher.SetSize(7) + particle_catchers.Add(catcher) + catcher = new (locate(src.x,src.y+3,src.z)) + catcher.parent = src + catcher.SetSize(7) + particle_catchers.Add(catcher) + catcher = new (locate(src.x,src.y-3,src.z)) + catcher.parent = src + catcher.SetSize(7) + particle_catchers.Add(catcher) + + //init values + major_radius = field_strength * 0.21875// max = 8.75 + minor_radius = field_strength * 0.2125// max = 8.625 + volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 1000 + + processing_objects.Add(src) + +/obj/effect/rust_em_field/process() + //make sure the field generator is still intact + if(!owned_core) + del(src) + + //handle radiation + if(!radiator) + radiator = new /obj/machinery/rust/rad_source() + radiator.mega_energy += radiation + radiator.source_alive++ + radiation = 0 + + //update values + var/transfer_ratio = field_strength / 50 //higher field strength will result in faster plasma aggregation + major_radius = field_strength * 0.21875// max = 8.75m + minor_radius = field_strength * 0.2125// max = 8.625m + volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio //one tile = 2.5m*2.5m*2.5m + + //add plasma from the surrounding environment + var/datum/gas_mixture/environment = loc.return_air() + + //hack in some stuff to remove plasma from the air because SCIENCE + //the amount of plasma pulled in each update is relative to the field strength, with 50T (max field strength) = 100% of area covered by the field + //at minimum strength, 0.25% of the field volume is pulled in per update (?) + //have a max of 1000 moles suspended + if(held_plasma.toxins < transfer_ratio * 1000) + var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION) + //world << "\blue moles_covered: [moles_covered]" // - catcher = new (locate(src.x,src.y,src.z)) - catcher.parent = src - catcher.SetSize(1) - particle_catchers.Add(catcher) + var/datum/gas_mixture/gas_covered = environment.remove(moles_covered) + var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture() // - catcher = new (locate(src.x-1,src.y,src.z)) - catcher.parent = src - catcher.SetSize(3) - particle_catchers.Add(catcher) - catcher = new (locate(src.x+1,src.y,src.z)) - catcher.parent = src - catcher.SetSize(3) - particle_catchers.Add(catcher) - catcher = new (locate(src.x,src.y+1,src.z)) - catcher.parent = src - catcher.SetSize(3) - particle_catchers.Add(catcher) - catcher = new (locate(src.x,src.y-1,src.z)) - catcher.parent = src - catcher.SetSize(3) - particle_catchers.Add(catcher) + plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio) + //world << "\blue[plasma_captured.toxins] moles of plasma captured" + plasma_captured.temperature = gas_covered.temperature + plasma_captured.update_values() // - catcher = new (locate(src.x-2,src.y,src.z)) - catcher.parent = src - catcher.SetSize(5) - particle_catchers.Add(catcher) - catcher = new (locate(src.x+2,src.y,src.z)) - catcher.parent = src - catcher.SetSize(5) - particle_catchers.Add(catcher) - catcher = new (locate(src.x,src.y+2,src.z)) - catcher.parent = src - catcher.SetSize(5) - particle_catchers.Add(catcher) - catcher = new (locate(src.x,src.y-2,src.z)) - catcher.parent = src - catcher.SetSize(5) - particle_catchers.Add(catcher) + gas_covered.toxins -= plasma_captured.toxins + gas_covered.update_values() // - catcher = new (locate(src.x-3,src.y,src.z)) - catcher.parent = src - catcher.SetSize(7) - particle_catchers.Add(catcher) - catcher = new (locate(src.x+3,src.y,src.z)) - catcher.parent = src - catcher.SetSize(7) - particle_catchers.Add(catcher) - catcher = new (locate(src.x,src.y+3,src.z)) - catcher.parent = src - catcher.SetSize(7) - particle_catchers.Add(catcher) - catcher = new (locate(src.x,src.y-3,src.z)) - catcher.parent = src - catcher.SetSize(7) - particle_catchers.Add(catcher) - - //init values - major_radius = field_strength * 0.21875// max = 8.75 - minor_radius = field_strength * 0.2125// max = 8.625 - volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 1000 - - process() - //make sure the field generator is still intact - if(!owned_core) - del(src) - if(!owned_core.on) - del(src) - - //handle radiation - if(!radiator) - radiator = new /obj/machinery/rust/rad_source() - radiator.mega_energy += radiation - radiator.source_alive++ - radiation = 0 - - //update values - var/transfer_ratio = field_strength / 50 //higher field strength will result in faster plasma aggregation - major_radius = field_strength * 0.21875// max = 8.75m - minor_radius = field_strength * 0.2125// max = 8.625m - volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio //one tile = 2.5m*2.5m*2.5m - - //add plasma from the surrounding environment - var/datum/gas_mixture/environment = loc.return_air() - - //hack in some stuff to remove plasma from the air because SCIENCE - //the amount of plasma pulled in each update is relative to the field strength, with 50T (max field strength) = 100% of area covered by the field - //at minimum strength, 0.25% of the field volume is pulled in per update (?) - //have a max of 1000 moles suspended - if(held_plasma.toxins < transfer_ratio * 1000) - var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION) - //world << "\blue moles_covered: [moles_covered]" - // - var/datum/gas_mixture/gas_covered = environment.remove(moles_covered) - var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture() - // - plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio) - //world << "\blue[plasma_captured.toxins] moles of plasma captured" - plasma_captured.temperature = gas_covered.temperature - plasma_captured.update_values() - // - gas_covered.toxins -= plasma_captured.toxins - gas_covered.update_values() - // - held_plasma.merge(plasma_captured) - // - environment.merge(gas_covered) - - //let the particles inside the field react - React() - - //forcibly radiate any excess energy - var/energy_max = transfer_ratio * 100000 - if(mega_energy > energy_max) - var/energy_lost = rand( 1.5 * (mega_energy - energy_max), 2.5 * (mega_energy - energy_max) ) - mega_energy -= energy_lost - radiation += energy_lost - - //change held plasma temp according to energy levels - //SPECIFIC_HEAT_TOXIN - if(mega_energy > 0 && held_plasma.toxins) - var/heat_capacity = held_plasma.heat_capacity()//200 * number of plasma moles - if(heat_capacity > 0.0003) //formerly MINIMUM_HEAT_CAPACITY - held_plasma.temperature = (heat_capacity + mega_energy * 35000)/heat_capacity - - //if there is too much plasma in the field, lose some - /*if( held_plasma.toxins > (MOLES_CELLSTANDARD * 7) * (50 / field_strength) ) - LosePlasma()*/ - if(held_plasma.toxins > 1) - //lose a random amount of plasma back into the air, increased by the field strength (want to switch this over to frequency eventually) - var/loss_ratio = rand() * (0.05 + (0.05 * 50 / field_strength)) - //world << "lost [loss_ratio*100]% of held plasma" - // - var/datum/gas_mixture/plasma_lost = new - plasma_lost.temperature = held_plasma.temperature - // - plasma_lost.toxins = held_plasma.toxins * loss_ratio - //plasma_lost.update_values() - held_plasma.toxins -= held_plasma.toxins * loss_ratio - //held_plasma.update_values() - // - environment.merge(plasma_lost) - radiation += loss_ratio * mega_energy * 0.1 - mega_energy -= loss_ratio * mega_energy * 0.1 - else - held_plasma.toxins = 0 - //held_plasma.update_values() - - //handle some reactants formatting - //helium-4 has no use at the moment, but a buttload of it is produced - if(dormant_reactant_quantities["Helium-4"] > 1000) - dormant_reactant_quantities["Helium-4"] = rand(0,dormant_reactant_quantities["Helium-4"]) - for(var/reactant in dormant_reactant_quantities) - if(!dormant_reactant_quantities[reactant]) - dormant_reactant_quantities.Remove(reactant) - - return 1 - - Del() - ..() - //radiate everything in one giant burst - for(var/obj/machinery/rust/particle_catcher/catcher in particle_catchers) - del (catcher) - RadiateAll() - - proc/ChangeFieldStrength(var/new_strength) - field_strength = new_strength - var/newsize - if(new_strength <= 5) - newsize = 1 - else if(new_strength <= 12) - newsize = 3 - else if(new_strength <= 25) - newsize = 5 - else if(new_strength <= 50) - newsize = 7 + held_plasma.merge(plasma_captured) // - change_size(newsize) + environment.merge(gas_covered) - proc/AddEnergy(var/a_energy, var/a_mega_energy, var/a_frequency) - var/energy_loss_ratio = abs(a_frequency - src.frequency) / 1e9 - energy += a_energy - a_energy * a_frequency - mega_energy += a_mega_energy - a_mega_energy * energy_loss_ratio + //let the particles inside the field react + React() - proc/AddParticles(var/name, var/quantity = 1) - if(name in dormant_reactant_quantities) - dormant_reactant_quantities[name] += quantity - else if(name != "proton" && name != "electron" && name != "neutron") - dormant_reactant_quantities.Add(name) - dormant_reactant_quantities[name] = quantity + //forcibly radiate any excess energy + var/energy_max = transfer_ratio * 100000 + if(mega_energy > energy_max) + var/energy_lost = rand( 1.5 * (mega_energy - energy_max), 2.5 * (mega_energy - energy_max) ) + mega_energy -= energy_lost + radiation += energy_lost - proc/RadiateAll(var/ratio_lost = 1) - for(var/particle in dormant_reactant_quantities) - radiation += dormant_reactant_quantities[particle] - dormant_reactant_quantities.Remove(particle) - radiation += mega_energy - mega_energy = 0 + //change held plasma temp according to energy levels + //SPECIFIC_HEAT_TOXIN + if(mega_energy > 0 && held_plasma.toxins) + var/heat_capacity = held_plasma.heat_capacity()//200 * number of plasma moles + if(heat_capacity > 0.0003) //formerly MINIMUM_HEAT_CAPACITY + held_plasma.temperature = (heat_capacity + mega_energy * 35000)/heat_capacity - //lose all held plasma back into the air - var/datum/gas_mixture/environment = loc.return_air() - environment.merge(held_plasma) - - proc/change_size(var/newsize = 1) + //if there is too much plasma in the field, lose some + /*if( held_plasma.toxins > (MOLES_CELLSTANDARD * 7) * (50 / field_strength) ) + LosePlasma()*/ + if(held_plasma.toxins > 1) + //lose a random amount of plasma back into the air, increased by the field strength (want to switch this over to frequency eventually) + var/loss_ratio = rand() * (0.05 + (0.05 * 50 / field_strength)) + //world << "lost [loss_ratio*100]% of held plasma" // - var/changed = 0 - switch(newsize) - if(1) - size = 1 - icon = 'emfield.dmi' - icon_state = "emfield_s1" - // - src.loc = get_turf(owned_core) - // - changed = 1 - if(3) - size = 3 - icon = '96x96.dmi' - icon_state = "emfield_s3" - // - var/turf/newloc = get_turf(owned_core) - newloc = get_step(newloc, SOUTHWEST) - src.loc = newloc - // - changed = 3 - if(5) - size = 5 - icon = '160x160.dmi' - icon_state = "emfield_s5" - // - var/turf/newloc = get_turf(owned_core) - newloc = get_step(newloc, SOUTHWEST) - newloc = get_step(newloc, SOUTHWEST) - src.loc = newloc - // - changed = 5 - if(7) - size = 7 - icon = '224x224.dmi' - icon_state = "emfield_s7" - // - var/turf/newloc = get_turf(owned_core) - newloc = get_step(newloc, SOUTHWEST) - newloc = get_step(newloc, SOUTHWEST) - newloc = get_step(newloc, SOUTHWEST) - src.loc = newloc - // - changed = 7 + var/datum/gas_mixture/plasma_lost = new + plasma_lost.temperature = held_plasma.temperature + // + plasma_lost.toxins = held_plasma.toxins * loss_ratio + //plasma_lost.update_values() + held_plasma.toxins -= held_plasma.toxins * loss_ratio + //held_plasma.update_values() + // + environment.merge(plasma_lost) + radiation += loss_ratio * mega_energy * 0.1 + mega_energy -= loss_ratio * mega_energy * 0.1 + else + held_plasma.toxins = 0 + //held_plasma.update_values() - for(var/obj/machinery/rust/particle_catcher/catcher in particle_catchers) - catcher.UpdateSize() - return changed + //handle some reactants formatting + //helium-4 has no use at the moment, but a buttload of it is produced + if(dormant_reactant_quantities["Helium-4"] > 1000) + dormant_reactant_quantities["Helium-4"] = rand(0,dormant_reactant_quantities["Helium-4"]) + for(var/reactant in dormant_reactant_quantities) + if(!dormant_reactant_quantities[reactant]) + dormant_reactant_quantities.Remove(reactant) - //the !!fun!! part - //reactions have to be individually hardcoded, see AttemptReaction() below this - proc/React() - //world << "React()" - //loop through the reactants in random order - var/list/reactants_reacting_pool = dormant_reactant_quantities.Copy() - /* - for(var/reagent in dormant_reactant_quantities) - world << " before: [reagent]: [dormant_reactant_quantities[reagent]]" - */ + return 1 - //cant have any reactions if there aren't any reactants present - if(reactants_reacting_pool.len) - //determine a random amount to actually react this cycle, and remove it from the standard pool - //this is a hack, and quite nonrealistic :( - for(var/reactant in reactants_reacting_pool) - reactants_reacting_pool[reactant] = rand(0,reactants_reacting_pool[reactant]) - dormant_reactant_quantities[reactant] -= reactants_reacting_pool[reactant] - if(!reactants_reacting_pool[reactant]) - reactants_reacting_pool -= reactant +/obj/effect/rust_em_field/proc/ChangeFieldStrength(var/new_strength) + var/calc_size = 1 + emp_overload = 0 + if(new_strength <= 50) + calc_size = 1 + else if(new_strength <= 200) + calc_size = 3 + else if(new_strength <= 500) + calc_size = 5 + else + calc_size = 7 + if(new_strength > 900) + emp_overload = 1 + // + field_strength = new_strength + change_size(calc_size) - var/list/produced_reactants = new/list - //loop through all the reacting reagents, picking out random reactions for them - var/list/primary_reactant_pool = reactants_reacting_pool.Copy() - while(primary_reactant_pool.len) - //pick one of the unprocessed reacting reagents randomly - var/cur_primary_reactant = pick(primary_reactant_pool) - primary_reactant_pool.Remove(cur_primary_reactant) - //world << "\blue primary reactant chosen: [cur_primary_reactant]" +/obj/effect/rust_em_field/proc/ChangeFieldFrequency(var/new_frequency) + frequency = new_frequency - //grab all the possible reactants to have a reaction with - var/list/possible_secondary_reactants = reactants_reacting_pool.Copy() - //if there is only one of a particular reactant, then it can not react with itself so remove it - possible_secondary_reactants[cur_primary_reactant] -= 1 - if(possible_secondary_reactants[cur_primary_reactant] < 1) - possible_secondary_reactants.Remove(cur_primary_reactant) - var/list/possible_reactions = new/list +/obj/effect/rust_em_field/proc/AddEnergy(var/a_energy, var/a_mega_energy, var/a_frequency) + var/energy_loss_ratio = 0 + if(a_frequency != src.frequency) + energy_loss_ratio = 1 / abs(a_frequency - src.frequency) + energy += a_energy - a_energy * energy_loss_ratio + mega_energy += a_mega_energy - a_mega_energy * energy_loss_ratio - //loop through and work out all the possible reactions - while(possible_secondary_reactants.len) - var/cur_secondary_reactant = pick(possible_secondary_reactants) - if(possible_secondary_reactants[cur_secondary_reactant] < 1) - possible_secondary_reactants.Remove(cur_secondary_reactant) - continue +/obj/effect/rust_em_field/proc/AddParticles(var/name, var/quantity = 1) + if(name in dormant_reactant_quantities) + dormant_reactant_quantities[name] += quantity + else if(name != "proton" && name != "electron" && name != "neutron") + dormant_reactant_quantities.Add(name) + dormant_reactant_quantities[name] = quantity + +/obj/effect/rust_em_field/proc/RadiateAll(var/ratio_lost = 1) + for(var/particle in dormant_reactant_quantities) + radiation += dormant_reactant_quantities[particle] + dormant_reactant_quantities.Remove(particle) + radiation += mega_energy + mega_energy = 0 + + //lose all held plasma back into the air + var/datum/gas_mixture/environment = loc.return_air() + environment.merge(held_plasma) + +/obj/effect/rust_em_field/proc/change_size(var/newsize = 1) + // + var/changed = 0 + switch(newsize) + if(1) + size = 1 + icon = 'rust.dmi' + icon_state = "emfield_s1" + pixel_x = 0 + pixel_y = 0 + // + changed = 1 + if(3) + size = 3 + icon = '96x96.dmi' + icon_state = "emfield_s3" + pixel_x = -32 + pixel_y = -32 + // + changed = 3 + if(5) + size = 5 + icon = '160x160.dmi' + icon_state = "emfield_s5" + pixel_x = -64 + pixel_y = -64 + // + changed = 5 + if(7) + size = 7 + icon = '224x224.dmi' + icon_state = "emfield_s7" + pixel_x = -96 + pixel_y = -96 + // + changed = 7 + + for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers) + catcher.UpdateSize() + return changed + +//the !!fun!! part +//reactions have to be individually hardcoded, see AttemptReaction() below this +/obj/effect/rust_em_field/proc/React() + //world << "React()" + //loop through the reactants in random order + var/list/reactants_reacting_pool = dormant_reactant_quantities.Copy() + /* + for(var/reagent in dormant_reactant_quantities) + world << " before: [reagent]: [dormant_reactant_quantities[reagent]]" + */ + + //cant have any reactions if there aren't any reactants present + if(reactants_reacting_pool.len) + //determine a random amount to actually react this cycle, and remove it from the standard pool + //this is a hack, and quite nonrealistic :( + for(var/reactant in reactants_reacting_pool) + reactants_reacting_pool[reactant] = rand(0,reactants_reacting_pool[reactant]) + dormant_reactant_quantities[reactant] -= reactants_reacting_pool[reactant] + if(!reactants_reacting_pool[reactant]) + reactants_reacting_pool -= reactant + + var/list/produced_reactants = new/list + //loop through all the reacting reagents, picking out random reactions for them + var/list/primary_reactant_pool = reactants_reacting_pool.Copy() + while(primary_reactant_pool.len) + //pick one of the unprocessed reacting reagents randomly + var/cur_primary_reactant = pick(primary_reactant_pool) + primary_reactant_pool.Remove(cur_primary_reactant) + //world << "\blue primary reactant chosen: [cur_primary_reactant]" + + //grab all the possible reactants to have a reaction with + var/list/possible_secondary_reactants = reactants_reacting_pool.Copy() + //if there is only one of a particular reactant, then it can not react with itself so remove it + possible_secondary_reactants[cur_primary_reactant] -= 1 + if(possible_secondary_reactants[cur_primary_reactant] < 1) + possible_secondary_reactants.Remove(cur_primary_reactant) + var/list/possible_reactions = new/list + + //loop through and work out all the possible reactions + while(possible_secondary_reactants.len) + var/cur_secondary_reactant = pick(possible_secondary_reactants) + if(possible_secondary_reactants[cur_secondary_reactant] < 1) possible_secondary_reactants.Remove(cur_secondary_reactant) - var/list/reaction_products = AttemptReaction(cur_primary_reactant, cur_secondary_reactant) - if(reaction_products.len) - //world << "\blue secondary reactant: [cur_secondary_reactant], [reaction_products.len]" - possible_reactions[cur_secondary_reactant] = reaction_products - //if there are no possible reactions here, abandon this primary reactant and move on - if(!possible_reactions.len) - //world << "\blue no reactions" continue + possible_secondary_reactants.Remove(cur_secondary_reactant) + var/list/reaction_products = AttemptReaction(cur_primary_reactant, cur_secondary_reactant) + if(reaction_products.len) + //world << "\blue secondary reactant: [cur_secondary_reactant], [reaction_products.len]" + possible_reactions[cur_secondary_reactant] = reaction_products + //if there are no possible reactions here, abandon this primary reactant and move on + if(!possible_reactions.len) + //world << "\blue no reactions" + continue - //split up the reacting atoms between the possible reactions - //the problem is in this while statement below - while(possible_reactions.len) - //pick another substance to react with - var/cur_secondary_reactant = pick(possible_reactions) - if(!reactants_reacting_pool[cur_secondary_reactant]) - possible_reactions.Remove(cur_secondary_reactant) - continue - var/list/cur_reaction_products = possible_reactions[cur_secondary_reactant] - - //set the randmax to be the lower of the two involved reactants - var/max_num_reactants = reactants_reacting_pool[cur_primary_reactant] > reactants_reacting_pool[cur_secondary_reactant] ? reactants_reacting_pool[cur_secondary_reactant] : reactants_reacting_pool[cur_primary_reactant] - - //make sure we have enough energy - if( mega_energy < max_num_reactants*cur_reaction_products["consumption"]) - max_num_reactants = round(mega_energy / cur_reaction_products["consumption"]) - - //randomly determined amount to react - var/amount_reacting = rand(1, max_num_reactants) - - //removing the reacting substances from the list of substances that are primed to react this cycle - //if there aren't enough of that substance (there should be) then modify the reactant amounts accordingly - if( reactants_reacting_pool[cur_primary_reactant] - amount_reacting > -1 ) - reactants_reacting_pool[cur_primary_reactant] -= amount_reacting - else - amount_reacting = reactants_reacting_pool[cur_primary_reactant] - reactants_reacting_pool[cur_primary_reactant] = 0 - // - if( reactants_reacting_pool[cur_secondary_reactant] - amount_reacting > -1 ) - reactants_reacting_pool[cur_secondary_reactant] -= amount_reacting - else - reactants_reacting_pool[cur_primary_reactant] += amount_reacting - reactants_reacting_pool[cur_primary_reactant] - amount_reacting = reactants_reacting_pool[cur_secondary_reactant] - reactants_reacting_pool[cur_secondary_reactant] = 0 - - //remove the consumed energy - if(cur_reaction_products["consumption"]) - mega_energy -= max_num_reactants * cur_reaction_products["consumption"] - cur_reaction_products.Remove("consumption") - - //grab any radiation and put it separate - //var/new_radiation = 0 - if("production" in cur_reaction_products) - mega_energy += max_num_reactants * cur_reaction_products["production"] - cur_reaction_products.Remove("production") - /*for(var/i=0, i reactants_reacting_pool[cur_secondary_reactant] ? reactants_reacting_pool[cur_secondary_reactant] : reactants_reacting_pool[cur_primary_reactant] - //loop through the newly produced reactants and add them to the pool - //var/list/neutronic_radiation = new - //var/list/protonic_radiation = new - for(var/reactant in produced_reactants) - AddParticles(reactant, dormant_reactant_quantities[reactant]) - //world << "produced: [reactant], [dormant_reactant_quantities[reactant]]" + //make sure we have enough energy + if( mega_energy < max_num_reactants*cur_reaction_products["consumption"]) + max_num_reactants = round(mega_energy / cur_reaction_products["consumption"]) - //check whether there are reactants left, and add them back to the pool - for(var/reactant in reactants_reacting_pool) - AddParticles(reactant, reactants_reacting_pool[reactant]) - //world << "retained: [reactant], [reactants_reacting_pool[reactant]]" + //randomly determined amount to react + var/amount_reacting = rand(1, max_num_reactants) + + //removing the reacting substances from the list of substances that are primed to react this cycle + //if there aren't enough of that substance (there should be) then modify the reactant amounts accordingly + if( reactants_reacting_pool[cur_primary_reactant] - amount_reacting > -1 ) + reactants_reacting_pool[cur_primary_reactant] -= amount_reacting + else + amount_reacting = reactants_reacting_pool[cur_primary_reactant] + reactants_reacting_pool[cur_primary_reactant] = 0 + // + if( reactants_reacting_pool[cur_secondary_reactant] - amount_reacting > -1 ) + reactants_reacting_pool[cur_secondary_reactant] -= amount_reacting + else + reactants_reacting_pool[cur_primary_reactant] += amount_reacting - reactants_reacting_pool[cur_primary_reactant] + amount_reacting = reactants_reacting_pool[cur_secondary_reactant] + reactants_reacting_pool[cur_secondary_reactant] = 0 + + //remove the consumed energy + if(cur_reaction_products["consumption"]) + mega_energy -= max_num_reactants * cur_reaction_products["consumption"] + cur_reaction_products.Remove("consumption") + + //grab any radiation and put it separate + //var/new_radiation = 0 + if("production" in cur_reaction_products) + mega_energy += max_num_reactants * cur_reaction_products["production"] + cur_reaction_products.Remove("production") + /*for(var/i=0, i 0.1) +/obj/effect/rust_em_field/proc/AttemptReaction(var/reactant_one, var/reactant_two) + //any charge on the atomic reactants / protons produced is abstracted away to enter the core energy pool straightaway + //atomic products remain in the core and produce more reactions next cycle + //any charged neutrons escape as radiation + var/check = 1 + recheck_reactions: + var/list/products = new/list + switch(reactant_one) + if("Tritium") + switch(reactant_two) + if("Tritium") + if(mega_energy > 0.1) + products["Helium-4"] = 1 + // + products["production"] = 11.3 + products["radiation"] = 1 + /*products["photon"] = 11.3 + // + products["neutron_quantity"] = 1 + products["neutron_charge"] = 0*/ + // + mega_energy -= 0.1 + if("Deuterium") + if(mega_energy > 0.1) + products["Helium-4"] = 1 + // + products["production"] = 3.5 + products["radiation"] = 14.1 + /*products["photon"] = 3.5 + // + products["neutron_quantity"] = 1 + products["neutron_charge"] = 14.1 + // + products["consumption"] = 0.1*/ + if("Helium-3") + if(mega_energy > 0.4) + if(prob(51)) products["Helium-4"] = 1 // - products["production"] = 11.3 + products["production"] = 13.1 products["radiation"] = 1 - /*products["photon"] = 11.3 + /*products["photon"] = 12.1 + // + products["proton_quantity"] = 1 + products["proton_charge"] = 0 // products["neutron_quantity"] = 1 products["neutron_charge"] = 0*/ - // - mega_energy -= 0.1 - if("Deuterium") - if(mega_energy > 0.1) + else if (prob(43)) products["Helium-4"] = 1 + products["Deuterium"] = 1 // - products["production"] = 3.5 - products["radiation"] = 14.1 - /*products["photon"] = 3.5 + products["production"] = 14.3 + /*products["photon"] = 4.8 + 9.5//14.3 + */ + else + products["Helium-4"] = 1 + products["production"] = 2.4 + products["radiation"] = 11.9 + /*products["photon"] = 0.5//12.4 + // + products["proton_quantity"] = 1 + products["proton_charge"] = 1.9 // products["neutron_quantity"] = 1 - products["neutron_charge"] = 14.1 + products["neutron_charge"] = 11.9*/ + // + products["consumption"] = 0.4 + if("Deuterium") + switch(reactant_two) + if("Deuterium") + if(mega_energy > 0.1) + if(prob(50)) + products["Tritium"] = 1 // - products["consumption"] = 0.1*/ - if("Helium-3") - if(mega_energy > 0.4) - if(prob(51)) - products["Helium-4"] = 1 - // - products["production"] = 13.1 - products["radiation"] = 1 - /*products["photon"] = 12.1 - // - products["proton_quantity"] = 1 - products["proton_charge"] = 0 - // - products["neutron_quantity"] = 1 - products["neutron_charge"] = 0*/ - else if (prob(43)) - products["Helium-4"] = 1 - products["Deuterium"] = 1 - // - products["production"] = 14.3 - /*products["photon"] = 4.8 + 9.5//14.3 - */ - else - products["Helium-4"] = 1 - products["production"] = 2.4 - products["radiation"] = 11.9 - /*products["photon"] = 0.5//12.4 - // - products["proton_quantity"] = 1 - products["proton_charge"] = 1.9 - // - products["neutron_quantity"] = 1 - products["neutron_charge"] = 11.9*/ - // - products["consumption"] = 0.4 - if("Deuterium") - switch(reactant_two) - if("Deuterium") - if(mega_energy > 0.1) - if(prob(50)) - products["Tritium"] = 1 - // - products["production"] = 4.03 - /*products["photon"] = 1.01 - // - products["proton_quantity"] = 1 - products["proton_charge"] = 3.02*/ - else - products["Helium-3"] = 1 - // - products["production"] = 0.82 - products["radiation"] = 2.45 - /*products["photon"] = 0.82 - // - products["neutron_quantity"] = 1 - products["neutron_charge"] = 2.45*/ - // - products["consumption"] = 0.1 - if("Helium-3") - if(mega_energy > 0.4) - products["Helium-4"] = 1 - // - products["production"] = 18.3 - /*products["photon"] = 3.6 + products["production"] = 4.03 + /*products["photon"] = 1.01 // products["proton_quantity"] = 1 - products["proton_charge"] = 14.7*/ - // - products["consumption"] = 0.4 - if("Lithium-6") - if(mega_energy > 0.6) - if(prob(25)) - products["Helium-4"] = 2 - products["production"] = 1 - /*products["photon"] = 22.4*/ - else if(prob(33)) - products["Helium-3"] = 1 - products["Helium-4"] = 1 - // - products["radiation"] = 1 - /*products["neutron_quantity"] = 1 - products["neutron_charge"] = 0*/ - else if(prob(50)) - products["Lithium-7"] = 1 - // - products["production"] = 1 - /*products["proton_quantity"] = 1 - products["proton_charge"] = 0*/ - else - products["Beryllium-7"] = 1 - products["production"] = 3.4 - products["radiation"] = 1 - /*products["photon"] = 3.4 - // - products["neutron_quantity"] = 1 - products["neutron_charge"] = 0*/ - // - products["consumption"] = 0.6 - if("Helium-3") - switch(reactant_two) - if("Helium-3") - if(mega_energy > 0.4) - products["Helium-4"] = 1 - products["production"] = 14.9 - /*products["photon"] = 12.9 - // - products["proton_quantity"] = 2 - products["proton_charge"] = 0*/ - // - products["consumption"] = 0.4 - if("Lithium-6") - if(mega_energy > 0.6) - products["Helium-4"] = 2 - // - products["production"] = 17.9 - /*products["photon"] = 16.9 - // - products["proton_quantity"] = 1 - products["proton_charge"] = 0*/ - // - products["consumption"] = 0.6 - /* - if("proton") - switch(reactant_two) - if("Lithium-6") - if(mega_energy > 0.6) - products["Helium-4"] = 1 + products["proton_charge"] = 3.02*/ + else products["Helium-3"] = 1 - products["photon"] = 4 // - mega_energy -= 0.6 - if("Boron-11") - if(mega_energy > 1) - products["Helium-4"] = 3 - products["photon"] = 8.7 + products["production"] = 0.82 + products["radiation"] = 2.45 + /*products["photon"] = 0.82 // - mega_energy -= 1 - */ + products["neutron_quantity"] = 1 + products["neutron_charge"] = 2.45*/ + // + products["consumption"] = 0.1 + if("Helium-3") + if(mega_energy > 0.4) + products["Helium-4"] = 1 + // + products["production"] = 18.3 + /*products["photon"] = 3.6 + // + products["proton_quantity"] = 1 + products["proton_charge"] = 14.7*/ + // + products["consumption"] = 0.4 + if("Lithium-6") + if(mega_energy > 0.6) + if(prob(25)) + products["Helium-4"] = 2 + products["production"] = 1 + /*products["photon"] = 22.4*/ + else if(prob(33)) + products["Helium-3"] = 1 + products["Helium-4"] = 1 + // + products["radiation"] = 1 + /*products["neutron_quantity"] = 1 + products["neutron_charge"] = 0*/ + else if(prob(50)) + products["Lithium-7"] = 1 + // + products["production"] = 1 + /*products["proton_quantity"] = 1 + products["proton_charge"] = 0*/ + else + products["Beryllium-7"] = 1 + products["production"] = 3.4 + products["radiation"] = 1 + /*products["photon"] = 3.4 + // + products["neutron_quantity"] = 1 + products["neutron_charge"] = 0*/ + // + products["consumption"] = 0.6 + if("Helium-3") + switch(reactant_two) + if("Helium-3") + if(mega_energy > 0.4) + products["Helium-4"] = 1 + products["production"] = 14.9 + /*products["photon"] = 12.9 + // + products["proton_quantity"] = 2 + products["proton_charge"] = 0*/ + // + products["consumption"] = 0.4 + if("Lithium-6") + if(mega_energy > 0.6) + products["Helium-4"] = 2 + // + products["production"] = 17.9 + /*products["photon"] = 16.9 + // + products["proton_quantity"] = 1 + products["proton_charge"] = 0*/ + // + products["consumption"] = 0.6 + /* + if("proton") + switch(reactant_two) + if("Lithium-6") + if(mega_energy > 0.6) + products["Helium-4"] = 1 + products["Helium-3"] = 1 + products["photon"] = 4 + // + mega_energy -= 0.6 + if("Boron-11") + if(mega_energy > 1) + products["Helium-4"] = 3 + products["photon"] = 8.7 + // + mega_energy -= 1 + */ - //if no reaction happened, switch the two reactants and try again - if(!products.len && check) - check = 0 - var/temp = reactant_one - reactant_one = reactant_two - reactant_two = temp - goto recheck_reactions - /*if(products.len) - world << "\blue [reactant_one] + [reactant_two] reaction occured" - for(var/reagent in products) - world << "\blue [reagent]: [products[reagent]]"*/ - /*if(products["neutron"]) - products -= "neutron" - if(products["proton"]) - products -= "proton" - if(products["photon"]) - products -= "photon" - if(products["radiated charge"]) - products -= "radiated charge"*/ - return products + //if no reaction happened, switch the two reactants and try again + if(!products.len && check) + check = 0 + var/temp = reactant_one + reactant_one = reactant_two + reactant_two = temp + goto recheck_reactions + /*if(products.len) + world << "\blue [reactant_one] + [reactant_two] reaction occured" + for(var/reagent in products) + world << "\blue [reagent]: [products[reagent]]"*/ + /*if(products["neutron"]) + products -= "neutron" + if(products["proton"]) + products -= "proton" + if(products["photon"]) + products -= "photon" + if(products["radiated charge"]) + products -= "radiated charge"*/ + return products + +/obj/effect/rust_em_field/Del() + //radiate everything in one giant burst + for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers) + del (catcher) + RadiateAll() + + processing_objects.Remove(src) + ..() diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm b/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm index 3a491b1077..52ab6d043a 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/core_gen.dm @@ -40,80 +40,247 @@ max volume of plasma storeable by the field = the total volume of a number of ti */ -/obj/machinery/rust/core - name = "Tokamak core" +#define MAX_FIELD_FREQ 1000 +#define MIN_FIELD_FREQ 1 +#define MAX_FIELD_STR 1000 +#define MIN_FIELD_STR 1 + +/obj/machinery/power/rust_core + name = "RUST Tokamak core" desc = "Enormous solenoid for generating extremely high power electromagnetic fields" - icon = 'core.dmi' + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' icon_state = "core0" - anchored = 1 - var/on = 0 - var/obj/machinery/rust/em_field/owned_field - var/field_strength = 0.01 - // + density = 1 + var/obj/effect/rust_em_field/owned_field + var/field_strength = 1//0.01 + var/field_frequency = 1 + var/id_tag = "allan, don't forget to set the ID of this one too" req_access = list(access_engine) // use_power = 1 - idle_power_usage = 10 - active_power_usage = 300 + idle_power_usage = 50 + active_power_usage = 500 //multiplied by field strength + var/cached_power_avail = 0 + directwired = 1 + var/state = 0 + var/locked = 1 + var/remote_access_enabled = 1 - Topic(href, href_list) - ..() - if( href_list["startup"] ) - Startup() - return - if( href_list["shutdown"] ) - Shutdown() - return - if( href_list["modify_field_strength"] ) - var/new_field_str = text2num(input("Enter new field strength", "Modifying field strength", owned_field.field_strength)) - if(!new_field_str) - usr << "\red That's not a valid number." - return - field_strength = max(new_field_str,0.1) - field_strength = min(new_field_str,50) - if(owned_field) - owned_field.ChangeFieldStrength(field_strength) - return +/obj/machinery/power/rust_core/process() + if(stat & BROKEN || !powernet) + Shutdown() - proc/Startup() + cached_power_avail = avail() + //luminosity = round(owned_field.field_strength/10) + //luminosity = max(luminosity,1) + +/obj/machinery/power/rust_core/attackby(obj/item/W, mob/user) + + if(istype(W, /obj/item/weapon/wrench)) if(owned_field) + user << "Turn off [src] first." return - on = 1 - owned_field = new(src.loc) + switch(state) + if(0) + state = 1 + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + user.visible_message("[user.name] secures [src.name] to the floor.", \ + "You secure the external reinforcing bolts to the floor.", \ + "You hear a ratchet") + src.anchored = 1 + if(1) + state = 0 + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ + "You undo the external reinforcing bolts.", \ + "You hear a ratchet") + src.anchored = 0 + if(2) + user << "\red The [src.name] needs to be unwelded from the floor." + return + + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(owned_field) + user << "Turn off the [src] first." + return + switch(state) + if(0) + user << "\red The [src.name] needs to be wrenched to the floor." + if(1) + if (WT.remove_fuel(0,user)) + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ + "You start to weld the [src] to the floor.", \ + "You hear welding") + if (do_after(user,20)) + if(!src || !WT.isOn()) return + state = 2 + user << "You weld the [src] to the floor." + connect_to_network() + src.directwired = 1 + else + user << "\red You need more welding fuel to complete this task." + if(2) + if (WT.remove_fuel(0,user)) + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ + "You start to cut the [src] free from the floor.", \ + "You hear welding") + if (do_after(user,20)) + if(!src || !WT.isOn()) return + state = 1 + user << "You cut the [src] free from the floor." + disconnect_from_network() + src.directwired = 0 + else + user << "\red You need more welding fuel to complete this task." + return + + if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda)) + if(emagged) + user << "\red The lock seems to be broken" + return + if(src.allowed(user)) + if(owned_field) + src.locked = !src.locked + user << "The controls are now [src.locked ? "locked." : "unlocked."]" + else + src.locked = 0 //just in case it somehow gets locked + user << "\red The controls can only be locked when the [src] is online" + else + user << "\red Access denied." + return + + if(istype(W, /obj/item/weapon/card/emag) && !emagged) + locked = 0 + emagged = 1 + user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.") + return + + ..() + return + +/obj/machinery/power/rust_core/attack_ai(mob/user) + attack_hand(user) + +/obj/machinery/power/rust_core/attack_hand(mob/user) + add_fingerprint(user) + interact(user) + +/obj/machinery/power/rust_core/interact(mob/user) + if(stat & BROKEN) + user.unset_machine() + user << browse(null, "window=core_gen") + return + if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1) + user.unset_machine() + user << browse(null, "window=core_gen") + return + + var/dat = "" + if(stat & NOPOWER || locked || state != 2) + dat += "The console is dark and nonresponsive." + else + dat += "RUST Tokamak pattern Electromagnetic Field Generator
" + dat += "Device ID tag: [id_tag ? id_tag : "UNSET"] \[Modify\]
" + dat += "\[[owned_field ? "Deactivate" : "Activate"]\]
" + dat += "\[[remote_access_enabled ? "Disable remote access to this device" : "Enable remote access to this device"]\]
" + dat += "
" + dat += "Field strength: [field_strength]Wm^3
" + dat += "\[----\] \ + \[--- \] \ + \[-- \] \ + \[- \] \ + \[+ \] \ + \[++ \] \ + \[+++ \] \ + \[++++\]
" + + dat += "Field frequency: [field_frequency]MHz
" + dat += "\[----\] \ + \[--- \] \ + \[-- \] \ + \[- \] \ + \[+ \] \ + \[++ \] \ + \[+++ \] \ + \[++++\]
" + + var/font_colour = "green" + if(cached_power_avail < active_power_usage) + font_colour = "red" + else if(cached_power_avail < active_power_usage * 2) + font_colour = "orange" + dat += "Power status: [active_power_usage]/[cached_power_avail] W
" + + user << browse(dat, "window=core_gen;size=500x300") + onclose(user, "core_gen") + user.set_machine(src) + +/obj/machinery/power/rust_core/Topic(href, href_list) + if(href_list["str"]) + var/dif = text2num(href_list["str"]) + field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR) + active_power_usage = 5 * field_strength //change to 500 later if(owned_field) owned_field.ChangeFieldStrength(field_strength) - icon_state = "core1" - luminosity = 1 - return 1 - proc/Shutdown() + if(href_list["freq"]) + var/dif = text2num(href_list["freq"]) + field_frequency = min(max(field_frequency + dif, MIN_FIELD_FREQ), MAX_FIELD_FREQ) + if(owned_field) + owned_field.ChangeFieldFrequency(field_frequency) + + if(href_list["toggle_active"]) + if(!Startup()) + Shutdown() + + if( href_list["toggle_remote"] ) + remote_access_enabled = !remote_access_enabled + + if(href_list["new_id_tag"]) + if(usr) + id_tag = input("Enter a new ID tag", "Tokamak core ID tag", id_tag) as text|null + + if(href_list["close"]) + usr << browse(null, "window=core_gen") + usr.unset_machine() + + if(href_list["extern_update"]) + var/obj/machinery/computer/rust_core_control/C = locate(href_list["extern_update"]) + if(C) + C.updateDialog() + + src.updateDialog() + +/obj/machinery/power/rust_core/proc/Startup() + if(owned_field) + return + owned_field = new(src.loc) + owned_field.ChangeFieldStrength(field_strength) + owned_field.ChangeFieldFrequency(field_frequency) + icon_state = "core1" + luminosity = 1 + use_power = 2 + return 1 + +/obj/machinery/power/rust_core/proc/Shutdown() + //todo: safety checks for field status + if(owned_field) icon_state = "core0" - on = 0 del(owned_field) luminosity = 0 + use_power = 1 - proc/AddParticles(var/name, var/quantity = 1) - if(owned_field) - owned_field.AddParticles(name, quantity) - return 1 - return 0 +/obj/machinery/power/rust_core/proc/AddParticles(var/name, var/quantity = 1) + if(owned_field) + owned_field.AddParticles(name, quantity) + return 1 + return 0 - process() - ..() - use_power(100 * field_strength + 500) - if(on && !owned_field) - Shutdown() - return - // - luminosity = round(owned_field.field_strength/10) - luminosity = max(luminosity,1) - // - if(stat & (NOPOWER|BROKEN)) - Shutdown() - - bullet_act(var/obj/item/projectile/Proj) - if(Proj.flag != "bullet" && owned_field) - var/obj/item/projectile/beam/laserbeam = Proj - owned_field.AddEnergy(0, laserbeam.damage / 5000, laserbeam.frequency) - return 0 +/obj/machinery/power/rust_core/bullet_act(var/obj/item/projectile/Proj) + if(Proj.flag != "bullet" && owned_field) + owned_field.AddEnergy(Proj.damage, 0, 1) + return 0 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core_monitor.dm b/code/WorkInProgress/Cael_Aislinn/Rust/core_monitor.dm index b7a464a675..e69de29bb2 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/core_monitor.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/core_monitor.dm @@ -1,77 +0,0 @@ - -/obj/machinery/computer/rust/radiation_monitor - name = "Core Radiation Monitor" - -/obj/machinery/computer/rust/energy_monitor - name = "Core Primary Monitor" - icon_state = "power" - var/obj/machinery/rust/core/core_generator = null - var/updating = 1 - - New() - ..() - spawn(0) - core_generator = locate() in world - - Topic(href, href_list) - ..() - if( href_list["shutdown"] ) - updating = 0 - core_generator.Topic(href, href_list) - updateDialog() - updating = 1 - return - if( href_list["startup"] ) - updating = 0 - core_generator.Topic(href, href_list) - updateDialog() - updating = 1 - return - if( href_list["modify_field_strength"] ) - updating = 0 - core_generator.Topic(href, href_list) - updateDialog() - updating = 1 - return - if( href_list["close"] ) - usr << browse(null, "window=core_monitor") - usr.machine = null - return - - process() - ..() - if(updating) - src.updateDialog() - - interact(mob/user) - if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=core_monitor") - return - var/t = "Reactor Core Primary Monitor
" - if(core_generator) - t += "[core_generator.on ? "Core Generator connected" : "Core Generator operational"]
" - if(core_generator.owned_field) - t += "Core suspension field online \[Bring field offline\]
" - t += "Electromagnetic plasma suspension field status:
" - t += " Strength (T): [core_generator.owned_field.field_strength] \[Modify\]
" - t += " Energy levels (MeV): [core_generator.owned_field.mega_energy]
" - t += " Core frequency: [core_generator.owned_field.frequency]
" - t += " Moles of plasma: [core_generator.owned_field.held_plasma.toxins]
" - t += " Core temperature: [core_generator.owned_field.held_plasma.temperature]
" - t += "
" - t += "Core atomic and subatomic constituents:
" - if(core_generator.owned_field.dormant_reactant_quantities && core_generator.owned_field.dormant_reactant_quantities.len) - for(var/reagent in core_generator.owned_field.dormant_reactant_quantities) - t += " [reagent]: [core_generator.owned_field.dormant_reactant_quantities[reagent]]
" - else - t += " No reactants present.
" - else - t += "Core suspension field offline \[Bring field online\]
" - else - t += "Core Generator unresponsive
" - t += "
" - t += "Close
" - user << browse(t, "window=core_monitor;size=500x400") - user.machine = src diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/emfield.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/emfield.dmi deleted file mode 100644 index 4f53b069c6..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/emfield.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dm index 681d38f9aa..bbd374a21e 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dm @@ -1,10 +1,10 @@ /obj/item/weapon/fuel_assembly - icon = 'fuel_assembly.dmi' + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' icon_state = "fuel_assembly" name = "Fuel Rod Assembly" var/list/rod_quantities - var/percent_depleted = 0 + var/percent_depleted = 1 // New() rod_quantities = new/list diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dmi deleted file mode 100644 index a902202183..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dm index af1037bd72..3d88307242 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dm @@ -1,31 +1,119 @@ -/obj/machinery/rust/fuel_assembly_port + +/obj/machinery/rust_fuel_assembly_port name = "Fuel Assembly Port" - icon = 'fuel_assembly_port.dmi' - icon_state = "port0" + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "port2" density = 0 - var/obj/item/weapon/fuel_assembly/cur_assembly = null - layer = 4 + var/obj/item/weapon/fuel_assembly/cur_assembly + var/busy = 0 + anchored = 1 - attackby(var/obj/item/I, var/mob/user) - if(istype(I,/obj/item/weapon/fuel_assembly)) - if(cur_assembly) - del cur_assembly + var/opened = 1 //0=closed, 1=opened + var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires + +/obj/machinery/rust_fuel_assembly_port/attackby(var/obj/item/I, var/mob/user) + if(istype(I,/obj/item/weapon/fuel_assembly) && !opened) + if(cur_assembly) + user << "\red There is already a fuel rod assembly in there!" + else cur_assembly = I user.drop_item() I.loc = src icon_state = "port1" + user << "\blue You insert [I] into [src]. Touch the panel again to insert [I] into the injector." - attack_hand(mob/user) - add_fingerprint(user) - /*if(stat & (BROKEN|NOPOWER)) - return*/ - if(cur_assembly) - cur_assembly.loc = src.loc +/obj/machinery/rust_fuel_assembly_port/attack_hand(mob/user) + add_fingerprint(user) + if(stat & (BROKEN|NOPOWER) || opened) + return + + if(cur_assembly) + if(try_insert_assembly()) + user << "\blue \icon[src] [src] inserts it's fuel rod assembly into an injector." + else + if(eject_assembly()) + user << "\red \icon[src] [src] ejects it's fuel assembly. Check the fuel injector status." + else if(try_draw_assembly()) + user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector." + else if(try_draw_assembly()) + user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector." + else + user << "\red \icon[src] [src] was unable to draw a fuel rod assembly from an injector." + +/obj/machinery/rust_fuel_assembly_port/proc/try_insert_assembly() + var/success = 0 + if(cur_assembly) + var/turf/check_turf = get_step(get_turf(src), src.dir) + check_turf = get_step(check_turf, src.dir) + for(var/obj/machinery/power/rust_fuel_injector/I in check_turf) + if(I.stat & (BROKEN|NOPOWER)) + break + if(I.cur_assembly) + break + if(I.state != 2) + break + + I.cur_assembly = cur_assembly + cur_assembly.loc = I cur_assembly = null icon_state = "port0" + success = 1 - New() - //embed the fuel port into a wall - pixel_x = (dir & 3)? 0 : (dir == 4 ? 24 : -24) - pixel_y = (dir & 3)? (dir ==1 ? 24 : -24) : 0 + return success + +/obj/machinery/rust_fuel_assembly_port/proc/eject_assembly() + if(cur_assembly) + cur_assembly.loc = get_step(get_turf(src), src.dir) + cur_assembly = null + icon_state = "port0" + return 1 + +/obj/machinery/rust_fuel_assembly_port/proc/try_draw_assembly() + var/success = 0 + if(cur_assembly) + var/turf/check_turf = get_step(get_turf(src), src.dir) + check_turf = get_step(check_turf, src.dir) + for(var/obj/machinery/power/rust_fuel_injector/I in check_turf) + if(I.stat & (BROKEN|NOPOWER)) + break + if(!I.cur_assembly) + break + if(I.injecting) + break + if(I.state != 2) + break + + cur_assembly = I.cur_assembly + cur_assembly.loc = src + I.cur_assembly = null + icon_state = "port1" + success = 1 + + return success + +/* +/obj/machinery/rust_fuel_assembly_port/verb/try_insert_assembly_verb() + set name = "Attempt to insert assembly from port into injector" + set category = "Object" + set src in oview(1) + + if(!busy) + try_insert_assembly() + +/obj/machinery/rust_fuel_assembly_port/verb/eject_assembly_verb() + set name = "Attempt to eject assembly from port" + set category = "Object" + set src in oview(1) + + if(!busy) + eject_assembly() + +/obj/machinery/rust_fuel_assembly_port/verb/try_draw_assembly_verb() + set name = "Draw assembly from injector" + set category = "Object" + set src in oview(1) + + if(!busy) + try_draw_assembly() +*/ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dmi deleted file mode 100644 index d2250e97d5..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm new file mode 100644 index 0000000000..f13780c280 --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm @@ -0,0 +1,133 @@ + +//frame assembly + +/obj/item/rust_fuel_assembly_port_frame + name = "Fuel Assembly Port frame" + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "port2" + w_class = 4 + flags = FPRINT | TABLEPASS| CONDUCT + +/obj/item/rust_fuel_assembly_port_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/wrench)) + new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 ) + del(src) + return + ..() + +/obj/item/rust_fuel_assembly_port_frame/proc/try_build(turf/on_wall) + if (get_dist(on_wall,usr)>1) + return + var/ndir = get_dir(usr,on_wall) + if (!(ndir in cardinal)) + return + var/turf/loc = get_turf(usr) + var/area/A = loc.loc + if (!istype(loc, /turf/simulated/floor)) + usr << "\red Port cannot be placed on this spot." + return + if (A.requires_power == 0 || A.name == "Space") + usr << "\red Port cannot be placed in this area." + return + new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1) + del(src) + +//construction steps +/obj/machinery/rust_fuel_assembly_port/New(turf/loc, var/ndir, var/building=0) + ..() + + // offset 24 pixels in direction of dir + // this allows the APC to be embedded in a wall, yet still inside an area + if (building) + dir = ndir + else + has_electronics = 3 + opened = 0 + icon_state = "port0" + + //20% easier to read than apc code + pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32) + pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0 + +/obj/machinery/rust_fuel_assembly_port/attackby(obj/item/W, mob/user) + + if (istype(user, /mob/living/silicon) && get_dist(src,user)>1) + return src.attack_hand(user) + if (istype(W, /obj/item/weapon/crowbar)) + if(opened) + if(has_electronics & 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + user << "You begin removing the circuitboard" //lpeters - fixed grammar issues + if(do_after(user, 50)) + user.visible_message(\ + "\red [user.name] has removed the circuitboard from [src.name]!",\ + "\blue You remove the circuitboard.") + has_electronics = 0 + new /obj/item/weapon/module/rust_fuel_port(loc) + has_electronics &= ~1 + else + opened = 0 + icon_state = "port0" + user << "\blue You close the maintenance cover." + else + if(cur_assembly) + user << "\red You cannot open the cover while there is a fuel assembly inside." + else + opened = 1 + user << "\blue You open the maintenance cover." + icon_state = "port2" + return + + else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2)) + var/obj/item/weapon/cable_coil/C = W + if(C.amount < 10) + user << "\red You need more wires." + return + user << "You start adding cables to the frame..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 20) && C.amount >= 10) + C.use(10) + user.visible_message(\ + "\red [user.name] has added cables to the port frame!",\ + "You add cables to the port frame.") + has_electronics &= 2 + return + + else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2)) + user << "You begin to cut the cables..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 50)) + new /obj/item/weapon/cable_coil(loc,10) + user.visible_message(\ + "\red [user.name] cut the cabling inside the port.",\ + "You cut the cabling inside the port.") + has_electronics &= ~2 + return + + else if (istype(W, /obj/item/weapon/module/rust_fuel_port) && opened && !(has_electronics & 1)) + user << "You trying to insert the port control board into the frame..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 10)) + has_electronics &= 1 + user << "You place the port control board inside the frame." + del(W) + return + + else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics) + var/obj/item/weapon/weldingtool/WT = W + if (WT.get_fuel() < 3) + user << "\blue You need more welding fuel to complete this task." + return + user << "You start welding the port frame..." + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + if(do_after(user, 50)) + if(!src || !WT.remove_fuel(3, user)) return + new /obj/item/rust_fuel_assembly_port_frame(loc) + user.visible_message(\ + "\red [src] has been cut away from the wall by [user.name].",\ + "You detached the port frame.",\ + "\red You hear welding.") + del(src) + return + + ..() diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dm index a1e2829426..cfade3ab2a 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dm @@ -1,87 +1,112 @@ var/const/max_assembly_amount = 300 -/obj/machinery/rust/fuel_compressor - icon = 'fuel_compressor.dmi' - icon_state = "fuel_compressor" +/obj/machinery/rust_fuel_compressor + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "fuel_compressor1" name = "Fuel Compressor" - var/list/new_assembly_quantities - // - New() - new_assembly_quantities = new/list - spawn(0) - new_assembly_quantities["Deuterium"] = 200 - new_assembly_quantities["Tritium"] = 100 - // - new_assembly_quantities["Helium-3"] = 0 - new_assembly_quantities["Lithium-6"] = 0 - new_assembly_quantities["Silver"] = 0 + var/list/new_assembly_quantities = list("Deuterium" = 200,"Tritium" = 100,"Helium-3" = 0,"Lithium-6" = 0,"Silver" = 0) + var/compressed_matter = 0 + anchored = 1 + layer = 2.9 - attack_ai(mob/user) - attack_hand(user) + var/opened = 1 //0=closed, 1=opened + var/locked = 0 + var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires - attack_hand(mob/user) - add_fingerprint(user) - /*if(stat & (BROKEN|NOPOWER)) - return*/ - interact(user) +/obj/machinery/rust_fuel_compressor/attack_ai(mob/user) + attack_hand(user) - /*power_change() - if(stat & BROKEN) - icon_state = "broken" - else - if( powered() ) - icon_state = initial(icon_state) - stat &= ~NOPOWER - else - spawn(rand(0, 15)) - src.icon_state = "c_unpowered" - stat |= NOPOWER*/ +/obj/machinery/rust_fuel_compressor/attack_hand(mob/user) + add_fingerprint(user) + /*if(stat & (BROKEN|NOPOWER)) + return*/ + interact(user) - Topic(href, href_list) - ..() - if( href_list["close"] ) - usr << browse(null, "window=fuelcomp") - usr.machine = null - return - // - for(var/reagent in new_assembly_quantities) - if(href_list[reagent]) - var/new_amount = text2num(input("Enter new rod amount", "Fuel Assembly Rod Composition ([reagent])", new_assembly_quantities[reagent]) as text|null) - if(!new_amount) - usr << "\red That's not a valid number." - return - var/sum_reactants = new_amount - new_assembly_quantities[reagent] - for(var/rod in new_assembly_quantities) - sum_reactants += new_assembly_quantities[rod] - if(sum_reactants > max_assembly_amount) - usr << "\red You have entered too many rods." - else - new_assembly_quantities[reagent] = new_amount - updateDialog() - return - if( href_list["activate"] ) - var/obj/item/weapon/fuel_assembly/F = new(src) - //world << "\blue New fuel rod assembly" - for(var/reagent in new_assembly_quantities) - F.rod_quantities[reagent] = new_assembly_quantities[reagent] - //world << "\blue [reagent]: new_assembly_quantities[reagent]
" - F.loc = src.loc +/obj/machinery/rust_fuel_compressor/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/rcd_ammo)) + compressed_matter += 10 + del(W) + return + ..() + +/obj/machinery/rust_fuel_compressor/interact(mob/user) + if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) + if (!istype(user, /mob/living/silicon)) + user.unset_machine() + user << browse(null, "window=fuelcomp") return - interact(mob/user) - /*if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=fuelcomp") - return*/ - var/t = "Reactor Fuel Rod Compressor / Assembler
" - t += "Close
" + var/t = "Reactor Fuel Rod Compressor / Assembler
" + t += "Close
" + if(locked) + t += "Swipe your ID to unlock this console." + else + t += "Compressed matter in storage: [compressed_matter] \[Eject all\]
" t += "Activate Fuel Synthesis
(fuel assemblies require no more than [max_assembly_amount] rods).
" t += "
" t += "- New fuel assembly constituents:-
" for(var/reagent in new_assembly_quantities) - t += " [reagent] rods: [new_assembly_quantities[reagent]] \[Modify\]
" - t += "
" - t += "Close
" - user << browse(t, "window=fuelcomp;size=500x800") - user.machine = src + t += " [reagent] rods: [new_assembly_quantities[reagent]] \[Modify\]
" + t += "
" + t += "Close
" + + user << browse(t, "window=fuelcomp;size=500x300") + user.set_machine(src) + + //var/locked + //var/coverlocked + +/obj/machinery/rust_fuel_compressor/Topic(href, href_list) + ..() + if( href_list["close"] ) + usr << browse(null, "window=fuelcomp") + usr.machine = null + + if( href_list["eject_matter"] ) + var/ejected = 0 + while(compressed_matter > 10) + new /obj/item/weapon/rcd_ammo(get_step(get_turf(src), src.dir)) + compressed_matter -= 10 + ejected = 1 + if(ejected) + usr << "\blue \icon[src] [src] ejects some compressed matter units." + else + usr << "\red \icon[src] there are no more compressed matter units in [src]." + + if( href_list["activate"] ) + //world << "\blue New fuel rod assembly" + var/obj/item/weapon/fuel_assembly/F = new(src) + var/fail = 0 + var/old_matter = compressed_matter + for(var/reagent in new_assembly_quantities) + var/req_matter = new_assembly_quantities[reagent] / 30 + //world << "[reagent] matter: [req_matter]/[compressed_matter]" + if(req_matter <= compressed_matter) + F.rod_quantities[reagent] = new_assembly_quantities[reagent] + compressed_matter -= req_matter + else + fail = 1 + break + //world << "\blue [reagent]: new_assembly_quantities[reagent]
" + if(fail) + del(F) + compressed_matter = old_matter + usr << "\red \icon[src] [src] flashes red: \'Out of matter.\'" + else + F.loc = get_step(get_turf(src), src.dir) + F.percent_depleted = 0 + if(compressed_matter < 0.034) + compressed_matter = 0 + + if( href_list["change_reagent"] ) + var/cur_reagent = href_list["change_reagent"] + var/avail_rods = 300 + for(var/rod in new_assembly_quantities) + avail_rods -= new_assembly_quantities[rod] + avail_rods += new_assembly_quantities[cur_reagent] + avail_rods = max(avail_rods, 0) + + var/new_amount = min(input("Enter new [cur_reagent] rod amount (max [avail_rods])", "Fuel Assembly Rod Composition ([cur_reagent])") as num, avail_rods) + new_assembly_quantities[cur_reagent] = new_amount + + updateDialog() diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dmi deleted file mode 100644 index 75c6cde035..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm new file mode 100644 index 0000000000..5d1c272016 --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm @@ -0,0 +1,160 @@ + +//frame assembly + +/obj/item/rust_fuel_compressor_frame + name = "Fuel Compressor frame" + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "fuel_compressor0" + w_class = 4 + flags = FPRINT | TABLEPASS| CONDUCT + +/obj/item/rust_fuel_compressor_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/wrench)) + new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 ) + del(src) + return + ..() + +/obj/item/rust_fuel_compressor_frame/proc/try_build(turf/on_wall) + if (get_dist(on_wall,usr)>1) + return + var/ndir = get_dir(usr,on_wall) + if (!(ndir in cardinal)) + return + var/turf/loc = get_turf(usr) + var/area/A = loc.loc + if (!istype(loc, /turf/simulated/floor)) + usr << "\red Compressor cannot be placed on this spot." + return + if (A.requires_power == 0 || A.name == "Space") + usr << "\red Compressor cannot be placed in this area." + return + new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1) + del(src) + +//construction steps +/obj/machinery/rust_fuel_compressor/New(turf/loc, var/ndir, var/building=0) + ..() + + // offset 24 pixels in direction of dir + // this allows the APC to be embedded in a wall, yet still inside an area + if (building) + dir = ndir + else + has_electronics = 3 + opened = 0 + locked = 0 + icon_state = "fuel_compressor1" + + //20% easier to read than apc code + pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32) + pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0 + +/obj/machinery/rust_fuel_compressor/attackby(obj/item/W, mob/user) + + if (istype(user, /mob/living/silicon) && get_dist(src,user)>1) + return src.attack_hand(user) + if (istype(W, /obj/item/weapon/crowbar)) + if(opened) + if(has_electronics & 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + user << "You begin removing the circuitboard" //lpeters - fixed grammar issues + if(do_after(user, 50)) + user.visible_message(\ + "\red [user.name] has removed the circuitboard from [src.name]!",\ + "\blue You remove the circuitboard board.") + has_electronics = 0 + new /obj/item/weapon/module/rust_fuel_compressor(loc) + has_electronics &= ~1 + else + opened = 0 + icon_state = "fuel_compressor0" + user << "\blue You close the maintenance cover." + else + if(compressed_matter > 0) + user << "\red You cannot open the cover while there is compressed matter inside." + else + opened = 1 + user << "\blue You open the maintenance cover." + icon_state = "fuel_compressor1" + return + + else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card + if(opened) + user << "You must close the cover to swipe an ID card." + else + if(src.allowed(usr)) + locked = !locked + user << "You [ locked ? "lock" : "unlock"] the compressor interface." + update_icon() + else + user << "\red Access denied." + return + + else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card + if(opened) + user << "You must close the cover to swipe an ID card." + else + flick("apc-spark", src) + if (do_after(user,6)) + if(prob(50)) + emagged = 1 + locked = 0 + user << "You emag the port interface." + else + user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface." + return + + else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2)) + var/obj/item/weapon/cable_coil/C = W + if(C.amount < 10) + user << "\red You need more wires." + return + user << "You start adding cables to the compressor frame..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 20) && C.amount >= 10) + C.use(10) + user.visible_message(\ + "\red [user.name] has added cables to the compressor frame!",\ + "You add cables to the port frame.") + has_electronics &= 2 + return + + else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2)) + user << "You begin to cut the cables..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 50)) + new /obj/item/weapon/cable_coil(loc,10) + user.visible_message(\ + "\red [user.name] cut the cabling inside the compressor.",\ + "You cut the cabling inside the port.") + has_electronics &= ~2 + return + + else if (istype(W, /obj/item/weapon/module/rust_fuel_compressor) && opened && !(has_electronics & 1)) + user << "You trying to insert the circuitboard into the frame..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + if(do_after(user, 10)) + has_electronics &= 1 + user << "You place the circuitboard inside the frame." + del(W) + return + + else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics) + var/obj/item/weapon/weldingtool/WT = W + if (WT.get_fuel() < 3) + user << "\blue You need more welding fuel to complete this task." + return + user << "You start welding the compressor frame..." + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + if(do_after(user, 50)) + if(!src || !WT.remove_fuel(3, user)) return + new /obj/item/rust_fuel_assembly_port_frame(loc) + user.visible_message(\ + "\red [src] has been cut away from the wall by [user.name].",\ + "You detached the compressor frame.",\ + "\red You hear welding.") + del(src) + return + + ..() diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_control.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_control.dm index f4a7f700fa..17c8fccfc7 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_control.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_control.dm @@ -1,172 +1,192 @@ -/obj/machinery/computer/rust/fuel_control - name = "Fuel Injection Control" - icon_state = "power" - var/list/fuel_injectors - var/list/stage_status +/obj/machinery/computer/rust_fuel_control + name = "RUST Fuel Injection Control" + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "fuel" + var/list/connected_injectors = list() + var/list/active_stages = list() + var/list/proceeding_stages = list() + var/list/stage_times = list() + //var/list/stage_status var/announce_fueldepletion = 0 var/announce_stageprogression = 0 - //var/obj/machinery/rust/fuel_injector/Injector = null - New() - ..() - //these are the only three stages we can accept - //we have another console for SCRAM - fuel_injectors = new/list - stage_status = new/list + var/scan_range = 25 + var/ticks_this_stage = 0 - fuel_injectors.Add("One") - fuel_injectors["One"] = new/list - stage_status.Add("One") - stage_status["One"] = 0 - fuel_injectors.Add("Two") - fuel_injectors["Two"] = new/list - stage_status.Add("Two") - stage_status["Two"] = 0 - fuel_injectors.Add("Three") - fuel_injectors["Three"] = new/list - stage_status.Add("Three") - stage_status["Three"] = 0 - fuel_injectors.Add("SCRAM") - fuel_injectors["SCRAM"] = new/list - stage_status.Add("SCRAM") - stage_status["SCRAM"] = 0 +/*/obj/machinery/computer/rust_fuel_control/New() + ..() + //these are the only three stages we can accept + //we have another console for SCRAM + fuel_injectors = new/list + stage_status = new/list - spawn(0) - for(var/obj/machinery/rust/fuel_injector/Injector in world) - if(Injector.stage in fuel_injectors) - var/list/targetlist = fuel_injectors[Injector.stage] - targetlist.Add(Injector) + fuel_injectors.Add("One") + fuel_injectors["One"] = new/list + stage_status.Add("One") + stage_status["One"] = 0 + fuel_injectors.Add("Two") + fuel_injectors["Two"] = new/list + stage_status.Add("Two") + stage_status["Two"] = 0 + fuel_injectors.Add("Three") + fuel_injectors["Three"] = new/list + stage_status.Add("Three") + stage_status["Three"] = 0 + fuel_injectors.Add("SCRAM") + fuel_injectors["SCRAM"] = new/list + stage_status.Add("SCRAM") + stage_status["SCRAM"] = 0 - attack_ai(mob/user) - attack_hand(user) + spawn(0) + for(var/obj/machinery/power/rust_fuel_injector/Injector in world) + if(Injector.stage in fuel_injectors) + var/list/targetlist = fuel_injectors[Injector.stage] + targetlist.Add(Injector)*/ - attack_hand(mob/user) - add_fingerprint(user) - /*if(stat & (BROKEN|NOPOWER)) - return*/ - interact(user) +/obj/machinery/computer/rust_fuel_control/attack_ai(mob/user) + attack_hand(user) - /*updateDialog() - for(var/mob/M in range(1)) - if(M.machine == src) - interact(m)*/ +/obj/machinery/computer/rust_fuel_control/attack_hand(mob/user) + add_fingerprint(user) + interact(user) - Topic(href, href_list) - ..() - if( href_list["close"] ) - usr << browse(null, "window=fuel_monitor") - usr.machine = null - return - if( href_list["beginstage"] ) - var/stage_name = href_list["beginstage"] - if(stage_name in fuel_injectors) - var/success = 1 - for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name]) - if(!Injector.BeginInjecting()) - success = 0 - if(!success) //may still partially complete - usr << "\red Unable to complete command." - stage_status[stage_name] = 1 - updateDialog() - return - if( href_list["begincool"] ) - var/stage_name = href_list["begincool"] - if(stage_name in fuel_injectors) - for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name]) - Injector.StopInjecting() - stage_status[stage_name] = 0 - updateDialog() - return - if( href_list["restart"] ) - updateDialog() - return - if( href_list["cooldown"] ) - for(var/stage_name in fuel_injectors) - for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name]) - Injector.StopInjecting() - stage_status[stage_name] = 0 - updateDialog() - return - if( href_list["update"] ) - updateDialog() - return - // - if( href_list["disable_fueldepletion"] ) - announce_fueldepletion = 0 - updateDialog() - return - if( href_list["announce_fueldepletion"] ) - announce_fueldepletion = 1 - updateDialog() - return - if( href_list["broadcast_fueldepletion"] ) - announce_fueldepletion = 2 - updateDialog() - return - // - if( href_list["disable_stageprogression"] ) - announce_stageprogression = 0 - updateDialog() - return - if( href_list["announce_stageprogression"] ) - announce_stageprogression = 1 - updateDialog() - return - if( href_list["broadcast_stageprogression"] ) - announce_stageprogression = 2 - updateDialog() - return +/obj/machinery/computer/rust_fuel_control/interact(mob/user) + if(stat & (BROKEN|NOPOWER)) + user.unset_machine() + user << browse(null, "window=fuel_control") + return - process() - ..() - src.updateDialog() + if (!istype(user, /mob/living/silicon) && get_dist(src, user) > 1) + user.unset_machine() + user << browse(null, "window=fuel_control") + return - interact(mob/user) - if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=fuel_monitor") - return - var/t = "Reactor Core Fuel Control
" - var/cooling = 0 - for(var/stage in stage_status) - if(stage_status[stage]) - t += "Fuel injection: Active
" - t += "Enter cooldown phase
" - cooling = 1 - break - if(!cooling) - t += "Fuel injection: Cooling
" - t += "----
" - // - t += "Fuel depletion announcement: " - t += "[announce_fueldepletion ? "Disable" : "Disabled"] " - t += "[announce_fueldepletion == 1 ? "Announcing" : "Announce"] " - t += "[announce_fueldepletion == 2 ? "Broadcasting" : "Broadcast"]
" - t += "Stage progression announcement: " - t += "[announce_stageprogression ? "Disable" : "Disabled"] " - t += "[announce_stageprogression == 1 ? "Announcing" : "Announce"] " - t += "[announce_stageprogression == 2 ? "Broadcasting" : "Broadcast"] " - t += "
" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - for(var/stage_name in fuel_injectors) - var/list/cur_stage = fuel_injectors[stage_name] - t += "" - for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage) - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "
Injector StatusInjection interval (sec)Assembly consumption per injectionFuel Assembly PortAssembly depletion percentage
Fuel Injection Stage: [stage_name], [stage_status[stage_name] ? "Active \[Enter cooldown\]" : "Cooling \[Begin injection\]"]
[Injector.on && Injector.remote_enabled ? "Operational" : "Unresponsive"][Injector.rate/10] Modify[Injector.fuel_usage*100]% Modify[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "Loaded": "Empty"]" : "Disconnected" ][Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[Injector.owned_assembly_port.cur_assembly.percent_depleted]%" : ""]
" - t += "Close
" - user << browse(t, "window=fuel_monitor;size=500x600") - user.machine = src + var/dat = "Reactor Core Fuel Control
" + /*dat += "Fuel depletion announcement: " + dat += "[announce_fueldepletion == 0 ? "Disabled" : "\[Disable\]"] " + dat += "[announce_fueldepletion == 1 ? "Announcing" : "\[Announce\]"] " + dat += "[announce_fueldepletion == 2 ? "Broadcasting" : "\[Broadcast\]"]
" + dat += "Stage progression announcement: " + dat += "[announce_stageprogression == 0 ? "Disabled" : "\[Disable\]"] " + dat += "[announce_stageprogression == 1 ? "Announcing" : "\[Announce\]"] " + dat += "[announce_stageprogression == 2 ? "Broadcasting" : "\[Broadcast\]"]
"*/ + dat += "
" + + dat += "Detected devices \[Refresh list\]" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + + for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors) + dat += "" + dat += "" + if(I.cur_assembly) + dat += "" + else + dat += "" + dat += "" + if(I.cur_assembly) + dat += "" + else + dat += "" + if(stage_times.Find(I.id_tag)) + dat += "" + else + dat += "" + if(proceeding_stages.Find(I.id_tag)) + dat += "" + else + dat += "" + dat += "" + dat += "" + dat += "
IDAssemblyConsumptionDepletionDurationNext stage
[I.id_tag]\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]None[I.fuel_usage * 100]%[I.cur_assembly.percent_depleted * 100]%NA[ticks_this_stage]/[stage_times[I.id_tag]]s Modify[ticks_this_stage]s Set[proceeding_stages[I.id_tag]]None \[modify\]\[[active_stages.Find(I.id_tag) ? "Deactivate stage" : "Activate stage "] \]
" + + dat += "
" + dat += "Refresh " + dat += "Close
" + user << browse(dat, "window=fuel_control;size=800x400") + user.set_machine(src) + +/obj/machinery/computer/rust_fuel_control/Topic(href, href_list) + ..() + + if( href_list["scan"] ) + connected_injectors = list() + for(var/obj/machinery/power/rust_fuel_injector/I in range(scan_range, src)) + if(check_injector_status(I)) + connected_injectors.Add(I) + + if( href_list["toggle_stage"] ) + var/cur_stage = href_list["toggle_stage"] + if(active_stages.Find(cur_stage)) + active_stages.Remove(cur_stage) + for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors) + if(I.id_tag == cur_stage && check_injector_status(I)) + I.StopInjecting() + else + active_stages.Add(cur_stage) + for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors) + if(I.id_tag == cur_stage && check_injector_status(I)) + I.BeginInjecting() + + if( href_list["cooldown"] ) + for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors) + if(check_injector_status(I)) + I.StopInjecting() + active_stages = list() + + if( href_list["warmup"] ) + for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors) + if(check_injector_status(I)) + I.BeginInjecting() + if(!active_stages.Find(I.id_tag)) + active_stages.Add(I.id_tag) + + if( href_list["stage_time"] ) + var/cur_stage = href_list["stage_time"] + var/new_duration = input("Enter new stage duration in seconds", "Stage duration") as num + if(new_duration) + stage_times[cur_stage] = new_duration + else if(stage_times.Find(cur_stage)) + stage_times.Remove(cur_stage) + + if( href_list["announce_fueldepletion"] ) + announce_fueldepletion = text2num(href_list["announce_fueldepletion"]) + + if( href_list["announce_stageprogression"] ) + announce_stageprogression = text2num(href_list["announce_stageprogression"]) + + if( href_list["close"] ) + usr << browse(null, "window=fuel_control") + usr.unset_machine() + + if( href_list["set_next_stage"] ) + var/cur_stage = href_list["set_next_stage"] + if(!proceeding_stages.Find(cur_stage)) + proceeding_stages.Add(cur_stage) + var/next_stage = input("Enter next stage ID", "Automated stage procession") as text|null + if(next_stage) + proceeding_stages[cur_stage] = next_stage + else + proceeding_stages.Remove(cur_stage) + + updateDialog() + +/obj/machinery/computer/rust_fuel_control/proc/check_injector_status(var/obj/machinery/power/rust_fuel_injector/I) + if(!I) + return 0 + + if(I.stat & (BROKEN|NOPOWER) || !I.remote_access_enabled || !I.id_tag) + if(connected_injectors.Find(I)) + connected_injectors.Remove(I) + return 0 + + return 1 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm index e773939c9f..64e9f46535 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm @@ -1,210 +1,290 @@ -/obj/machinery/rust/fuel_injector +/obj/machinery/power/rust_fuel_injector name = "Fuel Injector" - icon = 'fuel_injector.dmi' + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' icon_state = "injector0" - anchored = 1 density = 1 - var/obj/machinery/rust/fuel_assembly_port/owned_assembly_port - //var/list/stageone_assemblyports - //var/list/stagetwo_assemblyports - //var/list/scram_assemblyports - var/obj/machinery/rust/reactor_vessel/Vessel = null - var/rate = 10 //microseconds between each cycle - var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle - var/on = 1 - var/remote_enabled = 1 + var/state = 2 + var/locked = 0 + var/obj/item/weapon/fuel_assembly/cur_assembly + var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle + var/id_tag = "One" var/injecting = 0 - var/stage = "One" - var/targetting_field = 0 - layer = 4 + var/trying_to_swap_fuel = 0 // req_access = list(access_engine) // use_power = 1 idle_power_usage = 10 - active_power_usage = 300 + active_power_usage = 500 + directwired = 0 + var/remote_access_enabled = 1 + var/cached_power_avail = 0 + var/emergency_insert_ready = 0 - //fuel assembly should be embedded into the wall behind the injector - New() - ..() - name = "Stage [stage] Fuel Injector" - //pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) - //pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 - /* - stageone_assemblyports = new/list() - stagetwo_assemblyports = new/list() - scram_assemblyports = new/list() - spawn(1) - Vessel = locate() in range(6,src) - for(var/obj/machinery/rust/fuel_assembly_port/S in range(6,src)) - switch(S.stage) - if("One") - stageone_assemblyports.Add(S) - if("Two") - stagetwo_assemblyports.Add(S) - if("SCRAM") - scram_assemblyports.Add(S) - */ - spawn(1) - var/rev_dir = reverse_direction(dir) - var/turf/mid = get_step(src, rev_dir) - for(var/obj/machinery/rust/fuel_assembly_port/port in get_step(mid, rev_dir)) - owned_assembly_port = port - // - - Topic(href, href_list) - ..() - if( href_list["close"] ) - usr << browse(null, "window=fuel_injector") - usr.machine = null - return - if( href_list["begin_injecting"] ) - BeginInjecting() - updateDialog() - return - if( href_list["end_injecting"] ) +/obj/machinery/power/rust_fuel_injector/process() + if(injecting) + if(stat & (BROKEN|NOPOWER)) StopInjecting() - updateDialog() - return - if( href_list["cyclerate"] ) - var/new_rate = text2num(input("Enter new injection rate (0.1 - 10 sec)", "Modifying injection rate", rate/10)) - if(!new_rate) - usr << "\red That's not a valid number." - return - new_rate = min(new_rate,0.1) - new_rate = max(new_rate,10) - rate = new_rate * 10 - updateDialog() - return - if( href_list["fuel_usage"] ) - var/new_rate = text2num(input("Enter new fuel usage (1 - 100%)", "Modifying fuel usage", rate/10)) - if(!new_rate) - usr << "\red That's not a valid number." - return - new_rate = min(new_rate,0.1) - new_rate = max(new_rate,10) - rate = new_rate * 10 - updateDialog() - return - - attack_ai(mob/user) - attack_hand(user) - - attack_hand(mob/user) - add_fingerprint(user) - /*if(stat & (BROKEN|NOPOWER)) - return*/ - interact(user) - - interact(mob/user) - if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=fuel_injector") - return - var/t = "Reactor Core Fuel Injector
" - t += "Stage: [stage]
" - t += "Status: [injecting ? "Active \[Disable\]" : "Standby \[Enable\]"]
" - t += "Interval (sec): [rate/10] \[Modify\]
" - t += "Fuel usage: [fuel_usage*100]% \[Modify\]
" - /* - var/t = "Reactor Core Fuel Control
" - t += "Current fuel injection stage: [active_stage]
" - if(active_stage == "Cooling") - //t += "Restart injection cycle
" - t += "----
" else - t += "Enter cooldown phase
" - t += "Fuel depletion announcement: " - t += "[announce_fueldepletion ? "Disable" : "Disabled"] " - t += "[announce_fueldepletion == 1 ? "Announcing" : "Announce"] " - t += "[announce_fueldepletion == 2 ? "Broadcasting" : "Broadcast"]
" - t += "Stage progression announcement: " - t += "[announce_stageprogression ? "Disable" : "Disabled"] " - t += "[announce_stageprogression == 1 ? "Announcing" : "Announce"] " - t += "[announce_stageprogression == 2 ? "Broadcasting" : "Broadcast"] " - t += "
" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - for(var/stage in fuel_injectors) - var/list/cur_stage = fuel_injectors[stage] - t += "" - for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage) - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "" - t += "
Injector StatusInjection interval (sec)Assembly consumption per injectionFuel Assembly PortAssembly depletion percentage
Fuel Injection Stage: [stage] [active_stage == stage ? " (Currently active)" : "Activate"]
[Injector.on && Injector.remote_enabled ? "Operational" : "Unresponsive"][Injector.rate/10] Modify[Injector.fuel_usage*100]% Modify[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "Loaded": "Empty"]" : "Disconnected" ][Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[100 - Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]
" - */ - t += "
" - t += "Close
" - user << browse(t, "window=fuel_injector;size=500x800") - user.machine = src + Inject() - proc/BeginInjecting() - if(!injecting && owned_assembly_port && owned_assembly_port.cur_assembly) - icon_state = "injector1" - injecting = 1 - spawn(rate) - Inject() - return 1 - return 0 + cached_power_avail = avail() - proc/StopInjecting() +/obj/machinery/power/rust_fuel_injector/attackby(obj/item/W, mob/user) + + if(istype(W, /obj/item/weapon/wrench)) if(injecting) - injecting = 0 - icon_state = "injector0" - return 1 - return 0 - - proc/Inject() - if(!injecting) + user << "Turn off the [src] first." return - if(owned_assembly_port.cur_assembly) - var/obj/machinery/rust/em_field/target_field - if(targetting_field) - for(var/obj/machinery/rust/em_field/field in range(15)) - target_field = field - var/amount_left = 0 - for(var/reagent in owned_assembly_port.cur_assembly.rod_quantities) - //world << "checking [reagent]" - if(owned_assembly_port.cur_assembly.rod_quantities[reagent] > 0) - //world << " rods left: [owned_assembly_port.cur_assembly.rod_quantities[reagent]]" - var/amount = owned_assembly_port.cur_assembly.rod_quantities[reagent] * fuel_usage - var/numparticles = round(amount * 1000) - if(numparticles < 1) - numparticles = 1 - //world << " amount: [amount]" - //world << " numparticles: [numparticles]" - // - var/obj/effect/accelerated_particle/particle = new/obj/effect/accelerated_particle(src.loc, src.dir) - particle.particle_type = reagent - particle.energy = 0 - particle.icon_state = "particle" - particle.additional_particles = numparticles - 1 - particle.target = target_field - // - owned_assembly_port.cur_assembly.rod_quantities[reagent] -= amount - amount_left += owned_assembly_port.cur_assembly.rod_quantities[reagent] - owned_assembly_port.cur_assembly.percent_depleted = amount_left / 300 - flick("injector-emitting",src) - use_power(fuel_usage * 10000 + 100) //0.0001 - if(injecting) - spawn(rate) - Inject() - else - injecting = 0 + switch(state) + if(0) + state = 1 + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + user.visible_message("[user.name] secures [src.name] to the floor.", \ + "You secure the external reinforcing bolts to the floor.", \ + "You hear a ratchet") + src.anchored = 1 + if(1) + state = 0 + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ + "You undo the external reinforcing bolts.", \ + "You hear a ratchet") + src.anchored = 0 + if(2) + user << "\red The [src.name] needs to be unwelded from the floor." + return - process() - ..() + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(injecting) + user << "Turn off the [src] first." + return + switch(state) + if(0) + user << "\red The [src.name] needs to be wrenched to the floor." + if(1) + if (WT.remove_fuel(0,user)) + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ + "You start to weld the [src] to the floor.", \ + "You hear welding") + if (do_after(user,20)) + if(!src || !WT.isOn()) return + state = 2 + user << "You weld the [src] to the floor." + connect_to_network() + //src.directwired = 1 + else + user << "\red You need more welding fuel to complete this task." + if(2) + if (WT.remove_fuel(0,user)) + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ + "You start to cut the [src] free from the floor.", \ + "You hear welding") + if (do_after(user,20)) + if(!src || !WT.isOn()) return + state = 1 + user << "You cut the [src] free from the floor." + disconnect_from_network() + //src.directwired = 0 + else + user << "\red You need more welding fuel to complete this task." + return + + if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda)) + if(emagged) + user << "\red The lock seems to be broken" + return + if(src.allowed(user)) + src.locked = !src.locked + user << "The controls are now [src.locked ? "locked." : "unlocked."]" + else + user << "\red Access denied." + return + + if(istype(W, /obj/item/weapon/card/emag) && !emagged) + locked = 0 + emagged = 1 + user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.") + return + + if(istype(W, /obj/item/weapon/fuel_assembly) && !cur_assembly) + if(emergency_insert_ready) + cur_assembly = W + user.drop_item() + W.loc = src + emergency_insert_ready = 0 + return + + ..() + return + +/obj/machinery/power/rust_fuel_injector/attack_ai(mob/user) + attack_hand(user) + +/obj/machinery/power/rust_fuel_injector/attack_hand(mob/user) + add_fingerprint(user) + interact(user) + +/obj/machinery/power/rust_fuel_injector/interact(mob/user) + if(stat & BROKEN) + user.unset_machine() + user << browse(null, "window=fuel_injector") + return + if(get_dist(src, user) > 1 ) + if (!istype(user, /mob/living/silicon)) + user.unset_machine() + user << browse(null, "window=fuel_injector") + return + + var/dat = "" + if (stat & NOPOWER || locked || state != 2) + dat += "The console is dark and nonresponsive." + else + dat += "Reactor Core Fuel Injector
" + dat += "Device ID tag: [id_tag] \[Modify\]
" + dat += "Status: [injecting ? "Active \[Disable\]" : "Standby \[Enable\]"]
" + dat += "Fuel usage: [fuel_usage*100]% \[Modify\]
" + dat += "Fuel assembly port: " + dat += "\[[cur_assembly ? "Eject assembly to port" : "Draw assembly from port"]\] " + if(cur_assembly) + dat += "\[Emergency eject\]
" + else + dat += "\[[emergency_insert_ready ? "Cancel emergency insertion" : "Emergency insert"]\]
" + var/font_colour = "green" + if(cached_power_avail < active_power_usage) + font_colour = "red" + else if(cached_power_avail < active_power_usage * 2) + font_colour = "orange" + dat += "Power status: [active_power_usage]/[cached_power_avail] W
" + dat += "\[[remote_access_enabled ? "Disable remote access" : "Enable remote access"]\]
" + + dat += "
" + dat += "Refresh " + dat += "Close
" + + user << browse(dat, "window=fuel_injector;size=500x300") + onclose(user, "fuel_injector") + user.set_machine(src) + +/obj/machinery/power/rust_fuel_injector/Topic(href, href_list) + ..() + + if( href_list["modify_tag"] ) + id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null + + if( href_list["fuel_assembly"] ) + if(!trying_to_swap_fuel) + trying_to_swap_fuel = 1 + spawn(50) + attempt_fuel_swap() + trying_to_swap_fuel = 0 + + if( href_list["emergency_fuel_assembly"] ) + if(cur_assembly) + cur_assembly.loc = src.loc + cur_assembly = null + //irradiate! + else + emergency_insert_ready = !emergency_insert_ready + + if( href_list["toggle_injecting"] ) + if(injecting) + StopInjecting() + else + BeginInjecting() + + if( href_list["toggle_remote"] ) + remote_access_enabled = !remote_access_enabled + + if( href_list["fuel_usage"] ) + var/new_usage = text2num(input("Enter new fuel usage (0.01% - 100%)", "Modifying fuel usage", fuel_usage * 100)) + if(!new_usage) + usr << "\red That's not a valid number." + return + new_usage = max(new_usage, 0.01) + new_usage = min(new_usage, 100) + fuel_usage = new_usage / 100 + active_power_usage = 500 + 1000 * fuel_usage + + if( href_list["update_extern"] ) + var/obj/machinery/computer/rust_fuel_control/C = locate(href_list["update_extern"]) + if(C) + C.updateDialog() + + if( href_list["close"] ) + usr << browse(null, "window=fuel_injector") + usr.unset_machine() + + updateDialog() + +/obj/machinery/power/rust_fuel_injector/proc/BeginInjecting() + if(!injecting && cur_assembly) + icon_state = "injector1" + injecting = 1 + use_power = 1 + +/obj/machinery/power/rust_fuel_injector/proc/StopInjecting() + if(injecting) + injecting = 0 + icon_state = "injector0" + use_power = 0 + +/obj/machinery/power/rust_fuel_injector/proc/Inject() + if(!injecting) + return + if(cur_assembly) + var/amount_left = 0 + for(var/reagent in cur_assembly.rod_quantities) + //world << "checking [reagent]" + if(cur_assembly.rod_quantities[reagent] > 0) + //world << " rods left: [cur_assembly.rod_quantities[reagent]]" + var/amount = cur_assembly.rod_quantities[reagent] * fuel_usage + var/numparticles = round(amount * 1000) + if(numparticles < 1) + numparticles = 1 + //world << " amount: [amount]" + //world << " numparticles: [numparticles]" + // + + var/obj/effect/accelerated_particle/A = new/obj/effect/accelerated_particle(get_turf(src), dir) + A.particle_type = reagent + A.additional_particles = numparticles - 1 + //A.target = target_field + // + cur_assembly.rod_quantities[reagent] -= amount + amount_left += cur_assembly.rod_quantities[reagent] + cur_assembly.percent_depleted = amount_left / 300 + flick("injector-emitting",src) + else + StopInjecting() + +/obj/machinery/power/rust_fuel_injector/proc/attempt_fuel_swap() + var/rev_dir = reverse_direction(dir) + var/turf/mid = get_step(src, rev_dir) + var/success = 0 + for(var/obj/machinery/rust_fuel_assembly_port/check_port in get_step(mid, rev_dir)) + if(cur_assembly) + if(!check_port.cur_assembly) + check_port.cur_assembly = cur_assembly + cur_assembly.loc = check_port + cur_assembly = null + check_port.icon_state = "port1" + success = 1 + else + if(check_port.cur_assembly) + cur_assembly = check_port.cur_assembly + cur_assembly.loc = src + check_port.cur_assembly = null + check_port.icon_state = "port0" + success = 1 + + break + if(success) + src.visible_message("\blue \icon[src] a green light flashes on [src].") updateDialog() - // + else + src.visible_message("\red \icon[src] a red light flashes on [src].") diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dmi deleted file mode 100644 index c989781367..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm index 3926d84033..ba12179bf6 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm @@ -3,7 +3,7 @@ /obj/item/projectile/beam/ehf_beam /obj/machinery/rust/gyrotron - icon = 'gyrotron.dmi' + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' icon_state = "emitter-off" name = "Gyrotron" anchored = 1 @@ -41,7 +41,7 @@ new_val = min(new_val,0.01) new_val = max(new_val,0.001) mega_energy = new_val - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return if( href_list["modifyrate"] ) @@ -52,7 +52,7 @@ new_val = min(new_val,1) new_val = max(new_val,10) rate = new_val - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return if( href_list["modifyfreq"] ) @@ -63,29 +63,29 @@ new_val = min(new_val,1) new_val = max(new_val,50000) frequency = new_val - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return if( href_list["activate"] ) emitting = 1 spawn(rate) Emit() - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return if( href_list["deactivate"] ) emitting = 0 - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return if( href_list["enableremote"] ) remoteenabled = 1 - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return if( href_list["disableremote"] ) remoteenabled = 0 - for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25)) + for(var/obj/machinery/computer/rust_gyrotron_controller/comp in range(25)) comp.updateDialog() return /* diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dmi deleted file mode 100644 index 919503515f..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron_controller.dm b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron_controller.dm index 2c9b6f37d8..a28f67cc39 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron_controller.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron_controller.dm @@ -1,7 +1,8 @@ -/obj/machinery/computer/rust/gyrotron_controller +/obj/machinery/computer/rust_gyrotron_controller name = "Gyrotron Remote Controller" - icon_state = "power" + icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi' + icon_state = "engine" var/updating = 1 New() diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm b/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm index 62b826532c..155ef23c5c 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm @@ -67,4 +67,8 @@ //particle.invisibility = 2 // return particle -*/ \ No newline at end of file +*/ + +/obj/machinery/computer/rust_radiation_monitor + name = "Radiation Monitor" + icon_state = "power" diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi index cb8c21f10b..fd2ea5a0aa 100644 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi and b/code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/rust_computers.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/rust_computers.dmi deleted file mode 100644 index 324848a06a..0000000000 Binary files a/code/WorkInProgress/Cael_Aislinn/Rust/rust_computers.dmi and /dev/null differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/rust_old.dmi b/code/WorkInProgress/Cael_Aislinn/Rust/rust_old.dmi new file mode 100644 index 0000000000..7fd6ad57d0 Binary files /dev/null and b/code/WorkInProgress/Cael_Aislinn/Rust/rust_old.dmi differ diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/virtual_particle_catcher.dm b/code/WorkInProgress/Cael_Aislinn/Rust/virtual_particle_catcher.dm index b45d28259c..6030133473 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/virtual_particle_catcher.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/virtual_particle_catcher.dm @@ -1,49 +1,53 @@ //gimmicky hack to collect particles and direct them into the field -//byond multitiles are basically... shit -/obj/machinery/rust/particle_catcher - invisibility = 101 +/obj/effect/rust_particle_catcher icon = 'effects.dmi' - icon_state = "energynet" density = 0 anchored = 1 - var/obj/machinery/rust/em_field/parent + layer = 4 + var/obj/effect/rust_em_field/parent var/mysize = 0 - /*New() - for(var/obj/machinery/rust/em_field/field in range(6)) - parent = field - if(!parent) - del(src)*/ + invisibility = 101 - proc/SetSize(var/newsize) - name = "collector [newsize]" - mysize = newsize - UpdateSize() +/*/obj/effect/rust_particle_catcher/New() + for(var/obj/machinery/rust/em_field/field in range(6)) + parent = field + if(!parent) + del(src)*/ - proc/AddParticles(var/name, var/quantity = 1) - if(parent && parent.size >= mysize) - parent.AddParticles(name, quantity) - return 1 - return 0 +/obj/effect/rust_particle_catcher/process() + if(!parent) + del(src) - proc/UpdateSize() - if(parent.size >= mysize) - density = 1 - //invisibility = 101 - name = "collector [mysize] ON" - else - density = 0 - name = "collector [mysize] OFF" - //invisibility = 101 +/obj/effect/rust_particle_catcher/proc/SetSize(var/newsize) + name = "collector [newsize]" + mysize = newsize + UpdateSize() - bullet_act(var/obj/item/projectile/Proj) - if(Proj.flag != "bullet" && parent) - var/obj/item/projectile/beam/laserbeam = Proj - parent.AddEnergy(0, laserbeam.damage / 5000, laserbeam.frequency) - return 0 +/obj/effect/rust_particle_catcher/proc/AddParticles(var/name, var/quantity = 1) + if(parent && parent.size >= mysize) + parent.AddParticles(name, quantity) + return 1 + return 0 - process() - ..() - if(!parent) - del(src) +/obj/effect/rust_particle_catcher/proc/UpdateSize() + if(parent.size >= mysize) + density = 1 + invisibility = 0 + name = "collector [mysize] ON" + else + density = 0 + invisibility = 101 + name = "collector [mysize] OFF" + +/obj/effect/rust_particle_catcher/bullet_act(var/obj/item/projectile/Proj) + if(Proj.flag != "bullet" && parent) + parent.AddEnergy(Proj.damage, 0, 1) + update_icon() + return 0 + +/obj/effect/rust_particle_catcher/Bumped(atom/AM) + if(ismob(AM) && density && prob(10)) + AM << "\red A powerful force pushes you back." + ..() diff --git a/code/WorkInProgress/Cael_Aislinn/ShieldGen/circuits_and_designs.dm b/code/WorkInProgress/Cael_Aislinn/ShieldGen/circuits_and_designs.dm new file mode 100644 index 0000000000..b85be8f74a --- /dev/null +++ b/code/WorkInProgress/Cael_Aislinn/ShieldGen/circuits_and_designs.dm @@ -0,0 +1,78 @@ + +//////////////////////////////////////// +// External Shield Generator + +/obj/item/weapon/circuitboard/shield_gen_ex + name = "Circuit board (Experimental hull shield generator)" + board_type = "machine" + build_path = "/obj/machinery/shield_gen/external" + origin_tech = "bluespace=4;plasmatech=3" + frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator/pico" = 2, + "/obj/item/weapon/stock_parts/subspace/transmitter" = 1, + "/obj/item/weapon/stock_parts/subspace/crystal" = 1, + "/obj/item/weapon/stock_parts/subspace/amplifier" = 1, + "/obj/item/weapon/stock_parts/console_screen" = 1, + "/obj/item/weapon/cable_coil" = 5) + +datum/design/shield_gen_ex + name = "Circuit Design (Experimental hull shield generator)" + desc = "Allows for the construction of circuit boards used to build an experimental hull shield generator." + id = "shield_gen" + req_tech = list("bluespace" = 4, "plasmatech" = 3) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000) + build_path = "/obj/machinery/shield_gen/external" + +//////////////////////////////////////// +// Shield Generator + +/obj/item/weapon/circuitboard/shield_gen + name = "Circuit board (Experimental shield generator)" + board_type = "machine" + build_path = "/obj/machinery/shield_gen/external" + origin_tech = "bluespace=4;plasmatech=3" + frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator/pico" = 2, + "/obj/item/weapon/stock_parts/subspace/transmitter" = 1, + "/obj/item/weapon/stock_parts/subspace/crystal" = 1, + "/obj/item/weapon/stock_parts/subspace/amplifier" = 1, + "/obj/item/weapon/stock_parts/console_screen" = 1, + "/obj/item/weapon/cable_coil" = 5) + +datum/design/shield_gen + name = "Circuit Design (Experimental shield generator)" + desc = "Allows for the construction of circuit boards used to build an experimental shield generator." + id = "shield_gen" + req_tech = list("bluespace" = 4, "plasmatech" = 3) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000) + build_path = "/obj/machinery/shield_gen/external" + +//////////////////////////////////////// +// Shield Capacitor + +/obj/item/weapon/circuitboard/shield_cap + name = "Circuit board (Experimental shield capacitor)" + board_type = "machine" + build_path = "/obj/machinery/shield_capacitor" + origin_tech = "magnets=3;powerstorage=4" + frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Filter, 5 Pieces of cable, 1 Subspace Treatment disk, 1 Subspace Analyzer and 1 Console Screen." + req_components = list( + "/obj/item/weapon/stock_parts/manipulator/pico" = 2, + "/obj/item/weapon/stock_parts/subspace/filter" = 1, + "/obj/item/weapon/stock_parts/subspace/treatment" = 1, + "/obj/item/weapon/stock_parts/subspace/analyzer" = 1, + "/obj/item/weapon/stock_parts/console_screen" = 1, + "/obj/item/weapon/cable_coil" = 5) + +datum/design/shield_cap + name = "Circuit Design (Experimental shield capacitor)" + desc = "Allows for the construction of circuit boards used to build an experimental shielding capacitor." + id = "shield_cap" + req_tech = list("magnets" = 3, "powerstorage" = 4) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$silver" = 10000) + build_path = "/obj/machinery/shield_gen/external" diff --git a/code/WorkInProgress/Cael_Aislinn/energy_field.dm b/code/WorkInProgress/Cael_Aislinn/ShieldGen/energy_field.dm similarity index 84% rename from code/WorkInProgress/Cael_Aislinn/energy_field.dm rename to code/WorkInProgress/Cael_Aislinn/ShieldGen/energy_field.dm index 4488fc3af0..653de8ca4d 100644 --- a/code/WorkInProgress/Cael_Aislinn/energy_field.dm +++ b/code/WorkInProgress/Cael_Aislinn/ShieldGen/energy_field.dm @@ -1,52 +1,55 @@ - -//---------- actual energy field - -/obj/effect/energy_field - name = "energy field" - desc = "Impenetrable field of energy, capable of blocking anything as long as it's active." - icon = 'shielding.dmi' - icon_state = "shieldsparkles" - anchored = 1 - layer = 2.1 - density = 0 - invisibility = 2 - var/strength = 0 - var/obj/machinery/shield_gen/parent - var/stress = 0 - -/obj/effect/energy_field/ex_act(var/severity) - Stress(0.5 + severity) - -/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj) - Stress(1 + 1 * (Proj.damage / 100)) - - -/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj) - if(M) - walk(M,0) - -/obj/effect/energy_field/proc/Stress(var/severity) - strength -= severity - stress += severity - - //if we take too much damage, drop out - the generator will bring us back up if we have enough power - if(strength < 1) - invisibility = 2 - density = 0 - -/obj/effect/energy_field/proc/Strengthen(var/severity) - strength += severity - - //if we take too much damage, drop out - the generator will bring us back up if we have enough power - if(strength > 1) - invisibility = 0 - density = 1 - -/obj/effect/energy_field/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) - return density + +//---------- actual energy field + +/obj/effect/energy_field + name = "energy field" + desc = "Impenetrable field of energy, capable of blocking anything as long as it's active." + icon = 'shielding.dmi' + icon_state = "shieldsparkles" + anchored = 1 + layer = 2.1 + density = 0 + invisibility = 101 + var/strength = 0 + +/obj/effect/energy_field/ex_act(var/severity) + Stress(0.5 + severity) + +/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj) + Stress(Proj.damage / 10) + +/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj) + if(M) + walk(M,0) + Stress(2) + +/obj/effect/energy_field/proc/Stress(var/severity) + strength -= severity + + //if we take too much damage, drop out - the generator will bring us back up if we have enough power + if(strength < 1) + invisibility = 101 + density = 0 + else if(strength >= 1) + invisibility = 0 + density = 1 + +/obj/effect/energy_field/proc/Strengthen(var/severity) + strength += severity + + //if we take too much damage, drop out - the generator will bring us back up if we have enough power + if(strength >= 1) + invisibility = 0 + density = 1 + else if(strength < 1) + invisibility = 101 + density = 0 + +/obj/effect/energy_field/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) + return !density diff --git a/code/WorkInProgress/Cael_Aislinn/shield_capacitor.dm b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_capacitor.dm similarity index 55% rename from code/WorkInProgress/Cael_Aislinn/shield_capacitor.dm rename to code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_capacitor.dm index bd7ccfd773..9ea07f119b 100644 --- a/code/WorkInProgress/Cael_Aislinn/shield_capacitor.dm +++ b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_capacitor.dm @@ -1,158 +1,171 @@ - -//---------- shield capacitor -//pulls energy out of a power net and charges an adjacent generator - -/obj/machinery/shield_capacitor - name = "shield capacitor" - desc = "Machine that charges a shield generator." - icon = 'shielding.dmi' - icon_state = "capacitor" - var/active = 1 - density = 1 - anchored = 1 - var/obj/machinery/shield_gen/target_generator - var/stored_charge = 0 - var/time_since_fail = 100 - var/max_charge = 1000000 - var/max_charge_rate = 100000 - var/min_charge_rate = 0 - var/locked = 0 - // - use_power = 1 //0 use nothing - //1 use idle power - //2 use active power - idle_power_usage = 10 - active_power_usage = 100 - var/charge_rate = 100 - -/obj/machinery/shield_capacitor/New() - spawn(10) - for(var/obj/machinery/shield_gen/possible_gen in range(1, src)) - if(get_dir(src, possible_gen) == src.dir) - target_generator = possible_gen - possible_gen.owned_capacitor = src - break - ..() - -/obj/machinery/shield_capacitor/verb/rotate() - set name = "Rotate Clockwise" - set category = "Object" - set src in oview(1) - - if (src.anchored || usr:stat) - usr << "It is fastened to the floor!" - return 0 - src.dir = turn(src.dir, 270) - target_generator = locate() in get_step(src,dir) - if(target_generator && !target_generator.owned_capacitor) - target_generator.owned_capacitor = src - return 1 - -/obj/machinery/shield_capacitor/power_change() - if(stat & BROKEN) - icon_state = "broke" - else - if( powered() ) - if (src.active) - icon_state = "capacitor" - else - icon_state = "capacitor" - stat &= ~NOPOWER - else - spawn(rand(0, 15)) - src.icon_state = "capacitor" - stat |= NOPOWER - -/obj/machinery/shield_capacitor/process() - // - if(active) - use_power = 2 - if(stored_charge + charge_rate > max_charge) - active_power_usage = max_charge - stored_charge - else - active_power_usage = charge_rate - stored_charge += active_power_usage - else - use_power = 1 - - time_since_fail++ - if(stored_charge < active_power_usage * 1.5) - time_since_fail = 0 - // - updateDialog() - -/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user) - /*if(istype(W, /obj/item/weapon/wrench)) - if(active) - user << "Turn off the field generator first." - return - - else if(state == 0) - state = 1 - playsound(src.loc, '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) - user << "You undo the external reinforcing bolts." - src.anchored = 0 - return*/ - - 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."]" - else - user << "\red Access denied." - - else if(istype(W, /obj/item/weapon/wrench)) - src.anchored = !src.anchored - src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].") - - else - src.add_fingerprint(user) - user << "\red You hit the [src.name] with your [W.name]!" - for(var/mob/M in viewers(src)) - if(M == user) continue - M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!") - -/obj/machinery/shield_capacitor/Topic(href, href_list[]) - ..() - if( href_list["close"] ) - usr << browse(null, "window=shield_capacitor") - usr.machine = null - return - if( href_list["toggle"] ) - active = !active - if(active) - use_power = 2 - else - use_power = 1 - if( href_list["charge_rate"] ) - charge_rate += text2num(href_list["charge_rate"]) - if(charge_rate > max_charge_rate) - charge_rate = max_charge_rate - else if(charge_rate < min_charge_rate) - charge_rate = min_charge_rate - // - updateDialog() - -/obj/machinery/shield_capacitor/interact(mob/user) - if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=shield_capacitor") - return - var/t = "Shield Capacitor Control Console
" - t += "[target_generator ? "Shield generator connected." : "Unable to locate shield generator!"]
" - t += "This capacitor is: [active ? "Online" : "Offline" ] [active ? "\[Deactivate\]" : "\[Activate\]"]
" - t += "[time_since_fail > 2 ? "Charging stable." : "Warning, low charge!"]
" - t += "Capacitor charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)
" - t += "Capacitor charge rate (approx): \[min\] \[--\] \[-\][charge_rate] Watts/sec \[+\] \[++\] \[max\]
" - t += "
" - t += "Close
" - user << browse(t, "window=shield_capacitor;size=500x800") - user.machine = src + +//---------- shield capacitor +//pulls energy out of a power net and charges an adjacent generator + +/obj/machinery/shield_capacitor + name = "shield capacitor" + desc = "Machine that charges a shield generator." + icon = 'shielding.dmi' + icon_state = "capacitor" + var/active = 1 + density = 1 + anchored = 1 + var/stored_charge = 0 + var/time_since_fail = 100 + var/max_charge = 1000000 + var/max_charge_rate = 100000 + var/min_charge_rate = 0 + var/locked = 0 + // + use_power = 1 //0 use nothing + //1 use idle power + //2 use active power + idle_power_usage = 10 + active_power_usage = 100 + var/charge_rate = 100 + +/obj/machinery/shield_capacitor/New() + spawn(10) + for(var/obj/machinery/shield_gen/possible_gen in range(1, src)) + if(get_dir(src, possible_gen) == src.dir) + possible_gen.owned_capacitor = src + break + ..() + +/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user) + + if(istype(W, /obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/C = W + if(access_captain in C.access || access_security in C.access || access_engine in C.access) + src.locked = !src.locked + user << "Controls are now [src.locked ? "locked." : "unlocked."]" + updateDialog() + else + user << "\red Access denied." + else if(istype(W, /obj/item/weapon/card/emag)) + if(prob(75)) + src.locked = !src.locked + user << "Controls are now [src.locked ? "locked." : "unlocked."]" + updateDialog() + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + + else if(istype(W, /obj/item/weapon/wrench)) + src.anchored = !src.anchored + src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].") + + spawn(0) + for(var/obj/machinery/shield_gen/gen in range(1, src)) + if(get_dir(src, gen) == src.dir) + if(!src.anchored && gen.owned_capacitor == src) + gen.owned_capacitor = null + break + else if(src.anchored && !gen.owned_capacitor) + gen.owned_capacitor = src + break + gen.updateDialog() + updateDialog() + else + ..() + +/obj/machinery/shield_capacitor/attack_paw(user as mob) + return src.attack_hand(user) + +/obj/machinery/shield_capacitor/attack_ai(user as mob) + return src.attack_hand(user) + +/obj/machinery/shield_capacitor/attack_hand(mob/user) + if(stat & (NOPOWER|BROKEN)) + return + interact(user) + +/obj/machinery/shield_capacitor/interact(mob/user) + if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) + if (!istype(user, /mob/living/silicon)) + user.unset_machine() + user << browse(null, "window=shield_capacitor") + return + var/t = "Shield Capacitor Control Console

" + if(locked) + t += "Swipe your ID card to begin." + else + t += "This capacitor is: [active ? "Online" : "Offline" ] [active ? "\[Deactivate\]" : "\[Activate\]"]
" + t += "[time_since_fail > 2 ? "Charging stable." : "Warning, low charge!"]
" + t += "Charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)
" + t += "Charge rate: \ + \[min\] \ + \[--\] \ + \[-\][charge_rate] Watts/sec \ + \[+\] \ + \[++\] \ + \[max\]
" + t += "
" + t += "Refresh " + t += "Close
" + + user << browse(t, "window=shield_capacitor;size=500x800") + user.set_machine(src) + +/obj/machinery/shield_capacitor/process() + // + if(active) + use_power = 2 + if(stored_charge + charge_rate > max_charge) + active_power_usage = max_charge - stored_charge + else + active_power_usage = charge_rate + stored_charge += active_power_usage + else + use_power = 1 + + time_since_fail++ + if(stored_charge < active_power_usage * 1.5) + time_since_fail = 0 + +/obj/machinery/shield_capacitor/Topic(href, href_list[]) + ..() + if( href_list["close"] ) + usr << browse(null, "window=shield_capacitor") + usr.unset_machine() + return + if( href_list["toggle"] ) + active = !active + if(active) + use_power = 2 + else + use_power = 1 + if( href_list["charge_rate"] ) + charge_rate += text2num(href_list["charge_rate"]) + if(charge_rate > max_charge_rate) + charge_rate = max_charge_rate + else if(charge_rate < min_charge_rate) + charge_rate = min_charge_rate + // + updateDialog() + +/obj/machinery/shield_capacitor/power_change() + if(stat & BROKEN) + icon_state = "broke" + else + if( powered() ) + if (src.active) + icon_state = "capacitor" + else + icon_state = "capacitor" + stat &= ~NOPOWER + else + spawn(rand(0, 15)) + src.icon_state = "capacitor" + stat |= NOPOWER + +/obj/machinery/shield_capacitor/verb/rotate() + set name = "Rotate capacitor clockwise" + set category = "Object" + set src in oview(1) + + if (src.anchored) + usr << "It is fastened to the floor!" + return + src.dir = turn(src.dir, 270) + return diff --git a/code/WorkInProgress/Cael_Aislinn/shield_gen.dm b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_gen.dm similarity index 53% rename from code/WorkInProgress/Cael_Aislinn/shield_gen.dm rename to code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_gen.dm index c87fb4aab9..d03e8f366f 100644 --- a/code/WorkInProgress/Cael_Aislinn/shield_gen.dm +++ b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_gen.dm @@ -25,7 +25,6 @@ var/max_field_strength = 10 var/time_since_fail = 100 var/energy_conversion_rate = 0.01 //how many renwicks per watt? - var/flicker_shield_glitch = 1 //shield is slightly faulty and flickers - don't think this is working as intended // use_power = 1 //0 use nothing //1 use idle power @@ -38,14 +37,191 @@ for(var/obj/machinery/shield_capacitor/possible_cap in range(1, src)) if(get_dir(possible_cap, src) == possible_cap.dir) owned_capacitor = possible_cap - possible_cap.target_generator = src break field = new/list() ..() -//copied from a copypaste. DRY, right? +/obj/machinery/shield_gen/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/C = W + if(access_captain in C.access || access_security in C.access || access_engine in C.access) + src.locked = !src.locked + user << "Controls are now [src.locked ? "locked." : "unlocked."]" + updateDialog() + else + user << "\red Access denied." + else if(istype(W, /obj/item/weapon/card/emag)) + if(prob(75)) + src.locked = !src.locked + user << "Controls are now [src.locked ? "locked." : "unlocked."]" + updateDialog() + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + + else if(istype(W, /obj/item/weapon/wrench)) + src.anchored = !src.anchored + src.visible_message("\blue \icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].") + + spawn(0) + for(var/obj/machinery/shield_gen/gen in range(1, src)) + if(get_dir(src, gen) == src.dir) + if(!src.anchored && gen.owned_capacitor == src) + gen.owned_capacitor = null + break + else if(src.anchored && !gen.owned_capacitor) + gen.owned_capacitor = src + break + gen.updateDialog() + updateDialog() + else + ..() + +/obj/machinery/shield_gen/attack_paw(user as mob) + return src.attack_hand(user) + +/obj/machinery/shield_gen/attack_ai(user as mob) + return src.attack_hand(user) + +/obj/machinery/shield_gen/attack_hand(mob/user) + if(stat & (NOPOWER|BROKEN)) + return + interact(user) + +/obj/machinery/shield_gen/interact(mob/user) + if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) + if (!istype(user, /mob/living/silicon)) + user.unset_machine() + user << browse(null, "window=shield_generator") + return + var/t = "Shield Generator Control Console

" + if(locked) + t += "Swipe your ID card to begin." + else + t += "[owned_capacitor ? "Charge capacitor connected." : "Unable to locate charge capacitor!"]
" + t += "This generator is: [active ? "Online" : "Offline" ] [active ? "\[Deactivate\]" : "\[Activate\]"]
" + t += "[time_since_fail > 2 ? "Field is stable." : "Warning, field is unstable!"]
" + t += "Coverage radius (restart required): \ + -- \ + - \ + [field_radius * 2]m \ + + \ + ++
" + t += "Overall field strength: [average_field_strength] Renwicks ([max_field_strength ? 100 * average_field_strength / max_field_strength : "NA"]%)
" + t += "Charge rate: -- \ + - \ + [strengthen_rate] Renwicks/sec \ + + \ + ++
" + t += "Upkeep energy: [field.len * average_field_strength / energy_conversion_rate] Watts/sec
" + t += "Additional energy required to charge: [field.len * strengthen_rate / energy_conversion_rate] Watts/sec
" + t += "Maximum field strength: \ + \[min\] \ + -- \ + - \ + [max_field_strength] Renwicks \ + + \ + ++ \ + \[max\]
" + t += "
" + t += "Refresh " + t += "Close
" + user << browse(t, "window=shield_generator;size=500x800") + user.set_machine(src) + +/obj/machinery/shield_gen/process() + + if(active && field.len) + var/stored_renwicks = 0 + var/target_field_strength = min(strengthen_rate + max(average_field_strength, 0), max_field_strength) + if(owned_capacitor) + var/required_energy = field.len * target_field_strength / energy_conversion_rate + var/assumed_charge = min(owned_capacitor.stored_charge, required_energy) + stored_renwicks = assumed_charge * energy_conversion_rate + owned_capacitor.stored_charge -= assumed_charge + + time_since_fail++ + + average_field_strength = 0 + target_field_strength = stored_renwicks / field.len + + for(var/obj/effect/energy_field/E in field) + if(stored_renwicks) + var/strength_change = target_field_strength - E.strength + if(strength_change > stored_renwicks) + strength_change = stored_renwicks + if(E.strength >= 1) + E.Strengthen(strength_change) + else if(E.strength < 0) + E.strength = 0 + E.Strengthen(0.1) + + stored_renwicks -= strength_change + + average_field_strength += E.strength + else + E.Strengthen(-E.strength) + + average_field_strength /= field.len + if(average_field_strength < 0) + time_since_fail = 0 + else + average_field_strength = 0 + +/obj/machinery/shield_gen/Topic(href, href_list[]) + ..() + if( href_list["close"] ) + usr << browse(null, "window=shield_generator") + usr.unset_machine() + return + else if( href_list["toggle"] ) + toggle() + else if( href_list["change_radius"] ) + field_radius += text2num(href_list["change_radius"]) + if(field_radius > 200) + field_radius = 200 + else if(field_radius < 0) + field_radius = 0 + else if( href_list["strengthen_rate"] ) + strengthen_rate += text2num(href_list["strengthen_rate"]) + if(strengthen_rate > 1) + strengthen_rate = 1 + else if(strengthen_rate < 0) + strengthen_rate = 0 + else if( href_list["max_field_strength"] ) + max_field_strength += text2num(href_list["max_field_strength"]) + if(max_field_strength > 1000) + max_field_strength = 1000 + else if(max_field_strength < 0) + max_field_strength = 0 + // + updateDialog() + +/obj/machinery/shield_gen/power_change() + if(stat & BROKEN) + icon_state = "broke" + else + if( powered() ) + if (src.active) + icon_state = "generator1" + else + icon_state = "generator0" + stat &= ~NOPOWER + else + spawn(rand(0, 15)) + src.icon_state = "generator0" + stat |= NOPOWER + if (src.active) + toggle() + +/obj/machinery/shield_gen/ex_act(var/severity) + + if(active) + toggle() + return ..() + +/* /obj/machinery/shield_gen/proc/check_powered() - /* check_powered = 1 if(!anchored) powered = 0 @@ -76,122 +252,14 @@ PN.newload += shieldload //uses powernet power. */ -/obj/machinery/shield_gen/process() - - if(active && field.len) - var/stored_renwicks = 0 - var/target_field_strength = min(average_field_strength + strengthen_rate, max_field_strength) - if(owned_capacitor) - var/assumed_charge = min(owned_capacitor.stored_charge, (target_field_strength / energy_conversion_rate) * field.len) - stored_renwicks = assumed_charge * energy_conversion_rate - owned_capacitor.stored_charge -= assumed_charge - - time_since_fail++ - - average_field_strength = 0 - target_field_strength = stored_renwicks / field.len - - if(!flicker_shield_glitch) - for(var/obj/effect/energy_field/E in field) - //check to see if the shield is strengthening or failing - if(E.strength > target_field_strength) - E.strength = target_field_strength - else if(E.strength + strengthen_rate > target_field_strength) - E.strength = target_field_strength - else - E.strength += strengthen_rate - - if(stored_renwicks - E.strength < 0) - E.strength = stored_renwicks - stored_renwicks -= E.strength - - average_field_strength += E.strength - //check if the current shield tile has enough energy to maintain itself - if(E.strength >= 1) - E.density = 1 - E.invisibility = 0 - else - E.density = 0 - E.invisibility = 2 - else - //the flicker shield glitch is an intersting quirk in 'older' and/or faulty shielding models - //basically, it strengthens the shields continuously until it can no longer sustain them... then it drops out for a few seconds and starts again - //this makes the shield 'flicker' every now and then until it stabilises - //when this glitch is fixed, shields will only be charged as much as is sustainable - for(var/obj/effect/energy_field/E in field) - //check to see if the shield is strengthening or failing - if(E.strength < target_field_strength) - E.strength += strengthen_rate - - if(stored_renwicks - E.strength < 0) - E.strength = stored_renwicks - stored_renwicks -= E.strength - - average_field_strength += E.strength - //check if the current shield tile has enough energy to maintain itself - if(E.strength >= 1) - E.density = 1 - E.invisibility = 0 - else - E.density = 0 - E.invisibility = 2 - - //add any leftover charge back to the capacitor - if(owned_capacitor && stored_renwicks >= 0) - owned_capacitor.stored_charge += stored_renwicks / energy_conversion_rate - - average_field_strength /= field.len - if(average_field_strength < 0) - time_since_fail = 0 - else - average_field_strength = 0 - // - updateDialog() - -/obj/machinery/shield_gen/attackby(obj/item/W, mob/user) - - 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."]" - else - user << "\red Access denied." - - else if(istype(W, /obj/item/weapon/wrench)) - src.anchored = !src.anchored - src.visible_message("\blue \icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].") - - else - src.add_fingerprint(user) - user << "\red You hit the [src.name] with your [W.name]!" - for(var/mob/M in viewers(src)) - if(M == user) continue - M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!") - -/obj/machinery/shield_gen/power_change() - if(stat & BROKEN) - icon_state = "broke" - else - if( powered() ) - if (src.active) - icon_state = "generator1" - else - icon_state = "generator0" - stat &= ~NOPOWER - else - spawn(rand(0, 15)) - src.icon_state = "generator0" - stat |= NOPOWER - if (src.active) - toggle() - /obj/machinery/shield_gen/proc/toggle() active = !active power_change() if(active) var/list/covered_turfs = get_shielded_turfs() - if(get_turf(src) in covered_turfs) - covered_turfs.Remove(get_turf(src)) + var/turf/T = get_turf(src) + if(T in covered_turfs) + covered_turfs.Remove(T) for(var/turf/O in covered_turfs) var/obj/effect/energy_field/E = new(O) field.Add(E) @@ -207,60 +275,10 @@ for(var/mob/M in view(5,src)) M << "\icon[src] You hear heavy droning fade out." -/obj/machinery/shield_gen/Topic(href, href_list[]) - ..() - if( href_list["close"] ) - usr << browse(null, "window=shield_generator") - usr.machine = null - return - else if( href_list["toggle"] ) - toggle() - else if( href_list["change_radius"] ) - field_radius += text2num(href_list["change_radius"]) - if(field_radius > 200) - field_radius = 200 - else if(field_radius < 0) - field_radius = 0 - else if( href_list["strengthen_rate"] ) - strengthen_rate += text2num(href_list["strengthen_rate"]) - if(strengthen_rate > 0.2) - strengthen_rate = 0.2 - else if(strengthen_rate < 0) - strengthen_rate = 0 - else if( href_list["max_field_strength"] ) - max_field_strength += text2num(href_list["max_field_strength"]) - if(max_field_strength > 1000) - max_field_strength = 1000 - else if(max_field_strength < 0) - max_field_strength = 0 - // - updateDialog() - -/obj/machinery/shield_gen/interact(mob/user) - if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=shield_generator") - return - var/t = "Shield Generator Control Console
" - t += "[owned_capacitor ? "Charge capacitor connected." : "Unable to locate charge capacitor!"]
" - t += "This generator is: [active ? "Online" : "Offline" ] [active ? "\[Deactivate\]" : "\[Activate\]"]
" - t += "[time_since_fail > 2 ? "Field is stable." : "Warning, field is unstable!"]
" - t += "Coverage radius (generator will need a restart to take effect): -- - [field_radius * 2]m + ++
" - t += "Overall field strength: [average_field_strength] Renwicks ([100 * average_field_strength / max_field_strength]%)
" - t += "Charge consumption: [( (min(average_field_strength + strengthen_rate, max_field_strength)) / energy_conversion_rate) * field.len] Watts/sec
" - t += "Field charge rate (approx): -- -[strengthen_rate] Renwicks/sec + ++
" - t += "Maximum field strength (avg across field): \[min\] -- -[max_field_strength] Renwicks + ++ \[max\]
" - t += "
" - t += "Close
" - user << browse(t, "window=shield_generator;size=500x800") - user.machine = src - +//grab the border tiles in a circle around this machine /obj/machinery/shield_gen/proc/get_shielded_turfs() - return list() - -/obj/machinery/shield_gen/ex_act(var/severity) - - if(active) - toggle() - return ..() + var/list/out = list() + for(var/turf/T in range(field_radius, src)) + if(get_dist(src,T) == field_radius) + out.Add(T) + return out diff --git a/code/WorkInProgress/Cael_Aislinn/external_shield_gen.dm b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_gen_external.dm similarity index 65% rename from code/WorkInProgress/Cael_Aislinn/external_shield_gen.dm rename to code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_gen_external.dm index 1b3b7bf850..f239dc9dac 100644 --- a/code/WorkInProgress/Cael_Aislinn/external_shield_gen.dm +++ b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shield_gen_external.dm @@ -1,36 +1,42 @@ - -//---------- external shield generator -//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc - -/obj/machinery/shield_gen/external/New() - ..() - -/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 + +//---------- external shield generator +//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc + +/obj/machinery/shield_gen/external/New() + ..() + +/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 + + //uncomment this for structures (but not lattices) to be surrounded by shield as well + /*if(!add_this_turf) + for(var/obj/structure/S in orange(1, O)) + if(!istype(S, /obj/structure/lattice)) + add_this_turf = 1 + break + if(add_this_turf) + for(var/obj/structure/S in O) + if(!istype(S, /obj/structure/lattice)) + add_this_turf = 0 + break*/ + + if(add_this_turf && !(O in open) && !(O in closed)) + open += O + open -= T + closed += T + + return closed diff --git a/code/WorkInProgress/Cael_Aislinn/shielding.dmi b/code/WorkInProgress/Cael_Aislinn/ShieldGen/shielding.dmi similarity index 100% rename from code/WorkInProgress/Cael_Aislinn/shielding.dmi rename to code/WorkInProgress/Cael_Aislinn/ShieldGen/shielding.dmi diff --git a/code/WorkInProgress/Cib/MedicalSideEffects.dm b/code/WorkInProgress/Cib/MedicalSideEffects.dm new file mode 100644 index 0000000000..c886a8abe9 --- /dev/null +++ b/code/WorkInProgress/Cib/MedicalSideEffects.dm @@ -0,0 +1,148 @@ +// MEDICAL SIDE EFFECT BASE +// ======================== +/datum/medical_effect/var/name = "None" +/datum/medical_effect/var/strength = 0 +/datum/medical_effect/proc/on_life(mob/living/carbon/human/H, strength) +/datum/medical_effect/proc/cure(mob/living/carbon/human/H) + + +// MOB HELPERS +// =========== +/mob/living/carbon/human/var/list/datum/medical_effect/side_effects = list() +/mob/proc/add_side_effect(name, strength = 0) +/mob/living/carbon/human/add_side_effect(name, strength = 0) + for(var/datum/medical_effect/M in src.side_effects) if(M.name == name) + M.strength = max(M.strength, 10) + return + + var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect + + for(var/T in L) + var/datum/medical_effect/M = new T + if(M.name == name) + M.strength = strength + side_effects += M + +/mob/living/carbon/human/proc/handle_medical_side_effects() + if(src.reagents.has_reagent("cryoxadone") || src.reagents.get_reagent_amount("bicaridine") >= 15 || src.reagents.get_reagent_amount("tricordrazine") >= 15) + src.add_side_effect("Headache") + + if(src.reagents.get_reagent_amount("kelotane") >= 30 || src.reagents.get_reagent_amount("dermaline") >= 15) + src.add_side_effect("Bad Stomach") + + if(src.reagents.get_reagent_amount("tramadol") >= 16 || src.reagents.get_reagent_amount("anti_toxin") >= 30) + src.add_side_effect("Cramps") + + if(src.reagents.get_reagent_amount("space_drugs") >= 10) + src.add_side_effect("Itch") + + // One full cycle(in terms of strength) every 10 minutes + var/strength_percent = sin(life_tick / 2) + + // Only do anything if the effect is currently strong enough + if(strength_percent >= 0.4) + for (var/datum/medical_effect/M in side_effects) + if (M.cure(src) || M.strength > 60) + side_effects -= M + del(M) + else + if(life_tick % 45 == 0) + M.on_life(src, strength_percent*M.strength) + // Effect slowly growing stronger + M.strength+=0.08 + +// HEADACHE +// ======== +/datum/medical_effect/headache/name = "Headache" +/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("You feel a light pain in your head.",0) + if(11 to 30) + H.custom_pain("You feel a throbbing pain in your head!",1) + if(31 to 50) + H.custom_pain("You feel an excrutiating pain in your head!",1) + H.adjustBrainLoss(1) + if(51 to INFINITY) + H.custom_pain("It feels like your head is about to split open!",1) + H.adjustBrainLoss(3) + var/datum/organ/external/O = H.organs_by_name["head"] + O.take_damage(0, 1, 0, "Headache") + +/datum/medical_effect/headache/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("alkysine") || H.reagents.has_reagent("tramadol")) + H << "\red Your head stops throbbing.." + return 1 + return 0 + +// BAD STOMACH +// =========== +/datum/medical_effect/bad_stomach/name = "Bad Stomach" +/datum/medical_effect/bad_stomach/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("You feel a bit light around the stomach.",0) + if(11 to 30) + H.custom_pain("Your stomach hurts.",0) + if(31 to 50) + H.custom_pain("You feel sick.",1) + H.adjustToxLoss(1) + if(51 to INFINITY) + H.custom_pain("You can't hold it in any longer!",1) + H.vomit() + +/datum/medical_effect/bad_stomach/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("anti_toxin")) + H << "\red Your stomach feels a little better now.." + return 1 + return 0 + + +// CRAMPS +// ====== +/datum/medical_effect/cramps/name = "Cramps" +/datum/medical_effect/cramps/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("The muscles in your body hurt a little.",0) + if(11 to 30) + H.custom_pain("The muscles in your body cramp up painfully.",0) + if(31 to 50) + H.emote("me",1,"flinches as all the muscles in their body cramp up.") + H.custom_pain("There's pain all over your body.",1) + H.adjustToxLoss(1) + if(51 to INFINITY) + H.emote("me",1,"flinches as all the muscles in their body cramp up.") + H.custom_pain("It feels as though your muscles are being ripped apart!",1) + H.apply_damage(1, used_weapon = "Cramps") + +/datum/medical_effect/cramps/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("inaprovaline")) + H << "\red The cramps let up.." + return 1 + return 0 + +// ITCH +// ==== +/datum/medical_effect/itch/name = "Itch" +/datum/medical_effect/itch/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("You feel a slight itch.",0) + if(11 to 30) + H.custom_pain("You want to scratch your itch badly.",0) + if(31 to 50) + H.emote("me",1,"shivers slightly.") + H.custom_pain("This itch makes it really hard to concentrate.",1) + H.adjustToxLoss(1) + if(51 to INFINITY) + H.emote("me",1,"shivers.") + H.custom_pain("The itch starts hurting and oozing blood.",1) + H.apply_damage(1, BURN, used_weapon = "Itch") + H.drip(1) + +/datum/medical_effect/itch/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("inaprovaline")) + H << "\red The itching stops.." + return 1 + return 0 \ No newline at end of file diff --git a/code/WorkInProgress/Mini/ATM.dm b/code/WorkInProgress/Mini/ATM.dm index 68a6c39942..9578c3a2a3 100644 --- a/code/WorkInProgress/Mini/ATM.dm +++ b/code/WorkInProgress/Mini/ATM.dm @@ -40,12 +40,23 @@ log transactions machine_id = "[station_name()] RT #[num_financial_terminals++]" /obj/machinery/atm/process() + if(stat & NOPOWER) + return + + if(linked_db && ( (linked_db.stat & NOPOWER) || !linked_db.activated ) ) + linked_db = null + authenticated_account = null + src.visible_message("\red \icon[src] [src] buzzes rudely, \"Connection to remote database lost.\"") + updateDialog() + if(ticks_left_timeout > 0) ticks_left_timeout-- if(ticks_left_timeout <= 0) authenticated_account = null if(ticks_left_locked_down > 0) ticks_left_locked_down-- + if(ticks_left_locked_down <= 0) + number_incorrect_tries = 0 for(var/obj/item/weapon/spacecash/S in src) S.loc = src.loc @@ -57,7 +68,7 @@ log transactions /obj/machinery/atm/proc/reconnect_database() for(var/obj/machinery/account_database/DB in world) - if(DB.z == src.z) + if( DB.z == src.z && !(DB.stat & NOPOWER) && DB.activated ) linked_db = DB break @@ -68,7 +79,8 @@ log transactions usr.drop_item() idcard.loc = src held_card = idcard - authenticated_account = null + if(authenticated_account && held_card.associated_account_number != authenticated_account.account_number) + authenticated_account = null else if(authenticated_account) if(istype(I,/obj/item/weapon/spacecash)) //consume the money @@ -114,11 +126,11 @@ log transactions switch(view_screen) if(CHANGE_SECURITY_LEVEL) dat += "Select a new security level for this account:

" - var/text = "Zero - Only account number or card is required to access this account. EFTPOS transactions will require a card and ask for a pin, but not verify the pin is correct." + var/text = "Zero - Either the account number or card is required to access this account. EFTPOS transactions will require a card and ask for a pin, but not verify the pin is correct." if(authenticated_account.security_level != 0) text = "[text]" dat += "[text]
" - text = "One - Both an account number and pin is required to access this account and process transactions." + text = "One - An account number and pin must be manually entered to access this account and process transactions." if(authenticated_account.security_level != 1) text = "[text]" dat += "[text]
" @@ -185,7 +197,7 @@ log transactions dat += "Unable to connect to accounts database, please retry and if the issue persists contact NanoTrasen IT support." reconnect_database() - user << browse(dat,"window=atm;size=500x650") + user << browse(dat,"window=atm;size=550x650") else user << browse(null,"window=atm") @@ -223,7 +235,7 @@ log transactions var/new_sec_level = max( min(text2num(href_list["new_security_level"]), 2), 0) authenticated_account.security_level = new_sec_level if("attempt_auth") - if(linked_db) + if(linked_db && !ticks_left_locked_down) var/tried_account_num = text2num(href_list["account_num"]) if(!tried_account_num) tried_account_num = held_card.associated_account_number @@ -231,11 +243,11 @@ log transactions authenticated_account = linked_db.attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1) if(!authenticated_account) + number_incorrect_tries++ if(previous_account_number == tried_account_num) - if(++number_incorrect_tries > max_pin_attempts) + if(number_incorrect_tries > max_pin_attempts) //lock down the atm - number_incorrect_tries = 0 - ticks_left_locked_down = 10 + ticks_left_locked_down = 30 playsound(src, 'buzz-two.ogg', 50, 1) //create an entry in the account transaction log @@ -247,9 +259,12 @@ log transactions T.time = worldtime2text() authenticated_account.transaction_log.Add(T) else + usr << "\red \icon[src] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining." previous_account_number = tried_account_num - number_incorrect_tries = 1 playsound(src, 'buzz-sigh.ogg', 50, 1) + else + usr << "\red \icon[src] incorrect pin/account combination entered." + number_incorrect_tries = 0 else playsound(src, 'twobeep.ogg', 50, 1) ticks_left_timeout = 120 @@ -263,6 +278,10 @@ log transactions T.date = current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) + + usr << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'" + + previous_account_number = tried_account_num if("withdrawal") var/amount = max(text2num(href_list["funds_amount"]),0) if(authenticated_account && amount > 0) @@ -325,8 +344,8 @@ log transactions held_card = I if("logout") authenticated_account = null - usr << browse(null,"window=atm") - return + //usr << browse(null,"window=atm") + src.attack_hand(usr) //create the most effective combination of notes to make up the requested amount @@ -368,3 +387,14 @@ log transactions I = P.id if(I) authenticated_account = linked_db.attempt_account_access(I.associated_account_number) + if(authenticated_account) + human_user << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'" + + //create a transaction log entry + var/datum/transaction/T = new() + T.target_name = authenticated_account.owner_name + T.purpose = "Remote terminal access" + T.source_terminal = machine_id + T.date = current_date_string + T.time = worldtime2text() + authenticated_account.transaction_log.Add(T) diff --git a/code/WorkInProgress/Uristqwerty/transit_tube.dmi b/code/WorkInProgress/Uristqwerty/transit_tube.dmi new file mode 100644 index 0000000000..e708700180 Binary files /dev/null and b/code/WorkInProgress/Uristqwerty/transit_tube.dmi differ diff --git a/code/WorkInProgress/Uristqwerty/transit_tube_pod.dmi b/code/WorkInProgress/Uristqwerty/transit_tube_pod.dmi new file mode 100644 index 0000000000..a52b80f820 Binary files /dev/null and b/code/WorkInProgress/Uristqwerty/transit_tube_pod.dmi differ diff --git a/code/WorkInProgress/Uristqwerty/transit_tube_station.dmi b/code/WorkInProgress/Uristqwerty/transit_tube_station.dmi new file mode 100644 index 0000000000..ca8515fded Binary files /dev/null and b/code/WorkInProgress/Uristqwerty/transit_tube_station.dmi differ diff --git a/code/WorkInProgress/Uristqwerty/transit_tubes.dm b/code/WorkInProgress/Uristqwerty/transit_tubes.dm new file mode 100644 index 0000000000..96fffda15a --- /dev/null +++ b/code/WorkInProgress/Uristqwerty/transit_tubes.dm @@ -0,0 +1,405 @@ + +// Basic transit tubes. Straight pieces, curved sections, +// and basic splits/joins (no routing logic). +// Mappers: you can use "Generate Instances from Icon-states" +// to get the different pieces. +/obj/structure/transit_tube + icon = 'transit_tube.dmi' + icon_state = "E-W" + density = 1 + layer = 3.1 + anchored = 1.0 + var/list/tube_dirs = null + var/exit_delay = 2 + var/enter_delay = 1 + + +// A place where tube pods stop, and people can get in or out. +// Mappers: use "Generate Instances from Directions" for this +// one. +/obj/structure/transit_tube/station + icon = 'transit_tube_station.dmi' + icon_state = "closed" + exit_delay = 2 + enter_delay = 3 + var/pod_moving = 0 + var/automatic_launch_time = 100 + + var/const/OPEN_DURATION = 6 + var/const/CLOSE_DURATION = 6 + + + +/obj/structure/transit_tube_pod + icon = 'transit_tube_pod.dmi' + icon_state = "pod" + animate_movement = FORWARD_STEPS + var/moving = 0 + var/datum/gas_mixture/air_contents + + + +/obj/structure/transit_tube/station/New(loc) + ..(loc) + + spawn(automatic_launch_time) + launch_pod() + + +/obj/structure/transit_tube/station/Bumped(mob/AM as mob|obj) + if(!pod_moving && icon_state == "open" && istype(AM, /mob)) + for(var/obj/structure/transit_tube_pod/pod in loc) + if(!pod.moving && pod.dir in directions()) + AM.loc = pod + return + + + +/obj/structure/transit_tube/station/attack_hand(mob/user as mob) + if(!pod_moving) + for(var/obj/structure/transit_tube_pod/pod in loc) + if(!pod.moving && pod.dir in directions()) + if(icon_state == "closed") + open_animation() + + else if(icon_state == "open") + close_animation() + + + +/obj/structure/transit_tube/station/proc/open_animation() + if(icon_state == "closed") + icon_state = "opening" + spawn(OPEN_DURATION) + if(icon_state == "opening") + icon_state = "open" + + + +/obj/structure/transit_tube/station/proc/close_animation() + if(icon_state == "open") + icon_state = "closing" + spawn(CLOSE_DURATION) + if(icon_state == "closing") + icon_state = "closed" + + + +/obj/structure/transit_tube/station/proc/launch_pod() + for(var/obj/structure/transit_tube_pod/pod in loc) + if(!pod.moving && pod.dir in directions()) + spawn(5) + pod_moving = 1 + close_animation() + sleep(CLOSE_DURATION + 2) + if(icon_state == "closed" && pod) + pod.follow_tube() + + pod_moving = 0 + + return + + + +/obj/structure/transit_tube/proc/should_stop_pod(pod, from_dir) + return 0 + + + +/obj/structure/transit_tube/station/should_stop_pod(pod, from_dir) + return 1 + + + +/obj/structure/transit_tube/proc/pod_stopped(pod, from_dir) + return 0 + + + +/obj/structure/transit_tube/station/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir) + pod_moving = 1 + spawn(5) + open_animation() + sleep(OPEN_DURATION + 2) + pod_moving = 0 + pod.mix_air() + + if(automatic_launch_time) + var/const/wait_step = 5 + var/i = 0 + while(i < automatic_launch_time) + sleep(wait_step) + i += wait_step + + if(pod_moving || icon_state != "open") + return + + launch_pod() + + + +// Returns a /list of directions this tube section can +// connect to. +/obj/structure/transit_tube/proc/directions() + return tube_dirs + + + +/obj/structure/transit_tube/proc/has_entrance(from_dir) + from_dir = turn(from_dir, 180) + + for(var/direction in directions()) + if(direction == from_dir) + return 1 + + return 0 + + + +/obj/structure/transit_tube/proc/has_exit(in_dir) + for(var/direction in directions()) + if(direction == in_dir) + return 1 + + return 0 + + + +// Searches for an exit direction within 45 degrees of the +// specified dir. Returns that direction, or 0 if none match. +/obj/structure/transit_tube/proc/get_exit(in_dir) + var/near_dir = 0 + var/in_dir_cw = turn(in_dir, -45) + var/in_dir_ccw = turn(in_dir, 45) + + for(var/direction in directions()) + if(direction == in_dir) + return direction + + else if(direction == in_dir_cw) + near_dir = direction + + else if(direction == in_dir_ccw) + near_dir = direction + + return near_dir + + + +/obj/structure/transit_tube/proc/exit_delay(pod, to_dir) + return exit_delay + +/obj/structure/transit_tube/proc/enter_delay(pod, to_dir) + return enter_delay + + + +/obj/structure/transit_tube_pod/proc/follow_tube() + if(moving) + return + + moving = 1 + + spawn() + var/obj/structure/transit_tube/current_tube = null + var/next_dir + var/next_loc + + for(var/obj/structure/transit_tube/tube in loc) + if(tube.has_exit(dir)) + current_tube = tube + break + + while(current_tube) + next_dir = current_tube.get_exit(dir) + + if(!next_dir) + break + + sleep(current_tube.exit_delay(src, dir)) + next_loc = get_step(loc, next_dir) + + current_tube = null + for(var/obj/structure/transit_tube/tube in next_loc) + if(tube.has_entrance(next_dir)) + current_tube = tube + break + + if(current_tube == null) + dir = next_dir + step(src, dir) + break + + sleep(current_tube.enter_delay(src, next_dir)) + dir = next_dir + loc = next_loc + + if(current_tube && current_tube.should_stop_pod(src, next_dir)) + current_tube.pod_stopped(src, dir) + break + + moving = 0 + + + +// HUGE HACK: Because the pod isn't a mecha, travelling through tubes over space +// won't protect people from space. +// This avoids editing an additional file, so that adding +// tubes to a SS13 codebase is a simple as dropping this code file and the +// required icon files somewhere where BYOND can find them. +/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment) + if(!istype(loc, /obj/structure/transit_tube_pod)) + return ..(environment) + + + +/obj/structure/transit_tube_pod/return_air() + var/datum/gas_mixture/GM = new() + GM.oxygen = MOLES_O2STANDARD * 2 + GM.nitrogen = MOLES_N2STANDARD + GM.temperature = T20C + return GM + +// For now, copying what I found in an unused FEA file (and almost identical in a +// used ZAS file). Means that assume_air and remove_air don't actually alter the +// air contents. +/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver) + return 0 + +/obj/structure/transit_tube_pod/remove_air(amount) + var/oxygen = MOLES_O2STANDARD + var/carbon_dioxide = 0 + var/nitrogen = MOLES_N2STANDARD + var/toxins = 0 + + var/datum/gas_mixture/GM = new() + + var/sum = oxygen + carbon_dioxide + nitrogen + toxins + if(sum>0) + GM.oxygen = (oxygen/sum)*amount + GM.carbon_dioxide = (carbon_dioxide/sum)*amount + GM.nitrogen = (nitrogen/sum)*amount + GM.toxins = (toxins/sum)*amount + + GM.temperature = T20C + GM.update_values() //Needed in ZAS to prevent suffocation. Not present in FEA. Comment/uncomment as nessecary. + + return GM + + + +// Called when a pod arrives at, and before a pod departs from a station, +// giving it a chance to mix its internal air supply with the turf it is +// currently on. +/obj/structure/transit_tube_pod/proc/mix_air() + //Needs to be implemented at some point + + + +// When the player moves, check if the pos is currently stopped at a station. +// if it is, check the direction. If the direction matches the direction of +// the station, try to exit. If the direction matches one of the station's +// tube directions, launch the pod in that direction. +/obj/structure/transit_tube_pod/relaymove(mob/mob, direction) + if(!moving && istype(mob, /mob) && mob.client) + for(var/obj/structure/transit_tube/station/station in loc) + if(!station.pod_moving && (dir in station.directions())) + if(direction == station.dir) + if(station.icon_state == "open") + mob.loc = loc + mob.client.Move(get_step(loc, direction), direction) + + else + station.open_animation() + + else if(direction in station.directions()) + dir = direction + station.launch_pod() + + + +/obj/structure/transit_tube/New(loc) + ..(loc) + + if(tube_dirs == null) + init_dirs() + + + +// Parse the icon_state into a list of directions. +// This means that mappers can use Dream Maker's built in +// "Generate Instances from Icon-states" option to get all +// variations. Additionally, as a separate proc, sub-types +// can handle it more intelligently. +/obj/structure/transit_tube/proc/init_dirs() + tube_dirs = parse_dirs(icon_state) + + if(copytext(icon_state, 1, 3) == "D-") + density = 0 + + + +// Tube station directions are simply 90 to either side of +// the exit. +/obj/structure/transit_tube/station/init_dirs() + tube_dirs = list(turn(dir, 90), turn(dir, -90)) + + + +// Uses a list() to cache return values. Since they should +// never be edited directly, all tubes with a certain +// icon_state can just reference the same list. In theory, +// reduces memory usage, and improves CPU cache usage. +// In reality, I don't know if that is quite how BYOND works, +// but it is probably safer to assume the existence of, and +// rely on, a sufficiently smart compiler/optimizer. +/obj/structure/transit_tube/proc/parse_dirs(text) + var/global/list/direction_table = list() + + if(text in direction_table) + return direction_table[text] + + var/list/split_text = stringsplit(text, "-") + + // If the first token is D, the icon_state represents + // a purely decorative tube, and doesn't actually + // connect to anything. + if(split_text[1] == "D") + direction_table[text] = list() + return null + + var/list/directions = list() + + for(var/text_part in split_text) + var/direction = text2dir_extended(text_part) + + if(direction > 0) + directions += direction + + direction_table[text] = directions + return directions + + + +// A copy of text2dir, extended to accept one and two letter +// directions, and to clearly return 0 otherwise. +/obj/structure/transit_tube/proc/text2dir_extended(direction) + switch(uppertext(direction)) + if("NORTH", "N") + return 1 + if("SOUTH", "S") + return 2 + if("EAST", "E") + return 4 + if("WEST", "W") + return 8 + if("NORTHEAST", "NE") + return 5 + if("NORTHWEST", "NW") + return 9 + if("SOUTHEAST", "SE") + return 6 + if("SOUTHWEST", "SW") + return 10 + else + return 0 \ No newline at end of file diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index d0b8b90d6b..566a587b8a 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -66,6 +66,7 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al for(var/T in paths) var/datum/surgery_step/S = new T surgery_steps += S + sort_surgeries() /* // Uncomment to debug chemical reaction list. /client/verb/debug_chemical_list() diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 4311007cbf..f537bbae3e 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -63,8 +63,8 @@ var/server var/banappeals - var/wikiurl - var/forumurl + var/wikiurl = "http://baystation12.net/wiki/index.php?title=Main_Page" + var/forumurl = "http://baystation12.net/forums/" //Alert level description var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced." @@ -109,6 +109,8 @@ var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database + var/simultaneous_pm_warning_timeout = 100 + var/use_recursive_explosions //Defines whether the server uses recursive or circular explosions. var/assistant_maint = 0 //Do assistants get maint access? diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 2247b7c8f3..bdbe50b31a 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -62,6 +62,7 @@ datum/controller/game_controller/proc/setup() setup_objects() setupgenetics() setupfactions() + setup_economy() for(var/i=0, i