mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
Merge branch 'master' of https://github.com/Baystation12/Baystation12 into antag
This commit is contained in:
20
.travis.yml
Normal file
20
.travis.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
#pretending we're C because otherwise ruby will initialize, even with "language: dm".
|
||||
language: c
|
||||
|
||||
env:
|
||||
BYOND_MAJOR="503"
|
||||
BYOND_MINOR="1224"
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install libc6:i386 libgcc1:i386 libstdc++6:i386 -qq
|
||||
|
||||
install:
|
||||
- curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip
|
||||
- unzip byond.zip
|
||||
- cd byond
|
||||
- sudo make install
|
||||
- cd ..
|
||||
|
||||
script:
|
||||
- DreamMaker baystation12.dme
|
||||
2
COPYING
2
COPYING
@@ -1,5 +1,5 @@
|
||||
Baystation12
|
||||
Copyright (C) 2010-2013 Baystation12 and tgstation13.
|
||||
Copyright (C) 2010-2014 Baystation12 and tgstation13.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
#include "code\controllers\autotransfer.dm"
|
||||
#include "code\controllers\configuration.dm"
|
||||
#include "code\controllers\failsafe.dm"
|
||||
#include "code\controllers\hooks-defs.dm"
|
||||
#include "code\controllers\hooks.dm"
|
||||
#include "code\controllers\lighting_controller.dm"
|
||||
#include "code\controllers\master_controller.dm"
|
||||
#include "code\controllers\shuttle_controller.dm"
|
||||
@@ -176,9 +178,14 @@
|
||||
#include "code\game\area\ai_monitored.dm"
|
||||
#include "code\game\area\areas.dm"
|
||||
#include "code\game\area\Space Station 13 areas.dm"
|
||||
#include "code\game\dna\dna.dm"
|
||||
#include "code\game\dna\dna_misc.dm"
|
||||
#include "code\game\dna\dna2.dm"
|
||||
#include "code\game\dna\dna2_domutcheck.dm"
|
||||
#include "code\game\dna\dna2_helpers.dm"
|
||||
#include "code\game\dna\dna_modifier.dm"
|
||||
#include "code\game\dna\genes\disabilities.dm"
|
||||
#include "code\game\dna\genes\gene.dm"
|
||||
#include "code\game\dna\genes\monkey.dm"
|
||||
#include "code\game\dna\genes\powers.dm"
|
||||
#include "code\game\gamemodes\events.dm"
|
||||
#include "code\game\gamemodes\factions.dm"
|
||||
#include "code\game\gamemodes\game_mode.dm"
|
||||
@@ -223,6 +230,7 @@
|
||||
#include "code\game\gamemodes\malfunction\malfunction.dm"
|
||||
#include "code\game\gamemodes\meteor\meteor.dm"
|
||||
#include "code\game\gamemodes\meteor\meteors.dm"
|
||||
#include "code\game\gamemodes\ninja\ninja.dm"
|
||||
#include "code\game\gamemodes\nuclear\nuclear.dm"
|
||||
#include "code\game\gamemodes\nuclear\nuclearbomb.dm"
|
||||
#include "code\game\gamemodes\nuclear\pinpointer.dm"
|
||||
@@ -264,6 +272,7 @@
|
||||
#include "code\game\machinery\cloning.dm"
|
||||
#include "code\game\machinery\constructable_frame.dm"
|
||||
#include "code\game\machinery\cryo.dm"
|
||||
#include "code\game\machinery\cryopod.dm"
|
||||
#include "code\game\machinery\deployable.dm"
|
||||
#include "code\game\machinery\door_control.dm"
|
||||
#include "code\game\machinery\doppler_array.dm"
|
||||
@@ -436,6 +445,7 @@
|
||||
#include "code\game\objects\effects\decals\Cleanable\humans.dm"
|
||||
#include "code\game\objects\effects\decals\Cleanable\misc.dm"
|
||||
#include "code\game\objects\effects\decals\Cleanable\robots.dm"
|
||||
#include "code\game\objects\effects\decals\Cleanable\tracks.dm"
|
||||
#include "code\game\objects\effects\spawners\bombspawner.dm"
|
||||
#include "code\game\objects\effects\spawners\gibspawner.dm"
|
||||
#include "code\game\objects\effects\spawners\vaultspawner.dm"
|
||||
@@ -609,6 +619,7 @@
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\cargo.dm"
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\engineering.dm"
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\freezer.dm"
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\guncabinet.dm"
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\hydroponics.dm"
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\medical.dm"
|
||||
#include "code\game\objects\structures\crates_lockers\closets\secure\personal.dm"
|
||||
@@ -651,7 +662,6 @@
|
||||
#include "code\modules\admin\holder2.dm"
|
||||
#include "code\modules\admin\IsBanned.dm"
|
||||
#include "code\modules\admin\NewBan.dm"
|
||||
#include "code\modules\admin\newbanjob.dm"
|
||||
#include "code\modules\admin\player_notes.dm"
|
||||
#include "code\modules\admin\player_panel.dm"
|
||||
#include "code\modules\admin\topic.dm"
|
||||
@@ -680,6 +690,9 @@
|
||||
#include "code\modules\admin\verbs\possess.dm"
|
||||
#include "code\modules\admin\verbs\pray.dm"
|
||||
#include "code\modules\admin\verbs\randomverbs.dm"
|
||||
#include "code\modules\admin\verbs\SDQL.dm"
|
||||
#include "code\modules\admin\verbs\SDQL_2.dm"
|
||||
#include "code\modules\admin\verbs\SDQL_2_parser.dm"
|
||||
#include "code\modules\admin\verbs\striketeam.dm"
|
||||
#include "code\modules\admin\verbs\striketeam_syndicate.dm"
|
||||
#include "code\modules\admin\verbs\ticklag.dm"
|
||||
@@ -776,6 +789,7 @@
|
||||
#include "code\modules\economy\TradeDestinations.dm"
|
||||
#include "code\modules\events\alien_infestation.dm"
|
||||
#include "code\modules\events\blob.dm"
|
||||
#include "code\modules\events\borers.dm"
|
||||
#include "code\modules\events\brand_intelligence.dm"
|
||||
#include "code\modules\events\carp_migration.dm"
|
||||
#include "code\modules\events\comms_blackout.dm"
|
||||
@@ -817,6 +831,7 @@
|
||||
#include "code\modules\maps\reader.dm"
|
||||
#include "code\modules\maps\swapmaps.dm"
|
||||
#include "code\modules\maps\writer.dm"
|
||||
#include "code\modules\mining\abandonedcrates.dm"
|
||||
#include "code\modules\mining\machine_input_output_plates.dm"
|
||||
#include "code\modules\mining\machine_processing.dm"
|
||||
#include "code\modules\mining\machine_stacking.dm"
|
||||
@@ -824,10 +839,12 @@
|
||||
#include "code\modules\mining\mine_areas.dm"
|
||||
#include "code\modules\mining\mine_items.dm"
|
||||
#include "code\modules\mining\mine_turfs.dm"
|
||||
#include "code\modules\mining\minerals.dm"
|
||||
#include "code\modules\mining\mint.dm"
|
||||
#include "code\modules\mining\money_bag.dm"
|
||||
#include "code\modules\mining\ores_coins.dm"
|
||||
#include "code\modules\mining\satchel_ore_boxdm.dm"
|
||||
#include "code\modules\mob\abilities.dm"
|
||||
#include "code\modules\mob\death.dm"
|
||||
#include "code\modules\mob\emote.dm"
|
||||
#include "code\modules\mob\inventory.dm"
|
||||
@@ -1093,6 +1110,7 @@
|
||||
#include "code\modules\projectiles\guns\projectile\pistol.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\pneumatic.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\revolver.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\rocket.dm"
|
||||
#include "code\modules\projectiles\guns\projectile\shotgun.dm"
|
||||
#include "code\modules\projectiles\projectile\animate.dm"
|
||||
#include "code\modules\projectiles\projectile\beams.dm"
|
||||
@@ -1123,8 +1141,10 @@
|
||||
#include "code\modules\reagents\reagent_containers\robodropper.dm"
|
||||
#include "code\modules\reagents\reagent_containers\spray.dm"
|
||||
#include "code\modules\reagents\reagent_containers\syringes.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\cans.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\condiment.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\sandwich.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\snacks.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\bottle.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\drinkingglass.dm"
|
||||
@@ -1154,7 +1174,6 @@
|
||||
#include "code\modules\research\xenoarchaeology\geosample.dm"
|
||||
#include "code\modules\research\xenoarchaeology\manuals.dm"
|
||||
#include "code\modules\research\xenoarchaeology\misc.dm"
|
||||
#include "code\modules\research\xenoarchaeology\readme.dm"
|
||||
#include "code\modules\research\xenoarchaeology\artifact\artifact.dm"
|
||||
#include "code\modules\research\xenoarchaeology\artifact\artifact_autocloner.dm"
|
||||
#include "code\modules\research\xenoarchaeology\artifact\artifact_crystal.dm"
|
||||
@@ -1190,22 +1209,18 @@
|
||||
#include "code\modules\research\xenoarchaeology\finds\finds_fossils.dm"
|
||||
#include "code\modules\research\xenoarchaeology\finds\finds_misc.dm"
|
||||
#include "code\modules\research\xenoarchaeology\finds\finds_talkingitem.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_accelerator.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_base.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_fourier_transform.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_gas_chromatography.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_hyperspectral.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_ion_mobility.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\analysis_isotope_ratio.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\artifact_analyser.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\artifact_harvester.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\artifact_scanner.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\coolant.dm"
|
||||
#include "code\modules\research\xenoarchaeology\machinery\geosample_scanner.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\ano_device_battery.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\anomaly_suit.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\bunsen_burner.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\gearbelt.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\suspension_generator.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\tools.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\tools_anoscanner.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\tools_coresampler.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\tools_depthscanner.dm"
|
||||
#include "code\modules\research\xenoarchaeology\tools\tools_locater.dm"
|
||||
@@ -1238,11 +1253,16 @@
|
||||
#include "code\modules\surgery\eye.dm"
|
||||
#include "code\modules\surgery\face.dm"
|
||||
#include "code\modules\surgery\generic.dm"
|
||||
#include "code\modules\surgery\headreattach.dm"
|
||||
#include "code\modules\surgery\implant.dm"
|
||||
#include "code\modules\surgery\other.dm"
|
||||
#include "code\modules\surgery\ribcage.dm"
|
||||
#include "code\modules\surgery\robolimbs.dm"
|
||||
#include "code\modules\surgery\surgery.dm"
|
||||
#include "code\modules\telesci\bscrystal.dm"
|
||||
#include "code\modules\telesci\gps.dm"
|
||||
#include "code\modules\telesci\telepad.dm"
|
||||
#include "code\modules\telesci\telesci_computer.dm"
|
||||
#include "code\modules\virus2\analyser.dm"
|
||||
#include "code\modules\virus2\antibodies.dm"
|
||||
#include "code\modules\virus2\centrifuge.dm"
|
||||
@@ -1291,15 +1311,16 @@
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_gen.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_gen_external.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\LaserComputer.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\SuperMatter.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm"
|
||||
#include "code\WorkInProgress\Chinsky\ashtray.dm"
|
||||
#include "code\WorkInProgress\Chinsky\guestpass.dm"
|
||||
#include "code\WorkInProgress\Cib\MedicalSideEffects.dm"
|
||||
#include "code\WorkInProgress\kilakk\fax.dm"
|
||||
#include "code\WorkInProgress\Mini\atmos_control.dm"
|
||||
#include "code\WorkInProgress\Ported\policetape.dm"
|
||||
#include "code\WorkInProgress\SkyMarshal\officer_stuff.dm"
|
||||
#include "code\WorkInProgress\SkyMarshal\Ultralight_procs.dm"
|
||||
#include "code\WorkInProgress\Yinadele\Supermatter.dm"
|
||||
#include "code\ZAS\Airflow.dm"
|
||||
#include "code\ZAS\Connection.dm"
|
||||
#include "code\ZAS\Debug.dm"
|
||||
|
||||
@@ -338,13 +338,13 @@
|
||||
return
|
||||
|
||||
/*
|
||||
Alt-click to ventcrawl - Monkeys, aliens, and slimes
|
||||
Alt-click to ventcrawl - Monkeys, aliens, slimes and mice.
|
||||
This is a little buggy but somehow that just seems to plague ventcrawl.
|
||||
I am sorry, I don't know why.
|
||||
*/
|
||||
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/ML)
|
||||
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/ML)
|
||||
if(istype(ML))
|
||||
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl)
|
||||
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl,/mob/living/simple_animal/mouse/verb/ventcrawl)
|
||||
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
|
||||
ML.handle_ventcrawl(src)
|
||||
return
|
||||
|
||||
@@ -149,10 +149,6 @@ datum/pipeline
|
||||
air.merge(air_sample)
|
||||
//turf_air already modified by equalize_gases()
|
||||
|
||||
if(istype(target) && !target.processing)
|
||||
if(target.air)
|
||||
if(target.air.check_tile_graphic())
|
||||
target.update_visuals(target.air)
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ obj/machinery/atmospherics/pipe
|
||||
proc/burst()
|
||||
src.visible_message("\red \bold [src] bursts!");
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new
|
||||
smoke.set_up(1,0, src.loc, 0)
|
||||
smoke.start()
|
||||
del(src)
|
||||
@@ -1130,7 +1130,7 @@ obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/u
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
user << "<span class='warning'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>"
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
var/obj/structure/closet/crate/freezer/C = new(src.loc)
|
||||
var/num = rand(2,6)
|
||||
var/new_type = pick(
|
||||
/obj/item/weapon/reagent_containers/food/drinks/beer, \
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cans/beer, \
|
||||
/obj/item/weapon/reagent_containers/food/drinks/tea, \
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen, \
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candiedapple, \
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
construction_storage
|
||||
name = "\improper Construction storage"
|
||||
|
||||
locker
|
||||
name = "\improper Locker room"
|
||||
|
||||
atmos_storage
|
||||
name = "\improper Atmos storage"
|
||||
icon_state = "engine_storage"
|
||||
@@ -69,7 +66,11 @@
|
||||
//icon_state = "engine_portgyro"
|
||||
|
||||
storage
|
||||
name = "\improper Engineering hallway"
|
||||
name = "\improper Engineering Storage"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
storage_hard
|
||||
name = "\improper Engineering Hard Storage"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
hallway
|
||||
|
||||
@@ -145,14 +145,14 @@ datum/fusion_reaction/pergium_tritium
|
||||
energy_production = 0
|
||||
radiation = 5
|
||||
|
||||
datum/fusion_reaction/pergium_deuterium
|
||||
datum/fusion_reaction/pergium_obdurium
|
||||
primary_reactant = "Pergium"
|
||||
secondary_reactant = "Obdurium"
|
||||
energy_consumption = 5
|
||||
energy_production = 0
|
||||
radiation = 5
|
||||
|
||||
datum/fusion_reaction/pergium_tritium
|
||||
datum/fusion_reaction/pergium_solonium
|
||||
primary_reactant = "Pergium"
|
||||
secondary_reactant = "Solonium"
|
||||
energy_consumption = 5
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
#define NITROGEN_RETARDATION_FACTOR 12 //Higher == N2 slows reaction more
|
||||
#define THERMAL_RELEASE_MODIFIER 0.55 //Percentage of output power given to heat generation.
|
||||
|
||||
#define PLASMA_RELEASE_MODIFIER 0.24 //Percentage of output power given to plasma generation.
|
||||
#define PLASMA_CONVERSION_FACTOR 50 //How much energy per mole of plasma
|
||||
#define MAX_PLASMA_RELATIVE_INCREASE 0.3 //Percentage of current plasma amounts that can be added to preexisting plasma.
|
||||
|
||||
#define OXYGEN_RELEASE_MODIFIER 0.13 //Percentage of output power given to oxygen generation.
|
||||
#define OXYGEN_CONVERSION_FACTOR 150 //How much energy per mole of oxygen.
|
||||
#define MAX_OXYGEN_RELATIVE_INCREASE 0.2 //Percentage of current oxygen amounts that can be added to preexisting oxygen.
|
||||
|
||||
#define RADIATION_POWER_MODIFIER 0.03 //How much power goes to irradiating the area.
|
||||
#define RADIATION_FACTOR 10
|
||||
#define HALLUCINATION_POWER_MODIFIER 0.05 //How much power goes to hallucinations.
|
||||
#define HALLUCINATION_FACTOR 20
|
||||
|
||||
#define REACTION_POWER_MODIFIER 4 //Higher == more overall power
|
||||
|
||||
#define WARNING_DELAY 45 //45 seconds between warnings.
|
||||
|
||||
/obj/machinery/power/supermatter
|
||||
name = "Supermatter"
|
||||
desc = "A strangely translucent and iridescent crystal. \red You get headaches just from looking at it."
|
||||
icon = 'icons/obj/engine.dmi'
|
||||
icon_state = "darkmatter"
|
||||
density = 1
|
||||
anchored = 0
|
||||
|
||||
var/gasefficency = 0.25
|
||||
|
||||
var/base_icon_state = "darkmatter"
|
||||
|
||||
var/damage = 0
|
||||
var/damage_archived = 0
|
||||
var/safe_alert = "Crystaline hyperstructure returning to safe operating levels."
|
||||
var/warning_point = 100
|
||||
var/warning_alert = "Danger! Crystal hyperstructure instability!"
|
||||
var/emergency_point = 700
|
||||
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT"
|
||||
var/explosion_point = 1000
|
||||
|
||||
var/emergency_issued = 0
|
||||
|
||||
var/explosion_power = 8
|
||||
|
||||
var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning
|
||||
|
||||
var/power = 0
|
||||
|
||||
|
||||
shard //Small subtype, less efficient and more sensitive, but less boom.
|
||||
name = "Supermatter Shard"
|
||||
desc = "A strangely translucent and iridescent crystal. Looks like it used to be part of a larger structure. \red You get headaches just from looking at it."
|
||||
icon_state = "darkmatter_shard"
|
||||
base_icon_state = "darkmatter_shard"
|
||||
|
||||
warning_point = 50
|
||||
emergency_point = 500
|
||||
explosion_point = 900
|
||||
|
||||
gasefficency = 0.125
|
||||
|
||||
explosion_power = 3 //3,6,9,12? Or is that too small?
|
||||
|
||||
|
||||
process()
|
||||
|
||||
var/turf/L = loc
|
||||
|
||||
if(!istype(L)) //If we are not on a turf, uh oh.
|
||||
del src
|
||||
|
||||
//Ok, get the air from the turf
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
|
||||
//Remove gas from surrounding area
|
||||
var/datum/gas_mixture/removed = env.remove(gasefficency * env.total_moles)
|
||||
|
||||
if (!removed)
|
||||
return 1
|
||||
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
|
||||
|
||||
if(damage > emergency_point)
|
||||
//radioalert("states, \"[emergency_alert]\"","Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
else if(damage >= damage_archived) // The damage is still going up
|
||||
//radioalert("states, \"[warning_alert]\"","Supermatter Monitor")
|
||||
lastwarning = world.timeofday-150
|
||||
else // Phew, we're safe
|
||||
//radioalert("states, \"[safe_alert]\"","Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
|
||||
if(damage > explosion_point)
|
||||
explosion(loc,explosion_power,explosion_power*2,explosion_power*3,explosion_power*4,1)
|
||||
del src
|
||||
|
||||
damage_archived = damage
|
||||
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
|
||||
|
||||
if(!removed.total_moles)
|
||||
damage += max((power-1600)/10,0)
|
||||
power = max(power,1600)
|
||||
return 1
|
||||
|
||||
var/nitrogen_mod = abs((removed.nitrogen / removed.total_moles)) * NITROGEN_RETARDATION_FACTOR
|
||||
var/oxygen = max(min(removed.oxygen / removed.total_moles - nitrogen_mod, 1), 0)
|
||||
|
||||
var/temp_factor = 0
|
||||
if(oxygen > 0.8)
|
||||
// with a perfect gas mix, make the power less based on heat
|
||||
temp_factor = 100
|
||||
icon_state = "[base_icon_state]_glow"
|
||||
else
|
||||
// in normal mode, base the produced energy around the heat
|
||||
temp_factor = 60
|
||||
icon_state = base_icon_state
|
||||
|
||||
//Calculate power released as heat and gas, in as the sqrt of the power.
|
||||
var/power_factor = (power/500) ** 3
|
||||
var/device_energy = oxygen * power_factor
|
||||
power = max(round((removed.temperature - T0C) / temp_factor) + power - power_factor, 0) //Total laser power plus an overload factor
|
||||
|
||||
//Final energy calcs.
|
||||
device_energy = max(device_energy * REACTION_POWER_MODIFIER,0)
|
||||
|
||||
//To figure out how much temperature to add each tick, consider that at one atmosphere's worth
|
||||
//of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature
|
||||
//that the device energy is around 2140. At that stage, we don't want too much heat to be put out
|
||||
//Since the core is effectively "cold"
|
||||
|
||||
//Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock
|
||||
//is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall.
|
||||
|
||||
var/plasma_energy = device_energy * PLASMA_RELEASE_MODIFIER
|
||||
var/oxygen_energy = device_energy * OXYGEN_RELEASE_MODIFIER
|
||||
var/other_energy = device_energy * (1- (OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
|
||||
//Put as much plasma out as is permitted.
|
||||
if( plasma_energy > removed.total_moles * PLASMA_CONVERSION_FACTOR * MAX_PLASMA_RELATIVE_INCREASE / gasefficency)
|
||||
removed.toxins += (MAX_PLASMA_RELATIVE_INCREASE * removed.total_moles / gasefficency)
|
||||
other_energy += plasma_energy - (removed.total_moles * PLASMA_CONVERSION_FACTOR * MAX_PLASMA_RELATIVE_INCREASE / gasefficency)
|
||||
else
|
||||
removed.toxins += plasma_energy/PLASMA_CONVERSION_FACTOR
|
||||
|
||||
//Put as much plasma out as is permitted.
|
||||
if( oxygen_energy > removed.total_moles * OXYGEN_CONVERSION_FACTOR * MAX_OXYGEN_RELATIVE_INCREASE / gasefficency)
|
||||
removed.oxygen += (MAX_OXYGEN_RELATIVE_INCREASE * removed.total_moles / gasefficency)
|
||||
other_energy += oxygen_energy - (removed.total_moles * OXYGEN_CONVERSION_FACTOR * MAX_OXYGEN_RELATIVE_INCREASE / gasefficency)
|
||||
else
|
||||
removed.oxygen += oxygen_energy/OXYGEN_CONVERSION_FACTOR
|
||||
|
||||
|
||||
var/heat_energy = (other_energy*THERMAL_RELEASE_MODIFIER)/(1-(OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
var/hallucination_energy = (other_energy*HALLUCINATION_POWER_MODIFIER*HALLUCINATION_FACTOR)/(1-(OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
var/rad_energy = (other_energy*RADIATION_POWER_MODIFIER*RADIATION_FACTOR)/(1-(OXYGEN_RELEASE_MODIFIER + PLASMA_RELEASE_MODIFIER))
|
||||
|
||||
var/heat_applied = max(heat_energy,0)
|
||||
if(heat_applied + removed.temperature > 800)
|
||||
removed.temperature = 800
|
||||
var/energy_to_reconsider = (heat_applied + removed.temperature - 800)
|
||||
hallucination_energy += (energy_to_reconsider*HALLUCINATION_POWER_MODIFIER)/(HALLUCINATION_POWER_MODIFIER+RADIATION_POWER_MODIFIER)
|
||||
rad_energy += (energy_to_reconsider*RADIATION_POWER_MODIFIER)/(HALLUCINATION_POWER_MODIFIER+RADIATION_POWER_MODIFIER)
|
||||
else
|
||||
removed.temperature += heat_applied
|
||||
|
||||
removed.update_values()
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
for(var/mob/living/carbon/human/l in view(src, round(hallucination_energy**0.25))) // you have to be seeing the core to get hallucinations
|
||||
if(prob(10) && !istype(l.glasses, /obj/item/clothing/glasses/meson))
|
||||
l.hallucination += hallucination_energy/((get_dist(l,src)**2))
|
||||
|
||||
for(var/mob/living/l in range(src,round(rad_energy**0.25)))
|
||||
var/rads = rad_energy/((get_dist(l,src)**2))
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet")
|
||||
power += Proj.damage
|
||||
return 0
|
||||
@@ -17,35 +17,34 @@
|
||||
/obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (health < 1)
|
||||
return
|
||||
if (istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match))
|
||||
if(user)
|
||||
if (contents.len >= max_butts)
|
||||
user << "This ashtray is full."
|
||||
return
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
if (istype(W,/obj/item/weapon/cigbutt) || istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match))
|
||||
if (contents.len >= max_butts)
|
||||
user << "This ashtray is full."
|
||||
return
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
|
||||
if (istype(W,/obj/item/clothing/mask/cigarette))
|
||||
var/obj/item/clothing/mask/cigarette/cig = W
|
||||
if (cig.lit == 1)
|
||||
src.visible_message("[user] crushes [cig] in [src], putting it out.")
|
||||
cig.smoketime = 0
|
||||
processing_objects.Remove(cig)
|
||||
var/obj/item/butt = new cig.type_butt(src)
|
||||
cig.transfer_fingerprints_to(butt)
|
||||
del(cig)
|
||||
else if (cig.lit == 0)
|
||||
if(istype(cig, /obj/item/weapon/match))
|
||||
user << "You place [cig] in [src] without even lighting it. Why would you do that?"
|
||||
else
|
||||
user << "You place [cig] in [src] without even smoking it. Why would you do that?"
|
||||
else if (cig.lit == -1)
|
||||
src.visible_message("[user] places [cig] in [src].")
|
||||
user.update_inv_l_hand()
|
||||
user.update_inv_r_hand()
|
||||
add_fingerprint(user)
|
||||
if (contents.len == max_butts)
|
||||
icon_state = icon_full
|
||||
desc = empty_desc + " It's stuffed full."
|
||||
else if (contents.len > max_butts/2)
|
||||
icon_state = icon_half
|
||||
desc = empty_desc + " It's half-filled."
|
||||
user << "You place [cig] in [src] without even smoking it. Why would you do that?"
|
||||
|
||||
src.visible_message("[user] places [W] in [src].")
|
||||
user.update_inv_l_hand()
|
||||
user.update_inv_r_hand()
|
||||
add_fingerprint(user)
|
||||
if (contents.len == max_butts)
|
||||
icon_state = icon_full
|
||||
desc = empty_desc + " It's stuffed full."
|
||||
else if (contents.len > max_butts/2)
|
||||
icon_state = icon_half
|
||||
desc = empty_desc + " It's half-filled."
|
||||
else
|
||||
health = max(0,health - W.force)
|
||||
user << "You hit [src] with [W]."
|
||||
@@ -62,7 +61,6 @@
|
||||
if (contents.len)
|
||||
src.visible_message("\red [src] slams into [hit_atom] spilling its contents!")
|
||||
for (var/obj/item/clothing/mask/cigarette/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
icon_state = icon_empty
|
||||
return ..()
|
||||
@@ -70,7 +68,6 @@
|
||||
/obj/item/ashtray/proc/die()
|
||||
src.visible_message("\red [src] shatters spilling its contents!")
|
||||
for (var/obj/item/clothing/mask/cigarette/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
icon_state = icon_broken
|
||||
|
||||
|
||||
186
code/WorkInProgress/Chinsky/guestpass.dm
Normal file
186
code/WorkInProgress/Chinsky/guestpass.dm
Normal file
@@ -0,0 +1,186 @@
|
||||
/////////////////////////////////////////////
|
||||
//Guest pass ////////////////////////////////
|
||||
/////////////////////////////////////////////
|
||||
/obj/item/weapon/card/id/guest
|
||||
name = "guest pass"
|
||||
desc = "Allows temporary access to station areas."
|
||||
icon_state = "guest"
|
||||
|
||||
var/temp_access = list() //to prevent agent cards stealing access as permanent
|
||||
var/expiration_time = 0
|
||||
var/reason = "NOT SPECIFIED"
|
||||
|
||||
/obj/item/weapon/card/id/guest/GetAccess()
|
||||
if (world.time > expiration_time)
|
||||
return access
|
||||
else
|
||||
return temp_access
|
||||
|
||||
/obj/item/weapon/card/id/guest/examine()
|
||||
..()
|
||||
if (world.time < expiration_time)
|
||||
usr << "\blue This pass expires at [worldtime2text(expiration_time)]."
|
||||
else
|
||||
usr << "\red It expired at [worldtime2text(expiration_time)]."
|
||||
|
||||
/obj/item/weapon/card/id/guest/read()
|
||||
if (world.time > expiration_time)
|
||||
usr << "This pass expired at [worldtime2text(expiration_time)]."
|
||||
else
|
||||
usr << "This pass expires at [worldtime2text(expiration_time)]."
|
||||
|
||||
usr << "It grants access to following areas:"
|
||||
for (var/A in temp_access)
|
||||
usr << "[get_access_desc(A)]."
|
||||
usr << "Issuing reason: [reason]."
|
||||
return
|
||||
|
||||
/////////////////////////////////////////////
|
||||
//Guest pass terminal////////////////////////
|
||||
/////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/computer/guestpass
|
||||
name = "guest pass terminal"
|
||||
icon_state = "guest"
|
||||
density = 0
|
||||
|
||||
|
||||
var/obj/item/weapon/card/id/giver
|
||||
var/list/accesses = list()
|
||||
var/giv_name = "NOT SPECIFIED"
|
||||
var/reason = "NOT SPECIFIED"
|
||||
var/duration = 0
|
||||
|
||||
var/list/internal_log = list()
|
||||
var/mode = 0 // 0 - making pass, 1 - viewing logs
|
||||
|
||||
/obj/machinery/computer/guestpass/New()
|
||||
..()
|
||||
uid = "[rand(100,999)]-G[rand(10,99)]"
|
||||
|
||||
/obj/machinery/computer/guestpass/attackby(obj/O, mob/user)
|
||||
if(istype(O, /obj/item/weapon/card/id))
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
giver = O
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/guestpass/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/guestpass/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
|
||||
if (mode == 1) //Logs
|
||||
dat += "<h3>Activity log</h3><br>"
|
||||
for (var/entry in internal_log)
|
||||
dat += "[entry]<br><hr>"
|
||||
dat += "<a href='?src=\ref[src];action=print'>Print</a><br>"
|
||||
dat += "<a href='?src=\ref[src];mode=0'>Back</a><br>"
|
||||
else
|
||||
dat += "<h3>Guest pass terminal #[uid]</h3><br>"
|
||||
dat += "<a href='?src=\ref[src];mode=1'>View activity log</a><br><br>"
|
||||
dat += "Issuing ID: <a href='?src=\ref[src];action=id'>[giver]</a><br>"
|
||||
dat += "Issued to: <a href='?src=\ref[src];choice=giv_name'>[giv_name]</a><br>"
|
||||
dat += "Reason: <a href='?src=\ref[src];choice=reason'>[reason]</a><br>"
|
||||
dat += "Duration (minutes): <a href='?src=\ref[src];choice=duration'>[duration] m</a><br>"
|
||||
dat += "Access to areas:<br>"
|
||||
if (giver && giver.access)
|
||||
for (var/A in giver.access)
|
||||
var/area = get_access_desc(A)
|
||||
if (A in accesses)
|
||||
area = "<b>[area]</b>"
|
||||
dat += "<a href='?src=\ref[src];choice=access;access=[A]'>[area]</a><br>"
|
||||
dat += "<br><a href='?src=\ref[src];action=issue'>Issue pass</a><br>"
|
||||
|
||||
user << browse(dat, "window=guestpass;size=400x520")
|
||||
onclose(user, "guestpass")
|
||||
|
||||
|
||||
/obj/machinery/computer/guestpass/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
if (href_list["mode"])
|
||||
mode = text2num(href_list["mode"])
|
||||
|
||||
if (href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if ("giv_name")
|
||||
var/nam = input("Person pass is issued to", "Name", name)
|
||||
if (nam)
|
||||
giv_name = nam
|
||||
if ("reason")
|
||||
var/reas = input("Reason why pass is issued", "Reason", reason)
|
||||
reason = reas
|
||||
if ("duration")
|
||||
var/dur = input("Duration (in minutes) during which pass is valid.", "Duration") as num
|
||||
if (dur > 0 && dur < 30)
|
||||
duration = dur
|
||||
else
|
||||
usr << "\red Invalid duration."
|
||||
if ("access")
|
||||
var/A = text2num(href_list["access"])
|
||||
if (A in accesses)
|
||||
accesses.Remove(A)
|
||||
else
|
||||
accesses.Add(A)
|
||||
if (href_list["action"])
|
||||
switch(href_list["action"])
|
||||
if ("id")
|
||||
if (giver)
|
||||
if(ishuman(usr))
|
||||
giver.loc = usr.loc
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(giver)
|
||||
giver = null
|
||||
else
|
||||
giver.loc = src.loc
|
||||
giver = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
giver = I
|
||||
updateUsrDialog()
|
||||
|
||||
if ("print")
|
||||
var/dat = "<h3>Activity log of guest pass terminal #[uid]</h3><br>"
|
||||
for (var/entry in internal_log)
|
||||
dat += "[entry]<br><hr>"
|
||||
//usr << "Printing the log, standby..."
|
||||
//sleep(50)
|
||||
var/obj/item/weapon/paper/P = new/obj/item/weapon/paper( loc )
|
||||
P.name = "activity log"
|
||||
P.info = dat
|
||||
|
||||
if ("issue")
|
||||
if (giver)
|
||||
var/number = add_zero("[rand(0,9999)]", 4)
|
||||
var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: "
|
||||
for (var/i=1 to accesses.len)
|
||||
var/A = accesses[i]
|
||||
if (A)
|
||||
var/area = get_access_desc(A)
|
||||
entry += "[i > 1 ? ", [area]" : "[area]"]"
|
||||
entry += ". Expires at [worldtime2text(world.time + duration*10*60)]."
|
||||
internal_log.Add(entry)
|
||||
|
||||
var/obj/item/weapon/card/id/guest/pass = new(src.loc)
|
||||
pass.temp_access = accesses.Copy()
|
||||
pass.registered_name = giv_name
|
||||
pass.expiration_time = world.time + duration*10*60
|
||||
pass.reason = reason
|
||||
pass.name = "guest pass #[number]"
|
||||
else
|
||||
usr << "\red Cannot issue pass without issuing ID."
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -83,7 +83,7 @@
|
||||
/datum/medical_effect/headache
|
||||
name = "Headache"
|
||||
triggers = list("cryoxadone" = 10, "bicaridine" = 15, "tricordrazine" = 15)
|
||||
cures = list("alkysine", "tramadol")
|
||||
cures = list("alkysine", "tramadol", "paracetamol", "oxycodone")
|
||||
cure_message = "Your head stops throbbing..."
|
||||
|
||||
/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength)
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
if(!block)
|
||||
|
||||
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
|
||||
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
|
||||
if(smoke.reagents.total_volume)
|
||||
smoke.reagents.reaction(src, INGEST)
|
||||
spawn(5)
|
||||
|
||||
265
code/WorkInProgress/Yinadele/Supermatter.dm
Normal file
265
code/WorkInProgress/Yinadele/Supermatter.dm
Normal file
@@ -0,0 +1,265 @@
|
||||
|
||||
#define NITROGEN_RETARDATION_FACTOR 4 //Higher == N2 slows reaction more
|
||||
#define THERMAL_RELEASE_MODIFIER 10 //Higher == less heat released during reaction
|
||||
#define PLASMA_RELEASE_MODIFIER 1500 //Higher == less plasma released by reaction
|
||||
#define OXYGEN_RELEASE_MODIFIER 750 //Higher == less oxygen released at high temperature/power
|
||||
#define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power
|
||||
|
||||
|
||||
//These would be what you would get at point blank, decreases with distance
|
||||
#define DETONATION_RADS 200
|
||||
#define DETONATION_HALLUCINATION 600
|
||||
|
||||
|
||||
#define WARNING_DELAY 60 //45 seconds between warnings.
|
||||
|
||||
/obj/machinery/power/supermatter
|
||||
name = "Supermatter"
|
||||
desc = "A strangely translucent and iridescent crystal. \red You get headaches just from looking at it."
|
||||
icon = 'icons/obj/engine.dmi'
|
||||
icon_state = "darkmatter"
|
||||
density = 1
|
||||
anchored = 0
|
||||
|
||||
var/gasefficency = 0.25
|
||||
|
||||
var/base_icon_state = "darkmatter"
|
||||
|
||||
var/damage = 0
|
||||
var/damage_archived = 0
|
||||
var/safe_alert = "Crystaline hyperstructure returning to safe operating levels."
|
||||
var/warning_point = 100
|
||||
var/warning_alert = "Danger! Crystal hyperstructure instability!"
|
||||
var/emergency_point = 700
|
||||
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT."
|
||||
var/explosion_point = 1000
|
||||
|
||||
var/emergency_issued = 0
|
||||
|
||||
var/explosion_power = 8
|
||||
|
||||
var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning
|
||||
|
||||
var/power = 0
|
||||
|
||||
//Temporary values so that we can optimize this
|
||||
//How much the bullets damage should be multiplied by when it is added to the internal variables
|
||||
var/config_bullet_energy = 2
|
||||
//How much of the power is left after processing is finished?
|
||||
// var/config_power_reduction_per_tick = 0.5
|
||||
//How much hallucination should it produce per unit of power?
|
||||
var/config_hallucination_power = 0.1
|
||||
|
||||
var/obj/item/device/radio/radio
|
||||
|
||||
shard //Small subtype, less efficient and more sensitive, but less boom.
|
||||
name = "Supermatter Shard"
|
||||
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure. \red You get headaches just from looking at it."
|
||||
icon_state = "darkmatter_shard"
|
||||
base_icon_state = "darkmatter_shard"
|
||||
|
||||
warning_point = 50
|
||||
emergency_point = 500
|
||||
explosion_point = 900
|
||||
|
||||
gasefficency = 0.125
|
||||
|
||||
explosion_power = 3 //3,6,9,12? Or is that too small?
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/New()
|
||||
. = ..()
|
||||
radio = new (src)
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/Del()
|
||||
del radio
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/supermatter/proc/explode()
|
||||
explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1)
|
||||
del src
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter/process()
|
||||
|
||||
var/turf/L = loc
|
||||
|
||||
if(isnull(L)) // We have a null turf...something is wrong, stop processing this entity.
|
||||
return PROCESS_KILL
|
||||
|
||||
if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
|
||||
return //Yeah just stop.
|
||||
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
|
||||
|
||||
if(damage > emergency_point)
|
||||
radio.autosay(emergency_alert, "Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
|
||||
else if(damage >= damage_archived) // The damage is still going up
|
||||
radio.autosay(warning_alert, "Supermatter Monitor")
|
||||
lastwarning = world.timeofday - 150
|
||||
|
||||
else // Phew, we're safe
|
||||
radio.autosay(safe_alert, "Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
|
||||
if(damage > explosion_point)
|
||||
for(var/mob/living/mob in living_mob_list)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
//Hilariously enough, running into a closet should make you get hit the hardest.
|
||||
mob:hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
|
||||
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) )
|
||||
mob.apply_effect(rads, IRRADIATE)
|
||||
|
||||
explode()
|
||||
|
||||
//Ok, get the air from the turf
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
|
||||
//Remove gas from surrounding area
|
||||
var/datum/gas_mixture/removed = env.remove(gasefficency * env.total_moles)
|
||||
|
||||
if(!removed || !removed.total_moles)
|
||||
damage += max((power-1600)/10, 0)
|
||||
power = min(power, 1600)
|
||||
return 1
|
||||
|
||||
if (!removed)
|
||||
return 1
|
||||
|
||||
damage_archived = damage
|
||||
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
|
||||
//Ok, 100% oxygen atmosphere = best reaction
|
||||
//Maxes out at 100% oxygen pressure
|
||||
var/oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
|
||||
|
||||
var/temp_factor = 100
|
||||
|
||||
if(oxygen > 0.8)
|
||||
// with a perfect gas mix, make the power less based on heat
|
||||
icon_state = "[base_icon_state]_glow"
|
||||
else
|
||||
// in normal mode, base the produced energy around the heat
|
||||
temp_factor = 60
|
||||
icon_state = base_icon_state
|
||||
|
||||
power = max( (removed.temperature * temp_factor / T0C) * oxygen + power, 0) //Total laser power plus an overload
|
||||
|
||||
//We've generated power, now let's transfer it to the collectors for storing/usage
|
||||
transfer_energy()
|
||||
|
||||
var/device_energy = power * REACTION_POWER_MODIFIER
|
||||
|
||||
//To figure out how much temperature to add each tick, consider that at one atmosphere's worth
|
||||
//of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature
|
||||
//that the device energy is around 2140. At that stage, we don't want too much heat to be put out
|
||||
//Since the core is effectively "cold"
|
||||
|
||||
//Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock
|
||||
//is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall.
|
||||
removed.temperature += (device_energy / THERMAL_RELEASE_MODIFIER)
|
||||
|
||||
removed.temperature = max(0, min(removed.temperature, 2500))
|
||||
|
||||
//Calculate how much gas to release
|
||||
removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
|
||||
|
||||
removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
|
||||
|
||||
removed.update_values()
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
for(var/mob/living/carbon/human/l in view(src, round(power ** 0.25))) // you have to be seeing the core to get hallucinations
|
||||
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
|
||||
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) )
|
||||
|
||||
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
|
||||
var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) )
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
power -= (power/500)**3
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet")
|
||||
power += Proj.damage * config_bullet_energy
|
||||
else
|
||||
damage += Proj.damage * config_bullet_energy
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/attack_robot(mob/user as mob)
|
||||
if(Adjacent(user))
|
||||
return attack_hand(user)
|
||||
else
|
||||
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter/attack_ai(mob/user as mob)
|
||||
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
|
||||
|
||||
/obj/machinery/power/supermatter/attack_hand(mob/user as mob)
|
||||
user.visible_message("<span class=\"warning\">\The [user] reaches out and touches \the [src], inducing a resonance... \his body starts to glow and bursts into flames before flashing into ash.</span>",\
|
||||
"<span class=\"danger\">You reach out and touch \the [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"</span>",\
|
||||
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
|
||||
|
||||
Consume(user)
|
||||
|
||||
/obj/machinery/power/supermatter/proc/transfer_energy()
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
if(get_dist(R, src) <= 15) // Better than using orange() every process
|
||||
R.receive_pulse(power)
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
|
||||
user.visible_message("<span class=\"warning\">\The [user] touches \a [W] to \the [src] as a silence fills the room...</span>",\
|
||||
"<span class=\"danger\">You touch \the [W] to \the [src] when everything suddenly goes silent.\"</span>\n<span class=\"notice\">\The [W] flashes into dust as you flinch away from \the [src].</span>",\
|
||||
"<span class=\"warning\">Everything suddenly goes silent.</span>")
|
||||
|
||||
user.drop_from_inventory(W)
|
||||
Consume(W)
|
||||
|
||||
user.apply_effect(150, IRRADIATE)
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/Bumped(atom/AM as mob|obj)
|
||||
if(istype(AM, /mob/living))
|
||||
AM.visible_message("<span class=\"warning\">\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.</span>",\
|
||||
"<span class=\"danger\">You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
|
||||
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
|
||||
else
|
||||
AM.visible_message("<span class=\"warning\">\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class=\"warning\">You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
|
||||
Consume(AM)
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter/proc/Consume(var/mob/living/user)
|
||||
if(istype(user))
|
||||
user.dust()
|
||||
power += 200
|
||||
else
|
||||
del user
|
||||
|
||||
power += 200
|
||||
|
||||
//Some poor sod got eaten, go ahead and irradiate people nearby.
|
||||
for(var/mob/living/l in range(10))
|
||||
if(l in view())
|
||||
l.show_message("<span class=\"warning\">As \the [src] slowly stops resonating, you find your skin covered in new radiation burns.</span>", 1,\
|
||||
"<span class=\"warning\">The unearthly ringing subsides and you notice you have new radiation burns.</span>", 2)
|
||||
else
|
||||
l.show_message("<span class=\"warning\">You hear an uneartly ringing and notice your skin is covered in fresh radiation burns.</span>", 2)
|
||||
var/rads = 500 * sqrt( 1 / (get_dist(l, src) + 1) )
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
screen_loc = "NORTH,WEST+2"
|
||||
var/varholder = "name"
|
||||
var/valueholder = "derp"
|
||||
var/objholder = "/obj/structure/closet"
|
||||
var/objholder = /obj/structure/closet
|
||||
|
||||
Click(location, control, params)
|
||||
var/list/pa = params2list(params)
|
||||
@@ -145,13 +145,13 @@
|
||||
if(1)
|
||||
return 1
|
||||
if(2)
|
||||
objholder = input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet")
|
||||
var/list/removed_paths = list("/obj/effect/bhole")
|
||||
if(objholder in removed_paths)
|
||||
objholder = text2path(input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet"))
|
||||
if(!ispath(objholder))
|
||||
objholder = /obj/structure/closet
|
||||
alert("That path is not allowed.")
|
||||
objholder = "/obj/structure/closet"
|
||||
else if (dd_hasprefix(objholder, "/mob") && !check_rights(R_DEBUG,0))
|
||||
objholder = "/obj/structure/closet"
|
||||
else
|
||||
if(ispath(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")
|
||||
|
||||
@@ -234,8 +234,12 @@
|
||||
WIN.dir = NORTHWEST
|
||||
if(2)
|
||||
if(pa.Find("left"))
|
||||
var/obj/A = new holder.buildmode.objholder (get_turf(object))
|
||||
A.dir = holder.builddir.dir
|
||||
if(ispath(holder.buildmode.objholder,/turf))
|
||||
var/turf/T = get_turf(object)
|
||||
T.ChangeTurf(holder.buildmode.objholder)
|
||||
else
|
||||
var/obj/A = new holder.buildmode.objholder (get_turf(object))
|
||||
A.dir = holder.builddir.dir
|
||||
else if(pa.Find("right"))
|
||||
if(isobj(object)) del(object)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ datum/controller/game_controller/New()
|
||||
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
|
||||
if(!ticker) ticker = new /datum/controller/gameticker()
|
||||
if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle()
|
||||
|
||||
if(artifact_spawn) artifact_spawning_turfs = artifact_spawn
|
||||
|
||||
datum/controller/game_controller/proc/setup()
|
||||
world.tick_lag = config.Ticklag
|
||||
|
||||
@@ -65,6 +65,6 @@
|
||||
P.set_up(10,location)
|
||||
P.start()
|
||||
spawn(5)
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/S = new/datum/effect/effect/system/harmless_smoke_spread()
|
||||
var/datum/effect/effect/system/smoke_spread/S = new/datum/effect/effect/system/smoke_spread()
|
||||
S.set_up(5,0,location,null)
|
||||
S.start()
|
||||
@@ -1,19 +1,35 @@
|
||||
var/list/obj/machinery/faxmachine/allfaxes = list()
|
||||
var/list/alldepartments = list("Central Command")
|
||||
|
||||
/obj/machinery/faxmachine
|
||||
name = "fax machine"
|
||||
icon = 'icons/obj/library.dmi'
|
||||
icon_state = "fax"
|
||||
req_access = list(access_lawyer)
|
||||
req_one_access = list(access_lawyer, access_heads)
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 30
|
||||
active_power_usage = 200
|
||||
power_channel = EQUIP
|
||||
|
||||
var/obj/item/weapon/card/id/scan = null // identification
|
||||
var/authenticated = 0
|
||||
var/obj/item/weapon/paper/tofax = null // what we're sending to central
|
||||
|
||||
var/obj/item/weapon/paper/tofax = null // what we're sending
|
||||
var/sendcooldown = 0 // to avoid spamming fax messages
|
||||
|
||||
var/department = "Unknown" // our department
|
||||
|
||||
var/dpt = "Central Command" // the department we're sending to
|
||||
|
||||
/obj/machinery/faxmachine/New()
|
||||
..()
|
||||
allfaxes += src
|
||||
|
||||
if( !("[department]" in alldepartments) )
|
||||
alldepartments += department
|
||||
|
||||
/obj/machinery/faxmachine/process()
|
||||
return 0
|
||||
|
||||
@@ -26,7 +42,7 @@
|
||||
/obj/machinery/faxmachine/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "Central Command Fax Machine<BR>"
|
||||
var/dat = "Fax Machine<BR>"
|
||||
|
||||
var/scan_name
|
||||
if(scan)
|
||||
@@ -54,14 +70,15 @@
|
||||
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];send=1'>Send</a><br>"
|
||||
dat += "<b>Currently sending:</b> [tofax.name]"
|
||||
dat += "<b>Currently sending:</b> [tofax.name]<br>"
|
||||
dat += "<b>Sending to:</b> <a href='byond://?src=\ref[src];dept=1'>[dpt]</a><br>"
|
||||
|
||||
else
|
||||
if(sendcooldown)
|
||||
dat += "Please insert paper to send to Central Command via secure connection.<br><br>"
|
||||
dat += "Please insert paper to send via secure connection.<br><br>"
|
||||
dat += "<b>Transmitter arrays realigning. Please stand by.</b><br>"
|
||||
else
|
||||
dat += "Please insert paper to send to Central Command via secure connection.<br><br>"
|
||||
dat += "Please insert paper to send via secure connection.<br><br>"
|
||||
|
||||
else
|
||||
dat += "Proper authentication is required to use this device.<br><br>"
|
||||
@@ -76,18 +93,29 @@
|
||||
/obj/machinery/faxmachine/Topic(href, href_list)
|
||||
if(href_list["send"])
|
||||
if(tofax)
|
||||
Centcomm_fax(tofax.info, tofax.name, usr)
|
||||
usr << "Message transmitted."
|
||||
sendcooldown = 1
|
||||
spawn(3000) // three minute cooldown. might mess with this number a bit as time goes on
|
||||
|
||||
if(dpt == "Central Command")
|
||||
Centcomm_fax(tofax.info, tofax.name, usr)
|
||||
sendcooldown = 1800
|
||||
|
||||
else
|
||||
SendFax(tofax.info, tofax.name, usr, dpt)
|
||||
sendcooldown = 600
|
||||
|
||||
usr << "Message transmitted successfully."
|
||||
|
||||
spawn(sendcooldown) // cooldown time
|
||||
sendcooldown = 0
|
||||
|
||||
if(href_list["remove"])
|
||||
if(tofax)
|
||||
tofax.loc = usr.loc
|
||||
usr.put_in_hands(tofax)
|
||||
usr << "<span class='notice'>You take the paper out of \the [src].</span>"
|
||||
tofax = null
|
||||
if(!ishuman(usr))
|
||||
usr << "<span class='warning'>You can't do it.</span>"
|
||||
else
|
||||
tofax.loc = usr.loc
|
||||
usr.put_in_hands(tofax)
|
||||
usr << "<span class='notice'>You take the paper out of \the [src].</span>"
|
||||
tofax = null
|
||||
|
||||
if(href_list["scan"])
|
||||
if (scan)
|
||||
@@ -107,6 +135,9 @@
|
||||
scan = I
|
||||
authenticated = 0
|
||||
|
||||
if(href_list["dept"])
|
||||
dpt = input(usr, "Which department?", "Choose a department", "") as null|anything in alldepartments
|
||||
|
||||
if(href_list["auth"])
|
||||
if ( (!( authenticated ) && (scan)) )
|
||||
if (check_access(scan))
|
||||
@@ -148,3 +179,20 @@
|
||||
|
||||
var/msg = "\blue <b><font color='orange'>CENTCOMM FAX: </font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<a href='?_src_=holder;CentcommFaxReply=\ref[Sender]'>RPLY</a>)</b>: Receiving '[sentname]' via secure connection ... <a href='?_src_=holder;CentcommFaxView=\ref[sent]'>view message</a>"
|
||||
admins << msg
|
||||
|
||||
proc/SendFax(var/sent, var/sentname, var/mob/Sender, var/dpt)
|
||||
|
||||
for(var/obj/machinery/faxmachine/F in allfaxes)
|
||||
if( F.department == dpt )
|
||||
if(! (F.stat & (BROKEN|NOPOWER) ) )
|
||||
|
||||
flick("faxreceive", F)
|
||||
|
||||
// give the sprite some time to flick
|
||||
spawn(20)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( F.loc )
|
||||
P.name = "[sentname]"
|
||||
P.info = "[sent]"
|
||||
P.update_icon()
|
||||
|
||||
playsound(F.loc, "sound/items/polaroid1.ogg", 50, 1)
|
||||
|
||||
@@ -134,6 +134,7 @@ zone/proc/DebugDisplay(client/client)
|
||||
|
||||
|
||||
client/proc/TestZASRebuild()
|
||||
set category = "Debug"
|
||||
// var/turf/turf = get_turf(mob)
|
||||
var/zone/current_zone = mob.loc:zone
|
||||
if(!current_zone)
|
||||
@@ -155,7 +156,7 @@ client/proc/TestZASRebuild()
|
||||
|
||||
for(var/direction in cardinal)
|
||||
var/turf/simulated/adjacent = get_step(current, direction)
|
||||
if(!current.ZAirPass(adjacent))
|
||||
if(!current.ZCanPass(adjacent))
|
||||
continue
|
||||
if(turfs.Find(adjacent))
|
||||
current_adjacents += adjacent
|
||||
@@ -210,4 +211,9 @@ client/proc/TestZASRebuild()
|
||||
for(var/turf/current in turfs)
|
||||
current.overlays -= overlays
|
||||
|
||||
return final_arrangement
|
||||
return final_arrangement
|
||||
|
||||
/client/proc/ZASSettings()
|
||||
set category = "Debug"
|
||||
|
||||
vsc.SetDefault(mob)
|
||||
@@ -14,6 +14,20 @@ What are the archived variables for?
|
||||
#define QUANTIZE(variable) (round(variable,0.0001))
|
||||
#define TRANSFER_FRACTION 5 //What fraction (1/#) of the air difference to try and transfer
|
||||
|
||||
/hook/startup/proc/createGasOverlays()
|
||||
plmaster = new /obj/effect/overlay()
|
||||
plmaster.icon = 'icons/effects/tile_effects.dmi'
|
||||
plmaster.icon_state = "plasma"
|
||||
plmaster.layer = FLY_LAYER
|
||||
plmaster.mouse_opacity = 0
|
||||
|
||||
slmaster = new /obj/effect/overlay()
|
||||
slmaster.icon = 'icons/effects/tile_effects.dmi'
|
||||
slmaster.icon_state = "sleeping_agent"
|
||||
slmaster.layer = FLY_LAYER
|
||||
slmaster.mouse_opacity = 0
|
||||
return 1
|
||||
|
||||
/datum/gas/sleeping_agent/specific_heat = 40 //These are used for the "Trace Gases" stuff, but is buggy.
|
||||
|
||||
/datum/gas/oxygen_agent_b/specific_heat = 300
|
||||
|
||||
@@ -75,12 +75,12 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
|
||||
|
||||
//since the air is processed in fractions, we need to make sure not to have any minuscle residue or
|
||||
//the amount of moles might get to low for some functions to catch them and thus result in wonky behaviour
|
||||
if(air_contents.oxygen < 0.001)
|
||||
if(air_contents.oxygen < 0.1)
|
||||
air_contents.oxygen = 0
|
||||
if(air_contents.toxins < 0.001)
|
||||
if(air_contents.toxins < 0.1)
|
||||
air_contents.toxins = 0
|
||||
if(fuel)
|
||||
if(fuel.moles < 0.001)
|
||||
if(fuel.moles < 0.1)
|
||||
air_contents.trace_gases.Remove(fuel)
|
||||
|
||||
//check if there is something to combust
|
||||
@@ -200,7 +200,7 @@ datum/gas_mixture/proc/zburn(obj/effect/decal/cleanable/liquid_fuel/liquid, forc
|
||||
|
||||
if(liquid)
|
||||
//Liquid Fuel
|
||||
if(liquid.amount <= 0)
|
||||
if(liquid.amount <= 0.1)
|
||||
del liquid
|
||||
else
|
||||
total_fuel += liquid.amount
|
||||
@@ -257,9 +257,9 @@ datum/gas_mixture/proc/check_recombustability(obj/effect/decal/cleanable/liquid_
|
||||
if(oxygen && (toxins || fuel || liquid))
|
||||
if(liquid)
|
||||
return 1
|
||||
if (toxins)
|
||||
if(toxins >= 0.1)
|
||||
return 1
|
||||
if(fuel)
|
||||
if(fuel && fuel.moles >= 0.1)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
@@ -272,9 +272,9 @@ datum/gas_mixture/proc/check_combustability(obj/effect/decal/cleanable/liquid_fu
|
||||
if(oxygen && (toxins || fuel || liquid))
|
||||
if(liquid)
|
||||
return 1
|
||||
if (toxins >= 0.7)
|
||||
if (toxins >= 0.1)
|
||||
return 1
|
||||
if(fuel && fuel.moles >= 1.4)
|
||||
if(fuel && fuel.moles >= 0.1)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
@@ -118,12 +118,12 @@ obj/var/contaminated = 0
|
||||
/mob/living/carbon/human/proc/burn_eyes()
|
||||
//The proc that handles eye burning.
|
||||
if(prob(20)) src << "\red Your eyes burn!"
|
||||
eye_stat += 2.5
|
||||
var/datum/organ/internal/eyes/E = internal_organs["eyes"]
|
||||
E.damage += 2.5
|
||||
eye_blurry = min(eye_blurry+1.5,50)
|
||||
if (prob(max(0,eye_stat - 20) + 1) &&!eye_blind)
|
||||
if (prob(max(0,E.damage - 15) + 1) &&!eye_blind)
|
||||
src << "\red You are blinded!"
|
||||
eye_blind += 20
|
||||
eye_stat = 0
|
||||
|
||||
/mob/living/carbon/human/proc/pl_head_protected()
|
||||
//Checks if the head is adequately sealed.
|
||||
|
||||
@@ -67,7 +67,7 @@ var/global/vs_control/vsc = new
|
||||
|
||||
var/connection_insulation = 1
|
||||
var/connection_insulation_NAME = "Connections - Insulation"
|
||||
var/connection_insulation_DESC = "How insulative a connection is, in terms of heat transfer. 1 is perfectly insulative, and 0 is perfectly conductive."
|
||||
var/connection_insulation_DESC = "Boolean, should doors forbid heat transfer?"
|
||||
|
||||
var/connection_temperature_delta = 10
|
||||
var/connection_temperature_delta_NAME = "Connections - Temperature Difference"
|
||||
@@ -288,6 +288,7 @@ var/global/vs_control/vsc = new
|
||||
airflow_speed_decay = 1
|
||||
airflow_delay = 20
|
||||
airflow_mob_slowdown = 3
|
||||
connection_insulation = 0
|
||||
|
||||
|
||||
world << "\blue <b>[key_name(user)] changed the global plasma/ZAS settings to \"[def]\"</b>"
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
|
||||
/turf/simulated/var/tmp/datum/gas_mixture/air
|
||||
|
||||
/turf/simulated/var/tmp/processing = 1
|
||||
|
||||
/turf/simulated/var/tmp/air_check_directions = 0 //Do not modify this, just add turf to air_master.tiles_to_update
|
||||
|
||||
/turf/simulated/var/tmp/unsim_check_directions = 0 //See above.
|
||||
@@ -61,8 +59,6 @@
|
||||
overlays.Add(slmaster)
|
||||
|
||||
/turf/simulated/New()
|
||||
..()
|
||||
|
||||
if(!blocks_air)
|
||||
air = new
|
||||
|
||||
@@ -84,6 +80,8 @@
|
||||
if(istype(target))
|
||||
air_master.tiles_to_update |= target
|
||||
|
||||
. = ..()
|
||||
|
||||
/turf/simulated/Del()
|
||||
if(active_hotspot)
|
||||
del(active_hotspot)
|
||||
@@ -168,23 +166,73 @@
|
||||
if(src in air_master.turfs_with_connections)
|
||||
air_master.AddConnectionToCheck(air_master.turfs_with_connections[src])
|
||||
|
||||
if(zone && CanPass(null, src, 0, 0))
|
||||
|
||||
if(zone && !air_master.zones_needing_rebuilt.Find(zone))
|
||||
for(var/direction in cardinal)
|
||||
var/turf/T = get_step(src,direction)
|
||||
if(!istype(T))
|
||||
continue
|
||||
|
||||
//I can connect to air or space in this direction
|
||||
if((air_check_directions & direction && !(air_directions_archived & direction)) || \
|
||||
(unsim_check_directions & direction && !(unsim_directions_archived & direction)))
|
||||
ZConnect(src,T)
|
||||
zone.ActivateIfNeeded()
|
||||
if(T.zone) T.zone.ActivateIfNeeded()
|
||||
//I can connect to air in this direction
|
||||
if(air_check_directions & direction || unsim_check_directions & direction)
|
||||
|
||||
//If either block air, we must look to see if the adjacent turfs need rebuilt.
|
||||
if(!CanPass(null, T, 0, 0))
|
||||
|
||||
//Target blocks air
|
||||
if(!T.CanPass(null, T, 0, 0))
|
||||
var/turf/NT = get_step(T, direction)
|
||||
|
||||
//If that turf is in my zone still, rebuild.
|
||||
if(istype(NT,/turf/simulated) && NT in zone.contents)
|
||||
air_master.zones_needing_rebuilt.Add(zone)
|
||||
|
||||
//If that is an unsimulated tile in my zone, see if we need to rebuild or just remove.
|
||||
else if(istype(NT) && NT in zone.unsimulated_tiles)
|
||||
var/consider_rebuild = 0
|
||||
for(var/d in cardinal)
|
||||
var/turf/UT = get_step(NT,d)
|
||||
if(istype(UT, /turf/simulated) && UT.zone == zone && UT.CanPass(null, NT, 0, 0)) //If we find a neighboring tile that is in the same zone, check if we need to rebuild
|
||||
consider_rebuild = 1
|
||||
break
|
||||
if(consider_rebuild)
|
||||
air_master.zones_needing_rebuilt.Add(zone) //Gotta check if we need to rebuild, dammit
|
||||
else
|
||||
zone.RemoveTurf(NT) //Not adjacent to anything, and unsimulated. Goodbye~
|
||||
|
||||
//To make a closed connection through closed door.
|
||||
ZConnect(T, src)
|
||||
|
||||
//If I block air.
|
||||
else if(T.zone && !air_master.zones_needing_rebuilt.Find(T.zone))
|
||||
var/turf/NT = get_step(src, reverse_direction(direction))
|
||||
|
||||
//If I am splitting a zone, rebuild.
|
||||
if(istype(NT,/turf/simulated) && (NT in T.zone.contents || (NT.zone && T in NT.zone.contents)))
|
||||
air_master.zones_needing_rebuilt.Add(T.zone)
|
||||
|
||||
//If NT is unsimulated, parse if I should remove it or rebuild.
|
||||
else if(istype(NT) && NT in T.zone.unsimulated_tiles)
|
||||
var/consider_rebuild = 0
|
||||
for(var/d in cardinal)
|
||||
var/turf/UT = get_step(NT,d)
|
||||
if(istype(UT, /turf/simulated) && UT.zone == T.zone && UT.CanPass(null, NT, 0, 0)) //If we find a neighboring tile that is in the same zone, check if we need to rebuild
|
||||
consider_rebuild = 1
|
||||
break
|
||||
|
||||
//Needs rebuilt.
|
||||
if(consider_rebuild)
|
||||
air_master.zones_needing_rebuilt.Add(T.zone)
|
||||
|
||||
//Not adjacent to anything, and unsimulated. Goodbye~
|
||||
else
|
||||
T.zone.RemoveTurf(NT)
|
||||
|
||||
else
|
||||
//Produce connection through open door.
|
||||
ZConnect(src,T)
|
||||
|
||||
//Something like a wall was built, changing the geometry.
|
||||
else if((!(air_check_directions & direction) && air_directions_archived & direction) || \
|
||||
(!(unsim_check_directions & direction) && unsim_directions_archived & direction))
|
||||
else if(air_directions_archived & direction || unsim_directions_archived & direction)
|
||||
var/turf/NT = get_step(T, direction)
|
||||
|
||||
//If the tile is in our own zone, and we cannot connect to it, better rebuild.
|
||||
@@ -207,16 +255,12 @@
|
||||
//The unsimulated turf is adjacent to another one of our zone's turfs,
|
||||
// better rebuild to be sure we didn't get cut in twain
|
||||
if(consider_rebuild)
|
||||
air_master.zones_needing_rebuilt.Add(zone)
|
||||
air_master.zones_needing_rebuilt.Add(NT.zone)
|
||||
|
||||
//Not adjacent to anything, and unsimulated. Goodbye~
|
||||
else
|
||||
zone.RemoveTurf(NT)
|
||||
|
||||
if(air_check_directions)
|
||||
processing = 1
|
||||
else
|
||||
processing = 0
|
||||
return 1
|
||||
|
||||
/turf/proc/HasDoor(turf/O)
|
||||
|
||||
@@ -27,7 +27,6 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
var/interactions_with_unsim = 0
|
||||
var/progress = "nothing"
|
||||
|
||||
|
||||
//CREATION AND DELETION
|
||||
/zone/New(turf/start)
|
||||
. = ..()
|
||||
@@ -47,14 +46,23 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
|
||||
//Generate the gas_mixture for use in txhis zone by using the average of the gases
|
||||
//defined at startup.
|
||||
//Changed to try and find the source of the error.
|
||||
air = new
|
||||
air.group_multiplier = contents.len
|
||||
for(var/turf/simulated/T in contents)
|
||||
air.oxygen += T.oxygen / air.group_multiplier
|
||||
air.nitrogen += T.nitrogen / air.group_multiplier
|
||||
air.carbon_dioxide += T.carbon_dioxide / air.group_multiplier
|
||||
air.toxins += T.toxins / air.group_multiplier
|
||||
air.temperature += T.temperature / air.group_multiplier
|
||||
if(!T.air)
|
||||
continue
|
||||
air.oxygen += T.air.oxygen / air.group_multiplier
|
||||
air.nitrogen += T.air.nitrogen / air.group_multiplier
|
||||
air.carbon_dioxide += T.air.carbon_dioxide / air.group_multiplier
|
||||
air.toxins += T.air.toxins / air.group_multiplier
|
||||
air.temperature += T.air.temperature / air.group_multiplier
|
||||
for(var/datum/gas/trace in T.air.trace_gases)
|
||||
var/datum/gas/corresponding_gas = locate(trace.type) in air.trace_gases
|
||||
if(!corresponding_gas)
|
||||
corresponding_gas = new trace.type()
|
||||
air.trace_gases.Add(corresponding_gas)
|
||||
corresponding_gas.moles += trace.moles
|
||||
air.update_values()
|
||||
|
||||
//Add this zone to the global list.
|
||||
@@ -69,40 +77,57 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
for(var/turf/simulated/T in contents)
|
||||
RemoveTurf(T)
|
||||
air_master.ReconsiderTileZone(T)
|
||||
for(var/zone/Z in connected_zones)
|
||||
if(src in Z.connected_zones)
|
||||
Z.connected_zones.Remove(src)
|
||||
air_master.AddConnectionToCheck(connections)
|
||||
|
||||
if(air_master)
|
||||
air_master.zones.Remove(src)
|
||||
air_master.active_zones.Remove(src)
|
||||
air_master.zones_needing_rebuilt.Remove(src)
|
||||
air_master.AddConnectionToCheck(connections)
|
||||
|
||||
air = null
|
||||
|
||||
. = ..()
|
||||
|
||||
|
||||
//Handles deletion via garbage collection.
|
||||
/zone/proc/SoftDelete()
|
||||
air = null
|
||||
|
||||
if(air_master)
|
||||
air_master.zones.Remove(src)
|
||||
air_master.active_zones.Remove(src)
|
||||
air_master.zones_needing_rebuilt.Remove(src)
|
||||
air = null
|
||||
air_master.AddConnectionToCheck(connections)
|
||||
|
||||
connections = null
|
||||
for(var/connection/C in direct_connections)
|
||||
if(C.A.zone == src)
|
||||
C.A.zone = null
|
||||
if(C.B.zone == src)
|
||||
C.B.zone = null
|
||||
if(C.zone_A == src)
|
||||
C.zone_A = null
|
||||
if(C.zone_B == src)
|
||||
C.zone_B = null
|
||||
direct_connections = null
|
||||
|
||||
//Ensuring the zone list doesn't get clogged with null values.
|
||||
for(var/turf/simulated/T in contents)
|
||||
RemoveTurf(T)
|
||||
air_master.ReconsiderTileZone(T)
|
||||
|
||||
contents.Cut()
|
||||
|
||||
//Removing zone connections and scheduling connection cleanup
|
||||
for(var/zone/Z in connected_zones)
|
||||
if(src in Z.connected_zones)
|
||||
Z.connected_zones.Remove(src)
|
||||
connected_zones = null
|
||||
Z.connected_zones.Remove(src)
|
||||
if(!Z.connected_zones.len)
|
||||
Z.connected_zones = null
|
||||
|
||||
air_master.AddConnectionToCheck(connections)
|
||||
connections = null
|
||||
if(Z.closed_connection_zones)
|
||||
Z.closed_connection_zones.Remove(src)
|
||||
if(!Z.closed_connection_zones.len)
|
||||
Z.closed_connection_zones = null
|
||||
|
||||
connected_zones = null
|
||||
closed_connection_zones = null
|
||||
|
||||
return 1
|
||||
|
||||
@@ -161,6 +186,10 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
if(!unsim_air_needs_update && air_unsim) //if air_unsim doesn't exist, we need to create it even if we don't need an update.
|
||||
return
|
||||
|
||||
//Tempfix.
|
||||
if(!air)
|
||||
return
|
||||
|
||||
unsim_air_needs_update = 0
|
||||
|
||||
if(!air_unsim)
|
||||
@@ -340,25 +369,26 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
Z.interactions_with_neighbors++
|
||||
interactions_with_neighbors++
|
||||
|
||||
for(var/zone/Z in closed_connection_zones)
|
||||
//If that zone has already processed, skip it.
|
||||
if(Z.last_update > last_update)
|
||||
continue
|
||||
|
||||
var/handle_temperature = abs(air.temperature - Z.air.temperature) > vsc.connection_temperature_delta
|
||||
|
||||
if(Z.status == ZONE_SLEEPING)
|
||||
if (handle_temperature)
|
||||
Z.SetStatus(ZONE_ACTIVE)
|
||||
else
|
||||
if(!vsc.connection_insulation)
|
||||
for(var/zone/Z in closed_connection_zones)
|
||||
//If that zone has already processed, skip it.
|
||||
if(Z.last_update > last_update || !Z.air)
|
||||
continue
|
||||
|
||||
if(air && Z.air)
|
||||
if( handle_temperature )
|
||||
ShareHeat(air, Z.air, closed_connection_zones[Z])
|
||||
var/handle_temperature = abs(air.temperature - Z.air.temperature) > vsc.connection_temperature_delta
|
||||
|
||||
Z.interactions_with_neighbors++
|
||||
interactions_with_neighbors++
|
||||
if(Z.status == ZONE_SLEEPING)
|
||||
if (handle_temperature)
|
||||
Z.SetStatus(ZONE_ACTIVE)
|
||||
else
|
||||
continue
|
||||
|
||||
if(air && Z.air)
|
||||
if( handle_temperature )
|
||||
ShareHeat(air, Z.air, closed_connection_zones[Z])
|
||||
|
||||
Z.interactions_with_neighbors++
|
||||
interactions_with_neighbors++
|
||||
|
||||
if(!interactions_with_neighbors && !interactions_with_unsim)
|
||||
SetStatus(ZONE_SLEEPING)
|
||||
@@ -633,6 +663,18 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
|
||||
|
||||
|
||||
proc/ShareHeat(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
|
||||
//This implements a simplistic version of the Stefan-Boltzmann law.
|
||||
var/energy_delta = ((A.temperature - B.temperature) ** 4) * 5.6704e-8 * connecting_tiles * 2.5
|
||||
var/maximum_energy_delta = max(0, min(A.temperature * A.heat_capacity() * A.group_multiplier, B.temperature * B.heat_capacity() * B.group_multiplier))
|
||||
if(maximum_energy_delta > abs(energy_delta))
|
||||
if(energy_delta < 0)
|
||||
maximum_energy_delta *= -1
|
||||
energy_delta = maximum_energy_delta
|
||||
|
||||
A.temperature -= energy_delta / (A.heat_capacity() * A.group_multiplier)
|
||||
B.temperature += energy_delta / (B.heat_capacity() * B.group_multiplier)
|
||||
|
||||
/* This was bad an I feel bad.
|
||||
//Shares a specific ratio of gas between mixtures using simple weighted averages.
|
||||
var
|
||||
//WOOT WOOT TOUCH THIS AND YOU ARE A RETARD
|
||||
@@ -655,7 +697,7 @@ proc/ShareHeat(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
|
||||
|
||||
A.temperature = max(0, (A.temperature - temp_avg) * (1- (ratio / max(1,A.group_multiplier)) ) + temp_avg )
|
||||
B.temperature = max(0, (B.temperature - temp_avg) * (1- (ratio / max(1,B.group_multiplier)) ) + temp_avg )
|
||||
|
||||
*/
|
||||
|
||||
///////////////////
|
||||
//Zone Rebuilding//
|
||||
@@ -715,9 +757,9 @@ zone/proc/Rebuild()
|
||||
current_adjacents = list()
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if( !(current.air_check_directions & direction))
|
||||
continue
|
||||
var/turf/simulated/adjacent = get_step(current, direction)
|
||||
if(!current.ZCanPass(adjacent))
|
||||
continue
|
||||
if(adjacent in turfs)
|
||||
current_adjacents += adjacent
|
||||
adjacent_id = turfs[adjacent]
|
||||
@@ -747,6 +789,9 @@ zone/proc/Rebuild()
|
||||
final_arrangement[current_identifier] = list(current)
|
||||
|
||||
else
|
||||
//Sanity check.
|
||||
if(!islist(final_arrangement[current_identifier]))
|
||||
final_arrangement[current_identifier] = list()
|
||||
final_arrangement[current_identifier] += current
|
||||
|
||||
//lazy but fast
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
if(client_check && !M.client)
|
||||
L = recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
|
||||
L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
|
||||
continue
|
||||
if(sight_check && !isInSight(A, O))
|
||||
continue
|
||||
@@ -155,7 +155,7 @@
|
||||
L |= A
|
||||
|
||||
if(isobj(A) || ismob(A))
|
||||
L = recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
|
||||
L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
|
||||
return L
|
||||
|
||||
// The old system would loop through lists for a total of 5000 per function call, in an empty server.
|
||||
@@ -182,7 +182,7 @@
|
||||
hear += A
|
||||
|
||||
if(isobj(A) || ismob(A))
|
||||
hear = recursive_mob_check(A, hear, 3, 1, 0, 1)
|
||||
hear |= recursive_mob_check(A, hear, 3, 1, 0, 1)
|
||||
|
||||
return hear
|
||||
|
||||
@@ -209,8 +209,9 @@
|
||||
if(M)
|
||||
var/turf/ear = get_turf(M)
|
||||
if(ear)
|
||||
if(speaker_coverage[ear])
|
||||
. |= M
|
||||
// Ghostship is magic: Ghosts can hear radio chatter from anywhere
|
||||
if(speaker_coverage[ear] || (istype(M, /mob/dead/observer) && (M.client) && (M.client.prefs.toggles & CHAT_GHOSTRADIO)))
|
||||
. |= M // Since we're already looping through mobs, why bother using |= ? This only slows things down.
|
||||
return .
|
||||
|
||||
#define SIGN(X) ((X<0)?-1:1)
|
||||
@@ -327,3 +328,41 @@ proc/isInSight(var/atom/A, var/atom/B)
|
||||
spawn(delay)
|
||||
for(var/client/C in group)
|
||||
C.screen -= O
|
||||
|
||||
datum/projectile_data
|
||||
var/src_x
|
||||
var/src_y
|
||||
var/time
|
||||
var/distance
|
||||
var/power_x
|
||||
var/power_y
|
||||
var/dest_x
|
||||
var/dest_y
|
||||
|
||||
/datum/projectile_data/New(var/src_x, var/src_y, var/time, var/distance, \
|
||||
var/power_x, var/power_y, var/dest_x, var/dest_y)
|
||||
src.src_x = src_x
|
||||
src.src_y = src_y
|
||||
src.time = time
|
||||
src.distance = distance
|
||||
src.power_x = power_x
|
||||
src.power_y = power_y
|
||||
src.dest_x = dest_x
|
||||
src.dest_y = dest_y
|
||||
|
||||
/proc/projectile_trajectory(var/src_x, var/src_y, var/rotation, var/angle, var/power)
|
||||
|
||||
// returns the destination (Vx,y) that a projectile shot at [src_x], [src_y], with an angle of [angle],
|
||||
// rotated at [rotation] and with the power of [power]
|
||||
// Thanks to VistaPOWA for this function
|
||||
|
||||
var/power_x = power * cos(angle)
|
||||
var/power_y = power * sin(angle)
|
||||
var/time = 2* power_y / 10 //10 = g
|
||||
|
||||
var/distance = time * power_x
|
||||
|
||||
var/dest_x = src_x + distance*sin(rotation);
|
||||
var/dest_y = src_y + distance*cos(rotation);
|
||||
|
||||
return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)
|
||||
|
||||
@@ -42,7 +42,7 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
|
||||
/////Initial Building/////
|
||||
//////////////////////////
|
||||
|
||||
/proc/make_datum_references_lists()
|
||||
/hook/startup/proc/makeDatumRefLists()
|
||||
var/list/paths
|
||||
|
||||
//Hair - Initialise all /datum/sprite_accessory/hair into an list indexed by hair-style name
|
||||
@@ -94,9 +94,11 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
|
||||
var/datum/species/S = new T
|
||||
all_species[S.name] = S
|
||||
|
||||
if(S.flags & WHITELISTED)
|
||||
if(S.flags & IS_WHITELISTED)
|
||||
whitelisted_species += S.name
|
||||
|
||||
return 1
|
||||
|
||||
/* // Uncomment to debug chemical reaction list.
|
||||
/client/verb/debug_chemical_list()
|
||||
|
||||
|
||||
@@ -773,4 +773,14 @@ proc
|
||||
for(var/O in A.overlays)
|
||||
var/image/I = O
|
||||
composite.Blend(icon(I.icon, I.icon_state, I.dir, 1), ICON_OVERLAY)
|
||||
return composite
|
||||
return composite
|
||||
|
||||
proc/adjust_brightness(var/color, var/value)
|
||||
if (!color) return "#FFFFFF"
|
||||
if (!value) return color
|
||||
|
||||
var/list/RGB = ReadRGB(color)
|
||||
RGB[1] = Clamp(RGB[1]+value,0,255)
|
||||
RGB[2] = Clamp(RGB[2]+value,0,255)
|
||||
RGB[3] = Clamp(RGB[3]+value,0,255)
|
||||
return rgb(RGB[1],RGB[2],RGB[3])
|
||||
@@ -195,32 +195,10 @@ proc/checkhtml(var/t)
|
||||
* 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 .
|
||||
return list2text(text2list(text, find), replacement)
|
||||
|
||||
/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 .
|
||||
return list2text(text2listEx(text, find), replacement)
|
||||
|
||||
//Adds 'u' number of zeros ahead of the text 't'
|
||||
/proc/add_zero(t, u)
|
||||
@@ -287,27 +265,6 @@ proc/checkhtml(var/t)
|
||||
return message
|
||||
return copytext(message, 1, length + 1)
|
||||
|
||||
/*
|
||||
* Misc
|
||||
*/
|
||||
|
||||
/proc/stringsplit(txt, character)
|
||||
var/cur_text = txt
|
||||
var/last_found = 1
|
||||
var/found_char = findtext(cur_text,character)
|
||||
var/list/list = list()
|
||||
if(found_char)
|
||||
var/fs = copytext(cur_text,last_found,found_char)
|
||||
list += fs
|
||||
last_found = found_char+length(character)
|
||||
found_char = findtext(cur_text,character,last_found)
|
||||
while(found_char)
|
||||
var/found_string = copytext(cur_text,last_found,found_char)
|
||||
last_found = found_char+length(character)
|
||||
list += found_string
|
||||
found_char = findtext(cur_text,character,last_found)
|
||||
list += copytext(cur_text,last_found,length(cur_text)+1)
|
||||
return list
|
||||
|
||||
/proc/stringmerge(var/text,var/compare,replace = "*")
|
||||
//This proc fills in all spaces with the "replace" var (* by default) with whatever
|
||||
@@ -346,4 +303,4 @@ proc/checkhtml(var/t)
|
||||
var/new_text = ""
|
||||
for(var/i = length(text); i > 0; i--)
|
||||
new_text += copytext(text, i, i+1)
|
||||
return new_text
|
||||
return new_text
|
||||
|
||||
@@ -83,22 +83,94 @@
|
||||
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
|
||||
// Concatenates a list of strings into a single string. A seperator may optionally be provided.
|
||||
/proc/list2text(list/ls, sep)
|
||||
if(ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
return ls.len ? ls[1] : ""
|
||||
|
||||
var/l = ls.len // Made local for sanic speed.
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if(sep <> null)
|
||||
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
// Having the small concatenations come before the large ones boosted speed by an average of at least 5%.
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
. = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
. = text("[][][][][][][][][]", ., S4) // And so on....
|
||||
if(l-i & 0x08)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
else
|
||||
// Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc...
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. += S1 // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
. = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
. = text("[][][][][]", ., S4) // And so on...
|
||||
if(l-i & 0x08)
|
||||
. = text("[][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
|
||||
//slower then dd_list2text, but correctly processes associative lists.
|
||||
//slower then list2text, but correctly processes associative lists.
|
||||
proc/tg_list2text(list/list, glue=",")
|
||||
if(!istype(list) || !list.len)
|
||||
return
|
||||
@@ -108,62 +180,50 @@ proc/tg_list2text(list/list, glue=",")
|
||||
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")
|
||||
//Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator)
|
||||
/proc/text2list(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1) return list(text)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
do
|
||||
found = findtext(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
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")
|
||||
/proc/text2listEx(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1) return list(text)
|
||||
. = 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 .
|
||||
var/last_found = 1
|
||||
var/found
|
||||
do
|
||||
found = findtextEx(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
//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/num2dir(direction)
|
||||
switch(direction)
|
||||
if(1.0) return NORTH
|
||||
if(2.0) return SOUTH
|
||||
if(4.0) return EAST
|
||||
if(8.0) return WEST
|
||||
else
|
||||
world.log << "UNKNOWN DIRECTION: [direction]"
|
||||
|
||||
|
||||
|
||||
//Turns a direction into text
|
||||
/proc/dir2text(direction)
|
||||
switch(direction)
|
||||
@@ -261,4 +321,5 @@ proc/tg_list2text(list/list, glue=",")
|
||||
switch(ui_style)
|
||||
if("old") return 'icons/mob/screen1_old.dmi'
|
||||
if("Orange") return 'icons/mob/screen1_Orange.dmi'
|
||||
else return 'icons/mob/screen1_Midnight.dmi'
|
||||
if("Midnight") return 'icons/mob/screen1_Midnight.dmi'
|
||||
else return 'icons/mob/screen1_White.dmi'
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
continue // could not leave T0 in that direction
|
||||
|
||||
var/turf/T1 = get_step(T0,d)
|
||||
if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) & get_dir(T1,src), border_only = 0))
|
||||
if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) | get_dir(T1,src), border_only = 0))
|
||||
continue // couldn't enter or couldn't leave T1
|
||||
|
||||
if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target))
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
RestrainedClickOn(A)
|
||||
else
|
||||
*/
|
||||
A.add_hiddenprint(src)
|
||||
A.attack_ai(src)
|
||||
|
||||
/*
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
|
||||
// Simple helper to face what you clicked on, in case it should be needed in more than one place
|
||||
/mob/proc/face_atom(var/atom/A)
|
||||
if( buckled || !A || !x || !y || !A.x || !A.y ) return
|
||||
if( stat || buckled || !A || !x || !y || !A.x || !A.y ) return
|
||||
var/dx = A.x - x
|
||||
var/dy = A.y - y
|
||||
if(!dx && !dy) return
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
// Cyborgs have no range-checking unless there is item use
|
||||
if(!W)
|
||||
A.add_hiddenprint(src)
|
||||
A.attack_robot(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -166,9 +166,11 @@ datum/hud/New(mob/owner)
|
||||
if(!ismob(mymob)) return 0
|
||||
if(!mymob.client) return 0
|
||||
var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
|
||||
var/ui_color = mymob.client.prefs.UI_style_color
|
||||
var/ui_alpha = mymob.client.prefs.UI_style_alpha
|
||||
|
||||
if(ishuman(mymob))
|
||||
human_hud(ui_style) // Pass the player the UI style chosen in preferences
|
||||
human_hud(ui_style, ui_color, ui_alpha) // Pass the player the UI style chosen in preferences
|
||||
else if(ismonkey(mymob))
|
||||
monkey_hud(ui_style)
|
||||
else if(isbrain(mymob))
|
||||
@@ -186,14 +188,15 @@ datum/hud/New(mob/owner)
|
||||
|
||||
|
||||
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
||||
/mob/verb/button_pressed_F12()
|
||||
/mob/verb/button_pressed_F12(var/full = 0 as null)
|
||||
set name = "F12"
|
||||
set hidden = 1
|
||||
|
||||
if(hud_used)
|
||||
if(ishuman(src))
|
||||
if(!src.client) return
|
||||
|
||||
if(!client) return
|
||||
if(client.view != world.view)
|
||||
return
|
||||
if(hud_used.hud_shown)
|
||||
hud_used.hud_shown = 0
|
||||
if(src.hud_used.adding)
|
||||
@@ -207,10 +210,15 @@ datum/hud/New(mob/owner)
|
||||
|
||||
//Due to some poor coding some things need special treatment:
|
||||
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
|
||||
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
||||
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
if(!full)
|
||||
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
||||
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
else
|
||||
src.client.screen -= src.healths
|
||||
src.client.screen -= src.internals
|
||||
src.client.screen -= src.gun_setting_icon
|
||||
|
||||
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
|
||||
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
|
||||
@@ -223,7 +231,12 @@ datum/hud/New(mob/owner)
|
||||
src.client.screen += src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
|
||||
src.client.screen += src.hud_used.hotkeybuttons
|
||||
|
||||
if(src.healths)
|
||||
src.client.screen |= src.healths
|
||||
if(src.internals)
|
||||
src.client.screen |= src.internals
|
||||
if(src.gun_setting_icon)
|
||||
src.client.screen |= src.gun_setting_icon
|
||||
|
||||
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
|
||||
src.client.screen += src.zone_sel //This one is a special snowflake
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
|
||||
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255)
|
||||
|
||||
src.adding = list()
|
||||
src.other = list()
|
||||
@@ -73,6 +73,8 @@
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.layer = 20
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.adding += using
|
||||
move_intent = using
|
||||
|
||||
@@ -82,6 +84,8 @@
|
||||
using.icon_state = "act_drop"
|
||||
using.screen_loc = ui_drop_throw
|
||||
using.layer = 19
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.hotkeybuttons += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -92,6 +96,8 @@
|
||||
inv_box.icon_state = "center"
|
||||
inv_box.screen_loc = ui_iclothing
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -102,6 +108,8 @@
|
||||
inv_box.icon_state = "equip"
|
||||
inv_box.screen_loc = ui_oclothing
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -114,6 +122,9 @@
|
||||
inv_box.screen_loc = ui_rhand
|
||||
inv_box.slot_id = slot_r_hand
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
|
||||
src.r_hand_hud_object = inv_box
|
||||
src.adding += inv_box
|
||||
|
||||
@@ -127,6 +138,8 @@
|
||||
inv_box.screen_loc = ui_lhand
|
||||
inv_box.slot_id = slot_l_hand
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.l_hand_hud_object = inv_box
|
||||
src.adding += inv_box
|
||||
|
||||
@@ -137,6 +150,8 @@
|
||||
using.icon_state = "hand1"
|
||||
using.screen_loc = ui_swaphand1
|
||||
using.layer = 19
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen/inventory()
|
||||
@@ -146,6 +161,8 @@
|
||||
using.icon_state = "hand2"
|
||||
using.screen_loc = ui_swaphand2
|
||||
using.layer = 19
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.adding += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -156,6 +173,8 @@
|
||||
inv_box.screen_loc = ui_id
|
||||
inv_box.slot_id = slot_wear_id
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.adding += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -166,6 +185,8 @@
|
||||
inv_box.screen_loc = ui_mask
|
||||
inv_box.slot_id = slot_wear_mask
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -176,6 +197,8 @@
|
||||
inv_box.screen_loc = ui_back
|
||||
inv_box.slot_id = slot_back
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.adding += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -185,6 +208,8 @@
|
||||
inv_box.screen_loc = ui_storage1
|
||||
inv_box.slot_id = slot_l_store
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.adding += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -194,6 +219,8 @@
|
||||
inv_box.screen_loc = ui_storage2
|
||||
inv_box.slot_id = slot_r_store
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.adding += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -204,6 +231,8 @@
|
||||
inv_box.screen_loc = ui_sstore1
|
||||
inv_box.slot_id = slot_s_store
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.adding += inv_box
|
||||
|
||||
using = new /obj/screen()
|
||||
@@ -212,6 +241,8 @@
|
||||
using.icon_state = "act_resist"
|
||||
using.screen_loc = ui_pull_resist
|
||||
using.layer = 19
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.hotkeybuttons += using
|
||||
|
||||
using = new /obj/screen()
|
||||
@@ -220,6 +251,8 @@
|
||||
using.icon_state = "other"
|
||||
using.screen_loc = ui_inventory
|
||||
using.layer = 20
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen()
|
||||
@@ -228,6 +261,8 @@
|
||||
using.icon_state = "act_equip"
|
||||
using.screen_loc = ui_equip
|
||||
using.layer = 20
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
src.adding += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -237,6 +272,8 @@
|
||||
inv_box.screen_loc = ui_gloves
|
||||
inv_box.slot_id = slot_gloves
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -246,6 +283,8 @@
|
||||
inv_box.screen_loc = ui_glasses
|
||||
inv_box.slot_id = slot_glasses
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -255,6 +294,8 @@
|
||||
inv_box.screen_loc = ui_l_ear
|
||||
inv_box.slot_id = slot_l_ear
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -264,6 +305,8 @@
|
||||
inv_box.screen_loc = ui_r_ear
|
||||
inv_box.slot_id = slot_r_ear
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -273,6 +316,8 @@
|
||||
inv_box.screen_loc = ui_head
|
||||
inv_box.slot_id = slot_head
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -282,6 +327,8 @@
|
||||
inv_box.screen_loc = ui_shoes
|
||||
inv_box.slot_id = slot_shoes
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.other += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
@@ -291,6 +338,8 @@
|
||||
inv_box.screen_loc = ui_belt
|
||||
inv_box.slot_id = slot_belt
|
||||
inv_box.layer = 19
|
||||
inv_box.color = ui_color
|
||||
inv_box.alpha = ui_alpha
|
||||
src.adding += inv_box
|
||||
|
||||
mymob.throw_icon = new /obj/screen()
|
||||
@@ -298,6 +347,8 @@
|
||||
mymob.throw_icon.icon_state = "act_throw_off"
|
||||
mymob.throw_icon.name = "throw"
|
||||
mymob.throw_icon.screen_loc = ui_drop_throw
|
||||
mymob.throw_icon.color = ui_color
|
||||
mymob.throw_icon.alpha = ui_alpha
|
||||
src.hotkeybuttons += mymob.throw_icon
|
||||
|
||||
mymob.oxygen = new /obj/screen()
|
||||
@@ -382,6 +433,8 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.icon = ui_style
|
||||
mymob.zone_sel.color = ui_color
|
||||
mymob.zone_sel.alpha = ui_alpha
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
@@ -438,28 +491,26 @@
|
||||
|
||||
client.screen -= hud_used.item_action_list
|
||||
|
||||
hud_used.item_action_list = list()
|
||||
for(var/obj/item/I in src)
|
||||
if(I.action_button_name)
|
||||
if(hud_used.item_action_list.len < num)
|
||||
var/obj/screen/item_action/N = new(hud_used)
|
||||
hud_used.item_action_list += N
|
||||
|
||||
var/obj/screen/item_action/A = hud_used.item_action_list[num]
|
||||
|
||||
if(I.icon_action_button)
|
||||
var/obj/screen/item_action/A = new(hud_used)
|
||||
|
||||
//A.icon = 'icons/mob/screen1_action.dmi'
|
||||
//A.icon_state = I.icon_action_button
|
||||
A.icon = ui_style2icon(client.prefs.UI_style)
|
||||
A.icon_state = "template"
|
||||
|
||||
A.overlays = list()
|
||||
var/image/img = image(I.icon, A, I.icon_state)
|
||||
img.pixel_x = 0
|
||||
img.pixel_y = 0
|
||||
A.overlays += img
|
||||
|
||||
A.name = I.action_button_name
|
||||
if(I.action_button_name)
|
||||
A.name = I.action_button_name
|
||||
else
|
||||
A.name = "Use [I.name]"
|
||||
A.owner = I
|
||||
|
||||
client.screen += hud_used.item_action_list[num]
|
||||
|
||||
hud_used.item_action_list += A
|
||||
switch(num)
|
||||
if(1)
|
||||
A.screen_loc = ui_action_slot1
|
||||
@@ -473,3 +524,4 @@
|
||||
A.screen_loc = ui_action_slot5
|
||||
break //5 slots available, so no more can be added.
|
||||
num++
|
||||
src.client.screen += src.hud_used.item_action_list
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
if(istype(master, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = master
|
||||
S.close(usr)
|
||||
else if(istype(master,/obj/item/clothing/suit/storage))
|
||||
var/obj/item/clothing/suit/storage/S = master
|
||||
S.close(usr)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -273,37 +276,79 @@
|
||||
C << "<span class='notice'>You are not wearing a mask.</span>"
|
||||
return 1
|
||||
else
|
||||
if(istype(C.l_hand, /obj/item/weapon/tank))
|
||||
C << "<span class='notice'>You are now running on internals from the [C.l_hand] on your left hand.</span>"
|
||||
C.internal = C.l_hand
|
||||
else if(istype(C.r_hand, /obj/item/weapon/tank))
|
||||
C << "<span class='notice'>You are now running on internals from the [C.r_hand] on your right hand.</span>"
|
||||
C.internal = C.r_hand
|
||||
else if(ishuman(C))
|
||||
var/list/nicename = null
|
||||
var/list/tankcheck = null
|
||||
var/breathes = "oxygen" //default, we'll check later
|
||||
var/list/contents = list()
|
||||
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(istype(H.s_store, /obj/item/weapon/tank))
|
||||
H << "<span class='notice'>You are now running on internals from the [H.s_store] on your [H.wear_suit].</span>"
|
||||
H.internal = H.s_store
|
||||
else if(istype(H.belt, /obj/item/weapon/tank))
|
||||
H << "<span class='notice'>You are now running on internals from the [H.belt] on your belt.</span>"
|
||||
H.internal = H.belt
|
||||
else if(istype(H.l_store, /obj/item/weapon/tank))
|
||||
H << "<span class='notice'>You are now running on internals from the [H.l_store] in your left pocket.</span>"
|
||||
H.internal = H.l_store
|
||||
else if(istype(H.r_store, /obj/item/weapon/tank))
|
||||
H << "<span class='notice'>You are now running on internals from the [H.r_store] in your right pocket.</span>"
|
||||
H.internal = H.r_store
|
||||
breathes = H.species.breath_type
|
||||
nicename = list ("suit", "back", "belt", "right hand", "left hand", "left pocket", "right pocket")
|
||||
tankcheck = list (H.s_store, C.back, H.belt, C.r_hand, C.l_hand, H.l_store, H.r_store)
|
||||
|
||||
//Seperate so CO2 jetpacks are a little less cumbersome.
|
||||
if(!C.internal && istype(C.back, /obj/item/weapon/tank))
|
||||
C << "<span class='notice'>You are now running on internals from the [C.back] on your back.</span>"
|
||||
C.internal = C.back
|
||||
else
|
||||
|
||||
nicename = list("Right Hand", "Left Hand", "Back")
|
||||
tankcheck = list(C.r_hand, C.l_hand, C.back)
|
||||
|
||||
for(var/i=1, i<tankcheck.len+1, ++i)
|
||||
if(istype(tankcheck[i], /obj/item/weapon/tank))
|
||||
var/obj/item/weapon/tank/t = tankcheck[i]
|
||||
if (!isnull(t.manipulated_by) && t.manipulated_by != C.real_name && findtext(t.desc,breathes))
|
||||
contents.Add(t.air_contents.total_moles) //Someone messed with the tank and put unknown gasses
|
||||
continue //in it, so we're going to believe the tank is what it says it is
|
||||
switch(breathes)
|
||||
//These tanks we're sure of their contents
|
||||
if("nitrogen") //So we're a bit more picky about them.
|
||||
|
||||
if(t.air_contents.nitrogen && !t.air_contents.oxygen)
|
||||
contents.Add(t.air_contents.nitrogen)
|
||||
else
|
||||
contents.Add(0)
|
||||
|
||||
if ("oxygen")
|
||||
if(t.air_contents.oxygen && !t.air_contents.toxins)
|
||||
contents.Add(t.air_contents.oxygen)
|
||||
else
|
||||
contents.Add(0)
|
||||
|
||||
// No races breath this, but never know about downstream servers.
|
||||
if ("carbon dioxide")
|
||||
if(t.air_contents.carbon_dioxide && !t.air_contents.toxins)
|
||||
contents.Add(t.air_contents.carbon_dioxide)
|
||||
else
|
||||
contents.Add(0)
|
||||
|
||||
|
||||
else
|
||||
//no tank so we set contents to 0
|
||||
contents.Add(0)
|
||||
|
||||
//Alright now we know the contents of the tanks so we have to pick the best one.
|
||||
|
||||
var/best = 0
|
||||
var/bestcontents = 0
|
||||
for(var/i=1, i < contents.len + 1 , ++i)
|
||||
if(!contents[i])
|
||||
continue
|
||||
if(contents[i] > bestcontents)
|
||||
best = i
|
||||
bestcontents = contents[i]
|
||||
|
||||
|
||||
//We've determined the best container now we set it as our internals
|
||||
|
||||
if(best)
|
||||
C << "<span class='notice'>You are now running on internals from [tankcheck[best]] on your [nicename[best]].</span>"
|
||||
C.internal = tankcheck[best]
|
||||
|
||||
|
||||
if(C.internal)
|
||||
if(C.internals)
|
||||
C.internals.icon_state = "internal1"
|
||||
else
|
||||
C << "<span class='notice'>You don't have an oxygen tank.</span>"
|
||||
C << "<span class='notice'>You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank.</span>"
|
||||
if("act_intent")
|
||||
usr.a_intent_change("right")
|
||||
if("help")
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
M:attacked_by(src, user, def_zone)
|
||||
return M:attacked_by(src, user, def_zone)
|
||||
else
|
||||
switch(damtype)
|
||||
if("brute")
|
||||
|
||||
@@ -37,27 +37,6 @@
|
||||
// Not all of them require checking, see below
|
||||
A.attack_ghost(src)
|
||||
|
||||
// This is the ghost's follow verb with an argument
|
||||
/mob/dead/observer/proc/ManualFollow(var/atom/target)
|
||||
following = target
|
||||
if(target)
|
||||
src << "\blue Now following [target]"
|
||||
spawn(0)
|
||||
var/turf/pos = get_turf(src)
|
||||
while(loc == pos && target && following == target)
|
||||
|
||||
var/turf/T = get_turf(target)
|
||||
if(!T)
|
||||
break
|
||||
if(following != target)
|
||||
break
|
||||
if(!client)
|
||||
break
|
||||
loc = T
|
||||
pos = loc
|
||||
sleep(15)
|
||||
following = null
|
||||
|
||||
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
|
||||
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
|
||||
if(user.client && user.client.inquisitive_ghost)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
var/log_adminwarn = 0 // log warnings admins get about bomb construction and such
|
||||
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/log_runtime = 0 // logs world.log to a file
|
||||
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
|
||||
@@ -44,7 +45,8 @@
|
||||
var/Tickcomp = 0
|
||||
var/socket_talk = 0 // use socket_talk to communicate with other processes
|
||||
var/list/resource_urls = null
|
||||
|
||||
var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
|
||||
var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round.
|
||||
var/list/mode_names = list()
|
||||
var/list/modes = list() // allowed modes
|
||||
var/list/votable_modes = list() // votable modes
|
||||
@@ -62,6 +64,12 @@
|
||||
var/automute_on = 0 //enables automuting/spam prevention
|
||||
var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access.
|
||||
|
||||
var/cult_ghostwriter = 1 //Allows ghosts to write in blood in cult rounds...
|
||||
var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active.
|
||||
|
||||
var/disable_player_mice = 0
|
||||
var/uneducated_mice = 0 //Set to 1 to prevent newly-spawned mice from understanding human speech
|
||||
|
||||
var/usealienwhitelist = 0
|
||||
var/limitalienplayers = 0
|
||||
var/alien_to_human_ratio = 0.5
|
||||
@@ -177,7 +185,7 @@
|
||||
if(type == "config")
|
||||
switch (name)
|
||||
if ("resource_urls")
|
||||
config.resource_urls = stringsplit(value, " ")
|
||||
config.resource_urls = text2list(value, " ")
|
||||
|
||||
if ("admin_legacy_system")
|
||||
config.admin_legacy_system = 1
|
||||
@@ -239,6 +247,9 @@
|
||||
if ("log_hrefs")
|
||||
config.log_hrefs = 1
|
||||
|
||||
if ("log_runtime")
|
||||
config.log_runtime = 1
|
||||
|
||||
if("allow_admin_ooccolor")
|
||||
config.allow_admin_ooccolor = 1
|
||||
|
||||
@@ -389,6 +400,11 @@
|
||||
if("ticklag")
|
||||
Ticklag = text2num(value)
|
||||
|
||||
if("allow_antag_hud")
|
||||
config.antag_hud_allowed = 1
|
||||
if("antag_hud_restricted")
|
||||
config.antag_hud_restricted = 1
|
||||
|
||||
if("socket_talk")
|
||||
socket_talk = text2num(value)
|
||||
|
||||
@@ -423,6 +439,12 @@
|
||||
if("ghost_interaction")
|
||||
config.ghost_interaction = 1
|
||||
|
||||
if("disable_player_mice")
|
||||
config.disable_player_mice = 1
|
||||
|
||||
if("uneducated_mice")
|
||||
config.uneducated_mice = 1
|
||||
|
||||
if("comms_password")
|
||||
config.comms_password = value
|
||||
|
||||
@@ -444,10 +466,15 @@
|
||||
else //probably windows, if not this should work anyway
|
||||
config.python_path = "python"
|
||||
|
||||
if("allow_cult_ghostwriter")
|
||||
config.cult_ghostwriter = 1
|
||||
|
||||
if("req_cult_ghostwriter")
|
||||
config.cult_ghostwriter_req_cultists = value
|
||||
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
|
||||
else if(type == "game_options")
|
||||
if(!value)
|
||||
diary << "Unknown value for setting [name] in [filename]."
|
||||
|
||||
17
code/controllers/hooks-defs.dm
Normal file
17
code/controllers/hooks-defs.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Startup hook.
|
||||
* Called in world.dm when the server starts.
|
||||
*/
|
||||
/hook/startup
|
||||
|
||||
/**
|
||||
* Roundstart hook.
|
||||
* Called in gameticker.dm when a round starts.
|
||||
*/
|
||||
/hook/roundstart
|
||||
|
||||
/**
|
||||
* Roundend hook.
|
||||
* Called in gameticker.dm when a round ends.
|
||||
*/
|
||||
/hook/roundend
|
||||
39
code/controllers/hooks.dm
Normal file
39
code/controllers/hooks.dm
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @file hooks.dm
|
||||
* Implements hooks, a simple way to run code on pre-defined events.
|
||||
*/
|
||||
|
||||
/** @page hooks Code hooks
|
||||
* @section hooks Hooks
|
||||
* A hook is defined under /hook in the type tree.
|
||||
*
|
||||
* To add some code to be called by the hook, define a proc under the type, as so:
|
||||
* @code
|
||||
/hook/foo/proc/bar()
|
||||
if(1)
|
||||
return 1 //Sucessful
|
||||
else
|
||||
return 0 //Error, or runtime.
|
||||
* @endcode
|
||||
* All hooks must return nonzero on success, as runtimes will force return null.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Calls a hook, executing every piece of code that's attached to it.
|
||||
* @param hook Identifier of the hook to call.
|
||||
* @returns 1 if all hooked code runs successfully, 0 otherwise.
|
||||
*/
|
||||
/proc/callHook(hook)
|
||||
var/hook_path = text2path("/hook/[hook]")
|
||||
if(!hook_path)
|
||||
error("Invalid hook '/hook/[hook]' called.")
|
||||
return 0
|
||||
|
||||
var/caller = new hook_path
|
||||
var/status = 1
|
||||
for(var/P in typesof("[hook_path]/proc"))
|
||||
if(!call(caller, P)())
|
||||
error("Hook '[P]' failed or runtimed.")
|
||||
status = 0
|
||||
|
||||
return status
|
||||
@@ -66,6 +66,7 @@ datum/controller/game_controller/proc/setup()
|
||||
setupgenetics()
|
||||
setupfactions()
|
||||
setup_economy()
|
||||
SetupXenoarch()
|
||||
|
||||
transfer_controller = new
|
||||
|
||||
@@ -296,7 +297,7 @@ datum/controller/game_controller/proc/process_nano()
|
||||
var/i = 1
|
||||
while(i<=nanomanager.processing_uis.len)
|
||||
var/datum/nanoui/ui = nanomanager.processing_uis[i]
|
||||
if(ui && ui.src_object && ui.user)
|
||||
if(ui)
|
||||
ui.process()
|
||||
i++
|
||||
continue
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/hook/startup/proc/createDatacore()
|
||||
data_core = new /obj/effect/datacore()
|
||||
return 1
|
||||
|
||||
/obj/effect/datacore/proc/manifest(var/nosleep = 0)
|
||||
spawn()
|
||||
@@ -104,13 +107,13 @@
|
||||
var/datum/data/record/L = new()
|
||||
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]")
|
||||
L.fields["name"] = H.real_name
|
||||
L.fields["rank"] = H.mind.assigned_role
|
||||
L.fields["rank"] = H.mind.assigned_role
|
||||
L.fields["age"] = H.age
|
||||
L.fields["sex"] = H.gender
|
||||
L.fields["b_type"] = H.b_type
|
||||
L.fields["b_dna"] = H.dna.unique_enzymes
|
||||
L.fields["enzymes"] = H.dna.struc_enzymes
|
||||
L.fields["identity"] = H.dna.uni_identity
|
||||
L.fields["enzymes"] = H.dna.SE // Used in respawning
|
||||
L.fields["identity"] = H.dna.UI // "
|
||||
L.fields["image"] = getFlatIcon(H,0) //This is god-awful
|
||||
locked += L
|
||||
return
|
||||
|
||||
@@ -258,6 +258,9 @@ client
|
||||
body += "<option value='?_src_=vars;regenerateicons=\ref[D]'>Regenerate Icons</option>"
|
||||
body += "<option value='?_src_=vars;addlanguage=\ref[D]'>Add Language</option>"
|
||||
body += "<option value='?_src_=vars;remlanguage=\ref[D]'>Remove Language</option>"
|
||||
|
||||
body += "<option value='?_src_=vars;addverb=\ref[D]'>Add Verb</option>"
|
||||
body += "<option value='?_src_=vars;remverb=\ref[D]'>Remove Verb</option>"
|
||||
if(ishuman(D))
|
||||
body += "<option value>---</option>"
|
||||
body += "<option value='?_src_=vars;setmutantrace=\ref[D]'>Set Mutantrace</option>"
|
||||
@@ -808,6 +811,55 @@ client
|
||||
else
|
||||
usr << "Mob doesn't know that language."
|
||||
|
||||
else if(href_list["addverb"])
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
|
||||
var/mob/living/H = locate(href_list["addverb"])
|
||||
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living"
|
||||
return
|
||||
var/list/possibleverbs = list()
|
||||
possibleverbs += "Cancel" // One for the top...
|
||||
possibleverbs += typesof(/mob/proc,/mob/verb,/mob/living/proc,/mob/living/verb)
|
||||
switch(H.type)
|
||||
if(/mob/living/carbon/human)
|
||||
possibleverbs += typesof(/mob/living/carbon/proc,/mob/living/carbon/verb,/mob/living/carbon/human/verb,/mob/living/carbon/human/proc)
|
||||
if(/mob/living/silicon/robot)
|
||||
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/robot/proc,/mob/living/silicon/robot/verb)
|
||||
if(/mob/living/silicon/ai)
|
||||
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/ai/proc,/mob/living/silicon/ai/verb)
|
||||
possibleverbs -= H.verbs
|
||||
possibleverbs += "Cancel" // ...And one for the bottom
|
||||
|
||||
var/verb = input("Select a verb!", "Verbs",null) as anything in possibleverbs
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
if(!verb || verb == "Cancel")
|
||||
return
|
||||
else
|
||||
H.verbs += verb
|
||||
|
||||
else if(href_list["remverb"])
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
|
||||
var/mob/H = locate(href_list["remverb"])
|
||||
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob"
|
||||
return
|
||||
var/verb = input("Please choose a verb to remove.","Verbs",null) as null|anything in H.verbs
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
if(!verb)
|
||||
return
|
||||
else
|
||||
H.verbs -= verb
|
||||
|
||||
|
||||
|
||||
else if(href_list["regenerateicons"])
|
||||
if(!check_rights(0)) return
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ var/list/advance_cures = 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.
|
||||
var/result = dd_list2text(L, ":")
|
||||
var/result = list2text(L, ":")
|
||||
id = result
|
||||
return result
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
H.op_stage.appendix = 2.0
|
||||
|
||||
var/datum/organ/external/groin = H.get_organ("groin")
|
||||
var/datum/wound/W = new /datum/wound/internal_bleeding(25)
|
||||
var/datum/wound/W = new /datum/wound/internal_bleeding(20)
|
||||
H.adjustToxLoss(25)
|
||||
groin.wounds += W
|
||||
src.cure()
|
||||
|
||||
@@ -39,13 +39,13 @@
|
||||
|
||||
//Save original dna for when the disease is cured.
|
||||
src.original_dna["name"] = affected_mob.real_name
|
||||
src.original_dna["UI"] = affected_mob.dna.uni_identity
|
||||
src.original_dna["SE"] = affected_mob.dna.struc_enzymes
|
||||
src.original_dna["UI"] = affected_mob.dna.UI
|
||||
src.original_dna["SE"] = affected_mob.dna.SE
|
||||
|
||||
affected_mob << "\red You don't feel like yourself.."
|
||||
affected_mob.dna.uni_identity = strain_data["UI"]
|
||||
updateappearance(affected_mob, affected_mob.dna.uni_identity)
|
||||
affected_mob.dna.struc_enzymes = strain_data["SE"]
|
||||
affected_mob.UpdateAppearance(strain_data["UI"])
|
||||
affected_mob.dna.SE = strain_data["SE"]
|
||||
affected_mob.dna.UpdateSE()
|
||||
affected_mob.real_name = strain_data["name"]
|
||||
domutcheck(affected_mob)
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
|
||||
/datum/disease/dnaspread/Del()
|
||||
if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"]))
|
||||
affected_mob.dna.uni_identity = original_dna["UI"]
|
||||
updateappearance(affected_mob, affected_mob.dna.uni_identity)
|
||||
affected_mob.dna.struc_enzymes = original_dna["SE"]
|
||||
affected_mob.UpdateAppearance(original_dna["UI"])
|
||||
affected_mob.dna.SE = original_dna["SE"]
|
||||
affected_mob.dna.UpdateSE()
|
||||
affected_mob.real_name = original_dna["name"]
|
||||
|
||||
affected_mob << "\blue You feel more like yourself."
|
||||
|
||||
@@ -74,6 +74,8 @@ datum/mind
|
||||
current.mind = null
|
||||
if(new_character.mind) //remove any mind currently in our new body's mind variable
|
||||
new_character.mind.current = null
|
||||
|
||||
nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
|
||||
|
||||
current = new_character //link ourself to our new body
|
||||
new_character.mind = src //and link our new body to ourself
|
||||
@@ -550,6 +552,7 @@ datum/mind
|
||||
current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a head revolutionary!</B></FONT>"
|
||||
ticker.mode.update_rev_icons_removed(src)
|
||||
special_role = null
|
||||
current.verbs -= /mob/living/carbon/human/proc/RevConvert
|
||||
log_admin("[key_name_admin(usr)] has de-rev'ed [current].")
|
||||
|
||||
if("rev")
|
||||
@@ -570,7 +573,7 @@ datum/mind
|
||||
if(src in ticker.mode.revolutionaries)
|
||||
ticker.mode.revolutionaries -= src
|
||||
ticker.mode.update_rev_icons_removed(src)
|
||||
current << "\red <FONT size = 3><B>You have proved your devotion to revoltion! Yea are a head revolutionary now!</B></FONT>"
|
||||
current << "\red <FONT size = 3><B>You have proved your devotion to revoltion! You are a head revolutionary now!</B></FONT>"
|
||||
else if(!(src in ticker.mode.head_revolutionaries))
|
||||
current << "\blue You are a member of the revolutionaries' leadership now!"
|
||||
else
|
||||
@@ -586,6 +589,7 @@ datum/mind
|
||||
rev_obj.explanation_text = "Assassinate [O.target.name], the [O.target.assigned_role]."
|
||||
objectives += rev_obj
|
||||
ticker.mode.greet_revolutionary(src,0)
|
||||
current.verbs += /mob/living/carbon/human/proc/RevConvert
|
||||
ticker.mode.head_revolutionaries += src
|
||||
ticker.mode.update_rev_icons_added(src)
|
||||
special_role = "Head Revolutionary"
|
||||
@@ -726,7 +730,7 @@ datum/mind
|
||||
else
|
||||
current.dna = changeling.absorbed_dna[1]
|
||||
current.real_name = current.dna.real_name
|
||||
updateappearance(current, current.dna.uni_identity)
|
||||
current.UpdateAppearance()
|
||||
domutcheck(current, null)
|
||||
|
||||
else if (href_list["nuclear"])
|
||||
|
||||
@@ -173,11 +173,11 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
sparks.start()
|
||||
if(smoke_spread)
|
||||
if(smoke_spread == 1)
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
|
||||
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
|
||||
smoke.start()
|
||||
else if(smoke_spread == 2)
|
||||
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
|
||||
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
|
||||
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
|
||||
smoke.start()
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
if(prob(50))
|
||||
rate = -rate
|
||||
|
||||
/hook/startup/proc/createSun()
|
||||
sun = new /datum/sun()
|
||||
return 1
|
||||
|
||||
// calculate the sun's position given the time of day
|
||||
|
||||
/datum/sun/proc/calc_position()
|
||||
|
||||
@@ -128,12 +128,12 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle/goldschlager,
|
||||
/obj/item/weapon/storage/fancy/cigarettes/dromedaryco,
|
||||
/obj/item/weapon/lipstick/random,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/ale,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/ale,
|
||||
/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/cans/ale,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cans/ale,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cans/beer,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cans/beer,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cans/beer,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cans/beer)
|
||||
cost = 20
|
||||
containertype = /obj/structure/closet/crate
|
||||
containername = "Party equipment"
|
||||
@@ -456,6 +456,14 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containername = "fuel tank crate"
|
||||
group = "Engineering"
|
||||
|
||||
/datum/supply_packs/coolanttank
|
||||
name = "Coolant tank crate"
|
||||
contains = list(/obj/structure/reagent_dispensers/coolanttank)
|
||||
cost = 16
|
||||
containertype = /obj/structure/largecrate
|
||||
containername = "coolant tank crate"
|
||||
group = "Medical / Science"
|
||||
|
||||
/datum/supply_packs/solar
|
||||
name = "Solar Pack crate"
|
||||
contains = list(/obj/item/solar_assembly,
|
||||
@@ -687,6 +695,18 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/erifle
|
||||
name = "Energy marksman crate"
|
||||
contains = list(/obj/item/clothing/suit/armor/laserproof,
|
||||
/obj/item/clothing/suit/armor/laserproof,
|
||||
/obj/item/weapon/gun/energy/sniperrifle,
|
||||
/obj/item/weapon/gun/energy/sniperrifle)
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Energy marksman crate"
|
||||
access = access_armory
|
||||
group = "Security"
|
||||
|
||||
/datum/supply_packs/shotgunammo
|
||||
name = "Shotgun shells"
|
||||
contains = list(/obj/item/ammo_casing/shotgun,
|
||||
@@ -945,6 +965,25 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
/datum/supply_packs/smbig
|
||||
name = "Supermatter Core"
|
||||
contains = list(/obj/machinery/power/supermatter)
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure/plasma
|
||||
containername = "Supermatter crate (CAUTION)"
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
|
||||
/* /datum/supply_packs/smsmall // Currently nonfunctional, waiting on virgil
|
||||
name = "Supermatter Shard"
|
||||
contains = list(/obj/machinery/power/supermatter/shard)
|
||||
cost = 25
|
||||
containertype = /obj/structure/closet/crate/secure/plasma
|
||||
containername = "Supermatter shard crate (CAUTION)"
|
||||
access = access_ce
|
||||
group = "Engineering" */
|
||||
|
||||
/datum/supply_packs/shield_cap
|
||||
contains = list(/obj/item/weapon/circuitboard/shield_cap)
|
||||
name = "Experimental shield capacitor circuitry"
|
||||
|
||||
@@ -51,122 +51,194 @@
|
||||
//This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character().
|
||||
var/locked[] = list()
|
||||
|
||||
proc/get_manifest(monochrome, OOC)
|
||||
var/list/heads = new()
|
||||
var/list/sec = new()
|
||||
var/list/eng = new()
|
||||
var/list/med = new()
|
||||
var/list/sci = new()
|
||||
var/list/civ = new()
|
||||
var/list/bot = new()
|
||||
var/list/misc = new()
|
||||
var/list/isactive = new()
|
||||
var/dat = {"
|
||||
<head><style>
|
||||
.manifest {border-collapse:collapse;}
|
||||
.manifest td, th {border:1px solid [monochrome?"black":"#DEF; background-color:white; color:black"]; padding:.25em}
|
||||
.manifest th {height: 2em; [monochrome?"border-top-width: 3px":"background-color: #48C; color:white"]}
|
||||
.manifest tr.head th { [monochrome?"border-top-width: 1px":"background-color: #488;"] }
|
||||
.manifest td:first-child {text-align:right}
|
||||
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: #DEF"]}
|
||||
</style></head>
|
||||
<table class="manifest" width='350px'>
|
||||
<tr class='head'><th>Name</th><th>Rank</th><th>Activity</th></tr>
|
||||
"}
|
||||
var/even = 0
|
||||
|
||||
// sort mobs
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
var/name = t.fields["name"]
|
||||
var/rank = t.fields["rank"]
|
||||
var/real_rank = t.fields["real_rank"]
|
||||
if(OOC)
|
||||
var/active = 0
|
||||
for(var/mob/M in player_list)
|
||||
if(M.real_name == name && M.client && M.client.inactivity <= 10 * 60 * 10)
|
||||
active = 1
|
||||
break
|
||||
isactive[name] = active ? "Active" : "Inactive"
|
||||
else
|
||||
isactive[name] = t.fields["p_stat"]
|
||||
|
||||
/obj/effect/datacore/proc/get_manifest(monochrome, OOC)
|
||||
var/list/heads = new()
|
||||
var/list/sec = new()
|
||||
var/list/eng = new()
|
||||
var/list/med = new()
|
||||
var/list/sci = new()
|
||||
var/list/civ = new()
|
||||
var/list/bot = new()
|
||||
var/list/misc = new()
|
||||
var/list/isactive = new()
|
||||
var/dat = {"
|
||||
<head><style>
|
||||
.manifest {border-collapse:collapse;}
|
||||
.manifest td, th {border:1px solid [monochrome?"black":"#DEF; background-color:white; color:black"]; padding:.25em}
|
||||
.manifest th {height: 2em; [monochrome?"border-top-width: 3px":"background-color: #48C; color:white"]}
|
||||
.manifest tr.head th { [monochrome?"border-top-width: 1px":"background-color: #488;"] }
|
||||
.manifest td:first-child {text-align:right}
|
||||
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: #DEF"]}
|
||||
</style></head>
|
||||
<table class="manifest" width='350px'>
|
||||
<tr class='head'><th>Name</th><th>Rank</th><th>Activity</th></tr>
|
||||
"}
|
||||
var/even = 0
|
||||
// sort mobs
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
var/name = t.fields["name"]
|
||||
var/rank = t.fields["rank"]
|
||||
var/real_rank = t.fields["real_rank"]
|
||||
if(OOC)
|
||||
var/active = 0
|
||||
for(var/mob/M in player_list)
|
||||
if(M.real_name == name && M.client && M.client.inactivity <= 10 * 60 * 10)
|
||||
active = 1
|
||||
break
|
||||
isactive[name] = active ? "Active" : "Inactive"
|
||||
else
|
||||
isactive[name] = t.fields["p_stat"]
|
||||
//world << "[name]: [rank]"
|
||||
|
||||
//cael - to prevent multiple appearances of a player/job combination, add a continue after each line
|
||||
var/department = 0
|
||||
if(real_rank in command_positions)
|
||||
heads[name] = rank
|
||||
department = 1
|
||||
if(real_rank in security_positions)
|
||||
sec[name] = rank
|
||||
department = 1
|
||||
if(real_rank in engineering_positions)
|
||||
eng[name] = rank
|
||||
department = 1
|
||||
if(real_rank in medical_positions)
|
||||
med[name] = rank
|
||||
department = 1
|
||||
if(real_rank in science_positions)
|
||||
sci[name] = rank
|
||||
department = 1
|
||||
if(real_rank in civilian_positions)
|
||||
civ[name] = rank
|
||||
department = 1
|
||||
if(real_rank in nonhuman_positions)
|
||||
bot[name] = rank
|
||||
department = 1
|
||||
var/department = 0
|
||||
if(real_rank in command_positions)
|
||||
heads[name] = rank
|
||||
department = 1
|
||||
if(real_rank in security_positions)
|
||||
sec[name] = rank
|
||||
department = 1
|
||||
if(real_rank in engineering_positions)
|
||||
eng[name] = rank
|
||||
department = 1
|
||||
if(real_rank in medical_positions)
|
||||
med[name] = rank
|
||||
department = 1
|
||||
if(real_rank in science_positions)
|
||||
sci[name] = rank
|
||||
department = 1
|
||||
if(real_rank in civilian_positions)
|
||||
civ[name] = rank
|
||||
department = 1
|
||||
if(real_rank in nonhuman_positions)
|
||||
bot[name] = rank
|
||||
department = 1
|
||||
if(!department && !(name in heads))
|
||||
misc[name] = rank
|
||||
if(heads.len > 0)
|
||||
dat += "<tr><th colspan=3>Heads</th></tr>"
|
||||
for(name in heads)
|
||||
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=3>Security</th></tr>"
|
||||
for(name in sec)
|
||||
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=3>Engineering</th></tr>"
|
||||
for(name in eng)
|
||||
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=3>Medical</th></tr>"
|
||||
for(name in med)
|
||||
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=3>Science</th></tr>"
|
||||
for(name in sci)
|
||||
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=3>Civilian</th></tr>"
|
||||
for(name in civ)
|
||||
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=3>Silicon</th></tr>"
|
||||
for(name in bot)
|
||||
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=3>Miscellaneous</th></tr>"
|
||||
for(name in misc)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td><td>[isactive[name]]</td></tr>"
|
||||
even = !even
|
||||
|
||||
if(!department && !(name in heads))
|
||||
misc[name] = rank
|
||||
|
||||
if(heads.len > 0)
|
||||
dat += "<tr><th colspan=3>Heads</th></tr>"
|
||||
for(name in heads)
|
||||
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=3>Security</th></tr>"
|
||||
for(name in sec)
|
||||
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=3>Engineering</th></tr>"
|
||||
for(name in eng)
|
||||
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=3>Medical</th></tr>"
|
||||
for(name in med)
|
||||
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=3>Science</th></tr>"
|
||||
for(name in sci)
|
||||
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=3>Civilian</th></tr>"
|
||||
for(name in civ)
|
||||
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=3>Silicon</th></tr>"
|
||||
for(name in bot)
|
||||
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=3>Miscellaneous</th></tr>"
|
||||
for(name in misc)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td><td>[isactive[name]]</td></tr>"
|
||||
even = !even
|
||||
dat += "</table>"
|
||||
dat = replacetext(dat, "\n", "") // so it can be placed on paper correctly
|
||||
dat = replacetext(dat, "\t", "")
|
||||
return dat
|
||||
|
||||
|
||||
/*
|
||||
We can't just insert in HTML into the nanoUI so we need the raw data to play with.
|
||||
*/
|
||||
|
||||
/obj/effect/datacore/proc/get_manifest_json()
|
||||
var/heads[0]
|
||||
var/sec[0]
|
||||
var/eng[0]
|
||||
var/med[0]
|
||||
var/sci[0]
|
||||
var/civ[0]
|
||||
var/bot[0]
|
||||
var/misc[0]
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
var/name = sanitize(t.fields["name"])
|
||||
var/rank = sanitize(t.fields["rank"])
|
||||
var/real_rank = t.fields["real_rank"]
|
||||
var/isactive = t.fields["p_stat"]
|
||||
var/department = 0
|
||||
var/depthead = 0 // Department Heads will be placed at the top of their lists.
|
||||
if(real_rank in command_positions)
|
||||
heads[++heads.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
depthead = 1
|
||||
if(rank=="Captain" && heads.len != 1)
|
||||
heads.Swap(1,heads.len)
|
||||
|
||||
if(real_rank in security_positions)
|
||||
sec[++sec.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
if(depthead && sec.len != 1)
|
||||
sec.Swap(1,sec.len)
|
||||
|
||||
if(real_rank in engineering_positions)
|
||||
eng[++eng.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
if(depthead && eng.len != 1)
|
||||
eng.Swap(1,eng.len)
|
||||
|
||||
if(real_rank in medical_positions)
|
||||
med[++med.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
if(depthead && med.len != 1)
|
||||
med.Swap(1,med.len)
|
||||
|
||||
if(real_rank in science_positions)
|
||||
sci[++sci.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
if(depthead && sci.len != 1)
|
||||
sci.Swap(1,sci.len)
|
||||
|
||||
if(real_rank in civilian_positions)
|
||||
civ[++civ.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
if(depthead && civ.len != 1)
|
||||
civ.Swap(1,civ.len)
|
||||
|
||||
if(real_rank in nonhuman_positions)
|
||||
bot[++bot.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
department = 1
|
||||
|
||||
if(!department && !(name in heads))
|
||||
misc[++misc.len] = list("name" = name, "rank" = rank, "active" = isactive)
|
||||
|
||||
return list(\
|
||||
"heads" = heads,\
|
||||
"sec" = sec,\
|
||||
"eng" = eng,\
|
||||
"med" = med,\
|
||||
"sci" = sci,\
|
||||
"civ" = civ,\
|
||||
"bot" = bot,\
|
||||
"misc" = misc\
|
||||
)
|
||||
|
||||
|
||||
dat += "</table>"
|
||||
dat = replacetext(dat, "\n", "") // so it can be placed on paper correctly
|
||||
dat = replacetext(dat, "\t", "")
|
||||
return dat
|
||||
|
||||
/obj/effect/laser
|
||||
name = "laser"
|
||||
|
||||
@@ -132,6 +132,40 @@
|
||||
plant_type = 0
|
||||
growthstages = 1
|
||||
|
||||
/obj/item/seeds/shandseed
|
||||
name = "pack of s'rendarr's hand seeds"
|
||||
desc = "These seeds grow into a helpful herb called S'Rendarr's Hand, native to Ahdomai."
|
||||
icon_state = "seed-shand"
|
||||
mypath = "/obj/item/seeds/shandseed"
|
||||
species = "shand"
|
||||
plantname = "S'Rendarr's Hand"
|
||||
productname = "/obj/item/stack/medical/bruise_pack/tajaran"
|
||||
lifespan = 50
|
||||
endurance = 25
|
||||
maturation = 3
|
||||
production = 5
|
||||
yield = 4
|
||||
potency = 10
|
||||
plant_type = 0
|
||||
growthstages = 3
|
||||
|
||||
/obj/item/seeds/mtearseed
|
||||
name = "pack of messa's tear seeds"
|
||||
desc = "These seeds grow into a helpful herb called Messa's Tear, native to Ahdomai."
|
||||
icon_state = "seed-mtear"
|
||||
mypath = "/obj/item/seeds/mtearseed"
|
||||
species = "mtear"
|
||||
plantname = "Messa's Tear"
|
||||
productname = "/obj/item/stack/medical/ointment/tajaran"
|
||||
lifespan = 50
|
||||
endurance = 25
|
||||
maturation = 3
|
||||
production = 5
|
||||
yield = 4
|
||||
potency = 10
|
||||
plant_type = 0
|
||||
growthstages = 3
|
||||
|
||||
/obj/item/seeds/berryseed
|
||||
name = "pack of berry seeds"
|
||||
desc = "These seeds grow into berry bushes."
|
||||
|
||||
@@ -325,6 +325,13 @@
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "broom"
|
||||
|
||||
/obj/item/weapon/staff/gentcane
|
||||
name = "Gentlemans Cane"
|
||||
desc = "An ebony can with an ivory tip."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "cane"
|
||||
item_state = "stick"
|
||||
|
||||
/obj/item/weapon/staff/stick
|
||||
name = "stick"
|
||||
desc = "A great tool to drag someone else's drinks across the bar."
|
||||
@@ -393,7 +400,9 @@
|
||||
/obj/item/weapon/module/power_control
|
||||
name = "power control module"
|
||||
icon_state = "power_mod"
|
||||
desc = "Heavy-duty switching circuits for power control."
|
||||
desc = "Heavy-duty switching circuits for power control."
|
||||
m_amt = 50
|
||||
g_amt = 50
|
||||
|
||||
/obj/item/weapon/module/id_auth
|
||||
name = "\improper ID authentication module"
|
||||
|
||||
@@ -56,7 +56,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
|
||||
var/list/teleportlocs = list()
|
||||
|
||||
proc/process_teleport_locs()
|
||||
/hook/startup/proc/setupTeleportLocs()
|
||||
for(var/area/AR in world)
|
||||
if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
|
||||
if(teleportlocs.Find(AR.name)) continue
|
||||
@@ -65,20 +65,13 @@ proc/process_teleport_locs()
|
||||
teleportlocs += AR.name
|
||||
teleportlocs[AR.name] = AR
|
||||
|
||||
var/not_in_order = 0
|
||||
do
|
||||
not_in_order = 0
|
||||
if(teleportlocs.len <= 1)
|
||||
break
|
||||
for(var/i = 1, i <= (teleportlocs.len - 1), i++)
|
||||
if(sorttext(teleportlocs[i], teleportlocs[i+1]) == -1)
|
||||
teleportlocs.Swap(i, i+1)
|
||||
not_in_order = 1
|
||||
while(not_in_order)
|
||||
teleportlocs = sortAssoc(teleportlocs)
|
||||
|
||||
return 1
|
||||
|
||||
var/list/ghostteleportlocs = list()
|
||||
|
||||
proc/process_ghost_teleport_locs()
|
||||
/hook/startup/proc/setupGhostTeleportLocs()
|
||||
for(var/area/AR in world)
|
||||
if(ghostteleportlocs.Find(AR.name)) continue
|
||||
if(istype(AR, /area/turret_protected/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome))
|
||||
@@ -89,17 +82,9 @@ proc/process_ghost_teleport_locs()
|
||||
ghostteleportlocs += AR.name
|
||||
ghostteleportlocs[AR.name] = AR
|
||||
|
||||
var/not_in_order = 0
|
||||
do
|
||||
not_in_order = 0
|
||||
if(ghostteleportlocs.len <= 1)
|
||||
break
|
||||
for(var/i = 1, i <= (ghostteleportlocs.len - 1), i++)
|
||||
if(sorttext(ghostteleportlocs[i], ghostteleportlocs[i+1]) == -1)
|
||||
ghostteleportlocs.Swap(i, i+1)
|
||||
not_in_order = 1
|
||||
while(not_in_order)
|
||||
ghostteleportlocs = sortAssoc(ghostteleportlocs)
|
||||
|
||||
return 1
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
@@ -795,6 +780,14 @@ proc/process_ghost_teleport_locs()
|
||||
name = "\improper Dormitories"
|
||||
icon_state = "Sleep"
|
||||
|
||||
/area/crew_quarters/sleep/engi
|
||||
name = "\improper Engineering Dormitories"
|
||||
icon_state = "Sleep"
|
||||
|
||||
/area/crew_quarters/sleep/sec
|
||||
name = "\improper Security Dormitories"
|
||||
icon_state = "Sleep"
|
||||
|
||||
/area/crew_quarters/sleep_male
|
||||
name = "\improper Male Dorm"
|
||||
icon_state = "Sleep"
|
||||
@@ -1322,6 +1315,10 @@ proc/process_ghost_teleport_locs()
|
||||
name = "\improper Miscellaneous Research"
|
||||
icon_state = "toxmisc"
|
||||
|
||||
/area/toxins/telesci
|
||||
name = "\improper Telescience Lab"
|
||||
icon_state = "toxmisc"
|
||||
|
||||
/area/toxins/server
|
||||
name = "\improper Server Room"
|
||||
icon_state = "server"
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
return
|
||||
if( !fire )
|
||||
fire = 1
|
||||
master.fire = 1 //used for firedoor checks
|
||||
updateicon()
|
||||
mouse_opacity = 0
|
||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
||||
@@ -122,6 +123,7 @@
|
||||
/area/proc/firereset()
|
||||
if (fire)
|
||||
fire = 0
|
||||
master.fire = 0 //used for firedoor checks
|
||||
mouse_opacity = 0
|
||||
updateicon()
|
||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
var/list/fingerprintshidden
|
||||
var/fingerprintslast = null
|
||||
var/list/blood_DNA
|
||||
var/blood_color
|
||||
var/last_bumped = 0
|
||||
var/pass_flags = 0
|
||||
var/throwpass = 0
|
||||
@@ -361,7 +362,9 @@ its easier to just keep the beam vertical.
|
||||
return 0
|
||||
if(!blood_DNA || !istype(blood_DNA, /list)) //if our list of DNA doesn't exist yet (or isn't a list) initialise it.
|
||||
blood_DNA = list()
|
||||
|
||||
blood_color = "#A10808"
|
||||
if (M.species)
|
||||
blood_color = M.species.blood_color
|
||||
//adding blood to humans
|
||||
else if (istype(src, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
|
||||
@@ -103,16 +103,16 @@ var/list/radiochannels = list(
|
||||
"Medical" = 1355,
|
||||
"Engineering" = 1357,
|
||||
"Security" = 1359,
|
||||
"Response Team" = 1443,
|
||||
"Deathsquad" = 1441,
|
||||
"Response Team" = 1345,
|
||||
"Deathsquad" = 1341,
|
||||
"Syndicate" = 1213,
|
||||
"Supply" = 1347,
|
||||
)
|
||||
//depenging helpers
|
||||
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1443, 1441, 1347)
|
||||
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1345, 1341, 1347)
|
||||
|
||||
// central command channels, i.e deathsquid & response teams
|
||||
var/list/CENT_FREQS = list(1441, 1443)
|
||||
var/list/CENT_FREQS = list(1345, 1341)
|
||||
|
||||
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
|
||||
var/const/SYND_FREQ = 1213
|
||||
@@ -140,6 +140,10 @@ var/const/RADIO_MAGNETS = "9"
|
||||
|
||||
var/global/datum/controller/radio/radio_controller
|
||||
|
||||
/hook/startup/proc/createRadioController()
|
||||
radio_controller = new /datum/controller/radio()
|
||||
return 1
|
||||
|
||||
datum/controller/radio
|
||||
var/list/datum/radio_frequency/frequencies = list()
|
||||
|
||||
|
||||
358
code/game/dna/dna2.dm
Normal file
358
code/game/dna/dna2.dm
Normal file
@@ -0,0 +1,358 @@
|
||||
/**
|
||||
* DNA 2: The Spaghetti Strikes Back
|
||||
*
|
||||
* @author N3X15 <nexisentertainment@gmail.com>
|
||||
*/
|
||||
|
||||
// What each index means:
|
||||
#define DNA_OFF_LOWERBOUND 0
|
||||
#define DNA_OFF_UPPERBOUND 1
|
||||
#define DNA_ON_LOWERBOUND 2
|
||||
#define DNA_ON_UPPERBOUND 3
|
||||
|
||||
// Define block bounds (off-low,off-high,on-low,on-high)
|
||||
// Used in setupgame.dm
|
||||
#define DNA_DEFAULT_BOUNDS list(1,2049,2050,4095)
|
||||
#define DNA_HARDER_BOUNDS list(1,3049,3050,4095)
|
||||
#define DNA_HARD_BOUNDS list(1,3490,3500,4095)
|
||||
|
||||
// Defines which values mean "on" or "off".
|
||||
// This is to make some of the more OP superpowers a larger PITA to activate,
|
||||
// and to tell our new DNA datum which values to set in order to turn something
|
||||
// on or off.
|
||||
var/global/list/dna_activity_bounds[STRUCDNASIZE]
|
||||
|
||||
// Used to determine what each block means (admin hax and species stuff on /vg/, mostly)
|
||||
var/global/list/assigned_blocks[STRUCDNASIZE]
|
||||
|
||||
var/global/list/datum/dna/gene/dna_genes[0]
|
||||
|
||||
// UI Indices (can change to mutblock style, if desired)
|
||||
#define DNA_UI_HAIR_R 1
|
||||
#define DNA_UI_HAIR_G 2
|
||||
#define DNA_UI_HAIR_B 3
|
||||
#define DNA_UI_BEARD_R 4
|
||||
#define DNA_UI_BEARD_G 5
|
||||
#define DNA_UI_BEARD_B 6
|
||||
#define DNA_UI_SKIN_TONE 7
|
||||
#define DNA_UI_EYES_R 8
|
||||
#define DNA_UI_EYES_G 9
|
||||
#define DNA_UI_EYES_B 10
|
||||
#define DNA_UI_GENDER 11
|
||||
#define DNA_UI_BEARD_STYLE 12
|
||||
#define DNA_UI_HAIR_STYLE 13
|
||||
#define DNA_UI_LENGTH 13 // Update this when you add something, or you WILL break shit.
|
||||
|
||||
/////////////////
|
||||
// GENE DEFINES
|
||||
/////////////////
|
||||
|
||||
// Skip checking if it's already active.
|
||||
// Used for genes that check for value rather than a binary on/off.
|
||||
#define GENE_ALWAYS_ACTIVATE 1
|
||||
|
||||
/datum/dna
|
||||
// READ-ONLY, GETS OVERWRITTEN
|
||||
// DO NOT FUCK WITH THESE OR BYOND WILL EAT YOUR FACE
|
||||
var/uni_identity="" // Encoded UI
|
||||
var/struc_enzymes="" // Encoded SE
|
||||
var/unique_enzymes="" // MD5 of player name
|
||||
|
||||
// Internal dirtiness checks
|
||||
var/dirtyUI=0
|
||||
var/dirtySE=0
|
||||
|
||||
// Okay to read, but you're an idiot if you do.
|
||||
// BLOCK = VALUE
|
||||
var/list/SE[STRUCDNASIZE]
|
||||
var/list/UI[DNA_UI_LENGTH]
|
||||
|
||||
// From old dna.
|
||||
var/b_type = "A+" // Should probably change to an integer => string map but I'm lazy.
|
||||
var/mutantrace = null // The type of mutant race the player is, if applicable (i.e. potato-man)
|
||||
var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings,
|
||||
|
||||
// New stuff
|
||||
var/species = "Human"
|
||||
|
||||
// Make a copy of this strand.
|
||||
// USE THIS WHEN COPYING STUFF OR YOU'LL GET CORRUPTION!
|
||||
/datum/dna/proc/Clone()
|
||||
var/datum/dna/new_dna = new()
|
||||
new_dna.unique_enzymes=unique_enzymes
|
||||
new_dna.b_type=b_type
|
||||
new_dna.mutantrace=mutantrace
|
||||
new_dna.real_name=real_name
|
||||
new_dna.species=species
|
||||
for(var/b=1;b<=STRUCDNASIZE;b++)
|
||||
new_dna.SE[b]=SE[b]
|
||||
if(b<=DNA_UI_LENGTH)
|
||||
new_dna.UI[b]=UI[b]
|
||||
new_dna.UpdateUI()
|
||||
new_dna.UpdateSE()
|
||||
return new_dna
|
||||
|
||||
///////////////////////////////////////
|
||||
// UNIQUE IDENTITY
|
||||
///////////////////////////////////////
|
||||
|
||||
// Create random UI.
|
||||
/datum/dna/proc/ResetUI(var/defer=0)
|
||||
for(var/i=1,i<=DNA_UI_LENGTH,i++)
|
||||
switch(i)
|
||||
if(DNA_UI_SKIN_TONE)
|
||||
SetUIValueRange(DNA_UI_SKIN_TONE,rand(1,220),220,1) // Otherwise, it gets fucked
|
||||
else
|
||||
UI[i]=rand(0,4095)
|
||||
if(!defer)
|
||||
UpdateUI()
|
||||
|
||||
/datum/dna/proc/ResetUIFrom(var/mob/living/carbon/human/character)
|
||||
// INITIALIZE!
|
||||
ResetUI(1)
|
||||
// Hair
|
||||
// FIXME: Species-specific defaults pls
|
||||
if(!character.h_style)
|
||||
character.h_style = "Skinhead"
|
||||
var/hair = hair_styles_list.Find(character.h_style)
|
||||
|
||||
// Facial Hair
|
||||
if(!character.f_style)
|
||||
character.f_style = "Shaved"
|
||||
var/beard = facial_hair_styles_list.Find(character.f_style)
|
||||
|
||||
SetUIValueRange(DNA_UI_HAIR_R, character.r_hair, 255, 1)
|
||||
SetUIValueRange(DNA_UI_HAIR_G, character.g_hair, 255, 1)
|
||||
SetUIValueRange(DNA_UI_HAIR_B, character.b_hair, 255, 1)
|
||||
|
||||
SetUIValueRange(DNA_UI_BEARD_R, character.r_facial, 255, 1)
|
||||
SetUIValueRange(DNA_UI_BEARD_G, character.g_facial, 255, 1)
|
||||
SetUIValueRange(DNA_UI_BEARD_B, character.b_facial, 255, 1)
|
||||
|
||||
SetUIValueRange(DNA_UI_EYES_R, character.r_eyes, 255, 1)
|
||||
SetUIValueRange(DNA_UI_EYES_G, character.g_eyes, 255, 1)
|
||||
SetUIValueRange(DNA_UI_EYES_B, character.b_eyes, 255, 1)
|
||||
|
||||
SetUIValueRange(DNA_UI_SKIN_TONE, 35-character.s_tone, 220, 1) // Value can be negative.
|
||||
|
||||
SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1)
|
||||
|
||||
SetUIValueRange(DNA_UI_HAIR_STYLE, hair, hair_styles_list.len, 1)
|
||||
SetUIValueRange(DNA_UI_BEARD_STYLE, beard, facial_hair_styles_list.len,1)
|
||||
|
||||
UpdateUI()
|
||||
|
||||
// Set a DNA UI block's raw value.
|
||||
/datum/dna/proc/SetUIValue(var/block,var/value,var/defer=0)
|
||||
if (block<=0) return
|
||||
ASSERT(value>=0)
|
||||
ASSERT(value<=4095)
|
||||
UI[block]=value
|
||||
dirtyUI=1
|
||||
if(!defer)
|
||||
UpdateUI()
|
||||
|
||||
// Get a DNA UI block's raw value.
|
||||
/datum/dna/proc/GetUIValue(var/block)
|
||||
if (block<=0) return 0
|
||||
return UI[block]
|
||||
|
||||
// Set a DNA UI block's value, given a value and a max possible value.
|
||||
// Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list)
|
||||
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue,var/defer=0)
|
||||
if (block<=0) return
|
||||
ASSERT(maxvalue<=4095)
|
||||
var/range = (4095 / maxvalue)
|
||||
if(value)
|
||||
SetUIValue(block,round(value * range),defer)
|
||||
|
||||
// Getter version of above.
|
||||
/datum/dna/proc/GetUIValueRange(var/block,var/maxvalue)
|
||||
if (block<=0) return 0
|
||||
var/value = GetUIValue(block)
|
||||
return round(1 +(value / 4096)*maxvalue)
|
||||
|
||||
// Is the UI gene "on" or "off"?
|
||||
// For UI, this is simply a check of if the value is > 2050.
|
||||
/datum/dna/proc/GetUIState(var/block)
|
||||
if (block<=0) return
|
||||
return UI[block] > 2050
|
||||
|
||||
|
||||
// Set UI gene "on" (1) or "off" (0)
|
||||
/datum/dna/proc/SetUIState(var/block,var/on,var/defer=0)
|
||||
if (block<=0) return
|
||||
var/val
|
||||
if(on)
|
||||
val=rand(2050,4095)
|
||||
else
|
||||
val=rand(1,2049)
|
||||
SetUIValue(block,val,defer)
|
||||
|
||||
// Get a hex-encoded UI block.
|
||||
/datum/dna/proc/GetUIBlock(var/block)
|
||||
return EncodeDNABlock(GetUIValue(block))
|
||||
|
||||
// Do not use this unless you absolutely have to.
|
||||
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
|
||||
// Used in DNA modifiers.
|
||||
/datum/dna/proc/SetUIBlock(var/block,var/value,var/defer=0)
|
||||
if (block<=0) return
|
||||
return SetUIValue(block,hex2num(value),defer)
|
||||
|
||||
// Get a sub-block from a block.
|
||||
/datum/dna/proc/GetUISubBlock(var/block,var/subBlock)
|
||||
return copytext(GetUIBlock(block),subBlock,subBlock+1)
|
||||
|
||||
// Do not use this unless you absolutely have to.
|
||||
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
|
||||
// Used in DNA modifiers.
|
||||
/datum/dna/proc/SetUISubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0)
|
||||
if (block<=0) return
|
||||
var/oldBlock=GetUIBlock(block)
|
||||
var/newBlock=""
|
||||
for(var/i=1, i<=length(oldBlock), i++)
|
||||
if(i==subBlock)
|
||||
newBlock+=newSubBlock
|
||||
else
|
||||
newBlock+=copytext(oldBlock,i,i+1)
|
||||
SetUIBlock(block,newBlock,defer)
|
||||
|
||||
///////////////////////////////////////
|
||||
// STRUCTURAL ENZYMES
|
||||
///////////////////////////////////////
|
||||
|
||||
// "Zeroes out" all of the blocks.
|
||||
/datum/dna/proc/ResetSE()
|
||||
for(var/i = 1, i <= STRUCDNASIZE, i++)
|
||||
SetSEValue(i,rand(1,1024),1)
|
||||
UpdateSE()
|
||||
|
||||
// Set a DNA SE block's raw value.
|
||||
/datum/dna/proc/SetSEValue(var/block,var/value,var/defer=0)
|
||||
//testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]")
|
||||
if (block<=0) return
|
||||
ASSERT(value>=0)
|
||||
ASSERT(value<=4095)
|
||||
SE[block]=value
|
||||
dirtySE=1
|
||||
if(!defer)
|
||||
UpdateSE()
|
||||
|
||||
// Get a DNA SE block's raw value.
|
||||
/datum/dna/proc/GetSEValue(var/block)
|
||||
if (block<=0) return 0
|
||||
return SE[block]
|
||||
|
||||
// Set a DNA SE block's value, given a value and a max possible value.
|
||||
// Might be used for species?
|
||||
/datum/dna/proc/SetSEValueRange(var/block,var/value,var/maxvalue)
|
||||
if (block<=0) return
|
||||
ASSERT(maxvalue<=4095)
|
||||
var/range = round(4095 / maxvalue)
|
||||
if(value)
|
||||
SetSEValue(block, value * range - rand(1,range-1))
|
||||
|
||||
// Getter version of above.
|
||||
/datum/dna/proc/GetSEValueRange(var/block,var/maxvalue)
|
||||
if (block<=0) return 0
|
||||
var/value = GetSEValue(block)
|
||||
return round(1 +(value / 4096)*maxvalue)
|
||||
|
||||
// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.)
|
||||
/datum/dna/proc/GetSEState(var/block)
|
||||
if (block<=0) return 0
|
||||
var/list/BOUNDS=GetDNABounds(block)
|
||||
var/value=GetSEValue(block)
|
||||
return (value > BOUNDS[DNA_ON_LOWERBOUND])
|
||||
|
||||
// Set a block "on" or "off".
|
||||
/datum/dna/proc/SetSEState(var/block,var/on,var/defer=0)
|
||||
if (block<=0) return
|
||||
var/list/BOUNDS=GetDNABounds(block)
|
||||
var/val
|
||||
if(on)
|
||||
val=rand(BOUNDS[DNA_ON_LOWERBOUND],BOUNDS[DNA_ON_UPPERBOUND])
|
||||
else
|
||||
val=rand(1,BOUNDS[DNA_OFF_UPPERBOUND])
|
||||
SetSEValue(block,val,defer)
|
||||
|
||||
// Get hex-encoded SE block.
|
||||
/datum/dna/proc/GetSEBlock(var/block)
|
||||
return EncodeDNABlock(GetSEValue(block))
|
||||
|
||||
// Do not use this unless you absolutely have to.
|
||||
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
|
||||
// Used in DNA modifiers.
|
||||
/datum/dna/proc/SetSEBlock(var/block,var/value,var/defer=0)
|
||||
if (block<=0) return
|
||||
var/nval=hex2num(value)
|
||||
//testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]")
|
||||
return SetSEValue(block,nval,defer)
|
||||
|
||||
/datum/dna/proc/GetSESubBlock(var/block,var/subBlock)
|
||||
return copytext(GetSEBlock(block),subBlock,subBlock+1)
|
||||
|
||||
// Do not use this unless you absolutely have to.
|
||||
// Set a sub-block from a hex character. This is inefficient. If you can, use SetUIValue().
|
||||
// Used in DNA modifiers.
|
||||
/datum/dna/proc/SetSESubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0)
|
||||
if (block<=0) return
|
||||
var/oldBlock=GetSEBlock(block)
|
||||
var/newBlock=""
|
||||
for(var/i=1, i<=length(oldBlock), i++)
|
||||
if(i==subBlock)
|
||||
newBlock+=newSubBlock
|
||||
else
|
||||
newBlock+=copytext(oldBlock,i,i+1)
|
||||
//testing("SetSESubBlock([block],[subBlock],[newSubBlock],[defer]): [oldBlock] -> [newBlock]")
|
||||
SetSEBlock(block,newBlock,defer)
|
||||
|
||||
|
||||
/proc/EncodeDNABlock(var/value)
|
||||
return add_zero2(num2hex(value,1), 3)
|
||||
|
||||
/datum/dna/proc/UpdateUI()
|
||||
src.uni_identity=""
|
||||
for(var/block in UI)
|
||||
uni_identity += EncodeDNABlock(block)
|
||||
//testing("New UI: [uni_identity]")
|
||||
dirtyUI=0
|
||||
|
||||
/datum/dna/proc/UpdateSE()
|
||||
//var/oldse=struc_enzymes
|
||||
struc_enzymes=""
|
||||
for(var/block in SE)
|
||||
struc_enzymes += EncodeDNABlock(block)
|
||||
//testing("Old SE: [oldse]")
|
||||
//testing("New SE: [struc_enzymes]")
|
||||
dirtySE=0
|
||||
|
||||
// BACK-COMPAT!
|
||||
// Just checks our character has all the crap it needs.
|
||||
/datum/dna/proc/check_integrity(var/mob/living/carbon/human/character)
|
||||
if(character)
|
||||
if(UI.len != DNA_UI_LENGTH)
|
||||
ResetUIFrom(character)
|
||||
|
||||
if(length(struc_enzymes)!= 3*STRUCDNASIZE)
|
||||
ResetSE()
|
||||
|
||||
if(length(unique_enzymes) != 32)
|
||||
unique_enzymes = md5(character.real_name)
|
||||
else
|
||||
if(length(uni_identity) != 3*DNA_UI_LENGTH)
|
||||
uni_identity = "00600200A00E0110148FC01300B0095BD7FD3F4"
|
||||
if(length(struc_enzymes)!= 3*STRUCDNASIZE)
|
||||
struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6"
|
||||
|
||||
// BACK-COMPAT!
|
||||
// Initial DNA setup. I'm kind of wondering why the hell this doesn't just call the above.
|
||||
/datum/dna/proc/ready_dna(mob/living/carbon/human/character)
|
||||
ResetUIFrom(character)
|
||||
|
||||
ResetSE()
|
||||
|
||||
unique_enzymes = md5(character.real_name)
|
||||
reg_dna[unique_enzymes] = character.real_name
|
||||
|
||||
358
code/game/dna/dna2_domutcheck.dm
Normal file
358
code/game/dna/dna2_domutcheck.dm
Normal file
@@ -0,0 +1,358 @@
|
||||
// (Re-)Apply mutations.
|
||||
// TODO: Turn into a /mob proc, change inj to a bitflag for various forms of differing behavior.
|
||||
// M: Mob to mess with
|
||||
// connected: Machine we're in, type unchecked so I doubt it's used beyond monkeying
|
||||
// flags: See below, bitfield.
|
||||
#define MUTCHK_FORCED 1
|
||||
/proc/domutcheck(var/mob/living/M, var/connected=null, var/flags=0)
|
||||
for(var/datum/dna/gene/gene in dna_genes)
|
||||
if(!M)
|
||||
return
|
||||
if(!gene.block)
|
||||
continue
|
||||
|
||||
// Sanity checks, don't skip.
|
||||
if(!gene.can_activate(M,flags))
|
||||
//testing("[M] - Failed to activate [gene.name] (can_activate fail).")
|
||||
continue
|
||||
|
||||
// Current state
|
||||
var/gene_active = (gene.flags & GENE_ALWAYS_ACTIVATE)
|
||||
if(!gene_active)
|
||||
gene_active = M.dna.GetSEState(gene.block)
|
||||
|
||||
// Prior state
|
||||
var/gene_prior_status = (gene.type in M.active_genes)
|
||||
|
||||
if((gene_active && !gene_prior_status) || (gene.flags & GENE_ALWAYS_ACTIVATE))
|
||||
//testing("[gene.name] activated!")
|
||||
gene.activate(M,connected,flags)
|
||||
if(M)
|
||||
if(!(gene.flags & GENE_ALWAYS_ACTIVATE))
|
||||
M.active_genes |= gene.type
|
||||
M.update_icon=1
|
||||
else if(!gene_active && gene_prior_status)
|
||||
//testing("[gene.name] deactivated!")
|
||||
gene.deactivate(M,connected,flags)
|
||||
if(M)
|
||||
M.active_genes -= gene.type
|
||||
M.update_icon = 1
|
||||
//else
|
||||
// testing("[M] - Failed to activate [gene.name] - [gene_active?"+":"-"]active, [gene_prior_status?"+":"-"]prior")
|
||||
|
||||
|
||||
// PROC CONTINUES BELOW AFTER COMMENTED CODE.
|
||||
|
||||
/* Old, inflexibile
|
||||
/proc/domutcheck(var/mob/living/M, var/connected, var/flags)
|
||||
if (!M) return
|
||||
|
||||
M.dna.check_integrity()
|
||||
|
||||
M.disabilities = 0
|
||||
M.sdisabilities = 0
|
||||
var/old_mutations = M.mutations
|
||||
M.mutations = list()
|
||||
M.pass_flags = 0
|
||||
// M.see_in_dark = 2
|
||||
// M.see_invisible = 0
|
||||
|
||||
if(PLANT in old_mutations)
|
||||
M.mutations.Add(PLANT)
|
||||
if(SKELETON in old_mutations)
|
||||
M.mutations.Add(SKELETON)
|
||||
if(FAT in old_mutations)
|
||||
M.mutations.Add(FAT)
|
||||
if(HUSK in old_mutations)
|
||||
M.mutations.Add(HUSK)
|
||||
|
||||
var/inj = (flags & MUTCHK_FROM_INJECTOR) == MUTCHK_FROM_INJECTOR
|
||||
var/forced = (flags & MUTCHK_FORCED) == MUTCHK_FORCED
|
||||
|
||||
if(M.dna.GetSEState(NOBREATHBLOCK))
|
||||
if(forced || probinj(45,inj) || (mNobreath in old_mutations))
|
||||
M << "\blue You feel no need to breathe."
|
||||
M.mutations.Add(mNobreath)
|
||||
if(M.dna.GetSEState(REMOTEVIEWBLOCK))
|
||||
if(forced || probinj(45,inj) || (mRemote in old_mutations))
|
||||
M << "\blue Your mind expands"
|
||||
M.mutations.Add(mRemote)
|
||||
M.verbs += /mob/living/carbon/human/proc/remoteobserve
|
||||
if(M.dna.GetSEState(REGENERATEBLOCK))
|
||||
if(forced || probinj(45,inj) || (mRegen in old_mutations))
|
||||
M << "\blue You feel better"
|
||||
M.mutations.Add(mRegen)
|
||||
if(M.dna.GetSEState(INCREASERUNBLOCK))
|
||||
if(forced || probinj(45,inj) || (mRun in old_mutations))
|
||||
M << "\blue Your leg muscles pulsate."
|
||||
M.mutations.Add(mRun)
|
||||
if(M.dna.GetSEState(REMOTETALKBLOCK))
|
||||
if(forced || probinj(45,inj) || (mRemotetalk in old_mutations))
|
||||
M << "\blue You expand your mind outwards"
|
||||
M.mutations.Add(mRemotetalk)
|
||||
M.verbs += /mob/living/carbon/human/proc/remotesay
|
||||
if(M.dna.GetSEState(MORPHBLOCK))
|
||||
if(forced || probinj(45,inj) || (mMorph in old_mutations))
|
||||
M.mutations.Add(mMorph)
|
||||
M << "\blue Your skin feels strange"
|
||||
M.verbs += /mob/living/carbon/human/proc/morph
|
||||
if(M.dna.GetSEState(COLDBLOCK))
|
||||
if(!(COLD_RESISTANCE in old_mutations))
|
||||
if(forced || probinj(15,inj) || (mHeatres in old_mutations))
|
||||
M.mutations.Add(mHeatres)
|
||||
M << "\blue Your skin is icy to the touch"
|
||||
else
|
||||
if(forced || probinj(5,inj) || (mHeatres in old_mutations))
|
||||
M.mutations.Add(mHeatres)
|
||||
M << "\blue Your skin is icy to the touch"
|
||||
if(M.dna.GetSEState(HALLUCINATIONBLOCK))
|
||||
if(forced || probinj(45,inj) || (mHallucination in old_mutations))
|
||||
M.mutations.Add(mHallucination)
|
||||
M << "\red Your mind says 'Hello'"
|
||||
if(M.dna.GetSEState(NOPRINTSBLOCK))
|
||||
if(forced || probinj(45,inj) || (mFingerprints in old_mutations))
|
||||
M.mutations.Add(mFingerprints)
|
||||
M << "\blue Your fingers feel numb"
|
||||
if(M.dna.GetSEState(SHOCKIMMUNITYBLOCK))
|
||||
if(forced || probinj(45,inj) || (mShock in old_mutations))
|
||||
M.mutations.Add(mShock)
|
||||
M << "\blue Your skin feels strange"
|
||||
if(M.dna.GetSEState(SMALLSIZEBLOCK))
|
||||
if(forced || probinj(45,inj) || (mSmallsize in old_mutations))
|
||||
M << "\blue Your skin feels rubbery"
|
||||
M.mutations.Add(mSmallsize)
|
||||
M.pass_flags |= 1
|
||||
|
||||
|
||||
|
||||
if (M.dna.GetSEState(HULKBLOCK))
|
||||
if(forced || probinj(5,inj) || (HULK in old_mutations))
|
||||
M << "\blue Your muscles hurt."
|
||||
M.mutations.Add(HULK)
|
||||
if (M.dna.GetSEState(HEADACHEBLOCK))
|
||||
M.disabilities |= EPILEPSY
|
||||
M << "\red You get a headache."
|
||||
if (M.dna.GetSEState(FAKEBLOCK))
|
||||
M << "\red You feel strange."
|
||||
if (prob(95))
|
||||
if(prob(50))
|
||||
randmutb(M)
|
||||
else
|
||||
randmuti(M)
|
||||
else
|
||||
randmutg(M)
|
||||
if (M.dna.GetSEState(COUGHBLOCK))
|
||||
M.disabilities |= COUGHING
|
||||
M << "\red You start coughing."
|
||||
if (M.dna.GetSEState(CLUMSYBLOCK))
|
||||
M << "\red You feel lightheaded."
|
||||
M.mutations.Add(CLUMSY)
|
||||
if (M.dna.GetSEState(TWITCHBLOCK))
|
||||
M.disabilities |= TOURETTES
|
||||
M << "\red You twitch."
|
||||
if (M.dna.GetSEState(XRAYBLOCK))
|
||||
if(forced || probinj(30,inj) || (XRAY in old_mutations))
|
||||
M << "\blue The walls suddenly disappear."
|
||||
// M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
|
||||
// M.see_in_dark = 8
|
||||
// M.see_invisible = 2
|
||||
M.mutations.Add(XRAY)
|
||||
if (M.dna.GetSEState(NERVOUSBLOCK))
|
||||
M.disabilities |= NERVOUS
|
||||
M << "\red You feel nervous."
|
||||
if (M.dna.GetSEState(FIREBLOCK))
|
||||
if(!(mHeatres in old_mutations))
|
||||
if(forced || probinj(30,inj) || (COLD_RESISTANCE in old_mutations))
|
||||
M << "\blue Your body feels warm."
|
||||
M.mutations.Add(COLD_RESISTANCE)
|
||||
else
|
||||
if(forced || probinj(5,inj) || (COLD_RESISTANCE in old_mutations))
|
||||
M << "\blue Your body feels warm."
|
||||
M.mutations.Add(COLD_RESISTANCE)
|
||||
if (M.dna.GetSEState(BLINDBLOCK))
|
||||
M.sdisabilities |= BLIND
|
||||
M << "\red You can't seem to see anything."
|
||||
if (M.dna.GetSEState(TELEBLOCK))
|
||||
if(forced || probinj(15,inj) || (TK in old_mutations))
|
||||
M << "\blue You feel smarter."
|
||||
M.mutations.Add(TK)
|
||||
if (M.dna.GetSEState(DEAFBLOCK))
|
||||
M.sdisabilities |= DEAF
|
||||
M.ear_deaf = 1
|
||||
M << "\red Its kinda quiet.."
|
||||
if (M.dna.GetSEState(GLASSESBLOCK))
|
||||
M.disabilities |= NEARSIGHTED
|
||||
M << "Your eyes feel weird..."
|
||||
|
||||
/* If you want the new mutations to work, UNCOMMENT THIS.
|
||||
if(istype(M, /mob/living/carbon))
|
||||
for (var/datum/mutations/mut in global_mutations)
|
||||
mut.check_mutation(M)
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////// Monkey Block
|
||||
if (M.dna.GetSEState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human))
|
||||
// human > monkey
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.monkeyizing = 1
|
||||
var/list/implants = list() //Try to preserve implants.
|
||||
for(var/obj/item/weapon/implant/W in H)
|
||||
implants += W
|
||||
W.loc = null
|
||||
|
||||
if(!connected)
|
||||
for(var/obj/item/W in (H.contents-implants))
|
||||
if (W==H.w_uniform) // will be teared
|
||||
continue
|
||||
H.drop_from_inventory(W)
|
||||
M.monkeyizing = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new( M.loc )
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'icons/mob/mob.dmi'
|
||||
animation.master = src
|
||||
flick("h2monkey", animation)
|
||||
sleep(48)
|
||||
del(animation)
|
||||
|
||||
|
||||
var/mob/living/carbon/monkey/O = null
|
||||
if(H.species.primitive)
|
||||
O = new H.species.primitive(src)
|
||||
else
|
||||
H.gib() //Trying to change the species of a creature with no primitive var set is messy.
|
||||
return
|
||||
|
||||
if(M)
|
||||
if (M.dna)
|
||||
O.dna = M.dna
|
||||
M.dna = null
|
||||
|
||||
if (M.suiciding)
|
||||
O.suiciding = M.suiciding
|
||||
M.suiciding = null
|
||||
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
O.viruses += D
|
||||
D.affected_mob = O
|
||||
M.viruses -= D
|
||||
|
||||
|
||||
for(var/obj/T in (M.contents-implants))
|
||||
del(T)
|
||||
|
||||
O.loc = M.loc
|
||||
|
||||
if(M.mind)
|
||||
M.mind.transfer_to(O) //transfer our mind to the cute little monkey
|
||||
|
||||
if (connected) //inside dna thing
|
||||
var/obj/machinery/dna_scannernew/C = connected
|
||||
O.loc = C
|
||||
C.occupant = O
|
||||
connected = null
|
||||
O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6))
|
||||
O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss())
|
||||
O.adjustToxLoss(M.getToxLoss() + 20)
|
||||
O.adjustOxyLoss(M.getOxyLoss())
|
||||
O.stat = M.stat
|
||||
O.a_intent = "hurt"
|
||||
for (var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
// O.update_icon = 1 //queue a full icon update at next life() call
|
||||
del(M)
|
||||
return
|
||||
|
||||
if (!M.dna.GetSEState(MONKEYBLOCK) && !istype(M, /mob/living/carbon/human))
|
||||
// monkey > human,
|
||||
var/mob/living/carbon/monkey/Mo = M
|
||||
Mo.monkeyizing = 1
|
||||
var/list/implants = list() //Still preserving implants
|
||||
for(var/obj/item/weapon/implant/W in Mo)
|
||||
implants += W
|
||||
W.loc = null
|
||||
if(!connected)
|
||||
for(var/obj/item/W in (Mo.contents-implants))
|
||||
Mo.drop_from_inventory(W)
|
||||
M.monkeyizing = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new( M.loc )
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'icons/mob/mob.dmi'
|
||||
animation.master = src
|
||||
flick("monkey2h", animation)
|
||||
sleep(48)
|
||||
del(animation)
|
||||
|
||||
var/mob/living/carbon/human/O = new( src )
|
||||
if(Mo.greaterform)
|
||||
O.set_species(Mo.greaterform)
|
||||
|
||||
if (M.dna.GetUIState(DNA_UI_GENDER))
|
||||
O.gender = FEMALE
|
||||
else
|
||||
O.gender = MALE
|
||||
|
||||
if (M)
|
||||
if (M.dna)
|
||||
O.dna = M.dna
|
||||
M.dna = null
|
||||
|
||||
if (M.suiciding)
|
||||
O.suiciding = M.suiciding
|
||||
M.suiciding = null
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
O.viruses += D
|
||||
D.affected_mob = O
|
||||
M.viruses -= D
|
||||
|
||||
//for(var/obj/T in M)
|
||||
// del(T)
|
||||
|
||||
O.loc = M.loc
|
||||
|
||||
if(M.mind)
|
||||
M.mind.transfer_to(O) //transfer our mind to the human
|
||||
|
||||
if (connected) //inside dna thing
|
||||
var/obj/machinery/dna_scannernew/C = connected
|
||||
O.loc = C
|
||||
C.occupant = O
|
||||
connected = null
|
||||
|
||||
var/i
|
||||
while (!i)
|
||||
var/randomname
|
||||
if (O.gender == MALE)
|
||||
randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names)))
|
||||
else
|
||||
randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names)))
|
||||
if (findname(randomname))
|
||||
continue
|
||||
else
|
||||
O.real_name = randomname
|
||||
i++
|
||||
O.UpdateAppearance()
|
||||
O.take_overall_damage(M.getBruteLoss(), M.getFireLoss())
|
||||
O.adjustToxLoss(M.getToxLoss())
|
||||
O.adjustOxyLoss(M.getOxyLoss())
|
||||
O.stat = M.stat
|
||||
for (var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
// O.update_icon = 1 //queue a full icon update at next life() call
|
||||
del(M)
|
||||
return
|
||||
//////////////////////////////////////////////////////////// Monkey Block
|
||||
if(M)
|
||||
M.update_icon = 1 //queue a full icon update at next life() call
|
||||
return null
|
||||
/////////////////////////// DNA MISC-PROCS
|
||||
*/
|
||||
175
code/game/dna/dna2_helpers.dm
Normal file
175
code/game/dna/dna2_helpers.dm
Normal file
@@ -0,0 +1,175 @@
|
||||
/////////////////////////////
|
||||
// Helpers for DNA2
|
||||
/////////////////////////////
|
||||
|
||||
// Pads 0s to t until length == u
|
||||
/proc/add_zero2(t, u)
|
||||
var/temp1
|
||||
while (length(t) < u)
|
||||
t = "0[t]"
|
||||
temp1 = t
|
||||
if (length(t) > u)
|
||||
temp1 = copytext(t,2,u+1)
|
||||
return temp1
|
||||
|
||||
// DNA Gene activation boundaries, see dna2.dm.
|
||||
// Returns a list object with 4 numbers.
|
||||
/proc/GetDNABounds(var/block)
|
||||
var/list/BOUNDS=dna_activity_bounds[block]
|
||||
if(!istype(BOUNDS))
|
||||
return DNA_DEFAULT_BOUNDS
|
||||
return BOUNDS
|
||||
|
||||
// Give Random Bad Mutation to M
|
||||
/proc/randmutb(var/mob/living/M)
|
||||
if(!M) return
|
||||
M.dna.check_integrity()
|
||||
var/block = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK)
|
||||
M.dna.SetSEState(block, 1)
|
||||
|
||||
// Give Random Good Mutation to M
|
||||
/proc/randmutg(var/mob/living/M)
|
||||
if(!M) return
|
||||
M.dna.check_integrity()
|
||||
var/block = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK)
|
||||
M.dna.SetSEState(block, 1)
|
||||
|
||||
// Random Appearance Mutation
|
||||
/proc/randmuti(var/mob/living/M)
|
||||
if(!M) return
|
||||
M.dna.check_integrity()
|
||||
M.dna.SetUIValue(rand(1,UNIDNASIZE),rand(1,4095))
|
||||
|
||||
// Scramble UI or SE.
|
||||
/proc/scramble(var/UI, var/mob/M, var/prob)
|
||||
if(!M) return
|
||||
M.dna.check_integrity()
|
||||
if(UI)
|
||||
for(var/i = 1, i <= DNA_UI_LENGTH-1, i++)
|
||||
if(prob(prob))
|
||||
M.dna.SetUIValue(i,rand(1,4095),1)
|
||||
M.dna.UpdateUI()
|
||||
M.UpdateAppearance()
|
||||
|
||||
else
|
||||
for(var/i = 1, i <= STRUCDNASIZE-1, i++)
|
||||
if(prob(prob))
|
||||
M.dna.SetSEValue(i,rand(1,4095),1)
|
||||
M.dna.UpdateSE()
|
||||
domutcheck(M, null)
|
||||
return
|
||||
|
||||
// I haven't yet figured out what the fuck this is supposed to do.
|
||||
/proc/miniscramble(input,rs,rd)
|
||||
var/output
|
||||
output = null
|
||||
if (input == "C" || input == "D" || input == "E" || input == "F")
|
||||
output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"6",prob((rs*10));"7",prob((rs*5)+(rd));"0",prob((rs*5)+(rd));"1",prob((rs*10)-(rd));"2",prob((rs*10)-(rd));"3")
|
||||
if (input == "8" || input == "9" || input == "A" || input == "B")
|
||||
output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3")
|
||||
if (input == "4" || input == "5" || input == "6" || input == "7")
|
||||
output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3")
|
||||
if (input == "0" || input == "1" || input == "2" || input == "3")
|
||||
output = pick(prob((rs*10));"8",prob((rs*10));"9",prob((rs*10));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C",prob((rs*10)-(rd));"D",prob((rs*5)+(rd));"E",prob((rs*5)+(rd));"F")
|
||||
if (!output) output = "5"
|
||||
return output
|
||||
|
||||
// HELLO I MAKE BELL CURVES AROUND YOUR DESIRED TARGET
|
||||
// So a shitty way of replacing gaussian noise.
|
||||
// input: YOUR TARGET
|
||||
// rs: RAD STRENGTH
|
||||
// rd: DURATION
|
||||
/proc/miniscrambletarget(input,rs,rd)
|
||||
var/output = null
|
||||
switch(input)
|
||||
if("0")
|
||||
output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10));"2",prob((rs*10)-(rd));"3")
|
||||
if("1")
|
||||
output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10));"3",prob((rs*10)-(rd));"4")
|
||||
if("2")
|
||||
output = pick(prob((rs*10));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10));"4",prob((rs*10)-(rd));"5")
|
||||
if("3")
|
||||
output = pick(prob((rs*10)-(rd));"0",prob((rs*10));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10));"5",prob((rs*10)-(rd));"6")
|
||||
if("4")
|
||||
output = pick(prob((rs*10)-(rd));"1",prob((rs*10));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10));"6",prob((rs*10)-(rd));"7")
|
||||
if("5")
|
||||
output = pick(prob((rs*10)-(rd));"2",prob((rs*10));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10));"7",prob((rs*10)-(rd));"8")
|
||||
if("6")
|
||||
output = pick(prob((rs*10)-(rd));"3",prob((rs*10));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10));"8",prob((rs*10)-(rd));"9")
|
||||
if("7")
|
||||
output = pick(prob((rs*10)-(rd));"4",prob((rs*10));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10));"9",prob((rs*10)-(rd));"A")
|
||||
if("8")
|
||||
output = pick(prob((rs*10)-(rd));"5",prob((rs*10));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10));"A",prob((rs*10)-(rd));"B")
|
||||
if("9")
|
||||
output = pick(prob((rs*10)-(rd));"6",prob((rs*10));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C")
|
||||
if("10")//A
|
||||
output = pick(prob((rs*10)-(rd));"7",prob((rs*10));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10));"C",prob((rs*10)-(rd));"D")
|
||||
if("11")//B
|
||||
output = pick(prob((rs*10)-(rd));"8",prob((rs*10));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10));"D",prob((rs*10)-(rd));"E")
|
||||
if("12")//C
|
||||
output = pick(prob((rs*10)-(rd));"9",prob((rs*10));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10));"E",prob((rs*10)-(rd));"F")
|
||||
if("13")//D
|
||||
output = pick(prob((rs*10)-(rd));"A",prob((rs*10));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10));"F")
|
||||
if("14")//E
|
||||
output = pick(prob((rs*10)-(rd));"B",prob((rs*10));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F")
|
||||
if("15")//F
|
||||
output = pick(prob((rs*10)-(rd));"C",prob((rs*10));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F")
|
||||
|
||||
if(!input || !output) //How did this happen?
|
||||
output = "8"
|
||||
|
||||
return output
|
||||
|
||||
// /proc/updateappearance has changed behavior, so it's been removed
|
||||
// Use mob.UpdateAppearance() instead.
|
||||
|
||||
// Simpler. Don't specify UI in order for the mob to use its own.
|
||||
/mob/proc/UpdateAppearance(var/list/UI=null)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
if(UI!=null)
|
||||
src.dna.UI=UI
|
||||
src.dna.UpdateUI()
|
||||
dna.check_integrity()
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.r_hair = dna.GetUIValueRange(DNA_UI_HAIR_R, 255)
|
||||
H.g_hair = dna.GetUIValueRange(DNA_UI_HAIR_G, 255)
|
||||
H.b_hair = dna.GetUIValueRange(DNA_UI_HAIR_B, 255)
|
||||
|
||||
H.r_facial = dna.GetUIValueRange(DNA_UI_BEARD_R, 255)
|
||||
H.g_facial = dna.GetUIValueRange(DNA_UI_BEARD_G, 255)
|
||||
H.b_facial = dna.GetUIValueRange(DNA_UI_BEARD_B, 255)
|
||||
|
||||
H.r_eyes = dna.GetUIValueRange(DNA_UI_EYES_R, 255)
|
||||
H.g_eyes = dna.GetUIValueRange(DNA_UI_EYES_G, 255)
|
||||
H.b_eyes = dna.GetUIValueRange(DNA_UI_EYES_B, 255)
|
||||
|
||||
var/new_s_tone = dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220)
|
||||
H.s_tone = 35 - max(min( round(new_s_tone), 220),1) //Warning MATH. Blame the person that wrote modules/client/preferences.dm, line 994
|
||||
|
||||
if (dna.GetUIState(DNA_UI_GENDER))
|
||||
H.gender = FEMALE
|
||||
else
|
||||
H.gender = MALE
|
||||
|
||||
//Hair
|
||||
var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE,hair_styles_list.len)
|
||||
if((0 < hair) && (hair <= hair_styles_list.len))
|
||||
H.h_style = hair_styles_list[hair]
|
||||
|
||||
//Facial Hair
|
||||
var/beard = dna.GetUIValueRange(DNA_UI_BEARD_STYLE,facial_hair_styles_list.len)
|
||||
if((0 < beard) && (beard <= facial_hair_styles_list.len))
|
||||
H.f_style = facial_hair_styles_list[beard]
|
||||
|
||||
H.update_body(0)
|
||||
H.update_hair()
|
||||
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
// Used below, simple injection modifier.
|
||||
/proc/probinj(var/pr, var/inj)
|
||||
return prob(pr+inj*pr)
|
||||
|
||||
/////////////////////////// DNA MISC-PROCS
|
||||
@@ -1,5 +1,37 @@
|
||||
#define DNA_BLOCK_SIZE 3
|
||||
|
||||
// Buffer datatype flags.
|
||||
#define DNA2_BUF_UI 1
|
||||
#define DNA2_BUF_UE 2
|
||||
#define DNA2_BUF_SE 4
|
||||
|
||||
//list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0),
|
||||
/datum/dna2/record
|
||||
var/datum/dna/dna = null
|
||||
var/types=0
|
||||
var/name="Empty"
|
||||
|
||||
// Stuff for cloners
|
||||
var/id=null
|
||||
var/implant=null
|
||||
var/ckey=null
|
||||
var/mind=null
|
||||
|
||||
/datum/dna2/record/proc/GetData()
|
||||
var/list/ser=list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0)
|
||||
ser["ue"] = (types & DNA2_BUF_UE) == DNA2_BUF_UE
|
||||
if(types & DNA2_BUF_SE)
|
||||
ser["data"] = dna.SE
|
||||
else
|
||||
ser["data"] = dna.UI
|
||||
ser["owner"] = src.dna.real_name
|
||||
ser["label"] = name
|
||||
if(types & DNA2_BUF_UI)
|
||||
ser["type"] = "ui"
|
||||
else
|
||||
ser["type"] = "se"
|
||||
return ser
|
||||
|
||||
/////////////////////////// DNA MACHINES
|
||||
/obj/machinery/dna_scannernew
|
||||
name = "\improper DNA modifier"
|
||||
@@ -14,6 +46,7 @@
|
||||
var/locked = 0
|
||||
var/mob/living/carbon/occupant = null
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/opened = 0
|
||||
|
||||
/obj/machinery/dna_scannernew/New()
|
||||
..()
|
||||
@@ -80,12 +113,6 @@
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "scanner_1"
|
||||
/*
|
||||
for(var/obj/O in src) // THIS IS P. STUPID -- LOVE, DOOHL
|
||||
//O = null
|
||||
del(O)
|
||||
//Foreach goto(124)
|
||||
*/
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
@@ -111,7 +138,12 @@
|
||||
if (G.affecting.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
put_in(G.affecting)
|
||||
src.add_fingerprint(user)
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/proc/put_in(var/mob/M)
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
@@ -119,8 +151,6 @@
|
||||
src.occupant = M
|
||||
src.icon_state = "scanner_1"
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
// search for ghosts, if the corpse is empty and the scanner is connected to a cloner
|
||||
if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, SOUTH)) \
|
||||
@@ -132,19 +162,11 @@
|
||||
if(ghost.mind == M.mind)
|
||||
ghost << "<b><font color = #330033><font size = 3>Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned!</b> (Verbs -> Ghost -> Re-enter corpse)</font color>"
|
||||
break
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
return
|
||||
/*
|
||||
// it's like this was -just- here to break constructed dna scanners -Pete
|
||||
// if that's not the case, slap my shit and uncomment this.
|
||||
// for(var/obj/O in src)
|
||||
// O.loc = src.loc
|
||||
*/
|
||||
//Foreach goto(30)
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
@@ -205,11 +227,7 @@
|
||||
var/selected_ui_target_hex = 1
|
||||
var/radiation_duration = 2.0
|
||||
var/radiation_intensity = 1.0
|
||||
var/list/buffers = list(
|
||||
list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0),
|
||||
list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0),
|
||||
list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0)
|
||||
)
|
||||
var/list/datum/dna2/record/buffers[3]
|
||||
var/irradiating = 0
|
||||
var/injector_ready = 0 //Quick fix for issue 286 (screwdriver the screen twice to restore injector) -Pete
|
||||
var/obj/machinery/dna_scannernew/connected = null
|
||||
@@ -219,6 +237,7 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 400
|
||||
var/waiting_for_user_input=0 // Fix for #274 (Mash create block injector without answering dialog to make unlimited injectors) - N3X
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
@@ -302,19 +321,19 @@
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/proc/all_dna_blocks(var/buffer)
|
||||
/obj/machinery/computer/scan_consolenew/proc/all_dna_blocks(var/list/buffer)
|
||||
var/list/arr = list()
|
||||
for(var/i = 1, i <= length(buffer)/3, i++)
|
||||
arr += "[i]:[copytext(buffer,i*3-2,i*3+1)]"
|
||||
for(var/i = 1, i <= buffer.len, i++)
|
||||
arr += "[i]:[EncodeDNABlock(buffer[i])]"
|
||||
return arr
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/proc/setInjectorBlock(var/obj/item/weapon/dnainjector/I, var/blk, var/buffer)
|
||||
/obj/machinery/computer/scan_consolenew/proc/setInjectorBlock(var/obj/item/weapon/dnainjector/I, var/blk, var/datum/dna2/record/buffer)
|
||||
var/pos = findtext(blk,":")
|
||||
if(!pos) return 0
|
||||
var/id = text2num(copytext(blk,1,pos))
|
||||
if(!id) return 0
|
||||
I.block = id
|
||||
I.dna = copytext(buffer,id*3-2,id*3+1)
|
||||
I.buf = buffer
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/attackby(obj/item/W as obj, mob/user as mob)
|
||||
@@ -336,6 +355,7 @@
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/attack_ai(user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/attack_hand(user as mob)
|
||||
@@ -345,7 +365,7 @@
|
||||
/**
|
||||
* The ui_interact proc is used to open and update Nano UIs
|
||||
* If ui_interact is not used then the UI will not update correctly
|
||||
* ui_interact is currently defined for /atom/movable
|
||||
* ui_interact is currently defined for /atom/movable (which is inherited by /obj and /mob)
|
||||
*
|
||||
* @param user /mob The mob who is interacting with this ui
|
||||
* @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main")
|
||||
@@ -363,27 +383,26 @@
|
||||
data["selectedMenuKey"] = selected_menu_key
|
||||
data["locked"] = src.connected.locked
|
||||
data["hasOccupant"] = connected.occupant ? 1 : 0
|
||||
|
||||
|
||||
data["isInjectorReady"] = injector_ready
|
||||
|
||||
data["hasDisk"] = disk ? 1 : 0
|
||||
|
||||
var/diskData[0]
|
||||
if (!disk)
|
||||
if (!disk || !disk.buf)
|
||||
diskData["data"] = null
|
||||
diskData["owner"] = null
|
||||
diskData["label"] = null
|
||||
diskData["type"] = null
|
||||
diskData["ue"] = null
|
||||
else
|
||||
diskData["data"] = disk.data
|
||||
diskData["owner"] = disk.owner
|
||||
diskData["label"] = disk.name
|
||||
diskData["type"] = disk.data_type
|
||||
diskData["ue"] = disk.ue
|
||||
diskData = disk.buf.GetData()
|
||||
data["disk"] = diskData
|
||||
|
||||
data["buffers"] = buffers
|
||||
var/list/new_buffers = list()
|
||||
for(var/datum/dna2/record/buf in buffers)
|
||||
new_buffers.Add(buf.GetData())
|
||||
data["buffers"]=new_buffers
|
||||
|
||||
data["radiationIntensity"] = radiation_intensity
|
||||
data["radiationDuration"] = radiation_duration
|
||||
@@ -432,23 +451,19 @@
|
||||
if (connected.beaker.reagents && connected.beaker.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in connected.beaker.reagents.reagent_list)
|
||||
data["beakerVolume"] += R.volume
|
||||
|
||||
if (!ui) // no ui has been passed, so we'll search for one
|
||||
{
|
||||
ui = nanomanager.get_open_ui(user, src, ui_key)
|
||||
}
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new one
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700)
|
||||
// When the UI is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
// Auto update every Master Controller tick
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
else
|
||||
// The UI is already open so push the new data to it
|
||||
ui.push_data(data)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/Topic(href, href_list)
|
||||
if(..())
|
||||
@@ -571,10 +586,7 @@
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
|
||||
if (href_list["pulseUIRadiation"])
|
||||
var/block
|
||||
var/newblock
|
||||
var/tstructure2
|
||||
block = getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),src.selected_ui_subblock,1)
|
||||
var/block = src.connected.occupant.dna.GetUISubBlock(src.selected_ui_block,src.selected_ui_subblock)
|
||||
|
||||
irradiating = src.radiation_duration
|
||||
var/lock_state = src.connected.locked
|
||||
@@ -590,13 +602,8 @@
|
||||
|
||||
if (prob((80 + (src.radiation_duration / 2))))
|
||||
block = miniscrambletarget(num2text(selected_ui_target), src.radiation_intensity, src.radiation_duration)
|
||||
newblock = null
|
||||
if (src.selected_ui_subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),2,1) + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),3,1)
|
||||
if (src.selected_ui_subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),1,1) + block + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),3,1)
|
||||
if (src.selected_ui_subblock == 3) newblock = getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),1,1) + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),2,1) + block
|
||||
tstructure2 = setblock(src.connected.occupant.dna.uni_identity, src.selected_ui_block, newblock,DNA_BLOCK_SIZE)
|
||||
src.connected.occupant.dna.uni_identity = tstructure2
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.dna.SetUISubBlock(src.selected_ui_block,src.selected_ui_subblock,block)
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
else
|
||||
if (prob(20+src.radiation_intensity))
|
||||
@@ -604,7 +611,7 @@
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration)
|
||||
src.connected.locked = lock_state
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
@@ -632,15 +639,13 @@
|
||||
src.selected_se_block = select_block
|
||||
if ((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1))
|
||||
src.selected_se_subblock = select_subblock
|
||||
//testing("User selected block [selected_se_block] (sent [select_block]), subblock [selected_se_subblock] (sent [select_block]).")
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
|
||||
if (href_list["pulseSERadiation"])
|
||||
var/block
|
||||
var/newblock
|
||||
var/tstructure2
|
||||
var/oldblock
|
||||
|
||||
block = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),src.selected_se_subblock,1)
|
||||
var/block = src.connected.occupant.dna.GetSESubBlock(src.selected_se_block,src.selected_se_subblock)
|
||||
//var/original_block=block
|
||||
//testing("Irradiating SE block [src.selected_se_block]:[src.selected_se_subblock] ([block])...")
|
||||
|
||||
irradiating = src.radiation_duration
|
||||
var/lock_state = src.connected.locked
|
||||
@@ -653,47 +658,37 @@
|
||||
|
||||
if(src.connected.occupant)
|
||||
if (prob((80 + (src.radiation_duration / 2))))
|
||||
if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20))
|
||||
oldblock = src.selected_se_block
|
||||
block = miniscramble(block, src.radiation_intensity, src.radiation_duration)
|
||||
newblock = null
|
||||
// FIXME: Find out what these corresponded to and change them to the WHATEVERBLOCK they need to be.
|
||||
//if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20))
|
||||
var/real_SE_block=selected_se_block
|
||||
block = miniscramble(block, src.radiation_intensity, src.radiation_duration)
|
||||
if(prob(20))
|
||||
if (src.selected_se_block > 1 && src.selected_se_block < STRUCDNASIZE/2)
|
||||
src.selected_se_block++
|
||||
real_SE_block++
|
||||
else if (src.selected_se_block > STRUCDNASIZE/2 && src.selected_se_block < STRUCDNASIZE)
|
||||
src.selected_se_block--
|
||||
if (src.selected_se_subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1)
|
||||
if (src.selected_se_subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1)
|
||||
if (src.selected_se_subblock == 3) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + block
|
||||
tstructure2 = setblock(src.connected.occupant.dna.struc_enzymes, src.selected_se_block, newblock,DNA_BLOCK_SIZE)
|
||||
src.connected.occupant.dna.struc_enzymes = tstructure2
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
src.selected_se_block = oldblock
|
||||
else
|
||||
//
|
||||
block = miniscramble(block, src.radiation_intensity, src.radiation_duration)
|
||||
newblock = null
|
||||
if (src.selected_se_subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1)
|
||||
if (src.selected_se_subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1)
|
||||
if (src.selected_se_subblock == 3) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + block
|
||||
tstructure2 = setblock(src.connected.occupant.dna.struc_enzymes, src.selected_se_block, newblock,DNA_BLOCK_SIZE)
|
||||
src.connected.occupant.dna.struc_enzymes = tstructure2
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
real_SE_block--
|
||||
|
||||
//testing("Irradiated SE block [real_SE_block]:[src.selected_se_subblock] ([original_block] now [block]) [(real_SE_block!=selected_se_block) ? "(SHIFTED)":""]!")
|
||||
connected.occupant.dna.SetSESubBlock(real_SE_block,selected_se_subblock,block)
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration)
|
||||
if (prob(80-src.radiation_duration))
|
||||
//testing("Random bad mut!")
|
||||
randmutb(src.connected.occupant)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration)
|
||||
//testing("Random identity mut!")
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.locked = lock_state
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
|
||||
if(href_list["ejectBeaker"])
|
||||
if(connected.beaker)
|
||||
connected.beaker.loc = connected.loc
|
||||
var/obj/item/weapon/reagent_containers/glass/B = connected.beaker
|
||||
B.loc = connected.loc
|
||||
connected.beaker = null
|
||||
return 1
|
||||
|
||||
@@ -704,18 +699,14 @@
|
||||
// Transfer Buffer Management
|
||||
if(href_list["bufferOption"])
|
||||
var/bufferOption = href_list["bufferOption"]
|
||||
|
||||
|
||||
// These bufferOptions do not require a bufferId
|
||||
if (bufferOption == "wipeDisk")
|
||||
if ((isnull(src.disk)) || (src.disk.read_only))
|
||||
//src.temphtml = "Invalid disk. Please try again."
|
||||
return 0
|
||||
|
||||
src.disk.data = null
|
||||
src.disk.data_type = null
|
||||
src.disk.ue = null
|
||||
src.disk.owner = null
|
||||
src.disk.name = null
|
||||
src.disk.buf=null
|
||||
//src.temphtml = "Data saved."
|
||||
return 1
|
||||
|
||||
@@ -724,12 +715,12 @@
|
||||
return
|
||||
src.disk.loc = get_turf(src)
|
||||
src.disk = null
|
||||
return 1
|
||||
|
||||
return 1
|
||||
|
||||
// All bufferOptions from here on require a bufferId
|
||||
if (!href_list["bufferId"])
|
||||
return 0
|
||||
|
||||
|
||||
var/bufferId = text2num(href_list["bufferId"])
|
||||
|
||||
if (bufferId < 1 || bufferId > 3)
|
||||
@@ -737,56 +728,46 @@
|
||||
|
||||
if (bufferOption == "saveUI")
|
||||
if(src.connected.occupant && src.connected.occupant.dna)
|
||||
src.buffers[bufferId]["ue"] = 0
|
||||
src.buffers[bufferId]["data"] = src.connected.occupant.dna.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffers[bufferId]["owner"] = src.connected.occupant.name
|
||||
else
|
||||
src.buffers[bufferId]["owner"] = src.connected.occupant.real_name
|
||||
src.buffers[bufferId]["label"] = "Unique Identifier"
|
||||
src.buffers[bufferId]["type"] = "ui"
|
||||
var/datum/dna2/record/databuf=new
|
||||
databuf.types = DNA2_BUF_UE
|
||||
databuf.dna = src.connected.occupant.dna
|
||||
databuf.name = "Unique Identifier"
|
||||
src.buffers[bufferId] = databuf
|
||||
return 1
|
||||
|
||||
if (bufferOption == "saveUIAndUE")
|
||||
if(src.connected.occupant && src.connected.occupant.dna)
|
||||
src.buffers[bufferId]["data"] = src.connected.occupant.dna.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffers[bufferId]["owner"] = src.connected.occupant.name
|
||||
else
|
||||
src.buffers[bufferId]["owner"] = src.connected.occupant.real_name
|
||||
src.buffers[bufferId]["label"] = "Unique Identifier + Unique Enzymes"
|
||||
src.buffers[bufferId]["type"] = "ui"
|
||||
src.buffers[bufferId]["ue"] = 1
|
||||
var/datum/dna2/record/databuf=new
|
||||
databuf.types = DNA2_BUF_UI|DNA2_BUF_UE
|
||||
databuf.dna = src.connected.occupant.dna
|
||||
databuf.name = "Unique Identifier + Unique Enzymes"
|
||||
src.buffers[bufferId] = databuf
|
||||
return 1
|
||||
|
||||
if (bufferOption == "saveSE")
|
||||
if(src.connected.occupant && src.connected.occupant.dna)
|
||||
src.buffers[bufferId]["ue"] = 0
|
||||
src.buffers[bufferId]["data"] = src.connected.occupant.dna.struc_enzymes
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffers[bufferId]["owner"] = src.connected.occupant.name
|
||||
else
|
||||
src.buffers[bufferId]["owner"] = src.connected.occupant.real_name
|
||||
src.buffers[bufferId]["label"] = "Structural Enzymes"
|
||||
src.buffers[bufferId]["type"] = "se"
|
||||
var/datum/dna2/record/databuf=new
|
||||
databuf.types = DNA2_BUF_SE
|
||||
databuf.dna = src.connected.occupant.dna
|
||||
databuf.name = "Structural Enzymes"
|
||||
src.buffers[bufferId] = databuf
|
||||
return 1
|
||||
|
||||
if (bufferOption == "clear")
|
||||
src.buffers[bufferId]["data"] = null
|
||||
src.buffers[bufferId]["owner"] = null
|
||||
src.buffers[bufferId]["label"] = null
|
||||
src.buffers[bufferId]["ue"] = null
|
||||
src.buffers[bufferId]=null
|
||||
return 1
|
||||
|
||||
if (bufferOption == "changeLabel")
|
||||
var/label = src.buffers[bufferId]["label"] ? src.buffers[bufferId]["label"] : "New Label"
|
||||
src.buffers[bufferId]["label"] = sanitize(input("New Label:", "Edit Label", label))
|
||||
var/datum/dna2/record/buf = src.buffers[bufferId]
|
||||
buf.name = buf.name ? src.buffers[bufferId]["label"] : "New Label"
|
||||
buf.name = sanitize(input("New Label:", "Edit Label", buf.name))
|
||||
src.buffers[bufferId] = buf
|
||||
return 1
|
||||
|
||||
if (bufferOption == "transfer")
|
||||
if (!src.connected.occupant || (NOCLONE in src.connected.occupant.mutations) || !src.connected.occupant.dna)
|
||||
return
|
||||
|
||||
|
||||
irradiating = 2
|
||||
var/lock_state = src.connected.locked
|
||||
src.connected.locked = 1//lock it
|
||||
@@ -796,33 +777,37 @@
|
||||
|
||||
irradiating = 0
|
||||
src.connected.locked = lock_state
|
||||
|
||||
if (src.buffers[bufferId]["type"] == "ui")
|
||||
if (src.buffers[bufferId]["ue"])
|
||||
src.connected.occupant.real_name = src.buffers[bufferId]["owner"]
|
||||
src.connected.occupant.name = src.buffers[bufferId]["owner"]
|
||||
src.connected.occupant.dna.uni_identity = src.buffers[bufferId]["data"]
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
else if (src.buffers[bufferId]["type"] == "se")
|
||||
src.connected.occupant.dna.struc_enzymes = src.buffers[bufferId]["data"]
|
||||
|
||||
var/datum/dna2/record/buf = src.buffers[bufferId]
|
||||
|
||||
if ((buf.types & DNA2_BUF_UI))
|
||||
if ((buf.types & DNA2_BUF_UE))
|
||||
src.connected.occupant.real_name = buf.dna.real_name
|
||||
src.connected.occupant.name = buf.dna.real_name
|
||||
src.connected.occupant.UpdateAppearance(buf.dna.UI)
|
||||
else if (buf.types & DNA2_BUF_SE)
|
||||
src.connected.occupant.dna.SE = buf.dna.SE
|
||||
src.connected.occupant.dna.UpdateSE()
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += rand(20,50)
|
||||
return 1
|
||||
|
||||
if (bufferOption == "createInjector")
|
||||
if (src.injector_ready)
|
||||
if (src.injector_ready || waiting_for_user_input)
|
||||
|
||||
var/success = 1
|
||||
var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector
|
||||
I.dnatype = src.buffers[bufferId]["type"]
|
||||
var/datum/dna2/record/buf = src.buffers[bufferId]
|
||||
if(href_list["createBlockInjector"])
|
||||
var/blk = input(usr,"Select Block","Block") in all_dna_blocks(src.buffers[bufferId]["data"])
|
||||
success = setInjectorBlock(I,blk,src.buffers[bufferId]["data"])
|
||||
waiting_for_user_input=1
|
||||
var/blk = input(usr,"Select Block","Block") in all_dna_blocks(buf.GetData())
|
||||
success = setInjectorBlock(I,blk,buf)
|
||||
else
|
||||
I.dna = src.buffers[bufferId]["data"]
|
||||
I.buf = buf
|
||||
waiting_for_user_input=0
|
||||
if(success)
|
||||
I.loc = src.loc
|
||||
I.name += " ([src.buffers[bufferId]["label"]])"
|
||||
if (src.buffers[bufferId]["ue"]) I.ue = src.buffers[bufferId]["owner"] //lazy haw haw
|
||||
I.name += " ([buf.name])"
|
||||
//src.temphtml = "Injector created."
|
||||
src.injector_ready = 0
|
||||
spawn(300)
|
||||
@@ -834,14 +819,11 @@
|
||||
return 1
|
||||
|
||||
if (bufferOption == "loadDisk")
|
||||
if ((isnull(src.disk)) || (!src.disk.data) || (src.disk.data == ""))
|
||||
if ((isnull(src.disk)) || (!src.disk.buf))
|
||||
//src.temphtml = "Invalid disk. Please try again."
|
||||
return 0
|
||||
|
||||
src.buffers[bufferId]["data"] = src.disk.data
|
||||
src.buffers[bufferId]["type"] = src.disk.data_type
|
||||
src.buffers[bufferId]["ue"] = src.disk.ue
|
||||
src.buffers[bufferId]["owner"] = src.disk.owner
|
||||
src.buffers[bufferId]=src.disk.buf
|
||||
//src.temphtml = "Data loaded."
|
||||
return 1
|
||||
|
||||
@@ -850,13 +832,12 @@
|
||||
//src.temphtml = "Invalid disk. Please try again."
|
||||
return 0
|
||||
|
||||
src.disk.data = buffers[bufferId]["data"]
|
||||
src.disk.data_type = src.buffers[bufferId]["type"]
|
||||
src.disk.ue = src.buffers[bufferId]["ue"]
|
||||
src.disk.owner = src.buffers[bufferId]["owner"]
|
||||
src.disk.name = "data disk - '[src.buffers[bufferId]["owner"]]'"
|
||||
var/datum/dna2/record/buf = src.buffers[bufferId]
|
||||
|
||||
src.disk.buf = buf
|
||||
src.disk.name = "data disk - '[buf.dna.real_name]'"
|
||||
//src.temphtml = "Data saved."
|
||||
return 1
|
||||
return 1
|
||||
|
||||
|
||||
/////////////////////////// DNA MACHINES
|
||||
|
||||
125
code/game/dna/genes/disabilities.dm
Normal file
125
code/game/dna/genes/disabilities.dm
Normal file
@@ -0,0 +1,125 @@
|
||||
/////////////////////
|
||||
// DISABILITY GENES
|
||||
//
|
||||
// These activate either a mutation, disability, or sdisability.
|
||||
//
|
||||
// Gene is always activated.
|
||||
/////////////////////
|
||||
|
||||
/datum/dna/gene/disability
|
||||
name="DISABILITY"
|
||||
|
||||
// Mutation to give (or 0)
|
||||
var/mutation=0
|
||||
|
||||
// Disability to give (or 0)
|
||||
var/disability=0
|
||||
|
||||
// SDisability to give (or 0)
|
||||
var/sdisability=0
|
||||
|
||||
// Activation message
|
||||
var/activation_message=""
|
||||
|
||||
// Yay, you're no longer growing 3 arms
|
||||
var/deactivation_message=""
|
||||
|
||||
/datum/dna/gene/disability/can_activate(var/mob/M,var/flags)
|
||||
return 1 // Always set!
|
||||
|
||||
/datum/dna/gene/disability/activate(var/mob/M, var/connected, var/flags)
|
||||
if(mutation && !(mutation in M.mutations))
|
||||
M.mutations.Add(mutation)
|
||||
if(disability)
|
||||
M.disabilities|=disability
|
||||
if(sdisability)
|
||||
M.sdisabilities|=sdisability
|
||||
if(activation_message)
|
||||
M << "\red [activation_message]"
|
||||
|
||||
/datum/dna/gene/disability/deactivate(var/mob/M, var/connected, var/flags)
|
||||
if(mutation && (mutation in M.mutations))
|
||||
M.mutations.Remove(mutation)
|
||||
if(disability)
|
||||
M.disabilities &= ~disability
|
||||
if(sdisability)
|
||||
M.sdisabilities &= ~sdisability
|
||||
if(deactivation_message)
|
||||
M << "\red [deactivation_message]"
|
||||
|
||||
// Note: Doesn't seem to do squat, at the moment.
|
||||
/datum/dna/gene/disability/hallucinate
|
||||
name="Hallucinate"
|
||||
activation_message="Your mind says 'Hello'."
|
||||
mutation=mHallucination
|
||||
|
||||
New()
|
||||
block=HALLUCINATIONBLOCK
|
||||
|
||||
/datum/dna/gene/disability/epilepsy
|
||||
name="Epilepsy"
|
||||
activation_message="You get a headache."
|
||||
disability=EPILEPSY
|
||||
|
||||
New()
|
||||
block=HEADACHEBLOCK
|
||||
|
||||
/datum/dna/gene/disability/cough
|
||||
name="Coughing"
|
||||
activation_message="You start coughing."
|
||||
disability=COUGHING
|
||||
|
||||
New()
|
||||
block=COUGHBLOCK
|
||||
|
||||
/datum/dna/gene/disability/clumsy
|
||||
name="Clumsiness"
|
||||
activation_message="You feel lightheaded."
|
||||
mutation=CLUMSY
|
||||
|
||||
New()
|
||||
block=CLUMSYBLOCK
|
||||
|
||||
/datum/dna/gene/disability/tourettes
|
||||
name="Tourettes"
|
||||
activation_message="You twitch."
|
||||
disability=TOURETTES
|
||||
|
||||
New()
|
||||
block=TWITCHBLOCK
|
||||
|
||||
/datum/dna/gene/disability/nervousness
|
||||
name="Nervousness"
|
||||
activation_message="You feel nervous."
|
||||
disability=NERVOUS
|
||||
|
||||
New()
|
||||
block=NERVOUSBLOCK
|
||||
|
||||
/datum/dna/gene/disability/blindness
|
||||
name="Blindness"
|
||||
activation_message="You can't seem to see anything."
|
||||
sdisability=BLIND
|
||||
|
||||
New()
|
||||
block=BLINDBLOCK
|
||||
|
||||
/datum/dna/gene/disability/deaf
|
||||
name="Deafness"
|
||||
activation_message="It's kinda quiet."
|
||||
sdisability=DEAF
|
||||
|
||||
New()
|
||||
block=DEAFBLOCK
|
||||
|
||||
activate(var/mob/M, var/connected, var/flags)
|
||||
..(M,connected,flags)
|
||||
M.ear_deaf = 1
|
||||
|
||||
/datum/dna/gene/disability/nearsighted
|
||||
name="Nearsightedness"
|
||||
activation_message="Your eyes feel weird..."
|
||||
disability=NEARSIGHTED
|
||||
|
||||
New()
|
||||
block=GLASSESBLOCK
|
||||
88
code/game/dna/genes/gene.dm
Normal file
88
code/game/dna/genes/gene.dm
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Gene Datum
|
||||
*
|
||||
* domutcheck was getting pretty hairy. This is the solution.
|
||||
*
|
||||
* All genes are stored in a global variable to cut down on memory
|
||||
* usage.
|
||||
*
|
||||
* @author N3X15 <nexisentertainment@gmail.com>
|
||||
*/
|
||||
|
||||
/datum/dna/gene
|
||||
// Display name
|
||||
var/name="BASE GENE"
|
||||
|
||||
// Probably won't get used but why the fuck not
|
||||
var/desc="Oh god who knows what this does."
|
||||
|
||||
// Set in initialize()!
|
||||
// What gene activates this?
|
||||
var/block=0
|
||||
|
||||
// Any of a number of GENE_ flags.
|
||||
var/flags=0
|
||||
|
||||
// Return 1 if we can activate.
|
||||
// HANDLE MUTCHK_FORCED HERE!
|
||||
/datum/dna/gene/proc/can_activate(var/mob/M, var/flags)
|
||||
return 0
|
||||
|
||||
// Called when the gene activates. Do your magic here.
|
||||
/datum/dna/gene/proc/activate(var/mob/M, var/connected, var/flags)
|
||||
return
|
||||
|
||||
// Called when the gene deactivates. Undo your magic here.
|
||||
// Only called when the block is deactivated.
|
||||
/datum/dna/gene/proc/deactivate(var/mob/M, var/connected, var/flags)
|
||||
return
|
||||
|
||||
|
||||
/////////////////////
|
||||
// BASIC GENES
|
||||
//
|
||||
// These just chuck in a mutation and display a message.
|
||||
//
|
||||
// Gene is activated:
|
||||
// 1. If mutation already exists in mob
|
||||
// 2. If the probability roll succeeds
|
||||
// 3. Activation is forced (done in domutcheck)
|
||||
/////////////////////
|
||||
|
||||
|
||||
/datum/dna/gene/basic
|
||||
name="BASIC GENE"
|
||||
|
||||
// Mutation to give
|
||||
var/mutation=0
|
||||
|
||||
// Activation probability
|
||||
var/activation_prob=45
|
||||
|
||||
// Possible activation messages
|
||||
var/list/activation_messages=list()
|
||||
|
||||
// Possible deactivation messages
|
||||
var/list/deactivation_messages=list()
|
||||
|
||||
/datum/dna/gene/basic/can_activate(var/mob/M,var/flags)
|
||||
if(mutation==0)
|
||||
return 0
|
||||
|
||||
// Probability check
|
||||
if(flags & MUTCHK_FORCED || probinj(activation_prob,(flags&MUTCHK_FORCED)))
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/datum/dna/gene/basic/activate(var/mob/M)
|
||||
M.mutations.Add(mutation)
|
||||
if(activation_messages.len)
|
||||
var/msg = pick(activation_messages)
|
||||
M << "\blue [msg]"
|
||||
|
||||
/datum/dna/gene/basic/deactivate(var/mob/M)
|
||||
M.mutations.Remove(mutation)
|
||||
if(deactivation_messages.len)
|
||||
var/msg = pick(deactivation_messages)
|
||||
M << "\red [msg]"
|
||||
170
code/game/dna/genes/monkey.dm
Normal file
170
code/game/dna/genes/monkey.dm
Normal file
@@ -0,0 +1,170 @@
|
||||
/datum/dna/gene/monkey
|
||||
name="Monkey"
|
||||
|
||||
/datum/dna/gene/monkey/New()
|
||||
block=MONKEYBLOCK
|
||||
|
||||
/datum/dna/gene/monkey/can_activate(var/mob/M,var/flags)
|
||||
return istype(M, /mob/living/carbon/human) || istype(M,/mob/living/carbon/monkey)
|
||||
|
||||
/datum/dna/gene/monkey/activate(var/mob/living/M, var/connected, var/flags)
|
||||
if(!istype(M,/mob/living/carbon/human))
|
||||
return
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.monkeyizing = 1
|
||||
var/list/implants = list() //Try to preserve implants.
|
||||
for(var/obj/item/weapon/implant/W in H)
|
||||
implants += W
|
||||
W.loc = null
|
||||
|
||||
if(!connected)
|
||||
for(var/obj/item/W in (H.contents-implants))
|
||||
if (W==H.w_uniform) // will be teared
|
||||
continue
|
||||
H.drop_from_inventory(W)
|
||||
M.monkeyizing = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new( M.loc )
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'icons/mob/mob.dmi'
|
||||
animation.master = src
|
||||
flick("h2monkey", animation)
|
||||
sleep(48)
|
||||
del(animation)
|
||||
|
||||
|
||||
var/mob/living/carbon/monkey/O = null
|
||||
if(H.species.primitive)
|
||||
O = new H.species.primitive(src)
|
||||
else
|
||||
H.gib() //Trying to change the species of a creature with no primitive var set is messy.
|
||||
return
|
||||
|
||||
if(M)
|
||||
if (M.dna)
|
||||
O.dna = M.dna
|
||||
M.dna = null
|
||||
|
||||
if (M.suiciding)
|
||||
O.suiciding = M.suiciding
|
||||
M.suiciding = null
|
||||
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
O.viruses += D
|
||||
D.affected_mob = O
|
||||
M.viruses -= D
|
||||
|
||||
|
||||
for(var/obj/T in (M.contents-implants))
|
||||
del(T)
|
||||
|
||||
O.loc = M.loc
|
||||
|
||||
if(M.mind)
|
||||
M.mind.transfer_to(O) //transfer our mind to the cute little monkey
|
||||
|
||||
if (connected) //inside dna thing
|
||||
var/obj/machinery/dna_scannernew/C = connected
|
||||
O.loc = C
|
||||
C.occupant = O
|
||||
connected = null
|
||||
O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6))
|
||||
O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss())
|
||||
O.adjustToxLoss(M.getToxLoss() + 20)
|
||||
O.adjustOxyLoss(M.getOxyLoss())
|
||||
O.stat = M.stat
|
||||
O.a_intent = "hurt"
|
||||
for (var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
// O.update_icon = 1 //queue a full icon update at next life() call
|
||||
del(M)
|
||||
return
|
||||
|
||||
/datum/dna/gene/monkey/deactivate(var/mob/living/M, var/connected, var/flags)
|
||||
if(!istype(M,/mob/living/carbon/monkey))
|
||||
return
|
||||
var/mob/living/carbon/monkey/Mo = M
|
||||
Mo.monkeyizing = 1
|
||||
var/list/implants = list() //Still preserving implants
|
||||
for(var/obj/item/weapon/implant/W in Mo)
|
||||
implants += W
|
||||
W.loc = null
|
||||
if(!connected)
|
||||
for(var/obj/item/W in (Mo.contents-implants))
|
||||
Mo.drop_from_inventory(W)
|
||||
M.monkeyizing = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new( M.loc )
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'icons/mob/mob.dmi'
|
||||
animation.master = src
|
||||
flick("monkey2h", animation)
|
||||
sleep(48)
|
||||
del(animation)
|
||||
|
||||
var/mob/living/carbon/human/O = new( src )
|
||||
if(Mo.greaterform)
|
||||
O.set_species(Mo.greaterform)
|
||||
|
||||
if (M.dna.GetUIState(DNA_UI_GENDER))
|
||||
O.gender = FEMALE
|
||||
else
|
||||
O.gender = MALE
|
||||
|
||||
if (M)
|
||||
if (M.dna)
|
||||
O.dna = M.dna
|
||||
M.dna = null
|
||||
|
||||
if (M.suiciding)
|
||||
O.suiciding = M.suiciding
|
||||
M.suiciding = null
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
O.viruses += D
|
||||
D.affected_mob = O
|
||||
M.viruses -= D
|
||||
|
||||
//for(var/obj/T in M)
|
||||
// del(T)
|
||||
|
||||
O.loc = M.loc
|
||||
|
||||
if(M.mind)
|
||||
M.mind.transfer_to(O) //transfer our mind to the human
|
||||
|
||||
if (connected) //inside dna thing
|
||||
var/obj/machinery/dna_scannernew/C = connected
|
||||
O.loc = C
|
||||
C.occupant = O
|
||||
connected = null
|
||||
|
||||
var/i
|
||||
while (!i)
|
||||
var/randomname
|
||||
if (O.gender == MALE)
|
||||
randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names)))
|
||||
else
|
||||
randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names)))
|
||||
if (findname(randomname))
|
||||
continue
|
||||
else
|
||||
O.real_name = randomname
|
||||
i++
|
||||
O.UpdateAppearance()
|
||||
O.take_overall_damage(M.getBruteLoss(), M.getFireLoss())
|
||||
O.adjustToxLoss(M.getToxLoss())
|
||||
O.adjustOxyLoss(M.getOxyLoss())
|
||||
O.stat = M.stat
|
||||
for (var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
// O.update_icon = 1 //queue a full icon update at next life() call
|
||||
del(M)
|
||||
return
|
||||
167
code/game/dna/genes/powers.dm
Normal file
167
code/game/dna/genes/powers.dm
Normal file
@@ -0,0 +1,167 @@
|
||||
///////////////////////////////////
|
||||
// POWERS
|
||||
///////////////////////////////////
|
||||
|
||||
/datum/dna/gene/basic/nobreath
|
||||
name="No Breathing"
|
||||
activation_messages=list("You feel no need to breathe.")
|
||||
mutation=mNobreath
|
||||
|
||||
New()
|
||||
block=NOBREATHBLOCK
|
||||
|
||||
/datum/dna/gene/basic/remoteview
|
||||
name="Remote Viewing"
|
||||
activation_messages=list("Your mind expands.")
|
||||
mutation=mRemote
|
||||
|
||||
New()
|
||||
block=REMOTEVIEWBLOCK
|
||||
|
||||
activate(var/mob/M, var/connected, var/flags)
|
||||
..(M,connected,flags)
|
||||
M.verbs += /mob/living/carbon/human/proc/remoteobserve
|
||||
|
||||
/datum/dna/gene/basic/regenerate
|
||||
name="Regenerate"
|
||||
activation_messages=list("You feel better.")
|
||||
mutation=mRegen
|
||||
|
||||
New()
|
||||
block=REGENERATEBLOCK
|
||||
|
||||
/datum/dna/gene/basic/increaserun
|
||||
name="Super Speed"
|
||||
activation_messages=list("Your leg muscles pulsate.")
|
||||
mutation=mRun
|
||||
|
||||
New()
|
||||
block=INCREASERUNBLOCK
|
||||
|
||||
/datum/dna/gene/basic/remotetalk
|
||||
name="Telepathy"
|
||||
activation_messages=list("You expand your mind outwards.")
|
||||
mutation=mRemotetalk
|
||||
|
||||
New()
|
||||
block=REMOTETALKBLOCK
|
||||
|
||||
activate(var/mob/M, var/connected, var/flags)
|
||||
..(M,connected,flags)
|
||||
M.verbs += /mob/living/carbon/human/proc/remotesay
|
||||
|
||||
/datum/dna/gene/basic/morph
|
||||
name="Morph"
|
||||
activation_messages=list("Your skin feels strange.")
|
||||
mutation=mMorph
|
||||
|
||||
New()
|
||||
block=MORPHBLOCK
|
||||
|
||||
activate(var/mob/M)
|
||||
..(M)
|
||||
M.verbs += /mob/living/carbon/human/proc/morph
|
||||
|
||||
/* Not used on bay
|
||||
/datum/dna/gene/basic/heat_resist
|
||||
name="Heat Resistance"
|
||||
activation_messages=list("Your skin is icy to the touch.")
|
||||
mutation=mHeatres
|
||||
|
||||
New()
|
||||
block=COLDBLOCK
|
||||
|
||||
can_activate(var/mob/M,var/flags)
|
||||
// Probability check
|
||||
var/_prob = 15
|
||||
if(COLD_RESISTANCE in M.mutations)
|
||||
_prob=5
|
||||
if(probinj(_prob,(flags&MUTCHK_FORCED)))
|
||||
return 1
|
||||
*/
|
||||
|
||||
/datum/dna/gene/basic/cold_resist
|
||||
name="Cold Resistance"
|
||||
activation_messages=list("Your body is filled with warmth.")
|
||||
mutation=COLD_RESISTANCE
|
||||
|
||||
New()
|
||||
block=FIREBLOCK
|
||||
|
||||
can_activate(var/mob/M,var/flags)
|
||||
|
||||
// Probability check
|
||||
var/_prob=30
|
||||
//if(mHeatres in M.mutations)
|
||||
// _prob=5
|
||||
if(probinj(_prob,(flags&MUTCHK_FORCED)))
|
||||
return 1
|
||||
|
||||
/datum/dna/gene/basic/noprints
|
||||
name="No Prints"
|
||||
activation_messages=list("Your fingers feel numb.")
|
||||
mutation=mFingerprints
|
||||
|
||||
New()
|
||||
block=NOPRINTSBLOCK
|
||||
|
||||
/datum/dna/gene/basic/noshock
|
||||
name="Shock Immunity"
|
||||
activation_messages=list("Your skin feels strange.")
|
||||
mutation=mShock
|
||||
|
||||
New()
|
||||
block=SHOCKIMMUNITYBLOCK
|
||||
|
||||
/datum/dna/gene/basic/midget
|
||||
name="Midget"
|
||||
activation_messages=list("Your skin feels rubbery.")
|
||||
mutation=mSmallsize
|
||||
|
||||
New()
|
||||
block=SMALLSIZEBLOCK
|
||||
|
||||
can_activate(var/mob/M,var/flags)
|
||||
// Can't be big and small.
|
||||
if(HULK in M.mutations)
|
||||
return 0
|
||||
return ..(M,flags)
|
||||
|
||||
activate(var/mob/M, var/connected, var/flags)
|
||||
..(M,connected,flags)
|
||||
M.pass_flags |= 1
|
||||
|
||||
deactivate(var/mob/M, var/connected, var/flags)
|
||||
..(M,connected,flags)
|
||||
M.pass_flags &= ~1 //This may cause issues down the track, but offhand I can't think of any other way for humans to get passtable short of varediting so it should be fine. ~Z
|
||||
|
||||
/datum/dna/gene/basic/hulk
|
||||
name="Hulk"
|
||||
activation_messages=list("Your muscles hurt.")
|
||||
mutation=HULK
|
||||
|
||||
New()
|
||||
block=HULKBLOCK
|
||||
|
||||
can_activate(var/mob/M,var/flags)
|
||||
// Can't be big and small.
|
||||
if(mSmallsize in M.mutations)
|
||||
return 0
|
||||
return ..(M,flags)
|
||||
|
||||
/datum/dna/gene/basic/xray
|
||||
name="X-Ray Vision"
|
||||
activation_messages=list("The walls suddenly disappear.")
|
||||
mutation=XRAY
|
||||
|
||||
New()
|
||||
block=XRAYBLOCK
|
||||
|
||||
/datum/dna/gene/basic/tk
|
||||
name="Telekenesis"
|
||||
activation_messages=list("You feel smarter.")
|
||||
mutation=TK
|
||||
activation_prob=15
|
||||
|
||||
New()
|
||||
block=TELEBLOCK
|
||||
@@ -6,7 +6,7 @@
|
||||
density = 1
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
health = 100
|
||||
health = 60
|
||||
brute_resist = 1
|
||||
fire_resist = 2
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
src.dna = chosen_dna
|
||||
src.real_name = chosen_dna.real_name
|
||||
src.flavor_text = ""
|
||||
updateappearance(src, src.dna.uni_identity)
|
||||
src.UpdateAppearance()
|
||||
domutcheck(src, null)
|
||||
|
||||
src.verbs -= /mob/proc/changeling_transform
|
||||
@@ -205,6 +205,10 @@
|
||||
var/datum/changeling/changeling = changeling_power(1,0,0)
|
||||
if(!changeling) return
|
||||
|
||||
if(src.has_brain_worms())
|
||||
src << "<span class='warning'>We cannot perform this ability at the present time!</span>"
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C = src
|
||||
changeling.chem_charges--
|
||||
C.remove_changeling_powers()
|
||||
@@ -314,7 +318,7 @@
|
||||
W.layer = initial(W.layer)
|
||||
|
||||
var/mob/living/carbon/human/O = new /mob/living/carbon/human( src )
|
||||
if (isblockon(getblock(C.dna.uni_identity, 11,3),11))
|
||||
if (C.dna.GetUIState(DNA_UI_GENDER))
|
||||
O.gender = FEMALE
|
||||
else
|
||||
O.gender = MALE
|
||||
@@ -327,7 +331,7 @@
|
||||
|
||||
O.loc = C.loc
|
||||
|
||||
updateappearance(O,O.dna.uni_identity)
|
||||
O.UpdateAppearance()
|
||||
domutcheck(O, null)
|
||||
O.setToxLoss(C.getToxLoss())
|
||||
O.adjustBruteLoss(C.getBruteLoss())
|
||||
@@ -370,24 +374,24 @@
|
||||
if(changeling_power(20,1,100,DEAD))
|
||||
// charge the changeling chemical cost for stasis
|
||||
changeling.chem_charges -= 20
|
||||
|
||||
|
||||
// restore us to health
|
||||
C.rejuvenate()
|
||||
|
||||
|
||||
// remove our fake death flag
|
||||
C.status_flags &= ~(FAKEDEATH)
|
||||
|
||||
|
||||
// let us move again
|
||||
C.update_canmove()
|
||||
|
||||
|
||||
// re-add out changeling powers
|
||||
C.make_changeling()
|
||||
|
||||
C.make_changeling()
|
||||
|
||||
// sending display messages
|
||||
C << "<span class='notice'>We have regenerated.</span>"
|
||||
C.visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>")
|
||||
|
||||
|
||||
|
||||
|
||||
feedback_add_details("changeling_powers","FD")
|
||||
return 1
|
||||
|
||||
@@ -719,7 +723,7 @@ var/list/datum/dna/hivemind_bank = list()
|
||||
T.visible_message("<span class='warning'>[T] transforms!</span>")
|
||||
T.dna = chosen_dna
|
||||
T.real_name = chosen_dna.real_name
|
||||
updateappearance(T, T.dna.uni_identity)
|
||||
T.UpdateAppearance()
|
||||
domutcheck(T, null)
|
||||
feedback_add_details("changeling_powers","TS")
|
||||
return 1
|
||||
|
||||
@@ -248,7 +248,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
|
||||
<h3>Drain Blood</h3>
|
||||
This rune instantly heals you of some brute damage at the expense of a person placed on top of the rune. Whenever you invoke a drain rune, ALL drain runes on the station are activated, draining blood from anyone located on top of those runes. This includes yourself, though the blood you drain from yourself just comes back to you. This might help you identify this rune when studying words. One drain gives up to 25HP per each victim, but you can repeat it if you need more. Draining only works on living people, so you might need to recharge your "Battery" once its empty. Drinking too much blood at once might cause blood hunger.<br>
|
||||
<h3>Raise Dead</h3>
|
||||
This rune allows for the resurrection of any dead person. You will need a dead human body and a living human sacrifice. Make 2 raise dead runes. Put a living non-braindead human on top of one, and a dead body on the other one. When you invoke the rune, the life force of the living human will be transferred into the dead body, allowing a ghost standing on top of the dead body to enter it, instantly and fully healing it. Use other runes to ensure there is a ghost ready to be resurrected.<br>
|
||||
This rune allows for the resurrection of any dead person. You will need a dead human body and a living human sacrifice. Make 2 raise dead runes. Put a living, awake human on top of one, and a dead body on the other one. When you invoke the rune, the life force of the living human will be transferred into the dead body, allowing a ghost standing on top of the dead body to enter it, instantly and fully healing it. Use other runes to ensure there is a ghost ready to be resurrected.<br>
|
||||
<h3>Hide runes</h3>
|
||||
This rune makes all nearby runes completely invisible. They are still there and will work if activated somehow, but you cannot invoke them directly if you do not see them.<br>
|
||||
<h3>Reveal runes</h3>
|
||||
|
||||
@@ -163,8 +163,8 @@
|
||||
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.strain_data["UI"] = H.dna.UI
|
||||
D.strain_data["SE"] = H.dna.SE
|
||||
D.carrier = 1
|
||||
D.holder = H
|
||||
D.affected_mob = H
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
for(var/turf/simulated/floor/T in orange(1,xmas))
|
||||
for(var/i=1,i<=rand(1,5),i++)
|
||||
new /obj/item/weapon/a_gift(T)
|
||||
for(var/mob/living/simple_animal/corgi/Ian/Ian in mob_list)
|
||||
Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian))
|
||||
//for(var/mob/living/simple_animal/corgi/Ian/Ian in mob_list)
|
||||
// Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian))
|
||||
|
||||
/proc/ChristmasEvent()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
|
||||
@@ -12,6 +12,10 @@ var/global/Holiday = null
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ~Carn
|
||||
|
||||
/hook/startup/proc/updateHoliday()
|
||||
Get_Holiday()
|
||||
return 1
|
||||
|
||||
//sets up the Holiday global variable. Shouldbe called on game configuration or something.
|
||||
/proc/Get_Holiday()
|
||||
if(!Holiday) return // Holiday stuff was not enabled in the config!
|
||||
|
||||
@@ -57,7 +57,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
if(!ninjacost(,2))
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
U << "\blue There are <B>[s_bombs]</B> smoke bombs remaining."
|
||||
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
|
||||
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
|
||||
smoke.set_up(10, 0, U.loc)
|
||||
smoke.start()
|
||||
playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2)
|
||||
@@ -69,12 +69,12 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
//=======//RIGHT CLICK TELEPORT//=======//
|
||||
//Right click to teleport somewhere, almost exactly like admin jump to turf.
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ninjashift(turf/T in oview())
|
||||
set name = "Phase Shift (1E)"
|
||||
set name = "Phase Shift (400E)"
|
||||
set desc = "Utilizes the internal VOID-shift device to rapidly transit to a destination in view."
|
||||
set category = null//So it does not show up on the panel but can still be right-clicked.
|
||||
set src = usr.contents//Fixes verbs not attaching properly for objects. Praise the DM reference guide!
|
||||
|
||||
var/C = 200
|
||||
var/C = 40
|
||||
if(!ninjacost(C,1))
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
var/turf/mobloc = get_turf(U.loc)//To make sure that certain things work properly below.
|
||||
@@ -83,6 +83,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
playsound(U.loc, 'sound/effects/sparks4.ogg', 50, 1)
|
||||
anim(mobloc,src,'icons/mob/mob.dmi',,"phaseout",,U.dir)
|
||||
|
||||
cell.use(C*10)
|
||||
handle_teleport_grab(T, U)
|
||||
U.loc = T
|
||||
|
||||
@@ -92,19 +93,19 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
playsound(U.loc, 'sound/effects/sparks2.ogg', 50, 1)
|
||||
anim(U.loc,U,'icons/mob/mob.dmi',,"phasein",,U.dir)
|
||||
else
|
||||
U << "\red You cannot teleport into solid walls or from solid matter"
|
||||
U << "\red You cannot teleport into solid walls or from solid matter."
|
||||
return
|
||||
|
||||
//=======//EM PULSE//=======//
|
||||
//Disables nearby tech equipment.
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ninjapulse()
|
||||
set name = "EM Burst (1,000E)"
|
||||
set name = "EM Burst (2,000E)"
|
||||
set desc = "Disable any nearby technology with a electro-magnetic pulse."
|
||||
set category = "Ninja Ability"
|
||||
set popup_menu = 0
|
||||
|
||||
var/C = 250
|
||||
if(!ninjacost(C,100)) // EMP's now cost 1,000Energy about 30%
|
||||
var/C = 200
|
||||
if(!ninjacost(C,0)) // EMP's now cost 1,000Energy about 30%
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
playsound(U.loc, 'sound/effects/EMPulse.ogg', 60, 2)
|
||||
empulse(U, 2, 3) //Procs sure are nice. Slightly weaker than wizard's disable tch.
|
||||
@@ -115,13 +116,13 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
//=======//ENERGY BLADE//=======//
|
||||
//Summons a blade of energy in active hand.
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ninjablade()
|
||||
set name = "Energy Blade (20E)"
|
||||
set name = "Energy Blade (500E)"
|
||||
set desc = "Create a focused beam of energy in your active hand."
|
||||
set category = "Ninja Ability"
|
||||
set popup_menu = 0
|
||||
|
||||
var/C = 50
|
||||
if(!ninjacost(C, 800)) //Same spawn cost but higher upkeep cost
|
||||
if(!ninjacost(C,0)) //Same spawn cost but higher upkeep cost
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
if(!kamikaze)
|
||||
if(!U.get_active_hand()&&!istype(U.get_inactive_hand(), /obj/item/weapon/melee/energy/blade))
|
||||
@@ -148,12 +149,12 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
/*Shoots ninja stars at random people.
|
||||
This could be a lot better but I'm too tired atm.*/
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ninjastar()
|
||||
set name = "Energy Star (1,000E)"
|
||||
set name = "Energy Star (800E)"
|
||||
set desc = "Launches an energy star at a random living target."
|
||||
set category = "Ninja Ability"
|
||||
set popup_menu = 0
|
||||
|
||||
var/C = 50
|
||||
var/C = 80
|
||||
if(!ninjacost(C,1))
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
var/targets[] = list()//So yo can shoot while yo throw dawg
|
||||
@@ -173,7 +174,7 @@ This could be a lot better but I'm too tired atm.*/
|
||||
A.current = curloc
|
||||
A.yo = targloc.y - curloc.y
|
||||
A.xo = targloc.x - curloc.x
|
||||
cell.use(C*100)// Ninja stars now cost 100 energy, stil la fair chunk to avoid spamming, will run out of power quickly if used 3 or more times
|
||||
cell.use(C*10)
|
||||
A.process()
|
||||
else
|
||||
U << "\red There are no targets in view."
|
||||
@@ -183,13 +184,13 @@ This could be a lot better but I'm too tired atm.*/
|
||||
/*Allows the ninja to capture people, I guess.
|
||||
Must right click on a mob to activate.*/
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ninjanet(mob/living/carbon/M in oview())//Only living carbon mobs.
|
||||
set name = "Energy Net (8,000E)"
|
||||
set name = "Energy Net (7,000E)"
|
||||
set desc = "Captures a fallen opponent in a net of energy. Will teleport them to a holding facility after 30 seconds."
|
||||
set category = null
|
||||
set src = usr.contents
|
||||
|
||||
var/C = 500
|
||||
if(!ninjacost(C,80)&&iscarbon(M)) // Nets now cost 8,000
|
||||
var/C = 700
|
||||
if(!ninjacost(C,0)&&iscarbon(M))
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
if(M.client)//Monkeys without a client can still step_to() and bypass the net. Also, netting inactive people is lame.
|
||||
//if(M)//DEBUG
|
||||
@@ -200,7 +201,7 @@ Must right click on a mob to activate.*/
|
||||
return
|
||||
spawn(0)
|
||||
U.Beam(M,"n_beam",,15)
|
||||
M.anchored = 1//Anchors them so they can't move.
|
||||
M.captured = 1
|
||||
U.say("Get over here!")
|
||||
var/obj/effect/energy_net/E = new /obj/effect/energy_net(M.loc)
|
||||
E.layer = M.layer+1//To have it appear one layer above the mob.
|
||||
@@ -210,7 +211,7 @@ Must right click on a mob to activate.*/
|
||||
E.master = U
|
||||
spawn(0)//Parallel processing.
|
||||
E.process(M)
|
||||
cell.use(C*100) // Nets now cost what should be most of a standard battery, since your taking someone out of the round
|
||||
cell.use(C*10) // Nets now cost what should be most of a standard battery, since your taking someone out of the round
|
||||
else
|
||||
U << "They are already trapped inside an energy net."
|
||||
else
|
||||
|
||||
@@ -1385,7 +1385,8 @@ It is possible to destroy the net by the occupant or someone else.
|
||||
if(!isnull(master))//As long as they still exist.
|
||||
master << "\blue <b>SUCCESS</b>: \black transport procedure of \the [affecting] complete."
|
||||
|
||||
M.anchored = 0//Important.
|
||||
M.captured = 0 //Important.
|
||||
M.anchored = initial(M.anchored) //Changes the mob's anchored status to the original one; this is not handled by the can_move proc.
|
||||
|
||||
else//And they are free.
|
||||
M << "\blue You are free of the net!"
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
if(C.cell && C.z == 1)
|
||||
C.cell.charge = C.cell.maxcharge
|
||||
for(var/obj/machinery/power/smes/S in world)
|
||||
if(S.z != 1)
|
||||
if(istype(get_area(S), /area/turret_protected) || S.z != 1)
|
||||
continue
|
||||
S.charge = S.last_charge
|
||||
S.output = S.last_output
|
||||
|
||||
@@ -547,7 +547,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
|
||||
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_r_store)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_l_store)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(src), slot_s_store)
|
||||
return 1
|
||||
|
||||
//=======//HELPER PROCS//=======//
|
||||
|
||||
@@ -213,7 +213,7 @@ Implants;
|
||||
for(var/mob/living/carbon/human/man in player_list) if(man.client && man.mind)
|
||||
// NT relation option
|
||||
var/special_role = man.mind.special_role
|
||||
if (special_role == "Wizard" || special_role == "Ninja" || special_role == "Syndicate")
|
||||
if (special_role == "Wizard" || special_role == "Ninja" || special_role == "Syndicate" || special_role == "Vox Raider")
|
||||
continue //NT intelligence ruled out possiblity that those are too classy to pretend to be a crew.
|
||||
if(man.client.prefs.nanotrasen_relation == "Opposed" && prob(50) || \
|
||||
man.client.prefs.nanotrasen_relation == "Skeptical" && prob(20))
|
||||
|
||||
@@ -118,6 +118,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
data_core.manifest()
|
||||
current_state = GAME_STATE_PLAYING
|
||||
|
||||
callHook("roundstart")
|
||||
|
||||
//here to initialize the random events nicely at round start
|
||||
setup_economy()
|
||||
@@ -309,6 +310,8 @@ var/global/datum/controller/gameticker/ticker
|
||||
declare_completion()
|
||||
|
||||
spawn(50)
|
||||
callHook("roundend")
|
||||
|
||||
if (mode.station_was_nuked)
|
||||
feedback_set_details("end_proper","nuke")
|
||||
if(!delay_end)
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
VOX HEIST ROUNDTYPE
|
||||
*/
|
||||
|
||||
#define MAX_VOX_KILLS 10 //Number of kills during the round before the Inviolate is broken.
|
||||
//Would be nice to use vox-specific kills but is currently not feasible.
|
||||
|
||||
var/global/vox_kills = 0 //Used to check the Inviolate.
|
||||
|
||||
/datum/game_mode/
|
||||
var/list/datum/mind/raiders = list() //Antags.
|
||||
|
||||
@@ -139,10 +134,8 @@ var/global/vox_kills = 0 //Used to check the Inviolate.
|
||||
|
||||
/datum/game_mode/heist/proc/forge_vox_objectives()
|
||||
|
||||
|
||||
//Commented out for testing.
|
||||
/* var/i = 1
|
||||
var/max_objectives = pick(2,2,2,3,3)
|
||||
var/i = 1
|
||||
var/max_objectives = pick(2,2,2,2,3,3,3,4)
|
||||
var/list/objs = list()
|
||||
while(i<= max_objectives)
|
||||
var/list/goals = list("kidnap","loot","salvage")
|
||||
@@ -163,24 +156,16 @@ var/global/vox_kills = 0 //Used to check the Inviolate.
|
||||
|
||||
//-All- vox raids have these two objectives. Failing them loses the game.
|
||||
objs += new /datum/objective/heist/inviolate_crew
|
||||
objs += new /datum/objective/heist/inviolate_death */
|
||||
objs += new /datum/objective/heist/inviolate_death
|
||||
|
||||
raid_objectives += new /datum/objective/heist/kidnap
|
||||
raid_objectives += new /datum/objective/heist/loot
|
||||
raid_objectives += new /datum/objective/heist/salvage
|
||||
raid_objectives += new /datum/objective/heist/inviolate_crew
|
||||
raid_objectives += new /datum/objective/heist/inviolate_death
|
||||
|
||||
for(var/datum/objective/heist/O in raid_objectives)
|
||||
O.choose_target()
|
||||
|
||||
return raid_objectives
|
||||
return objs
|
||||
|
||||
/datum/game_mode/heist/proc/greet_vox(var/datum/mind/raider)
|
||||
raider.current << "\blue <B>You are a Vox Raider, fresh from the Shoal!</b>"
|
||||
raider.current << "\blue The Vox are a race of cunning, sharp-eyed nomadic raiders and traders endemic to Tau Ceti and much of the unexplored galaxy. You and the crew have come to the Exodus for plunder, trade or both."
|
||||
raider.current << "\blue Vox are cowardly and will flee from larger groups, but corner one or find them en masse and they are vicious."
|
||||
raider.current << "\blue Use :V to voxtalk, :H to talk on your encrypted channel, and don't forget to turn on your nitrogen internals!"
|
||||
raider.current << "\red IF YOU HAVE NOT PLAYED A VOX BEFORE, REVIEW THIS THREAD: http://baystation12.net/forums/viewtopic.php?f=6&t=8657."
|
||||
var/obj_count = 1
|
||||
for(var/datum/objective/objective in raider.objectives)
|
||||
raider.current << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
var/const/meteordelay = 2000
|
||||
var/nometeors = 1
|
||||
required_players = 0
|
||||
votable = 0
|
||||
|
||||
uplink_welcome = "EVIL METEOR Uplink Console:"
|
||||
uplink_uses = 10
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define METEOR_TEMPERATURE
|
||||
|
||||
/var/const/meteor_wave_delay = 625 //minimum wait between waves in tenths of seconds
|
||||
//set to at least 100 unless you want evarr ruining every round
|
||||
|
||||
@@ -95,18 +93,9 @@
|
||||
icon_state = "smallf"
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
|
||||
/obj/effect/meteor/Move()
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
T.hotspot_expose(METEOR_TEMPERATURE, 1000)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/effect/meteor/Bump(atom/A)
|
||||
spawn(0)
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai)) //bad idea to shake an ai's view
|
||||
shake_camera(M, 3, 1)
|
||||
|
||||
if (A)
|
||||
A.meteorhit(src)
|
||||
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
@@ -117,9 +106,7 @@
|
||||
if(!istype(A,/obj/machinery/power/emitter) && \
|
||||
!istype(A,/obj/machinery/field_generator) && \
|
||||
prob(15))
|
||||
|
||||
explosion(src.loc, 4, 5, 6, 7, 0)
|
||||
playsound(src.loc, "explosion", 50, 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
@@ -146,16 +133,18 @@
|
||||
if(--src.hits <= 0)
|
||||
del(src) //Dont blow up singularity containment if we get stuck there.
|
||||
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai)) //bad idea to shake an ai's view
|
||||
shake_camera(M, 3, 1)
|
||||
if (A)
|
||||
for(var/mob/M in player_list)
|
||||
var/turf/T = get_turf(M)
|
||||
if(!T || T.z != src.z)
|
||||
continue
|
||||
shake_camera(M, 3, get_dist(M.loc, src.loc) > 20 ? 1 : 3)
|
||||
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
explosion(src.loc, 0, 1, 2, 3, 0)
|
||||
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
|
||||
if (--src.hits <= 0)
|
||||
if(prob(15) && !istype(A, /obj/structure/grille))
|
||||
explosion(src.loc, 1, 2, 3, 4, 0)
|
||||
playsound(src.loc, "explosion", 50, 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -26,18 +26,22 @@
|
||||
ninja.assigned_role = "MODE" //So they aren't chosen for other jobs.
|
||||
ninja.special_role = "Ninja"
|
||||
ninja.original = ninja.current
|
||||
if(ninjastart.len == 0)
|
||||
|
||||
/*if(ninjastart.len == 0)
|
||||
ninja.current << "<B>\red A proper starting location for you could not be found, please report this bug!</B>"
|
||||
ninja.current << "<B>\red Attempting to place at a carpspawn.</B>"
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "carpspawn")
|
||||
ninjastart.Add(L)
|
||||
if(ninjastart.len == 0 && latejoin.len > 0)
|
||||
ninja.current << "<B>\red Still no spawneable locations could be found. Defaulting to latejoin.</B>"
|
||||
return 1
|
||||
else if (ninjastart.len == 0)
|
||||
ninja.current << "<B>\red Still no spawneable locations could be found. Aborting.</B>"
|
||||
return 0
|
||||
ninja.current << "<B>\red Attempting to place at a carpspawn.</B>"*/
|
||||
|
||||
//Until such a time as people want to place ninja spawn points, carpspawn will do fine.
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "carpspawn")
|
||||
ninjastart.Add(L)
|
||||
if(ninjastart.len == 0 && latejoin.len > 0)
|
||||
ninja.current << "<B>\red No spawneable locations could be found. Defaulting to latejoin.</B>"
|
||||
return 1
|
||||
else if (ninjastart.len == 0)
|
||||
ninja.current << "<B>\red No spawneable locations could be found. Aborting.</B>"
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/datum/game_mode/ninja/pre_setup()
|
||||
@@ -50,7 +54,7 @@
|
||||
/datum/game_mode/ninja/post_setup()
|
||||
for(var/datum/mind/ninja in ninjas)
|
||||
if(ninja.current && !(istype(ninja.current,/mob/living/carbon/human))) return 0
|
||||
//forge_ninja_objectives(ninja)
|
||||
forge_ninja_objectives(ninja)
|
||||
var/mob/living/carbon/human/N = ninja.current
|
||||
N.internal = N.s_store
|
||||
N.internals.icon_state = "internal1"
|
||||
@@ -78,7 +82,8 @@
|
||||
return 1
|
||||
|
||||
/datum/game_mode/ninja/proc/forge_ninja_objectives(var/datum/mind/ninja)
|
||||
var/objective_list[] = list(1,2,3,4,5)
|
||||
|
||||
var/objective_list = list(1,2,3,4,5)
|
||||
for(var/i=rand(2,4),i>0,i--)
|
||||
switch(pick(objective_list))
|
||||
if(1)//Kill
|
||||
@@ -123,6 +128,7 @@
|
||||
var/datum/objective/survive/ninja_objective = new
|
||||
ninja_objective.owner = ninja
|
||||
ninja.objectives += ninja_objective
|
||||
ninja.current.mind = ninja
|
||||
|
||||
var/directive = generate_ninja_directive("heel")//Only hired by antags, not NT
|
||||
ninja.current << "You are an elite mercenary assassin of the Spider Clan, [ninja.current.real_name]. You have a variety of abilities at your disposal, thanks to your nano-enhanced cyber armor.\nYour current directive is: \red <B>[directive]</B>\n \blue Try your best to adhere to this."
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/datum/game_mode/nuclear
|
||||
name = "nuclear emergency"
|
||||
config_tag = "nuclear"
|
||||
required_players = 6
|
||||
required_players = 15
|
||||
required_players_secret = 25 // 25 players - 5 players to be the nuke ops = 20 players remaining
|
||||
required_enemies = 5
|
||||
required_enemies = 1
|
||||
recommended_enemies = 5
|
||||
|
||||
uplink_welcome = "Corporate Backed Uplink Console:"
|
||||
@@ -34,17 +34,25 @@
|
||||
var/list/possible_syndicates = get_players_for_role(BE_OPERATIVE)
|
||||
var/agent_number = 0
|
||||
|
||||
/*
|
||||
* if(possible_syndicates.len > agents_possible)
|
||||
* agent_number = agents_possible
|
||||
* else
|
||||
* agent_number = possible_syndicates.len
|
||||
*
|
||||
* if(agent_number > n_players)
|
||||
* agent_number = n_players/2
|
||||
*/
|
||||
|
||||
if(possible_syndicates.len < 1)
|
||||
return 0
|
||||
|
||||
if(possible_syndicates.len > agents_possible)
|
||||
agent_number = agents_possible
|
||||
else
|
||||
agent_number = possible_syndicates.len
|
||||
|
||||
//Antag number should scale to active crew.
|
||||
var/n_players = num_players()
|
||||
if(agent_number > n_players)
|
||||
agent_number = n_players/2
|
||||
agent_number = Clamp((n_players/5), 2, 6)
|
||||
|
||||
if(possible_syndicates.len < agent_number)
|
||||
agent_number = possible_syndicates.len
|
||||
|
||||
while(agent_number > 0)
|
||||
var/datum/mind/new_syndicate = pick(possible_syndicates)
|
||||
@@ -121,7 +129,6 @@
|
||||
|
||||
var/nuke_code = "[rand(10000, 99999)]"
|
||||
var/leader_selected = 0
|
||||
var/agent_number = 1
|
||||
var/spawnpos = 1
|
||||
|
||||
for(var/datum/mind/synd_mind in syndicates)
|
||||
@@ -129,6 +136,10 @@
|
||||
spawnpos = 1
|
||||
synd_mind.current.loc = synd_spawn[spawnpos]
|
||||
|
||||
synd_mind.current.real_name = "[syndicate_name()] Operative" // placeholder while we get their actual name
|
||||
spawn(0)
|
||||
NukeNameAssign(synd_mind)
|
||||
|
||||
forge_syndicate_objectives(synd_mind)
|
||||
greet_syndicate(synd_mind)
|
||||
equip_syndicate(synd_mind.current)
|
||||
@@ -136,9 +147,7 @@
|
||||
if(!leader_selected)
|
||||
prepare_syndicate_leader(synd_mind, nuke_code)
|
||||
leader_selected = 1
|
||||
else
|
||||
synd_mind.current.real_name = "[syndicate_name()] Operative #[agent_number]"
|
||||
agent_number++
|
||||
|
||||
spawnpos++
|
||||
update_synd_icons_added(synd_mind)
|
||||
|
||||
@@ -157,10 +166,6 @@
|
||||
|
||||
|
||||
/datum/game_mode/proc/prepare_syndicate_leader(var/datum/mind/synd_mind, var/nuke_code)
|
||||
// var/leader_title = pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")
|
||||
spawn(1)
|
||||
// NukeNameAssign(nukelastname(synd_mind.current),syndicates) //allows time for the rest of the syndies to be chosen
|
||||
synd_mind.current.real_name = "[pick(first_names_male)] [pick(last_names)]"
|
||||
if (nuke_code)
|
||||
synd_mind.store_memory("<B>Syndicate Nuclear Bomb Code</B>: [nuke_code]", 0, 0)
|
||||
synd_mind.current << "The nuclear authorization code is: <B>[nuke_code]</B>"
|
||||
@@ -209,9 +214,7 @@
|
||||
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(synd_mob), slot_shoes)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(synd_mob), slot_wear_suit)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(synd_mob), slot_gloves)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(synd_mob), slot_head)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/weapon/card/id/syndicate(synd_mob), slot_wear_id)
|
||||
if(synd_mob.backbag == 2) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(synd_mob), slot_back)
|
||||
if(synd_mob.backbag == 3) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(synd_mob), slot_back)
|
||||
@@ -221,6 +224,26 @@
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), slot_in_backpack)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/c20r(synd_mob), slot_belt)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(synd_mob.back), slot_in_backpack)
|
||||
|
||||
if(synd_mob.species)
|
||||
var/race = synd_mob.species.name
|
||||
|
||||
if(race == "Unathi")
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/unathi(synd_mob), slot_wear_suit)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/unathi(synd_mob), slot_head)
|
||||
else if(race == "Tajaran")
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/tajara(synd_mob), slot_wear_suit)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/tajara(synd_mob), slot_head)
|
||||
else if(race == "Skrell")
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/skrell(synd_mob), slot_wear_suit)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/skrell(synd_mob), slot_head)
|
||||
else
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/human(synd_mob), slot_wear_suit)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/human(synd_mob), slot_head)
|
||||
else
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/human(synd_mob), slot_wear_suit)
|
||||
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/human(synd_mob), slot_head)
|
||||
|
||||
var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob)
|
||||
E.imp_in = synd_mob
|
||||
E.implanted = 1
|
||||
@@ -344,12 +367,14 @@
|
||||
|
||||
return newname
|
||||
*/
|
||||
/proc/NukeNameAssign(var/lastname,var/list/syndicates)
|
||||
for(var/datum/mind/synd_mind in syndicates)
|
||||
switch(synd_mind.current.gender)
|
||||
if(MALE)
|
||||
synd_mind.name = "[pick(first_names_male)] [pick(last_names)]"
|
||||
if(FEMALE)
|
||||
synd_mind.name = "[pick(first_names_female)] [pick(last_names)]"
|
||||
synd_mind.current.real_name = synd_mind.name
|
||||
return
|
||||
|
||||
/proc/NukeNameAssign(var/datum/mind/synd_mind)
|
||||
var/choose_name = input(synd_mind.current, "You are a [syndicate_name()] agent! What is your name?", "Choose a name") as text
|
||||
|
||||
if(!choose_name)
|
||||
return
|
||||
|
||||
else
|
||||
synd_mind.current.name = choose_name
|
||||
synd_mind.current.real_name = choose_name
|
||||
return
|
||||
@@ -8,6 +8,8 @@ var/bomb_set
|
||||
density = 1
|
||||
var/deployable = 0.0
|
||||
var/extended = 0.0
|
||||
var/lighthack = 0
|
||||
var/opened = 0.0
|
||||
var/timeleft = 60.0
|
||||
var/timing = 0.0
|
||||
var/r_code = "ADMIN"
|
||||
@@ -15,15 +17,36 @@ var/bomb_set
|
||||
var/yes_code = 0.0
|
||||
var/safety = 1.0
|
||||
var/obj/item/weapon/disk/nuclear/auth = null
|
||||
var/list/wires = list()
|
||||
var/light_wire
|
||||
var/safety_wire
|
||||
var/timing_wire
|
||||
var/removal_stage = 0 // 0 is no removal, 1 is covers removed, 2 is covers open,
|
||||
// 3 is sealant open, 4 is unwrenched, 5 is removed from bolts.
|
||||
flags = FPRINT
|
||||
use_power = 0
|
||||
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/New()
|
||||
..()
|
||||
r_code = "[rand(10000, 99999.0)]"//Creates a random code upon object spawn.
|
||||
|
||||
src.wires["Red"] = 0
|
||||
src.wires["Blue"] = 0
|
||||
src.wires["Green"] = 0
|
||||
src.wires["Marigold"] = 0
|
||||
src.wires["Fuschia"] = 0
|
||||
src.wires["Black"] = 0
|
||||
src.wires["Pearl"] = 0
|
||||
var/list/w = list("Red","Blue","Green","Marigold","Black","Fuschia","Pearl")
|
||||
src.light_wire = pick(w)
|
||||
w -= src.light_wire
|
||||
src.timing_wire = pick(w)
|
||||
w -= src.timing_wire
|
||||
src.safety_wire = pick(w)
|
||||
w -= src.safety_wire
|
||||
|
||||
/obj/machinery/nuclearbomb/process()
|
||||
if (src.timing)
|
||||
bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed.
|
||||
@@ -36,6 +59,34 @@ var/bomb_set
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob)
|
||||
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
src.add_fingerprint(user)
|
||||
if (src.auth)
|
||||
if (src.opened == 0)
|
||||
src.opened = 1
|
||||
overlays += image(icon, "npanel_open")
|
||||
user << "You unscrew the control panel of [src]."
|
||||
|
||||
else
|
||||
src.opened = 0
|
||||
overlays -= image(icon, "npanel_open")
|
||||
user << "You screw the control panel of [src] back on."
|
||||
else
|
||||
if (src.opened == 0)
|
||||
user << "The [src] emits a buzzing noise, the panel staying locked in."
|
||||
if (src.opened == 1)
|
||||
src.opened = 0
|
||||
overlays -= image(icon, "npanel_open")
|
||||
user << "You screw the control panel of [src] back on."
|
||||
flick("nuclearbombc", src)
|
||||
|
||||
return
|
||||
if (istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/device/multitool))
|
||||
if (src.opened == 1)
|
||||
nukehack_win(user)
|
||||
return
|
||||
|
||||
if (src.extended)
|
||||
if (istype(O, /obj/item/weapon/disk/nuclear))
|
||||
usr.drop_item()
|
||||
@@ -119,11 +170,13 @@ var/bomb_set
|
||||
|
||||
/obj/machinery/nuclearbomb/attack_hand(mob/user as mob)
|
||||
if (src.extended)
|
||||
|
||||
if (!ishuman(user))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return 1
|
||||
|
||||
if (!ishuman(user))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return 1
|
||||
user.set_machine(src)
|
||||
var/dat = text("<TT><B>Nuclear Fission Explosive</B><BR>\nAuth. Disk: <A href='?src=\ref[];auth=1'>[]</A><HR>", src, (src.auth ? "++++++++++" : "----------"))
|
||||
if (src.auth)
|
||||
@@ -150,11 +203,23 @@ var/bomb_set
|
||||
visible_message("\red With a steely snap, bolts slide out of [src] and anchor it to the flooring!")
|
||||
else
|
||||
visible_message("\red \The [src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.")
|
||||
flick("nuclearbombc", src)
|
||||
src.icon_state = "nuclearbomb1"
|
||||
if(!src.lighthack)
|
||||
flick("nuclearbombc", src)
|
||||
src.icon_state = "nuclearbomb1"
|
||||
src.extended = 1
|
||||
return
|
||||
|
||||
obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
|
||||
var/dat as text
|
||||
dat += "<TT><B>Nuclear Fission Explosive</B><BR>\nNuclear Device Wires:</A><HR>"
|
||||
for(var/wire in src.wires)
|
||||
dat += text("[wire] Wire: <A href='?src=\ref[src];wire=[wire];act=wire'>[src.wires[wire] ? "Mend" : "Cut"]</A> <A href='?src=\ref[src];wire=[wire];act=pulse'>Pulse</A><BR>")
|
||||
dat += text("<HR>The device is [src.timing ? "shaking!" : "still"]<BR>")
|
||||
dat += text("The device is [src.safety ? "quiet" : "whirring"].<BR>")
|
||||
dat += text("The lights are [src.lighthack ? "static" : "functional"].<BR>")
|
||||
user << browse("<HTML><HEAD><TITLE>Bomb Defusion</TITLE></HEAD><BODY>[dat]</BODY></HTML>","window=nukebomb_hack")
|
||||
onclose(user, "nukebomb_hack")
|
||||
|
||||
/obj/machinery/nuclearbomb/verb/make_deployable()
|
||||
set category = "Object"
|
||||
set name = "Make Deployable"
|
||||
@@ -172,16 +237,57 @@ var/bomb_set
|
||||
else
|
||||
usr << "\red You adjust some panels to make [src] deployable."
|
||||
src.deployable = 1
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/Topic(href, href_list)
|
||||
..()
|
||||
if (!usr.canmove || usr.stat || usr.restrained())
|
||||
return
|
||||
if (!ishuman(usr))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return 1
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.set_machine(src)
|
||||
if(href_list["act"])
|
||||
var/temp_wire = href_list["wire"]
|
||||
if(href_list["act"] == "pulse")
|
||||
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
|
||||
usr << "You need a multitool!"
|
||||
else
|
||||
if(src.wires[temp_wire])
|
||||
usr << "You can't pulse a cut wire."
|
||||
else
|
||||
if(src.light_wire == temp_wire)
|
||||
src.lighthack = !src.lighthack
|
||||
spawn(100) src.lighthack = !src.lighthack
|
||||
if(src.timing_wire == temp_wire)
|
||||
if(src.timing)
|
||||
explode()
|
||||
if(src.safety_wire == temp_wire)
|
||||
src.safety = !src.safety
|
||||
spawn(100) src.safety = !src.safety
|
||||
if(src.safety == 1)
|
||||
visible_message("\blue The [src] quiets down.")
|
||||
if(!src.lighthack)
|
||||
if (src.icon_state == "nuclearbomb2")
|
||||
src.icon_state = "nuclearbomb1"
|
||||
else
|
||||
visible_message("\blue The [src] emits a quiet whirling noise!")
|
||||
if(href_list["act"] == "wire")
|
||||
if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters))
|
||||
usr << "You need wirecutters!"
|
||||
else
|
||||
wires[temp_wire] = !wires[temp_wire]
|
||||
if(src.safety_wire == temp_wire)
|
||||
if(src.timing)
|
||||
explode()
|
||||
if(src.timing_wire == temp_wire)
|
||||
if(!src.lighthack)
|
||||
if (src.icon_state == "nuclearbomb2")
|
||||
src.icon_state = "nuclearbomb1"
|
||||
src.timing = 0
|
||||
bomb_set = 0
|
||||
if(src.light_wire == temp_wire)
|
||||
src.lighthack = !src.lighthack
|
||||
|
||||
if (href_list["auth"])
|
||||
if (src.auth)
|
||||
src.auth.loc = src.loc
|
||||
@@ -222,14 +328,16 @@ var/bomb_set
|
||||
return
|
||||
src.timing = !( src.timing )
|
||||
if (src.timing)
|
||||
src.icon_state = "nuclearbomb2"
|
||||
if(!src.lighthack)
|
||||
src.icon_state = "nuclearbomb2"
|
||||
if(!src.safety)
|
||||
bomb_set = 1//There can still be issues with this reseting when there are multiple bombs. Not a big deal tho for Nuke/N
|
||||
else
|
||||
bomb_set = 0
|
||||
else
|
||||
src.icon_state = "nuclearbomb1"
|
||||
bomb_set = 0
|
||||
if(!src.lighthack)
|
||||
src.icon_state = "nuclearbomb1"
|
||||
if (href_list["safety"])
|
||||
src.safety = !( src.safety )
|
||||
if(safety)
|
||||
@@ -277,7 +385,8 @@ var/bomb_set
|
||||
src.timing = -1.0
|
||||
src.yes_code = 0
|
||||
src.safety = 1
|
||||
src.icon_state = "nuclearbomb3"
|
||||
if(!src.lighthack)
|
||||
src.icon_state = "nuclearbomb3"
|
||||
playsound(src,'sound/machines/Alarm.ogg',100,0,5)
|
||||
if (ticker && ticker.mode)
|
||||
ticker.mode.explosion_in_progress = 1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
var/global/list/all_objectives = list()
|
||||
|
||||
datum/objective
|
||||
var/datum/mind/owner = null //Who owns the objective.
|
||||
@@ -8,9 +9,14 @@ datum/objective
|
||||
var/completed = 0 //currently only used for custom objectives.
|
||||
|
||||
New(var/text)
|
||||
all_objectives |= src
|
||||
if(text)
|
||||
explanation_text = text
|
||||
|
||||
Del()
|
||||
all_objectives -= src
|
||||
..()
|
||||
|
||||
proc/check_completion()
|
||||
return completed
|
||||
|
||||
@@ -916,8 +922,12 @@ datum/objective/heist/inviolate_crew
|
||||
if(H.is_raider_crew_safe()) return 1
|
||||
return 0
|
||||
|
||||
#define MAX_VOX_KILLS 10 //Number of kills during the round before the Inviolate is broken.
|
||||
//Would be nice to use vox-specific kills but is currently not feasible.
|
||||
var/global/vox_kills = 0 //Used to check the Inviolate.
|
||||
|
||||
datum/objective/heist/inviolate_death
|
||||
explanation_text = "Follow the Inviolate. Minimise death and loss of resources."
|
||||
check_completion()
|
||||
if(vox_kills>5) return 0
|
||||
if(vox_kills > MAX_VOX_KILLS) return 0
|
||||
return 1
|
||||
@@ -156,9 +156,17 @@
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/RevConvert(mob/M as mob in oview(src))
|
||||
/mob/living/carbon/human/proc/RevConvert()
|
||||
set name = "Rev-Convert"
|
||||
set category = "IC"
|
||||
var/list/Possible = list()
|
||||
for (var/mob/living/carbon/human/P in oview(src))
|
||||
if(!stat && P.client && P.mind && !P.mind.special_role)
|
||||
Possible += P
|
||||
if(!Possible.len)
|
||||
src << "\red There doesn't appear to be anyone available for you to convert here."
|
||||
return
|
||||
var/mob/living/carbon/human/M = input("Select a person to convert", "Viva la revolution!", null) as mob in Possible
|
||||
if(((src.mind in ticker.mode:head_revolutionaries) || (src.mind in ticker.mode:revolutionaries)))
|
||||
if((M.mind in ticker.mode:head_revolutionaries) || (M.mind in ticker.mode:revolutionaries))
|
||||
src << "\red <b>[M] is already be a revolutionary!</b>"
|
||||
@@ -251,4 +259,4 @@
|
||||
rev_obj.target = M.mind
|
||||
rev_obj.explanation_text = "Assassinate, convert or capture [M.real_name], the [M.mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
rev_mind.current << "\red A new Head of Staff, [M.real_name], the [M.mind.assigned_role] has appeared. Your objectives have been updated."
|
||||
rev_mind.current << "\red A new Head of Staff, [M.real_name], the [M.mind.assigned_role] has appeared. Your objectives have been updated."
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
/////////////////////////
|
||||
// (mostly) DNA2 SETUP
|
||||
/////////////////////////
|
||||
|
||||
// Randomize block, assign a reference name, and optionally define difficulty (by making activation zone smaller or bigger)
|
||||
// The name is used on /vg/ for species with predefined genetic traits,
|
||||
// and for the DNA panel in the player panel.
|
||||
/proc/getAssignedBlock(var/name,var/list/blocksLeft, var/activity_bounds=DNA_DEFAULT_BOUNDS)
|
||||
var/assigned = pick(blocksLeft)
|
||||
blocksLeft.Remove(assigned)
|
||||
assigned_blocks[assigned]=name
|
||||
dna_activity_bounds[assigned]=activity_bounds
|
||||
//testing("[name] assigned to block #[assigned].")
|
||||
return assigned
|
||||
|
||||
/proc/setupgenetics()
|
||||
|
||||
if (prob(50))
|
||||
// Currently unused. Will revisit. - N3X
|
||||
BLOCKADD = rand(-300,300)
|
||||
if (prob(75))
|
||||
DIFFMUT = rand(0,20)
|
||||
|
||||
/* Old, for reference (so I don't accidentally activate something) - N3X
|
||||
var/list/avnums = new/list()
|
||||
var/tempnum
|
||||
|
||||
@@ -41,11 +58,62 @@
|
||||
tempnum = pick(avnums)
|
||||
avnums.Remove(tempnum)
|
||||
BLINDBLOCK = tempnum
|
||||
*/
|
||||
var/list/numsToAssign=new()
|
||||
for(var/i=1;i<STRUCDNASIZE;i++)
|
||||
numsToAssign += i
|
||||
|
||||
//testing("Assigning DNA blocks:")
|
||||
|
||||
// Standard muts, imported from older code above.
|
||||
BLINDBLOCK = getAssignedBlock("BLIND", numsToAssign)
|
||||
DEAFBLOCK = getAssignedBlock("DEAF", numsToAssign)
|
||||
HULKBLOCK = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS)
|
||||
TELEBLOCK = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS)
|
||||
FIREBLOCK = getAssignedBlock("FIRE", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
XRAYBLOCK = getAssignedBlock("XRAY", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
CLUMSYBLOCK = getAssignedBlock("CLUMSY", numsToAssign)
|
||||
FAKEBLOCK = getAssignedBlock("FAKE", numsToAssign)
|
||||
|
||||
// UNUSED!
|
||||
//COUGHBLOCK = getAssignedBlock("COUGH", numsToAssign)
|
||||
//GLASSESBLOCK = getAssignedBlock("GLASSES", numsToAssign)
|
||||
//EPILEPSYBLOCK = getAssignedBlock("EPILEPSY", numsToAssign)
|
||||
//TWITCHBLOCK = getAssignedBlock("TWITCH", numsToAssign)
|
||||
//NERVOUSBLOCK = getAssignedBlock("NERVOUS", numsToAssign)
|
||||
|
||||
// Bay muts (UNUSED)
|
||||
//HEADACHEBLOCK = getAssignedBlock("HEADACHE", numsToAssign)
|
||||
//NOBREATHBLOCK = getAssignedBlock("NOBREATH", numsToAssign, DNA_HARD_BOUNDS)
|
||||
//REMOTEVIEWBLOCK = getAssignedBlock("REMOTEVIEW", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
//REGENERATEBLOCK = getAssignedBlock("REGENERATE", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
//INCREASERUNBLOCK = getAssignedBlock("INCREASERUN", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
//REMOTETALKBLOCK = getAssignedBlock("REMOTETALK", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
//MORPHBLOCK = getAssignedBlock("MORPH", numsToAssign, DNA_HARDER_BOUNDS)
|
||||
//COLDBLOCK = getAssignedBlock("COLD", numsToAssign)
|
||||
//HALLUCINATIONBLOCK = getAssignedBlock("HALLUCINATION", numsToAssign)
|
||||
//NOPRINTSBLOCK = getAssignedBlock("NOPRINTS", numsToAssign, DNA_HARD_BOUNDS)
|
||||
//SHOCKIMMUNITYBLOCK = getAssignedBlock("SHOCKIMMUNITY", numsToAssign)
|
||||
//SMALLSIZEBLOCK = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS)
|
||||
|
||||
// And the genes that actually do the work. (domutcheck improvements)
|
||||
var/list/blocks_assigned[STRUCDNASIZE]
|
||||
for(var/gene_type in typesof(/datum/dna/gene))
|
||||
var/datum/dna/gene/G = new gene_type
|
||||
if(G.block)
|
||||
if(G.block in blocks_assigned)
|
||||
warning("DNA2: Gene [G.name] trying to use already-assigned block [G.block] (used by [english_list(blocks_assigned[G.block])])")
|
||||
dna_genes.Add(G)
|
||||
var/list/assignedToBlock[0]
|
||||
if(blocks_assigned[G.block])
|
||||
assignedToBlock=blocks_assigned[G.block]
|
||||
assignedToBlock.Add(G.name)
|
||||
blocks_assigned[G.block]=assignedToBlock
|
||||
testing("DNA2: Gene [G.name] assigned to block [G.block].")
|
||||
|
||||
// HIDDEN MUTATIONS / SUPERPOWERS INITIALIZTION
|
||||
|
||||
/*
|
||||
/*
|
||||
for(var/x in typesof(/datum/mutations) - /datum/mutations)
|
||||
var/datum/mutations/mut = new x
|
||||
|
||||
@@ -62,7 +130,7 @@
|
||||
|
||||
|
||||
global_mutations += mut// add to global mutations list!
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
/proc/setupfactions()
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
if(istype(M, /mob/living/carbon/human/dummy))
|
||||
return..()
|
||||
|
||||
if(M.has_brain_worms()) //Borer stuff - RR
|
||||
user << "<span class='warning'>This being is corrupted by an alien intelligence and cannot be soul trapped.</span>"
|
||||
return..()
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their soul captured with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to capture the soul of [M.name] ([M.ckey])</font>")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) used the [src.name] to capture the soul of [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
@@ -51,9 +51,9 @@
|
||||
B.name = "Toolbox Manifesto"
|
||||
if("homosexuality")
|
||||
B.name = "Guys Gone Wild"
|
||||
if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks")
|
||||
B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition")
|
||||
H.setBrainLoss(100) // starts off retarded as fuck
|
||||
//if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks")
|
||||
// B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition")
|
||||
// H.setBrainLoss(100) // starts off retarded as fuck
|
||||
if("science")
|
||||
B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition")
|
||||
else
|
||||
@@ -152,4 +152,4 @@
|
||||
ticker.Bible_deity_name = B.deity_name
|
||||
feedback_set_details("religion_deity","[new_deity]")
|
||||
feedback_set_details("religion_book","[new_book_style]")
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
minimal_access = list(access_medical, access_morgue, access_genetics, access_heads,
|
||||
access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce,
|
||||
access_keycard_auth, access_sec_doors, access_psychiatrist)
|
||||
minimal_player_age = 7
|
||||
minimal_player_age = 10
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
selection_color = "#ffeeee"
|
||||
access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels)
|
||||
minimal_player_age = 7
|
||||
minimal_player_age = 5
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
@@ -100,7 +100,7 @@
|
||||
access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
minimal_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
alt_titles = list("Forensic Technician")
|
||||
minimal_player_age = 7
|
||||
minimal_player_age = 3
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
@@ -146,7 +146,7 @@
|
||||
selection_color = "#ffeeee"
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels, access_morgue)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels)
|
||||
minimal_player_age = 7
|
||||
minimal_player_age = 3
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
selection_color = "#ccffcc"
|
||||
supervisors = "your laws"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 30
|
||||
minimal_player_age = 7
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
@@ -25,7 +25,8 @@
|
||||
spawn_positions = 2
|
||||
supervisors = "your laws and the AI" //Nodrak
|
||||
selection_color = "#ddffdd"
|
||||
minimal_player_age = 21
|
||||
minimal_player_age = 1
|
||||
alt_titles = list("Android", "Robot")
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
|
||||
@@ -67,7 +67,7 @@ var/global/datum/controller/occupations/job_master
|
||||
|
||||
proc/FreeRole(var/rank) //making additional slot on the fly
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(job && job.current_positions >= job.total_positions)
|
||||
if(job && job.current_positions >= job.total_positions && job.total_positions != -1)
|
||||
job.total_positions++
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
var/list/whitelist = list()
|
||||
|
||||
/hook/startup/proc/loadWhitelist()
|
||||
if(config.usewhitelist)
|
||||
load_whitelist()
|
||||
return 1
|
||||
|
||||
/proc/load_whitelist()
|
||||
whitelist = file2list(WHITELISTFILE)
|
||||
if(!whitelist.len) whitelist = null
|
||||
@@ -11,9 +16,14 @@ var/list/whitelist = list()
|
||||
return 0
|
||||
return ("[M.ckey]" in whitelist)
|
||||
|
||||
var/list/alien_whitelist = list()
|
||||
/var/list/alien_whitelist = list()
|
||||
|
||||
proc/load_alienwhitelist()
|
||||
/hook/startup/proc/loadAlienWhitelist()
|
||||
if(config.usealienwhitelist)
|
||||
load_alienwhitelist()
|
||||
return 1
|
||||
|
||||
/proc/load_alienwhitelist()
|
||||
var/text = file2text("config/alienwhitelist.txt")
|
||||
if (!text)
|
||||
diary << "Failed to load config/alienwhitelist.txt\n"
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
density = 1
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
|
||||
|
||||
/obj/machinery/sleep_console/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
@@ -71,10 +78,11 @@
|
||||
if(occupant.reagents)
|
||||
for(var/chemical in connected.available_chemicals)
|
||||
dat += "[connected.available_chemicals[chemical]]: [occupant.reagents.get_reagent_amount(chemical)] units<br>"
|
||||
dat += "<HR><A href='?src=\ref[src];refresh=1'>Refresh meter readings each second</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh Meter Readings</A><BR>"
|
||||
if(src.connected.beaker)
|
||||
dat += "<HR><A href='?src=\ref[src];removebeaker=1'>Remove Beaker</A><BR>"
|
||||
if(src.connected.filtering)
|
||||
dat += "<HR><A href='?src=\ref[src];togglefilter=1'>Stop Dialysis</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];togglefilter=1'>Stop Dialysis</A><BR>"
|
||||
dat += text("Output Beaker has [] units of free space remaining<BR><HR>", src.connected.beaker.reagents.maximum_volume - src.connected.beaker.reagents.total_volume)
|
||||
else
|
||||
dat += "<HR><A href='?src=\ref[src];togglefilter=1'>Start Dialysis</A><BR>"
|
||||
@@ -85,8 +93,10 @@
|
||||
for(var/chemical in connected.available_chemicals)
|
||||
dat += "Inject [connected.available_chemicals[chemical]]: "
|
||||
for(var/amount in connected.amounts)
|
||||
dat += "<a href ='?src=\ref[src];chemical=[chemical];amount=[amount]'>[amount] units</a> "
|
||||
dat += "<br>"
|
||||
dat += "<a href ='?src=\ref[src];chemical=[chemical];amount=[amount]'>[amount] units</a><br> "
|
||||
|
||||
|
||||
dat += "<HR><A href='?src=\ref[src];ejectify=1'>Eject Patient</A>"
|
||||
else
|
||||
dat += "The sleeper is empty."
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=sleeper'>Close</A>", user)
|
||||
@@ -108,19 +118,21 @@
|
||||
src.connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"]))
|
||||
else
|
||||
usr << "\red \b This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!"
|
||||
src.updateUsrDialog()
|
||||
if (href_list["refresh"])
|
||||
src.updateUsrDialog()
|
||||
if (href_list["removebeaker"])
|
||||
src.connected.remove_beaker()
|
||||
src.updateUsrDialog()
|
||||
if (href_list["togglefilter"])
|
||||
src.connected.toggle_filter()
|
||||
src.updateUsrDialog()
|
||||
if (href_list["ejectify"])
|
||||
src.connected.eject()
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/power_change()
|
||||
return
|
||||
@@ -144,7 +156,7 @@
|
||||
anchored = 1
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
var/mob/living/carbon/human/occupant = null
|
||||
var/available_chemicals = list("inaprovaline" = "Inaprovaline", "stoxin" = "Soporific", "dermaline" = "Dermaline", "bicaridine" = "Bicaridine", "dexalin" = "Dexalin")
|
||||
var/available_chemicals = list("inaprovaline" = "Inaprovaline", "stoxin" = "Soporific", "paracetamol" = "Paracetamol", "anti_toxin" = "Dylovene", "dexalin" = "Dexalin")
|
||||
var/amounts = list(5, 10)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/filtering = 0
|
||||
@@ -169,10 +181,9 @@
|
||||
if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
|
||||
src.occupant.vessel.trans_to(beaker, 1)
|
||||
for(var/datum/reagent/x in src.occupant.reagents.reagent_list)
|
||||
if(x.volume > 20)
|
||||
src.occupant.reagents.trans_id_to(beaker, x.id, 2)
|
||||
src.occupant.vessel.trans_to(beaker, 1)
|
||||
src.updateDialog()
|
||||
src.occupant.reagents.trans_to(beaker, 3)
|
||||
src.occupant.vessel.trans_to(beaker, 1)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
@@ -191,6 +202,7 @@
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else
|
||||
user << "\red The sleeper has a beaker already."
|
||||
|
||||
@@ -250,6 +250,9 @@
|
||||
dat += text("Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
|
||||
dat += text("Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)<BR><HR>")
|
||||
|
||||
if(occupant.has_brain_worms())
|
||||
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<BR/>"
|
||||
|
||||
if(occupant.vessel)
|
||||
var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
|
||||
var/blood_percent = blood_volume / 560
|
||||
@@ -281,6 +284,7 @@
|
||||
var/infected = ""
|
||||
var/imp = ""
|
||||
var/bled = ""
|
||||
var/robot = ""
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
@@ -295,6 +299,8 @@
|
||||
bled = "Bleeding:"
|
||||
if(e.status & ORGAN_BROKEN)
|
||||
AN = "[e.broken_description]:"
|
||||
if(e.status & ORGAN_ROBOT)
|
||||
robot = "Prosthetic:"
|
||||
if(e.open)
|
||||
open = "Open:"
|
||||
var/unknown_body = 0
|
||||
@@ -308,16 +314,25 @@
|
||||
if(!AN && !open && !infected & !imp)
|
||||
AN = "None:"
|
||||
if(!(e.status & ORGAN_DESTROYED))
|
||||
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
|
||||
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
|
||||
else
|
||||
dat += "<td>[e.display_name]</td><td>-</td><td>-</td><td>Not Found</td>"
|
||||
dat += "</tr>"
|
||||
for(var/organ_name in occupant.internal_organs)
|
||||
var/datum/organ/internal/i = occupant.internal_organs[organ_name]
|
||||
var/mech = ""
|
||||
if(i.robotic == 1)
|
||||
mech = "Assisted:"
|
||||
if(i.robotic == 2)
|
||||
mech = "Mechanical:"
|
||||
dat += "<tr>"
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>None:</td>"
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>None:[mech]</td><td></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
if(occupant.sdisabilities & BLIND)
|
||||
dat += text("<font color='red'>Cataracts detected.</font><BR>")
|
||||
if(occupant.sdisabilities & NEARSIGHTED)
|
||||
dat += text("<font color='red'>Retinal misalignment detected.</font><BR>")
|
||||
else
|
||||
dat += "\The [src] is empty."
|
||||
else
|
||||
|
||||
@@ -95,7 +95,7 @@ obj/machinery/computer/general_air_control
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateDialog()
|
||||
src.updateUsrDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
@@ -250,7 +250,7 @@ Max Output Pressure: [output_pressure] kPa<BR>"}
|
||||
var/change = text2num(href_list["adj_pressure"])
|
||||
pressure_setting = between(0, pressure_setting + change, 50*ONE_ATMOSPHERE)
|
||||
spawn(1)
|
||||
src.updateDialog()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
if(!radio_connection)
|
||||
@@ -282,7 +282,7 @@ Max Output Pressure: [output_pressure] kPa<BR>"}
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
spawn(5)
|
||||
src.updateDialog()
|
||||
src.updateUsrDialog()
|
||||
|
||||
fuel_injection
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
|
||||
@@ -243,18 +243,20 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
|
||||
if(href_list["toggle"])
|
||||
if (valve_open)
|
||||
if (holding)
|
||||
release_log += "Valve was <b>closed</b> by [usr], stopping the transfer into the [holding]<br>"
|
||||
release_log += "Valve was <b>closed</b> by [usr] ([usr.ckey]), stopping the transfer into the [holding]<br>"
|
||||
else
|
||||
release_log += "Valve was <b>closed</b> by [usr], stopping the transfer into the <font color='red'><b>air</b></font><br>"
|
||||
release_log += "Valve was <b>closed</b> by [usr] ([usr.ckey]), stopping the transfer into the <font color='red'><b>air</b></font><br>"
|
||||
else
|
||||
if (holding)
|
||||
release_log += "Valve was <b>opened</b> by [usr], starting the transfer into the [holding]<br>"
|
||||
release_log += "Valve was <b>opened</b> by [usr] ([usr.ckey]), starting the transfer into the [holding]<br>"
|
||||
else
|
||||
release_log += "Valve was <b>opened</b> by [usr], starting the transfer into the <font color='red'><b>air</b></font><br>"
|
||||
release_log += "Valve was <b>opened</b> by [usr] ([usr.ckey]), starting the transfer into the <font color='red'><b>air</b></font><br>"
|
||||
valve_open = !valve_open
|
||||
|
||||
if (href_list["remove_tank"])
|
||||
if(holding)
|
||||
if(istype(holding, /obj/item/weapon/tank))
|
||||
holding.manipulated_by = usr.real_name
|
||||
holding.loc = loc
|
||||
holding = null
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user