Merge branch 'incremental_tg' r4967 (27/10/2012) into bs12_with_tgport

Conflicts:
	baystation12.dme
	code/__HELPERS/game.dm
	code/__HELPERS/type2type.dm
	code/datums/helper_datums/getrev.dm
	code/game/atoms.dm
	code/game/gamemodes/events.dm
	code/game/machinery/atmo_control.dm
	code/game/machinery/atmoalter/area_atmos_computer.dm
	code/game/machinery/computer/HolodeckControl.dm
	code/game/machinery/computer/atmos_alert.dm
	code/game/machinery/computer/card.dm
	code/game/machinery/computer/cloning.dm
	code/game/machinery/computer/computer.dm
	code/game/machinery/computer/pod.dm
	code/game/machinery/computer/prisoner.dm
	code/game/machinery/computer/syndicate_shuttle.dm
	code/game/machinery/newscaster.dm
	code/game/machinery/spaceheater.dm
	code/game/machinery/telecomms/broadcaster.dm
	code/game/machinery/telecomms/logbrowser.dm
	code/game/machinery/telecomms/machine_interactions.dm
	code/game/machinery/telecomms/telemonitor.dm
	code/game/machinery/telecomms/traffic_control.dm
	code/game/machinery/wishgranter.dm
	code/game/objects/items/devices/uplinks.dm
	code/game/objects/items/stacks/stack.dm
	code/game/objects/objs.dm
	code/modules/DetectiveWork/detective_work.dm
	code/modules/admin/IsBanned.dm
	code/modules/admin/admin.dm
	code/modules/admin/verbs/adminsay.dm
	code/modules/admin/verbs/getlogs.dm
	code/modules/awaymissions/zlevel.dm
	code/modules/client/client procs.dm
	code/modules/clothing/masks/miscellaneous.dm
	code/modules/clothing/spacesuits/miscellaneous.dm
	code/modules/flufftext/TextFilters.dm
	code/modules/mining/machine_processing.dm
	code/modules/mining/machine_stacking.dm
	code/modules/mining/mine_items.dm
	code/modules/mining/mint.dm
	code/modules/mining/satchel_ore_boxdm.dm
	code/modules/mob/living/carbon/monkey/life.dm
	code/modules/mob/living/living_defense.dm
	code/modules/mob/living/simple_animal/friendly/corgi.dm
	code/modules/mob/mob.dm
	code/modules/paperwork/filingcabinet.dm
	code/modules/paperwork/photocopier.dm
	code/modules/power/gravitygenerator.dm
	html/changelog.html
	icons/mob/head.dmi
	icons/mob/human_face.dmi
	icons/mob/mask.dmi
	icons/mob/suit.dmi
	icons/obj/clothing/hats.dmi
	icons/obj/clothing/masks.dmi
	icons/obj/clothing/suits.dmi

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-12-28 01:03:14 +10:00
250 changed files with 9936 additions and 10091 deletions

View File

@@ -7,229 +7,11 @@
// BEGIN_FILE_DIR
#define FILE_DIR .
#define FILE_DIR "code"
#define FILE_DIR "code/ATMOSPHERICS"
#define FILE_DIR "code/ATMOSPHERICS/components"
#define FILE_DIR "code/ATMOSPHERICS/components/binary_devices"
#define FILE_DIR "code/ATMOSPHERICS/components/trinary_devices"
#define FILE_DIR "code/ATMOSPHERICS/components/unary"
#define FILE_DIR "code/controllers"
#define FILE_DIR "code/datums"
#define FILE_DIR "code/datums/diseases"
#define FILE_DIR "code/datums/helper_datums"
#define FILE_DIR "code/datums/organs"
#define FILE_DIR "code/datums/spells"
#define FILE_DIR "code/defines"
#define FILE_DIR "code/defines/obj"
#define FILE_DIR "code/defines/obj/clothing"
#define FILE_DIR "code/defines/procs"
#define FILE_DIR "code/defines/sd_procs"
#define FILE_DIR "code/FEA"
#define FILE_DIR "code/game"
#define FILE_DIR "code/game/area"
#define FILE_DIR "code/game/events"
#define FILE_DIR "code/game/events/EventProcs"
#define FILE_DIR "code/game/events/Events"
#define FILE_DIR "code/game/gamemodes"
#define FILE_DIR "code/game/gamemodes/autotraitor"
#define FILE_DIR "code/game/gamemodes/blob"
#define FILE_DIR "code/game/gamemodes/blob/blobs"
#define FILE_DIR "code/game/gamemodes/changeling"
#define FILE_DIR "code/game/gamemodes/cult"
#define FILE_DIR "code/game/gamemodes/epidemic"
#define FILE_DIR "code/game/gamemodes/events"
#define FILE_DIR "code/game/gamemodes/events/holidays"
#define FILE_DIR "code/game/gamemodes/extended"
#define FILE_DIR "code/game/gamemodes/malfunction"
#define FILE_DIR "code/game/gamemodes/meme"
#define FILE_DIR "code/game/gamemodes/meteor"
#define FILE_DIR "code/game/gamemodes/nuclear"
#define FILE_DIR "code/game/gamemodes/revolution"
#define FILE_DIR "code/game/gamemodes/sandbox"
#define FILE_DIR "code/game/gamemodes/traitor"
#define FILE_DIR "code/game/gamemodes/wizard"
#define FILE_DIR "code/game/jobs"
#define FILE_DIR "code/game/jobs/job"
#define FILE_DIR "code/game/machinery"
#define FILE_DIR "code/game/machinery/atmoalter"
#define FILE_DIR "code/game/machinery/bots"
#define FILE_DIR "code/game/machinery/camera"
#define FILE_DIR "code/game/machinery/computer"
#define FILE_DIR "code/game/machinery/doors"
#define FILE_DIR "code/game/machinery/embedded_controller"
#define FILE_DIR "code/game/machinery/kitchen"
#define FILE_DIR "code/game/machinery/pipe"
#define FILE_DIR "code/game/machinery/telecomms"
#define FILE_DIR "code/game/magic"
#define FILE_DIR "code/game/mecha"
#define FILE_DIR "code/game/mecha/combat"
#define FILE_DIR "code/game/mecha/equipment"
#define FILE_DIR "code/game/mecha/equipment/tools"
#define FILE_DIR "code/game/mecha/equipment/weapons"
#define FILE_DIR "code/game/mecha/medical"
#define FILE_DIR "code/game/mecha/working"
#define FILE_DIR "code/game/objects"
#define FILE_DIR "code/game/objects/closets"
#define FILE_DIR "code/game/objects/closets/secure"
#define FILE_DIR "code/game/objects/effects"
#define FILE_DIR "code/game/objects/effects/decals"
#define FILE_DIR "code/game/objects/effects/decals/Cleanable"
#define FILE_DIR "code/game/objects/effects/spawners"
#define FILE_DIR "code/game/objects/items"
#define FILE_DIR "code/game/objects/items/devices"
#define FILE_DIR "code/game/objects/items/devices/PDA"
#define FILE_DIR "code/game/objects/items/devices/radio"
#define FILE_DIR "code/game/objects/items/robot"
#define FILE_DIR "code/game/objects/items/stacks"
#define FILE_DIR "code/game/objects/items/stacks/sheets"
#define FILE_DIR "code/game/objects/items/stacks/tiles"
#define FILE_DIR "code/game/objects/items/weapons"
#define FILE_DIR "code/game/objects/items/weapons/grenades"
#define FILE_DIR "code/game/objects/items/weapons/implants"
#define FILE_DIR "code/game/objects/items/weapons/secstorage"
#define FILE_DIR "code/game/objects/items/weapons/storage"
#define FILE_DIR "code/game/objects/items/weapons/tanks"
#define FILE_DIR "code/game/objects/storage"
#define FILE_DIR "code/game/objects/structures"
#define FILE_DIR "code/game/objects/structures/crates_lockers"
#define FILE_DIR "code/game/objects/structures/crates_lockers/closets"
#define FILE_DIR "code/game/objects/structures/crates_lockers/closets/secure"
#define FILE_DIR "code/game/objects/structures/stool_bed_chair_nest"
#define FILE_DIR "code/game/player"
#define FILE_DIR "code/game/structure"
#define FILE_DIR "code/game/turfs"
#define FILE_DIR "code/game/turfs/simulated"
#define FILE_DIR "code/game/turfs/space"
#define FILE_DIR "code/game/turfs/unsimulated"
#define FILE_DIR "code/game/vehicles"
#define FILE_DIR "code/game/vehicles/airtight"
#define FILE_DIR "code/game/verbs"
#define FILE_DIR "code/js"
#define FILE_DIR "code/modules"
#define FILE_DIR "code/modules/admin"
#define FILE_DIR "code/modules/admin/DB ban"
#define FILE_DIR "code/modules/admin/permissionverbs"
#define FILE_DIR "code/modules/admin/verbs"
#define FILE_DIR "code/modules/assembly"
#define FILE_DIR "code/modules/awaymissions"
#define FILE_DIR "code/modules/awaymissions/maploader"
#define FILE_DIR "code/modules/chemical"
#define FILE_DIR "code/modules/client"
#define FILE_DIR "code/modules/clothing"
#define FILE_DIR "code/modules/clothing/glasses"
#define FILE_DIR "code/modules/clothing/gloves"
#define FILE_DIR "code/modules/clothing/head"
#define FILE_DIR "code/modules/clothing/masks"
#define FILE_DIR "code/modules/clothing/shoes"
#define FILE_DIR "code/modules/clothing/spacesuits"
#define FILE_DIR "code/modules/clothing/suits"
#define FILE_DIR "code/modules/clothing/under"
#define FILE_DIR "code/modules/clothing/under/jobs"
#define FILE_DIR "code/modules/clothing/uniforms"
#define FILE_DIR "code/modules/critters"
#define FILE_DIR "code/modules/critters/hivebots"
#define FILE_DIR "code/modules/customitems"
#define FILE_DIR "code/modules/DetectiveWork"
#define FILE_DIR "code/modules/flufftext"
#define FILE_DIR "code/modules/food"
#define FILE_DIR "code/modules/genetics"
#define FILE_DIR "code/modules/icon generation"
#define FILE_DIR "code/modules/library"
#define FILE_DIR "code/modules/liquid"
#define FILE_DIR "code/modules/maps"
#define FILE_DIR "code/modules/mining"
#define FILE_DIR "code/modules/mob"
#define FILE_DIR "code/modules/mob/dead"
#define FILE_DIR "code/modules/mob/dead/observer"
#define FILE_DIR "code/modules/mob/living"
#define FILE_DIR "code/modules/mob/living/blob"
#define FILE_DIR "code/modules/mob/living/carbon"
#define FILE_DIR "code/modules/mob/living/carbon/alien"
#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid"
#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid/caste"
#define FILE_DIR "code/modules/mob/living/carbon/alien/larva"
#define FILE_DIR "code/modules/mob/living/carbon/alien/special"
#define FILE_DIR "code/modules/mob/living/carbon/amorph"
#define FILE_DIR "code/modules/mob/living/carbon/brain"
#define FILE_DIR "code/modules/mob/living/carbon/human"
#define FILE_DIR "code/modules/mob/living/carbon/metroid"
#define FILE_DIR "code/modules/mob/living/carbon/monkey"
#define FILE_DIR "code/modules/mob/living/parasite"
#define FILE_DIR "code/modules/mob/living/silicon"
#define FILE_DIR "code/modules/mob/living/silicon/ai"
#define FILE_DIR "code/modules/mob/living/silicon/ai/freelook"
#define FILE_DIR "code/modules/mob/living/silicon/decoy"
#define FILE_DIR "code/modules/mob/living/silicon/pai"
#define FILE_DIR "code/modules/mob/living/silicon/robot"
#define FILE_DIR "code/modules/mob/living/simple_animal"
#define FILE_DIR "code/modules/mob/living/simple_animal/friendly"
#define FILE_DIR "code/modules/mob/living/simple_animal/hostile"
#define FILE_DIR "code/modules/mob/new_player"
#define FILE_DIR "code/modules/mob/simple_animal"
#define FILE_DIR "code/modules/paperwork"
#define FILE_DIR "code/modules/power"
#define FILE_DIR "code/modules/power/antimatter"
#define FILE_DIR "code/modules/power/singularity"
#define FILE_DIR "code/modules/power/singularity/particle_accelerator"
#define FILE_DIR "code/modules/projectiles"
#define FILE_DIR "code/modules/projectiles/ammunition"
#define FILE_DIR "code/modules/projectiles/guns"
#define FILE_DIR "code/modules/projectiles/guns/energy"
#define FILE_DIR "code/modules/projectiles/guns/projectile"
#define FILE_DIR "code/modules/projectiles/projectile"
#define FILE_DIR "code/modules/reagents"
#define FILE_DIR "code/modules/reagents/reagent_containers"
#define FILE_DIR "code/modules/reagents/reagent_containers/food"
#define FILE_DIR "code/modules/reagents/reagent_containers/food/drinks"
#define FILE_DIR "code/modules/reagents/reagent_containers/food/drinks/bottle"
#define FILE_DIR "code/modules/reagents/reagent_containers/food/snacks"
#define FILE_DIR "code/modules/reagents/reagent_containers/glass"
#define FILE_DIR "code/modules/reagents/reagent_containers/glass/bottle"
#define FILE_DIR "code/modules/recycling"
#define FILE_DIR "code/modules/research"
#define FILE_DIR "code/modules/research/xenoarchaeology"
#define FILE_DIR "code/modules/scripting"
#define FILE_DIR "code/modules/scripting/AST"
#define FILE_DIR "code/modules/scripting/AST/Operators"
#define FILE_DIR "code/modules/scripting/Implementations"
#define FILE_DIR "code/modules/scripting/Interpreter"
#define FILE_DIR "code/modules/scripting/Parser"
#define FILE_DIR "code/modules/scripting/Scanner"
#define FILE_DIR "code/modules/security levels"
#define FILE_DIR "code/TriDimension"
#define FILE_DIR "code/unused"
#define FILE_DIR "code/unused/beast"
#define FILE_DIR "code/unused/computer2"
#define FILE_DIR "code/unused/disease2"
#define FILE_DIR "code/unused/gamemodes"
#define FILE_DIR "code/unused/hivebot"
#define FILE_DIR "code/unused/mining"
#define FILE_DIR "code/unused/optics"
#define FILE_DIR "code/unused/pda2"
#define FILE_DIR "code/unused/powerarmor"
#define FILE_DIR "code/unused/spacecraft"
#define FILE_DIR "code/WorkInProgress"
#define FILE_DIR "code/WorkInProgress/AI_Visibility"
#define FILE_DIR "code/WorkInProgress/animusstation"
#define FILE_DIR "code/WorkInProgress/Apples"
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn"
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust"
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter"
#define FILE_DIR "code/WorkInProgress/carn"
#define FILE_DIR "code/WorkInProgress/Chinsky"
#define FILE_DIR "code/WorkInProgress/mapload"
#define FILE_DIR "code/WorkInProgress/Mini"
#define FILE_DIR "code/WorkInProgress/Mloc"
#define FILE_DIR "code/WorkInProgress/organs"
#define FILE_DIR "code/WorkInProgress/Ported"
#define FILE_DIR "code/WorkInProgress/Ported/Abi79"
#define FILE_DIR "code/WorkInProgress/Ported/Bureaucracy"
#define FILE_DIR "code/WorkInProgress/Ported/Spawners"
#define FILE_DIR "code/WorkInProgress/SkyMarshal"
#define FILE_DIR "code/WorkInProgress/Tastyfish"
#define FILE_DIR "code/WorkInProgress/virus2"
#define FILE_DIR "code/WorkInProgress/virus2/Disease2"
#define FILE_DIR "code/WorkInProgress/Wrongnumber"
#define FILE_DIR "code/ZAS"
#define FILE_DIR "html"
#define FILE_DIR "icons"
#define FILE_DIR "icons/48x48"
@@ -251,9 +33,7 @@
#define FILE_DIR "icons/turf"
#define FILE_DIR "icons/vehicles"
#define FILE_DIR "icons/vending_icons"
#define FILE_DIR "interface"
#define FILE_DIR "maps"
#define FILE_DIR "maps/RandomZLevels"
#define FILE_DIR "sound"
#define FILE_DIR "sound/AI"
#define FILE_DIR "sound/ambience"
@@ -268,8 +48,6 @@
#define FILE_DIR "sound/violin"
#define FILE_DIR "sound/voice"
#define FILE_DIR "sound/weapons"
#define FILE_DIR "tools"
#define FILE_DIR "tools/Redirector"
// END_FILE_DIR
// BEGIN_PREFERENCES
@@ -282,6 +60,17 @@
#include "code\setup.dm"
#include "code\stylesheet.dm"
#include "code\world.dm"
#include "code\__HELPERS\files.dm"
#include "code\__HELPERS\game.dm"
#include "code\__HELPERS\global_lists.dm"
#include "code\__HELPERS\icons.dm"
#include "code\__HELPERS\lists.dm"
#include "code\__HELPERS\logging.dm"
#include "code\__HELPERS\names.dm"
#include "code\__HELPERS\text.dm"
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
#include "code\ATMOSPHERICS\datum_pipeline.dm"
@@ -382,25 +171,10 @@
#include "code\defines\obj\weapon.dm"
#include "code\defines\procs\AStar.dm"
#include "code\defines\procs\captain_announce.dm"
#include "code\defines\procs\church_name.dm"
#include "code\defines\procs\command_alert.dm"
#include "code\defines\procs\command_name.dm"
#include "code\defines\procs\dbcore.dm"
#include "code\defines\procs\forum_activation.dm"
#include "code\defines\procs\gamehelpers.dm"
#include "code\defines\procs\global_lists.dm"
#include "code\defines\procs\helper_list.dm"
#include "code\defines\procs\helper_text.dm"
#include "code\defines\procs\helper_type2type.dm"
#include "code\defines\procs\helpers.dm"
#include "code\defines\procs\icon_procs.dm"
#include "code\defines\procs\icon_procs_readme.dm"
#include "code\defines\procs\logging.dm"
#include "code\defines\procs\religion_name.dm"
#include "code\defines\procs\station_name.dm"
#include "code\defines\procs\statistics.dm"
#include "code\defines\procs\syndicate_name.dm"
#include "code\defines\procs\time_stamp.dm"
#include "code\game\asteroid.dm"
#include "code\game\atoms.dm"
#include "code\game\atoms_movable.dm"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -182,12 +182,12 @@
/proc/dd_replacetext(text, search_string, replacement_string)
if(!text || !istext(text) || !search_string || !istext(search_string) || !istext(replacement_string))
return null
var/textList = dd_text2list(text, search_string)
var/textList = text2list(text, search_string)
return dd_list2text(textList, replacement_string)
//Search and replace a case sensitive sub-string within a string
/proc/dd_replacetext_case(text, search_string, replacement_string)
var/textList = dd_text2list(text, search_string)
var/textList = text2list(text, search_string)
return dd_list2text(textList, replacement_string)
//Adds 'u' number of zeros ahead of the text 't'

View File

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

View File

@@ -82,47 +82,6 @@
hex = text("0[]", hex)
return hex
//Text 'text' will be added as elements of a list when seperated by 'seperator'
/proc/dd_text2list(text, separator, var/list/withinList)
var/textlength = length(text)
var/separatorlength = length(separator)
if(withinList && !withinList.len) withinList = null
var/list/textList = new()
var/searchPosition = 1
var/findPosition = 1
var/loops = 999
while(loops) //Byond will think 1000+ iterations of a loop is an infinite loop
findPosition = findtext(text, separator, searchPosition, 0)
var/buggyText = copytext(text, searchPosition, findPosition)
if(!withinList || (buggyText in withinList)) textList += "[buggyText]"
if(!findPosition) return textList
searchPosition = findPosition + separatorlength
if(searchPosition > textlength)
textList += ""
return textList
loops--
return
//Text 'text' will be added as elements of a list when seperated by 'seperator'. The separator is case sensitive.
/proc/dd_text2list_case(text, separator, var/list/withinList)
var/textlength = length(text)
var/separatorlength = length(separator)
if(withinList && !withinList.len) withinList = null
var/list/textList = new()
var/searchPosition = 1
var/findPosition = 1
var/loops = 999
while(loops) //Byond will think 1000+ iterations of a loop is an infinite loop
findPosition = findtextEx(text, separator, searchPosition, 0)
var/buggyText = copytext(text, searchPosition, findPosition)
if(!withinList || (buggyText in withinList)) textList += "[buggyText]"
if(!findPosition) return textList
searchPosition = findPosition + separatorlength
if(searchPosition > textlength)
textList += ""
return textList
loops--
return
//Attaches each element of a list to a single string seperated by 'seperator'.
/proc/dd_list2text(var/list/the_list, separator)
@@ -138,46 +97,6 @@
count++
return newText
//tg_text2list is faster then dd_text2list
//not case sensitive version
proc/tg_text2list(string, separator=",")
if(!string)
return
var/list/output = new
var/seplength = length(separator)
var/strlength = length(string)
var/prev = 1
var/index
do
index = findtext(string, separator, prev, 0)
output += copytext(string, prev, index)
if(!index)
break
prev = index+seplength
if(prev>strlength)
break
while(index)
return output
//case sensitive version
proc/tg_text2list_case(string, separator=",")
if(!string)
return
var/list/output = new
var/seplength = length(separator)
var/strlength = length(string)
var/prev = 1
var/index
do
index = findtextEx(string, separator, prev, 0)
output += copytext(string, prev, index)
if(!index)
break
prev = index+seplength
if(prev>strlength)
break
while(index)
return output
//slower then dd_list2text, but correctly processes associative lists.
proc/tg_list2text(list/list, glue=",")
@@ -188,16 +107,58 @@ proc/tg_list2text(list/list, glue=",")
output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]")
return output
//Gets a file and adds its contents to a list.
/proc/dd_file2list(file_path, separator)
var/file
if(separator == null)
separator = "\n"
if(isfile(file_path))
file = file_path
else
file = file(file_path)
return dd_text2list(file2text(file), separator)
//Converts a text string into a list by splitting the string at each seperator found in text (discarding the seperator)
//Returns an empty list if the text cannot be split, or the split text in a list.
//Not giving a "" seperator will cause the text to be broken into a list of single letters.
/proc/text2list(text, seperator="\n")
. = list()
var/text_len = length(text) //length of the input text
var/seperator_len = length(seperator) //length of the seperator text
if(text_len >= seperator_len)
var/i
var/last_i = 1
for(i=1,i<=(text_len+1-seperator_len),i++)
if( cmptext(copytext(text,i,i+seperator_len), seperator) )
if(i != last_i)
. += copytext(text,last_i,i)
last_i = i + seperator_len
if(last_i <= text_len)
. += copytext(text, last_i, 0)
return .
//Converts a text string into a list by splitting the string at each seperator found in text (discarding the seperator)
//Returns an empty list if the text cannot be split, or the split text in a list.
//Not giving a "" seperator will cause the text to be broken into a list of single letters.
//Case Sensitive!
/proc/text2listEx(text, seperator="\n")
. = list()
var/text_len = length(text) //length of the input text
var/seperator_len = length(seperator) //length of the seperator text
if(text_len > seperator_len)
var/i
var/last_i = 1
for(i=1,i<=(text_len+1-seperator_len),i++)
if( cmptextEx(copytext(text,i,i+seperator_len), seperator) )
if(i != last_i)
. += copytext(text,last_i,i)
last_i = i + seperator_len
if(last_i <= text_len)
. += copytext(text, last_i, 0)
return .
//Splits the text of a file at seperator and returns them in a list.
/proc/file2list(filename, seperator="\n")
return text2list(return_file_text(filename),seperator)
//Turns a direction into text
/proc/dir2text(direction)
@@ -258,9 +219,3 @@ proc/tg_list2text(list/list, glue=",")
//Returns the angle in english
/proc/angle2text(var/degree)
return dir2text(angle2dir(degree))
//Returns the world time in english
proc/worldtime2text(var/time = 0)
if(time == 0)
time = world.time
return "[round(time / 36000)+12]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]"

View File

@@ -615,7 +615,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
// so just reset the user mob's machine var
if(src && src.mob)
//world << "[src] was [src.mob.machine], setting to null"
src.mob.machine = null
src.mob.unset_machine()
return
//Will return the location of the turf an atom is ultimatly sitting on

View File

@@ -123,20 +123,10 @@
src.votable_modes += "secret"
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
var/text = file2text(filename)
var/list/Lines = file2list(filename)
if (!text)
diary << "No [filename] file found, setting defaults"
src = new /datum/configuration()
return
diary << "Reading configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
@@ -412,20 +402,9 @@
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/loadsql(filename) // -- TLE
var/text = file2text(filename)
if (!text)
diary << "No dbconfig.txt file found, retaining defaults"
world << "No dbconfig.txt file found, retaining defaults"
return
diary << "Reading database configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
@@ -469,20 +448,9 @@
diary << "Unknown setting in configuration: '[name]'"
/datum/configuration/proc/loadforumsql(filename) // -- TLE
var/text = file2text(filename)
if (!text)
diary << "No forumdbconfig.txt file found, retaining defaults"
world << "No forumdbconfig.txt file found, retaining defaults"
return
diary << "Reading forum database configuration file [filename]"
var/list/CL = dd_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)

View File

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

View File

@@ -64,7 +64,7 @@ datum/controller/vote
greatest_votes = votes
//default-vote for everyone who didn't vote
if(!config.vote_no_default && choices.len)
var/non_voters = (client_list.len - total_votes)
var/non_voters = (clients.len - total_votes)
if(non_voters > 0)
if(mode == "restart")
choices["Continue Playing"] += non_voters

View File

@@ -245,6 +245,7 @@ client
if(ismob(D))
body += "<option value='byond://?src=\ref[src];give_spell=\ref[D]'>Give Spell</option>"
body += "<option value='byond://?src=\ref[src];give_disease=\ref[D]'>Give Disease</option>"
body += "<option value='byond://?src=\ref[src];ninja=\ref[D]'>Make Space Ninja</option>"
body += "<option value='byond://?src=\ref[src];godmode=\ref[D]'>Toggle Godmode</option>"
body += "<option value='byond://?src=\ref[src];build_mode=\ref[D]'>Toggle Build Mode</option>"
@@ -477,6 +478,19 @@ client
if(!admin_rank_check(src.holder.level, 3)) return
src.give_spell(MOB)
href_list["datumrefresh"] = href_list["give_spell"]
else if (href_list["give_disease"])
if(!href_list["give_disease"])
return
var/mob/MOB = locate(href_list["give_disease"])
if(!MOB)
return
if(!ismob(MOB))
return
if(!src.holder)
return
if(!admin_rank_check(src.holder.level, 3)) return
src.give_disease(MOB)
href_list["datumrefresh"] = href_list["give_spell"]
else if (href_list["ninja"])
if(!href_list["ninja"])
return

View File

@@ -17,6 +17,8 @@ to null does not delete the object itself. Thank you.
*/
var/list/diseases = typesof(/datum/disease) - /datum/disease
/datum/disease
var/form = "Virus" //During medscans, what the disease is referred to as

View File

@@ -5,7 +5,6 @@
if(!holder) return
if(holder == affected_mob)
stage_act()
if(affected_mob)
if(affected_mob.stat == DEAD)
if(prob(50))
@@ -45,16 +44,7 @@
/datum/disease/alien_embryo/stage_act()
..()
switch(stage)
if(2)
if(prob(1))
affected_mob.emote("sneeze")
if(prob(1))
affected_mob.emote("cough")
if(prob(1))
affected_mob << "\red Your throat feels sore."
if(prob(1))
affected_mob << "\red Mucous runs down the back of your throat."
if(3)
if(2, 3)
if(prob(1))
affected_mob.emote("sneeze")
if(prob(1))
@@ -83,16 +73,7 @@
affected_mob.updatehealth()
if(prob(50))
if(gibbed != 0) return 0
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
i++
var/list/candidates = get_alien_candidates()
var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc)
if(candidates.len)
new_xeno.key = pick(candidates)
@@ -111,15 +92,15 @@ Des: Removes all infection images from aliens and places an infection image on a
----------------------------------------*/
/datum/disease/alien_embryo/proc/RefreshInfectionImage()
spawn(0)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
for(var/image/I in alien.client.images)
if(I.icon_state == "infected")
del(I)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
for (var/mob/living/carbon/C in world)
for (var/mob/living/carbon/C in mob_list)
if(C)
if (C.status_flags & XENO_HOST)
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected")
@@ -132,7 +113,7 @@ Des: Checks if the passed mob (C) is infected with the alien egg, then gives eac
----------------------------------------*/
/datum/disease/alien_embryo/proc/AddInfectionImages(var/mob/living/carbon/C)
if (C)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
if (C.status_flags & XENO_HOST)
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected")
@@ -146,7 +127,7 @@ Des: Removes the alien infection image from all aliens in the world located in p
/datum/disease/alien_embryo/proc/RemoveInfectionImages(var/mob/living/carbon/C)
if (C)
for (var/mob/living/carbon/alien/alien in world)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
for(var/image/I in alien.client.images)
if(I.loc == C)

View File

@@ -19,18 +19,10 @@ var/global/datum/getrev/revdata = new("config/svndir.txt")
New(filename)
..()
if(!fexists(filename))
return abort()
var/text = file2text(file(filename))
if(!text)
diary << "Unable to get [filename] contents, aborting"
return abort()
var/list/CL = tg_text2list(text, "\n")
for (var/t in CL)
if (!t)
continue
var/list/Lines = file2list(filename)
if(!Lines.len) return abort()
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
continue
@@ -53,7 +45,7 @@ var/global/datum/getrev/revdata = new("config/svndir.txt")
revhref = value
if(svndirpath && fexists(svndirpath) && fexists("[svndirpath]/entries") && isfile(file("[svndirpath]/entries")))
var/list/filelist = dd_file2list("[svndirpath]/entries",null)
var/list/filelist = file2list("[svndirpath]/entries")
if(filelist.len < 4)
return abort()
revision = filelist[4]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -21,10 +21,7 @@ proc/sql_poll_players()
proc/sql_poll_admins()
if(!sqllogging)
return
var/admincount = 0
for (var/client/C in admin_list)
if(C)
admincount += 1
var/admincount = admins.len
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())

View File

@@ -24,13 +24,11 @@
/atom/proc/throw_impact(atom/hit_atom)
if(istype(hit_atom,/mob/living))
var/mob/living/M = hit_atom
M.visible_message("\red [hit_atom] has been hit by [src].")
if(isobj(src))//Hate typecheckin for a child object but this is just fixing crap another guy broke so if someone wants to put the time in and make this proper feel free.
M.take_organ_damage(src:throwforce)
M.hitby(src)
log_attack("<font color='red'>[hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])</font>")
log_admin("ATTACK: [hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])")
msg_admin_attack("ATTACK: [hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])")
log_attack("<font color='red'>[hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])</font>")
log_admin("ATTACK: [hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])")
msg_admin_attack("ATTACK: [hit_atom] ([M.ckey]) was hit by [src] thrown by ([src.fingerprintslast])")
else if(isobj(hit_atom))
var/obj/O = hit_atom
@@ -62,7 +60,7 @@
return null
/atom/proc/check_eye(user as mob)
if (istype(user, /mob/living/silicon/ai))
if (istype(user, /mob/living/silicon/ai)) // WHYYYY
return 1
return

View File

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

View File

@@ -565,7 +565,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
for (var/mob/V in viewers(src))
V.show_message("\red [user] slices open a finger and begins to chant and paint symbols on the floor.", 3, "\red You hear chanting.", 2)
user << "\red You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world."
user.take_overall_damage(1)
user.take_overall_damage((rand(9)+1)/10) // 0.1 to 1.0 damage
if(do_after(user, 50))
if(usr.get_active_hand() != src)
return

View File

@@ -237,15 +237,7 @@
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = list() //List of candidate KEYs to control the new larvae. ~Carn
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
i++
var/list/candidates = get_alien_candidates()
if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)

View File

@@ -46,7 +46,7 @@
/obj/machinery/nuclearbomb/attack_hand(mob/user as mob)
if (src.extended)
user.machine = src
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)
if (src.yes_code)
@@ -91,7 +91,7 @@
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.machine = src
usr.set_machine(src)
if (href_list["auth"])
if (src.auth)
src.auth.loc = src.loc

View File

@@ -267,7 +267,7 @@
. = ..()
/obj/item/weapon/pinpointer/attack_self(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat
if (src.temp)
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
@@ -298,7 +298,7 @@
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
usr.machine = src
usr.set_machine(src)
if (href_list["refresh"])
src.temp = "<B>Nuclear Disk Pinpointer</B><HR>"
var/turf/sr = get_turf(src)

View File

@@ -41,7 +41,7 @@
attack_self(mob/user)
if (!in_range(src, user))
return
user.machine = src
user.set_machine(src)
var/dat = "<TT><B>Soul Stone</B><BR>"
for(var/mob/living/simple_animal/shade/A in src)
dat += "Captured Soul: [A.name]<br>"
@@ -59,16 +59,16 @@
var/mob/U = usr
if (!in_range(src, U)||U.machine!=src)
U << browse(null, "window=aicard")
U.machine = null
U.unset_machine()
return
add_fingerprint(U)
U.machine = src
U.set_machine(src)
switch(href_list["choice"])//Now we switch based on choice.
if ("Close")
U << browse(null, "window=aicard")
U.machine = null
U.unset_machine()
return
if ("Summon")

View File

@@ -2,7 +2,7 @@
//SPELL BOOK PROCS
/obj/item/weapon/spellbook/attack_self(mob/user as mob)
user.machine = src
user.set_machine(src)
var/dat
if (src.temp)
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
@@ -53,7 +53,7 @@
if (!( istype(H, /mob/living/carbon/human)))
return 1
if ((usr.contents.Find(src) || (in_range(src,usr) && istype(src.loc, /turf))))
usr.machine = src
usr.set_machine(src)
if(href_list["spell_choice"])
if(src.uses >= 1 && src.max_uses >=1 && text2num(href_list["spell_choice"]) < 18)
src.uses--

View File

@@ -90,7 +90,7 @@
..()
//NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6
if(src.req_access_txt)
var/list/req_access_str = dd_text2list(req_access_txt,";")
var/list/req_access_str = text2list(req_access_txt,";")
if(!req_access)
req_access = list()
for(var/x in req_access_str)
@@ -99,7 +99,7 @@
req_access += n
if(src.req_one_access_txt)
var/list/req_one_access_str = dd_text2list(req_one_access_txt,";")
var/list/req_one_access_str = text2list(req_one_access_txt,";")
if(!req_one_access)
req_one_access = list()
for(var/x in req_one_access_str)

View File

@@ -395,13 +395,7 @@ var/global/datum/controller/occupations/job_master
if(!config.load_jobs_from_txt)
return 0
var/text = file2text(jobsfile)
if(!text)
world << "No jobs.txt found, using defaults."
return
var/list/jobEntries = dd_text2list(text, "\n")
var/list/jobEntries = file2list(jobsfile)
for(var/job in jobEntries)
if(!job)

View File

@@ -3,11 +3,8 @@
var/list/whitelist = list()
/proc/load_whitelist()
var/text = file2text(WHITELISTFILE)
if (!text)
diary << "Failed to [WHITELISTFILE]\n"
else
whitelist = dd_text2list(text, "\n")
whitelist = file2list(WHITELISTFILE)
if(!whitelist.len) whitelist = null
/proc/check_whitelist(mob/M /*, var/rank*/)
if(!whitelist)
@@ -21,7 +18,7 @@ proc/load_alienwhitelist()
if (!text)
diary << "Failed to load config/alienwhitelist.txt\n"
else
alien_whitelist = dd_text2list(text, "\n")
alien_whitelist = text2list(text, "\n")
/proc/is_alien_whitelisted(mob/M, var/species)
if(!alien_whitelist)

View File

@@ -42,7 +42,7 @@
return src.attack_hand(user)
attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
var/temp_text = ""
if(air_contents.temperature > (T0C - 20))
temp_text = "<FONT color=red>[air_contents.temperature]</FONT>"
@@ -63,7 +63,7 @@
Topic(href, href_list)
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
usr.set_machine(src)
if (href_list["start"])
src.on = !src.on
update_icon()
@@ -128,7 +128,7 @@
return src.attack_hand(user)
attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
var/temp_text = ""
if(air_contents.temperature > (T20C+40))
temp_text = "<FONT color=red>[air_contents.temperature]</FONT>"
@@ -147,7 +147,7 @@
Topic(href, href_list)
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
usr.set_machine(src)
if (href_list["start"])
src.on = !src.on
update_icon()

View File

@@ -84,7 +84,7 @@
if(..())
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
usr.set_machine(src)
if (src.connected)
if (src.connected.occupant)
if(src.connected.occupant.health > 0)

View File

@@ -39,7 +39,7 @@
user << "You [ locked ? "lock" : "unlock"] the device."
if (locked)
if (user.machine==src)
user.machine = null
user.unset_machine()
user << browse(null, "window=ai_slipper")
else
if (user.machine==src)
@@ -58,11 +58,11 @@
if ( (get_dist(src, user) > 1 ))
if (!istype(user, /mob/living/silicon))
user << text("Too far away.")
user.machine = null
user.unset_machine()
user << browse(null, "window=ai_slipper")
return
user.machine = src
user.set_machine(src)
var/loc = src.loc
if (istype(loc, /turf))
loc = loc:loc

View File

@@ -177,11 +177,11 @@
. = ..()
if (.)
return
user.machine = src
user.set_machine(src)
if ( (get_dist(src, user) > 1 ))
if (!istype(user, /mob/living/silicon))
user.machine = null
user.unset_machine()
user << browse(null, "window=air_alarm")
user << browse(null, "window=AAlarmwires")
return
@@ -716,11 +716,11 @@ table tr:first-child th:first-child { border: none;}
if(..())
return
src.add_fingerprint(usr)
usr.machine = src
usr.set_machine(src)
if ( (get_dist(src, usr) > 1 ))
if (!istype(usr, /mob/living/silicon))
usr.machine = null
usr.unset_machine()
usr << browse(null, "window=air_alarm")
usr << browse(null, "window=AAlarmwires")
return
@@ -1080,7 +1080,7 @@ table tr:first-child th:first-child { border: none;}
if(user.stat || stat & (NOPOWER|BROKEN))
return
user.machine = src
user.set_machine(src)
var/area/A = src.loc
var/d1
var/d2
@@ -1122,7 +1122,7 @@ table tr:first-child th:first-child { border: none;}
if (usr.stat || stat & (BROKEN|NOPOWER))
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["reset"])
src.reset()
else
@@ -1175,7 +1175,7 @@ table tr:first-child th:first-child { border: none;}
if(user.stat || stat & (NOPOWER|BROKEN))
return
user.machine = src
user.set_machine(src)
var/area/A = src.loc
var/d1
var/d2
@@ -1237,7 +1237,7 @@ table tr:first-child th:first-child { border: none;}
if (usr.stat || stat & (BROKEN|NOPOWER))
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
usr.set_machine(src)
if (href_list["reset"])
src.reset()
else

View File

@@ -88,7 +88,7 @@ obj/machinery/computer/general_air_control
attack_hand(mob/user)
user << browse(return_text(),"window=computer")
user.machine = src
user.set_machine(src)
onclose(user, "computer")
process()

View File

@@ -87,7 +87,7 @@
Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)

View File

@@ -159,6 +159,12 @@
healthcheck()
return
/obj/machinery/portable_atmospherics/canister/bullet_act(var/obj/item/projectile/Proj)
if(Proj.damage)
src.health -= round(Proj.damage / 2)
healthcheck()
..()
/obj/machinery/portable_atmospherics/canister/meteorhit(var/obj/O as obj)
src.health = 0
healthcheck()
@@ -196,7 +202,7 @@
if (src.destroyed)
return
user.machine = src
user.set_machine(src)
var/holding_text
if(holding)
holding_text = {"<BR><B>Tank Pressure</B>: [holding.air_contents.return_pressure()] KPa<BR>
@@ -226,7 +232,7 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
return
if (((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))
usr.machine = src
usr.set_machine(src)
if(href_list["toggle"])
if (valve_open)
@@ -277,16 +283,6 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
return
return
/obj/machinery/portable_atmospherics/canister/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
if(Proj.flag == "bullet")
src.health = 0
spawn( 0 )
healthcheck()
return
..()
return
/obj/machinery/portable_atmospherics/canister/toxins/New()
..()

View File

@@ -82,7 +82,7 @@
/obj/machinery/portable_atmospherics/pump/attack_hand(var/mob/user as mob)
user.machine = src
user.set_machine(src)
var/holding_text
if(holding)
@@ -112,7 +112,7 @@ Target Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?src
return
if (((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))
usr.machine = src
usr.set_machine(src)
if(href_list["power"])
on = !on

View File

@@ -143,7 +143,7 @@
/obj/machinery/portable_atmospherics/scrubber/attack_hand(var/mob/user as mob)
user.machine = src
user.set_machine(src)
var/holding_text
if(holding)
@@ -172,7 +172,7 @@ Power regulator: <A href='?src=\ref[src];volume_adj=-1000'>-</A> <A href='?src=\
return
if (((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))
usr.machine = src
usr.set_machine(src)
if(href_list["power"])
on = !on

View File

@@ -165,7 +165,7 @@ var/global/list/autolathe_recipes_hidden = list( \
del(src)
return 1
else
user.machine = src
user.set_machine(src)
interact(user)
return 1
@@ -219,14 +219,14 @@ var/global/list/autolathe_recipes_hidden = list( \
return src.attack_hand(user)
attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
interact(user)
Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
if (!busy)
if(href_list["make"])

View File

@@ -77,7 +77,7 @@
/obj/machinery/biogenerator/proc/interact(mob/user as mob)
if(stat & BROKEN)
return
user.machine = src
user.set_machine(src)
var/dat = "<TITLE>Biogenerator</TITLE>Biogenerator:<BR>"
if (processing)
dat += "<FONT COLOR=red>Biogenerator is processing! Please wait...</FONT>"
@@ -206,7 +206,7 @@
if(usr.stat || usr.restrained()) return
if(!in_range(src, usr)) return
usr.machine = src
usr.set_machine(src)
switch(href_list["action"])
if("activate")

View File

@@ -51,13 +51,6 @@
return
/obj/machinery/bot/attack_alien(var/mob/living/carbon/alien/user as mob)
/* Well, aliums dislike machines and do not want to caress them.
if (user.a_intent == "help")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [user] caresses [src.name] with its scythe like arm."), 1)
else
*/
src.health -= rand(15,30)*brute_dam_coeff
src.visible_message("\red <B>[user] has slashed [src]!</B>")
playsound(src.loc, 'sound/weapons/slice.ogg', 25, 1, -1)

View File

@@ -76,7 +76,7 @@
. = ..()
if (.)
return
usr.machine = src
usr.set_machine(src)
interact(user)
/obj/machinery/bot/cleanbot/proc/interact(mob/user as mob)
@@ -105,7 +105,7 @@ text("<A href='?src=\ref[src];operation=oddbutton'>[src.oddbutton ? "Yes" : "No"
/obj/machinery/bot/cleanbot/Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
switch(href_list["operation"])
if("start")

View File

@@ -150,7 +150,7 @@ Auto Patrol: []"},
/obj/machinery/bot/ed209/Topic(href, href_list)
if (..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
if(lasercolor && (istype(usr,/mob/living/carbon/human)))
var/mob/living/carbon/human/H = usr

View File

@@ -72,7 +72,7 @@
. = ..()
if (.)
return
usr.machine = src
usr.set_machine(src)
interact(user)
/obj/machinery/bot/floorbot/proc/interact(mob/user as mob)
@@ -131,7 +131,7 @@
/obj/machinery/bot/floorbot/Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
switch(href_list["operation"])
if("start")

View File

@@ -142,7 +142,7 @@
/obj/machinery/bot/medbot/Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
if ((href_list["power"]) && (src.allowed(usr)))
if (src.on)

View File

@@ -192,14 +192,14 @@
/obj/machinery/bot/mulebot/attack_ai(var/mob/user)
user.machine = src
user.set_machine(src)
interact(user, 1)
/obj/machinery/bot/mulebot/attack_hand(var/mob/user)
. = ..()
if (.)
return
user.machine = src
user.set_machine(src)
interact(user, 0)
/obj/machinery/bot/mulebot/proc/interact(var/mob/user, var/ai=0)
@@ -290,7 +290,7 @@
if (usr.stat)
return
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
switch(href_list["op"])
if("lock", "unlock")
@@ -309,10 +309,7 @@
return
else
return
usr << "You switch [on ? "on" : "off"] [src]."
for(var/mob/M in viewers(src))
if(M==usr) continue
M << "[usr] switches [on ? "on" : "off"] [src]."
visible_message("[usr] switches [on ? "on" : "off"] [src].")
updateDialog()
@@ -393,7 +390,7 @@
auto_pickup = !auto_pickup
if("close")
usr.machine = null
usr.unset_machine()
usr << browse(null,"window=mulebot")
@@ -432,7 +429,7 @@
//src.updateUsrDialog()
else
usr << browse(null, "window=mulebot")
usr.machine = null
usr.unset_machine()
return

View File

@@ -99,7 +99,7 @@
. = ..()
if(.)
return
usr.machine = src
usr.set_machine(src)
interact(user)
/obj/machinery/bot/secbot/proc/interact(mob/user as mob)
@@ -131,7 +131,7 @@ Auto Patrol: []"},
return
/obj/machinery/bot/secbot/Topic(href, href_list)
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
if((href_list["power"]) && (src.allowed(usr)))
if(src.on)
@@ -236,8 +236,7 @@ Auto Patrol: []"},
maxstuns--
if(maxstuns <= 0)
target = null
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src.target] has been stunned by [src]!</B>", 1, "\red You hear someone fall", 2)
visible_message("\red <B>[src.target] has been stunned by [src]!</B>")
mode = SECBOT_PREP_ARREST
src.anchored = 1
@@ -263,8 +262,7 @@ Auto Patrol: []"},
if(!src.target.handcuffed && !src.arrest_type)
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
mode = SECBOT_ARREST
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src] is trying to put handcuffs on [src.target]!</B>", 1)
visible_message("\red <B>[src] is trying to put handcuffs on [src.target]!</B>")
spawn(60)
if(get_dist(src, src.target) <= 1)

View File

@@ -66,7 +66,7 @@
if (istype(O.machine, /obj/machinery/computer/security))
var/obj/machinery/computer/security/S = O.machine
if (S.current == src)
O.machine = null
O.unset_machine()
O.reset_view(null)
O << "The screen bursts into static."
..()
@@ -95,9 +95,8 @@
if(!istype(user))
return
status = 0
for(var/mob/O in viewers(user, null))
O.show_message("<span class='warning'>\The [user] slashes at [src]!</span>", 1)
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
visible_message("<span class='warning'>\The [user] slashes at [src]!</span>")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
icon_state = "[initial(icon_state)]1"
add_hiddenprint(user)
deactivate(user,0)
@@ -169,9 +168,7 @@
spark_system.start()
playsound(loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(loc, "sparks", 50, 1)
for(var/mob/O in viewers(user, 3))
O.show_message(text("\blue The camera has been sliced apart by [] with an energy blade!", user), 1, text("\red You hear metal being sliced and sparks flying."), 2)
visible_message("\blue The camera has been sliced apart by [] with an energy blade!")
del(src)
else
..()
@@ -181,15 +178,13 @@
if(choice==1)
status = !( src.status )
if (!(src.status))
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [] has deactivated []!", user, src), 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
visible_message("\red [user] has deactivated [src]!")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
icon_state = "[initial(icon_state)]1"
add_hiddenprint(user)
else
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [] has reactivated []!", user, src), 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
visible_message("\red [user] has reactivated [src]!")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
icon_state = initial(icon_state)
add_hiddenprint(user)
// now disconnect anyone using the camera
@@ -199,7 +194,7 @@
if (istype(O.machine, /obj/machinery/computer/security))
var/obj/machinery/computer/security/S = O.machine
if (S.current == src)
O.machine = null
O.unset_machine()
O.reset_view(null)
O << "The screen bursts into static."

View File

@@ -102,7 +102,7 @@
if(!panel_open)
return
user.machine = src
user.set_machine(src)
var/t1 = text("<B>Access Panel</B><br>\n")
var/list/wires = list(
"Orange" = 1,
@@ -136,7 +136,7 @@
/obj/machinery/camera/Topic(href, href_list)
..()
if (in_range(src, usr) && istype(src.loc, /turf))
usr.machine = src
usr.set_machine(src)
if (href_list["wires"])
var/t1 = text2num(href_list["wires"])
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
@@ -158,7 +158,7 @@
src.pulse(t1)
else if (href_list["close2"])
usr << browse(null, "window=wires")
usr.machine = null
usr.unset_machine()
return

View File

@@ -20,7 +20,7 @@
if(..())
return
user.machine = src
user.set_machine(src)
var/dat
@@ -63,7 +63,7 @@
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if(href_list["emptycourt"])
target = locate(/area/holodeck/source_emptycourt)
@@ -236,8 +236,7 @@
if(!silent)
var/obj/oldobj = obj
for(var/mob/M in viewers(world.view,get_turf(obj)))
M << "The [oldobj.name] fades away!"
visible_message("The [oldobj.name] fades away!")
del(obj)
/obj/machinery/computer/HolodeckControl/proc/checkInteg(var/area/A)
@@ -402,9 +401,7 @@
return
G.affecting.loc = src.loc
G.affecting.Weaken(5)
for(var/mob/O in viewers(world.view, src))
if (O.client)
O << text("\red [] puts [] on the table.", G.assailant, G.affecting)
visible_message("\red [G.assailant] puts [G.affecting] on the table.")
del(W)
return
@@ -515,14 +512,12 @@
return
G.affecting.loc = src.loc
G.affecting.Weaken(5)
for(var/mob/M in viewers(src))
M.show_message("\red [G.assailant] dunks [G.affecting] into the [src]!", 3)
visible_message("\red [G.assailant] dunks [G.affecting] into the [src]!", 3)
del(W)
return
else if (istype(W, /obj/item) && get_dist(src,user)<2)
user.drop_item(src)
for(var/mob/M in viewers(src))
M.show_message("\blue [user] dunks [W] into the [src]!", 3)
visible_message("\blue [user] dunks [W] into the [src]!", 3)
return
/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -532,11 +527,9 @@
return
if(prob(50))
I.loc = src.loc
for(var/mob/M in viewers(src))
M.show_message("\blue Swish! \the [I] lands in \the [src].", 3)
visible_message("\blue Swish! \the [I] lands in \the [src].", 3)
else
for(var/mob/M in viewers(src))
M.show_message("\red \the [I] bounces off of \the [src]'s rim!", 3)
visible_message("\red \the [I] bounces off of \the [src]'s rim!", 3)
return 0
else
return ..(mover, target, height, air_group)

View File

@@ -33,11 +33,11 @@
/obj/machinery/computer/operating/proc/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user.unset_machine()
user << browse(null, "window=op")
return
user.machine = src
user.set_machine(src)
var/dat = "<HEAD><TITLE>Operating Computer</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
dat += "<A HREF='?src=\ref[user];mach_close=op'>Close</A><br><br>" //| <A HREF='?src=\ref[user];update=1'>Update</A>"
if(src.table && (src.table.check_victim()))
@@ -71,7 +71,7 @@
if(..())
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
return

View File

@@ -68,7 +68,7 @@
user << "\red <b>ERROR</b>: \black Remote access channel disabled."
return
user.machine = src
user.set_machine(src)
var/dat = "<h3>AI System Integrity Restorer</h3><br><br>"
if (src.occupant)

View File

@@ -61,7 +61,7 @@
/obj/machinery/computer/arcade/attack_hand(mob/user as mob)
if(..())
return
user.machine = src
user.set_machine(src)
var/dat = "<a href='byond://?src=\ref[src];close=1'>Close</a>"
dat += "<center><h4>[src.enemy_name]</h4></center>"
@@ -126,7 +126,7 @@
src.arcade_action()
if (href_list["close"])
usr.machine = null
usr.unset_machine()
usr << browse(null, "window=arcade")
else if (href_list["newgame"]) //Reset everything

View File

@@ -41,7 +41,7 @@
attack_hand(mob/user)
user << browse(return_text(),"window=computer")
user.machine = src
user.set_machine(src)
onclose(user, "computer")
process()

View File

@@ -34,7 +34,7 @@
if(stat & (NOPOWER|BROKEN)) return
if(!isAI(user))
user.machine = src
user.set_machine(src)
var/list/L = list()
for (var/obj/machinery/camera/C in cameranet.cameras)
@@ -50,13 +50,13 @@
var/t = input(user, "Which camera should you change to?") as null|anything in D
if(!t)
user.machine = null
user.unset_machine()
return 0
var/obj/machinery/camera/C = D[t]
if(t == "Cancel")
user.machine = null
user.unset_machine()
return 0
if(C)

View File

@@ -46,7 +46,7 @@
if(..())
return
user.machine = src
user.set_machine(src)
var/dat
if (!( ticker ))
return
@@ -171,7 +171,7 @@
/obj/machinery/computer/card/Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
switch(href_list["choice"])
if ("modify")
if (modify)

View File

@@ -155,7 +155,7 @@
return attack_hand(user)
/obj/machinery/computer/cloning/attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))

View File

@@ -44,10 +44,10 @@
/obj/machinery/computer/communications/Topic(href, href_list)
if(..())
return
if (src.z > 6)
if (src.z > 1)
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
return
usr.machine = src
usr.set_machine(src)
if(!href_list["operation"])
return
@@ -291,7 +291,7 @@
user << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
return
user.machine = src
user.set_machine(src)
var/dat = "<head><title>Communications Console</title></head><body>"
if (emergency_shuttle.online && emergency_shuttle.location==0)
var/timeleft = emergency_shuttle.timeleft()

View File

@@ -48,6 +48,11 @@
else
return
bullet_act(var/obj/item/projectile/Proj)
if(prob(Proj.damage))
set_broken()
..()
blob_act()
if (prob(75))

View File

@@ -46,7 +46,7 @@
return
if( href_list["close"] )
usr << browse(null, "window=crewcomp")
usr.machine = null
usr.unset_machine()
return
if(href_list["update"])
src.updateDialog()
@@ -57,10 +57,10 @@
interact(mob/user)
if( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if(!istype(user, /mob/living/silicon))
user.machine = null
user.unset_machine()
user << browse(null, "window=powcomp")
return
user.machine = src
user.set_machine(src)
src.scan()
var/t = "<TT><B>Crew Monitoring</B><HR>"
t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A> "

View File

@@ -46,7 +46,7 @@
/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob)
var/dat
user.machine = src
user.set_machine(src)
if (src.temp)
dat = text("[]<BR><BR><A href='?src=\ref[];temp=1'>Clear</A>", src.temp, src)
else

View File

@@ -125,7 +125,7 @@
if (!( data_core.medical.Find(src.active2) ))
src.active2 = null
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["temp"])
src.temp = null
if (href_list["scan"])

View File

@@ -118,7 +118,7 @@
return
var/dat = "<HTML><BODY><TT><B>[title]</B>"
user.machine = src
user.set_machine(src)
if(connected)
var/d2
if(timing) //door controls do not need timers.
@@ -162,7 +162,7 @@
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if(href_list["power"])
var/t = text2num(href_list["power"])
t = min(max(0.25, t), 16)

View File

@@ -72,12 +72,12 @@
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user.unset_machine()
user << browse(null, "window=powcomp")
return
user.machine = src
user.set_machine(src)
var/t = "<TT><B>Power Monitoring</B><HR>"
t += "<BR><HR><A href='?src=\ref[src];update=1'>Refresh</A>"
@@ -119,7 +119,7 @@
..()
if( href_list["close"] )
usr << browse(null, "window=powcomp")
usr.machine = null
usr.unset_machine()
return
if( href_list["update"] )
src.updateDialog()

View File

@@ -25,7 +25,7 @@
attack_hand(var/mob/user as mob)
if(..())
return
user.machine = src
user.set_machine(src)
var/dat
dat += "<B>Prisoner Implant Manager System</B><BR>"
if(screen == 0)
@@ -74,7 +74,7 @@
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if(href_list["inject1"])
var/obj/item/weapon/implant/I = locate(href_list["inject1"])

View File

@@ -72,7 +72,7 @@ var/prison_shuttle_timeleft = 0
return
if(..())
return
user.machine = src
user.set_machine(src)
post_signal("prison")
var/dat
if (src.temp)
@@ -93,7 +93,7 @@ var/prison_shuttle_timeleft = 0
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["sendtodock"])
if (!prison_can_move())

View File

@@ -31,7 +31,7 @@
if (src.z > 6)
user << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
return
user.machine = src
user.set_machine(src)
var/dat
if (src.temp)
dat = "<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
@@ -104,7 +104,7 @@
if(..())
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["eject"])
src.temp = {"Destroy Robots?<BR>

View File

@@ -201,7 +201,7 @@ What a mess.*/
if (!( data_core.security.Find(active2) ))
active2 = null
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
switch(href_list["choice"])
// SORTING!
if("Sorting")
@@ -265,7 +265,7 @@ What a mess.*/
return
Perp = new/list()
t1 = lowertext(t1)
var/list/components = dd_text2list(t1, " ")
var/list/components = text2list(t1, " ")
if(components.len > 5)
return //Lets not let them search too greedily.
for(var/datum/data/record/R in data_core.general)

View File

@@ -186,7 +186,7 @@ var/specops_shuttle_timeleft = 0
if(..())
return
user.machine = src
user.set_machine(src)
var/dat
if (temp)
dat = temp
@@ -205,7 +205,7 @@ var/specops_shuttle_timeleft = 0
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["sendtodock"])
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return

View File

@@ -24,7 +24,7 @@
proc/interact(mob/user)
usr.machine = src
usr.set_machine(src)
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
dat += "<A HREF='?src=\ref[user];mach_close=alerts'>Close</A><br><br>"
for (var/cat in src.alarms)

View File

@@ -153,7 +153,7 @@ var/bomb_set = 1
if(..())
return
user.machine = src
user.set_machine(src)
var/dat
if (src.temp)
dat = src.temp
@@ -172,7 +172,7 @@ var/bomb_set = 1
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["sendtospace"])
if(!syndicate_station_at_station|| syndicate_station_moving_to_station || syndicate_station_moving_to_space) return

View File

@@ -199,7 +199,7 @@ var/syndicate_elite_shuttle_timeleft = 0
if(..())
return
user.machine = src
user.set_machine(src)
var/dat
if (temp)
dat = temp
@@ -218,7 +218,7 @@ var/syndicate_elite_shuttle_timeleft = 0
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if (href_list["sendtodock"])
if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return

View File

@@ -63,7 +63,7 @@
return
/obj/machinery/atmospherics/unary/cryo_cell/attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
var/beaker_text = ""
var/health_text = ""
var/temp_text = ""
@@ -90,7 +90,7 @@
[beaker_text]<BR><BR>
<B>Current occupant:</B> [occupant ? "<BR>Name: [occupant]<BR>Health: [health_text]<BR>Oxygen deprivation: [round(occupant.getOxyLoss(),0.1)]<BR>Brute damage: [round(occupant.getBruteLoss(),0.1)]<BR>Fire damage: [round(occupant.getFireLoss(),0.1)]<BR>Toxin damage: [round(occupant.getToxLoss(),0.1)]<BR>Body temperature: [occupant.bodytemperature]" : "<FONT color=red>None</FONT>"]<BR>
"}
user.machine = src
user.set_machine(src)
user << browse(dat, "window=cryo")
onclose(user, "cryo")

View File

@@ -294,7 +294,6 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
napalm.temperature = 400+T0C
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(temperature, 400)
new/obj/structure/door_assembly/door_assembly_0( src.loc )
for(var/obj/structure/falsewall/plasma/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve
var/turf/T = get_turf(F)
T.ReplaceWithMineralWall("plasma")
@@ -304,6 +303,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
for(var/obj/machinery/door/airlock/plasma/D in range(3,src))
D.ignite(temperature/4)
new/obj/structure/door_assembly/door_assembly_0( src.loc )
del (src)
/obj/machinery/door/airlock/clown
@@ -679,7 +679,7 @@ About the new airlock wires panel:
user << "Airlock AI control has been blocked with a firewall. Unable to hack."
//Separate interface for the AI.
user.machine = src
user.set_machine(src)
var/t1 = text("<B>Airlock Control</B><br>\n")
if(src.secondsMainPowerLost > 0)
if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)))
@@ -851,20 +851,18 @@ About the new airlock wires panel:
if(H.getBrainLoss() >= 60)
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
if(!istype(H.head, /obj/item/clothing/head/helmet))
for(var/mob/M in viewers(src, null))
M << "\red [user] headbutts the airlock."
visible_message("\red [user] headbutts the airlock.")
var/datum/organ/external/affecting = H.get_organ("head")
H.Stun(8)
H.Weaken(5)
if(affecting.take_damage(10, 0))
H.UpdateDamageIcon()
else
for(var/mob/M in viewers(src, null))
M << "\red [user] headbutts the airlock. Good thing they're wearing a helmet."
visible_message("\red [user] headbutts the airlock. Good thing they're wearing a helmet.")
return
if(src.p_open)
user.machine = src
user.set_machine(src)
var/t1 = text("<B>Access Panel</B><br>\n")
//t1 += text("[]: ", airlockFeatureNames[airlockWireColorToIndex[9]])
@@ -917,11 +915,11 @@ About the new airlock wires panel:
if(href_list["close"])
usr << browse(null, "window=airlock")
if(usr.machine==src)
usr.machine = null
usr.unset_machine()
return
if((in_range(src, usr) && istype(src.loc, /turf)) && src.p_open)
usr.machine = src
usr.set_machine(src)
if(href_list["wires"])
var/t1 = text2num(href_list["wires"])
if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))

View File

@@ -132,7 +132,7 @@
return
var/second = round(timeleft() % 60)
var/minute = round((timeleft() - second) / 60)
user.machine = src
user.set_machine(src)
var/dat = "<HTML><BODY><TT>"
dat += "<HR>Timer System:</hr>"
dat += "<b>Door [src.id] controls</b><br/>"
@@ -169,7 +169,7 @@
if(!src.allowed(usr))
return
usr.machine = src
usr.set_machine(src)
if(href_list["timing"])
src.timing = text2num(href_list["timing"])
else

View File

@@ -122,19 +122,8 @@
src.operating = 0
return 1
//When an object is thrown at the window
/obj/machinery/door/window/hitby(AM as mob|obj)
..()
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>The glass door was hit by [AM].</B>", 1)
var/tforce = 0
if(ismob(AM))
tforce = 40
else
tforce = AM:throwforce
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
src.health = max(0, src.health - tforce)
/obj/machinery/door/window/proc/take_damage(var/damage)
src.health = max(0, src.health - damage)
if (src.health <= 0)
new /obj/item/weapon/shard(src.loc)
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src.loc)
@@ -142,6 +131,24 @@
src.density = 0
del(src)
return
/obj/machinery/door/window/bullet_act(var/obj/item/projectile/Proj)
if(Proj.damage)
take_damage(round(Proj.damage / 2))
..()
//When an object is thrown at the window
/obj/machinery/door/window/hitby(AM as mob|obj)
..()
visible_message("\red <B>The glass door was hit by [AM].</B>", 1)
var/tforce = 0
if(ismob(AM))
tforce = 40
else
tforce = AM:throwforce
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
take_damage(tforce)
//..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak
return
@@ -155,8 +162,7 @@
return
src.health = max(0, src.health - 25)
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[user] smashes against the [src.name].</B>", 1)
visible_message("\red <B>[user] smashes against the [src.name].</B>", 1)
if (src.health <= 0)
new /obj/item/weapon/shard(src.loc)
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src.loc)
@@ -185,9 +191,8 @@
spark_system.start()
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
for(var/mob/O in viewers(user, 5))
O.show_message(text("\blue The glass door was sliced open by []!", user), 1, text("\red You hear glass being sliced and sparks flying."), 2)
flick(text("[]spark", src.base_state), src)
visible_message("\blue The glass door was sliced open by [user]!")
flick("[src.base_state]spark", src)
sleep(6)
open()
return 1
@@ -198,8 +203,7 @@
if(I.damtype == BRUTE || I.damtype == BURN)
src.health = max(0, src.health - aforce)
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src] was hit by [I].</B>", 1)
visible_message("\red <B>[src] was hit by [I].</B>")
if (src.health <= 0)
new /obj/item/weapon/shard(src.loc)
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src.loc)

View File

@@ -29,7 +29,7 @@ obj/machinery/embedded_controller
attack_hand(mob/user)
user << browse(return_text(), "window=computer")
user.machine = src
user.set_machine(src)
onclose(user, "computer")
update_icon()
@@ -53,7 +53,7 @@ obj/machinery/embedded_controller
program.receive_user_command(href_list["command"])
spawn(5) program.process()
usr.machine = src
usr.set_machine(src)
spawn(5) src.updateDialog()
process()

View File

@@ -131,12 +131,10 @@
if(src.operating)
return
if(!src.occupant)
for(var/mob/M in viewers(src, null))
M.show_message("\red You hear a loud metallic grinding sound.", 1)
visible_message("\red You hear a loud metallic grinding sound.")
return
use_power(1000)
for(var/mob/M in viewers(src, null))
M.show_message("\red You hear a loud squelchy grinding sound.", 1)
visible_message("\red You hear a loud squelchy grinding sound.")
src.operating = 1
update_icon()
var/sourcename = src.occupant.real_name

View File

@@ -59,7 +59,7 @@
return 0
/obj/machinery/juicer/attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
interact(user)
/obj/machinery/juicer/proc/interact(mob/user as mob) // The microwave Menu
@@ -105,7 +105,7 @@
/obj/machinery/juicer/Topic(href, href_list)
if(..())
return
usr.machine = src
usr.set_machine(src)
switch(href_list["action"])
if ("juice")
juice()

View File

@@ -139,7 +139,7 @@
return 0
/obj/machinery/microwave/attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
interact(user)
/*******************
@@ -357,7 +357,7 @@
if(..())
return
usr.machine = src
usr.set_machine(src)
if(src.operating)
src.updateUsrDialog()
return

View File

@@ -82,7 +82,7 @@
return 0
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
user.machine = src
user.set_machine(src)
interact(user)
/*******************
@@ -115,7 +115,7 @@
if(..())
return
usr.machine = src
usr.set_machine(src)
var/N = href_list["vend"]

View File

@@ -249,7 +249,7 @@
attack_hand(mob/user as mob)
if(stat & (BROKEN|NOPOWER))
return
user.machine = src
user.set_machine(src)
var/dat = "<B>Magnetic Control Console</B><BR><BR>"
if(!autolink)
dat += {"
@@ -277,7 +277,7 @@
Topic(href, href_list)
if(stat & (BROKEN|NOPOWER))
return
usr.machine = src
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["radio-op"])

View File

@@ -39,7 +39,7 @@
codes = new()
var/list/entries = dd_text2list(codes_txt, ";") // entries are separated by semicolons
var/list/entries = text2list(codes_txt, ";") // entries are separated by semicolons
for(var/e in entries)
var/index = findtext(e, "=") // format is "key=value"
@@ -186,7 +186,7 @@ Transponder Codes:<UL>"}
return
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
if(open && !locked)
usr.machine = src
usr.set_machine(src)
if (href_list["freq"])
freq = sanitize_frequency(freq + text2num(href_list["freq"]))

View File

@@ -414,7 +414,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(..())
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
usr.set_machine(src)
if(href_list["set_channel_name"])
src.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
while (findtext(src.channel_name," ") == 1)
@@ -810,7 +810,7 @@ obj/item/weapon/newspaper/Topic(href, href_list)
var/mob/living/U = usr
..()
if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ))
U.machine = src
U.set_machine(src)
if(href_list["next_page"])
if(curr_page==src.pages+1)
return //Don't need that at all, but anyway.

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