Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into putnamos-for-real

This commit is contained in:
Putnam
2020-07-08 22:02:03 -07:00
1515 changed files with 270775 additions and 326499 deletions
@@ -20,26 +20,41 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define DF_ISPROCESSING (1<<2)
//FLAGS BITMASK
#define HEAR_1 (1<<3) // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not.
#define CHECK_RICOCHET_1 (1<<4) // Projectiels will check ricochet on things impacted that have this.
#define CONDUCT_1 (1<<5) // conducts electricity (metal etc.)
#define NODECONSTRUCT_1 (1<<7) // For machines and structures that should not break into parts, eg, holodeck stuff
#define OVERLAY_QUEUED_1 (1<<8) // atom queued to SSoverlay
#define ON_BORDER_1 (1<<9) // item has priority to check when entering or leaving
#define PREVENT_CLICK_UNDER_1 (1<<11) //Prevent clicking things below it on the same turf eg. doors/ fulltile windows
///This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not.
#define HEAR_1 (1<<3)
///Projectiles will use default chance-based ricochet handling on things with this.
#define DEFAULT_RICOCHET_1 (1<<4)
///Conducts electricity (metal etc.).
#define CONDUCT_1 (1<<5)
///For machines and structures that should not break into parts, eg, holodeck stuff.
#define NODECONSTRUCT_1 (1<<7)
///Atom queued to SSoverlay.
#define OVERLAY_QUEUED_1 (1<<8)
///Item has priority to check when entering or leaving.
#define ON_BORDER_1 (1<<9)
///Prevent clicking things below it on the same turf eg. doors/ fulltile windows.
#define PREVENT_CLICK_UNDER_1 (1<<11)
#define HOLOGRAM_1 (1<<12)
#define TESLA_IGNORE_1 (1<<13) // TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define INITIALIZED_1 (1<<14) //Whether /atom/Initialize() has already run for the object
#define ADMIN_SPAWNED_1 (1<<15) //was this spawned by an admin? used for stat tracking stuff.
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<16) /// should not get harmed if this gets caught by an explosion?
///Prevents mobs from getting chainshocked by teslas and the supermatter.
#define SHOCKED_1 (1<<13)
///Whether /atom/Initialize() has already run for the object.
#define INITIALIZED_1 (1<<14)
///was this spawned by an admin? used for stat tracking stuff.
#define ADMIN_SPAWNED_1 (1<<15)
/// should not get harmed if this gets caught by an explosion?
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<16)
/// Early returns mob.face_atom()
#define BLOCK_FACE_ATOM_1 (1<<17)
//turf-only flags
#define NOJAUNT_1 (1<<0)
#define UNUSED_RESERVATION_TURF_1 (1<<1)
#define CAN_BE_DIRTY_1 (1<<2) // If a turf can be made dirty at roundstart. This is also used in areas.
#define NO_LAVA_GEN_1 (1<<6) //Blocks lava rivers being generated on the turf
#define NO_RUINS_1 (1<<10) //Blocks ruins spawning on the turf
///If a turf can be made dirty at roundstart. This is also used in areas.
#define CAN_BE_DIRTY_1 (1<<2)
///Blocks lava rivers being generated on the turf.
#define NO_LAVA_GEN_1 (1<<6)
///Blocks ruins spawning on the turf.
#define NO_RUINS_1 (1<<10)
/*
These defines are used specifically with the atom/pass_flags bitmask
@@ -59,8 +74,10 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define FLYING (1<<1)
#define VENTCRAWLING (1<<2)
#define FLOATING (1<<3)
#define UNSTOPPABLE (1<<4) //When moving, will Bump()/Cross()/Uncross() everything, but won't be stopped.
#define CRAWLING (1<<5) //Applied if you're crawling around on the ground/resting.
///When moving, will Bump()/Cross()/Uncross() everything, but won't be stopped.
#define UNSTOPPABLE (1<<4)
///Applied if you're crawling around on the ground/resting.
#define CRAWLING (1<<5)
//Fire and Acid stuff, for resistance_flags
#define LAVA_PROOF (1<<0)
@@ -75,14 +92,15 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define GOLIATH_WEAKNESS (1<<9) //CIT CHANGE
//tesla_zap
#define TESLA_MACHINE_EXPLOSIVE (1<<0)
#define TESLA_ALLOW_DUPLICATES (1<<1)
#define TESLA_OBJ_DAMAGE (1<<2)
#define TESLA_MOB_DAMAGE (1<<3)
#define TESLA_MOB_STUN (1<<4)
#define ZAP_MACHINE_EXPLOSIVE (1<<0)
#define ZAP_ALLOW_DUPLICATES (1<<1)
#define ZAP_OBJ_DAMAGE (1<<2)
#define ZAP_MOB_DAMAGE (1<<3)
#define ZAP_MOB_STUN (1<<4)
#define TESLA_DEFAULT_FLAGS ALL
#define TESLA_FUSION_FLAGS TESLA_OBJ_DAMAGE | TESLA_MOB_DAMAGE | TESLA_MOB_STUN
#define ZAP_DEFAULT_FLAGS ALL
#define ZAP_FUSION_FLAGS ZAP_OBJ_DAMAGE | ZAP_MOB_DAMAGE | ZAP_MOB_STUN
#define ZAP_SUPERMATTER_FLAGS NONE
//EMP protection
#define EMP_PROTECT_SELF (1<<0)
@@ -119,3 +137,27 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_PICKUP | MOBILITY_USE | MOBILITY_UI | MOBILITY_STORAGE | MOBILITY_PULL | MOBILITY_RESIST)
#define MOBILITY_FLAGS_ANY_INTERACTION (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_UI | MOBILITY_STORAGE)
// melee_attack_chain() attackchain_flags
/// The attack is from a parry counterattack.
#define ATTACKCHAIN_PARRY_COUNTERATTACK (1<<0)
/// If the thing can reflect light (lasers/energy)
#define RICOCHET_SHINY (1<<0)
/// If the thing can reflect matter (bullets/bomb shrapnel)
#define RICOCHET_HARD (1<<1)
#define KEEP_TOGETHER_ORIGINAL "keep_together_original"
//setter for KEEP_TOGETHER to allow for multiple sources to set and unset it
#define ADD_KEEP_TOGETHER(x, source)\
if ((x.appearance_flags & KEEP_TOGETHER) && !HAS_TRAIT(x, TRAIT_KEEP_TOGETHER)) ADD_TRAIT(x, TRAIT_KEEP_TOGETHER, KEEP_TOGETHER_ORIGINAL); \
ADD_TRAIT(x, TRAIT_KEEP_TOGETHER, source);\
x.appearance_flags |= KEEP_TOGETHER
#define REMOVE_KEEP_TOGETHER(x, source)\
REMOVE_TRAIT(x, TRAIT_KEEP_TOGETHER, source);\
if(HAS_TRAIT_FROM_ONLY(x, TRAIT_KEEP_TOGETHER, KEEP_TOGETHER_ORIGINAL))\
REMOVE_TRAIT(x, TRAIT_KEEP_TOGETHER, KEEP_TOGETHER_ORIGINAL);\
else if(!HAS_TRAIT(x, TRAIT_KEEP_TOGETHER))\
x.appearance_flags &= ~KEEP_TOGETHER
+55
View File
@@ -0,0 +1,55 @@
// Flags for the item_flags var on /obj/item
#define BEING_REMOVED (1<<0)
///is this item equipped into an inventory slot or hand of a mob? used for tooltips
#define IN_INVENTORY (1<<1)
///used for tooltips
#define FORCE_STRING_OVERRIDE (1<<2)
///Used by security bots to determine if this item is safe for public use.
#define NEEDS_PERMIT (1<<3)
#define SLOWS_WHILE_IN_HAND (1<<4)
///Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
#define NO_MAT_REDEMPTION (1<<5)
///When dropped, it calls qdel on itself
#define DROPDEL (1<<6)
///when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
#define NOBLUDGEON (1<<7)
///for all things that are technically items but used for various different stuff
#define ABSTRACT (1<<8)
///When players should not be able to change the slowdown of the item (Speed potions, ect)
#define IMMUTABLE_SLOW (1<<9)
///Tool commonly used for surgery: won't attack targets in an active surgical operation on help intent (in case of mistakes)
#define SURGICAL_TOOL (1<<10)
///Can be worn on certain slots (currently belt and id) that would otherwise require an uniform.
#define NO_UNIFORM_REQUIRED (1<<11)
///Damage when attacking people is not affected by combat mode.
#define NO_COMBAT_MODE_FORCE_MODIFIER (1<<12)
/// This item can be used to parry. Only a basic check used to determine if we should proceed with parry chain at all.
#define ITEM_CAN_PARRY (1<<13)
/// This item can be used in the directional blocking system. Only a basic check used to determine if we should proceed with directional block handling at all.
#define ITEM_CAN_BLOCK (1<<14)
// Flags for the clothing_flags var on /obj/item/clothing
#define LAVAPROTECT (1<<0)
#define STOPSPRESSUREDAMAGE (1<<1) //SUIT and HEAD items which stop pressure damage. To stop you taking all pressure damage you must have both a suit and head item with this flag.
#define BLOCK_GAS_SMOKE_EFFECT (1<<2) //blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
#define ALLOWINTERNALS (1<<3) //mask allows internals
#define NOSLIP (1<<4) //prevents from slipping on wet floors, in space etc
#define NOSLIP_ICE (1<<5) //prevents from slipping on frozen floors
#define THICKMATERIAL (1<<6) //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body.
#define VOICEBOX_TOGGLABLE (1<<7) //The voicebox in this clothing can be toggled.
#define VOICEBOX_DISABLED (1<<8) //The voicebox is currently turned off.
#define IGNORE_HAT_TOSS (1<<9) //Hats with negative effects when worn (i.e the tinfoil hat).
#define SCAN_REAGENTS (1<<10) // Allows helmets and glasses to scan reagents.
// Flags for the organ_flags var on /obj/item/organ
#define ORGAN_SYNTHETIC (1<<0) //Synthetic organs, or cybernetic organs. Reacts to EMPs and don't deteriorate or heal
#define ORGAN_FROZEN (1<<1) //Frozen organs, don't deteriorate
#define ORGAN_FAILING (1<<2) //Failing organs perform damaging effects until replaced or fixed
#define ORGAN_EXTERNAL (1<<3) //Was this organ implanted/inserted/etc, if true will not be removed during species change.
#define ORGAN_VITAL (1<<4) //Currently only the brain
#define ORGAN_NO_SPOIL (1<<5) //Do not spoil under any circumstances
#define ORGAN_NO_DISMEMBERMENT (1<<6) //Immune to disembowelment.
#define ORGAN_EDIBLE (1<<5) //is a snack? :D
+15
View File
@@ -0,0 +1,15 @@
// Flags for the obj_flags var on /obj
#define EMAGGED (1<<0)
#define IN_USE (1<<1) //If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
#define CAN_BE_HIT (1<<2) //can this be bludgeoned by items?
#define BEING_SHOCKED (1<<3) //Whether this thing is currently (already) being shocked by a tesla
#define DANGEROUS_POSSESSION (1<<4) //Admin possession yes/no
#define ON_BLUEPRINTS (1<<5) //Are we visible on the station blueprints at roundstart?
#define UNIQUE_RENAME (1<<6) //can you customize the description/name of the thing?
#define USES_TGUI (1<<7) //put on things that use tgui on ui_interact instead of custom/old UI.
#define FROZEN (1<<8)
#define SHOVABLE_ONTO (1<<9) //called on turf.shove_act() to consider whether an object should have a niche effect (defined in their own shove_act()) when someone is pushed onto it, or do a sanity CanPass() check.
#define BLOCK_Z_FALL (1<<10)
// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support
-7
View File
@@ -83,10 +83,3 @@
#define SPAM_TRIGGER_WARNING 5 //Number of identical messages required before the spam-prevention will warn you to stfu
#define SPAM_TRIGGER_AUTOMUTE 10 //Number of identical messages required before the spam-prevention will automute you
///Max length of a keypress command before it's considered to be a forged packet/bogus command
#define MAX_KEYPRESS_COMMANDLENGTH 16
///Max amount of keypress messages per second over two seconds before client is autokicked
#define MAX_KEYPRESS_AUTOKICK 100
///Length of max held keys
#define MAX_HELD_KEYS 15
+18
View File
@@ -0,0 +1,18 @@
// Defines for managed input/keybinding system.
/// Max length of a keypress command before it's considered to be a forged packet/bogus command
#define MAX_KEYPRESS_COMMANDLENGTH 16
/// Maximum keys that can be bound to one button
#define MAX_COMMANDS_PER_KEY 5
/// Maximum keys per keybind
#define MAX_KEYS_PER_KEYBIND 3
/// Max amount of keypress messages per second over two seconds before client is autokicked
#define MAX_KEYPRESS_AUTOKICK 100
/// Max keys that can be held down at once by a client
#define MAX_HELD_KEYS 15
/// Macroset name of hotkeys/keybind only/modern mode
#define SKIN_MACROSET_HOTKEYS "hotkeys"
/// Macroset name of classic hotkey mode
#define SKIN_MACROSET_CLASSIC_HOTKEYS "oldhotkeys"
/// Macroset name of classic input mode
#define SKIN_MACROSET_CLASSIC_INPUT "oldinput"
+11
View File
@@ -11,6 +11,17 @@
#define NUKE_RESULT_WRONG_STATION 7
#define NUKE_RESULT_WRONG_STATION_DEAD 8
//fugitive end results
#define FUGITIVE_RESULT_BADASS_HUNTER 0
#define FUGITIVE_RESULT_POSTMORTEM_HUNTER 1
#define FUGITIVE_RESULT_MAJOR_HUNTER 2
#define FUGITIVE_RESULT_HUNTER_VICTORY 3
#define FUGITIVE_RESULT_MINOR_HUNTER 4
#define FUGITIVE_RESULT_STALEMATE 5
#define FUGITIVE_RESULT_MINOR_FUGITIVE 6
#define FUGITIVE_RESULT_FUGITIVE_VICTORY 7
#define FUGITIVE_RESULT_MAJOR_FUGITIVE 8
#define APPRENTICE_DESTRUCTION "destruction"
#define APPRENTICE_BLUESPACE "bluespace"
#define APPRENTICE_ROBELESS "robeless"
+1
View File
@@ -59,6 +59,7 @@
#define ANTAG_HUD_CLOCKWORK 22
#define ANTAG_HUD_BROTHER 23
#define ANTAG_HUD_BLOODSUCKER 24
#define ANTAG_HUD_FUGITIVE 25
// Notification action types
#define NOTIFY_JUMP "jump"
+5 -1
View File
@@ -32,4 +32,8 @@
list("", "\improper S.T.E.A.L.T.H. pod MKVII", "A supply pod that, under normal circumstances, is completely invisible to conventional methods of detection. How are you even seeing this?"),\
list("gondolapod", "gondola", "The silent walker. This one seems to be part of a delivery agency."),\
list("", "", "")\
)
)
#define PACK_GOODY_NONE 0
#define PACK_GOODY_PUBLIC 1 //can be bought by both privates and cargo
#define PACK_GOODY_PRIVATE 2 //can be bought only by privates
-3
View File
@@ -101,8 +101,5 @@
#define TOGGLES_CITADEL 0
//component stuff
#define COMSIG_VORE_TOGGLED "voremode_toggled" // totally not copypasta
//belly sound pref things
#define NORMIE_HEARCHECK 4
+77 -108
View File
@@ -29,38 +29,38 @@
#define EFFECT_DROWSY "drowsy"
#define EFFECT_JITTER "jitter"
// /mob/living/combat_flags
#define CAN_TOGGLE_COMBAT_MODE(mob) FORCE_BOOLEAN((mob.stat == CONSCIOUS) && !(mob.combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
// mob/living/var/combat_flags variable.
/// Default combat flags for those affected by sprinting (combat mode has been made into its own component)
#define COMBAT_FLAGS_DEFAULT (COMBAT_FLAG_PARRY_CAPABLE | COMBAT_FLAG_BLOCK_CAPABLE)
/// Default combat flags for everyone else (so literally everyone but humans).
#define COMBAT_FLAGS_SPRINT_EXEMPT (COMBAT_FLAG_SPRINT_ACTIVE | COMBAT_FLAG_SPRINT_TOGGLED | COMBAT_FLAG_SPRINT_FORCED | COMBAT_FLAG_PARRY_CAPABLE | COMBAT_FLAG_BLOCK_CAPABLE)
/// Default combat flags for those affected by ((stamina combat))
#define COMBAT_FLAGS_DEFAULT NONE
/// Default combat flags for everyone else (so literally everyone but humans)
#define COMBAT_FLAGS_STAMSYSTEM_EXEMPT (COMBAT_FLAG_SPRINT_ACTIVE | COMBAT_FLAG_COMBAT_ACTIVE | COMBAT_FLAG_SPRINT_TOGGLED | COMBAT_FLAG_COMBAT_TOGGLED | COMBAT_FLAG_SPRINT_FORCED | COMBAT_FLAG_COMBAT_FORCED)
/// Default combat flags for those only affected by sprint (so just silicons)
#define COMBAT_FLAGS_STAMEXEMPT_YESSPRINT (COMBAT_FLAG_COMBAT_ACTIVE | COMBAT_FLAG_COMBAT_TOGGLED | COMBAT_FLAG_COMBAT_FORCED)
/// The user wants combat mode on
#define COMBAT_FLAG_COMBAT_TOGGLED (1<<0)
/// The user wants sprint mode on
#define COMBAT_FLAG_SPRINT_TOGGLED (1<<1)
/// Combat mode is currently active
#define COMBAT_FLAG_COMBAT_ACTIVE (1<<2)
#define COMBAT_FLAG_SPRINT_TOGGLED (1<<0)
/// Sprint is currently active
#define COMBAT_FLAG_SPRINT_ACTIVE (1<<3)
#define COMBAT_FLAG_SPRINT_ACTIVE (1<<1)
/// Currently attempting to crawl under someone
#define COMBAT_FLAG_ATTEMPTING_CRAWL (1<<4)
#define COMBAT_FLAG_ATTEMPTING_CRAWL (1<<2)
/// Currently stamcritted
#define COMBAT_FLAG_HARD_STAMCRIT (1<<5)
#define COMBAT_FLAG_HARD_STAMCRIT (1<<3)
/// Currently attempting to resist up from the ground
#define COMBAT_FLAG_RESISTING_REST (1<<6)
#define COMBAT_FLAG_RESISTING_REST (1<<4)
/// Intentionally resting
#define COMBAT_FLAG_INTENTIONALLY_RESTING (1<<7)
#define COMBAT_FLAG_INTENTIONALLY_RESTING (1<<5)
/// Currently stamcritted but not as violently
#define COMBAT_FLAG_SOFT_STAMCRIT (1<<8)
/// Force combat mode on at all times, overrides everything including combat disable traits.
#define COMBAT_FLAG_COMBAT_FORCED (1<<9)
#define COMBAT_FLAG_SOFT_STAMCRIT (1<<6)
/// Force sprint mode on at all times, overrides everything including sprint disable traits.
#define COMBAT_FLAG_SPRINT_FORCED (1<<10)
#define COMBAT_FLAG_SPRINT_FORCED (1<<7)
/// This mob is capable of using the active parrying system.
#define COMBAT_FLAG_PARRY_CAPABLE (1<<8)
/// This mob is capable of using the active blocking system.
#define COMBAT_FLAG_BLOCK_CAPABLE (1<<9)
/// This mob is capable of unarmed parrying
#define COMBAT_FLAG_UNARMED_PARRY (1<<10)
/// This mob is currently actively blocking
#define COMBAT_FLAG_ACTIVE_BLOCKING (1<<11)
/// This mob is currently starting an active block
#define COMBAT_FLAG_ACTIVE_BLOCK_STARTING (1<<12)
// Helpers for getting someone's stamcrit state. Cast to living.
#define NOT_STAMCRIT 0
@@ -72,10 +72,18 @@
#define CHECK_STAMCRIT(mob) ((mob.combat_flags & COMBAT_FLAG_HARD_STAMCRIT)? HARD_STAMCRIT : ((mob.combat_flags & COMBAT_FLAG_SOFT_STAMCRIT)? SOFT_STAMCRIT : NOT_STAMCRIT))
//stamina stuff
#define STAMINA_SOFTCRIT 100 //softcrit for stamina damage. prevents standing up, prevents performing actions that cost stamina, etc, but doesn't force a rest or stop movement
#define STAMINA_CRIT 140 //crit for stamina damage. forces a rest, and stops movement until stamina goes back to stamina softcrit
#define STAMINA_SOFTCRIT_TRADITIONAL 0 //same as STAMINA_SOFTCRIT except for the more traditional health calculations
#define STAMINA_CRIT_TRADITIONAL -40 //ditto, but for STAMINA_CRIT
///Threshold over which attacks start being hindered.
#define STAMINA_NEAR_SOFTCRIT 90
///softcrit for stamina damage. prevents standing up, some actions that cost stamina, etc, but doesn't force a rest or stop movement
#define STAMINA_SOFTCRIT 100
///sanity cap to prevent stamina actions (that are still performable) from sending you into crit.
#define STAMINA_NEAR_CRIT 130
///crit for stamina damage. forces a rest, and stops movement until stamina goes back to stamina softcrit
#define STAMINA_CRIT 140
///same as STAMINA_SOFTCRIT except for the more traditional health calculations
#define STAMINA_SOFTCRIT_TRADITIONAL 0
///ditto, but for STAMINA_CRIT
#define STAMINA_CRIT_TRADITIONAL -40
#define CRAWLUNDER_DELAY 30 //Delay for crawling under a standing mob
@@ -115,18 +123,6 @@
#define GRAB_NECK 2
#define GRAB_KILL 3
/// Attack types for check_block()/run_block(). Flags, combinable.
/// Attack was melee, whether or not armed.
#define ATTACK_TYPE_MELEE (1<<0)
/// Attack was with a gun or something that should count as a gun (but not if a gun shouldn't count for a gun, crazy right?)
#define ATTACK_TYPE_PROJECTILE (1<<1)
/// Attack was unarmed.. this usually means hand to hand combat.
#define ATTACK_TYPE_UNARMED (1<<2)
/// Attack was a thrown atom hitting the victim.
#define ATTACK_TYPE_THROWN (1<<3)
/// Attack was a bodyslam/leap/tackle. See: Xenomorph leap tackles.
#define ATTACK_TYPE_TACKLE (1<<4)
//attack visual effects
#define ATTACK_EFFECT_PUNCH "punch"
#define ATTACK_EFFECT_KICK "kick"
@@ -167,9 +163,8 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
/obj/item/gun)))
//Combat object defines
//Embedded objects
#define EMBEDDED_PAIN_CHANCE 15 //Chance for embedded objects to cause pain (damage user)
#define EMBEDDED_ITEM_FALLOUT 5 //Chance for embedded object to fall out (causing pain but removing the object)
#define EMBED_CHANCE 45 //Chance for an object to embed into somebody when thrown (if it's sharp)
@@ -178,7 +173,16 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define EMBEDDED_IMPACT_PAIN_MULTIPLIER 4 //Coefficient of multiplication for the damage the item does when it first embeds (this*item.w_class)
#define EMBED_THROWSPEED_THRESHOLD 4 //The minimum value of an item's throw_speed for it to embed (Unless it has embedded_ignore_throwspeed_threshold set to 1)
#define EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER 8 //Coefficient of multiplication for the damage the item does when removed without a surgery (this*item.w_class)
#define EMBEDDED_UNSAFE_REMOVAL_TIME 150 //A Time in ticks, total removal time = (this/item.w_class)
#define EMBEDDED_UNSAFE_REMOVAL_TIME 30 //A Time in ticks, total removal time = (this*item.w_class)
#define EMBEDDED_JOSTLE_CHANCE 5 //Chance for embedded objects to cause pain every time they move (jostle)
#define EMBEDDED_JOSTLE_PAIN_MULTIPLIER 1 //Coefficient of multiplication for the damage the item does while
#define EMBEDDED_PAIN_STAM_PCT 0.0 //This percentage of all pain will be dealt as stam damage rather than brute (0-1)
#define EMBED_CHANCE_TURF_MOD -15 //You are this many percentage points less likely to embed into a turf (good for things glass shards and spears vs walls)
#define EMBED_HARMLESS list("pain_mult" = 0, "jostle_pain_mult" = 0, "ignore_throwspeed_threshold" = TRUE)
#define EMBED_HARMLESS_SUPERIOR list("pain_mult" = 0, "jostle_pain_mult" = 0, "ignore_throwspeed_threshold" = TRUE, "embed_chance" = 100, "fall_chance" = 0.1)
#define EMBED_POINTY list("ignore_throwspeed_threshold" = TRUE)
#define EMBED_POINTY_SUPERIOR list("embed_chance" = 100, "ignore_throwspeed_threshold" = TRUE)
//Gun weapon weight
#define WEAPON_LIGHT 1
@@ -193,6 +197,17 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define EGUN_SELFCHARGE 1
#define EGUN_SELFCHARGE_BORG 2
//Gun suppression
#define SUPPRESSED_NONE 0
#define SUPPRESSED_QUIET 1 ///standard suppressed
#define SUPPRESSED_VERY 2 /// no message
//Nice shot bonus
#define NICE_SHOT_RICOCHET_BONUS 10 //if the shooter has the NICE_SHOT trait and they fire a ricocheting projectile, add this to the ricochet chance and auto aim angle
///Time to spend without clicking on other things required for your shots to become accurate.
#define GUN_AIMING_TIME (2 SECONDS)
//Object/Item sharpness
#define IS_BLUNT 0
#define IS_SHARP 1
@@ -254,76 +269,30 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
//stamina cost defines.
#define STAM_COST_ATTACK_OBJ_MULT 1.2
#define STAM_COST_ATTACK_MOB_MULT 0.8
#define STAM_COST_ATTACK_MOB_MULT 1
#define STAM_COST_BATON_MOB_MULT 1
#define STAM_COST_NO_COMBAT_MULT 1.25
#define STAM_COST_W_CLASS_MULT 1.25
#define STAM_COST_THROW_MULT 2
#define STAM_COST_THROW_MOB 2.5 //multiplied by (mob size + 1)^2.
///Multiplier of the (STAMINA_NEAR_CRIT - user current stamina loss) : (STAMINA_NEAR_CRIT - STAMINA_SOFTCRIT) ratio used in damage penalties when stam soft-critted.
#define STAM_CRIT_ITEM_ATTACK_PENALTY 0.66
/// changeNext_move penalty multiplier of the above.
#define STAM_CRIT_ITEM_ATTACK_DELAY 1.75
/// Damage penalty when fighting prone.
#define LYING_DAMAGE_PENALTY 0.5
/// Added delay when firing guns stam-softcritted. Summed with a hardset CLICK_CD_RANGE delay, similar to STAM_CRIT_DAMAGE_DELAY otherwise.
#define STAM_CRIT_GUN_DELAY 2.75
//bullet_act() return values
#define BULLET_ACT_HIT "HIT" //It's a successful hit, whatever that means in the context of the thing it's hitting.
#define BULLET_ACT_BLOCK "BLOCK" //It's a blocked hit, whatever that means in the context of the thing it's hitting.
#define BULLET_ACT_FORCE_PIERCE "PIERCE" //It pierces through the object regardless of the bullet being piercing by default.
#define BULLET_ACT_TURF "TURF" //It hit us but it should hit something on the same turf too. Usually used for turfs.
//stamina recovery defines. Blocked if combat mode is on.
#define STAM_RECOVERY_STAM_CRIT -7.5
#define STAM_RECOVERY_RESTING -6
#define STAM_RECOVERY_NORMAL -3
#define STAM_RECOVERY_LIMB 4 //limbs recover stamina separately from handle_status_effects(), and aren't blocked by combat mode.
/// Check whether or not we can block, without "triggering" a block. Basically run checks without effects like depleting shields.
/// Wrapper for do_run_block(). The arguments on that means the same as for this.
#define mob_check_block(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)\
do_run_block(FALSE, object, damage, attack_text, attack_type, armour_penetration, attacker, check_zone(def_zone), return_list)
/// Runs a block "sequence", effectively checking and then doing effects if necessary.
/// Wrapper for do_run_block(). The arguments on that means the same as for this.
#define mob_run_block(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)\
do_run_block(TRUE, object, damage, attack_text, attack_type, armour_penetration, attacker, check_zone(def_zone), return_list)
/// Bitflags for check_block() and run_block(). Meant to be combined. You can be hit and still reflect, for example, if you do not use BLOCK_SUCCESS.
/// Attack was not blocked
#define BLOCK_NONE NONE
/// Attack was blocked, do not do damage. THIS FLAG MUST BE THERE FOR DAMAGE/EFFECT PREVENTION!
#define BLOCK_SUCCESS (1<<1)
/// The below are for "metadata" on "how" the attack was blocked.
/// Attack was and should be redirected according to list argument REDIRECT_METHOD (NOTE: the SHOULD here is important, as it says "the thing blocking isn't handling the reflecting for you so do it yourself"!)
#define BLOCK_SHOULD_REDIRECT (1<<2)
/// Attack was redirected (whether by us or by SHOULD_REDIRECT flagging for automatic handling)
#define BLOCK_REDIRECTED (1<<3)
/// Attack was blocked by something like a shield.
#define BLOCK_PHYSICAL_EXTERNAL (1<<4)
/// Attack was blocked by something worn on you.
#define BLOCK_PHYSICAL_INTERNAL (1<<5)
/// Attack outright missed because the target dodged. Should usually be combined with redirection passthrough or something (see martial arts)
#define BLOCK_TARGET_DODGED (1<<7)
/// Meta-flag for run_block/do_run_block : By default, BLOCK_SUCCESS tells do_run_block() to assume the attack is completely blocked and not continue the block chain. If this is present, it will continue to check other items in the chain rather than stopping.
#define BLOCK_CONTINUE_CHAIN (1<<8)
/// For keys in associative list/block_return as we don't want to saturate our (somewhat) limited flags.
#define BLOCK_RETURN_REDIRECT_METHOD "REDIRECT_METHOD"
/// Pass through victim
#define REDIRECT_METHOD_PASSTHROUGH "passthrough"
/// Deflect at randomish angle
#define REDIRECT_METHOD_DEFLECT "deflect"
/// reverse 180 angle, basically (as opposed to "realistic" wall reflections)
#define REDIRECT_METHOD_REFLECT "reflect"
/// "do not taser the bad man with the desword" - actually aims at the firer/attacker rather than just reversing
#define REDIRECT_METHOD_RETURN_TO_SENDER "no_you"
/// These keys are generally only applied to the list if real_attack is FALSE. Used incase we want to make "smarter" mob AI in the future or something.
/// Tells the caller how likely from 0 (none) to 100 (always) we are to reflect energy projectiles
#define BLOCK_RETURN_REFLECT_PROJECTILE_CHANCE "reflect_projectile_chance"
/// Tells the caller how likely we are to block attacks from 0 to 100 in general
#define BLOCK_RETURN_NORMAL_BLOCK_CHANCE "normal_block_chance"
/// Tells the caller about how many hits we can soak on average before our blocking fails.
#define BLOCK_RETURN_BLOCK_CAPACITY "block_capacity"
/// Default if the above isn't set in the list.
#define DEFAULT_REDIRECT_METHOD_PROJECTILE REDIRECT_METHOD_DEFLECT
/// Block priorities
#define BLOCK_PRIORITY_HELD_ITEM 100
#define BLOCK_PRIORITY_WEAR_SUIT 75
#define BLOCK_PRIORITY_CLOTHING 50
#define BLOCK_PRIORITY_UNIFORM 25
#define BLOCK_PRIORITY_DEFAULT BLOCK_PRIORITY_HELD_ITEM
/**
* should the current-attack-damage be lower than the item force multiplied by this value,
* a "inefficiently" prefix will be added to the message.
*/
#define FEEBLE_ATTACK_MSG_THRESHOLD 0.5
+32
View File
@@ -0,0 +1,32 @@
// Attack types for check_block()/run_block(). Flags, combinable.
/// Attack was melee, whether or not armed.
#define ATTACK_TYPE_MELEE (1<<0)
/// Attack was with a gun or something that should count as a gun (but not if a gun shouldn't count for a gun, crazy right?)
#define ATTACK_TYPE_PROJECTILE (1<<1)
/// Attack was unarmed.. this usually means hand to hand combat.
#define ATTACK_TYPE_UNARMED (1<<2)
/// Attack was a thrown atom hitting the victim.
#define ATTACK_TYPE_THROWN (1<<3)
/// Attack was a bodyslam/leap/tackle. See: Xenomorph leap tackles.
#define ATTACK_TYPE_TACKLE (1<<4)
/// Attack was from a parry counterattack. Do not attempt to parry-this!
#define ATTACK_TYPE_PARRY_COUNTERATTACK (1<<5)
// Requires for datum definitions to not error with must be a constant statement when used in lists as text associative keys.
// KEEP IN SYNC WITH ABOVE!
#define TEXT_ATTACK_TYPE_MELEE "1"
#define TEXT_ATTACK_TYPE_PROJECTILE "2"
#define TEXT_ATTACK_TYPE_UNARMED "4"
#define TEXT_ATTACK_TYPE_THROWN "8"
#define TEXT_ATTACK_TYPE_TACKLE "16"
#define TEXT_ATTACK_TYPE_PARRY_COUNTERATTACK "32"
GLOBAL_LIST_INIT(attack_type_names, list(
TEXT_ATTACK_TYPE_MELEE = "Melee",
TEXT_ATTACK_TYPE_PROJECTILE = "Projectile",
TEXT_ATTACK_TYPE_UNARMED = "Unarmed",
TEXT_ATTACK_TYPE_THROWN = "Thrown",
TEXT_ATTACK_TYPE_TACKLE = "Tackle",
TEXT_ATTACK_TYPE_PARRY_COUNTERATTACK = "Parry Counterattack"
))
+80
View File
@@ -0,0 +1,80 @@
/// Check whether or not we can block, without "triggering" a block. Basically run checks without effects like depleting shields.
/// Wrapper for do_run_block(). The arguments on that means the same as for this.
#define mob_check_block(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)\
do_run_block(FALSE, object, damage, attack_text, attack_type, armour_penetration, attacker, check_zone(def_zone), return_list)
/// Runs a block "sequence", effectively checking and then doing effects if necessary.
/// Wrapper for do_run_block(). The arguments on that means the same as for this.
#define mob_run_block(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)\
do_run_block(TRUE, object, damage, attack_text, attack_type, armour_penetration, attacker, check_zone(def_zone), return_list)
// Don't ask why there's block_parry.dm and this. This is for the run_block() system, which is the "parent" system of the directional block and parry systems.
/// Bitflags for check_block() and handle_block(). Meant to be combined. You can be hit and still reflect, for example, if you do not use BLOCK_SUCCESS.
/// Attack was not blocked
#define BLOCK_NONE NONE
/// Attack was blocked, do not do damage. THIS FLAG MUST BE THERE FOR DAMAGE/EFFECT PREVENTION!
#define BLOCK_SUCCESS (1<<1)
/// The below are for "metadata" on "how" the attack was blocked.
/// Attack was and should be redirected according to list argument REDIRECT_METHOD (NOTE: the SHOULD here is important, as it says "the thing blocking isn't handling the reflecting for you so do it yourself"!)
#define BLOCK_SHOULD_REDIRECT (1<<2)
/// Attack was redirected (whether by us or by SHOULD_REDIRECT flagging for automatic handling)
#define BLOCK_REDIRECTED (1<<3)
/// Attack was blocked by something like a shield.
#define BLOCK_PHYSICAL_EXTERNAL (1<<4)
/// Attack was blocked by something worn on you.
#define BLOCK_PHYSICAL_INTERNAL (1<<5)
/// Attack outright missed because the target dodged. Should usually be combined with redirection passthrough or something (see martial arts)
#define BLOCK_TARGET_DODGED (1<<7)
/// Meta-flag for run_block/do_run_block : By default, BLOCK_SUCCESS tells do_run_block() to assume the attack is completely blocked and not continue the block chain. If this is present, it will continue to check other items in the chain rather than stopping.
#define BLOCK_CONTINUE_CHAIN (1<<8)
/// Attack should change the amount of damage incurred. This means something calling run_block() has to handle it!
#define BLOCK_SHOULD_CHANGE_DAMAGE (1<<9)
/// Attack should scale by this percent, 0 for no block and 100 for full blocked
#define BLOCK_SHOULD_PARTIAL_MITIGATE (1<<10)
/// For keys in associative list/block_return as we don't want to saturate our (somewhat) limited flags.
#define BLOCK_RETURN_REDIRECT_METHOD "REDIRECT_METHOD"
/// Pass through victim
#define REDIRECT_METHOD_PASSTHROUGH "passthrough"
/// Deflect at randomish angle
#define REDIRECT_METHOD_DEFLECT "deflect"
/// reverse 180 angle, basically (as opposed to "realistic" wall reflections)
#define REDIRECT_METHOD_REFLECT "reflect"
/// "do not taser the bad man with the desword" - actually aims at the firer/attacker rather than just reversing
#define REDIRECT_METHOD_RETURN_TO_SENDER "no_you"
/// These keys are generally only applied to the list if real_attack is FALSE. Used incase we want to make "smarter" mob AI in the future or something.
/// Tells the caller how likely from 0 (none) to 100 (always) we are to reflect energy projectiles
#define BLOCK_RETURN_REFLECT_PROJECTILE_CHANCE "reflect_projectile_chance"
/// Tells the caller how likely we are to block attacks from 0 to 100 in general
#define BLOCK_RETURN_NORMAL_BLOCK_CHANCE "normal_block_chance"
/// Tells the caller about how many hits we can soak on average before our blocking fails.
#define BLOCK_RETURN_BLOCK_CAPACITY "block_capacity"
/// Tells the caller we got blocked by active directional block.
#define BLOCK_RETURN_ACTIVE_BLOCK "active_block"
/// Tells the caller our damage mitigation for their attack.
#define BLOCK_RETURN_ACTIVE_BLOCK_DAMAGE_MITIGATED "damage_mitigated"
/// For [BLOCK_CHANGE_DAMAGE]. Set damage to this.
#define BLOCK_RETURN_SET_DAMAGE_TO "set_damage_to"
/// For [BLOCK_SHOULD_PARTIAL_MITIGATE]. Percentage mitigation.
#define BLOCK_RETURN_MITIGATION_PERCENT "partial_mitigation"
/// Used internally by run_parry proc, use on an on_active_parry() proc to override parrying efficiency.
#define BLOCK_RETURN_OVERRIDE_PARRY_EFFICIENCY "override_parry_efficiency"
/// Always set to 100 by run_block() if BLOCK_SUCCESS is in return value. Otherwise, defaults to mitigation percent if not set. Used by projectile/proc/on_hit().
#define BLOCK_RETURN_PROJECTILE_BLOCK_PERCENTAGE "projectile_block_percentage"
/// Default if the above isn't set in the list.
#define DEFAULT_REDIRECT_METHOD_PROJECTILE REDIRECT_METHOD_DEFLECT
/// Block priorities. Higher means it's checked sooner.
// THESE MUST NEVER BE 0! Block code uses ! instead of isnull for the speed boost.
#define BLOCK_PRIORITY_ACTIVE_BLOCK 200
#define BLOCK_PRIORITY_HELD_ITEM 100
#define BLOCK_PRIORITY_CLOTHING 50
#define BLOCK_PRIORITY_WEAR_SUIT 75
#define BLOCK_PRIORITY_UNIFORM 25
#define BLOCK_PRIORITY_DEFAULT BLOCK_PRIORITY_HELD_ITEM
+72
View File
@@ -0,0 +1,72 @@
// We can't determine things like NORTHEAST vs NORTH *and* EAST without making our own flags :(
#define BLOCK_DIR_NORTH (1<<0)
#define BLOCK_DIR_NORTHEAST (1<<1)
#define BLOCK_DIR_NORTHWEST (1<<2)
#define BLOCK_DIR_WEST (1<<3)
#define BLOCK_DIR_EAST (1<<4)
#define BLOCK_DIR_SOUTH (1<<5)
#define BLOCK_DIR_SOUTHEAST (1<<6)
#define BLOCK_DIR_SOUTHWEST (1<<7)
#define BLOCK_DIR_ONTOP (1<<8)
GLOBAL_LIST_INIT(dir2blockdir, list(
"[NORTH]" = BLOCK_DIR_NORTH,
"[NORTHEAST]" = BLOCK_DIR_NORTHEAST,
"[NORTHWEST]" = BLOCK_DIR_NORTHWEST,
"[WEST]" = BLOCK_DIR_WEST,
"[EAST]" = BLOCK_DIR_EAST,
"[SOUTH]" = BLOCK_DIR_SOUTH,
"[SOUTHEAST]" = BLOCK_DIR_SOUTHEAST,
"[SOUTHWEST]" = BLOCK_DIR_SOUTHWEST,
"[NONE]" = BLOCK_DIR_ONTOP
))
#define DIR2BLOCKDIR(d) (GLOB.dir2blockdir["[d]"])
GLOBAL_LIST_INIT(block_direction_names, list(
"[BLOCK_DIR_NORTH]" = "Front",
"[BLOCK_DIR_NORTHEAST]" = "Front Right",
"[BLOCK_DIR_NORTHWEST]" = "Front Left",
"[BLOCK_DIR_WEST]" = "Left",
"[BLOCK_DIR_EAST]" = "Right",
"[BLOCK_DIR_SOUTH]" = "Behind",
"[BLOCK_DIR_SOUTHEAST]" = "Behind Right",
"[BLOCK_DIR_SOUTHWEST]" = "Behind Left",
"[BLOCK_DIR_ONTOP]" = "Ontop"
))
/// If this is the value of active_block_starting it signals we want to interrupt the start
#define ACTIVE_BLOCK_STARTING_INTERRUPT "INTERRUPT"
/// ""types"" of parry "items"
#define UNARMED_PARRY "unarmed"
#define MARTIAL_PARRY "martial"
#define ITEM_PARRY "item"
/// Parry phase we're in
#define NOT_PARRYING 0
#define PARRY_WINDUP 1
#define PARRY_ACTIVE 2
#define PARRY_SPINDOWN 3
// /datum/block_parry_data/var/parry_flags
/// Default handling for audio/visual feedback
#define PARRY_DEFAULT_HANDLE_FEEDBACK (1<<0)
/// Lock sprinting while parrying
#define PARRY_LOCK_SPRINTING (1<<1)
/// Lock attacking while parrying
#define PARRY_LOCK_ATTACKING (1<<2)
/// Parry effects.
/// Automatically melee attacks back normally, LMB equivalent action of an harm intent attack. List association should be defaulting to 1, being the attack damage multiplier for said counterattack
#define PARRY_COUNTERATTACK_MELEE_ATTACK_CHAIN "melee_counterattack_chain"
/// List association should be TRUE.
#define PARRY_DISARM_ATTACKER "disarm_attacker"
/// List association should be duration or null for just plain knockdown.
#define PARRY_KNOCKDOWN_ATTACKER "knockdown_attacker"
/// List association should be duration.
#define PARRY_STAGGER_ATTACKER "stagger_attacker"
/// List association should be amount of time to daze attacker.
#define PARRY_DAZE_ATTACKER "daze_attacker"
/// Set to TRUE in list association to ignore adjacency checks
#define PARRY_COUNTERATTACK_IGNORE_ADJACENCY "ignore_adjacency"
+10 -2
View File
@@ -67,8 +67,11 @@
//tablecrafting defines
#define CAT_NONE ""
#define CAT_WEAPONRY "Weaponry"
#define CAT_WEAPON "Weapons"
#define CAT_WEAPON "Ranged Weapons"
#define CAT_MELEE "Melee Weapons"
#define CAT_OTHER "Misc"
#define CAT_AMMO "Ammunition"
#define CAT_PARTS "Weapon Parts"
#define CAT_ROBOT "Robots"
#define CAT_MISC "Misc"
#define CAT_MISCELLANEOUS "Miscellaneous"
@@ -103,4 +106,9 @@
#define RCD_COMPUTER 16
#define RCD_UPGRADE_FRAMES 1
#define RCD_UPGRADE_SIMPLE_CIRCUITS 2
#define RCD_UPGRADE_SIMPLE_CIRCUITS 2
//Electrochromatic window defines.
#define NOT_ELECTROCHROMATIC 0
#define ELECTROCHROMATIC_OFF 1
#define ELECTROCHROMATIC_DIMMED 2
+71
View File
@@ -0,0 +1,71 @@
//// COOLDOWN SYSTEMS
/*
* We have 2 cooldown systems: timer cooldowns (divided between stoppable and regular) and world.time cooldowns.
*
* When to use each?
*
* * Adding a commonly-checked cooldown, like on a subsystem to check for processing
* * * Use the world.time ones, as they are cheaper.
*
* * Adding a rarely-used one for special situations, such as giving an uncommon item a cooldown on a target.
* * * Timer cooldown, as adding a new variable on each mob to track the cooldown of said uncommon item is going too far.
*
* * Triggering events at the end of a cooldown.
* * * Timer cooldown, registering to its signal.
*
* * Being able to check how long left for the cooldown to end.
* * * Either world.time or stoppable timer cooldowns, depending on the other factors. Regular timer cooldowns do not support this.
*
* * Being able to stop the timer before it ends.
* * * Either world.time or stoppable timer cooldowns, depending on the other factors. Regular timer cooldowns do not support this.
*/
/*
* Cooldown system based on an datum-level associative lazylist using timers.
*/
//INDEXES
#define COOLDOWN_EMPLOYMENT_CABINET "employment cabinet"
//TIMER COOLDOWN MACROS
#define COMSIG_CD_STOP(cd_index) "cooldown_[cd_index]"
#define COMSIG_CD_RESET(cd_index) "cd_reset_[cd_index]"
#define TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, /proc/end_cooldown, cd_source, cd_index), cd_time))
#define TIMER_COOLDOWN_CHECK(cd_source, cd_index) LAZYACCESS(cd_source.cooldowns, cd_index)
#define TIMER_COOLDOWN_END(cd_source, cd_index) LAZYREMOVE(cd_source.cooldowns, cd_index)
/*
* Stoppable timer cooldowns.
* Use indexes the same as the regular tiemr cooldowns.
* They make use of the TIMER_COOLDOWN_CHECK() and TIMER_COOLDOWN_END() macros the same, just not the TIMER_COOLDOWN_START() one.
* A bit more expensive than the regular timers, but can be reset before they end and the time left can be checked.
*/
#define S_TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, /proc/end_cooldown, cd_source, cd_index), cd_time, TIMER_STOPPABLE))
#define S_TIMER_COOLDOWN_RESET(cd_source, cd_index) reset_cooldown(cd_source, cd_index)
#define S_TIMER_COOLDOWN_TIMELEFT(cd_source, cd_index) (timeleft(TIMER_COOLDOWN_CHECK(cd_source, cd_index)))
/*
* Cooldown system based on storing world.time on a variable, plus the cooldown time.
* Better performance over timer cooldowns, lower control. Same functionality.
*/
#define COOLDOWN_DECLARE(cd_index) var/##cd_index = 0
#define COOLDOWN_START(cd_source, cd_index, cd_time) (cd_source.cd_index = world.time + cd_time)
//Returns true if the cooldown has run its course, false otherwise
#define COOLDOWN_FINISHED(cd_source, cd_index) (cd_source.cd_index < world.time)
#define COOLDOWN_RESET(cd_source, cd_index) cd_source.cd_index = 0
#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time))
+8
View File
@@ -75,3 +75,11 @@
#define ID_COMPONENT_KNOWLEDGE_NONE 0
/// Has full knowledge
#define ID_COMPONENT_KNOWLEDGE_FULL 1
// Combat mode flags.
/// The user wants combat mode on
#define COMBAT_MODE_TOGGLED (1<<0)
/// combat mode is active.
#define COMBAT_MODE_ACTIVE (1<<1)
/// combat mode is not active
#define COMBAT_MODE_INACTIVE (1<<2)
+87 -31
View File
@@ -26,10 +26,16 @@
#define COMPONENT_ADD_TRAIT (1<<0)
#define COMPONENT_REMOVE_TRAIT (1<<1)
/// fires on the target datum when an element is attached to it (/datum/element)
#define COMSIG_ELEMENT_ATTACH "element_attach"
/// fires on the target datum when an element is attached to it (/datum/element)
#define COMSIG_ELEMENT_DETACH "element_detach"
// /atom signals
#define COMSIG_PARENT_ATTACKBY "atom_attackby" //from base of atom/attackby(): (/obj/item, /mob/living, params)
#define COMPONENT_NO_AFTERATTACK 1 //Return this in response if you don't want afterattack to be called
#define COMSIG_ATOM_HULK_ATTACK "hulk_attack" //from base of atom/attack_hulk(): (/mob/living/carbon/human)
#define COMSIG_ATOM_ATTACK_ANIMAL "attack_animal" //from base of atom/animal_attack(): (/mob/user)
#define COMSIG_PARENT_EXAMINE "atom_examine" //from base of atom/examine(): (/mob, list/examine_return_text)
#define COMSIG_ATOM_GET_EXAMINE_NAME "atom_examine_name" //from base of atom/get_examine_name(): (/mob, list/overrides)
//Positions for overrides list
@@ -89,7 +95,7 @@
#define COMSIG_EXIT_AREA "exit_area" //from base of area/Exited(): (/area)
#define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params, mob/user)
#define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob)
#define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob), return flags also used by other signals.
#define COMPONENT_ALLOW_EXAMINATE 1
#define COMPONENT_DENY_EXAMINATE 2 //Higher priority compared to the above one
@@ -135,19 +141,24 @@
#define HEARING_SPEAKER 2
// #define HEARING_LANGUAGE 3
#define HEARING_RAW_MESSAGE 4
/* #define HEARING_RADIO_FREQ 5
#define HEARING_SPANS 6
// #define HEARING_RADIO_FREQ 5
// #define HEARING_SPANS 6
#define HEARING_MESSAGE_MODE 7
#define HEARING_SOURCE 8*/
// #define HEARING_SOURCE 8
#define COMSIG_MOVABLE_DISPOSING "movable_disposing" //called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
#define COMSIG_MOVABLE_TELEPORTED "movable_teleported" //from base of do_teleport(): (channel, turf/origin, turf/destination)
// /mind signals
#define COMSIG_PRE_MIND_TRANSFER "pre_mind_transfer" //from base of mind/transfer_to() before it's done: (new_character, old_character)
#define COMPONENT_STOP_MIND_TRANSFER 1 //stops the mind transfer from happening.
#define COMSIG_MIND_TRANSFER "mind_transfer" //from base of mind/transfer_to() when it's done: (new_character, old_character)
// /mob signals
#define COMSIG_MOB_EXAMINATE "mob_examinate" //from base of /mob/verb/examinate(): (atom/A)
#define COMSIG_MOB_CLICKED_SHIFT_ON "mob_shift_click_on" //from base of /atom/ShiftClick(): (atom/A), for return values, see COMSIG_CLICK_SHIFT
#define COMSIG_MOB_FOV_VIEW "mob_visible_atoms" //from base of /mob/fov_view(): (list/visible_atoms)
#define COMSIG_MOB_POINTED "mob_pointed" //from base of /mob/verb/pointed(): (atom/A)
#define COMSIG_MOB_EXAMINATE "mob_examinate" //from base of /mob/verb/examinate(): (atom/A), for return values, see COMSIG_CLICK_SHIFT
#define COMPONENT_EXAMINATE_BLIND 3 //outputs the "something is there but you can't see it" message.
#define COMSIG_MOB_DEATH "mob_death" //from base of mob/death(): (gibbed)
#define COMPONENT_BLOCK_DEATH_BROADCAST 1 //stops the death from being broadcasted in deadchat.
#define COMSIG_MOB_CLICKON "mob_clickon" //from base of mob/clickon(): (atom/A, params)
@@ -181,30 +192,21 @@
#define SPEECH_LANGUAGE 5
// #define SPEECH_IGNORE_SPAM 6
// #define SPEECH_FORCED 7
#define COMSIG_MOB_FOV_VIEWER "mob_is_viewer" //from base of /fov_viewers(): (atom/center, depth, viewers_list)
#define COMSIG_MOB_GET_VISIBLE_MESSAGE "mob_get_visible_message" //from base of atom/visible_message(): (atom/A, msg, range, ignored_mobs)
#define COMPONENT_NO_VISIBLE_MESSAGE 1 //exactly what's said on the tin.
#define COMSIG_MOB_ANTAG_ON_GAIN "mob_antag_on_gain" //from base of /datum/antagonist/on_gain(): (antag_datum)
#define COMSIG_MOB_SPELL_CAN_CAST "mob_spell_can_cast" //from base of /obj/effect/proc_holder/spell/can_cast(): (spell)
#define COMSIG_MOB_SWAP_HANDS "mob_swap_hands" //from base of mob/swap_hand(): (obj/item)
#define COMPONENT_BLOCK_SWAP 1
#define COMSIG_MOB_ACTION_SKILL_MOD "mob_action_skill_mod" //from base of /datum/skill_holder/action_skills_mod() : (proc args list, list/mod_values)
#define ACTION_SKILL_MOD_SKILL 1 //redundancy.
#define ACTION_SKILL_MOD_VALUE 2
#define ACTION_SKILL_MOD_THRESHOLD 3
#define ACTION_SKILL_MOD_IS_MULTI 4
//other mod values, kept separate from the args
#define MOD_VALUES_SKILL_MOD 1
#define COMSIG_MOB_ITEM_ACTION_SKILLS_MOD "mob_item_action_skills_mod" //from base of /datum/skill_holder/item_action_skills_mod() : (proc args list, mod_values)
#define ITEM_SKILLS_MOD_ITEM 1 //redundancy
#define ITEM_SKILLS_MOD_VALUE 2
#define ITEM_SKILLS_MOD_FLAGS 3
#define ITEM_SKILLS_MOD_BAD_FLAGS 4
#define ITEM_SKILLS_MOD_IS_MULTI 5
//other mod values, kept separate from the args
#define MOD_VALUES_ITEM_SKILLS_SUM 1
#define MOD_VALUES_ITEM_SKILLS_DIV 2
#define MOD_VALUES_ITEM_SKILLS_CHECKED 3
#define COMSIG_MOB_SKILL_GET_AFFINITY "mob_skill_get_affinity" //from base of /datum/skill_holder/get_skill_affinity(): (skill_path, list/return_value)
// /client signals
#define COMSIG_MOB_CLIENT_LOGIN "mob_client_login" //sent when a mob/login() finishes: (client)
#define COMSIG_MOB_CLIENT_LOGOUT "mob_client_logout" //sent when a mob/logout() starts: (client)
#define COMSIG_MOB_CLIENT_MOVE "mob_client_move" //sent when client/Move() finishes with no early returns: (client, direction, n, oldloc)
#define COMSIG_MOB_CLIENT_CHANGE_VIEW "mob_client_change_view" //from base of /client/change_view(): (client, old_view, view)
#define COMSIG_MOB_CLIENT_MOUSEMOVE "mob_client_mousemove" //from base of /client/MouseMove(): (object, location, control, params)
// /mob/living signals
#define COMSIG_LIVING_REGENERATE_LIMBS "living_regenerate_limbs" //from base of /mob/living/regenerate_limbs(): (noheal, excluded_limbs)
@@ -212,18 +214,21 @@
#define COMSIG_LIVING_IGNITED "living_ignite" //from base of mob/living/IgniteMob() (/mob/living)
#define COMSIG_LIVING_EXTINGUISHED "living_extinguished" //from base of mob/living/ExtinguishMob() (/mob/living)
#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act" //from base of mob/living/electrocute_act(): (shock_damage, source, siemens_coeff, flags)
#define COMSIG_LIVING_SHOCK_PREVENTED "living_shock_prevented" //sent when items with siemen coeff. of 0 block a shock: (power_source, source, siemens_coeff, dist_check)
#define COMSIG_LIVING_MINOR_SHOCK "living_minor_shock" //sent by stuff like stunbatons and tasers: ()
#define COMSIG_LIVING_REVIVE "living_revive" //from base of mob/living/revive() (full_heal, admin_revive)
#define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login" //sent when a mob/login() finishes: (client)
#define COMSIG_MOB_CLIENT_LOGOUT "comsig_mob_client_logout" //sent when a mob/logout() starts: (client)
#define COMSIG_MOB_CLIENT_MOVE "comsig_mob_client_move" //sent when client/Move() finishes with no early returns: (client, direction, n, oldloc)
#define COMSIG_MOB_RESET_PERSPECTIVE "mob_reset_perspective" //from base of /mob/reset_perspective(): (atom/target)
#define COMSIG_LIVING_GUN_PROCESS_FIRE "living_gun_process_fire" //from base of /obj/item/gun/proc/process_fire(): (atom/target, params, zone_override)
// This returns flags as defined for block in __DEFINES/combat.dm!
#define COMSIG_LIVING_RUN_BLOCK "living_do_run_block" //from base of mob/living/do_run_block(): (real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone)
#define COMSIG_LIVING_COMBAT_ENABLED "combatmode_enabled" //from base of mob/living/enable_combat_mode() (was_forced)
#define COMSIG_LIVING_COMBAT_DISABLED "combatmode_disabled" //from base of mob/living/disable_combat_mode() (was_forced)
#define COMSIG_LIVING_GET_BLOCKING_ITEMS "get_blocking_items" //from base of mob/living/get_blocking_items(): (list/items)
#define COMSIG_LIVING_ACTIVE_BLOCK_START "active_block_start" //from base of mob/living/keybind_start_active_blocking(): (obj/item/blocking_item, list/backup_items)
#define COMPONENT_PREVENT_BLOCK_START 1
#define COMSIG_LIVING_ACTIVE_PARRY_START "active_parry_start" //from base of mob/living/initiate_parry_sequence(): (parrying_method, datum/parrying_item_mob_or_art, list/backup_items)
#define COMPONENT_PREVENT_PARRY_START 1
//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS!
#define COMSIG_LIVING_STATUS_STUN "living_stun" //from base of mob/living/Stun() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown" //from base of mob/living/Knockdown() (amount, update, ignore)
@@ -235,10 +240,20 @@
#define COMSIG_LIVING_STATUS_STAGGER "living_stagger" //from base of mob/living/Stagger() (amount, update, ignore)
#define COMPONENT_NO_STUN 1 //For all of them
#define COMSIG_LIVING_LIFE "life_tick" //from base of mob/living/Life() (seconds, times_fired)
#define COMPONENT_INTERRUPT_LIFE_BIOLOGICAL 1 // interrupt biological processes
#define COMPONENT_INTERRUPT_LIFE_PHYSICAL 2 // interrupt physical handling
// /mob/living/carbon signals
#define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity))
#define COMSIG_CARBON_IDENTITY_TRANSFERRED_TO "carbon_id_transferred_to" //from datum/dna/transfer_identity(): (datum/dna, transfer_SE)
#define COMSIG_CARBON_TACKLED "carbon_tackled" //sends from tackle.dm on tackle completion
#define COMSIG_CARBON_EMBED_RIP "item_embed_start_rip" // defined twice, in carbon and human's topics, fired when interacting with a valid embedded_object to pull it out (mob/living/carbon/target, /obj/item, /obj/item/bodypart/L)
#define COMSIG_CARBON_EMBED_REMOVAL "item_embed_remove_safe" // called when removing a given item from a mob, from mob/living/carbon/remove_embedded_object(mob/living/carbon/target, /obj/item)
// /mob/living/silicon signals
#define COMSIG_ROBOT_UPDATE_ICONS "robot_update_icons" //from base of robot/update_icons(): ()
// /mob/living/simple_animal/hostile signals
#define COMSIG_HOSTILE_ATTACKINGTARGET "hostile_attackingtarget"
#define COMPONENT_HOSTILE_NO_ATTACK 1
@@ -247,6 +262,9 @@
#define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled)
#define COMSIG_OBJ_BREAK "obj_break" //from base of /obj/obj_break(): (damage_flag)
#define COMSIG_OBJ_SETANCHORED "obj_setanchored" //called in /obj/structure/setAnchored(): (value)
#define COMSIG_OBJ_ATTACK_GENERIC "obj_attack_generic" //from base of atom/animal_attack(): (/mob/user)
#define COMPONENT_STOP_GENERIC_ATTACK 1
// /machinery signals
#define COMSIG_MACHINE_EJECT_OCCUPANT "eject_occupant" //from base of obj/machinery/dropContents() (occupant)
@@ -272,15 +290,30 @@
#define COMSIG_ITEM_ATTACK_ZONE "item_attack_zone" //from base of mob/living/carbon/attacked_by(): (mob/living/carbon/target, mob/living/user, hit_zone)
#define COMSIG_ITEM_IMBUE_SOUL "item_imbue_soul" //return a truthy value to prevent ensouling, checked in /obj/effect/proc_holder/spell/targeted/lichdom/cast(): (mob/user)
#define COMSIG_ITEM_HIT_REACT "item_hit_react" //from base of obj/item/hit_reaction(): (list/args)
#define COMSIG_ITEM_WEARERCROSSED "wearer_crossed" //called on item when crossed by something (): (/atom/movable)
#define COMSIG_ITEM_WEARERCROSSED "wearer_crossed" //called on item when crossed by something (): (/atom/movable)
#define COMSIG_ITEM_SHARPEN_ACT "sharpen_act" //from base of item/sharpener/attackby(): (amount, max)
#define COMPONENT_BLOCK_SHARPEN_APPLIED 1
#define COMPONENT_BLOCK_SHARPEN_BLOCKED 2
#define COMPONENT_BLOCK_SHARPEN_ALREADY 4
#define COMPONENT_BLOCK_SHARPEN_MAXED 8
#define COMSIG_ITEM_MICROWAVE_ACT "microwave_act" //called on item when microwaved (): (obj/machinery/microwave/M)
#define COMSIG_ITEM_WORN_OVERLAYS "item_worn_overlays" //from base of obj/item/worn_overlays(): (isinhands, icon_file, used_state, style_flags, list/overlays)
// THE FOLLOWING TWO BLOCKS SHOULD RETURN BLOCK FLAGS AS DEFINED IN __DEFINES/combat.dm!
#define COMSIG_ITEM_CHECK_BLOCK "check_block" //from base of obj/item/check_block(): (mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
#define COMSIG_ITEM_RUN_BLOCK "run_block" //from base of obj/item/run_block(): (mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
// Item mouse siganls
#define COMSIG_ITEM_MOUSE_EXIT "item_mouse_exit" //from base of obj/item/MouseExited(): (location, control, params)
#define COMSIG_ITEM_MOUSE_ENTER "item_mouse_enter" //from base of obj/item/MouseEntered(): (location, control, params)
#define COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN "deconstructor_deepscan" //Called by deconstructive analyzers deepscanning an item: (obj/machinery/rnd/destructive_analyzer/analyzer_machine, mob/user, list/information_list)
#define COMSIG_ITEM_DISABLE_EMBED "item_disable_embed" ///from [/obj/item/proc/disableEmbedding]:
#define COMSIG_MINE_TRIGGERED "minegoboom" ///from [/obj/effect/mine/proc/triggermine]:
// Uncovered information
#define COMPONENT_DEEPSCAN_UNCOVERED_INFORMATION 1
// /obj/item/grenade signals
#define COMSIG_GRENADE_PRIME "grenade_prime" //called in /obj/item/gun/process_fire (user, target, params, zone_override)
#define COMSIG_GRENADE_ARMED "grenade_armed" //called in /obj/item/gun/process_fire (user, target, params, zone_override)
// /obj/item/clothing signals
#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //from base of obj/item/clothing/shoes/proc/step_action(): ()
#define COMSIG_SUIT_MADE_HELMET "suit_made_helmet" //from base of obj/item/clothing/suit/MakeHelmet(): (helmet)
@@ -308,8 +341,15 @@
#define COMSIG_PEN_ROTATED "pen_rotated" //called after rotation in /obj/item/pen/attack_self(): (rotation, mob/living/carbon/user)
// /obj/item/projectile signals (sent to the firer)
#define COMSIG_PROJECTILE_SELF_ON_HIT "projectile_self_on_hit" // from base of /obj/item/projectile/proc/on_hit(): (atom/movable/firer, atom/target, Angle)
#define COMSIG_PROJECTILE_ON_HIT "projectile_on_hit" // from base of /obj/item/projectile/proc/on_hit(): (atom/movable/firer, atom/target, Angle)
#define COMSIG_PROJECTILE_BEFORE_FIRE "projectile_before_fire" // from base of /obj/item/projectile/proc/fire(): (obj/item/projectile, atom/original_target)
#define COMSIG_PROJECTILE_FIRE "projectile_fire" ///from the base of /obj/projectile/proc/fire(): ()
#define COMSIG_PROJECTILE_RANGE_OUT "projectile_range_out" // sent to targets during the process_hit proc of projectiles
#define COMSIG_EMBED_TRY_FORCE "item_try_embed" // sent when trying to force an embed (mainly for projectiles, only used in the embed element)
#define COMSIG_PROJECTILE_PREHIT "com_proj_prehit" ///sent to targets during the process_hit proc of projectiles
#define COMSIG_PELLET_CLOUD_INIT "pellet_cloud_init" // sent to targets during the process_hit proc of projectiles
// /mob/living/carbon/human signals
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" //from mob/living/carbon/human/UnarmedAttack(): (atom/target)
@@ -323,6 +363,9 @@
#define COMSIG_SPECIES_GAIN "species_gain" //from datum/species/on_species_gain(): (datum/species/new_species, datum/species/old_species)
#define COMSIG_SPECIES_LOSS "species_loss" //from datum/species/on_species_loss(): (datum/species/lost_species)
// /datum/mutation signals
#define COMSIG_HUMAN_MUTATION_LOSS "human_mutation_loss" //from datum/mutation/human/on_losing(): (datum/mutation/human/lost_mutation)
/*******Component Specific Signals*******/
//Janitor
#define COMSIG_TURF_IS_WET "check_turf_wet" //(): Returns bitflags of wet values.
@@ -343,6 +386,14 @@
//NTnet
#define COMSIG_COMPONENT_NTNET_RECEIVE "ntnet_receive" //called on an object by its NTNET connection component on receive. (sending_id(number), sending_netname(text), data(datum/netdata))
//Combat mode
#define COMSIG_TOGGLE_COMBAT_MODE "toggle_combat_mode" //safely toggles combat mode.
#define COMSIG_DISABLE_COMBAT_MODE "disable_combat_mode" //safely disables combat mode.
#define COMSIG_ENABLE_COMBAT_MODE "enable_combat_mode" //safely enables combat mode.
#define COMSIG_LIVING_COMBAT_ENABLED "combatmode_enabled" //from base of datum/component/combat_mode/enable_combat_mode() (was_forced)
#define COMSIG_LIVING_COMBAT_DISABLED "combatmode_disabled" //from base of datum/component/combat_mode/disable_combat_mode() (was_forced)
#define COMSIG_COMBAT_MODE_CHECK "combatmode_check" //called when checking the combat mode flags (enabled/disabled/forced)
//Nanites
#define COMSIG_HAS_NANITES "has_nanites" //() returns TRUE if nanites are found
#define COMSIG_NANITE_IS_STEALTHY "nanite_is_stealthy" //() returns TRUE if nanites have stealth
@@ -380,6 +431,11 @@
#define COMSIG_TRY_STORAGE_RETURN_INVENTORY "storage_return_inventory" //(list/list_to_inject_results_into, recursively_search_inside_storages = TRUE)
#define COMSIG_TRY_STORAGE_CAN_INSERT "storage_can_equip" //(obj/item/insertion_candidate, mob/user, silent) - returns bool
// /datum/component/two_handed signals
#define COMSIG_TWOHANDED_WIELD "twohanded_wield" //from base of datum/component/two_handed/proc/wield(mob/living/carbon/user): (/mob/user)
#define COMPONENT_TWOHANDED_BLOCK_WIELD 1
#define COMSIG_TWOHANDED_UNWIELD "twohanded_unwield" //from base of datum/component/two_handed/proc/unwield(mob/living/carbon/user): (/mob/user)
// /datum/action signals
#define COMSIG_ACTION_TRIGGER "action_trigger" //from base of datum/action/proc/Trigger(): (datum/action)
#define COMPONENT_ACTION_BLOCK_TRIGGER 1
+16
View File
@@ -33,3 +33,19 @@
#define ID_NO_BANK_ACCOUNT 0
#define ID_FREE_BANK_ACCOUNT 1
#define ID_LOCKED_BANK_ACCOUNT 2
//Some price defines to help standarize the intended vending value of items. Do not bother adding too many examples.
#define PRICE_FREE 0 // Sustainance/soviet vendor stuff.
#define PRICE_CHEAP_AS_FREE 10 // Cheap lighters, syringes, soft drinks etc.
#define PRICE_REALLY_CHEAP 20 // Snacks, hot drinks, tools.
#define PRICE_PRETTY_CHEAP 30 // Some snacks, beer.
#define PRICE_CHEAP 40 // Clothings. some electronics
#define PRICE_ALMOST_CHEAP 60 // Fancy clothing, cig packs, booze-o-mat, seeds, medical.
#define PRICE_BELOW_NORMAL 80 // Clothesmate and kinkmate premium stuff.
#define PRICE_NORMAL 100 // Kitchen knife, other stuff.
#define PRICE_ABOVE_NORMAL 150 // Liberation (capitalism ahoy) and donksoft vendors.
#define PRICE_ALMOST_EXPENSIVE 200 // Butcher knife, cartridges, some premium stuff.
#define PRICE_EXPENSIVE 325 // Premium stuff.
#define PRICE_ABOVE_EXPENSIVE 500 // RCD, Crew pinpointer/monitor, galoshes
#define PRICE_REALLY_EXPENSIVE 700 // More premium stuff.
#define PRICE_ALMOST_ONE_GRAND 900 // $$$ Insulated gloves, backpack water-tank spray $$$
+32
View File
@@ -0,0 +1,32 @@
/// Requires absolute stillness from the user
#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER (1<<0)
/// Requires absolute stillness from the target
#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET (1<<1)
/// Requires that the user is on a turf.
#define DO_AFTER_REQUIRES_USER_ON_TURF (1<<2)
/// Requires relative stillness to our target via dx and dy coordinate difference but only if both are spacedrifting. Specify DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY to say otherwise.
#define DO_AFTER_DISALLOW_MOVING_RELATIVE (1<<3)
/// Breaks if active hand item changes. Requires a tool be specified, otherwise defaults to active item
#define DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE (1<<4)
/// Breaks if the user has no free hands. If a tool is specified, allows that as well.
#define DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL (1<<5)
/// Do not display progressbar.
#define DO_AFTER_NO_PROGRESSBAR (1<<6)
/// Do not check do_after_coefficient()
#define DO_AFTER_NO_COEFFICIENT (1<<7)
/// For relative stillness, allow non spacedrift relative movement
#define DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY (1<<8)
/// Ignores checks.
#define DO_AFTER_PROCEED "PROCEED"
/// Uses all other checks
#define DO_AFTER_CONTINUE "CONTINUE"
/// Breaks
#define DO_AFTER_STOP "STOP"
/// Stage - initiating a do_after
#define DO_AFTER_STARTING 1
/// Stage - main loop of a do_after
#define DO_AFTER_PROGRESSING 2
/// Stage - Last check of a do_after
#define DO_AFTER_FINISHING 3
+5 -1
View File
@@ -18,4 +18,8 @@
#define DRINK_VERYGOOD 3
#define DRINK_FANTASTIC 4
#define FOOD_AMAZING 5
#define RACE_DRINK 6
#define RACE_DRINK 6
#define FOOD_IN_CONTAINER (1<<0)
#define STOP_SERVING_BREAKFAST (15 MINUTES)
+18
View File
@@ -6,6 +6,7 @@
#define FOOTSTEP_GRASS "grass"
#define FOOTSTEP_WATER "water"
#define FOOTSTEP_LAVA "lava"
#define FOOTSTEP_MEAT "meat"
//barefoot sounds
#define FOOTSTEP_WOOD_BAREFOOT "woodbarefoot"
#define FOOTSTEP_WOOD_CLAW "woodclaw"
@@ -24,6 +25,15 @@
#define FOOTPRINT_SNAKE "snake"
#define FOOTPRINT_DRAG "drag"
//footstep mob defines
#define FOOTSTEP_MOB_CLAW 1
#define FOOTSTEP_MOB_BAREFOOT 2
#define FOOTSTEP_MOB_HEAVY 3
#define FOOTSTEP_MOB_SHOE 4
#define FOOTSTEP_MOB_HUMAN 5 //Warning: Only works on /mob/living/carbon/human
#define FOOTSTEP_MOB_SLIME 6
#define FOOTSTEP_MOB_CRAWL 7
/*
id = list(
@@ -80,6 +90,8 @@ GLOBAL_LIST_INIT(footstep, list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'sound/effects/meatslap.ogg'), 100, 0)
))
//bare footsteps lists
@@ -122,6 +134,8 @@ GLOBAL_LIST_INIT(barefootstep, list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'sound/effects/meatslap.ogg'), 100, 0)
))
//claw footsteps lists
@@ -164,6 +178,8 @@ GLOBAL_LIST_INIT(clawfootstep, list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'sound/effects/meatslap.ogg'), 100, 0)
))
//heavy footsteps list
@@ -180,4 +196,6 @@ GLOBAL_LIST_INIT(heavyfootstep, list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'sound/effects/meatslap.ogg'), 100, 0)
))
+11 -44
View File
@@ -1,3 +1,6 @@
/// Checks if something is a BYOND object datatype rather than a primitive, or whatever's closest to one.
#define is_object_datatype(object) (object && !ispath(object) && !istext(object) && !isnum(object))
// simple is_type and similar inline helpers
#define in_range(source, user) (get_dist(source, user) <= 1 && (get_step(source, 0)?:z) == (get_step(user, 0)?:z))
@@ -132,6 +135,8 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(
#define iscat(A) (istype(A, /mob/living/simple_animal/pet/cat))
#define isdog(A) (istype(A, /mob/living/simple_animal/pet/dog))
#define iscorgi(A) (istype(A, /mob/living/simple_animal/pet/dog/corgi))
#define ishostile(A) (istype(A, /mob/living/simple_animal/hostile))
@@ -148,50 +153,6 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(
#define isclown(A) (istype(A, /mob/living/simple_animal/hostile/retaliate/clown))
GLOBAL_LIST_INIT(shoefootmob, typecacheof(list(
/mob/living/carbon/human/,
/mob/living/simple_animal/cow,
/mob/living/simple_animal/hostile/cat_butcherer,
/mob/living/simple_animal/hostile/faithless,
/mob/living/simple_animal/hostile/nanotrasen,
/mob/living/simple_animal/hostile/pirate,
/mob/living/simple_animal/hostile/russian,
/mob/living/simple_animal/hostile/syndicate,
/mob/living/simple_animal/hostile/wizard,
/mob/living/simple_animal/hostile/zombie,
/mob/living/simple_animal/hostile/retaliate/clown,
/mob/living/simple_animal/hostile/retaliate/spaceman,
/mob/living/simple_animal/hostile/retaliate/nanotrasenpeace,
/mob/living/simple_animal/hostile/retaliate/goat,
/mob/living/carbon/true_devil,
)))
GLOBAL_LIST_INIT(clawfootmob, typecacheof(list(
/mob/living/carbon/alien/humanoid,
/mob/living/simple_animal/hostile/alien,
/mob/living/simple_animal/pet/cat,
/mob/living/simple_animal/pet/dog,
/mob/living/simple_animal/pet/fox,
/mob/living/simple_animal/chicken,
/mob/living/simple_animal/hostile/bear,
/mob/living/simple_animal/hostile/jungle/mega_arachnid,
/mob/living/simple_animal/hostile/asteroid/ice_whelp,
/mob/living/simple_animal/hostile/asteroid/wolf,
/mob/living/simple_animal/hostile/asteroid/polarbear
)))
GLOBAL_LIST_INIT(barefootmob, typecacheof(list(
/mob/living/carbon/monkey,
/mob/living/simple_animal/pet/penguin,
/mob/living/simple_animal/hostile/gorilla,
/mob/living/simple_animal/hostile/jungle/mook
)))
GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list(
/mob/living/simple_animal/hostile/megafauna,
/mob/living/simple_animal/hostile/jungle/leaper
)))
//Misc mobs
#define isobserver(A) (istype(A, /mob/dead/observer))
@@ -221,6 +182,12 @@ GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list(
#define isitem(A) (istype(A, /obj/item))
#define isgrenade(A) (istype(A, /obj/item/grenade))
#define islandmine(A) (istype(A, /obj/effect/mine))
#define isammocasing(A) (istype(A, /obj/item/ammo_casing))
#define isidcard(I) (istype(I, /obj/item/card/id))
#define isstructure(A) (istype(A, /obj/structure))
+41 -18
View File
@@ -11,16 +11,38 @@
#define PLANE_SPACE_PARALLAX_RENDER_TARGET "PLANE_SPACE_PARALLAX"
#define OPENSPACE_LAYER 17 //Openspace layer over all
#define OPENSPACE_PLANE -4 //Openspace plane below all turfs
#define OPENSPACE_BACKDROP_PLANE -3 //Black square just over openspace plane to guaranteed cover all in openspace turf
#define OPENSPACE_PLANE -10 //Openspace plane below all turfs
#define OPENSPACE_BACKDROP_PLANE -9 //Black square just over openspace plane to guaranteed cover all in openspace turf
#define FLOOR_PLANE -2
#define FLOOR_PLANE -8
#define FLOOR_PLANE_RENDER_TARGET "FLOOR_PLANE"
#define GAME_PLANE -1
#define WALL_PLANE -7
#define WALL_PLANE_RENDER_TARGET "WALL_PLANE"
#define ABOVE_WALL_PLANE -6
#define ABOVE_WALL_PLANE_RENDER_TARGET "ABOVE_WALL_PLANE"
#define FIELD_OF_VISION_BLOCKER_PLANE -5
#define FIELD_OF_VISION_BLOCKER_RENDER_TARGET "*FIELD_OF_VISION_BLOCKER_PLANE"
#define FIELD_OF_VISION_PLANE -4
#define FIELD_OF_VISION_RENDER_TARGET "*FIELD_OF_VISION_PLANE"
#define FIELD_OF_VISION_LAYER 17 //used to place the visual (not the mask) shadow cone above any other floor plane stuff.
#define GAME_PLANE -3
#define GAME_PLANE_RENDER_TARGET "GAME_PLANE"
#define FIELD_OF_VISION_VISUAL_PLANE -2 //Yea, FoV does require quite a few planes to work with 513 filters to a decent degree.
#define FIELD_OF_VISION_VISUAL_RENDER_TARGET "FIELD_OF_VISION_VISUAL_PLANE"
#define CHAT_PLANE -1 //We don't want heard messages to be hidden by FoV.
#define CHAT_LAYER 12.1 //Legacy, it doesn't matter that much because we are displayed above the game plane anyway.
#define BLACKNESS_PLANE 0 //To keep from conflicts with SEE_BLACKNESS internals
#define BLACKNESS_PLANE_RENDER_TARGET "BLACKNESS_PLANE"
///Layers most often used by atoms of plane lower than GAME_PLANE
#define SPACE_LAYER 1.8
//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define
#define MID_TURF_LAYER 2.02
@@ -40,11 +62,12 @@
#define GAS_PIPE_VISIBLE_LAYER 2.47
#define GAS_FILTER_LAYER 2.48
#define GAS_PUMP_LAYER 2.49
#define LOW_OBJ_LAYER 2.5
#define LOW_SIGIL_LAYER 2.52
#define SIGIL_LAYER 2.54
#define HIGH_SIGIL_LAYER 2.56
///Layers most often used by atoms of plane equal or higher than GAME_PLANE
#define BELOW_OPEN_DOOR_LAYER 2.6
#define BLASTDOOR_LAYER 2.65
#define OPEN_DOOR_LAYER 2.7
@@ -80,8 +103,9 @@
#define SPACEVINE_LAYER 4.8
#define SPACEVINE_MOB_LAYER 4.9
//#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define
#define GASFIRE_LAYER 5.05
#define RIPPLE_LAYER 5.1
#define ABOVE_FLY_LAYER 5.1
#define GASFIRE_LAYER 5.2
#define RIPPLE_LAYER 5.3
#define GHOST_LAYER 6
#define LOW_LANDMARK_LAYER 9
@@ -91,8 +115,6 @@
#define MASSIVE_OBJ_LAYER 11
#define POINT_LAYER 12
#define CHAT_LAYER 12.1
#define EMISSIVE_BLOCKER_PLANE 12
#define EMISSIVE_BLOCKER_LAYER 12
#define EMISSIVE_BLOCKER_RENDER_TARGET "*EMISSIVE_BLOCKER_PLANE"
@@ -136,19 +158,20 @@
#define HUD_LAYER 21
#define HUD_RENDER_TARGET "HUD_PLANE"
#define VOLUMETRIC_STORAGE_BOX_PLANE 23
#define VOLUMETRIC_STORAGE_BOX_LAYER 23
#define VOLUMETRIC_STORAGE_BOX_PLANE 22
#define VOLUMETRIC_STORAGE_BOX_LAYER 22
#define VOLUMETRIC_STORAGE_BOX_RENDER_TARGET "VOLUME_STORAGE_BOX_PLANE"
#define VOLUMETRIC_STORAGE_ITEM_PLANE 24
#define VOLUMETRIC_STORAGE_ITEM_LAYER 24
#define VOLUMETRIC_STORAGE_ITEM_PLANE 23
#define VOLUMETRIC_STORAGE_ITEM_LAYER 23
#define VOLUMETRIC_STORAGE_ACTIVE_ITEM_LAYER 25
#define VOLUMETRIC_STORAGE_ACTIVE_ITEM_PLANE 25
#define VOLUMETRIC_STORAGE_ITEM_RENDER_TARGET "VOLUME_STORAGE_ITEM_PLANE"
#define ABOVE_HUD_PLANE 25
#define ABOVE_HUD_LAYER 25
#define ABOVE_HUD_PLANE 30
#define ABOVE_HUD_LAYER 30
#define ABOVE_HUD_RENDER_TARGET "ABOVE_HUD_PLANE"
#define SPLASHSCREEN_LAYER 30
#define SPLASHSCREEN_PLANE 30
#define SPLASHSCREEN_LAYER 90
#define SPLASHSCREEN_PLANE 90
#define SPLASHSCREEN_RENDER_TARGET "SPLASHSCREEN_PLANE"
+25
View File
@@ -88,3 +88,28 @@
#define EMISSIVE_BLOCK_GENERIC 1
/// Uses a dedicated render_target object to copy the entire appearance in real time to the blocking layer. For things that can change in appearance a lot from the base state, like humans.
#define EMISSIVE_BLOCK_UNIQUE 2
/// Returns the red part of a #RRGGBB hex sequence as number
#define GETREDPART(hexa) hex2num(copytext(hexa, 2, 4))
/// Returns the green part of a #RRGGBB hex sequence as number
#define GETGREENPART(hexa) hex2num(copytext(hexa, 4, 6))
/// Returns the blue part of a #RRGGBB hex sequence as number
#define GETBLUEPART(hexa) hex2num(copytext(hexa, 6, 8))
/// Parse the hexadecimal color into lumcounts of each perspective.
#define PARSE_LIGHT_COLOR(source) \
do { \
if (source.light_color) { \
var/__light_color = source.light_color; \
source.lum_r = GETREDPART(__light_color) / 255; \
source.lum_g = GETGREENPART(__light_color) / 255; \
source.lum_b = GETBLUEPART(__light_color) / 255; \
} else { \
source.lum_r = 1; \
source.lum_g = 1; \
source.lum_b = 1; \
}; \
} while (FALSE)
+1
View File
@@ -18,6 +18,7 @@
#define INVESTIGATE_CIRCUIT "circuit"
#define INVESTIGATE_FERMICHEM "fermichem"
#define INVESTIGATE_RCD "rcd"
#define INVESTIGATE_CRYOGENICS "cryogenics"
// Logging types for log_message()
#define LOG_ATTACK (1 << 0)
+4
View File
@@ -115,3 +115,7 @@
//these flags are used to tell the DNA modifier if a plant gene cannot be extracted or modified.
#define PLANT_GENE_REMOVABLE (1<<0)
#define PLANT_GENE_EXTRACTABLE (1<<1)
#define CLONEPOD_GET_MIND 1
#define CLONEPOD_POLL_MIND 2
#define CLONEPOD_NO_MIND 3
+6 -2
View File
@@ -4,8 +4,12 @@
/// Hard materials, such as iron or metal
#define MAT_CATEGORY_RIGID "rigid material"
///Use this flag on TRUE if you want the basic recipes
#define MAT_CATEGORY_BASE_RECIPES "basic recipes"
/// Flag for atoms, this flag ensures it isn't re-colored by materials. Useful for snowflake icons such as default toolboxes.
#define MATERIAL_COLOR (1<<0)
#define MATERIAL_ADD_PREFIX (1<<1)
#define MATERIAL_EFFECTS (1<<2)
#define MATERIAL_AFFECT_STATISTICS (1<<3)
#define MATERIAL_AFFECT_STATISTICS (1<<2)
#define MATERIAL_SOURCE(mat) "[mat.name]_material"
+2
View File
@@ -209,3 +209,5 @@
/// Make sure something is a boolean TRUE/FALSE 1/0 value, since things like bitfield & bitflag doesn't always give 1s and 0s.
#define FORCE_BOOLEAN(x) ((x)? TRUE : FALSE)
#define TILES_TO_PIXELS(tiles) (tiles * PIXELS)
+32 -28
View File
@@ -11,6 +11,8 @@
/// Inverse direction, taking into account UP|DOWN if necessary.
#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )
/// world.icon_size
#define PIXELS 32
//These get to go at the top, because they're special
//You can use these defines to get the typepath of the currently running proc/verb (yes procs + verbs are objects)
@@ -30,31 +32,32 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
//Human Overlays Indexes/////////
//LOTS OF CIT CHANGES HERE. BE CAREFUL WHEN UPSTREAM ADDS MORE LAYERS
#define MUTATIONS_LAYER 32 //mutations. Tk headglows, cold resistance glow, etc
#define GENITALS_BEHIND_LAYER 31 //Some genitalia needs to be behind everything, such as with taurs (Taurs use body_behind_layer
#define BODY_BEHIND_LAYER 30 //certain mutantrace features (tail when looking south) that must appear behind the body parts
#define BODYPARTS_LAYER 29 //Initially "AUGMENTS", this was repurposed to be a catch-all bodyparts flag
#define MARKING_LAYER 28 //Matrixed body markings because clashing with snouts?
#define BODY_ADJ_LAYER 27 //certain mutantrace features (snout, body markings) that must appear above the body parts
#define GENITALS_FRONT_LAYER 26 //Draws some genitalia above clothes and the TAUR body if need be.
#define BODY_LAYER 25 //underwear, undershirts, socks, eyes, lips(makeup)
#define BODY_ADJ_UPPER_LAYER 24
#define FRONT_MUTATIONS_LAYER 23 //mutations that should appear above body, body_adj and bodyparts layer (e.g. laser eyes)
#define DAMAGE_LAYER 22 //damage indicators (cuts and burns)
#define UNIFORM_LAYER 21
#define ID_LAYER 20
#define HANDS_PART_LAYER 19
#define SHOES_LAYER 18
#define GLOVES_LAYER 17
#define EARS_LAYER 16
#define SUIT_LAYER 15
#define GENITALS_EXPOSED_LAYER 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 MUTATIONS_LAYER 33 //mutations. Tk headglows, cold resistance glow, etc
#define GENITALS_BEHIND_LAYER 32 //Some genitalia needs to be behind everything, such as with taurs (Taurs use body_behind_layer
#define BODY_BEHIND_LAYER 31 //certain mutantrace features (tail when looking south) that must appear behind the body parts
#define BODYPARTS_LAYER 30 //Initially "AUGMENTS", this was repurposed to be a catch-all bodyparts flag
#define MARKING_LAYER 29 //Matrixed body markings because clashing with snouts?
#define BODY_ADJ_LAYER 28 //certain mutantrace features (snout, body markings) that must appear above the body parts
#define GENITALS_FRONT_LAYER 27 //Draws some genitalia above clothes and the TAUR body if need be.
#define BODY_LAYER 26 //underwear, undershirts, socks, eyes, lips(makeup)
#define BODY_ADJ_UPPER_LAYER 25
#define FRONT_MUTATIONS_LAYER 24 //mutations that should appear above body, body_adj and bodyparts layer (e.g. laser eyes)
#define DAMAGE_LAYER 23 //damage indicators (cuts and burns)
#define UNIFORM_LAYER 22
#define ID_LAYER 21
#define HANDS_PART_LAYER 20
#define SHOES_LAYER 19
#define GLOVES_LAYER 18
#define EARS_LAYER 17
#define SUIT_LAYER 16
#define GENITALS_EXPOSED_LAYER 15
#define GLASSES_LAYER 14
#define BELT_LAYER 13 //Possible make this an overlay of somethign required to wear a belt?
#define SUIT_STORE_LAYER 12
#define NECK_LAYER 11
#define BACK_LAYER 10
#define HAIR_LAYER 9 //TODO: make part of head layer?
#define HORNS_LAYER 8
#define FACEMASK_LAYER 7
#define HEAD_LAYER 6
#define HANDCUFF_LAYER 5
@@ -62,7 +65,7 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
#define HANDS_LAYER 3
#define BODY_FRONT_LAYER 2
#define FIRE_LAYER 1 //If you're on fire
#define TOTAL_LAYERS 32 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
#define TOTAL_LAYERS 33 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
//Human Overlay Index Shortcuts for alternate_worn_layer, layers
//Because I *KNOW* somebody will think layer+1 means "above"
@@ -431,6 +434,7 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
//text files
#define BRAIN_DAMAGE_FILE "traumas.json"
#define ION_FILE "ion_laws.json"
#define REDPILL_FILE "redpill.json"
#define PIRATE_NAMES_FILE "pirates.json"
@@ -460,13 +464,13 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
#define EGG_LAYING_MESSAGES list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")
// list of all null rod weapons
#define HOLY_WEAPONS /obj/item/nullrod, /obj/item/twohanded/dualsaber/hypereutactic/chaplain, /obj/item/gun/energy/laser/redtag/hitscan/chaplain, /obj/item/multitool/chaplain, /obj/item/clothing/gloves/fingerless/pugilist/chaplain, /obj/item/melee/baseball_bat/chaplain
#define HOLY_WEAPONS /obj/item/nullrod, /obj/item/dualsaber/hypereutactic/chaplain, /obj/item/gun/energy/laser/redtag/hitscan/chaplain, /obj/item/multitool/chaplain, /obj/item/clothing/gloves/fingerless/pugilist/chaplain, /obj/item/melee/baseball_bat/chaplain
// Used by PDA and cartridge code to reduce repetitiveness of spritesheets
#define PDAIMG(what) {"<span class="pda16x16 [#what]"></span>"}
//Filters
#define AMBIENT_OCCLUSION list("type"="drop_shadow","x"=0,"y"=-2,"size"=4,"color"="#04080FAA")
#define AMBIENT_OCCLUSION(_size, _color) list("type"="drop_shadow","x"=0,"y"=-2,"size"=_size,"color"=_color)
#define EYE_BLUR(size) list("type"="blur", "size"=size)
#define GRAVITY_MOTION_BLUR list("type"="motion_blur","x"=0,"y"=0)
+15
View File
@@ -98,6 +98,7 @@
#define BRAIN_TRAUMA_MILD /datum/brain_trauma/mild
#define BRAIN_TRAUMA_SEVERE /datum/brain_trauma/severe
#define BRAIN_TRAUMA_SPECIAL /datum/brain_trauma/special
#define BRAIN_TRAUMA_MAGIC /datum/brain_trauma/magic
#define TRAUMA_RESILIENCE_BASIC 1 //Curable with chems
#define TRAUMA_RESILIENCE_SURGERY 2 //Curable with brain surgery
@@ -126,6 +127,13 @@
#define SCREWYHUD_DEAD 2
#define SCREWYHUD_HEALTHY 3
//Threshold levels for beauty for humans
#define BEAUTY_LEVEL_HORRID -66
#define BEAUTY_LEVEL_BAD -33
#define BEAUTY_LEVEL_DECENT 33
#define BEAUTY_LEVEL_GOOD 66
#define BEAUTY_LEVEL_GREAT 100
//Moods levels for humans
#define MOOD_LEVEL_HAPPY4 15
#define MOOD_LEVEL_HAPPY3 10
@@ -290,8 +298,15 @@
#define HUMAN_FIRE_STACK_ICON_NUM 3
#define TYPING_INDICATOR_TIMEOUT 5 MINUTES
#define GRAB_PIXEL_SHIFT_PASSIVE 6
#define GRAB_PIXEL_SHIFT_AGGRESSIVE 12
#define GRAB_PIXEL_SHIFT_NECK 16
#define SLEEP_CHECK_DEATH(X) sleep(X); if(QDELETED(src) || stat == DEAD) return;
/// Field of vision defines.
#define FOV_90_DEGREES 90
#define FOV_180_DEGREES 180
#define FOV_270_DEGREES 270
+1 -1
View File
@@ -3,7 +3,7 @@
/// How much someone is slowed from fireman carrying a human
#define FIREMAN_CARRY_SLOWDOWN 0
/// How much someone is slowed by piggybacking a human
#define PIGGYBACK_CARRY_SLOWDOWN 1
#define PIGGYBACK_CARRY_SLOWDOWN 0
/// slowdown when in softcrit. Note that crawling slowdown will also apply at the same time!
#define SOFTCRIT_ADD_SLOWDOWN 2
/// slowdown when crawling
+64 -1
View File
@@ -8,5 +8,68 @@
//ids
#define MOVESPEED_ID_SANITY "mood_sanity"
#define MOVESPEED_ID_MOB_GRAB_STATE "mob_grab_state"
#define MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED "MOB_WALK_RUN"
#define MOVESPEED_ID_MOB_GRAB_STATE "MOB_GRAB_STATE"
#define MOVESPEED_ID_MOB_EQUIPMENT "MOB_EQUIPMENT"
#define MOVESPEED_ID_MOB_GRAVITY "MOB_GRAVITY"
#define MOVESPEED_ID_CONFIG_SPEEDMOD "MOB_CONFIG_MODIFIER"
#define MOVESPEED_ID_SLIME_REAGENTMOD "SLIME_REAGENT_MODIFIER"
#define MOVESPEED_ID_SLIME_HEALTHMOD "SLIME_HEALTH_MODIFIER"
#define MOVESPEED_ID_SLIME_TEMPMOD "SLIME_TEMPERATURE_MODIFIER"
#define MOVESPEED_ID_SLIME_STATUS "SLIME_STATUS"
#define MOVESPEED_ID_TARANTULA_WEB "TARANTULA_WEB"
#define MOVESPEED_ID_LIVING_TURF_SPEEDMOD "LIVING_TURF_SPEEDMOD"
#define MOVESPEED_ID_LIVING_LIMBLESS "LIVING_LIMBLESS"
#define MOVESPEED_ID_CARBON_SOFTCRIT "CARBON_SOFTCRIT"
#define MOVESPEED_ID_CARBON_OLDSPEED "CARBON_DEPRECATED_SPEED"
#define MOVESPEED_ID_DNA_VAULT "DNA_VAULT"
#define MOVESPEED_ID_YELLOW_ORB "YELLOW_ORB"
#define MOVESPEED_ID_TARFOOT "TARFOOT"
#define MOVESPEED_ID_SEPIA "SEPIA"
#define MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD "MONKEY_REAGENT_SPEEDMOD"
#define MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD "MONKEY_TEMPERATURE_SPEEDMOD"
#define MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD "MONKEY_HEALTH_SPEEDMOD"
#define MOVESPEED_ID_CHANGELING_MUSCLES "CHANGELING_MUSCLES"
#define MOVESPEED_ID_SIMPLEMOB_VARSPEED "SIMPLEMOB_VARSPEED_MODIFIER"
#define MOVESPEED_ID_ADMIN_VAREDIT "ADMIN_VAREDIT_MODIFIER"
#define MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD "PAI_SPACEWALK_MODIFIER"
#define MOVESPEED_ID_SPECIES "SPECIES_SPEED_MOD"
#define MOVESPEED_ID_PRONE_DRAGGING "PRONE_DRAG"
#define MOVESPEED_ID_HUMAN_CARRYING "HUMAN_CARRY"
#define MOVESPEED_ID_SHRINK_RAY "SHRUNKEN_SPEED_MODIFIER"
#define MOVESPEED_ID_SLAUGHTER "SLAUGHTER"
#define MOVESPEED_ID_CYBER_THRUSTER "CYBER_IMPLANT_THRUSTER"
#define MOVESPEED_ID_JETPACK "JETPACK"
#define MOVESPEED_ID_MKULTRA "MKULTRA"
#define MOVESPEED_ID_TASED_STATUS "TASED"
#define MOVESPEED_ID_ELECTROSTAFF "ELECTROSTAFF"
#define MOVESPEED_ID_SHOVE "SHOVE"
#define MOVESPEED_ID_FAT "FAT"
#define MOVESPEED_ID_COLD "COLD"
#define MOVESPEED_ID_HUNGRY "HUNGRY"
#define MOVESPEED_ID_DAMAGE_SLOWDOWN "DAMAGE"
#define MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING "FLYING"
#define MOVESPEED_ID_ACTIVE_BLOCK "ACTIVE_BLOCK"
#define MOVESPEED_ID_MOB_WALK_RUN "mob_walk_run"
-56
View File
@@ -1,56 +0,0 @@
// Flags for the obj_flags var on /obj
#define EMAGGED (1<<0)
#define IN_USE (1<<1) //If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
#define CAN_BE_HIT (1<<2) //can this be bludgeoned by items?
#define BEING_SHOCKED (1<<3) //Whether this thing is currently (already) being shocked by a tesla
#define DANGEROUS_POSSESSION (1<<4) //Admin possession yes/no
#define ON_BLUEPRINTS (1<<5) //Are we visible on the station blueprints at roundstart?
#define UNIQUE_RENAME (1<<6) //can you customize the description/name of the thing?
#define USES_TGUI (1<<7) //put on things that use tgui on ui_interact instead of custom/old UI.
#define FROZEN (1<<8)
#define SHOVABLE_ONTO (1<<9) //called on turf.shove_act() to consider whether an object should have a niche effect (defined in their own shove_act()) when someone is pushed onto it, or do a sanity CanPass() check.
#define BLOCK_Z_FALL (1<<10)
// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support
// Flags for the item_flags var on /obj/item
#define BEING_REMOVED (1<<0)
#define IN_INVENTORY (1<<1) //is this item equipped into an inventory slot or hand of a mob? used for tooltips
#define FORCE_STRING_OVERRIDE (1<<2) //used for tooltips
#define NEEDS_PERMIT (1<<3) //Used by security bots to determine if this item is safe for public use.
#define SLOWS_WHILE_IN_HAND (1<<4)
#define NO_MAT_REDEMPTION (1<<5) //Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
#define DROPDEL (1<<6) //When dropped, it calls qdel on itself
#define NOBLUDGEON (1<<7) //when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
#define ABSTRACT (1<<8) //for all things that are technically items but used for various different stuff
#define IMMUTABLE_SLOW (1<<9) //When players should not be able to change the slowdown of the item (Speed potions, ect)
#define SURGICAL_TOOL (1<<10) //Tool commonly used for surgery: won't attack targets in an active surgical operation on help intent (in case of mistakes)
#define NO_UNIFORM_REQUIRED (1<<11) //Can be worn on certain slots (currently belt and id) that would otherwise require an uniform.
#define NO_ATTACK_CHAIN_SOFT_STAMCRIT (1<<12) //Entirely blocks melee_attack_chain() if user is soft stamcritted. Uses getStaminaLoss() to check at this point in time. THIS DOES NOT BLOCK RANGED AFTERATTACK()S, ONLY MELEE RANGE AFTERATTACK()S.
// Flags for the clothing_flags var on /obj/item/clothing
#define LAVAPROTECT (1<<0)
#define STOPSPRESSUREDAMAGE (1<<1) //SUIT and HEAD items which stop pressure damage. To stop you taking all pressure damage you must have both a suit and head item with this flag.
#define BLOCK_GAS_SMOKE_EFFECT (1<<2) //blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
#define ALLOWINTERNALS (1<<3) //mask allows internals
#define NOSLIP (1<<4) //prevents from slipping on wet floors, in space etc
#define NOSLIP_ICE (1<<5) //prevents from slipping on frozen floors
#define THICKMATERIAL (1<<6) //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body.
#define VOICEBOX_TOGGLABLE (1<<7) //The voicebox in this clothing can be toggled.
#define VOICEBOX_DISABLED (1<<8) //The voicebox is currently turned off.
#define IGNORE_HAT_TOSS (1<<9) //Hats with negative effects when worn (i.e the tinfoil hat).
#define SCAN_REAGENTS (1<<10) // Allows helmets and glasses to scan reagents.
// Flags for the organ_flags var on /obj/item/organ
#define ORGAN_SYNTHETIC (1<<0) //Synthetic organs, or cybernetic organs. Reacts to EMPs and don't deteriorate or heal
#define ORGAN_FROZEN (1<<1) //Frozen organs, don't deteriorate
#define ORGAN_FAILING (1<<2) //Failing organs perform damaging effects until replaced or fixed
#define ORGAN_EXTERNAL (1<<3) //Was this organ implanted/inserted/etc, if true will not be removed during species change.
#define ORGAN_VITAL (1<<4) //Currently only the brain
#define ORGAN_NO_SPOIL (1<<5) //Do not spoil under any circumstances
#define ORGAN_NO_DISMEMBERMENT (1<<6) //Immune to disembowelment.
+1 -1
View File
@@ -26,4 +26,4 @@
#define PROFILE_ITEM_LEN 2
#define PROFILE_ITEM_TIME 1
#define PROFILE_ITEM_COUNT 2
#define PROFILE_ITEM_COUNT 2
+14
View File
@@ -0,0 +1,14 @@
/// This atom should be ricocheted off of from its inherent properties using standard % chance handling.
#define PROJECTILE_RICOCHET_YES 1
/// This atom should not be ricocheted off of from its inherent properties.
#define PROJECTILE_RICOCHET_NO 2
/// This atom should prevent any kind of projectile ricochet from its inherent properties.
#define PROJECTILE_RICOCHET_PREVENT 3
/// This atom should force a projectile ricochet from its inherent properties.
#define PROJECTILE_RICOCHET_FORCE 4
//bullet_act() return values
#define BULLET_ACT_HIT "HIT" //It's a successful hit, whatever that means in the context of the thing it's hitting.
#define BULLET_ACT_BLOCK "BLOCK" //It's a blocked hit, whatever that means in the context of the thing it's hitting.
#define BULLET_ACT_FORCE_PIERCE "PIERCE" //It pierces through the object regardless of the bullet being piercing by default.
#define BULLET_ACT_TURF "TURF" //It hit us but it should hit something on the same turf too. Usually used for turfs.
+14
View File
@@ -27,6 +27,7 @@
#define BOT_NAV 15 // computing navigation
#define BOT_WAIT_FOR_NAV 16 // waiting for nav computation
#define BOT_NO_ROUTE 17 // no destination beacon found (or no route)
#define BOT_TIPPED 18 // someone tipped a medibot over ;_;
//Bot types
#define SEC_BOT (1<<0) // Secutritrons (Beepsky) and ED-209s
@@ -51,6 +52,19 @@
#define ASSEMBLY_FOURTH_STEP 3
#define ASSEMBLY_FIFTH_STEP 4
//Bot Upgrade defines
#define UPGRADE_CLEANER_ADVANCED_MOP (1<<0)
#define UPGRADE_CLEANER_BROOM (1<<1)
#define UPGRADE_MEDICAL_HYPOSPRAY (1<<0)
#define UPGRADE_MEDICAL_CHEM_BOARD (1<<1)
#define UPGRADE_MEDICAL_CRYO_BOARD (1<<2)
#define UPGRADE_MEDICAL_CHEM_MASTER (1<<3)
#define UPGRADE_MEDICAL_SLEEP_BOARD (1<<4)
#define UPGRADE_MEDICAL_PIERERCING (1<<5)
#define UPGRADE_FLOOR_ARTBOX (1<<0)
#define UPGRADE_FLOOR_SYNDIBOX (1<<1)
//Checks to determine borg availability depending on the server's config. These are defines in the interest of reducing copypasta
#define BORG_SEC_AVAILABLE (!CONFIG_GET(flag/disable_secborg) && GLOB.security_level >= CONFIG_GET(number/minimum_secborg_alert))
-1
View File
@@ -1 +0,0 @@
#define RUSTG_OVERRIDE_BUILTINS
+18 -1
View File
@@ -1,10 +1,27 @@
// rust_g.dm - DM API for rust_g extension library
#define RUST_G "rust_g"
#define RUSTG_JOB_NO_RESULTS_YET "NO RESULTS YET"
#define RUSTG_JOB_NO_SUCH_JOB "NO SUCH JOB"
#define RUSTG_JOB_ERROR "JOB PANICKED"
#define rustg_dmi_strip_metadata(fname) call(RUST_G, "dmi_strip_metadata")(fname)
#define rustg_dmi_create_png(fname,width,height,data) call(RUST_G, "dmi_create_png")(fname,width,height,data)
#define rustg_git_revparse(rev) call(RUST_G, "rg_git_revparse")(rev)
#define rustg_git_commit_date(rev) call(RUST_G, "rg_git_commit_date")(rev)
#define rustg_log_write(fname, text) call(RUST_G, "log_write")(fname, text)
#define rustg_log_write(fname, text, format) call(RUST_G, "log_write")(fname, text, format)
/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")()
// RUST-G defines & procs for HTTP component
#define RUSTG_HTTP_METHOD_GET "get"
#define RUSTG_HTTP_METHOD_POST "post"
#define RUSTG_HTTP_METHOD_PUT "put"
#define RUSTG_HTTP_METHOD_DELETE "delete"
#define RUSTG_HTTP_METHOD_PATCH "patch"
#define RUSTG_HTTP_METHOD_HEAD "head"
#define rustg_http_request_blocking(method, url, body, headers) call(RUST_G, "http_request_blocking")(method, url, body, headers)
#define rustg_http_request_async(method, url, body, headers) call(RUST_G, "http_request_async")(method, url, body, headers)
#define rustg_http_check_request(req_id) call(RUST_G, "http_check_request")(req_id)
+2
View File
@@ -7,6 +7,8 @@
#define SHUTTLE_STRANDED "stranded"
#define SHUTTLE_ESCAPE "escape"
#define SHUTTLE_ENDGAME "endgame: game over"
#define SHUTTLE_RECHARGING "recharging"
#define SHUTTLE_PREARRIVAL "landing"
#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)))
+59 -26
View File
@@ -8,46 +8,47 @@
/// Levels
#define SKILL_PROGRESSION_LEVEL 4
/// Max value of skill for numerical skills
#define SKILL_NUMERICAL_MAX 100
/// Min value of skill for numerical skills
#define SKILL_NUMERICAL_MIN 0
// Standard values for job starting skills
#define STARTING_SKILL_SURGERY_MEDICAL 35 //out of SKILL_NUMERICAL_MAX
// Standard values for job starting skill affinities
#define STARTING_SKILL_AFFINITY_SURGERY_MEDICAL 1.2
#define STARTING_SKILL_AFFINITY_WIRING_ENGI_ROBO 1.2
#define STARTING_SKILL_AFFINITY_DEF_JOB 1.2
// Standard values for skill gain (this is multiplied by affinity)
#define DEF_SKILL_GAIN 1
#define SKILL_GAIN_SURGERY_PER_STEP 0.25
#define STD_USE_TOOL_MULT 1
#define EASY_USE_TOOL_MULT 0.75
#define TRIVIAL_USE_TOOL_MULT 0.5
#define BARE_USE_TOOL_MULT 0.25
#define SKILL_AFFINITY_MOOD_BONUS 1.25
//multiplier of the difference of max_value and min_value. Mostly for balance purposes between numerical and level-based skills.
#define STD_NUM_SKILL_ITEM_GAIN_MULTI 0.002
///Items skill_flags and other defines
#define SKILL_USE_TOOL (1<<0)
#define SKILL_TRAINING_TOOL (1<<1)
#define SKILL_ATTACK_MOB (1<<2)
#define SKILL_TRAIN_ATTACK_MOB (1<<3)
#define SKILL_ATTACK_OBJ (1<<4)
#define SKILL_TRAIN_ATTACK_OBJ (1<<5)
#define SKILL_STAMINA_COST (1<<6) //Influences the stamina cost from weapon usage.
#define SKILL_THROW_STAM_COST (1<<7)
#define SKILL_COMBAT_MODE (1<<8) //The user must have combat mode on.
#define SKILL_USE_MOOD (1<<9) //Is the skill negatively affected by bad mood.
#define SKILL_TRAIN_MOOD (1<<10) //Is this skill training affected by good mood.
//An extra point for each few seconds of delay when using a tool. Before the multiplier.
#define SKILL_GAIN_DELAY_DIVISOR 3 SECONDS
///competency_threshold index defines
#define THRESHOLD_COMPETENT 1
#define THRESHOLD_EXPERT 2
#define THRESHOLD_MASTER 3
///Items skill_traits and other defines
#define SKILL_USE_TOOL "use_tool"
#define SKILL_TRAINING_TOOL "training_tool"
#define SKILL_ATTACK_MOB "attack_mob"
#define SKILL_TRAIN_ATTACK_MOB "train_attack_mob"
#define SKILL_ATTACK_OBJ "attack_obj"
#define SKILL_TRAIN_ATTACK_OBJ "train_attack_obj"
#define SKILL_STAMINA_COST "stamina_cost" //Influences the stamina cost from weapon usage.
#define SKILL_THROW_STAM_COST "throw_stam_cost"
#define SKILL_COMBAT_MODE "combat_mode" //The user must have combat mode on.
#define SKILL_SANITY "sanity" //Is the skill affected by (in)sanity.
#define SKILL_INTELLIGENCE "intelligence" //Is the skill affected by brain damage?
///competency_threshold defines
#define THRESHOLD_UNTRAINED "untrained"
#define THRESHOLD_COMPETENT "competent"
#define THRESHOLD_EXPERT "expert"
#define THRESHOLD_MASTER "master"
/// Level/Experience skills defines.
#define STD_XP_LVL_UP 100
@@ -75,3 +76,35 @@
#define DORF_SKILL_COMPETENT 3
#define DORF_SKILL_EXPERT 8
#define DORF_SKILL_MASTER 12
/// Skill modifier defines and flags.
#define MODIFIER_SKILL_VALUE (1<<0)
#define MODIFIER_SKILL_AFFINITY (1<<1)
#define MODIFIER_SKILL_LEVEL (1<<2)
///makes the skill modifier a multiplier, not an addendum.
#define MODIFIER_SKILL_MULT (1<<3)
///Sets the skill to the defined value if lower than that. Highly reccomended you don't use it with MODIFIER_SKILL_MULT.
#define MODIFIER_SKILL_VIRTUE (1<<4)
///Does the opposite of the above. combining both effectively results in the skill being locked to the specified value.
#define MODIFIER_SKILL_HANDICAP (1<<5)
///Makes it untransferred by mind.transfer_to()
#define MODIFIER_SKILL_BODYBOUND (1<<6)
///Adds the difference of the current value and the value stored at the time the modifier was added to the result.
#define MODIFIER_SKILL_ORIGIN_DIFF (1<<7)
///Will this skill use competency thresholds instead of preset values
#define MODIFIER_USE_THRESHOLDS (1<<8)
#define MODIFIER_TARGET_VALUE "value"
#define MODIFIER_TARGET_LEVEL "level"
#define MODIFIER_TARGET_AFFINITY "affinity"
///Ascending priority defines.
#define MODIFIER_SKILL_PRIORITY_LOW 100
#define MODIFIER_SKILL_PRIORITY_DEF 50
#define MODIFIER_SKILL_PRIORITY_MAX 1 //max priority, meant for job/antag modifiers so they don't null out other (de)buffs
// UI Defines
///Categories of skills, these will be displayed alphabetically.
#define SKILL_UI_CAT_ENG "Engineering"
#define SKILL_UI_CAT_MED "Medical"
#define SKILL_UI_CAT_MISC "Misc"
+40
View File
@@ -6,3 +6,43 @@
//More experience value getter macros
#define GET_STANDARD_LVL(lvl) XP_LEVEL(STD_XP_LVL_UP, STD_XP_LVL_MULTI, lvl)
#define GET_DORF_LVL(lvl) DORF_XP_LEVEL(DORF_XP_LVL_UP, DORF_XP_LVL_MULTI, lvl)
#define IS_SKILL_VALUE_GREATER(path, existing, new_value) GLOB.skill_datums[path].is_value_greater(existing, new_value)
#define SANITIZE_SKILL_VALUE(path, value) GLOB.skill_datums[path].sanitize_value(value)
///Doesn't automatically round the value.
#define SANITIZE_SKILL_LEVEL(path, lvl) clamp(lvl, 0, GLOB.skill_datums[path].max_levels)
/// Simple generic identifier macro.
#define GET_SKILL_MOD_ID(path, id) (id ? "[path]&[id]" : path)
/**
* A simple universal comsig for body bound skill modifiers.
* Technically they are still bound to the mind, but other signal procs will take care of adding and removing the modifier
* from/to new/old minds.
*/
#define ADD_SKILL_MODIFIER_BODY(path, id, body, prototype) \
prototype = GLOB.skill_modifiers[GET_SKILL_MOD_ID(path, id)] || new path(id, TRUE);\
if(body.mind){\
body.mind.add_skill_modifier(prototype.identifier)\
} else {\
prototype.RegisterSignal(body, COMSIG_MOB_ON_NEW_MIND, /datum/skill_modifier.proc/on_mob_new_mind, TRUE)\
}
/// Same as above but to remove the skill modifier.
#define REMOVE_SKILL_MODIFIER_BODY(path, id, body) \
if(GLOB.skill_modifiers[GET_SKILL_MOD_ID(path, id)]){\
if(body.mind){\
body.mind.remove_skill_modifier(GET_SKILL_MOD_ID(path, id))\
} else {\
GLOB.skill_modifiers[GET_SKILL_MOD_ID(path, id)].UnregisterSignal(body, COMSIG_MOB_ON_NEW_MIND)\
}\
}
///Macro used when adding generic singleton skill modifiers.
#define ADD_SINGLETON_SKILL_MODIFIER(mind, path, id) \
if(!GLOB.skill_modifiers[GET_SKILL_MOD_ID(path, id)]){\
new path(id, TRUE)\
};\
mind.add_skill_modifier(GET_SKILL_MOD_ID(path, id))
+16
View File
@@ -6,10 +6,26 @@
#define RETURN_TYPE(X) set SpacemanDMM_return_type = X
#define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X
#define UNLINT(X) SpacemanDMM_unlint(X)
#define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X
#define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X
#define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X
#define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X
#define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X
#define VAR_FINAL var/SpacemanDMM_final
#define VAR_PRIVATE var/SpacemanDMM_private
#define VAR_PROTECTED var/SpacemanDMM_protected
#else
#define RETURN_TYPE(X)
#define SHOULD_CALL_PARENT(X)
#define UNLINT(X) X
#define SHOULD_NOT_OVERRIDE(X)
#define SHOULD_NOT_SLEEP(X)
#define SHOULD_BE_PURE(X)
#define PRIVATE_PROC(X)
#define PROTECTED_PROC(X)
#define VAR_FINAL var
#define VAR_PRIVATE var
#define VAR_PROTECTED var
#endif
/world/proc/enable_debugger()
+2
View File
@@ -96,6 +96,8 @@
#define STATUS_EFFECT_SPASMS /datum/status_effect/spasms //causes random muscle spasms
#define STATUS_EFFECT_FAKE_VIRUS /datum/status_effect/fake_virus //gives you fluff messages for cough, sneeze, headache, etc but without an actual virus
#define STATUS_EFFECT_BREASTS_ENLARGEMENT /datum/status_effect/chem/breast_enlarger //Applied slowdown due to the ominous bulk.
#define STATUS_EFFECT_PENIS_ENLARGEMENT /datum/status_effect/chem/penis_enlarger //More applied slowdown, just like the above.
@@ -11,7 +11,21 @@
#define STORAGE_LIMIT_MAX_W_CLASS (1<<3)
#define STORAGE_FLAGS_LEGACY_DEFAULT (STORAGE_LIMIT_MAX_ITEMS | STORAGE_LIMIT_COMBINED_W_CLASS | STORAGE_LIMIT_MAX_W_CLASS)
#define STORAGE_FLAGS_VOLUME_DEFAULT (STORAGE_LIMIT_MAX_ITEMS | STORAGE_LIMIT_VOLUME | STORAGE_LIMIT_MAX_W_CLASS)
#define STORAGE_FLAGS_VOLUME_DEFAULT (STORAGE_LIMIT_VOLUME | STORAGE_LIMIT_MAX_W_CLASS)
// UI defines
/// Size of volumetric box icon
#define VOLUMETRIC_STORAGE_BOX_ICON_SIZE 32
/// Size of EACH left/right border icon for volumetric boxes
#define VOLUMETRIC_STORAGE_BOX_BORDER_SIZE 1
/// Minimum pixels an item must have in volumetric scaled storage UI
#define MINIMUM_PIXELS_PER_ITEM 8
/// Maximum number of objects that will be allowed to be displayed using the volumetric display system. Arbitrary number to prevent server lockups.
#define MAXIMUM_VOLUMETRIC_ITEMS 256
/// How much padding to give between items
#define VOLUMETRIC_STORAGE_ITEM_PADDING 4
/// How much padding to give to edges
#define VOLUMETRIC_STORAGE_EDGE_PADDING 1
//ITEM INVENTORY WEIGHT, FOR w_class
/// Usually items smaller then a human hand, ex: Playing Cards, Lighter, Scalpel, Coins/Money
@@ -26,22 +40,3 @@
#define WEIGHT_CLASS_HUGE 5
/// Essentially means it cannot be picked up or placed in an inventory, ex: Mech Parts, Safe - Can not fit in Boh
#define WEIGHT_CLASS_GIGANTIC 6
/// Macro for automatically getting the volume of an item from its w_class.
#define AUTO_SCALE_VOLUME(w_class) (2 ** w_class)
/// Macro for automatically getting the volume of a storage item from its max_w_class and max_combined_w_class.
#define AUTO_SCALE_STORAGE_VOLUME(w_class, max_combined_w_class) (AUTO_SCALE_VOLUME(w_class) * (max_combined_w_class / w_class))
// UI defines
/// Size of volumetric box icon
#define VOLUMETRIC_STORAGE_BOX_ICON_SIZE 32
/// Size of EACH left/right border icon for volumetric boxes
#define VOLUMETRIC_STORAGE_BOX_BORDER_SIZE 1
/// Minimum pixels an item must have in volumetric scaled storage UI
#define MINIMUM_PIXELS_PER_ITEM 6
/// Maximum number of objects that will be allowed to be displayed using the volumetric display system. Arbitrary number to prevent server lockups.
#define MAXIMUM_VOLUMETRIC_ITEMS 256
/// How much padding to give between items
#define VOLUMETRIC_STORAGE_ITEM_PADDING 1
/// How much padding to give to edges
#define VOLUMETRIC_STORAGE_EDGE_PADDING 1
+40
View File
@@ -0,0 +1,40 @@
// PLEASE KEEP ALL VOLUME DEFINES IN THIS FILE, it's going to be hell to keep track of them later.
#define DEFAULT_VOLUME_TINY 2
#define DEFAULT_VOLUME_SMALL 3
#define DEFAULT_VOLUME_NORMAL 4
#define DEFAULT_VOLUME_BULKY 8
#define DEFAULT_VOLUME_HUGE 16
#define DEFAULT_VOLUME_GIGANTIC 32
GLOBAL_LIST_INIT(default_weight_class_to_volume, list(
"[WEIGHT_CLASS_TINY]" = DEFAULT_VOLUME_TINY,
"[WEIGHT_CLASS_SMALL]" = DEFAULT_VOLUME_SMALL,
"[WEIGHT_CLASS_NORMAL]" = DEFAULT_VOLUME_NORMAL,
"[WEIGHT_CLASS_BULKY]" = DEFAULT_VOLUME_BULKY,
"[WEIGHT_CLASS_HUGE]" = DEFAULT_VOLUME_HUGE,
"[WEIGHT_CLASS_GIGANTIC]" = DEFAULT_VOLUME_GIGANTIC
))
/// Macro for automatically getting the volume of an item from its w_class.
#define AUTO_SCALE_VOLUME(w_class) (GLOB.default_weight_class_to_volume["[w_class]"])
/// Macro for automatically getting the volume of a storage item from its max_w_class and max_combined_w_class.
#define AUTO_SCALE_STORAGE_VOLUME(w_class, max_combined_w_class) (AUTO_SCALE_VOLUME(w_class) * (max_combined_w_class / w_class))
// Let's keep all of this in one place. given what we put above anyways..
// volume amount for items
#define ITEM_VOLUME_DISK 1
// #define SAMPLE_VOLUME_AMOUNT 2
// max_weight_class for storages
#define MAX_WEIGHT_CLASS_BACKPACK WEIGHT_CLASS_NORMAL
#define MAX_WEIGHT_CLASS_BAG_OF_HOLDING WEIGHT_CLASS_BULKY
// max_volume for storages
#define STORAGE_VOLUME_BACKPACK (DEFAULT_VOLUME_NORMAL * 7)
#define STORAGE_VOLUME_DUFFLEBAG (DEFAULT_VOLUME_NORMAL * 10)
#define STORAGE_VOLUME_BAG_OF_HOLDING (DEFAULT_VOLUME_NORMAL * 20)
#define STORAGE_VOLUME_CHEMISTRY_BAG (DEFAULT_VOLUME_TINY * 50)
#define STORAGE_VOLUME_PILL_BOTTLE (DEFAULT_VOLUME_TINY * 7)
+1
View File
@@ -117,6 +117,7 @@
#define FIRE_PRIORITY_NPC 80
#define FIRE_PRIORITY_MOBS 100
#define FIRE_PRIORITY_TGUI 110
#define FIRE_PRIORITY_PROJECTILES 200
#define FIRE_PRIORITY_TICKER 200
#define FIRE_PRIORITY_ATMOS_ADJACENCY 300
#define FIRE_PRIORITY_CHAT 400
+3 -2
View File
@@ -4,8 +4,9 @@
#define TGS_READ_GLOBAL(Name) GLOB.##Name
#define TGS_WRITE_GLOBAL(Name, Value) GLOB.##Name = ##Value
#define TGS_WORLD_ANNOUNCE(message) to_chat(world, "<span class='boldannounce'>[html_encode(##message)]</span>")
#define TGS_INFO_LOG(message) log_world("TGS: Info: [##message]")
#define TGS_ERROR_LOG(message) log_world("TGS: Error: [##message]")
#define TGS_INFO_LOG(message) log_world("TGS Info: [##message]")
#define TGS_WARNING_LOG(message) log_world("TGS Warn: [##message]")
#define TGS_ERROR_LOG(message) log_world("TGS Error: [##message]")
#define TGS_NOTIFY_ADMINS(event) message_admins(##event)
#define TGS_CLIENT_COUNT GLOB.clients.len
#define TGS_PROTECT_DATUM(Path) GENERAL_PROTECT_DATUM(##Path)
+231 -120
View File
@@ -1,235 +1,346 @@
//tgstation-server DMAPI
// tgstation-server DMAPI
//All functions and datums outside this document are subject to change with any version and should not be relied on
#define TGS_DMAPI_VERSION "5.2.1"
//CONFIGURATION
// All functions and datums outside this document are subject to change with any version and should not be relied on.
//create this define if you want to do configuration outside of this file
// CONFIGURATION
/// Create this define if you want to do TGS configuration outside of this file.
#ifndef TGS_EXTERNAL_CONFIGURATION
//Comment this out once you've filled in the below
// Comment this out once you've filled in the below.
#error TGS API unconfigured
//Uncomment this if you wish to allow the game to interact with TGS 3
//This will raise the minimum required security level of your game to TGS_SECURITY_TRUSTED due to it utilizing call()()
// Uncomment this if you wish to allow the game to interact with TGS 3.
// This will raise the minimum required security level of your game to TGS_SECURITY_TRUSTED due to it utilizing call()()
//#define TGS_V3_API
//Required interfaces (fill in with your codebase equivalent):
// Required interfaces (fill in with your codebase equivalent):
//create a global variable named `Name` and set it to `Value`
//These globals must not be modifiable from anywhere outside of the server tools
/// Create a global variable named `Name` and set it to `Value`.
#define TGS_DEFINE_AND_SET_GLOBAL(Name, Value)
//Read the value in the global variable `Name`
/// Read the value in the global variable `Name`.
#define TGS_READ_GLOBAL(Name)
//Set the value in the global variable `Name` to `Value`
/// Set the value in the global variable `Name` to `Value`.
#define TGS_WRITE_GLOBAL(Name, Value)
//Disallow ANYONE from reflecting a given `path`, security measure to prevent in-game priveledge escalation
/// Disallow ANYONE from reflecting a given `path`, security measure to prevent in-game use of DD -> TGS capabilities.
#define TGS_PROTECT_DATUM(Path)
//display an announcement `message` from the server to all players
/// Display an announcement `message` from the server to all players.
#define TGS_WORLD_ANNOUNCE(message)
//Notify current in-game administrators of a string `event`
/// Notify current in-game administrators of a string `event`.
#define TGS_NOTIFY_ADMINS(event)
//Write an info `message` to a server log
/// Write an info `message` to a server log.
#define TGS_INFO_LOG(message)
//Write an error `message` to a server log
/// Write an warning `message` to a server log.
#define TGS_WARNING_LOG(message)
/// Write an error `message` to a server log.
#define TGS_ERROR_LOG(message)
//Get the number of connected /clients
/// Get the number of connected /clients.
#define TGS_CLIENT_COUNT
#endif
//EVENT CODES
// EVENT CODES
#define TGS_EVENT_PORT_SWAP -2 //before a port change is about to happen, extra parameter is new port
#define TGS_EVENT_REBOOT_MODE_CHANGE -1 //before a reboot mode change, extras parameters are the current and new reboot mode enums
/// Before a reboot mode change, extras parameters are the current and new reboot mode enums
#define TGS_EVENT_REBOOT_MODE_CHANGE -1
/// Before a port change is about to happen, extra parameters is new port
#define TGS_EVENT_PORT_SWAP -2
/// Before the instance is renamed, extra parameter is the new name
#define TGS_EVENT_INSTANCE_RENAMED -3
/// After the watchdog reattaches to DD, extra parameter is the new [/datum/tgs_version] of the server
#define TGS_EVENT_WATCHDOG_REATTACH -4
//See the descriptions for these codes here: https://github.com/tgstation/tgstation-server/blob/master/src/Tgstation.Server.Host/Components/EventType.cs
/// When the repository is reset to its origin reference. Parameters: Reference name, Commit SHA
#define TGS_EVENT_REPO_RESET_ORIGIN 0
/// When the repository performs a checkout. Parameters: Checkout git object
#define TGS_EVENT_REPO_CHECKOUT 1
/// When the repository performs a fetch operation. No parameters
#define TGS_EVENT_REPO_FETCH 2
/// When the repository merges a pull request. Parameters: PR Number, PR Sha, (Nullable) Comment made by TGS user
#define TGS_EVENT_REPO_MERGE_PULL_REQUEST 3
/// Before the repository makes a sychronize operation. Parameters: Absolute repostiory path
#define TGS_EVENT_REPO_PRE_SYNCHRONIZE 4
/// Before a BYOND install operation begins. Parameters: [/datum/tgs_version] of the installing BYOND
#define TGS_EVENT_BYOND_INSTALL_START 5
/// When a BYOND install operation fails. Parameters: Error message
#define TGS_EVENT_BYOND_INSTALL_FAIL 6
/// When the active BYOND version changes. Parameters: (Nullable) [/datum/tgs_version] of the current BYOND, [/datum/tgs_version] of the new BYOND
#define TGS_EVENT_BYOND_ACTIVE_VERSION_CHANGE 7
/// When the compiler starts running. Parameters: Game directory path, origin commit SHA
#define TGS_EVENT_COMPILE_START 8
/// When a compile is cancelled. No parameters
#define TGS_EVENT_COMPILE_CANCELLED 9
/// When a compile fails. Parameters: Game directory path, [TRUE]/[FALSE] based on if the cause for failure was DMAPI validation
#define TGS_EVENT_COMPILE_FAILURE 10
/// When a compile operation completes. Note, this event fires before the new .dmb is loaded into the watchdog. Consider using the [TGS_EVENT_DEPLOYMENT_COMPLETE] instead. Parameters: Game directory path
#define TGS_EVENT_COMPILE_COMPLETE 11
/// When an automatic update for the current instance begins. No parameters
#define TGS_EVENT_INSTANCE_AUTO_UPDATE_START 12
/// When the repository encounters a merge conflict: Parameters: Base SHA, target SHA, base reference, target reference
#define TGS_EVENT_REPO_MERGE_CONFLICT 13
/// When a deployment completes. No Parameters
#define TGS_EVENT_DEPLOYMENT_COMPLETE 14
/// Before the watchdog shuts down. Not sent for graceful shutdowns. No parameters.
#define TGS_EVENT_WATCHDOG_SHUTDOWN 15
/// Before the watchdog detaches for a TGS update/restart. No parameters.
#define TGS_EVENT_WATCHDOG_DETACH 16
//OTHER ENUMS
// OTHER ENUMS
/// The server will reboot normally.
#define TGS_REBOOT_MODE_NORMAL 0
/// The server will stop running on reboot.
#define TGS_REBOOT_MODE_SHUTDOWN 1
/// The watchdog will restart on reboot.
#define TGS_REBOOT_MODE_RESTART 2
/// DreamDaemon Trusted security level.
#define TGS_SECURITY_TRUSTED 0
/// DreamDaemon Safe security level.
#define TGS_SECURITY_SAFE 1
/// DreamDaemon Ultrasafe security level.
#define TGS_SECURITY_ULTRASAFE 2
//REQUIRED HOOKS
//Call this somewhere in /world/New() that is always run
//event_handler: optional user defined event handler. The default behaviour is to broadcast the event in english to all connected admin channels
//minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated
/**
* Call this somewhere in [/world/proc/New] that is always run. This function may sleep!
*
* * event_handler - Optional user defined [/datum/tgs_event_handler].
* * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED].
*/
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE)
return
//Call this when your initializations are complete and your game is ready to play before any player interactions happen
//This may use world.sleep_offline to make this happen so ensure no changes are made to it while this call is running
//Most importantly, before this point, note that any static files or directories may be in use by another server. Your code should account for this
//This function should not be called before ..() in /world/New()
/**
* Call this when your initializations are complete and your game is ready to play before any player interactions happen.
*
* This may use [/world/var/sleep_offline] to make this happen so ensure no changes are made to it while this call is running.
* Before this point, note that any static files or directories may be in use by another server. Your code should account for this.
* This function should not be called before ..() in [/world/proc/New].
*/
/world/proc/TgsInitializationComplete()
return
//Put this at the start of /world/Topic()
/// Put this at the start of [/world/proc/Topic].
#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return
//Call this at the beginning of world/Reboot(reason)
/**
* Call this at the beginning of [world/proc/Reboot].
*/
/world/proc/TgsReboot()
return
//DATUM DEFINITIONS
//unless otherwise specified all datums defined here should be considered read-only, warranty void if written
// DATUM DEFINITIONS
// All datums defined here should be considered read-only
//represents git revision information about the current world build
/// Represents git revision information.
/datum/tgs_revision_information
var/commit //full sha of compiled commit
var/origin_commit //full sha of last known remote commit. This may be null if the TGS repository is not currently tracking a remote branch
/// Full SHA of the commit.
var/commit
/// Full sha of last known remote commit. This may be null if the TGS repository is not currently tracking a remote branch.
var/origin_commit
//represents a version of tgstation-server
/// Represents a version.
/datum/tgs_version
var/suite //The suite version, can be >=3
/// The suite/major version number
var/suite
//this group of variables can be null to represent a wild card
var/major //The major version
var/minor //The minor version
var/patch //The patch version
// This group of variables can be null to represent a wild card
/// The minor version number. null for wildcards
var/minor
/// The patch version number. null for wildcards
var/patch
var/raw_parameter //The unparsed parameter
var/deprefixed_parameter //The version only bit of raw_parameter
/// Legacy version number. Generally null
var/deprecated_patch
//if the tgs_version is a wildcard version
/// Unparsed string value
var/raw_parameter
/// String value minus prefix
var/deprefixed_parameter
/**
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
*/
/datum/tgs_version/proc/Wildcard()
return
//represents a merge of a GitHub pull request
/**
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] equals some other version.
*
* other_version - The [/datum/tgs_version] to compare against.
*/
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
return
/// Represents a merge of a GitHub pull request.
/datum/tgs_revision_information/test_merge
var/number //pull request number
var/title //pull request title
var/body //pull request body
var/author //pull request github author
var/url //link to pull request html
var/pull_request_commit //commit of the pull request when it was merged
var/time_merged //timestamp of when the merge commit for the pull request was created
var/comment //optional comment left by the one who initiated the test merge
/// The pull request number.
var/number
/// The pull request title when it was merged.
var/title
/// The pull request body when it was merged.
var/body
/// The GitHub username of the pull request's author.
var/author
/// An http URL to the pull request.
var/url
/// The SHA of the pull request when that was merged.
var/pull_request_commit
/// ISO 8601 timestamp of when the pull request was merged.
var/time_merged
/// (Nullable) Comment left by the TGS user who initiated the merge..
var/comment
//represents a connected chat channel
/// Represents a connected chat channel.
/datum/tgs_chat_channel
var/id //internal channel representation
var/friendly_name //user friendly channel name
var/connection_name //the name of the configured chat connection
var/is_admin_channel //if the server operator has marked this channel for game admins only
var/is_private_channel //if this is a private chat channel
var/custom_tag //user defined string associated with channel
/// TGS internal channel ID.
var/id
/// User friendly name of the channel.
var/friendly_name
/// Name of the chat connection. This is the IRC server address or the Discord guild.
var/connection_name
/// [TRUE]/[FALSE] based on if the server operator has marked this channel for game admins only.
var/is_admin_channel
/// [TRUE]/[FALSE] if the channel is a private message channel for a [/datum/tgs_chat_user].
var/is_private_channel
/// Tag string associated with the channel in TGS
var/custom_tag
//represents a chat user
// Represents a chat user
/datum/tgs_chat_user
var/id //Internal user representation, requires channel to be unique
var/friendly_name //The user's public name
var/mention //The text to use to ping this user in a message
var/datum/tgs_chat_channel/channel //The /datum/tgs_chat_channel this user was from
/// TGS internal user ID.
var/id
// The user's display name.
var/friendly_name
// The string to use to ping this user in a message.
var/mention
/// The [/datum/tgs_chat_channel] the user was from
var/datum/tgs_chat_channel/channel
//user definable callback for handling events
//extra parameters may be specified depending on the event
/**
* User definable callback for handling TGS events.
*
* event_code - One of the TGS_EVENT_ defines. Extra parameters will be documented in each
*/
/datum/tgs_event_handler/proc/HandleEvent(event_code, ...)
set waitfor = FALSE
return
//user definable chat command
/// User definable chat command
/datum/tgs_chat_command
var/name = "" //the string to trigger this command on a chat bot. e.g. TGS3_BOT: do_this_command
var/help_text = "" //help text for this command
var/admin_only = FALSE //set to TRUE if this command should only be usable by registered chat admins
/// The string to trigger this command on a chat bot. e.g `@bot name ...` or `!tgs name ...`
var/name = ""
/// The help text displayed for this command
var/help_text = ""
/// If this command should be available to game administrators only
var/admin_only = FALSE
//override to implement command
//sender: The tgs_chat_user who send to command
//params: The trimmed string following the command name
//The return value will be stringified and sent to the appropriate chat
/**
* Process command activation. Should return a string to respond to the issuer with.
*
* sender - The [/datum/tgs_chat_user] who issued the command.
* params - The trimmed string following the command `/datum/tgs_chat_command/var/name].
*/
/datum/tgs_chat_command/proc/Run(datum/tgs_chat_user/sender, params)
CRASH("[type] has no implementation for Run()")
//FUNCTIONS
// API FUNCTIONS
//Returns the respective supported /datum/tgs_version of the API
/// Returns the maximum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMaximumAPIVersion()
return
/// Returns the minimum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMinimumAPIVersion()
return
//Returns TRUE if the world was launched under the server tools and the API matches, FALSE otherwise
//No function below this succeeds if it returns FALSE
/**
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
*/
/world/proc/TgsAvailable()
return
//Gets the current /datum/tgs_version of the server tools running the server
/world/proc/TgsVersion()
return
// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
/world/proc/TgsInstanceName()
return
//Get the current `/datum/tgs_revision_information`
/world/proc/TgsRevision()
return
//Get the current BYOND security level
/world/proc/TgsSecurityLevel()
return
//Gets a list of active `/datum/tgs_revision_information/test_merge`s
/world/proc/TgsTestMerges()
return
//Forces a hard reboot of BYOND by ending the process
//unlike del(world) clients will try to reconnect
//If the service has not requested a shutdown, the next server will take over
/**
* Forces a hard reboot of DreamDaemon by ending the process.
*
* Unlike del(world) clients will try to reconnect.
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again
*/
/world/proc/TgsEndProcess()
return
//Gets a list of connected tgs_chat_channel
/world/proc/TgsChatChannelInfo()
/**
* Send a message to connected chats.
*
* message - The string to send.
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
*/
/world/proc/TgsTargetedChatBroadcast(message, admin_only = FALSE)
return
//Sends a message to connected game chats
//message: The message to send
//channels: optional channels to limit the broadcast to
/world/proc/TgsChatBroadcast(message, list/channels)
return
//Send a message to non-admin connected chats
//message: The message to send
//admin_only: If TRUE, message will instead be sent to only admin connected chats
/world/proc/TgsTargetedChatBroadcast(message, admin_only)
return
//Send a private message to a specific user
//message: The message to send
//user: The /datum/tgs_chat_user to send to
/**
* Send a private message to a specific user.
*
* message - The string to send.
* user: The [/datum/tgs_chat_user] to PM.
*/
/world/proc/TgsChatPrivateMessage(message, datum/tgs_chat_user/user)
return
// The following functions will sleep if a call to TgsNew() is sleeping
/**
* Send a message to connected chats that are flagged as game-related in TGS.
*
* message - The string to send.
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
*/
/world/proc/TgsChatBroadcast(message, list/channels = null)
return
/// Returns the current [/datum/tgs_version] of TGS if it is running the server, null otherwise.
/world/proc/TgsVersion()
return
/// Returns the current [/datum/tgs_version] of the DMAPI being used if it was activated, null otherwise.
/world/proc/TgsApiVersion()
return
/// Returns the name of the TGS instance running the game if TGS is present, null otherwise.
/world/proc/TgsInstanceName()
return
/// Return the current [/datum/tgs_revision_information] of the running server if TGS is present, null otherwise.
/world/proc/TgsRevision()
return
/// Returns the current BYOND security level as a TGS_SECURITY_ define if TGS is present, null otherwise.
/world/proc/TgsSecurityLevel()
return
/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise.
/world/proc/TgsTestMerges()
return
/// Returns a list of connected [/datum/tgs_chat_channel]s if TGS is present, null otherwise.
/world/proc/TgsChatChannelInfo()
return
/*
The MIT License
@@ -255,4 +366,4 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
*/
+3
View File
@@ -18,6 +18,7 @@
#define VALENTINES "Valentine's Day"
#define APRIL_FOOLS "April Fool's Day"
#define EASTER "Easter"
#define PRIDE_MONTH "Pride Month"
#define HALLOWEEN "Halloween"
#define CHRISTMAS "Christmas"
#define FESTIVE_SEASON "Festive Season"
@@ -38,6 +39,8 @@ When using time2text(), please use "DDD" to find the weekday. Refrain from using
#define SATURDAY "Sat"
#define SUNDAY "Sun"
#define WEEKDAY2NUM(D) (D == SUNDAY ? 1 : D == MONDAY ? 2 : D == TUESDAY ? 3 : D == WEDNESDAY ? 4 : D == THURSDAY ? 5 : D == FRIDAY ? 6 : 7) //this looks ugly, but switch statements can't be used as vars, so *shrug
#define SECONDS *10
#define MINUTES SECONDS*60
+22 -1
View File
@@ -61,12 +61,20 @@
} while (0)
#define HAS_TRAIT(target, trait) (target.status_traits ? (target.status_traits[trait] ? TRUE : FALSE) : FALSE)
#define HAS_TRAIT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (source in target.status_traits[trait]) : FALSE) : FALSE)
#define HAS_TRAIT_FROM_ONLY(target, trait, source) (\
target.status_traits ?\
(target.status_traits[trait] ?\
((source in target.status_traits[trait]) && (length(target.status_traits) == 1))\
: FALSE)\
: FALSE)
#define HAS_TRAIT_NOT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (length(target.status_traits[trait] - source) > 0) : FALSE) : FALSE)
//mob traits
#define TRAIT_BLIND "blind"
#define TRAIT_MUTE "mute"
#define TRAIT_EMOTEMUTE "emotemute"
#define TRAIT_LOOC_MUTE "looc_mute" //Just like unconsciousness, it disables LOOC salt.
#define TRAIT_AOOC_MUTE "aooc_mute" //Same as above but for AOOC.
#define TRAIT_DEAF "deaf"
#define TRAIT_NEARSIGHT "nearsighted"
#define TRAIT_FAT "fat"
@@ -88,6 +96,7 @@
#define TRAIT_SLEEPIMMUNE "sleep_immunity"
#define TRAIT_PUSHIMMUNE "push_immunity"
#define TRAIT_SHOCKIMMUNE "shock_immunity"
#define TRAIT_TESLA_SHOCKIMMUNE "tesla_shock_immunity"
#define TRAIT_STABLEHEART "stable_heart"
#define TRAIT_STABLELIVER "stable_liver"
#define TRAIT_RESISTHEAT "resist_heat"
@@ -134,6 +143,7 @@
#define TRAIT_LAW_ENFORCEMENT_METABOLISM "law-enforcement-metabolism"
#define TRAIT_QUICK_CARRY "quick-carry"
#define TRAIT_QUICKER_CARRY "quicker-carry"
#define TRAIT_QUICK_BUILD "quick-build"
#define TRAIT_STRONG_GRABBER "strong_grabber"
#define TRAIT_CALCIUM_HEALER "calcium_healer"
#define TRAIT_MAGIC_CHOKE "magic_choke"
@@ -146,6 +156,8 @@
#define TRAIT_NORUNNING "norunning" // You walk!
#define TRAIT_NOMARROW "nomarrow" // You don't make blood, with chemicals or nanites.
#define TRAIT_NOPULSE "nopulse" // Your heart doesn't beat.
#define TRAIT_NOGUT "nogutting" //Your chest cant be gutted of organs
#define TRAIT_NODECAP "nodecapping" //Your head cant be cut off in combat
#define TRAIT_EXEMPT_HEALTH_EVENTS "exempt-health-events"
#define TRAIT_NO_MIDROUND_ANTAG "no-midround-antag" //can't be turned into an antag by random events
#define TRAIT_PUGILIST "pugilist" //This guy punches people for a living
@@ -178,6 +190,7 @@
#define TRAIT_PARA "paraplegic"
#define TRAIT_EMPATH "empath"
#define TRAIT_FRIENDLY "friendly"
#define TRAIT_SNOB "snob"
#define TRAIT_CULT_EYES "cult_eyes"
#define TRAIT_AUTO_CATCH_ITEM "auto_catch_item"
#define TRAIT_CLOWN_MENTALITY "clown_mentality" // The future is now, clownman.
@@ -189,6 +202,7 @@
#define TRAIT_NO_ALCOHOL "alcohol_intolerance"
#define TRAIT_MUTATION_STASIS "mutation_stasis" //Prevents processed genetics mutations from processing.
#define TRAIT_FAST_PUMP "fast_pump"
#define TRAIT_NICE_SHOT "nice_shot" //hnnnnnnnggggg..... you're pretty good....
// mobility flag traits
// IN THE FUTURE, IT WOULD BE NICE TO DO SOMETHING SIMILAR TO https://github.com/tgstation/tgstation/pull/48923/files (ofcourse not nearly the same because I have my.. thoughts on it)
@@ -218,6 +232,8 @@
#define VEHICLE_TRAIT "vehicle" // inherited from riding vehicles
#define INNATE_TRAIT "innate"
///Used for managing KEEP_TOGETHER in [appearance_flags]
#define TRAIT_KEEP_TOGETHER "keep-together"
// item traits
#define TRAIT_NODROP "nodrop"
@@ -249,7 +265,7 @@
#define BOOK_TRAIT "granter (book)" // knowledge is power
// unique trait sources, still defines
#define STATUE_MUTE "statue"
#define STATUE_TRAIT "statue"
#define CLONING_POD_TRAIT "cloning-pod"
#define VIRTUAL_REALITY_TRAIT "vr_trait"
#define CHANGELING_DRAIN "drain"
@@ -290,3 +306,8 @@
#define CLOWNOP_TRAIT "clown-op"
#define MEGAFAUNA_TRAIT "megafauna"
#define DEATHSQUAD_TRAIT "deathsquad"
/// This trait is added by the active directional block system.
#define ACTIVE_BLOCK_TRAIT "active_block"
/// This trait is added by the parry system.
#define ACTIVE_PARRY_TRAIT "active_parry"
#define STICKY_NODROP "sticky-nodrop" //sticky nodrop sounds like a bad soundcloud rapper's name
+3
View File
@@ -122,3 +122,6 @@
// misc
#define VV_HK_SPACEVINE_PURGE "spacevine_purge"
// paintings
#define VV_HK_REMOVE_PAINTING "remove_painting"
-3
View File
@@ -1,9 +1,6 @@
//THIS FILE CONTAINS CONSTANTS, PROCS, AND OTHER THINGS//
/////////////////////////////////////////////////////////
/mob/proc/setClickCooldown(var/timeout)
next_move = max(world.time + timeout, next_move)
/proc/get_matrix_largest()
var/matrix/mtrx=new()
return mtrx.Scale(2)
+12 -1
View File
@@ -37,6 +37,7 @@
* TYPECONT: The typepath of the contents of the list
* COMPARE: The object to compare against, usualy the same as INPUT
* COMPARISON: The variable on the objects to compare
* COMPTYPE: How the current bin item to compare against COMPARE is fetched. By key or value.
*/
#define BINARY_INSERT(INPUT, LIST, TYPECONT, COMPARE, COMPARISON, COMPTYPE) \
do {\
@@ -68,7 +69,7 @@
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
var/total = input.len
if (!total)
return "[nothing_text]"
return nothing_text
else if (total == 1)
return "[input[1]]"
else if (total == 2)
@@ -670,3 +671,13 @@
for(var/key in input)
ret += key
return ret
/proc/is_type_in_ref_list(path, list/L)
if(!ispath(path))//not a path
return
for(var/i in L)
var/datum/D = i
if(!istype(D))//not an usable reference
continue
if(istype(D, path))
return TRUE
+11 -3
View File
@@ -4,7 +4,9 @@
#define SEND_SOUND(target, sound) DIRECT_OUTPUT(target, sound)
#define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text)
#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text)
#define WRITE_LOG(log, text) rustg_log_write(log, text)
//This is an external call, "true" and "false" are how rust parses out booleans
#define WRITE_LOG(log, text) rustg_log_write(log, text, "true")
#define WRITE_LOG_NO_FORMAT(log, text) rustg_log_write(log, text, "false")
//print a warning message to world.log
#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [UNLINT(src)] usr: [usr].")
@@ -53,7 +55,7 @@
WRITE_LOG(GLOB.world_game_log, "ADMIN: DSAY: [text]")
/proc/log_consent(text)
WRITE_LOG(GLOB.world_game_log,"CONSENT: [text]")
WRITE_LOG(GLOB.world_game_log, "CONSENT: [text]")
/* All other items are public. */
/proc/log_game(text)
@@ -64,6 +66,9 @@
if (CONFIG_GET(flag/log_virus))
WRITE_LOG(GLOB.world_virus_log, "VIRUS: [text]")
/proc/log_asset(text)
WRITE_LOG(GLOB.world_asset_log, "ASSET: [text]")
/proc/log_access(text)
if (CONFIG_GET(flag/log_access))
WRITE_LOG(GLOB.world_game_log, "ACCESS: [text]")
@@ -152,6 +157,9 @@
/proc/log_subsystem(subsystem, text)
WRITE_LOG(GLOB.subsystem_log, "[subsystem]: [text]")
/proc/log_click(atom/object, atom/location, control, params, client/C, event = "clicked", unexpected)
WRITE_LOG(GLOB.click_log, "[unexpected? "ERROR" :"CLICK"]: [C.ckey] - [event] : [istype(object)? "[object] ([COORD(object)])" : object] | [istype(location)? "[location] ([COORD(location)])" : location] | [control] | [params]")
/* Log to both DD and the logfile. */
/proc/log_world(text)
#ifdef USE_CUSTOM_ERROR_HANDLER
@@ -181,7 +189,7 @@
/proc/start_log(log)
WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------")
/* ui logging */
/* ui logging */
/proc/log_tgui(text)
WRITE_LOG(GLOB.tgui_log, text)
+39
View File
@@ -0,0 +1,39 @@
/proc/get_projectile_angle(atom/source, atom/target)
var/sx = source.x * world.icon_size
var/sy = source.y * world.icon_size
var/tx = target.x * world.icon_size
var/ty = target.y * world.icon_size
var/atom/movable/AM
if(ismovable(source))
AM = source
sx += AM.step_x
sy += AM.step_y
if(ismovable(target))
AM = target
tx += AM.step_x
ty += AM.step_y
return SIMPLIFY_DEGREES(arctan(ty - sy, tx - sx))
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
if(!start || !end)
return 0
var/dy
var/dx
dy=(32*end.y+end.pixel_y)-(32*start.y+start.pixel_y)
dx=(32*end.x+end.pixel_x)-(32*start.x+start.pixel_x)
if(!dy)
return (dx>=0)?90:270
.=arctan(dx/dy)
if(dy<0)
.+=180
else if(dx<0)
.+=360
/proc/Get_Pixel_Angle(var/y, var/x)//for getting the angle when animating something's pixel_x and pixel_y
if(!y)
return (x>=0)?90:270
.=arctan(x/y)
if(y<0)
.+=180
else if(x<0)
.+=360
+1
View File
@@ -170,6 +170,7 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(/area/engine/eng
newA.setup(str)
newA.set_dynamic_lighting()
newA.has_gravity = oldA.has_gravity
newA.noteleport = oldA.noteleport
else
newA = area_choice
+6 -1
View File
@@ -104,7 +104,7 @@ GLOBAL_VAR_INIT(cmp_field, "name")
var/a_sign = num2sign(initial(A.value) * -1)
var/b_sign = num2sign(initial(B.value) * -1)
// Neutral traits go last.
// Neutral traits go last
if(a_sign == 0)
a_sign = 2
if(b_sign == 0)
@@ -120,3 +120,8 @@ GLOBAL_VAR_INIT(cmp_field, "name")
/proc/cmp_item_block_priority_asc(obj/item/A, obj/item/B)
return A.block_priority - B.block_priority
/proc/cmp_skill_categories(datum/skill/A, datum/skill/B)
if(A.ui_category == B.ui_category)
return sorttext(A.name, B.name)
return sorttext(A.ui_category, B.ui_category)
+323
View File
@@ -0,0 +1,323 @@
/**
* Higher overhead "advanced" version of do_after.
* @params
* - atom/user is the atom doing the action or the "physical" user
* - delay is time in deciseconds
* - atom/target is the atom the action is being done to, defaults to user
* - do_after_flags see __DEFINES/flags/do_after.dm for details.
* - datum/callback/extra_checks - Every time this ticks, extra_checks() is invoked with (user, delay, target, time_left, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool).
* Stage can be DO_AFTER_STARTING, DO_AFTER_PROGRESSING, DO_AFTER_FINISHING
* If it returns DO_AFTER_STOP, this breaks.
* If it returns nothing, all other checks are done.
* If it returns DO_AFTER_PROCEED, all other checks are ignored.
* - required_mobility_flags is checked with CHECK_ALL_MOBILITY. Will immediately fail if the user isn't a mob.
* - requried_combat_flags is checked with CHECK_MULTIPLE_BITFIELDS. Will immediately fail if the user isn't a mob.
* - mob/living/mob_redirect - advanced option: If this is specified, movement and mobility/combat flag checks will use this instead of user. Progressbars will also go to this.
* - obj/item/tool - The tool we're using. See do_after flags for details.
*/
#define INVOKE_CALLBACK cb_return = extra_checks?.Invoke(user, delay, target, world.time - starttime, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool)
#define CHECK_FLAG_FAILURE ((required_mobility_flags || required_combat_flags) && (!living_user || (required_mobility_flags && !CHECK_ALL_MOBILITY(living_user, required_mobility_flags)) || (required_combat_flags && !CHECK_MULTIPLE_BITFIELDS(living_user.combat_flags, required_combat_flags))))
#define TIMELEFT (world.time - starttime)
/proc/do_after_advanced(atom/user, delay, atom/target, do_after_flags, datum/callback/extra_checks, required_mobility_flags, required_combat_flags, mob/living/mob_redirect, obj/item/tool)
// CHECK AND SET VARIABLES
if(!user)
return FALSE
if(!target)
target = user
if((user.loc == null) || (target.loc == null))
return FALSE
var/mob/living/living_user = mob_redirect
if(!living_user && isliving(user))
living_user = user
var/stage = DO_AFTER_STARTING
var/startlocuser = user.loc
var/startloctarget = target.loc
var/turf/userturf = get_turf(user)
var/turf/targetturf = get_turf(target)
if(!userturf || !targetturf)
return FALSE
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
return FALSE
var/starttime = world.time
var/endtime = world.time + delay
var/obj/item/initially_held_item = mob_redirect?.get_active_held_item()
if(!(do_after_flags & DO_AFTER_NO_COEFFICIENT) && living_user)
delay *= living_user.do_after_coefficent()
var/atom/movable/AM_user = ismovable(user) && user
var/drifting = AM_user?.Process_Spacemove(NONE) && AM_user.inertia_dir
var/initial_dx = targetturf.x - userturf.x
var/initial_dy = targetturf.y - userturf.y
var/dx = initial_dx
var/dy = initial_dy
// DO OUR STARTING CHECKS
var/cb_return
INVOKE_CALLBACK
if(cb_return == DO_AFTER_STOP)
return FALSE
else if(cb_return != DO_AFTER_PROCEED)
if(CHECK_FLAG_FAILURE)
return FALSE
// SETUP LOOP
var/datum/progressbar/progbar
if(living_user)
if(!(do_after_flags & DO_AFTER_NO_PROGRESSBAR))
progbar = new(living_user, delay, target)
// MAIN LOOP
. = TRUE
if(!delay)
return
var/obj/item/held
var/locchanged
var/ctu
var/ctt
while(world.time < endtime)
stoplag(1)
progbar?.update(TIMELEFT)
if(QDELETED(user) || QDELETED(target) || (user.loc == null) || (target.loc == null))
. = FALSE
break
INVOKE_CALLBACK
if(cb_return == DO_AFTER_STOP)
. = FALSE
break
else if(cb_return == DO_AFTER_PROCEED)
continue
// otherwise, go through our normal checks.
if(((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER) && (user.loc != startlocuser)) || ((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET) && (target.loc != startloctarget)))
. = FALSE
break
else if(do_after_flags & DO_AFTER_DISALLOW_MOVING_RELATIVE)
ctu = get_turf(user)
ctt = get_turf(target)
locchanged = (userturf != ctu) || (targetturf != ctt)
userturf = ctu
targetturf = ctt
dx = targetturf.x - userturf.x
dy = targetturf.y - userturf.y
if((dx != initial_dx) || (dy != initial_dy))
. = FALSE
break
if(locchanged && !drifting && !(do_after_flags & DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY))
. = FALSE
break
if(!AM_user.inertia_dir)
drifting = FALSE
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
return FALSE
if(CHECK_FLAG_FAILURE)
. = FALSE
break
held = living_user?.get_active_held_item()
if((do_after_flags & DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE) && (held != (tool || initially_held_item)))
. = FALSE
break
if((do_after_flags & DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL) && (!living_user?.is_holding(tool) && !length(living_user?.get_empty_held_indexes())))
. = FALSE
break
// CLEANUP
qdel(progbar)
// If we failed, just return.
if(!.)
return FALSE
// DO FINISHING CHECKS
if(QDELETED(user) || QDELETED(target))
return FALSE
INVOKE_CALLBACK
if(cb_return == DO_AFTER_STOP)
return FALSE
else if(cb_return == DO_AFTER_PROCEED)
return TRUE
if(CHECK_FLAG_FAILURE)
return FALSE
if(((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER) && (user.loc != startlocuser)) || ((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET) && (target.loc != startloctarget)))
return FALSE
else if(do_after_flags & DO_AFTER_DISALLOW_MOVING_RELATIVE)
ctu = get_turf(user)
ctt = get_turf(target)
locchanged = (userturf != ctu) || (targetturf != ctt)
userturf = ctu
targetturf = ctt
dx = targetturf.x - userturf.x
dy = targetturf.y - userturf.y
if((dx != initial_dx) || (dy != initial_dy))
return FALSE
if(locchanged && !drifting && !(do_after_flags & DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY))
return FALSE
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
return FALSE
held = living_user?.get_active_held_item()
if((do_after_flags & DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE) && (held != (tool || initially_held_item)))
return FALSE
if((do_after_flags & DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL) && (!living_user?.is_holding(tool) && !length(living_user?.get_empty_held_indexes())))
return FALSE
#undef INVOKE_CALLBACK
#undef CHECK_FLAG_FAILURE
/proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks = null, ignorehelditem = FALSE, resume_time = 0 SECONDS)
if(!user || !target)
return 0
var/user_loc = user.loc
var/drifting = 0
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/target_loc = target.loc
var/holding = user.get_active_held_item()
var/datum/progressbar/progbar
if (progress)
progbar = new(user, time, target)
var/endtime = world.time+time
var/starttime = world.time
. = 1
while (world.time + resume_time < endtime)
stoplag(1)
if (progress)
progbar.update(world.time - starttime + resume_time)
if(QDELETED(user) || QDELETED(target))
. = 0
break
if(uninterruptible)
continue
if(drifting && !user.inertia_dir)
drifting = 0
user_loc = user.loc
if((!drifting && user.loc != user_loc) || target.loc != target_loc || (!ignorehelditem && user.get_active_held_item() != holding) || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
. = 0
break
if (progress)
qdel(progbar)
//some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action
/mob/proc/break_do_after_checks(list/checked_health, check_clicks)
if(check_clicks && next_move > world.time)
return FALSE
return TRUE
//pass a list in the format list("health" = mob's health var) to check health during this
/mob/living/break_do_after_checks(list/checked_health, check_clicks)
if(islist(checked_health))
if(health < checked_health["health"])
return FALSE
checked_health["health"] = health
return ..()
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_USE|MOBILITY_MOVE), resume_time = 0 SECONDS)
if(!user)
return 0
var/atom/Tloc = null
if(target && !isturf(target))
Tloc = target.loc
var/atom/Uloc = user.loc
var/drifting = 0
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/holding = user.get_active_held_item()
var/holdingnull = 1 //User's hand started out empty, check for an empty hand
if(holding)
holdingnull = 0 //Users hand started holding something, check to see if it's still holding that
delay *= user.do_after_coefficent()
var/datum/progressbar/progbar
if (progress)
progbar = new(user, delay, target)
var/endtime = world.time + delay
var/starttime = world.time
. = 1
var/mob/living/L = isliving(user) && user //evals to last thing eval'd
while (world.time + resume_time < endtime)
stoplag(1)
if (progress)
progbar.update(world.time - starttime + resume_time)
if(drifting && !user.inertia_dir)
drifting = 0
Uloc = user.loc
if(L && !CHECK_ALL_MOBILITY(L, required_mobility_flags))
. = 0
break
if(QDELETED(user) || user.stat || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
. = 0
break
if(!QDELETED(Tloc) && (QDELETED(target) || Tloc != target.loc))
if((Uloc != Tloc || Tloc != user) && !drifting)
. = 0
break
if(needhand)
//This might seem like an odd check, but you can still need a hand even when it's empty
//i.e the hand is used to pull some item/tool out of the construction
if(!holdingnull)
if(!holding)
. = 0
break
if(user.get_active_held_item() != holding)
. = 0
break
if (progress)
qdel(progbar)
/mob/proc/do_after_coefficent() // This gets added to the delay on a do_after, default 1
. = 1
return
/proc/do_after_mob(mob/user, var/list/targets, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks)
if(!user || !targets)
return 0
if(!islist(targets))
targets = list(targets)
var/user_loc = user.loc
var/drifting = 0
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/list/originalloc = list()
for(var/atom/target in targets)
originalloc[target] = target.loc
var/holding = user.get_active_held_item()
var/datum/progressbar/progbar
if(progress)
progbar = new(user, time, targets[1])
var/endtime = world.time + time
var/starttime = world.time
. = 1
mainloop:
while(world.time < endtime)
stoplag(1)
if(progress)
progbar.update(world.time - starttime)
if(QDELETED(user) || !targets)
. = 0
break
if(uninterruptible)
continue
if(drifting && !user.inertia_dir)
drifting = 0
user_loc = user.loc
for(var/atom/target in targets)
if((!drifting && user_loc != user.loc) || QDELETED(target) || originalloc[target] != target.loc || user.get_active_held_item() != holding || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
. = 0
break mainloop
if(progbar)
qdel(progbar)
+1 -1
View File
@@ -3,7 +3,7 @@
for(var/file in args)
src << browse_rsc(file)
/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list("txt","log","htm", "html", "md"))
/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list("txt","log","htm", "html", "md", "json"))
var/path = root
for(var/i=0, i<max_iterations, i++)
+9 -16
View File
@@ -249,6 +249,15 @@
SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .)
processing += A.contents
//viewers() but with a signal, for blacklisting.
/proc/fov_viewers(depth = world.view, atom/center)
if(!center)
return
. = viewers(depth, center)
for(var/k in .)
var/mob/M = k
SEND_SIGNAL(M, COMSIG_MOB_FOV_VIEWER, center, depth, .)
/proc/get_mobs_in_radio_ranges(list/obj/item/radio/radios)
. = list()
// Returns a list of mobs who can hear any of the radios given in @radios
@@ -535,22 +544,6 @@
var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems)
announcer.announce("ARRIVAL", character.real_name, rank, list()) //make the list empty to make it announce it in common
/proc/GetHexColors(const/hexa)
return list(
GetRedPart(hexa)/ 255,
GetGreenPart(hexa)/ 255,
GetBluePart(hexa)/ 255
)
/proc/GetRedPart(const/hexa)
return hex2num(copytext(hexa, 2, 4))
/proc/GetGreenPart(const/hexa)
return hex2num(copytext(hexa, 4, 6))
/proc/GetBluePart(const/hexa)
return hex2num(copytext(hexa, 6, 8))
/proc/lavaland_equipment_pressure_check(turf/T)
. = FALSE
if(!istype(T))
+2
View File
@@ -75,6 +75,8 @@
var/datum/emote/E = new path()
E.emote_list[E.key] = E
init_keybindings()
//Uplink Items
for(var/path in subtypesof(/datum/uplink_item))
var/datum/uplink_item/I = path
+6 -4
View File
@@ -1136,9 +1136,10 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0
if (!isicon(I))
if (isfile(thing)) //special snowflake
var/name = sanitize_filename("[generate_asset_name(thing)].png")
register_asset(name, thing)
if(!SSassets.cache[name])
register_asset(name, thing)
for (var/thing2 in targets)
send_asset(thing2, key, FALSE)
send_asset(thing2, key)
return "<img class='icon icon-misc' src=\"[url_encode(name)]\">"
var/atom/A = thing
if (isnull(dir))
@@ -1160,9 +1161,10 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0
I = icon(I, icon_state, dir, frame, moving)
key = "[generate_asset_name(I)].png"
register_asset(key, I)
if(!SSassets.cache[key])
register_asset(key, I)
for (var/thing2 in targets)
send_asset(thing2, key, FALSE)
send_asset(thing2, key)
return "<img class='icon icon-[icon_state]' src=\"[url_encode(key)]\">"
+3 -167
View File
@@ -216,6 +216,7 @@
"ipc_screen" = snowflake_ipc_antenna_list ? pick(snowflake_ipc_antenna_list) : "None",
"ipc_antenna" = "None",
"flavor_text" = "",
"silicon_flavor_text" = "",
"meat_type" = "Mammalian",
"body_model" = body_model,
"body_size" = RESIZE_DEFAULT_SIZE
@@ -319,173 +320,6 @@ GLOBAL_LIST_EMPTY(species_list)
else
return "unknown"
/proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks = null, ignorehelditem = FALSE, resume_time = 0 SECONDS)
if(!user || !target)
return 0
var/user_loc = user.loc
var/drifting = 0
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/target_loc = target.loc
var/holding = user.get_active_held_item()
var/datum/progressbar/progbar
if (progress)
progbar = new(user, time, target)
var/endtime = world.time+time
var/starttime = world.time
. = 1
while (world.time + resume_time < endtime)
stoplag(1)
if (progress)
progbar.update(world.time - starttime + resume_time)
if(QDELETED(user) || QDELETED(target))
. = 0
break
if(uninterruptible)
continue
if(drifting && !user.inertia_dir)
drifting = 0
user_loc = user.loc
if((!drifting && user.loc != user_loc) || target.loc != target_loc || (!ignorehelditem && user.get_active_held_item() != holding) || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
. = 0
break
if (progress)
qdel(progbar)
//some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action
/mob/proc/break_do_after_checks(list/checked_health, check_clicks)
if(check_clicks && next_move > world.time)
return FALSE
return TRUE
//pass a list in the format list("health" = mob's health var) to check health during this
/mob/living/break_do_after_checks(list/checked_health, check_clicks)
if(islist(checked_health))
if(health < checked_health["health"])
return FALSE
checked_health["health"] = health
return ..()
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_USE|MOBILITY_MOVE), resume_time = 0 SECONDS)
if(!user)
return 0
var/atom/Tloc = null
if(target && !isturf(target))
Tloc = target.loc
var/atom/Uloc = user.loc
var/drifting = 0
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/holding = user.get_active_held_item()
var/holdingnull = 1 //User's hand started out empty, check for an empty hand
if(holding)
holdingnull = 0 //Users hand started holding something, check to see if it's still holding that
delay *= user.do_after_coefficent()
var/datum/progressbar/progbar
if (progress)
progbar = new(user, delay, target)
var/endtime = world.time + delay
var/starttime = world.time
. = 1
var/mob/living/L = isliving(user) && user //evals to last thing eval'd
while (world.time + resume_time < endtime)
stoplag(1)
if (progress)
progbar.update(world.time - starttime + resume_time)
if(drifting && !user.inertia_dir)
drifting = 0
Uloc = user.loc
if(L && !CHECK_ALL_MOBILITY(L, required_mobility_flags))
. = 0
break
if(QDELETED(user) || user.stat || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
. = 0
break
if(!QDELETED(Tloc) && (QDELETED(target) || Tloc != target.loc))
if((Uloc != Tloc || Tloc != user) && !drifting)
. = 0
break
if(needhand)
//This might seem like an odd check, but you can still need a hand even when it's empty
//i.e the hand is used to pull some item/tool out of the construction
if(!holdingnull)
if(!holding)
. = 0
break
if(user.get_active_held_item() != holding)
. = 0
break
if (progress)
qdel(progbar)
/mob/proc/do_after_coefficent() // This gets added to the delay on a do_after, default 1
. = 1
return
/proc/do_after_mob(mob/user, var/list/targets, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks)
if(!user || !targets)
return 0
if(!islist(targets))
targets = list(targets)
var/user_loc = user.loc
var/drifting = 0
if(!user.Process_Spacemove(0) && user.inertia_dir)
drifting = 1
var/list/originalloc = list()
for(var/atom/target in targets)
originalloc[target] = target.loc
var/holding = user.get_active_held_item()
var/datum/progressbar/progbar
if(progress)
progbar = new(user, time, targets[1])
var/endtime = world.time + time
var/starttime = world.time
. = 1
mainloop:
while(world.time < endtime)
stoplag(1)
if(progress)
progbar.update(world.time - starttime)
if(QDELETED(user) || !targets)
. = 0
break
if(uninterruptible)
continue
if(drifting && !user.inertia_dir)
drifting = 0
user_loc = user.loc
for(var/atom/target in targets)
if((!drifting && user_loc != user.loc) || QDELETED(target) || originalloc[target] != target.loc || user.get_active_held_item() != holding || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
. = 0
break mainloop
if(progbar)
qdel(progbar)
/proc/is_species(A, species_datum)
. = FALSE
if(ishuman(A))
@@ -541,6 +375,8 @@ GLOBAL_LIST_EMPTY(species_list)
override = TRUE
if(HAS_TRAIT(M, TRAIT_SIXTHSENSE))
override = TRUE
if(SSticker.current_state == GAME_STATE_FINISHED)
override = TRUE
if(isnewplayer(M) && !override)
continue
if(M.stat != DEAD && !override)
+2 -1
View File
@@ -174,7 +174,7 @@
to_chat(world, "<BR><BR><BR><span class='big bold'>The round has ended.</span>")
if(LAZYLEN(GLOB.round_end_notifiees))
send2irc("Notice", "[GLOB.round_end_notifiees.Join(", ")] the round has ended.")
world.TgsTargetedChatBroadcast("[GLOB.round_end_notifiees.Join(", ")] the round has ended.", FALSE)
for(var/I in round_end_events)
var/datum/callback/cb = I
@@ -233,6 +233,7 @@
for(var/antag_name in total_antagonists)
var/list/L = total_antagonists[antag_name]
log_game("[antag_name]s :[L.Join(", ")].")
set_observer_default_invisibility(0, "<span class='warning'>The round is over! You are now visible to the living.</span>")
CHECK_TICK
SSdbcore.SetRoundEnd()
+6
View File
@@ -18,6 +18,12 @@
return text
return default
/proc/sanitize_islist(value, default)
if(islist(value) && length(value))
return value
if(default)
return default
/proc/sanitize_inlist(value, list/List, default)
if(value in List)
return value
+42
View File
@@ -629,3 +629,45 @@
return null
r += ascii2text(c)
return r
/proc/slot_to_string(slot)
switch(slot)
if(SLOT_BACK)
return "Backpack"
if(SLOT_WEAR_MASK)
return "Mask"
if(SLOT_HANDS)
return "Hands"
if(SLOT_BELT)
return "Belt"
if(SLOT_EARS)
return "Ears"
if(SLOT_GLASSES)
return "Glasses"
if(SLOT_GLOVES)
return "Gloves"
if(SLOT_NECK)
return "Neck"
if(SLOT_HEAD)
return "Head"
if(SLOT_SHOES)
return "Shoes"
if(SLOT_WEAR_SUIT)
return "Suit"
if(SLOT_W_UNIFORM)
return "Uniform"
if(SLOT_IN_BACKPACK)
return "In backpack"
/proc/tg_ui_icon_to_cit_ui(ui_style)
switch(ui_style)
if('icons/mob/screen_plasmafire.dmi')
return 'modular_citadel/icons/ui/screen_plasmafire.dmi'
if('icons/mob/screen_slimecore.dmi')
return 'modular_citadel/icons/ui/screen_slimecore.dmi'
if('icons/mob/screen_operative.dmi')
return 'modular_citadel/icons/ui/screen_operative.dmi'
if('icons/mob/screen_clockwork.dmi')
return 'modular_citadel/icons/ui/screen_clockwork.dmi'
else
return 'modular_citadel/icons/ui/screen_midnight.dmi'
+18 -33
View File
@@ -1,5 +1,3 @@
/*
* A large number of misc global procs.
*/
@@ -17,30 +15,8 @@
var/textb = copytext(HTMLstring, 6, 8)
return rgb(255 - hex2num(textr), 255 - hex2num(textg), 255 - hex2num(textb))
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
if(!start || !end)
return 0
var/dy
var/dx
dy=(32*end.y+end.pixel_y)-(32*start.y+start.pixel_y)
dx=(32*end.x+end.pixel_x)-(32*start.x+start.pixel_x)
if(!dy)
return (dx>=0)?90:270
.=arctan(dx/dy)
if(dy<0)
.+=180
else if(dx<0)
.+=360
/proc/Get_Pixel_Angle(var/y, var/x)//for getting the angle when animating something's pixel_x and pixel_y
if(!y)
return (x>=0)?90:270
.=arctan(x/y)
if(y<0)
.+=180
else if(x<0)
.+=360
//Better performant than an artisanal proc and more reliable than Turn(). From TGMC.
#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )
//Returns location. Returns null if no location was found.
/proc/get_teleport_loc(turf/location,mob/target,distance = 1, density = FALSE, errorx = 0, errory = 0, eoffsetx = 0, eoffsety = 0)
/*
@@ -391,6 +367,16 @@ Turf and target are separate in case you want to teleport some distance from a t
break
return loc
//Returns a list of all locations the target is within.
/proc/get_nested_locs(atom/movable/M, include_turf = FALSE)
. = list()
var/atom/A = M.loc
while(A && !isturf(A))
. += A
A = A.loc
if(A && include_turf) //At this point, only the turf is left.
. += A
// returns the turf located at the map edge in the specified direction relative to A
// used for mass driver
/proc/get_edge_target_turf(atom/A, direction)
@@ -689,12 +675,6 @@ Turf and target are separate in case you want to teleport some distance from a t
loc = loc.loc
return null
//For objects that should embed, but make no sense being is_sharp or is_pointed()
//e.g: rods
GLOBAL_LIST_INIT(can_embed_types, typecacheof(list(
/obj/item/stack/rods,
/obj/item/pipe)))
/*
Checks if that loc and dir has an item on the wall
*/
@@ -1592,8 +1572,13 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
//empty string - use TgsTargetBroadcast with admin_only = FALSE
//other string - use TgsChatBroadcast with the tag that matches config_setting, only works with TGS4, if using TGS3 the above method is used
/proc/send2chat(message, config_setting)
if(config_setting == null || !world.TgsAvailable())
if(config_setting == null)
return
UNTIL(GLOB.tgs_initialized)
if(!world.TgsAvailable())
return
var/datum/tgs_version/version = world.TgsVersion()
if(config_setting == "" || version.suite == 3)
world.TgsTargetedChatBroadcast(message, FALSE)
+18 -11
View File
@@ -49,6 +49,8 @@ GLOBAL_LIST_INIT(bitfields, list(
"DROPDEL" = DROPDEL,
"NOBLUDGEON" = NOBLUDGEON,
"ABSTRACT" = ABSTRACT,
"ITEM_CAN_BLOCK" = ITEM_CAN_BLOCK,
"ITEM_CAN_PARRY" = ITEM_CAN_PARRY
),
"admin_flags" = list(
"BUILDMODE" = R_BUILDMODE,
@@ -123,7 +125,7 @@ GLOBAL_LIST_INIT(bitfields, list(
"UNUSED_RESERVATION_TURF_1" = UNUSED_RESERVATION_TURF_1,
"CAN_BE_DIRTY_1" = CAN_BE_DIRTY_1,
"HEAR_1" = HEAR_1,
"CHECK_RICOCHET_1" = CHECK_RICOCHET_1,
"DEFAULT_RICOCHET_1" = DEFAULT_RICOCHET_1,
"CONDUCT_1" = CONDUCT_1,
"NO_LAVA_GEN_1" = NO_LAVA_GEN_1,
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
@@ -132,9 +134,15 @@ GLOBAL_LIST_INIT(bitfields, list(
"NO_RUINS_1" = NO_RUINS_1,
"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
"HOLOGRAM_1" = HOLOGRAM_1,
"TESLA_IGNORE_1" = TESLA_IGNORE_1,
"SHOCKED_1" = SHOCKED_1,
"INITIALIZED_1" = INITIALIZED_1,
"ADMIN_SPAWNED_1" = ADMIN_SPAWNED_1,
"BLOCK_FACE_ATOM_1" = BLOCK_FACE_ATOM_1,
"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1
),
"flags_ricochet" = list(
"RICOCHET_SHINY" = RICOCHET_SHINY,
"RICOCHET_HARD" = RICOCHET_HARD
),
"clothing_flags" = list(
"LAVAPROTECT" = LAVAPROTECT,
@@ -148,12 +156,12 @@ GLOBAL_LIST_INIT(bitfields, list(
"IGNORE_HAT_TOSS" = IGNORE_HAT_TOSS,
"SCAN_REAGENTS" = SCAN_REAGENTS
),
"tesla_flags" = list(
"TESLA_MOB_DAMAGE" = TESLA_MOB_DAMAGE,
"TESLA_OBJ_DAMAGE" = TESLA_OBJ_DAMAGE,
"TESLA_MOB_STUN" = TESLA_MOB_STUN,
"TESLA_ALLOW_DUPLICATES" = TESLA_ALLOW_DUPLICATES,
"TESLA_MACHINE_EXPLOSIVE" = TESLA_MACHINE_EXPLOSIVE,
"zap_flags" = list(
"ZAP_MOB_DAMAGE" = ZAP_MOB_DAMAGE,
"ZAP_OBJ_DAMAGE" = ZAP_OBJ_DAMAGE,
"ZAP_MOB_STUN" = ZAP_MOB_STUN,
"ZAP_ALLOW_DUPLICATES" = ZAP_ALLOW_DUPLICATES,
"ZAP_MACHINE_EXPLOSIVE" = ZAP_MACHINE_EXPLOSIVE,
),
"smooth" = list(
"SMOOTH_TRUE" = SMOOTH_TRUE,
@@ -240,15 +248,14 @@ GLOBAL_LIST_INIT(bitfields, list(
"MOBILITY_RESIST" = MOBILITY_RESIST
),
"combat_flags" = list(
"COMBAT_FLAG_COMBAT_TOGGLED" = COMBAT_FLAG_COMBAT_TOGGLED,
"COMBAT_FLAG_SPRINT_TOGGLED" = COMBAT_FLAG_SPRINT_TOGGLED,
"COMBAT_FLAG_COMBAT_ACTIVE" = COMBAT_FLAG_COMBAT_ACTIVE,
"COMBAT_FLAG_SPRINT_ACTIVE" = COMBAT_FLAG_SPRINT_ACTIVE,
"COMBAT_FLAG_ATTEMPTING_CRAWL" = COMBAT_FLAG_ATTEMPTING_CRAWL,
"COMBAT_FLAG_HARD_STAMCRIT" = COMBAT_FLAG_HARD_STAMCRIT,
"COMBAT_FLAG_SOFT_STAMCRIT" = COMBAT_FLAG_SOFT_STAMCRIT,
"COMBAT_FLAG_INTENTIONALLY_RESTING" = COMBAT_FLAG_INTENTIONALLY_RESTING,
"COMBAT_FLAG_RESISTING_REST" = COMBAT_FLAG_RESISTING_REST
"COMBAT_FLAG_RESISTING_REST" = COMBAT_FLAG_RESISTING_REST,
"COMBAT_FLAG_SPRINT_FORCED" = COMBAT_FLAG_SPRINT_FORCED
),
"shield_flags" = list(
"SHIELD_TRANSPARENT" = SHIELD_TRANSPARENT,
+21
View File
@@ -0,0 +1,21 @@
GLOBAL_LIST_EMPTY(classic_keybinding_list_by_key)
GLOBAL_LIST_EMPTY(hotkey_keybinding_list_by_key)
GLOBAL_LIST_EMPTY(keybindings_by_name)
// This is a mapping from JS keys to Byond - ref: https://keycode.info/
GLOBAL_LIST_INIT(_kbMap, list(
"UP" = "North",
"RIGHT" = "East",
"DOWN" = "South",
"LEFT" = "West",
"INSERT" = "Insert",
"HOME" = "Northwest",
"PAGEUP" = "Northeast",
"DEL" = "Delete",
"END" = "Southwest",
"PAGEDOWN" = "Southeast",
"SPACEBAR" = "Space",
"ALT" = "Alt",
"SHIFT" = "Shift",
"CONTROL" = "Ctrl"
))
+8
View File
@@ -223,3 +223,11 @@ GLOBAL_LIST_INIT(station_numerals, greek_letters + phonetic_alphabet + numbers_a
GLOBAL_LIST_INIT(admiral_messages, list("Do you know how expensive these stations are?","Stop wasting my time.","I was sleeping, thanks a lot.","Stand and fight you cowards!","You knew the risks coming in.","Stop being paranoid.","Whatever's broken just build a new one.","No.", "<i>null</i>","<i>Error: No comment given.</i>", "It's a good day to die!"))
GLOBAL_LIST_INIT(redacted_strings, list("\[REDACTED\]", "\[CLASSIFIED\]", "\[ARCHIVED\]", "\[EXPLETIVE DELETED\]", "\[EXPUNGED\]", "\[INFORMATION ABOVE YOUR SECURITY CLEARANCE\]", "\[MOVE ALONG CITIZEN\]", "\[NOTHING TO SEE HERE\]", "\[ACCESS DENIED\]"))
GLOBAL_LIST_INIT(wisdoms, world.file2list("strings/wisdoms.txt"))
GLOBAL_LIST_INIT(speech_verbs, list("default","says","gibbers", "states", "chitters", "declares", "bellows", "buzzes" ,"beeps", "chirps" ,"hisses" ,"poofs" ,"rattles", "mewls" ,"barks", "blorbles", "squeaks", "squawks", "flutters"))
GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/organ/tongue, "lizard tongue" = /obj/item/organ/tongue/lizard, "skeleton tongue" = /obj/item/organ/tongue/bone, "fly tongue" = /obj/item/organ/tongue/fly, "ipc tongue" = /obj/item/organ/tongue/robot/ipc))
+31
View File
@@ -0,0 +1,31 @@
/// Creates and sorts all the keybinding datums
/proc/init_keybindings()
for(var/KB in subtypesof(/datum/keybinding))
var/datum/keybinding/keybinding = KB
if(!initial(keybinding.hotkey_keys))
continue
add_keybinding(new keybinding)
// init_emote_keybinds() - Disabled - I don't particularly want this.
/// Adds an instanced keybinding to the global tracker
/proc/add_keybinding(datum/keybinding/instance)
GLOB.keybindings_by_name[instance.name] = instance
// Classic
if(LAZYLEN(instance.classic_keys))
for(var/bound_key in instance.classic_keys)
LAZYADD(GLOB.classic_keybinding_list_by_key[bound_key], list(instance.name))
// Hotkey
if(LAZYLEN(instance.hotkey_keys))
for(var/bound_key in instance.hotkey_keys)
LAZYADD(GLOB.hotkey_keybinding_list_by_key[bound_key], list(instance.name))
/proc/init_emote_keybinds()
for(var/i in subtypesof(/datum/emote))
var/datum/emote/faketype = i
if(!initial(faketype.key))
continue
var/datum/keybinding/emote/emote_kb = new
emote_kb.link_to_emote(faketype)
add_keybinding(emote_kb)
+21 -2
View File
@@ -51,7 +51,7 @@ GLOBAL_LIST_INIT(maintenance_loot, list(
/obj/item/airlock_painter = 1,
/obj/item/stack/cable_coil/random = 4,
/obj/item/stack/cable_coil/random/five = 6,
/obj/item/stack/medical/bruise_pack = 1,
/obj/item/stack/medical/suture = 1,
/obj/item/stack/rods/ten = 9,
/obj/item/stack/rods/twentyfive = 1,
/obj/item/stack/rods/fifty = 1,
@@ -89,7 +89,7 @@ GLOBAL_LIST_INIT(maintenance_loot, list(
/obj/effect/spawner/lootdrop/welder_tools = 3,
/obj/effect/spawner/lootdrop/low_tools = 5,
/obj/item/relic = 3,
/obj/item/weaponcrafting/receiver = 2,
/obj/item/weaponcrafting/improvised_parts/shotgun_receiver = 2,
/obj/item/clothing/head/cone = 2,
/obj/item/grenade/smokebomb = 2,
/obj/item/geiger_counter = 3,
@@ -116,5 +116,24 @@ GLOBAL_LIST_INIT(maintenance_loot, list(
/obj/item/autosurgeon/testicles = 1,
/obj/item/storage/box/marshmallow = 2,
/obj/item/clothing/gloves/tackler/offbrand = 1,
/obj/item/stack/sticky_tape = 1,
"" = 3
))
GLOBAL_LIST_INIT(ratking_trash, list(//Garbage: used by the regal rat mob when spawning garbage.
/obj/item/cigbutt,
/obj/item/trash/cheesie,
/obj/item/trash/candy,
/obj/item/trash/chips,
/obj/item/trash/pistachios,
/obj/item/trash/plate,
/obj/item/trash/popcorn,
/obj/item/trash/raisins,
/obj/item/trash/sosjerky,
/obj/item/trash/syndi_cakes))
GLOBAL_LIST_INIT(ratking_coins, list(//Coins: Used by the regal rat mob when spawning coins.
/obj/item/coin/iron,
/obj/item/coin/silver,
/obj/item/coin/plastic,
/obj/item/coin/titanium))
+3 -1
View File
@@ -19,6 +19,7 @@
#define POLL_IGNORE_WIZARD "wizard"
#define POLL_IGNORE_CLONE "clone"
#define POLL_IGNORE_CONTRACTOR_SUPPORT "contractor_support"
#define POLL_IGNORE_FUGITIVE "fugitive"
GLOBAL_LIST_INIT(poll_ignore_desc, list(
POLL_IGNORE_SENTIENCE_POTION = "Sentience potion",
@@ -39,7 +40,8 @@ GLOBAL_LIST_INIT(poll_ignore_desc, list(
POLL_IGNORE_DEMON = "Demons",
POLL_IGNORE_WIZARD = "Wizards",
POLL_IGNORE_CLONE = "Defective/SDGF clones",
POLL_IGNORE_CONTRACTOR_SUPPORT = "Contractor Support Unit"
POLL_IGNORE_CONTRACTOR_SUPPORT = "Contractor Support Unit",
POLL_IGNORE_FUGITIVE = "Fugitive Hunter"
))
GLOBAL_LIST_INIT(poll_ignore, init_poll_ignore())
+4
View File
@@ -28,6 +28,8 @@ GLOBAL_VAR(world_job_debug_log)
GLOBAL_PROTECT(world_job_debug_log)
GLOBAL_VAR(world_virus_log)
GLOBAL_PROTECT(world_virus_log)
GLOBAL_VAR(world_asset_log)
GLOBAL_PROTECT(world_asset_log)
GLOBAL_VAR(world_map_error_log)
GLOBAL_PROTECT(world_map_error_log)
GLOBAL_VAR(subsystem_log)
@@ -36,6 +38,8 @@ GLOBAL_VAR(reagent_log)
GLOBAL_PROTECT(reagent_log)
GLOBAL_VAR(world_crafting_log)
GLOBAL_PROTECT(world_crafting_log)
GLOBAL_VAR(click_log)
GLOBAL_PROTECT(click_log)
GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)
+4 -1
View File
@@ -29,6 +29,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE,
"TRAIT_PUSHIMMUNE" = TRAIT_PUSHIMMUNE,
"TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE,
"TRAIT_TESLA_SHOCKIMMUNE" = TRAIT_TESLA_SHOCKIMMUNE,
"TRAIT_STABLEHEART" = TRAIT_STABLEHEART,
"TRAIT_STABLELIVER" = TRAIT_STABLELIVER,
"TRAIT_RESISTHEAT" = TRAIT_RESISTHEAT,
@@ -92,6 +93,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_PASSTABLE" = TRAIT_PASSTABLE,
"TRAIT_GIANT" = TRAIT_GIANT,
"TRAIT_DWARF" = TRAIT_DWARF,
"TRAIT_NICE_SHOT" = TRAIT_NICE_SHOT,
"TRAIT_COMBAT_MODE_LOCKED" = TRAIT_COMBAT_MODE_LOCKED,
"TRAIT_SPRINT_LOCKED" = TRAIT_SPRINT_LOCKED,
"TRAIT_AUTO_CATCH_ITEM" = TRAIT_AUTO_CATCH_ITEM,
@@ -115,7 +117,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_MASO" = TRAIT_MASO,
"TRAIT_HIGH_BLOOD" = TRAIT_HIGH_BLOOD,
"TRAIT_EMPATH" = TRAIT_EMPATH,
"TRAIT_FRIENDLY" = TRAIT_FRIENDLY
"TRAIT_FRIENDLY" = TRAIT_FRIENDLY,
"TRAIT_NICE_SHOT" = TRAIT_NICE_SHOT
),
/obj/item/bodypart = list(
"TRAIT_PARALYSIS" = TRAIT_PARALYSIS
+23 -16
View File
@@ -17,10 +17,14 @@
// eg: 10*0.5 = 5 deciseconds of delay
// DOES NOT EFFECT THE BASE 1 DECISECOND DELAY OF NEXT_CLICK
/mob/proc/timeToNextMove()
return max(0, next_move - world.time)
/mob/proc/changeNext_move(num)
next_move = world.time + ((num+next_move_adjust)*next_move_modifier)
/mob/living/changeNext_move(num)
last_click_move = next_move
var/mod = next_move_modifier
var/adj = next_move_adjust
for(var/i in status_effects)
@@ -72,12 +76,12 @@
if(check_click_intercept(params,A))
return
if(notransform)
if(mob_transforming)
return
if(SEND_SIGNAL(src, COMSIG_MOB_CLICKON, A, params) & COMSIG_MOB_CANCEL_CLICKON)
return
var/list/modifiers = params2list(params)
if(modifiers["shift"] && modifiers["middle"])
ShiftMiddleClickOn(A)
@@ -324,10 +328,9 @@
return
/atom/proc/ShiftClick(mob/user)
var/flags = SEND_SIGNAL(src, COMSIG_CLICK_SHIFT, user)
var/flags = SEND_SIGNAL(src, COMSIG_CLICK_SHIFT, user) | SEND_SIGNAL(user, COMSIG_MOB_CLICKED_SHIFT_ON, src)
if(!(flags & COMPONENT_DENY_EXAMINATE) && user.client && (user.client.eye == user || user.client.eye == user.loc || flags & COMPONENT_ALLOW_EXAMINATE))
user.examinate(src)
return
/*
Ctrl click
@@ -424,32 +427,36 @@
LE.fire()
// Simple helper to face what you clicked on, in case it should be needed in more than one place
/mob/proc/face_atom(atom/A)
if( buckled || stat != CONSCIOUS || !A || !x || !y || !A.x || !A.y )
/mob/proc/face_atom(atom/A, ismousemovement = FALSE)
if( buckled || stat != CONSCIOUS || !loc || !A || !A.x || !A.y )
return
var/dx = A.x - x
var/dy = A.y - y
var/atom/L = loc
if(L.flags_1 & BLOCK_FACE_ATOM_1)
return
var/turf/T = get_turf(src)
var/dx = A.x - T.x
var/dy = A.y - T.y
if(!dx && !dy) // Wall items are graphically shifted but on the floor
if(A.pixel_y > 16)
setDir(NORTH)
setDir(NORTH, ismousemovement)
else if(A.pixel_y < -16)
setDir(SOUTH)
setDir(SOUTH, ismousemovement)
else if(A.pixel_x > 16)
setDir(EAST)
setDir(EAST, ismousemovement)
else if(A.pixel_x < -16)
setDir(WEST)
setDir(WEST, ismousemovement)
return
if(abs(dx) < abs(dy))
if(dy > 0)
setDir(NORTH)
setDir(NORTH, ismousemovement)
else
setDir(SOUTH)
setDir(SOUTH, ismousemovement)
else
if(dx > 0)
setDir(EAST)
setDir(EAST, ismousemovement)
else
setDir(WEST)
setDir(WEST, ismousemovement)
//debug
/obj/screen/proc/scale_to(x1,y1)
+2 -24
View File
@@ -24,16 +24,6 @@
return
/client
var/list/atom/selected_target[2]
var/obj/item/active_mousedown_item = null
var/mouseParams = ""
var/mouseLocation = null
var/mouseObject = null
var/mouseControlObject = null
var/middragtime = 0
var/atom/middragatom
/client/MouseDown(object, location, control, params)
if (mouse_down_icon)
mouse_pointer_icon = mouse_down_icon
@@ -84,12 +74,6 @@
/obj/item/proc/onMouseUp(object, location, params, mob)
return
/obj/item
var/canMouseDown = FALSE
/obj/item/gun
var/automatic = 0 //can gun use it, 0 is no, anything above 0 is the delay between clicks in ds
/obj/item/gun/CanItemAutoclick(object, location, params)
. = automatic
@@ -108,16 +92,10 @@
mouseLocation = location
mouseObject = object
mouseControlObject = control
if(mob && LAZYLEN(mob.mousemove_intercept_objects))
for(var/datum/D in mob.mousemove_intercept_objects)
D.onMouseMove(object, location, control, params)
if(!show_popup_menus && mob) //CIT CHANGE - passes onmousemove() to mobs
mob.onMouseMove(object, location, control, params) //CIT CHANGE - ditto
if(mob)
SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_MOUSEMOVE, object, location, control, params)
..()
/datum/proc/onMouseMove(object, location, control, params)
return
/client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params)
var/list/L = params2list(params)
if (L["middle"])
+1 -4
View File
@@ -242,7 +242,7 @@ If you're feeling frisky, examine yourself and click the underlined item to pull
/obj/screen/alert/embeddedobject/Click()
if(isliving(usr))
var/mob/living/carbon/human/M = usr
var/mob/living/carbon/M = usr
return M.help_shake_act(M)
/obj/screen/alert/weightless
@@ -642,9 +642,6 @@ so as to remain in compliance with the most up-to-date laws."
mymob.client.screen |= alert
return 1
/mob
var/list/alerts = list() // contains /obj/screen/alert only // On /mob so clientless mobs will throw alerts properly
/obj/screen/alert/Click(location, control, params)
if(!usr || !usr.client)
return
-4
View File
@@ -1,7 +1,3 @@
/mob
var/list/screens = list()
/mob/proc/overlay_fullscreen(category, type, severity)
var/obj/screen/fullscreen/screen = screens[category]
if (!screen || screen.type != type)
-2
View File
@@ -114,8 +114,6 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
return ..()
/mob
var/hud_type = /datum/hud
/mob/proc/create_mob_hud()
if(!client || hud_used)
+2 -9
View File
@@ -241,18 +241,11 @@
using.hud = src
hotkeybuttons += using
//CIT CHANGES - rest and combat mode buttons
using = new /obj/screen/restbutton()
using.icon = tg_ui_icon_to_cit_ui(ui_style)
using = new /obj/screen/rest()
using.icon = ui_style
using.screen_loc = ui_pull_resist
using.hud = src
static_inventory += using
using = new /obj/screen/combattoggle()
using.icon = tg_ui_icon_to_cit_ui(ui_style)
using.screen_loc = ui_combat_toggle
using.hud = src
static_inventory += using
//END OF CIT CHANGES
using = new /obj/screen/human/toggle()
-12
View File
@@ -1,16 +1,4 @@
/client
var/list/parallax_layers
var/list/parallax_layers_cached
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
/datum/hud/proc/create_parallax(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
+77 -4
View File
@@ -24,6 +24,10 @@
blend_mode = BLEND_MULTIPLY
alpha = 255
/obj/screen/plane_master/openspace/Initialize()
. = ..()
filters += filter(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE)
/obj/screen/plane_master/openspace/backdrop(mob/mymob)
filters = list()
filters += filter(type = "drop_shadow", color = "#04080FAA", size = -10)
@@ -46,6 +50,32 @@
appearance_flags = PLANE_MASTER
blend_mode = BLEND_OVERLAY
/obj/screen/plane_master/wall
name = "wall plane master"
plane = WALL_PLANE
appearance_flags = PLANE_MASTER
/obj/screen/plane_master/wall/backdrop(mob/mymob)
if(mymob?.client?.prefs.ambientocclusion)
add_filter("ambient_occlusion", 0, AMBIENT_OCCLUSION(4, "#04080FAA"))
else
remove_filter("ambient_occlusion")
/obj/screen/plane_master/above_wall
name = "above wall plane master"
plane = ABOVE_WALL_PLANE
appearance_flags = PLANE_MASTER
/obj/screen/plane_master/above_wall/Initialize()
. = ..()
add_filter("vision_cone", 100, list(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE))
/obj/screen/plane_master/above_wall/backdrop(mob/mymob)
if(mymob?.client?.prefs.ambientocclusion)
add_filter("ambient_occlusion", 0, AMBIENT_OCCLUSION(3, "#04080F64"))
else
remove_filter("ambient_occlusion")
///Contains most things in the game world
/obj/screen/plane_master/game_world
name = "game world plane master"
@@ -53,12 +83,50 @@
appearance_flags = PLANE_MASTER //should use client color
blend_mode = BLEND_OVERLAY
/obj/screen/plane_master/game_world/Initialize()
. = ..()
add_filter("vision_cone", 100, list(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE))
/obj/screen/plane_master/game_world/backdrop(mob/mymob)
if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client.prefs.ambientocclusion)
add_filter("ambient_occlusion", 0, AMBIENT_OCCLUSION)
if(mymob?.client?.prefs.ambientocclusion)
add_filter("ambient_occlusion", 0, AMBIENT_OCCLUSION(4, "#04080FAA"))
else
remove_filter("ambient_occlusion")
update_filters()
//Reserved to chat messages, so they are still displayed above the field of vision masking.
/obj/screen/plane_master/chat_messages
name = "chat messages plane master"
plane = CHAT_PLANE
appearance_flags = PLANE_MASTER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
///Contains all shadow cone masks, whose image overrides are displayed only to their respective owners.
/obj/screen/plane_master/field_of_vision
name = "field of vision mask plane master"
plane = FIELD_OF_VISION_PLANE
render_target = FIELD_OF_VISION_RENDER_TARGET
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/screen/plane_master/field_of_vision/Initialize()
. = ..()
filters += filter(type="alpha", render_source=FIELD_OF_VISION_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE)
///Used to display the owner and its adjacent surroundings through the FoV plane mask.
/obj/screen/plane_master/field_of_vision_blocker
name = "field of vision blocker plane master"
plane = FIELD_OF_VISION_BLOCKER_PLANE
render_target = FIELD_OF_VISION_BLOCKER_RENDER_TARGET
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
///Stores the visible portion of the FoV shadow cone.
/obj/screen/plane_master/field_of_vision_visual
name = "field of vision visual plane master"
plane = FIELD_OF_VISION_VISUAL_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/screen/plane_master/field_of_vision_visual/Initialize()
. = ..()
filters += filter(type="alpha", render_source=FIELD_OF_VISION_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE)
///Contains all lighting objects
/obj/screen/plane_master/lighting
@@ -87,11 +155,12 @@
/obj/screen/plane_master/emissive/Initialize()
. = ..()
filters += filter(type="alpha", render_source=EMISSIVE_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE)
filters += filter(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE)
/**
* Things placed on this always mask the lighting plane. Doesn't render directly.
*
* Always masks the light plane, isn't blocked by anything. Use for on mob glows,
* Always masks the light plane, isn't blocked by anything (except Field of Vision). Use for on mob glows,
* magic stuff, etc.
*/
@@ -101,6 +170,10 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_target = EMISSIVE_UNBLOCKABLE_RENDER_TARGET
/obj/screen/plane_master/emissive_unblockable/Initialize()
. = ..()
filters += filter(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE)
/**
* Things placed on this layer mask the emissive layer. Doesn't render directly
*
+1
View File
@@ -238,6 +238,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
var/mutable_appearance/MA = new /mutable_appearance(E)
if(MA)
MA.layer = ABOVE_HUD_LAYER
MA.plane = ABOVE_HUD_PLANE
MA.appearance_flags |= RESET_TRANSFORM
return MA
+1 -1
View File
@@ -153,7 +153,7 @@
var/image/item_overlay = image(holding)
item_overlay.alpha = 92
if(!user.can_equip(holding, slot_id, TRUE))
if(!user.can_equip(holding, slot_id, TRUE, TRUE, TRUE))
item_overlay.color = "#FF0000"
else
item_overlay.color = "#00ff00"
+58 -9
View File
@@ -54,13 +54,18 @@
/obj/screen/storage/volumetric_box
icon_state = "stored_continue"
layer = VOLUMETRIC_STORAGE_BOX_LAYER
plane = VOLUMETRIC_STORAGE_BOX_PLANE
var/obj/item/our_item
/obj/screen/storage/volumetric_box/Initialize(mapload, new_master, our_item)
/obj/screen/storage/volumetric_box/Initialize(mapload, new_master, obj/item/our_item)
src.our_item = our_item
RegisterSignal(our_item, COMSIG_ITEM_MOUSE_ENTER, .proc/on_item_mouse_enter)
RegisterSignal(our_item, COMSIG_ITEM_MOUSE_EXIT, .proc/on_item_mouse_exit)
return ..()
/obj/screen/storage/volumetric_box/Destroy()
makeItemInactive()
our_item = null
return ..()
@@ -70,10 +75,34 @@
/obj/screen/storage/volumetric_box/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
return our_item.MouseDrop(over, src_location, over_location, src_control, over_control, params)
/obj/screen/storage/volumetric_box/MouseExited(location, control, params)
makeItemInactive()
/obj/screen/storage/volumetric_box/MouseEntered(location, control, params)
makeItemActive()
/obj/screen/storage/volumetric_box/proc/on_item_mouse_enter()
makeItemActive()
/obj/screen/storage/volumetric_box/proc/on_item_mouse_exit()
makeItemInactive()
/obj/screen/storage/volumetric_box/proc/makeItemInactive()
if(!our_item)
return
our_item.layer = VOLUMETRIC_STORAGE_ITEM_LAYER
our_item.plane = VOLUMETRIC_STORAGE_ITEM_PLANE
/obj/screen/storage/volumetric_box/proc/makeItemActive()
if(!our_item)
return
our_item.layer = VOLUMETRIC_STORAGE_ACTIVE_ITEM_LAYER //make sure we display infront of the others!
our_item.plane = VOLUMETRIC_STORAGE_ACTIVE_ITEM_PLANE
/obj/screen/storage/volumetric_box/center
icon_state = "stored_continue"
var/obj/screen/storage/stored_left/left
var/obj/screen/storage/stored_right/right
var/obj/screen/storage/volumetric_edge/stored_left/left
var/obj/screen/storage/volumetric_edge/stored_right/right
var/pixel_size
/obj/screen/storage/volumetric_box/center/Initialize(mapload, new_master, our_item)
@@ -87,7 +116,7 @@
return ..()
/obj/screen/storage/volumetric_box/center/proc/on_screen_objects()
return list(src, left, right)
return list(src)
/**
* Sets the size of this box screen object and regenerates its left/right borders. This includes the actual border's size!
@@ -96,18 +125,38 @@
if(pixel_size == pixels)
return
pixel_size = pixels
cut_overlays()
cut_overlays(TRUE)
//our icon size is 32 pixels.
transform = matrix((pixels - (VOLUMETRIC_STORAGE_BOX_BORDER_SIZE * 2)) / VOLUMETRIC_STORAGE_BOX_ICON_SIZE, 0, 0, 0, 1, 0)
left.pixel_x = -((pixels - VOLUMETRIC_STORAGE_BOX_ICON_SIZE) * 0.5) - VOLUMETRIC_STORAGE_BOX_BORDER_SIZE
right.pixel_x = ((pixels - VOLUMETRIC_STORAGE_BOX_ICON_SIZE) * 0.5) + VOLUMETRIC_STORAGE_BOX_BORDER_SIZE
add_overlay(left)
add_overlay(right)
add_overlay(left, TRUE)
add_overlay(right, TRUE)
/obj/screen/storage/stored_left
/obj/screen/storage/volumetric_edge
layer = VOLUMETRIC_STORAGE_BOX_LAYER
plane = VOLUMETRIC_STORAGE_BOX_PLANE
/obj/screen/storage/volumetric_edge/Initialize(mapload, master, our_item)
src.master = master
return ..()
/obj/screen/storage/volumetric_edge/Click(location, control, params)
return master.Click(location, control, params)
/obj/screen/storage/volumetric_edge/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
return master.MouseDrop(over, src_location, over_location, src_control, over_control, params)
/obj/screen/storage/volumetric_edge/MouseExited(location, control, params)
return master.MouseExited(location, control, params)
/obj/screen/storage/volumetric_edge/MouseEntered(location, control, params)
return master.MouseEntered(location, control, params)
/obj/screen/storage/volumetric_edge/stored_left
icon_state = "stored_start"
appearance_flags = APPEARANCE_UI | KEEP_APART | RESET_TRANSFORM // Yes I know RESET_TRANSFORM is in APPEARANCE_UI but we're hard-asserting this incase someone changes it.
/obj/screen/storage/stored_right
/obj/screen/storage/volumetric_edge/stored_right
icon_state = "stored_end"
appearance_flags = APPEARANCE_UI | KEEP_APART | RESET_TRANSFORM
+85 -58
View File
@@ -7,21 +7,17 @@
*and lastly
*afterattack. The return value does not matter.
*/
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params, flags, damage_multiplier = 1)
if(isliving(user))
var/mob/living/L = user
if(item_flags & NO_ATTACK_CHAIN_SOFT_STAMCRIT)
if(IS_STAMCRIT(L))
to_chat(L, "<span class='warning'>You are too exhausted to swing [src]!</span>")
return
if(!CHECK_MOBILITY(L, MOBILITY_USE))
if(!CHECK_MOBILITY(L, MOBILITY_USE) && !(flags & ATTACKCHAIN_PARRY_COUNTERATTACK))
to_chat(L, "<span class='warning'>You are unable to swing [src] right now!</span>")
return
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
return
if(pre_attack(target, user, params))
return
if(target.attackby(src,user, params))
if(target.attackby(src, user, params, flags, damage_multiplier))
return
if(QDELETED(src) || QDELETED(target))
return
@@ -56,23 +52,20 @@
/obj/attackby(obj/item/I, mob/living/user, params)
return ..() || ((obj_flags & CAN_BE_HIT) && I.attack_obj(src, user))
/mob/living/attackby(obj/item/I, mob/living/user, params)
/mob/living/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier)
if(..())
return TRUE
user.changeNext_move(CLICK_CD_MELEE)
return I.attack(src, user)
I.attack_delay_done = FALSE //Should be set TRUE in pre_attacked_by()
. = I.attack(src, user, attackchain_flags, damage_multiplier)
if(!I.attack_delay_done) //Otherwise, pre_attacked_by() should handle it.
user.changeNext_move(I.click_delay)
/obj/item/proc/attack(mob/living/M, mob/living/user)
/obj/item/proc/attack(mob/living/M, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, M, user) & COMPONENT_ITEM_NO_ATTACK)
return
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user)
if(item_flags & NOBLUDGEON)
return
if(IS_STAMCRIT(user)) // CIT CHANGE - makes it impossible to attack in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted.</span>") // CIT CHANGE - ditto
return // CIT CHANGE - ditto
if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, "<span class='warning'>You don't want to harm other living beings!</span>")
return
@@ -86,12 +79,14 @@
M.lastattackerckey = user.ckey
user.do_attack_animation(M)
M.attacked_by(src, user)
M.attacked_by(src, user, attackchain_flags, damage_multiplier)
log_combat(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
add_fingerprint(user)
user.adjustStaminaLossBuffered(getweight(user, STAM_COST_ATTACK_MOB_MULT))//CIT CHANGE - makes attacking things cause stamina loss
var/weight = getweight(user, STAM_COST_ATTACK_MOB_MULT) //CIT CHANGE - makes attacking things cause stamina loss
if(weight)
user.adjustStaminaLossBuffered(weight)
//the equivalent of the standard version of attack() but for object targets.
/obj/item/proc/attack_obj(obj/O, mob/living/user)
@@ -99,41 +94,53 @@
return
if(item_flags & NOBLUDGEON)
return
if(IS_STAMCRIT(user)) // CIT CHANGE - makes it impossible to attack in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted.</span>") // CIT CHANGE - ditto
return // CIT CHANGE - ditto
user.adjustStaminaLossBuffered(getweight(user, STAM_COST_ATTACK_OBJ_MULT))//CIT CHANGE - makes attacking things cause stamina loss
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(O)
O.attacked_by(src, user)
if(!O.attacked_by(src, user))
user.changeNext_move(click_delay)
var/weight = getweight(user, STAM_COST_ATTACK_OBJ_MULT)
if(weight)
user.adjustStaminaLossBuffered(weight)//CIT CHANGE - makes attacking things cause stamina loss
/atom/movable/proc/attacked_by()
return
/obj/attacked_by(obj/item/I, mob/living/user)
var/totitemdamage = I.force
var/bad_flag = NONE
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && iscarbon(user))
totitemdamage *= 0.5
bad_flag |= SKILL_COMBAT_MODE //blacklist combat skills.
/obj/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
var/totitemdamage = I.force * damage_multiplier
var/bad_trait
var/stamloss = user.getStaminaLoss()
var/next_move_mult = 1
if(stamloss > STAMINA_NEAR_SOFTCRIT) //The more tired you are, the less damage you do.
var/penalty = (stamloss - STAMINA_NEAR_SOFTCRIT)/(STAMINA_NEAR_CRIT - STAMINA_NEAR_SOFTCRIT)*STAM_CRIT_ITEM_ATTACK_PENALTY
totitemdamage *= 1 - penalty
next_move_mult += penalty*STAM_CRIT_ITEM_ATTACK_DELAY
user.changeNext_move(I.click_delay*next_move_mult)
if(SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
bad_trait = SKILL_COMBAT_MODE //blacklist combat skills.
if(I.used_skills && user.mind)
if(totitemdamage)
totitemdamage = user.mind.skill_holder.item_action_skills_mod(I, totitemdamage, I.skill_difficulty, SKILL_ATTACK_OBJ, bad_flag)
totitemdamage = user.mind.item_action_skills_mod(I, totitemdamage, I.skill_difficulty, SKILL_ATTACK_OBJ, bad_trait)
for(var/skill in I.used_skills)
if(!(I.used_skills[skill] & SKILL_TRAIN_ATTACK_OBJ))
if(!(SKILL_TRAIN_ATTACK_OBJ in I.used_skills[skill]))
continue
user.mind.skill_holder.auto_gain_experience(skill, I.skill_gain)
user.mind.auto_gain_experience(skill, I.skill_gain)
if(totitemdamage)
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.
log_combat(user, src, "attacked", I)
take_damage(totitemdamage, I.damtype, "melee", 1)
return TRUE
/mob/living/attacked_by(obj/item/I, mob/living/user)
var/totitemdamage = pre_attacked_by(I, user)
if((user != src) && mob_run_block(I, totitemdamage, "the [I.name]", ATTACK_TYPE_MELEE, I.armour_penetration, user, null, null) & BLOCK_SUCCESS)
/mob/living/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
var/list/block_return = list()
var/totitemdamage = pre_attacked_by(I, user) * damage_multiplier
if((user != src) && mob_run_block(I, totitemdamage, "the [I.name]", ((attackchain_flags & ATTACKCHAIN_PARRY_COUNTERATTACK)? ATTACK_TYPE_PARRY_COUNTERATTACK : NONE) | ATTACK_TYPE_MELEE, I.armour_penetration, user, null, block_return) & BLOCK_SUCCESS)
return FALSE
send_item_attack_message(I, user)
totitemdamage = block_calculate_resultant_damage(totitemdamage, block_return)
send_item_attack_message(I, user, null, totitemdamage)
I.do_stagger_action(src, user, totitemdamage)
if(I.force)
apply_damage(totitemdamage, I.damtype)
@@ -146,33 +153,49 @@
user.add_mob_blood(src)
return TRUE //successful attack
/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user)
/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
if(I.force < force_threshold || I.damtype == STAMINA)
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), 1, -1)
user.changeNext_move(I.click_delay) //pre_attacked_by not called
else
return ..()
/mob/living/proc/pre_attacked_by(obj/item/I, mob/living/user)
. = I.force
var/bad_flag = NONE
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && iscarbon(user))
. *= 0.5
bad_flag |= SKILL_COMBAT_MODE //blacklist combat skills.
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
. *= 0.5
if(!.)
return
var/stamloss = user.getStaminaLoss()
var/stam_mobility_mult = 1
var/next_move_mult = 1
if(stamloss > STAMINA_NEAR_SOFTCRIT) //The more tired you are, the less damage you do.
var/penalty = (stamloss - STAMINA_NEAR_SOFTCRIT)/(STAMINA_NEAR_CRIT - STAMINA_NEAR_SOFTCRIT)*STAM_CRIT_ITEM_ATTACK_PENALTY
stam_mobility_mult -= penalty
next_move_mult += penalty*STAM_CRIT_ITEM_ATTACK_DELAY
if(stam_mobility_mult > LYING_DAMAGE_PENALTY && !CHECK_MOBILITY(user, MOBILITY_STAND)) //damage penalty for fighting prone, doesn't stack with the above.
stam_mobility_mult = LYING_DAMAGE_PENALTY
. *= stam_mobility_mult
user.changeNext_move(I.click_delay*next_move_mult)
I.attack_delay_done = TRUE
var/bad_trait
if(!(I.item_flags & NO_COMBAT_MODE_FORCE_MODIFIER))
if(SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
bad_trait = SKILL_COMBAT_MODE //blacklist combat skills.
if(SEND_SIGNAL(src, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))
. *= 0.5
else if(SEND_SIGNAL(src, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
. *= 1.5
if(!user.mind || !I.used_skills)
return
if(.)
. = user.mind.skill_holder.item_action_skills_mod(I, ., I.skill_difficulty, SKILL_ATTACK_MOB, bad_flag)
. = user.mind.item_action_skills_mod(I, ., I.skill_difficulty, SKILL_ATTACK_MOB, bad_trait)
for(var/skill in I.used_skills)
if(!(I.used_skills[skill] & SKILL_TRAIN_ATTACK_MOB))
if(!(SKILL_TRAIN_ATTACK_MOB in I.used_skills[skill]))
continue
user.mind.skill_holder.auto_gain_experience(skill, I.skill_gain)
/mob/living/carbon/pre_attacked_by(obj/item/I, mob/living/user)
. = ..()
if(!(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
. *= 1.5
var/datum/skill/S = GLOB.skill_datums[skill]
user.mind.auto_gain_experience(skill, I.skill_gain*S.item_skill_gain_multi)
// 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.
@@ -187,10 +210,12 @@
else
return clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area, current_force)
var/message_verb = "attacked"
if(I.attack_verb && I.attack_verb.len)
message_verb = "[pick(I.attack_verb)]"
if(current_force < I.force * FEEBLE_ATTACK_MSG_THRESHOLD)
message_verb = "[pick("feebly", "limply", "saplessly")] [message_verb]"
else if(!I.force)
return
var/message_hit_area = ""
@@ -207,16 +232,18 @@
return 1
/// How much stamina this takes to swing this is not for realism purposes hecc off.
/obj/item/proc/getweight(mob/living/user, multiplier = 1, flags = SKILL_STAMINA_COST)
/obj/item/proc/getweight(mob/living/user, multiplier = 1, trait = SKILL_STAMINA_COST)
. = (total_mass || w_class * STAM_COST_W_CLASS_MULT) * multiplier
if(!user)
return
var/bad_flag = NONE
if(iscarbon(user) && !(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
var/bad_trait
if(SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
. *= STAM_COST_NO_COMBAT_MULT
bad_flag |= SKILL_COMBAT_MODE
bad_trait = SKILL_COMBAT_MODE
if(used_skills && user.mind)
. = user.mind.skill_holder.item_action_skills_mod(src, ., skill_difficulty, flags, bad_flag, FALSE)
. = user.mind.item_action_skills_mod(src, ., skill_difficulty, trait, bad_trait, FALSE)
var/total_health = user.getStaminaLoss()
. = clamp(., 0, STAMINA_NEAR_CRIT - total_health)
/// How long this staggers for. 0 and negatives supported.
/obj/item/proc/melee_stagger_duration(force_override)
+1 -1
View File
@@ -108,7 +108,7 @@
A.attack_animal(src)
/atom/proc/attack_animal(mob/user)
return
SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_ANIMAL, user)
/mob/living/RestrainedClickOn(atom/A)
return
+1 -2
View File
@@ -102,9 +102,8 @@
//stops TK grabs being equipped anywhere but into hands
/obj/item/tk_grab/equipped(mob/user, slot)
if(slot == SLOT_HANDS)
return
return ..()
qdel(src)
return
/obj/item/tk_grab/examine(user)
if (focus)
@@ -104,7 +104,9 @@
var/list/lines = world.file2list("[directory]/[filename]")
var/list/_entries = entries
var/list/postload_required = list()
var/linenumber = 0
for(var/L in lines)
linenumber++
L = trim(L)
if(!L)
continue
@@ -132,7 +134,7 @@
if(entry == "$include")
if(!value)
log_config("Warning: Invalid $include directive: [value]")
log_config("LINE [linenumber]: Invalid $include directive: [value]")
else
LoadEntries(value, stack)
++.
@@ -140,7 +142,7 @@
var/datum/config_entry/E = _entries[entry]
if(!E)
log_config("Unknown setting in configuration: '[entry]'")
log_config("LINE [linenumber]: Unknown setting: '[entry]'")
continue
if(lockthis)
@@ -150,7 +152,7 @@
var/datum/config_entry/new_ver = entries_by_type[E.deprecated_by]
var/new_value = E.DeprecationUpdate(value)
var/good_update = istext(new_value)
log_config("Entry [entry] is deprecated and will be removed soon. Migrate to [new_ver.name]![good_update ? " Suggested new value is: [new_value]" : ""]")
log_config("LINE [linenumber]: [entry] is deprecated and will be removed soon. Migrate to [new_ver.name]![good_update ? " Suggested new value is: [new_value]" : ""]")
if(!warned_deprecated_configs)
addtimer(CALLBACK(GLOBAL_PROC, /proc/message_admins, "This server is using deprecated configuration settings. Please check the logs and update accordingly."), 0)
warned_deprecated_configs = TRUE
@@ -162,10 +164,10 @@
var/validated = E.ValidateAndSet(value, TRUE)
if(!validated)
log_config("Failed to validate setting \"[value]\" for [entry]")
log_config("LINE [linenumber]: Failed to validate setting \"[value]\" for [entry]")
else
if(E.modified && !E.dupes_allowed)
log_config("Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
log_config("LINE [linenumber]: Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
if(E.postload_required)
postload_required[E] = TRUE
@@ -25,4 +25,23 @@
/datum/config_entry/string/medal_hub_address
/datum/config_entry/string/medal_hub_password
protection = CONFIG_ENTRY_HIDDEN
protection = CONFIG_ENTRY_HIDDEN
/datum/config_entry/keyed_list/cross_server_bunker_override
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_TEXT
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/keyed_list/cross_server_bunker_override/ValidateAndSet(str_val)
. = ..()
if(.)
var/list/newv = list()
for(var/I in config_entry_value)
newv[replacetext(I, "+", " ")] = config_entry_value[I]
config_entry_value = newv
/datum/config_entry/keyed_list/cross_server_bunker_override/ValidateListEntry(key_name, key_value)
return key_value != "byond:\\address:port" && ..()
/datum/config_entry/flag/allow_cross_server_bunker_override
protection = CONFIG_ENTRY_LOCKED
@@ -168,12 +168,14 @@
/datum/config_entry/flag/join_with_mutant_humans //players can pick mutant bodyparts for humans before joining the game
/datum/config_entry/flag/no_summon_guns //No
/datum/config_entry/flag/no_summon_guns //No
/datum/config_entry/flag/no_summon_magic //Fun
/datum/config_entry/flag/no_summon_events //Allowed
/datum/config_entry/flag/no_summon_traumas //!
/datum/config_entry/flag/no_intercept_report //Whether or not to send a communications intercept report roundstart. This may be overridden by gamemodes.
/datum/config_entry/number/arrivals_shuttle_dock_window //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
@@ -435,6 +437,10 @@
config_entry_value = 64
min_val = 0
/datum/config_entry/number/ratcap
config_entry_value = 64
min_val = 0
/datum/config_entry/flag/disable_stambuffer
/datum/config_entry/keyed_list/box_random_engine
@@ -507,3 +513,20 @@
//Allows players to set a hexadecimal color of their choice as skin tone, on top of the standard ones.
/datum/config_entry/flag/allow_custom_skintones
///Initial loadout points
/datum/config_entry/number/initial_gear_points
config_entry_value = 10
/**
* Enables the FoV component, which hides objects and mobs behind the parent from their sight, unless they turn around, duh.
* Camera mobs, AIs, ghosts and some other are of course exempt from this. This also doesn't influence simplemob AI, for the best.
*/
/datum/config_entry/flag/use_field_of_vision
//Shuttle size limiter
/datum/config_entry/number/max_shuttle_count
config_entry_value = 6
/datum/config_entry/number/max_shuttle_size
config_entry_value = 250
+2
View File
@@ -81,6 +81,8 @@ SUBSYSTEM_DEF(air)
var/list/pipenet_rebuilds = pipenets_needing_rebuilt
for(var/thing in pipenet_rebuilds)
var/obj/machinery/atmospherics/AT = thing
if(!istype(AT))
continue
AT.build_network()
cost_rebuilds = MC_AVERAGE(cost_rebuilds, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
pipenets_needing_rebuilt.Cut()
+1 -11
View File
@@ -6,17 +6,7 @@ SUBSYSTEM_DEF(assets)
var/list/preload = list()
/datum/controller/subsystem/assets/Initialize(timeofday)
var/list/priority_assets = list(
/datum/asset/simple/oui_theme_nano,
/datum/asset/simple/goonchat
)
for(var/type in priority_assets)
var/datum/asset/A = new type()
A.register()
for(var/type in typesof(/datum/asset) - (priority_assets | list(/datum/asset, /datum/asset/simple)))
for(var/type in typesof(/datum/asset))
var/datum/asset/A = type
if (type != initial(A._abstract))
get_asset_datum(type)
+2 -1
View File
@@ -12,7 +12,7 @@ SUBSYSTEM_DEF(events)
var/frequency_upper = 6000 //10 minutes upper bound. Basically an event will happen every 3 to 10 minutes.
var/list/holidays //List of all holidays occuring today or null if no holidays
var/wizardmode = 0
var/wizardmode = FALSE
/datum/controller/subsystem/events/Initialize(time, zlevel)
for(var/type in typesof(/datum/round_event_control))
@@ -91,6 +91,7 @@ SUBSYSTEM_DEF(events)
if(. == EVENT_CANT_RUN)//we couldn't run this event for some reason, set its max_occurrences to 0
E.max_occurrences = 0
else if(. == EVENT_READY)
E.random = TRUE
E.runEvent(TRUE)
//allows a client to trigger an event
+15
View File
@@ -451,3 +451,18 @@ SUBSYSTEM_DEF(garbage)
#endif
#endif
#ifdef TESTING
/proc/writeDatumCount()
var/list/datums = list()
for(var/datum/D in world)
datums[D.type] += 1
for(var/datum/D)
datums[D.type] += 1
datums = sortTim(datums, /proc/cmp_numeric_dsc, associative = TRUE)
if(fexists("data/DATUMCOUNT.txt"))
fdel("data/DATUMCOUNT.txt")
var/outfile = file("data/DATUMCOUNT.txt")
for(var/path in datums)
outfile << "[datums[path]]\t\t\t\t\t[path]"
#endif
+89 -84
View File
@@ -6,13 +6,20 @@ SUBSYSTEM_DEF(input)
priority = FIRE_PRIORITY_INPUT
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
var/list/macro_sets
var/list/movement_keys
/// Classic mode input focused macro set. Manually set because we can't define ANY or ANY+UP for classic.
var/static/list/macroset_classic_input
/// Classic mode map focused macro set. Manually set because it needs to be clientside and go to macroset_classic_input.
var/static/list/macroset_classic_hotkey
/// New hotkey mode macro set. All input goes into map, game keeps incessently setting your focus to map, we can use ANY all we want here; we don't care about the input bar, the user has to force the input bar every time they want to type.
var/static/list/macroset_hotkey
/// Macro set for hotkeys
var/list/hotkey_mode_macros
/// Macro set for classic.
var/list/input_mode_macros
/datum/controller/subsystem/input/Initialize()
setup_default_macro_sets()
setup_default_movement_keys()
setup_macrosets()
initialized = TRUE
@@ -20,90 +27,82 @@ SUBSYSTEM_DEF(input)
return ..()
// This is for when macro sets are eventualy datumized
/datum/controller/subsystem/input/proc/setup_default_macro_sets()
var/list/static/default_macro_sets
if(default_macro_sets)
macro_sets = default_macro_sets
return
default_macro_sets = list(
"default" = list(
"Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"O" = "ooc",
"Ctrl+O" = "looc",
"T" = "say",
"Ctrl+T" = "whisper",
"M" = "me",
"Ctrl+M" = "subtle",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
),
"old_default" = list(
"Tab" = "\".winset \\\"mainwindow.macro=old_hotkeys map.focus=true input.background-color=[COLOR_INPUT_DISABLED]\\\"\"",
"Ctrl+T" = "say",
"Ctrl+O" = "ooc",
),
"old_hotkeys" = list(
"Tab" = "\".winset \\\"mainwindow.macro=old_default input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"O" = "ooc",
"L" = "looc",
"T" = "say",
"M" = "me",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
),
)
// Because i'm lazy and don't want to type all these out twice
var/list/old_default = default_macro_sets["old_default"]
var/list/static/oldmode_keys = list(
/// Sets up the key list for classic mode for when badmins screw up vv's.
/datum/controller/subsystem/input/proc/setup_macrosets()
// First, let's do the snowflake keyset!
macroset_classic_input = list()
var/list/classic_mode_keys = list(
"North", "East", "South", "West",
"Northeast", "Southeast", "Northwest", "Southwest",
"Insert", "Delete", "Ctrl", "Alt",
"Insert", "Delete", "Ctrl", "Alt", "Shift",
"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
)
for(var/i in 1 to oldmode_keys.len)
var/key = oldmode_keys[i]
old_default[key] = "\"KeyDown [key]\""
old_default["[key]+UP"] = "\"KeyUp [key]\""
var/list/static/oldmode_ctrl_override_keys = list(
"W" = "W", "A" = "A", "S" = "S", "D" = "D", // movement
"1" = "1", "2" = "2", "3" = "3", "4" = "4", // intent
"B" = "B", // resist
"E" = "E", // quick equip
"F" = "F", // intent left
"G" = "G", // intent right
"H" = "H", // stop pulling
"Q" = "Q", // drop
"R" = "R", // throw
"X" = "X", // switch hands
"Y" = "Y", // activate item
"Z" = "Z", // activate item
for(var/key in classic_mode_keys)
macroset_classic_input[key] = "\"KeyDown [key]\""
macroset_classic_input["[key]+UP"] = "\"KeyUp [key]\""
// LET'S PLAY THE BIND EVERY KEY GAME!
// oh except for Backspace and Enter; if you want to use those you shouldn't have used oldmode!
var/list/classic_ctrl_override_keys = list(
"\[", "\]", "\\\\", ";", "'", ",", ".", "/", "-", "=", "`"
)
// i'm lazy let's play the list iteration game of numbers
for(var/i in 0 to 9)
classic_ctrl_override_keys += "[i]"
// let's play the ascii game of A to Z (UPPERCASE)
for(var/i in 65 to 90)
classic_ctrl_override_keys += ascii2text(i)
// let's play the game of clientside bind overrides!
classic_ctrl_override_keys -= list("T", "O", "M", "L")
macroset_classic_input["Ctrl+T"] = "say"
macroset_classic_input["Ctrl+O"] = "ooc"
macroset_classic_input["Ctrl+L"] = "looc"
// let's play the list iteration game x2
for(var/key in classic_ctrl_override_keys)
// make sure to double double quote to ensure things are treated as a key combo instead of addition/semicolon logic.
macroset_classic_input["\"Ctrl+[key]\""] = "\"KeyDown [istext(classic_ctrl_override_keys[key])? classic_ctrl_override_keys[key] : key]\""
macroset_classic_input["\"Ctrl+[key]+UP\""] = "\"KeyUp [istext(classic_ctrl_override_keys[key])? classic_ctrl_override_keys[key] : key]\""
// Misc
macroset_classic_input["Tab"] = "\".winset \\\"mainwindow.macro=[SKIN_MACROSET_CLASSIC_HOTKEYS] map.focus=true input.background-color=[COLOR_INPUT_DISABLED]\\\"\""
macroset_classic_input["Escape"] = "\".winset \\\"input.text=\\\"\\\"\\\"\""
// FINALLY, WE CAN DO SOMETHING MORE NORMAL FOR THE SNOWFLAKE-BUT-LESS KEYSET.
// HAHA - SIKE. Because of BYOND weirdness (tl;dr not specifically binding this way results in potentially duplicate chatboxes when
// conflicts occur with something like say indicator vs say), we're going to snowflake this anyways
var/list/hard_binds = list(
"O" = "ooc",
"T" = "say",
"L" = "looc",
"M" = "me"
)
var/list/hard_bind_anti_collision = list()
var/list/anti_collision_modifiers = list("Ctrl", "Alt", "Shift", "Ctrl+Alt", "Ctrl+Shift", "Alt+Shift", "Ctrl+Alt+Shift")
for(var/key in hard_binds)
for(var/modifier in anti_collision_modifiers)
hard_bind_anti_collision["[modifier]+[key]"] = ".NONSENSICAL_VERB_THAT_DOES_NOTHING"
macroset_classic_hotkey = list(
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
"Tab" = "\".winset \\\"mainwindow.macro=[SKIN_MACROSET_CLASSIC_INPUT] input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"Escape" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
)
macroset_classic_hotkey |= hard_binds
macroset_classic_hotkey |= hard_bind_anti_collision
for(var/i in 1 to oldmode_ctrl_override_keys.len)
var/key = oldmode_ctrl_override_keys[i]
var/override = oldmode_ctrl_override_keys[key]
old_default["Ctrl+[key]"] = "\"KeyDown [override]\""
old_default["Ctrl+[key]+UP"] = "\"KeyUp [override]\""
macro_sets = default_macro_sets
// For initially setting up or resetting to default the movement keys
/datum/controller/subsystem/input/proc/setup_default_movement_keys()
var/static/list/default_movement_keys = list(
"W" = NORTH, "A" = WEST, "S" = SOUTH, "D" = EAST, // WASD
"North" = NORTH, "West" = WEST, "South" = SOUTH, "East" = EAST, // Arrow keys & Numpad
)
movement_keys = default_movement_keys.Copy()
// And finally, the modern set.
macroset_hotkey = list(
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
"Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"Escape" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
)
macroset_hotkey |= hard_binds
macroset_hotkey |= hard_bind_anti_collision
// Badmins just wanna have fun ♪
/datum/controller/subsystem/input/proc/refresh_client_macro_sets()
@@ -111,9 +110,15 @@ SUBSYSTEM_DEF(input)
for(var/i in 1 to clients.len)
var/client/user = clients[i]
user.set_macros()
user.update_movement_keys()
/datum/controller/subsystem/input/fire()
var/list/clients = GLOB.clients // Let's sing the list cache song
for(var/i in 1 to length(clients))
for(var/i in 1 to clients.len)
var/client/C = clients[i]
C.keyLoop()
/// *sigh
/client/verb/NONSENSICAL_VERB_THAT_DOES_NOTHING()
set name = ".NONSENSICAL_VERB_THAT_DOES_NOTHING"
set hidden = TRUE
+34 -2
View File
@@ -10,20 +10,52 @@ SUBSYSTEM_DEF(materials)
var/list/materials
///Dictionary of category || list of material refs
var/list/materials_by_category
///Dictionary of category || list of material types, mostly used by rnd machines like autolathes.
var/list/materialtypes_by_category
///A cache of all material combinations that have been used
var/list/list/material_combos
///List of stackcrafting recipes for materials using rigid materials
var/list/rigid_stack_recipes = list(new/datum/stack_recipe("chair", /obj/structure/chair/greyscale, one_per_turf = TRUE, on_floor = TRUE, applies_mats = TRUE))
var/list/rigid_stack_recipes = list(
new /datum/stack_recipe("chair", /obj/structure/chair/greyscale, one_per_turf = TRUE, on_floor = TRUE, applies_mats = TRUE),
new /datum/stack_recipe("toilet", /obj/structure/toilet/greyscale, one_per_turf = TRUE, on_floor = TRUE, applies_mats = TRUE),
new /datum/stack_recipe("sink", /obj/structure/sink/greyscale, one_per_turf = TRUE, on_floor = TRUE, applies_mats = TRUE),
new /datum/stack_recipe("Floor tile", /obj/item/stack/tile/material, 1, 4, 20, applies_mats = TRUE)
)
///Ran on initialize, populated the materials and materials_by_category dictionaries with their appropiate vars (See these variables for more info)
/datum/controller/subsystem/materials/proc/InitializeMaterials()
materials = list()
materials_by_category = list()
materialtypes_by_category = list()
material_combos = list()
for(var/type in subtypesof(/datum/material))
var/datum/material/ref = new type
materials[type] = ref
for(var/c in ref.categories)
materials_by_category[c] += list(ref)
materialtypes_by_category[c] += list(type)
/datum/controller/subsystem/materials/proc/GetMaterialRef(datum/material/fakemat)
if(!materials)
InitializeMaterials()
return materials[fakemat] || fakemat
return materials[fakemat] || fakemat
///Returns a list to be used as an object's custom_materials. Lists will be cached and re-used based on the parameters.
/datum/controller/subsystem/materials/proc/FindOrCreateMaterialCombo(list/materials_declaration, multiplier)
if(!material_combos)
InitializeMaterials()
var/list/combo_params = list()
for(var/x in materials_declaration)
var/datum/material/mat = x
var/path_name = ispath(mat) ? "[mat]" : "[mat.type]"
combo_params += "[path_name]=[materials_declaration[mat] * multiplier]"
sortTim(combo_params, /proc/cmp_text_asc) // We have to sort now in case the declaration was not in order
var/combo_index = combo_params.Join("-")
var/list/combo = material_combos[combo_index]
if(!combo)
combo = list()
for(var/mat in materials_declaration)
combo[GetMaterialRef(mat)] = materials_declaration[mat] * multiplier
material_combos[combo_index] = combo
return combo
+3 -3
View File
@@ -1,8 +1,8 @@
SUBSYSTEM_DEF(minimaps)
name = "Minimaps"
flags = SS_NO_FIRE
var/list/station_minimaps
var/datum/minimap_group/station_minimap
var/list/station_minimaps = list()
var/datum/minimap_group/station_minimap = null
/datum/controller/subsystem/minimaps/Initialize()
if(!CONFIG_GET(flag/minimaps_enabled))
@@ -12,9 +12,9 @@ SUBSYSTEM_DEF(minimaps)
return ..()
/datum/controller/subsystem/minimaps/proc/build_minimaps()
station_minimaps = list()
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
var/datum/space_level/SL = SSmapping.get_level(z)
var/name = (SL.name == initial(SL.name))? "[z] - Station" : "[z] - [SL.name]"
station_minimaps += new /datum/minimap(z, name = name)
station_minimap = new(station_minimaps, "Station")
+1
View File
@@ -8,6 +8,7 @@ SUBSYSTEM_DEF(mobs)
var/static/list/clients_by_zlevel[][]
var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when z2 is created and new_players can login before that.
var/static/list/cubemonkeys = list()
var/static/list/cheeserats = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_living_list.len]")

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