Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
@@ -5,8 +5,8 @@
#define MC_AVERAGE_SLOW(average, current) (0.9 * (average) + 0.1 * (current))
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
#define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = 1;Processor.processing += Datum}
#define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = 0;Processor.processing -= Datum
#define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) Datum.isprocessing = 1;Processor.processing += Datum
#define STOP_PROCESSING(Processor, Datum) if (Datum.isprocessing) Datum.isprocessing = 0;Processor.processing -= Datum
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
@@ -46,4 +46,4 @@
//Timing subsystem
#define GLOBAL_PROC "some_magic_bullshit"
#define GLOBAL_PROC "some_magic_bullshit"
+1 -19
View File
@@ -14,7 +14,7 @@
#define BANTYPE_JOB_PERMA 3
#define BANTYPE_JOB_TEMP 4
#define BANTYPE_ANY_FULLBAN 5 //used to locate stuff to unban.
#define BANTYPE_APPEARANCE 6
#define BANTYPE_ADMIN_PERMA 7
#define BANTYPE_ADMIN_TEMP 8
#define BANTYPE_ANY_JOB 9 //used to remove jobbans
@@ -36,21 +36,3 @@
#define R_SPAWN 4096
#define R_MAXPERMISSION 4096 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
#define ADMIN_QUE(user) "(<a href='?_src_=holder;adminmoreinfo=\ref[user]'>?</a>)"
#define ADMIN_FLW(user) "(<a href='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</a>)"
#define ADMIN_PP(user) "(<a href='?_src_=holder;adminplayeropts=\ref[user]'>PP</a>)"
#define ADMIN_VV(atom) "(<a href='?_src_=vars;Vars=\ref[atom]'>VV</a>)"
#define ADMIN_SM(user) "(<a href='?_src_=holder;subtlemessage=\ref[user]'>SM</a>)"
#define ADMIN_TP(user) "(<a href='?_src_=holder;traitor=\ref[user]'>TP</a>)"
#define ADMIN_BSA(user) "(<a href='?_src_=holder;BlueSpaceArtillery=\ref[user]'>BSA</a>)"
#define ADMIN_CENTCOM_REPLY(user) "(<a href='?_src_=holder;CentcommReply=\ref[user]'>RPLY</a>)"
#define ADMIN_SYNDICATE_REPLY(user) "(<a href='?_src_=holder;SyndicateReply=\ref[user]'>RPLY</a>)"
#define ADMIN_SC(user) "(<a href='?_src_=holder;adminspawncookie=\ref[user]'>SC</a>)"
#define ADMIN_LOOKUP(user) "[key_name_admin(user)][ADMIN_QUE(user)]"
#define ADMIN_LOOKUPFLW(user) "[key_name_admin(user)][ADMIN_QUE(user)] [ADMIN_FLW(user)]"
#define ADMIN_SET_SD_CODE "(<a href='?_src_=holder;set_selfdestruct_code=1'>SETCODE</a>)"
#define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_QUE(user)] [ADMIN_PP(user)] [ADMIN_VV(user)] [ADMIN_SM(user)] [ADMIN_FLW(user)] [ADMIN_TP(user)]"
#define ADMIN_JMP(src) "(<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)"
#define COORD(src) "[src ? "([src.x],[src.y],[src.z])" : "nonexistent location"]"
#define ADMIN_COORDJMP(src) "[src ? "[COORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]"
-7
View File
@@ -163,10 +163,3 @@
#define TANK_MAX_RELEASE_PRESSURE (ONE_ATMOSPHERE*3)
#define TANK_MIN_RELEASE_PRESSURE 0
#define TANK_DEFAULT_RELEASE_PRESSURE 16
#define ATMOS_PASS_YES 1
#define ATMOS_PASS_NO 0
#define ATMOS_PASS_PROC -1 //ask CanAtmosPass()
#define ATMOS_PASS_DENSITY -2 //just check density
#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
-98
View File
@@ -1,98 +0,0 @@
//component id defines
#define BELLIGERENT_EYE "belligerent_eye"
#define VANGUARD_COGWHEEL "vanguard_cogwheel"
#define GEIS_CAPACITOR "geis_capacitor"
#define REPLICANT_ALLOY "replicant_alloy"
#define HIEROPHANT_ANSIBLE "hierophant_ansible"
var/global/clockwork_construction_value = 0 //The total value of all structures built by the clockwork cult
var/global/clockwork_caches = 0 //How many clockwork caches exist in the world (not each individual)
var/global/clockwork_daemons = 0 //How many daemons exist in the world
var/global/list/clockwork_generals_invoked = list("nezbere" = FALSE, "sevtug" = FALSE, "nzcrentr" = FALSE, "inath-neq" = FALSE) //How many generals have been recently invoked
var/global/list/all_clockwork_objects = list() //All clockwork items, structures, and effects in existence
var/global/list/all_clockwork_mobs = list() //All clockwork SERVANTS (not creatures) in existence
var/global/list/clockwork_component_cache = list(BELLIGERENT_EYE = 0, VANGUARD_COGWHEEL = 0, GEIS_CAPACITOR = 0, REPLICANT_ALLOY = 0, HIEROPHANT_ANSIBLE = 0) //The pool of components that caches draw from
var/global/ratvar_awakens = 0 //If Ratvar has been summoned; not a boolean, for proper handling of multiple ratvars
var/global/clockwork_gateway_activated = FALSE //if a gateway to the celestial derelict has ever been successfully activated
var/global/list/all_scripture = list() //a list containing scripture instances; not used to track existing scripture
//Scripture tiers and requirements; peripherals should never be used
#define SCRIPTURE_PERIPHERAL "Peripheral"
#define SCRIPTURE_DRIVER "Driver"
#define SCRIPTURE_SCRIPT "Script"
#define SCRIPT_SERVANT_REQ 5
#define SCRIPT_CACHE_REQ 1
#define SCRIPTURE_APPLICATION "Application"
#define APPLICATION_SERVANT_REQ 8
#define APPLICATION_CACHE_REQ 3
#define APPLICATION_CV_REQ 100
#define SCRIPTURE_REVENANT "Revenant"
#define REVENANT_SERVANT_REQ 10
#define REVENANT_CACHE_REQ 4
#define REVENANT_CV_REQ 200
#define SCRIPTURE_JUDGEMENT "Judgement"
#define JUDGEMENT_SERVANT_REQ 12
#define JUDGEMENT_CACHE_REQ 5
#define JUDGEMENT_CV_REQ 300
//general component/cooldown things
#define SLAB_PRODUCTION_TIME 900 //how long(deciseconds) slabs require to produce a single component; defaults to 1 minute 30 seconds
#define SLAB_SERVANT_SLOWDOWN 300 //how much each servant above 5 slows down slab-based generation; defaults to 30 seconds per sevant
#define SLAB_SLOWDOWN_MAXIMUM 2700 //maximum slowdown from additional servants; defaults to 4 minutes 30 seconds
#define CACHE_PRODUCTION_TIME 900 //how long(deciseconds) caches require to produce a component; defaults to 1 minute 30 seconds
#define LOWER_PROB_PER_COMPONENT 10 //how much each component in the cache reduces the weight of getting another of that component type
#define MAX_COMPONENTS_BEFORE_RAND 10*LOWER_PROB_PER_COMPONENT //the number of each component, times LOWER_PROB_PER_COMPONENT, you need to have before component generation will become random
#define CLOCKWORK_GENERAL_COOLDOWN 3000 //how long clockwork generals go on cooldown after use, defaults to 5 minutes
//proselytizer defines
#define REPLICANT_ALLOY_UNIT 100 //how much each piece of replicant alloy gives in a clockwork proselytizer
#define REPLICANT_STANDARD REPLICANT_ALLOY_UNIT*0.2 //how much alloy is in anything else; doesn't matter as much as the following
#define REPLICANT_FLOOR REPLICANT_ALLOY_UNIT*0.1 //how much alloy is in a clockwork floor, determines the cost of clockwork floor production
#define REPLICANT_WALL_MINUS_FLOOR REPLICANT_ALLOY_UNIT*0.4 //amount of alloy in a clockwork wall, determines the cost of clockwork wall production
#define REPLICANT_GEAR REPLICANT_ALLOY_UNIT*0.3 //amount of alloy in a wall gear, minus the brass from the wall
#define REPLICANT_WALL_TOTAL REPLICANT_WALL_MINUS_FLOOR+REPLICANT_FLOOR //how much alloy is in a clockwork wall and the floor under it
#define REPLICANT_ROD REPLICANT_ALLOY_UNIT*0.01 //amount of replicant alloy in one rod
#define REPLICANT_METAL REPLICANT_ALLOY_UNIT*0.02 //amount of replicant alloy in one sheet of metal
#define REPLICANT_PLASTEEL REPLICANT_ALLOY_UNIT*0.05 //amount of replicant alloy in one sheet of plasteel
#define RATVAR_ALLOY_CHECK "ratvar?" //when passed into can_use_alloy(), converts it into a check for if ratvar has woken/the proselytizer is debug
//clockcult power defines
#define MIN_CLOCKCULT_POWER 50 //the minimum amount of power clockcult machines will handle gracefully
#define CLOCKCULT_POWER_TO_ALLOY_MULTIPLIER 0.04 //conversion rate for power -> alloy
#define CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER 25 //conversion rate for alloy -> power
#define REPLICANT_ALLOY_POWER REPLICANT_ALLOY_UNIT*CLOCKCULT_ALLOY_TO_POWER_MULTIPLIER //the amount of power you get from a single piece of replicant alloy
//Ark defines
#define GATEWAY_SUMMON_RATE 1 //the time amount the Gateway to the Celestial Derelict gets each process tick; defaults to 1 per tick
#define GATEWAY_REEBE_FOUND 119 //when progress is at or above this, the gateway finds reebe and begins drawing power
#define GATEWAY_RATVAR_COMING 239 //when progress is at or above this, ratvar has entered and is coming through the gateway
#define GATEWAY_RATVAR_ARRIVAL 300 //when progress is at or above this, game over ratvar's here everybody go home
//Objective defines
#define CLOCKCULT_GATEWAY "gateway"
#define CLOCKCULT_ESCAPE "escape"
#define CLOCKCULT_SILICONS "silicons"
+12 -31
View File
@@ -10,22 +10,20 @@
#define SLOT_ID 256
#define SLOT_BELT 512
#define SLOT_BACK 1024
#define SLOT_POCKET 2048 // this is to allow items with a w_class of WEIGHT_CLASS_NORMAL or WEIGHT_CLASS_BULKY to fit in pockets.
#define SLOT_DENYPOCKET 4096 // this is to deny items with a w_class of WEIGHT_CLASS_SMALL or WEIGHT_CLASS_TINY to fit in pockets.
#define SLOT_NECK 8192
#define SLOT_POCKET 2048 //this is to allow items with a w_class of 3 or 4 to fit in pockets.
#define SLOT_DENYPOCKET 4096 //this is to deny items with a w_class of 2 or 1 to fit in pockets.
//SLOTS
#define slot_back 1
#define slot_wear_mask 2
#define slot_handcuffed 3
#define slot_hands 4 //wherever you provide a slot for hands you provide slot_hands
//slot_hands as a slot will pick ANY available hand
#define slot_belt 5
#define slot_wear_id 6
#define slot_ears 7
#define slot_glasses 8
#define slot_gloves 9
#define slot_neck 10
#define slot_l_hand 4
#define slot_r_hand 5
#define slot_belt 6
#define slot_wear_id 7
#define slot_ears 8
#define slot_glasses 9
#define slot_gloves 10
#define slot_head 11
#define slot_shoes 12
#define slot_wear_suit 13
@@ -35,7 +33,7 @@
#define slot_s_store 17
#define slot_in_backpack 18
#define slot_legcuffed 19
#define slot_generic_dextrous_storage 20
#define slot_drone_storage 20
#define slots_amt 20 // Keep this up to date!
@@ -47,8 +45,6 @@
. = SLOT_BACK
if(slot_wear_mask)
. = SLOT_MASK
if(slot_neck)
. = SLOT_NECK
if(slot_belt)
. = SLOT_BELT
if(slot_wear_id)
@@ -82,7 +78,7 @@
#define HIDEFACE 128 // Whether we appear as unknown.
#define HIDEHAIR 256
#define HIDEFACIALHAIR 512
#define HIDENECK 1024
//Cant seem to find a mob bitflags area other than the powers one
@@ -102,8 +98,7 @@
#define HAND_LEFT 512
#define HAND_RIGHT 1024
#define HANDS 1536
#define NECK 2048
#define FULL_BODY 4095
#define FULL_BODY 2047
// bitflags for the percentual amount of protection a piece of clothing which covers the body part offers.
// Used with human/proc/get_heat_protection() and human/proc/get_cold_protection()
@@ -127,20 +122,6 @@
#define FEMALE_UNIFORM_FULL 1
#define FEMALE_UNIFORM_TOP 2
//flags for alternate styles: These are hard sprited so don't set this if you didn't put the effort it
#define NORMAL_STYLE 0
#define ALT_STYLE 1
#define DIGITIGRADE_STYLE 2
//flags for outfits that have mutantrace variants (try not to use this): Currently only needed if you're trying to add tight fitting bootyshorts
#define NO_MUTANTRACE_VARIATION 0
#define MUTANTRACE_VARIATION 1
#define NOT_DIGITIGRADE 0
#define FULL_DIGITIGRADE 1
#define SQUISHED_DIGITIGRADE 2
//flags for covering body parts
#define GLASSESCOVERSEYES 1
+3 -13
View File
@@ -69,22 +69,12 @@
#define UNARMED_ATTACK 2
#define PROJECTILE_ATTACK 3
#define THROWN_PROJECTILE_ATTACK 4
#define LEAP_ATTACK 5
//the define for visible message range in combat
#define COMBAT_MESSAGE_RANGE 3
//Gun Stuff
#define SAWN_INTACT 0
#define SAWN_OFF 1
#define WEAPON_DUAL_WIELD 0
#define WEAPON_LIGHT 1
#define WEAPON_MEDIUM 2
#define WEAPON_HEAVY 3
//Health Defines
#define HEALTH_THRESHOLD_CRIT 0
#define HEALTH_THRESHOLD_DEAD -100
#define WEAPON_LIGHT 0
#define WEAPON_MEDIUM 1
#define WEAPON_HEAVY 2
-28
View File
@@ -1,28 +0,0 @@
//Defines for construction states of various objects
//girder construction states
#define GIRDER_NORMAL 0
#define GIRDER_REINF_STRUTS 1
#define GIRDER_REINF 2
#define GIRDER_DISPLACED 3
#define GIRDER_DISASSEMBLED 4
//rwall construction states
#define INTACT 0
#define SUPPORT_LINES 1
#define COVER 2
#define CUT_COVER 3
#define BOLTS 4
#define SUPPORT_RODS 5
#define SHEATH 6
//default_unfasten_wrench() return defines
#define CANT_UNFASTEN 0
#define FAILED_UNFASTEN 1
#define SUCCESSFUL_UNFASTEN 2
//disposal unit mode defines, which do double time as the construction defines
#define PRESSURE_OFF 0
#define PRESSURE_ON 1
#define PRESSURE_MAXED 2
#define SCREWS_OUT -1
+1 -2
View File
@@ -15,8 +15,7 @@
#define BANE_TOOLBOX "toolbox"
#define OBLIGATION_FOOD "food"
#define OBLIGATION_FIDDLE "fiddle"
#define OBLIGATION_DANCEOFF "danceoff"
#define OBLIGATION_DRINK "drink"
#define OBLIGATION_GREET "greet"
#define OBLIGATION_PRESENCEKNOWN "presenceknown"
#define OBLIGATION_SAYNAME "sayname"
+27 -6
View File
@@ -34,8 +34,6 @@
//turf-only flags
#define NOJAUNT 1
#define UNUSED_TRANSIT_TURF 2
#define CAN_BE_DIRTY 4 //If a turf can be made dirty at roundstart. This is also used in areas.
/*
These defines are used specifically with the atom/pass_flags bitmask
@@ -49,12 +47,34 @@
#define PASSMOB 16
#define LETPASSTHROW 32
//flags for species
//Movement Types
#define IMMOBILE 0
#define GROUND 1
#define FLYING 2
#define MUTCOLORS 1
#define HAIR 2
#define FACEHAIR 3
#define EYECOLOR 4
#define LIPS 5
#define RESISTTEMP 6
#define RADIMMUNE 7
#define NOBREATH 8
#define NOGUNS 9
#define NOBLOOD 10
#define NOFIRE 11
#define VIRUSIMMUNE 12
#define PIERCEIMMUNE 13
#define NOTRANSSTING 14
#define MUTCOLORS_PARTSONLY 15 //Used if we want the mutant colour to be only used by mutant bodyparts. Don't combine this with MUTCOLORS, or it will be useless.
#define NODISMEMBER 16
#define NOHUNGER 17
#define NOCRITDAMAGE 18
#define NOZOMBIE 19
#define EASYDISMEMBER 20
#define EASYLIMBATTACHMENT 21
#define TOXINLOVER 22
#define MUTCOLORS2 23
#define MUTCOLORS3 24
#define FLYING 65536
/*
These defines are used specifically with the atom/movable/languages bitmask.
@@ -68,6 +88,7 @@
#define DRONE 32
#define SWARMER 64
#define RATVAR 128
#define YAUTJA 256
// Flags for reagents
#define REAGENT_NOREACT 1
+16 -54
View File
@@ -61,24 +61,23 @@
#define DNA_HAIR_COLOR_BLOCK 1
#define DNA_FACIAL_HAIR_COLOR_BLOCK 2
#define DNA_SKIN_TONE_BLOCK 3
#define DNA_EYE_COLOR_BLOCK 4
#define DNA_GENDER_BLOCK 5
#define DNA_FACIAL_HAIR_STYLE_BLOCK 6
#define DNA_HAIR_STYLE_BLOCK 7
#define DNA_EYE_COLOR_TWO_BLOCK 8
#define DNA_EYE_COLOR_SWITCH_BLOCK 9
#define DNA_EYE_COLOR_BLOCK 10
#define DNA_COLOR_ONE_BLOCK 11
#define DNA_COLOR_TWO_BLOCK 12
#define DNA_COLOR_THR_BLOCK 13
#define DNA_COLOR_SWITCH_BLOCK 14
#define DNA_EYE_COLOR_TWO_BLOCK 4
#define DNA_EYE_COLOR_SWITCH_BLOCK 5
#define DNA_EYE_COLOR_BLOCK 6
#define DNA_GENDER_BLOCK 7
#define DNA_FACIAL_HAIR_STYLE_BLOCK 8
#define DNA_HAIR_STYLE_BLOCK 9
#define DNA_COLOR_ONE_BLOCK 10
#define DNA_COLOR_TWO_BLOCK 11
#define DNA_COLOR_THR_BLOCK 12
#define DNA_COLOR_SWITCH_BLOCK 13
#define DNA_COLOR_SWITCH_MAX 7 //must be (2^(n+1))-1
#define DNA_COCK_BLOCK 15
#define DNA_MUTANTRACE_BLOCK 16
#define DNA_MUTANTTAIL_BLOCK 17
#define DNA_MUTANTWING_BLOCK 18
#define DNA_WINGCOLOR_BLOCK 19
//#define DNA_TAUR_BLOCK 20 //Taurs will be tails for now, easier - Pooj
#define DNA_COCK_BLOCK 14
#define DNA_MUTANTRACE_BLOCK 15
#define DNA_MUTANTTAIL_BLOCK 16
#define DNA_MUTANTWING_BLOCK 17
#define DNA_WINGCOLOR_BLOCK 18
#define DNA_TAUR_BLOCK 19
#define DNA_STRUC_ENZYMES_BLOCKS 19
#define DNA_UNIQUE_ENZYMES_LEN 32
@@ -98,14 +97,6 @@
#define ORGAN_ORGANIC 1
#define ORGAN_ROBOTIC 2
#define BODYPART_ORGANIC 1
#define BODYPART_ROBOTIC 2
#define MONKEY_BODYPART "monkey"
#define ALIEN_BODYPART "alien"
#define LARVA_BODYPART "larva"
#define DEVIL_BODYPART "devil"
//Nutrition levels for humans. No idea where else to put it
#define NUTRITION_LEVEL_FAT 600
#define NUTRITION_LEVEL_FULL 550
@@ -125,32 +116,3 @@
#define BLOOD_VOLUME_OKAY 336
#define BLOOD_VOLUME_BAD 224
#define BLOOD_VOLUME_SURVIVE 122
//species traits for mutantraces
#define MUTCOLORS 1
#define HAIR 2
#define FACEHAIR 3
#define EYECOLOR 4
#define LIPS 5
#define RESISTHOT 6
#define RESISTCOLD 7
#define RESISTPRESSURE 8
#define RADIMMUNE 9
#define NOBREATH 10
#define NOGUNS 11
#define NOBLOOD 12
#define NOFIRE 13
#define VIRUSIMMUNE 14
#define PIERCEIMMUNE 15
#define NOTRANSSTING 16
#define MUTCOLORS_PARTSONLY 17 //Used if we want the mutant colour to be only used by mutant bodyparts. Don't combine this with MUTCOLORS, or it will be useless.
#define NODISMEMBER 18
#define NOHUNGER 19
#define NOCRITDAMAGE 20
#define NOZOMBIE 21
#define EASYDISMEMBER 22
#define EASYLIMBATTACHMENT 23
#define TOXINLOVER 24
#define DIGITIGRADE 25 //Uses weird leg sprites. Optional for Lizards, required for ashwalkers. Don't give it to other races unless you make sprites for this (see human_parts_greyscale.dmi)
#define MUTCOLORS2 26
#define MUTCOLORS3 27
+10 -8
View File
@@ -30,14 +30,16 @@
#define ANTAG_HUD_OPS 8
#define ANTAG_HUD_WIZ 9
#define ANTAG_HUD_SHADOW 10
#define ANTAG_HUD_TRAITOR 11
#define ANTAG_HUD_NINJA 12
#define ANTAG_HUD_CHANGELING 13
#define ANTAG_HUD_ABDUCTOR 14
#define ANTAG_HUD_DEVIL 15
#define ANTAG_HUD_SINTOUCHED 16
#define ANTAG_HUD_SOULLESS 17
#define ANTAG_HUD_CLOCKWORK 18
#define ANTAG_HUD_HOG_BLUE 11
#define ANTAG_HUD_HOG_RED 12
#define ANTAG_HUD_TRAITOR 13
#define ANTAG_HUD_NINJA 14
#define ANTAG_HUD_CHANGELING 15
#define ANTAG_HUD_ABDUCTOR 16
#define ANTAG_HUD_DEVIL 17
#define ANTAG_HUD_SINTOUCHED 18
#define ANTAG_HUD_SOULLESS 19
#define ANTAG_HUD_CLOCKWORK 20
// Notification action types
#define NOTIFY_JUMP "jump"
+47 -72
View File
@@ -4,32 +4,13 @@
#define in_range(source, user) (get_dist(source, user) <= 1)
#define ismovableatom(A) (istype(A, /atom/movable))
#define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable
//Turfs
#define isopenturf(A) (istype(A, /turf/open))
#define isspaceturf(A) (istype(A, /turf/open/space))
#define isfloorturf(A) (istype(A, /turf/open/floor))
#define isclosedturf(A) (istype(A, /turf/closed))
#define iswallturf(A) (istype(A, /turf/closed/wall))
#define ismineralturf(A) (istype(A, /turf/closed/mineral))
//Mobs
#define isliving(A) (istype(A, /mob/living))
#define isbrain(A) (istype(A, /mob/living/brain))
//Carbon mobs
#define iscarbon(A) (istype(A, /mob/living/carbon))
// MOB HELPERS
#define ishuman(A) (istype(A, /mob/living/carbon/human))
//Human sub-species
// Human sub-species
#define isabductor(A) (is_species(A, /datum/species/abductor))
#define isgolem(A) (is_species(A, /datum/species/golem))
#define islizard(A) (is_species(A, /datum/species/lizard))
@@ -41,86 +22,80 @@
#define iszombie(A) (is_species(A, /datum/species/zombie))
#define ishumanbasic(A) (is_species(A, /datum/species/human))
//more carbon mobs
#define ismonkey(A) (istype(A, /mob/living/carbon/monkey))
#define isbrain(A) (istype(A, /mob/living/carbon/brain))//We didn't port the /mob/living/brain update, yet.
#define isalien(A) (istype(A, /mob/living/carbon/alien))
#define islarva(A) (istype(A, /mob/living/carbon/alien/larva))
#define isalienadult(A) (istype(A, /mob/living/carbon/alien/humanoid))
#define isdevil(A) (istype(A, /mob/living/carbon/true_devil))
//Silicon mobs
#define issilicon(A) (istype(A, /mob/living/silicon))
#define iscyborg(A) (istype(A, /mob/living/silicon/robot))
#define isAI(A) (istype(A, /mob/living/silicon/ai))
#define ispAI(A) (istype(A, /mob/living/silicon/pai))
//Simple animals
#define isanimal(A) (istype(A, /mob/living/simple_animal))
#define isrevenant(A) (istype(A, /mob/living/simple_animal/revenant))
#define isborer(A) (istype(A, /mob/living/simple_animal/borer))
#define isbot(A) (istype(A, /mob/living/simple_animal/bot))
#define iscrab(A) (istype(A, /mob/living/simple_animal/crab))
#define isshade(A) (istype(A, /mob/living/simple_animal/shade))
#define ismouse(A) (istype(A, /mob/living/simple_animal/mouse))
#define islarva(A) (istype(A, /mob/living/carbon/alien/larva))
#define isslime(A) (istype(A, /mob/living/simple_animal/slime))
#define isdrone(A) (istype(A, /mob/living/simple_animal/drone))
#define isrobot(A) (istype(A, /mob/living/silicon/robot))
#define iscat(A) (istype(A, /mob/living/simple_animal/pet/cat))
#define isdog(A) (istype(A, /mob/living/simple_animal/pet/dog))
#define isanimal(A) (istype(A, /mob/living/simple_animal))
#define iscorgi(A) (istype(A, /mob/living/simple_animal/pet/dog/corgi))
#define ishostile(A) (istype(A, /mob/living/simple_animal/hostile))
#define iscrab(A) (istype(A, /mob/living/simple_animal/crab))
#define iscat(A) (istype(A, /mob/living/simple_animal/pet/cat))
#define ismouse(A) (istype(A, /mob/living/simple_animal/mouse))
#define isconstruct(A) (istype(A, /mob/living/simple_animal/hostile/construct))
#define isclockmob(A) (istype(A, /mob/living/simple_animal/hostile/clockwork))
#define ismegafauna(A) (istype(A, /mob/living/simple_animal/hostile/megafauna))
#define isshade(A) (istype(A, /mob/living/simple_animal/shade))
#define isbear(A) (istype(A, /mob/living/simple_animal/hostile/bear))
#define iscarp(A) (istype(A, /mob/living/simple_animal/hostile/carp))
#define isswarmer(A) (istype(A, /mob/living/simple_animal/hostile/swarmer))
#define isguardian(A) (istype(A, /mob/living/simple_animal/hostile/guardian))
#define isclockmob(A) (istype(A, /mob/living/simple_animal/hostile/clockwork))
#define isconstruct(A) (istype(A, /mob/living/simple_animal/hostile/construct))
#define ismegafauna(A) (istype(A, /mob/living/simple_animal/hostile/megafauna))
#define isclown(A) (istype(A, /mob/living/simple_animal/hostile/retaliate/clown))
//Misc mobs
#define isAI(A) (istype(A, /mob/living/silicon/ai))
#define ispAI(A) (istype(A, /mob/living/silicon/pai))
#define iscarbon(A) (istype(A, /mob/living/carbon))
#define issilicon(A) (istype(A, /mob/living/silicon))
#define iscyborg(A) (istype(A, /mob/living/silicon/robot))
#define isliving(A) (istype(A, /mob/living))
#define isobserver(A) (istype(A, /mob/dead/observer))
#define isnewplayer(A) (istype(A, /mob/new_player))
#define isovermind(A) (istype(A, /mob/camera/blob))
//Objects
#define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs
#define isdrone(A) (istype(A, /mob/living/simple_animal/drone))
#define isswarmer(A) (istype(A, /mob/living/simple_animal/hostile/swarmer))
#define isguardian(A) (istype(A, /mob/living/simple_animal/hostile/guardian))
#define ishostile(A) (istype(A, /mob/living/simple_animal/hostile))
#define islimb(A) (istype(A, /obj/item/bodypart))
#define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable
#define isbot(A) (istype(A, /mob/living/simple_animal/bot))
#define isorgan(A) (istype(A, /obj/item/organ))
#define ismovableatom(A) (istype(A, /atom/movable))
#define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs
// ASSEMBLY HELPERS
//Assemblies
#define isassembly(O) (istype(O, /obj/item/device/assembly))
#define isigniter(O) (istype(O, /obj/item/device/assembly/igniter))
@@ -131,4 +106,4 @@
#define issignaler(O) (istype(O, /obj/item/device/assembly/signaler))
#define istimer(O) (istype(O, /obj/item/device/assembly/timer))
#define istimer(O) (istype(O, /obj/item/device/assembly/timer))
+9 -25
View File
@@ -1,16 +1,8 @@
//Defines for atom layers and planes
//Defines for atom layers
//KEEP THESE IN A NICE ACSCENDING ORDER, PLEASE
#define CLICKCATCHER_PLANE -99
#define PLANE_SPACE -95
#define PLANE_SPACE_PARALLAX -90
#define GAME_PLANE 0
//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define
#define MID_TURF_LAYER 2.02
#define HIGH_TURF_LAYER 2.03
#define ABOVE_OPEN_TURF_LAYER 2.04
#define ABOVE_OPEN_TURF_LAYER 2.01
#define CLOSED_TURF_LAYER 2.05
#define ABOVE_NORMAL_TURF_LAYER 2.08
#define LATTICE_LAYER 2.2
@@ -32,8 +24,7 @@
#define ABOVE_OBJ_LAYER 3.2
#define ABOVE_WINDOW_LAYER 3.3
#define SIGN_LAYER 3.4
#define NOT_HIGH_OBJ_LAYER 3.5
#define HIGH_OBJ_LAYER 3.6
#define HIGH_OBJ_LAYER 3.5
#define BELOW_MOB_LAYER 3.7
#define LYING_MOB_LAYER 3.8
@@ -54,20 +45,13 @@
#define AREA_LAYER 10
#define MASSIVE_OBJ_LAYER 11
#define POINT_LAYER 12
#define LIGHTING_PLANE 15
#define LIGHTING_LAYER 15
//HUD layer defines
#define FULLSCREEN_PLANE 18
#define FLASH_LAYER 18
#define FULLSCREEN_LAYER 18.1
#define UI_DAMAGE_LAYER 18.2
#define BLIND_LAYER 18.3
#define CRIT_LAYER 18.4
#define HUD_PLANE 19
#define FLASH_LAYER 17.9
#define FULLSCREEN_LAYER 18
#define UI_DAMAGE_LAYER 18.1
#define BLIND_LAYER 18.2
#define CRIT_LAYER 18.3
#define HUD_LAYER 19
#define ABOVE_HUD_PLANE 20
#define ABOVE_HUD_LAYER 20
#define ABOVE_HUD_LAYER 19.1
+77 -14
View File
@@ -1,16 +1,79 @@
//Arbitrary lighting related stuff
#define LIGHTING_CIRCULAR 1 //Comment this out to use old square lighting effects.
#define LIGHTING_CAP 10 //The lumcount level at which alpha is 0 and we're fully lit.
#define LIGHTING_CAP_FRAC (255/LIGHTING_CAP) //A precal'd variable we'll use in turf/redraw_lighting()
#define LIGHTING_ICON 'icons/effects/alphacolors.dmi'
#define LIGHTING_ICON_STATE ""
#define LIGHTING_TIME 2 //Time to do any lighting change. Actual number pulled out of my ass
#define LIGHTING_DARKEST_VISIBLE_ALPHA 250 //Anything darker than this is so dark, we'll just consider the whole tile unlit
#define LIGHTING_LUM_FOR_FULL_BRIGHT 6 //Anything who's lum is lower then this starts off less bright.
#define LIGHTING_MIN_RADIUS 4 //Lowest radius a light source can effect.
#define DYNAMIC_LIGHTING_DISABLED 0 //dynamic lighting disabled (area stays at full brightness)
#define DYNAMIC_LIGHTING_ENABLED 1 //dynamic lighting enabled
#define DYNAMIC_LIGHTING_IFSTARLIGHT 2 //dynamic lighting enabled only if starlight is.
#define IS_DYNAMIC_LIGHTING(A) ( A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT ? config.starlight : A.dynamic_lighting )
//different modes that lights can operate in
#define LIGHTING_REGULAR 1 //Apply all effects additively
#define LIGHTING_STARLIGHT 2 //Track all starlight but only apply brightest
//Bay lighting engine shit, not in /code/modules/lighting because BYOND is being shit about it
#define LIGHTING_INTERVAL 5 // frequency, in 1/10ths of a second, of the lighting process
#ifndef LIGHTING_INSTANT_UPDATES
#define LIGHTING_INTERVAL 5 // Frequency, in 1/10ths of a second, of the lighting process.
#include "../controllers/subsystem/lighting.dm"
#endif
#define LIGHTING_FALLOFF 1 // type of falloff to use for lighting; 1 for circular, 2 for square
#define LIGHTING_LAMBERTIAN 0 // use lambertian shading for light sources
#define LIGHTING_HEIGHT 1 // height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone
#define LIGHTING_ROUND_VALUE 1 / 128 //Value used to round lumcounts, values smaller than 1/255 don't matter (if they do, thanks sinking points), greater values will make lighting less precise, but in turn increase performance, VERY SLIGHTLY.
#define LIGHTING_ICON 'icons/effects/lighting_overlay.png' // icon used for lighting shading effects
#define LIGHTING_SOFT_THRESHOLD 0.05 // If the max of the lighting lumcounts of each spectrum drops below this, disable luminosity on the lighting overlays.
// If I were you I'd leave this alone.
#define LIGHTING_BASE_MATRIX \
list \
( \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
0, 0, 0, 1 \
) \
// Helpers so we can (more easily) control the colour matrices.
#define CL_MATRIX_RR 1
#define CL_MATRIX_RG 2
#define CL_MATRIX_RB 3
#define CL_MATRIX_RA 4
#define CL_MATRIX_GR 5
#define CL_MATRIX_GG 6
#define CL_MATRIX_GB 7
#define CL_MATRIX_GA 8
#define CL_MATRIX_BR 9
#define CL_MATRIX_BG 10
#define CL_MATRIX_BB 11
#define CL_MATRIX_BA 12
#define CL_MATRIX_AR 13
#define CL_MATRIX_AG 14
#define CL_MATRIX_AB 15
#define CL_MATRIX_AA 16
#define CL_MATRIX_CR 17
#define CL_MATRIX_CG 18
#define CL_MATRIX_CB 19
#define CL_MATRIX_CA 20
//Some defines to generalise colours used in lighting.
//Important note on colors. Colors can end up significantly different from the basic html picture, especially when saturated
#define LIGHT_COLOR_RED "#FA8282" //Warm but extremely diluted red. rgb(250, 130, 130)
#define LIGHT_COLOR_GREEN "#64C864" //Bright but quickly dissipating neon green. rgb(100, 200, 100)
#define LIGHT_COLOR_BLUE "#6496FA" //Cold, diluted blue. rgb(100, 150, 250)
#define LIGHT_COLOR_CYAN "#7DE1E1" //Diluted cyan. rgb(125, 225, 225)
#define LIGHT_COLOR_PINK "#E17DE1" //Diluted, mid-warmth pink. rgb(225, 125, 225)
#define LIGHT_COLOR_YELLOW "#E1E17D" //Dimmed yellow, leaning kaki. rgb(225, 225, 125)
#define LIGHT_COLOR_BROWN "#966432" //Clear brown, mostly dim. rgb(150, 100, 50)
#define LIGHT_COLOR_ORANGE "#FA9632" //Mostly pure orange. rgb(250, 150, 50)
//These ones aren't a direct colour like the ones above, because nothing would fit
#define LIGHT_COLOR_FIRE "#FAA019" //Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25)
#define LIGHT_COLOR_FLARE "#FA644B" //Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75)
#define LIGHT_COLOR_SLIME_LAMP "#AFC84B" //Weird color, between yellow and green, very slimy. rgb(175, 200, 75)
#define LIGHT_COLOR_TUNGSTEN "#FAE1AF" //Extremely diluted yellow, close to skin color (for some reason). rgb(250, 225, 175)
#define LIGHT_COLOR_HALOGEN "#F0FAFA" //Barely visible cyan-ish hue, as the doctor prescribed. rgb(240, 250, 250)
#define FOR_DVIEW(type, range, center, invis_flags) \
dview_mob.forceMove(center); \
dview_mob.see_invisible = invis_flags; \
for(type in view(range, dview_mob))
+1 -13
View File
@@ -21,16 +21,4 @@
#define AUTOLATHE 4 //Uses glass/metal only.
#define CRAFTLATHE 8 //Uses fuck if I know. For use eventually.
#define MECHFAB 16 //Remember, objects utilising this flag should have construction_time and construction_cost vars.
#define BIOGENERATOR 32 //Uses biomass
#define LIMBGROWER 64 //Uses synthetic flesh
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
#define MC_CPU "CPU"
#define MC_HDD "HDD"
#define MC_SDD "SDD"
#define MC_CARD "CARD"
#define MC_NET "NET"
#define MC_PRINT "PRINT"
#define MC_CELL "CELL"
#define MC_CHARGE "CHARGE"
#define MC_AI "AI"
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
+24 -161
View File
@@ -1,10 +1,3 @@
// Byond direction defines, because I want to put them somewhere.
// #define NORTH 1
// #define SOUTH 2
// #define EAST 4
// #define WEST 8
#define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day
#define JANUARY 1
@@ -27,7 +20,6 @@
#define EASTER "Easter"
#define HALLOWEEN "Halloween"
#define CHRISTMAS "Christmas"
#define FESTIVE_SEASON "Festive Season"
#define FRIDAY_13TH "Friday the 13th"
//Human Overlays Indexes/////////
@@ -47,14 +39,14 @@
#define GLASSES_LAYER 13
#define BELT_LAYER 12 //Possible make this an overlay of somethign required to wear a belt?
#define SUIT_STORE_LAYER 11
#define NECK_LAYER 10
#define BACK_LAYER 9
#define HAIR_LAYER 8 //TODO: make part of head layer?
#define FACEMASK_LAYER 7
#define HEAD_LAYER 6
#define HANDCUFF_LAYER 5
#define LEGCUFF_LAYER 4
#define HANDS_LAYER 3
#define BACK_LAYER 10
#define HAIR_LAYER 9 //TODO: make part of head layer?
#define FACEMASK_LAYER 8
#define HEAD_LAYER 7
#define HANDCUFF_LAYER 6
#define LEGCUFF_LAYER 5
#define L_HAND_LAYER 4
#define R_HAND_LAYER 3 //Having the two hands seperate seems rather silly, merge them together? It'll allow for code to be reused on mobs with arbitarily many hands
#define BODY_FRONT_LAYER 2
#define FIRE_LAYER 1 //If you're on fire
#define TOTAL_LAYERS 26 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
@@ -83,7 +75,8 @@
#define UNDER_HEAD_LAYER HEAD_LAYER+1
#define UNDER_HANDCUFF_LAYER HANDCUFF_LAYER+1
#define UNDER_LEGCUFF_LAYER LEGCUFF_LAYER+1
#define UNDER_HANDS_LAYER HANDS_LAYER+1
#define UNDER_L_HAND_LAYER L_HAND_LAYER+1
#define UNDER_R_HAND_LAYER R_HAND_LAYER+1
#define UNDER_BODY_FRONT_LAYER BODY_FRONT_LAYER+1
#define UNDER_FIRE_LAYER FIRE_LAYER+1
@@ -109,7 +102,8 @@
#define ABOVE_HEAD_LAYER HEAD_LAYER-1
#define ABOVE_HANDCUFF_LAYER HANDCUFF_LAYER-1
#define ABOVE_LEGCUFF_LAYER LEGCUFF_LAYER-1
#define ABOVE_HANDS_LAYER HANDS_LAYER-1
#define ABOVE_L_HAND_LAYER L_HAND_LAYER-1
#define ABOVE_R_HAND_LAYER R_HAND_LAYER-1
#define ABOVE_BODY_FRONT_LAYER BODY_FRONT_LAYER-1
#define ABOVE_FIRE_LAYER FIRE_LAYER-1
@@ -151,7 +145,6 @@
#define CLICK_CD_MELEE 8
#define CLICK_CD_RANGE 4
#define CLICK_CD_RAPID 2
#define CLICK_CD_CLICK_ABILITY 6
#define CLICK_CD_BREAKOUT 100
#define CLICK_CD_HANDCUFFED 10
@@ -314,14 +307,6 @@ var/list/bloody_footprints_cache = list()
#define POLLTYPE_MULTI "MULTICHOICE"
#define POLLTYPE_IRV "IRV"
//lighting area defines
#define DYNAMIC_LIGHTING_DISABLED 0 //dynamic lighting disabled (area stays at full brightness)
#define DYNAMIC_LIGHTING_ENABLED 1 //dynamic lighting enabled
#define DYNAMIC_LIGHTING_IFSTARLIGHT 2 //dynamic lighting enabled only if starlight is.
#define IS_DYNAMIC_LIGHTING(A) ( A.lighting_use_dynamic == DYNAMIC_LIGHTING_IFSTARLIGHT ? config.starlight : A.lighting_use_dynamic )
//subtypesof(), typesof() without the parent path
#define subtypesof(typepath) ( typesof(typepath) - typepath )
@@ -342,15 +327,12 @@ var/list/bloody_footprints_cache = list()
#define SENTIENCE_MINEBOT 4
#define SENTIENCE_BOSS 5
//Fire stuff, for burn_state
#define LAVA_PROOF -2
#define FIRE_PROOF -1
#define FLAMMABLE 0
#define ON_FIRE 1
//Fire and Acid stuff, for resistance_flags
#define LAVA_PROOF 1
#define FIRE_PROOF 2 //100% immune to fire damage (but not necessarily to lava or heat)
#define FLAMMABLE 4
#define ON_FIRE 8
#define UNACIDABLE 16 //acid can't even appear on it, let alone melt it.
#define ACID_PROOF 32 //acid stuck on it doesn't melt it.
#define INDESTRUCTIBLE 64 //doesn't take damage
//Ghost orbit types:
#define GHOST_ORBIT_CIRCLE "circle"
@@ -427,6 +409,12 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define TRIGGER_GUARD_NONE 0
#define TRIGGER_GUARD_NORMAL 1
// Plant types
#define PLANT_NORMAL 0
#define PLANT_WEED 1
#define PLANT_MUSHROOM 2
#define PLANT_ALIEN 3
// Maploader bounds indices
#define MAP_MINX 1
#define MAP_MINY 2
@@ -440,9 +428,6 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
// Evil narsie colour
#define NARSIE_WINDOW_COLOUR "#7D1919"
//let's just pretend fulltile windows being children of border windows is fine
#define FULLTILE_WINDOW_DIR NORTHEAST
// Defib stats
#define DEFIB_TIME_LIMIT 120
#define DEFIB_TIME_LOSS 60
@@ -484,6 +469,7 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define STORAGE_VIEW_DEPTH 2
// Medal names
#define BOSS_KILL_MEDAL "Killer"
@@ -496,128 +482,5 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define COLOSSUS_SCORE "Colossus Killed"
#define BUBBLEGUM_SCORE "Bubblegum Killed"
#define DRAKE_SCORE "Drakes Killed"
#define BIRD_SCORE "Hierophants Killed"
#define SWARMER_BEACON_SCORE "Swarmer Beacons Killed"
#define BOSS_SCORE "Bosses Killed"
#define TENDRIL_CLEAR_SCORE "Tendrils Killed"
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
// NTNet transfer speeds, used when downloading/uploading a file/program.
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
// Program bitflags
#define PROGRAM_ALL 7
#define PROGRAM_CONSOLE 1
#define PROGRAM_LAPTOP 2
#define PROGRAM_TABLET 4
#define PROGRAM_STATE_KILLED 0
#define PROGRAM_STATE_BACKGROUND 1
#define PROGRAM_STATE_ACTIVE 2
// Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 300
#define MIN_NTNET_LOGS 10
//TODO Move to a pref
#define STATION_GOAL_BUDGET 1
//Luma coefficients suggested for HDTVs. If you change these, make sure they add up to 1.
#define LUMA_R 0.213
#define LUMA_G 0.715
#define LUMA_B 0.072
//attack visual effects
#define ATTACK_EFFECT_PUNCH "punch"
#define ATTACK_EFFECT_KICK "kick"
#define ATTACK_EFFECT_SMASH "smash"
#define ATTACK_EFFECT_CLAW "claw"
#define ATTACK_EFFECT_DISARM "disarm"
#define ATTACK_EFFECT_BITE "bite"
#define ATTACK_EFFECT_MECHFIRE "mech_fire"
#define ATTACK_EFFECT_MECHTOXIN "mech_toxin"
#define ATTACK_EFFECT_BOOP "boop" //Honk
//different types of atom colorations
#define ADMIN_COLOUR_PRIORITY 1 //only used by rare effects like greentext coloring mobs and when admins varedit color
#define TEMPORARY_COLOUR_PRIORITY 2 //e.g. purple effect of the revenant on a mob, black effect when mob electrocuted
#define WASHABLE_COLOUR_PRIORITY 3 //color splashed onto an atom (e.g. paint on turf)
#define FIXED_COLOUR_PRIORITY 4 //color inherent to the atom (e.g. blob color)
#define COLOUR_PRIORITY_AMOUNT 4 //how many priority levels there are.
// w_class (weight class)
#define WEIGHT_CLASS_TINY 1 // Usually items smaller then a human hand
#define WEIGHT_CLASS_SMALL 2 // Pockets can hold small and tiny items
#define WEIGHT_CLASS_NORMAL 3 // Standard backpacks can carry tiny, small & normal items
#define WEIGHT_CLASS_BULKY 4 // Items that can be weilded or equipped but not stored in an inventory
#define WEIGHT_CLASS_HUGE 5 // Usually represents objects that require two hands to operate
#define WEIGHT_CLASS_GIGANTIC 6 // Essentially means it cannot be picked up or placed in an inventory
// Examples of tiny items: Playing Cards, Lighter, Scalpel, Coins/Money
// Examples of small items: Flashlight, Multitool, Grenades, GPS Device
// Examples of normal items: Fire extinguisher, Stunbaton, Gas Mask, Metal Sheets
// Examples of bulky items: Defibrillator, Backpack, Space Suits
// Examples of huge items: Shotgun, Two Handed Melee Weapons
// Examples of gigantic items: Mech Parts, Safe
// m_intent
#define MOVE_INTENT_WALK "walk"
#define MOVE_INTENT_RUN "run"
//Endgame Results
#define NUKE_NEAR_MISS 1
#define NUKE_MISS_STATION 2
#define NUKE_SYNDICATE_BASE 3
#define STATION_DESTROYED_NUKE 4
#define STATION_EVACUATED 5
#define GANG_LOSS 6
#define GANG_TAKEOVER 7
#define BLOB_WIN 8
#define BLOB_NUKE 9
#define BLOB_DESTROYED 10
#define CULT_ESCAPE 11
#define CULT_FAILURE 12
#define CULT_SUMMON 13
#define NUKE_MISS 14
#define OPERATIVES_KILLED 15
#define OPERATIVE_SKIRMISH 16
#define REVS_WIN 17
#define REVS_LOSE 18
#define WIZARD_KILLED 19
#define STATION_NUKED 20
#define CLOCK_SUMMON 21
#define CLOCK_SILICONS 22
#define CLOCK_PROSELYTIZATION 23
#define SHUTTLE_HIJACK 24
//For SSTimer
#define TIMER_NORMAL "normal"
#define TIMER_UNIQUE "unique"
// Ventcrawling
#define VENTCRAWLER_NONE 0
#define VENTCRAWLER_NUDE 1
#define VENTCRAWLER_ALWAYS 2
// Intent
#define INTENT_HELP "help"
#define INTENT_GRAB "grab"
#define INTENT_DISARM "disarm"
#define INTENT_HARM "harm"
// NOTE: INTENT_HOTKEY_* defines are not actual intents!
// they are here to support hotkeys
#define INTENT_HOTKEY_LEFT "left"
#define INTENT_HOTKEY_RIGHT "right"
-7
View File
@@ -1,7 +0,0 @@
//I would rather have these in pinpointer.dm, but Malf_Modules.dm is loaded before that file so they need to be here.
#define TRACK_NUKE_DISK 1 //We track the nuclear authentication disk, either to protect it or steal it
#define TRACK_MALF_AI 2 //We track the malfunctioning AI, so we can prevent it from blowing us all up
#define TRACK_INFILTRATOR 3 //We track the Syndicate infiltrator, so we can get back to ship when the nuke's armed
#define TRACK_OPERATIVES 4 //We track the closest operative, so we can regroup when we need to
#define TRACK_ATOM 5 //We track a specified atom, so admins can make us function for events
#define TRACK_COORDINATES 6 //We point towards the specified coordinates on our z-level, so we can navigate
+1 -18
View File
@@ -38,21 +38,4 @@ Construction breaks otherwise
#define DISP_END_OUTLET 7
#define DISP_END_CHUTE 8
#define DISP_SORTJUNCTION 9
#define DISP_SORTJUNCTION_FLIP 10
//Transit tubes
#define TRANSIT_TUBE_STRAIGHT 0
#define TRANSIT_TUBE_STRAIGHT_CROSSING 1
#define TRANSIT_TUBE_CURVED 2
#define TRANSIT_TUBE_DIAGONAL 3
#define TRANSIT_TUBE_DIAGONAL_CROSSING 4
#define TRANSIT_TUBE_JUNCTION 5
#define TRANSIT_TUBE_STATION 6
#define TRANSIT_TUBE_TERMINUS 7
#define TRANSIT_TUBE_POD 8
//the open status of the transit tube station
#define STATION_TUBE_OPEN 0
#define STATION_TUBE_OPENING 1
#define STATION_TUBE_CLOSED 2
#define STATION_TUBE_CLOSING 3
#define DISP_SORTJUNCTION_FLIP 10
+2 -10
View File
@@ -28,15 +28,7 @@
#define CHAT_GHOSTWHISPER 128
#define CHAT_GHOSTPDA 256
#define CHAT_GHOSTRADIO 512
#define CHAT_LOOC 1024
#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO)
#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO|CHAT_LOOC)
#define PARALLAX_INSANE -1 //for show offs
#define PARALLAX_HIGH 0 //default.
#define PARALLAX_MED 1
#define PARALLAX_LOW 2
#define PARALLAX_DISABLE 3 //this option must be the highest number
#define PARALLAX_DELAY_DEFAULT world.tick_lag
#define PARALLAX_DELAY_MED 1
#define PARALLAX_DELAY_LOW 2
+1 -2
View File
@@ -12,5 +12,4 @@
//defines for the gc_destroyed var
#define GC_QUEUED_FOR_QUEUING -1
#define GC_QUEUED_FOR_HARD_DEL -2
#define GC_CURRENTLY_BEING_QDELETED -3
#define GC_QUEUED_FOR_HARD_DEL -2
+4 -7
View File
@@ -21,9 +21,10 @@
#define ROLE_GANG "gangster"
#define ROLE_ABDUCTOR "abductor"
#define ROLE_REVENANT "revenant"
#define ROLE_HOG_GOD "hand of god: god"
#define ROLE_HOG_CULTIST "hand of god: cultist"
#define ROLE_DEVIL "devil"
#define ROLE_SERVANT_OF_RATVAR "servant of Ratvar"
#define ROLE_BORER "borer"
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
@@ -44,12 +45,8 @@ var/global/list/special_roles = list(
ROLE_GANG = /datum/game_mode/gang,
ROLE_REVENANT,
ROLE_ABDUCTOR = /datum/game_mode/abduction,
ROLE_HOG_GOD = /datum/game_mode/hand_of_god,
ROLE_HOG_CULTIST = /datum/game_mode/hand_of_god,
ROLE_DEVIL = /datum/game_mode/devil,
ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult,
ROLE_BORER,
)
//Job defines for what happens when you fail to qualify for any job during job selection
#define BEASSISTANT 1
#define BERANDOMJOB 2
#define RETURNTOLOBBY 3
-1
View File
@@ -24,7 +24,6 @@
#define SPAN_PAPYRUS "papyrus"
#define SPAN_REALLYBIG "reallybig"
#define SPAN_COMMAND "command_headset"
#define SPAN_CLOWN "clown"
//bitflag #defines for return value of the radio() proc.
#define ITALICS 1
+7 -17
View File
@@ -1,19 +1,17 @@
//shuttle mode defines
#define SHUTTLE_IDLE "idle"
#define SHUTTLE_IGNITING "igniting"
#define SHUTTLE_RECALL "recall"
#define SHUTTLE_CALL "call"
#define SHUTTLE_DOCKED "docked"
#define SHUTTLE_STRANDED "stranded"
#define SHUTTLE_ESCAPE "escape"
#define SHUTTLE_ENDGAME "endgame: game over"
#define SHUTTLE_IDLE 0
#define SHUTTLE_RECALL 1
#define SHUTTLE_CALL 2
#define SHUTTLE_DOCKED 3
#define SHUTTLE_STRANDED 4
#define SHUTTLE_ESCAPE 5
#define SHUTTLE_ENDGAME 6
#define EMERGENCY_IDLE_OR_RECALLED (SSshuttle.emergency && ((SSshuttle.emergency.mode == SHUTTLE_IDLE) || (SSshuttle.emergency.mode == SHUTTLE_RECALL)))
#define EMERGENCY_ESCAPED_OR_ENDGAMED (SSshuttle.emergency && ((SSshuttle.emergency.mode == SHUTTLE_ESCAPE) || (SSshuttle.emergency.mode == SHUTTLE_ENDGAME)))
#define EMERGENCY_AT_LEAST_DOCKED (SSshuttle.emergency && SSshuttle.emergency.mode != SHUTTLE_IDLE && SSshuttle.emergency.mode != SHUTTLE_RECALL && SSshuttle.emergency.mode != SHUTTLE_CALL)
// Shuttle return values
#define SHUTTLE_CAN_DOCK "can_dock"
#define SHUTTLE_NOT_A_DOCKING_PORT "not_a_docking_port"
#define SHUTTLE_DWIDTH_TOO_LARGE "docking_width_too_large"
#define SHUTTLE_WIDTH_TOO_LARGE "width_too_large"
@@ -31,11 +29,3 @@
// Ripples, effects that signal a shuttle's arrival
#define SHUTTLE_RIPPLE_TIME 100
#define SHUTTLE_RIPPLE_FADEIN 50
#define TRANSIT_REQUEST 1
#define TRANSIT_READY 2
#define TRANSIT_FULL 3
#define SHUTTLE_TRANSIT_BORDER 8
#define PARALLAX_LOOP_TIME 25
-5
View File
@@ -24,8 +24,3 @@
#define POWEROFF 4 // tbd
#define MAINT 8 // under maintaince
#define EMPED 16 // temporary broken by EMP pulse
//ai power requirement defines
#define POWER_REQ_NONE 0
#define POWER_REQ_ALL 1
#define POWER_REQ_CLOCKCULT 2
-21
View File
@@ -1,21 +0,0 @@
//These are all the different status effects. Use the paths for each effect in the defines.
#define BASIC_STATUS_EFFECT /datum/status_effect //Has no effect.
///////////
// BUFFS //
///////////
#define STATUS_EFFECT_SHADOW_MEND /datum/status_effect/shadow_mend //Quick, powerful heal that deals damage afterwards. Heals 15 brute/burn every second for 3 seconds.
#define STATUS_EFFECT_VOID_PRICE /datum/status_effect/void_price //The price of healing yourself with void energy. Deals 3 brute damage every 3 seconds for 30 seconds.
#define STATUS_EFFECT_VANGUARD /datum/status_effect/vanguard_shield //Grants temporary stun absorption, but will stun the user based on how many stuns they absorbed.
#define STATUS_EFFECT_INATHNEQS_ENDOWMENT /datum/status_effect/inathneqs_endowment //A 15-second invulnerability and stun absorption, granted by Inath-neq.
#define STATUS_EFFECT_WRAITHSPECS /datum/status_effect/wraith_spectacles
#define STATUS_EFFECT_POWERREGEN /datum/status_effect/cyborg_power_regen //Regenerates power on a given cyborg over time
/////////////
// DEBUFFS //
/////////////
+2 -14
View File
@@ -3,18 +3,6 @@
#define CAT_WEAPON "Weaponry"
#define CAT_AMMO "Ammunition"
#define CAT_ROBOT "Robots"
#define CAT_FOOD "Food"
#define CAT_MISC "Misc"
#define CAT_PRIMAL "Tribal"
#define CAT_BREAD "Breads"
#define CAT_BURGER "Burgers"
#define CAT_CAKE "Cakes"
#define CAT_EGG "Egg-Based Food"
#define CAT_MEAT "Meats"
#define CAT_MISCFOOD "Misc. Food"
#define CAT_PASTRY "Pastries"
#define CAT_PIE "Pies"
#define CAT_PIZZA "Pizzas"
#define CAT_SALAD "Salads"
#define CAT_SANDWICH "Sandwiches"
#define CAT_SOUP "Soups"
#define CAT_SPAGHETTI "Spaghettis"
#define CAT_PRIMAL "Tribal"
+4 -4
View File
@@ -1,7 +1,7 @@
#define TICK_LIMIT_RUNNING 80
#define TICK_LIMIT_TO_RUN 78
#define TICK_LIMIT_MC 70
#define TICK_LIMIT_MC_INIT 98
#define TICK_LIMIT_RUNNING 85
#define TICK_LIMIT_TO_RUN 80
#define TICK_LIMIT_MC 84
#define TICK_LIMIT_MC_INIT 100
#define TICK_CHECK ( world.tick_usage > CURRENT_TICKLIMIT ? stoplag() : 0 )
#define CHECK_TICK if (world.tick_usage > CURRENT_TICKLIMIT) stoplag()
-8
View File
@@ -1,8 +0,0 @@
//Byond type ids
#define TYPEID_NULL "0"
#define TYPEID_NORMAL_LIST "f"
//helper macros
#define GET_TYPEID(ref) ( ( (lentext(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, lentext(ref)-6) ) )
#define IS_NORMAL_LIST(L) (GET_TYPEID("\ref[L]") == TYPEID_NORMAL_LIST)
-21
View File
@@ -1,21 +0,0 @@
#define VV_NUM "Number"
#define VV_TEXT "Text"
#define VV_MESSAGE "Mutiline Text"
#define VV_ICON "Icon"
#define VV_ATOM_REFERENCE "Atom Reference"
#define VV_DATUM_REFERENCE "Datum Reference"
#define VV_MOB_REFERENCE "Mob Reference"
#define VV_CLIENT "Client"
#define VV_ATOM_TYPE "Atom Typepath"
#define VV_DATUM_TYPE "Datum Typepath"
#define VV_TYPE "Custom Typepath"
#define VV_FILE "File"
#define VV_LIST "List"
#define VV_NEW_ATOM "New Atom"
#define VV_NEW_DATUM "New Datum"
#define VV_NEW_TYPE "New Custom Typepath"
#define VV_NEW_LIST "New List"
#define VV_NULL "NULL"
#define VV_RESTORE_DEFAULT "Restore to Default"
#define VV_MARKED_DATUM "Marked Datum"
+44 -45
View File
@@ -1,45 +1,44 @@
#define WIRE_DUD_PREFIX "__dud"
#define WIRE_ACTIVATE "Activate"
#define WIRE_AI "AI Connection"
#define WIRE_ALARM "Alarm"
#define WIRE_AVOIDANCE "Avoidance"
#define WIRE_BACKUP1 "Auxillary Power 1"
#define WIRE_BACKUP2 "Auxillary Power 2"
#define WIRE_BEACON "Beacon"
#define WIRE_BOLTS "Bolts"
#define WIRE_BOOM "Boom"
#define WIRE_CAMERA "Camera"
#define WIRE_CONTRABAND "Contraband"
#define WIRE_DELAY "Delay"
#define WIRE_DISABLE "Disable"
#define WIRE_DISARM "Disarm"
#define WIRE_HACK "Hack"
#define WIRE_IDSCAN "ID Scan"
#define WIRE_INTERFACE "Interface"
#define WIRE_LAWSYNC "AI Law Synchronization"
#define WIRE_LIGHT "Bolt Lights"
#define WIRE_LIMIT "Limiter"
#define WIRE_LOADCHECK "Load Check"
#define WIRE_LOCKDOWN "Lockdown"
#define WIRE_MOTOR1 "Motor 1"
#define WIRE_MOTOR2 "Motor 2"
#define WIRE_OPEN "Open"
#define WIRE_PANIC "Panic Siphon"
#define WIRE_POWER "Power"
#define WIRE_POWER1 "Main Power 1"
#define WIRE_POWER2 "Main Power 2"
#define WIRE_PROCEED "Proceed"
#define WIRE_RX "Recieve"
#define WIRE_RESET_MODULE "Reset Module"
#define WIRE_SAFETY "Safety"
#define WIRE_SHOCK "High Voltage Ground"
#define WIRE_SIGNAL "Signal"
#define WIRE_SPEAKER "Speaker"
#define WIRE_STRENGTH "Strength"
#define WIRE_THROW "Throw"
#define WIRE_TIMING "Timing"
#define WIRE_TX "Transmit"
#define WIRE_UNBOLT "Unbolt"
#define WIRE_ZAP "High Voltage Circuit"
#define WIRE_ZAP1 "High Voltage Circuit 1"
#define WIRE_ZAP2 "High Voltage Circuit 2"
#define WIRE_ACTIVATE "activate"
#define WIRE_AI "ai"
#define WIRE_ALARM "alarm"
#define WIRE_AVOIDANCE "avoidance"
#define WIRE_BACKUP1 "backup1"
#define WIRE_BACKUP2 "backup2"
#define WIRE_BEACON "beacon"
#define WIRE_BOLTS "bolts"
#define WIRE_BOOM "boom"
#define WIRE_CAMERA "camera"
#define WIRE_CONTRABAND "contraband"
#define WIRE_DELAY "delay"
#define WIRE_DISABLE "disable"
#define WIRE_DISARM "disarm"
#define WIRE_ELECTRIFY "electrify"
#define WIRE_HACK "hack"
#define WIRE_IDSCAN "idscan"
#define WIRE_INTERFACE "interface"
#define WIRE_LAWSYNC "lawsync"
#define WIRE_LIGHT "light"
#define WIRE_LIMIT "limit"
#define WIRE_LOADCHECK "loadcheck"
#define WIRE_LOCKDOWN "lockdown"
#define WIRE_MOTOR1 "motor1"
#define WIRE_MOTOR2 "motor2"
#define WIRE_OPEN "open"
#define WIRE_PANIC "panic"
#define WIRE_POWER "power"
#define WIRE_POWER1 "power1"
#define WIRE_POWER2 "power2"
#define WIRE_PROCEED "proceed"
#define WIRE_RX "recieve"
#define WIRE_SAFETY "safety"
#define WIRE_SHOCK "shock"
#define WIRE_SIGNAL "signal"
#define WIRE_SPEAKER "speaker"
#define WIRE_STRENGTH "strength"
#define WIRE_THROW "throw"
#define WIRE_TIMING "timing"
#define WIRE_TX "transmit"
#define WIRE_UNBOLT "unbolt"
#define WIRE_ZAP "zap"
#define WIRE_ZAP1 "zap1"
#define WIRE_ZAP2 "zap2"
+1 -4
View File
@@ -22,7 +22,7 @@
/proc/log_adminsay(text)
if (config.log_adminchat)
log_admin("ASAY: [text]")
/proc/log_dsay(text)
if (config.log_adminchat)
log_admin("DSAY: [text]")
@@ -76,6 +76,3 @@
//reusing the PDA option because I really don't think news comments are worth a config option
diary << "\[[time_stamp()]]COMMENT: [text]"
/proc/log_chat(text)
if (config.log_pda)
diary << "\[[time_stamp()]]CHAT: [text]"
-2
View File
@@ -10,8 +10,6 @@
if(query.NextRow())
var/diff = text2num(query.item[1])
if(config.use_account_age_for_jobs)
player_age = max(0,diff) //So job code soesn't freak out if they are time traveling.
if(diff < YOUNG)
var/msg = "(IP: [address], ID: [computer_id]) is a new BYOND account made on [y]-[m]-[d]."
if(diff < 0)
+1 -4
View File
@@ -41,7 +41,4 @@ var/cmp_field = "name"
return a.priority - b.priority
/proc/cmp_clientcolour_priority(datum/client_colour/A, datum/client_colour/B)
return B.priority - A.priority
/proc/cmp_clockscripture_priority(datum/clockwork_scripture/A, datum/clockwork_scripture/B)
return initial(A.sort_priority) - initial(B.sort_priority)
return B.priority - A.priority
+6 -43
View File
@@ -13,17 +13,13 @@
for(A, A && !isarea(A), A=A.loc); //semicolon is for the empty statement
return A
/proc/get_area_name(atom/X)
var/area/Y = get_area(X)
return Y.name
/proc/get_area_master(O)
var/area/A = get_area(O)
if(A && A.master)
A = A.master
return A
/proc/get_area_by_name(N) //get area by its name
/proc/get_area_name(N) //get area by its name
for(var/area/A in world)
if(A.name == N)
return A
@@ -348,9 +344,9 @@
continue
else if(afk_check && M.client.is_afk())
continue
else if(human_check && !ishuman(M))
else if(human_check && !istype(M, /mob/living/carbon/human))
continue
else if(isnewplayer(M)) // exclude people in the lobby
else if(istype(M, /mob/new_player)) // exclude people in the lobby
continue
else if(isobserver(M)) // Ghosts are fine if they were playing once (didn't start as observers)
var/mob/dead/observer/O = M
@@ -397,14 +393,14 @@
return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)
/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_category = null)
/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300)
var/list/mob/dead/observer/candidates = list()
var/time_passed = world.time
if (!Question)
Question = "Would you like to be a special role?"
for(var/mob/dead/observer/G in player_list)
if(!G.key || !G.client || (ignore_category && poll_ignore[ignore_category] && G.ckey in poll_ignore[ignore_category]))
if(!G.key || !G.client)
continue
if(be_special_flag)
if(!(G.client.prefs) || !(be_special_flag in G.client.prefs.be_special))
@@ -417,7 +413,7 @@
continue
spawn(0)
G << 'sound/misc/notice2.ogg' //Alerting them to their consideration
switch(ignore_category ? askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time))
switch(askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time))
if(1)
G << "<span class='notice'>Choice registered: Yes.</span>"
if((world.time-time_passed)>poll_time)
@@ -427,12 +423,6 @@
candidates += G
if(2)
G << "<span class='danger'>Choice registered: No.</span>"
if(3)
var/list/L = poll_ignore[ignore_category]
if(!L)
poll_ignore[ignore_category] = list()
poll_ignore[ignore_category] += G.ckey
G << "<span class='danger'>Choice registered: Never for this round.</span>"
sleep(poll_time)
//Check all our candidates, to make sure they didn't log off during the wait period.
@@ -442,23 +432,6 @@
return candidates
/proc/pollCandidatesForMob(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, mob/M, ignore_category = null)
var/list/L = pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category)
if(!M || qdeleted(M) || !M.loc)
return list()
return L
/proc/pollCandidatesForMobs(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, list/mobs, ignore_category = null)
var/list/L = pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category)
var/i=1
for(var/v in mobs)
var/atom/A = v
if(!A || qdeleted(A) || !A.loc)
mobs.Cut(i,i+1)
else
++i
return L
/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
if(!G_found || !G_found.key)
return
@@ -471,13 +444,3 @@
new_character.key = G_found.key
return new_character
/proc/send_to_playing_players(thing) //sends a whatever to all playing players; use instead of world << where needed
for(var/M in player_list)
if(M && !isnewplayer(M))
M << thing
/proc/window_flash(var/client_or_usr)
if (!client_or_usr)
return
winset(client_or_usr, "mainwindow", "flash=5")
+6 -8
View File
@@ -13,23 +13,22 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, undershirt_list, undershirt_m, undershirt_f)
//socks
init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, socks_list)
//human mutant bodyparts
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, tails_list_human)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/human, animated_tails_list_human)
init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, ears_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, wings_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, wings_open_list)
//lizard bodyparts (blizzard intensifies)
init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, body_markings_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, tails_list_lizard)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/lizard, animated_tails_list_lizard)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, tails_list_human)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/human, animated_tails_list_human)
init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, snouts_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/horns, horns_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, ears_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, wings_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, wings_open_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, frills_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, spines_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/spines_animated, animated_spines_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, legs_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, r_wings_list,roundstart = TRUE)
//mammal bodyparts (fucking furries)
init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_body_markings, mam_body_markings_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_tails, mam_tails_list)
@@ -45,7 +44,6 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_tail, xeno_tail_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_dorsal, xeno_dorsal_list)
//Species
for(var/spath in subtypesof(/datum/species))
var/datum/species/S = new spath()
+48 -50
View File
@@ -108,39 +108,39 @@
return adjacencies
//do not use, use queue_smooth(atom)
/proc/smooth_icon(atom/A)
if(!A || !A.smooth || !A.z)
return
if(qdeleted(A))
return
if((A.smooth & SMOOTH_TRUE) || (A.smooth & SMOOTH_MORE))
var/adjacencies = calculate_adjacencies(A)
if(!A || !A.smooth)
return
spawn(0)
if((A.smooth & SMOOTH_TRUE) || (A.smooth & SMOOTH_MORE))
var/adjacencies = calculate_adjacencies(A)
if(A.smooth & SMOOTH_DIAGONAL)
A.diagonal_smooth(adjacencies)
else
cardinal_smooth(A, adjacencies)
if(A.smooth & SMOOTH_DIAGONAL)
A.diagonal_smooth(adjacencies)
else
cardinal_smooth(A, adjacencies)
/atom/proc/diagonal_smooth(adjacencies)
switch(adjacencies)
if(N_NORTH|N_WEST)
replace_smooth_overlays("d-se","d-se-0")
replace_smooth_overlays("d1-se-0","d2-se","d3-se","d4-se")
if(N_NORTH|N_EAST)
replace_smooth_overlays("d-sw","d-sw-0")
replace_smooth_overlays("d1-sw","d2-sw-0","d3-sw","d4-sw")
if(N_SOUTH|N_WEST)
replace_smooth_overlays("d-ne","d-ne-0")
replace_smooth_overlays("d1-ne","d2-ne","d3-ne-0","d4-ne")
if(N_SOUTH|N_EAST)
replace_smooth_overlays("d-nw","d-nw-0")
replace_smooth_overlays("d1-nw","d2-nw","d3-nw","d4-nw-0")
if(N_NORTH|N_WEST|N_NORTHWEST)
replace_smooth_overlays("d-se","d-se-1")
replace_smooth_overlays("d1-se-1","d2-se","d3-se","d4-se")
if(N_NORTH|N_EAST|N_NORTHEAST)
replace_smooth_overlays("d-sw","d-sw-1")
replace_smooth_overlays("d1-sw","d2-sw-1","d3-sw","d4-sw")
if(N_SOUTH|N_WEST|N_SOUTHWEST)
replace_smooth_overlays("d-ne","d-ne-1")
replace_smooth_overlays("d1-ne","d2-ne","d3-ne-1","d4-ne")
if(N_SOUTH|N_EAST|N_SOUTHEAST)
replace_smooth_overlays("d-nw","d-nw-1")
replace_smooth_overlays("d1-nw","d2-nw","d3-nw","d4-nw-1")
else
cardinal_smooth(src, adjacencies)
@@ -153,33 +153,25 @@
/turf/closed/wall/diagonal_smooth(adjacencies)
adjacencies = reverse_ndir(..())
if(adjacencies)
var/list/U = list()
underlays.Cut()
if(fixed_underlay)
if(fixed_underlay["space"])
var/image/I = image('icons/turf/space.dmi', SPACE_ICON_STATE, layer=TURF_LAYER)
I.plane = PLANE_SPACE
U += I
underlays += image('icons/turf/space.dmi', SPACE_ICON_STATE, layer=src.layer)
else
U += image(fixed_underlay["icon"], fixed_underlay["icon_state"], layer=TURF_LAYER)
underlays += image(fixed_underlay["icon"], fixed_underlay["icon_state"], layer=src.layer)
else
var/turf/T = get_step(src, turn(adjacencies, 180))
if(T && (T.density || T.smooth))
if(T && T.density)
T = get_step(src, turn(adjacencies, 135))
if(T && (T.density || T.smooth))
if(T && T.density)
T = get_step(src, turn(adjacencies, 225))
if(isspaceturf(T) && !istype(T, /turf/open/space/transit))
var/image/I = image('icons/turf/space.dmi', SPACE_ICON_STATE, layer=TURF_LAYER)
I.plane = PLANE_SPACE
U += I
if(istype(T, /turf/open/space))
underlays += image('icons/turf/space.dmi', SPACE_ICON_STATE, layer=src.layer)
else if(T && !T.density && !T.smooth)
U += T
else if(baseturf && !initial(baseturf.density) && !initial(baseturf.smooth))
U += image(initial(baseturf.icon), initial(baseturf.icon_state), layer=TURF_LAYER)
underlays += T
else
U += DEFAULT_UNDERLAY_IMAGE
underlays = U
underlays += DEFAULT_UNDERLAY_IMAGE
/proc/cardinal_smooth(atom/A, adjacencies)
//NW CORNER
@@ -234,31 +226,25 @@
else if(adjacencies & N_EAST)
se = "4-e"
var/list/New = list()
if(A.top_left_corner != nw)
A.overlays -= A.top_left_corner
A.top_left_corner = nw
New += nw
A.add_overlay(nw)
if(A.top_right_corner != ne)
A.overlays -= A.top_right_corner
A.top_right_corner = ne
New += ne
A.add_overlay(ne)
if(A.bottom_right_corner != sw)
A.overlays -= A.bottom_right_corner
A.bottom_right_corner = sw
New += sw
A.add_overlay(sw)
if(A.bottom_left_corner != se)
A.overlays -= A.bottom_left_corner
A.bottom_left_corner = se
New += se
if(New.len)
A.add_overlay(New)
A.add_overlay(se)
/proc/find_type_in_direction(atom/source, direction)
var/turf/target_turf = get_step(source, direction)
@@ -319,16 +305,14 @@
/atom/proc/replace_smooth_overlays(nw, ne, sw, se)
clear_smooth_overlays()
var/list/O = list()
top_left_corner = nw
O += nw
add_overlay(nw)
top_right_corner = ne
O += ne
add_overlay(ne)
bottom_left_corner = sw
O += sw
add_overlay(sw)
bottom_right_corner = se
O += se
add_overlay(O)
add_overlay(se)
/proc/reverse_ndir(ndir)
switch(ndir)
@@ -367,6 +351,19 @@
else
return 0
//SSicon_smooth
/proc/ss_smooth_icon(atom/A)
if(qdeleted(A))
return
if(!istype(A) || (A && !A.smooth))
return
if((A.smooth & SMOOTH_TRUE) || (A.smooth & SMOOTH_MORE))
var/adjacencies = calculate_adjacencies(A)
if(A.smooth & SMOOTH_DIAGONAL)
A.diagonal_smooth(adjacencies)
else
cardinal_smooth(A, adjacencies)
//SSicon_smooth
/proc/queue_smooth_neighbors(atom/A)
for(var/V in orange(1,A))
@@ -387,5 +384,6 @@
name = "smooth wall"
icon = 'icons/turf/smooth_wall.dmi'
icon_state = "smooth"
walltype = "shuttle"
smooth = SMOOTH_TRUE|SMOOTH_DIAGONAL|SMOOTH_BORDER
canSmoothWith = null
+3 -31
View File
@@ -199,7 +199,7 @@ mob
getFlatIcon(src)
Browse_Icon()
/obj/effect/overlayTest
obj/effect/overlayTest
icon = 'old_or_unused.dmi'
icon_state = "blue"
pixel_x = -24
@@ -948,8 +948,9 @@ var/global/list/friendly_animal_types = list()
overlays += priority_overlays
/atom/proc/add_overlay(image, priority = 0)
if(image in overlays)
return
var/list/new_overlays = overlays.Copy()
new_overlays -= image
if(priority)
if(!priority_overlays)
priority_overlays = list()
@@ -1006,32 +1007,3 @@ var/global/list/humanoid_icon_cache = list()
//Lame.
/image/proc/setDir(newdir)
dir = newdir
// Used to make the frozen item visuals for Freon.
var/list/freeze_item_icons = list()
/atom/proc/freeze_icon_index()
return "\ref[initial(icon)]-[initial(icon_state)]"
/obj/proc/make_frozen_visual()
if(!is_frozen && (initial(icon) && initial(icon_state)))
var/index = freeze_icon_index()
var/icon/IC
var/icon/P = freeze_item_icons[index]
if(!P)
P = new /icon
for(var/iconstate in icon_states(icon))
var/icon/O = new('icons/effects/freeze.dmi', "ice_cube")
IC = new(icon, iconstate)
O.Blend(IC, ICON_ADD)
P.Insert(O, iconstate)
freeze_item_icons[index] = P
icon = P
name = "frozen [name]"
is_frozen = TRUE
//Assumes already frozed
obj/proc/make_unfrozen()
icon = initial(icon)
name = replacetext(name, "frozen ", "")
is_frozen = FALSE
+7 -41
View File
@@ -104,8 +104,13 @@
//Removes any null entries from the list
/proc/listclearnulls(list/L)
var/list/N = new(L.len)
L -= N
if(istype(L))
var/i=1
for(var/thing in L)
if(thing != null)
++i
continue
L.Cut(i,i+1)
/*
* Returns list containing all the entries from first list that are not present in second.
@@ -223,30 +228,12 @@
return L
//same, but returns nothing and acts on list in place
/proc/shuffle_inplace(list/L)
if(!L)
return
for(var/i=1, i<L.len, ++i)
L.Swap(i,rand(i,L.len))
//Return a list with no duplicate entries
/proc/uniqueList(list/L)
. = list()
for(var/i in L)
. |= i
//same, but returns nothing and acts on list in place (also handles associated values properly)
/proc/uniqueList_inplace(list/L)
var/temp = L.Copy()
L.len = 0
for(var/key in temp)
if (isnum(key))
L |= key
else
L[key] = temp[key]
//for sorting clients or mobs by ckey
/proc/sortKey(list/L, order=1)
return sortTim(L, order >= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc)
@@ -405,26 +392,5 @@
if(islist(.[i]))
.[i] = .(.[i])
#if DM_VERSION > 512
#error Remie said that lummox was adding a way to get a lists
#error contents via list.values, if that is true remove this
#error otherwise, update the version and bug lummox
#elseif
//Flattens a keyed list into a list of it's contents
/proc/flatten_list(list/key_list)
if(!islist(key_list))
return null
. = list()
for(var/key in key_list)
. |= key_list[key]
//Picks from the list, with some safeties, and returns the "default" arg if it fails
#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default)
#define LAZYINITLIST(L) if (!L) L = list()
#define UNSETEMPTY(L) if (L && !L.len) L = null
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } }
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null)
#define LAZYLEN(L) length(L)
+1
View File
@@ -21,6 +21,7 @@ var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
return -round(-x / y) * y
#define Clamp(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) )
#define CLAMP01(x) (Clamp(x,0,1))
// cotangent
/proc/Cot(x)
+77 -82
View File
@@ -63,96 +63,91 @@
// Color matrices:
/* Documenting a couple of potentially useful color matrices here to inspire ideas
// Greyscale - indentical to saturation @ 0
list(LUMA_R,LUMA_R,LUMA_R,0, LUMA_G,LUMA_G,LUMA_G,0, LUMA_B,LUMA_B,LUMA_B,0, 0,0,0,1, 0,0,0,0)
//Luma coefficients suggested for HDTVs. If you change these, make sure they add up to 1.
#define LUMR 0.2126
#define LUMG 0.7152
#define LUMB 0.0722
// Color inversion
list(-1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,1, 1,1,1,0)
//Still need color matrix addition, negation, and multiplication.
// Sepiatone
list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0,0,0)
*/
//Returns an identity color matrix which does nothing
/proc/color_identity()
return list(1,0,0, 0,1,0, 0,0,1)
//Does nothing
/proc/color_matrix_identity()
return list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, 0,0,0,0)
//Adds/subtracts overall lightness
//0 is identity, 1 makes everything white, -1 makes everything black
/proc/color_matrix_lightness(power)
return list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, power,power,power,0)
//Changes distance hues have from grey while maintaining the overall lightness. Greys are unaffected.
//1 is identity, 0 is greyscale, >1 oversaturates colors
/proc/color_matrix_saturation(value)
var/inv = 1 - value
var/R = round(LUMA_R * inv, 0.001)
var/G = round(LUMA_G * inv, 0.001)
var/B = round(LUMA_B * inv, 0.001)
return list(R + value,R,R,0, G,G + value,G,0, B,B,B + value,0, 0,0,0,1, 0,0,0,0)
//Changes distance colors have from rgb(127,127,127) grey
//1 is identity. 0 makes everything grey >1 blows out colors and greys
/proc/color_matrix_contrast(value)
var/add = (1 - value) / 2
return list(value,0,0,0, 0,value,0,0, 0,0,value,0, 0,0,0,1, add,add,add,0)
//Moves all colors angle degrees around the color wheel while maintaining intensity of the color and not affecting greys
//0 is identity, 120 moves reds to greens, 240 moves reds to blues
/proc/color_matrix_rotate_hue(angle)
var/sin = sin(angle)
//Moves all colors angle degrees around the color wheel while maintaining intensity of the color and not affecting whites
//TODO: Need a version that only affects one color (ie shift red to blue but leave greens and blues alone)
/proc/color_rotation(angle)
if(angle == 0)
return color_identity()
angle = Clamp(angle, -180, 180)
var/cos = cos(angle)
var/cos_inv_third = 0.333*(1-cos)
var/sqrt3_sin = sqrt(3)*sin
var/sin = sin(angle)
var/constA = 0.143
var/constB = 0.140
var/constC = -0.283
return list(
round(cos+cos_inv_third, 0.001), round(cos_inv_third+sqrt3_sin, 0.001), round(cos_inv_third-sqrt3_sin, 0.001), 0,
round(cos_inv_third-sqrt3_sin, 0.001), round(cos+cos_inv_third, 0.001), round(cos_inv_third+sqrt3_sin, 0.001), 0,
round(cos_inv_third+sqrt3_sin, 0.001), round(cos_inv_third-sqrt3_sin, 0.001), round(cos+cos_inv_third, 0.001), 0,
0,0,0,1,
0,0,0,0)
LUMR + cos * (1-LUMR) + sin * -LUMR, LUMR + cos * -LUMR + sin * constA, LUMR + cos * -LUMR + sin * -(1-LUMR),
LUMG + cos * -LUMG + sin * -LUMG, LUMG + cos * (1-LUMG) + sin * constB, LUMG + cos * -LUMG + sin * LUMG,
LUMB + cos * -LUMB + sin * (1-LUMB), LUMB + cos * -LUMB + sin * constC, LUMB + cos * (1-LUMB) + sin * LUMB
)
//These next three rotate values about one axis only
//x is the red axis, y is the green axis, z is the blue axis.
/proc/color_matrix_rotate_x(angle)
var/sinval = round(sin(angle), 0.001); var/cosval = round(cos(angle), 0.001)
return list(1,0,0,0, 0,cosval,sinval,0, 0,-sinval,cosval,0, 0,0,0,1, 0,0,0,0)
//Makes everything brighter or darker without regard to existing color or brightness
/proc/color_brightness(power)
power = Clamp(power, -255, 255)
power = power/255
/proc/color_matrix_rotate_y(angle)
var/sinval = round(sin(angle), 0.001); var/cosval = round(cos(angle), 0.001)
return list(cosval,0,-sinval,0, 0,1,0,0, sinval,0,cosval,0, 0,0,0,1, 0,0,0,0)
return list(1,0,0, 0,1,0, 0,0,1, power,power,power)
/proc/color_matrix_rotate_z(angle)
var/sinval = round(sin(angle), 0.001); var/cosval = round(cos(angle), 0.001)
return list(cosval,sinval,0,0, -sinval,cosval,0,0, 0,0,1,0, 0,0,0,1, 0,0,0,0)
/var/list/delta_index = list(
0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11,
0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.20, 0.21, 0.22, 0.24,
0.25, 0.27, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42,
0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68,
0.71, 0.74, 0.77, 0.80, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98,
1.0, 1.06, 1.12, 1.18, 1.24, 1.30, 1.36, 1.42, 1.48, 1.54,
1.60, 1.66, 1.72, 1.78, 1.84, 1.90, 1.96, 2.0, 2.12, 2.25,
2.37, 2.50, 2.62, 2.75, 2.87, 3.0, 3.2, 3.4, 3.6, 3.8,
4.0, 4.3, 4.7, 4.9, 5.0, 5.5, 6.0, 6.5, 6.8, 7.0,
7.3, 7.5, 7.8, 8.0, 8.4, 8.7, 9.0, 9.4, 9.6, 9.8,
10.0)
//Exxagerates or removes brightness
/proc/color_contrast(value)
value = Clamp(value, -100, 100)
if(value == 0)
return color_identity()
//Returns a matrix addition of A with B
/proc/color_matrix_add(list/A, list/B)
if(!istype(A) || !istype(B))
return color_matrix_identity()
if(A.len != 20 || B.len != 20)
return color_matrix_identity()
var/list/output = list()
output.len = 20
for(var/value in 1 to 20)
output[value] = A[value] + B[value]
return output
var/x = 0
if (value < 0)
x = 127 + value / 100 * 127;
else
x = value % 1
if(x == 0)
x = delta_index[value]
else
x = delta_index[value] * (1-x) + delta_index[value+1] * x//use linear interpolation for more granularity.
x = x * 127 + 127
//Returns a matrix multiplication of A with B
/proc/color_matrix_multiply(list/A, list/B)
if(!istype(A) || !istype(B))
return color_matrix_identity()
if(A.len != 20 || B.len != 20)
return color_matrix_identity()
var/list/output = list()
output.len = 20
var/x = 1
var/y = 1
var/offset = 0
for(y in 1 to 5)
offset = (y-1)*4
for(x in 1 to 4)
output[offset+x] = round(A[offset+1]*B[x] + A[offset+2]*B[x+4] + A[offset+3]*B[x+8] + A[offset+4]*B[x+12]+(y==5?B[x+16]:0), 0.001)
return output
var/mult = x / 127
var/add = 0.5 * (127-x) / 255
return list(mult,0,0, 0,mult,0, 0,0,mult, add,add,add)
//Exxagerates or removes colors
/proc/color_saturation(value as num)
if(value == 0)
return color_identity()
value = Clamp(value, -100, 100)
if(value > 0)
value *= 3
var/x = 1 + value / 100
var/inv = 1 - x
var/R = LUMR * inv
var/G = LUMG * inv
var/B = LUMB * inv
return list(R + x,R,R, G,G + x,G, B,B,B + x)
#undef LUMR
#undef LUMG
#undef LUMB
+23 -64
View File
@@ -62,15 +62,13 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, frills_list)
if(!spines_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, spines_list)
if(!legs_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, legs_list)
if(!body_markings_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, body_markings_list)
if(!wings_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, wings_list)
//For now we will always return none for tail_human and ears.
return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail_lizard" = pick(tails_list_lizard), "tail_human" = "None", "wings" = "None", "snout" = pick(snouts_list), "horns" = pick(horns_list), "ears" = "None", "frills" = pick(frills_list), "spines" = pick(spines_list), "body_markings" = pick(body_markings_list), "legs" = "Normal Legs"))
return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail_lizard" = pick(tails_list_lizard), "tail_human" = "None", "wings" = "None", "snout" = pick(snouts_list), "horns" = pick(horns_list), "ears" = "None", "frills" = pick(frills_list), "spines" = pick(spines_list), "body_markings" = pick(body_markings_list)))
/proc/random_hair_style(gender)
switch(gender)
@@ -107,13 +105,6 @@
if(i != attempts_to_find_unique_name && !findname(.))
break
/proc/random_unique_plasmaman_name(attempts_to_find_unique_name=10)
for(var/i=1, i<=attempts_to_find_unique_name, i++)
. = capitalize(plasmaman_name())
if(i != attempts_to_find_unique_name && !findname(.))
break
/proc/random_skin_tone()
return pick(skin_tones)
@@ -133,6 +124,7 @@ var/list/skin_tones = list(
)
var/global/list/species_list[0]
var/global/list/whitelisted_species_list[0]
var/global/list/roundstart_species[0]
/proc/age2agedescription(age)
@@ -169,30 +161,24 @@ Proc for attack log creation, because really why not
*/
/proc/add_logs(mob/user, mob/target, what_done, object=null, addition=null)
var/newhealthtxt = ""
var/coordinates = ""
var/turf/attack_location = get_turf(target)
var/is_mob_user = user && typecache_mob[user.type]
var/is_mob_target = target && typecache_mob[target.type]
var/mob/living/living_target
if(attack_location)
coordinates = "([attack_location.x],[attack_location.y],[attack_location.z])"
if(target && isliving(target))
living_target = target
if(is_mob_user)
var/message = "\[[time_stamp()]\] <font color='red'>[user ? "[user.name][(user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has [what_done] [target ? "[target.name][(is_mob_target && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]</font>"
user.attack_log += message
var/mob/living/L = target
newhealthtxt = " (NEWHP: [L.health])"
if(user && ismob(user))
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]</font>")
if(user.mind)
user.mind.attack_log += message
if(is_mob_target)
var/message = "\[[time_stamp()]\] <font color='orange'>[target ? "[target.name][(target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has been [what_done] by [user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]</font>"
target.attack_log += message
user.mind.attack_log += text("\[[time_stamp()]\] <font color='red'>[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]</font>")
if(target && ismob(target))
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]</font>")
if(target.mind)
target.mind.attack_log += message
target.mind.attack_log += text("\[[time_stamp()]\] <font color='orange'>[target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]</font>")
log_attack("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]")
log_attack("[user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(is_mob_target && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]")
/proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1)
@@ -206,7 +192,7 @@ Proc for attack log creation, because really why not
var/target_loc = target.loc
var/holding = user.get_active_held_item()
var/holding = user.get_active_hand()
var/datum/progressbar/progbar
if (progress)
progbar = new(user, time, target)
@@ -228,7 +214,7 @@ Proc for attack log creation, because really why not
drifting = 0
user_loc = user.loc
if((!drifting && user.loc != user_loc) || target.loc != target_loc || user.get_active_held_item() != holding || user.incapacitated() || user.lying )
if((!drifting && user.loc != user_loc) || target.loc != target_loc || user.get_active_hand() != holding || user.incapacitated() || user.lying )
. = 0
break
if (progress)
@@ -248,7 +234,7 @@ Proc for attack log creation, because really why not
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/holding = user.get_active_held_item()
var/holding = user.get_active_hand()
var/holdingnull = 1 //User's hand started out empty, check for an empty hand
if(holding)
@@ -285,7 +271,7 @@ Proc for attack log creation, because really why not
if(!holding)
. = 0
break
if(user.get_active_held_item() != holding)
if(user.get_active_hand() != holding)
. = 0
break
if (progress)
@@ -306,7 +292,7 @@ Proc for attack log creation, because really why not
for(var/atom/target in targets)
originalloc[target] = target.loc
var/holding = user.get_active_held_item()
var/holding = user.get_active_hand()
var/datum/progressbar/progbar
if(progress)
progbar = new(user, time, targets[1])
@@ -330,7 +316,7 @@ Proc for attack log creation, because really why not
user_loc = user.loc
for(var/atom/target in targets)
if((!drifting && user_loc != user.loc) || originalloc[target] != target.loc || user.get_active_held_item() != holding || user.incapacitated() || user.lying )
if((!drifting && user_loc != user.loc) || originalloc[target] != target.loc || user.get_active_hand() != holding || user.incapacitated() || user.lying )
. = 0
break mainloop
if(progbar)
@@ -343,33 +329,6 @@ Proc for attack log creation, because really why not
if(H.dna && istype(H.dna.species, species_datum))
. = TRUE
/proc/spawn_atom_to_turf(spawn_type, target, amount, admin_spawn=FALSE)
var/turf/T = get_turf(target)
if(!T)
throw EXCEPTION("attempt to spawn atom type: [spawn_type] in nullspace")
for(var/j in 1 to amount)
var/atom/X = new spawn_type(T)
X.admin_spawned = admin_spawn
/proc/spawn_and_random_walk(spawn_type, target, amount, walk_chance=100, max_walk=3, always_max_walk=FALSE, admin_spawn=FALSE)
var/turf/T = get_turf(target)
var/step_count = 0
if(!T)
throw EXCEPTION("attempt to spawn atom type: [spawn_type] in nullspace")
for(var/j in 1 to amount)
var/atom/movable/X = new spawn_type(T)
X.admin_spawned = admin_spawn
if(always_max_walk || prob(walk_chance))
if(always_max_walk)
step_count = max_walk
else
step_count = rand(1, max_walk)
for(var/i in 1 to step_count)
step(X, pick(NORTH, SOUTH, EAST, WEST))
/proc/deadchat_broadcast(message, mob/follow_target=null, speaker_key=null, message_type=DEADCHAT_REGULAR)
for(var/mob/M in player_list)
@@ -382,7 +341,7 @@ Proc for attack log creation, because really why not
var/adminoverride = 0
if(M.client && M.client.holder && (prefs.chat_toggles & CHAT_DEAD))
adminoverride = 1
if(isnewplayer(M) && !adminoverride)
if(istype(M, /mob/new_player) && !adminoverride)
continue
if(M.stat != DEAD && !adminoverride)
continue
@@ -397,7 +356,7 @@ Proc for attack log creation, because really why not
if(prefs.toggles & DISABLE_ARRIVALRATTLE)
continue
if(isobserver(M) && follow_target)
if(istype(M, /mob/dead/observer) && follow_target)
var/link = FOLLOW_LINK(M, follow_target)
M << "[link] [message]"
else
+2 -4
View File
@@ -4,8 +4,6 @@
else
return "[pick(lizard_names_female)]-[pick(lizard_names_female)]"
/proc/plasmaman_name()
return "[pick(plasmaman_names)] \Roman[rand(1,99)]"
var/church_name = null
/proc/church_name()
@@ -102,7 +100,7 @@ var/religion_name = null
if(2)
new_station_name += pick(greek_letters)
if(3)
new_station_name += "\Roman[rand(1,99)]"
new_station_name += pick(roman_numerals)
if(4)
new_station_name += pick(phonetic_alphabet)
if(5)
@@ -172,7 +170,7 @@ var/syndicate_code_response//Code response for traitors.
var/safety[] = list(1,2,3)//Tells the proc which options to remove later on.
var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation")
var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island iced tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","wine","moonshine")
var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","wine","moonshine")
var/locations[] = teleportlocs.len ? teleportlocs : drinks//if null, defaults to drinks instead.
var/names[] = list()
-242
View File
@@ -1,242 +0,0 @@
//pronoun procs, for getting pronouns without using the text macros that only work in certain positions
//datums don't have gender, but most of their subtypes do!
/datum/proc/p_they(capitalized, temp_gender)
. = "it"
if(capitalized)
. = capitalize(.)
/datum/proc/p_their(capitalized, temp_gender)
. = "its"
if(capitalized)
. = capitalize(.)
/datum/proc/p_them(capitalized, temp_gender)
. = "it"
if(capitalized)
. = capitalize(.)
/datum/proc/p_have(temp_gender)
. = "has"
/datum/proc/p_are(temp_gender)
. = "is"
/datum/proc/p_were(temp_gender)
. = "was"
/datum/proc/p_do(temp_gender)
. = "does"
/datum/proc/p_theyve(capitalized, temp_gender)
. = p_they(capitalized, temp_gender) + "'" + copytext(p_have(temp_gender), 3)
/datum/proc/p_theyre(capitalized, temp_gender)
. = p_they(capitalized, temp_gender) + "'" + copytext(p_are(temp_gender), 2)
/datum/proc/p_s(temp_gender) //is this a descriptive proc name, or what?
. = "s"
//like clients, which do have gender.
/client/p_they(capitalized, temp_gender)
if(!temp_gender)
temp_gender = gender
. = "they"
switch(temp_gender)
if(FEMALE)
. = "she"
if(MALE)
. = "he"
if(capitalized)
. = capitalize(.)
/client/p_their(capitalized, temp_gender)
if(!temp_gender)
temp_gender = gender
. = "their"
switch(temp_gender)
if(FEMALE)
. = "her"
if(MALE)
. = "his"
if(capitalized)
. = capitalize(.)
/client/p_them(capitalized, temp_gender)
if(!temp_gender)
temp_gender = gender
. = "them"
switch(temp_gender)
if(FEMALE)
. = "her"
if(MALE)
. = "him"
if(capitalized)
. = capitalize(.)
/client/p_have(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "has"
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "have"
/client/p_are(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "is"
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "are"
/client/p_were(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "was"
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "were"
/client/p_do(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "does"
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "do"
/client/p_s(temp_gender)
if(!temp_gender)
temp_gender = gender
if(temp_gender != PLURAL && temp_gender != NEUTER)
. = "s"
//mobs(and atoms but atoms don't really matter write your own proc overrides) also have gender!
/mob/p_they(capitalized, temp_gender)
if(!temp_gender)
temp_gender = gender
. = "it"
switch(temp_gender)
if(FEMALE)
. = "she"
if(MALE)
. = "he"
if(PLURAL)
. = "they"
if(capitalized)
. = capitalize(.)
/mob/p_their(capitalized, temp_gender)
if(!temp_gender)
temp_gender = gender
. = "its"
switch(temp_gender)
if(FEMALE)
. = "her"
if(MALE)
. = "his"
if(PLURAL)
. = "their"
if(capitalized)
. = capitalize(.)
/mob/p_them(capitalized, temp_gender)
if(!temp_gender)
temp_gender = gender
. = "it"
switch(temp_gender)
if(FEMALE)
. = "her"
if(MALE)
. = "him"
if(PLURAL)
. = "them"
if(capitalized)
. = capitalize(.)
/mob/p_have(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "has"
if(temp_gender == PLURAL)
. = "have"
/mob/p_are(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "is"
if(temp_gender == PLURAL)
. = "are"
/mob/p_were(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "was"
if(temp_gender == PLURAL)
. = "were"
/mob/p_do(temp_gender)
if(!temp_gender)
temp_gender = gender
. = "does"
if(temp_gender == PLURAL)
. = "do"
/mob/p_s(temp_gender)
if(!temp_gender)
temp_gender = gender
if(temp_gender != PLURAL)
. = "s"
//humans need special handling, because they can have their gender hidden
/mob/living/carbon/human/p_they(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_their(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_them(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_have(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_are(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_were(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_do(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_s(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((slot_w_uniform in obscured) && skipface)
temp_gender = PLURAL
return ..()
+54 -98
View File
@@ -421,110 +421,66 @@ var/list/binary = list("0","1")
return t
#define string2charlist(string) (splittext(string, regex("(.)")) - splittext(string, ""))
/proc/char_split(t)
. = list()
for(var/x in 1 to length(t))
. += copytext(t,x,x+1)
/proc/rot13(text = "")
var/list/textlist = string2charlist(text)
var/list/result = list()
for(var/c in textlist)
var/ca = text2ascii(c)
if(ca >= text2ascii("a") && ca <= text2ascii("m"))
ca += 13
else if(ca >= text2ascii("n") && ca <= text2ascii("z"))
ca -= 13
else if(ca >= text2ascii("A") && ca <= text2ascii("M"))
ca += 13
else if(ca >= text2ascii("N") && ca <= text2ascii("Z"))
ca -= 13
result += ascii2text(ca)
return jointext(result, "")
var/list/rot13_lookup = list()
//Takes a list of values, sanitizes it down for readability and character count,
//then exports it as a json file at data/npc_saves/[filename].json.
//As far as SS13 is concerned this is write only data. You can't change something
//in the json file and have it be reflected in the in game item/mob it came from.
//(That's what things like savefiles are for) Note that this list is not shuffled.
/proc/twitterize(list/proposed, filename, cullshort = 0, storemax = 1000)
if(!islist(proposed) || !filename || !config.log_twitter)
return
/proc/generate_rot13_lookup()
var/letters = alphabet.Copy()
for(var/c in alphabet)
letters += uppertext(c)
//Regular expressions are, as usual, absolute magic
var/regex/is_website = new("http|www.|\[a-z0-9_-]+.(com|org|net|mil|edu)+", "i")
var/regex/is_email = new("\[a-z0-9_-]+@\[a-z0-9_-]+.\[a-z0-9_-]+", "i")
var/regex/alphanumeric = new("\[a-z0-9]+", "i")
var/regex/punctuation = new("\[.!?]+", "i")
var/regex/all_invalid_symbols = new("\[^ -~]+")
for(var/char in letters)
var/ascii_char = text2ascii(char, 1)
var/list/accepted = list()
for(var/string in proposed)
if(findtext(string,is_website) || findtext(string,is_email) || findtext(string,all_invalid_symbols))
continue
var/buffer = ""
var/early_culling = TRUE
for(var/pos = 1, pos != lentext(string), pos++)
var/let = copytext(string, pos, (pos + 1) % lentext(string))
if(early_culling && !findtext(let,alphanumeric))
continue
early_culling = FALSE
buffer += let
var/punctbuffer = ""
var/cutoff = lentext(buffer)
for(var/pos = lentext(buffer), pos != 0, pos--)
var/let = copytext(buffer, pos, (pos + 1) % lentext(buffer))
if(findtext(let,alphanumeric))
break
if(findtext(let,punctuation))
punctbuffer = let + punctbuffer //Note this isn't the same thing as using +=
cutoff = pos
if(punctbuffer) //We clip down excessive punctuation to get the letter count lower and reduce repeats. It's not perfect but it helps.
var/exclaim = FALSE
var/question = FALSE
var/periods = 0
for(var/pos = lentext(punctbuffer), pos != 0, pos--)
var/punct = copytext(buffer, pos, (pos + 1) % lentext(buffer))
if(!exclaim && punct == "!")
exclaim = TRUE
if(!question && punct == "?")
question = TRUE
if(!exclaim && !question && punct == ".")
periods += 1
if(exclaim)
if(question)
punctbuffer = "?!"
else
punctbuffer = "!"
else if(question)
punctbuffer = "?"
else if(periods)
if(periods >= 3)
punctbuffer = "..."
else
punctbuffer = "" //Grammer nazis be damned
buffer = copytext(buffer, 1, cutoff) + punctbuffer
var/index
if(!buffer || lentext(buffer) > 140 || lentext(buffer) <= cullshort || buffer in accepted)
continue
switch(ascii_char)
// A - Z
if(65 to 90)
index = 65
// a - z
if(97 to 122)
index = 97
accepted += buffer
var/d = ascii_char - index
d += 13
if(d >= 26)
d -= 26
ascii_char = index + d
var/translated_char = ascii2text(ascii_char)
var/log = file("data/npc_saves/[filename].json") //If this line ever shows up as changed in a PR be very careful you aren't being memed on
var/list/oldjson = list()
var/list/oldentries = list()
if(fexists(log))
oldjson = json_decode(file2text(log))
oldentries = oldjson["data"]
if(!isemptylist(oldentries))
for(var/string in accepted)
for(var/old in oldentries)
if(string == old)
oldentries.Remove(old) //Line's position in line is "refreshed" until it falls off the in game radar
break
rot13_lookup[char] = translated_char
var/list/finalized = list()
finalized["data"] = accepted.Copy() + oldentries.Copy() //we keep old and unreferenced phrases near the bottom for culling
listclearnulls(finalized)
if(!isemptylist(finalized) && finalized.len > storemax)
finalized.Cut(storemax + 1)
fdel(log)
/proc/rot13(t_in)
if(!rot13_lookup.len)
generate_rot13_lookup()
log << json_encode(finalized)
var/t_out = ""
for(var/i in 1 to length(t_in))
var/char = copytext(t_in, i, i + 1)
if(char in rot13_lookup)
t_out += rot13_lookup[char]
else
t_out += char
return t_out
//Used in preferences' SetFlavorText and human's set_flavor verb
//Previews a string of len or less length
/proc/copytext_preserve_html(var/text, var/first, var/last)
return html_encode(copytext(html_decode(text), first, last))
proc/TextPreview(var/string,var/len=40)
if(lentext(string) <= len)
if(!lentext(string))
return "\[...\]"
else
return string
else
return "[copytext(string, 1, 37)]..."
-9
View File
@@ -7,12 +7,3 @@
t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+5)
index = findtext(t, char)
return t
proc/TextPreview(var/string,var/len=40)
if(lentext(string) <= len)
if(!lentext(string))
return "\[...\]"
else
return string
else
return "[copytext(string, 1, 37)]..."
+1 -1
View File
@@ -6,7 +6,7 @@
return time2text(world.timeofday, format)
/proc/gameTimestamp(format = "hh:mm:ss") // Get the game time in text
return time2text(world.time - timezoneOffset + 432000 - round_start_time, format)
return time2text(world.time - timezoneOffset + 432000, format)
/* Returns 1 if it is the selected month and day */
/proc/isDay(month, day)
+71 -21
View File
@@ -225,8 +225,6 @@
return 'icons/mob/screen_slimecore.dmi'
if("Operative")
return 'icons/mob/screen_operative.dmi'
if("Clockwork")
return 'icons/mob/screen_clockwork.dmi'
else
return 'icons/mob/screen_midnight.dmi'
@@ -349,6 +347,55 @@ for(var/t in test_times)
/proc/isLeap(y)
return ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
// A copy of text2dir, extended to accept one and two letter
// directions, and to clearly return 0 otherwise.
/proc/text2dir_extended(direction)
switch(uppertext(direction))
if("NORTH", "N")
return 1
if("SOUTH", "S")
return 2
if("EAST", "E")
return 4
if("WEST", "W")
return 8
if("NORTHEAST", "NE")
return 5
if("NORTHWEST", "NW")
return 9
if("SOUTHEAST", "SE")
return 6
if("SOUTHWEST", "SW")
return 10
else
return 0
// A copy of dir2text, which returns the short one or two letter
// directions used in tube icon states.
/proc/dir2text_short(direction)
switch(direction)
if(1)
return "N"
if(2)
return "S"
if(4)
return "E"
if(8)
return "W"
if(5)
return "NE"
if(6)
return "SE"
if(9)
return "NW"
if(10)
return "SW"
else
return
//Turns a Body_parts_covered bitfield into a list of organ/limb names.
@@ -527,23 +574,26 @@ for(var/t in test_times)
var/B = hex2num(copytext(A,6,0))
return R+G+B
//word of warning: using a matrix like this as a color value will simplify it back to a string after being set
/proc/color_hex2color_matrix(string)
var/length = length(string)
if(length != 7 && length != 9)
return color_matrix_identity()
var/r = hex2num(copytext(string, 2, 4))/255
var/g = hex2num(copytext(string, 4, 6))/255
var/b = hex2num(copytext(string, 6, 8))/255
var/a = 1
if(length == 9)
a = hex2num(copytext(string, 8, 10))/255
if(!isnum(r) || !isnum(g) || !isnum(b) || !isnum(a))
return color_matrix_identity()
return list(r,0,0,0, 0,g,0,0, 0,0,b,0, 0,0,0,a, 0,0,0,0)
//get just one color
/proc/GetRedPart(A)
return hex2num(copytext(A,2,4))
//will drop all values not on the diagonal
/proc/color_matrix2color_hex(list/the_matrix)
if(!istype(the_matrix) || the_matrix.len != 20)
return "#ffffffff"
return rgb(the_matrix[1]*255, the_matrix[6]*255, the_matrix[11]*255, the_matrix[16]*255)
/proc/GetGreenPart(A)
return hex2num(copytext(A,4,6))
/proc/GetBluePart(A)
return hex2num(copytext(A,6,0))
//Converts a positive interger to its roman numeral equivilent. Ignores any decimals.
//Numbers over 3999 will display with extra "M"s (don't tell the Romans) and can get comically long, so be careful.
/proc/num2roman(A)
var/list/values = list("M" = 1000, "CM" = 900, "D" = 500, "CD" = 400, "C" = 100, "XC" = 90, "L" = 50, "XL" = 40, "X" = 10, "IX" = 9, "V" = 5, "IV" = 4, "I" = 1)
if(!A || !isnum(A))
return 0
while(A >= 1)
for(var/i in values)
if(A >= values[i])
. += i
A -= values[i]
break
+204 -125
View File
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/*
* A large number of misc global procs.
@@ -337,7 +337,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
moblist.Add(M)
for(var/mob/living/carbon/human/M in sortmob)
moblist.Add(M)
for(var/mob/living/brain/M in sortmob)
for(var/mob/living/carbon/brain/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/alien/M in sortmob)
moblist.Add(M)
@@ -359,6 +359,41 @@ Turf and target are seperate in case you want to teleport some distance from a t
moblist.Add(M)
return moblist
/var/mob/dview/dview_mob = new
//Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).
/proc/dview(var/range = world.view, var/center, var/invis_flags = 0)
if(!center)
return
dview_mob.forceMove(center)
dview_mob.see_invisible = invis_flags
. = view(range, dview_mob)
dview_mob.forceMove(null)
/mob/dview
invisibility = 101
density = 0
see_in_dark = 1e6
anchored = 1
// Finds ALL mobs on turfs in line of sight. Similar to "in dview", but catches mobs that are not on a turf (e.g. inside a locker or such).
/proc/get_all_mobs_in_dview(var/turf/T, var/range = world.view, var/list/ignore_types = list())
. = list()
var/list/can_see = dview(range, T)
for(var/mob/M in can_see)
if(is_type_in_list(M, ignore_types))
continue
. += M
for(var/mob/M in mob_list) //Got the ones in vision, now let's go for the ones not on a turf.
if(M.z == 0) //Mobs not on a turf will have XYZ = 0,0,0. They also won't show up in dview() so we're not checking anything twice.
if(is_type_in_list(M, ignore_types))
continue
if(get_turf(M) in can_see) //Checking the mob's turf now, since those are it's "true" coordinates (plus dview() did pick up on turfs, so we can check using that).
. += M
//E = MC^2
/proc/convert2energy(M)
var/E = M*(SPEED_OF_LIGHT_SQ)
@@ -437,15 +472,12 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(M.ckey == key)
return M
//Returns the atom sitting on the turf.
//For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
//Optional arg 'type' to stop once it reaches a specific type instead of a turf.
/proc/get_atom_on_turf(atom/movable/M, stop_type)
// Returns the atom sitting on the turf.
// For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
/proc/get_atom_on_turf(atom/movable/M)
var/atom/loc = M
while(loc && loc.loc && !isturf(loc.loc))
while(loc && loc.loc && !istype(loc.loc, /turf/))
loc = loc.loc
if(stop_type && istype(loc, stop_type))
break
return loc
// returns the turf located at the map edge in the specified direction relative to A
@@ -499,6 +531,25 @@ Turf and target are seperate in case you want to teleport some distance from a t
var/y=arcsin(x/sqrt(1+x*x))
return y
/proc/anim(turf/location,target as mob|obj,a_icon,a_icon_state as text,flick_anim as text,sleeptime = 0,direction as num)
//This proc throws up either an icon or an animation for a specified amount of time.
//The variables should be apparent enough.
var/atom/movable/overlay/animation = new(location)
if(direction)
animation.setDir(direction)
animation.icon = a_icon
animation.layer = target:layer+1
if(a_icon_state)
animation.icon_state = a_icon_state
else
animation.icon_state = "blank"
animation.master = target
flick(flick_anim, animation)
sleep(max(sleeptime, 15))
qdel(animation)
/atom/proc/GetAllContents()
var/list/processing_list = list(src)
var/list/assembled = list()
@@ -608,60 +659,58 @@ Turf and target are seperate in case you want to teleport some distance from a t
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all areas of that type in the world.
/proc/get_areas(areatype, subtypes=TRUE)
/proc/get_areas(areatype)
if(!areatype)
return null
if(istext(areatype))
areatype = text2path(areatype)
else if(isarea(areatype))
if(isarea(areatype))
var/area/areatemp = areatype
areatype = areatemp.type
else if(!ispath(areatype))
return null
var/list/areas = list()
if(subtypes)
var/list/cache = typecacheof(areatype)
for(var/V in sortedAreas)
var/area/A = V
if(cache[A.type])
areas += V
else
for(var/V in sortedAreas)
var/area/A = V
if(A.type == areatype)
areas += V
var/list/areas = new/list()
for(var/area/N in world)
if(istype(N, areatype))
areas += N
return areas
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all turfs in areas of that type of that type in the world.
/proc/get_area_turfs(areatype, target_z = 0, subtypes=FALSE)
/proc/get_area_turfs(areatype, target_z = 0)
if(!areatype)
return null
if(istext(areatype))
areatype = text2path(areatype)
else if(isarea(areatype))
if(isarea(areatype))
var/area/areatemp = areatype
areatype = areatemp.type
else if(!ispath(areatype))
return null
var/list/turfs = list()
if(subtypes)
var/list/cache = typecacheof(areatype)
for(var/V in sortedAreas)
var/area/A = V
if(!cache[A.type])
continue
for(var/turf/T in A)
if(target_z == 0 || target_z == T.z)
turfs += T
else
for(var/V in sortedAreas)
var/area/A = V
if(A.type != areatype)
continue
for(var/turf/T in A)
var/list/turfs = new/list()
for(var/area/N in world)
if(istype(N, areatype))
for(var/turf/T in N)
if(target_z == 0 || target_z == T.z)
turfs += T
return turfs
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world.
/proc/get_area_all_atoms(areatype)
if(!areatype)
return null
if(istext(areatype))
areatype = text2path(areatype)
if(isarea(areatype))
var/area/areatemp = areatype
areatype = areatemp.type
var/list/atoms = new/list()
for(var/area/N in world)
if(istype(N, areatype))
for(var/atom/A in N)
atoms += A
return atoms
/proc/get_cardinal_dir(atom/A, atom/B)
var/dx = abs(B.x - A.x)
var/dy = abs(B.y - A.y)
@@ -708,18 +757,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
return zone
/*
Gets the turf this atom's *ICON* appears to inhabit
It takes into account:
* Pixel_x/y
* Matrix x/y
NOTE: if your atom has non-standard bounds then this proc
will handle it, but:
* if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked
(this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off)
* if the bounds are odd, the true middle turf of the atom is returned
*/
/proc/get_turf_pixel(atom/movable/AM)
@@ -798,24 +844,24 @@ var/global/list/common_tools = list(
//For objects that should embed, but make no sense being is_sharp or is_pointed()
//e.g: rods
var/list/can_embed_types = typecacheof(list(
/obj/item/stack/rods,
/obj/item/pipe))
/proc/can_embed(obj/item/W)
if(W.is_sharp())
return 1
if(is_pointed(W))
return 1
if(is_type_in_typecache(W, can_embed_types))
var/list/embed_items = list(\
/obj/item/stack/rods,\
)
if(is_type_in_list(W, embed_items))
return 1
/*
Checks if that loc and dir has a item on the wall
*/
var/list/WALLITEMS = typecacheof(list(
var/list/WALLITEMS = list(
/obj/machinery/power/apc, /obj/machinery/airalarm, /obj/item/device/radio/intercom,
/obj/structure/extinguisher_cabinet, /obj/structure/reagent_dispensers/peppertank,
/obj/machinery/status_display, /obj/machinery/requests_console, /obj/machinery/light_switch, /obj/structure/sign,
@@ -823,22 +869,22 @@ var/list/WALLITEMS = typecacheof(list(
/obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio/simple_vent_controller,
/obj/item/weapon/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth,
/obj/structure/mirror, /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment
))
)
var/list/WALLITEMS_EXTERNAL = typecacheof(list(
/obj/machinery/camera, /obj/structure/camera_assembly,
/obj/structure/light_construct, /obj/machinery/light))
var/list/WALLITEMS_EXTERNAL = list(
/obj/machinery/camera, /obj/machinery/camera_assembly,
/obj/machinery/light_construct, /obj/machinery/light)
var/list/WALLITEMS_INVERSE = typecacheof(list(
/obj/structure/light_construct, /obj/machinery/light))
var/list/WALLITEMS_INVERSE = list(
/obj/machinery/light_construct, /obj/machinery/light)
/proc/gotwallitem(loc, dir, var/check_external = 0)
var/locdir = get_step(loc, dir)
for(var/obj/O in loc)
if(is_type_in_typecache(O, WALLITEMS) && check_external != 2)
if(is_type_in_list(O, WALLITEMS) && check_external != 2)
//Direction works sometimes
if(is_type_in_typecache(O, WALLITEMS_INVERSE))
if(is_type_in_list(O, WALLITEMS_INVERSE))
if(O.dir == turn(dir, 180))
return 1
else if(O.dir == dir)
@@ -849,8 +895,8 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(
if(get_turf_pixel(O) == locdir)
return 1
if(is_type_in_typecache(O, WALLITEMS_EXTERNAL) && check_external)
if(is_type_in_typecache(O, WALLITEMS_INVERSE))
if(is_type_in_list(O, WALLITEMS_EXTERNAL) && check_external)
if(is_type_in_list(O, WALLITEMS_INVERSE))
if(O.dir == turn(dir, 180))
return 1
else if(O.dir == dir)
@@ -858,7 +904,7 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(
//Some stuff is placed directly on the wallturf (signs)
for(var/obj/O in locdir)
if(is_type_in_typecache(O, WALLITEMS) && check_external != 2)
if(is_type_in_list(O, WALLITEMS) && check_external != 2)
if(O.pixel_x == 0 && O.pixel_y == 0)
return 1
return 0
@@ -929,34 +975,33 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(
return "white"
/proc/params2turf(scr_loc, turf/origin)
if(!scr_loc)
return null
var/tX = splittext(scr_loc, ",")
var/tY = splittext(tX[2], ":")
var/tZ = origin.z
tY = tY[1]
tX = splittext(tX[1], ":")
tX = tX[1]
tX = Clamp(origin.x + text2num(tX) - world.view - 1, 1, world.maxx)
tY = Clamp(origin.y + text2num(tY) - world.view - 1, 1, world.maxy)
tX = max(1, min(world.maxx, origin.x + (text2num(tX) - (world.view + 1))))
tY = max(1, min(world.maxy, origin.y + (text2num(tY) - (world.view + 1))))
return locate(tX, tY, tZ)
/proc/screen_loc2turf(text, turf/origin)
if(!text)
return null
var/tZ = splittext(text, ",")
var/tX = splittext(tZ[1], "-")
var/tY = text2num(tX[2])
tX = splittext(tZ[2], "-")
tX = text2num(tX[2])
tZ = origin.z
tX = Clamp(origin.x + 7 - tX, 1, world.maxx)
tY = Clamp(origin.y + 7 - tY, 1, world.maxy)
tX = max(1, min(origin.x + 7 - tX, world.maxx))
tY = max(1, min(origin.y + 7 - tY, world.maxy))
return locate(tX, tY, tZ)
/proc/IsValidSrc(datum/D)
if(istype(D))
return !qdeleted(D)
/proc/IsValidSrc(A)
if(istype(A, /datum))
var/datum/B = A
return !qdeleted(B)
if(istype(A, /client))
return 1
return 0
@@ -978,7 +1023,7 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(
/proc/is_A_facing_B(atom/A,atom/B)
if(!istype(A) || !istype(B))
return 0
if(isliving(A))
if(istype(A, /mob/living))
var/mob/living/LA = A
if(LA.lying)
return 0
@@ -993,7 +1038,6 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(
/*
rough example of the "cone" made by the 3 dirs checked
B
\
\
@@ -1009,10 +1053,68 @@ B --><-- A
/
/
B
*/
//This is just so you can stop an orbit.
//orbit() can run without it (swap orbiting for A)
//but then you can never stop it and that's just silly.
/atom/movable/var/atom/orbiting = null
//A: atom to orbit
//radius: range to orbit at, radius of the circle formed by orbiting
//clockwise: whether you orbit clockwise or anti clockwise
//rotation_speed: how fast to rotate
//rotation_segments: the resolution of the orbit circle, less = a more block circle, this can be used to produce hexagons (6 segments) triangles (3 segments), and so on, 36 is the best default.
//pre_rotation: Chooses to rotate src 90 degress towards the orbit dir (clockwise/anticlockwise), useful for things to go "head first" like ghosts
//lockinorbit: Forces src to always be on A's turf, otherwise the orbit cancels when src gets too far away (eg: ghosts)
/atom/movable/proc/orbit(atom/A, radius = 10, clockwise = FALSE, rotation_speed = 20, rotation_segments = 36, pre_rotation = TRUE, lockinorbit = FALSE)
if(!istype(A))
return
if(orbiting)
stop_orbit()
orbiting = A
var/matrix/initial_transform = matrix(transform)
var/lastloc = loc
//Head first!
if(pre_rotation)
var/matrix/M = matrix(transform)
var/pre_rot = 90
if(!clockwise)
pre_rot = -90
M.Turn(pre_rot)
transform = M
var/matrix/shift = matrix(transform)
shift.Translate(0,radius)
transform = shift
SpinAnimation(rotation_speed, -1, clockwise, rotation_segments)
//we stack the orbits up client side, so we can assign this back to normal server side without it breaking the orbit
transform = initial_transform
while(orbiting && orbiting == A && A.loc)
var/targetloc = get_turf(A)
if(!lockinorbit && loc != lastloc && loc != targetloc)
break
loc = targetloc
lastloc = loc
stoplag()
if (orbiting == A) //make sure we haven't started orbiting something else.
orbiting = null
SpinAnimation(0,0)
/atom/movable/proc/stop_orbit()
orbiting = null
//Center's an image.
//Requires:
//The Image
@@ -1187,13 +1289,10 @@ B --><-- A
/proc/add_to_proximity_list(atom/A, range)
var/turf/T = get_turf(A)
if(!T || !A.loc)
throw EXCEPTION("Someone adding a prox sensor in nullspace")
var/list/L = block(locate(T.x - range, T.y - range, T.z), locate(T.x + range, T.y + range, T.z))
for(var/B in L)
var/turf/C = B
LAZYINITLIST(C.proximity_checkers)
C.proximity_checkers[A] = TRUE
C.proximity_checkers |= A
return L
/proc/remove_from_proximity_list(atom/A, range)
@@ -1201,11 +1300,7 @@ B --><-- A
var/list/L = block(locate(T.x - range, T.y - range, T.z), locate(T.x + range, T.y + range, T.z))
for(var/B in L)
var/turf/C = B
if (!C.proximity_checkers)
continue
C.proximity_checkers.Remove(A)
UNSETEMPTY(C.proximity_checkers)
/proc/shift_proximity(atom/checker, atom/A, range, atom/B, newrange)
var/turf/T = get_turf(A)
@@ -1218,14 +1313,10 @@ B --><-- A
var/list/O = M - L
for(var/C in N)
var/turf/D = C
if (!D.proximity_checkers)
continue
D.proximity_checkers.Remove(checker)
UNSETEMPTY(D.proximity_checkers)
for(var/E in O)
var/turf/F = E
LAZYINITLIST(F.proximity_checkers)
F.proximity_checkers[checker] = TRUE
F.proximity_checkers |= checker
return 1
/proc/flick_overlay_static(image/I, atom/A, duration)
@@ -1238,13 +1329,13 @@ B --><-- A
/proc/get_areas_in_z(zlevel)
. = list()
var/validarea = FALSE
var/validarea = 0
for(var/V in sortedAreas)
var/area/A = V
validarea = TRUE
validarea = 1
for(var/turf/T in A)
if(T.z != zlevel)
validarea = FALSE
validarea = 0
break
if(validarea)
. += A
@@ -1256,7 +1347,7 @@ B --><-- A
if(!istype(A, type))
continue
var/distance = get_dist(source, A)
if(!closest_atom)
if(!closest_distance)
closest_distance = distance
closest_atom = A
else
@@ -1265,14 +1356,9 @@ B --><-- A
closest_atom = A
return closest_atom
proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
if (value == FALSE) //nothing should be calling us with a number, so this is safe
value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text
if (isnull(value))
return
value = trim(value)
if(!isnull(value) && value != "")
proc/pick_closest_path(value)
var/list/matches = get_fancy_list_of_types()
if (!isnull(value) && value!="")
matches = filter_fancy_list(matches, value)
if(matches.len==0)
@@ -1282,7 +1368,7 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
if(matches.len==1)
chosen = matches[1]
else
chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in matches
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
if(!chosen)
return
chosen = matches[chosen]
@@ -1293,23 +1379,17 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
CRASH(msg)
//Key thing that stops lag. Cornerstone of performance in ss13, Just sitting here, in unsorted.dm.
//Increases delay as the server gets more overloaded,
//as sleeps aren't cheap and sleeping only to wake up and sleep again is wasteful
#define DELTA_CALC max(((max(world.tick_usage, world.cpu) / 100) * max(Master.sleep_delta,1)), 1)
/proc/stoplag()
. = round(1*DELTA_CALC)
. = 1
sleep(world.tick_lag)
if (world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, still not enough tick, sleep for more.
. += round(2*DELTA_CALC)
sleep(world.tick_lag*2*DELTA_CALC)
. += 2
sleep(world.tick_lag*2)
if (world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, STILL not enough tick, sleep for more.
. += round(4*DELTA_CALC)
sleep(world.tick_lag*4*DELTA_CALC)
. += 4
sleep(world.tick_lag*4)
//you might be thinking of adding more steps to this, or making it use a loop and a counter var
// not worth it.
#undef DELTA_CALC
/proc/flash_color(mob_or_client, flash_color="#960000", flash_time=20)
var/client/C
@@ -1331,7 +1411,7 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
#define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255)))
#define QDEL_IN(item, time) addtimer(GLOBAL_PROC, "qdel", time, TIMER_NORMAL, item)
#define QDEL_IN(item, time) addtimer(GLOBAL_PROC, "qdel", time, FALSE, item)
/proc/check_for_cleanbot_bug()
var/static/admins_warned //bet you didn't know you could do this!
@@ -1359,11 +1439,10 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
str = "0" + str
. = str
/atom/proc/Shake(pixelshiftx = 15, pixelshifty = 15, duration = 250)
var/initialpixelx = pixel_x
var/initialpixely = pixel_y
var/shiftx = rand(-pixelshiftx,pixelshiftx)
var/shifty = rand(-pixelshifty,pixelshifty)
animate(src, pixel_x = pixel_x + shiftx, pixel_y = pixel_y + shifty, time = 0.2, loop = duration)
pixel_x = initialpixelx
pixel_y = initialpixely
/proc/trange(var/Dist = 0, var/turf/Center = null)
if (isnull(Center))
return
var/turf/x1y1 = locate(((Center.x - Dist) < 1 ? 1 : Center.x - Dist), ((Center.y - Dist) < 1 ? 1 : Center.y - Dist), Center.z)
var/turf/x2y2 = locate(((Center.x + Dist) > world.maxx ? world.maxx : Center.x + Dist), ((Center.y + Dist) > world.maxy ? world.maxy : Center.y + Dist), Center.z)
return block(x1y1, x2y2)
-7
View File
@@ -29,12 +29,6 @@ var/global/comms_allowed = 0 //By default, the server does not allow messages to
//Cross server communications
var/global/cross_address = "byond://" //This needs to be global as the message sent contains the comms key.
var/global/cross_allowed = 0 //Don't bother attempting to send if the address wasn't set.
var/global/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players
var/global/medal_hub = null
var/global/medal_pass = " "
var/global/medals_enabled = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls.
//This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage
var/MAX_EX_DEVESTATION_RANGE = 3
@@ -42,5 +36,4 @@ var/MAX_EX_HEAVY_RANGE = 7
var/MAX_EX_LIGHT_RANGE = 14
var/MAX_EX_FLASH_RANGE = 14
var/MAX_EX_FLAME_RANGE = 14
var/DYN_EX_SCALE = 0.5
-1
View File
@@ -25,7 +25,6 @@ var/global/list/snouts_list = list()
var/global/list/horns_list = list()
var/global/list/frills_list = list()
var/global/list/spines_list = list()
var/global/list/legs_list = list()
var/global/list/animated_spines_list = list()
//Mutant Human bits
-2
View File
@@ -64,5 +64,3 @@ var/list/datum/map_template/lava_ruins_templates = list()
var/list/datum/map_template/shuttle_templates = list()
var/list/datum/map_template/shelter_templates = list()
var/list/transit_markers = list()
+2 -4
View File
@@ -2,8 +2,7 @@ var/list/clients = list() //all clients
var/list/admins = list() //all clients whom are admins
var/list/deadmins = list() //all clients who have used the de-admin verb.
var/list/directory = list() //all ckeys with associated client
var/list/stealthminID = list() //reference list with IDs that store ckeys, for stealthmins
var/global/list/current_watchlist = list() //stores players that are currently online and in the watchlist
var/list/stealthminID = list() //reference list with IDs that store ckeys, for stealthmins
//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
@@ -13,5 +12,4 @@ var/global/list/mob_list = list() //all mobs, including clientless
var/global/list/living_mob_list = list() //all alive mobs, including clientless. Excludes /mob/new_player
var/global/list/dead_mob_list = list() //all dead mobs, including clientless. Excludes /mob/new_player
var/global/list/joined_player_list = list() //all clients that have joined the game at round-start or as a latejoin.
var/global/list/silicon_mobs = list() //all silicon mobs
var/global/list/pai_list = list()
var/global/list/silicon_mobs = list() //all silicon mobs
-1
View File
@@ -13,7 +13,6 @@ var/list/clown_names = file2list("config/names/clown.txt")
var/list/mime_names = file2list("config/names/mime.txt")
var/list/carp_names = file2list("config/names/carp.txt")
var/list/golem_names = file2list("config/names/golem.txt")
var/list/plasmaman_names = file2list("config/names/plasmaman.txt")
var/list/verbs = file2list("config/names/verbs.txt")
+2 -5
View File
@@ -6,12 +6,10 @@ var/global/list/shuttle_caller_list = list() //list of all communication cons
var/global/list/machines = list() //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing !
var/global/list/syndicate_shuttle_boards = list() //important to keep track of for managing nukeops war declarations.
var/global/list/navbeacons = list() //list of all bot nagivation beacons, used for patrolling.
var/global/list/teleportbeacons = list() //list of all tracking beacons used by teleporters
var/global/list/deliverybeacons = list() //list of all MULEbot delivery beacons.
var/global/list/deliverybeacontags = list() //list of all tags associated with delivery beacons.
var/global/list/nuke_list = list()
var/global/list/nuke_tiles = list() //list of all turfs that turn to animated red grids when a nuke is triggered
var/global/list/alarmdisplay = list() //list of all machines or programs that can display station alerts
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
@@ -22,8 +20,7 @@ var/global/list/crafting_recipes = list() //list of all table craft recipes
var/global/list/rcd_list = list() //list of Rapid Construction Devices.
var/global/list/apcs_list = list() //list of all Area Power Controller machines, seperate from machines for powernet speeeeeeed.
var/global/list/tracked_implants = list() //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented...
var/global/list/tracked_chem_implants = list() //list of implants the prisoner console can track and send inject commands too
var/global/list/poi_list = list() //list of points of interest for observe/follow
var/global/list/pinpointer_list = list() //list of all pinpointers. Used to change stuff they are pointing to all at once.
var/global/list/zombie_infection_list = list() // A list of all zombie_infection organs, for any mass "animation"
var/global/list/meteor_list = list() // List of all meteors.
// A list of all zombie_infection organs, for any mass "animation"
var/global/list/zombie_infection_list = list()
-6
View File
@@ -1,6 +0,0 @@
//Each lists stores ckeys for "Never for this round" option category
#define POLL_IGNORE_PAI "pai"
#define POLL_IGNORE_SENTIENCE_POTION "sentience_potion"
var/list/poll_ignore = list()
-9
View File
@@ -1,9 +0,0 @@
//please store common type caches here.
//type caches should only be stored here if used in mutiple places or likely to be used in mutiple places.
//Note: typecache can only replace istype if you know for sure the thing is at least a datum.
var/list/typecache_mob = typecacheof(list(/mob))
+6 -13
View File
@@ -34,13 +34,6 @@
if(control_disabled || stat)
return
var/turf/pixel_turf = get_turf_pixel(A)
if(pixel_turf && !cameranet.checkTurfVis(pixel_turf))
log_admin("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(pixel_turf)])")
message_admins("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([ADMIN_COORDJMP(pixel_turf)]))")
send2irc_adminless_only("NOCHEAT", "[key_name(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(pixel_turf)]))")
return
var/list/modifiers = params2list(params)
if(modifiers["shift"] && modifiers["ctrl"])
CtrlShiftClickOn(A)
@@ -135,7 +128,7 @@
Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!)
else
Topic("aiDisable=4", list("aiDisable"="4"), 1)
return
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
if(emagged)
return
@@ -145,7 +138,7 @@
else
// disable/6 is not in Topic; disable/5 disables both temporary and permenant shock
Topic("aiDisable=5", list("aiDisable"="5"), 1)
return
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(emagged)
return
@@ -153,7 +146,7 @@
Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=7", list("aiDisable"="7"), 1)
return
/obj/machinery/door/airlock/AICtrlShiftClick() // Sets/Unsets Emergency Access Override
if(emagged)
return
@@ -161,12 +154,12 @@
Topic("aiEnable=11", list("aiEnable"="11"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=11", list("aiDisable"="11"), 1)
return
/* APC */
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
if(can_use(usr, 1))
toggle_breaker()
add_fingerprint(usr)
toggle_breaker()
add_fingerprint(usr)
/* AI Turrets */
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
+1 -1
View File
@@ -23,7 +23,7 @@
/mob/living/carbon/CanMobAutoclick(atom/object, location, params)
if(!object.IsAutoclickable())
return
var/obj/item/h = get_active_held_item()
var/obj/item/h = get_active_hand()
if(h)
. = h.CanItemAutoclick(object, location, params)
+16 -32
View File
@@ -98,16 +98,19 @@
throw_item(A)
return
var/obj/item/W = get_active_held_item()
var/obj/item/W = get_active_hand()
if(W == A)
W.attack_self(src)
update_inv_hands()
if(hand)
update_inv_l_hand(0)
else
update_inv_r_hand(0)
return
// operate three levels deep here (item in backpack in src; item in box in backpack in src, not any deeper)
if(A.ClickAccessible(src, depth=INVENTORY_DEPTH))
if(!isturf(A) && A == loc || (A in contents) || (A.loc in contents) || (A.loc && (A.loc.loc in contents)))
// No adjacency needed
if(W)
var/resolved = A.attackby(W,src)
@@ -219,7 +222,6 @@
Ctrl click
For most objects, pull
*/
/mob/proc/CtrlClickOn(atom/A)
A.CtrlClick(src)
return
@@ -229,13 +231,6 @@
if(istype(ML))
ML.pulled(src)
/mob/living/carbon/human/CtrlClick(mob/user)
if(ishuman(user) && Adjacent(user))
var/mob/living/carbon/human/H = user
H.dna.species.grab(H, src, H.martial_art)
H.next_click = world.time + CLICK_CD_MELEE
else
..()
/*
Alt click
Unused except for AI
@@ -279,21 +274,6 @@
/atom/proc/CtrlShiftClick(mob/user)
return
/*
Helper to check can the mob click/access an item.
Used by mob inventory and storage items.
*/
/atom/proc/ClickAccessible(mob/user, depth=1)
if(src == user.loc || (src in user.contents))
return TRUE
if(loc && depth > 1)
return loc.ClickAccessible(user, depth-1)
/turf/ClickAccessible(mob/user, depth=1)
return
/*
Misc helpers
@@ -354,11 +334,15 @@
icon_state = "click_catcher"
plane = CLICKCATCHER_PLANE
mouse_opacity = 2
screen_loc = "CENTER"
screen_loc = "CENTER-7,CENTER-7"
/obj/screen/click_catcher/New()
..()
transform = matrix(200, 0, 0, 0, 200, 0)
/obj/screen/click_catcher/proc/MakeGreed()
. = list()
for(var/i = 0, i<15, i++)
for(var/j = 0, j<15, j++)
var/obj/screen/click_catcher/CC = new()
CC.screen_loc = "NORTH-[i],EAST-[j]"
. += CC
/obj/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
@@ -366,7 +350,7 @@
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = params2turf(modifiers["screen-loc"], get_turf(usr))
var/turf/T = screen_loc2turf(screen_loc, get_turf(usr))
if(T)
T.Click(location, control, params)
. = 1
. = 1
+1 -1
View File
@@ -51,7 +51,7 @@
aicamera.captureimage(A, usr)
return
var/obj/item/W = get_active_held_item()
var/obj/item/W = get_active_hand()
// Cyborgs have no range-checking unless there is item use
if(!W)
+26 -42
View File
@@ -17,67 +17,53 @@
Therefore, the top right corner (except during admin shenanigans) is at "15,15"
*/
//Lower left, persistent menu
//Lower left, persistant menu
#define ui_inventory "WEST:6,SOUTH:5"
//Middle left indicators
#define ui_lingchemdisplay "WEST:6,CENTER-1:15"
#define ui_lingstingdisplay "WEST:6,CENTER-3:11"
#define ui_crafting "12:-10,1:5"
#define ui_building "12:-10,1:21"
#define ui_devilsouldisplay "WEST:6,CENTER-1:15"
//Lower center, persistent menu
//Lower center, persistant menu
#define ui_sstore1 "CENTER-5:10,SOUTH:5"
#define ui_id "CENTER-4:12,SOUTH:5"
#define ui_belt "CENTER-3:14,SOUTH:5"
#define ui_back "CENTER-2:14,SOUTH:5"
/proc/ui_hand_position(i) //values based on old hand ui positions (CENTER:-/+16,SOUTH:5)
var/x_off = -(!(i % 2))
var/y_off = round((i-1) / 2)
return"CENTER+[x_off]:16,SOUTH+[y_off]:5"
/proc/ui_equip_position(mob/M)
var/y_off = round((M.held_items.len-1) / 2) //values based on old equip ui position (CENTER: +/-16,SOUTH+1:5)
return "CENTER:-16,SOUTH+[y_off+1]:5"
/proc/ui_swaphand_position(mob/M, which = 1) //values based on old swaphand ui positions (CENTER: +/-16,SOUTH+1:5)
var/x_off = which == 1 ? -1 : 0
var/y_off = round((M.held_items.len-1) / 2)
return "CENTER+[x_off]:16,SOUTH+[y_off+1]:5"
#define ui_rhand "CENTER:-16,SOUTH:5"
#define ui_lhand "CENTER: 16,SOUTH:5"
#define ui_equip "CENTER:-16,SOUTH+1:5"
#define ui_swaphand1 "CENTER:-16,SOUTH+1:5"
#define ui_swaphand2 "CENTER: 16,SOUTH+1:5"
#define ui_storage1 "CENTER+1:18,SOUTH:5"
#define ui_storage2 "CENTER+2:20,SOUTH:5"
#define ui_borg_sensor "CENTER-3:16, SOUTH:5" //borgs
#define ui_borg_lamp "CENTER-4:16, SOUTH:5" //borgs
#define ui_borg_thrusters "CENTER-5:16, SOUTH:5" //borgs
#define ui_inv1 "CENTER-2:16,SOUTH:5" //borgs
#define ui_inv2 "CENTER-1 :16,SOUTH:5" //borgs
#define ui_inv3 "CENTER :16,SOUTH:5" //borgs
#define ui_borg_module "CENTER+1:16,SOUTH:5" //borgs
#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs
#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs
#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs
#define ui_borg_talk_wheel "CENTER+4:21,SOUTH+1:5" //borgs
#define ui_borg_sensor "CENTER-3:16, SOUTH:5" //borgs
#define ui_borg_lamp "CENTER-4:16, SOUTH:5" //borgies
#define ui_borg_thrusters "CENTER-5:16, SOUTH:5"//borgies
#define ui_inv1 "CENTER-2:16,SOUTH:5" //borgs
#define ui_inv2 "CENTER-1 :16,SOUTH:5" //borgs
#define ui_inv3 "CENTER :16,SOUTH:5" //borgs
#define ui_borg_module "CENTER+1:16,SOUTH:5"
#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs
#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs
#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs
#define ui_monkey_head "CENTER-4:13,SOUTH:5" //monkey
#define ui_monkey_mask "CENTER-3:14,SOUTH:5" //monkey
#define ui_monkey_neck "CENTER-2:15,SOUTH:5" //monkey
#define ui_monkey_back "CENTER-1:16,SOUTH:5" //monkey
#define ui_monkey_back "CENTER-2:15,SOUTH:5" //monkey
#define ui_alien_storage_l "CENTER-2:14,SOUTH:5"//alien
#define ui_alien_storage_r "CENTER+1:18,SOUTH:5"//alien
#define ui_alien_talk_wheel "EAST-3:26,SOUTH:5" //alien
#define ui_drone_drop "CENTER+1:18,SOUTH:5" //maintenance drones
#define ui_drone_pull "CENTER+2:2,SOUTH:5" //maintenance drones
#define ui_drone_storage "CENTER-2:14,SOUTH:5" //maintenance drones
#define ui_drone_head "CENTER-3:14,SOUTH:5" //maintenance drones
//Lower right, persistent menu
//Lower right, persistant menu
#define ui_drop_throw "EAST-1:28,SOUTH+1:7"
#define ui_pull_resist "EAST-2:26,SOUTH+1:7"
#define ui_movi "EAST-2:26,SOUTH:5"
@@ -108,7 +94,6 @@
#define ui_borg_health "EAST-1:28,CENTER-1:15" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "EAST-1:28,CENTER-1:15" //aliens have the health display where humans have the pressure damage indicator.
#define ui_alienplasmadisplay "EAST-1:28,CENTER-2:15"
#define ui_alien_queen_finder "EAST-1:28,CENTER-3:15"
// AI
@@ -135,19 +120,18 @@
#define ui_oclothing "WEST+1:8,SOUTH+1:7"
#define ui_gloves "WEST+2:10,SOUTH+1:7"
#define ui_glasses "WEST:6,SOUTH+3:11"
#define ui_glasses "WEST:6,SOUTH+2:9"
#define ui_mask "WEST+1:8,SOUTH+2:9"
#define ui_ears "WEST+2:10,SOUTH+2:9"
#define ui_neck "WEST:6,SOUTH+2:9"
#define ui_head "WEST+1:8,SOUTH+3:11"
//Ghosts
#define ui_ghost_jumptomob "SOUTH:6,CENTER-2:24"
#define ui_ghost_orbit "SOUTH:6,CENTER-1:24"
#define ui_ghost_reenter_corpse "SOUTH:6,CENTER:24"
#define ui_ghost_teleport "SOUTH:6,CENTER+1:24"
#define ui_ghost_pai "SOUTH: 6, CENTER+2:24"
#define ui_ghost_jumptomob "SOUTH:6,CENTER-2:16"
#define ui_ghost_orbit "SOUTH:6,CENTER-1:16"
#define ui_ghost_reenter_corpse "SOUTH:6,CENTER:16"
#define ui_ghost_teleport "SOUTH:6,CENTER+1:16"
//Hand of God, god
+10 -26
View File
@@ -1,8 +1,6 @@
#define ACTION_BUTTON_DEFAULT_BACKGROUND "default"
/obj/screen/movable/action_button
var/datum/action/linked_action
var/actiontooltipstyle = ""
screen_loc = null
/obj/screen/movable/action_button/Click(location,control,params)
@@ -22,9 +20,6 @@
icon = 'icons/mob/actions.dmi'
icon_state = "bg_default"
var/hidden = 0
var/hide_icon = 'icons/mob/actions.dmi'
var/hide_state = "hide"
var/show_state = "show"
/obj/screen/movable/action_button/hide_toggle/Click(location,control,params)
var/list/modifiers = params2list(params)
@@ -42,39 +37,28 @@
usr.update_action_buttons()
/obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud)
var settings = owner_hud.get_action_buttons_icons()
icon = settings["bg_icon"]
icon_state = settings["bg_state"]
hide_icon = settings["toggle_icon"]
hide_state = settings["toggle_hide"]
show_state = settings["toggle_show"]
/obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(mob/living/user)
if(isalien(user))
icon_state = "bg_alien"
else
icon_state = "bg_default"
UpdateIcon()
return
/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon()
cut_overlays()
var/image/img = image(hide_icon, src, hidden ? show_state : hide_state)
var/image/img = image(icon, src, hidden ? "show" : "hide")
add_overlay(img)
return
/obj/screen/movable/action_button/MouseEntered(location,control,params)
openToolTip(usr,src,params,title = name,content = desc,theme = actiontooltipstyle)
openToolTip(usr,src,params,title = name,content = desc)
/obj/screen/movable/action_button/MouseExited()
closeToolTip(usr)
/datum/hud/proc/get_action_buttons_icons()
. = list()
.["bg_icon"] = ui_style_icon
.["bg_state"] = "template"
//TODO : Make these fit theme
.["toggle_icon"] = 'icons/mob/actions.dmi'
.["toggle_hide"] = "hide"
.["toggle_show"] = "show"
//see human and alien hud for specific implementations.
/mob/proc/update_action_buttons_icon()
for(var/X in actions)
@@ -99,7 +83,7 @@
else
for(var/datum/action/A in actions)
button_number++
A.UpdateButtonIcon(hud_used)
A.UpdateButtonIcon()
var/obj/screen/movable/action_button/B = A.button
if(!B.moved)
B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number)
+3 -34
View File
@@ -1,17 +1,11 @@
/obj/screen/ai
icon = 'icons/mob/screen_ai.dmi'
/obj/screen/ai/Click()
if(isobserver(usr))
return 1
/obj/screen/ai/aicore
name = "AI core"
icon_state = "ai_core"
/obj/screen/ai/aicore/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.view_core()
@@ -29,8 +23,6 @@
icon_state = "track"
/obj/screen/ai/camera_track/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
var/target_name = input(AI, "Choose who you want to track", "Tracking") as null|anything in AI.trackable_mobs()
AI.ai_camera_track(target_name)
@@ -40,8 +32,6 @@
icon_state = "camera_light"
/obj/screen/ai/camera_light/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.toggle_camera_light()
@@ -50,8 +40,6 @@
icon_state = "crew_monitor"
/obj/screen/ai/crew_monitor/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
crewmonitor.show(AI)
@@ -60,8 +48,6 @@
icon_state = "manifest"
/obj/screen/ai/crew_manifest/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.ai_roster()
@@ -70,8 +56,6 @@
icon_state = "alerts"
/obj/screen/ai/alerts/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.ai_alerts()
@@ -80,8 +64,6 @@
icon_state = "announcement"
/obj/screen/ai/announcement/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.announcement()
@@ -90,8 +72,6 @@
icon_state = "call_shuttle"
/obj/screen/ai/call_shuttle/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.ai_call_shuttle()
@@ -100,8 +80,6 @@
icon_state = "state_laws"
/obj/screen/ai/state_laws/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.checklaws()
@@ -110,8 +88,6 @@
icon_state = "pda_send"
/obj/screen/ai/pda_msg_send/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.cmd_send_pdamesg(usr)
@@ -120,8 +96,6 @@
icon_state = "pda_receive"
/obj/screen/ai/pda_msg_show/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.cmd_show_message_log(usr)
@@ -133,7 +107,7 @@
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
AI.aicamera.toggle_camera_mode()
else if(iscyborg(usr))
else if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.aicamera.toggle_camera_mode()
@@ -145,7 +119,7 @@
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
AI.aicamera.viewpictures()
else if(iscyborg(usr))
else if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.aicamera.viewpictures()
@@ -154,16 +128,11 @@
icon_state = "ai_sensor"
/obj/screen/ai/sensors/Click()
if(..())
return
var/mob/living/silicon/S = usr
S.sensor_mode()
/datum/hud/ai
ui_style_icon = 'icons/mob/screen_ai.dmi'
/datum/hud/ai/New(mob/owner, ui_style = 'icons/mob/screen_ai.dmi')
/datum/hud/ai/New(mob/owner)
..()
var/obj/screen/using
-178
View File
@@ -37,12 +37,9 @@
if(new_master)
var/old_layer = new_master.layer
var/old_plane = new_master.plane
new_master.layer = FLOAT_LAYER
new_master.plane = FLOAT_PLANE
alert.overlays += new_master
new_master.layer = old_layer
new_master.plane = old_plane
alert.icon_state = "template" // We'll set the icon to the client's ui pref in reorganize_alerts()
alert.master = new_master
else
@@ -243,163 +240,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
icon_state = "blobbernaut_nofactory"
alerttooltipstyle = "blob"
// CLOCKCULT
/obj/screen/alert/clockwork
alerttooltipstyle = "clockcult"
/obj/screen/alert/clockwork/scripture_reqs
name = "Next Tier Requirements"
desc = "You shouldn't be seeing this description unless you're very fast. If you're very fast, good job!"
icon_state = "no-servants-caches"
var/static/list/scripture_states = list(SCRIPTURE_DRIVER = TRUE, SCRIPTURE_SCRIPT = FALSE, SCRIPTURE_APPLICATION = FALSE, SCRIPTURE_REVENANT = FALSE, SCRIPTURE_JUDGEMENT = FALSE)
/obj/screen/alert/clockwork/scripture_reqs/New()
..()
START_PROCESSING(SSprocessing, src)
process()
/obj/screen/alert/clockwork/scripture_reqs/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/screen/alert/clockwork/scripture_reqs/process()
if(clockwork_gateway_activated)
qdel(src)
return
var/current_state
scripture_states = scripture_unlock_check()
for(var/i in scripture_states)
if(!scripture_states[i])
current_state = i
break
icon_state = "no"
if(!current_state)
name = "Current Objective"
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects)
var/area/gate_area = get_area(G)
desc = "<b>Protect the Ark at [gate_area.map_name]!</b>"
return
desc = "<b>All tiers of Scripture are unlocked.<br>\
Acquire components and summon the Ark.</b>"
else
name = "Next Tier Requirements"
var/validservants = 0
var/unconverted_ais_exist = FALSE
for(var/mob/living/L in living_mob_list)
if(is_servant_of_ratvar(L) && (ishuman(L) || issilicon(L)))
validservants++
else if(isAI(L))
unconverted_ais_exist++
var/req_servants = 0
var/req_caches = 0
var/req_cv = 0
var/req_ai = FALSE
desc = "Requirements for <b>[current_state] Scripture:</b>"
switch(current_state) //get our requirements based on the tier
if(SCRIPTURE_SCRIPT)
req_servants = SCRIPT_SERVANT_REQ
req_caches = SCRIPT_CACHE_REQ
if(SCRIPTURE_APPLICATION)
req_servants = APPLICATION_SERVANT_REQ
req_caches = APPLICATION_CACHE_REQ
req_cv = APPLICATION_CV_REQ
if(SCRIPTURE_REVENANT)
req_servants = REVENANT_SERVANT_REQ
req_caches = REVENANT_CACHE_REQ
req_cv = REVENANT_CV_REQ
if(SCRIPTURE_JUDGEMENT)
req_servants = JUDGEMENT_SERVANT_REQ
req_caches = JUDGEMENT_CACHE_REQ
req_cv = JUDGEMENT_CV_REQ
req_ai = TRUE
desc += "<br><b>[validservants]/[req_servants]</b> Servants"
if(validservants < req_servants)
icon_state += "-servants" //in this manner, generate an icon key based on what we're missing
else
desc += ": <b><font color=#5A6068>\[CHECK\]</font></b>"
desc += "<br><b>[clockwork_caches]/[req_caches]</b> Tinkerer's Caches"
if(clockwork_caches < req_caches)
icon_state += "-caches"
else
desc += ": <b><font color=#5A6068>\[CHECK\]</font></b>"
if(req_cv) //cv only shows up if the tier requires it
desc += "<br><b>[clockwork_construction_value]/[req_cv]</b> Construction Value"
if(clockwork_construction_value < req_cv)
icon_state += "-cv"
else
desc += ": <b><font color=#5A6068>\[CHECK\]</font></b>"
if(req_ai) //same for ai
if(unconverted_ais_exist)
if(unconverted_ais_exist > 1)
desc += "<br><b>[unconverted_ais_exist] unconverted AIs exist!</b><br>"
else
desc += "<br><b>An unconverted AI exists!</b>"
icon_state += "-ai"
else
desc += "<br>No unconverted AIs exist: <b><font color=#5A6068>\[CHECK\]</font></b>"
/obj/screen/alert/clockwork/infodump
name = "Global Records"
desc = "You shouldn't be seeing this description, because it should be dynamically generated."
icon_state = "clockinfo"
/obj/screen/alert/clockwork/infodump/MouseEntered(location,control,params)
if(ratvar_awakens)
desc = "<font size=3><b>CHETR<br>NYY<br>HAGEHUGF-NAQ-UBABE<br>RATVAR.</b></font>"
else
var/servants = 0
var/validservants = 0
var/unconverted_ais_exist = FALSE
var/list/scripture_states = scripture_unlock_check()
for(var/mob/living/L in living_mob_list)
if(is_servant_of_ratvar(L))
servants++
if(ishuman(L) || issilicon(L))
validservants++
else if(isAI(L))
unconverted_ais_exist++
if(servants > 1)
if(validservants > 1)
desc = "<b>[servants]</b> Servants, <b>[validservants]</b> of which count towards scripture.<br>"
else
desc = "<b>[servants]</b> Servants, [validservants ? "<b>[validservants]</b> of which counts":"none of which count"] towards scripture.<br>"
else
desc = "<b>[servants]</b> Servant, who [validservants ? "counts":"does not count"] towards scripture.<br>"
desc += "<b>[clockwork_caches ? "[clockwork_caches]</b> Tinkerer's Caches.":"No Tinkerer's Caches, construct one!</b>"]<br>\
<b>[clockwork_construction_value]</b> Construction Value.<br>"
if(clockwork_daemons)
desc += "<b>[clockwork_daemons]</b> Tinkerer's Daemons: <b>[servants * 0.2 < clockwork_daemons ? "DISABLED":"ACTIVE"]</b><br>"
else
desc += "No Tinkerer's Daemons.<br>"
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects)
var/area/gate_area = get_area(G)
desc += "Ark Location: <b>[uppertext(gate_area.map_name)]</b><br>"
if(G.ratvar_portal)
desc += "Seconds until Ratvar's arrival: <b>[G.get_arrival_text(TRUE)]</b><br>"
else
desc += "Seconds until Proselytization: <b>[G.get_arrival_text(TRUE)]</b><br>"
if(unconverted_ais_exist)
if(unconverted_ais_exist > 1)
desc += "<b>[unconverted_ais_exist] unconverted AIs exist!</b><br>"
else
desc += "<b>An unconverted AI exists!</b><br>"
if(scripture_states[SCRIPTURE_REVENANT])
var/inathneq_available = clockwork_generals_invoked["inath-neq"] <= world.time
var/sevtug_available = clockwork_generals_invoked["sevtug"] <= world.time
var/nezbere_available = clockwork_generals_invoked["nezbere"] <= world.time
var/nezcrentr_available = clockwork_generals_invoked["nzcrentr"] <= world.time
if(inathneq_available || sevtug_available || nezbere_available || nezcrentr_available)
desc += "Generals available:<b>[inathneq_available ? "<br><font color=#1E8CE1>INATH-NEQ</font>":""][sevtug_available ? "<br><font color=#AF0AAF>SEVTUG</font>":""]\
[nezbere_available ? "<br><font color=#5A6068>NEZBERE</font>":""][nezcrentr_available ? "<br><font color=#DAAA18>NZCRENTR</font>":""]</b><br>"
else
desc += "Generals available: <b>NONE</b><br>"
else
desc += "Generals available: <b>NONE</b><br>"
for(var/i in scripture_states)
if(i != SCRIPTURE_DRIVER) //ignore the always-unlocked stuff
desc += "[i] Scripture: <b>[scripture_states[i] ? "UNLOCKED":"LOCKED"]</b><br>"
..()
//GUARDIANS
/obj/screen/alert/cancharge
@@ -457,23 +297,6 @@ so as to remain in compliance with the most up-to-date laws."
icon_state = "newlaw"
timeout = 300
/obj/screen/alert/hackingapc
name = "Hacking APC"
desc = "An Area Power Controller is being hacked. When the process is \
complete, you will have exclusive control of it, and you will gain \
additional processing time to unlock more malfunction abilities."
icon_state = "hackingapc"
timeout = 600
var/atom/target = null
/obj/screen/alert/hackingapc/Click()
if(!usr || !usr.client) return
if(!target) return
var/mob/living/silicon/ai/AI = usr
var/turf/T = get_turf(target)
if(T)
AI.eyeobj.setLoc(T)
//MECHS
/obj/screen/alert/low_mech_integrity
@@ -536,7 +359,6 @@ so as to remain in compliance with the most up-to-date laws."
if(isliving(usr))
var/mob/living/L = usr
return L.resist()
// PRIVATE = only edit, use, or override these if you're editing the system as a whole
// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there
+37 -38
View File
@@ -21,46 +21,50 @@
if(T)
T.fire(A)
/obj/screen/alien/plasma_display
icon = 'icons/mob/screen_gen.dmi'
icon_state = "power_display2"
name = "plasma stored"
screen_loc = ui_alienplasmadisplay
/obj/screen/alien/alien_queen_finder
icon = 'icons/mob/screen_alien.dmi'
icon_state = "queen_finder"
name = "queen sense"
desc = "Allows you to sense the general direction of your Queen."
screen_loc = ui_alien_queen_finder
/datum/hud/alien
ui_style_icon = 'icons/mob/screen_alien.dmi'
/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner, ui_style = 'icons/mob/screen_alien.dmi')
/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner)
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
//equippable shit
//hands
build_hand_slots(ui_style)
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = 'icons/mob/screen_alien.dmi'
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = 'icons/mob/screen_alien.dmi'
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
//begin buttons
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon = 'icons/mob/screen_alien.dmi'
using.icon_state = "swap_1"
using.screen_loc = ui_swaphand_position(owner,1)
using.screen_loc = ui_swaphand1
static_inventory += using
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon = 'icons/mob/screen_alien.dmi'
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand_position(owner,2)
using.screen_loc = ui_swaphand2
static_inventory += using
using = new /obj/screen/act_intent/alien()
@@ -74,28 +78,23 @@
H.leap_icon.screen_loc = ui_alien_storage_r
static_inventory += H.leap_icon
using = new/obj/screen/wheel/talk
using.screen_loc = ui_alien_talk_wheel
wheels += using
static_inventory += using
using = new /obj/screen/drop()
using.icon = ui_style
using.icon = 'icons/mob/screen_alien.dmi'
using.screen_loc = ui_drop_throw
static_inventory += using
using = new /obj/screen/resist()
using.icon = ui_style
using.icon = 'icons/mob/screen_alien.dmi'
using.screen_loc = ui_pull_resist
hotkeybuttons += using
throw_icon = new /obj/screen/throw_catch()
throw_icon.icon = ui_style
throw_icon.icon = 'icons/mob/screen_alien.dmi'
throw_icon.screen_loc = ui_drop_throw
hotkeybuttons += throw_icon
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.icon = 'icons/mob/screen_alien.dmi'
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
static_inventory += pull_icon
@@ -111,10 +110,6 @@
alien_plasma_display = new /obj/screen/alien/plasma_display()
infodisplay += alien_plasma_display
if(!istype(mymob, /mob/living/carbon/alien/humanoid/royal/queen))
alien_queen_finder = new /obj/screen/alien/alien_queen_finder
infodisplay += alien_queen_finder
zone_select = new /obj/screen/zone_sel/alien()
zone_select.update_icon(mymob)
static_inventory += zone_select
@@ -125,18 +120,22 @@
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/alien/persistent_inventory_update()
/datum/hud/alien/persistant_inventory_update()
if(!mymob)
return
var/mob/living/carbon/alien/humanoid/H = mymob
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in H.held_items)
I.screen_loc = ui_hand_position(H.get_held_index_of_item(I))
H.client.screen += I
if(H.r_hand)
H.r_hand.screen_loc = ui_rhand
H.client.screen += H.r_hand
if(H.l_hand)
H.l_hand.screen_loc = ui_lhand
H.client.screen += H.l_hand
else
for(var/obj/item/I in H.held_items)
I.screen_loc = null
H.client.screen -= I
if(H.r_hand)
H.r_hand.screen_loc = null
if(H.l_hand)
H.l_hand.screen_loc = null
/mob/living/carbon/alien/humanoid/create_mob_hud()
if(client && !hud_used)
+1 -7
View File
@@ -13,19 +13,13 @@
nightvisionicon = new /obj/screen/alien/nightvision()
nightvisionicon.screen_loc = ui_alien_nightvision
infodisplay += nightvisionicon
alien_queen_finder = new /obj/screen/alien/alien_queen_finder()
infodisplay += alien_queen_finder
pull_icon = new /obj/screen/pull()
pull_icon.icon = 'icons/mob/screen_alien.dmi'
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
hotkeybuttons += pull_icon
using = new/obj/screen/wheel/talk
using.screen_loc = ui_alien_talk_wheel
wheels += using
static_inventory += using
zone_select = new /obj/screen/zone_sel/alien()
zone_select.update_icon(mymob)
static_inventory += zone_select
+17 -26
View File
@@ -34,15 +34,12 @@
desc = "Moves your camera to your blob core."
/obj/screen/blob/JumpToCore/MouseEntered(location,control,params)
if(hud && hud.mymob && isovermind(hud.mymob))
var/mob/camera/blob/B = hud.mymob
if(isovermind(usr))
var/mob/camera/blob/B = usr
if(!B.placed)
name = "Place Blob Core"
desc = "Attempt to place your blob core at this location."
openToolTip(usr,src,params,title = "Place Blob Core",content = "Attempt to place your blob core at this location.", theme = "blob")
else
name = initial(name)
desc = initial(desc)
..()
..()
/obj/screen/blob/JumpToCore/Click()
if(isovermind(usr))
@@ -54,7 +51,7 @@
/obj/screen/blob/Blobbernaut
icon_state = "ui_blobbernaut"
name = "Produce Blobbernaut (40)"
desc = "Produces a strong, smart blobbernaut from a factory blob for 40 resources.<br>The factory blob used will become fragile and unable to produce spores."
desc = "Produces a strong, smart blobbernaut from a factory blob for 40 points.<br>The factory blob used will become fragile and unable to produce spores."
/obj/screen/blob/Blobbernaut/Click()
if(isovermind(usr))
@@ -64,7 +61,7 @@
/obj/screen/blob/ResourceBlob
icon_state = "ui_resource"
name = "Produce Resource Blob (40)"
desc = "Produces a resource blob for 40 resources.<br>Resource blobs will give you resources every few seconds."
desc = "Produces a resource blob for 40 points.<br>Resource blobs will give you points every few seconds."
/obj/screen/blob/ResourceBlob/Click()
if(isovermind(usr))
@@ -73,8 +70,8 @@
/obj/screen/blob/NodeBlob
icon_state = "ui_node"
name = "Produce Node Blob (50)"
desc = "Produces a node blob for 50 resources.<br>Node blobs will expand and activate nearby resource and factory blobs."
name = "Produce Node Blob (60)"
desc = "Produces a node blob for 60 points.<br>Node blobs will expand and activate nearby resource and factory blobs."
/obj/screen/blob/NodeBlob/Click()
if(isovermind(usr))
@@ -84,7 +81,7 @@
/obj/screen/blob/FactoryBlob
icon_state = "ui_factory"
name = "Produce Factory Blob (60)"
desc = "Produces a factory blob for 60 resources.<br>Factory blobs will produce spores every few seconds."
desc = "Produces a factory blob for 60 points.<br>Factory blobs will produce spores every few seconds."
/obj/screen/blob/FactoryBlob/Click()
if(isovermind(usr))
@@ -94,18 +91,15 @@
/obj/screen/blob/ReadaptChemical
icon_state = "ui_chemswap"
name = "Readapt Chemical (40)"
desc = "Randomly rerolls your chemical for 40 resources."
desc = "Randomly rerolls your chemical for 40 points."
/obj/screen/blob/ReadaptChemical/MouseEntered(location,control,params)
if(hud && hud.mymob && isovermind(hud.mymob))
var/mob/camera/blob/B = hud.mymob
if(isovermind(usr))
var/mob/camera/blob/B = usr
if(B.free_chem_rerolls)
name = "Readapt Chemical (FREE)"
desc = "Randomly rerolls your chemical for free."
openToolTip(usr,src,params,title = "Readapt Chemical (FREE)",content = "Randomly rerolls your chemical for free.", theme = "blob")
else
name = initial(name)
desc = initial(desc)
..()
..()
/obj/screen/blob/ReadaptChemical/Click()
if(isovermind(usr))
@@ -115,7 +109,7 @@
/obj/screen/blob/RelocateCore
icon_state = "ui_swap"
name = "Relocate Core (80)"
desc = "Swaps a node and your core for 80 resources."
desc = "Swaps a node and your core for 80 points."
/obj/screen/blob/RelocateCore/Click()
if(isovermind(usr))
@@ -132,7 +126,6 @@
blobpwrdisplay.screen_loc = ui_health
blobpwrdisplay.mouse_opacity = 0
blobpwrdisplay.layer = ABOVE_HUD_LAYER
blobpwrdisplay.plane = ABOVE_HUD_PLANE
infodisplay += blobpwrdisplay
healths = new /obj/screen/healths/blob()
@@ -148,7 +141,6 @@
using = new /obj/screen/blob/JumpToCore()
using.screen_loc = ui_zonesel
using.hud = src
static_inventory += using
using = new /obj/screen/blob/Blobbernaut()
@@ -160,16 +152,15 @@
static_inventory += using
using = new /obj/screen/blob/NodeBlob()
using.screen_loc = ui_hand_position(2)
using.screen_loc = ui_lhand
static_inventory += using
using = new /obj/screen/blob/FactoryBlob()
using.screen_loc = ui_hand_position(1)
using.screen_loc = ui_rhand
static_inventory += using
using = new /obj/screen/blob/ReadaptChemical()
using.screen_loc = ui_storage1
using.hud = src
static_inventory += using
using = new /obj/screen/blob/RelocateCore()
-64
View File
@@ -1,64 +0,0 @@
/datum/hud/marauder
var/obj/screen/hosthealth
var/obj/screen/blockchance
var/obj/screen/counterchance
/datum/hud/marauder/New(mob/living/simple_animal/hostile/guardian/owner)
..()
var/obj/screen/using
healths = new /obj/screen/healths/clock()
infodisplay += healths
hosthealth = new /obj/screen/healths/clock()
hosthealth.screen_loc = ui_internal
infodisplay += hosthealth
using = new /obj/screen/marauder/emerge()
using.screen_loc = ui_zonesel
static_inventory += using
blockchance = new /obj/screen/marauder/blockchance()
blockchance.screen_loc = ui_hand_position(2)
infodisplay += blockchance
counterchance = new /obj/screen/marauder/counterchance()
counterchance.screen_loc = ui_hand_position(1)
infodisplay += counterchance
/datum/hud/marauder/Destroy()
blockchance = null
counterchance = null
hosthealth = null
return ..()
/mob/living/simple_animal/hostile/clockwork/marauder/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/marauder(src, ui_style2icon(client.prefs.UI_style))
/obj/screen/marauder
icon = 'icons/mob/clockwork_mobs.dmi'
/obj/screen/marauder/emerge
icon_state = "marauder_emerge"
name = "Emerge/Return"
desc = "Emerge or Return."
/obj/screen/marauder/emerge/Click()
if(istype(usr, /mob/living/simple_animal/hostile/clockwork/marauder))
var/mob/living/simple_animal/hostile/clockwork/marauder/M = usr
if(M.is_in_host())
M.try_emerge()
else
M.return_to_host()
/obj/screen/marauder/blockchance
icon_state = "marauder_block"
name = "Block Chance"
desc = "Clang."
/obj/screen/marauder/counterchance
icon_state = "marauder_counter"
name = "Counter Chance"
desc = "Slash."
+29 -12
View File
@@ -5,6 +5,7 @@
/datum/hud/devil/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen/drop()
using.icon = ui_style
@@ -17,24 +18,36 @@
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon
build_hand_slots(ui_style)
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.icon = ui_style
using.icon_state = "swap_1_m"
using.screen_loc = ui_swaphand_position(owner,1)
using.screen_loc = ui_swaphand1
using.layer = HUD_LAYER
using.plane = HUD_PLANE
static_inventory += using
using = new /obj/screen/inventory()
using.name = "hand"
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand_position(owner,2)
using.screen_loc = ui_swaphand2
using.layer = HUD_LAYER
using.plane = HUD_PLANE
static_inventory += using
zone_select = new /obj/screen/zone_sel()
@@ -46,19 +59,23 @@
infodisplay += devilsouldisplay
/datum/hud/devil/persistent_inventory_update()
/datum/hud/devil/persistant_inventory_update()
if(!mymob)
return
var/mob/living/carbon/true_devil/D = mymob
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in D.held_items)
I.screen_loc = ui_hand_position(D.get_held_index_of_item(I))
D.client.screen += I
if(D.r_hand)
D.r_hand.screen_loc = ui_rhand
D.client.screen += D.r_hand
if(D.l_hand)
D.l_hand.screen_loc = ui_lhand
D.client.screen += D.l_hand
else
for(var/obj/item/I in D.held_items)
I.screen_loc = null
D.client.screen -= I
if(D.r_hand)
D.r_hand.screen_loc = null
if(D.l_hand)
D.l_hand.screen_loc = null
/mob/living/carbon/true_devil/create_mob_hud()
if(client && !hud_used)
+67 -4
View File
@@ -1,14 +1,42 @@
/datum/hud/dextrous/drone/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
/datum/hud/drone/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen/drop()
using.icon = ui_style
using.screen_loc = ui_drone_drop
static_inventory += using
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "internal storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_storage
inv_box.slot_id = slot_generic_dextrous_storage
inv_box.slot_id = slot_drone_storage
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
@@ -20,6 +48,26 @@
inv_box.slot_id = slot_head
static_inventory += inv_box
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1_m"
using.screen_loc = ui_swaphand1
static_inventory += using
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
static_inventory += using
zone_select = new /obj/screen/zone_sel()
zone_select.icon = ui_style
zone_select.update_icon(mymob)
using = new /obj/screen/inventory/craft
using.icon = ui_style
static_inventory += using
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
@@ -27,7 +75,7 @@
inv.update_icon()
/datum/hud/dextrous/drone/persistent_inventory_update()
/datum/hud/drone/persistant_inventory_update()
if(!mymob)
return
var/mob/living/simple_animal/drone/D = mymob
@@ -45,4 +93,19 @@
if(D.head)
D.head.screen_loc = null
..()
if(hud_version != HUD_STYLE_NOHUD)
if(D.r_hand)
D.r_hand.screen_loc = ui_rhand
D.client.screen += D.r_hand
if(D.l_hand)
D.l_hand.screen_loc = ui_lhand
D.client.screen += D.l_hand
else
if(D.r_hand)
D.r_hand.screen_loc = null
if(D.l_hand)
D.l_hand.screen_loc = null
/mob/living/simple_animal/drone/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/drone(src, ui_style2icon(client.prefs.UI_style))
+1 -21
View File
@@ -60,7 +60,6 @@
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
layer = FULLSCREEN_LAYER
plane = FULLSCREEN_PLANE
mouse_opacity = 0
var/severity = 0
@@ -72,22 +71,18 @@
/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
@@ -102,7 +97,7 @@
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/obj/screen/fullscreen/flash/static
/obj/screen/fullscreen/flash/noise
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"
@@ -111,18 +106,3 @@
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"
/obj/screen/fullscreen/color_vision
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
alpha = 80
/obj/screen/fullscreen/color_vision/green
color = "#00ff00"
/obj/screen/fullscreen/color_vision/red
color = "#ff0000"
/obj/screen/fullscreen/color_vision/blue
color = "#0000ff"
+28 -36
View File
@@ -2,42 +2,39 @@
/datum/hud/dextrous/New(mob/living/owner, ui_style = 'icons/mob/screen_midnight.dmi')
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen/drop()
using.icon = ui_style
using.screen_loc = ui_drone_drop
static_inventory += using
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
build_hand_slots(ui_style)
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1_m"
using.screen_loc = ui_swaphand_position(owner,1)
using.screen_loc = ui_swaphand1
static_inventory += using
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand_position(owner,2)
static_inventory += using
zone_select = new /obj/screen/zone_sel()
zone_select.icon = ui_style
zone_select.update_icon(mymob)
using = new /obj/screen/inventory/craft
using.icon = ui_style
static_inventory += using
using = new /obj/screen/inventory/area_creator
using.icon = ui_style
using.screen_loc = ui_swaphand2
static_inventory += using
mymob.client.screen = list()
@@ -48,24 +45,19 @@
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/dextrous/persistent_inventory_update()
/datum/hud/dextrous/persistant_inventory_update()
if(!mymob)
return
var/mob/living/D = mymob
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in D.held_items)
I.screen_loc = ui_hand_position(D.get_held_index_of_item(I))
D.client.screen += I
if(D.r_hand)
D.r_hand.screen_loc = ui_rhand
D.client.screen += D.r_hand
if(D.l_hand)
D.l_hand.screen_loc = ui_lhand
D.client.screen += D.l_hand
else
for(var/obj/item/I in D.held_items)
I.screen_loc = null
D.client.screen -= I
//Dextrous simple mobs can use hands!
/mob/living/simple_animal/create_mob_hud()
if(client && !hud_used)
if(dextrous)
hud_used = new dextrous_hud_type(src, ui_style2icon(client.prefs.UI_style))
else
..()
if(D.r_hand)
D.r_hand.screen_loc = null
if(D.l_hand)
D.l_hand.screen_loc = null
+5 -18
View File
@@ -36,15 +36,7 @@
var/mob/dead/observer/G = usr
G.dead_tele()
/obj/screen/ghost/pai
name = "pAI Candidate"
icon_state = "pai"
/obj/screen/ghost/pai/Click()
var/mob/dead/observer/G = usr
G.register_pai()
/datum/hud/ghost/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
/datum/hud/ghost/New(mob/owner)
..()
var/mob/dead/observer/G = mymob
if(!G.client.prefs.ghost_hud)
@@ -69,19 +61,14 @@
using.screen_loc = ui_ghost_teleport
static_inventory += using
using = new /obj/screen/ghost/pai()
using.screen_loc = ui_ghost_pai
static_inventory += using
/datum/hud/ghost/show_hud()
var/mob/dead/observer/G = mymob
mymob.client.screen = list()
create_parallax()
if(G.client.prefs.ghost_hud)
mymob.client.screen += static_inventory
if(!G.client.prefs.ghost_hud)
return
mymob.client.screen += static_inventory
/mob/dead/observer/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/ghost(src, ui_style2icon(client.prefs.UI_style))
hud_used = new /datum/hud/ghost(src)
+3 -64
View File
@@ -7,11 +7,11 @@
infodisplay += healths
using = new /obj/screen/guardian/Manifest()
using.screen_loc = ui_hand_position(2)
using.screen_loc = ui_rhand
static_inventory += using
using = new /obj/screen/guardian/Recall()
using.screen_loc = ui_hand_position(1)
using.screen_loc = ui_lhand
static_inventory += using
using = new owner.toggle_button_type()
@@ -29,69 +29,8 @@
/mob/living/simple_animal/hostile/guardian/create_mob_hud()
if(client && !hud_used)
if(dextrous)
..()
else
hud_used = new /datum/hud/guardian(src, ui_style2icon(client.prefs.UI_style))
hud_used = new /datum/hud/guardian(src)
/datum/hud/dextrous/guardian/New(mob/living/simple_animal/hostile/guardian/owner, ui_style = 'icons/mob/screen_midnight.dmi') //for a dextrous guardian
..()
var/obj/screen/using
if(istype(owner, /mob/living/simple_animal/hostile/guardian/dextrous))
var/obj/screen/inventory/inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "internal storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
inv_box.screen_loc = ui_id
inv_box.slot_id = slot_generic_dextrous_storage
static_inventory += inv_box
using = new /obj/screen/guardian/Communicate()
using.screen_loc = ui_sstore1
static_inventory += using
else
using = new /obj/screen/guardian/Communicate()
using.screen_loc = ui_id
static_inventory += using
healths = new /obj/screen/healths/guardian()
infodisplay += healths
using = new /obj/screen/guardian/Manifest()
using.screen_loc = ui_belt
static_inventory += using
using = new /obj/screen/guardian/Recall()
using.screen_loc = ui_back
static_inventory += using
using = new owner.toggle_button_type()
using.screen_loc = ui_storage2
static_inventory += using
using = new /obj/screen/guardian/ToggleLight()
using.screen_loc = ui_inventory
static_inventory += using
/datum/hud/dextrous/guardian/persistent_inventory_update()
if(!mymob)
return
if(istype(mymob, /mob/living/simple_animal/hostile/guardian/dextrous))
var/mob/living/simple_animal/hostile/guardian/dextrous/D = mymob
if(hud_shown)
if(D.internal_storage)
D.internal_storage.screen_loc = ui_id
D.client.screen += D.internal_storage
else
if(D.internal_storage)
D.internal_storage.screen_loc = null
..()
/obj/screen/guardian
icon = 'icons/mob/guardian.dmi'
+29 -101
View File
@@ -9,7 +9,7 @@
var/hud_shown = 1 //Used for the HUD toggle (F12)
var/hud_version = 1 //Current displayed version of the HUD
var/inventory_shown = 0 //Equipped item inventory
var/inventory_shown = 1 //the inventory
var/show_intent_icons = 0
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
@@ -19,7 +19,6 @@
var/obj/screen/blobpwrdisplay
var/obj/screen/alien_plasma_display
var/obj/screen/alien_queen_finder
var/obj/screen/devil/soul_counter/devilsouldisplay
@@ -33,16 +32,12 @@
var/obj/screen/throw_icon
var/obj/screen/module_store_icon
var/list/wheels = list() //list of the wheel screen objects
var/list/static_inventory = list() //the screen objects which are static
var/list/toggleable_inventory = list() //the screen objects which can be hidden
var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys
var/list/infodisplay = list() //the screen objects that display mob info (health, alien plasma, etc...)
var/list/screenoverlays = list() //the screen objects used as whole screen overlays (flash, damageoverlay, etc...)
var/list/inv_slots[slots_amt] // /obj/screen/inventory objects, ordered by their slot ID.
var/list/hand_slots // /obj/screen/inventory/hand objects, assoc list of "[held_index]" = object
var/list/obj/screen/plane_master/plane_masters = list() // see "appearance_flags" in the ref, assoc list of "[plane]" = object
var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle
var/action_buttons_hidden = 0
@@ -51,21 +46,10 @@
var/obj/screen/healthdoll
var/obj/screen/internals
var/ui_style_icon = 'icons/mob/screen_midnight.dmi'
/datum/hud/New(mob/owner , ui_style = 'icons/mob/screen_midnight.dmi')
/datum/hud/New(mob/owner)
mymob = owner
ui_style_icon = ui_style
hide_actions_toggle = new
hide_actions_toggle.InitialiseIcon(src)
hand_slots = list()
for(var/mytype in subtypesof(/obj/screen/plane_master))
var/obj/screen/plane_master/instance = new mytype()
plane_masters["[instance.plane]"] = instance
hide_actions_toggle.InitialiseIcon(mymob)
/datum/hud/Destroy()
if(mymob.hud_used == src)
@@ -77,8 +61,6 @@
qdel(module_store_icon)
module_store_icon = null
wheels = null //all wheels are also in static_inventory
if(static_inventory.len)
for(var/thing in static_inventory)
qdel(thing)
@@ -114,16 +96,10 @@
lingstingdisplay = null
blobpwrdisplay = null
alien_plasma_display = null
alien_queen_finder = null
deity_power_display = null
deity_follower_display = null
nightvisionicon = null
if(plane_masters.len)
for(var/thing in plane_masters)
qdel(plane_masters[thing])
plane_masters.Cut()
if(screenoverlays.len)
for(var/thing in screenoverlays)
qdel(thing)
@@ -136,15 +112,13 @@
hud_used = new /datum/hud(src)
//Version denotes which style should be displayed. blank or 0 means "next version"
/datum/hud/proc/show_hud(version = 0,mob/viewmob)
/datum/hud/proc/show_hud(version = 0)
if(!ismob(mymob))
return 0
if(!mymob.client)
return 0
var/mob/screenmob = viewmob || mymob
screenmob.client.screen = list()
mymob.client.screen = list()
var/display_hud_version = version
if(!display_hud_version) //If 0 or blank, display the next hud version
@@ -156,13 +130,13 @@
if(HUD_STYLE_STANDARD) //Default HUD
hud_shown = 1 //Governs behavior of other procs
if(static_inventory.len)
screenmob.client.screen += static_inventory
if(toggleable_inventory.len && screenmob.hud_used && screenmob.hud_used.inventory_shown)
screenmob.client.screen += toggleable_inventory
mymob.client.screen += static_inventory
if(toggleable_inventory.len && inventory_shown)
mymob.client.screen += toggleable_inventory
if(hotkeybuttons.len && !hotkey_ui_hidden)
screenmob.client.screen += hotkeybuttons
mymob.client.screen += hotkeybuttons
if(infodisplay.len)
screenmob.client.screen += infodisplay
mymob.client.screen += infodisplay
mymob.client.screen += hide_actions_toggle
@@ -172,48 +146,45 @@
if(HUD_STYLE_REDUCED) //Reduced HUD
hud_shown = 0 //Governs behavior of other procs
if(static_inventory.len)
screenmob.client.screen -= static_inventory
mymob.client.screen -= static_inventory
if(toggleable_inventory.len)
screenmob.client.screen -= toggleable_inventory
mymob.client.screen -= toggleable_inventory
if(hotkeybuttons.len)
screenmob.client.screen -= hotkeybuttons
mymob.client.screen -= hotkeybuttons
if(infodisplay.len)
screenmob.client.screen += infodisplay
mymob.client.screen += infodisplay
//These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay
for(var/h in hand_slots)
var/obj/screen/hand = hand_slots[h]
if(hand)
screenmob.client.screen += hand
if(inv_slots[slot_l_hand])
mymob.client.screen += inv_slots[slot_l_hand] //we want the hands to be visible
if(inv_slots[slot_r_hand])
mymob.client.screen += inv_slots[slot_r_hand] //we want the hands to be visible
if(action_intent)
screenmob.client.screen += action_intent //we want the intent switcher visible
mymob.client.screen += action_intent //we want the intent switcher visible
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
if(HUD_STYLE_NOHUD) //No HUD
hud_shown = 0 //Governs behavior of other procs
if(static_inventory.len)
screenmob.client.screen -= static_inventory
mymob.client.screen -= static_inventory
if(toggleable_inventory.len)
screenmob.client.screen -= toggleable_inventory
mymob.client.screen -= toggleable_inventory
if(hotkeybuttons.len)
screenmob.client.screen -= hotkeybuttons
mymob.client.screen -= hotkeybuttons
if(infodisplay.len)
screenmob.client.screen -= infodisplay
mymob.client.screen -= infodisplay
if(plane_masters.len)
for(var/thing in plane_masters)
screenmob.client.screen += plane_masters[thing]
hud_version = display_hud_version
persistent_inventory_update(screenmob)
persistant_inventory_update()
mymob.update_action_buttons(1)
reorganize_alerts()
mymob.reload_fullscreen()
create_parallax()
update_parallax_existence()
/datum/hud/human/show_hud(version = 0,mob/viewmob)
/datum/hud/human/show_hud(version = 0)
..()
hidden_inventory_update(viewmob)
hidden_inventory_update()
/datum/hud/robot/show_hud(version = 0)
..()
@@ -222,19 +193,8 @@
/datum/hud/proc/hidden_inventory_update()
return
/datum/hud/proc/persistent_inventory_update(mob/viewer)
if(!mymob)
return
var/mob/living/L = mymob
var/mob/screenmob = viewer || L
for(var/X in wheels)
var/obj/screen/wheel/W = X
if(W.toggled)
screenmob.client.screen |= W.buttons_list
else
screenmob.client.screen -= W.buttons_list
/datum/hud/proc/persistant_inventory_update()
return
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12()
@@ -246,35 +206,3 @@
usr << "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>"
else
usr << "<span class ='warning'>This mob type does not use a HUD.</span>"
//(re)builds the hand ui slots, throwing away old ones
//not really worth jugglying existing ones so we just scrap+rebuild
//9/10 this is only called once per mob and only for 2 hands
/datum/hud/proc/build_hand_slots(ui_style = 'icons/mob/screen_midnight.dmi')
for(var/h in hand_slots)
var/obj/screen/inventory/hand/H = hand_slots[h]
if(H)
static_inventory -= H
hand_slots = list()
var/obj/screen/inventory/hand/hand_box
for(var/i in 1 to mymob.held_items.len)
hand_box = new /obj/screen/inventory/hand()
hand_box.name = mymob.get_held_index_name(i)
hand_box.icon = ui_style
hand_box.icon_state = "hand_[mymob.held_index_to_dir(i)]"
hand_box.screen_loc = ui_hand_position(i)
hand_box.held_index = i
hand_slots["[i]"] = hand_box
hand_box.hud = src
static_inventory += hand_box
hand_box.update_icon()
var/i = 1
for(var/obj/screen/swap_hand/SH in static_inventory)
SH.screen_loc = ui_swaphand_position(mymob,!(i % 2) ? 2: 1)
i++
for(var/obj/screen/human/equip/E in static_inventory)
E.screen_loc = ui_equip_position(mymob)
if(mymob.hud_used)
show_hud(HUD_STYLE_STANDARD,mymob)
+87 -109
View File
@@ -6,22 +6,14 @@
icon_state = "toggle"
/obj/screen/human/toggle/Click()
var/mob/targetmob = usr
if(isobserver(usr))
if(ishuman(usr.client.eye) && (usr.client.eye != usr))
var/mob/M = usr.client.eye
targetmob = M
if(usr.hud_used.inventory_shown && targetmob.hud_used)
if(usr.hud_used.inventory_shown)
usr.hud_used.inventory_shown = 0
usr.client.screen -= targetmob.hud_used.toggleable_inventory
usr.client.screen -= usr.hud_used.toggleable_inventory
else
usr.hud_used.inventory_shown = 1
usr.client.screen += targetmob.hud_used.toggleable_inventory
usr.client.screen += usr.hud_used.toggleable_inventory
targetmob.hud_used.hidden_inventory_update(usr)
usr.hud_used.hidden_inventory_update()
/obj/screen/human/equip
name = "equip"
@@ -70,8 +62,6 @@
screen_loc = ui_lingstingdisplay
/obj/screen/ling/sting/Click()
if(isobserver(usr))
return
var/mob/living/carbon/U = usr
U.unset_sting()
@@ -87,6 +77,7 @@
/datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi')
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
@@ -94,15 +85,6 @@
using.icon = ui_style
static_inventory += using
using = new/obj/screen/wheel/talk
using.icon = ui_style
wheels += using
static_inventory += using
using = new /obj/screen/inventory/area_creator
using.icon = ui_style
static_inventory += using
using = new /obj/screen/act_intent()
using.icon_state = mymob.a_intent
static_inventory += using
@@ -110,7 +92,7 @@
using = new /obj/screen/mov_intent()
using.icon = ui_style
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
static_inventory += using
@@ -137,18 +119,32 @@
inv_box.screen_loc = ui_oclothing
toggleable_inventory += inv_box
build_hand_slots(ui_style)
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1"
using.screen_loc = ui_swaphand_position(owner,1)
using.screen_loc = ui_swaphand1
static_inventory += using
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand_position(owner,2)
using.screen_loc = ui_swaphand2
static_inventory += using
inv_box = new /obj/screen/inventory()
@@ -169,15 +165,6 @@
inv_box.slot_id = slot_wear_mask
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "neck"
inv_box.icon = ui_style
inv_box.icon_state = "neck"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_neck
inv_box.slot_id = slot_neck
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.icon = ui_style
@@ -226,7 +213,7 @@
using = new /obj/screen/human/equip()
using.icon = ui_style
using.screen_loc = ui_equip_position(mymob)
using.screen_loc = ui_equip
static_inventory += using
inv_box = new /obj/screen/inventory()
@@ -317,111 +304,102 @@
zone_select.update_icon(mymob)
static_inventory += zone_select
inventory_shown = 0
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/human/hidden_inventory_update(mob/viewer)
/datum/hud/human/hidden_inventory_update()
if(!mymob)
return
var/mob/living/carbon/human/H = mymob
var/mob/screenmob = viewer || H
if(screenmob.hud_used.inventory_shown && screenmob.hud_used.hud_shown)
if(inventory_shown && hud_shown)
if(H.shoes)
H.shoes.screen_loc = ui_shoes
screenmob.client.screen += H.shoes
H.client.screen += H.shoes
if(H.gloves)
H.gloves.screen_loc = ui_gloves
screenmob.client.screen += H.gloves
H.client.screen += H.gloves
if(H.ears)
H.ears.screen_loc = ui_ears
screenmob.client.screen += H.ears
H.client.screen += H.ears
if(H.glasses)
H.glasses.screen_loc = ui_glasses
screenmob.client.screen += H.glasses
H.client.screen += H.glasses
if(H.w_uniform)
H.w_uniform.screen_loc = ui_iclothing
screenmob.client.screen += H.w_uniform
H.client.screen += H.w_uniform
if(H.wear_suit)
H.wear_suit.screen_loc = ui_oclothing
screenmob.client.screen += H.wear_suit
H.client.screen += H.wear_suit
if(H.wear_mask)
H.wear_mask.screen_loc = ui_mask
screenmob.client.screen += H.wear_mask
if(H.wear_neck)
H.wear_neck.screen_loc = ui_neck
screenmob.client.screen += H.wear_neck
H.client.screen += H.wear_mask
if(H.head)
H.head.screen_loc = ui_head
screenmob.client.screen += H.head
H.client.screen += H.head
else
if(H.shoes) screenmob.client.screen -= H.shoes
if(H.gloves) screenmob.client.screen -= H.gloves
if(H.ears) screenmob.client.screen -= H.ears
if(H.glasses) screenmob.client.screen -= H.glasses
if(H.w_uniform) screenmob.client.screen -= H.w_uniform
if(H.wear_suit) screenmob.client.screen -= H.wear_suit
if(H.wear_mask) screenmob.client.screen -= H.wear_mask
if(H.wear_neck) screenmob.client.screen -= H.wear_neck
if(H.head) screenmob.client.screen -= H.head
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.ears) H.ears.screen_loc = null
if(H.glasses) H.glasses.screen_loc = null
if(H.w_uniform) H.w_uniform.screen_loc = null
if(H.wear_suit) H.wear_suit.screen_loc = null
if(H.wear_mask) H.wear_mask.screen_loc = null
if(H.head) H.head.screen_loc = null
/datum/hud/human/persistent_inventory_update(mob/viewer)
/datum/hud/human/persistant_inventory_update()
if(!mymob)
return
..()
var/mob/living/carbon/human/H = mymob
var/mob/screenmob = viewer || H
if(screenmob.hud_used)
if(screenmob.hud_used.hud_shown)
if(H.s_store)
H.s_store.screen_loc = ui_sstore1
screenmob.client.screen += H.s_store
if(H.wear_id)
H.wear_id.screen_loc = ui_id
screenmob.client.screen += H.wear_id
if(H.belt)
H.belt.screen_loc = ui_belt
screenmob.client.screen += H.belt
if(H.back)
H.back.screen_loc = ui_back
screenmob.client.screen += H.back
if(H.l_store)
H.l_store.screen_loc = ui_storage1
screenmob.client.screen += H.l_store
if(H.r_store)
H.r_store.screen_loc = ui_storage2
screenmob.client.screen += H.r_store
else
if(H.s_store)
screenmob.client.screen -= H.s_store
if(H.wear_id)
screenmob.client.screen -= H.wear_id
if(H.belt)
screenmob.client.screen -= H.belt
if(H.back)
screenmob.client.screen -= H.back
if(H.l_store)
screenmob.client.screen -= H.l_store
if(H.r_store)
screenmob.client.screen -= H.r_store
if(hud_shown)
if(H.s_store)
H.s_store.screen_loc = ui_sstore1
H.client.screen += H.s_store
if(H.wear_id)
H.wear_id.screen_loc = ui_id
H.client.screen += H.wear_id
if(H.belt)
H.belt.screen_loc = ui_belt
H.client.screen += H.belt
if(H.back)
H.back.screen_loc = ui_back
H.client.screen += H.back
if(H.l_store)
H.l_store.screen_loc = ui_storage1
H.client.screen += H.l_store
if(H.r_store)
H.r_store.screen_loc = ui_storage2
H.client.screen += H.r_store
else
if(H.s_store)
H.s_store.screen_loc = null
if(H.wear_id)
H.wear_id.screen_loc = null
if(H.belt)
H.belt.screen_loc = null
if(H.back)
H.back.screen_loc = null
if(H.l_store)
H.l_store.screen_loc = null
if(H.r_store)
H.r_store.screen_loc = null
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in H.held_items)
I.screen_loc = ui_hand_position(H.get_held_index_of_item(I))
screenmob.client.screen += I
if(H.r_hand)
H.r_hand.screen_loc = ui_rhand
H.client.screen += H.r_hand
if(H.l_hand)
H.l_hand.screen_loc = ui_lhand
H.client.screen += H.l_hand
else
for(var/obj/item/I in H.held_items)
I.screen_loc = null
screenmob.client.screen -= I
if(H.r_hand)
H.r_hand.screen_loc = null
if(H.l_hand)
H.l_hand.screen_loc = null
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
+29 -28
View File
@@ -12,32 +12,41 @@
using = new /obj/screen/mov_intent()
using.icon = ui_style
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
static_inventory += using
using = new/obj/screen/wheel/talk
using.icon = ui_style
wheels += using
static_inventory += using
using = new /obj/screen/drop()
using.icon = ui_style
using.screen_loc = ui_drop_throw
static_inventory += using
build_hand_slots(ui_style)
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1_m" //extra wide!
using.screen_loc = ui_swaphand_position(owner,1)
using.screen_loc = ui_swaphand1
static_inventory += using
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand_position(owner,2)
using.screen_loc = ui_swaphand2
static_inventory += using
inv_box = new /obj/screen/inventory()
@@ -49,15 +58,6 @@
inv_box.slot_id = slot_wear_mask
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "neck"
inv_box.icon = ui_style
inv_box.icon_state = "neck"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_monkey_neck
inv_box.slot_id = slot_neck
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = ui_style
@@ -118,7 +118,7 @@
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/monkey/persistent_inventory_update()
/datum/hud/monkey/persistant_inventory_update()
if(!mymob)
return
var/mob/living/carbon/monkey/M = mymob
@@ -130,9 +130,6 @@
if(M.wear_mask)
M.wear_mask.screen_loc = ui_monkey_mask
M.client.screen += M.wear_mask
if(M.wear_neck)
M.wear_neck.screen_loc = ui_monkey_neck
M.client.screen += M.wear_neck
if(M.head)
M.head.screen_loc = ui_monkey_head
M.client.screen += M.head
@@ -145,13 +142,17 @@
M.head.screen_loc = null
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in M.held_items)
I.screen_loc = ui_hand_position(M.get_held_index_of_item(I))
M.client.screen += I
if(M.r_hand)
M.r_hand.screen_loc = ui_rhand
M.client.screen += M.r_hand
if(M.l_hand)
M.l_hand.screen_loc = ui_lhand
M.client.screen += M.l_hand
else
for(var/obj/item/I in M.held_items)
I.screen_loc = null
M.client.screen -= I
if(M.r_hand)
M.r_hand.screen_loc = null
if(M.l_hand)
M.l_hand.screen_loc = null
/mob/living/carbon/monkey/create_mob_hud()
if(client && !hud_used)
+29 -1
View File
@@ -7,7 +7,35 @@
mymob.client.screen = list()
mymob.client.screen += mymob.client.void
/mob/living/brain/create_mob_hud()
/mob/living/carbon/brain/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/brain(src)
/datum/hud/hog_god/New(mob/owner)
..()
healths = new /obj/screen/healths/deity()
infodisplay += healths
deity_power_display = new /obj/screen/deity_power_display()
infodisplay += deity_power_display
deity_follower_display = new /obj/screen/deity_follower_display()
infodisplay += deity_follower_display
/mob/camera/god/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/hog_god(src)
/obj/screen/deity_power_display
name = "Faith"
icon_state = "deity_power"
screen_loc = ui_deitypower
layer = HUD_LAYER
/obj/screen/deity_follower_display
name = "Followers"
icon_state = "deity_followers"
screen_loc = ui_deityfollowers
layer = HUD_LAYER
+218 -232
View File
@@ -1,268 +1,254 @@
/*
* This file handles all parallax-related business once the parallax itself is initialized with the rest of the HUD
*/
#define PARALLAX_IMAGE_WIDTH 15
#define PARALLAX_IMAGE_TILES (PARALLAX_IMAGE_WIDTH**2)
/client
var/list/parallax_layers
var/list/parallax_layers_cached
var/static/list/parallax_static_layers_tail = newlist(/obj/screen/parallax_pmaster, /obj/screen/parallax_space_whitifier)
var/atom/movable/movingmob
var/turf/previous_turf
var/dont_animate_parallax //world.time of when we can state animate()ing parallax again
var/last_parallax_shift //world.time of last update
var/parallax_throttle = 0 //ds between updates
var/parallax_movedir = 0
var/parallax_layers_max = 3
var/parallax_animate_timer
var/list/parallax_on_clients = list()
/datum/hud/proc/create_parallax()
var/client/C = mymob.client
if (!apply_parallax_pref())
/obj/screen/parallax
var/base_offset_x = 0
var/base_offset_y = 0
mouse_opacity = 0
icon = 'icons/turf/space.dmi'
icon_state = "blank"
name = "space parallax"
screen_loc = "CENTER,CENTER"
blend_mode = BLEND_ADD
layer = AREA_LAYER
plane = PLANE_SPACE_PARALLAX
var/parallax_speed = 0
/obj/screen/plane_master
appearance_flags = PLANE_MASTER
screen_loc = "CENTER,CENTER"
/obj/screen/plane_master/parallax_master
plane = PLANE_SPACE_PARALLAX
blend_mode = BLEND_MULTIPLY
color = list(
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,0,
0,0,0,1)
/obj/screen/plane_master/parallax_spacemaster //Turns space white, causing the parallax to only show in areas with opacity. Somehow
plane = PLANE_SPACE_BACKGROUND
color = list(
0,0,0,0,
0,0,0,0,
0,0,0,0,
1,1,1,1,
0,0,0,0)
/obj/screen/plane_master/parallax_spacemaster/New()
..()
overlays += image(icon = 'icons/mob/screen1.dmi', icon_state = "blank")
/obj/screen/plane_master/parallax_dustmaster
plane = PLANE_SPACE_DUST
color = list(0,0,0,0)
/datum/hud/proc/update_parallax_existence()
if(!parallax_initialized)
return
initialize_parallax()
update_parallax()
update_parallax_values()
if(!length(C.parallax_layers_cached))
C.parallax_layers_cached = list()
C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_1(null, C.view)
C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_2(null, C.view)
C.parallax_layers = C.parallax_layers_cached.Copy()
if (length(C.parallax_layers) > C.parallax_layers_max)
C.parallax_layers.len = C.parallax_layers_max
C.screen |= (C.parallax_layers + C.parallax_static_layers_tail)
/datum/hud/proc/remove_parallax()
/datum/hud/proc/initialize_parallax()
var/client/C = mymob.client
C.screen -= (C.parallax_layers_cached + C.parallax_static_layers_tail)
C.parallax_layers = null
/datum/hud/proc/apply_parallax_pref()
var/client/C = mymob.client
switch(C.prefs.parallax)
if (PARALLAX_INSANE)
C.parallax_throttle = FALSE
C.parallax_layers_max = 4
return TRUE
if(!C.parallax_master)
C.parallax_master = PoolOrNew(/obj/screen/plane_master/parallax_master)
if(!C.parallax_spacemaster)
C.parallax_spacemaster = PoolOrNew(/obj/screen/plane_master/parallax_spacemaster)
if(!C.parallax_dustmaster)
C.parallax_dustmaster = PoolOrNew(/obj/screen/plane_master/parallax_dustmaster)
if (PARALLAX_MED)
C.parallax_throttle = PARALLAX_DELAY_MED
C.parallax_layers_max = 2
return TRUE
if(!C.parallax.len)
for(var/obj/screen/parallax/bgobj in parallax_icon)
var/obj/screen/parallax/parallax_layer = PoolOrNew(/obj/screen/parallax)
parallax_layer.appearance = bgobj.appearance
parallax_layer.base_offset_x = bgobj.base_offset_x
parallax_layer.base_offset_y = bgobj.base_offset_y
parallax_layer.parallax_speed = bgobj.parallax_speed
parallax_layer.screen_loc = bgobj.screen_loc
C.parallax += parallax_layer
if(bgobj.parallax_speed)
C.parallax_movable += parallax_layer
if (PARALLAX_LOW)
C.parallax_throttle = PARALLAX_DELAY_LOW
C.parallax_layers_max = 1
return TRUE
if(!C.parallax_offset.len)
C.parallax_offset["horizontal"] = 0
C.parallax_offset["vertical"] = 0
if (PARALLAX_DISABLE)
return FALSE
else
C.parallax_throttle = PARALLAX_DELAY_DEFAULT
C.parallax_layers_max = 3
return TRUE
/datum/hud/proc/update_parallax_pref()
remove_parallax()
create_parallax()
// This sets which way the current shuttle is moving (returns true if the shuttle has stopped moving so the caller can append their animation)
/datum/hud/proc/set_parallax_movedir(new_parallax_movedir)
. = FALSE
var/client/C = mymob.client
if(new_parallax_movedir == C.parallax_movedir)
return
var/animatedir = new_parallax_movedir
if(new_parallax_movedir == FALSE)
var/animate_time = 0
for(var/thing in C.parallax_layers)
var/obj/screen/parallax_layer/L = thing
L.icon_state = initial(L.icon_state)
L.update_o(C.view)
var/T = PARALLAX_LOOP_TIME / L.speed
if (T > animate_time)
animate_time = T
C.dont_animate_parallax = world.time + min(animate_time, PARALLAX_LOOP_TIME)
animatedir = C.parallax_movedir
var/matrix/newtransform
switch(animatedir)
if(NORTH)
newtransform = matrix(1, 0, 0, 0, 1, 480)
if(SOUTH)
newtransform = matrix(1, 0, 0, 0, 1,-480)
if(EAST)
newtransform = matrix(1, 0, 480, 0, 1, 0)
if(WEST)
newtransform = matrix(1, 0,-480, 0, 1, 0)
var/shortesttimer
for(var/thing in C.parallax_layers)
var/obj/screen/parallax_layer/L = thing
var/T = PARALLAX_LOOP_TIME / L.speed
if (isnull(shortesttimer))
shortesttimer = T
if (T < shortesttimer)
shortesttimer = T
L.transform = newtransform
animate(L, transform = matrix(), time = T, easing = QUAD_EASING | (new_parallax_movedir ? EASE_IN : EASE_OUT), flags = ANIMATION_END_NOW)
if (new_parallax_movedir)
L.transform = newtransform
animate(transform = matrix(), time = T) //queue up another animate so lag doesn't create a shutter
C.parallax_movedir = new_parallax_movedir
if (C.parallax_animate_timer)
deltimer(C.parallax_animate_timer)
C.parallax_animate_timer = addtimer(src, .update_parallax_motionblur, min(shortesttimer, PARALLAX_LOOP_TIME), TIMER_NORMAL, C, animatedir, new_parallax_movedir, newtransform)
/datum/hud/proc/update_parallax_motionblur(client/C, animatedir, new_parallax_movedir, matrix/newtransform)
C.parallax_animate_timer = FALSE
for(var/thing in C.parallax_layers)
var/obj/screen/parallax_layer/L = thing
if (!new_parallax_movedir)
animate(L)
continue
var/newstate = initial(L.icon_state)
if (animatedir)
if(animatedir == NORTH || animatedir == SOUTH)
newstate += "_vertical"
else
newstate += "_horizontal"
var/T = PARALLAX_LOOP_TIME / L.speed
if (newstate in icon_states(L.icon))
L.icon_state = newstate
L.update_o(C.view)
L.transform = newtransform
animate(L, transform = matrix(), time = T, loop = -1, flags = ANIMATION_END_NOW)
C.screen |= C.parallax_dustmaster
/datum/hud/proc/update_parallax()
var/client/C = mymob.client
if(C.prefs.space_parallax)
parallax_on_clients |= C
for(var/obj/screen/parallax/bgobj in C.parallax)
C.screen |= bgobj
C.screen |= C.parallax_master
C.screen |= C.parallax_spacemaster
if(C.prefs.space_dust)
C.parallax_dustmaster.color = list(
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1)
else
C.parallax_dustmaster.color = list(0,0,0,0)
else
for(var/obj/screen/parallax/bgobj in C.parallax)
C.screen -= bgobj
parallax_on_clients -= C
C.screen -= C.parallax_master
C.screen -= C.parallax_spacemaster
C.parallax_dustmaster.color = list(0,0,0,0)
/datum/hud/proc/update_parallax_values()
var/client/C = mymob.client
if(!parallax_initialized)
return
if(!(locate(/turf/open/space) in trange(C.view,get_turf(C.eye))))
return
//ACTUALLY MOVING THE PARALLAX
var/turf/posobj = get_turf(C.eye)
var/area/areaobj = posobj.loc
// Update the movement direction of the parallax if necessary (for shuttles)
set_parallax_movedir(areaobj.parallax_movedir)
var/force
if(!C.previous_turf || (C.previous_turf.z != posobj.z))
C.previous_turf = posobj
force = TRUE
if (!force && world.time < C.last_parallax_shift+C.parallax_throttle)
return
//Doing it this way prevents parallax layers from "jumping" when you change Z-Levels.
var/offset_x = posobj.x - C.previous_turf.x
var/offset_y = posobj.y - C.previous_turf.y
var/offsetx = C.parallax_offset["horizontal"] + posobj.x - C.previous_turf.x
var/offsety = C.parallax_offset["vertical"] + posobj.y - C.previous_turf.y
C.parallax_offset["horizontal"] = offsetx
C.parallax_offset["vertical"] = offsety
if(!offset_x && !offset_y && !force)
return
var/last_delay = world.time - C.last_parallax_shift
last_delay = min(last_delay, C.parallax_throttle)
C.previous_turf = posobj
C.last_parallax_shift = world.time
for(var/thing in C.parallax_layers)
var/obj/screen/parallax_layer/L = thing
if (L.view_sized != C.view)
L.update_o(C.view)
var/change_x = offset_x * L.speed
L.offset_x -= change_x
var/change_y = offset_y * L.speed
L.offset_y -= change_y
if(L.offset_x > 240)
L.offset_x -= 480
if(L.offset_x < -240)
L.offset_x += 480
if(L.offset_y > 240)
L.offset_y -= 480
if(L.offset_y < -240)
L.offset_y += 480
var/maxoffset = 480 //480 = (15 tiles * 32 icon_size * 3 grid size / 2) - (15 tiles * 32 icon size / 2) for centering
var/minoffset = -960 //960 = (15 tiles * 32 icon_size * 3 grid size / 2) + (15 tiles * 32 icon size / 2) for centering
for(var/obj/screen/parallax/bgobj in C.parallax_movable)
var/accumulated_offset_x = bgobj.base_offset_x - round(offsetx * bgobj.parallax_speed * C.prefs.parallax_speed)
var/accumulated_offset_y = bgobj.base_offset_y - round(offsety * bgobj.parallax_speed * C.prefs.parallax_speed)
if(!areaobj.parallax_movedir && C.dont_animate_parallax <= world.time && (offset_x || offset_y) && abs(offset_x) <= max(C.parallax_throttle/world.tick_lag+1,1) && abs(offset_y) <= max(C.parallax_throttle/world.tick_lag+1,1) && (round(abs(change_x)) > 1 || round(abs(change_y)) > 1))
L.transform = matrix(1, 0, offset_x*L.speed, 0, 1, offset_y*L.speed)
animate(L, transform=matrix(), time = last_delay)
if(accumulated_offset_x > maxoffset)
accumulated_offset_x -= 1440 //3x3 grid, 15 tiles * 32 icon_size * 3 grid size
if(accumulated_offset_x < minoffset)
accumulated_offset_x += 1440
L.screen_loc = "CENTER-7:[round(L.offset_x,1)],CENTER-7:[round(L.offset_y,1)]"
if(accumulated_offset_y > maxoffset)
accumulated_offset_y -= 1440
if(accumulated_offset_y < minoffset)
accumulated_offset_y += 1440
/atom/movable/proc/update_parallax_contents()
if(length(client_mobs_in_contents))
for(var/thing in client_mobs_in_contents)
var/mob/M = thing
if(M && M.client && M.hud_used && length(M.client.parallax_layers))
M.hud_used.update_parallax()
bgobj.screen_loc = "CENTER:[accumulated_offset_x],CENTER:[accumulated_offset_y]"
/obj/screen/parallax_layer
icon = 'icons/effects/parallax.dmi'
var/speed = 1
var/offset_x = 0
var/offset_y = 0
var/view_sized
blend_mode = BLEND_ADD
plane = PLANE_SPACE_PARALLAX
screen_loc = "CENTER-7,CENTER-7"
mouse_opacity = 0
//Parallax generation code below
#define PARALLAX4_ICON_NUMBER 20
#define PARALLAX3_ICON_NUMBER 14
#define PARALLAX2_ICON_NUMBER 10
/obj/screen/parallax_layer/New(view)
..()
if (!view)
view = world.view
update_o(view)
/datum/subsystem/parallax/proc/create_global_parallax_icons()
var/list/plane1 = list()
var/list/plane2 = list()
var/list/plane3 = list()
var/list/pixel_x = list()
var/list/pixel_y = list()
var/index = 1
for(var/i = 0 to (PARALLAX_IMAGE_TILES-1))
for(var/j = 1 to 9)
plane1 += rand(1,26)
plane2 += rand(1,26)
plane3 += rand(1,26)
pixel_x += world.icon_size * (i%PARALLAX_IMAGE_WIDTH)
pixel_y += world.icon_size * round(i/PARALLAX_IMAGE_WIDTH)
/obj/screen/parallax_layer/proc/update_o(view)
if (!view)
view = world.view
var/list/new_overlays = list()
var/count = Ceiling(view/(480/world.icon_size))+1
for(var/x in -count to count)
for(var/y in -count to count)
if(x == 0 && y == 0)
continue
var/image/I = image(icon, null, icon_state)
I.transform = matrix(1, 0, x*480, 0, 1, y*480)
new_overlays += I
for(var/i in 0 to 8)
var/obj/screen/parallax/parallax_layer = PoolOrNew(/obj/screen/parallax)
overlays = new_overlays
view_sized = view
var/list/L = list()
for(var/j in 1 to PARALLAX_IMAGE_TILES)
if(plane1[j+i*PARALLAX_IMAGE_TILES] <= PARALLAX4_ICON_NUMBER)
var/image/I = image('icons/turf/space_parallax4.dmi',"[plane1[j+i*PARALLAX_IMAGE_TILES]]")
I.pixel_x = pixel_x[j]
I.pixel_y = pixel_y[j]
L += I
/obj/screen/parallax_layer/layer_1
icon_state = "layer1"
speed = 0.6
layer = 1
parallax_layer.overlays = L
parallax_layer.parallax_speed = 0
parallax_layer.calibrate_parallax(i+1)
parallax_icon[index] = parallax_layer
index++
/obj/screen/parallax_layer/layer_2
icon_state = "layer2"
speed = 1
layer = 2
for(var/i in 0 to 8)
var/obj/screen/parallax/parallax_layer = PoolOrNew(/obj/screen/parallax)
/obj/screen/parallax_pmaster
appearance_flags = PLANE_MASTER
plane = PLANE_SPACE_PARALLAX
blend_mode = BLEND_MULTIPLY
mouse_opacity = FALSE
screen_loc = "CENTER-7,CENTER-7"
var/list/L = list()
for(var/j in 1 to PARALLAX_IMAGE_TILES)
if(plane2[j+i*PARALLAX_IMAGE_TILES] <= PARALLAX3_ICON_NUMBER)
var/image/I = image('icons/turf/space_parallax3.dmi',"[plane2[j+i*PARALLAX_IMAGE_TILES]]")
I.pixel_x = pixel_x[j]
I.pixel_y = pixel_y[j]
L += I
/obj/screen/parallax_space_whitifier
appearance_flags = PLANE_MASTER
plane = PLANE_SPACE
color = list(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1,
0, 0, 0, 0
)
screen_loc = "CENTER-7,CENTER-7"
parallax_layer.overlays = L
parallax_layer.parallax_speed = 0.5
parallax_layer.calibrate_parallax(i+1)
parallax_icon[index] = parallax_layer
index++
for(var/i in 0 to 8)
var/obj/screen/parallax/parallax_layer = PoolOrNew(/obj/screen/parallax)
var/list/L = list()
for(var/j in 1 to PARALLAX_IMAGE_TILES)
if(plane3[j+i*PARALLAX_IMAGE_TILES] <= PARALLAX2_ICON_NUMBER)
var/image/I = image('icons/turf/space_parallax2.dmi',"[plane3[j+i*PARALLAX_IMAGE_TILES]]")
I.pixel_x = pixel_x[j]
I.pixel_y = pixel_y[j]
L += I
#undef LOOP_NONE
#undef LOOP_NORMAL
#undef LOOP_REVERSE
#undef LOOP_TIME
parallax_layer.overlays = L
parallax_layer.parallax_speed = 1
parallax_layer.calibrate_parallax(i+1)
parallax_icon[index] = parallax_layer
index++
parallax_initialized = 1
/obj/screen/parallax/proc/calibrate_parallax(var/i)
if(!i) return
/* Placement of screen objects
1 2 3
4 5 6
7 8 9
*/
base_offset_x = -PARALLAX_IMAGE_WIDTH*world.icon_size/2
base_offset_y = -PARALLAX_IMAGE_WIDTH*world.icon_size/2
switch(i)
if(1,4,7)
base_offset_x -= world.icon_size*PARALLAX_IMAGE_WIDTH
if(3,6,9)
base_offset_x += world.icon_size*PARALLAX_IMAGE_WIDTH
switch(i)
if(1,2,3)
base_offset_y += world.icon_size*PARALLAX_IMAGE_WIDTH
if(7,8,9)
base_offset_y -= world.icon_size*PARALLAX_IMAGE_WIDTH
screen_loc = "CENTER:[base_offset_x],CENTER:[base_offset_y]"
#undef PARALLAX4_ICON_NUMBER
#undef PARALLAX3_ICON_NUMBER
#undef PARALLAX2_ICON_NUMBER
#undef PARALLAX_IMAGE_WIDTH
#undef PARALLAX_IMAGE_TILES
-28
View File
@@ -1,28 +0,0 @@
/obj/screen/plane_master
screen_loc = "CENTER"
icon_state = "blank"
appearance_flags = PLANE_MASTER|NO_CLIENT_COLOR
blend_mode = BLEND_OVERLAY
/obj/screen/plane_master/New()
if(blend_mode == BLEND_MULTIPLY)
//What is this? Read http://www.byond.com/forum/?post=2141928
var/image/backdrop = image('icons/mob/screen_gen.dmi', "black")
backdrop.transform = matrix(200, 0, 0, 0, 200, 0)
backdrop.layer = BACKGROUND_LAYER
backdrop.blend_mode = BLEND_OVERLAY
overlays += backdrop
..()
/obj/screen/plane_master/game_world
name = "game world plane master"
plane = GAME_PLANE
blend_mode = BLEND_OVERLAY
/obj/screen/plane_master/lighting
name = "lighting plane master"
plane = LIGHTING_PLANE
blend_mode = BLEND_OVERLAY
// blend_mode = BLEND_MULTIPLY
// color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,0, 0.1,0.1,0.1,0)
mouse_opacity = 0
+45 -80
View File
@@ -5,15 +5,9 @@
name = "cyborg module"
icon_state = "nomod"
/obj/screen/robot/Click()
if(isobserver(usr))
return 1
/obj/screen/robot/module/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
if(R.module.type != /obj/item/weapon/robot_module)
if(R.module)
R.hud_used.toggle_show_robot_modules()
return 1
R.pick_module()
@@ -23,8 +17,6 @@
icon_state = "inv1"
/obj/screen/robot/module1/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.toggle_module(1)
@@ -33,8 +25,6 @@
icon_state = "inv2"
/obj/screen/robot/module2/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.toggle_module(2)
@@ -43,8 +33,6 @@
icon_state = "inv3"
/obj/screen/robot/module3/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.toggle_module(3)
@@ -53,8 +41,6 @@
icon_state = "radio"
/obj/screen/robot/radio/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.radio.interact(R)
@@ -63,8 +49,6 @@
icon_state = "store"
/obj/screen/robot/store/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.uneq_active()
@@ -73,8 +57,6 @@
icon_state = "lamp0"
/obj/screen/robot/lamp/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.control_headlamp()
@@ -83,24 +65,14 @@
icon_state = "ionpulse0"
/obj/screen/robot/thrusters/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.toggle_ionpulse()
/datum/hud/robot
ui_style_icon = 'icons/mob/screen_cyborg.dmi'
/datum/hud/robot/New(mob/owner, ui_style = 'icons/mob/screen_cyborg.dmi')
/datum/hud/robot/New(mob/owner)
..()
var/mob/living/silicon/robot/mymobR = mymob
var/obj/screen/using
using = new/obj/screen/wheel/talk
using.screen_loc = ui_borg_talk_wheel
wheels += using
static_inventory += using
//Radio
using = new /obj/screen/robot/radio()
using.screen_loc = ui_borg_radio
@@ -161,9 +133,9 @@
infodisplay += healths
//Installed Module
mymobR.hands = new /obj/screen/robot/module()
mymobR.hands.screen_loc = ui_borg_module
static_inventory += mymobR.hands
mymob.hands = new /obj/screen/robot/module()
mymob.hands.screen_loc = ui_borg_module
static_inventory += mymob.hands
//Store
module_store_icon = new /obj/screen/robot/store()
@@ -182,53 +154,50 @@
/datum/hud/proc/toggle_show_robot_modules()
if(!iscyborg(mymob)) return
if(!isrobot(mymob)) return
var/mob/living/silicon/robot/R = mymob
var/mob/living/silicon/robot/r = mymob
R.shown_robot_modules = !R.shown_robot_modules
r.shown_robot_modules = !r.shown_robot_modules
update_robot_modules_display()
/datum/hud/proc/update_robot_modules_display(mob/viewer)
if(!iscyborg(mymob)) return
/datum/hud/proc/update_robot_modules_display()
if(!isrobot(mymob)) return
var/mob/living/silicon/robot/R = mymob
var/mob/living/silicon/robot/r = mymob
var/mob/screenmob = viewer || R
if(!R.module)
if(!r.client)
return
if(!R.client)
if(!r.module)
return
if(R.shown_robot_modules && screenmob.hud_used.hud_shown)
if(r.shown_robot_modules && hud_shown)
//Modules display is shown
screenmob.client.screen += module_store_icon //"store" icon
r.client.screen += module_store_icon //"store" icon
if(!R.module.modules)
if(!r.module.modules)
usr << "<span class='danger'>Selected module has no modules to select</span>"
return
if(!R.robot_modules_background)
if(!r.robot_modules_background)
return
var/display_rows = Ceiling(length(R.module.get_inactive_modules()) / 8)
R.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7"
screenmob.client.screen += R.robot_modules_background
var/display_rows = Ceiling(length(r.module.get_inactive_modules()) / 8)
r.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7"
r.client.screen += r.robot_modules_background
var/x = -4 //Start at CENTER-4,SOUTH+1
var/y = 1
for(var/atom/movable/A in R.module.get_inactive_modules())
for(var/atom/movable/A in r.module.get_inactive_modules())
//Module is not currently active
screenmob.client.screen += A
r.client.screen += A
if(x < 0)
A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7"
else
A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7"
A.layer = ABOVE_HUD_LAYER
A.plane = ABOVE_HUD_PLANE
x++
if(x == 4)
@@ -237,41 +206,37 @@
else
//Modules display is hidden
screenmob.client.screen -= module_store_icon //"store" icon
r.client.screen -= module_store_icon //"store" icon
for(var/atom/A in R.module.get_inactive_modules())
for(var/atom/A in r.module.get_inactive_modules())
//Module is not currently active
screenmob.client.screen -= A
R.shown_robot_modules = 0
screenmob.client.screen -= R.robot_modules_background
r.client.screen -= A
r.shown_robot_modules = 0
r.client.screen -= r.robot_modules_background
/mob/living/silicon/robot/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/robot(src)
/datum/hud/robot/persistent_inventory_update(mob/viewer)
/datum/hud/robot/persistant_inventory_update()
if(!mymob)
return
var/mob/living/silicon/robot/R = mymob
var/mob/screenmob = viewer || R
if(screenmob.hud_used)
if(screenmob.hud_used.hud_shown)
for(var/i in 1 to R.held_items.len)
var/obj/item/I = R.held_items[i]
if(I)
switch(i)
if(1)
I.screen_loc = ui_inv1
if(2)
I.screen_loc = ui_inv2
if(3)
I.screen_loc = ui_inv3
else
return
screenmob.client.screen += I
else
for(var/obj/item/I in R.held_items)
screenmob.client.screen -= I
if(hud_shown)
if(R.module_state_1)
R.module_state_1.screen_loc = ui_inv1
R.client.screen += R.module_state_1
if(R.module_state_2)
R.module_state_2.screen_loc = ui_inv2
R.client.screen += R.module_state_2
if(R.module_state_3)
R.module_state_3.screen_loc = ui_inv3
R.client.screen += R.module_state_3
else
if(R.module_state_1)
R.module_state_1.screen_loc = null
if(R.module_state_2)
R.module_state_2.screen_loc = null
if(R.module_state_3)
R.module_state_3.screen_loc = null
+47 -231
View File
@@ -10,15 +10,11 @@
name = ""
icon = 'icons/mob/screen_gen.dmi'
layer = ABOVE_HUD_LAYER
plane = ABOVE_HUD_PLANE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
unacidable = 1
appearance_flags = APPEARANCE_UI
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/datum/hud/hud = null // A reference to the owner HUD, if any.
/obj/screen/take_damage()
return
/obj/screen/Destroy()
master = null
return ..()
@@ -34,7 +30,6 @@
/obj/screen/swap_hand
layer = HUD_LAYER
plane = HUD_PLANE
name = "swap hand"
/obj/screen/swap_hand/Click()
@@ -59,31 +54,13 @@
/obj/screen/inventory/craft/Click()
var/mob/living/M = usr
if(isobserver(usr))
return
M.OpenCraftingMenu()
/obj/screen/inventory/area_creator
name = "create new area"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "area_edit"
screen_loc = ui_building
/obj/screen/inventory/area_creator/Click()
if(usr.incapacitated())
return 1
var/area/A = get_area(usr)
if(!A.outdoors)
usr << "<span class='warning'>There is already a defined structure here.</span>"
return 1
create_area(usr)
/obj/screen/inventory
var/slot_id // The indentifier for the slot. It has nothing to do with ID cards.
var/icon_empty // Icon when empty. For now used only by humans.
var/icon_full // Icon when contains an item. For now used only by humans.
layer = HUD_LAYER
plane = HUD_PLANE
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
@@ -96,7 +73,8 @@
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(usr.attack_ui(slot_id))
usr.update_inv_hands()
usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0)
return 1
/obj/screen/inventory/update_icon()
@@ -113,15 +91,13 @@
var/image/active_overlay
var/image/handcuff_overlay
var/image/blocked_overlay
var/held_index = 0
/obj/screen/inventory/hand/update_icon()
..()
if(!active_overlay)
active_overlay = image("icon"=icon, "icon_state"="hand_active")
if(!handcuff_overlay)
var/state = (!(held_index % 2)) ? "markus" : "gabrielle"
var/state = (slot_id == slot_r_hand) ? "markus" : "gabrielle"
handcuff_overlay = image("icon"='icons/mob/screen_gen.dmi', "icon_state"=state)
if(!blocked_overlay)
blocked_overlay = image("icon"='icons/mob/screen_gen.dmi', "icon_state"="blocked")
@@ -133,14 +109,17 @@
var/mob/living/carbon/C = hud.mymob
if(C.handcuffed)
add_overlay(handcuff_overlay)
if(held_index)
if(!C.has_hand_for_held_index(held_index))
if(slot_id == slot_r_hand)
if(!C.has_right_hand())
add_overlay(blocked_overlay)
else if(slot_id == slot_l_hand)
if(!C.has_left_hand())
add_overlay(blocked_overlay)
if(held_index == hud.mymob.active_hand_index)
if(slot_id == slot_l_hand && hud.mymob.hand)
add_overlay(active_overlay)
else if(slot_id == slot_r_hand && !hud.mymob.hand)
add_overlay(active_overlay)
/obj/screen/inventory/hand/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
@@ -154,7 +133,11 @@
if(ismob(usr))
var/mob/M = usr
M.swap_hand(held_index)
switch(name)
if("right hand", "r_hand")
M.activate_hand("r")
if("left hand", "l_hand")
M.activate_hand("l")
return 1
/obj/screen/close
@@ -172,7 +155,6 @@
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_drop"
layer = HUD_LAYER
plane = HUD_PLANE
/obj/screen/drop/Click()
usr.drop_item_v()
@@ -189,19 +171,19 @@
var/_y = text2num(params2list(params)["icon-y"])
if(_x<=16 && _y<=16)
usr.a_intent_change(INTENT_HARM)
usr.a_intent_change("harm")
else if(_x<=16 && _y>=17)
usr.a_intent_change(INTENT_HELP)
usr.a_intent_change("help")
else if(_x>=17 && _y<=16)
usr.a_intent_change(INTENT_GRAB)
usr.a_intent_change("grab")
else if(_x>=17 && _y>=17)
usr.a_intent_change(INTENT_DISARM)
usr.a_intent_change("disarm")
else
usr.a_intent_change(INTENT_HOTKEY_RIGHT)
usr.a_intent_change("right")
/obj/screen/act_intent/alien
icon = 'icons/mob/screen_alien.dmi'
@@ -240,10 +222,12 @@
C << "<span class='warning'>You are not wearing an internals mask!</span>"
return
var/obj/item/I = C.is_holding_item_of_type(/obj/item/weapon/tank)
if(I)
C << "<span class='notice'>You are now running on internals from the [I] on your [C.get_held_index_name(C.get_held_index_of_item(I))].</span>"
C.internal = I
if(istype(C.l_hand, /obj/item/weapon/tank))
C << "<span class='notice'>You are now running on internals from the [C.l_hand] on your left hand.</span>"
C.internal = C.l_hand
else if(istype(C.r_hand, /obj/item/weapon/tank))
C << "<span class='notice'>You are now running on internals from the [C.r_hand] on your right hand.</span>"
C.internal = C.r_hand
else if(ishuman(C))
var/mob/living/carbon/human/H = C
if(istype(H.s_store, /obj/item/weapon/tank))
@@ -277,19 +261,14 @@
icon_state = "running"
/obj/screen/mov_intent/Click()
toggle(usr)
/obj/screen/mov_intent/proc/toggle(mob/user)
if(isobserver(user))
return
switch(user.m_intent)
switch(usr.m_intent)
if("run")
user.m_intent = MOVE_INTENT_WALK
usr.m_intent = "walk"
icon_state = "walking"
if("walk")
user.m_intent = MOVE_INTENT_RUN
usr.m_intent = "run"
icon_state = "running"
user.update_icons()
usr.update_icons()
/obj/screen/pull
name = "stop pulling"
@@ -297,8 +276,6 @@
icon_state = "pull"
/obj/screen/pull/Click()
if(isobserver(usr))
return
usr.stop_pulling()
/obj/screen/pull/update_icon(mob/mymob)
@@ -313,7 +290,6 @@
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_resist"
layer = HUD_LAYER
plane = HUD_PLANE
/obj/screen/resist/Click()
if(isliving(usr))
@@ -331,7 +307,7 @@
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(master)
var/obj/item/I = usr.get_active_held_item()
var/obj/item/I = usr.get_active_hand()
if(I)
master.attackby(I, usr, params)
return 1
@@ -353,65 +329,55 @@
var/selecting = "chest"
/obj/screen/zone_sel/Click(location, control,params)
if(isobserver(usr))
return
var/list/PL = params2list(params)
var/icon_x = text2num(PL["icon-x"])
var/icon_y = text2num(PL["icon-y"])
var/choice
var/old_selecting = selecting //We're only going to update_icon() if there's been a change
switch(icon_y)
if(1 to 9) //Legs
switch(icon_x)
if(10 to 15)
choice = "r_leg"
selecting = "r_leg"
if(17 to 22)
choice = "l_leg"
selecting = "l_leg"
else
return 1
if(10 to 13) //Hands and groin
switch(icon_x)
if(8 to 11)
choice = "r_arm"
selecting = "r_arm"
if(12 to 20)
choice = "groin"
selecting = "groin"
if(21 to 24)
choice = "l_arm"
selecting = "l_arm"
else
return 1
if(14 to 22) //Chest and arms to shoulders
switch(icon_x)
if(8 to 11)
choice = "r_arm"
selecting = "r_arm"
if(12 to 20)
choice = "chest"
selecting = "chest"
if(21 to 24)
choice = "l_arm"
selecting = "l_arm"
else
return 1
if(23 to 30) //Head, but we need to check for eye or mouth
if(icon_x in 12 to 20)
choice = "head"
selecting = "head"
switch(icon_y)
if(23 to 24)
if(icon_x in 15 to 17)
choice = "mouth"
selecting = "mouth"
if(26) //Eyeline, eyes are on 15 and 17
if(icon_x in 14 to 18)
choice = "eyes"
selecting = "eyes"
if(25 to 27)
if(icon_x in 15 to 17)
choice = "eyes"
selecting = "eyes"
return set_selected_zone(choice, usr)
/obj/screen/zone_sel/proc/set_selected_zone(choice, mob/user)
if(isobserver(user))
return
if(choice != selecting)
selecting = choice
if(old_selecting != selecting)
update_icon(usr)
return 1
@@ -438,7 +404,6 @@
blend_mode = BLEND_ADD
screen_loc = "WEST,SOUTH to EAST,NORTH"
layer = FLASH_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/damageoverlay
icon = 'icons/mob/screen_full.dmi'
@@ -448,7 +413,6 @@
screen_loc = "CENTER-7,CENTER-7"
mouse_opacity = 0
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/healths
name = "health"
@@ -491,17 +455,6 @@
screen_loc = ui_health
mouse_opacity = 0
/obj/screen/healths/clock
icon = 'icons/mob/actions.dmi'
icon_state = "bg_clock"
screen_loc = ui_health
mouse_opacity = 0
/obj/screen/healths/clock/gear
icon = 'icons/mob/clockwork_mobs.dmi'
icon_state = "bg_gear"
screen_loc = ui_internal
/obj/screen/healths/revenant
name = "essence"
icon = 'icons/mob/actions.dmi'
@@ -512,140 +465,3 @@
/obj/screen/healthdoll
name = "health doll"
screen_loc = ui_healthdoll
/obj/screen/wheel
name = "wheel"
layer = HUD_LAYER
plane = HUD_PLANE
icon_state = ""
screen_loc = null //if you make a new wheel, remember to give it a screen_loc
var/list/buttons_names = list() //list of the names for each button, its length is the amount of buttons.
var/toggled = 0 //wheel is hidden/shown
var/wheel_buttons_type //the type of buttons used with this wheel.
var/list/buttons_list = list()
/obj/screen/wheel/New()
..()
build_options()
//we create the buttons for the wheel and place them in a square spiral fashion.
/obj/screen/wheel/proc/build_options()
var/obj/screen/wheel_button/close_wheel/CW = new ()
buttons_list += CW //the close option
CW.wheel = src
var/list/offset_x_list = list()
var/list/offset_y_list = list()
var/num = 1
var/N = 1
var/M = 0
var/sign = -1
my_loop:
while(offset_y_list.len < buttons_names.len)
for(var/i=1, i<=num, i++)
offset_y_list += N
offset_x_list += M
if(offset_y_list.len == buttons_names.len)
break my_loop
if(N != 0)
N = 0
M = -sign
else
N = sign
M = 0
sign = -sign
num++
var/screenx = 8
var/screeny = 8
for(var/i = 1, i <= buttons_names.len, i++)
var/obj/screen/wheel_button/WB = new wheel_buttons_type()
WB.wheel = src
buttons_list += WB
screenx += offset_x_list[i]
screeny += offset_y_list[i]
WB.screen_loc = "[screenx], [screeny]"
set_button(WB, i)
/obj/screen/wheel/proc/set_button(obj/screen/wheel_button/WB, button_number)
WB.name = buttons_names[button_number]
return
/obj/screen/wheel/Destroy()
for(var/obj/screen/S in buttons_list)
qdel(S)
return ..()
/obj/screen/wheel/Click()
if(world.time <= usr.next_move)
return
if(usr.stat)
return
if(isliving(usr))
var/mob/living/L = usr
if(toggled)
L.client.screen -= buttons_list
else
L.client.screen |= buttons_list
toggled = !toggled
/obj/screen/wheel/talk
name = "talk wheel"
icon_state = "talk_wheel"
screen_loc = "11:6,2:-11"
wheel_buttons_type = /obj/screen/wheel_button/talk
buttons_names = list("help","hello","bye","stop","thanks","come","out", "yes", "no")
var/list/word_messages = list(list("Help!","Help me!"), list("Hello.", "Hi."), list("Bye.", "Goodbye."),\
list("Stop!", "Halt!"), list("Thanks.", "Thanks!", "Thank you."), \
list("Come.", "Follow me."), list("Out!", "Go away!", "Get out!"), \
list("Yes.", "Affirmative."), list("No.", "Negative"))
/obj/screen/wheel/talk/set_button(obj/screen/wheel_button/WB, button_number)
..()
var/obj/screen/wheel_button/talk/T = WB //we already know what type the button is exactly.
T.icon_state = "talk_[T.name]"
T.word_messages = word_messages[button_number]
/obj/screen/wheel_button
name = "default wheel button"
screen_loc = "8,8"
layer = HUD_LAYER
plane = HUD_PLANE
mouse_opacity = 2
var/obj/screen/wheel/wheel
/obj/screen/wheel_button/Destroy()
wheel = null
return ..()
/obj/screen/wheel_button/close_wheel
name = "close wheel"
icon_state = "x3"
/obj/screen/wheel_button/close_wheel/Click()
if(isliving(usr))
var/mob/living/L = usr
L.client.screen -= wheel.buttons_list
wheel.toggled = !wheel.toggled
/obj/screen/wheel_button/talk
name = "talk option"
icon_state = "talk_help"
var/talk_cooldown = 0
var/list/word_messages = list()
/obj/screen/wheel_button/talk/Click(location, control,params)
if(isliving(usr))
var/mob/living/L = usr
if(L.stat)
return
if(word_messages.len && talk_cooldown < world.time)
talk_cooldown = world.time + 10
L.say(pick(word_messages))
+2 -2
View File
@@ -68,11 +68,11 @@
var/obj/screen/using
using = new /obj/screen/swarmer/FabricateTrap()
using.screen_loc = ui_hand_position(2)
using.screen_loc = ui_rhand
static_inventory += using
using = new /obj/screen/swarmer/Barricade()
using.screen_loc = ui_hand_position(1)
using.screen_loc = ui_lhand
static_inventory += using
using = new /obj/screen/swarmer/Replicate()
+31 -29
View File
@@ -8,14 +8,11 @@
return
/obj/attackby(obj/item/I, mob/living/user, params)
if(unique_rename && istype(I, /obj/item/weapon/pen))
rewrite(user)
else
return I.attack_obj(src, user)
return I.attack_obj(src, user)
/mob/living/attackby(obj/item/I, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
if(user.a_intent == INTENT_HARM && stat == DEAD && butcher_results) //can we butcher it?
if(user.a_intent == "harm" && stat == DEAD && butcher_results) //can we butcher it?
var/sharpness = I.is_sharp()
if(sharpness)
user << "<span class='notice'>You begin to butcher [src]...</span>"
@@ -37,7 +34,6 @@
user.lastattacked = M
M.lastattacker = user
user.do_attack_animation(M)
M.attacked_by(src, user)
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
@@ -52,33 +48,29 @@
user.do_attack_animation(O)
O.attacked_by(src, user)
/atom/movable/proc/attacked_by()
return
/obj/attacked_by(obj/item/I, mob/living/user)
if(I.force)
visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", null, null, COMBAT_MESSAGE_RANGE)
//only witnesses close by and the victim see a hit message.
take_damage(I.force, I.damtype, "melee", 1)
user.visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", "<span class='danger'>You hit [src] with [I]!</span>")
/mob/living/attacked_by(obj/item/I, mob/living/user)
send_item_attack_message(I, user)
if(I.force)
apply_damage(I.force, I.damtype)
if(I.damtype == BRUTE)
if(prob(33))
I.add_mob_blood(src)
var/turf/location = get_turf(src)
add_splatter_floor(location)
if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
user.add_mob_blood(src)
return TRUE //successful attack
if(user != src)
user.do_attack_animation(src)
if(send_item_attack_message(I, user))
if(apply_damage(I.force, I.damtype))
if(I.damtype == BRUTE)
if(prob(33))
I.add_mob_blood(src)
var/turf/location = get_turf(src)
add_splatter_floor(location)
if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
user.add_mob_blood(src)
return TRUE
/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user)
if(I.force < force_threshold || I.damtype == STAMINA)
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), 1, -1)
else
return ..()
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
@@ -95,17 +87,27 @@
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
var/message_verb = "attacked"
if(I.attack_verb && I.attack_verb.len)
if(I.attack_verb.len)
message_verb = "[pick(I.attack_verb)]"
else if(!I.force)
return
return 0
var/message_hit_area = ""
if(hit_area)
message_hit_area = " in the [hit_area]"
var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]."
if(user in viewers(src, null))
attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!"
visible_message("<span class='danger'>[attack_message]</span>", \
"<span class='userdanger'>[attack_message]</span>", null, COMBAT_MESSAGE_RANGE)
visible_message("<span class='danger'>[attack_message]</span>",
"<span class='userdanger'>[attack_message]</span>")
return 1
/mob/living/simple_animal/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
if(!I.force)
user.visible_message("<span class='warning'>[user] gently taps [src] with [I].</span>",\
"<span class='warning'>This weapon is ineffective, it does no damage!</span>")
else if(I.force < force_threshold || I.damtype == STAMINA)
visible_message("<span class='warning'>[I] bounces harmlessly off of [src].</span>",\
"<span class='warning'>[I] bounces harmlessly off of [src]!</span>")
else
return ..()
-1
View File
@@ -15,7 +15,6 @@
// Otherwise jump
else if(A.loc)
loc = get_turf(A)
update_parallax_contents()
/mob/dead/observer/ClickOn(var/atom/A, var/params)
if(client.click_intercept)
+10 -67
View File
@@ -20,7 +20,7 @@
var/override = 0
for(var/datum/mutation/human/HM in dna.mutations)
override += HM.on_attack_hand(src, A, proximity)
override += HM.on_attack_hand(src, A)
if(override)
return
@@ -50,8 +50,9 @@
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_ranged_attack(src, A)
if(isturf(A) && get_dist(src,A) <= 1)
src.Move_Pulled(A)
var/turf/T = A
if(istype(T) && get_dist(src,T) <= 1)
src.Move_Pulled(T)
/*
Animals & All Unspecified
@@ -59,6 +60,10 @@
/mob/living/UnarmedAttack(atom/A)
A.attack_animal(src)
/mob/living/simple_animal/hostile/UnarmedAttack(atom/A)
target = A
AttackingTarget()
/atom/proc/attack_animal(mob/user)
return
/mob/living/RestrainedClickOn(atom/A)
@@ -82,7 +87,7 @@
/mob/living/carbon/monkey/RestrainedClickOn(atom/A)
if(..())
return
if(a_intent != INTENT_HARM || !ismob(A))
if(a_intent != "harm" || !ismob(A))
return
if(is_muzzled())
return
@@ -110,7 +115,7 @@
*/
/mob/living/carbon/alien/UnarmedAttack(atom/A)
A.attack_alien(src)
/atom/proc/attack_alien(mob/living/carbon/alien/user)
/atom/proc/attack_alien(mob/user)
attack_paw(user)
return
/mob/living/carbon/alien/RestrainedClickOn(atom/A)
@@ -134,68 +139,6 @@
/mob/living/simple_animal/slime/RestrainedClickOn(atom/A)
return
/*
Drones
*/
/mob/living/simple_animal/drone/UnarmedAttack(atom/A)
A.attack_drone(src)
/atom/proc/attack_drone(mob/living/simple_animal/drone/user)
attack_hand(user) //defaults to attack_hand. Override it when you don't want drones to do same stuff as humans.
/mob/living/simple_animal/slime/RestrainedClickOn(atom/A)
return
/*
True Devil
*/
/mob/living/carbon/true_devil/UnarmedAttack(atom/A, proximity)
A.attack_hand(src)
/*
Brain
*/
/mob/living/brain/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
return
/*
pAI
*/
/mob/living/silicon/pai/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
return
/*
Simple animals
*/
/mob/living/simple_animal/UnarmedAttack(atom/A, proximity)
if(!dextrous)
return ..()
if(!ismob(A))
A.attack_hand(src)
update_inv_hands()
/*
Hostile animals
*/
/mob/living/simple_animal/hostile/UnarmedAttack(atom/A)
target = A
if(dextrous && !is_type_in_typecache(A, environment_target_typecache) && !ismob(A))
..()
else
AttackingTarget()
/*
New Players:
Have no reason to click on anything at all.
+4 -10
View File
@@ -1,13 +1,11 @@
/*
Telekinesis
This needs more thinking out, but I might as well.
*/
var/const/tk_maxrange = 15
/*
Telekinetic attack:
By default, emulate the user's unarmed attack
*/
/atom/proc/attack_tk(mob/user)
@@ -19,7 +17,6 @@ var/const/tk_maxrange = 15
/*
This is similar to item attack_self, but applies to anything
that you can grab with a telekinetic grab.
It is used for manipulating things at range, for example, opening and closing closets.
There are not a lot of defaults at this time, add more where appropriate.
*/
@@ -57,7 +54,6 @@ var/const/tk_maxrange = 15
/*
TK Grab Item (the workhorse of old TK)
* If you have not grabbed something, do a normal tk attack
* If you have something, throw it at the target. If it is already adjacent, do a normal attackby()
* If you click what you are holding, or attack_self(), do an attack_self_tk() on it.
@@ -70,9 +66,8 @@ var/const/tk_maxrange = 15
icon_state = "2"
flags = NOBLUDGEON | ABSTRACT | DROPDEL
//item_state = null
w_class = WEIGHT_CLASS_GIGANTIC
w_class = 10
layer = ABOVE_HUD_LAYER
plane = ABOVE_HUD_PLANE
var/last_throw = 0
var/atom/movable/focus = null
@@ -87,7 +82,7 @@ var/const/tk_maxrange = 15
//stops TK grabs being equipped anywhere but into hands
/obj/item/tk_grab/equipped(mob/user, slot)
if(slot == slot_hands)
if( (slot == slot_l_hand) || (slot== slot_r_hand) )
return
qdel(src)
return
@@ -190,7 +185,7 @@ var/const/tk_maxrange = 15
return
/obj/item/tk_grab/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is using [user.p_their()] telekinesis to choke [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is using \his telekinesis to choke \himself! It looks like \he's trying to commit suicide.</span>")
return (OXYLOSS)
/*Not quite done likely needs to use something thats not get_step_to
@@ -218,5 +213,4 @@ var/const/tk_maxrange = 15
var/X = source:x
var/Y = source:y
var/Z = source:z
*/
*/
+1 -2
View File
@@ -22,7 +22,7 @@ var/const/SIZEPLAY_HUGE=5
/proc/get_matrix_smallest()
var/matrix/mtrx=new()
return mtrx.Scale(0.65)
/* omited for quick error resolution while porting -Pooj
proc/get_racelist(var/mob/user)//This proc returns a list of species that 'user' has available to them. It searches the list of ckeys attached to the 'whitelist' var for a species and also checks if they're an admin.
for(var/spath in subtypesof(/datum/species))
var/datum/species/S = new spath()
@@ -32,4 +32,3 @@ proc/get_racelist(var/mob/user)//This proc returns a list of species that 'user'
else if(!S.whitelisted && S.roundstart) //Normal roundstart species will be handled here.
whitelisted_species_list[S.id] = S.type
return whitelisted_species_list
*/
+9 -94
View File
@@ -1,4 +1,4 @@
//Configuraton defines //TODO: Move all yes/no switches into bitflags
f//Configuraton defines //TODO: Move all yes/no switches into bitflags
//Used by jobs_have_maint_access
#define ASSISTANTS_HAVE_MAINT_ACCESS 1
@@ -18,7 +18,6 @@
var/server_suffix = 0 // generate numeric suffix based on server port
var/lobby_countdown = 120 // In between round countdown.
var/round_end_countdown = 25 // Post round murder death kill countdown
var/hub = 0
var/log_ooc = 0 // log OOC channel
var/log_access = 0 // log login/logout
@@ -34,7 +33,6 @@
var/log_adminchat = 0 // log admin chat messages
var/log_pda = 0 // log pda messages
var/log_hrefs = 0 // log all links clicked in-game. Could be used for debugging and tracking down exploits
var/log_twitter = 0 // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases.
var/log_world_topic = 0 // log all world.Topic() calls
var/sql_enabled = 0 // for sql switching
var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour
@@ -72,11 +70,6 @@
var/forbid_singulo_possession = 0
var/useircbot = 0
var/check_randomizer = 0
var/allow_panic_bunker_bounce = 0 //Send new players somewhere else
var/panic_server_name = "somewhere else"
//IP Intel vars
var/ipintel_email
var/ipintel_rating_bad = 1
@@ -87,7 +80,6 @@
var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database
var/use_account_age_for_jobs = 0 //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected.
var/see_own_notes = 0 //Can players see their own admin notes (read-only)? Config option in config.txt
//Population cap vars
@@ -104,8 +96,6 @@
var/list/modes = list() // allowed modes
var/list/votable_modes = list() // votable modes
var/list/probabilities = list() // relative probability of each mode
var/list/min_pop = list() // overrides for acceptible player counts in a mode
var/list/max_pop = list()
var/humans_need_surnames = 0
var/allow_ai = 0 // allow ai job
@@ -147,6 +137,9 @@
var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
var/health_threshold_crit = 0
var/health_threshold_dead = -100
var/revival_pod_plants = 1
var/revival_cloning = 1
var/revival_brain_life = -1
@@ -174,8 +167,6 @@
var/silent_ai = 0
var/silent_borg = 0
var/damage_multiplier = 1 //Modifier for damage to all mobs. Impacts healing as well.
var/allowwebclient = 0
var/webclientmembersonly = 0
@@ -183,9 +174,6 @@
var/default_laws = 0 //Controls what laws the AI spawns with.
var/silicon_max_law_amount = 12
var/list/lawids = list()
var/list/law_weights = list()
var/assistant_cap = -1
@@ -194,7 +182,6 @@
var/grey_assistants = 0
var/lavaland_budget = 60
var/space_budget = 16
var/aggressive_changelog = 0
@@ -226,7 +213,6 @@
var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server."
var/cross_name = "Other server"
var/showircname = 0
/datum/configuration/New()
var/list/L = subtypesof(/datum/game_mode)
@@ -274,16 +260,12 @@
if(type == "config")
switch(name)
if("hub")
config.hub = 1
if("admin_legacy_system")
config.admin_legacy_system = 1
if("ban_legacy_system")
config.ban_legacy_system = 1
if("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
if("use_account_age_for_jobs")
config.use_account_age_for_jobs = 1
if("lobby_countdown")
config.lobby_countdown = text2num(value)
if("round_end_countdown")
@@ -316,8 +298,6 @@
config.log_pda = 1
if("log_hrefs")
config.log_hrefs = 1
if("log_twitter")
config.log_twitter = 1
if("log_world_topic")
config.log_world_topic = 1
if("allow_admin_ooccolor")
@@ -361,7 +341,7 @@
if("guest_ban")
guests_allowed = 0
if("usewhitelist")
config.usewhitelist = TRUE
config.usewhitelist = 1
if("allow_metadata")
config.allow_Metadata = 1
if("kick_inactive")
@@ -396,18 +376,6 @@
global.cross_allowed = 1
if("cross_comms_name")
cross_name = value
if("panic_server_name")
panic_server_name = value
if("panic_server_address")
global.panic_address = value
if(value != "byond:\\address:port")
allow_panic_bunker_bounce = 1
if("medal_hub_address")
global.medal_hub = value
if("medal_hub_password")
global.medal_pass = value
if("show_irc_name")
config.showircname = 1
if("see_own_notes")
config.see_own_notes = 1
if("soft_popcap")
@@ -428,8 +396,6 @@
config.notify_new_player_age = text2num(value)
if("irc_first_connection_alert")
config.irc_first_connection_alert = 1
if("check_randomizer")
config.check_randomizer = 1
if("ipintel_email")
if (value != "ch@nge.me")
config.ipintel_email = value
@@ -482,8 +448,10 @@
else if(type == "game_options")
switch(name)
if("damage_multiplier")
config.damage_multiplier = text2num(value)
if("health_threshold_crit")
config.health_threshold_crit = text2num(value)
if("health_threshold_dead")
config.health_threshold_dead = text2num(value)
if("revival_pod_plants")
config.revival_pod_plants = text2num(value)
if("revival_cloning")
@@ -552,34 +520,6 @@
config.midround_antag_time_check = text2num(value)
if("midround_antag_life_check")
config.midround_antag_life_check = text2num(value)
if("min_pop")
var/pop_pos = findtext(value, " ")
var/mode_name = null
var/mode_value = null
if(pop_pos)
mode_name = lowertext(copytext(value, 1, pop_pos))
mode_value = copytext(value, pop_pos + 1)
if(mode_name in config.modes)
config.min_pop[mode_name] = text2num(mode_value)
else
diary << "Unknown minimum population configuration definition: [mode_name]."
else
diary << "Incorrect minimum population configuration definition: [mode_name] [mode_value]."
if("max_pop")
var/pop_pos = findtext(value, " ")
var/mode_name = null
var/mode_value = null
if(pop_pos)
mode_name = lowertext(copytext(value, 1, pop_pos))
mode_value = copytext(value, pop_pos + 1)
if(mode_name in config.modes)
config.max_pop[mode_name] = text2num(mode_value)
else
diary << "Unknown maximum population configuration definition: [mode_name]."
else
diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]."
if("shuttle_refuel_delay")
config.shuttle_refuel_delay = text2num(value)
if("show_game_type_odds")
@@ -649,19 +589,6 @@
config.sandbox_autoclose = 1
if("default_laws")
config.default_laws = text2num(value)
if("random_laws")
var/law_id = lowertext(value)
lawids += law_id
if("law_weight")
// Value is in the form "LAWID,NUMBER"
var/list/L = splittext(value, ",")
if(L.len != 2)
diary << "Invalid LAW_WEIGHT: " + t
continue
var/lawid = L[1]
var/weight = text2num(L[2])
law_weights[lawid] = weight
if("silicon_max_law_amount")
config.silicon_max_law_amount = text2num(value)
if("join_with_mutant_race")
@@ -682,8 +609,6 @@
config.grey_assistants = 1
if("lavaland_budget")
config.lavaland_budget = text2num(value)
if("space_budget")
config.space_budget = text2num(value)
if("no_summon_guns")
config.no_summon_guns = 1
if("no_summon_magic")
@@ -828,10 +753,6 @@
if(probabilities[M.config_tag]<=0)
qdel(M)
continue
if(min_pop[M.config_tag])
M.required_players = min_pop[M.config_tag]
if(max_pop[M.config_tag])
M.maximum_players = max_pop[M.config_tag]
if(M.can_start())
runnable_modes[M] = probabilities[M.config_tag]
//world << "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]"
@@ -847,13 +768,7 @@
if(probabilities[M.config_tag]<=0)
qdel(M)
continue
if(min_pop[M.config_tag])
M.required_players = min_pop[M.config_tag]
if(max_pop[M.config_tag])
M.maximum_players = max_pop[M.config_tag]
if(M.required_players <= crew)
if(M.maximum_players >= 0 && M.maximum_players < crew)
continue
runnable_modes[M] = probabilities[M.config_tag]
return runnable_modes
+2 -10
View File
@@ -35,8 +35,6 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
var/init_time
var/tickdrift = 0
var/sleep_delta
var/make_runtime = 0
// Has round started? (So we know what subsystems to run)
@@ -67,11 +65,6 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
// Tell qdel() to Del() this object.
return QDEL_HINT_HARDDEL_NOW
/datum/controller/master/proc/Shutdown()
processing = FALSE
for(var/datum/subsystem/ss in subsystems)
ss.Shutdown()
// Returns 1 if we created a new mc, 0 if we couldn't due to a recent restart,
// -1 if we encountered a runtime trying to recreate it
/proc/Recreate_MC()
@@ -172,8 +165,8 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
message_admins("MC crashed or runtimed, restarting")
var/rtn2 = Recreate_MC()
if (rtn2 <= 0)
log_game("Failed to recreate MC (Error code: [rtn2]), it's up to the failsafe now")
message_admins("Failed to recreate MC (Error code: [rtn2]), it's up to the failsafe now")
log_game("Failed to recreate MC (Error code: [rtn2]), its up to the failsafe now")
message_admins("Failed to recreate MC (Error code: [rtn2]), its up to the failsafe now")
Failsafe.defcon = 2
// Main loop.
@@ -287,7 +280,6 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
iteration++
last_run = world.time
src.sleep_delta = MC_AVERAGE_FAST(src.sleep_delta, sleep_delta)
sleep(world.tick_lag * (processing + sleep_delta))
+5 -14
View File
@@ -37,10 +37,6 @@
// Used to initialize the subsystem BEFORE the map has loaded
/datum/subsystem/New()
//cleanup actions
/datum/subsystem/proc/Shutdown()
return
//previously, this would have been named 'process()' but that name is used everywhere for different things!
//fire() seems more suitable. This is the procedure that gets called every 'wait' deciseconds.
//fire(), and the procs it calls, SHOULD NOT HAVE ANY SLEEP OPERATIONS in them!
@@ -144,7 +140,7 @@
statclick = new/obj/effect/statclick/debug("Initializing...", src)
if(can_fire)
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%|[round(ticks,0.1)]\t[msg]"
msg = "[round(cost*ticks,1)]ms|[round(tick_usage,1)]%|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"
@@ -161,12 +157,7 @@
/datum/subsystem/proc/Recover()
//this is so the subsystem doesn't rapid fire to make up missed ticks causing more lag
/datum/subsystem/vv_edit_var(var_name, var_value)
switch (var_name)
if ("can_fire")
if (var_value)
next_fire = world.time + wait
if ("queued_priority") //editing this breaks things.
return 0
. = ..()
/datum/subsystem/on_varedit(edited_var)
if (edited_var == "can_fire" && can_fire)
next_fire = world.time + wait
..()
-42
View File
@@ -1,42 +0,0 @@
var/datum/subsystem/acid/SSacid
/datum/subsystem/acid
name = "Acid"
priority = 40
flags = SS_NO_INIT|SS_BACKGROUND
var/list/currentrun = list()
var/list/processing = list()
/datum/subsystem/acid/New()
NEW_SS_GLOBAL(SSacid)
/datum/subsystem/acid/stat_entry()
..("P:[processing.len]")
/datum/subsystem/acid/fire(resumed = 0)
if (!resumed)
src.currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while (currentrun.len)
var/obj/O = currentrun[currentrun.len]
currentrun.len--
if (!O || qdeleted(O))
processing -= O
if (MC_TICK_CHECK)
return
continue
if(O.acid_level && O.acid_processing())
else
O.overlays -= acid_overlay
O.priority_overlays -= acid_overlay
processing -= O
if (MC_TICK_CHECK)
return
-84
View File
@@ -1,84 +0,0 @@
var/datum/subsystem/augury/SSaugury
/datum/subsystem/augury
name = "Augury"
flags = SS_NO_INIT
var/list/watchers = list()
var/list/doombringers = list()
var/list/observers_given_action = list()
/datum/subsystem/augury/New()
NEW_SS_GLOBAL(SSaugury)
/datum/subsystem/augury/stat_entry(msg)
..("W:[watchers.len]|D:[doombringers.len]")
/datum/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity
/datum/subsystem/augury/fire()
var/biggest_doom = null
var/biggest_threat = null
for(var/d in doombringers)
if(!d || qdeleted(d))
doombringers -= d
continue
var/threat = doombringers[d]
if((biggest_threat == null) || (biggest_threat < threat))
biggest_doom = d
biggest_threat = threat
if(doombringers.len)
for(var/i in player_list)
if(isobserver(i) && (!(observers_given_action[i])))
var/datum/action/innate/augury/A = new
A.Grant(i)
observers_given_action[i] = TRUE
else
for(var/i in observers_given_action)
if(observers_given_action[i] && isobserver(i))
var/mob/dead/observer/O = i
for(var/datum/action/innate/augury/A in O.actions)
qdel(A)
observers_given_action -= i
for(var/w in watchers)
if(!w)
watchers -= w
continue
var/mob/dead/observer/O = w
if(biggest_doom && (!O.orbiting || O.orbiting.orbiting != biggest_doom))
O.ManualFollow(biggest_doom)
/datum/action/innate/augury
name = "Auto Follow Debris"
icon_icon = 'icons/obj/meteor.dmi'
button_icon_state = "flaming"
background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND
/datum/action/innate/augury/Destroy()
if(owner)
SSaugury.watchers -= owner
return ..()
/datum/action/innate/augury/Activate()
SSaugury.watchers += owner
owner << "<span class='notice'>You are now auto-following debris.</span>"
active = TRUE
UpdateButtonIcon()
/datum/action/innate/augury/Deactivate()
SSaugury.watchers -= owner
owner << "<span class='notice'>You are no longer auto-following debris.</span>"
active = FALSE
UpdateButtonIcon()
/datum/action/innate/augury/UpdateButtonIcon()
..()
if(active)
button.icon_state = "template_active"
else
button.icon_state = "template"
+2 -2
View File
@@ -110,8 +110,8 @@ var/datum/subsystem/events/SSevent
/datum/round_event/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
var/list/safe_areas = list(
/area/ai_monitored/turret_protected/ai,
/area/ai_monitored/turret_protected/ai_upload,
/area/turret_protected/ai,
/area/turret_protected/ai_upload,
/area/engine,
/area/solar,
/area/holodeck,
+33
View File
@@ -0,0 +1,33 @@
var/datum/subsystem/fastprocess/SSfastprocess
/datum/subsystem/fastprocess
name = "Fast Process"
priority = 25
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING|SS_NO_INIT
wait = 2
var/list/processing = list()
var/list/currentrun = list()
/datum/subsystem/fastprocess/New()
NEW_SS_GLOBAL(SSfastprocess)
/datum/subsystem/fastprocess/stat_entry()
..("FP:[processing.len]")
/datum/subsystem/fastprocess/fire(resumed = 0)
if (!resumed)
src.currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/datum/thing = currentrun[currentrun.len]
currentrun.len--
if(thing)
thing.process(wait)
else
SSfastprocess.processing -= thing
if (MC_TICK_CHECK)
return
@@ -1,42 +0,0 @@
var/datum/subsystem/fire_burning/SSfire_burning
/datum/subsystem/fire_burning
name = "Fire Burning"
priority = 40
flags = SS_NO_INIT|SS_BACKGROUND
var/list/currentrun = list()
var/list/processing = list()
/datum/subsystem/fire_burning/New()
NEW_SS_GLOBAL(SSfire_burning)
/datum/subsystem/fire_burning/stat_entry()
..("P:[processing.len]")
/datum/subsystem/fire_burning/fire(resumed = 0)
if (!resumed)
src.currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/obj/O = currentrun[currentrun.len]
currentrun.len--
if (!O || qdeleted(O))
processing -= O
if (MC_TICK_CHECK)
return
continue
if(O.resistance_flags & ON_FIRE)
O.take_damage(20, BURN, "fire", 0)
else
processing -= O
if (MC_TICK_CHECK)
return
+18 -28
View File
@@ -70,7 +70,7 @@ var/datum/subsystem/garbage_collector/SSgarbage
Queue(ref)
tobequeued.Cut(1, 2)
/datum/subsystem/garbage_collector/proc/HandleQueue()
/datum/subsystem/garbage_collector/proc/HandleQueue(time_to_stop)
delslasttick = 0
gcedlasttick = 0
var/time_to_kill = world.time - collection_timeout // Anything qdel() but not GC'd BEFORE this time needs to be manually del()
@@ -121,7 +121,7 @@ var/datum/subsystem/garbage_collector/SSgarbage
++totalgcs
/datum/subsystem/garbage_collector/proc/QueueForQueuing(datum/A)
if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
if (istype(A) && isnull(A.gc_destroyed))
tobequeued += A
A.gc_destroyed = GC_QUEUED_FOR_QUEUING
@@ -142,7 +142,7 @@ var/datum/subsystem/garbage_collector/SSgarbage
queue[refid] = gctime
/datum/subsystem/garbage_collector/proc/HardQueue(datum/A)
if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
if (istype(A) && isnull(A.gc_destroyed))
tobequeued += A
A.gc_destroyed = GC_QUEUED_FOR_HARD_DEL
@@ -158,12 +158,11 @@ var/datum/subsystem/garbage_collector/SSgarbage
if(!D)
return
#ifdef TESTING
SSgarbage.qdel_list += "[D.type]"
SSgarbage.qdel_list += "[A.type]"
#endif
if(!istype(D))
del(D)
else if(isnull(D.gc_destroyed))
D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED
var/hint = D.Destroy(force) // Let our friend know they're about to get fucked up.
if(!D)
return
@@ -172,7 +171,6 @@ var/datum/subsystem/garbage_collector/SSgarbage
SSgarbage.QueueForQueuing(D)
if (QDEL_HINT_LETMELIVE, QDEL_HINT_IWILLGC) //qdel should let the object live after calling destory.
if(!force)
D.gc_destroyed = null //clear the gc variable (important!)
return
// Returning LETMELIVE after being told to force destroy
// indicates the objects Destroy() does not respect force
@@ -193,15 +191,13 @@ var/datum/subsystem/garbage_collector/SSgarbage
if (QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion.
SSgarbage.QueueForQueuing(D)
#ifdef TESTING
D.find_references()
A.find_references()
#endif
else
if(!SSgarbage.noqdelhint["[D.type]"])
SSgarbage.noqdelhint["[D.type]"] = "[D.type]"
testing("WARNING: [D.type] is not returning a qdel hint. It is being placed in the queue. Further instances of this type will also be queued.")
SSgarbage.QueueForQueuing(D)
else if(D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
CRASH("[D.type] destroy proc was called multiple times, likely due to a qdel loop in the Destroy logic")
// Returns 1 if the object has been queued for deletion.
/proc/qdeleted(datum/D)
@@ -211,14 +207,6 @@ var/datum/subsystem/garbage_collector/SSgarbage
return TRUE
return FALSE
// Returns true if the object's destroy has been called (set just before it is called)
/proc/qdestroying(datum/D)
if(!istype(D))
return FALSE
if(D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
return TRUE
return FALSE
// Default implementation of clean-up code.
// This should be overridden to remove all references pointing to the object being destroyed.
// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE.
@@ -229,18 +217,15 @@ var/datum/subsystem/garbage_collector/SSgarbage
/datum/var/gc_destroyed //Time when this object was destroyed.
#ifdef TESTING
/client/var/running_find_references
/datum/var/running_find_references
/datum/verb/find_refs()
/datum/verb/find_references()
set category = "Debug"
set name = "Find References"
set background = 1
set src in world
find_references(FALSE)
/datum/proc/find_references(skip_alert)
set background = 1
running_find_references = type
if(usr && usr.client)
if(usr.client.running_find_references)
@@ -252,10 +237,9 @@ var/datum/subsystem/garbage_collector/SSgarbage
SSgarbage.next_fire = world.time + world.tick_lag
return
if(!skip_alert)
if(alert("Running this will lock everything up for about 5 minutes. Would you like to begin the search?", "Find References", "Yes", "No") == "No")
running_find_references = null
return
if(alert("Running this will create a lot of lag until it finishes. You can cancel it by running it again. Would you like to begin the search?", "Find References", "Yes", "No") == "No")
running_find_references = null
return
//this keeps the garbage collector from failing to collect objects being searched for in here
SSgarbage.can_fire = 0
@@ -264,7 +248,13 @@ var/datum/subsystem/garbage_collector/SSgarbage
usr.client.running_find_references = type
testing("Beginning search for references to a [type].")
for(var/datum/thing in world)
var/list/things = list()
for(var/client/thing)
things |= thing
for(var/datum/thing)
things |= thing
testing("Collected list of things in search for references to a [type]. ([things.len] Thing\s)")
for(var/datum/thing in things)
if(usr && usr.client && !usr.client.running_find_references) return
for(var/varname in thing.vars)
var/variable = thing.vars[varname]
@@ -300,7 +290,7 @@ var/datum/subsystem/garbage_collector/SSgarbage
qdel(src)
if(!running_find_references)
find_references(TRUE)
find_references()
/client/verb/show_qdeleted()
set category = "Debug"
+4 -8
View File
@@ -16,7 +16,7 @@ var/datum/subsystem/icon_smooth/SSicon_smooth
while(smooth_queue.len)
var/atom/A = smooth_queue[smooth_queue.len]
smooth_queue.len--
smooth_icon(A)
ss_smooth_icon(A)
if (MC_TICK_CHECK)
return
if (!smooth_queue.len)
@@ -25,12 +25,8 @@ var/datum/subsystem/icon_smooth/SSicon_smooth
/datum/subsystem/icon_smooth/Initialize()
smooth_zlevel(1,TRUE)
smooth_zlevel(2,TRUE)
var/queue = smooth_queue
smooth_queue = list()
for(var/V in queue)
for(var/V in smooth_queue)
var/atom/A = V
if(!A || A.z <= 2)
continue
smooth_icon(A)
if(A.z == 1 || A.z == 2)
smooth_queue -= A
..()
+6 -14
View File
@@ -328,7 +328,7 @@ var/datum/subsystem/job/SSjob
for(var/mob/new_player/player in unassigned)
if(PopcapReached())
RejectPlayer(player)
else if(player.client.prefs.joblessrole == BERANDOMJOB)
else if(player.client.prefs.userandomjob)
GiveRandomJob(player)
Debug("DO, Standard Check end")
@@ -339,15 +339,8 @@ var/datum/subsystem/job/SSjob
for(var/mob/new_player/player in unassigned)
if(PopcapReached())
RejectPlayer(player)
if(player.client.prefs.joblessrole == BEASSISTANT)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
else // For those who don't want to play if their preference were filled, back you go.
RejectPlayer(player)
for(var/mob/new_player/player in unassigned) //Players that wanted to back out but couldn't because they're antags (can you feel the edge case?)
GiveRandomJob(player)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
return 1
//Gives the player the stuff he should have with his rank
@@ -382,7 +375,7 @@ var/datum/subsystem/job/SSjob
if(clear)
S = T
continue
if(istype(S, /obj/effect/landmark) && isturf(S.loc))
if(istype(S, /obj/effect/landmark) && istype(S.loc, /turf))
H.loc = S.loc
if(H.mind)
@@ -401,7 +394,7 @@ var/datum/subsystem/job/SSjob
H << "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"
if(config.minimal_access_threshold)
H << "<FONT color='blue'><B>As this station was initially staffed with a [config.jobs_have_minimal_access ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.</B></font>"
return H
return 1
/datum/subsystem/job/proc/setup_officer_positions()
@@ -477,8 +470,7 @@ var/datum/subsystem/job/SSjob
/datum/subsystem/job/proc/RejectPlayer(mob/new_player/player)
if(player.mind && player.mind.special_role)
return
if(PopcapReached())
Debug("Popcap overflow Check observer located, Player: [player]")
Debug("Popcap overflow Check observer located, Player: [player]")
player << "<b>You have failed to qualify for any job you desired.</b>"
unassigned -= player
player.ready = 0
+43 -94
View File
@@ -1,116 +1,65 @@
var/datum/subsystem/lighting/SSlighting
#define SSLIGHTING_LIGHTS 1
#define SSLIGHTING_TURFS 2
/var/list/lighting_update_lights = list() // List of lighting sources queued for update.
/var/list/lighting_update_corners = list() // List of lighting corners queued for update.
/var/list/lighting_update_overlays = list() // List of lighting overlays queued for update.
/var/list/lighting_update_lights_old = list() // List of lighting sources currently being updated.
/var/list/lighting_update_corners_old = list() // List of lighting corners currently being updated.
/var/list/lighting_update_overlays_old = list() // List of lighting overlays currently being updated.
/datum/subsystem/lighting
name = "Lighting"
name = "lighting"
init_order = 1
wait = 1
flags = SS_POST_FIRE_TIMING
priority = 40
wait = 2
display_order = 5
var/list/changed_lights = list() //list of all datum/light_source that need updating
var/changed_lights_workload = 0 //stats on the largest number of lights (max changed_lights.len)
var/list/changed_turfs = list() //list of all turfs which may have a different light level
var/changed_turfs_workload = 0 //stats on the largest number of turfs changed (max changed_turfs.len)
priority = 40
flags = SS_POST_FIRE_TIMING
/datum/subsystem/lighting/New()
NEW_SS_GLOBAL(SSlighting)
return ..()
/datum/subsystem/lighting/stat_entry()
..("L:[round(changed_lights_workload,1)]|T:[round(changed_turfs_workload,1)]")
//Workhorse of lighting. It cycles through each light that needs updating. It updates their
//effects and then processes every turf in the queue, updating their lighting object's appearance
//Any light that returns 1 in check() deletes itself
//By using queues we are ensuring we don't perform more updates than are necessary
/datum/subsystem/lighting/fire(resumed = 0)
var/ticklimit = CURRENT_TICKLIMIT
//split our tick allotment in half so we don't spend it all on lightshift checks
CURRENT_TICKLIMIT = world.tick_usage + ((ticklimit-world.tick_usage)/2)
var/list/changed_lights = src.changed_lights
if (!resumed)
changed_lights_workload = MC_AVERAGE(changed_lights_workload, changed_lights.len)
var/i = 1
while (i <= changed_lights.len)
var/datum/light_source/LS = changed_lights[i++]
LS.check()
if (MC_TICK_CHECK)
break
if (i > 1)
changed_lights.Cut(1,i)
CURRENT_TICKLIMIT = ticklimit
var/list/changed_turfs = src.changed_turfs
if (!resumed)
changed_turfs_workload = MC_AVERAGE(changed_turfs_workload, changed_turfs.len)
i = 1
while (i <= changed_turfs.len)
var/turf/T = changed_turfs[i++]
if(T.lighting_changed)
T.redraw_lighting()
if (MC_TICK_CHECK)
break
if (i > 1)
changed_turfs.Cut(1,i)
//same as above except it attempts to shift ALL turfs in the world regardless of lighting_changed status
/datum/subsystem/lighting/Initialize(timeofday)
var/list/turfs_to_init = block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz))
/datum/subsystem/lighting/Initialize()
if (config.starlight)
for(var/area/A in world)
if (A.lighting_use_dynamic == DYNAMIC_LIGHTING_IFSTARLIGHT)
if (A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
A.luminosity = 0
for(var/thing in changed_lights)
var/datum/light_source/LS = thing
LS.check()
changed_lights.Cut()
create_all_lighting_overlays()
for(var/thing in turfs_to_init)
var/turf/T = thing
T.init_lighting()
changed_turfs.Cut()
/datum/subsystem/lighting/fire()
..()
lighting_update_lights_old = lighting_update_lights //We use a different list so any additions to the update lists during a delay from scheck() don't cause things to be cut from the list without being updated.
lighting_update_lights = list()
for(var/datum/light_source/L in lighting_update_lights_old)
//Used to strip valid information from an existing instance and transfer it to the replacement. i.e. when a crash occurs
//It works by using spawn(-1) to transfer the data, if there is a runtime the data does not get transfered but the loop
//does not crash
/datum/subsystem/lighting/Recover()
if(!istype(SSlighting.changed_turfs))
SSlighting.changed_turfs = list()
if(!istype(SSlighting.changed_lights))
SSlighting.changed_lights = list()
if(L.check() || L.destroyed || L.force_update)
L.remove_lum()
if(!L.destroyed)
L.apply_lum()
for(var/thing in SSlighting.changed_lights)
var/datum/light_source/LS = thing
spawn(-1) //so we don't crash the loop (inefficient)
LS.check()
else if(L.vis_update) //We smartly update only tiles that became (in) visible to use.
L.smart_vis_update()
for(var/thing in changed_turfs)
var/turf/T = thing
if(T.lighting_changed)
spawn(-1)
T.redraw_lighting()
L.vis_update = FALSE
L.force_update = FALSE
L.needs_update = FALSE
var/msg = "## DEBUG: [time2text(world.timeofday)] [name] subsystem restarted. Reports:\n"
for(var/varname in SSlighting.vars)
switch(varname)
if("tag","bestF","type","parent_type","vars")
continue
else
var/varval1 = SSlighting.vars[varname]
var/varval2 = vars[varname]
if(istype(varval1,/list))
varval1 = "/list([length(varval1)])"
varval2 = "/list([length(varval2)])"
msg += "\t [varname] = [varval1] -> [varval2]\n"
world.log << msg
lighting_update_corners_old = lighting_update_corners //Same as above.
lighting_update_corners = list()
for(var/A in lighting_update_corners_old)
var/datum/lighting_corner/C = A
C.update_overlays()
C.needs_update = FALSE
lighting_update_overlays_old = lighting_update_overlays //Same as above.
lighting_update_overlays = list()
for(var/atom/movable/lighting_overlay/O in lighting_update_overlays_old)
O.update_overlay()
O.needs_update = 0

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