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

This commit is contained in:
Zuhayr
2013-01-06 03:12:48 -08:00
563 changed files with 31587 additions and 20824 deletions

View File

@@ -1,235 +1,17 @@
// DM Environment file for tgstation.dme.
// DM Environment file for baystation12.dme.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
#define FILE_DIR "code"
#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/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/obj/clothing"
#define FILE_DIR "code/defines/procs"
#define FILE_DIR "code/defines/sd_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/secstorage"
#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/player"
#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/vehicles/airtight"
#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/chemical"
#define FILE_DIR "code/modules/client"
#define FILE_DIR "code/modules/clothing"
#define FILE_DIR "code/modules/clothing/glasses"
#define FILE_DIR "code/modules/clothing/gloves"
#define FILE_DIR "code/modules/clothing/head"
#define FILE_DIR "code/modules/clothing/masks"
#define FILE_DIR "code/modules/clothing/shoes"
#define FILE_DIR "code/modules/clothing/spacesuits"
#define FILE_DIR "code/modules/clothing/suits"
#define FILE_DIR "code/modules/clothing/under"
#define FILE_DIR "code/modules/clothing/under/jobs"
#define FILE_DIR "code/modules/clothing/uniforms"
#define FILE_DIR "code/modules/critters"
#define FILE_DIR "code/modules/critters/hivebots"
#define FILE_DIR "code/modules/customitems"
#define FILE_DIR "code/modules/DetectiveWork"
#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/amorph"
#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/parasite"
#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/new_player"
#define FILE_DIR "code/modules/mob/simple_animal"
#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/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/Rust"
#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/mapload"
#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/SkyMarshal"
#define FILE_DIR "code/WorkInProgress/Tastyfish"
#define FILE_DIR "code/WorkInProgress/virus2"
#define FILE_DIR "code/WorkInProgress/virus2/Disease2"
#define FILE_DIR "code/WorkInProgress/Wrongnumber"
#define FILE_DIR "code/ZAS"
#define FILE_DIR "code/WorkInProgress/Susan"
#define FILE_DIR "html"
#define FILE_DIR "icons"
#define FILE_DIR "icons/48x48"
@@ -251,13 +33,12 @@
#define FILE_DIR "icons/turf"
#define FILE_DIR "icons/vehicles"
#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/wind"
#define FILE_DIR "sound/hallucinations"
#define FILE_DIR "sound/items"
#define FILE_DIR "sound/machines"
@@ -268,8 +49,6 @@
#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
@@ -282,6 +61,17 @@
#include "code\setup.dm"
#include "code\stylesheet.dm"
#include "code\world.dm"
#include "code\__HELPERS\files.dm"
#include "code\__HELPERS\game.dm"
#include "code\__HELPERS\global_lists.dm"
#include "code\__HELPERS\icons.dm"
#include "code\__HELPERS\lists.dm"
#include "code\__HELPERS\logging.dm"
#include "code\__HELPERS\names.dm"
#include "code\__HELPERS\text.dm"
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
#include "code\ATMOSPHERICS\datum_pipeline.dm"
@@ -349,6 +139,22 @@
#include "code\datums\diseases\robotic_transformation.dm"
#include "code\datums\diseases\wizarditis.dm"
#include "code\datums\diseases\xeno_transformation.dm"
#include "code\datums\diseases\advance\advance.dm"
#include "code\datums\diseases\advance\cold.dm"
#include "code\datums\diseases\advance\flu.dm"
#include "code\datums\diseases\advance\symptoms\confusion.dm"
#include "code\datums\diseases\advance\symptoms\cough.dm"
#include "code\datums\diseases\advance\symptoms\damage_converter.dm"
#include "code\datums\diseases\advance\symptoms\dizzy.dm"
#include "code\datums\diseases\advance\symptoms\fever.dm"
#include "code\datums\diseases\advance\symptoms\hallucigen.dm"
#include "code\datums\diseases\advance\symptoms\headache.dm"
#include "code\datums\diseases\advance\symptoms\itching.dm"
#include "code\datums\diseases\advance\symptoms\shivering.dm"
#include "code\datums\diseases\advance\symptoms\sneeze.dm"
#include "code\datums\diseases\advance\symptoms\symptoms.dm"
#include "code\datums\diseases\advance\symptoms\vomit.dm"
#include "code\datums\diseases\advance\symptoms\weight.dm"
#include "code\datums\helper_datums\construction_datum.dm"
#include "code\datums\helper_datums\events.dm"
#include "code\datums\helper_datums\getrev.dm"
@@ -382,25 +188,10 @@
#include "code\defines\obj\weapon.dm"
#include "code\defines\procs\AStar.dm"
#include "code\defines\procs\captain_announce.dm"
#include "code\defines\procs\church_name.dm"
#include "code\defines\procs\command_alert.dm"
#include "code\defines\procs\command_name.dm"
#include "code\defines\procs\dbcore.dm"
#include "code\defines\procs\forum_activation.dm"
#include "code\defines\procs\gamehelpers.dm"
#include "code\defines\procs\global_lists.dm"
#include "code\defines\procs\helper_list.dm"
#include "code\defines\procs\helper_text.dm"
#include "code\defines\procs\helper_type2type.dm"
#include "code\defines\procs\helpers.dm"
#include "code\defines\procs\icon_procs.dm"
#include "code\defines\procs\icon_procs_readme.dm"
#include "code\defines\procs\logging.dm"
#include "code\defines\procs\religion_name.dm"
#include "code\defines\procs\station_name.dm"
#include "code\defines\procs\sd_Alert.dm"
#include "code\defines\procs\statistics.dm"
#include "code\defines\procs\syndicate_name.dm"
#include "code\defines\procs\time_stamp.dm"
#include "code\game\asteroid.dm"
#include "code\game\atoms.dm"
#include "code\game\atoms_movable.dm"
@@ -504,6 +295,7 @@
#include "code\game\machinery\floodlight.dm"
#include "code\game\machinery\Freezer.dm"
#include "code\game\machinery\hologram.dm"
#include "code\game\machinery\holosign.dm"
#include "code\game\machinery\hydroponics.dm"
#include "code\game\machinery\igniter.dm"
#include "code\game\machinery\iv_drip.dm"
@@ -532,7 +324,6 @@
#include "code\game\machinery\turrets.dm"
#include "code\game\machinery\vending.dm"
#include "code\game\machinery\washing_machine.dm"
#include "code\game\machinery\wishgranter.dm"
#include "code\game\machinery\atmoalter\area_atmos_computer.dm"
#include "code\game\machinery\atmoalter\canister.dm"
#include "code\game\machinery\atmoalter\meter.dm"
@@ -628,7 +419,6 @@
#include "code\game\mecha\equipment\weapons\weapons.dm"
#include "code\game\mecha\medical\medical.dm"
#include "code\game\mecha\medical\odysseus.dm"
#include "code\game\mecha\working\firefighter.dm"
#include "code\game\mecha\working\ripley.dm"
#include "code\game\mecha\working\working.dm"
#include "code\game\objects\empulse.dm"
@@ -641,6 +431,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\biomass_rift.dm"
#include "code\game\objects\effects\bump_teleporter.dm"
#include "code\game\objects\effects\effect_system.dm"
@@ -671,6 +462,7 @@
#include "code\game\objects\items\blueprints.dm"
#include "code\game\objects\items\bodybag.dm"
#include "code\game\objects\items\candle.dm"
#include "code\game\objects\items\contraband.dm"
#include "code\game\objects\items\crayons.dm"
#include "code\game\objects\items\latexballoon.dm"
#include "code\game\objects\items\shooting_range.dm"
@@ -732,7 +524,6 @@
#include "code\game\objects\items\weapons\kitchen.dm"
#include "code\game\objects\items\weapons\manuals.dm"
#include "code\game\objects\items\weapons\mop.dm"
#include "code\game\objects\items\weapons\mousetraps.dm"
#include "code\game\objects\items\weapons\paint.dm"
#include "code\game\objects\items\weapons\paiwire.dm"
#include "code\game\objects\items\weapons\photography.dm"
@@ -780,6 +571,7 @@
#include "code\game\objects\items\weapons\tanks\jetpack.dm"
#include "code\game\objects\items\weapons\tanks\tank_types.dm"
#include "code\game\objects\items\weapons\tanks\tanks.dm"
#include "code\game\objects\storage\coat.dm"
#include "code\game\objects\structures\bedsheet_bin.dm"
#include "code\game\objects\structures\displaycase.dm"
#include "code\game\objects\structures\door_assembly.dm"
@@ -833,7 +625,6 @@
#include "code\game\objects\structures\stool_bed_chair_nest\bed.dm"
#include "code\game\objects\structures\stool_bed_chair_nest\chairs.dm"
#include "code\game\objects\structures\stool_bed_chair_nest\stools.dm"
#include "code\game\player\admin_report.dm"
#include "code\game\turfs\simulated.dm"
#include "code\game\turfs\turf.dm"
#include "code\game\turfs\unsimulated.dm"
@@ -864,6 +655,7 @@
#include "code\modules\admin\admin.dm"
#include "code\modules\admin\admin_investigate.dm"
#include "code\modules\admin\admin_memo.dm"
#include "code\modules\admin\admin_ranks.dm"
#include "code\modules\admin\admin_verbs.dm"
#include "code\modules\admin\banjob.dm"
#include "code\modules\admin\create_mob.dm"
@@ -876,9 +668,9 @@
#include "code\modules\admin\newbanjob.dm"
#include "code\modules\admin\player_notes.dm"
#include "code\modules\admin\player_panel.dm"
#include "code\modules\admin\topic.dm"
#include "code\modules\admin\ToRban.dm"
#include "code\modules\admin\DB ban\functions.dm"
#include "code\modules\admin\permissionverbs\assignment.dm"
#include "code\modules\admin\permissionverbs\permissionedit.dm"
#include "code\modules\admin\verbs\adminhelp.dm"
#include "code\modules\admin\verbs\adminjump.dm"
@@ -911,6 +703,7 @@
#include "code\modules\assembly\holder.dm"
#include "code\modules\assembly\igniter.dm"
#include "code\modules\assembly\infrared.dm"
#include "code\modules\assembly\mousetrap.dm"
#include "code\modules\assembly\proximity.dm"
#include "code\modules\assembly\shock_kit.dm"
#include "code\modules\assembly\signaler.dm"
@@ -1359,8 +1152,10 @@
#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\Mini\atmos_control.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\virus2\analyser.dm"
#include "code\WorkInProgress\virus2\antibodies.dm"
#include "code\WorkInProgress\virus2\base.dm"
@@ -1381,5 +1176,6 @@
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "maps\tgstation.2.0.9.1.dmm"
#include "maps\RandomZLevels\Academy.dm"
#include "maps\RandomZLevels\stationCollision.dm"
// END_INCLUDE

View File

@@ -138,7 +138,7 @@ obj/machinery/atmospherics/binary/passive_gate
if(!src.allowed(user))
user << "\red Access denied."
return
usr.machine = src
usr.set_machine(src)
interact(user)
return
@@ -149,7 +149,7 @@ obj/machinery/atmospherics/binary/passive_gate
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
src.target_pressure = max(0, min(4500, new_pressure))
usr.machine = src
usr.set_machine(src)
src.update_icon()
src.updateUsrDialog()
return

View File

@@ -156,7 +156,7 @@ obj/machinery/atmospherics/binary/pump
if(!src.allowed(user))
user << "\red Access denied."
return
usr.machine = src
usr.set_machine(src)
interact(user)
return
@@ -167,7 +167,7 @@ obj/machinery/atmospherics/binary/pump
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
src.target_pressure = max(0, min(4500, new_pressure))
usr.machine = src
usr.set_machine(src)
src.update_icon()
src.updateUsrDialog()
return

View File

@@ -147,7 +147,7 @@ obj/machinery/atmospherics/binary/volume_pump
if(!src.allowed(user))
user << "\red Access denied."
return
usr.machine = src
usr.set_machine(src)
interact(user)
return
@@ -158,7 +158,7 @@ obj/machinery/atmospherics/binary/volume_pump
if(href_list["set_transfer_rate"])
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",src.transfer_rate) as num
src.transfer_rate = max(0, min(200, new_transfer_rate))
usr.machine = src
usr.set_machine(src)
src.update_icon()
src.updateUsrDialog()
return

View File

@@ -211,7 +211,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
if(..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["filterset"])
src.filter_type = text2num(href_list["filterset"])

View File

@@ -112,7 +112,7 @@ obj/machinery/atmospherics/trinary/mixer
if(!src.allowed(user))
user << "\red Access denied."
return
usr.machine = src
usr.set_machine(src)
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
<b>Desirable output pressure: </b>
[target_pressure]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>

View File

@@ -5,13 +5,14 @@
name = "Air Vent"
desc = "Has a valve and pump attached to it"
var/area/initial_loc
level = 1
var/area_uid
var/id_tag = null
var/id_tag
power_channel = ENVIRON
var/on = 0
var/pump_direction = 1 //0 = siphoning, 1 = releasing
var/pump_speed = 1 //Used to adjust speed for siphons
var/external_pressure_bound = ONE_ATMOSPHERE
var/internal_pressure_bound = 0
@@ -42,25 +43,27 @@
icon_state = "in"
New()
initial_loc = get_area(loc)
if (initial_loc.master)
initial_loc = initial_loc.master
area_uid = initial_loc.uid
var/area/A = get_area(loc)
if (A.master)
A = A.master
area_uid = A.uid
if (!id_tag)
assign_uid()
id_tag = num2text(uid)
if(ticker && ticker.current_state == 3)//if the game is running
src.initialize()
src.broadcast_status()
initialize()
broadcast_status()
..()
high_volume
name = "Large Air Vent"
power_channel = EQUIP
New()
..()
air_contents.volume = 1000
update_icon()
if(welded)
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]weld"
@@ -77,11 +80,12 @@
process()
..()
// broadcast_status()
if(stat & (NOPOWER|BROKEN))
return
if (!node)
on = 0
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
if(!on)
return 0
@@ -101,7 +105,7 @@
if(pressure_delta > 0)
if(air_contents.temperature > 0)
var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/transfer_moles = pressure_delta*environment.volume*environment.group_multiplier*pump_speed/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
@@ -119,7 +123,7 @@
if(pressure_delta > 0)
if(environment.temperature > 0)
var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
var/transfer_moles = pressure_delta*air_contents.volume*air_contents.group_multiplier*pump_speed/(environment.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
if (isnull(removed)) //in space
@@ -132,16 +136,18 @@
return 1
//Radio remote control
proc
set_frequency(new_frequency)
proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = radio_controller.add_object(src, frequency,radio_filter_in)
broadcast_status()
proc/broadcast_status()
if(!radio_connection)
return 0
@@ -159,7 +165,8 @@
"internal" = internal_pressure_bound,
"external" = external_pressure_bound,
"timestamp" = world.time,
"sigtype" = "status"
"sigtype" = "status",
"setting" = pump_speed
)
radio_connection.post_signal(src, signal, radio_filter_out)
@@ -176,6 +183,7 @@
if(frequency)
set_frequency(frequency)
receive_signal(datum/signal/signal)
if(stat & (NOPOWER|BROKEN))
return
@@ -203,47 +211,29 @@
if("checks_toggle" in signal.data)
pressure_checks = (pressure_checks?0:3)
if("direction" in signal.data)
if("direction" in signal)
pump_direction = text2num(signal.data["direction"])
if("set_internal_pressure" in signal.data)
internal_pressure_bound = between(
0,
text2num(signal.data["set_internal_pressure"]),
ONE_ATMOSPHERE*50
)
internal_pressure_bound = between(0, text2num(signal.data["set_internal_pressure"]), ONE_ATMOSPHERE*50)
if("set_external_pressure" in signal.data)
external_pressure_bound = between(
0,
text2num(signal.data["set_external_pressure"]),
ONE_ATMOSPHERE*50
)
external_pressure_bound = between(0, text2num(signal.data["set_external_pressure"]), ONE_ATMOSPHERE*50)
if("adjust_internal_pressure" in signal.data)
internal_pressure_bound = between(
0,
internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),
ONE_ATMOSPHERE*50
)
internal_pressure_bound = between(0, internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]), ONE_ATMOSPHERE*50)
if("adjust_external_pressure" in signal.data)
external_pressure_bound = between(
0,
external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),
ONE_ATMOSPHERE*50
)
external_pressure_bound = between(0, external_pressure_bound + text2num(signal.data["adjust_external_pressure"]), ONE_ATMOSPHERE*50)
if("init" in signal.data)
name = signal.data["init"]
return
if("status" in signal.data)
spawn(2)
broadcast_status()
return //do not update_icon
if("setting" in signal.data)
pump_speed = text2num(signal.data["setting"])
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal["command"]]\"\n[signal.debug_print()]")
spawn(2)
broadcast_status()
update_icon()
@@ -284,6 +274,7 @@
else
user << "\blue You need more welding fuel to complete this task."
return 1
examine()
set src in oview(1)
..()
@@ -322,9 +313,3 @@
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
del(src)
/obj/machinery/atmospherics/unary/vent_pump/Del()
if (initial_loc.air_scrub_info)
initial_loc.air_scrub_info -= id_tag
..()
return

View File

@@ -7,34 +7,36 @@
level = 1
var/area/initial_loc
var/id_tag = null
var/frequency = 1439
var/datum/radio_frequency/radio_connection
var/on = 0
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
var/scrub_CO2 = 1
var/scrub_Toxins = 0
var/scrub_N2O = 0
var/scrub_rate = 1
var/volume_rate = 120
var/panic = 0 //is this scrubber panicked?
var/area_uid
var/frequency = 1439
var/datum/radio_frequency/radio_connection
var/radio_filter_out
var/radio_filter_in
New()
initial_loc = get_area(loc)
if (initial_loc.master)
initial_loc = initial_loc.master
area_uid = initial_loc.uid
var/area/A = get_area(loc)
if (A.master)
A = A.master
area_uid = A.uid
if (!id_tag)
assign_uid()
id_tag = num2text(uid)
if(ticker && ticker.current_state == 3)//if the game is running
src.initialize()
src.broadcast_status()
initialize()
broadcast_status()
..()
update_icon()
@@ -86,20 +88,20 @@
process()
..()
// broadcast_status()
if(stat & (NOPOWER|BROKEN))
return
if (!node)
on = 0
//broadcast_status()
if(!on)
return 0
var/datum/gas_mixture/environment = loc.return_air()
if(scrubbing)
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
var/transfer_moles = min(1, volume_rate*scrub_rate/environment.volume)*environment.total_moles
//Take a gas sample
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
@@ -118,15 +120,14 @@
if(removed.trace_gases.len>0)
for(var/datum/gas/trace_gas in removed.trace_gases)
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
//Remix the resulting gases
filtered_out.update_values()
removed.update_values()
air_contents.merge(filtered_out)
loc.assume_air(removed)
@@ -138,7 +139,7 @@
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
return
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
var/transfer_moles = environment.total_moles*(volume_rate*scrub_rate/environment.volume)
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
@@ -220,6 +221,9 @@
broadcast_status()
return //do not update_icon
if("setting" in signal.data)
scrub_rate = text2num(signal.data["setting"])
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
spawn(2)
broadcast_status()
@@ -227,7 +231,7 @@
return
power_change()
if(powered(power_channel))
if(powered(ENVIRON))
stat &= ~NOPOWER
else
stat |= NOPOWER
@@ -258,9 +262,3 @@
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
del(src)
/obj/machinery/atmospherics/unary/vent_scrubber/Del()
if (initial_loc.air_scrub_info)
initial_loc.air_scrub_info -= id_tag
..()
return

View File

@@ -90,7 +90,8 @@ datum/air_group
if (next_check > 0)
next_check--
return 1
next_check += check_delay + rand(max(check_delay, 1)/2,check_delay)
var/player_count = max(player_list.len, 3) / 3
next_check += check_delay + rand(player_count, player_count * 1.5)
check_delay++
var/turf/simulated/list/border_individual = list()

View File

@@ -152,7 +152,7 @@
else
chance_of_deletion = 100
if(prob(chance_of_deletion))
T.ReplaceWithSpace()
T.ChangeTurf(/turf/space)
else
T.to_be_destroyed = 0
T.max_fire_temperature_sustained = 0

View File

@@ -304,7 +304,8 @@ turf
if (next_check > 0)
next_check--
return 1
next_check += check_delay + rand(max(check_delay, 1)/2,check_delay)
var/player_count = max(player_list.len, 3) / 3
next_check += check_delay + rand(player_count, player_count * 1.5)
check_delay++
var/turf/simulated/list/possible_fire_spreads = list()

View File

@@ -13,15 +13,6 @@
spawn(0)
core_generator = locate() in world
attack_ai(mob/user)
attack_hand(user)
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
Topic(href, href_list)
..()
if( href_list["shutdown"] )
@@ -52,7 +43,6 @@
if(updating)
src.updateDialog()
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -68,7 +68,6 @@ var/const/max_assembly_amount = 300
F.loc = src.loc
return
proc
interact(mob/user)
/*if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -121,7 +121,6 @@
..()
src.updateDialog()
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -97,7 +97,6 @@
return*/
interact(user)
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -163,16 +163,6 @@
pixel_x = -pixel_x
pixel_y = -pixel_y
attack_ai(mob/user)
attack_hand(user)
attack_hand(mob/user)
add_fingerprint(user)
/*if(stat & (BROKEN|NOPOWER))
return*/
interact(user)
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -7,20 +7,6 @@
New()
..()
attack_ai(mob/user)
attack_hand(user)
attack_hand(mob/user)
add_fingerprint(user)
/*if(stat & (BROKEN|NOPOWER))
return*/
interact(user)
/*updateDialog()
for(var/mob/M in range(1))
if(M.machine == src)
interact(m)*/
Topic(href, href_list)
..()
if( href_list["close"] )
@@ -37,7 +23,6 @@
if(updating)
src.updateDialog()
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -14,20 +14,10 @@
if(las.id == src.id)
lasers += las
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
attack_ai(mob/user)
attack_hand(user)
process()
..()
updateDialog()
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))

View File

@@ -119,10 +119,6 @@
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/attack_hand(mob/user as mob)
interact(user)
src.add_fingerprint(user)
/obj/machinery/shield_capacitor/Topic(href, href_list[])
..()
if( href_list["close"] )
@@ -144,7 +140,7 @@
//
updateDialog()
/obj/machinery/shield_capacitor/proc/interact(mob/user)
/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

View File

@@ -148,11 +148,6 @@
//
updateDialog()
/obj/machinery/shield_gen/attack_hand(mob/user as mob)
interact(user)
src.add_fingerprint(user)
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
@@ -241,7 +236,7 @@
//
updateDialog()
/obj/machinery/shield_gen/proc/interact(mob/user)
/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

View File

@@ -16,7 +16,7 @@
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
if(..())
return
user.machine = src
user.set_machine(src)
if(allowed(user))
overridden = 1
else if(!emagged)
@@ -139,6 +139,12 @@
src.updateUsrDialog()
return
if(href_list["atmos_unlock"])
switch(href_list["atmos_unlock"])
if("0")
current.air_doors_close(1)
if("1")
current.air_doors_open(1)
if(href_list["atmos_alarm"])
if (current.alarm_area.atmosalert(2))
@@ -187,6 +193,8 @@
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_SCRUBBING]'>turn syphoning off</A>"
else
output += "<A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_PANIC]'><font color='red'><B>ACTIVATE PANIC SYPHON IN AREA</B></font></A>"
output += "<br><br>Atmospheric Lockdown: <a href='?src=\ref[src];alarm=\ref[current];atmos_unlock=[current.alarm_area.air_doors_activated]'>[current.alarm_area.air_doors_activated ? "<b>ENABLED</b>" : "Disabled"]</a>"
if (AALARM_SCREEN_VENT)
var/sensor_data = ""
if(current.alarm_area.air_vent_names.len)

View File

@@ -31,7 +31,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if(!uplink_data)
uplink_data = ticker.mode.uplink_items
items = dd_replacetext(uplink_data, "\n", "") // Getting the text string of items
items = replacetext(uplink_data, "\n", "") // Getting the text string of items
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
uses = ticker.mode.uplink_uses

View File

@@ -116,7 +116,7 @@
new /obj/item/clothing/head/helmet/welding(src)
new /obj/item/weapon/storage/belt/utility/full(src)
new /obj/item/weapon/storage/toolbox/mechanical(src)
new /obj/item/clothing/suit/hazardvest(src)
new /obj/item/clothing/suit/storage/hazardvest(src)
new /obj/item/clothing/gloves/yellow(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/glasses/meson(src)
@@ -135,7 +135,7 @@
new /obj/item/weapon/pen(src)
new /obj/item/device/pda/engineering(src)
new /obj/item/device/t_scanner(src)
new /obj/item/clothing/suit/hazardvest(src)
new /obj/item/clothing/suit/storage/hazardvest(src)
new /obj/item/weapon/storage/belt/utility/full(src)
new /obj/item/weapon/storage/toolbox/mechanical(src)
new /obj/item/clothing/mask/gas(src)
@@ -426,7 +426,7 @@
new /obj/item/taperoll/police(src)
new /obj/item/weapon/storage/box/evidence(src)
new /obj/item/device/pda/detective(src)
new /obj/item/clothing/suit/det_suit/armor(src)
new /obj/item/clothing/suit/storage/det_suit/armor(src)
new /obj/item/clothing/suit/storage/det_suit(src)
new /obj/item/clothing/gloves/detective(src)
new /obj/item/clothing/head/det_hat(src)
@@ -606,9 +606,9 @@
new /obj/item/clothing/shoes/brown(src)
if(prob(50))
new /obj/item/clothing/under/lawyer/bluesuit(src)
new /obj/item/clothing/suit/lawyer/bluejacket(src)
new /obj/item/clothing/suit/storage/lawyer/bluejacket(src)
else
new /obj/item/clothing/under/lawyer/purpsuit(src)
new /obj/item/clothing/suit/lawyer/purpjacket(src)
new /obj/item/clothing/suit/storage/lawyer/purpjacket(src)

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,497 @@
//this is everything i'm going to be using in my outpost zeta map, and possibly future maps.
turf/unsimulated/desert
name = "desert"
icon = 'desert.dmi'
icon_state = "desert"
temperature = 393.15
luminosity = 5
brightness_on = 1
lighting_lumcount = 8
turf/unsimulated/desert/New()
icon_state = "desert[rand(0,4)]"
/area/awaymission/labs/researchdivision
name = "Research"
icon_state = "away3"
/area/awaymission/labs/militarydivision
name = "Military"
icon_state = "away2"
/area/awaymission/labs/gateway
name = "Gateway"
icon_state = "away1"
/area/awaymission/labs/command
name = "Command"
icon_state = "away"
/area/awaymission/labs/civilian
name = "Civilian"
icon_state = "away3"
/area/awaymission/labs/cargo
name = "Cargo"
icon_state = "away2"
/area/awaymission/labs/medical
name = "Medical"
icon_state = "away1"
/area/awaymission/labs/security
name = "Security"
icon_state = "away"
/area/awaymission/labs/solars
name = "Solars"
icon_state = "away3"
/area/awaymission/labs/cave
name = "Caves"
icon_state = "away2"
//corpses and possibly other decorative items
/obj/effect/landmark/corpse/alien/New() //Creates a mob and checks for gear in each slot before attempting to equip it.
var/mob/living/carbon/human/M = new /mob/living/carbon/human (src.loc)
M.dna.mutantrace = "lizard"
M.real_name = src.name
M.stat = 2 //Kills the new mob
if(src.corpseuniform)
M.equip_to_slot_or_del(new src.corpseuniform(M), slot_w_uniform)
if(src.corpsesuit)
M.equip_to_slot_or_del(new src.corpsesuit(M), slot_wear_suit)
if(src.corpseshoes)
M.equip_to_slot_or_del(new src.corpseshoes(M), slot_shoes)
if(src.corpsegloves)
M.equip_to_slot_or_del(new src.corpsegloves(M), slot_gloves)
if(src.corpseradio)
M.equip_to_slot_or_del(new src.corpseradio(M), slot_ears)
if(src.corpseglasses)
M.equip_to_slot_or_del(new src.corpseglasses(M), slot_glasses)
if(src.corpsemask)
M.equip_to_slot_or_del(new src.corpsemask(M), slot_wear_mask)
if(src.corpsehelmet)
M.equip_to_slot_or_del(new src.corpsehelmet(M), slot_head)
if(src.corpsebelt)
M.equip_to_slot_or_del(new src.corpsebelt(M), slot_belt)
if(src.corpsepocket1)
M.equip_to_slot_or_del(new src.corpsepocket1(M), slot_r_store)
if(src.corpsepocket2)
M.equip_to_slot_or_del(new src.corpsepocket2(M), slot_l_store)
if(src.corpseback)
M.equip_to_slot_or_del(new src.corpseback(M), slot_back)
if(src.corpseid == 1)
var/obj/item/weapon/card/id/W = new(M)
W.name = "[M.real_name]'s ID Card"
if(src.corpseidicon)
W.icon_state = corpseidicon
if(src.corpseidaccess)
W.access = get_access(corpseidaccess)
if(corpseidjob)
W.assignment = corpseidjob
W.registered_name = M.real_name
M.equip_to_slot_or_del(W, slot_wear_id)
del(src)
/obj/effect/landmark/corpse/alien/cargo
name = "Cargo Technician"
corpseuniform = /obj/item/clothing/under/rank/cargo
corpseradio = /obj/item/device/radio/headset/headset_cargo
corpseid = 1
corpseidjob = "Cargo Technician"
corpseidaccess = "Quartermaster"
/obj/effect/landmark/corpse/alien/laborer
name = "Laborer"
corpseuniform = /obj/item/clothing/under/overalls
corpseradio = /obj/item/device/radio/headset/headset_eng
corpseback = /obj/item/weapon/storage/backpack/industrial
corpsebelt = /obj/item/weapon/storage/belt/utility/full
corpsehelmet = /obj/item/clothing/head/hardhat
corpseid = 1
corpseidjob = "Laborer"
corpseidaccess = "Engineer"
/obj/effect/landmark/corpse/alien/testsubject
name = "Unfortunate Test Subject"
corpseuniform = /obj/item/clothing/under/color/white
corpseid = 0
/obj/effect/landmark/corpse/overseer
name = "Overseer"
corpseuniform = /obj/item/clothing/under/rank/navyhead_of_security
corpsesuit = /obj/item/clothing/suit/armor/hosnavycoat
corpseradio = /obj/item/device/radio/headset/heads/captain
corpsegloves = /obj/item/clothing/gloves/black/hos
corpseshoes = /obj/item/clothing/shoes/swat
corpsehelmet = /obj/item/clothing/head/beret/navyhos
corpseglasses = /obj/item/clothing/glasses/eyepatch
corpseid = 1
corpseidjob = "Facility Overseer"
corpseidaccess = "Captain"
/obj/effect/landmark/corpse/officer
name = "Security Officer"
corpseuniform = /obj/item/clothing/under/rank/navysecurity
corpsesuit = /obj/item/clothing/suit/armor/navysecvest
corpseradio = /obj/item/device/radio/headset/headset_sec
corpseshoes = /obj/item/clothing/shoes/swat
corpsehelmet = /obj/item/clothing/head/beret/navysec
corpseid = 1
corpseidjob = "Security Officer"
corpseidaccess = "Security Officer"
/*
* Weeds
*/
#define NODERANGE 1
/obj/effect/alien/flesh/weeds
name = "Fleshy Growth"
desc = "A pulsating grouping of odd, alien tissues. It's almost like it has a heartbeat..."
icon = 'biocraps.dmi'
icon_state = "flesh"
anchored = 1
density = 0
var/health = 15
var/obj/effect/alien/weeds/node/linked_node = null
/obj/effect/alien/flesh/weeds/node
icon_state = "fleshnode"
icon = 'biocraps.dmi'
name = "Throbbing Pustule"
desc = "A grotquese, oozing, pimple-like growth. You swear you can see something moving around in the bulb..."
luminosity = NODERANGE
var/node_range = NODERANGE
/obj/effect/alien/flesh/weeds/node/New()
..(src.loc, src)
/obj/effect/alien/flesh/weeds/New(pos, node)
..()
linked_node = node
if(istype(loc, /turf/space))
del(src)
return
if(icon_state == "flesh")icon_state = pick("flesh", "flesh1", "flesh2")
spawn(rand(150, 200))
if(src)
Life()
return
/obj/effect/alien/flesh/weeds/proc/Life()
set background = 1
var/turf/U = get_turf(src)
/*
if (locate(/obj/movable, U))
U = locate(/obj/movable, U)
if(U.density == 1)
del(src)
return
Alien plants should do something if theres a lot of poison
if(U.poison> 200000)
health -= round(U.poison/200000)
update()
return
*/
if (istype(U, /turf/space))
del(src)
return
direction_loop:
for(var/dirn in cardinal)
var/turf/T = get_step(src, dirn)
if (!istype(T) || T.density || locate(/obj/effect/alien/flesh/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space))
continue
if(!linked_node || get_dist(linked_node, src) > linked_node.node_range)
return
// if (locate(/obj/movable, T)) // don't propogate into movables
// continue
for(var/obj/O in T)
if(O.density)
continue direction_loop
new /obj/effect/alien/flesh/weeds(T, linked_node)
/obj/effect/alien/flesh/weeds/ex_act(severity)
switch(severity)
if(1.0)
del(src)
if(2.0)
if (prob(50))
del(src)
if(3.0)
if (prob(5))
del(src)
return
/obj/effect/alien/flesh/weeds/attackby(var/obj/item/weapon/W, var/mob/user)
if(W.attack_verb.len)
visible_message("\red <B>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
else
visible_message("\red <B>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = W.force / 4.0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
damage = 15
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
health -= damage
healthcheck()
/obj/effect/alien/flesh/weeds/proc/healthcheck()
if(health <= 0)
del(src)
/obj/effect/alien/flesh/weeds/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
health -= 5
healthcheck()
/*/obj/effect/alien/weeds/burn(fi_amount)
if (fi_amount > 18000)
spawn( 0 )
del(src)
return
return 0
return 1
*/
#undef NODERANGE
//clothing, weapons, and other items that can be worn or used in some way
/obj/item/clothing/under/rank/navywarden
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the word \"Warden\" written on the shoulders."
name = "warden's jumpsuit"
icon_state = "wardendnavyclothes"
item_state = "wardendnavyclothes"
color = "wardendnavyclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS
/obj/item/clothing/under/rank/navysecurity
name = "security officer's jumpsuit"
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
icon_state = "officerdnavyclothes"
item_state = "officerdnavyclothes"
color = "officerdnavyclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS
/obj/item/clothing/under/rank/navyhead_of_security
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Head of Security\". It has additional armor to protect the wearer."
name = "head of security's jumpsuit"
icon_state = "hosdnavyclothes"
item_state = "hosdnavyclothes"
color = "hosdnavyclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS
/obj/item/clothing/suit/armor/hosnavycoat
name = "armored coat"
desc = "A coat enchanced with a special alloy for some protection and style."
icon_state = "hosdnavyjacket"
item_state = "armor"
armor = list(melee = 65, bullet = 30, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
/obj/item/clothing/head/beret/navysec
name = "security beret"
desc = "A beret with the security insignia emblazoned on it. For officers that are more inclined towards style than safety."
icon_state = "officerberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/head/beret/navywarden
name = "warden's beret"
desc = "A beret with a two-colored security insignia emblazoned on it. For wardens that are more inclined towards style than safety."
icon_state = "wardenberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/head/beret/navyhos
name = "security head's beret"
desc = "A stylish beret bearing a golden insignia that proudly displays the security coat of arms. A commander's must-have."
icon_state = "hosberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/suit/armor/navysecvest
name = "armored coat"
desc = "An armored coat that protects against some damage."
icon_state = "officerdnavyjacket"
item_state = "armor"
flags = FPRINT | TABLEPASS
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
/obj/item/clothing/suit/armor/navywardenvest
name = "Warden's jacket"
desc = "An armoured jacket with silver rank pips and livery."
icon_state = "wardendnavyjacket"
item_state = "armor"
flags = FPRINT | TABLEPASS
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
//hostile entities or npcs
/obj/item/projectile/slimeglob
icon = 'projectiles.dmi'
icon_state = "toxin"
damage = 20
damage_type = BRUTE
/obj/effect/critter/fleshmonster
name = "Fleshy Horror"
desc = "A grotesque, shambling fleshy horror... was this once a... a person?"
icon = 'icons/mob/mob.dmi'
icon_state = "horror"
health = 120
max_health = 120
aggressive = 1
defensive = 1
wanderer = 1
opensdoors = 1
atkcarbon = 1
atksilicon = 1
atkcritter = 1
atksame = 0
atkmech = 1
firevuln = 0.5
brutevuln = 1
seekrange = 25
armor = 15
melee_damage_lower = 12
melee_damage_upper = 17
angertext = "shambles"
attacktext = "slashes"
var/ranged = 0
var/rapid = 0
proc
Shoot(var/target, var/start, var/user, var/bullet = 0)
OpenFire(var/thing)//bluh ill rename this later or somethin
Die()
if (!src.alive) return
src.alive = 0
walk_to(src,0)
src.visible_message("<b>[src]</b> disintegrates into mush!")
playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
var/turf/Ts = get_turf(src)
new /obj/effect/decal/cleanable/blood(Ts)
del(src)
seek_target()
src.anchored = 0
var/T = null
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
if (src.target)
src.task = "chasing"
break
if((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue
if(istype(C, /mob/living/carbon/) && !src.atkcarbon) continue
if(istype(C, /mob/living/silicon/) && !src.atksilicon) continue
if(C.health < 0) continue
if(istype(C, /mob/living/carbon/) && src.atkcarbon)
if(C:mind)
if(C:mind:special_role == "H.I.V.E")
continue
src.attack = 1
if(istype(C, /mob/living/silicon/) && src.atksilicon)
if(C:mind)
if(C:mind:special_role == "H.I.V.E")
continue
src.attack = 1
if(src.attack)
T = C
break
if(!src.attack)
for(var/obj/effect/critter/C in view(src.seekrange,src))
if(istype(C, /obj/effect/critter) && !src.atkcritter) continue
if(C.health <= 0) continue
if(istype(C, /obj/effect/critter) && src.atkcritter)
if((istype(C, /obj/effect/critter/hivebot) && !src.atksame) || (C == src)) continue
T = C
break
for(var/obj/mecha/M in view(src.seekrange,src))
if(istype(M, /obj/mecha) && !src.atkmech) continue
if(M.health <= 0) continue
if(istype(M, /obj/mecha) && src.atkmech) src.attack = 1
if(src.attack)
T = M
break
if(src.attack)
src.target = T
src.oldtarget_name = T:name
if(src.ranged)
OpenFire(T)
return
src.task = "chasing"
return
OpenFire(var/thing)
src.target = thing
src.oldtarget_name = thing:name
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[src]</b> spits a glob at [src.target]!", 1)
var/tturf = get_turf(target)
if(rapid)
spawn(1)
Shoot(tturf, src.loc, src)
spawn(4)
Shoot(tturf, src.loc, src)
spawn(6)
Shoot(tturf, src.loc, src)
else
Shoot(tturf, src.loc, src)
src.attack = 0
sleep(12)
seek_target()
src.task = "thinking"
return
Shoot(var/target, var/start, var/user, var/bullet = 0)
if(target == start)
return
var/obj/item/projectile/slimeglob/A = new /obj/item/projectile/slimeglob(user:loc)
playsound(user, 'sound/weapons/bite.ogg', 100, 1)
if(!A) return
if (!istype(target, /turf))
del(A)
return
A.current = target
A.yo = target:y - start:y
A.xo = target:x - start:x
spawn( 0 )
A.process()
return
obj/effect/critter/fleshmonster/fleshslime
name = "Flesh Slime"
icon = 'biocraps.dmi'
icon_state = "livingflesh"
desc = "A creature that appears to be made out of living tissue strewn together haphazardly. Some kind of liquid bubbles from its maw."
ranged = 1

View File

@@ -149,13 +149,13 @@
if(objholder in removed_paths)
alert("That path is not allowed.")
objholder = "/obj/structure/closet"
else if (dd_hasprefix(objholder, "/mob") && !(usr.client.holder.rank in list("Game Master", "Game Admin", "Badmin")))
else if (dd_hasprefix(objholder, "/mob") && !check_rights(R_DEBUG,0))
objholder = "/obj/structure/closet"
if(3)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine")
master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
if(master.buildmode.varholder in locked && !(usr.client.holder.rank in list("Game Master", "Game Admin")))
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
return
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
if(!thetype) return
@@ -186,28 +186,28 @@
if(istype(object,/turf) && pa.Find("left") && !pa.Find("alt") && !pa.Find("ctrl") )
if(istype(object,/turf/space))
var/turf/T = object
T.ReplaceWithFloor()
T.ChangeTurf(/turf/simulated/floor)
return
else if(istype(object,/turf/simulated/floor))
var/turf/T = object
T.ReplaceWithWall()
T.ChangeTurf(/turf/simulated/wall)
return
else if(istype(object,/turf/simulated/wall))
var/turf/T = object
T.ReplaceWithRWall()
T.ChangeTurf(/turf/simulated/wall/r_wall)
return
else if(pa.Find("right"))
if(istype(object,/turf/simulated/wall))
var/turf/T = object
T.ReplaceWithFloor()
T.ChangeTurf(/turf/simulated/floor)
return
else if(istype(object,/turf/simulated/floor))
var/turf/T = object
T.ReplaceWithSpace()
T.ChangeTurf(/turf/space)
return
else if(istype(object,/turf/simulated/wall/r_wall))
var/turf/T = object
T.ReplaceWithWall()
T.ChangeTurf(/turf/simulated/wall)
return
else if(istype(object,/obj))
del(object)
@@ -235,7 +235,6 @@
if(pa.Find("left"))
var/obj/A = new holder.buildmode.objholder (get_turf(object))
A.dir = holder.builddir.dir
blink(A)
else if(pa.Find("right"))
if(isobj(object)) del(object)
@@ -244,14 +243,12 @@
if(object.vars.Find(holder.buildmode.varholder))
log_admin("[key_name(usr)] modified [object.name]'s [holder.buildmode.varholder] to [holder.buildmode.valueholder]")
object.vars[holder.buildmode.varholder] = holder.buildmode.valueholder
blink(object)
else
usr << "\red [initial(object.name)] does not have a var called '[holder.buildmode.varholder]'"
if(pa.Find("right"))
if(object.vars.Find(holder.buildmode.varholder))
log_admin("[key_name(usr)] modified [object.name]'s [holder.buildmode.varholder] to [holder.buildmode.valueholder]")
object.vars[holder.buildmode.varholder] = initial(object.vars[holder.buildmode.varholder])
blink(object)
else
usr << "\red [initial(object.name)] does not have a var called '[holder.buildmode.varholder]'"
@@ -262,8 +259,3 @@
if(holder.throw_atom)
holder.throw_atom.throw_at(object, 10, 1)
/proc/blink(atom/A)
A.icon += rgb(0,75,75)
spawn(5)
if(A)
A.icon = initial(A.icon)

View File

@@ -1,12 +1,3 @@
//check if mob is lying down on something we can operate him on.
/proc/can_operate(mob/living/carbon/M)
return (locate(/obj/machinery/optable, M.loc) && M.resting) || \
(locate(/obj/structure/stool/bed/roller, M.loc) && \
(M.buckled || M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat)) && prob(75) || \
(locate(/obj/structure/table/, M.loc) && \
(M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat) && prob(66))
/datum/surgery_status/
var/eyes = 0
var/face = 0
@@ -49,7 +40,7 @@
var/can_infect = 0
// Build this list by iterating over all typesof(/datum/surgery_step) and sorting the results by priority
var/global/list/surgery_steps = null
proc/build_surgery_steps_list()
surgery_steps = list()
@@ -88,6 +79,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/generic/cut_open
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 90
max_duration = 110
@@ -116,9 +108,12 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.display_name] in a wrong spot with \the [tool]!", \
"\red Your hand slips, slicing open [target]'s [affected.display_name] in a wrong spot with \the [tool]!")
affected.createwound(CUT, 10)
if (ishuman(user))
user:bloody_hands(target, 0)
/datum/surgery_step/generic/clamp_bleeders
required_tool = /obj/item/weapon/hemostat
allowed_tools = list(/obj/item/weapon/cable_coil, /obj/item/device/assembly/mousetrap)
min_duration = 40
max_duration = 60
@@ -145,9 +140,12 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
user.visible_message("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.display_name] with the \[tool]!", \
"\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!",)
affected.createwound(CUT, 10)
if (ishuman(user))
user:bloody_hands(target, 0)
/datum/surgery_step/generic/retract_skin
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/kitchen/utensil/fork)
min_duration = 30
max_duration = 40
@@ -181,6 +179,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
user.visible_message(msg, self_msg)
affected.open = 2
spread_germs_to_organ(affected, user)
if (prob(40)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
@@ -197,6 +196,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/generic/cauterize
required_tool = /obj/item/weapon/cautery
allowed_tools = list(/obj/item/weapon/weldingtool, /obj/item/clothing/mask/cigarette, /obj/item/weapon/lighter)
min_duration = 70
max_duration = 100
@@ -242,6 +242,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/appendectomy/cut_appendix
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 70
max_duration = 90
@@ -258,15 +259,19 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
user.visible_message("\blue [user] has separated [target]'s appendix with \the [tool]." , \
"\blue You have separated [target]'s appendix with \the [tool].")
target.op_stage.appendix = 1
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/groin = target.get_organ("groin")
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s abdomen with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s abdomen with \the [tool]!")
groin.createwound(CUT, 50)
groin.createwound(CUT, 50, 1)
if (ishuman(user))
user:bloody_body(target)
/datum/surgery_step/appendectomy/remove_appendix
required_tool = /obj/item/weapon/hemostat
allowed_tools = list(/obj/item/weapon/wirecutters)
min_duration = 60
max_duration = 80
@@ -292,6 +297,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
else
new /obj/item/weapon/reagent_containers/food/snacks/appendix(get_turf(target))
target.op_stage.appendix = 2
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
@@ -307,6 +313,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/fix_vein
required_tool = /obj/item/weapon/FixOVein
allowed_tools = list(/obj/item/weapon/cable_coil)
min_duration = 70
max_duration = 90
@@ -335,6 +342,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
for(var/datum/wound/W in affected.wounds) if(W.internal)
affected.wounds -= W
affected.update_damages()
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
@@ -349,6 +357,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/glue_bone
required_tool = /obj/item/weapon/bonegel
allowed_tools = list(/obj/item/weapon/screwdriver)
min_duration = 50
max_duration = 60
@@ -370,6 +379,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
"\blue You apply some [tool] to [target]'s bone in [affected.display_name] with \the [tool].")
affected.stage = 1
spread_germs_to_organ(affected, user)
if (ishuman(user) && prob(80)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
@@ -378,6 +388,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/set_bone
required_tool = /obj/item/weapon/bonesetter
allowed_tools = list(/obj/item/weapon/wrench)
min_duration = 60
max_duration = 70
@@ -413,6 +424,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/mend_skull
required_tool = /obj/item/weapon/bonesetter
allowed_tools = list(/obj/item/weapon/wrench)
min_duration = 60
max_duration = 70
@@ -442,6 +454,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/finish_bone
required_tool = /obj/item/weapon/bonegel
allowed_tools = list(/obj/item/weapon/screwdriver)
min_duration = 50
max_duration = 60
@@ -464,6 +477,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
affected.stage = 0
affected.perma_injury = 0
spread_germs_to_organ(affected, user)
if (ishuman(user) && prob(80)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
@@ -485,6 +499,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/eye/cut_open
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 90
max_duration = 110
@@ -509,6 +524,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/eye/lift_eyes
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/kitchen/utensil/fork)
min_duration = 30
max_duration = 40
@@ -533,6 +549,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/eye/mend_eyes
required_tool = /obj/item/weapon/hemostat
allowed_tools = list(/obj/item/weapon/cable_coil, /obj/item/device/assembly/mousetrap)
min_duration = 80
max_duration = 100
@@ -557,6 +574,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/eye/cauterize
required_tool = /obj/item/weapon/cautery
allowed_tools = list(/obj/item/weapon/weldingtool, /obj/item/clothing/mask/cigarette, /obj/item/weapon/lighter)
min_duration = 70
max_duration = 100
@@ -598,6 +616,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/generic/cut_face
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 90
max_duration = 110
@@ -623,6 +642,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/face/mend_vocal
required_tool = /obj/item/weapon/hemostat
allowed_tools = list(/obj/item/weapon/cable_coil, /obj/item/device/assembly/mousetrap)
min_duration = 70
max_duration = 90
@@ -643,9 +663,13 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
user.visible_message("\red [user]'s hand slips, clamping [target]'s trachea shut for a moment with \the [tool]!", \
"\red Your hand slips, clamping [user]'s trachea shut for a moment with \the [tool]!")
target.losebreath += 10
if (ishuman(user))
user:bloody_body(target)
user:bloody_hands(target, 0)
/datum/surgery_step/face/fix_face
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/kitchen/utensil/fork)
min_duration = 80
max_duration = 100
@@ -670,6 +694,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/face/cauterize
required_tool = /obj/item/weapon/cautery
allowed_tools = list(/obj/item/weapon/weldingtool, /obj/item/clothing/mask/cigarette, /obj/item/weapon/lighter)
min_duration = 70
max_duration = 100
@@ -731,6 +756,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/brain/cut_brain
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 80
max_duration = 100
@@ -750,7 +776,10 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, cutting a vein in [target]'s brain with \the [tool]!", \
"\red Your hand slips, cutting a vein in [target]'s brain with \the [tool]!")
target.apply_damage(50, BRUTE, "head")
target.apply_damage(50, BRUTE, "head", 1)
if (ishuman(user))
user:bloody_body(target)
user:bloody_hands(target, 0)
/datum/surgery_step/brain/saw_spine
required_tool = /obj/item/weapon/circular_saw
@@ -785,7 +814,10 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, cutting a vein in [target]'s brain with \the [tool]!", \
"\red Your hand slips, cutting a vein in [target]'s brain with \the [tool]!")
target.apply_damage(30, BRUTE, "head")
target.apply_damage(30, BRUTE, "head", 1)
if (ishuman(user))
user:bloody_body(target)
user:bloody_hands(target, 0)
//////////////////////////////////////////////////////////////////
@@ -798,6 +830,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/metroid/cut_flesh
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 30
max_duration = 50
@@ -820,6 +853,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/metroid/cut_innards
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 30
max_duration = 50
@@ -887,6 +921,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/limb/cut
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 80
max_duration = 100
@@ -913,6 +948,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/limb/mend
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/kitchen/utensil/fork)
min_duration = 80
max_duration = 100
@@ -943,6 +979,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/limb/prepare
required_tool = /obj/item/weapon/cautery
allowed_tools = list(/obj/item/weapon/weldingtool, /obj/item/clothing/mask/cigarette, /obj/item/weapon/lighter)
min_duration = 60
max_duration = 70
@@ -1045,6 +1082,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/ribcage/retract_ribcage
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/crowbar)
min_duration = 30
max_duration = 40
@@ -1069,6 +1107,9 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
var/datum/organ/external/affected = target.get_organ(target_zone)
affected.fracture()
if (ishuman(user))
user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\red [user]'s hand slips, breaking [target]'s ribcage!"
var/self_msg = "\red Your hand slips, breaking [target]'s ribcage!"
@@ -1078,6 +1119,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
/datum/surgery_step/ribcage/close_ribcage
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/crowbar)
min_duration = 20
max_duration = 40
@@ -1151,8 +1193,11 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
for(var/datum/disease/alien_embryo in target.viruses)
alien_embryo.cure()
if (ishuman(user)) user:bloody_hands(target, 0)
/datum/surgery_step/ribcage/fix_lungs
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 70
max_duration = 90
@@ -1170,10 +1215,14 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
user.visible_message("\blue [user] mends the rupture in [target]'s lungs with \the [tool].", \
"\blue You mend the rupture in [target]'s lungs with \the [tool]." )
affected.ruptured_lungs = 0
if (ishuman(user) && prob(80)) user:bloody_hands(target, 0)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ("chest")
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s chest with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s chest with \the [tool]!")
affected.createwound(CUT, 20)
if (ishuman(user))
user:bloody_hands(target, 0)
user:bloody_body(target)

View File

@@ -235,7 +235,6 @@ proc/airborne_can_reach(turf/source, turf/target)
if(prob(1))
majormutate()
if(mob.reagents.has_reagent("spaceacillin"))
mob.reagents.remove_reagent("spaceacillin",0.3)
return
if(mob.reagents.has_reagent("virusfood"))
mob.reagents.remove_reagent("virusfood",0.1)

View File

@@ -133,15 +133,16 @@ proc/Airflow(zone/A, zone/B)
else
connected_turfs |= C.B
//Get lists of things that can be thrown across the room for each zone.
var/list/pplz = B.movables()
var/list/otherpplz = A.movables()
//Get lists of things that can be thrown across the room for each zone (assumes air is moving from zone B to zone A)
var/list/air_sucked = B.movables()
var/list/air_repelled = A.movables()
if(n < 0)
var/list/temporary_pplz = pplz
pplz = otherpplz
otherpplz = temporary_pplz
//air is moving from zone A to zone B
var/list/temporary_pplz = air_sucked
air_sucked = air_repelled
air_repelled = temporary_pplz
for(var/atom/movable/M in pplz)
for(var/atom/movable/M in air_sucked)
if(M.last_airflow > world.time - vsc.airflow_delay) continue
@@ -166,7 +167,7 @@ proc/Airflow(zone/A, zone/B)
spawn M.GotoAirflowDest(abs(n)/5)
//Do it again for the stuff in the other zone, making it fly away.
for(var/atom/movable/M in otherpplz)
for(var/atom/movable/M in air_repelled)
if(M.last_airflow > world.time - vsc.airflow_delay) continue
@@ -240,12 +241,15 @@ atom/movable
if(airflow_dest == loc)
step_away(src,loc)
if(ismob(src))
if(src:nodamage) return
if(src:nodamage)
return
if(istype(src, /mob/living/carbon/human))
if(istype(src, /mob/living/carbon/human))
if(src:buckled) return
if(src:buckled)
return
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return
if(src:shoes.type == /obj/item/clothing/shoes/magboots)
if(src:shoes.flags & NOSLIP)
return
src << "\red You are sucked away by airflow!"
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
@@ -266,9 +270,15 @@ atom/movable
airflow_speed -= vsc.airflow_speed_decay
if(airflow_speed > 7)
if(airflow_time++ >= airflow_speed - 7)
if(od)
density = 0
sleep(1 * tick_multiplier)
else
if(od)
density = 0
sleep(max(1,10-(airflow_speed+3)) * tick_multiplier)
if(od)
density = 1
if ((!( src.airflow_dest ) || src.loc == src.airflow_dest))
src.airflow_dest = locate(min(max(src.x + xo, 1), world.maxx), min(max(src.y + yo, 1), world.maxy), src.z)
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
@@ -276,7 +286,8 @@ atom/movable
if(!istype(loc, /turf))
return
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
if(ismob(src) && src:client)
src:client:move_delay = world.time + vsc.airflow_mob_slowdown
airflow_dest = null
airflow_speed = 0
airflow_time = 0
@@ -295,12 +306,15 @@ atom/movable
if(airflow_dest == loc)
step_away(src,loc)
if(ismob(src))
if(src:nodamage) return
if(src:nodamage)
return
if(istype(src, /mob/living/carbon/human))
if(istype(src, /mob/living/carbon/human))
if(src:buckled) return
if(src:buckled)
return
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return
if(src:shoes.type == /obj/item/clothing/shoes/magboots)
if(src:shoes.flags & NOSLIP)
return
src << "\red You are pushed away by airflow!"
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
@@ -331,7 +345,8 @@ atom/movable
if(!istype(loc, /turf))
return
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
if(ismob(src) && src:client)
src:client:move_delay = world.time + vsc.airflow_mob_slowdown
airflow_dest = null
airflow_speed = 0
airflow_time = 0

View File

@@ -280,8 +280,8 @@ pl_control
else if(istext(vars["[V]_RANDOM"]))
var/txt = vars["[V]_RANDOM"]
if(findtextEx(txt,"PROB"))
txt = dd_text2list(txt,"/")
txt[1] = dd_replacetext(txt[1],"PROB","")
txt = text2list(txt,"/")
txt[1] = replacetext(txt[1],"PROB","")
var/p = text2num(txt[1])
var/r = txt[2]
if(prob(p))
@@ -289,8 +289,8 @@ pl_control
else
newvalue = vars[V]
else if(findtextEx(txt,"PICK"))
txt = dd_replacetext(txt,"PICK","")
txt = dd_text2list(txt,",")
txt = replacetext(txt,"PICK","")
txt = text2list(txt,",")
newvalue = pick(txt)
else
newvalue = roll(txt)

View File

@@ -16,6 +16,9 @@ zone
last_update = 0
progress = "nothing"
// To make sure you're not spammed to death by airflow sound effects
tmp/playsound_cooldown = 0
//CREATION AND DELETION
New(turf/start)
. = ..()
@@ -33,7 +36,7 @@ zone
if(!istype(T,/turf/simulated))
AddTurf(T)
//Generate the gas_mixture for use in this zone by using the average of the gases
//Generate the gas_mixture for use in txhis zone by using the average of the gases
//defined at startup.
air = new
var/members = contents.len
@@ -161,6 +164,16 @@ zone/proc/process()
RemoveTurf(T)
if(unsimulated_tiles)
var/moved_air = ShareSpace(air,unsimulated_tiles)
// Only play a sound effect every once in a while
if(playsound_cooldown <= world.time)
// Play a nice sound effect at one of the bordering turfs
playsound_cooldown = world.time + rand(30, 70)
var/turf/random_border = pick(contents)
play_wind_sound(random_border, abs(moved_air))
if(moved_air > vsc.airflow_lightest_pressure)
AirflowSpace(src)
@@ -239,7 +252,17 @@ zone/proc/process()
for(var/zone/Z in connected_zones)
if(air && Z.air)
//Ensure we're not doing pointless calculations on equilibrium zones.
if(abs(air.total_moles() - Z.air.total_moles()) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
var/moles_delta = abs(air.total_moles() - Z.air.total_moles())
if(moles_delta > 0.1)
// Only play a sound effect every once in a while
if(playsound_cooldown <= world.time)
// Play a nice sound effect at one of the bordering turfs
playsound_cooldown = world.time + rand(30, 70)
var/turf/random_border = pick(contents)
play_wind_sound(random_border, abs(moles_delta))
if(moles_delta > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
if(abs(Z.air.return_pressure() - air.return_pressure()) > vsc.airflow_lightest_pressure)
Airflow(src,Z)
ShareRatio( air , Z.air , connected_zones[Z] )
@@ -255,7 +278,7 @@ var/list/sharing_lookup_table = list(0.06, 0.11, 0.15, 0.18, 0.20, 0.21)
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
//Shares a specific ratio of gas between mixtures using simple weighted averages.
var
ratio = 0.21
ratio = 0.50
size = max(1,A.group_multiplier)
share_size = max(1,B.group_multiplier)
@@ -281,9 +304,6 @@ proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
temp_avg = (A.temperature * full_heat_capacity + B.temperature * s_full_heat_capacity) / (full_heat_capacity + s_full_heat_capacity)
if(sharing_lookup_table.len >= connecting_tiles) //6 or more interconnecting tiles will max at 42% of air moved per tick.
ratio = sharing_lookup_table[connecting_tiles]
A.oxygen = max(0, (A.oxygen - oxy_avg) * (1-ratio) + oxy_avg )
A.nitrogen = max(0, (A.nitrogen - nit_avg) * (1-ratio) + nit_avg )
A.carbon_dioxide = max(0, (A.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg )
@@ -338,37 +358,34 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles)
unsim_temperature += T.temperature/unsimulated_tiles.len
var
ratio = 0.21
// Depressurize very, very fast(it's fine since many rooms are internally multiple zones)
ratio = 0.50
old_pressure = A.return_pressure()
size = max(1,A.group_multiplier)
share_size = max(1,unsimulated_tiles.len)
full_oxy = A.oxygen * size
full_nitro = A.nitrogen * size
full_co2 = A.carbon_dioxide * size
full_plasma = A.toxins * size
//full_oxy = A.oxygen * size
//full_nitro = A.nitrogen * size
//full_co2 = A.carbon_dioxide * size
//full_plasma = A.toxins * size
full_heat_capacity = A.heat_capacity() * size
//full_heat_capacity = A.heat_capacity() * size
oxy_avg = (full_oxy + unsim_oxygen) / (size + share_size)
nit_avg = (full_nitro + unsim_nitrogen) / (size + share_size)
co2_avg = (full_co2 + unsim_co2) / (size + share_size)
plasma_avg = (full_plasma + unsim_plasma) / (size + share_size)
oxy_avg = unsim_oxygen//(full_oxy + unsim_oxygen) / (size + share_size)
nit_avg = unsim_nitrogen//(full_nitro + unsim_nitrogen) / (size + share_size)
co2_avg = unsim_co2//(full_co2 + unsim_co2) / (size + share_size)
plasma_avg = unsim_plasma//(full_plasma + unsim_plasma) / (size + share_size)
temp_avg = (A.temperature * full_heat_capacity + unsim_temperature * unsim_heat_capacity) / (full_heat_capacity + unsim_heat_capacity)
if(sharing_lookup_table.len >= unsimulated_tiles.len) //6 or more interconnecting tiles will max at 42% of air moved per tick.
ratio = sharing_lookup_table[unsimulated_tiles.len]
ratio *= 2
A.oxygen = max(0, (A.oxygen - oxy_avg) * (1-ratio) + oxy_avg )
A.nitrogen = max(0, (A.nitrogen - nit_avg) * (1-ratio) + nit_avg )
A.carbon_dioxide = max(0, (A.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg )
A.toxins = max(0, (A.toxins - plasma_avg) * (1-ratio) + plasma_avg )
A.temperature = max(TCMB, (A.temperature - temp_avg) * (1-ratio) + temp_avg )
// EXPERIMENTAL: Disable space being cold
//A.temperature = max(TCMB, (A.temperature - temp_avg) * (1-ratio) + temp_avg )
for(var/datum/gas/G in A.trace_gases)
var/G_avg = (G.moles*size + 0) / (size+share_size)
@@ -458,6 +475,21 @@ zone/proc/Rebuild()
if(istype(T) && T.zone && S.CanPass(null, T, 0, 0))
T.zone.AddTurf(S)
proc/play_wind_sound(var/turf/random_border, var/n)
if(random_border)
var/windsound = 'sound/effects/wind/wind_2_1.ogg'
switch(n)
if(0 to 30)
windsound = pick('sound/effects/wind/wind_2_1.ogg', 'sound/effects/wind/wind_2_2.ogg')
if(31 to 40)
windsound = pick('sound/effects/wind/wind_3_1.ogg')
if(41 to 60)
windsound = pick('sound/effects/wind/wind_4_1.ogg', 'sound/effects/wind/wind_4_2.ogg')
if(61 to 1000000)
windsound = pick('sound/effects/wind/wind_5_1.ogg')
playsound(random_border, windsound, 50, 1, 1)
//UNUSED
/*
zone/proc/connected_zones()

18
code/__HELPERS/files.dm Normal file
View File

@@ -0,0 +1,18 @@
//checks if a file exists and contains text
//returns text as a string if these conditions are met
/proc/return_file_text(filename)
if(fexists(filename) == 0)
error("File not found ([filename])")
return
var/text = file2text(filename)
if(!text)
error("File empty ([filename])")
return
return text
//Sends resource files to client cache
/mob/proc/getFiles()
for(var/file in args)
src << browse_rsc(file)

View File

@@ -280,7 +280,6 @@ proc/isInSight(var/atom/A, var/atom/B)
if(M.ckey == lowertext(key))
return M
return null
proc/check_can_reach(atom/user, atom/target)
if(!in_range(user,target))
return 0
@@ -320,3 +319,33 @@ var/list/DummyCache = list()
D.loc = null
DummyCache.Add(D)
return 1
// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer.
/proc/get_active_candidates(var/buffer = 1)
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(((G.client.inactivity/10)/60) <= buffer + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
i++
return candidates
// Same as above but for alien candidates.
/proc/get_alien_candidates()
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
i++
return candidates

View File

@@ -0,0 +1,42 @@
var/list/clients = list() //list of all clients
var/list/admins = list() //list of all clients whom are admins
var/list/directory = list() //list of all ckeys with associated client
//Since it didn't really belong in any other category, I'm putting this here
//This is for procs to replace all the goddamn 'in world's that are chilling around the code
var/global/list/player_list = list() //List of all mobs **with clients attached**. Excludes /mob/new_player
var/global/list/mob_list = list() //List of all mobs, including clientless
var/global/list/living_mob_list = list() //List of all alive mobs, including clientless. Excludes /mob/new_player
var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless. Excludes /mob/new_player
var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time
var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name
var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessory/facial_hair indexed by name
var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions
var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
var/global/list/landmarks_list = list() //list of all landmarks created
var/global/list/surgery_steps = list() //list of all surgery steps |BS12
//////////////////////////
/////Initial Building/////
//////////////////////////
/proc/make_datum_references_lists()
var/list/paths
//Hair - Initialise all /datum/sprite_accessory/hair into an list indexed by hair-style name
paths = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair
for(var/path in paths)
var/datum/sprite_accessory/hair/H = new path()
hair_styles_list[H.name] = H
//Facial Hair - Initialise all /datum/sprite_accessory/facial_hair into an list indexed by facialhair-style name
paths = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair
for(var/path in paths)
var/datum/sprite_accessory/facial_hair/H = new path()
facial_hair_styles_list[H.name] = H
//Surgery Steps - Initialize all /datum/surgery_step into a list
paths = typesof(/datum/surgery_step)-/datum/surgery_step
for(var/T in paths)
var/datum/surgery_step/S = new T
surgery_steps += S

View File

@@ -1,7 +1,216 @@
/*
IconProcs
IconProcs README
A BYOND library for manipulating icons and colors
by Lummox JR
Check the icon_procs_readme.dm for how they work.
version 1.0
The IconProcs library was made to make a lot of common icon operations much easier. BYOND's icon manipulation
routines are very capable but some of the advanced capabilities like using alpha transparency can be unintuitive to beginners.
CHANGING ICONS
Several new procs have been added to the /icon datum to simplify working with icons. To use them,
remember you first need to setup an /icon var like so:
var/icon/my_icon = new('iconfile.dmi')
icon/ChangeOpacity(amount = 1)
A very common operation in DM is to try to make an icon more or less transparent. Making an icon more
transparent is usually much easier than making it less so, however. This proc basically is a frontend
for MapColors() which can change opacity any way you like, in much the same way that SetIntensity()
can make an icon lighter or darker. If amount is 0.5, the opacity of the icon will be cut in half.
If amount is 2, opacity is doubled and anything more than half-opaque will become fully opaque.
icon/GrayScale()
Converts the icon to grayscale instead of a fully colored icon. Alpha values are left intact.
icon/ColorTone(tone)
Similar to GrayScale(), this proc converts the icon to a range of black -> tone -> white, where tone is an
RGB color (its alpha is ignored). This can be used to create a sepia tone or similar effect.
See also the global ColorTone() proc.
icon/MinColors(icon)
The icon is blended with a second icon where the minimum of each RGB pixel is the result.
Transparency may increase, as if the icons were blended with ICON_ADD. You may supply a color in place of an icon.
icon/MaxColors(icon)
The icon is blended with a second icon where the maximum of each RGB pixel is the result.
Opacity may increase, as if the icons were blended with ICON_OR. You may supply a color in place of an icon.
icon/Opaque(background = "#000000")
All alpha values are set to 255 throughout the icon. Transparent pixels become black, or whatever background color you specify.
icon/BecomeAlphaMask()
You can convert a simple grayscale icon into an alpha mask to use with other icons very easily with this proc.
The black parts become transparent, the white parts stay white, and anything in between becomes a translucent shade of white.
icon/AddAlphaMask(mask)
The alpha values of the mask icon will be blended with the current icon. Anywhere the mask is opaque,
the current icon is untouched. Anywhere the mask is transparent, the current icon becomes transparent.
Where the mask is translucent, the current icon becomes more transparent.
icon/UseAlphaMask(mask, mode)
Sometimes you may want to take the alpha values from one icon and use them on a different icon.
This proc will do that. Just supply the icon whose alpha mask you want to use, and src will change
so it has the same colors as before but uses the mask for opacity.
COLOR MANAGEMENT AND HSV
RGB isn't the only way to represent color. Sometimes it's more useful to work with a model called HSV, which stands for hue, saturation, and value.
* The hue of a color describes where it is along the color wheel. It goes from red to yellow to green to
cyan to blue to magenta and back to red.
* The saturation of a color is how much color is in it. A color with low saturation will be more gray,
and with no saturation at all it is a shade of gray.
* The value of a color determines how bright it is. A high-value color is vivid, moderate value is dark,
and no value at all is black.
Just as BYOND uses "#rrggbb" to represent RGB values, a similar format is used for HSV: "#hhhssvv". The hue is three
hex digits because it ranges from 0 to 0x5FF.
* 0 to 0xFF - red to yellow
* 0x100 to 0x1FF - yellow to green
* 0x200 to 0x2FF - green to cyan
* 0x300 to 0x3FF - cyan to blue
* 0x400 to 0x4FF - blue to magenta
* 0x500 to 0x5FF - magenta to red
Knowing this, you can figure out that red is "#000ffff" in HSV format, which is hue 0 (red), saturation 255 (as colorful as possible),
value 255 (as bright as possible). Green is "#200ffff" and blue is "#400ffff".
More than one HSV color can match the same RGB color.
Here are some procs you can use for color management:
ReadRGB(rgb)
Takes an RGB string like "#ffaa55" and converts it to a list such as list(255,170,85). If an RGBA format is used
that includes alpha, the list will have a fourth item for the alpha value.
hsv(hue, sat, val, apha)
Counterpart to rgb(), this takes the values you input and converts them to a string in "#hhhssvv" or "#hhhssvvaa"
format. Alpha is not included in the result if null.
ReadHSV(rgb)
Takes an HSV string like "#100FF80" and converts it to a list such as list(256,255,128). If an HSVA format is used that
includes alpha, the list will have a fourth item for the alpha value.
RGBtoHSV(rgb)
Takes an RGB or RGBA string like "#ffaa55" and converts it into an HSV or HSVA color such as "#080aaff".
HSVtoRGB(hsv)
Takes an HSV or HSVA string like "#080aaff" and converts it into an RGB or RGBA color such as "#ff55aa".
BlendRGB(rgb1, rgb2, amount)
Blends between two RGB or RGBA colors using regular RGB blending. If amount is 0, the first color is the result;
if 1, the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
The returned value is an RGB or RGBA color.
BlendHSV(hsv1, hsv2, amount)
Blends between two HSV or HSVA colors using HSV blending, which tends to produce nicer results than regular RGB
blending because the brightness of the color is left intact. If amount is 0, the first color is the result; if 1,
the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
The returned value is an HSV or HSVA color.
BlendRGBasHSV(rgb1, rgb2, amount)
Like BlendHSV(), but the colors used and the return value are RGB or RGBA colors. The blending is done in HSV form.
HueToAngle(hue)
Converts a hue to an angle range of 0 to 360. Angle 0 is red, 120 is green, and 240 is blue.
AngleToHue(hue)
Converts an angle to a hue in the valid range.
RotateHue(hsv, angle)
Takes an HSV or HSVA value and rotates the hue forward through red, green, and blue by an angle from 0 to 360.
(Rotating red by 60° produces yellow.) The result is another HSV or HSVA color with the same saturation and value
as the original, but a different hue.
GrayScale(rgb)
Takes an RGB or RGBA color and converts it to grayscale. Returns an RGB or RGBA string.
ColorTone(rgb, tone)
Similar to GrayScale(), this proc converts an RGB or RGBA color to a range of black -> tone -> white instead of
using strict shades of gray. The tone value is an RGB color; any alpha value is ignored.
*/
/*
Get Flat Icon DEMO by DarkCampainger
This is a test for the get flat icon proc, modified approprietly for icons and their states.
Probably not a good idea to run this unless you want to see how the proc works in detail.
mob
icon = 'old_or_unused.dmi'
icon_state = "green"
Login()
// Testing image underlays
underlays += image(icon='old_or_unused.dmi',icon_state="red")
underlays += image(icon='old_or_unused.dmi',icon_state="red", pixel_x = 32)
underlays += image(icon='old_or_unused.dmi',icon_state="red", pixel_x = -32)
// Testing image overlays
overlays += image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = -32)
overlays += image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = 32)
overlays += image(icon='old_or_unused.dmi',icon_state="green", pixel_x = -32, pixel_y = -32)
// Testing icon file overlays (defaults to mob's state)
overlays += '_flat_demoIcons2.dmi'
// Testing icon_state overlays (defaults to mob's icon)
overlays += "white"
// Testing dynamic icon overlays
var/icon/I = icon('old_or_unused.dmi', icon_state="aqua")
I.Shift(NORTH,16,1)
overlays+=I
// Testing dynamic image overlays
I=image(icon=I,pixel_x = -32, pixel_y = 32)
overlays+=I
// Testing object types (and layers)
overlays+=/obj/effect/overlayTest
loc = locate (10,10,1)
verb
Browse_Icon()
set name = "1. Browse Icon"
// Give it a name for the cache
var/iconName = "[ckey(src.name)]_flattened.dmi"
// Send the icon to src's local cache
src<<browse_rsc(getFlatIcon(src), iconName)
// Display the icon in their browser
src<<browse("<body bgcolor='#000000'><p><img src='[iconName]'></p></body>")
Output_Icon()
set name = "2. Output Icon"
src<<"Icon is: \icon[getFlatIcon(src)]"
Label_Icon()
set name = "3. Label Icon"
// Give it a name for the cache
var/iconName = "[ckey(src.name)]_flattened.dmi"
// Copy the file to the rsc manually
var/icon/I = fcopy_rsc(getFlatIcon(src))
// Send the icon to src's local cache
src<<browse_rsc(I, iconName)
// Update the label to show it
winset(src,"imageLabel","image='\ref[I]'");
Add_Overlay()
set name = "4. Add Overlay"
overlays += image(icon='old_or_unused.dmi',icon_state="yellow",pixel_x = rand(-64,32), pixel_y = rand(-64,32))
Stress_Test()
set name = "5. Stress Test"
for(var/i = 0 to 1000)
// The third parameter forces it to generate a new one, even if it's already cached
getFlatIcon(src,0,2)
if(prob(5))
Add_Overlay()
Browse_Icon()
Cache_Test()
set name = "6. Cache Test"
for(var/i = 0 to 1000)
getFlatIcon(src)
Browse_Icon()
obj/effect/overlayTest
icon = 'old_or_unused.dmi'
icon_state = "blue"
pixel_x = -24
pixel_y = 24
layer = TURF_LAYER // Should appear below the rest of the overlays
world
view = "7x7"
maxx = 20
maxy = 20
maxz = 1
*/
#define TO_HEX_DIGIT(n) ascii2text((n&15) + ((n&15)<10 ? 48 : 87))

View File

@@ -1,3 +1,15 @@
//print an error message to world.log
/proc/error(msg)
world.log << "## ERROR: [msg]"
//print a warning message to world.log
/proc/warning(msg)
world.log << "## WARNING: [msg]"
//print a testing-mode debug message to world.log
/proc/testing(msg)
world.log << "## TESTING: [msg]"
/proc/log_admin(text)
admin_log.Add(text)
if (config.log_admin)

View File

@@ -1,3 +1,117 @@
var/church_name = null
/proc/church_name()
if (church_name)
return church_name
var/name = ""
name += pick("Holy", "United", "First", "Second", "Last")
if (prob(20))
name += " Space"
name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses")
name += " of [religion_name()]"
return name
var/command_name = null
/proc/command_name()
if (command_name)
return command_name
var/name = "Central Command"
command_name = name
return name
/proc/change_command_name(var/name)
command_name = name
return name
var/religion_name = null
/proc/religion_name()
if (religion_name)
return religion_name
var/name = ""
name += pick("bee", "science", "edu", "captain", "assistant", "monkey", "alien", "space", "unit", "sprocket", "gadget", "bomb", "revolution", "beyond", "station", "goon", "robot", "ivor", "hobnob")
name += pick("ism", "ia", "ology", "istism", "ites", "ick", "ian", "ity")
return capitalize(name)
/proc/station_name()
if (station_name)
return station_name
var/random = rand(1,5)
var/name = ""
//Rare: Pre-Prefix
if (prob(10))
name = pick("Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", "Automated", "Experimental", "Augmented")
station_name = name + " "
// Prefix
switch(Holiday)
//get normal name
if(null,"",0)
name = pick("", "Stanford", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist","Corrogated","Skeleton","Race", "Fatguy", "Gentleman", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Spess", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot", "Hats", "Pizza")
if(name)
station_name += name + " "
//For special days like christmas, easter, new-years etc ~Carn
if("Friday the 13th")
name = pick("Mike","Friday","Evil","Myers","Murder","Deathly","Stabby")
station_name += name + " "
random = 13
else
//get the first word of the Holiday and use that
var/i = findtext(Holiday," ",1,0)
name = copytext(Holiday,1,i)
station_name += name + " "
// Suffix
name = pick("Station", "Fortress", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard","Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", "Complex", "Base", "Facility", "Depot", "Outpost", "Installation", "Drydock", "Observatory", "Array", "Relay", "Monitor", "Platform", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker", "Roost", "Fat Camp")
station_name += name + " "
// ID Number
switch(random)
if(1)
station_name += "[rand(1, 99)]"
if(2)
station_name += pick("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega")
if(3)
station_name += pick("II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX")
if(4)
station_name += pick("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu")
if(5)
station_name += pick("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
if(13)
station_name += pick("13","XIII","Thirteen")
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = station_name
return station_name
/proc/world_name(var/name)
station_name = name
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = name
return name
var/syndicate_name = null
/proc/syndicate_name()
if (syndicate_name)

View File

@@ -15,8 +15,8 @@
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
/proc/sanitizeSQL(var/t as text)
var/sanitized_text = dd_replacetext(t, "'", "\\'")
sanitized_text = dd_replacetext(sanitized_text, "\"", "\\\"")
var/sanitized_text = replacetext(t, "'", "\\'")
sanitized_text = replacetext(sanitized_text, "\"", "\\\"")
return sanitized_text
/*
@@ -177,18 +177,33 @@
/*
* Text modification
*/
/proc/replacetext(text, find, replacement)
var/find_len = length(find)
if(find_len < 1) return text
. = ""
var/last_found = 1
while(1)
var/found = findtext(text, find, last_found, 0)
. += copytext(text, last_found, found)
if(found)
. += replacement
last_found = found + find_len
continue
return .
//Search and replace a sub-string within a string
/proc/dd_replacetext(text, search_string, replacement_string)
if(!text || !istext(text) || !search_string || !istext(search_string) || !istext(replacement_string))
return null
var/textList = dd_text2list(text, search_string)
return dd_list2text(textList, replacement_string)
//Search and replace a case sensitive sub-string within a string
/proc/dd_replacetext_case(text, search_string, replacement_string)
var/textList = dd_text2list(text, search_string)
return dd_list2text(textList, replacement_string)
/proc/replacetextEx(text, find, replacement)
var/find_len = length(find)
if(find_len < 1) return text
. = ""
var/last_found = 1
while(1)
var/found = findtextEx(text, find, last_found, 0)
. += copytext(text, last_found, found)
if(found)
. += replacement
last_found = found + find_len
continue
return .
//Adds 'u' number of zeros ahead of the text 't'
/proc/add_zero(t, u)

View File

@@ -1,3 +1,11 @@
//Returns the world time in english
proc/worldtime2text()
return "[round(world.time / 36000)+12]:[(world.time / 600 % 60) < 10 ? add_zero(world.time / 600 % 60, 1) : world.time / 600 % 60]"
proc/time_stamp()
return time2text(world.timeofday, "hh:mm:ss")
/* Preserving this so future generations can see how fucking retarded some people are
proc/time_stamp()
var/hh = text2num(time2text(world.timeofday, "hh")) // Set the hour
var/mm = text2num(time2text(world.timeofday, "mm")) // Set the minute
@@ -9,7 +17,7 @@ proc/time_stamp()
if(mm < 10) pm = "0"
if(ss < 10) ps = "0"
return"[ph][hh]:[pm][mm]:[ps][ss]"
*/
/* Returns 1 if it is the selected month and day */
proc/isDay(var/month, var/day)

256
code/__HELPERS/type2type.dm Normal file
View File

@@ -0,0 +1,256 @@
/*
* Holds procs designed to change one type of value, into another.
* Contains:
* hex2num & num2hex
* text2list & list2text
* file2list
* angle2dir
* angle2text
* worldtime2text
*/
//Returns an integer given a hex input
/proc/hex2num(hex)
if (!( istext(hex) ))
return
var/num = 0
var/power = 0
var/i = null
i = length(hex)
while(i > 0)
var/char = copytext(hex, i, i + 1)
switch(char)
if("0")
//Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist
if("9", "8", "7", "6", "5", "4", "3", "2", "1")
num += text2num(char) * 16 ** power
if("a", "A")
num += 16 ** power * 10
if("b", "B")
num += 16 ** power * 11
if("c", "C")
num += 16 ** power * 12
if("d", "D")
num += 16 ** power * 13
if("e", "E")
num += 16 ** power * 14
if("f", "F")
num += 16 ** power * 15
else
return
power++
i--
return num
//Returns the hex value of a number given a value assumed to be a base-ten value
/proc/num2hex(num, placeholder)
if (placeholder == null)
placeholder = 2
if (!( isnum(num) ))
return
if (!( num ))
return "0"
var/hex = ""
var/i = 0
while(16 ** i < num)
i++
var/power = null
power = i - 1
while(power >= 0)
var/val = round(num / 16 ** power)
num -= val * 16 ** power
switch(val)
if(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0)
hex += text("[]", val)
if(10.0)
hex += "A"
if(11.0)
hex += "B"
if(12.0)
hex += "C"
if(13.0)
hex += "D"
if(14.0)
hex += "E"
if(15.0)
hex += "F"
else
power--
while(length(hex) < placeholder)
hex = text("0[]", hex)
return hex
//Attaches each element of a list to a single string seperated by 'seperator'.
/proc/dd_list2text(var/list/the_list, separator)
var/total = the_list.len
if(!total)
return
var/count = 2
var/newText = "[the_list[1]]"
while(count <= total)
if(separator)
newText += separator
newText += "[the_list[count]]"
count++
return newText
//slower then dd_list2text, but correctly processes associative lists.
proc/tg_list2text(list/list, glue=",")
if(!istype(list) || !list.len)
return
var/output
for(var/i=1 to list.len)
output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]")
return output
//Converts a text string into a list by splitting the string at each seperator found in text (discarding the seperator)
//Returns an empty list if the text cannot be split, or the split text in a list.
//Not giving a "" seperator will cause the text to be broken into a list of single letters.
/proc/text2list(text, seperator="\n")
. = list()
var/text_len = length(text) //length of the input text
var/seperator_len = length(seperator) //length of the seperator text
if(text_len >= seperator_len)
var/i
var/last_i = 1
for(i=1,i<=(text_len+1-seperator_len),i++)
if( cmptext(copytext(text,i,i+seperator_len), seperator) )
if(i != last_i)
. += copytext(text,last_i,i)
last_i = i + seperator_len
if(last_i <= text_len)
. += copytext(text, last_i, 0)
else
. += text
return .
//Converts a text string into a list by splitting the string at each seperator found in text (discarding the seperator)
//Returns an empty list if the text cannot be split, or the split text in a list.
//Not giving a "" seperator will cause the text to be broken into a list of single letters.
//Case Sensitive!
/proc/text2listEx(text, seperator="\n")
. = list()
var/text_len = length(text) //length of the input text
var/seperator_len = length(seperator) //length of the seperator text
if(text_len >= seperator_len)
var/i
var/last_i = 1
for(i=1,i<=(text_len+1-seperator_len),i++)
if( cmptextEx(copytext(text,i,i+seperator_len), seperator) )
if(i != last_i)
. += copytext(text,last_i,i)
last_i = i + seperator_len
if(last_i <= text_len)
. += copytext(text, last_i, 0)
else
. += text
return .
//Splits the text of a file at seperator and returns them in a list.
/proc/file2list(filename, seperator="\n")
return text2list(return_file_text(filename),seperator)
//Turns a direction into text
/proc/dir2text(direction)
switch(direction)
if(1.0)
return "north"
if(2.0)
return "south"
if(4.0)
return "east"
if(8.0)
return "west"
if(5.0)
return "northeast"
if(6.0)
return "southeast"
if(9.0)
return "northwest"
if(10.0)
return "southwest"
else
return
//Turns text into proper directions
/proc/text2dir(direction)
switch(uppertext(direction))
if("NORTH")
return 1
if("SOUTH")
return 2
if("EAST")
return 4
if("WEST")
return 8
if("NORTHEAST")
return 5
if("NORTHWEST")
return 9
if("SOUTHEAST")
return 6
if("SOUTHWEST")
return 10
else
return
//Converts an angle (degrees) into an ss13 direction
/proc/angle2dir(var/degree)
degree = ((degree+22.5)%365)
if(degree < 45) return NORTH
if(degree < 90) return NORTHEAST
if(degree < 135) return EAST
if(degree < 180) return SOUTHEAST
if(degree < 225) return SOUTH
if(degree < 270) return SOUTHWEST
if(degree < 315) return WEST
return NORTH|WEST
//returns the north-zero clockwise angle in degrees, given a direction
/proc/dir2angle(var/D)
switch(D)
if(NORTH) return 0
if(SOUTH) return 180
if(EAST) return 90
if(WEST) return 270
if(NORTHEAST) return 45
if(SOUTHEAST) return 135
if(NORTHWEST) return 315
if(SOUTHWEST) return 225
else return null
//Returns the angle in english
/proc/angle2text(var/degree)
return dir2text(angle2dir(degree))
//Converts a rights bitfield into a string
/proc/rights2text(rights)
if(rights & R_BUILDMODE) . += "+BUILDMODE"
if(rights & R_ADMIN) . += "+ADMIN"
if(rights & R_BAN) . += "+BAN"
if(rights & R_FUN) . += "+FUN"
if(rights & R_SERVER) . += "+SERVER"
if(rights & R_DEBUG) . += "+DEBUG"
if(rights & R_POSSESS) . += "+POSSESS"
if(rights & R_PERMISSIONS) . += "+PERMISSIONS"
if(rights & R_STEALTH) . += "+STEALTH"
if(rights & R_REJUVINATE) . += "+REJUVINATE"
if(rights & R_VAREDIT) . += "+VAREDIT"
if(rights & R_SOUNDS) . += "+SOUND"
if(rights & R_SPAWN) . += "+SPAWN"
return .

View File

@@ -615,7 +615,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
// so just reset the user mob's machine var
if(src && src.mob)
//world << "[src] was [src.mob.machine], setting to null"
src.mob.machine = null
src.mob.unset_machine()
return
//Will return the location of the turf an atom is ultimatly sitting on
@@ -945,7 +945,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
corner.density = 1
corner.anchored = 1
corner.icon = X.icon
corner.icon_state = dd_replacetext(X.icon_state, "_s", "_f")
corner.icon_state = replacetext(X.icon_state, "_s", "_f")
corner.tag = "delete me"
corner.name = "wall"
@@ -965,7 +965,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
// Reset the shuttle corners
if(O.tag == "delete me")
X.icon = 'icons/turf/shuttle.dmi'
X.icon_state = dd_replacetext(O.icon_state, "_f", "_s") // revert the turf to the old icon_state
X.icon_state = replacetext(O.icon_state, "_f", "_s") // revert the turf to the old icon_state
X.name = "wall"
del(O) // prevents multiple shuttle corners from stacking
continue
@@ -995,7 +995,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
fromupdate += ttl
else
T.ReplaceWithSpace()
T.ChangeTurf(/turf/space)
refined_src -= T
refined_trg -= B
@@ -1363,6 +1363,14 @@ proc/is_hot(obj/item/W as obj)
istype(W, /obj/item/weapon/bonesetter)
)
//check if mob is lying down on something we can operate him on.
/proc/can_operate(mob/living/carbon/M)
return (locate(/obj/machinery/optable, M.loc) && M.resting) || \
(locate(/obj/structure/stool/bed/roller, M.loc) && \
(M.buckled || M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat)) && prob(75) || \
(locate(/obj/structure/table/, M.loc) && \
(M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat) && prob(66))
/proc/reverse_direction(var/dir)
switch(dir)
if(NORTH)

View File

@@ -18,6 +18,7 @@
var/log_pda = 0 // log pda messages
var/log_hrefs = 0 // logs all links clicked in-game. Could be used for debugging and tracking down exploits
var/sql_enabled = 1 // for sql switching
var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour
var/allow_vote_restart = 0 // allow votes to restart
var/allow_vote_mode = 0 // allow votes to change mode
var/allow_admin_jump = 1 // allows admin jumping
@@ -102,7 +103,11 @@
var/metroid_delay = 0
var/animal_delay = 0
var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system.
var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
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/assistant_maint = 0 //Do assistants get maint access?
var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour.
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
@@ -123,20 +128,10 @@
src.votable_modes += "secret"
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
var/text = file2text(filename)
var/list/Lines = file2list(filename)
if (!text)
diary << "No [filename] file found, setting defaults"
src = new /datum/configuration()
return
diary << "Reading configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
@@ -162,6 +157,9 @@
if ("admin_legacy_system")
config.admin_legacy_system = 1
if ("ban_legacy_system")
config.ban_legacy_system = 1
if ("log_ooc")
config.log_ooc = 1
@@ -204,6 +202,9 @@
if ("log_hrefs")
config.log_hrefs = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
if ("allow_vote_restart")
config.allow_vote_restart = 1
@@ -364,6 +365,12 @@
limitalienplayers = 1
alien_to_human_ratio = text2num(value)
if("assistant_maint")
config.assistant_maint = 1
if("gateway_delay")
config.gateway_delay = text2num(value)
else
diary << "Unknown setting in configuration: '[name]'"
@@ -412,20 +419,9 @@
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/loadsql(filename) // -- TLE
var/text = file2text(filename)
if (!text)
diary << "No dbconfig.txt file found, retaining defaults"
world << "No dbconfig.txt file found, retaining defaults"
return
diary << "Reading database configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
@@ -469,20 +465,9 @@
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/loadforumsql(filename) // -- TLE
var/text = file2text(filename)
if (!text)
diary << "No forumdbconfig.txt file found, retaining defaults"
world << "No forumdbconfig.txt file found, retaining defaults"
return
diary << "Reading forum database configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)

View File

@@ -34,12 +34,10 @@ var/datum/controller/failsafe/Failsafe
if(0 to 3)
MC_defcon++
if(4)
for(var/client/C in admin_list)
C << "<font color='red' size='2'><b>Warning. The Master Controller has not fired in the last [MC_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
admins << "<font color='red' size='2'><b>Warning. The Master Controller has not fired in the last [MC_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
MC_defcon = 5
if(5)
for(var/client/C in admin_list)
C << "<font color='red' size='2'><b>Warning. The Master Controller has still not fired within the last [MC_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
admins << "<font color='red' size='2'><b>Warning. The Master Controller has still not fired within the last [MC_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process)
master_controller.process() //Start it rolling again
MC_defcon = 0
@@ -53,12 +51,10 @@ var/datum/controller/failsafe/Failsafe
if(0 to 3)
lighting_defcon++
if(4)
for(var/client/C in admin_list)
C << "<font color='red' size='2'><b>Warning. The Lighting Controller has not fired in the last [lighting_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
admins << "<font color='red' size='2'><b>Warning. The Lighting Controller has not fired in the last [lighting_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
lighting_defcon = 5
if(5)
for(var/client/C in admin_list)
C << "<font color='red' size='2'><b>Warning. The Lighting Controller has still not fired within the last [lighting_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
admins << "<font color='red' size='2'><b>Warning. The Lighting Controller has still not fired within the last [lighting_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
new /datum/controller/lighting() //replace the old lighting_controller (hence killing the old one's process)
lighting_controller.process() //Start it rolling again
lighting_defcon = 0

View File

@@ -288,6 +288,13 @@ datum/shuttle_controller
if(1)
// Just before it leaves, close the damn doors!
if(timeleft == 2 || timeleft == 1)
var/area/start_location = locate(/area/shuttle/escape/station)
for(var/obj/machinery/door/D in start_location)
spawn(0)
D.close()
if(timeleft>0)
return 0

View File

@@ -64,7 +64,7 @@ datum/controller/vote
greatest_votes = votes
//default-vote for everyone who didn't vote
if(!config.vote_no_default && choices.len)
var/non_voters = (client_list.len - total_votes)
var/non_voters = (clients.len - total_votes)
if(non_voters > 0)
if(mode == "restart")
choices["Continue Playing"] += non_voters
@@ -186,7 +186,7 @@ datum/controller/vote
var/trialmin = 0
if(C.holder)
admin = 1
if (C.holder.level >= 3)
if(C.holder.rights & R_ADMIN)
trialmin = 1
voting |= C

View File

@@ -180,12 +180,12 @@ client
body += "<br><font size='1'><a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=ckey'>[M.ckey ? M.ckey : "No ckey"]</a> / <a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=real_name'>[M.real_name ? M.real_name : "No real name"]</a></font>"
body += {"
<br><font size='1'>
BRUTE:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=\ref["brute"]'>[M.getBruteLoss()]</a>
FIRE:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=\ref["fire"]'>[M.getFireLoss()]</a>
TOXIN:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=\ref["toxin"]'>[M.getToxLoss()]</a>
OXY:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=\ref["oxygen"]'>[M.getOxyLoss()]</a>
CLONE:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=\ref["clone"]'>[M.getCloneLoss()]</a>
BRAIN:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=\ref["brain"]'>[M.getBrainLoss()]</a>
BRUTE:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=brute'>[M.getBruteLoss()]</a>
FIRE:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=fire'>[M.getFireLoss()]</a>
TOXIN:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=toxin'>[M.getToxLoss()]</a>
OXY:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=oxygen'>[M.getOxyLoss()]</a>
CLONE:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=clone'>[M.getCloneLoss()]</a>
BRAIN:<font size='1'><a href='byond://?src=\ref[src];mobToDamage=\ref[D];adjustDamage=brain'>[M.getBrainLoss()]</a>
</font>
@@ -245,6 +245,7 @@ client
if(ismob(D))
body += "<option value='byond://?src=\ref[src];give_spell=\ref[D]'>Give Spell</option>"
body += "<option value='byond://?src=\ref[src];give_disease=\ref[D]'>Give Disease</option>"
body += "<option value='byond://?src=\ref[src];ninja=\ref[D]'>Make Space Ninja</option>"
body += "<option value='byond://?src=\ref[src];godmode=\ref[D]'>Toggle Godmode</option>"
body += "<option value='byond://?src=\ref[src];build_mode=\ref[D]'>Toggle Build Mode</option>"
@@ -406,9 +407,13 @@ client
//~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records).
else if(href_list["rename"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["rename"])
if(!istype(M)) return
if(!admin_rank_check(src.holder.level, 3)) return
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN)
if( !new_name || !M ) return
@@ -416,418 +421,370 @@ client
M.fully_replace_character_name(M.real_name,new_name)
href_list["datumrefresh"] = href_list["rename"]
else if (href_list["varnameedit"])
if(!href_list["datumedit"] || !href_list["varnameedit"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
else if(href_list["varnameedit"] && href_list["datumedit"])
if(!check_rights(0)) return
var/D = locate(href_list["datumedit"])
if(!istype(D,/datum) && !istype(D,/client))
usr << "This can only be used on instances of types /client or /datum"
return
var/DAT = locate(href_list["datumedit"])
if(!DAT)
usr << "Item not found"
return
if(!istype(DAT,/datum) && !istype(DAT,/client))
usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables."
return
modify_variables(DAT, href_list["varnameedit"], 1)
else if (href_list["varnamechange"])
if(!href_list["datumchange"] || !href_list["varnamechange"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
return
var/DAT = locate(href_list["datumchange"])
if(!DAT)
usr << "Item not found"
return
if(!istype(DAT,/datum) && !istype(DAT,/client))
usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables."
return
modify_variables(DAT, href_list["varnamechange"], 0)
else if (href_list["varnamemass"])
if(!href_list["datummass"] || !href_list["varnamemass"])
usr << "Varedit error: Not all information has been sent. Contact a coder."
modify_variables(D, href_list["varnameedit"], 1)
else if(href_list["varnamechange"] && href_list["datumchange"])
if(!check_rights(0)) return
var/D = locate(href_list["datumchange"])
if(!istype(D,/datum) && !istype(D,/client))
usr << "This can only be used on instances of types /client or /datum"
return
modify_variables(D, href_list["varnamechange"], 0)
else if(href_list["varnamemass"] && href_list["datummass"])
if(!check_rights(0)) return
var/atom/A = locate(href_list["datummass"])
if(!A)
usr << "Item not found"
return
if(!istype(A,/atom))
usr << "Can't mass edit an item of this type. Type must be /atom, so an object, turf, mob or area. You cannot mass edit clients!"
if(!istype(A))
usr << "This can only be used on instances of type /atom"
return
cmd_mass_modify_object_variables(A, href_list["varnamemass"])
else if(href_list["mob_player_panel"])
if(!href_list["mob_player_panel"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["mob_player_panel"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/mob/MOB = locate(href_list["mob_player_panel"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
src.holder.show_player_panel(MOB)
src.holder.show_player_panel(M)
href_list["datumrefresh"] = href_list["mob_player_panel"]
else if(href_list["give_spell"])
if(!href_list["give_spell"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["give_spell"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/mob/MOB = locate(href_list["give_spell"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
src.give_spell(MOB)
src.give_spell(M)
href_list["datumrefresh"] = href_list["give_spell"]
else if(href_list["give_disease"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["give_disease"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
src.give_disease(M)
href_list["datumrefresh"] = href_list["give_spell"]
else if(href_list["ninja"])
if(!href_list["ninja"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["ninja"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/mob/MOB = locate(href_list["ninja"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
src.cmd_admin_ninjafy(MOB)
src.cmd_admin_ninjafy(M)
href_list["datumrefresh"] = href_list["ninja"]
else if(href_list["godmode"])
if(!href_list["godmode"])
if(!check_rights(R_REJUVINATE)) return
var/mob/M = locate(href_list["godmode"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/mob/MOB = locate(href_list["godmode"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
src.cmd_admin_godmode(MOB)
src.cmd_admin_godmode(M)
href_list["datumrefresh"] = href_list["godmode"]
else if(href_list["gib"])
if(!href_list["gib"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["gib"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/mob/MOB = locate(href_list["gib"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
src.cmd_admin_gib(MOB)
src.cmd_admin_gib(M)
else if(href_list["build_mode"])
if(!href_list["build_mode"])
if(!check_rights(R_BUILDMODE)) return
var/mob/M = locate(href_list["build_mode"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
var/mob/MOB = locate(href_list["build_mode"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
togglebuildmode(MOB)
togglebuildmode(M)
href_list["datumrefresh"] = href_list["build_mode"]
else if(href_list["drop_everything"])
if(!href_list["drop_everything"])
return
var/mob/MOB = locate(href_list["drop_everything"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
if(!check_rights(0)) return
var/mob/M = locate(href_list["drop_everything"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
if(usr.client)
if(!admin_rank_check(src.holder.level, 3)) return
usr.client.cmd_admin_drop_everything(MOB)
usr.client.cmd_admin_drop_everything(M)
else if(href_list["direct_control"])
if(!href_list["direct_control"])
return
var/mob/MOB = locate(href_list["direct_control"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
if(!check_rights(0)) return
var/mob/M = locate(href_list["direct_control"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
if(usr.client)
if(!admin_rank_check(src.holder.level, 3)) return
usr.client.cmd_assume_direct_control(MOB)
usr.client.cmd_assume_direct_control(M)
else if(href_list["make_skeleton"])
if(!href_list["make_skeleton"])
return
var/mob/MOB = locate(href_list["make_skeleton"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["make_skeleton"])
if(!istype(H))
usr << "This can only be used on instances of type /mob/living/carbon/human"
return
if(ishuman(MOB))
if(!admin_rank_check(src.holder.level, 3)) return
var/mob/living/carbon/human/HUMANMOB = MOB
HUMANMOB.makeSkeleton()
H.makeSkeleton()
href_list["datumrefresh"] = href_list["make_skeleton"]
else if(href_list["delall"])
if(!href_list["delall"])
if(!check_rights(R_DEBUG|R_SERVER)) return
var/obj/O = locate(href_list["delall"])
if(!isobj(O))
usr << "This can only be used on instances of type /obj"
return
var/atom/A = locate(href_list["delall"])
if(!admin_rank_check(src.holder.level, 3)) return
if(!A)
var/action_type = alert("Strict type ([O.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel")
if(action_type == "Cancel" || !action_type)
return
if(!isobj(A))
usr << "This can only be used on objects (of type /obj)"
return
if(!A.type)
return
var/action_type = alert("Strict type ([A.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel")
if(!action_type || action_type == "Cancel")
return
if(alert("Are you really sure you want to delete all objects of type [A.type]?",,"Yes","No") != "Yes")
if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes")
return
if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes")
return
var/a_type = A.type
if(action_type == "Strict type")
var/O_type = O.type
switch(action_type)
if("Strict type")
var/i = 0
for(var/obj/O in world)
if(O.type == a_type)
for(var/obj/Obj in world)
if(Obj.type == O_type)
i++
del(O)
del(Obj)
if(!i)
usr << "No objects of this type exist"
return
log_admin("[key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ", 1)
else if(action_type == "Type and subtypes")
log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ", 1)
if("Type and subtypes")
var/i = 0
for(var/obj/O in world)
if(istype(O,a_type))
for(var/obj/Obj in world)
if(istype(Obj,O_type))
i++
del(O)
del(Obj)
if(!i)
usr << "No objects of this type exist"
return
log_admin("[key_name(usr)] deleted all objects of scrict type with subtypes [a_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of type with subtypes [a_type] ([i] objects deleted) ", 1)
log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ")
message_admins("\blue [key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ", 1)
else if(href_list["explode"])
if(!href_list["explode"])
return
if(!check_rights(0)) return
var/atom/A = locate(href_list["explode"])
if(!A)
return
if(!isobj(A) && !ismob(A) && !isturf(A))
usr << "This can only be done to instances of type /obj, /mob and /turf"
return
if(!admin_rank_check(src.holder.level, 3)) return
src.cmd_admin_explosion(A)
href_list["datumrefresh"] = href_list["explode"]
else if(href_list["emp"])
if(!href_list["emp"])
return
if(!check_rights(0)) return
var/atom/A = locate(href_list["emp"])
if(!A)
return
if(!isobj(A) && !ismob(A) && !isturf(A))
usr << "This can only be done to instances of type /obj, /mob and /turf"
return
if(!admin_rank_check(src.holder.level, 3)) return
src.cmd_admin_emp(A)
href_list["datumrefresh"] = href_list["emp"]
else if(href_list["mark_object"])
if(!href_list["mark_object"])
return
if(!check_rights(0)) return
var/datum/D = locate(href_list["mark_object"])
if(!D)
if(!istype(D))
usr << "This can only be done to instances of type /datum"
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
src.holder.marked_datum = D
href_list["datumrefresh"] = href_list["mark_object"]
else if(href_list["rotatedatum"])
if(!admin_rank_check(src.holder.level, 3)) return
if(!href_list["rotatedir"])
return
if(!check_rights(0)) return
var/atom/A = locate(href_list["rotatedatum"])
if(!A)
return
if(!istype(A,/atom))
usr << "This can only be done to objects of type /atom"
return
if(!src.holder)
if(!istype(A))
usr << "This can only be done to instances of type /atom"
return
switch(href_list["rotatedir"])
if("right")
A.dir = turn(A.dir, -45)
if("left")
A.dir = turn(A.dir, 45)
if("right") A.dir = turn(A.dir, -45)
if("left") A.dir = turn(A.dir, 45)
href_list["datumrefresh"] = href_list["rotatedatum"]
else if(href_list["makemonkey"])
var/mob/M = locate(href_list["makemonkey"])
if(!M)
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["makemonkey"])
if(!istype(H))
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
if(!admin_rank_check(src.holder.level, 3)) return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("monkeyone"=href_list["makemonkey"]))
else if(href_list["makerobot"])
var/mob/M = locate(href_list["makerobot"])
if(!M)
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["makerobot"])
if(!istype(H))
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
if(!admin_rank_check(src.holder.level, 3)) return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makerobot"=href_list["makerobot"]))
else if(href_list["makealien"])
var/mob/M = locate(href_list["makealien"])
if(!M)
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["makealien"])
if(!istype(H))
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
if(!admin_rank_check(src.holder.level, 3)) return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makealien"=href_list["makealien"]))
else if(href_list["makemetroid"])
var/mob/M = locate(href_list["makemetroid"])
if(!M)
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["makemetroid"])
if(!istype(H))
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
if(!admin_rank_check(src.holder.level, 3)) return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makemetroid"=href_list["makemetroid"]))
else if(href_list["makeai"])
var/mob/M = locate(href_list["makeai"])
if(!M)
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["makeai"])
if(!istype(H))
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
if(!admin_rank_check(src.holder.level, 3)) return
if(!ishuman(M))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
return
var/action_type = alert("Confirm mob type change?",,"Transform","Cancel")
if(!action_type || action_type == "Cancel")
return
if(!M)
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
usr << "Mob doesn't exist anymore"
return
holder.Topic(href, list("makeai"=href_list["makeai"]))
else if(href_list["setmutantrace"])
if(!check_rights(0)) return
var/mob/living/carbon/human/H = locate(href_list["setmutantrace"])
if(!admin_rank_check(src.holder.level, 3)) return
if(!istype(H))
usr << "This can only be done to objects of type /mob/living/carbon/human"
return
if(!src.holder)
usr << "You are not an administrator."
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
var/new_mutantrace = input("Please choose a new mutantrace","Mutantrace",null) as null|anything in list("NONE","golem","lizard","metroid","plant","tajaran","skrell") //BS12 EDIT TAJ EDIT SKR
switch(new_mutantrace)
if(null) return
if("NONE") new_mutantrace = ""
if(!H || !istype(H))
if(!H)
usr << "Mob doesn't exist anymore"
return
if(H.dna)
H.dna.mutantrace = new_mutantrace
H.update_mutantrace()
else if(href_list["regenerateicons"])
if(!check_rights(0)) return
var/mob/M = locate(href_list["regenerateicons"])
if(!admin_rank_check(src.holder.level, 3)) return
if(!istype(M))
usr << "This can only be done to objects of type /mob"
return
if(!src.holder)
usr << "You are not an administrator."
if(!ismob(M))
usr << "This can only be done to instances of type /mob"
return
M.regenerate_icons()
else if(href_list["adjustDamage"] && href_list["mobToDamage"])
var/mob/M = locate(href_list["mobToDamage"])
var/Text = locate(href_list["adjustDamage"])
if(!check_rights(0)) return
if(!isliving(M)) return
var/mob/living/L = M
var/mob/living/L = locate(href_list["mobToDamage"])
if(!istype(L)) return
if(!admin_rank_check(src.holder.level, 3)) return
var/Text = href_list["adjustDamage"]
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
if(Text == "brute")
L.adjustBruteLoss(amount)
else if(Text == "fire")
L.adjustFireLoss(amount)
else if(Text == "toxin")
L.adjustToxLoss(amount)
else if(Text == "oxygen")
L.adjustOxyLoss(amount)
else if(Text == "brain")
L.adjustBrainLoss(amount)
else if(Text == "clone")
L.adjustCloneLoss(amount)
if(!L)
usr << "Mob doesn't exist anymore"
return
switch(Text)
if("brute") L.adjustBruteLoss(amount)
if("fire") L.adjustFireLoss(amount)
if("toxin") L.adjustToxLoss(amount)
if("oxygen")L.adjustOxyLoss(amount)
if("brain") L.adjustBrainLoss(amount)
if("clone") L.adjustCloneLoss(amount)
else
usr << "You caused an error. DEBUG: Text:[Text] Mob:[M]"
usr << "You caused an error. DEBUG: Text:[Text] Mob:[L]"
return
if(amount != 0)
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [M] ")
message_admins("\blue [key_name(usr)] dealt [amount] amount of [Text] damage to [M] ", 1)
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ")
message_admins("\blue [key_name(usr)] dealt [amount] amount of [Text] damage to [L] ", 1)
href_list["datumrefresh"] = href_list["mobToDamage"]
else
. = 0
if(href_list["datumrefresh"])
var/datum/DAT = locate(href_list["datumrefresh"])
if(!DAT)
return
if(!istype(DAT, /datum))
return
src.debug_variables(DAT)
. = 1
return

View File

@@ -1,10 +1,10 @@
#define NON_CONTAGIOUS -1
#define SPECIAL 0
#define CONTACT_GENERAL 1
#define CONTACT_HANDS 2
#define CONTACT_FEET 3
#define AIRBORNE 4
#define BLOOD 5
#define SPECIAL -1
#define NON_CONTAGIOUS 0
#define BLOOD 1
#define CONTACT_FEET 2
#define CONTACT_HANDS 3
#define CONTACT_GENERAL 4
#define AIRBORNE 5
#define SCANNER 1
#define PANDEMIC 2
@@ -17,6 +17,8 @@ to null does not delete the object itself. Thank you.
*/
var/list/diseases = typesof(/datum/disease) - /datum/disease
/datum/disease
var/form = "Virus" //During medscans, what the disease is referred to as
@@ -28,6 +30,7 @@ to null does not delete the object itself. Thank you.
var/cure_list = null // allows for multiple possible cure combinations
var/cure_chance = 8//chance for the cure to do its job
var/spread = null //spread type description
var/initial_spread = null
var/spread_type = AIRBORNE
var/contagious_period = 0//the disease stage when it can be spread
var/list/affected_species = list()
@@ -58,7 +61,7 @@ to null does not delete the object itself. Thank you.
//world << "[affected_mob] is carrier"
return
spread = (cure_present?"Remissive":initial(spread))
spread = (cure_present?"Remissive":initial_spread)
if(stage > max_stages)
stage = max_stages
@@ -94,10 +97,15 @@ to null does not delete the object itself. Thank you.
return result
/datum/disease/proc/spread(var/atom/source=null)
/datum/disease/proc/spread(var/atom/source=null, var/airborne_range = 2, var/force_spread)
//world << "Disease [src] proc spread was called from holder [source]"
if(spread_type == SPECIAL || spread_type == NON_CONTAGIOUS)//does not spread
// If we're overriding how we spread, say so here
var/how_spread = spread_type
if(force_spread)
how_spread = force_spread
if(how_spread == SPECIAL || how_spread == NON_CONTAGIOUS)//does not spread
return
if(stage < contagious_period) //the disease is not contagious at this stage
@@ -110,26 +118,32 @@ to null does not delete the object itself. Thank you.
return
var/check_range = AIRBORNE//defaults to airborne - range 4
var/check_range = airborne_range//defaults to airborne - range 2
if(spread_type != AIRBORNE && spread_type != SPECIAL)
check_range = 0 // everything else, like infect-on-contact things, only infect things on top of it
if(how_spread != AIRBORNE && how_spread != SPECIAL)
check_range = 1 // everything else, like infect-on-contact things, only infect things on top of it
for(var/mob/living/carbon/M in oview(check_range, source)) //I have no idea why oview works when oviewers doesn't. -Pete
M.contract_disease(src)
if(isturf(source.loc))
for(var/mob/living/carbon/M in oview(check_range, source))
if(isturf(M.loc))
if(AStar(source.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range))
M.contract_disease(src, 0, 1, force_spread)
return
/datum/disease/proc/process()
if(!holder) return
if(!holder)
active_diseases -= src
return
if(prob(65))
spread(holder)
if(affected_mob)
for(var/datum/disease/D in affected_mob.viruses)
if(D != src)
if(istype(src, D.type))
if(IsSame(D))
//error("Deleting [D.name] because it's the same as [src.name].")
del(D) // if there are somehow two viruses of the same kind in the system, delete the other one
if(holder == affected_mob)
@@ -159,10 +173,19 @@ to null does not delete the object itself. Thank you.
return
/datum/disease/New(var/process=1)//process = 1 - adding the object to global list. List is processed by master controller.
/datum/disease/New(var/process=1, var/datum/disease/D)//process = 1 - adding the object to global list. List is processed by master controller.
cure_list = list(cure_id) // to add more cures, add more vars to this list in the actual disease's New()
if(process) // Viruses in list are considered active.
active_diseases += src
initial_spread = spread
/datum/disease/proc/IsSame(var/datum/disease/D)
if(istype(src, D.type))
return 1
return 0
/datum/disease/proc/Copy()
return new type(0, src)
/*
/datum/disease/Del()

View File

@@ -0,0 +1,379 @@
/*
Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties
which add onto the overall disease.
If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus.
*/
#define RANDOM_STARTING_LEVEL 2
var/list/archive_diseases = list()
/*
PROPERTIES
*/
/datum/disease/advance
name = "Unknown" // We will always let our Virologist name our disease.
desc = "An engineered disease which can contain a multitude of symptoms."
form = "Advance Disease" // Will let med-scanners know that this disease was engineered.
agent = "advance microbes"
max_stages = 5
spread = "Unknown"
affected_species = list("Human","Monkey")
// NEW VARS
var/list/symptoms = list() // The symptoms of the disease.
/*
OLD PROCS
*/
/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D, var/copy = 0)
// Setup our dictionary if it hasn't already.
if(!dictionary_symptoms.len)
for(var/symp in list_symptoms)
var/datum/symptom/S = new symp
dictionary_symptoms[S.id] = symp
if(!istype(D))
D = null
// Generate symptoms if we weren't given any.
if(!symptoms || !symptoms.len)
if(!D || !D.symptoms || !D.symptoms.len)
symptoms = GenerateSymptoms()
else
for(var/datum/symptom/S in D.symptoms)
symptoms += new S.type
name = D.name
Refresh(!copy)
..(process, D)
return
// Randomly pick a symptom to activate.
/datum/disease/advance/stage_act()
..()
if(symptoms && symptoms.len)
for(var/datum/symptom/S in symptoms)
S.Activate(src)
else
CRASH("We do not have any symptoms during stage_act()!")
// Compares type then ID.
/datum/disease/advance/IsSame(var/datum/disease/advance/D)
if(!(istype(D, /datum/disease/advance)))
//error("Returning 0 because not same type.")
return 0
//error("Comparing [src.GetDiseaseID()] [D.GetDiseaseID()]")
if(src.GetDiseaseID() != D.GetDiseaseID())
//error("Returing 0")
return 0
//error("Returning 1")
return 1
// To add special resistances.
/datum/disease/advance/cure(var/resistance=1)
if(affected_mob)
var/id = "[GetDiseaseID()]"
if(resistance && !(id in affected_mob.resistances))
affected_mob.resistances[id] = id
affected_mob.viruses -= src //remove the datum from the list
del(src) //delete the datum to stop it processing
return
// Returns the advance disease with a different reference memory.
/datum/disease/advance/Copy()
return new /datum/disease/advance(0, src, 1)
/*
NEW PROCS
*/
// Mix the symptoms of two diseases (the src and the argument)
/datum/disease/advance/proc/Mix(var/datum/disease/advance/D)
if(!(src.IsSame(D)))
var/list/possible_symptoms = shuffle(D.symptoms)
for(var/datum/symptom/S in possible_symptoms)
AddSymptom(new S.type)
/datum/disease/advance/proc/HasSymptom(var/datum/symptom/S)
for(var/datum/symptom/symp in symptoms)
if(symp.id == S.id)
return 1
return 0
// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated.
/datum/disease/advance/proc/GenerateSymptoms(var/type_level_limit = RANDOM_STARTING_LEVEL, var/amount_get = 0)
var/list/generated = list() // Symptoms we generated.
// Generate symptoms. By default, we only choose non-deadly symptoms.
var/list/possible_symptoms = list()
for(var/symp in list_symptoms)
var/datum/symptom/S = new symp
if(S.level <= type_level_limit)
if(!HasSymptom(S))
possible_symptoms += S
if(!possible_symptoms.len)
return
//error("Advance Disease - We weren't able to get any possible symptoms in GenerateSymptoms([type_level_limit], [amount_get])")
// Random chance to get more than one symptom
var/number_of = amount_get
if(!amount_get)
number_of = 1
while(prob(20))
number_of += 1
for(var/i = 1; number_of >= i; i++)
var/datum/symptom/S = pick(possible_symptoms)
generated += S
possible_symptoms -= S
return generated
/datum/disease/advance/proc/Refresh(var/save = 1)
//world << "[src.name] \ref[src] - REFRESH!"
var/list/properties = GenerateProperties()
AssignProperties(properties)
if(save)
archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1)
//Generate disease properties based on the effects. Returns an associated list.
/datum/disease/advance/proc/GenerateProperties()
if(!symptoms || !symptoms.len)
CRASH("We did not have any symptoms before generating properties.")
return
var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 1)
for(var/datum/symptom/S in symptoms)
properties["resistance"] += S.resistance
properties["stealth"] += S.stealth
properties["stage_rate"] += S.stage_speed
properties["transmittable"] += S.transmittable
properties["severity"] = max(properties["severity"], S.level) // severity is based on the highest level symptom
return properties
// Assign the properties that are in the list.
/datum/disease/advance/proc/AssignProperties(var/list/properties = list())
if(properties && properties.len)
hidden = list( (properties["stealth"] > 2), (properties["stealth"] > 3) )
// The more symptoms we have, the less transmittable it is but some symptoms can make up for it.
SetSpread(max(BLOOD, min(properties["transmittable"] - symptoms.len, AIRBORNE)))
permeability_mod = max(round(0.5 * properties["transmittable"]), 1)
stage_prob = max(properties["stage_rate"], 1)
SetSeverity(properties["severity"])
GenerateCure(properties)
else
CRASH("Our properties were empty or null!")
// Assign the spread type and give it the correct description.
/datum/disease/advance/proc/SetSpread(var/spread_id)
switch(spread_id)
if(NON_CONTAGIOUS)
spread = "None"
if(SPECIAL)
spread = "None"
if(CONTACT_GENERAL, CONTACT_HANDS, CONTACT_FEET)
spread = "On contact"
if(AIRBORNE)
spread = "Airborne"
if(BLOOD)
spread = "Blood"
spread_type = spread_id
//world << "Setting spread type to [spread_id]/[spread]"
/datum/disease/advance/proc/SetSeverity(var/level_sev)
switch(level_sev)
if(0)
severity = "Non-Threat"
if(1)
severity = "Minor"
if(2)
severity = "Medium"
if(3)
severity = "Harmful"
if(4)
severity = "Dangerous!"
if(5)
severity = "BIOHAZARD THREAT!"
else
severity = "Unknown"
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure(var/list/properties = list())
if(properties && properties.len)
var/res = max(properties["resistance"] - (symptoms.len / 2), 0)
//world << "Res = [res]"
switch(round(res))
// Due to complications, I cannot randomly generate cures or randomly give cures.
if(0)
cure_id = "nutriment"
if(1)
cure_id = "sodiumchloride"
if(2)
cure_id = "orangejuice"
if(3)
cure_id = "spaceacillin"
if(4)
cure_id = "ethanol"
if(5)
cure_id = "ethylredoxrazine"
if(6)
cure_id = "synaptizine"
if(7)
cure_id = "silver"
if(8)
cure_id = "gold"
if(9)
cure_id = "mindbreaker"
else
cure_id = "plasma"
// Get the cure name from the cure_id
var/datum/reagent/D = chemical_reagents_list[cure_id]
cure = D.name
return
// Randomly generate a symptom, has a chance to lose or gain a symptom.
/datum/disease/advance/proc/Evolve(var/level = 2)
var/s = safepick(GenerateSymptoms(level, 1))
if(s)
AddSymptom(s)
Refresh()
return
// Randomly remove a symptom.
/datum/disease/advance/proc/Devolve()
if(symptoms.len > 1)
var/s = safepick(symptoms)
if(s)
RemoveSymptom(s)
Refresh()
return
// Name the disease.
/datum/disease/advance/proc/AssignName(var/name = "Unknown")
src.name = name
return
// Return a unique ID of the disease.
/datum/disease/advance/proc/GetDiseaseID()
var/list/L = list()
for(var/datum/symptom/S in symptoms)
L += S.id
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
return dd_list2text(L, ":")
// Add a symptom, if it is over the limit (with a small chance to be able to go over)
// we take a random symptom away and add the new one.
/datum/disease/advance/proc/AddSymptom(var/datum/symptom/S)
if(HasSymptom(S))
return
if(symptoms.len < 3 + rand(-1, 1))
symptoms += S
else
RemoveSymptom(pick(symptoms))
symptoms += S
return
// Simply removes the symptom.
/datum/disease/advance/proc/RemoveSymptom(var/datum/symptom/S)
symptoms -= S
return
/*
Static Procs
*/
// Mix a list of advance diseases and return the mixed result.
/proc/Advance_Mix(var/list/D_list)
//world << "Mixing!!!!"
var/list/diseases = list()
for(var/datum/disease/advance/A in D_list.Copy())
diseases += A.Copy()
if(!diseases.len)
return null
if(diseases.len <= 1)
return pick(diseases) // Just return the only entry.
var/i = 0
// Mix our diseases until we are left with only one result.
while(i < 20 && diseases.len > 1)
i++
var/datum/disease/advance/D1 = pick(diseases)
diseases -= D1
var/datum/disease/advance/D2 = pick(diseases)
D2.Mix(D1)
// Should be only 1 entry left, but if not let's only return a single entry
//world << "END MIXING!!!!!"
var/datum/disease/advance/to_return = pick(diseases)
to_return.Refresh()
return to_return
/proc/SetViruses(var/datum/reagent/R, var/list/data)
if(data)
var/list/preserve = list()
if(istype(data) && data["viruses"])
for(var/datum/disease/A in data["viruses"])
preserve += A.Copy()
R.data = data.Copy()
else
R.data = data
if(preserve.len)
R.data["viruses"] = preserve
#undef RANDOM_STARTING_LEVEL

View File

@@ -0,0 +1,5 @@
/datum/disease/advance/cold/New(var/process = 1, var/datum/disease/advance/D, var/copy = 0)
if(!D)
name = "Cold"
symptoms = list(new/datum/symptom/sneeze)
..(process, D, copy)

View File

@@ -0,0 +1,5 @@
/datum/disease/advance/flu/New(var/process = 1, var/datum/disease/advance/D, var/copy = 0)
if(!D)
name = "Flu"
symptoms = list(new/datum/symptom/cough)
..(process, D, copy)

View File

@@ -0,0 +1,39 @@
/*
//////////////////////////////////////
Confusion
Little bit hidden.
Lowers resistance.
Decreases stage speed.
Not very transmittable.
Intense Level.
Bonus
Makes the affected mob be confused for short periods of time.
//////////////////////////////////////
*/
/datum/symptom/confusion
name = "Confusion"
stealth = 1
resistance = -1
stage_speed = -3
transmittable = 0
level = 4
/datum/symptom/confusion/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/carbon/M = A.affected_mob
switch(A.stage)
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You feel confused.", "You forgot what you were thinking about.")]</span>"
else
M << "<span class='notice'>You are unable to think straight!</span>"
M.confused = min(100, M.confused + 2)
return

View File

@@ -0,0 +1,37 @@
/*
//////////////////////////////////////
Coughing
Noticable.
No Resistance.
Doesn't increase stage speed.
Transmittable.
Low Level.
BONUS
Will force the affected mob to drop items!
//////////////////////////////////////
*/
/datum/symptom/cough
name = "Cough"
stealth = -1
resistance = 0
stage_speed = 0
transmittable = 2
level = 1
/datum/symptom/cough/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3)
M << "<span notice='notice'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>"
else
M.emote("cough")
M.drop_item()
return

View File

@@ -0,0 +1,43 @@
/*
//////////////////////////////////////
Damage Converter
Little bit hidden.
Lowers resistance tremendously.
Decreases stage speed tremendously.
Reduced transmittablity
Intense Level.
Bonus
Slowly converts brute/fire damage to toxin.
//////////////////////////////////////
*/
/datum/symptom/damage_converter // Not the egg
name = "Toxic Compensation"
stealth = 1
resistance = -4
stage_speed = -4
transmittable = -2
level = 4
/datum/symptom/damage_converter/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(5)
Convert(M)
return
/datum/symptom/damage_converter/proc/Convert(var/mob/living/M)
if(M.getFireLoss() < M.getMaxHealth() || M.getBruteLoss() < M.getMaxHealth())
var/get_damage = rand(1, 2)
M.adjustFireLoss(-get_damage)
M.adjustBruteLoss(-get_damage)
M.adjustToxLoss(get_damage * 2)
return 1

View File

@@ -0,0 +1,37 @@
/*
//////////////////////////////////////
Dizziness
Little bit hidden.
Lowers resistance considerably.
Decreases stage speed.
Reduced transmittability
Intense Level.
Bonus
Shakes the affected mob's screen for short periods.
//////////////////////////////////////
*/
/datum/symptom/dizzy // Not the egg
name = "Dizziness"
stealth = 1
resistance = -2
stage_speed = -3
transmittable = -1
level = 4
/datum/symptom/dizzy/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You feel dizzy.", "Your head starts spinning.")]</span>"
else
M << "<span class='notice'>You are unable to look straight!</span>"
M.make_dizzy(5)
return

View File

@@ -0,0 +1,34 @@
/*
//////////////////////////////////////
Fever
No change to hidden.
Increases resistance.
Increases stage speed.
Little transmittable.
Low level.
Bonus
Heats up your body.
//////////////////////////////////////
*/
/datum/symptom/fever
name = "Fever"
stealth = 0
resistance = 3
stage_speed = 3
transmittable = 1
level = 2
/datum/symptom/fever/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/carbon/M = A.affected_mob
M << "<span class='notice'>[pick("You feel hot.", "You feel like you're burning.")]</span>"
M.bodytemperature += 20 * A.stage
return

View File

@@ -0,0 +1,37 @@
/*
//////////////////////////////////////
Hallucigen
Very noticable.
Lowers resistance considerably.
Decreases stage speed.
Reduced transmittable.
Critical Level.
Bonus
Makes the affected mob be hallucinated for short periods of time.
//////////////////////////////////////
*/
/datum/symptom/hallucigen
name = "Hallucigen"
stealth = -2
resistance = -3
stage_speed = -3
transmittable = -1
level = 5
/datum/symptom/hallucigen/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/carbon/M = A.affected_mob
switch(A.stage)
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You notice someone in the corner of your eye.", "Is that footsteps?.")]</span>"
else
M.hallucination += 5
return

View File

@@ -0,0 +1,33 @@
/*
//////////////////////////////////////
Headache
Noticable.
Highly resistant.
Increases stage speed.
Not transmittable.
Low Level.
BONUS
Displays an annoying message!
Should be used for buffing your disease.
//////////////////////////////////////
*/
/datum/symptom/headache
name = "Headache"
stealth = -1
resistance = 4
stage_speed = 2
transmittable = 0
level = 1
/datum/symptom/headache/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
M << "<span class='notice'>[pick("Your head hurts.", "Your head starts pounding.")]</span>"
return

View File

@@ -0,0 +1,33 @@
/*
//////////////////////////////////////
Itching
Not noticable or unnoticable.
Resistant.
Increases stage speed.
Little transmittable.
Low Level.
BONUS
Displays an annoying message!
Should be used for buffing your disease.
//////////////////////////////////////
*/
/datum/symptom/itching
name = "Itching"
stealth = 0
resistance = 3
stage_speed = 3
transmittable = 1
level = 1
/datum/symptom/itching/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
M << "<span class='notice'>Your [pick("back", "arm", "leg", "elbow", "head")] itches.</span>"
return

View File

@@ -0,0 +1,34 @@
/*
//////////////////////////////////////
Shivering
No change to hidden.
Increases resistance.
Increases stage speed.
Little transmittable.
Low level.
Bonus
Cools down your body.
//////////////////////////////////////
*/
/datum/symptom/shivering
name = "Shivering"
stealth = 0
resistance = 2
stage_speed = 2
transmittable = 1
level = 2
/datum/symptom/shivering/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/carbon/M = A.affected_mob
M << "<span class='notice'>[pick("You feel cold.", "You start shaking from the cold.")]</span>"
M.bodytemperature -= 20 * A.stage
return

View File

@@ -0,0 +1,38 @@
/*
//////////////////////////////////////
Sneezing
Very Noticable.
Increases resistance.
Doesn't increase stage speed.
Very transmittable.
Low Level.
Bonus
Forces a spread type of AIRBORNE
with extra range!
//////////////////////////////////////
*/
/datum/symptom/sneeze
name = "Sneezing"
stealth = -2
resistance = 2
stage_speed = 0
transmittable = 3
level = 1
/datum/symptom/sneeze/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3)
M.emote("sniff")
else
M.emote("sneeze")
A.spread(A.holder, 5, AIRBORNE)
return

View File

@@ -0,0 +1,31 @@
// Symptoms are the effects that engineered advanced diseases do.
var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom
var/list/dictionary_symptoms = list()
var/global/const/SYMPTOM_ACTIVATION_PROB = 3
/datum/symptom
// Buffs/Debuffs the symptom has to the overall engineered disease.
var/name = ""
var/stealth = 0
var/resistance = 0
var/stage_speed = 0
var/transmittable = 0
// The type level of the symptom. Higher is more lethal and harder to generate.
var/level = 0
// The hash tag for our diseases, we will add it up with our other symptoms to get a unique id! ID MUST BE UNIQUE!!!
var/id = ""
/datum/symptom/New()
var/list/S = list_symptoms
for(var/i = 1; i <= S.len; i++)
if(src.type == S[i])
id = "[i]"
return
CRASH("We couldn't assign an ID!")
/datum/symptom/proc/Activate(var/mob/living/M, var/stage)
return

View File

@@ -0,0 +1,95 @@
/*
//////////////////////////////////////
Vomiting
Very Very Noticable.
Decreases resistance.
Doesn't increase stage speed.
Little transmittable.
Medium Level.
Bonus
Forces the affected mob to vomit!
Meaning your disease can spread via
people walking on vomit.
Makes the affected mob lose nutrition and
heal toxin damage.
//////////////////////////////////////
*/
/datum/symptom/vomit
name = "Vomiting"
stealth = -2
resistance = -1
stage_speed = 0
transmittable = 1
level = 3
/datum/symptom/vomit/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You feel nauseous.", "You feel like you're going to throw up!")]</span>"
else
Vomit(M)
return
/datum/symptom/vomit/proc/Vomit(var/mob/living/M)
M.Stun(5)
M.visible_message("<B>[M]</B> vomits on the floor!")
M.nutrition -= 20
M.adjustToxLoss(-3)
var/turf/pos = get_turf(M)
pos.add_vomit_floor(M)
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
/*
//////////////////////////////////////
Vomiting Blood
Very Very Noticable.
Decreases resistance.
Decreases stage speed.
Little transmittable.
Intense level.
Bonus
Forces the affected mob to vomit blood!
Meaning your disease can spread via
people walking on the blood.
Makes the affected mob lose health.
//////////////////////////////////////
*/
/datum/symptom/vomit/blood
name = "Blood Vomiting"
stealth = -2
resistance = -1
stage_speed = -1
transmittable = 1
level = 4
/datum/symptom/vomit/blood/Vomit(var/mob/living/M)
M.Stun(5)
M.visible_message("<B>[M]</B> vomits on the floor!")
// They lose blood and health.
var/brute_dam = M.getBruteLoss()
if(brute_dam >= 50)
M.adjustBruteLoss(3)
var/turf/pos = get_turf(M)
pos.add_blood_floor(M)
playsound(pos, 'sound/effects/splat.ogg', 50, 1)

View File

@@ -0,0 +1,119 @@
/*
//////////////////////////////////////
Weight Gain
Very Very Noticable.
Decreases resistance.
Decreases stage speed.
Reduced transmittable.
Intense Level.
Bonus
Increases the weight gain of the mob,
forcing it to eventually turn fat.
//////////////////////////////////////
*/
/datum/symptom/weight_gain
name = "Weight Gain"
stealth = -3
resistance = -3
stage_speed = -2
transmittable = -2
level = 4
/datum/symptom/weight_gain/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You feel blubbery.", "You feel full.")]</span>"
else
M.overeatduration = min(M.overeatduration + 100, 600)
M.nutrition = min(M.nutrition + 100, 500)
return
/*
//////////////////////////////////////
Weight Loss
Very Very Noticable.
Decreases resistance.
Decreases stage speed.
Reduced Transmittable.
High level.
Bonus
Decreases the weight of the mob,
forcing it to be skinny.
//////////////////////////////////////
*/
/datum/symptom/weight_loss
name = "Weight Loss"
stealth = -3
resistance = -2
stage_speed = -2
transmittable = -2
level = 3
/datum/symptom/weight_loss/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You feel hungry.", "You crave for food.")]</span>"
else
M << "<span class='notice'>Your stomach rumbles.</span>"
M.overeatduration = max(M.overeatduration - 100, 0)
M.nutrition = max(M.nutrition - 100, 0)
return
/*
//////////////////////////////////////
Weight Even
Very Noticable.
Decreases resistance.
Decreases stage speed.
Reduced transmittable.
High level.
Bonus
Causes the weight of the mob to
be even, meaning eating isn't
required anymore.
//////////////////////////////////////
*/
/datum/symptom/weight_even
name = "Weight Even"
stealth = -3
resistance = -2
stage_speed = -2
transmittable = -2
level = 4
/datum/symptom/weight_loss/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/M = A.affected_mob
switch(A.stage)
if(5)
M.overeatduration = 0
M.nutrition = 400
return

View File

@@ -5,7 +5,6 @@
if(!holder) return
if(holder == affected_mob)
stage_act()
if(affected_mob)
if(affected_mob.stat == DEAD)
if(prob(50))
@@ -35,26 +34,18 @@
spread_type = SPECIAL
cure = "Unknown"
cure_id = list("lexorin","toxin","gargleblaster")
cure_chance = 20
cure_chance = 50
affected_species = list("Human", "Monkey")
permeability_mod = 15//likely to infect
can_carry = 0
stage_prob = 3
var/gibbed = 0
stage_minimum_age = 300
/datum/disease/alien_embryo/stage_act()
..()
switch(stage)
if(2)
if(prob(1))
affected_mob.emote("sneeze")
if(prob(1))
affected_mob.emote("cough")
if(prob(1))
affected_mob << "\red Your throat feels sore."
if(prob(1))
affected_mob << "\red Mucous runs down the back of your throat."
if(3)
if(2, 3)
if(prob(1))
affected_mob.emote("sneeze")
if(prob(1))
@@ -83,22 +74,24 @@
affected_mob.updatehealth()
if(prob(50))
if(gibbed != 0) return 0
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
i++
var/list/candidates = get_alien_candidates()
var/picked = null
// To stop clientless larva, we will check that our host has a client
// if we find no ghosts to become the alien. If the host has a client
// he will become the alien but if he doesn't then we will set the stage
// to 2, so we don't do a process heavy check everytime.
if(candidates.len)
picked = pick(candidates)
else if(affected_mob.client)
picked = affected_mob.key
else
stage = 2 // Let's try again later.
return
var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc)
if(candidates.len)
new_xeno.key = pick(candidates)
else
new_xeno.key = affected_mob.key
new_xeno.key = picked
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention
affected_mob.gib()
src.cure(0)
@@ -111,15 +104,15 @@ Des: Removes all infection images from aliens and places an infection image on a
----------------------------------------*/
/datum/disease/alien_embryo/proc/RefreshInfectionImage()
spawn(0)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
for(var/image/I in alien.client.images)
if(I.icon_state == "infected")
del(I)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
for (var/mob/living/carbon/C in world)
for (var/mob/living/carbon/C in mob_list)
if(C)
if (C.status_flags & XENO_HOST)
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected")
@@ -132,7 +125,7 @@ Des: Checks if the passed mob (C) is infected with the alien egg, then gives eac
----------------------------------------*/
/datum/disease/alien_embryo/proc/AddInfectionImages(var/mob/living/carbon/C)
if (C)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
if (C.status_flags & XENO_HOST)
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected")
@@ -146,7 +139,7 @@ Des: Removes the alien infection image from all aliens in the world located in p
/datum/disease/alien_embryo/proc/RemoveInfectionImages(var/mob/living/carbon/C)
if (C)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
for(var/image/I in alien.client.images)
if(I.loc == C)

View File

@@ -19,18 +19,10 @@ var/global/datum/getrev/revdata = new("config/svndir.txt")
New(filename)
..()
if(!fexists(filename))
return abort()
var/text = file2text(file(filename))
if(!text)
diary << "Unable to get [filename] contents, aborting"
return abort()
var/list/CL = tg_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
var/list/Lines = file2list(filename)
if(!Lines.len) return abort()
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
continue
@@ -53,11 +45,24 @@ var/global/datum/getrev/revdata = new("config/svndir.txt")
revhref = value
if(svndirpath && fexists(svndirpath) && fexists("[svndirpath]/entries") && isfile(file("[svndirpath]/entries")))
var/list/filelist = dd_file2list("[svndirpath]/entries",null)
if(filelist.len < 4)
return abort()
revision = filelist[4]
commiter = filelist[12]
var/list/filelist = file2list("[svndirpath]/entries")
var/s_archive = "" //Stores the previous line so the revision owner can be assigned.
//This thing doesn't count blank lines, so doing filelist[4] isn't working.
for(var/s in filelist)
if(!commiter)
if(s == "has-props")//The line before this is the committer.
commiter = s_archive
if(!revision)
var/n = text2num(s)
if(isnum(n))
if(n > 5000 && n < 99999) //Do you think we'll still be up and running at r100000? :) ~Errorage
revision = s
if(revision && commiter)
break
s_archive = s
if(!revision)
abort()
diary << "Revision info loaded succesfully"
return
return abort()

View File

@@ -161,6 +161,7 @@
if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
@@ -168,6 +169,17 @@
else
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(destination.z > 7)
if(destination.z == 2) //centcomm z-level
if(istype(teleatom, /obj/mecha))
var/obj/mecha/MM = teleatom
MM.occupant << "\red <B>The mech would not survive the jump to a location so far away!</B>"
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)))
teleatom.visible_message("\red <B>The Bag of Holding bounces off of the portal!</B>")
return 0
if(destination.z > 7) //Away mission z-levels
return 0
return 1

View File

@@ -68,6 +68,7 @@ datum/mind
if(current) //remove ourself from our old body's mind variable
if(changeling)
current.remove_changeling_powers()
current.verbs -= /datum/changeling/proc/EvolutionMenu
current.mind = null
if(new_character.mind) //remove any mind currently in our new body's mind variable
new_character.mind.current = null
@@ -312,7 +313,7 @@ datum/mind
crystals = suplink.uses
if (suplink)
text += "|<a href='?src=\ref[src];common=takeuplink'>take</a>"
if (usr.client.holder.level >= 3)
if (usr.client.holder.rights & R_FUN)
text += ", <a href='?src=\ref[src];common=crystals'>[crystals]</a> crystals"
else
text += ", [crystals] crystals"
@@ -339,17 +340,7 @@ datum/mind
usr << browse(out, "window=edit_memory[src]")
Topic(href, href_list)
if(!usr || !usr.client)
return
if(!usr.client.holder)
message_admins("\red [key_name(usr)] tried to access [current]'s mind without authorization.")
log_admin("[key_name(usr)] tried to access [current]'s mind without authorization.")
return
if (!(usr.client.holder.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master")))
alert("You cannot perform this action. You must be of a higher administrative rank!")
return
if(!check_rights(R_ADMIN)) return
if (href_list["role_edit"])
var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs()
@@ -761,7 +752,7 @@ datum/mind
return
switch(href_list["monkey"])
if("healthy")
if (usr.client.holder.level >= 3)
if (usr.client.holder.rights & R_ADMIN)
var/mob/living/carbon/human/H = current
var/mob/living/carbon/monkey/M = current
if (istype(H))
@@ -776,7 +767,7 @@ datum/mind
D.cure(0)
sleep(0) //because deleting of virus is done through spawn(0)
if("infected")
if (usr.client.holder.level >= 3)
if (usr.client.holder.rights & R_ADMIN)
var/mob/living/carbon/human/H = current
var/mob/living/carbon/monkey/M = current
if (istype(H))
@@ -880,7 +871,7 @@ datum/mind
take_uplink()
memory = null//Remove any memory they may have had.
if("crystals")
if (usr.client.holder.level >= 3)
if (usr.client.holder.rights & R_FUN)
var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink()
var/crystals
if (suplink)

View File

@@ -64,6 +64,11 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
usr << "Not when you're incapacitated."
return 0
if(ishuman(usr) || ismonkey(usr))
if(istype(usr.wear_mask, /obj/item/clothing/mask/muzzle))
usr << "Mmmf mrrfff!"
return 0
if(clothes_req) //clothes check
if(!istype(usr, /mob/living/carbon/human))
usr << "You aren't a human, Why are you trying to cast a human spell, silly non-human? Casting human spells is for humans."
@@ -96,7 +101,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(prob(50))//Auto-mute? Fuck that noise
usr.say(invocation)
else
usr.say(dd_replacetext(invocation," ","`"))
usr.say(replacetext(invocation," ","`"))
if(usr.gender==MALE)
playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
else
@@ -105,7 +110,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(prob(50))
usr.whisper(invocation)
else
usr.whisper(dd_replacetext(invocation," ","`"))
usr.whisper(replacetext(invocation," ","`"))
/obj/effect/proc_holder/spell/New()
..()

View File

@@ -29,6 +29,11 @@
var/spawn_place = pick(targets)
if(summon_ignore_prev_spawn_points)
targets -= spawn_place
if(ispath(summoned_object_type,/turf))
var/turf/O = spawn_place
var/turf/N = summoned_object_type
O.ChangeTurf(N)
else
var/atom/summoned_object = new summoned_object_type(spawn_place)
for(var/varName in newVars)

View File

@@ -73,26 +73,5 @@
S.update_solar_exposure()
//returns the north-zero clockwise angle in degrees, given a direction
/proc/dir2angle(var/D)
switch(D)
if(1)
return 0
if(2)
return 180
if(4)
return 90
if(8)
return 270
if(5)
return 45
if(6)
return 135
if(9)
return 315
if(10)
return 225
else
return null

View File

@@ -16,6 +16,7 @@
var/access = null
var/hidden = 0
var/contraband = 0
var/group
/datum/supply_packs/New()
manifest += "<ul>"
@@ -100,7 +101,9 @@
/obj/item/weapon/reagent_containers/food/drinks/beer,
/obj/item/weapon/reagent_containers/food/drinks/beer,
/obj/item/weapon/reagent_containers/food/drinks/beer,
/obj/item/weapon/reagent_containers/food/drinks/beer)
/obj/item/weapon/reagent_containers/food/drinks/beer,
/obj/item/weapon/cigpacket/dromedaryco,
/obj/item/weapon/lipstick/random)
cost = 20
containertype = /obj/structure/closet/crate
containername = "Party equipment"
@@ -202,6 +205,13 @@
containertype = /obj/structure/largecrate/mule
containername = "MULEbot Crate"
/datum/supply_packs/lisa
name = "Corgi Crate"
contains = list()
cost = 50
containertype = /obj/structure/largecrate/lisa
containername = "Corgi Crate"
/datum/supply_packs/hydroponics // -- Skie
name = "Hydroponics Supply Crate"
contains = list(/obj/item/weapon/reagent_containers/spray/plantbgone,
@@ -331,9 +341,9 @@
contains = list(/obj/item/weapon/storage/belt/utility/full,
/obj/item/weapon/storage/belt/utility/full,
/obj/item/weapon/storage/belt/utility/full,
/obj/item/clothing/suit/hazardvest,
/obj/item/clothing/suit/hazardvest,
/obj/item/clothing/suit/hazardvest,
/obj/item/clothing/suit/storage/hazardvest,
/obj/item/clothing/suit/storage/hazardvest,
/obj/item/clothing/suit/storage/hazardvest,
/obj/item/clothing/head/welding,
/obj/item/clothing/head/welding,
/obj/item/clothing/head/hardhat)
@@ -597,14 +607,85 @@
manifest += "Contains any [num_contained] of:"
..()
/datum/supply_packs/artscrafts
name = "Arts and Crafts supplies"
contains = list("/obj/item/weapon/storage/crayonbox",
"/obj/item/weapon/camera_test",
"/obj/item/weapon/camera_film",
"/obj/item/weapon/camera_film",
"/obj/item/weapon/storage/photo_album",
"/obj/item/weapon/packageWrap",
"/obj/item/weapon/reagent_containers/glass/paint/red",
"/obj/item/weapon/reagent_containers/glass/paint/green",
"/obj/item/weapon/reagent_containers/glass/paint/blue",
"/obj/item/weapon/reagent_containers/glass/paint/yellow",
"/obj/item/weapon/reagent_containers/glass/paint/violet",
"/obj/item/weapon/reagent_containers/glass/paint/black",
"/obj/item/weapon/reagent_containers/glass/paint/white",
"/obj/item/weapon/reagent_containers/glass/paint/remover",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/contraband/poster")
cost = 5
containertype = "/obj/structure/closet/crate"
containername = "Arts and Crafts crate"
/datum/supply_packs/randomised/contraband
num_contained = 5
contains = list(/obj/item/weapon/contraband/poster,
/obj/item/weapon/cigpacket/dromedaryco,
/obj/item/weapon/lipstick/random)
contains = list("/obj/item/seeds/bloodtomatoseed",
"/obj/item/weapon/storage/pill_bottle/zoom",
"/obj/item/weapon/storage/pill_bottle/happy",
"/obj/item/weapon/reagent_containers/food/drinks/bottle/absinthe")
name = "Contraband crate"
cost = 30
containertype = /obj/structure/closet/crate
containername = "Contraband crate"
containername = "Unlabeled crate"
contraband = 1
/datum/supply_packs/boxes
name = "Empty Box supplies"
contains = list("/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",
"/obj/item/weapon/storage/box",)
cost = 5
containertype = "/obj/structure/closet/crate"
containername = "Empty Box crate"
/datum/supply_packs/surgery
name = "Surgery crate"
contains = list("/obj/item/weapon/cautery",
"/obj/item/weapon/surgicaldrill",
"/obj/item/clothing/mask/breath/medical",
"/obj/item/weapon/tank/anesthetic",
"/obj/item/weapon/FixOVein",
"/obj/item/weapon/hemostat",
"/obj/item/weapon/scalpel",
"/obj/item/weapon/bonegel",
"/obj/item/weapon/retractor",
"/obj/item/weapon/bonesetter",
"/obj/item/weapon/circular_saw")
cost = 25
containertype = "/obj/structure/closet/crate/secure"
containername = "Surgery crate"
access = access_medical
group = "Medical / Science"
/datum/supply_packs/sterile
name = "Sterile equipment crate"
contains = list("/obj/item/clothing/under/rank/medical/green",
"/obj/item/clothing/under/rank/medical/green",
"/obj/item/weapon/storage/stma_kit",
"/obj/item/weapon/storage/lglo_kit")
cost = 10
containertype = "/obj/structure/closet/crate"
containername = "Sterile equipment crate"
group = "Medical / Science"

View File

@@ -39,6 +39,10 @@
anchored = 1.0
unacidable = 1
/*
* This item is completely unused, but removing it will break something in R&D and Radio code causing PDA and Ninja code to fail on compile
*/
/obj/effect/datacore
name = "datacore"
var/medical[] = list()
@@ -56,6 +60,7 @@
var/list/civ = new()
var/list/bot = new()
var/list/misc = new()
var/list/isactive = new()
var/dat = {"
<head><style>
@@ -67,7 +72,7 @@
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: #DEF"]}
</style></head>
<table class="manifest">
<tr class='head'><th>Name</th><th>Rank</th></tr>
<tr class='head'><th>Name</th><th>Rank</th><th>Activity</th></tr>
"}
var/even = 0
@@ -77,6 +82,17 @@
var/rank = t.fields["rank"]
var/real_rank = t.fields["real_rank"]
var/active = 0
for(var/mob/M in player_list) if(M.name == name)
// For dead ones, have a chance to get their status wrong
if(M.stat == 2)
active = M.x % 2 // Should be good enough, avoids their status flipping constantly
break
else if(M.client && M.client.inactivity <= 10 * 60 * 10)
active = 1
break
isactive[name] = active ? "Active" : "SSD"
//world << "[name]: [rank]"
if(real_rank in command_positions)
@@ -104,52 +120,52 @@
misc[name] = rank
if(heads.len > 0)
dat += "<tr><th colspan=2>Heads</th></tr>"
dat += "<tr><th colspan=3>Heads</th></tr>"
for(name in heads)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[heads[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[heads[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
if(sec.len > 0)
dat += "<tr><th colspan=2>Security</th></tr>"
dat += "<tr><th colspan=3>Security</th></tr>"
for(name in sec)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sec[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sec[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
if(eng.len > 0)
dat += "<tr><th colspan=2>Engineering</th></tr>"
dat += "<tr><th colspan=3>Engineering</th></tr>"
for(name in eng)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[eng[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[eng[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
if(med.len > 0)
dat += "<tr><th colspan=2>Medical</th></tr>"
dat += "<tr><th colspan=3>Medical</th></tr>"
for(name in med)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[med[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[med[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
if(sci.len > 0)
dat += "<tr><th colspan=2>Science</th></tr>"
dat += "<tr><th colspan=3>Science</th></tr>"
for(name in sci)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sci[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sci[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
if(civ.len > 0)
dat += "<tr><th colspan=2>Civilian</th></tr>"
dat += "<tr><th colspan=3>Civilian</th></tr>"
for(name in civ)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[civ[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[civ[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
// in case somebody is insane and added them to the manifest, why not
if(bot.len > 0)
dat += "<tr><th colspan=2>Silicon</th></tr>"
dat += "<tr><th colspan=3>Silicon</th></tr>"
for(name in bot)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[bot[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[bot[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
// misc guys
if(misc.len > 0)
dat += "<tr><th colspan=2>Miscellaneous</th></tr>"
dat += "<tr><th colspan=3>Miscellaneous</th></tr>"
for(name in misc)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td></tr>"
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td><td>[isactive[name]]</td></tr>"
even = !even
dat += "</table>"
dat = dd_replacetext(dat, "\n", "") // so it can be placed on paper correctly
dat = dd_replacetext(dat, "\t", "")
dat = replacetext(dat, "\n", "") // so it can be placed on paper correctly
dat = replacetext(dat, "\t", "")
return dat
/obj/item/device/infra_sensor
@@ -161,6 +177,10 @@
item_state = "electronic"
m_amt = 150
origin_tech = "magnets=2"
/*
*
*/
/obj/effect/laser

View File

@@ -20,7 +20,7 @@
/obj/effect/landmark/costume/madscientist/New()
new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc)
new /obj/item/clothing/head/flatcap(src.loc)
new /obj/item/clothing/suit/labcoat/mad(src.loc)
new /obj/item/clothing/suit/storage/labcoat/mad(src.loc)
new /obj/item/clothing/glasses/gglasses(src.loc)
del(src)

View File

@@ -20,7 +20,7 @@
/obj/effect/landmark/costume/madscientist/New()
new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc)
new /obj/item/clothing/head/flatcap(src.loc)
new /obj/item/clothing/suit/labcoat/mad(src.loc)
new /obj/item/clothing/suit/storage/labcoat/mad(src.loc)
new /obj/item/clothing/glasses/gglasses(src.loc)
del(src)

View File

@@ -10,6 +10,23 @@
/obj/item/toy/prize
icon = 'icons/obj/toy.dmi'
icon_state = "ripleytoy"
var/cooldown = 0
//all credit to skasi for toy mech fun ideas
/obj/item/toy/prize/attack_self(mob/user as mob)
if(cooldown < world.time - 8)
user << "<span class='notice'>You play with [src].</span>"
playsound(user, 'sound/mecha/mechstep.ogg', 20, 1)
cooldown = world.time
/obj/item/toy/prize/attack_hand(mob/user as mob)
if(loc == user)
if(cooldown < world.time - 8)
user << "<span class='notice'>You play with [src].</span>"
playsound(user, 'sound/mecha/mechturn.ogg', 20, 1)
cooldown = world.time
return
..()
/obj/item/toy/prize/ripley
name = "toy ripley"
@@ -486,3 +503,16 @@
else
icon_state = "waterballoon-e"
item_state = "balloon-empty"
/obj/item/toy/katana
name = "replica katana"
desc = "Woefully underpowered in D20."
icon = 'icons/obj/weapons.dmi'
icon_state = "katana"
item_state = "katana"
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT | SLOT_BACK
force = 5
throwforce = 5
w_class = 3
attack_verb = list("attacked", "slashed", "stabbed", "sliced")

View File

@@ -25,7 +25,7 @@
var/vend_reply //Thank you for shopping!
var/last_reply = 0
var/last_slogan = 0 //When did we last pitch?
var/slogan_delay = 600 //How long until we can pitch again?
var/slogan_delay = 6000 //How long until we can pitch again?
var/icon_vend //Icon_state when vending!
var/icon_deny //Icon_state when vending!
//var/emagged = 0 //Ignores if somebody doesn't have card access to that machine.

View File

@@ -1,5 +1,3 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/item/weapon
name = "weapon"
icon = 'icons/obj/weapons.dmi'
@@ -37,14 +35,17 @@
m_amt = 1000
origin_tech = "materials=2"
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
IsShield()
return 1
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/melee/baton))
user.visible_message("<span class='warning'>[user] bashes their [src] with [W]!</span>")
if(cooldown < world.time - 25)
user.visible_message("<span class='warning'>[user] bashes [src] with [W]!</span>")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
else
..()
@@ -83,9 +84,6 @@
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
log_admin("ATTACK: [user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])")
msg_admin_attack("ATTACK: [user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") //BS12 EDIT ALG
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
@@ -306,7 +304,7 @@
/obj/item/weapon/spacecash/attack_self(var/mob/user)
interact(user)
/obj/item/weapon/spacecash/proc/interact(var/mob/user)
/obj/item/weapon/spacecash/interact(var/mob/user)
user.machine = src
@@ -1490,6 +1488,7 @@
m_amt = 12000
origin_tech = "materials=1"
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharp = 1
/obj/item/weapon/butch/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
@@ -1713,23 +1712,6 @@
var/cigarcount = 6
flags = ONBELT | TABLEPASS */
/obj/item/weapon/mousetrap
name = "mousetrap"
desc = "A handy little spring-loaded trap for catching pesty rodents."
icon = 'icons/obj/weapons.dmi'
icon_state = "mousetrap"
item_state = "mousetrap"
w_class = 1
force = null
throwforce = null
var/armed = 0
origin_tech = "combat=1"
/obj/item/weapon/mousetrap/armed
icon_state = "mousetraparmed"
armed = 1
/obj/item/weapon/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
name = "data cable"

View File

@@ -1,16 +0,0 @@
var/church_name = null
/proc/church_name()
if (church_name)
return church_name
var/name = ""
name += pick("Holy", "United", "First", "Second", "Last")
if (prob(20))
name += " Space"
name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses")
name += " of [religion_name()]"
return name

View File

@@ -1,30 +0,0 @@
var/command_name = null
/proc/command_name()
if (command_name)
return command_name
var/name = "Central Command"
/*
if (prob(10))
name += pick("Super", "Ultra")
name += " "
// Prefix
if (name)
name += pick("", "Central", "System", "Home", "Primary", "Alpha", "Friend", "Science", "Renegade")
else
name += pick("Central", "System", "Home", "Primary", "Alpha", "Friend", "Science", "Renegade")
if (name)
name += " "
// Suffix
name += pick("Federation", "Command", "Alliance", "Unity", "Empire", "Confederation", "Kingdom", "Monarchy", "Complex", "Protectorate", "Commonwealth", "Imperium", "Republic")
*/
command_name = name
return name
/proc/change_command_name(var/name)
command_name = name
return name

View File

@@ -39,37 +39,6 @@ var/DB_PORT = 3306 // This is the port your MySQL server is running on (3306 is
*/
DBConnection
New(dbi_handler,username,password_handler,cursor_handler)
src.dbi = dbi_handler
src.user = username
src.password = password_handler
src.default_cursor = cursor_handler
_db_con = _dm_db_new_con()
proc
Connect(dbi_handler=src.dbi,user_handler=src.user,password_handler=src.password,cursor_handler)
if(!sqllogging)
return 0
if(!src) return 0
cursor_handler = src.default_cursor
if(!cursor_handler) cursor_handler = Default_Cursor
return _dm_db_connect(_db_con,dbi_handler,user_handler,password_handler,cursor_handler,null)
Disconnect() return _dm_db_close(_db_con)
IsConnected()
if(!sqllogging) return 0
var/success = _dm_db_is_connected(_db_con)
return success
Quote(str) return _dm_db_quote(_db_con,str)
ErrorMsg() return _dm_db_error_msg(_db_con)
SelectDB(database_name,dbi)
if(IsConnected()) Disconnect()
//return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[DB_SERVER]:[DB_PORT]"]",user,password)
return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[sqladdress]:[sqlport]"]",user,password)
NewQuery(sql_query,cursor_handler=src.default_cursor) return new/DBQuery(sql_query,src,cursor_handler)
var/_db_con // This variable contains a reference to the actual database connection.
var/dbi // This variable is a string containing the DBI MySQL requires.
var/user // This variable contains the username data.
@@ -79,36 +48,76 @@ DBConnection
var/server = ""
var/port = 3306
DBQuery
New(sql_query,DBConnection/connection_handler,cursor_handler)
DBConnection/New(dbi_handler,username,password_handler,cursor_handler)
src.dbi = dbi_handler
src.user = username
src.password = password_handler
src.default_cursor = cursor_handler
_db_con = _dm_db_new_con()
DBConnection/proc/Connect(dbi_handler=src.dbi,user_handler=src.user,password_handler=src.password,cursor_handler)
if(!sqllogging)
return 0
if(!src) return 0
cursor_handler = src.default_cursor
if(!cursor_handler) cursor_handler = Default_Cursor
return _dm_db_connect(_db_con,dbi_handler,user_handler,password_handler,cursor_handler,null)
DBConnection/proc/Disconnect() return _dm_db_close(_db_con)
DBConnection/proc/IsConnected()
if(!sqllogging) return 0
var/success = _dm_db_is_connected(_db_con)
return success
DBConnection/proc/Quote(str) return _dm_db_quote(_db_con,str)
DBConnection/proc/ErrorMsg() return _dm_db_error_msg(_db_con)
DBConnection/proc/SelectDB(database_name,dbi)
if(IsConnected()) Disconnect()
//return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[DB_SERVER]:[DB_PORT]"]",user,password)
return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[sqladdress]:[sqlport]"]",user,password)
DBConnection/proc/NewQuery(sql_query,cursor_handler=src.default_cursor) return new/DBQuery(sql_query,src,cursor_handler)
DBQuery/New(sql_query,DBConnection/connection_handler,cursor_handler)
if(sql_query) src.sql = sql_query
if(connection_handler) src.db_connection = connection_handler
if(cursor_handler) src.default_cursor = cursor_handler
_db_query = _dm_db_new_query()
return ..()
proc
Connect(DBConnection/connection_handler) src.db_connection = connection_handler
DBQuery
var/sql // The sql query being executed.
var/default_cursor
var/list/columns //list of DB Columns populated by Columns()
var/list/conversions
var/list/item[0] //list of data values populated by NextRow()
Execute(sql_query=src.sql,cursor_handler=default_cursor)
var/DBConnection/db_connection
var/_db_query
DBQuery/proc/Connect(DBConnection/connection_handler) src.db_connection = connection_handler
DBQuery/proc/Execute(sql_query=src.sql,cursor_handler=default_cursor)
Close()
return _dm_db_execute(_db_query,sql_query,db_connection._db_con,cursor_handler,null)
NextRow() return _dm_db_next_row(_db_query,item,conversions)
DBQuery/proc/NextRow() return _dm_db_next_row(_db_query,item,conversions)
RowsAffected() return _dm_db_rows_affected(_db_query)
DBQuery/proc/RowsAffected() return _dm_db_rows_affected(_db_query)
RowCount() return _dm_db_row_count(_db_query)
DBQuery/proc/RowCount() return _dm_db_row_count(_db_query)
ErrorMsg() return _dm_db_error_msg(_db_query)
DBQuery/proc/ErrorMsg() return _dm_db_error_msg(_db_query)
Columns()
DBQuery/proc/Columns()
if(!columns)
columns = _dm_db_columns(_db_query,/DBColumn)
return columns
GetRowData()
DBQuery/proc/GetRowData()
var/list/columns = Columns()
var/list/results
if(columns.len)
@@ -119,29 +128,21 @@ DBQuery
results[C] = src.item[(cur_col.position+1)]
return results
Close()
DBQuery/proc/Close()
item.len = 0
columns = null
conversions = null
return _dm_db_close(_db_query)
Quote(str)
DBQuery/proc/Quote(str)
return db_connection.Quote(str)
SetConversion(column,conversion)
DBQuery/proc/SetConversion(column,conversion)
if(istext(column)) column = columns.Find(column)
if(!conversions) conversions = new/list(column)
else if(conversions.len < column) conversions.len = column
conversions[column] = conversion
var/sql // The sql query being executed.
var/default_cursor
var/list/columns //list of DB Columns populated by Columns()
var/list/conversions
var/list/item[0] //list of data values populated by NextRow()
var/DBConnection/db_connection
var/_db_query
DBColumn
var/name
@@ -152,7 +153,7 @@ DBColumn
var/length
var/max_length
New(name_handler,table_handler,position_handler,type_handler,flag_handler,length_handler,max_length_handler)
DBColumn/New(name_handler,table_handler,position_handler,type_handler,flag_handler,length_handler,max_length_handler)
src.name = name_handler
src.table = table_handler
src.position = position_handler
@@ -162,8 +163,8 @@ DBColumn
src.max_length = max_length_handler
return ..()
proc
SqlTypeName(type_handler=src.sql_type)
DBColumn/proc/SqlTypeName(type_handler=src.sql_type)
switch(type_handler)
if(TINYINT) return "TINYINT"
if(SMALLINT) return "SMALLINT"

View File

@@ -1,102 +0,0 @@
//*******************************
//
// Forum SQL Account Activation
//
//*******************************
//
// This module allows players to associate their BYOND keys with a specific forum username on the /tg/station forums.
// Its original intent is to disable posting for any non-associated forum accounts, and only allow players who've activated
// their account in-game to be able to post, hopefully reducing the spam the forum receives dramatically.
//
// This effect, of course, is not achieved entirely within BYOND. Some configuration on the forum-side is required as well.
// Targetted for phpBB3, not tested with earlier versions.
//
//
// Requires Dantom.DB library ( http://www.byond.com/developer/Dantom/DB )
//
// Written by TLE for /tg/station13
/proc/associate_key_with_forum(var/accname as text, var/playerkey as text)
var/DBConnection/dbcon = new()
var/uid
// TODO: Replace local vars with global var references
var/TG13user = forumsqllogin
var/TG13pass = forumsqlpass
var/TG13db = forumsqldb
var/TG13address = forumsqladdress
var/TG13port = forumsqlport
dbcon.Connect("dbi:mysql:[TG13db]:[TG13address]:[TG13port]","[TG13user]","[TG13pass]")
if(!dbcon.IsConnected())
src << "<font color=red><b>Server Connection Error</b> : Unable to open a connection with the forum database.</font>"
src << "<i>Potential causes for this problem: Incorrect login information, incorrect server connection information, the forum server is down or not responding to requests, your firewall is blocking outgoing SQL requests.</i>"
return
// Sanitize inputs to avoid SQL injection attacks
accname = sanitizeSQL(accname)
playerkey = sanitizeSQL(playerkey)
var/DBQuery/query = dbcon.NewQuery("SELECT user_id FROM [forumsqldb].phpbb_users WHERE username = '[accname]'")
query.Execute()
while(query.NextRow())
uid = query.item[1] // Find and save the account's user_id
if(!uid)
src << "Forum account not found!"
dbcon.Disconnect()
return
query = dbcon.NewQuery("SELECT pf_byondkey FROM [forumsqldb].phpbb_profile_fields_data WHERE user_id = '[uid]'")
if(!query.Execute())
src << "Unable to verify whether account is already associated with a BYOND key or not. This error shouldn't occur, please contact an administrator."
dbcon.Disconnect()
return
if(query.RowCount() > 0)
query.NextRow()
var/currentholder = query.item[1]
src << "Forum account already has a BYOND key associated with it. The current BYOND key associated with the account is \"[currentholder]\"."
src << "If this is not a key you own and you feel that someone has wrongfully authenticated your forum account please contact an administrator to have your account returned to you."
dbcon.Disconnect()
return
query = dbcon.NewQuery("SELECT * FROM [forumsqldb].phpbb_user_group WHERE user_id = '[uid]' AND group_id = '[forum_authenticated_group]'")
if(!query.Execute())
src << "Unable to verify whether account is already part of the authenticated group or not. This error should not occur, please contact an administrator."
dbcon.Disconnect()
return
if(query.RowCount() > 0)
src << "Forum account already belongs to the authenticated group. If this is your account and you did not authenticate it please contact an administrator to have your account returned to you."
dbcon.Disconnect()
return
query = dbcon.NewQuery("INSERT INTO [forumsqldb].phpbb_profile_fields_data (user_id, pf_byondkey) VALUES ('[uid]', '[playerkey]')") // Remember which key is associated with the account
if(!query.Execute())
src << "Unable to associate key with account. Authentication failed."
dbcon.Disconnect()
return
query = dbcon.NewQuery("UPDATE [forumsqldb].phpbb_user_group SET group_id = '[forum_authenticated_group]' WHERE user_id = '[uid]' AND group_id = '[forum_activated_group]'") // Replace 'registered_name Users' group with 'Activated Users'
if(!query.Execute())
src << "Unable to move account into authenticated group. This error shouldn't occur, contact an administrator for help. Authentication failed."
dbcon.Disconnect()
return
query = dbcon.NewQuery("UPDATE [forumsqldb].phpbb_users SET group_id = '[forum_authenticated_group]' WHERE user_id = '[uid]'") // Change 'default group' the the authenticated group. Not doing so was causing many authenticated accounts to retain their unauthenticated permissions, despite being succesfully authenticated.
if(!query.Execute())
src << "Unable to modify default group for account. This error should never occur, contact an administrator for help. Authentication failed."
else
src << "Authentication succeeded. You may now start posting on the <a href=http://nanotrasen.com/phpBB3/>tgstation forums</a>."
dbcon.Disconnect()
// This actually opens up a bunch of security holes to the forum DB. Given that it's not used much in the first place,
// I'm going to keep this commented out until we're sure everything's secure. -- TLE
/*
/client/verb/activate_forum_account(var/a as text)
set name = "Activate Forum Account"
set category = "Special Verbs"
set desc = "Associate a tgstation forum account with your BYOND key to enable posting."
associate_key_with_forum(a, src.key)
*/

View File

@@ -1,146 +0,0 @@
//Since it didn't really belong in any other category, I'm putting this here
//This is for procs to replace all the goddamn 'in world's that are chilling around the code
var/global/list/player_list = list() //List of all logged in players **with clients attached** (Based on mob reference)
var/global/list/admin_list = list() //List of all logged in admins (Based on mob reference)
var/global/list/mob_list = list() //List of all mobs, including clientless
var/global/list/living_mob_list = list() //List of all living mobs, including clientless
var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless
var/global/list/client_list = list() //List of all clients, based on ckey
var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time
var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name
var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessory/facial_hair indexed by name
var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions
var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
var/global/list/landmarks_list = list() //list of all landmarks created
//////////////////////////
/////Initial Building/////
//////////////////////////
//Realistically, these should never be run, but ideally, they should only be run once at round-start
/proc/make_datum_references_lists()
var/list/paths
//Hair - Initialise all /datum/sprite_accessory/hair into an list indexed by hair-style name
paths = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair
for(var/path in paths)
var/datum/sprite_accessory/hair/H = new path()
hair_styles_list[H.name] = H
//Facial Hair - Initialise all /datum/sprite_accessory/facial_hair into an list indexed by facialhair-style name
paths = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair
for(var/path in paths)
var/datum/sprite_accessory/facial_hair/H = new path()
facial_hair_styles_list[H.name] = H
proc/make_player_list()//Global proc that rebuilds the player list
for(var/mob/p in player_list)//Clears out everyone that logged out
if(!(p.client))
player_list -= p
for(var/mob/M in world)//Adds everyone that has logged in
if(M.client)
player_list += M
proc/make_admin_list()//Rebuild that shit to try and avoid issues with stealthmins
admin_list = list()
for(var/client/C in client_list)
if(C && C.holder)
admin_list += C
proc/make_mob_list()
for(var/mob/p in mob_list)
if(!p)//If it's a null reference, remove it
mob_list -= p
for(var/mob/M in world)
mob_list += M
proc/make_extra_mob_list()
for(var/mob/p in living_mob_list)
if(!p)
living_mob_list -= p
if(p.stat == DEAD)//Transfer
living_mob_list -= p
dead_mob_list += p
for(var/mob/p in dead_mob_list)
if(!p)
dead_mob_list -= p
if(p.stat != DEAD)
dead_mob_list -= p
living_mob_list += p
for(var/mob/M in world)
if(M.stat == DEAD)
living_mob_list += M
else
dead_mob_list += M
//Alright, this proc should NEVER be called in the code, ever. This is more of an 'oh god everything is broken'-emergency button.
proc/rebuild_mob_lists()
player_list = list()
admin_list = list()
mob_list = list()
living_mob_list = list()
dead_mob_list = list()
client_list = list()
for(var/mob/M in world)
mob_list += M
if(M.client)
player_list += M
if(M.stat != DEAD)
living_mob_list += M
else
dead_mob_list += M
for(var/client/C)
client_list += C.ckey
if(C.holder)
admin_list += C
proc/add_to_mob_list(var/mob/A)//Adds an individual mob
if(A)
mob_list |= A
if(istype(A,/mob/new_player))//New players are only on the mob list, but not the dead/living
return
else
if(A.stat == 2)
dead_mob_list |= A
if(A.stat != 2)
living_mob_list |= A
// if(A.client)
// player_list |= A
proc/remove_from_mob_list(var/mob/R)//Removes an individual mob
mob_list -= R
if(R.stat == 2)
dead_mob_list -= R
if(R.stat != 2)
living_mob_list -= R
// if(R.client)
// player_list -= R
proc/make_client_list()//Rebuilds client list
for(var/mob/c in client_list)
if(!c.client)
client_list -= c.ckey
for(var/mob/M in world)
if(M.client)
client_list += M.ckey
/*/obj/item/listdebug//Quick debugger for the global lists
icon = 'icons/obj/assemblies.dmi'
icon_state = "radio-igniter-tank"
/obj/item/listdebug/attack_self()
switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients"))
if("Players")
usr << dd_list2text(player_list,",")
if("Admins")
usr << dd_list2text(admin_list,",")
if("Mobs")
usr << dd_list2text(mob_list,",")
if("Living Mobs")
usr << dd_list2text(living_mob_list,",")
if("Dead Mobs")
usr << dd_list2text(dead_mob_list,",")
if("Clients")
usr << dd_list2text(client_list,",")*/

View File

@@ -1,266 +0,0 @@
/*
* Holds procs designed to change one type of value, into another.
* Contains:
* hex2num & num2hex
* text2list & list2text
* file2list
* angle2dir
* angle2text
* worldtime2text
*/
//Returns an integer given a hex input
/proc/hex2num(hex)
if (!( istext(hex) ))
return
var/num = 0
var/power = 0
var/i = null
i = length(hex)
while(i > 0)
var/char = copytext(hex, i, i + 1)
switch(char)
if("0")
//Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist
if("9", "8", "7", "6", "5", "4", "3", "2", "1")
num += text2num(char) * 16 ** power
if("a", "A")
num += 16 ** power * 10
if("b", "B")
num += 16 ** power * 11
if("c", "C")
num += 16 ** power * 12
if("d", "D")
num += 16 ** power * 13
if("e", "E")
num += 16 ** power * 14
if("f", "F")
num += 16 ** power * 15
else
return
power++
i--
return num
//Returns the hex value of a number given a value assumed to be a base-ten value
/proc/num2hex(num, placeholder)
if (placeholder == null)
placeholder = 2
if (!( isnum(num) ))
return
if (!( num ))
return "0"
var/hex = ""
var/i = 0
while(16 ** i < num)
i++
var/power = null
power = i - 1
while(power >= 0)
var/val = round(num / 16 ** power)
num -= val * 16 ** power
switch(val)
if(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0)
hex += text("[]", val)
if(10.0)
hex += "A"
if(11.0)
hex += "B"
if(12.0)
hex += "C"
if(13.0)
hex += "D"
if(14.0)
hex += "E"
if(15.0)
hex += "F"
else
power--
while(length(hex) < placeholder)
hex = text("0[]", hex)
return hex
//Text 'text' will be added as elements of a list when seperated by 'seperator'
/proc/dd_text2list(text, separator, var/list/withinList)
var/textlength = length(text)
var/separatorlength = length(separator)
if(withinList && !withinList.len) withinList = null
var/list/textList = new()
var/searchPosition = 1
var/findPosition = 1
var/loops = 999
while(loops) //Byond will think 1000+ iterations of a loop is an infinite loop
findPosition = findtext(text, separator, searchPosition, 0)
var/buggyText = copytext(text, searchPosition, findPosition)
if(!withinList || (buggyText in withinList)) textList += "[buggyText]"
if(!findPosition) return textList
searchPosition = findPosition + separatorlength
if(searchPosition > textlength)
textList += ""
return textList
loops--
return
//Text 'text' will be added as elements of a list when seperated by 'seperator'. The separator is case sensitive.
/proc/dd_text2list_case(text, separator, var/list/withinList)
var/textlength = length(text)
var/separatorlength = length(separator)
if(withinList && !withinList.len) withinList = null
var/list/textList = new()
var/searchPosition = 1
var/findPosition = 1
var/loops = 999
while(loops) //Byond will think 1000+ iterations of a loop is an infinite loop
findPosition = findtextEx(text, separator, searchPosition, 0)
var/buggyText = copytext(text, searchPosition, findPosition)
if(!withinList || (buggyText in withinList)) textList += "[buggyText]"
if(!findPosition) return textList
searchPosition = findPosition + separatorlength
if(searchPosition > textlength)
textList += ""
return textList
loops--
return
//Attaches each element of a list to a single string seperated by 'seperator'.
/proc/dd_list2text(var/list/the_list, separator)
var/total = the_list.len
if(!total)
return
var/count = 2
var/newText = "[the_list[1]]"
while(count <= total)
if(separator)
newText += separator
newText += "[the_list[count]]"
count++
return newText
//tg_text2list is faster then dd_text2list
//not case sensitive version
proc/tg_text2list(string, separator=",")
if(!string)
return
var/list/output = new
var/seplength = length(separator)
var/strlength = length(string)
var/prev = 1
var/index
do
index = findtext(string, separator, prev, 0)
output += copytext(string, prev, index)
if(!index)
break
prev = index+seplength
if(prev>strlength)
break
while(index)
return output
//case sensitive version
proc/tg_text2list_case(string, separator=",")
if(!string)
return
var/list/output = new
var/seplength = length(separator)
var/strlength = length(string)
var/prev = 1
var/index
do
index = findtextEx(string, separator, prev, 0)
output += copytext(string, prev, index)
if(!index)
break
prev = index+seplength
if(prev>strlength)
break
while(index)
return output
//slower then dd_list2text, but correctly processes associative lists.
proc/tg_list2text(list/list, glue=",")
if(!istype(list) || !list.len)
return
var/output
for(var/i=1 to list.len)
output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]")
return output
//Gets a file and adds its contents to a list.
/proc/dd_file2list(file_path, separator)
var/file
if(separator == null)
separator = "\n"
if(isfile(file_path))
file = file_path
else
file = file(file_path)
return dd_text2list(file2text(file), separator)
//Turns a direction into text
/proc/dir2text(direction)
switch(direction)
if(1.0)
return "north"
if(2.0)
return "south"
if(4.0)
return "east"
if(8.0)
return "west"
if(5.0)
return "northeast"
if(6.0)
return "southeast"
if(9.0)
return "northwest"
if(10.0)
return "southwest"
else
return
//Turns text into proper directions
/proc/text2dir(direction)
switch(uppertext(direction))
if("NORTH")
return 1
if("SOUTH")
return 2
if("EAST")
return 4
if("WEST")
return 8
if("NORTHEAST")
return 5
if("NORTHWEST")
return 9
if("SOUTHEAST")
return 6
if("SOUTHWEST")
return 10
else
return
//Converts an angle (degrees) into an ss13 direction
/proc/angle2dir(var/degree)
degree = ((degree+22.5)%365)
if(degree < 45) return NORTH
if(degree < 90) return NORTH|EAST
if(degree < 135) return EAST
if(degree < 180) return SOUTH|EAST
if(degree < 225) return SOUTH
if(degree < 270) return SOUTH|WEST
if(degree < 315) return WEST
return NORTH|WEST
//Returns the angle in english
/proc/angle2text(var/degree)
return dir2text(angle2dir(degree))
//Returns the world time in english
proc/worldtime2text(var/time = 0)
if(time == 0)
time = world.time
return "[round(time / 36000)+12]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]"

View File

@@ -1,214 +0,0 @@
/*
IconProcs README
A BYOND library for manipulating icons and colors
by Lummox JR
version 1.0
The IconProcs library was made to make a lot of common icon operations much easier. BYOND's icon manipulation
routines are very capable but some of the advanced capabilities like using alpha transparency can be unintuitive to beginners.
CHANGING ICONS
Several new procs have been added to the /icon datum to simplify working with icons. To use them,
remember you first need to setup an /icon var like so:
var/icon/my_icon = new('iconfile.dmi')
icon/ChangeOpacity(amount = 1)
A very common operation in DM is to try to make an icon more or less transparent. Making an icon more
transparent is usually much easier than making it less so, however. This proc basically is a frontend
for MapColors() which can change opacity any way you like, in much the same way that SetIntensity()
can make an icon lighter or darker. If amount is 0.5, the opacity of the icon will be cut in half.
If amount is 2, opacity is doubled and anything more than half-opaque will become fully opaque.
icon/GrayScale()
Converts the icon to grayscale instead of a fully colored icon. Alpha values are left intact.
icon/ColorTone(tone)
Similar to GrayScale(), this proc converts the icon to a range of black -> tone -> white, where tone is an
RGB color (its alpha is ignored). This can be used to create a sepia tone or similar effect.
See also the global ColorTone() proc.
icon/MinColors(icon)
The icon is blended with a second icon where the minimum of each RGB pixel is the result.
Transparency may increase, as if the icons were blended with ICON_ADD. You may supply a color in place of an icon.
icon/MaxColors(icon)
The icon is blended with a second icon where the maximum of each RGB pixel is the result.
Opacity may increase, as if the icons were blended with ICON_OR. You may supply a color in place of an icon.
icon/Opaque(background = "#000000")
All alpha values are set to 255 throughout the icon. Transparent pixels become black, or whatever background color you specify.
icon/BecomeAlphaMask()
You can convert a simple grayscale icon into an alpha mask to use with other icons very easily with this proc.
The black parts become transparent, the white parts stay white, and anything in between becomes a translucent shade of white.
icon/AddAlphaMask(mask)
The alpha values of the mask icon will be blended with the current icon. Anywhere the mask is opaque,
the current icon is untouched. Anywhere the mask is transparent, the current icon becomes transparent.
Where the mask is translucent, the current icon becomes more transparent.
icon/UseAlphaMask(mask, mode)
Sometimes you may want to take the alpha values from one icon and use them on a different icon.
This proc will do that. Just supply the icon whose alpha mask you want to use, and src will change
so it has the same colors as before but uses the mask for opacity.
COLOR MANAGEMENT AND HSV
RGB isn't the only way to represent color. Sometimes it's more useful to work with a model called HSV, which stands for hue, saturation, and value.
* The hue of a color describes where it is along the color wheel. It goes from red to yellow to green to
cyan to blue to magenta and back to red.
* The saturation of a color is how much color is in it. A color with low saturation will be more gray,
and with no saturation at all it is a shade of gray.
* The value of a color determines how bright it is. A high-value color is vivid, moderate value is dark,
and no value at all is black.
Just as BYOND uses "#rrggbb" to represent RGB values, a similar format is used for HSV: "#hhhssvv". The hue is three
hex digits because it ranges from 0 to 0x5FF.
* 0 to 0xFF - red to yellow
* 0x100 to 0x1FF - yellow to green
* 0x200 to 0x2FF - green to cyan
* 0x300 to 0x3FF - cyan to blue
* 0x400 to 0x4FF - blue to magenta
* 0x500 to 0x5FF - magenta to red
Knowing this, you can figure out that red is "#000ffff" in HSV format, which is hue 0 (red), saturation 255 (as colorful as possible),
value 255 (as bright as possible). Green is "#200ffff" and blue is "#400ffff".
More than one HSV color can match the same RGB color.
Here are some procs you can use for color management:
ReadRGB(rgb)
Takes an RGB string like "#ffaa55" and converts it to a list such as list(255,170,85). If an RGBA format is used
that includes alpha, the list will have a fourth item for the alpha value.
hsv(hue, sat, val, apha)
Counterpart to rgb(), this takes the values you input and converts them to a string in "#hhhssvv" or "#hhhssvvaa"
format. Alpha is not included in the result if null.
ReadHSV(rgb)
Takes an HSV string like "#100FF80" and converts it to a list such as list(256,255,128). If an HSVA format is used that
includes alpha, the list will have a fourth item for the alpha value.
RGBtoHSV(rgb)
Takes an RGB or RGBA string like "#ffaa55" and converts it into an HSV or HSVA color such as "#080aaff".
HSVtoRGB(hsv)
Takes an HSV or HSVA string like "#080aaff" and converts it into an RGB or RGBA color such as "#ff55aa".
BlendRGB(rgb1, rgb2, amount)
Blends between two RGB or RGBA colors using regular RGB blending. If amount is 0, the first color is the result;
if 1, the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
The returned value is an RGB or RGBA color.
BlendHSV(hsv1, hsv2, amount)
Blends between two HSV or HSVA colors using HSV blending, which tends to produce nicer results than regular RGB
blending because the brightness of the color is left intact. If amount is 0, the first color is the result; if 1,
the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
The returned value is an HSV or HSVA color.
BlendRGBasHSV(rgb1, rgb2, amount)
Like BlendHSV(), but the colors used and the return value are RGB or RGBA colors. The blending is done in HSV form.
HueToAngle(hue)
Converts a hue to an angle range of 0 to 360. Angle 0 is red, 120 is green, and 240 is blue.
AngleToHue(hue)
Converts an angle to a hue in the valid range.
RotateHue(hsv, angle)
Takes an HSV or HSVA value and rotates the hue forward through red, green, and blue by an angle from 0 to 360.
(Rotating red by 60<36> produces yellow.) The result is another HSV or HSVA color with the same saturation and value
as the original, but a different hue.
GrayScale(rgb)
Takes an RGB or RGBA color and converts it to grayscale. Returns an RGB or RGBA string.
ColorTone(rgb, tone)
Similar to GrayScale(), this proc converts an RGB or RGBA color to a range of black -> tone -> white instead of
using strict shades of gray. The tone value is an RGB color; any alpha value is ignored.
*/
/*
Get Flat Icon DEMO by DarkCampainger
This is a test for the get flat icon proc, modified approprietly for icons and their states.
Probably not a good idea to run this unless you want to see how the proc works in detail.
mob
icon = 'old_or_unused.dmi'
icon_state = "green"
Login()
// Testing image underlays
underlays += image(icon='old_or_unused.dmi',icon_state="red")
underlays += image(icon='old_or_unused.dmi',icon_state="red", pixel_x = 32)
underlays += image(icon='old_or_unused.dmi',icon_state="red", pixel_x = -32)
// Testing image overlays
overlays += image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = -32)
overlays += image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = 32)
overlays += image(icon='old_or_unused.dmi',icon_state="green", pixel_x = -32, pixel_y = -32)
// Testing icon file overlays (defaults to mob's state)
overlays += '_flat_demoIcons2.dmi'
// Testing icon_state overlays (defaults to mob's icon)
overlays += "white"
// Testing dynamic icon overlays
var/icon/I = icon('old_or_unused.dmi', icon_state="aqua")
I.Shift(NORTH,16,1)
overlays+=I
// Testing dynamic image overlays
I=image(icon=I,pixel_x = -32, pixel_y = 32)
overlays+=I
// Testing object types (and layers)
overlays+=/obj/effect/overlayTest
loc = locate (10,10,1)
verb
Browse_Icon()
set name = "1. Browse Icon"
// Give it a name for the cache
var/iconName = "[ckey(src.name)]_flattened.dmi"
// Send the icon to src's local cache
src<<browse_rsc(getFlatIcon(src), iconName)
// Display the icon in their browser
src<<browse("<body bgcolor='#000000'><p><img src='[iconName]'></p></body>")
Output_Icon()
set name = "2. Output Icon"
src<<"Icon is: \icon[getFlatIcon(src)]"
Label_Icon()
set name = "3. Label Icon"
// Give it a name for the cache
var/iconName = "[ckey(src.name)]_flattened.dmi"
// Copy the file to the rsc manually
var/icon/I = fcopy_rsc(getFlatIcon(src))
// Send the icon to src's local cache
src<<browse_rsc(I, iconName)
// Update the label to show it
winset(src,"imageLabel","image='\ref[I]'");
Add_Overlay()
set name = "4. Add Overlay"
overlays += image(icon='old_or_unused.dmi',icon_state="yellow",pixel_x = rand(-64,32), pixel_y = rand(-64,32))
Stress_Test()
set name = "5. Stress Test"
for(var/i = 0 to 1000)
// The third parameter forces it to generate a new one, even if it's already cached
getFlatIcon(src,0,2)
if(prob(5))
Add_Overlay()
Browse_Icon()
Cache_Test()
set name = "6. Cache Test"
for(var/i = 0 to 1000)
getFlatIcon(src)
Browse_Icon()
obj/effect/overlayTest
icon = 'old_or_unused.dmi'
icon_state = "blue"
pixel_x = -24
pixel_y = 24
layer = TURF_LAYER // Should appear below the rest of the overlays
world
view = "7x7"
maxx = 20
maxy = 20
maxz = 1
*/

View File

@@ -1,11 +0,0 @@
var/religion_name = null
/proc/religion_name()
if (religion_name)
return religion_name
var/name = ""
name += pick("bee", "science", "edu", "captain", "assistant", "monkey", "alien", "space", "unit", "sprocket", "gadget", "bomb", "revolution", "beyond", "station", "goon", "robot", "ivor", "hobnob")
name += pick("ism", "ia", "ology", "istism", "ites", "ick", "ian", "ity")
return capitalize(name)

View File

@@ -0,0 +1,168 @@
/* sd_Alert library
by Shadowdarke (shadowdarke@byond.com)
sd_Alert() is a powerful and flexible alternative to the built in BYOND
alert() proc. sd_Alert offers timed popups, unlimited buttons, custom
appearance, and even the option to popup without stealing keyboard focus
from the map or command line.
Please see demo.dm for detailed examples.
FORMAT
sd_Alert(who, message, title, buttons, default, duration, unfocus, \
size, table, style, tag, select, flags)
ARGUMENTS
who - the client or mob to display the alert to.
message - text message to display
title - title of the alert box
buttons - list of buttons
Default Value: list("Ok")
default - default button selestion
Default Value: the first button in the list
duration - the number of ticks before this alert expires. If not
set, the alert lasts until a button is clicked.
Default Value: 0 (unlimited)
unfocus - if this value is set, the popup will not steal keyboard
focus from the map or command line.
Default Value: 1 (do not take focus)
size - size of the popup window in px
Default Value: "300x200"
table - optional parameters for the HTML table in the alert
Default Value: "width=100% height=100%" (fill the window)
style - optional style sheet information
tag - lets you specify a certain tag for this sd_Alert so you may manipulate it
externally. (i.e. force the alert to close, change options and redisplay,
reuse the same window, etc.)
select - if set, the buttons will be replaced with a selection box with a number of
lines displayed equal to this value.
Default value: 0 (use buttons)
flags - optional flags effecting the alert display. These flags may be ORed (|)
together for multiple effects.
SD_ALERT_SCROLL = display a scrollbar
SD_ALERT_SELECT_MULTI = forces selection box display (instead of
buttons) allows the user to select multiple
choices.
SD_ALERT_LINKS = display each choice as a plain text link.
Any selection box style overrides this flag.
SD_ALERT_NOVALIDATE = don't validate responses
Default value: SD_ALERT_SCROLL
(button display with scroll bar, validate responses)
RETURNS
The text of the selected button, or null if the alert duration expired
without a button click.
Version 1 changes (from version 0):
* Added the tag, select, and flags arguments, thanks to several suggestions from Foomer.
* Split the sd_Alert/Alert() proc into New(), Display(), and Response() to allow more
customization by developers. Primarily developers would want to use Display() to change
the display of active tagged windows
*/
#define SD_ALERT_SCROLL 1
#define SD_ALERT_SELECT_MULTI 2
#define SD_ALERT_LINKS 4
#define SD_ALERT_NOVALIDATE 8
proc/sd_Alert(client/who, message, title, buttons = list("Ok"),\
default, duration = 0, unfocus = 1, size = "300x200", \
table = "width=100% height=100%", style, tag, select, flags = SD_ALERT_SCROLL)
if(ismob(who))
var/mob/M = who
who = M.client
if(!istype(who)) CRASH("sd_Alert: Invalid target:[who] (\ref[who])")
var/sd_alert/T = locate(tag)
if(T)
if(istype(T)) del(T)
else CRASH("sd_Alert: tag \"[tag]\" is already in use by datum '[T]' (type: [T.type])")
T = new(who, tag)
if(duration)
spawn(duration)
if(T) del(T)
return
T.Display(message,title,buttons,default,unfocus,size,table,style,select,flags)
. = T.Response()
sd_alert
var
client/target
response
list/validation
Del()
target << browse(null,"window=\ref[src]")
..()
New(who, tag)
..()
target = who
src.tag = tag
Topic(href,params[])
if(usr.client != target) return
response = params["clk"]
proc/Display(message,title,list/buttons,default,unfocus,size,table,style,select,flags)
if(unfocus) spawn() target << browse(null,null)
if(istext(buttons)) buttons = list(buttons)
if(!default) default = buttons[1]
if(!(flags & SD_ALERT_NOVALIDATE)) validation = buttons.Copy()
var/html = {"<head><title>[title]</title>[style]<script>\
function c(x) {document.location.href='BYOND://?src=\ref[src];'+x;}\
</script></head><body onLoad="fcs.focus();"\
[(flags&SD_ALERT_SCROLL)?"":" scroll=no"]><table [table]><tr>\
<td>[message]</td></tr><tr><th>"}
if(select || (flags & SD_ALERT_SELECT_MULTI)) // select style choices
html += {"<FORM ID=fcs ACTION='BYOND://?' METHOD=GET>\
<INPUT TYPE=HIDDEN NAME=src VALUE='\ref[src]'>
<SELECT NAME=clk SIZE=[select]\
[(flags & SD_ALERT_SELECT_MULTI)?" MULTIPLE":""]>"}
for(var/b in buttons)
html += "<OPTION[(b == default)?" SELECTED":""]>\
[html_encode(b)]</OPTION>"
html += "</SELECT><BR><INPUT TYPE=SUBMIT VALUE=Submit></FORM>"
else if(flags & SD_ALERT_LINKS) // text link style
for(var/b in buttons)
var/list/L = list()
L["clk"] = b
var/html_string=list2params(L)
var/focus
if(b == default) focus = " ID=fcs"
html += "<A[focus] href=# onClick=\"c('[html_string]')\">[html_encode(b)]</A>\
<BR>"
else // button style choices
for(var/b in buttons)
var/list/L = list()
L["clk"] = b
var/html_string=list2params(L)
var/focus
if(b == default) focus = " ID=fcs"
html += "<INPUT[focus] TYPE=button VALUE='[html_encode(b)]' \
onClick=\"c('[html_string]')\"> "
html += "</th></tr></table></body>"
target << browse(html,"window=\ref[src];size=[size];can_close=0")
proc/Response()
var/validated
while(!validated)
while(target && !response) // wait for a response
sleep(2)
if(response && validation)
if(istype(response, /list))
var/list/L = response - validation
if(L.len) response = null
else validated = 1
else if(response in validation) validated = 1
else response=null
else validated = 1
spawn(2) del(src)
return response

View File

@@ -1,68 +0,0 @@
/proc/station_name()
if (station_name)
return station_name
var/random = rand(1,5)
var/name = ""
//Rare: Pre-Prefix
if (prob(10))
name = pick("Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", "Automated", "Experimental", "Augmented")
station_name = name + " "
// Prefix
switch(Holiday)
//get normal name
if(null,"",0)
name = pick("", "Stanford", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist","Corrogated","Skeleton","Race", "Fatguy", "Gentleman", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Spess", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot", "Hats", "Pizza")
if(name)
station_name += name + " "
//For special days like christmas, easter, new-years etc ~Carn
if("Friday the 13th")
name = pick("Mike","Friday","Evil","Myers","Murder","Deathly","Stabby")
station_name += name + " "
random = 13
else
//get the first word of the Holiday and use that
var/i = findtext(Holiday," ",1,0)
name = copytext(Holiday,1,i)
station_name += name + " "
// Suffix
name = pick("Station", "Fortress", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard","Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", "Complex", "Base", "Facility", "Depot", "Outpost", "Installation", "Drydock", "Observatory", "Array", "Relay", "Monitor", "Platform", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker", "Roost", "Fat Camp")
station_name += name + " "
// ID Number
switch(random)
if(1)
station_name += "[rand(1, 99)]"
if(2)
station_name += pick("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega")
if(3)
station_name += pick("II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX")
if(4)
station_name += pick("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu")
if(5)
station_name += pick("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
if(13)
station_name += pick("13","XIII","Thirteen")
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = station_name
return station_name
/proc/world_name(var/name)
station_name = name
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = name
return name

View File

@@ -5,37 +5,30 @@ proc/sql_poll_players()
for(var/mob/M in player_list)
if(M.client)
playercount += 1
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
establish_db_connection()
if(!dbcon.IsConnected())
log_game("SQL ERROR during player polling. Failed to connect.")
else
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO population (playercount, time) VALUES ([playercount], '[sqltime]')")
var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (playercount, time) VALUES ([playercount], '[sqltime]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during player polling. Error : \[[err]\]\n")
dbcon.Disconnect()
proc/sql_poll_admins()
if(!sqllogging)
return
var/admincount = 0
for (var/client/C in admin_list)
if(C)
admincount += 1
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
var/admincount = admins.len
establish_db_connection()
if(!dbcon.IsConnected())
log_game("SQL ERROR during admin polling. Failed to connect.")
else
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO population (admincount, time) VALUES ([admincount], '[sqltime]')")
var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (admincount, time) VALUES ([admincount], '[sqltime]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during admin polling. Error : \[[err]\]\n")
dbcon.Disconnect()
proc/sql_report_round_start()
// TODO
@@ -71,8 +64,7 @@ proc/sql_report_death(var/mob/living/carbon/human/H)
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/coord = "[H.x], [H.y], [H.z]"
//world << "INSERT INTO death (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.bruteloss], [H.getFireLoss()], [H.brainloss], [H.getOxyLoss()])"
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
establish_db_connection()
if(!dbcon.IsConnected())
log_game("SQL ERROR during death reporting. Failed to connect.")
else
@@ -80,7 +72,6 @@ proc/sql_report_death(var/mob/living/carbon/human/H)
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during death reporting. Error : \[[err]\]\n")
dbcon.Disconnect()
proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H)
@@ -108,8 +99,7 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H)
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/coord = "[H.x], [H.y], [H.z]"
//world << "INSERT INTO death (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.bruteloss], [H.getFireLoss()], [H.brainloss], [H.getOxyLoss()])"
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
establish_db_connection()
if(!dbcon.IsConnected())
log_game("SQL ERROR during death reporting. Failed to connect.")
else
@@ -117,7 +107,6 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H)
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during death reporting. Error : \[[err]\]\n")
dbcon.Disconnect()
proc/statistic_cycle()
@@ -142,8 +131,7 @@ proc/sql_commit_feedback()
log_game("Round ended without any feedback being generated. No feedback was sent to the database.")
return
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
establish_db_connection()
if(!dbcon.IsConnected())
log_game("SQL ERROR during feedback reporting. Failed to connect.")
else
@@ -172,27 +160,3 @@ proc/sql_commit_feedback()
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during death reporting. Error : \[[err]\]\n")
dbcon.Disconnect()
proc/debug_sql_commit_feedback()
if(!blackbox)
world << "Round ended without a blackbox recorder. No feedback was sent to the database."
return
//content is a list of lists. Each item in the list is a list with two fields, a variable name and a value. Items MUST only have these two values.
var/list/datum/feedback_variable/content = blackbox.get_round_feedback()
if(!content)
world << "Round ended without any feedback being generated. No feedback was sent to the database."
return
for(var/datum/feedback_variable/item in content)
var/variable = item.get_variable()
var/value = item.get_value()
world << "INSERT INTO erro_feedback (id, roundid, time, variable, value) VALUES (null, ABC, Now(), '[variable]', '[value]')"
world << "end"

View File

@@ -49,6 +49,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
// (original area before splitting due to sd_DAL)
var/list/related // the other areas of the same type as this
// var/list/lights // list of all lights on this area
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/air_doors_activated = 0
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
@@ -967,6 +969,17 @@ proc/process_ghost_teleport_locs()
icon_state = "medbay"
music = 'sound/ambience/signal.ogg'
//Medbay is a large area, these additional areas help level out APC load.
/area/medical/medbay2
name = "Medbay"
icon_state = "medbay2"
music = 'sound/ambience/signal.ogg'
/area/medical/medbay3
name = "Medbay"
icon_state = "medbay3"
music = 'sound/ambience/signal.ogg'
/area/medical/patients_rooms
name = "\improper Patient's Rooms"
icon_state = "patients"
@@ -1008,9 +1021,13 @@ proc/process_ghost_teleport_locs()
icon_state = "exam_room"
/area/medical/genetics
name = "Genetics"
name = "Genetics Lab"
icon_state = "genetics"
/area/medical/genetics_cloning
name = "Cloning Lab"
icon_state = "cloning"
/area/medical/sleeper
name = "\improper Medical Sleeper Room"
icon_state = "exam_room"

View File

@@ -10,7 +10,7 @@
/area/New()
icon_state = ""
layer = 10
master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references src.loc.loc.master ~Carn
master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references loc.loc.master ~Carn
uid = ++global_uid
related = list(src)
@@ -62,43 +62,43 @@
return
/area/proc/atmosalert(danger_level)
// if(src.type==/area) //No atmos alarms in space
// if(type==/area) //No atmos alarms in space
// return 0 //redudant
if(danger_level != src.atmosalm)
//src.updateicon()
//src.mouse_opacity = 0
if(danger_level != atmosalm)
//updateicon()
//mouse_opacity = 0
if (danger_level==2)
var/list/cameras = list()
for(var/area/RA in src.related)
//src.updateicon()
for(var/area/RA in related)
//updateicon()
for(var/obj/machinery/camera/C in RA)
cameras += C
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in world)
a.triggerAlarm("Atmosphere", src, cameras, src)
else if (src.atmosalm == 2)
else if (atmosalm == 2)
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in world)
a.cancelAlarm("Atmosphere", src, src)
src.atmosalm = danger_level
atmosalm = danger_level
return 1
return 0
/area/proc/firealert()
if(src.name == "Space") //no fire alarms in space
if(name == "Space") //no fire alarms in space
return
if (!( src.fire ))
src.fire = 1
src.updateicon()
src.mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in src)
if( !fire )
fire = 1
updateicon()
mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
if(D.operating)
D.nextstate = CLOSED
else if(!D.density)
spawn(0)
spawn()
D.close()
var/list/cameras = list()
for (var/obj/machinery/camera/C in src)
@@ -107,14 +107,13 @@
aiPlayer.triggerAlarm("Fire", src, cameras, src)
for (var/obj/machinery/computer/station_alert/a in world)
a.triggerAlarm("Fire", src, cameras, src)
return
/area/proc/firereset()
if (src.fire)
src.fire = 0
src.mouse_opacity = 0
src.updateicon()
for(var/obj/machinery/door/firedoor/D in src)
if (fire)
fire = 0
mouse_opacity = 0
updateicon()
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
if(D.operating)
D.nextstate = OPEN
@@ -125,7 +124,6 @@
aiPlayer.cancelAlarm("Fire", src, src)
for (var/obj/machinery/computer/station_alert/a in world)
a.cancelAlarm("Fire", src, src)
return
/area/proc/readyalert()
if(name == "Space")
@@ -142,19 +140,19 @@
return
/area/proc/partyalert()
if(src.name == "Space") //no parties in space!!!
if(name == "Space") //no parties in space!!!
return
if (!( src.party ))
src.party = 1
src.updateicon()
src.mouse_opacity = 0
if (!( party ))
party = 1
updateicon()
mouse_opacity = 0
return
/area/proc/partyreset()
if (src.party)
src.party = 0
src.mouse_opacity = 0
src.updateicon()
if (party)
party = 0
mouse_opacity = 0
updateicon()
for(var/obj/machinery/door/firedoor/D in src)
if(!D.blocked)
if(D.operating)
@@ -273,7 +271,7 @@
A:client:ambience_playing = 1
A << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
switch(src.name)
switch(name)
if ("Chapel") sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg')
if ("Morgue") sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/title2.ogg')
if ("Space") sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg',)

View File

@@ -24,13 +24,9 @@
/atom/proc/throw_impact(atom/hit_atom)
if(istype(hit_atom,/mob/living))
var/mob/living/M = hit_atom
M.visible_message("\red [hit_atom] has been hit by [src].")
if(isobj(src))//Hate typecheckin for a child object but this is just fixing crap another guy broke so if someone wants to put the time in and make this proper feel free.
M.take_organ_damage(src:throwforce)
M.hitby(src)
log_attack("<font color='red'>[hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])</font>")
log_admin("ATTACK: [hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])")
msg_admin_attack("ATTACK: [hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])")
else if(isobj(hit_atom))
var/obj/O = hit_atom
@@ -62,7 +58,7 @@
return null
/atom/proc/check_eye(user as mob)
if (istype(user, /mob/living/silicon/ai))
if (istype(user, /mob/living/silicon/ai)) // WHYYYY
return 1
return
@@ -513,7 +509,7 @@ its easier to just keep the beam vertical.
// Only adds blood on the floor -- Skie
/atom/proc/add_blood_floor(mob/living/carbon/M as mob)
if( istype(M, /mob/living/carbon/monkey) )
if( istype(M, /mob/living/carbon/monkey) || istype(M, /mob/living/carbon/human))
if( istype(src, /turf/simulated) )
var/turf/simulated/source1 = src
var/obj/effect/decal/cleanable/blood/this = new /obj/effect/decal/cleanable/blood(source1)
@@ -536,11 +532,7 @@ its easier to just keep the beam vertical.
else if( istype(M, /mob/living/silicon/robot ))
if( istype(src, /turf/simulated) )
var/turf/simulated/source2 = src
var/obj/effect/decal/cleanable/oil/this = new /obj/effect/decal/cleanable/oil(source2)
for(var/datum/disease/D in M.viruses)
var/datum/disease/newDisease = new D.type
this.viruses += newDisease
newDisease.holder = this
new /obj/effect/decal/cleanable/oil(source2)
/atom/proc/clean_prints()
if(istype(fingerprints, /list))
@@ -1235,12 +1227,10 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
if((LASER in usr:mutations) && usr:a_intent == "hurt" && world.time >= usr.next_move)
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
var/turf/oloc
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
if(istype(src, /turf)) oloc = src
else
oloc = loc
if(istype(usr, /mob/living/carbon/human))
usr:nutrition -= rand(1,5)
@@ -1253,7 +1243,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = oloc
A.original = src
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x

View File

@@ -983,7 +983,7 @@
if(!src || !src.connected)
return
if ((usr.contents.Find(src) || in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["locked"])
if ((src.connected && src.connected.occupant))
src.connected.locked = !( src.connected.locked )

View File

@@ -351,6 +351,8 @@
if(!changeling) return
var/mob/living/carbon/C = usr
if(!C.stat && alert("Are we sure we wish to fake our death?",,"Yes","No") == "No")//Confirmation for living changelings if they want to fake their death
return
C << "<span class='notice'>We will attempt to regenerate our form.</span>"
C.status_flags |= FAKEDEATH //play dead
@@ -526,10 +528,10 @@ var/list/datum/dna/hivemind_bank = list()
/mob/proc/changeling_hivedownload()
set category = "Changeling"
set name = "Hive Absorb (40)"
set name = "Hive Absorb (20)"
set desc = "Allows you to absorb DNA that is being channeled in the airwaves."
var/datum/changeling/changeling = changeling_power(40,1)
var/datum/changeling/changeling = changeling_power(20,1)
if(!changeling) return
var/list/names = list()
@@ -547,7 +549,7 @@ var/list/datum/dna/hivemind_bank = list()
if(!chosen_dna)
return
changeling.chem_charges -= 40
changeling.chem_charges -= 20
changeling.absorbed_dna += chosen_dna
usr << "<span class='notice'>We absorb the DNA of [S] from the air.</span>"
feedback_add_details("changeling_powers","HD")

View File

@@ -463,9 +463,6 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
log_attack("<font color='red'>[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey])</font>")
log_admin("ATTACK: [user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey])")
msg_admin_attack("ATTACK: [user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey])") //BS12 EDIT ALG
if(istype(M,/mob/dead))
M.invisibility = 0
user.visible_message( \
@@ -565,7 +562,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
for (var/mob/V in viewers(src))
V.show_message("\red [user] slices open a finger and begins to chant and paint symbols on the floor.", 3, "\red You hear chanting.", 2)
user << "\red You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world."
user.take_overall_damage(1)
user.take_overall_damage((rand(9)+1)/10) // 0.1 to 1.0 damage
if(do_after(user, 50))
if(usr.get_active_hand() != src)
return

View File

@@ -10,24 +10,72 @@
dust_swarm("weak")*/
if (!event)
//CARN: checks to see if random events are enabled.
if(config.allow_random_events && prob(eventchance))
event()
hadevent = 1
if(config.allow_random_events)
hadevent = event()
else
Holiday_Random_Event()
else
event = 0
sleep(2400)
// Doesn't necessarily trigger an event, but might. Returns 1 if it did.
/proc/event()
event = 1
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/minutes_passed = world.time/600
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)
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
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
possibleEvents["Space Ninja"] = security_count * 10 // very low chance for space ninja event
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)) // "normal" event chance at 20 players
return 0
switch(picked_event)
if("Meteor")
command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert")
world << sound('sound/AI/meteors.ogg')
spawn(100)
@@ -36,33 +84,34 @@
spawn(700)
meteor_wave()
spawn_meteors()
if(4)
if("Blob")
mini_blob_event()
if(5)
if("Space Ninja")
//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like.
space_ninja_arrival()
if("Radiation")
high_radiation_event()
if(6)
if("Virus")
viral_outbreak()
if(7)
if(prob(10))
if("Alien")
alien_infestation()
if(8)
if("Prison Break")
prison_break()
if(9)
if("Carp")
carp_migration()
/*if(10)
immovablerod()*/
if(11)
if("Lights")
lightsout(1,2)
if(12)
if("Appendicitis")
appendicitis()
if(13)
if("Ion Storm")
IonStorm()
if(14)
if("Spacevine")
spacevine_infestation()
if(15)
if("Communications")
communications_blackout()
return 1
/proc/communications_blackout(var/silent = 1)
if(!silent)
@@ -170,61 +219,16 @@
break
/proc/viral_outbreak(var/virus = null)
// command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
// world << sound('sound/AI/outbreak7.ogg')
var/virus_type
if(!virus)
virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat)
else
switch(virus)
if("fake gbs")
virus_type = /datum/disease/fake_gbs
if("gbs")
virus_type = /datum/disease/gbs
if("magnitis")
virus_type = /datum/disease/magnitis
if("rhumba beat")
virus_type = /datum/disease/rhumba_beat
if("brain rot")
virus_type = /datum/disease/brainrot
if("cold")
virus_type = /datum/disease/cold
if("retrovirus")
virus_type = /datum/disease/dnaspread
if("flu")
virus_type = /datum/disease/flu
// if("t-virus")
// virus_type = /datum/disease/t_virus
if("pierrot's throat")
virus_type = /datum/disease/pierrot_throat
for(var/mob/living/carbon/human/H in living_mob_list)
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
foundAlready = 1
if(H.stat == 2 || foundAlready)
for(var/mob/living/carbon/human/H in world)
if((H.virus2) || (H.stat == 2) || prob(30))
continue
if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work.
if((!H.dna) || (H.sdisabilities & BLIND)) //A blindness disease would be the worst.
continue
var/datum/disease/dnaspread/D = new
D.strain_data["name"] = H.real_name
D.strain_data["UI"] = H.dna.uni_identity
D.strain_data["SE"] = H.dna.struc_enzymes
D.carrier = 1
D.holder = H
D.affected_mob = H
H.viruses += D
infect_mob_random_lesser(H)
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("An unknown virus has been detected onboard the ship.", "Virus Alert")
spawn(rand(0, 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')
@@ -237,15 +241,7 @@
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = list() //List of candidate KEYs to control the new larvae. ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
i++
var/list/candidates = get_alien_candidates()
if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)
@@ -491,3 +487,38 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
world << "Ion Storm Main Done"
*/
// 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

@@ -25,7 +25,7 @@
for(var/obj/O in orange(1,src))
del(O)
for(var/turf/simulated/ST in orange(1,src))
ST.ReplaceWithSpace()
ST.ChangeTurf(/turf/space)
sleep(6)
grav(10, 4, 10, 0 )
@@ -84,5 +84,5 @@
//Destroying the turf
if( T && istype(T,/turf/simulated) && prob(turf_removal_chance) )
var/turf/simulated/ST = T
ST.ReplaceWithSpace()
ST.ChangeTurf(/turf/space)
return

View File

@@ -118,13 +118,9 @@ var/global/Holiday = null
set name = ".Set Holiday"
set category = "Fun"
set desc = "Force-set the Holiday variable to make the game think it's a certain day."
if( !holder || !(holder.rank in list("Game Master","Game Admin")) )
src << "<font color='red'>Error: Set_Holiday: You hold insufficient rank to perform this action.</font>"
return
if(!check_rights(R_SERVER)) return
if(!T) return
Holiday = T
//get a new station name
station_name = null

View File

@@ -93,7 +93,15 @@ When I already created about 4 new objectives, this doesn't seem terribly import
/var/global/toggle_space_ninja = 1//If ninjas can spawn or not.
/var/global/sent_ninja_to_station = 0//If a ninja is already on the station.
/proc/space_ninja_arrival()
var/ninja_selection_id = 1
var/ninja_selection_active = 0
var/ninja_confirmed_selection = 0
/proc/space_ninja_arrival(var/assign_key = null, var/assign_mission = null)
if(ninja_selection_active)
usr << "\red Ninja selection already in progress. Please wait until it ends."
return
var/datum/game_mode/current_mode = ticker.mode
var/datum/mind/current_mind
@@ -133,23 +141,71 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp
//Here we pick a location and spawn the ninja.
var/list/spawn_list = list()
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "ninjaspawn")
spawn_list.Add(L)
if(!spawn_list.len)
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "carpspawn")
spawn_list.Add(L)
var/ninja_key = null
var/mob/candidate_mob
if(assign_key)
ninja_key = assign_key
else
var/list/candidates = list() //list of candidate keys
for(var/mob/dead/observer/G in player_list)
if(G.client && !G.client.holder && ((G.client.inactivity/10)/60) <= 5)
if(G.client && !G.client.holder && !G.client.is_afk() && G.client.be_spaceninja)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
candidates += G
if(!candidates.len) return
candidates = shuffle(candidates)//Incorporating Donkie's list shuffle
candidate_mob = pick(candidates)
ninja_key = candidate_mob.ckey
if(!candidate_mob)
for(var/mob/M in player_list)
if((M.key == ninja_key || M.ckey == ninja_key) && M.client)
candidate_mob = M
break
if(!candidate_mob)
usr << "\red The randomly chosen mob was not found in the second check."
return
ninja_selection_active = 1
ninja_selection_id++
var/this_selection_id = ninja_selection_id
spawn(1)
if(alert(candidate_mob, "You have been selected to play as a space ninja. Would you like to play as this role? (You have 30 seconds to accept - You will spawn in 30 seconds if you accept)",,"Yes","No")!="Yes")
usr << "\red The selected candidate for space ninja declined."
return
ninja_confirmed_selection = this_selection_id
spawn(300)
if(!ninja_selection_active || (this_selection_id != ninja_selection_id ))
ninja_selection_active = 0
candidate_mob << "\red Sorry, you were too late. You only had 30 seconds to accept."
return
if(ninja_confirmed_selection != ninja_selection_id)
ninja_selection_active = 0
usr << "\red The ninja did not accept the role in time."
return
ninja_selection_active = 0
//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.key = ninja_key
new_ninja.wear_suit:randomize_param()//Give them a random set of suit parameters.
new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess.
new_ninja.internals.icon_state = "internal1"
@@ -165,6 +221,10 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp
if(istype(xeno))
xeno_list += xeno
if(assign_mission)
new_ninja.mind.store_memory("<B>Mission:</B> \red [assign_mission].<br>")
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>[assign_mission]</B>"
else
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()
@@ -411,43 +471,14 @@ As such, it's hard-coded for now. No reason for it not to be, really.
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 landmarks_list)
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
space_ninja_arrival(input, mission)
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.")
message_admins("\blue [key_name_admin(key)] has spawned [input] as a Space Ninja.\nTheir <b>mission</b> is: [mission]")
log_admin("[key] used Spawn Space Ninja.")
return
@@ -500,7 +531,6 @@ As such, it's hard-coded for now. No reason for it not to be, really.
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//=======//

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