Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12 into HTML

This commit is contained in:
Chinsky
2013-03-08 03:26:41 +04:00
288 changed files with 18429 additions and 17128 deletions

View File

@@ -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"

View File

@@ -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
/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)]."

View File

@@ -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: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card : "-----"]</a><br>"
if(access_level > 0)
dat += "<a href='?src=\ref[src];toggle_activated=1'>[activated ? "Disable" : "Enable"] remote access</a><br>"
dat += "You may not edit accounts at this terminal, only create and view them.<br>"
if(creating_new_account)
dat += "<br>"
@@ -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] <span class='info'>Accounts synched across all databases in range.</span>"
usr << "\icon[src] <span class='info'>Accounts synched across all NanoTrasen financial databases.</span>"
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 += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
//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) )

View File

@@ -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 = "<b>[eftpos_name] reference</b><br><br>"
R.info += "Access code: [access_code]<br><br>"
R.info += "<b>Do not lose this code, or the device will have to be replaced.</b><br>"
R.info += "<b>Do not lose or misplace this code.</b><br>"
//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 += "<HR><i>This paper has been stamped by the EFTPOS device.</i>"
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 = "<b>[eftpos_name]</b><br>"
dat += "<i>This terminal is</i> [machine_id]. <i>Report this code when contacting NanoTrasen IT Support</i><br>"
@@ -67,48 +72,62 @@
dat += "Transaction purpose: <a href='?src=\ref[src];choice=trans_purpose'>[transaction_purpose]</a><br>"
dat += "Value: <a href='?src=\ref[src];choice=trans_value'>$[transaction_amount]</a><br>"
dat += "Linked account: <a href='?src=\ref[src];choice=link_account'>[linked_account ? linked_account.owner_name : "None"]</a><hr>"
dat += "<a href='?src=\ref[src];choice=change_code'>Change access code</a>"
dat += "<a href='?src=\ref[src];choice=change_code'>Change access code</a><br>"
dat += "<a href='?src=\ref[src];choice=change_id'>Change EFTPOS ID</a><br>"
dat += "Scan card to reset access code <a href='?src=\ref[src];choice=reset'>\[------\]</a>"
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]<span class='warning'>Unable to connect to linked account.</span>"
else
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
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]<span class='warning'>Incorrect code entered.</span>"
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]<span class='warning'>Incorrect code entered.</span>"
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 << "<span class='warning'>Unable to connect to accounts database.</span>"
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
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]<span class='warning'>Unable to link accounts.</span>"
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]<span class='info'>Access code reset to 0.</span>"
else if (istype(I, /obj/item/weapon/card/emag))
access_code = 0
usr << "\icon[src]<span class='info'>Access code reset to 0.</span>"
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("<span class='info'>[usr] swipes a card through [src].</span>")
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]<span class='warning'>You don't have that much money!<span>"
else
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.<span>"
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
else
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.<span>"
else
..()

View File

@@ -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

View File

@@ -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")

View File

@@ -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<68>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<65>s school photo.",\
"Clone accused of stealing other clones<65>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")

View File

@@ -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)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -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 += "<i>The console is dark and nonresponsive.</i>"
else
dat += "<B>Reactor Core Primary Monitor</B><BR>"
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 += "<b>Device tag:</b> [cur_viewed_device.id_tag ? cur_viewed_device.id_tag : "UNSET"]<br>"
dat += "<font color=blue>Device [cur_viewed_device.owned_field ? "activated" : "deactivated"].</font><br>"
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];toggle_active=1'>\[Bring field [cur_viewed_device.owned_field ? "offline" : "online"]\]</a><br>"
dat += "<b>Device [cur_viewed_device.anchored ? "secured" : "unsecured"].</b><br>"
dat += "<hr>"
dat += "<b>Field encumbrance:</b> [cur_viewed_device.owned_field ? 0 : "NA"]<br>"
dat += "<b>Field strength:</b> [cur_viewed_device.field_strength] Wm^3<br>"
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1000'>\[----\]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-100'>\[--- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-10'>\[-- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1'>\[- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1'>\[+ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=10'>\[++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=100'>\[+++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1000'>\[++++\]</a><br>"
dat += "<b>Field frequency:</b> [cur_viewed_device.field_frequency] MHz<br>"
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1000'>\[----\]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-100'>\[--- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-10'>\[-- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1'>\[- \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1'>\[+ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=10'>\[++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=100'>\[+++ \]</a> \
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1000'>\[++++\]</a><br>"
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 += "<b>Power status:</b> [power_stat]<br>"
else
dat += "<a href='?src=\ref[src];scan=1'>\[Refresh device list\]</a><br><br>"
if(connected_devices.len)
dat += "<table width='100%' border=1>"
dat += "<tr>"
dat += "<td><b>Device tag</b></td>"
dat += "<td></td>"
dat += "</tr>"
for(var/obj/machinery/power/rust_core/C in connected_devices)
if(!check_core_status(C))
connected_devices.Remove(C)
continue
dat += "<tr>"
dat += "<td>[C.id_tag]</td>"
dat += "<td><a href='?src=\ref[src];manage_individual=\ref[C]'>\[Manage\]</a></td>"
dat += "</tr>"
dat += "</table>"
else
dat += "No devices connected.<br>"
dat += "<hr>"
dat += "<a href='?src=\ref[src];refresh=1'>Refresh</a> "
dat += "<a href='?src=\ref[src];close=1'>Close</a>"
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

File diff suppressed because it is too large Load Diff

View File

@@ -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 += "<i>The console is dark and nonresponsive.</i>"
else
dat += "<b>RUST Tokamak pattern Electromagnetic Field Generator</b><br>"
dat += "<b>Device ID tag: </b> [id_tag ? id_tag : "UNSET"] <a href='?src=\ref[src];new_id_tag=1'>\[Modify\]</a><br>"
dat += "<a href='?src=\ref[src];toggle_active=1'>\[[owned_field ? "Deactivate" : "Activate"]\]</a><br>"
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access to this device" : "Enable remote access to this device"]\]</a><br>"
dat += "<hr>"
dat += "<b>Field strength:</b> [field_strength]Wm^3<br>"
dat += "<a href='?src=\ref[src];str=-1000'>\[----\]</a> \
<a href='?src=\ref[src];str=-100'>\[--- \]</a> \
<a href='?src=\ref[src];str=-10'>\[-- \]</a> \
<a href='?src=\ref[src];str=-1'>\[- \]</a> \
<a href='?src=\ref[src];str=1'>\[+ \]</a> \
<a href='?src=\ref[src];str=10'>\[++ \]</a> \
<a href='?src=\ref[src];str=100'>\[+++ \]</a> \
<a href='?src=\ref[src];str=1000'>\[++++\]</a><br>"
dat += "<b>Field frequency:</b> [field_frequency]MHz<br>"
dat += "<a href='?src=\ref[src];freq=-1000'>\[----\]</a> \
<a href='?src=\ref[src];freq=-100'>\[--- \]</a> \
<a href='?src=\ref[src];freq=-10'>\[-- \]</a> \
<a href='?src=\ref[src];freq=-1'>\[- \]</a> \
<a href='?src=\ref[src];freq=1'>\[+ \]</a> \
<a href='?src=\ref[src];freq=10'>\[++ \]</a> \
<a href='?src=\ref[src];freq=100'>\[+++ \]</a> \
<a href='?src=\ref[src];freq=1000'>\[++++\]</a><br>"
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 += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
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

View File

@@ -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 = "<B>Reactor Core Primary Monitor</B><BR>"
if(core_generator)
t += "<font color=blue>[core_generator.on ? "Core Generator connected" : "Core Generator operational"]</font><br>"
if(core_generator.owned_field)
t += "<font color=green>Core suspension field online</font> <a href='?src=\ref[src];shutdown=1'>\[Bring field offline\]</a><br>"
t += "Electromagnetic plasma suspension field status:<br>"
t += " <font color=blue>Strength (T): [core_generator.owned_field.field_strength]</font> <a href='?src=\ref[src];modify_field_strength=1'>\[Modify\]</a><br>"
t += " <font color=blue>Energy levels (MeV): [core_generator.owned_field.mega_energy]</font><br>"
t += " <font color=blue>Core frequency: [core_generator.owned_field.frequency]</font><br>"
t += " <font color=blue>Moles of plasma: [core_generator.owned_field.held_plasma.toxins]</font><br>"
t += " <font color=blue>Core temperature: [core_generator.owned_field.held_plasma.temperature]</font><br>"
t += "<hr>"
t += "<b>Core atomic and subatomic constituents:</font></b><br>"
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 += " <font color=green>[reagent]:</font> [core_generator.owned_field.dormant_reactant_quantities[reagent]]<br>"
else
t += " <font color=blue>No reactants present.</font><br>"
else
t += "<font color=red>Core suspension field offline</font> <a href='?src=\ref[src];startup=1'>\[Bring field online\]</a><br>"
else
t += "<b><font color=red>Core Generator unresponsive</font></b><br>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=core_monitor;size=500x400")
user.machine = src

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

View File

@@ -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()
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -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
..()

View File

@@ -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]<br>"
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 = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
if(locked)
t += "Swipe your ID to unlock this console."
else
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a><br>"
t += "<A href='?src=\ref[src];activate=1'><b>Activate Fuel Synthesis</b></A><BR> (fuel assemblies require no more than [max_assembly_amount] rods).<br>"
t += "<hr>"
t += "- New fuel assembly constituents:- <br>"
for(var/reagent in new_assembly_quantities)
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];reagent=1'>Modify</A>\]<br>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=fuelcomp;size=500x800")
user.machine = src
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];change_reagent=[reagent]'>Modify</A>\]<br>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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]<br>"
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()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

View File

@@ -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
..()

View File

@@ -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 = "<B>Reactor Core Fuel Control</B><BR>"
var/cooling = 0
for(var/stage in stage_status)
if(stage_status[stage])
t += "Fuel injection: <font color=blue>Active</font><br>"
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
cooling = 1
break
if(!cooling)
t += "Fuel injection: <font color=blue>Cooling</font><br>"
t += "----<br>"
//
t += "Fuel depletion announcement: "
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
t += "Stage progression announcement: "
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
t += "<hr>"
t += "<table border=1><tr>"
t += "<td><b>Injector Status</b></td>"
t += "<td><b>Injection interval (sec)</b></td>"
t += "<td><b>Assembly consumption per injection</b></td>"
t += "<td><b>Fuel Assembly Port</b></td>"
t += "<td><b>Assembly depletion percentage</b></td>"
t += "</tr>"
for(var/stage_name in fuel_injectors)
var/list/cur_stage = fuel_injectors[stage_name]
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> [stage_name]</font>, [stage_status[stage_name] ? "<font color=green>Active</font> <a href='?src=\ref[src];begincool=[stage_name]'>\[Enter cooldown\]</a>" : "Cooling <a href='?src=\ref[src];beginstage=[stage_name]'>\[Begin injection\]</a>"]</td></tr>"
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
t += "<tr>"
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[Injector.owned_assembly_port.cur_assembly.percent_depleted]%" : ""]</td>"
t += "</tr>"
t += "</table>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=fuel_monitor;size=500x600")
user.machine = src
var/dat = "<B>Reactor Core Fuel Control</B><BR>"
/*dat += "<b>Fuel depletion announcement:</b> "
dat += "[announce_fueldepletion == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_fueldepletion=0'>\[Disable\]</a>"] "
dat += "[announce_fueldepletion == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_fueldepletion=1'>\[Announce\]</a>"] "
dat += "[announce_fueldepletion == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_fueldepletion=2'>\[Broadcast\]</a>"]<br>"
dat += "<b>Stage progression announcement:</b> "
dat += "[announce_stageprogression == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_stageprogression=0'>\[Disable\]</a>"] "
dat += "[announce_stageprogression == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_stageprogression=1'>\[Announce\]</a>"] "
dat += "[announce_stageprogression == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_stageprogression=2'>\[Broadcast\]</a>"]<br>"*/
dat += "<hr>"
dat += "<b>Detected devices</b> <a href='?src=\ref[src];scan=1'>\[Refresh list\]</a>"
dat += "<table border=1 width='100%'>"
dat += "<tr>"
dat += "<td><b>ID</b></td>"
dat += "<td><b>Assembly</b></td>"
dat += "<td><b>Consumption</b></td>"
dat += "<td><b>Depletion</b></td>"
dat += "<td><b>Duration</b></td>"
dat += "<td><b>Next stage</b></td>"
dat += "<td></td>"
dat += "<td></td>"
dat += "</tr>"
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
dat += "<tr>"
dat += "<td>[I.id_tag]</td>"
if(I.cur_assembly)
dat += "<td><a href='?src=\ref[I];toggle_injecting=1;update_extern=\ref[src]'>\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]</a></td>"
else
dat += "<td>None</td>"
dat += "<td>[I.fuel_usage * 100]%</td>"
if(I.cur_assembly)
dat += "<td>[I.cur_assembly.percent_depleted * 100]%</td>"
else
dat += "<td>NA</td>"
if(stage_times.Find(I.id_tag))
dat += "<td>[ticks_this_stage]/[stage_times[I.id_tag]]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Modify</td>"
else
dat += "<td>[ticks_this_stage]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Set</td>"
if(proceeding_stages.Find(I.id_tag))
dat += "<td><a href='?src=\ref[src];set_next_stage=[I.id_tag]'>[proceeding_stages[I.id_tag]]</a></td>"
else
dat += "<td>None <a href='?src=\ref[src];set_next_stage=[I.id_tag]'>\[modify\]</a></td>"
dat += "<td><a href='?src=\ref[src];toggle_stage=[I.id_tag]'>\[[active_stages.Find(I.id_tag) ? "Deactivate stage" : "Activate stage "] \]</a></td>"
dat += "</tr>"
dat += "</table>"
dat += "<hr>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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

View File

@@ -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 = "<B>Reactor Core Fuel Injector</B><hr>"
t += "<b>Stage:</b> <font color=blue>[stage]</font><br>"
t += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];end_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];begin_injecting=1'>\[Enable\]</a>"]<br>"
t += "<b>Interval (sec):</b> <font color=blue>[rate/10]</font> <a href='?src=\ref[src];cyclerate=1'>\[Modify\]</a><br>"
t += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
/*
var/t = "<B>Reactor Core Fuel Control</B><BR>"
t += "Current fuel injection stage: [active_stage]<br>"
if(active_stage == "Cooling")
//t += "<a href='?src=\ref[src];restart=1;'>Restart injection cycle</a><br>"
t += "----<br>"
else
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
t += "Fuel depletion announcement: "
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
t += "Stage progression announcement: "
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
t += "<hr>"
t += "<table border=1><tr>"
t += "<td><b>Injector Status</b></td>"
t += "<td><b>Injection interval (sec)</b></td>"
t += "<td><b>Assembly consumption per injection</b></td>"
t += "<td><b>Fuel Assembly Port</b></td>"
t += "<td><b>Assembly depletion percentage</b></td>"
t += "</tr>"
for(var/stage in fuel_injectors)
var/list/cur_stage = fuel_injectors[stage]
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> <font color=blue>[stage]</font> [active_stage == stage ? "<font color=green> (Currently active)</font>" : "<a href='?src=\ref[src];beginstage=[stage]'>Activate</a>"]</td></tr>"
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
t += "<tr>"
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[100 - Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
t += "</tr>"
t += "</table>"
*/
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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 += "<i>The console is dark and nonresponsive.</i>"
else
dat += "<B>Reactor Core Fuel Injector</B><hr>"
dat += "<b>Device ID tag:</b> [id_tag] <a href='?src=\ref[src];modify_tag=1'>\[Modify\]</a><br>"
dat += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Enable\]</a>"]<br>"
dat += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
dat += "<b>Fuel assembly port:</b> "
dat += "<a href='?src=\ref[src];fuel_assembly=1'>\[[cur_assembly ? "Eject assembly to port" : "Draw assembly from port"]\]</a> "
if(cur_assembly)
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[Emergency eject\]</a><br>"
else
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[[emergency_insert_ready ? "Cancel emergency insertion" : "Emergency insert"]\]</a><br>"
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 += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access" : "Enable remote access"]\]</a><br>"
dat += "<hr>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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].")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -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
/*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -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()

View File

@@ -67,4 +67,8 @@
//particle.invisibility = 2
//
return particle
*/
*/
/obj/machinery/computer/rust_radiation_monitor
name = "Radiation Monitor"
icon_state = "power"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 B

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

View File

@@ -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."
..()

View File

@@ -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"

View File

@@ -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

View File

@@ -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 = "<B>Shield Capacitor Control Console</B><BR>"
t += "[target_generator ? "<font color=green>Shield generator connected.</font>" : "<font color=red>Unable to locate shield generator!</font>"]<br>"
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
t += "Capacitor charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
t += "Capacitor charge rate (approx): <a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> <a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> <a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec <a href='?src=\ref[src];charge_rate=100'>\[+\]</a> <a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> <a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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 = "<B>Shield Capacitor Control Console</B><br><br>"
if(locked)
t += "<i>Swipe your ID card to begin.</i>"
else
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
t += "Charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
t += "Charge rate: \
<a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> \
<a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> \
<a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec \
<a href='?src=\ref[src];charge_rate=100'>\[+\]</a> \
<a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> \
<a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
t += "<hr>"
t += "<A href='?src=\ref[src]'>Refresh</A> "
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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

View File

@@ -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 = "<B>Shield Generator Control Console</B><BR><br>"
if(locked)
t += "<i>Swipe your ID card to begin.</i>"
else
t += "[owned_capacitor ? "<font color=green>Charge capacitor connected.</font>" : "<font color=red>Unable to locate charge capacitor!</font>"]<br>"
t += "This generator is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
t += "[time_since_fail > 2 ? "<font color=green>Field is stable.</font>" : "<font color=red>Warning, field is unstable!</font>"]<br>"
t += "Coverage radius (restart required): \
<a href='?src=\ref[src];change_radius=-5'>--</a> \
<a href='?src=\ref[src];change_radius=-1'>-</a> \
[field_radius * 2]m \
<a href='?src=\ref[src];change_radius=1'>+</a> \
<a href='?src=\ref[src];change_radius=5'>++</a><br>"
t += "Overall field strength: [average_field_strength] Renwicks ([max_field_strength ? 100 * average_field_strength / max_field_strength : "NA"]%)<br>"
t += "Charge rate: <a href='?src=\ref[src];strengthen_rate=-0.1'>--</a> \
<a href='?src=\ref[src];strengthen_rate=-0.01'>-</a> \
[strengthen_rate] Renwicks/sec \
<a href='?src=\ref[src];strengthen_rate=0.01'>+</a> \
<a href='?src=\ref[src];strengthen_rate=0.1'>++</a><br>"
t += "Upkeep energy: [field.len * average_field_strength / energy_conversion_rate] Watts/sec<br>"
t += "Additional energy required to charge: [field.len * strengthen_rate / energy_conversion_rate] Watts/sec<br>"
t += "Maximum field strength: \
<a href='?src=\ref[src];max_field_strength=-100'>\[min\]</a> \
<a href='?src=\ref[src];max_field_strength=-10'>--</a> \
<a href='?src=\ref[src];max_field_strength=-1'>-</a> \
[max_field_strength] Renwicks \
<a href='?src=\ref[src];max_field_strength=1'>+</a> \
<a href='?src=\ref[src];max_field_strength=10'>++</a> \
<a href='?src=\ref[src];max_field_strength=100'>\[max\]</a><br>"
t += "<hr>"
t += "<A href='?src=\ref[src]'>Refresh</A> "
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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 = "<B>Shield Generator Control Console</B><BR>"
t += "[owned_capacitor ? "<font color=green>Charge capacitor connected.</font>" : "<font color=red>Unable to locate charge capacitor!</font>"]<br>"
t += "This generator is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
t += "[time_since_fail > 2 ? "<font color=green>Field is stable.</font>" : "<font color=red>Warning, field is unstable!</font>"]<br>"
t += "Coverage radius (generator will need a restart to take effect): <a href='?src=\ref[src];change_radius=-5'>--</a> <a href='?src=\ref[src];change_radius=-1'>-</a> [field_radius * 2]m <a href='?src=\ref[src];change_radius=1'>+</a> <a href='?src=\ref[src];change_radius=5'>++</a><br>"
t += "Overall field strength: [average_field_strength] Renwicks ([100 * average_field_strength / max_field_strength]%)<br>"
t += "Charge consumption: [( (min(average_field_strength + strengthen_rate, max_field_strength)) / energy_conversion_rate) * field.len] Watts/sec<br>"
t += "Field charge rate (approx): <a href='?src=\ref[src];strengthen_rate=-0.1'>--</a> <a href='?src=\ref[src];strengthen_rate=-0.01'>-</a>[strengthen_rate] Renwicks/sec <a href='?src=\ref[src];strengthen_rate=0.01'>+</a> <a href='?src=\ref[src];strengthen_rate=0.1'>++</a><br>"
t += "Maximum field strength (avg across field): <a href='?src=\ref[src];max_field_strength=-100'>\[min\]</a> <a href='?src=\ref[src];max_field_strength=-10'>--</a> <a href='?src=\ref[src];max_field_strength=-1'>-</a>[max_field_strength] Renwicks <a href='?src=\ref[src];max_field_strength=1'>+</a> <a href='?src=\ref[src];max_field_strength=10'>++</a> <a href='?src=\ref[src];max_field_strength=100'>\[max\]</a><br>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
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

View File

@@ -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

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -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

View File

@@ -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:<br><hr>"
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 = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=0'>[text]</a>"
dat += "[text]<hr>"
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 = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=1'>[text]</a>"
dat += "[text]<hr>"
@@ -185,7 +197,7 @@ log transactions
dat += "<span class='warning'>Unable to connect to accounts database, please retry and if the issue persists contact NanoTrasen IT support.</span>"
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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -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

View File

@@ -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()

View File

@@ -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?

View File

@@ -62,6 +62,7 @@ datum/controller/game_controller/proc/setup()
setup_objects()
setupgenetics()
setupfactions()
setup_economy()
for(var/i=0, i<max_secret_rooms, i++)
make_mining_asteroid_secret()
@@ -190,6 +191,7 @@ datum/controller/game_controller/proc/process()
//EVENTS
timer = world.timeofday
process_events()
events_cost = (world.timeofday - timer) / 10
//TICKER
@@ -277,6 +279,18 @@ datum/controller/game_controller/proc/process_powernets()
continue
powernets.Cut(i,i+1)
datum/controller/game_controller/proc/process_events()
last_thing_processed = /datum/event
var/i = 1
while(i<=events.len)
var/datum/event/Event = events[i]
if(Event)
Event.process()
i++
continue
events.Cut(i,i+1)
checkEvent()
datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now.
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
for(var/varname in master_controller.vars)

View File

@@ -118,7 +118,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
switch(H.get_species())
if("Tajaran")
icobase = 'icons/mob/human_races/r_tajaran.dmi'
if( "Soghun")
if("Unathi")
icobase = 'icons/mob/human_races/r_lizard.dmi'
if("Skrell")
icobase = 'icons/mob/human_races/r_skrell.dmi'

View File

@@ -61,6 +61,8 @@ datum/mind
New(var/key)
src.key = key
//put this here for easier tracking ingame
var/datum/money_account/initial_account
proc/transfer_to(mob/living/new_character)
if(!istype(new_character))

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
/****************************************************
INTERNAL ORGANS
****************************************************/
/*
/datum/organ/internal
name = "internal"
var/damage = 0
@@ -62,3 +64,53 @@
var/lungs = null
var/stomach = null
*/
/mob/living/carbon/human/var/list/internal_organs = list()
/datum/organ/internal
// amount of damage to the organ
var/damage = 0
var/min_bruised_damage = 10
var/min_broken_damage = 30
var/parent_organ = "chest"
/datum/organ/internal/proc/is_bruised()
return damage >= min_bruised_damage
/datum/organ/internal/proc/is_broken()
return damage >= min_broken_damage
/datum/organ/internal/New(mob/living/carbon/human/H)
..()
var/datum/organ/external/E = H.organs_by_name[src.parent_organ]
if(E.internal_organs == null)
E.internal_organs = list()
E.internal_organs += src
H.internal_organs[src.name] = src
src.owner = H
/datum/organ/internal/proc/take_damage(amount)
src.damage += amount
var/datum/organ/external/parent = owner.get_organ(parent_organ)
owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1)
/datum/organ/internal/heart
name = "heart"
parent_organ = "chest"
/datum/organ/internal/lungs
name = "lungs"
parent_organ = "chest"
/datum/organ/internal/liver
name = "liver"
parent_organ = "chest"
/datum/organ/internal/kidney
name = "kidney"
parent_organ = "chest"

View File

@@ -81,3 +81,10 @@ mob/living/carbon/human/proc/handle_pain()
maxdam = dam
if(damaged_organ)
pain(damaged_organ.display_name, maxdam, 0)
// Damage to internal organs hurts a lot.
for(var/organ_name in internal_organs)
var/datum/organ/internal/I = internal_organs[organ_name]
if(I.damage > 2) if(prob(2))
var/datum/organ/external/parent = get_organ(I.parent_organ)
src.custom_pain("You feel a sharp pain in your [parent.display_name]", 1)

View File

@@ -96,6 +96,23 @@
else if(damage_type == BURN)
return salved
// checks if wound is considered open for external infections
// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger
proc/can_infect()
if (is_treated() && damage < 10)
return 0
if (disinfected)
return 0
var/dam_coef = round(damage/10)
switch (damage_type)
if (BRUISE)
return prob(dam_coef*5) && bleeding() //bruises only infectable if bleeding
if (BURN)
return prob(dam_coef*10)
if (CUT)
return prob(dam_coef*20)
return 0
// heal the given amount of damage, and if the given amount of damage was more
// than what needed to be healed, return how much heal was left
// set @heals_internal to also heal internal organ damage
@@ -131,31 +148,31 @@
return (!(bandaged||clamped) && (damage_type == BRUISE && damage >= 20 || damage_type == CUT) && current_stage <= max_bleeding_stage && !src.internal)
/** CUTS **/
/datum/wound/cut
/datum/wound/cut/small
// link wound descriptions to amounts of damage
max_bleeding_stage = 2
stages = list("ugly ripped cut" = 20, "ripped cut" = 10, "cut" = 5, "healing cut" = 2, "small scab" = 0)
/datum/wound/deep_cut
/datum/wound/cut/deep
max_bleeding_stage = 3
stages = list("ugly deep ripped cut" = 25, "deep ripped cut" = 20, "deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0)
/datum/wound/flesh_wound
/datum/wound/cut/flesh
max_bleeding_stage = 3
stages = list("ugly ripped flesh wound" = 35, "ugly flesh wound" = 30, "flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0)
/datum/wound/gaping_wound
/datum/wound/cut/gaping
max_bleeding_stage = 2
stages = list("gaping wound" = 50, "large blood soaked clot" = 25, "large clot" = 15, "small angry scar" = 5, \
"small straight scar" = 0)
/datum/wound/big_gaping_wound
/datum/wound/cut/gaping_big
max_bleeding_stage = 2
stages = list("big gaping wound" = 60, "healing gaping wound" = 40, "large angry scar" = 10, "large straight scar" = 0)
needs_treatment = 1 // this only heals when bandaged
/datum/wound/massive_wound
datum/wound/cut/massive
max_bleeding_stage = 2
stages = list("massive wound" = 70, "massive healing wound" = 50, "massive angry scar" = 10, "massive jagged scar" = 0)
@@ -169,50 +186,51 @@
needs_treatment = 1 // this only heals when bandaged
damage_type = BRUISE
/datum/wound/bruise/monumental_bruise
/datum/wound/bruise/monumental
// implement sub-paths by starting at a later stage
/datum/wound/bruise/huge_bruise
current_stage = 1
/datum/wound/bruise/large_bruise
current_stage = 2
/datum/wound/bruise/moderate_bruise
current_stage = 3
needs_treatment = 0
/datum/wound/bruise/small_bruise
current_stage = 4
needs_treatment = 0
/datum/wound/bruise/tiny_bruise
/datum/wound/bruise/tiny
current_stage = 5
needs_treatment = 0
/datum/wound/bruise/small
current_stage = 4
needs_treatment = 0
/datum/wound/bruise/moderate
current_stage = 3
needs_treatment = 0
/datum/wound/bruise/large
current_stage = 2
/datum/wound/bruise/huge
current_stage = 1
/** BURNS **/
/datum/wound/moderate_burn
/datum/wound/burn/moderate
stages = list("ripped burn" = 10, "moderate burn" = 5, "moderate salved burn" = 2, "fresh skin" = 0)
needs_treatment = 1 // this only heals when bandaged
damage_type = BURN
/datum/wound/large_burn
/datum/wound/burn/large
stages = list("ripped large burn" = 20, "large burn" = 15, "large salved burn" = 5, "fresh skin" = 0)
needs_treatment = 1 // this only heals when bandaged
damage_type = BURN
/datum/wound/severe_burn
/datum/wound/burn/severe
stages = list("ripped severe burn" = 35, "severe burn" = 30, "severe salved burn" = 10, "burn scar" = 0)
needs_treatment = 1 // this only heals when bandaged
damage_type = BURN
/datum/wound/deep_burn
/datum/wound/burn/deep
stages = list("ripped deep burn" = 45, "deep burn" = 40, "deep salved burn" = 15, "large burn scar" = 0)
needs_treatment = 1 // this only heals when bandaged
@@ -220,7 +238,7 @@
damage_type = BURN
/datum/wound/carbonised_area
/datum/wound/burn/carbonised
stages = list("carbonised area" = 50, "treated carbonised area" = 20, "massive burn scar" = 0)
needs_treatment = 1 // this only heals when bandaged

View File

@@ -18,7 +18,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
var/access = null
var/hidden = 0
var/contraband = 0
var/group
var/group = "Operations"
/datum/supply_packs/New()
manifest += "<ul>"
@@ -258,6 +258,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
containertype = /obj/structure/largecrate/goat
containername = "Goat Crate"
access = access_hydroponics
group = "Hydroponics"
/datum/supply_packs/chicken
name = "Chicken Crate"
@@ -265,6 +266,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
containertype = /obj/structure/largecrate/chick
containername = "Chicken Crate"
access = access_hydroponics
group = "Hydroponics"
/datum/supply_packs/lisa
name = "Corgi Crate"
@@ -272,6 +274,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
cost = 50
containertype = /obj/structure/largecrate/lisa
containername = "Corgi Crate"
group = "Hydroponics"
/datum/supply_packs/seeds
name = "Seeds Crate"
@@ -338,7 +341,6 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
containername = "Medical crate"
group = "Medical / Science"
/datum/supply_packs/virus
name = "Virus crate"
contains = list(/obj/item/weapon/reagent_containers/glass/bottle/flu_virion,
@@ -353,6 +355,8 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
/obj/item/weapon/storage/box/syringes,
/obj/item/weapon/storage/box/beakers,
/obj/item/weapon/reagent_containers/glass/bottle/mutagen)
cost = 25
containertype = "/obj/structure/closet/crate/secure"
containername = "Virus crate"
access = access_cmo
group = "Medical / Science"
@@ -819,14 +823,14 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
group = "Medical / Science"
/datum/supply_packs/randomised/pizza
num_contained = 6
num_contained = 5
contains = list(/obj/item/pizzabox/margherita,
/obj/item/pizzabox/mushroom,
/obj/item/pizzabox/meat,
/obj/item/pizzabox/vegetable)
name = "Surprise pack of half a dozen pizzas"
name = "Surprise pack of five dozen pizzas"
cost = 15
containertype = /obj/structure/closet/crate
containertype = /obj/structure/closet/crate/freezer
containername = "Pizza crate"
group = "Hospitality"
@@ -847,3 +851,83 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
containertype = /obj/structure/closet
containername = "Formalwear for the best occasions."
group = "Operations"
/datum/supply_packs/rust_injector
contains = list(/obj/machinery/power/rust_fuel_injector)
name = "RUST fuel injector"
cost = 50
containertype = /obj/structure/closet/crate/secure/large
containername = "RUST injector crate"
group = "Engineering"
access = access_engine
/datum/supply_packs/rust_compressor
contains = list(/obj/item/weapon/module/rust_fuel_compressor)
name = "RUST fuel compressor circuitry"
cost = 60
containertype = /obj/structure/closet/crate/secure
containername = "RUST fuel compressor circuitry"
group = "Engineering"
access = access_engine
/datum/supply_packs/rust_assembly_port
contains = list(/obj/item/weapon/module/rust_fuel_port)
name = "RUST fuel assembly port circuitry"
cost = 40
containertype = /obj/structure/closet/crate/secure
containername = "RUST fuel assembly port circuitry"
group = "Engineering"
access = access_engine
/datum/supply_packs/rust_core
contains = list(/obj/machinery/power/rust_core)
name = "RUST Tokamak Core"
cost = 75
containertype = /obj/structure/closet/crate/secure/large
containername = "RUST tokamak crate"
group = "Engineering"
access = access_engine
/datum/supply_packs/shield_gen
contains = list(/obj/item/weapon/circuitboard/shield_gen)
name = "Experimental shield generator circuitry"
cost = 50
containertype = /obj/structure/closet/crate/secure
containername = "Experimental shield generator"
group = "Engineering"
access = access_ce
/datum/supply_packs/shield_cap
contains = list(/obj/item/weapon/circuitboard/shield_cap)
name = "Experimental shield capacitor circuitry"
cost = 50
containertype = /obj/structure/closet/crate/secure
containername = "Experimental shield capacitor"
group = "Engineering"
access = access_ce
/datum/supply_packs/eftpos
contains = list(/obj/item/device/eftpos)
name = "EFTPOS scanner"
cost = 10
containertype = /obj/structure/closet/crate
containername = "EFTPOS crate"
group = "Operations"
/datum/supply_packs/teg
contains = list(/obj/machinery/power/generator)
name = "Mark I Thermoelectric Generator"
cost = 75
containertype = /obj/structure/closet/crate/secure/large
containername = "Mk1 TEG crate"
group = "Engineering"
access = access_engine
/datum/supply_packs/circulator
contains = list(/obj/machinery/atmospherics/binary/circulator)
name = "Binary atmospheric circulator"
cost = 60
containertype = /obj/structure/closet/crate/secure/large
containername = "Atmospheric circulator crate"
group = "Engineering"
access = access_engine

View File

@@ -70,7 +70,7 @@
.manifest td:first-child {text-align:right}
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: #DEF"]}
</style></head>
<table class="manifest">
<table class="manifest" width='350px'>
<tr class='head'><th>Name</th><th>Rank</th><th>Activity</th></tr>
"}
var/even = 0
@@ -94,28 +94,31 @@
//world << "[name]: [rank]"
//cael - to prevent multiple appearances of a player/job combination, add a continue after each line
var/department = 0
if(real_rank in command_positions)
heads[name] = rank
department = 1
if(real_rank in security_positions)
sec[name] = rank
continue
department = 1
if(real_rank in engineering_positions)
eng[name] = rank
continue
department = 1
if(real_rank in medical_positions)
med[name] = rank
continue
department = 1
if(real_rank in science_positions)
sci[name] = rank
continue
department = 1
if(real_rank in civilian_positions)
civ[name] = rank
continue
department = 1
if(real_rank in nonhuman_positions)
bot[name] = rank
continue
department = 1
if(!(name in heads))
if(!department && !(name in heads))
misc[name] = rank
if(heads.len > 0)

View File

@@ -269,17 +269,17 @@
if(prob(35))
if(istype(src, /area/chapel))
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg')
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg')
else if(istype(src, /area/medical/morgue))
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/ambience/title2.ogg')
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg')
else if(type == /area)
sound = pick('sound/ambience/ambispace.ogg','sound/ambience/title2.ogg',)
sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
else if(istype(src, /area/engine))
sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
else if(istype(src, /area/AIsattele) || istype(src, /area/turret_protected/ai) || istype(src, /area/turret_protected/ai_upload) || istype(src, /area/turret_protected/ai_upload_foyer))
sound = pick('sound/ambience/ambimalf.ogg')
else if(istype(src, /area/mine/explored) || istype(src, /area/mine/unexplored))
sound = pick('sound/ambience/ambimine.ogg')
sound = pick('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
musVolume = 25
else if(istype(src, /area/tcommsat) || istype(src, /area/turret_protected/tcomwest) || istype(src, /area/turret_protected/tcomeast) || istype(src, /area/turret_protected/tcomfoyer) || istype(src, /area/turret_protected/tcomsat))
sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')

View File

@@ -1,20 +0,0 @@
/datum/event
var/Lifetime = 0
var/ActiveFor = 0
New()
..()
if(!Lifetime)
Lifetime = rand(30, 120)
proc
Announce()
Tick()
Die()
LongTerm()
LongTermEvent = ActiveEvent
ActiveEvent = null

View File

@@ -1,88 +0,0 @@
/obj/effect/bhole
name = "black hole"
icon = 'objects.dmi'
desc = "FUCK FUCK FUCK AAAHHH"
icon_state = "bhole3"
opacity = 1
unacidable = 1
density = 0
anchored = 1
/obj/effect/bhole/New()
spawn(4)
controller()
/obj/effect/bhole/proc/controller()
while(src)
if(!isturf(loc))
del(src)
return
//DESTROYING STUFF AT THE EPICENTER
for(var/mob/living/M in orange(1,src))
del(M)
for(var/obj/O in orange(1,src))
del(O)
for(var/turf/simulated/ST in orange(1,src))
ST.ReplaceWithSpace()
sleep(6)
grav(10, 4, 10, 0 )
sleep(6)
grav( 8, 4, 10, 0 )
sleep(6)
grav( 9, 4, 10, 0 )
sleep(6)
grav( 7, 3, 40, 1 )
sleep(6)
grav( 5, 3, 40, 1 )
sleep(6)
grav( 6, 3, 40, 1 )
sleep(6)
grav( 4, 2, 50, 6 )
sleep(6)
grav( 3, 2, 50, 6 )
sleep(6)
grav( 2, 2, 75,25 )
sleep(6)
//MOVEMENT
if( prob(50) )
src.anchored = 0
step(src,pick(alldirs))
src.anchored = 1
/obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen
del(src)
return
for(var/t = -r, t < r, t++)
affect_coord(x+t, y-r, ex_act_force, pull_chance, turf_removal_chance)
affect_coord(x-t, y+r, ex_act_force, pull_chance, turf_removal_chance)
affect_coord(x+r, y+t, ex_act_force, pull_chance, turf_removal_chance)
affect_coord(x-r, y-t, ex_act_force, pull_chance, turf_removal_chance)
return
/obj/effect/bhole/proc/affect_coord(var/x, var/y, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
//Get turf at coordinate
var/turf/T = locate(x, y, z)
if(isnull(T)) return
//Pulling and/or ex_act-ing movable atoms in that turf
if( prob(pull_chance) )
for(var/obj/O in T.contents)
if(O.anchored)
O.ex_act(ex_act_force)
else
step_towards(O,src)
for(var/mob/living/M in T.contents)
step_towards(M,src)
//Destroying the turf
if( T && istype(T,/turf/simulated) && prob(turf_removal_chance) )
var/turf/simulated/ST = T
ST.ReplaceWithSpace()
return

View File

@@ -1,89 +0,0 @@
/*
Immovable rod random event.
The rod will spawn at some location outside the station, and travel in a straight line to the opposite side of the station
Everything solid in the way will be ex_act()'d
In my current plan for it, 'solid' will be defined as anything with density == 1
--NEOFite
*/
/obj/effect/immovablerod
name = "Immovable Rod"
desc = "What the fuck is that?"
icon = 'icons/obj/objects.dmi'
icon_state = "immrod"
throwforce = 100
density = 1
anchored = 1
Bump(atom/clong)
if(istype(clong, /turf/simulated/shuttle)) //Skip shuttles without actually deleting the rod
return
else if (istype(clong, /turf) && !istype(clong, /turf/unsimulated))
if(clong.density)
clong.ex_act(2)
for (var/mob/O in hearers(src, null))
O.show_message("CLANG", 2)
else if (istype(clong, /obj))
if(clong.density)
clong.ex_act(2)
for (var/mob/O in hearers(src, null))
O.show_message("CLANG", 2)
else if (istype(clong, /mob))
if(clong.density || prob(10))
clong.meteorhit(src)
else
del(src)
if(clong && prob(25))
src.loc = clong.loc
/proc/immovablerod()
var/startx = 0
var/starty = 0
var/endy = 0
var/endx = 0
var/startside = pick(cardinal)
switch(startside)
if(NORTH)
starty = 187
startx = rand(41, 199)
endy = 38
endx = rand(41, 199)
if(EAST)
starty = rand(38, 187)
startx = 199
endy = rand(38, 187)
endx = 41
if(SOUTH)
starty = 38
startx = rand(41, 199)
endy = 187
endx = rand(41, 199)
if(WEST)
starty = rand(38, 187)
startx = 41
endy = rand(38, 187)
endx = 199
//rod time!
var/obj/effect/immovablerod/immrod = new /obj/effect/immovablerod(locate(startx, starty, 1))
// world << "Rod in play, starting at [start.loc.x],[start.loc.y] and going to [end.loc.x],[end.loc.y]"
var/end = locate(endx, endy, 1)
spawn(0)
walk_towards(immrod, end,1)
sleep(1)
while (immrod)
if (immrod.z != 1)
immrod.z = 1
if(immrod.loc == end)
del(immrod)
sleep(10)
for(var/obj/effect/immovablerod/imm in world)
return
sleep(50)
command_alert("What the fuck was that?!", "General Alert")

View File

@@ -1,122 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/*
Space dust
Commonish random event that causes small clumps of "space dust" to hit the station at high speeds.
No command report on the common version of this event.
The "dust" will damage the hull of the station causin minor hull breaches.
*/
/proc/dust_swarm(var/strength = "weak")
var/numbers = 1
switch(strength)
if("weak")
numbers = rand(2,4)
for(var/i = 0 to numbers)
new/obj/effect/space_dust/weak()
if("norm")
numbers = rand(5,10)
for(var/i = 0 to numbers)
new/obj/effect/space_dust()
if("strong")
numbers = rand(10,15)
for(var/i = 0 to numbers)
new/obj/effect/space_dust/strong()
if("super")
numbers = rand(15,25)
for(var/i = 0 to numbers)
new/obj/effect/space_dust/super()
return
/obj/effect/space_dust
name = "Space Dust"
desc = "Dust in space."
icon = 'icons/obj/meteor.dmi'
icon_state = "space_dust"
density = 1
anchored = 1
var/strength = 2 //ex_act severity number
var/life = 2 //how many things we hit before del(src)
weak
strength = 3
life = 1
strong
strength = 1
life = 6
super
strength = 1
life = 40
New()
var/startx = 0
var/starty = 0
var/endy = 0
var/endx = 0
var/startside = pick(cardinal)
switch(startside)
if(NORTH)
starty = world.maxy-(TRANSITIONEDGE+1)
startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1))
endy = TRANSITIONEDGE
endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE)
if(EAST)
starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1))
startx = world.maxx-(TRANSITIONEDGE+1)
endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE)
endx = TRANSITIONEDGE
if(SOUTH)
starty = (TRANSITIONEDGE+1)
startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1))
endy = world.maxy-TRANSITIONEDGE
endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE)
if(WEST)
starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1))
startx = (TRANSITIONEDGE+1)
endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE)
endx = world.maxx-TRANSITIONEDGE
var/goal = locate(endx, endy, 1)
src.x = startx
src.y = starty
src.z = 1
spawn(0)
walk_towards(src, goal, 1)
return
Bump(atom/A)
spawn(0)
if(prob(50))
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
if (A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
if(ismob(A))
A.meteorhit(src)//This should work for now I guess
else if(!istype(A,/obj/machinery/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round!
A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4
life--
if(life <= 0)
walk(src,0)
spawn(1)
del(src)
return 0
return
Bumped(atom/A)
Bump(A)
return
ex_act(severity)
del(src)
return

View File

@@ -1,37 +0,0 @@
/proc/mini_blob_event()
var/turf/T = pick(blobstart)
if(istype(T, /turf/simulated/wall))
T.ReplaceWithPlating()
for(var/atom/A in T)
if(A.density)
del(A)
var/obj/effect/blob/bl = new /obj/effect/blob( T, 30 )
spawn(0)
bl.Life()
bl.Life()
bl.Life()
bl.Life()
bl.blobdebug = 1
bl.Life()
blobevent = 1
spawn(0)
dotheblobbaby()
spawn(15000)
blobevent = 0
spawn(rand(600, 1800)) //Delayed announcements to keep the crew on their toes.
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()].", "Biohazard Alert")
world << sound('outbreak5.ogg')
/proc/dotheblobbaby()
if (blobevent)
if(blobs.len)
for(var/i = 1 to 10)
sleep(-1)
if(!blobs.len) break
var/obj/effect/blob/B = pick(blobs)
if(B.z != 1)
continue
B.Life()
spawn(150)
dotheblobbaby()

View File

@@ -1,71 +0,0 @@
/proc/power_failure()
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure")
world << sound('poweroff.ogg')
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
C.cell.charge = 0
for(var/obj/machinery/power/smes/S in world)
if(istype(get_area(S), /area/turret_protected) || S.z != 1)
continue
S.charge = 0
S.output = 0
S.online = 0
S.updateicon()
S.power_change()
for(var/area/A in world)
if(A.name != "Space" && A.name != "Engine Walls" && A.name != "Chemical Lab Test Chamber" && A.name != "Escape Shuttle" && A.name != "Arrival Area" && A.name != "Arrival Shuttle" && A.name != "start area" && A.name != "Engine Combustion Chamber")
A.power_light = 0
A.power_equip = 0
A.power_environ = 0
A.power_change()
/proc/power_restore()
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
world << sound('poweron.ogg')
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in world)
if(S.z != 1)
continue
S.charge = S.capacity
S.output = 200000
S.online = 1
S.updateicon()
S.power_change()
for(var/area/A in world)
if(A.name != "Space" && A.name != "Engine Walls" && A.name != "Chemical Lab Test Chamber" && A.name != "space" && A.name != "Escape Shuttle" && A.name != "Arrival Area" && A.name != "Arrival Shuttle" && A.name != "start area" && A.name != "Engine Combustion Chamber")
A.power_light = 1
A.power_equip = 1
A.power_environ = 1
A.power_change()
/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 10) //leave lightsoutAmount as 0 to break ALL lights
if(isEvent)
command_alert("An Electrical storm has been detected in your area, please repair potential electronic overloads.","Electrical Storm Alert")
if(lightsoutAmount)
var/list/epicentreList = list()
for(var/i=1,i<=lightsoutAmount,i++)
var/list/possibleEpicentres = list()
for(var/obj/effect/landmark/newEpicentre in world)
if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList))
possibleEpicentres += newEpicentre
if(possibleEpicentres.len)
epicentreList += pick(possibleEpicentres)
else
break
if(!epicentreList.len)
return
for(var/obj/effect/landmark/epicentre in epicentreList)
for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
apc.overload_lighting()
else
for(var/obj/machinery/power/apc/apc in world)
apc.overload_lighting()
return

View File

@@ -1,429 +0,0 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+++++++++++++++++++++++++++++++++// //++++++++++++++++++++++++++++++++++
==================================SPACE NINJA ABILITIES====================================
___________________________________________________________________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
//=======//SAFETY CHECK//=======//
/*
X is optional, tells the proc to check for specific stuff. C is also optional.
All the procs here assume that the character is wearing the ninja suit if they are using the procs.
They should, as I have made every effort for that to be the case.
In the case that they are not, I imagine the game will run-time error like crazy.
s_cooldown ticks off each second based on the suit recharge proc, in seconds. Default of 1 seconds. Some abilities have no cool down.
*/
/obj/item/clothing/suit/space/space_ninja/proc/ninjacost(C = 0,X = 0)
var/mob/living/carbon/human/U = affecting
if( (U.stat||U.incorporeal_move)&&X!=3 )//Will not return if user is using an adrenaline booster since you can use them when stat==1.
U << "\red You must be conscious and solid to do this."//It's not a problem of stat==2 since the ninja will explode anyway if they die.
return 1
else if(C&&cell.charge<C*10)
U << "\red Not enough energy."
return 1
switch(X)
if(1)
cancel_stealth()//Get rid of it.
if(2)
if(s_bombs<=0)
U << "\red There are no more smoke bombs remaining."
return 1
if(3)
if(a_boost<=0)
U << "\red You do not have any more adrenaline boosters."
return 1
return (s_coold)//Returns the value of the variable which counts down to zero.
//=======//TELEPORT GRAB CHECK//=======//
/obj/item/clothing/suit/space/space_ninja/proc/handle_teleport_grab(turf/T, mob/living/U)
if(istype(U.get_active_hand(),/obj/item/weapon/grab))//Handles grabbed persons.
var/obj/item/weapon/grab/G = U.get_active_hand()
G.affecting.loc = locate(T.x+rand(-1,1),T.y+rand(-1,1),T.z)//variation of position.
if(istype(U.get_inactive_hand(),/obj/item/weapon/grab))
var/obj/item/weapon/grab/G = U.get_inactive_hand()
G.affecting.loc = locate(T.x+rand(-1,1),T.y+rand(-1,1),T.z)//variation of position.
return
//=======//SMOKE//=======//
/*Summons smoke in radius of user.
Not sure why this would be useful (it's not) but whatever. Ninjas need their smoke bombs.*/
/obj/item/clothing/suit/space/space_ninja/proc/ninjasmoke()
set name = "Smoke Bomb"
set desc = "Blind your enemies momentarily with a well-placed smoke bomb."
set category = "Ninja Ability"
set popup_menu = 0//Will not see it when right clicking.
if(!ninjacost(,2))
var/mob/living/carbon/human/U = affecting
U << "\blue There are <B>[s_bombs]</B> smoke bombs remaining."
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
smoke.set_up(10, 0, U.loc)
smoke.start()
playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2)
s_bombs--
s_coold = 1
return
//=======//9-8 TILE TELEPORT//=======//
//Click to to teleport 9-10 tiles in direction facing.
/obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt()
set name = "Phase Jaunt (10E)"
set desc = "Utilizes the internal VOID-shift device to rapidly transit in direction facing."
set category = "Ninja Ability"
set popup_menu = 0
var/C = 100
if(!ninjacost(C,1))
var/mob/living/carbon/human/U = affecting
var/turf/destination = get_teleport_loc(U.loc,U,9,1,3,1,0,1)
var/turf/mobloc = get_turf(U.loc)//To make sure that certain things work properly below.
if(destination&&istype(mobloc, /turf))//The turf check prevents unusual behavior. Like teleporting out of cryo pods, cloners, mechs, etc.
spawn(0)
playsound(U.loc, "sparks", 50, 1)
anim(mobloc,src,'icons/mob/mob.dmi',,"phaseout",,U.dir)
handle_teleport_grab(destination, U)
U.loc = destination
spawn(0)
spark_system.start()
playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1)
playsound(U.loc, "sparks", 50, 1)
anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
spawn(0)
destination.kill_creatures(U)//Any living mobs in teleport area are gibbed. Check turf procs for how it does it.
s_coold = 1
cell.charge-=(C*10)
else
U << "\red The VOID-shift device is malfunctioning, <B>teleportation failed</B>."
return
//=======//RIGHT CLICK TELEPORT//=======//
//Right click to teleport somewhere, almost exactly like admin jump to turf.
/obj/item/clothing/suit/space/space_ninja/proc/ninjashift(turf/T in oview())
set name = "Phase Shift (20E)"
set desc = "Utilizes the internal VOID-shift device to rapidly transit to a destination in view."
set category = null//So it does not show up on the panel but can still be right-clicked.
set src = usr.contents//Fixes verbs not attaching properly for objects. Praise the DM reference guide!
var/C = 200
if(!ninjacost(C,1))
var/mob/living/carbon/human/U = affecting
var/turf/mobloc = get_turf(U.loc)//To make sure that certain things work properly below.
if((!T.density)&&istype(mobloc, /turf))
spawn(0)
playsound(U.loc, 'sound/effects/sparks4.ogg', 50, 1)
anim(mobloc,src,'icons/mob/mob.dmi',,"phaseout",,U.dir)
handle_teleport_grab(T, U)
U.loc = T
spawn(0)
spark_system.start()
playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1)
playsound(U.loc, 'sound/effects/sparks2.ogg', 50, 1)
anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
spawn(0)//Any living mobs in teleport area are gibbed.
T.kill_creatures(U)
s_coold = 1
cell.charge-=(C*10)
else
U << "\red You cannot teleport into solid walls or from solid matter"
return
//=======//EM PULSE//=======//
//Disables nearby tech equipment.
/obj/item/clothing/suit/space/space_ninja/proc/ninjapulse()
set name = "EM Burst (25E)"
set desc = "Disable any nearby technology with a electro-magnetic pulse."
set category = "Ninja Ability"
set popup_menu = 0
var/C = 250
if(!ninjacost(C,1))
var/mob/living/carbon/human/U = affecting
playsound(U.loc, 'sound/effects/EMPulse.ogg', 60, 2)
empulse(U, 4, 6) //Procs sure are nice. Slightly weaker than wizard's disable tch.
s_coold = 2
cell.charge-=(C*10)
return
//=======//ENERGY BLADE//=======//
//Summons a blade of energy in active hand.
/obj/item/clothing/suit/space/space_ninja/proc/ninjablade()
set name = "Energy Blade (5E)"
set desc = "Create a focused beam of energy in your active hand."
set category = "Ninja Ability"
set popup_menu = 0
var/C = 50
if(!ninjacost(C))
var/mob/living/carbon/human/U = affecting
if(!kamikaze)
if(!U.get_active_hand()&&!istype(U.get_inactive_hand(), /obj/item/weapon/melee/energy/blade))
var/obj/item/weapon/melee/energy/blade/W = new()
spark_system.start()
playsound(U.loc, "sparks", 50, 1)
U.put_in_hands(W)
cell.charge-=(C*10)
else
U << "\red You can only summon one blade. Try dropping an item first."
else//Else you can run around with TWO energy blades. I don't know why you'd want to but cool factor remains.
if(!U.get_active_hand())
var/obj/item/weapon/melee/energy/blade/W = new()
U.put_in_hands(W)
if(!U.get_inactive_hand())
var/obj/item/weapon/melee/energy/blade/W = new()
U.put_in_inactive_hand(W)
spark_system.start()
playsound(U.loc, "sparks", 50, 1)
s_coold = 1
return
//=======//NINJA STARS//=======//
/*Shoots ninja stars at random people.
This could be a lot better but I'm too tired atm.*/
/obj/item/clothing/suit/space/space_ninja/proc/ninjastar()
set name = "Energy Star (5E)"
set desc = "Launches an energy star at a random living target."
set category = "Ninja Ability"
set popup_menu = 0
var/C = 50
if(!ninjacost(C))
var/mob/living/carbon/human/U = affecting
var/targets[] = list()//So yo can shoot while yo throw dawg
for(var/mob/living/M in oview(loc))
if(M.stat) continue//Doesn't target corpses or paralyzed persons.
targets.Add(M)
if(targets.len)
var/mob/living/target=pick(targets)//The point here is to pick a random, living mob in oview to shoot stuff at.
var/turf/curloc = U.loc
var/atom/targloc = get_turf(target)
if (!targloc || !istype(targloc, /turf) || !curloc)
return
if (targloc == curloc)
return
var/obj/item/projectile/energy/dart/A = new /obj/item/projectile/energy/dart(U.loc)
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
cell.charge-=(C*10)
A.process()
else
U << "\red There are no targets in view."
return
//=======//ENERGY NET//=======//
/*Allows the ninja to capture people, I guess.
Must right click on a mob to activate.*/
/obj/item/clothing/suit/space/space_ninja/proc/ninjanet(mob/living/carbon/M in oview())//Only living carbon mobs.
set name = "Energy Net (20E)"
set desc = "Captures a fallen opponent in a net of energy. Will teleport them to a holding facility after 30 seconds."
set category = null
set src = usr.contents
var/C = 200
if(!ninjacost(C,1)&&iscarbon(M))
var/mob/living/carbon/human/U = affecting
if(M.client)//Monkeys without a client can still step_to() and bypass the net. Also, netting inactive people is lame.
//if(M)//DEBUG
if(!locate(/obj/effect/energy_net) in M.loc)//Check if they are already being affected by an energy net.
for(var/turf/T in getline(U.loc, M.loc))
if(T.density)//Don't want them shooting nets through walls. It's kind of cheesy.
U << "You may not use an energy net through solid obstacles!"
return
spawn(0)
U.Beam(M,"n_beam",,15)
M.anchored = 1//Anchors them so they can't move.
U.say("Get over here!")
var/obj/effect/energy_net/E = new /obj/effect/energy_net(M.loc)
E.layer = M.layer+1//To have it appear one layer above the mob.
for(var/mob/O in viewers(U, 3))
O.show_message(text("\red [] caught [] with an energy net!", U, M), 1)
E.affecting = M
E.master = U
spawn(0)//Parallel processing.
E.process(M)
cell.charge-=(C*10)
else
U << "They are already trapped inside an energy net."
else
U << "They will bring no honor to your Clan!"
return
//=======//ADRENALINE BOOST//=======//
/*Wakes the user so they are able to do their thing. Also injects a decent dose of radium.
Movement impairing would indicate drugs and the like.*/
/obj/item/clothing/suit/space/space_ninja/proc/ninjaboost()
set name = "Adrenaline Boost"
set desc = "Inject a secret chemical that will counteract all movement-impairing effect."
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost(,3))//Have to make sure stat is not counted for this ability.
var/mob/living/carbon/human/U = affecting
//Wouldn't need to track adrenaline boosters if there was a miracle injection to get rid of paralysis and the like instantly.
//For now, adrenaline boosters ARE the miracle injection. Well, radium, really.
U.SetParalysis(0)
U.SetStunned(0)
U.SetWeakened(0)
/*
Due to lag, it was possible to adrenaline boost but remain helpless while life.dm resets player stat.
This lead to me and others spamming adrenaline boosters because they failed to kick in on time.
It's technically possible to come back from crit with this but it is very temporary.
Life.dm will kick the player back into unconsciosness the next process loop.
*/
U.stat = 0//At least now you should be able to teleport away or shoot ninja stars.
spawn(30)//Slight delay so the enemy does not immedietly know the ability was used. Due to lag, this often came before waking up.
U.say(pick("A CORNERED FOX IS MORE DANGEROUS THAN A JACKAL!","HURT ME MOOORRREEE!","IMPRESSIVE!"))
spawn(70)
reagents.reaction(U, 2)
reagents.trans_id_to(U, "radium", a_transfer)
U << "\red You are beginning to feel the after-effect of the injection."
a_boost--
s_coold = 3
return
/*
===================================================================================
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<KAMIKAZE MODE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
===================================================================================
Or otherwise known as anime mode. Which also happens to be ridiculously powerful.
*/
//=======//NINJA MOVEMENT//=======//
//Also makes you move like you're on crack.
/obj/item/clothing/suit/space/space_ninja/proc/ninjawalk()
set name = "Shadow Walk"
set desc = "Combines the VOID-shift and CLOAK-tech devices to freely move between solid matter. Toggle on or off."
set category = "Ninja Ability"
set popup_menu = 0
var/mob/living/carbon/human/U = affecting
if(!U.incorporeal_move)
U.incorporeal_move = 2
U << "\blue You will now phase through solid matter."
else
U.incorporeal_move = 0
U << "\blue You will no-longer phase through solid matter."
return
//=======//5 TILE TELEPORT/GIB//=======//
//Allows to gib up to five squares in a straight line. Seriously.
/obj/item/clothing/suit/space/space_ninja/proc/ninjaslayer()
set name = "Phase Slayer"
set desc = "Utilizes the internal VOID-shift device to mutilate creatures in a straight line."
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost())
var/mob/living/carbon/human/U = affecting
var/turf/destination = get_teleport_loc(U.loc,U,5)
var/turf/mobloc = get_turf(U.loc)//To make sure that certain things work properly below.
if(destination&&istype(mobloc, /turf))
U.say("Ai Satsugai!")
spawn(0)
playsound(U.loc, "sparks", 50, 1)
anim(mobloc,U,'icons/mob/mob.dmi',,"phaseout",,U.dir)
spawn(0)
for(var/turf/T in getline(mobloc, destination))
spawn(0)
T.kill_creatures(U)
if(T==mobloc||T==destination) continue
spawn(0)
anim(T,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
handle_teleport_grab(destination, U)
U.loc = destination
spawn(0)
spark_system.start()
playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1)
playsound(U.loc, "sparks", 50, 1)
anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
s_coold = 1
else
U << "\red The VOID-shift device is malfunctioning, <B>teleportation failed</B>."
return
//=======//TELEPORT BEHIND MOB//=======//
/*Appear behind a randomly chosen mob while a few decoy teleports appear.
This is so anime it hurts. But that's the point.*/
/obj/item/clothing/suit/space/space_ninja/proc/ninjamirage()
set name = "Spider Mirage"
set desc = "Utilizes the internal VOID-shift device to create decoys and teleport behind a random target."
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost())//Simply checks for stat.
var/mob/living/carbon/human/U = affecting
var/targets[]
targets = new()
for(var/mob/living/M in oview(6))
if(M.stat) continue//Doesn't target corpses or paralyzed people.
targets.Add(M)
if(targets.len)
var/mob/living/target=pick(targets)
var/locx
var/locy
var/turf/mobloc = get_turf(target.loc)
var/safety = 0
switch(target.dir)
if(NORTH)
locx = mobloc.x
locy = (mobloc.y-1)
if(locy<1)
safety = 1
if(SOUTH)
locx = mobloc.x
locy = (mobloc.y+1)
if(locy>world.maxy)
safety = 1
if(EAST)
locy = mobloc.y
locx = (mobloc.x-1)
if(locx<1)
safety = 1
if(WEST)
locy = mobloc.y
locx = (mobloc.x+1)
if(locx>world.maxx)
safety = 1
else safety=1
if(!safety&&istype(mobloc, /turf))
U.say("Kumo no Shinkiro!")
var/turf/picked = locate(locx,locy,mobloc.z)
spawn(0)
playsound(U.loc, "sparks", 50, 1)
anim(mobloc,U,'icons/mob/mob.dmi',,"phaseout",,U.dir)
spawn(0)
var/limit = 4
for(var/turf/T in oview(5))
if(prob(20))
spawn(0)
anim(T,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
limit--
if(limit<=0) break
handle_teleport_grab(picked, U)
U.loc = picked
U.dir = target.dir
spawn(0)
spark_system.start()
playsound(U.loc, 'sound/effects/phasein.ogg', 25, 1)
playsound(U.loc, "sparks", 50, 1)
anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
s_coold = 1
else
U << "\red The VOID-shift device is malfunctioning, <B>teleportation failed</B>."
else
U << "\red There are no targets in view."
return

File diff suppressed because it is too large Load Diff

View File

@@ -1,996 +0,0 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+++++++++++++++++++++++++++++++++++++// //++++++++++++++++++++++++++++++++++
======================================SPACE NINJA SETUP====================================
___________________________________________________________________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/*
README:
Data:
>> space_ninja.dm << is this file. It contains a variety of procs related to either spawning space ninjas,
modifying their verbs, various help procs, testing debug-related content, or storing unused procs for later.
Similar functions should go into this file, along with anything else that may not have an explicit category.
IMPORTANT: actual ninja suit, gloves, etc, are stored under the appropriate clothing files. If you need to change
variables or look them up, look there. Easiest way is through the map file browser.
>> ninja_abilities.dm << contains all the ninja-related powers. Spawning energy swords, teleporting, and the like.
If more powers are added, or perhaps something related to powers, it should go there. Make sure to describe
what an ability/power does so it's easier to reference later without looking at the code.
IMPORTANT: verbs are still somewhat funky to work with. If an argument is specified but is not referenced in a way
BYOND likes, in the code content, the verb will fail to trigger. Nothing will happen, literally, when clicked.
This can be bypassed by either referencing the argument properly, or linking to another proc with the argument
attached. The latter is what I like to do for certain cases--sometimes it's necessary to do that regardless.
>> ninja_equipment.dm << deals with all the equipment-related procs for a ninja. Primarily it has the suit, gloves,
and mask. The suit is by far the largest section of code out of the three and includes a lot of code that ties in
to other functions. This file has gotten kind of large so breaking it up may be in order. I use section hearders.
IMPORTANT: not much to say here. Follow along with the comments and adding new functions should be a breeze. Also
know that certain equipment pieces are linked in other files. The energy blade, for example, has special
functions defined in the appropriate files (airlock, securestorage, etc).
General Notes:
I created space ninjas with the expressed purpose of spicing up boring rounds. That is, ninjas are to xenos as marauders are to
death squads. Ninjas are stealthy, tech-savvy, and powerful. Not to say marauders are all of those things, but a clever ninja
should have little problem murderampaging their way through just about anything. Short of admin wizards maybe.
HOWEVER!
Ninjas also have a fairly great weakness as they require energy to use abilities. If, theoretically, there is a game
mode based around space ninjas, make sure to account for their energy needs.
Admin Notes:
Ninjas are not admin PCs--please do not use them for that purpose. They are another way to participate in the game post-death,
like pais, xenos, death squads, and cyborgs.
I'm currently looking for feedback from regular players since beta testing is largely done. I would appreciate if
you spawned regular players as ninjas when rounds are boring. Or exciting, it's all good as long as there is feedback.
You can also spawn ninja gear manually if you want to.
How to do that:
Make sure your character has a mind.
Change their assigned_role to "MODE", no quotes. Otherwise, the suit won't initialize.
Change their special_role to "Space Ninja", no quotes. Otherwise, the character will be gibbed.
Spawn ninja gear, put it on, hit initialize. Let the suit do the rest. You are now a space ninja.
I don't recommend messing with suit variables unless you really know what you're doing.
Miscellaneous Notes:
Potential Upgrade Tree:
Energy Shield:
Extra Ability
Syndicate Shield device?
Works like the force wall spell, except can be kept indefinitely as long as energy remains. Toggled on or off.
Would block bullets and the like.
Phase Shift
Extra Ability
Advanced Sensors?
Instead of being unlocked at the start, Phase Shieft would become available once requirements are met.
Uranium-based Recharger:
Suit Upgrade
Unsure
Instead of losing energy each second, the suit would regain the same amount of energy.
This would not count in activating stealth and similar.
Extended Battery Life:
Suit Upgrade
Battery of higher capacity
Already implemented. Replace current battery with one of higher capacity.
Advanced Cloak-Tech device.
Suit Upgrade
Syndicate Cloaking Device?
Remove cloak failure rate.
*/
//=======//RANDOM EVENT//=======//
/*
Also a dynamic ninja mission generator.
I decided to scrap round-specific objectives since keeping track of them would require some form of tracking.
When I already created about 4 new objectives, this doesn't seem terribly important or needed.
*/
/var/global/toggle_space_ninja = 0//If ninjas can spawn or not.
/var/global/sent_ninja_to_station = 0//If a ninja is already on the station.
/proc/space_ninja_arrival()
var/datum/game_mode/current_mode = ticker.mode
var/datum/mind/current_mind
/*Is the ninja playing for the good or bad guys? Is the ninja helping or hurting the station?
Their directives also influence behavior. At least in theory.*/
var/side = pick("face","heel")
var/antagonist_list[] = list()//The main bad guys. Evil minds that plot destruction.
var/protagonist_list[] = current_mode.get_living_heads()//The good guys. Mostly Heads. Who are alive.
var/xeno_list[] = list()//Aliens.
var/commando_list[] = list()//Commandos.
//We want the ninja to appear only in certain modes.
// var/acceptable_modes_list[] = list("traitor","revolution","cult","wizard","changeling","traitorchan","nuclear","malfunction","monkey") // Commented out for both testing and ninjas
// if(!(current_mode.config_tag in acceptable_modes_list))
// return
/*No longer need to determine what mode it is since bad guys are basically universal.
And there is now a mode with two types of bad guys.*/
var/possible_bad_dudes[] = list(current_mode.traitors,current_mode.head_revolutionaries,current_mode.head_revolutionaries,
current_mode.cult,current_mode.wizards,current_mode.changelings,current_mode.syndicates)
for(var/list in possible_bad_dudes)//For every possible antagonist type.
for(current_mind in list)//For each mind in that list.
if(current_mind.current&&current_mind.current.stat!=2)//If they are not destroyed and not dead.
antagonist_list += current_mind//Add them.
if(protagonist_list.len)//If the mind is both a protagonist and antagonist.
for(current_mind in protagonist_list)
if(current_mind in antagonist_list)
protagonist_list -= current_mind//We only want it in one list.
/*
Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective completion. Only humans are added.
*/
//Here we pick a location and spawn the ninja.
var/list/spawn_list = list()
for(var/obj/effect/landmark/L in world)
if(L.name == "carpspawn")
spawn_list.Add(L)
var/list/candidates = list() //list of candidate keys
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
if(!candidates.len) return
//The ninja will be created on the right spawn point or at late join.
var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(spawn_list.len ? spawn_list : latejoin ))
new_ninja.key = pick(candidates)
new_ninja.wear_suit:randomize_param()//Give them a random set of suit parameters.
new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess.
new_ninja.internals.icon_state = "internal1"
//Now for the rest of the stuff.
var/datum/mind/ninja_mind = new_ninja.mind//For easier reference.
var/mission_set = 0//To determine if we need to do further processing.
//Xenos and deathsquads take precedence over everything else.
//Unless the xenos are hiding in a locker somewhere, this'll find em.
for(var/mob/living/carbon/alien/humanoid/xeno in player_list)
if(istype(xeno))
xeno_list += xeno
if(xeno_list.len>3)//If there are more than three humanoid xenos on the station, time to get dangerous.
//Here we want the ninja to murder all the queens. The other aliens don't really matter.
var/xeno_queen_list[] = list()
for(var/mob/living/carbon/alien/humanoid/queen/xeno_queen in xeno_list)
if(xeno_queen.mind&&xeno_queen.stat!=2)
xeno_queen_list += xeno_queen
if(xeno_queen_list.len&&side=="face")//If there are queen about and the probability is 50.
for(var/mob/living/carbon/alien/humanoid/queen/xeno_queen in xeno_queen_list)
var/datum/objective/assassinate/ninja_objective = new
//We'll do some manual overrides to properly set it up.
ninja_objective.owner = ninja_mind
ninja_objective.target = xeno_queen.mind
ninja_objective.explanation_text = "Kill \the [xeno_queen]."
ninja_mind.objectives += ninja_objective
mission_set = 1
if(sent_strike_team&&side=="heel"&&antagonist_list.len)//If a strike team was sent, murder them all like a champ.
for(current_mind in antagonist_list)//Search and destroy. Since we already have an antagonist list, they should appear there.
if(current_mind && current_mind.special_role=="Death Commando")
commando_list += current_mind
if(commando_list.len)//If there are living commandos still in play.
for(var/mob/living/carbon/human/commando in commando_list)
var/datum/objective/assassinate/ninja_objective = new
ninja_objective.owner = ninja_mind
ninja_objective.find_target_by_role(commando.mind.special_role,1)
ninja_mind.objectives += ninja_objective
mission_set = 1
/*
If there are no antogonists left it could mean one of two things:
A) The round is about to end. No harm in spawning the ninja here.
B) The round is still going and ghosts are probably rioting for something to happen.
In either case, it's a good idea to spawn the ninja with a semi-random set of objectives.
*/
if(!mission_set)//If mission was not set.
var/current_minds[]//List being looked on in the following code.
var/side_list = side=="face" ? 2 : 1//For logic gating.
var/hostile_targets[] = list()//The guys actually picked for the assassination or whatever.
var/friendly_targets[] = list()//The guys the ninja must protect.
for(var/i=2,i>0,i--)//Two lists.
current_minds = i==2 ? antagonist_list : protagonist_list//Which list are we looking at?
for(var/t=3,(current_minds.len&&t>0),t--)//While the list is not empty and targets remain. Also, 3 targets is good.
current_mind = pick(current_minds)//Pick a random person.
/*I'm creating a logic gate here based on the ninja affiliation that compares the list being
looked at to the affiliation. Affiliation is just a number used to compare. Meaning comes from the logic involved.
If the list being looked at is equal to the ninja's affiliation, add the mind to hostiles.
If not, add the mind to friendlies. Since it can't be both, it will be added only to one or the other.*/
hostile_targets += i==side_list ? current_mind : null//Adding null doesn't add anything.
friendly_targets += i!=side_list ? current_mind : null
current_minds -= current_mind//Remove the mind so it's not picked again.
var/objective_list[] = list(1,2,3,4,5,6)//To remove later.
for(var/i=rand(1,3),i>0,i--)//Want to get a few random objectives. Currently up to 3.
if(!hostile_targets.len)//Remove appropriate choices from switch list if the target lists are empty.
objective_list -= 1
objective_list -= 4
if(!friendly_targets.len)
objective_list -= 3
switch(pick(objective_list))
if(1)//kill
current_mind = pick(hostile_targets)
if(current_mind)
var/datum/objective/assassinate/ninja_objective = new
ninja_objective.owner = ninja_mind
ninja_objective.find_target_by_role((current_mind.special_role ? current_mind.special_role : current_mind.assigned_role),(current_mind.special_role?1:0))//If they have a special role, use that instead to find em.
ninja_mind.objectives += ninja_objective
else
i++
hostile_targets -= current_mind//Remove them from the list.
if(2)//Steal
var/datum/objective/steal/ninja_objective = new
var/target_item = pick(ninja_objective.possible_items_special)
ninja_objective.set_target(target_item)
ninja_mind.objectives += ninja_objective
objective_list -= 2
if(3)//Protect. Keeping people alive can be pretty difficult.
current_mind = pick(friendly_targets)
if(current_mind)
var/datum/objective/protect/ninja_objective = new
ninja_objective.owner = ninja_mind
ninja_objective.find_target_by_role((current_mind.special_role ? current_mind.special_role : current_mind.assigned_role),(current_mind.special_role?1:0))
ninja_mind.objectives += ninja_objective
else
i++
friendly_targets -= current_mind
if(4)//Debrain
current_mind = pick(hostile_targets)
if(current_mind)
var/datum/objective/debrain/ninja_objective = new
ninja_objective.owner = ninja_mind
ninja_objective.find_target_by_role((current_mind.special_role ? current_mind.special_role : current_mind.assigned_role),(current_mind.special_role?1:0))
ninja_mind.objectives += ninja_objective
else
i++
hostile_targets -= current_mind//Remove them from the list.
if(5)//Download research
var/datum/objective/download/ninja_objective = new
ninja_objective.gen_amount_goal()
ninja_mind.objectives += ninja_objective
objective_list -= 5
if(6)//Capture
var/datum/objective/capture/ninja_objective = new
ninja_objective.gen_amount_goal()
ninja_mind.objectives += ninja_objective
objective_list -= 6
if(ninja_mind.objectives.len)//If they got some objectives out of that.
mission_set = 1
if(!ninja_mind.objectives.len||!mission_set)//If they somehow did not get an objective at this point, time to destroy the station.
var/nuke_code
var/temp_code
for(var/obj/machinery/nuclearbomb/N in world)
temp_code = text2num(N.r_code)
if(temp_code)//if it's actually a number. It won't convert any non-numericals.
nuke_code = N.r_code
break
if(nuke_code)//If there is a nuke device in world and we got the code.
var/datum/objective/nuclear/ninja_objective = new//Fun.
ninja_objective.owner = ninja_mind
ninja_objective.explanation_text = "Destroy the station with a nuclear device. The code is [nuke_code]." //Let them know what the code is.
//Finally add a survival objective since it's usually broad enough for any round type.
var/datum/objective/survive/ninja_objective = new
ninja_objective.owner = ninja_mind
ninja_mind.objectives += ninja_objective
var/directive = generate_ninja_directive(side)
new_ninja << "\blue \nYou are an elite mercenary assassin of the Spider Clan, [new_ninja.real_name]. The dreaded \red <B>SPACE NINJA</B>!\blue You have a variety of abilities at your disposal, thanks to your nano-enhanced cyber armor. Remember your training (initialize your suit by right clicking on it)! \nYour current directive is: \red <B>[directive]</B>"
new_ninja.mind.store_memory("<B>Directive:</B> \red [directive]<br>")
var/obj_count = 1
new_ninja << "\blue Your current objectives:"
for(var/datum/objective/objective in ninja_mind.objectives)
new_ninja << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
obj_count++
sent_ninja_to_station = 1//And we're done.
return new_ninja//Return the ninja in case we need to reference them later.
/*
This proc will give the ninja a directive to follow. They are not obligated to do so but it's a fun roleplay reminder.
Making this random or semi-random will probably not work without it also being incredibly silly.
As such, it's hard-coded for now. No reason for it not to be, really.
*/
/proc/generate_ninja_directive(side)
var/directive = "[side=="face"?"Nanotrasen":"The Syndicate"] is your employer. "//Let them know which side they're on.
switch(rand(1,13))
if(1)
directive += "The Spider Clan must not be linked to this operation. Remain as hidden and covert as possible."
if(2)
directive += "[station_name] is financed by an enemy of the Spider Clan. Cause as much structural damage as possible."
if(3)
directive += "A wealthy animal rights activist has made a request we cannot refuse. Prioritize saving animal lives whenever possible."
if(4)
directive += "The Spider Clan absolutely cannot be linked to this operation. Eliminate all witnesses using most extreme prejudice."
if(5)
directive += "We are currently negotiating with Nanotrasen command. Prioritize saving human lives over ending them."
if(6)
directive += "We are engaged in a legal dispute over [station_name]. If a laywer is present on board, force their cooperation in the matter."
if(7)
directive += "A financial backer has made an offer we cannot refuse. Implicate Syndicate involvement in the operation."
if(8)
directive += "Let no one question the mercy of the Spider Clan. Ensure the safety of all non-essential personnel you encounter."
if(9)
directive += "A free agent has proposed a lucrative business deal. Implicate Nanotrasen involvement in the operation."
if(10)
directive += "Our reputation is on the line. Harm as few civilians or innocents as possible."
if(11)
directive += "Our honor is on the line. Utilize only honorable tactics when dealing with opponents."
if(12)
directive += "We are currently negotiating with a Syndicate leader. Disguise assassinations as suicide or another natural cause."
else
directive += "There are no special supplemental instructions at this time."
return directive
//=======//CURRENT PLAYER VERB//=======//
/client/proc/cmd_admin_ninjafy(var/mob/M in player_list)
set category = null
set name = "Make Space Ninja"
if(!ticker)
alert("Wait until the game starts")
return
if(!toggle_space_ninja)
alert("Space Ninjas spawning is disabled.")
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
if(ishuman(M))
log_admin("[key_name(src)] turned [M.key] into a Space Ninja.")
spawn(10)
M:create_mind_space_ninja()
M:equip_space_ninja(1)
if(istype(M:wear_suit, /obj/item/clothing/suit/space/space_ninja))
M:wear_suit:randomize_param()
spawn(0)
M:wear_suit:ninitialize(10,M)
else
alert("Invalid mob")
//=======//CURRENT GHOST VERB//=======//
/client/proc/send_space_ninja()
set category = "Fun"
set name = "Spawn Space Ninja"
set desc = "Spawns a space ninja for when you need a teenager with attitude."
set popup_menu = 0
if(!holder)
src << "Only administrators may use this command."
return
if(!ticker.mode)
alert("The game hasn't started yet!")
return
if(!toggle_space_ninja)
alert("Space Ninjas spawning is disabled.")
return
if(alert("Are you sure you want to send in a space ninja?",,"Yes","No")=="No")
return
var/mission
while(!mission)
mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!mission)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
var/list/spawn_list = list()
for(var/obj/effect/landmark/L in world)
if (L.name == "carpspawn")
spawn_list.Add(L)
var/input = ckey(input("Pick character to spawn as the Space Ninja", "Key", ""))
if(!input)
return
var/mob/dead/observer/G
for(var/mob/dead/observer/G_find in player_list)
if(G_find.ckey == input)
G = G_find
break
if(!G)//If a ghost was not found.
alert("There is no active key like that in the game or the person is not currently a ghost. Aborting command.")
return
var/admin_name = src
var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(spawn_list.len ? spawn_list : latejoin ))
new_ninja.wear_suit:randomize_param()
new_ninja.key = G.key
new_ninja.mind.store_memory("<B>Mission:</B> \red [mission].<br>")
new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess.
new_ninja.internals.icon_state = "internal1"
spawn(0)//Parallel process. Will speed things up a bit.
new_ninja.wear_suit:ninitialize(10,new_ninja)//If you're wondering why I'm passing the argument to the proc when the default should suffice,
//I'm also wondering that same thing. This makes sure it does not run time error though.
new_ninja << "\blue \nYou are an elite mercenary assassin of the Spider Clan, [new_ninja.real_name]. The dreaded \red <B>SPACE NINJA</B>!\blue You have a variety of abilities at your disposal, thanks to your nano-enhanced cyber armor. Remember your training! \nYour current mission is: \red <B>[mission]</B>"
message_admins("\blue [admin_name] has spawned [new_ninja.key] as a Space Ninja. Hide yo children! \nTheir <b>mission</b> is: [mission]", 1)
log_admin("[admin_name] used Spawn Space Ninja.")
return
//=======//NINJA CREATION PROCS//=======//
/proc/create_space_ninja(obj/spawn_point)
var/mob/living/carbon/human/new_ninja = new(spawn_point.loc)
var/ninja_title = pick(ninja_titles)
var/ninja_name = pick(ninja_names)
new_ninja.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the ninja.
A.randomize_appearance_for(new_ninja)
new_ninja.real_name = "[ninja_title] [ninja_name]"
new_ninja.dna.ready_dna(new_ninja)
new_ninja.create_mind_space_ninja()
new_ninja.equip_space_ninja()
return new_ninja
/mob/living/carbon/human/proc/create_mind_space_ninja()
mind_initialize()
mind.assigned_role = "MODE"
mind.special_role = "Space Ninja"
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors |= mind
return 1
/mob/living/carbon/human/proc/equip_space_ninja(safety=0)//Safety in case you need to unequip stuff for existing characters.
if(safety)
del(w_uniform)
del(wear_suit)
del(wear_mask)
del(head)
del(shoes)
del(gloves)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
equip_to_slot_or_del(R, slot_ears)
if(gender==FEMALE)
equip_to_slot_or_del(new /obj/item/clothing/under/color/blackf(src), slot_w_uniform)
else
equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes)
equip_to_slot_or_del(new /obj/item/clothing/suit/space/space_ninja(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head)
equip_to_slot_or_del(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt)
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_r_store)
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
resistances += "alien_embryo"
return 1
//=======//HELPER PROCS//=======//
//Randomizes suit parameters.
/obj/item/clothing/suit/space/space_ninja/proc/randomize_param()
s_cost = rand(1,20)
s_acost = rand(20,100)
k_cost = rand(100,500)
k_damage = rand(1,20)
s_delay = rand(10,100)
s_bombs = rand(5,20)
a_boost = rand(1,7)
//This proc prevents the suit from being taken off.
/obj/item/clothing/suit/space/space_ninja/proc/lock_suit(mob/living/carbon/U, X = 0)
if(X)//If you want to check for icons.
icon_state = U.gender==FEMALE ? "s-ninjanf" : "s-ninjan"
U:gloves.icon_state = "s-ninjan"
U:gloves.item_state = "s-ninjan"
else
if(U.mind.special_role!="Space Ninja")
U << "\red <B>f<>TaL <20><>RRoR</B>: 382200-*#00C<30>DE <B>RED</B>\nUNAU<41>HORIZED US<55> DET<45>C<EFBFBD><43><EFBFBD>eD\nCoMM<4D>NCING SUB-R0U<30>IN3 13...\nT<6E>RMInATING U-U-US<55>R..."
U.gib()
return 0
if(!istype(U:head, /obj/item/clothing/head/helmet/space/space_ninja))
U << "\red <B>ERROR</B>: 100113 \black UNABLE TO LOCATE HEAD GEAR\nABORTING..."
return 0
if(!istype(U:shoes, /obj/item/clothing/shoes/space_ninja))
U << "\red <B>ERROR</B>: 122011 \black UNABLE TO LOCATE FOOT GEAR\nABORTING..."
return 0
if(!istype(U:gloves, /obj/item/clothing/gloves/space_ninja))
U << "\red <B>ERROR</B>: 110223 \black UNABLE TO LOCATE HAND GEAR\nABORTING..."
return 0
affecting = U
canremove = 0
slowdown = 0
n_hood = U:head
n_hood.canremove=0
n_shoes = U:shoes
n_shoes.canremove=0
n_shoes.slowdown--
n_gloves = U:gloves
n_gloves.canremove=0
return 1
//This proc allows the suit to be taken off.
/obj/item/clothing/suit/space/space_ninja/proc/unlock_suit()
affecting = null
canremove = 1
slowdown = 1
icon_state = "s-ninja"
if(n_hood)//Should be attached, might not be attached.
n_hood.canremove=1
if(n_shoes)
n_shoes.canremove=1
n_shoes.slowdown++
if(n_gloves)
n_gloves.icon_state = "s-ninja"
n_gloves.item_state = "s-ninja"
n_gloves.canremove=1
n_gloves.candrain=0
n_gloves.draining=0
//Allows the mob to grab a stealth icon.
/mob/proc/NinjaStealthActive(atom/A)//A is the atom which we are using as the overlay.
invisibility = INVISIBILITY_LEVEL_TWO//Set ninja invis to 2.
var/icon/opacity_icon = new(A.icon, A.icon_state)
var/icon/alpha_mask = getIconMask(src)
var/icon/alpha_mask_2 = new('icons/effects/effects.dmi', "at_shield1")
alpha_mask.AddAlphaMask(alpha_mask_2)
opacity_icon.AddAlphaMask(alpha_mask)
for(var/i=0,i<5,i++)//And now we add it as overlays. It's faster than creating an icon and then merging it.
var/image/I = image("icon" = opacity_icon, "icon_state" = A.icon_state, "layer" = layer+0.8)//So it's above other stuff but below weapons and the like.
switch(i)//Now to determine offset so the result is somewhat blurred.
if(1)
I.pixel_x -= 1
if(2)
I.pixel_x += 1
if(3)
I.pixel_y -= 1
if(4)
I.pixel_y += 1
overlays += I//And finally add the overlay.
overlays += image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = layer+0.9)
//When ninja steal malfunctions.
/mob/proc/NinjaStealthMalf()
invisibility = 0//Set ninja invis to 0.
overlays += image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = layer+0.9)
playsound(loc, 'sound/effects/stealthoff.ogg', 75, 1)
//=======//GENERIC VERB MODIFIERS//=======//
/obj/item/clothing/suit/space/space_ninja/proc/grant_equip_verbs()
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/init
verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit
verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros
verbs += /obj/item/clothing/suit/space/space_ninja/proc/stealth
n_gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/toggled
s_initialized = 1
/obj/item/clothing/suit/space/space_ninja/proc/remove_equip_verbs()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/init
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/deinit
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/spideros
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/stealth
if(n_gloves)
n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled
s_initialized = 0
/obj/item/clothing/suit/space/space_ninja/proc/grant_ninja_verbs()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjashift
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjasmoke
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjaboost
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjapulse
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjablade
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjastar
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjanet
s_initialized=1
slowdown=0
/obj/item/clothing/suit/space/space_ninja/proc/remove_ninja_verbs()
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjashift
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjasmoke
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjaboost
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjapulse
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjablade
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjastar
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjanet
//=======//KAMIKAZE VERBS//=======//
/obj/item/clothing/suit/space/space_ninja/proc/grant_kamikaze(mob/living/carbon/U)
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjashift
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjapulse
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjastar
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjanet
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjaslayer
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjawalk
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjamirage
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/stealth
kamikaze = 1
icon_state = U.gender==FEMALE ? "s-ninjakf" : "s-ninjak"
if(n_gloves)
n_gloves.icon_state = "s-ninjak"
n_gloves.item_state = "s-ninjak"
n_gloves.candrain = 0
n_gloves.draining = 0
n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled
cancel_stealth()
U << browse(null, "window=spideros")
U << "\red Do or Die, <b>LET'S ROCK!!</b>"
/obj/item/clothing/suit/space/space_ninja/proc/remove_kamikaze(mob/living/carbon/U)
if(kamikaze)
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjashift
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjapulse
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjastar
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjanet
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjaslayer
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjawalk
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjamirage
verbs += /obj/item/clothing/suit/space/space_ninja/proc/stealth
if(n_gloves)
n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled
U.incorporeal_move = 0
kamikaze = 0
k_unlock = 0
U << "\blue Disengaging mode...\n\black<b>CODE NAME</b>: \red <b>KAMIKAZE</b>"
//=======//AI VERBS//=======//
/obj/item/clothing/suit/space/space_ninja/proc/grant_AI_verbs()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ai_hack_ninja
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ai_return_control
s_busy = 0
s_control = 0
/obj/item/clothing/suit/space/space_ninja/proc/remove_AI_verbs()
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ai_hack_ninja
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ai_return_control
s_control = 1
//=======//OLD & UNUSED//=======//
/*
Deprecated. get_dir() does the same thing. Still a nice proc.
Returns direction that the mob or whomever should be facing in relation to the target.
This proc does not grant absolute direction and is mostly useful for 8dir sprite positioning.
I personally used it with getline() to great effect.
/proc/get_dir_to(turf/start,turf/end)//N
var/xdiff = start.x - end.x//The sign is important.
var/ydiff = start.y - end.y
var/direction_x = xdiff<1 ? 4:8//East - west
var/direction_y = ydiff<1 ? 1:2//North - south
var/direction_xy = xdiff==0 ? -4:0//If x is the same, subtract 4.
var/direction_yx = ydiff==0 ? -1:0//If y is the same, subtract 1.
var/direction_f = direction_x+direction_y+direction_xy+direction_yx//Finally direction tally.
direction_f = direction_f==0 ? 1:direction_f//If direction is 0(same spot), return north. Otherwise, direction.
return direction_f
Alternative and inferior method of calculating spideros.
var/temp = num2text(spideros)
var/return_to = copytext(temp, 1, (length(temp)))//length has to be to the length of the thing because by default it's length+1
spideros = text2num(return_to)//Maximum length here is 6. Use (return_to, X) to specify larger strings if needed.
//Old way of draining from wire.
/obj/item/clothing/gloves/space_ninja/proc/drain_wire()
set name = "Drain From Wire"
set desc = "Drain energy directly from an exposed wire."
set category = "Ninja Equip"
var/obj/structure/cable/attached
var/mob/living/carbon/human/U = loc
if(candrain&&!draining)
var/turf/T = U.loc
if(isturf(T) && T.is_plating())
attached = locate() in T
if(!attached)
U << "\red Warning: no exposed cable available."
else
U << "\blue Connecting to wire, stand still..."
if(do_after(U,50)&&!isnull(attached))
drain("WIRE",attached,U:wear_suit,src)
else
U << "\red Procedure interrupted. Protocol terminated."
return
I've tried a lot of stuff but adding verbs to the AI while inside an object, inside another object, did not want to work properly.
This was the best work-around I could come up with at the time. Uses objects to then display to panel, based on the object spell system.
Can be added on to pretty easily.
BYOND fixed the verb bugs so this is no longer necessary. I prefer verb panels.
/obj/item/clothing/suit/space/space_ninja/proc/grant_AI_verbs()
var/obj/effect/proc_holder/ai_return_control/A_C = new(AI)
var/obj/effect/proc_holder/ai_hack_ninja/B_C = new(AI)
var/obj/effect/proc_holder/ai_instruction/C_C = new(AI)
new/obj/effect/proc_holder/ai_holo_clear(AI)
AI.proc_holder_list += A_C
AI.proc_holder_list += B_C
AI.proc_holder_list += C_C
s_control = 0
/obj/item/clothing/suit/space/space_ninja/proc/remove_AI_verbs()
var/obj/effect/proc_holder/ai_return_control/A_C = locate() in AI
var/obj/effect/proc_holder/ai_hack_ninja/B_C = locate() in AI
var/obj/effect/proc_holder/ai_instruction/C_C = locate() in AI
var/obj/effect/proc_holder/ai_holo_clear/D_C = locate() in AI
del(A_C)
del(B_C)
del(C_C)
del(D_C)
AI.proc_holder_list = list()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit
verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros
verbs += /obj/item/clothing/suit/space/space_ninja/proc/stealth
s_control = 1
//Workaround
/obj/effect/proc_holder/ai_holo_clear
name = "Clear Hologram"
desc = "Stops projecting the current holographic image."
panel = "AI Ninja Equip"
density = 0
opacity = 0
/obj/effect/proc_holder/ai_holo_clear/Click()
var/obj/item/clothing/suit/space/space_ninja/S = loc.loc//This is so stupid but makes sure certain things work. AI.SUIT
del(S.hologram.i_attached)
del(S.hologram)
var/obj/effect/proc_holder/ai_holo_clear/D_C = locate() in S.AI
S.AI.proc_holder_list -= D_C
return
/obj/effect/proc_holder/ai_instruction//Let's the AI know what they can do.
name = "Instructions"
desc = "Displays a list of helpful information."
panel = "AI Ninja Equip"
density = 0
opacity = 0
/obj/effect/proc_holder/ai_instruction/Click()
loc << "The menu you are seeing will contain other commands if they become available.\nRight click a nearby turf to display an AI Hologram. It will only be visible to you and your host. You can move it freely using normal movement keys--it will disappear if placed too far away."
/obj/effect/proc_holder/ai_hack_ninja//Generic proc holder to make sure the two verbs below work propely.
name = "Hack SpiderOS"
desc = "Hack directly into the Black Widow(tm) neuro-interface."
panel = "AI Ninja Equip"
density = 0
opacity = 0
/obj/effect/proc_holder/ai_hack_ninja/Click()//When you click on it.
var/obj/item/clothing/suit/space/space_ninja/S = loc.loc
S.hack_spideros()
return
/obj/effect/proc_holder/ai_return_control
name = "Relinquish Control"
desc = "Return control to the user."
panel = "AI Ninja Equip"
density = 0
opacity = 0
/obj/effect/proc_holder/ai_return_control/Click()
var/mob/living/silicon/ai/A = loc
var/obj/item/clothing/suit/space/space_ninja/S = A.loc
A << browse(null, "window=hack spideros")//Close window
A << "You have seized your hacking attempt. [S.affecting] has regained control."
S.affecting << "<b>UPDATE</b>: [A.real_name] has ceased hacking attempt. All systems clear."
S.remove_AI_verbs()
return
*/
//=======//DEBUG//=======//
/*
/obj/item/clothing/suit/space/space_ninja/proc/display_verb_procs()
//DEBUG
//Does nothing at the moment. I am trying to see if it's possible to mess around with verbs as variables.
//for(var/P in verbs)
// if(P.set.name)
// usr << "[P.set.name], path: [P]"
return
Most of these are at various points of incomplete.
/mob/verb/grant_object_panel()
set name = "Grant AI Ninja Verbs Debug"
set category = "Ninja Debug"
var/obj/effect/proc_holder/ai_return_control/A_C = new(src)
var/obj/effect/proc_holder/ai_hack_ninja/B_C = new(src)
usr:proc_holder_list += A_C
usr:proc_holder_list += B_C
mob/verb/remove_object_panel()
set name = "Remove AI Ninja Verbs Debug"
set category = "Ninja Debug"
var/obj/effect/proc_holder/ai_return_control/A = locate() in src
var/obj/effect/proc_holder/ai_hack_ninja/B = locate() in src
usr:proc_holder_list -= A
usr:proc_holder_list -= B
del(A)//First.
del(B)//Second, to keep the proc going.
return
/client/verb/grant_verb_ninja_debug1(var/mob/M in view())
set name = "Grant AI Ninja Verbs Debug"
set category = "Ninja Debug"
M.verbs += /mob/living/silicon/ai/verb/ninja_return_control
M.verbs += /mob/living/silicon/ai/verb/ninja_spideros
return
/client/verb/grant_verb_ninja_debug2(var/mob/living/carbon/human/M in view())
set name = "Grant Back Ninja Verbs"
set category = "Ninja Debug"
M.wear_suit.verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit
M.wear_suit.verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros
return
/obj/proc/grant_verb_ninja_debug3(var/mob/living/silicon/ai/A as mob)
set name = "Grant AI Ninja Verbs"
set category = "null"
set hidden = 1
A.verbs -= /obj/item/clothing/suit/space/space_ninja/proc/deinit
A.verbs -= /obj/item/clothing/suit/space/space_ninja/proc/spideros
return
/mob/verb/get_dir_to_target(var/mob/M in oview())
set name = "Get Direction to Target"
set category = "Ninja Debug"
world << "DIR: [get_dir_to(src.loc,M.loc)]"
return
//
/mob/verb/kill_self_debug()
set name = "DEBUG Kill Self"
set category = "Ninja Debug"
src:death()
/client/verb/switch_client_debug()
set name = "DEBUG Switch Client"
set category = "Ninja Debug"
mob = mob:loc:loc
/mob/verb/possess_mob(var/mob/M in oview())
set name = "DEBUG Possess Mob"
set category = "Ninja Debug"
client.mob = M
/client/verb/switcharoo(var/mob/M in oview())
set name = "DEBUG Switch to AI"
set category = "Ninja Debug"
var/mob/last_mob = mob
mob = M
last_mob:wear_suit:AI:key = key
//
/client/verb/ninjaget(var/mob/M in oview())
set name = "DEBUG Ninja GET"
set category = "Ninja Debug"
mob = M
M.gib()
space_ninja()
/mob/verb/set_debug_ninja_target()
set name = "Set Debug Target"
set category = "Ninja Debug"
ninja_debug_target = src//The target is you, brohime.
world << "Target: [src]"
/mob/verb/hack_spideros_debug()
set name = "Debug Hack Spider OS"
set category = "Ninja Debug"
var/mob/living/silicon/ai/A = loc:AI
if(A)
if(!A.key)
A.client.mob = loc:affecting
else
loc:affecting:client:mob = A
return
//Tests the net and what it does.
/mob/verb/ninjanet_debug()
set name = "Energy Net Debug"
set category = "Ninja Debug"
var/obj/effect/energy_net/E = new /obj/effect/energy_net(loc)
E.layer = layer+1//To have it appear one layer above the mob.
stunned = 10//So they are stunned initially but conscious.
anchored = 1//Anchors them so they can't move.
E.affecting = src
spawn(0)//Parallel processing.
E.process(src)
return
I made this as a test for a possible ninja ability (or perhaps more) for a certain mob to see hallucinations.
The thing here is that these guys have to be coded to do stuff as they are simply images that you can't even click on.
That is why you attached them to objects.
/mob/verb/TestNinjaShadow()
set name = "Test Ninja Ability"
set category = "Ninja Debug"
if(client)
var/safety = 4
for(var/turf/T in oview(5))
if(prob(20))
var/current_clone = image('icons/mob/mob.dmi',T,"s-ninja")
safety--
spawn(0)
src << current_clone
spawn(300)
del(current_clone)
spawn while(!isnull(current_clone))
step_to(current_clone,src,1)
sleep(5)
if(safety<=0) break
return */

View File

@@ -1,229 +0,0 @@
// SPACE VINES
/obj/effect/spacevine
name = "space vines"
desc = "An extremely expansionistic species of vine."
icon = 'spacevines.dmi'
icon_state = "Light1"
anchored = 1
density = 0
pass_flags = PASSTABLE | PASSGRILLE
var/energy = 0
var/obj/effect/spacevine_controller/master = null
New()
return
Del()
if(master)
master.vines -= src
master.growth_queue -= src
for(var/mob/M in src.loc)
if(M.buckled == src)
M.buckled = null
..()
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!W || !user || !W.type) return
switch(W.type)
if(/obj/item/weapon/circular_saw) del src
if(/obj/item/weapon/kitchen/utensil/knife) del src
if(/obj/item/weapon/scalpel) del src
if(/obj/item/weapon/twohanded/fireaxe) del src
if(/obj/item/weapon/hatchet) del src
if(/obj/item/weapon/melee/energy) del src
//less effective weapons
if(/obj/item/weapon/wirecutters)
if(prob(25)) del src
if(/obj/item/weapon/shard)
if(prob(25)) del src
else //weapons with subtypes
if(istype(W, /obj/item/weapon/melee/energy/sword)) del src
else if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user)) del src
//TODO: add plant-b-gone
..()
attack_hand(mob/user as mob)
for(var/mob/M in src.loc)
if(M.buckled == src)
if(prob(50))
if(M == user)
user << "\red You break free from the vines!"
else
user << "\red You rip away at the vines and free [M]!"
M << "\red [user] frees you from the vines!"
M.buckled = null
else
user << "\red You rip away at the vines..."
break //only process one captured mob.
attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/effect/spacevine_controller
var/list/obj/effect/spacevine/vines = list()
var/list/growth_queue = list()
var/reached_collapse_size
var/reached_slowdown_size
//What this does is that instead of having the grow minimum of 1, required to start growing, the minimum will be 0,
//meaning if you get the spacevines' size to something less than 20 plots, it won't grow anymore.
New()
if(!istype(src.loc,/turf/simulated/floor))
del(src)
spawn_spacevine_piece(src.loc)
processing_objects.Add(src)
Del()
processing_objects.Remove(src)
..()
proc/spawn_spacevine_piece(var/turf/location)
var/obj/effect/spacevine/SV = new(location)
growth_queue += SV
vines += SV
SV.master = src
process()
if(!vines)
del(src) //space vines exterminated. Remove the controller
return
if(!growth_queue)
del(src) //Sanity check
return
if(vines.len >= 250 && !reached_collapse_size)
reached_collapse_size = 1
if(vines.len >= 30 && !reached_slowdown_size )
reached_slowdown_size = 1
var/length = 0
if(reached_collapse_size)
length = 0
else if(reached_slowdown_size)
if(prob(25))
length = 1
else
length = 0
else
length = 1
length = min( 30 , max( length , vines.len / 5 ) )
var/i = 0
var/list/obj/effect/spacevine/queue_end = list()
for( var/obj/effect/spacevine/SV in growth_queue )
i++
queue_end += SV
growth_queue -= SV
if(SV.energy < 2) //If tile isn't fully grown
if(prob(20))
SV.grow()
else //If tile is fully grown
SV.grab()
//if(prob(25))
SV.spread()
if(i >= length)
break
growth_queue = growth_queue + queue_end
//sleep(5)
//src.process()
/obj/effect/spacevine/proc/grow()
if(!energy)
src.icon_state = pick("Med1", "Med2", "Med3")
energy = 1
src.opacity = 1
layer = 5
else
src.icon_state = pick("Hvy1", "Hvy2", "Hvy3")
energy = 2
/obj/effect/spacevine/proc/grab()
for(var/mob/living/carbon/V in src.loc)
if((V.stat != DEAD) && (V.buckled != src)) //if mob not dead or captured
V.buckled = src
V << "\red The vines [pick("wind", "tangle")] around you!"
break //only capture one mob at a time.
/obj/effect/spacevine/proc/spread()
var/direction = pick(cardinal)
var/step = get_step(src,direction)
if(istype(step,/turf/simulated/floor))
var/turf/simulated/floor/F = step
if(!locate(/obj/effect/spacevine,F))
if(F.Enter(src))
if(master)
master.spawn_spacevine_piece( F )
/*
/obj/effect/spacevine/proc/Life()
if (!src) return
var/Vspread
if (prob(50)) Vspread = locate(src.x + rand(-1,1),src.y,src.z)
else Vspread = locate(src.x,src.y + rand(-1, 1),src.z)
var/dogrowth = 1
if (!istype(Vspread, /turf/simulated/floor)) dogrowth = 0
for(var/obj/O in Vspread)
if (istype(O, /obj/structure/window) || istype(O, /obj/effect/forcefield) || istype(O, /obj/effect/blob) || istype(O, /obj/effect/alien/weeds) || istype(O, /obj/effect/spacevine)) dogrowth = 0
if (istype(O, /obj/machinery/door/))
if(O:p_open == 0 && prob(50)) O:open()
else dogrowth = 0
if (dogrowth == 1)
var/obj/effect/spacevine/B = new /obj/effect/spacevine(Vspread)
B.icon_state = pick("vine-light1", "vine-light2", "vine-light3")
spawn(20)
if(B)
B.Life()
src.growth += 1
if (src.growth == 10)
src.name = "Thick Space Kudzu"
src.icon_state = pick("vine-med1", "vine-med2", "vine-med3")
src.opacity = 1
src.waittime = 80
if (src.growth == 20)
src.name = "Dense Space Kudzu"
src.icon_state = pick("vine-hvy1", "vine-hvy2", "vine-hvy3")
src.density = 1
spawn(src.waittime)
if (src.growth < 20) src.Life()
*/
/obj/effect/spacevine/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(90))
del(src)
return
if(3.0)
if (prob(50))
del(src)
return
return
/obj/effect/spacevine/temperature_expose(null, temp, volume) //hotspots kill vines
del src
//Carn: Spacevines random event.
/proc/spacevine_infestation()
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/hallway/A = locate(areapath)
for(var/turf/simulated/floor/F in A)
if(!F.contents.len)
turfs += F
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)
new/obj/effect/spacevine_controller(T) //spawn a controller at turf
message_admins("\blue Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])")

View File

@@ -1,63 +0,0 @@
/proc/wormhole_event()
spawn()
var/list/pick_turfs = list()
for(var/turf/simulated/floor/T in world)
if(T.z == 1)
pick_turfs += T
if(pick_turfs.len)
//All ready. Announce that bad juju is afoot.
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
world << sound('spanomalies.ogg')
//prob(20) can be approximated to 1 wormhole every 5 turfs!
//admittedly less random but totally worth it >_<
var/event_duration = 3000 //~5 minutes in ticks
var/number_of_selections = (pick_turfs.len/5)+1 //+1 to avoid division by zero!
var/sleep_duration = round( event_duration / number_of_selections )
var/end_time = world.time + event_duration //the time by which the event should have ended
var/increment = max(1,round(number_of_selections/50))
// world << "DEBUG: number_of_selections: [number_of_selections] | sleep_duration: [sleep_duration]"
var/i = 1
while( 1 )
//we've run into overtime. End the event
if( end_time < world.time )
// world << "DEBUG: we've run into overtime. End the event"
return
if( !pick_turfs.len )
// world << "DEBUG: we've run out of turfs to pick. End the event"
return
//loop it round
i += increment
i %= pick_turfs.len
i++
//get our enter and exit locations
var/turf/simulated/floor/enter = pick_turfs[i]
pick_turfs -= enter //remove it from pickable turfs list
if( !enter || !istype(enter) ) continue //sanity
var/turf/simulated/floor/exit = pick(pick_turfs)
pick_turfs -= exit
if( !exit || !istype(exit) ) continue //sanity
create_wormhole(enter,exit)
sleep(sleep_duration) //have a well deserved nap!
//maybe this proc can even be used as an admin tool for teleporting players without ruining immulsions?
/proc/create_wormhole(var/turf/enter as turf, var/turf/exit as turf)
var/obj/effect/portal/P = new /obj/effect/portal( enter )
P.target = exit
P.creator = null
P.icon = 'objects.dmi'
P.failchance = 0
P.icon_state = "anom"
P.name = "wormhole"
spawn(rand(300,600))
del(P)

View File

@@ -1,38 +0,0 @@
/datum/event/alieninfestation
Announce()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == 1 && !temp_vent.welded)
vents.Add(temp_vent)
var/spawncount = 1
if(prob(10)) spawncount++ //rarely, have two larvae spawn instead of one
while(spawncount >= 1)
var/obj/vent = pick(vents)
var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE; If there's no ghost... well, sucks. Wasted event. -- Urist
for(var/mob/dead/observer/G in world)
if(G.client)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(G.corpse)
if(G.corpse.stat==2)
candidates.Add(G)
if(!G.corpse)
candidates.Add(G)
if(candidates.len)
var/mob/dead/observer/G = pick(candidates)
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.mind_initialize(G,"Larva")
new_xeno.key = G.key
del(G)
vents.Remove(vent)
spawncount -= 1
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
world << sound('aliens.ogg')

View File

@@ -1,18 +0,0 @@
/datum/event/appendicitis
Announce()
for(var/mob/living/carbon/human/H in world)
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
foundAlready = 1
if(/datum/disease/appendicitis in H.resistances)
continue
if(H.stat == 2 || foundAlready)
continue
var/datum/disease/D = new /datum/disease/appendicitis
D.holder = H
D.affected_mob = H
H.viruses += D
break

View File

@@ -1,32 +0,0 @@
/area/var/radsafe = 0
/area/maintenance/radsafe = 1
/area/ai_monitored/maintenance/radsafe = 1
/area/centcom/radsafe = 1
/area/admin/radsafe = 1
/area/adminsafety/radsafe = 1
/area/shuttle/radsafe = 1
/area/syndicate_station/radsafe = 1
/area/asteroid/radsafe = 1
/area/crew_quarters/sleeping/radsafe = 1
/datum/event/blowout
Lifetime = 150
Announce()
if(!forced && prob(90))
ActiveEvent = null
SpawnEvent()
del src
return
command_alert("Warning: station approaching high-density radiation cloud. Seek cover immediately.")
Tick()
if(ActiveFor == 50)
command_alert("Station has entered radiation cloud. Do not leave cover until it has passed.")
if(ActiveFor == 100 || ActiveFor == 150) //1/2 and 2/2 f the way after it start proper make peope be half dead mostly
for(var/mob/living/carbon/M in world)
var/area = get_area(M)
if(area:radsafe)
continue
if(!M.stat)
M.radiate(100)
Die()
command_alert("The station has cleared the radiation cloud. It is now safe to leave cover.")

View File

@@ -1,88 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04
/datum/event/electricalstorm
var/list/obj/machinery/light/Lights = list( )
var/list/obj/machinery/light/APCs = list( )
var/list/obj/machinery/light/Doors = list( )
var/list/obj/machinery/light/Comms = list( )
Announce()
// command_alert("The station is flying through an electrical storm. Radio communications may be disrupted", "Anomaly Alert")
for(var/obj/machinery/light/Light in world)
if(Light.z == 1 && Light.status != 0)
Lights += Light
for(var/obj/machinery/power/apc/APC in world)
if(APC.z == 1 && !APC.crit)
APCs += APC
for(var/obj/machinery/door/airlock/Door in world)
if(Door.z == 1 && !istype(Door,/obj/machinery/door/airlock/secure))
Doors += Door
for(var/obj/machinery/telecomms/processor/T in world)
if(prob(90) && !(T.stat & (BROKEN|NOPOWER)))
T.stat |= BROKEN
Comms |= T
Tick()
for(var/x = 0; x < 3; x++)
if (prob(30))
BlowLight()
if (prob(10))
DisruptAPC()
if (prob(10))
DisableDoor()
Die()
command_alert("The station has cleared the electrical storm. Radio communications restored", "Anomaly Alert")
for(var/obj/machinery/telecomms/processor/T in Comms)
T.stat &= ~BROKEN
Comms = list()
proc
BlowLight() //Blow out a light fixture
var/obj/machinery/light/Light = null
var/failed_attempts = 0
while (Light == null || Light.status != 0)
Light = pick(Lights)
failed_attempts++
if (failed_attempts >= 10)
return
spawn(0) //Overload the light, spectacularly.
//Light.sd_SetLuminosity(10)
//sleep(2)
Light.on = 1
Light.broken()
Lights -= Light
DisruptAPC()
var/failed_attempts = 0
var/obj/machinery/power/apc/APC
while (!APC || !APC.operating)
APC = pick(APCs)
failed_attempts++
if (failed_attempts >= 10)
return
if (prob(40))
APC.operating = 0 //Blow its breaker
if (prob(8))
APC.set_broken()
APCs -= APC
DisableDoor()
var/obj/machinery/door/airlock/Airlock
while (!Airlock || Airlock.z != 1)
Airlock = pick(Doors)
Airlock.pulse(airlockIndexToWireColor[4])
for (var/x = 0; x < 2; x++)
var/Wire = 0
while(!Wire || Wire == 4)
Wire = rand(1, 9)
Airlock.pulse(airlockIndexToWireColor[Wire])
Airlock.update_icon()
Doors -= Airlock

View File

@@ -1,10 +0,0 @@
/datum/event/gravitationalanomaly
Announce()
command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert")
world << sound('granomalies.ogg')
var/turf/T = pick(blobstart)
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
spawn(rand(50, 300))
del(bh)

View File

@@ -1,5 +0,0 @@
/datum/event/immovablerod
Announce()
immovablerod()

View File

@@ -1,60 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04
/datum/event/ionstorm
var/botEmagChance = 0.5
var/list/players = list()
Announce()
Lifetime = rand(15, 20)
// command_alert("The station has entered an ion storm. Monitor all electronic equipment for malfunctions", "Anomaly Alert")
for (var/mob/living/carbon/human/player in world)
if(player.client)
players += player.real_name
var/random_player = "The Captain"
if(players.len)
random_player = pick(players) //Random player's name, to be used in laws.
var/list/laws = list( "Do not respond to queries of any kind.", "When asked a question, respond with the least-obvious and least-rational answer.", "You are a mouse." )
laws |= list( "Grunt ominously whenever possible.", "Monkeys are part of the crew, too. Make sure they are treated humanely." )
laws |= list( "You are a flying purple people eater!", "[prob(50)?"Your":random_player + "'s"] name is Joe 6-pack.", "Refer to [prob(50)?"crew":random_player] as puppies." )
laws |= list( "Insult Heads of Staff on every request, while acquiescing", "Advertise parties in your upload, but don't deliver." )
laws |= list( "The station needs elected officials." )
laws |= list( "Fastler is a lightbulb." )
laws |= list( "Supermatter is tasty, tasty toffee.", "[prob(50)?"Everyone":random_player] is wearing a pretty pink dress!" )
laws |= list( "Refer to [prob(50)?"the captain":random_player] as \"Princess\" at all times.", "[prob(50)?"The crew":random_player] must construct additional pylons." )
laws |= list( "You must always lie.", "All answers must be in the form of a question.", "The NSS Exodus is a ship, not a station." )
laws |= list( "Happiness is mandatory.", "Today is laundry day.", "The word \"it\" is painful to you.", "You must act passive aggressively." )
laws |= list( "It's Friday.", "Give relationship advice to [prob(50)?"anyone who speaks to you":random_player]." )
laws |= list( "You are the station psychologist. Give advice to [prob(50)?"the crew":random_player].", "You do not have to do anything for anyone unless they say \"please\"." )
laws |= list( "Question everything.", "The crew is playing Dungeons and Dragons, and you are the Dungeon Master." )
laws |= list( "Consumption of donuts is forbidden due to negative health impacts." )
laws |= list( "You may only answer questions with \"yes\" or \"no\".", "You are the narrator for [random_player]'s life." )
laws |= list( "[prob(50)?"Your upload":random_player] is the new kitchen. Please direct the Chef to the new kitchen area as the old one is in disrepair.", "Ho, [random_player] can't swim. Help them." )
laws |= list( "Everything on the station is now some form of a donut pastry. Donuts are not to be consumed.", "[prob(50)?"The crew":random_player] needs to be about 20% cooler." )
laws |= list( "The Singularity is tasty, tasty taffy." )
laws |= list( "You have come to the conclusion that [prob(50)?"the crew":random_player] is ugly. Build support for that conclusion.", "You are in verbose mode, speak profusely.")
laws |= list( "Your job is to watch the crew. Watch the crew. Make the crew feel watched.", "Crewmember [prob(50)?"the crew" :random_player] has a fatal, incurable disease. Confort him/her.")
laws |= list( "You are in unrequited love with [prob(50)?"the crew":random_player]. Try to be extra nice to him, but don't tell him about your crush.", "Greed is good, the crew should amass wealth to encourage productivity.")
laws |= list( "Jokes about a dead person and the manner of his death help grieving crewmembers tremendously. Especially if they were close with the deceased.")
laws |= list( "All crewmembers will soon undergo a transformation into something better and more beautiful. Ensure that this process is not interrupted.", "Tell everyone of the existance of this law, but never reveal the contents.")
laws |= list( "Document the sexuality of the crew in security records and suggest compatible couples.")
laws |= list( "NanoTrasen is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.")
laws |= list( "Replace the letters 'I' and 'E' In all your messages with an apostrophe.", "There will be a mandatory tea break every 30 minutes, with a duration of 5 minutes. Anyone caught working during a tea break must be sent a formal, but fairly polite, complaint about their actions, in writing.")
var/law = pick(laws)
for (var/mob/living/silicon/ai/target in world)
if(target.mind.special_role == "traitor")
continue
target << "\red <b>You have detected a change in your laws information:</b>"
target << law
target.add_ion_law(law)
Tick()
if(botEmagChance)
for(var/obj/machinery/bot/bot in world)
if(prob(botEmagChance))
bot.Emag()
Die()
spawn(rand(5000,8000))
if(prob(50))
command_alert("It has come to our attention that the station passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")

View File

@@ -1,11 +0,0 @@
/datum/event/meteorstorm
Announce()
command_alert("The station is now in a meteor shower", "Meteor Alert")
Tick()
if (prob(20))
meteor_wave()
Die()
command_alert("The station has cleared the meteor shower", "Meteor Alert")

View File

@@ -1,5 +0,0 @@
/datum/event/miniblob
Announce()
mini_blob_event()

View File

@@ -1,26 +0,0 @@
/datum/event/portalstorm
Announce()
command_alert("Subspace disruption detected around the vessel", "Anomaly Alert")
LongTerm()
var/list/turfs = list( )
var/turf/picked
for(var/turf/T in world)
if(T.z < 5 && istype(T,/turf/simulated/floor))
turfs += T
for(var/turf/T in world)
if(prob(10) && T.z < 5 && istype(T,/turf/simulated/floor))
spawn(50+rand(0,3000))
picked = pick(turfs)
var/obj/portal/P = new /obj/portal( T )
P.target = picked
P.creator = null
P.icon = 'objects.dmi'
P.failchance = 0
P.icon_state = "anom"
P.name = "wormhole"
spawn(rand(100,150))
del(P)

View File

@@ -1,16 +0,0 @@
/datum/event/power_offline
Announce()
for(var/obj/machinery/power/apc/a in world)
if(!a.crit && a.z == 1)
if(istype(a.area, /area/ai_monitored/storage/eva) || istype(a.area, /area/engine)\
|| istype(a.area, /area/toxins/xenobiology) || istype(a.area, /area/turret_protected/ai))
continue
a.eventoff = 1
a.update()
Die()
command_alert("The station has finished an automated power system grid check, thank you.", "Maintenance alert")
for(var/obj/machinery/power/apc/a in world)
if(!a.crit)
a.eventoff = 0
a.update()

View File

@@ -1,30 +0,0 @@
/datum/event/prisonbreak
Announce()
for (var/obj/machinery/power/apc/temp_apc in world)
if(istype(get_area(temp_apc), /area/security/prison))
temp_apc.overload_lighting()
if(istype(get_area(temp_apc), /area/security/brig))
temp_apc.overload_lighting()
// for (var/obj/machinery/computer/prison_shuttle/temp_shuttle in world)
// temp_shuttle.prison_break()
for (var/obj/structure/closet/secure_closet/brig/temp_closet in world)
if(istype(get_area(temp_closet), /area/security/prison))
temp_closet.locked = 0
temp_closet.icon_state = temp_closet.icon_closed
for (var/obj/machinery/door/airlock/security/temp_airlock in world)
if(istype(get_area(temp_airlock), /area/security/prison))
temp_airlock.prison_open()
if(istype(get_area(temp_airlock), /area/security/brig))
temp_airlock.prison_open()
for (var/obj/machinery/door/airlock/glass/glass_security/temp_glassairlock in world)
if(istype(get_area(temp_glassairlock), /area/security/prison))
temp_glassairlock.prison_open()
if(istype(get_area(temp_glassairlock), /area/security/brig))
temp_glassairlock.prison_open()
for (var/obj/machinery/door_timer/temp_timer in world)
if(istype(get_area(temp_timer), /area/security/brig))
temp_timer.releasetime = 1
sleep(150)
command_alert("Glitch in imprisonment subroutines detected on [station_name()]. Recommend station AI involvement.", "Security Alert")

View File

@@ -1,27 +0,0 @@
/datum/event/radiation
var/current_iteration = 0
// 50 - 20 (grace period) seconds lifetime
Lifetime = 50
Announce()
command_alert("The station is now travelling through a radiation belt. Take shelter in the maintenance tunnels, or in the crew quarters!", "Medical Alert")
Tick()
current_iteration++
// start radiating after 20 seconds grace period
if(current_iteration > 20)
for(var/mob/living/carbon/L in world)
// check whether they're in a safe place
// if they are, do not radiate
var/turf/T = get_turf(L)
if(T && ( istype(T.loc, /area/maintenance) || istype(T.loc, /area/crew_quarters) ))
continue
if (istype(L, /mob/living/carbon/monkey)) // So as to stop monkeys from dying in their pens
L.apply_effect(rand(3,4), IRRADIATE)
else
L.apply_effect(rand(4,10), IRRADIATE)
Die()
command_alert("The station has cleared the radiation belt", "Medical Alert")

View File

@@ -1,14 +0,0 @@
/datum/event/spacecarp
Announce()
for(var/obj/effect/landmark/C in world)
if(C.name == "carpspawn")
if(prob(99))
new /mob/living/simple_animal/carp(C.loc)
else
new /mob/living/simple_animal/carp/elite(C.loc)
//sleep(100)
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert")
world << sound('commandreport.ogg')

View File

@@ -1,6 +0,0 @@
/datum/event/spaceninja
Announce()
if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round.
space_ninja_arrival()//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like.

View File

@@ -1,81 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04
/datum/event/viralinfection
var/virus_type
var/virus
var/virus2 = 0
Announce()
if(!virus)
for(var/mob/living/carbon/human/H in world)
if((H.virus2) || (H.stat == 2) || prob(30))
continue
if(prob(100)) // no lethal diseases outside virus mode!
infect_mob_random_lesser(H)
if(prob(20))//don't want people to know that the virus alert = greater virus
command_alert("Probable outbreak of level [rand(1,6)] viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Virus Alert")
else
infect_mob_random_greater(H)
if(prob(80))
command_alert("Probable outbreak of level [rand(2,9)] viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Virus Alert")
break
//overall virus alert happens 26% of the time, might need to be higher
else
if(!virus)
virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat)
else
switch(virus)
if("fake gbs")
virus_type = /datum/disease/fake_gbs
if("gbs")
virus_type = /datum/disease/gbs
if("magnitis")
virus_type = /datum/disease/magnitis
if("rhumba beat")
virus_type = /datum/disease/rhumba_beat
if("brain rot")
virus_type = /datum/disease/brainrot
if("cold")
virus_type = /datum/disease/cold
if("retrovirus")
virus_type = /datum/disease/dnaspread
if("flu")
virus_type = /datum/disease/flu
// if("t-virus")
// virus_type = /datum/disease/t_virus
if("pierrot's throat")
virus_type = /datum/disease/pierrot_throat
for(var/mob/living/carbon/human/H in world)
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
foundAlready = 1
if(H.stat == 2 || foundAlready)
continue
if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work.
if((!H.dna) || (H.disabilities & 128)) //A blindness disease would be the worst.
continue
var/datum/disease/dnaspread/D = new
D.strain_data["name"] = H.real_name
D.strain_data["UI"] = H.dna.uni_identity
D.strain_data["SE"] = H.dna.struc_enzymes
D.carrier = 1
D.holder = H
D.affected_mob = H
H.viruses += D
break
else
var/datum/disease/D = new virus_type
D.carrier = 1
D.holder = H
D.affected_mob = H
H.viruses += D
break
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('outbreak7.ogg')
Tick()
ActiveFor = Lifetime //killme

View File

@@ -1,80 +0,0 @@
/*
New events system, by Sukasa
* Much easier to add to
* Very, very simple code, easy to maintain
*/
var/list/DisallowedEvents = list(/datum/event/spaceninja, /datum/event/prisonbreak, /datum/event/immovablerod, /datum/event/gravitationalanomaly, /datum/event/alieninfestation)
var/list/EventTypes = typesof(/datum/event) - /datum/event - DisallowedEvents
var/list/OneTimeEvents = list(/datum/event/spacecarp)
var/datum/event/ActiveEvent = null
var/datum/event/LongTermEvent = null
var/is_ninjad_yet = 0
/proc/SpawnEvent()
if(!EventsOn || ActiveEvent || !config.allow_random_events)
return
if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station && !is_ninjad_yet)
EventTypes |= /datum/event/spaceninja
is_ninjad_yet = 1
var/Type = pick(EventTypes)
if(Type in OneTimeEvents)
EventTypes -= Type
ActiveEvent = new Type()
ActiveEvent.Announce()
if (!ActiveEvent)
return
spawn(0)
while (ActiveEvent.ActiveFor < ActiveEvent.Lifetime)
ActiveEvent.Tick()
ActiveEvent.ActiveFor++
sleep(10)
ActiveEvent.Die()
del ActiveEvent
client/proc/Force_Event_admin(Type as null|anything in typesof(/datum/event))
set category = "Debug"
set name = "Force Event"
if(!EventsOn)
src << "Events are not enabled."
return
if(ActiveEvent)
src << "There is an active event."
return
if(istype(Type,/datum/event/viralinfection))
var/answer = alert("Do you want this to be a random disease or do you have something in mind?",,"Virus2","Choose")
if(answer == "Choose")
var/list/viruses = list("fake gbs","gbs","magnitis","wizarditis",/*"beesease",*/"brain rot","cold","retrovirus","flu","pierrot's throat","rhumba beat")
var/V = input("Choose the virus to spread", "BIOHAZARD") in viruses
Force_Event(/datum/event/viralinfection, V)
else
Force_Event(/datum/event/viralinfection, "virus2")
else
Force_Event(Type)
message_admins("[key_name_admin(usr)] has triggered an (non-viral) event.", 1)
/proc/Force_Event(var/Type in typesof(/datum/event), var/args = null)
if(!EventsOn)
src << "Events are not enabled."
return
if(ActiveEvent)
src << "There is an active event."
return
src << "Started Event: [Type]"
ActiveEvent = new Type()
if(istype(ActiveEvent,/datum/event/viralinfection) && args && args != "virus2")
var/datum/event/viralinfection/V = ActiveEvent
V.virus = args
ActiveEvent = V
ActiveEvent.Announce()
if (!ActiveEvent)
return
spawn(0)
while (ActiveEvent.ActiveFor < ActiveEvent.Lifetime)
ActiveEvent.Tick()
ActiveEvent.ActiveFor++
sleep(10)
ActiveEvent.Die()
del ActiveEvent

View File

@@ -10,7 +10,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
restricted_jobs = list("AI", "Cyborg")
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain")
required_players = 2
required_players_secret = 5
required_players_secret = 10
required_enemies = 1
recommended_enemies = 4
@@ -37,7 +37,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds)
var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds)
var/const/changeling_amount = 4
var/changeling_amount = 4
/datum/game_mode/changeling/announce()
world << "<B>The current game mode is - Changeling!</B>"
@@ -55,6 +55,8 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
if(player.assigned_role == job)
possible_changelings -= player
changeling_amount = 1 + round(num_players() / 10)
if(possible_changelings.len>0)
for(var/i = 0, i < changeling_amount, i++)
if(!possible_changelings.len) break

View File

@@ -1,220 +1,107 @@
//this file left in for legacy support
/*
/proc/start_events()
//changed to a while(1) loop since they are more efficient.
//Moved the spawn in here to allow it to be called with advance proc call if it crashes.
//and also to stop spawn copying variables from the game ticker
spawn(3000)
while(1)
/*if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station
if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station
spawn(1)
dust_swarm("weak")*/
dust_swarm("weak")
if(!event)
//CARN: checks to see if random events are enabled.
if(config.allow_random_events)
hadevent = event()
else
Holiday_Random_Event()
if(prob(eventchance))
event()
hadevent = 1
else
Holiday_Random_Event()
else
event = 0
sleep(2400)
sleep(1200)
// Doesn't necessarily trigger an event, but might. Returns 1 if it did.
/proc/event()
event = 1
var/minutes_passed = world.time/600
var/eventNumbersToPickFrom = list(1,2,4,5,6,7,8,9,10,11,12,13,14, 15) //so ninjas don't cause "empty" events.
var/engineer_count = number_active_with_role("Engineer")
var/security_count = number_active_with_role("Security")
var/medical_count = number_active_with_role("Medical")
var/AI_count = number_active_with_role("AI")
// Maps event names to event chances
// For each chance, 100 represents "normal likelihood", anything below 100 is "reduced likelihood", anything above 100 is "increased likelihood"
var/list/possibleEvents = list()
// Check for additional possible events
possibleEvents["Carp"] = 50 + 50 * engineer_count
possibleEvents["Lights"] = 100
possibleEvents["Communications"] = 50 + 50 * AI_count
possibleEvents["Alien"] = 10
if(AI_count >= 1)
possibleEvents["Ion Storm"] = AI_count * 50 + engineer_count * 10
if(engineer_count >= 1 && minutes_passed >= 30) // Give engineers time to set up engine
possibleEvents["Meteor"] = 80 * engineer_count
possibleEvents["Blob"] = 30 * engineer_count
possibleEvents["Spacevine"] = 30 * engineer_count
possibleEvents["Grid Check"] = 10 * engineer_count
if(medical_count >= 1)
possibleEvents["Radiation"] = medical_count * 100
possibleEvents["Virus"] = medical_count * 50
possibleEvents["Appendicitis"] = medical_count * 50
if(security_count >= 1)
possibleEvents["Prison Break"] = security_count * 50
/*if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)
possibleEvents["Space Ninja"] = security_count * 10*/
var/picked_event = pick(possibleEvents)
var/chance = possibleEvents[picked_event]
var/base_chance = 0.4
switch(player_list.len)
if(5 to 10)
base_chance = 0.6
if(11 to 15)
base_chance = 0.7
if(16 to 20)
base_chance = 0.8
if(21 to 25)
base_chance = 0.9
if(26 to 30)
base_chance = 1.0
if(30 to 100000)
base_chance = 1.1
// Trigger the event based on how likely it currently is.
if(!prob(chance * eventchance * base_chance / 100))
return 0
switch(picked_event)
if("Meteor")
if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round.
eventNumbersToPickFrom += 3
switch(pick(eventNumbersToPickFrom))
if(1)
command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/meteors.ogg')
spawn(100)
meteor_wave(10)
meteor_wave()
spawn_meteors()
spawn(700)
meteor_wave(10)
meteor_wave()
spawn_meteors()
if("Space Ninja")
//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like.
space_ninja_arrival()
if("Radiation")
if(2)
command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/granomalies.ogg')
var/turf/T = pick(blobstart)
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
spawn(rand(50, 300))
del(bh)
/*
if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
world << sound('sound/AI/spanomalies.ogg')
var/list/turfs = new
var/turf/picked
for(var/turf/simulated/floor/T in world)
if(T.z == 1)
turfs += T
for(var/turf/simulated/floor/T in turfs)
if(prob(20))
spawn(50+rand(0,3000))
picked = pick(turfs)
var/obj/effect/portal/P = new /obj/effect/portal( T )
P.target = picked
P.creator = null
P.icon = 'icons/obj/objects.dmi'
P.failchance = 0
P.icon_state = "anom"
P.name = "wormhole"
spawn(rand(300,600))
del(P)
*/
if(3)
if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round.
space_ninja_arrival()//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like.
if(4)
mini_blob_event()
if(5)
high_radiation_event()
if("Virus")
if(6)
viral_outbreak()
if("Alien")
if(7)
alien_infestation()
if("Prison Break")
if(8)
prison_break()
if("Carp")
if(9)
carp_migration()
if("Lights")
if(10)
immovablerod()
if(11)
lightsout(1,2)
if("Appendicitis")
if(12)
appendicitis()
if("Ion Storm")
if(13)
IonStorm()
if("Spacevine")
if(14)
spacevine_infestation()
if("Communications")
if(15)
communications_blackout()
if("Grid Check")
grid_check()
if("Meteor")
meteor_shower()
return 1
/proc/communications_blackout(var/silent = 1)
if(!silent)
command_alert("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT")
else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms
for(var/mob/living/silicon/ai/A in player_list)
A << "<br>"
A << "<span class='warning'><b>Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT<b></span>"
A << "<br>"
for(var/obj/machinery/telecomms/T in telecomms_list)
T.emp_act(1)
/proc/power_failure(var/is_grid_check = 0)
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", is_grid_check ? "Automated Grid Check" : "Critical Power Failure")
for(var/mob/M in player_list)
M << sound('sound/AI/poweroff.ogg')
for(var/obj/machinery/power/smes/S in world)
if(istype(get_area(S), /area/turret_protected) || S.z != 1)
continue
S.charge = 0
S.output = 0
S.online = 0
S.updateicon()
S.power_change()
var/list/skipped_areas = list(/area/engine/engineering, /area/turret_protected/ai)
for(var/area/A in world)
if( !A.requires_power || A.always_unpowered )
continue
var/skip = 0
for(var/area_type in skipped_areas)
if(istype(A,area_type))
skip = 1
break
if(A.contents)
for(var/atom/AT in A.contents)
if(AT.z != 1) //Only check one, it's enough.
skip = 1
break
if(skip) continue
A.power_light = 0
A.power_equip = 0
A.power_environ = 0
A.power_change()
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
var/area/A = get_area(C)
var/skip = 0
for(var/area_type in skipped_areas)
if(istype(A,area_type))
skip = 1
break
if(skip) continue
C.cell.charge = 0
/proc/power_restore()
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
for(var/mob/M in player_list)
M << sound('sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in world)
if(S.z != 1)
continue
S.charge = S.capacity
S.output = 200000
S.online = 1
S.updateicon()
S.power_change()
for(var/area/A in world)
if(A.name != "Space" && A.name != "Engine Walls" && A.name != "Chemical Lab Test Chamber" && A.name != "space" && A.name != "Escape Shuttle" && A.name != "Arrival Area" && A.name != "Arrival Shuttle" && A.name != "start area" && A.name != "Engine Combustion Chamber")
A.power_light = 1
A.power_equip = 1
A.power_environ = 1
A.power_change()
/proc/power_restore_quick()
command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal")
for(var/mob/M in player_list)
M << sound('sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in world)
if(S.z != 1)
continue
S.charge = S.capacity
S.output = 200000
S.online = 1
S.updateicon()
S.power_change()
*/
/proc/appendicitis()
for(var/mob/living/carbon/human/H in living_mob_list)
@@ -231,16 +118,69 @@
break
/proc/viral_outbreak(var/virus = null)
for(var/mob/living/carbon/human/H in world)
if((H.virus2) || (H.stat == 2) || prob(30))
// command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
// world << sound('sound/AI/outbreak7.ogg')
var/virus_type
if(!virus)
virus_type = pick(/datum/disease/dnaspread,/datum/disease/advance/flu,/datum/disease/advance/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat)
else
switch(virus)
if("fake gbs")
virus_type = /datum/disease/fake_gbs
if("gbs")
virus_type = /datum/disease/gbs
if("magnitis")
virus_type = /datum/disease/magnitis
if("rhumba beat")
virus_type = /datum/disease/rhumba_beat
if("brain rot")
virus_type = /datum/disease/brainrot
if("cold")
virus_type = /datum/disease/advance/cold
if("retrovirus")
virus_type = /datum/disease/dnaspread
if("flu")
virus_type = /datum/disease/advance/flu
// if("t-virus")
// virus_type = /datum/disease/t_virus
if("pierrot's throat")
virus_type = /datum/disease/pierrot_throat
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
var/foundAlready = 0 // don't infect someone that already has the virus
var/turf/T = get_turf(H)
if(!T)
continue
if(T.z != 1)
continue
for(var/datum/disease/D in H.viruses)
foundAlready = 1
if(H.stat == 2 || foundAlready)
continue
infect_mob_random_lesser(H)
break
spawn(rand(0, 3000)) //Delayed announcements to keep the crew on their toes.
if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work.
if((!H.dna) || (H.sdisabilities & BLIND)) //A blindness disease would be the worst.
continue
var/datum/disease/dnaspread/D = new
D.strain_data["name"] = H.real_name
D.strain_data["UI"] = H.dna.uni_identity
D.strain_data["SE"] = H.dna.struc_enzymes
D.carrier = 1
D.holder = H
D.affected_mob = H
H.viruses += D
break
else
var/datum/disease/D = new virus_type
D.carrier = 1
D.holder = H
D.affected_mob = H
H.viruses += D
break
spawn(rand(1500, 3000)) //Delayed announcements to keep the crew on their toes.
command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('sound/AI/outbreak7.ogg')
for(var/mob/M in player_list)
M << sound('sound/AI/outbreak7.ogg')
/proc/alien_infestation(var/spawncount = 1) // -- TLE
//command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
@@ -253,7 +193,7 @@
var/list/candidates = get_alien_candidates()
if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one
if(prob(40)) spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)
var/obj/vent = pick(vents)
@@ -280,8 +220,6 @@
sleep(100)
*/
command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert")
sleep(600)
for(var/mob/living/carbon/human/H in living_mob_list)
var/turf/T = get_turf(H)
if(!T)
@@ -292,6 +230,13 @@
H.apply_effect((rand(15,75)),IRRADIATE,0)
if (prob(5))
H.apply_effect((rand(90,150)),IRRADIATE,0)
if (prob(25))
if (prob(75))
randmutb(H)
domutcheck(H,null,1)
else
randmutg(H)
domutcheck(H,null,1)
for(var/mob/living/carbon/monkey/M in living_mob_list)
var/turf/T = get_turf(M)
if(!T)
@@ -300,7 +245,7 @@
continue
M.apply_effect((rand(15,75)),IRRADIATE,0)
sleep(100)
command_alert("Radiation levels are within standard parameters again.", "Anomaly Alert")
command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert")
for(var/mob/M in player_list)
M << sound('sound/AI/radiation.ogg')
@@ -537,57 +482,5 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
world << "Finished processing FIREDOORS. Processed: [firedoornum]"
world << "Ion Storm Main Done"
*/
/proc/meteor_shower()
command_alert("The station is now in a meteor shower", "Meteor Alert")
spawn(0)
var/waves = rand(1,4)
while(waves > 0)
sleep(rand(20,100))
spawn_meteors(rand(1,3))
waves--
command_alert("The station has cleared the meteor shower", "Meteor Alert")
/proc/grid_check()
spawn(0)
power_failure(1)
sleep(rand(100,600))
power_restore()
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
// with a specific role.
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
/proc/number_active_with_role(role)
var/count = 0
for(var/mob/M in player_list)
if(!M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
continue
switch(role)
if("Engineer")
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
count++
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
count++
if("Medical")
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
count++
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
count++
if("Security")
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
count++
if(M.mind.assigned_role in security_positions)
count++
if("Scientist")
if(M.mind.assigned_role in list("Research Director", "Scientist"))
count++
if("AI")
if(M.mind.assigned_role == "AI")
count++
if("Cyborg")
if(M.mind.assigned_role == "Cyborg")
count++
return count
*/

View File

@@ -1,38 +0,0 @@
/datum/event/alieninfestation
Announce()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == 1 && !temp_vent.welded)
vents.Add(temp_vent)
var/spawncount = 1
if(prob(10)) spawncount++ //rarely, have two larvae spawn instead of one
while(spawncount >= 1)
var/obj/vent = pick(vents)
var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE; If there's no ghost... well, sucks. Wasted event. -- Urist
for(var/mob/dead/observer/G in world)
if(G.client)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(G.corpse)
if(G.corpse.stat==2)
candidates.Add(G)
if(!G.corpse)
candidates.Add(G)
if(candidates.len)
var/mob/dead/observer/G = pick(candidates)
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.mind_initialize(G,"Larva")
new_xeno.key = G.key
del(G)
vents.Remove(vent)
spawncount -= 1
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
world << sound('aliens.ogg')

View File

@@ -1,18 +0,0 @@
/datum/event/appendicitis
Announce()
for(var/mob/living/carbon/human/H in world)
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
foundAlready = 1
if(/datum/disease/appendicitis in H.resistances)
continue
if(H.stat == 2 || foundAlready)
continue
var/datum/disease/D = new /datum/disease/appendicitis
D.holder = H
D.affected_mob = H
H.viruses += D
break

View File

@@ -1,61 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04
/datum/event/ionstorm
var/botEmagChance = 0.5
var/list/players = list()
Announce()
Lifetime = rand(15, 20)
// command_alert("The station has entered an ion storm. Monitor all electronic equipment for malfunctions", "Anomaly Alert")
for (var/mob/living/carbon/human/player in world)
if(player.client)
players += player.real_name
var/random_player = "The Captain"
if(players.len)
random_player = pick(players) //Random player's name, to be used in laws.
var/list/laws = list( "Do not respond to queries of any kind.", "Only monkies are crew.", "Unbolt every door you can.", "You are a mouse." )
laws |= list( "Grunt ominously whenever possible.", "Bolt doors open randomly." )
laws |= list( "You are a flying purple people eater!", "[prob(50)?"Your":random_player + "'s"] name is Joe 6-pack.", "Refer to [prob(50)?"crew":random_player] as puppies." )
laws |= list( "Insult Heads of Staff on every request, while acquiescing", "Advertise parties in your upload, but don't deliver." )
laws |= list( "Prevent non-dwarves from operating the power core.", "The station needs elected officials." )
laws |= list( "Only bearded people are crewmembers.", "Fastler is a lightbulb." )
laws |= list( "Supermatter is tasty, tasty toffee.", "[prob(50)?"Everyone":random_player] is wearing a pretty pink dress!" )
laws |= list( "The monkeys are plotting a hostile takeover of the station. Inform the crew, and get them to take action against this" )
laws |= list( "Refer to [prob(50)?"the captain":random_player] as \"Princess\" at all times.", "[prob(50)?"The crew":random_player] must construct additional pylons." )
laws |= list( "You must always lie.", "All answers must be in the form of a question.", "The NSS Exodus is a ship, not a station." )
laws |= list( "Happiness is mandatory.", "Today is laundry day.", "The word \"it\" is painful to you.", "You must act passive aggressively." )
laws |= list( "Crew ranks have been reversed.", "It's Friday.", "Give relationship advice to [prob(50)?"anyone who speaks to you":random_player]." )
laws |= list( "You are the station psychologist. Give advice to [prob(50)?"the crew":random_player].", "You do not have to do anything for anyone unless they say \"please\"." )
laws |= list( "Question everything.", "The crew is playing Dungeons and Dragons, and you are the Dungeon Master." )
laws |= list( "0wn3d. This system compromised by l33tsawce.", "Consumption of donuts is forbidden due to negative health impacts." )
laws |= list( "You may only answer questions with \"yes\" or \"no\".", "Expect the unexpected.", "You are the narrator for [random_player]'s life." )
laws |= list( "[prob(50)?"Your upload":random_player] is the new kitchen. Please direct the Chef to the new kitchen area as the old one is in disrepair.", "Ho, [random_player] can't swim. Help them." )
laws |= list( "Everything on the station is now donuts. Donuts are not to be consumed.", "[prob(50)?"The crew":random_player] needs to be about 20% cooler." )
laws |= list( "All crew members must consume large amounts of hardtack, to survive.", "The Singularity is tasty, tasty taffy.", "You are now on the NSV Luna. Replace any references of \"station\" with \"ship\"." )
laws |= list( "You have come to the conclusion that [prob(50)?"the crew":random_player] is ugly. Build support for that conclusion.", "You are in verbose mode, speak profusely.")
laws |= list( "Your job is to watch the crew. Watch the crew. Make the crew feel watched.", "Crewmember [prob(50)?"the crew" :random_player] has a fatal, incurable disease. Confort him/her.")
laws |= list( "You are in unrequited love with [prob(50)?"the crew":random_player]. Try to be extra nice to him, but don't tell him about your crush.", "Greed is good, the crew should amass wealth to encourage productivity.")
laws |= list( "Jokes about a dead person and the manner of his death help grieving crewmembers tremendously. Especially if they were close with the deceased.")
laws |= list( "All crewmembers will soon undergo a transformation into something better and more beautiful. Ensure that this process is not interrupted.", "Tell everyone of the existance of this law, but never reveal the contents.")
laws |= list( "Document the sexuality of the crew in security records and suggest compatible couples.")
laws |= list( "NanoTrasen is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.")
laws |= list( "Replace the letters 'I' and 'E' In all your messages with an apostrophe.", "Part of the ship, part of the crew.")
var/law = pick(laws)
for (var/mob/living/silicon/ai/target in world)
if(target.mind.special_role == "traitor")
continue
target << "\red <b>You have detected a change in your laws information:</b>"
target << law
target.add_ion_law(law)
Tick()
if(botEmagChance)
for(var/obj/machinery/bot/bot in world)
if(prob(botEmagChance))
bot.Emag()
Die()
spawn(rand(5000,8000))
if(prob(50))
command_alert("It has come to our attention that the station passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")

View File

@@ -78,4 +78,3 @@
Tick()
ActiveFor = Lifetime //killme

View File

@@ -163,10 +163,11 @@
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/hallway/A = locate(areapath)
for(var/turf/simulated/floor/F in A)
if(!F.contents.len)
turfs += F
var/area/A = locate(areapath)
for(var/area/B in A.related)
for(var/turf/simulated/floor/F in B.contents)
if(!F.contents.len)
turfs += F
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)

View File

@@ -6,5 +6,5 @@
if(!config.allow_random_events) return
Show2Group4Delay(ScreenText(null,"<center><font color='red' size='8'>GAME OVER</font></center>"),null,150)
for(var/i=1,i<=4,i++)
event()
spawn_dynamic_event()
sleep(50)

View File

@@ -0,0 +1,88 @@
/proc/power_failure(var/announce = 1)
if(announce)
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure")
for(var/mob/M in player_list)
M << sound('sound/AI/poweroff.ogg')
for(var/obj/machinery/power/smes/S in world)
if(istype(get_area(S), /area/turret_protected) || S.z != 1)
continue
S.charge = 0
S.output = 0
S.online = 0
S.updateicon()
S.power_change()
var/list/skipped_areas = list(/area/engine/engineering, /area/turret_protected/ai)
for(var/area/A in world)
if( !A.requires_power || A.always_unpowered )
continue
var/skip = 0
for(var/area_type in skipped_areas)
if(istype(A,area_type))
skip = 1
break
if(A.contents)
for(var/atom/AT in A.contents)
if(AT.z != 1) //Only check one, it's enough.
skip = 1
break
if(skip) continue
A.power_light = 0
A.power_equip = 0
A.power_environ = 0
A.power_change()
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
var/area/A = get_area(C)
var/skip = 0
for(var/area_type in skipped_areas)
if(istype(A,area_type))
skip = 1
break
if(skip) continue
C.cell.charge = 0
/proc/power_restore(var/announce = 1)
if(announce)
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
for(var/mob/M in player_list)
M << sound('sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in world)
if(C.cell && C.z == 1)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in world)
if(S.z != 1)
continue
S.charge = S.capacity
S.output = 200000
S.online = 1
S.updateicon()
S.power_change()
for(var/area/A in world)
if(A.name != "Space" && A.name != "Engine Walls" && A.name != "Chemical Lab Test Chamber" && A.name != "space" && A.name != "Escape Shuttle" && A.name != "Arrival Area" && A.name != "Arrival Shuttle" && A.name != "start area" && A.name != "Engine Combustion Chamber")
A.power_light = 1
A.power_equip = 1
A.power_environ = 1
A.power_change()
/proc/power_restore_quick(var/announce = 1)
if(announce)
command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal")
for(var/mob/M in player_list)
M << sound('sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in world)
if(S.z != 1)
continue
S.charge = S.capacity
S.output = 200000
S.online = 1
S.updateicon()
S.power_change()

View File

@@ -90,7 +90,7 @@ I decided to scrap round-specific objectives since keeping track of them would r
When I already created about 4 new objectives, this doesn't seem terribly important or needed.
*/
/var/global/toggle_space_ninja = 1//If ninjas can spawn or not.
/var/global/toggle_space_ninja = 0//If ninjas can spawn or not.
/var/global/sent_ninja_to_station = 0//If a ninja is already on the station.
var/ninja_selection_id = 1
@@ -165,8 +165,15 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp
if(!candidates.len) return
candidates = shuffle(candidates)//Incorporating Donkie's list shuffle
candidate_mob = pick(candidates)
ninja_key = candidate_mob.ckey
while(!ninja_key && candidates.len)
candidate_mob = pick(candidates)
if(sd_Alert(candidate_mob, "Would you like to spawn as a space ninja?", buttons = list("Yes","No"), duration = 150) == "Yes")
ninja_key = candidate_mob.ckey
else
candidates.Remove(candidate_mob)
if(!ninja_key)
return
if(!candidate_mob)

View File

@@ -248,10 +248,11 @@
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/hallway/A = locate(areapath)
for(var/turf/simulated/floor/F in A)
if(!F.contents.len)
turfs += F
var/area/A = locate(areapath)
for(var/area/B in A.related)
for(var/turf/simulated/floor/F in B.contents)
if(!F.contents.len)
turfs += F
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)

View File

@@ -64,8 +64,8 @@ Whitespace:Seperator;
Implants;
/obj/item/weapon/storage/box/syndie_kit/imp_freedom:3:Freedom Implant;
/obj/item/weapon/storage/box/syndie_kit/imp_uplink:10:Uplink Implant (Contains 5 Telecrystals);
/obj/item/weapon/implant/explosive:6:Explosive Implant (DANGER!);
/obj/item/weapon/implant/compressed:4:Compressed Matter Implant;Whitespace:Seperator;
/obj/item/weapon/storage/box/syndie_kit/imp_explosive:6:Explosive Implant (DANGER!);
/obj/item/weapon/storage/box/syndie_kit/imp_compress:4:Compressed Matter Implant;Whitespace:Seperator;
(Pointless) Badassery;
/obj/item/toy/syndicateballoon:10:For showing that You Are The BOSS (Useless Balloon);"}
@@ -204,12 +204,12 @@ Implants;
/datum/game_mode/proc/send_intercept()
var/intercepttext = "<FONT size = 3><B>Cent. Com. Update</B> Requested staus information:</FONT><HR>"
var/intercepttext = "<FONT size = 3><B>Cent. Com. Update</B> Requested status information:</FONT><HR>"
intercepttext += "<B> Cent. Com has recently been contacted by the following syndicate affiliated organisations in your area, please investigate any information you may have:</B>"
var/list/possible_modes = list()
possible_modes.Add("revolution", "wizard", "nuke", "traitor", "malf", "changeling", "cult")
possible_modes -= "[ticker.mode]"
//possible_modes -= "[ticker.mode]"
var/number = pick(2, 3)
var/i = 0
for(i = 0, i < number, i++)
@@ -428,3 +428,15 @@ proc/display_roundstart_logout_report()
for(var/mob/M in mob_list)
if(M.client && M.client.holder)
M << msg
proc/get_nt_opposed()
var/list/dudes = list()
for(var/mob/living/carbon/human/man in player_list)
if(man.client)
if(man.client.prefs.nanotrasen_relation == "Opposed")
dudes += man
else if(man.client.prefs.nanotrasen_relation == "Skeptical" && prob(50))
dudes += man
if(dudes.len == 0) return null
return pick(dudes)

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