@@ -30,11 +30,17 @@
|
||||
#define R_POSSESS 64
|
||||
#define R_PERMISSIONS 128
|
||||
#define R_STEALTH 256
|
||||
#define R_REJUVINATE 512
|
||||
#define R_POLL 512
|
||||
#define R_VAREDIT 1024
|
||||
#define R_SOUNDS 2048
|
||||
#define R_SPAWN 4096
|
||||
|
||||
#if DM_VERSION > 512
|
||||
#error Remove the flag below , its been long enough
|
||||
#endif
|
||||
//legacy , remove post 512, it was replaced by R_POLL
|
||||
#define R_REJUVINATE 2
|
||||
|
||||
#define R_MAXPERMISSION 4096 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
|
||||
|
||||
#define ADMIN_QUE(user) "(<a href='?_src_=holder;adminmoreinfo=\ref[user]'>?</a>)"
|
||||
@@ -65,4 +71,4 @@
|
||||
|
||||
#define AHELP_ACTIVE 1
|
||||
#define AHELP_CLOSED 2
|
||||
#define AHELP_RESOLVED 3
|
||||
#define AHELP_RESOLVED 3
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
#define ANTAG_DATUM_NINJA_RANDOM /datum/antagonist/ninja/randomAllegiance/
|
||||
#define ANTAG_DATUM_TRAITOR /datum/antagonist/traitor
|
||||
#define ANTAG_DATUM_TRAITOR_CUSTOM /datum/antagonist/traitor/custom
|
||||
#define ANTAG_DATUM_IAA /datum/antagonist/traitor/internal_affairs
|
||||
#define ANTAG_DATUM_TRAITOR /datum/antagonist/traitor
|
||||
#define ANTAG_DATUM_TRAITOR_CUSTOM /datum/antagonist/traitor/custom
|
||||
#define ANTAG_DATUM_TRAITOR_HUMAN /datum/antagonist/traitor/human
|
||||
#define ANTAG_DATUM_TRAITOR_HUMAN_CUSTOM /datum/antagonist/traitor/human/custom
|
||||
#define ANTAG_DATUM_TRAITOR_AI /datum/antagonist/traitor/AI
|
||||
@@ -20,4 +17,4 @@
|
||||
#define ANTAG_DATUM_IAA_HUMAN /datum/antagonist/traitor/human/internal_affairs
|
||||
#define ANTAG_DATUM_IAA_HUMAN_CUSTOM /datum/antagonist/traitor/human/internal_affairs/custom
|
||||
#define ANTAG_DATUM_IAA_AI_CUSTOM /datum/antagonist/traitor/AI/internal_affairs/custom
|
||||
#define ANTAG_DATUM_IAA_AI /datum/antagonist/traitor/AI/internal_affairs
|
||||
#define ANTAG_DATUM_IAA_AI /datum/antagonist/traitor/AI/internal_affairs
|
||||
|
||||
+174
-173
@@ -1,175 +1,176 @@
|
||||
#define FIRE_DAMAGE_MODIFIER 0.0215 //Higher values result in more external fire damage to the skin (default 0.0215)
|
||||
#define AIR_DAMAGE_MODIFIER 2.025 //More means less damage from hot air scalding lungs, less = more damage. (default 2.025)
|
||||
|
||||
#define MOLES_CELLSTANDARD (ONE_ATMOSPHERE*CELL_VOLUME/(T20C*R_IDEAL_GAS_EQUATION)) //moles in a 2.5 m^3 cell at 101.325 Pa and 20 degC
|
||||
#define M_CELL_WITH_RATIO (MOLES_CELLSTANDARD * 0.005)
|
||||
#define O2STANDARD 0.21
|
||||
#define N2STANDARD 0.79
|
||||
#define MOLES_O2STANDARD (MOLES_CELLSTANDARD*O2STANDARD) // O2 standard value (21%)
|
||||
#define MOLES_N2STANDARD (MOLES_CELLSTANDARD*N2STANDARD) // N2 standard value (79%)
|
||||
|
||||
//indices of values in gas lists. used by listmos.
|
||||
#define MOLES 1
|
||||
#define ARCHIVE 2
|
||||
#define GAS_META 3
|
||||
#define META_GAS_SPECIFIC_HEAT 1
|
||||
#define META_GAS_NAME 2
|
||||
#define META_GAS_MOLES_VISIBLE 3
|
||||
#define META_GAS_OVERLAY 4
|
||||
#define META_GAS_DANGER 5
|
||||
|
||||
//stuff you should probably leave well alone!
|
||||
//ATMOS
|
||||
#define CELL_VOLUME 2500 //liters in a cell
|
||||
#define BREATH_VOLUME 0.5 //liters in a normal breath
|
||||
#define BREATH_PERCENTAGE (BREATH_VOLUME/CELL_VOLUME) //Amount of air to take a from a tile
|
||||
#define HUMAN_NEEDED_OXYGEN (MOLES_CELLSTANDARD*BREATH_PERCENTAGE*0.16) //Amount of air needed before pass out/suffocation commences
|
||||
#define NORMPIPERATE 30 //pipe-insulation rate divisor
|
||||
#define HEATPIPERATE 8 //heat-exch pipe insulation
|
||||
#define FLOWFRAC 0.99 //fraction of gas transfered per process
|
||||
#define TANK_LEAK_PRESSURE (30.*ONE_ATMOSPHERE) //Tank starts leaking
|
||||
#define TANK_RUPTURE_PRESSURE (35.*ONE_ATMOSPHERE) //Tank spills all contents into atmosphere
|
||||
#define TANK_FRAGMENT_PRESSURE (40.*ONE_ATMOSPHERE) //Boom 3x3 base explosion
|
||||
#define TANK_FRAGMENT_SCALE (6.*ONE_ATMOSPHERE) //+1 for each SCALE kPa aboe threshold
|
||||
#define MINIMUM_AIR_RATIO_TO_SUSPEND 0.1 //Ratio of air that must move to/from a tile to reset group processing
|
||||
#define MINIMUM_AIR_RATIO_TO_MOVE 0.001 //Minimum ratio of air that must move to/from a tile
|
||||
#define MINIMUM_AIR_TO_SUSPEND (MOLES_CELLSTANDARD*MINIMUM_AIR_RATIO_TO_SUSPEND) //Minimum amount of air that has to move before a group processing can be suspended
|
||||
#define MINIMUM_MOLES_DELTA_TO_MOVE (MOLES_CELLSTANDARD*MINIMUM_AIR_RATIO_TO_MOVE) //Either this must be active
|
||||
#define EXCITED_GROUP_BREAKDOWN_CYCLES 4
|
||||
#define EXCITED_GROUP_DISMANTLE_CYCLES 16
|
||||
#define MINIMUM_TEMPERATURE_TO_MOVE (T20C+100) //or this (or both, obviously)
|
||||
#define MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND 0.012
|
||||
#define MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND 4 //Minimum temperature difference before group processing is suspended
|
||||
#define MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER 0.5 //Minimum temperature difference before the gas temperatures are just set to be equal
|
||||
#define MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION T20C+10
|
||||
#define MINIMUM_TEMPERATURE_START_SUPERCONDUCTION T20C+200
|
||||
#define FLOOR_HEAT_TRANSFER_COEFFICIENT 0.4
|
||||
#define WALL_HEAT_TRANSFER_COEFFICIENT 0.0
|
||||
#define DOOR_HEAT_TRANSFER_COEFFICIENT 0.0
|
||||
#define SPACE_HEAT_TRANSFER_COEFFICIENT 0.2 //a hack to partly simulate radiative heat
|
||||
#define OPEN_HEAT_TRANSFER_COEFFICIENT 0.4
|
||||
#define WINDOW_HEAT_TRANSFER_COEFFICIENT 0.1 //a hack for now
|
||||
//Must be between 0 and 1. Values closer to 1 equalize temperature faster
|
||||
//Should not exceed 0.4 else strange heat flow occur
|
||||
#define FIRE_MINIMUM_TEMPERATURE_TO_SPREAD 150+T0C
|
||||
#define FIRE_MINIMUM_TEMPERATURE_TO_EXIST 100+T0C
|
||||
#define FIRE_SPREAD_RADIOSITY_SCALE 0.85
|
||||
#define FIRE_CARBON_ENERGY_RELEASED 500000 //Amount of heat released per mole of burnt carbon into the tile
|
||||
#define FIRE_PLASMA_ENERGY_RELEASED 3000000 //Amount of heat released per mole of burnt plasma into the tile
|
||||
#define FIRE_GROWTH_RATE 40000 //For small fires
|
||||
#define CARBON_LIFEFORM_FIRE_RESISTANCE 200+T0C //Resistance to fire damage
|
||||
#define CARBON_LIFEFORM_FIRE_DAMAGE 4 //Fire damage
|
||||
//Plasma fire properties
|
||||
#define OXYGEN_BURN_RATE_BASE 1.4
|
||||
#define PLASMA_BURN_RATE_DELTA 9
|
||||
#define PLASMA_MINIMUM_BURN_TEMPERATURE 100+T0C
|
||||
#define PLASMA_UPPER_TEMPERATURE 1370+T0C
|
||||
#define PLASMA_MINIMUM_OXYGEN_NEEDED 2
|
||||
#define PLASMA_MINIMUM_OXYGEN_PLASMA_RATIO 30
|
||||
#define PLASMA_OXYGEN_FULLBURN 10
|
||||
#define MIN_PLASMA_DAMAGE 1
|
||||
#define MAX_PLASMA_DAMAGE 10
|
||||
#define MOLES_PLASMA_VISIBLE 0.5 //Moles in a standard cell after which plasma is visible
|
||||
//Plasma fusion properties
|
||||
#define PLASMA_BINDING_ENERGY 3000000
|
||||
#define MAX_CARBON_EFFICENCY 9
|
||||
#define PLASMA_FUSED_COEFFICENT 0.08
|
||||
#define CARBON_CATALYST_COEFFICENT 0.01
|
||||
#define FUSION_PURITY_THRESHOLD 0.9
|
||||
// Pressure limits.
|
||||
#define HAZARD_HIGH_PRESSURE 550 //This determins at what pressure the ultra-high pressure red icon is displayed. (This one is set as a constant)
|
||||
#define WARNING_HIGH_PRESSURE 325 //This determins when the orange pressure icon is displayed (it is 0.7 * HAZARD_HIGH_PRESSURE)
|
||||
#define WARNING_LOW_PRESSURE 50 //This is when the gray low pressure icon is displayed. (it is 2.5 * HAZARD_LOW_PRESSURE)
|
||||
#define HAZARD_LOW_PRESSURE 20 //This is when the black ultra-low pressure icon is displayed. (This one is set as a constant)
|
||||
|
||||
#define TEMPERATURE_DAMAGE_COEFFICIENT 1.5 //This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount.
|
||||
#define BODYTEMP_AUTORECOVERY_DIVISOR 12 //This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive.
|
||||
#define BODYTEMP_AUTORECOVERY_MINIMUM 10 //Minimum amount of kelvin moved toward 310.15K per tick. So long as abs(310.15 - bodytemp) is more than 50.
|
||||
#define BODYTEMP_COLD_DIVISOR 6 //Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is lower than their body temperature. Make it lower to lose bodytemp faster.
|
||||
#define BODYTEMP_HEAT_DIVISOR 6 //Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is higher than their body temperature. Make it lower to gain bodytemp faster.
|
||||
#define BODYTEMP_COOLING_MAX 30 //The maximum number of degrees that your body can cool in 1 tick, when in a cold area.
|
||||
#define BODYTEMP_HEATING_MAX 30 //The maximum number of degrees that your body can heat up in 1 tick, when in a hot area.
|
||||
|
||||
#define BODYTEMP_HEAT_DAMAGE_LIMIT 360.15 // The limit the human body can take before it starts taking damage from heat.
|
||||
#define BODYTEMP_COLD_DAMAGE_LIMIT 260.15 // The limit the human body can take before it starts taking damage from coldness.
|
||||
|
||||
#define SPACE_HELM_MIN_TEMP_PROTECT 2.0 //what min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
|
||||
#define SPACE_HELM_MAX_TEMP_PROTECT 1500 //Thermal insulation works both ways /Malkevin
|
||||
#define SPACE_SUIT_MIN_TEMP_PROTECT 2.0 //what min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
|
||||
#define SPACE_SUIT_MAX_TEMP_PROTECT 1500
|
||||
|
||||
#define FIRE_SUIT_MIN_TEMP_PROTECT 60 //Cold protection for firesuits
|
||||
#define FIRE_SUIT_MAX_TEMP_PROTECT 30000 //what max_heat_protection_temperature is set to for firesuit quality suits. MUST NOT BE 0.
|
||||
#define FIRE_HELM_MIN_TEMP_PROTECT 60 //Cold protection for fire helmets
|
||||
#define FIRE_HELM_MAX_TEMP_PROTECT 30000 //for fire helmet quality items (red and white hardhats)
|
||||
|
||||
#define FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT 35000 //what max_heat_protection_temperature is set to for firesuit quality suits. MUST NOT BE 0.
|
||||
#define FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT 35000 //for fire helmet quality items (red and white hardhats)
|
||||
|
||||
#define HELMET_MIN_TEMP_PROTECT 160 //For normal helmets
|
||||
#define HELMET_MAX_TEMP_PROTECT 600 //For normal helmets
|
||||
#define ARMOR_MIN_TEMP_PROTECT 160 //For armor
|
||||
#define ARMOR_MAX_TEMP_PROTECT 600 //For armor
|
||||
|
||||
#define GLOVES_MIN_TEMP_PROTECT 2.0 //For some gloves (black and)
|
||||
#define GLOVES_MAX_TEMP_PROTECT 1500 //For some gloves
|
||||
#define SHOES_MIN_TEMP_PROTECT 2.0 //For gloves
|
||||
#define SHOES_MAX_TEMP_PROTECT 1500 //For gloves
|
||||
|
||||
|
||||
#define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE
|
||||
#define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :(
|
||||
#define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value).
|
||||
|
||||
#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this
|
||||
|
||||
// Atmos pipe limits
|
||||
#define MAX_OUTPUT_PRESSURE 4500 // (kPa) What pressure pumps and powered equipment max out at.
|
||||
#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at.
|
||||
|
||||
//Atmos machinery pipenet stuff
|
||||
|
||||
// used for device_type vars; used by DEVICE_TYPE_LOOP
|
||||
#define UNARY 1
|
||||
#define BINARY 2
|
||||
#define TRINARY 3
|
||||
#define QUATERNARY 4
|
||||
|
||||
// this is the standard for loop used by all sorts of atmos machinery procs
|
||||
#define DEVICE_TYPE_LOOP var/I in 1 to device_type
|
||||
|
||||
// defines for the various machinery lists
|
||||
// NODE_I, AIR_I, PARENT_I are used within DEVICE_TYPE_LOOP
|
||||
|
||||
// nodes list - all atmos machinery
|
||||
#define NODE1 nodes[1]
|
||||
#define NODE2 nodes[2]
|
||||
#define NODE3 nodes[3]
|
||||
#define NODE4 nodes[4]
|
||||
#define NODE_I nodes[I]
|
||||
|
||||
// airs list - components only
|
||||
#define AIR1 airs[1]
|
||||
#define AIR2 airs[2]
|
||||
#define AIR3 airs[3]
|
||||
#define AIR_I airs[I]
|
||||
|
||||
// parents list - components only
|
||||
#define PARENT1 parents[1]
|
||||
#define PARENT2 parents[2]
|
||||
#define PARENT3 parents[3]
|
||||
#define PARENT_I parents[I]
|
||||
|
||||
//Tanks
|
||||
#define TANK_MAX_RELEASE_PRESSURE (ONE_ATMOSPHERE*3)
|
||||
#define TANK_MIN_RELEASE_PRESSURE 0
|
||||
#define TANK_DEFAULT_RELEASE_PRESSURE 16
|
||||
|
||||
|
||||
#define ATMOS_PASS_YES 1
|
||||
#define ATMOS_PASS_NO 0
|
||||
#define ATMOS_PASS_PROC -1 //ask CanAtmosPass()
|
||||
#define ATMOS_PASS_DENSITY -2 //just check density
|
||||
#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
|
||||
#define FIRE_DAMAGE_MODIFIER 0.0215 //Higher values result in more external fire damage to the skin (default 0.0215)
|
||||
#define AIR_DAMAGE_MODIFIER 2.025 //More means less damage from hot air scalding lungs, less = more damage. (default 2.025)
|
||||
|
||||
#define MOLES_CELLSTANDARD (ONE_ATMOSPHERE*CELL_VOLUME/(T20C*R_IDEAL_GAS_EQUATION)) //moles in a 2.5 m^3 cell at 101.325 Pa and 20 degC
|
||||
#define M_CELL_WITH_RATIO (MOLES_CELLSTANDARD * 0.005)
|
||||
#define O2STANDARD 0.21
|
||||
#define N2STANDARD 0.79
|
||||
#define MOLES_O2STANDARD (MOLES_CELLSTANDARD*O2STANDARD) // O2 standard value (21%)
|
||||
#define MOLES_N2STANDARD (MOLES_CELLSTANDARD*N2STANDARD) // N2 standard value (79%)
|
||||
|
||||
//indices of values in gas lists. used by listmos.
|
||||
#define MOLES 1
|
||||
#define ARCHIVE 2
|
||||
#define GAS_META 3
|
||||
#define META_GAS_SPECIFIC_HEAT 1
|
||||
#define META_GAS_NAME 2
|
||||
#define META_GAS_MOLES_VISIBLE 3
|
||||
#define META_GAS_OVERLAY 4
|
||||
#define META_GAS_DANGER 5
|
||||
|
||||
//stuff you should probably leave well alone!
|
||||
//ATMOS
|
||||
#define CELL_VOLUME 2500 //liters in a cell
|
||||
#define BREATH_VOLUME 0.5 //liters in a normal breath
|
||||
#define BREATH_PERCENTAGE (BREATH_VOLUME/CELL_VOLUME) //Amount of air to take a from a tile
|
||||
#define HUMAN_NEEDED_OXYGEN (MOLES_CELLSTANDARD*BREATH_PERCENTAGE*0.16) //Amount of air needed before pass out/suffocation commences
|
||||
#define NORMPIPERATE 30 //pipe-insulation rate divisor
|
||||
#define HEATPIPERATE 8 //heat-exch pipe insulation
|
||||
#define FLOWFRAC 0.99 //fraction of gas transfered per process
|
||||
#define TANK_LEAK_PRESSURE (30.*ONE_ATMOSPHERE) //Tank starts leaking
|
||||
#define TANK_RUPTURE_PRESSURE (35.*ONE_ATMOSPHERE) //Tank spills all contents into atmosphere
|
||||
#define TANK_FRAGMENT_PRESSURE (40.*ONE_ATMOSPHERE) //Boom 3x3 base explosion
|
||||
#define TANK_FRAGMENT_SCALE (6.*ONE_ATMOSPHERE) //+1 for each SCALE kPa aboe threshold
|
||||
#define MINIMUM_AIR_RATIO_TO_SUSPEND 0.1 //Ratio of air that must move to/from a tile to reset group processing
|
||||
#define MINIMUM_AIR_RATIO_TO_MOVE 0.001 //Minimum ratio of air that must move to/from a tile
|
||||
#define MINIMUM_AIR_TO_SUSPEND (MOLES_CELLSTANDARD*MINIMUM_AIR_RATIO_TO_SUSPEND) //Minimum amount of air that has to move before a group processing can be suspended
|
||||
#define MINIMUM_MOLES_DELTA_TO_MOVE (MOLES_CELLSTANDARD*MINIMUM_AIR_RATIO_TO_MOVE) //Either this must be active
|
||||
#define EXCITED_GROUP_BREAKDOWN_CYCLES 4
|
||||
#define EXCITED_GROUP_DISMANTLE_CYCLES 16
|
||||
#define MINIMUM_TEMPERATURE_TO_MOVE (T20C+100) //or this (or both, obviously)
|
||||
#define MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND 0.012
|
||||
#define MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND 4 //Minimum temperature difference before group processing is suspended
|
||||
#define MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER 0.5 //Minimum temperature difference before the gas temperatures are just set to be equal
|
||||
#define MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION T20C+10
|
||||
#define MINIMUM_TEMPERATURE_START_SUPERCONDUCTION T20C+200
|
||||
#define FLOOR_HEAT_TRANSFER_COEFFICIENT 0.4
|
||||
#define WALL_HEAT_TRANSFER_COEFFICIENT 0.0
|
||||
#define DOOR_HEAT_TRANSFER_COEFFICIENT 0.0
|
||||
#define SPACE_HEAT_TRANSFER_COEFFICIENT 0.2 //a hack to partly simulate radiative heat
|
||||
#define OPEN_HEAT_TRANSFER_COEFFICIENT 0.4
|
||||
#define WINDOW_HEAT_TRANSFER_COEFFICIENT 0.1 //a hack for now
|
||||
//Must be between 0 and 1. Values closer to 1 equalize temperature faster
|
||||
//Should not exceed 0.4 else strange heat flow occur
|
||||
#define FIRE_MINIMUM_TEMPERATURE_TO_SPREAD 150+T0C
|
||||
#define FIRE_MINIMUM_TEMPERATURE_TO_EXIST 100+T0C
|
||||
#define FIRE_SPREAD_RADIOSITY_SCALE 0.85
|
||||
#define FIRE_CARBON_ENERGY_RELEASED 500000 //Amount of heat released per mole of burnt carbon into the tile
|
||||
#define FIRE_PLASMA_ENERGY_RELEASED 3000000 //Amount of heat released per mole of burnt plasma into the tile
|
||||
#define FIRE_GROWTH_RATE 40000 //For small fires
|
||||
#define CARBON_LIFEFORM_FIRE_RESISTANCE 200+T0C //Resistance to fire damage
|
||||
#define CARBON_LIFEFORM_FIRE_DAMAGE 4 //Fire damage
|
||||
//Plasma fire properties
|
||||
#define OXYGEN_BURN_RATE_BASE 1.4
|
||||
#define PLASMA_BURN_RATE_DELTA 9
|
||||
#define PLASMA_MINIMUM_BURN_TEMPERATURE 100+T0C
|
||||
#define PLASMA_UPPER_TEMPERATURE 1370+T0C
|
||||
#define PLASMA_MINIMUM_OXYGEN_NEEDED 2
|
||||
#define PLASMA_MINIMUM_OXYGEN_PLASMA_RATIO 30
|
||||
#define PLASMA_OXYGEN_FULLBURN 10
|
||||
#define MIN_PLASMA_DAMAGE 1
|
||||
#define MAX_PLASMA_DAMAGE 10
|
||||
#define MOLES_PLASMA_VISIBLE 0.5 //Moles in a standard cell after which plasma is visible
|
||||
//Plasma fusion properties
|
||||
#define PLASMA_BINDING_ENERGY 3000000
|
||||
#define MAX_CARBON_EFFICENCY 9
|
||||
#define PLASMA_FUSED_COEFFICENT 0.08
|
||||
#define CARBON_CATALYST_COEFFICENT 0.01
|
||||
#define FUSION_PURITY_THRESHOLD 0.9
|
||||
// Pressure limits.
|
||||
#define HAZARD_HIGH_PRESSURE 550 //This determins at what pressure the ultra-high pressure red icon is displayed. (This one is set as a constant)
|
||||
#define WARNING_HIGH_PRESSURE 325 //This determins when the orange pressure icon is displayed (it is 0.7 * HAZARD_HIGH_PRESSURE)
|
||||
#define WARNING_LOW_PRESSURE 50 //This is when the gray low pressure icon is displayed. (it is 2.5 * HAZARD_LOW_PRESSURE)
|
||||
#define HAZARD_LOW_PRESSURE 20 //This is when the black ultra-low pressure icon is displayed. (This one is set as a constant)
|
||||
|
||||
#define TEMPERATURE_DAMAGE_COEFFICIENT 1.5 //This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount.
|
||||
#define BODYTEMP_AUTORECOVERY_DIVISOR 12 //This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive.
|
||||
#define BODYTEMP_AUTORECOVERY_MINIMUM 10 //Minimum amount of kelvin moved toward 310.15K per tick. So long as abs(310.15 - bodytemp) is more than 50.
|
||||
#define BODYTEMP_COLD_DIVISOR 6 //Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is lower than their body temperature. Make it lower to lose bodytemp faster.
|
||||
#define BODYTEMP_HEAT_DIVISOR 6 //Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is higher than their body temperature. Make it lower to gain bodytemp faster.
|
||||
#define BODYTEMP_COOLING_MAX 30 //The maximum number of degrees that your body can cool in 1 tick, when in a cold area.
|
||||
#define BODYTEMP_HEATING_MAX 30 //The maximum number of degrees that your body can heat up in 1 tick, when in a hot area.
|
||||
|
||||
#define BODYTEMP_HEAT_DAMAGE_LIMIT 360.15 // The limit the human body can take before it starts taking damage from heat.
|
||||
#define BODYTEMP_COLD_DAMAGE_LIMIT 260.15 // The limit the human body can take before it starts taking damage from coldness.
|
||||
|
||||
#define SPACE_HELM_MIN_TEMP_PROTECT 2.0 //what min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
|
||||
#define SPACE_HELM_MAX_TEMP_PROTECT 1500 //Thermal insulation works both ways /Malkevin
|
||||
#define SPACE_SUIT_MIN_TEMP_PROTECT 2.0 //what min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
|
||||
#define SPACE_SUIT_MAX_TEMP_PROTECT 1500
|
||||
|
||||
#define FIRE_SUIT_MIN_TEMP_PROTECT 60 //Cold protection for firesuits
|
||||
#define FIRE_SUIT_MAX_TEMP_PROTECT 30000 //what max_heat_protection_temperature is set to for firesuit quality suits. MUST NOT BE 0.
|
||||
#define FIRE_HELM_MIN_TEMP_PROTECT 60 //Cold protection for fire helmets
|
||||
#define FIRE_HELM_MAX_TEMP_PROTECT 30000 //for fire helmet quality items (red and white hardhats)
|
||||
|
||||
#define FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT 35000 //what max_heat_protection_temperature is set to for firesuit quality suits. MUST NOT BE 0.
|
||||
#define FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT 35000 //for fire helmet quality items (red and white hardhats)
|
||||
|
||||
#define HELMET_MIN_TEMP_PROTECT 160 //For normal helmets
|
||||
#define HELMET_MAX_TEMP_PROTECT 600 //For normal helmets
|
||||
#define ARMOR_MIN_TEMP_PROTECT 160 //For armor
|
||||
#define ARMOR_MAX_TEMP_PROTECT 600 //For armor
|
||||
|
||||
#define GLOVES_MIN_TEMP_PROTECT 2.0 //For some gloves (black and)
|
||||
#define GLOVES_MAX_TEMP_PROTECT 1500 //For some gloves
|
||||
#define SHOES_MIN_TEMP_PROTECT 2.0 //For gloves
|
||||
#define SHOES_MAX_TEMP_PROTECT 1500 //For gloves
|
||||
|
||||
|
||||
#define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE
|
||||
#define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :(
|
||||
#define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value).
|
||||
|
||||
#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this
|
||||
|
||||
// Atmos pipe limits
|
||||
#define MAX_OUTPUT_PRESSURE 4500 // (kPa) What pressure pumps and powered equipment max out at.
|
||||
#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at.
|
||||
|
||||
//Atmos machinery pipenet stuff
|
||||
|
||||
// used for device_type vars; used by DEVICE_TYPE_LOOP
|
||||
#define UNARY 1
|
||||
#define BINARY 2
|
||||
#define TRINARY 3
|
||||
#define QUATERNARY 4
|
||||
|
||||
// this is the standard for loop used by all sorts of atmos machinery procs
|
||||
#define DEVICE_TYPE_LOOP var/I in 1 to device_type
|
||||
|
||||
// defines for the various machinery lists
|
||||
// NODE_I, AIR_I, PARENT_I are used within DEVICE_TYPE_LOOP
|
||||
|
||||
// nodes list - all atmos machinery
|
||||
#define NODE1 nodes[1]
|
||||
#define NODE2 nodes[2]
|
||||
#define NODE3 nodes[3]
|
||||
#define NODE4 nodes[4]
|
||||
#define NODE_I nodes[I]
|
||||
|
||||
// airs list - components only
|
||||
#define AIR1 airs[1]
|
||||
#define AIR2 airs[2]
|
||||
#define AIR3 airs[3]
|
||||
#define AIR_I airs[I]
|
||||
|
||||
// parents list - components only
|
||||
#define PARENT1 parents[1]
|
||||
#define PARENT2 parents[2]
|
||||
#define PARENT3 parents[3]
|
||||
#define PARENT_I parents[I]
|
||||
|
||||
//Tanks
|
||||
#define TANK_MAX_RELEASE_PRESSURE (ONE_ATMOSPHERE*3)
|
||||
#define TANK_MIN_RELEASE_PRESSURE 0
|
||||
#define TANK_DEFAULT_RELEASE_PRESSURE 16
|
||||
|
||||
|
||||
#define ATMOS_PASS_YES 1
|
||||
#define ATMOS_PASS_NO 0
|
||||
#define ATMOS_PASS_PROC -1 //ask CanAtmosPass()
|
||||
#define ATMOS_PASS_DENSITY -2 //just check density
|
||||
#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
|
||||
|
||||
#define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 50 //what pressure you have to be under to increase the effect of equipment meant for lavaland
|
||||
#define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300"
|
||||
|
||||
@@ -7,13 +7,11 @@
|
||||
|
||||
GLOBAL_VAR_INIT(clockwork_construction_value, 0) //The total value of all structures built by the clockwork cult
|
||||
GLOBAL_VAR_INIT(clockwork_caches, 0) //How many clockwork caches exist in the world (not each individual)
|
||||
GLOBAL_VAR_INIT(clockwork_daemons, 0) //How many daemons exist in the world
|
||||
GLOBAL_LIST_INIT(clockwork_generals_invoked, list("nezbere" = FALSE, "sevtug" = FALSE, "nzcrentr" = FALSE, "inath-neq" = FALSE)) //How many generals have been recently invoked
|
||||
GLOBAL_LIST_EMPTY(active_daemons) //A list of all active tinkerer's daemons
|
||||
GLOBAL_LIST_EMPTY(all_clockwork_objects) //All clockwork items, structures, and effects in existence
|
||||
GLOBAL_LIST_EMPTY(all_clockwork_mobs) //All clockwork SERVANTS (not creatures) in existence
|
||||
GLOBAL_LIST_INIT(clockwork_component_cache, list(BELLIGERENT_EYE = 0, VANGUARD_COGWHEEL = 0, GEIS_CAPACITOR = 0, REPLICANT_ALLOY = 0, HIEROPHANT_ANSIBLE = 0)) //The pool of components that caches draw from
|
||||
GLOBAL_VAR_INIT(ratvar_awakens, 0) //If Ratvar has been summoned; not a boolean, for proper handling of multiple Ratvars
|
||||
GLOBAL_VAR_INIT(nezbere_invoked, 0) //If Nezbere has been invoked; not a boolean, for proper handling of multiple Nezberes
|
||||
GLOBAL_VAR_INIT(clockwork_gateway_activated, FALSE) //if a gateway to the celestial derelict has ever been successfully activated
|
||||
GLOBAL_LIST_EMPTY(all_scripture) //a list containing scripture instances; not used to track existing scripture
|
||||
|
||||
@@ -27,10 +25,6 @@ GLOBAL_LIST_EMPTY(all_scripture) //a list containing scripture instances; not us
|
||||
#define APPLICATION_SERVANT_REQ 9
|
||||
#define APPLICATION_CACHE_REQ 3
|
||||
#define APPLICATION_CV_REQ 100
|
||||
#define SCRIPTURE_REVENANT "Revenant"
|
||||
#define REVENANT_SERVANT_REQ 10
|
||||
#define REVENANT_CACHE_REQ 4
|
||||
#define REVENANT_CV_REQ 200
|
||||
#define SCRIPTURE_JUDGEMENT "Judgement"
|
||||
#define JUDGEMENT_SERVANT_REQ 12
|
||||
#define JUDGEMENT_CACHE_REQ 5
|
||||
@@ -51,10 +45,6 @@ GLOBAL_LIST_EMPTY(all_scripture) //a list containing scripture instances; not us
|
||||
|
||||
#define MAX_COMPONENTS_BEFORE_RAND (10*LOWER_PROB_PER_COMPONENT) //the number of each component, times LOWER_PROB_PER_COMPONENT, you need to have before component generation will become random
|
||||
|
||||
#define GLOBAL_CLOCKWORK_GENERAL_COOLDOWN 3000 //how long globally-affecting clockwork generals go on cooldown after use, defaults to 5 minutes
|
||||
|
||||
#define CLOCKWORK_GENERAL_COOLDOWN 2000 //how long clockwork generals go on cooldown after use, defaults to 3 minutes 20 seconds
|
||||
|
||||
//clockcult power defines
|
||||
#define MIN_CLOCKCULT_POWER 25 //the minimum amount of power clockcult machines will handle gracefully
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
#define OXYLOSS 8
|
||||
#define SHAME 16
|
||||
//citadel code
|
||||
#define AROUSAL 32
|
||||
#define AROUSAL 32
|
||||
|
||||
#define STUN "stun"
|
||||
#define WEAKEN "weaken"
|
||||
#define PARALYZE "paralize"
|
||||
#define KNOCKDOWN "knockdown"
|
||||
#define UNCONSCIOUS "unconscious"
|
||||
#define IRRADIATE "irradiate"
|
||||
#define STUTTER "stutter"
|
||||
#define SLUR "slur"
|
||||
@@ -33,8 +33,8 @@
|
||||
|
||||
//Bitflags defining which status effects could be or are inflicted on a mob
|
||||
#define CANSTUN 1
|
||||
#define CANWEAKEN 2
|
||||
#define CANPARALYSE 4
|
||||
#define CANKNOCKDOWN 2
|
||||
#define CANUNCONSCIOUS 4
|
||||
#define CANPUSH 8
|
||||
#define IGNORESLOWDOWN 16
|
||||
#define GOTTAGOFAST 32
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
|
||||
#define EVENT_CANT_RUN 0
|
||||
#define EVENT_READY 1
|
||||
#define EVENT_CANCELLED 2
|
||||
#define EVENT_CANCELLED 2
|
||||
#define EVENT_INTERRUPTED 3
|
||||
|
||||
+81
-81
@@ -1,93 +1,93 @@
|
||||
/*
|
||||
These defines are specific to the atom/flags bitmask
|
||||
*/
|
||||
#define ALL ~0 //For convenience.
|
||||
#define NONE 0
|
||||
|
||||
/*
|
||||
These defines are specific to the atom/flags bitmask
|
||||
*/
|
||||
#define ALL ~0 //For convenience.
|
||||
#define NONE 0
|
||||
|
||||
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
|
||||
|
||||
//FLAGS BITMASK
|
||||
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere
|
||||
//To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
|
||||
|
||||
#define NODROP 2 // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
|
||||
#define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
|
||||
#define MASKINTERNALS 8 // mask allows internals
|
||||
#define HEAR 16 // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not.
|
||||
//FLAGS BITMASK
|
||||
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere
|
||||
//To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
|
||||
|
||||
#define NODROP 2 // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
|
||||
#define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
|
||||
#define MASKINTERNALS 8 // mask allows internals
|
||||
#define HEAR 16 // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not.
|
||||
#define CHECK_RICOCHET 32 // Projectiels will check ricochet on things impacted that have this.
|
||||
#define CONDUCT 64 // conducts electricity (metal etc.)
|
||||
#define ABSTRACT 128 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way
|
||||
#define NODECONSTRUCT 128 // For machines and structures that should not break into parts, eg, holodeck stuff
|
||||
#define OVERLAY_QUEUED 256 //atom queued to SSoverlay
|
||||
#define ON_BORDER 512 // item has priority to check when entering or leaving
|
||||
|
||||
#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc
|
||||
#define CLEAN_ON_MOVE 2048
|
||||
|
||||
// BLOCK_GAS_SMOKE_EFFECT only used in masks at the moment.
|
||||
#define BLOCK_GAS_SMOKE_EFFECT 4096 // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
|
||||
#define THICKMATERIAL 8192 //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 DROPDEL 16384 // When dropped, it calls qdel on itself
|
||||
#define CONDUCT 64 // conducts electricity (metal etc.)
|
||||
#define ABSTRACT 128 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way
|
||||
#define NODECONSTRUCT 128 // For machines and structures that should not break into parts, eg, holodeck stuff
|
||||
#define OVERLAY_QUEUED 256 //atom queued to SSoverlay
|
||||
#define ON_BORDER 512 // item has priority to check when entering or leaving
|
||||
|
||||
#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc
|
||||
#define CLEAN_ON_MOVE 2048
|
||||
|
||||
// BLOCK_GAS_SMOKE_EFFECT only used in masks at the moment.
|
||||
#define BLOCK_GAS_SMOKE_EFFECT 4096 // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
|
||||
#define THICKMATERIAL 8192 //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 DROPDEL 16384 // When dropped, it calls qdel on itself
|
||||
#define PREVENT_CLICK_UNDER 32768 //Prevent clicking things below it on the same turf eg. doors/ fulltile windows
|
||||
|
||||
/* Secondary atom flags, access using the SECONDARY_FLAG macros */
|
||||
|
||||
#define SLOWS_WHILE_IN_HAND "slows_while_in_hand"
|
||||
#define NO_EMP_WIRES "no_emp_wires"
|
||||
#define HOLOGRAM "hologram"
|
||||
#define FROZEN "frozen"
|
||||
#define STATIONLOVING "stationloving"
|
||||
#define INFORM_ADMINS_ON_RELOCATE "inform_admins_on_relocate"
|
||||
#define BANG_PROTECT "bang_protect"
|
||||
|
||||
|
||||
/* Secondary atom flags, access using the SECONDARY_FLAG macros */
|
||||
|
||||
#define SLOWS_WHILE_IN_HAND "slows_while_in_hand"
|
||||
#define NO_EMP_WIRES "no_emp_wires"
|
||||
#define HOLOGRAM "hologram"
|
||||
#define FROZEN "frozen"
|
||||
#define STATIONLOVING "stationloving"
|
||||
#define INFORM_ADMINS_ON_RELOCATE "inform_admins_on_relocate"
|
||||
#define BANG_PROTECT "bang_protect"
|
||||
|
||||
// An item worn in the ear slot with HEALS_EARS will heal your ears each
|
||||
// Life() tick, even if normally your ears would be too damaged to heal.
|
||||
#define HEALS_EARS "heals_ears"
|
||||
|
||||
// A mob with OMNITONGUE has no restriction in the ability to speak
|
||||
// languages that they know. So even if they wouldn't normally be able to
|
||||
// through mob or tongue restrictions, this flag allows them to ignore
|
||||
// those restrictions.
|
||||
#define OMNITONGUE "omnitongue"
|
||||
|
||||
// A mob with OMNITONGUE has no restriction in the ability to speak
|
||||
// languages that they know. So even if they wouldn't normally be able to
|
||||
// through mob or tongue restrictions, this flag allows them to ignore
|
||||
// those restrictions.
|
||||
#define OMNITONGUE "omnitongue"
|
||||
|
||||
// TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
|
||||
#define TESLA_IGNORE "tesla_ignore"
|
||||
|
||||
//turf-only flags
|
||||
#define NOJAUNT 1
|
||||
#define UNUSED_TRANSIT_TURF 2
|
||||
#define CAN_BE_DIRTY 4 //If a turf can be made dirty at roundstart. This is also used in areas.
|
||||
#define NO_DEATHRATTLE 16 // Do not notify deadchat about any deaths that occur on this turf.
|
||||
//turf-only flags
|
||||
#define NOJAUNT 1
|
||||
#define UNUSED_TRANSIT_TURF 2
|
||||
#define CAN_BE_DIRTY 4 //If a turf can be made dirty at roundstart. This is also used in areas.
|
||||
#define NO_DEATHRATTLE 16 // Do not notify deadchat about any deaths that occur on this turf.
|
||||
//#define CHECK_RICOCHET 32 //Same thing as atom flag.
|
||||
|
||||
/*
|
||||
These defines are used specifically with the atom/pass_flags bitmask
|
||||
the atom/checkpass() proc uses them (tables will call movable atom checkpass(PASSTABLE) for example)
|
||||
*/
|
||||
//flags for pass_flags
|
||||
#define PASSTABLE 1
|
||||
#define PASSGLASS 2
|
||||
#define PASSGRILLE 4
|
||||
#define PASSBLOB 8
|
||||
#define PASSMOB 16
|
||||
#define LETPASSTHROW 32
|
||||
|
||||
|
||||
//Movement Types
|
||||
#define IMMOBILE 0
|
||||
#define GROUND 1
|
||||
#define FLYING 2
|
||||
|
||||
// Flags for reagents
|
||||
#define REAGENT_NOREACT 1
|
||||
|
||||
//Fire and Acid stuff, for resistance_flags
|
||||
#define LAVA_PROOF 1
|
||||
#define FIRE_PROOF 2 //100% immune to fire damage (but not necessarily to lava or heat)
|
||||
#define FLAMMABLE 4
|
||||
#define ON_FIRE 8
|
||||
#define UNACIDABLE 16 //acid can't even appear on it, let alone melt it.
|
||||
#define ACID_PROOF 32 //acid stuck on it doesn't melt it.
|
||||
#define INDESTRUCTIBLE 64 //doesn't take damage
|
||||
|
||||
// language secondary flags for atoms
|
||||
|
||||
/*
|
||||
These defines are used specifically with the atom/pass_flags bitmask
|
||||
the atom/checkpass() proc uses them (tables will call movable atom checkpass(PASSTABLE) for example)
|
||||
*/
|
||||
//flags for pass_flags
|
||||
#define PASSTABLE 1
|
||||
#define PASSGLASS 2
|
||||
#define PASSGRILLE 4
|
||||
#define PASSBLOB 8
|
||||
#define PASSMOB 16
|
||||
#define LETPASSTHROW 32
|
||||
|
||||
|
||||
//Movement Types
|
||||
#define IMMOBILE 0
|
||||
#define GROUND 1
|
||||
#define FLYING 2
|
||||
|
||||
// Flags for reagents
|
||||
#define REAGENT_NOREACT 1
|
||||
|
||||
//Fire and Acid stuff, for resistance_flags
|
||||
#define LAVA_PROOF 1
|
||||
#define FIRE_PROOF 2 //100% immune to fire damage (but not necessarily to lava or heat)
|
||||
#define FLAMMABLE 4
|
||||
#define ON_FIRE 8
|
||||
#define UNACIDABLE 16 //acid can't even appear on it, let alone melt it.
|
||||
#define ACID_PROOF 32 //acid stuck on it doesn't melt it.
|
||||
#define INDESTRUCTIBLE 64 //doesn't take damage
|
||||
|
||||
// language secondary flags for atoms
|
||||
|
||||
@@ -52,6 +52,14 @@
|
||||
|
||||
#define isalienadult(A) (istype(A, /mob/living/carbon/alien/humanoid))
|
||||
|
||||
#define isalienhunter(A) (istype(A, /mob/living/carbon/alien/humanoid/hunter))
|
||||
|
||||
#define isaliensentinel(A) (istype(A, /mob/living/carbon/alien/humanoid/sentinel))
|
||||
|
||||
#define isalienroyal(A) (istype(A, /mob/living/carbon/alien/humanoid/royal))
|
||||
|
||||
#define isalienqueen(A) (istype(A, /mob/living/carbon/alien/humanoid/royal/queen))
|
||||
|
||||
#define isdevil(A) (istype(A, /mob/living/carbon/true_devil))
|
||||
|
||||
//Silicon mobs
|
||||
@@ -68,8 +76,6 @@
|
||||
|
||||
#define isrevenant(A) (istype(A, /mob/living/simple_animal/revenant))
|
||||
|
||||
#define isborer(A) (istype(A, /mob/living/simple_animal/borer))
|
||||
|
||||
#define isbot(A) (istype(A, /mob/living/simple_animal/bot))
|
||||
|
||||
#define iscrab(A) (istype(A, /mob/living/simple_animal/crab))
|
||||
@@ -109,6 +115,8 @@
|
||||
//Misc mobs
|
||||
#define isobserver(A) (istype(A, /mob/dead/observer))
|
||||
|
||||
#define isdead(A) (istype(A, /mob/dead))
|
||||
|
||||
#define isnewplayer(A) (istype(A, /mob/dead/new_player))
|
||||
|
||||
#define isovermind(A) (istype(A, /mob/camera/blob))
|
||||
@@ -116,7 +124,7 @@
|
||||
//Objects
|
||||
#define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs
|
||||
|
||||
#define islimb(A) (istype(A, /obj/item/bodypart))
|
||||
#define isitem(A) (istype(A, /obj/item))
|
||||
|
||||
#define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#define CLOSED_TURF_LAYER 2.05
|
||||
#define ABOVE_NORMAL_TURF_LAYER 2.08
|
||||
#define LATTICE_LAYER 2.2
|
||||
#define OVER_LATTICE_LAYER 2.25
|
||||
#define DISPOSAL_PIPE_LAYER 2.3
|
||||
#define GAS_PIPE_HIDDEN_LAYER 2.35
|
||||
#define WIRE_LAYER 2.4
|
||||
|
||||
+67
-67
@@ -1,76 +1,76 @@
|
||||
// channel numbers for power
|
||||
#define EQUIP 1
|
||||
#define LIGHT 2
|
||||
#define ENVIRON 3
|
||||
#define TOTAL 4 //for total power used only
|
||||
#define STATIC_EQUIP 5
|
||||
#define STATIC_LIGHT 6
|
||||
#define STATIC_ENVIRON 7
|
||||
|
||||
// channel numbers for power
|
||||
#define EQUIP 1
|
||||
#define LIGHT 2
|
||||
#define ENVIRON 3
|
||||
#define TOTAL 4 //for total power used only
|
||||
#define STATIC_EQUIP 5
|
||||
#define STATIC_LIGHT 6
|
||||
#define STATIC_ENVIRON 7
|
||||
|
||||
//Power use
|
||||
#define NO_POWER_USE 0
|
||||
#define IDLE_POWER_USE 1
|
||||
#define ACTIVE_POWER_USE 2
|
||||
|
||||
|
||||
//bitflags for door switches.
|
||||
#define OPEN 1
|
||||
#define IDSCAN 2
|
||||
#define BOLTS 4
|
||||
#define SHOCK 8
|
||||
#define SAFE 16
|
||||
|
||||
//used in design to specify which machine can build it
|
||||
#define IMPRINTER 1 //For circuits. Uses glass/chemicals.
|
||||
#define PROTOLATHE 2 //New stuff. Uses glass/metal/chemicals
|
||||
#define AUTOLATHE 4 //Uses glass/metal only.
|
||||
#define CRAFTLATHE 8 //Uses fuck if I know. For use eventually.
|
||||
#define MECHFAB 16 //Remember, objects utilising this flag should have construction_time and construction_cost vars.
|
||||
#define BIOGENERATOR 32 //Uses biomass
|
||||
#define LIMBGROWER 64 //Uses synthetic flesh
|
||||
|
||||
//bitflags for door switches.
|
||||
#define OPEN 1
|
||||
#define IDSCAN 2
|
||||
#define BOLTS 4
|
||||
#define SHOCK 8
|
||||
#define SAFE 16
|
||||
|
||||
//used in design to specify which machine can build it
|
||||
#define IMPRINTER 1 //For circuits. Uses glass/chemicals.
|
||||
#define PROTOLATHE 2 //New stuff. Uses glass/metal/chemicals
|
||||
#define AUTOLATHE 4 //Uses glass/metal only.
|
||||
#define CRAFTLATHE 8 //Uses fuck if I know. For use eventually.
|
||||
#define MECHFAB 16 //Remember, objects utilising this flag should have construction_time and construction_cost vars.
|
||||
#define BIOGENERATOR 32 //Uses biomass
|
||||
#define LIMBGROWER 64 //Uses synthetic flesh
|
||||
#define SMELTER 128 //uses various minerals
|
||||
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
|
||||
|
||||
//Modular computer/NTNet defines
|
||||
|
||||
//Modular computer part defines
|
||||
#define MC_CPU "CPU"
|
||||
#define MC_HDD "HDD"
|
||||
#define MC_SDD "SDD"
|
||||
#define MC_CARD "CARD"
|
||||
#define MC_NET "NET"
|
||||
#define MC_PRINT "PRINT"
|
||||
#define MC_CELL "CELL"
|
||||
#define MC_CHARGE "CHARGE"
|
||||
#define MC_AI "AI"
|
||||
|
||||
//NTNet stuff, for modular computers
|
||||
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
|
||||
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
|
||||
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
|
||||
#define NTNET_COMMUNICATION 3 // Communication (messaging)
|
||||
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
|
||||
|
||||
//NTNet transfer speeds, used when downloading/uploading a file/program.
|
||||
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
|
||||
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
|
||||
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
|
||||
|
||||
//Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
|
||||
#define MAX_NTNET_LOGS 300
|
||||
#define MIN_NTNET_LOGS 10
|
||||
|
||||
//Program bitflags
|
||||
#define PROGRAM_ALL 7
|
||||
#define PROGRAM_CONSOLE 1
|
||||
#define PROGRAM_LAPTOP 2
|
||||
#define PROGRAM_TABLET 4
|
||||
//Program states
|
||||
#define PROGRAM_STATE_KILLED 0
|
||||
#define PROGRAM_STATE_BACKGROUND 1
|
||||
#define PROGRAM_STATE_ACTIVE 2
|
||||
|
||||
#define FIREDOOR_OPEN 1
|
||||
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
|
||||
|
||||
//Modular computer/NTNet defines
|
||||
|
||||
//Modular computer part defines
|
||||
#define MC_CPU "CPU"
|
||||
#define MC_HDD "HDD"
|
||||
#define MC_SDD "SDD"
|
||||
#define MC_CARD "CARD"
|
||||
#define MC_NET "NET"
|
||||
#define MC_PRINT "PRINT"
|
||||
#define MC_CELL "CELL"
|
||||
#define MC_CHARGE "CHARGE"
|
||||
#define MC_AI "AI"
|
||||
|
||||
//NTNet stuff, for modular computers
|
||||
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
|
||||
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
|
||||
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
|
||||
#define NTNET_COMMUNICATION 3 // Communication (messaging)
|
||||
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
|
||||
|
||||
//NTNet transfer speeds, used when downloading/uploading a file/program.
|
||||
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
|
||||
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
|
||||
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
|
||||
|
||||
//Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
|
||||
#define MAX_NTNET_LOGS 300
|
||||
#define MIN_NTNET_LOGS 10
|
||||
|
||||
//Program bitflags
|
||||
#define PROGRAM_ALL 7
|
||||
#define PROGRAM_CONSOLE 1
|
||||
#define PROGRAM_LAPTOP 2
|
||||
#define PROGRAM_TABLET 4
|
||||
//Program states
|
||||
#define PROGRAM_STATE_KILLED 0
|
||||
#define PROGRAM_STATE_BACKGROUND 1
|
||||
#define PROGRAM_STATE_ACTIVE 2
|
||||
|
||||
#define FIREDOOR_OPEN 1
|
||||
#define FIREDOOR_CLOSED 2
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
diff a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm (rejected hunks)
|
||||
@@ -440,4 +440,4 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
|
||||
#define BEAT_SLOW 2
|
||||
#define BEAT_NONE 0
|
||||
|
||||
-#define BEAT_CHANNEL 150 //sound channel for heartbeats
|
||||
+
|
||||
@@ -7,7 +7,6 @@
|
||||
#define PLAYER_READY_TO_PLAY 1
|
||||
#define PLAYER_READY_TO_OBSERVE 2
|
||||
|
||||
|
||||
//movement intent defines for the m_intent var
|
||||
#define MOVE_INTENT_WALK "walk"
|
||||
#define MOVE_INTENT_RUN "run"
|
||||
@@ -135,4 +134,13 @@
|
||||
#define INCORPOREAL_MOVE_BASIC 1
|
||||
#define INCORPOREAL_MOVE_SHADOW 2 // leaves a trail of shadows
|
||||
#define INCORPOREAL_MOVE_JAUNT 3 // is blocked by holy water/salt
|
||||
|
||||
//Secbot and ED209 judgement criteria bitflag values
|
||||
#define JUDGE_EMAGGED 1
|
||||
#define JUDGE_IDCHECK 2
|
||||
#define JUDGE_WEAPONCHECK 4
|
||||
#define JUDGE_RECORDCHECK 8
|
||||
//ED209's ignore monkeys
|
||||
#define JUDGE_IGNOREMONKEYS 16
|
||||
|
||||
#define MEGAFAUNA_DEFAULT_RECOVERY_TIME 5
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#define ROLE_REVENANT "revenant"
|
||||
#define ROLE_DEVIL "devil"
|
||||
#define ROLE_SERVANT_OF_RATVAR "servant of Ratvar"
|
||||
#define ROLE_BORER "borer"
|
||||
|
||||
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
|
||||
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
|
||||
@@ -45,8 +44,7 @@ GLOBAL_LIST_INIT(special_roles, list(
|
||||
ROLE_REVENANT,
|
||||
ROLE_ABDUCTOR = /datum/game_mode/abduction,
|
||||
ROLE_DEVIL = /datum/game_mode/devil,
|
||||
ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult,
|
||||
ROLE_BORER,
|
||||
ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult
|
||||
))
|
||||
|
||||
//Job defines for what happens when you fail to qualify for any job during job selection
|
||||
|
||||
@@ -51,4 +51,4 @@
|
||||
//Engine related
|
||||
#define ENGINE_COEFF_MIN 0.5
|
||||
#define ENGINE_COEFF_MAX 2
|
||||
#define ENGINE_DEFAULT_MAXSPEED_ENGINES 5
|
||||
#define ENGINE_DEFAULT_MAXSPEED_ENGINES 5
|
||||
@@ -3,13 +3,14 @@
|
||||
#define CHANNEL_ADMIN 1023
|
||||
#define CHANNEL_VOX 1022
|
||||
#define CHANNEL_JUKEBOX 1021
|
||||
#define CHANNEL_JUSTICAR_ARK 1020
|
||||
#define CHANNEL_HEARTBEAT 1019 //sound channel for heartbeats
|
||||
|
||||
//Citadel code
|
||||
#define CHANNEL_PRED 1020
|
||||
#define CHANNEL_PREY 1019
|
||||
#define CHANNEL_PRED 1018
|
||||
|
||||
//THIS SHOULD ALWAYS BE THE LOWEST ONE!
|
||||
//KEEP IT UPDATED
|
||||
|
||||
#define CHANNEL_HIGHEST_AVAILABLE 1018
|
||||
#define CHANNEL_HIGHEST_AVAILABLE 1017
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
diff a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm (rejected hunks)
|
||||
@@ -9,5 +9,5 @@
|
||||
//THIS SHOULD ALWAYS BE THE LOWEST ONE!
|
||||
//KEEP IT UPDATED
|
||||
|
||||
-#define CHANNEL_HIGHEST_AVAILABLE 1019
|
||||
+#define CHANNEL_HIGHEST_AVAILABLE 1018
|
||||
|
||||
@@ -26,10 +26,20 @@
|
||||
|
||||
#define STATUS_EFFECT_WISH_GRANTERS_GIFT /datum/status_effect/wish_granters_gift //If you're currently resurrecting with the Wish Granter
|
||||
|
||||
#define STATUS_EFFECT_BLOODDRUNK /datum/status_effect/blooddrunk //Stun immunity and greatly reduced damage taken
|
||||
|
||||
/////////////
|
||||
// DEBUFFS //
|
||||
/////////////
|
||||
|
||||
#define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun //the affected is stunned
|
||||
|
||||
#define STATUS_EFFECT_KNOCKDOWN /datum/status_effect/incapacitating/knockdown //the affected is knocked down
|
||||
|
||||
#define STATUS_EFFECT_UNCONSCIOUS /datum/status_effect/incapacitating/unconscious //the affected is unconscious
|
||||
|
||||
#define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep
|
||||
|
||||
#define STATUS_EFFECT_BELLIGERENT /datum/status_effect/belligerent //forces the affected to walk, doing damage if they try to run
|
||||
|
||||
#define STATUS_EFFECT_MANIAMOTOR /datum/status_effect/maniamotor //disrupts, damages, and confuses the affected as long as they're in range of the motor
|
||||
@@ -39,8 +49,10 @@
|
||||
#define STATUS_EFFECT_HISWRATH /datum/status_effect/his_wrath //His Wrath.
|
||||
|
||||
#define STATUS_EFFECT_SUMMONEDGHOST /datum/status_effect/cultghost //is a cult ghost and can't use manifest runes
|
||||
|
||||
#define STATUS_EFFECT_CRUSHERMARK /datum/status_effect/crusher_mark //if struck with a proto-kinetic crusher, takes a ton of damage
|
||||
|
||||
#define STATUS_EFFECT_SAWBLEED /datum/status_effect/saw_bleed //if the bleed builds up enough, takes a ton of damage
|
||||
|
||||
/////////////
|
||||
// NEUTRAL //
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
}\
|
||||
}
|
||||
|
||||
|
||||
// Subsystem init_order, from highest priority to lowest priority
|
||||
// Subsystems shutdown in the reverse of the order they initialize in
|
||||
// The numbers just define the ordering, they are meaningless otherwise.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
|
||||
Days of the week to make it easier to reference them.
|
||||
|
||||
When using time2text(), please use "DDD" to find the weekday. Refrain from using "Day"
|
||||
|
||||
*/
|
||||
|
||||
#define MONDAY "Mon"
|
||||
#define TUESDAY "Tue"
|
||||
#define WEDNESDAY "Wed"
|
||||
#define THURSDAY "Thu"
|
||||
#define FRIDAY "Fri"
|
||||
#define SATURDAY "Sat"
|
||||
#define SUNDAY "Sun"
|
||||
+43
-43
@@ -1,45 +1,45 @@
|
||||
#define WIRE_DUD_PREFIX "__dud"
|
||||
#define WIRE_ACTIVATE "Activate"
|
||||
#define WIRE_AI "AI Connection"
|
||||
#define WIRE_ALARM "Alarm"
|
||||
#define WIRE_AVOIDANCE "Avoidance"
|
||||
#define WIRE_DUD_PREFIX "__dud"
|
||||
#define WIRE_ACTIVATE "Activate"
|
||||
#define WIRE_AI "AI Connection"
|
||||
#define WIRE_ALARM "Alarm"
|
||||
#define WIRE_AVOIDANCE "Avoidance"
|
||||
#define WIRE_BACKUP1 "Auxiliary Power 1"
|
||||
#define WIRE_BACKUP2 "Auxiliary Power 2"
|
||||
#define WIRE_BEACON "Beacon"
|
||||
#define WIRE_BOLTS "Bolts"
|
||||
#define WIRE_BOOM "Boom"
|
||||
#define WIRE_CAMERA "Camera"
|
||||
#define WIRE_CONTRABAND "Contraband"
|
||||
#define WIRE_DELAY "Delay"
|
||||
#define WIRE_DISABLE "Disable"
|
||||
#define WIRE_DISARM "Disarm"
|
||||
#define WIRE_HACK "Hack"
|
||||
#define WIRE_IDSCAN "ID Scan"
|
||||
#define WIRE_INTERFACE "Interface"
|
||||
#define WIRE_LAWSYNC "AI Law Synchronization"
|
||||
#define WIRE_LIGHT "Bolt Lights"
|
||||
#define WIRE_LIMIT "Limiter"
|
||||
#define WIRE_LOADCHECK "Load Check"
|
||||
#define WIRE_LOCKDOWN "Lockdown"
|
||||
#define WIRE_MOTOR1 "Motor 1"
|
||||
#define WIRE_MOTOR2 "Motor 2"
|
||||
#define WIRE_OPEN "Open"
|
||||
#define WIRE_PANIC "Panic Siphon"
|
||||
#define WIRE_POWER "Power"
|
||||
#define WIRE_POWER1 "Main Power 1"
|
||||
#define WIRE_POWER2 "Main Power 2"
|
||||
#define WIRE_PROCEED "Proceed"
|
||||
#define WIRE_RX "Recieve"
|
||||
#define WIRE_RESET_MODULE "Reset Module"
|
||||
#define WIRE_SAFETY "Safety"
|
||||
#define WIRE_SHOCK "High Voltage Ground"
|
||||
#define WIRE_SIGNAL "Signal"
|
||||
#define WIRE_SPEAKER "Speaker"
|
||||
#define WIRE_STRENGTH "Strength"
|
||||
#define WIRE_THROW "Throw"
|
||||
#define WIRE_TIMING "Timing"
|
||||
#define WIRE_TX "Transmit"
|
||||
#define WIRE_UNBOLT "Unbolt"
|
||||
#define WIRE_ZAP "High Voltage Circuit"
|
||||
#define WIRE_ZAP1 "High Voltage Circuit 1"
|
||||
#define WIRE_ZAP2 "High Voltage Circuit 2"
|
||||
#define WIRE_BEACON "Beacon"
|
||||
#define WIRE_BOLTS "Bolts"
|
||||
#define WIRE_BOOM "Boom"
|
||||
#define WIRE_CAMERA "Camera"
|
||||
#define WIRE_CONTRABAND "Contraband"
|
||||
#define WIRE_DELAY "Delay"
|
||||
#define WIRE_DISABLE "Disable"
|
||||
#define WIRE_DISARM "Disarm"
|
||||
#define WIRE_HACK "Hack"
|
||||
#define WIRE_IDSCAN "ID Scan"
|
||||
#define WIRE_INTERFACE "Interface"
|
||||
#define WIRE_LAWSYNC "AI Law Synchronization"
|
||||
#define WIRE_LIGHT "Bolt Lights"
|
||||
#define WIRE_LIMIT "Limiter"
|
||||
#define WIRE_LOADCHECK "Load Check"
|
||||
#define WIRE_LOCKDOWN "Lockdown"
|
||||
#define WIRE_MOTOR1 "Motor 1"
|
||||
#define WIRE_MOTOR2 "Motor 2"
|
||||
#define WIRE_OPEN "Open"
|
||||
#define WIRE_PANIC "Panic Siphon"
|
||||
#define WIRE_POWER "Power"
|
||||
#define WIRE_POWER1 "Main Power 1"
|
||||
#define WIRE_POWER2 "Main Power 2"
|
||||
#define WIRE_PROCEED "Proceed"
|
||||
#define WIRE_RX "Recieve"
|
||||
#define WIRE_RESET_MODULE "Reset Module"
|
||||
#define WIRE_SAFETY "Safety"
|
||||
#define WIRE_SHOCK "High Voltage Ground"
|
||||
#define WIRE_SIGNAL "Signal"
|
||||
#define WIRE_SPEAKER "Speaker"
|
||||
#define WIRE_STRENGTH "Strength"
|
||||
#define WIRE_THROW "Throw"
|
||||
#define WIRE_TIMING "Timing"
|
||||
#define WIRE_TX "Transmit"
|
||||
#define WIRE_UNBOLT "Unbolt"
|
||||
#define WIRE_ZAP "High Voltage Circuit"
|
||||
#define WIRE_ZAP1 "High Voltage Circuit 1"
|
||||
#define WIRE_ZAP2 "High Voltage Circuit 2"
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
||||
/proc/bitfield2list(bitfield = 0, list/wordlist)
|
||||
var/list/r = list()
|
||||
if(istype(wordlist,/list))
|
||||
if(islist(wordlist))
|
||||
var/max = min(wordlist.len,16)
|
||||
var/bit = 1
|
||||
for(var/i=1, i<=max, i++)
|
||||
@@ -450,7 +450,7 @@
|
||||
. |= key_list[key]
|
||||
|
||||
//Picks from the list, with some safeties, and returns the "default" arg if it fails
|
||||
#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default)
|
||||
#define DEFAULTPICK(L, default) ((islist(L) && L:len) ? pick(L) : default)
|
||||
#define LAZYINITLIST(L) if (!L) L = list()
|
||||
#define UNSETEMPTY(L) if (L && !L.len) L = null
|
||||
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } }
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
/proc/datum_info_line(datum/D)
|
||||
if(!istype(D))
|
||||
return
|
||||
if(!istype(D, /mob))
|
||||
if(!ismob(D))
|
||||
return "[D] ([D.type])"
|
||||
var/mob/M = D
|
||||
return "[M] ([M.ckey]) ([M.type])"
|
||||
|
||||
@@ -47,3 +47,5 @@ GLOBAL_VAR_INIT(cmp_field, "name")
|
||||
/proc/cmp_clockscripture_priority(datum/clockwork_scripture/A, datum/clockwork_scripture/B)
|
||||
return initial(A.sort_priority) - initial(B.sort_priority)
|
||||
|
||||
/proc/cmp_ruincost_priority(datum/map_template/ruin/A, datum/map_template/ruin/B)
|
||||
return initial(A.cost) - initial(B.cost)
|
||||
|
||||
@@ -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"))
|
||||
/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list("txt","log","htm", "html"))
|
||||
var/path = root
|
||||
|
||||
for(var/i=0, i<max_iterations, i++)
|
||||
@@ -22,9 +22,13 @@
|
||||
|
||||
if(copytext(path,-1,0) != "/") //didn't choose a directory, no need to iterate again
|
||||
break
|
||||
|
||||
var/extension = copytext(path,-4,0)
|
||||
if( !fexists(path) || !(extension in valid_extensions) )
|
||||
var/extensions
|
||||
for(var/i in valid_extensions)
|
||||
if(extensions)
|
||||
extensions += "|"
|
||||
extensions += "[i]"
|
||||
var/regex/valid_ext = new("\\.([extensions])$", "i")
|
||||
if( !fexists(path) || !(valid_ext.Find(path)) )
|
||||
to_chat(src, "<font color='red'>Error: browse_files(): File not found/Invalid file([path]).</font>")
|
||||
return
|
||||
|
||||
|
||||
@@ -455,7 +455,6 @@
|
||||
var/time_passed = world.time
|
||||
if (!Question)
|
||||
Question = "Would you like to be a special role?"
|
||||
|
||||
var/list/result = list()
|
||||
for(var/m in group)
|
||||
var/mob/M = m
|
||||
@@ -553,4 +552,12 @@
|
||||
return hex2num(copytext(hexa, 4, 6))
|
||||
|
||||
/proc/GetBluePart(const/hexa)
|
||||
return hex2num(copytext(hexa, 6, 8))
|
||||
return hex2num(copytext(hexa, 6, 8))
|
||||
|
||||
/proc/lavaland_equipment_pressure_check(turf/T)
|
||||
if(!istype(T))
|
||||
return
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
if(pressure <= LAVALAND_EQUIPMENT_EFFECT_PRESSURE)
|
||||
return TRUE
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
var/adjacencies = 0
|
||||
|
||||
var/atom/movable/AM
|
||||
if(istype(A, /atom/movable))
|
||||
if(ismovableatom(A))
|
||||
AM = A
|
||||
if(AM.can_be_unanchored && !AM.anchored)
|
||||
return 0
|
||||
|
||||
+995
-995
File diff suppressed because it is too large
Load Diff
+168
-168
@@ -1,135 +1,135 @@
|
||||
// Credits to Nickr5 for the useful procs I've taken from his library resource.
|
||||
|
||||
GLOBAL_VAR_INIT(E, 2.71828183)
|
||||
GLOBAL_VAR_INIT(Sqrt2, 1.41421356)
|
||||
|
||||
// List of square roots for the numbers 1-100.
|
||||
GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10))
|
||||
|
||||
/proc/sign(x)
|
||||
return x!=0?x/abs(x):0
|
||||
|
||||
/proc/Atan2(x, y)
|
||||
if(!x && !y) return 0
|
||||
var/a = arccos(x / sqrt(x*x + y*y))
|
||||
return y >= 0 ? a : -a
|
||||
|
||||
/proc/Ceiling(x, y=1)
|
||||
return -round(-x / y) * y
|
||||
|
||||
/proc/Floor(x, y=1)
|
||||
return round(x / y) * y
|
||||
|
||||
#define Clamp(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) )
|
||||
|
||||
// cotangent
|
||||
/proc/Cot(x)
|
||||
return 1 / Tan(x)
|
||||
|
||||
// cosecant
|
||||
/proc/Csc(x)
|
||||
return 1 / sin(x)
|
||||
|
||||
/proc/Default(a, b)
|
||||
return a ? a : b
|
||||
|
||||
// Greatest Common Divisor - Euclid's algorithm
|
||||
/proc/Gcd(a, b)
|
||||
return b ? Gcd(b, a % b) : a
|
||||
|
||||
/proc/Inverse(x)
|
||||
return 1 / x
|
||||
|
||||
/proc/IsAboutEqual(a, b, deviation = 0.1)
|
||||
return abs(a - b) <= deviation
|
||||
|
||||
/proc/IsEven(x)
|
||||
return x % 2 == 0
|
||||
|
||||
// Returns true if val is from min to max, inclusive.
|
||||
/proc/IsInRange(val, min, max)
|
||||
return min <= val && val <= max
|
||||
|
||||
/proc/IsInteger(x)
|
||||
return round(x) == x
|
||||
|
||||
/proc/IsOdd(x)
|
||||
return !IsEven(x)
|
||||
|
||||
/proc/IsMultiple(x, y)
|
||||
return x % y == 0
|
||||
|
||||
// Least Common Multiple
|
||||
/proc/Lcm(a, b)
|
||||
return abs(a) / Gcd(a, b) * abs(b)
|
||||
|
||||
// Performs a linear interpolation between a and b.
|
||||
// Note that amount=0 returns a, amount=1 returns b, and
|
||||
// amount=0.5 returns the mean of a and b.
|
||||
/proc/Lerp(a, b, amount = 0.5)
|
||||
return a + (b - a) * amount
|
||||
|
||||
//Calculates the sum of a list of numbers.
|
||||
/proc/Sum(var/list/data)
|
||||
. = 0
|
||||
for(var/val in data)
|
||||
.+= val
|
||||
|
||||
//Calculates the mean of a list of numbers.
|
||||
/proc/Mean(var/list/data)
|
||||
. = Sum(data) / (data.len)
|
||||
|
||||
|
||||
// Returns the nth root of x.
|
||||
/proc/Root(n, x)
|
||||
return x ** (1 / n)
|
||||
|
||||
// secant
|
||||
/proc/Sec(x)
|
||||
return 1 / cos(x)
|
||||
|
||||
// The quadratic formula. Returns a list with the solutions, or an empty list
|
||||
// if they are imaginary.
|
||||
/proc/SolveQuadratic(a, b, c)
|
||||
ASSERT(a)
|
||||
. = list()
|
||||
var/d = b*b - 4 * a * c
|
||||
var/bottom = 2 * a
|
||||
if(d < 0) return
|
||||
var/root = sqrt(d)
|
||||
. += (-b + root) / bottom
|
||||
if(!d) return
|
||||
. += (-b - root) / bottom
|
||||
|
||||
// tangent
|
||||
/proc/Tan(x)
|
||||
return sin(x) / cos(x)
|
||||
|
||||
/proc/ToDegrees(radians)
|
||||
// 180 / Pi
|
||||
return radians * 57.2957795
|
||||
|
||||
/proc/ToRadians(degrees)
|
||||
// Pi / 180
|
||||
return degrees * 0.0174532925
|
||||
|
||||
// Will filter out extra rotations and negative rotations
|
||||
// E.g: 540 becomes 180. -180 becomes 180.
|
||||
/proc/SimplifyDegrees(degrees)
|
||||
degrees = degrees % 360
|
||||
if(degrees < 0)
|
||||
degrees += 360
|
||||
return degrees
|
||||
|
||||
// min is inclusive, max is exclusive
|
||||
/proc/Wrap(val, min, max)
|
||||
var/d = max - min
|
||||
var/t = round((val - min) / d)
|
||||
return val - (t * d)
|
||||
|
||||
// Credits to Nickr5 for the useful procs I've taken from his library resource.
|
||||
|
||||
GLOBAL_VAR_INIT(E, 2.71828183)
|
||||
GLOBAL_VAR_INIT(Sqrt2, 1.41421356)
|
||||
|
||||
// List of square roots for the numbers 1-100.
|
||||
GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10))
|
||||
|
||||
/proc/sign(x)
|
||||
return x!=0?x/abs(x):0
|
||||
|
||||
/proc/Atan2(x, y)
|
||||
if(!x && !y) return 0
|
||||
var/a = arccos(x / sqrt(x*x + y*y))
|
||||
return y >= 0 ? a : -a
|
||||
|
||||
/proc/Ceiling(x, y=1)
|
||||
return -round(-x / y) * y
|
||||
|
||||
/proc/Floor(x, y=1)
|
||||
return round(x / y) * y
|
||||
|
||||
#define Clamp(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) )
|
||||
|
||||
// cotangent
|
||||
/proc/Cot(x)
|
||||
return 1 / Tan(x)
|
||||
|
||||
// cosecant
|
||||
/proc/Csc(x)
|
||||
return 1 / sin(x)
|
||||
|
||||
/proc/Default(a, b)
|
||||
return a ? a : b
|
||||
|
||||
// Greatest Common Divisor - Euclid's algorithm
|
||||
/proc/Gcd(a, b)
|
||||
return b ? Gcd(b, a % b) : a
|
||||
|
||||
/proc/Inverse(x)
|
||||
return 1 / x
|
||||
|
||||
/proc/IsAboutEqual(a, b, deviation = 0.1)
|
||||
return abs(a - b) <= deviation
|
||||
|
||||
/proc/IsEven(x)
|
||||
return x % 2 == 0
|
||||
|
||||
// Returns true if val is from min to max, inclusive.
|
||||
/proc/IsInRange(val, min, max)
|
||||
return min <= val && val <= max
|
||||
|
||||
/proc/IsInteger(x)
|
||||
return round(x) == x
|
||||
|
||||
/proc/IsOdd(x)
|
||||
return !IsEven(x)
|
||||
|
||||
/proc/IsMultiple(x, y)
|
||||
return x % y == 0
|
||||
|
||||
// Least Common Multiple
|
||||
/proc/Lcm(a, b)
|
||||
return abs(a) / Gcd(a, b) * abs(b)
|
||||
|
||||
// Performs a linear interpolation between a and b.
|
||||
// Note that amount=0 returns a, amount=1 returns b, and
|
||||
// amount=0.5 returns the mean of a and b.
|
||||
/proc/Lerp(a, b, amount = 0.5)
|
||||
return a + (b - a) * amount
|
||||
|
||||
//Calculates the sum of a list of numbers.
|
||||
/proc/Sum(var/list/data)
|
||||
. = 0
|
||||
for(var/val in data)
|
||||
.+= val
|
||||
|
||||
//Calculates the mean of a list of numbers.
|
||||
/proc/Mean(var/list/data)
|
||||
. = Sum(data) / (data.len)
|
||||
|
||||
|
||||
// Returns the nth root of x.
|
||||
/proc/Root(n, x)
|
||||
return x ** (1 / n)
|
||||
|
||||
// secant
|
||||
/proc/Sec(x)
|
||||
return 1 / cos(x)
|
||||
|
||||
// The quadratic formula. Returns a list with the solutions, or an empty list
|
||||
// if they are imaginary.
|
||||
/proc/SolveQuadratic(a, b, c)
|
||||
ASSERT(a)
|
||||
. = list()
|
||||
var/d = b*b - 4 * a * c
|
||||
var/bottom = 2 * a
|
||||
if(d < 0) return
|
||||
var/root = sqrt(d)
|
||||
. += (-b + root) / bottom
|
||||
if(!d) return
|
||||
. += (-b - root) / bottom
|
||||
|
||||
// tangent
|
||||
/proc/Tan(x)
|
||||
return sin(x) / cos(x)
|
||||
|
||||
/proc/ToDegrees(radians)
|
||||
// 180 / Pi
|
||||
return radians * 57.2957795
|
||||
|
||||
/proc/ToRadians(degrees)
|
||||
// Pi / 180
|
||||
return degrees * 0.0174532925
|
||||
|
||||
// Will filter out extra rotations and negative rotations
|
||||
// E.g: 540 becomes 180. -180 becomes 180.
|
||||
/proc/SimplifyDegrees(degrees)
|
||||
degrees = degrees % 360
|
||||
if(degrees < 0)
|
||||
degrees += 360
|
||||
return degrees
|
||||
|
||||
// min is inclusive, max is exclusive
|
||||
/proc/Wrap(val, min, max)
|
||||
var/d = max - min
|
||||
var/t = round((val - min) / d)
|
||||
return val - (t * d)
|
||||
|
||||
#define NORM_ROT(rot) ((((rot % 360) + (rot - round(rot, 1))) > 0) ? ((rot % 360) + (rot - round(rot, 1))) : (((rot % 360) + (rot - round(rot, 1))) + 360))
|
||||
|
||||
/proc/get_angle_of_incidence(face_angle, angle_in, auto_normalize = TRUE)
|
||||
@@ -146,39 +146,39 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
|
||||
return incidence_s
|
||||
else
|
||||
return incidence
|
||||
|
||||
//A logarithm that converts an integer to a number scaled between 0 and 1 (can be tweaked to be higher).
|
||||
//Currently, this is used for hydroponics-produce sprite transforming, but could be useful for other transform functions.
|
||||
/proc/TransformUsingVariable(input, inputmaximum, scaling_modifier = 0)
|
||||
|
||||
var/inputToDegrees = (input/inputmaximum)*180 //Converting from a 0 -> 100 scale to a 0 -> 180 scale. The 0 -> 180 scale corresponds to degrees
|
||||
var/size_factor = ((-cos(inputToDegrees) +1) /2) //returns a value from 0 to 1
|
||||
|
||||
return size_factor + scaling_modifier //scale mod of 0 results in a number from 0 to 1. A scale modifier of +0.5 returns 0.5 to 1.5
|
||||
//to_chat(world, "Transform multiplier of [src] is [size_factor + scaling_modifer]")
|
||||
|
||||
//converts a uniform distributed random number into a normal distributed one
|
||||
//since this method produces two random numbers, one is saved for subsequent calls
|
||||
//(making the cost negligble for every second call)
|
||||
//This will return +/- decimals, situated about mean with standard deviation stddev
|
||||
//68% chance that the number is within 1stddev
|
||||
//95% chance that the number is within 2stddev
|
||||
//98% chance that the number is within 3stddev...etc
|
||||
#define ACCURACY 10000
|
||||
/proc/gaussian(mean, stddev)
|
||||
var/static/gaussian_next
|
||||
var/R1;var/R2;var/working
|
||||
if(gaussian_next != null)
|
||||
R1 = gaussian_next
|
||||
gaussian_next = null
|
||||
else
|
||||
do
|
||||
R1 = rand(-ACCURACY,ACCURACY)/ACCURACY
|
||||
R2 = rand(-ACCURACY,ACCURACY)/ACCURACY
|
||||
working = R1*R1 + R2*R2
|
||||
while(working >= 1 || working==0)
|
||||
working = sqrt(-2 * log(working) / working)
|
||||
R1 *= working
|
||||
gaussian_next = R2 * working
|
||||
return (mean + stddev * R1)
|
||||
#undef ACCURACY
|
||||
|
||||
//A logarithm that converts an integer to a number scaled between 0 and 1 (can be tweaked to be higher).
|
||||
//Currently, this is used for hydroponics-produce sprite transforming, but could be useful for other transform functions.
|
||||
/proc/TransformUsingVariable(input, inputmaximum, scaling_modifier = 0)
|
||||
|
||||
var/inputToDegrees = (input/inputmaximum)*180 //Converting from a 0 -> 100 scale to a 0 -> 180 scale. The 0 -> 180 scale corresponds to degrees
|
||||
var/size_factor = ((-cos(inputToDegrees) +1) /2) //returns a value from 0 to 1
|
||||
|
||||
return size_factor + scaling_modifier //scale mod of 0 results in a number from 0 to 1. A scale modifier of +0.5 returns 0.5 to 1.5
|
||||
//to_chat(world, "Transform multiplier of [src] is [size_factor + scaling_modifer]")
|
||||
|
||||
//converts a uniform distributed random number into a normal distributed one
|
||||
//since this method produces two random numbers, one is saved for subsequent calls
|
||||
//(making the cost negligble for every second call)
|
||||
//This will return +/- decimals, situated about mean with standard deviation stddev
|
||||
//68% chance that the number is within 1stddev
|
||||
//95% chance that the number is within 2stddev
|
||||
//98% chance that the number is within 3stddev...etc
|
||||
#define ACCURACY 10000
|
||||
/proc/gaussian(mean, stddev)
|
||||
var/static/gaussian_next
|
||||
var/R1;var/R2;var/working
|
||||
if(gaussian_next != null)
|
||||
R1 = gaussian_next
|
||||
gaussian_next = null
|
||||
else
|
||||
do
|
||||
R1 = rand(-ACCURACY,ACCURACY)/ACCURACY
|
||||
R2 = rand(-ACCURACY,ACCURACY)/ACCURACY
|
||||
working = R1*R1 + R2*R2
|
||||
while(working >= 1 || working==0)
|
||||
working = sqrt(-2 * log(working) / working)
|
||||
R1 *= working
|
||||
gaussian_next = R2 * working
|
||||
return (mean + stddev * R1)
|
||||
#undef ACCURACY
|
||||
|
||||
+536
-536
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/proc/priority_announce(text, title = "", sound = 'sound/AI/attention.ogg', type)
|
||||
/proc/priority_announce(text, title = "", sound = 'sound/ai/attention.ogg', type)
|
||||
if(!text)
|
||||
return
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
title = "Classified [command_name()] Update"
|
||||
|
||||
if(announce)
|
||||
priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg')
|
||||
priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/ai/commandreport.ogg')
|
||||
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
if(!(C.stat & (BROKEN|NOPOWER)) && C.z == ZLEVEL_STATION)
|
||||
|
||||
+611
-611
File diff suppressed because it is too large
Load Diff
@@ -37,3 +37,16 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
|
||||
return GLOB.midnight_rollovers++
|
||||
return GLOB.midnight_rollovers
|
||||
|
||||
/proc/weekdayofthemonth()
|
||||
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
|
||||
switch(DD)
|
||||
if(8 to 13)
|
||||
return 2
|
||||
if(14 to 20)
|
||||
return 3
|
||||
if(21 to 27)
|
||||
return 4
|
||||
if(28 to INFINITY)
|
||||
return 5
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
/world/proc/file2list(filename, seperator="\n")
|
||||
return splittext(file2text(filename),seperator)
|
||||
|
||||
|
||||
//Turns a direction into text
|
||||
/proc/dir2text(direction)
|
||||
switch(direction)
|
||||
@@ -200,8 +199,8 @@
|
||||
. += "[seperator]+PERMISSIONS"
|
||||
if(rights & R_STEALTH)
|
||||
. += "[seperator]+STEALTH"
|
||||
if(rights & R_REJUVINATE)
|
||||
. += "[seperator]+REJUVINATE"
|
||||
if(rights & R_POLL)
|
||||
. += "[seperator]+POLL"
|
||||
if(rights & R_VAREDIT)
|
||||
. += "[seperator]+VAREDIT"
|
||||
if(rights & R_SOUNDS)
|
||||
|
||||
@@ -722,11 +722,11 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
//Irregular objects
|
||||
var/icon/AMicon = icon(AM.icon, AM.icon_state)
|
||||
var/icon/AMiconheight = AMicon.Height()
|
||||
var/icon/AMiconwidth = AMicon.Width()
|
||||
var/AMiconheight = AMicon.Height()
|
||||
var/AMiconwidth = AMicon.Width()
|
||||
if(AMiconheight != world.icon_size || AMiconwidth != world.icon_size)
|
||||
pixel_x_offset += ((AMicon.Width()/world.icon_size)-1)*(world.icon_size*0.5)
|
||||
pixel_y_offset += ((AMicon.Height()/world.icon_size)-1)*(world.icon_size*0.5)
|
||||
pixel_x_offset += ((AMiconwidth/world.icon_size)-1)*(world.icon_size*0.5)
|
||||
pixel_y_offset += ((AMiconheight/world.icon_size)-1)*(world.icon_size*0.5)
|
||||
|
||||
//DY and DX
|
||||
var/rough_x = round(round(pixel_x_offset,world.icon_size)/world.icon_size)
|
||||
@@ -1225,7 +1225,7 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
|
||||
|
||||
/proc/flash_color(mob_or_client, flash_color="#960000", flash_time=20)
|
||||
var/client/C
|
||||
if(istype(mob_or_client, /mob))
|
||||
if(ismob(mob_or_client))
|
||||
var/mob/M = mob_or_client
|
||||
if(M.client)
|
||||
C = M.client
|
||||
@@ -1245,9 +1245,15 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
|
||||
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE)
|
||||
#define QDEL_NULL(item) qdel(item); item = null
|
||||
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
|
||||
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)
|
||||
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
|
||||
#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qel(L[I]); L.Cut(); }
|
||||
|
||||
/proc/______qdel_list_wrapper(list/L) //the underscores are to encourage people not to use this directly.
|
||||
QDEL_LIST(L)
|
||||
|
||||
|
||||
|
||||
/proc/random_nukecode()
|
||||
var/val = rand(0, 99999)
|
||||
var/str = "[val]"
|
||||
|
||||
@@ -69,5 +69,9 @@
|
||||
#error You need version 511 or higher
|
||||
#endif
|
||||
|
||||
#define SERVICE_CMD_PARAM_KEY "serviceCommsKey"
|
||||
|
||||
#define SERVICE_CMD_PARAM_KEY "serviceCommsKey"
|
||||
//Update this whenever the db schema changes
|
||||
//make sure you add an update to the schema_version stable in the db changelog
|
||||
#define DB_MAJOR_VERSION 3
|
||||
#define DB_MINOR_VERSION 0
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
GLOBAL_REAL(config, /datum/configuration)
|
||||
|
||||
GLOBAL_DATUM_INIT(revdata, /datum/getrev, new)
|
||||
|
||||
GLOBAL_VAR(host)
|
||||
GLOBAL_VAR(join_motd)
|
||||
GLOBAL_VAR(station_name)
|
||||
GLOBAL_VAR_INIT(game_version, "/tg/ Station 13")
|
||||
GLOBAL_VAR_INIT(changelog_hash, "")
|
||||
|
||||
GLOBAL_VAR_INIT(ooc_allowed, TRUE) // used with admin verbs to disable ooc - not a config option apparently
|
||||
GLOBAL_VAR_INIT(dooc_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(abandon_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(enter_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(guests_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(shuttle_frozen, FALSE)
|
||||
GLOBAL_VAR_INIT(shuttle_left, FALSE)
|
||||
GLOBAL_VAR_INIT(tinted_weldhelh, TRUE)
|
||||
|
||||
|
||||
// Debug is used exactly once (in living.dm) but is commented out in a lot of places. It is not set anywhere and only checked.
|
||||
// Debug2 is used in conjunction with a lot of admin verbs and therefore is actually legit.
|
||||
GLOBAL_VAR_INIT(Debug, FALSE) // global debug switch
|
||||
GLOBAL_VAR_INIT(Debug2, FALSE)
|
||||
GLOBAL_REAL(config, /datum/configuration)
|
||||
|
||||
GLOBAL_DATUM_INIT(revdata, /datum/getrev, new)
|
||||
|
||||
GLOBAL_VAR(host)
|
||||
GLOBAL_VAR(join_motd)
|
||||
GLOBAL_VAR(station_name)
|
||||
GLOBAL_VAR_INIT(game_version, "/tg/ Station 13")
|
||||
GLOBAL_VAR_INIT(changelog_hash, "")
|
||||
|
||||
GLOBAL_VAR_INIT(ooc_allowed, TRUE) // used with admin verbs to disable ooc - not a config option apparently
|
||||
GLOBAL_VAR_INIT(dooc_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(abandon_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(enter_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(guests_allowed, TRUE)
|
||||
GLOBAL_VAR_INIT(shuttle_frozen, FALSE)
|
||||
GLOBAL_VAR_INIT(shuttle_left, FALSE)
|
||||
GLOBAL_VAR_INIT(tinted_weldhelh, TRUE)
|
||||
|
||||
|
||||
// Debug is used exactly once (in living.dm) but is commented out in a lot of places. It is not set anywhere and only checked.
|
||||
// Debug2 is used in conjunction with a lot of admin verbs and therefore is actually legit.
|
||||
GLOBAL_VAR_INIT(Debug, FALSE) // global debug switch
|
||||
GLOBAL_VAR_INIT(Debug2, FALSE)
|
||||
|
||||
//This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage
|
||||
GLOBAL_VAR_INIT(MAX_EX_DEVESTATION_RANGE, 3)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
GLOBAL_VAR_INIT(master_mode, "traitor") //"extended"
|
||||
GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode
|
||||
|
||||
GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name
|
||||
GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report
|
||||
|
||||
// Cult, needs to be global so admin cultists are functional
|
||||
GLOBAL_VAR_INIT(blood_target, null) // Cult Master's target or Construct's Master
|
||||
GLOBAL_DATUM(blood_target_image, /image)
|
||||
GLOBAL_VAR_INIT(blood_target_reset_timer, null)
|
||||
GLOBAL_DATUM(sac_mind, /datum/mind)
|
||||
GLOBAL_VAR_INIT(sac_image, null)
|
||||
GLOBAL_VAR_INIT(cult_vote_called, FALSE)
|
||||
GLOBAL_VAR_INIT(cult_mastered, FALSE)
|
||||
GLOBAL_VAR_INIT(reckoning_complete, FALSE)
|
||||
GLOBAL_VAR_INIT(sac_complete, FALSE)
|
||||
GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode
|
||||
|
||||
GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name
|
||||
GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report
|
||||
|
||||
// Cult, needs to be global so admin cultists are functional
|
||||
GLOBAL_VAR_INIT(blood_target, null) // Cult Master's target or Construct's Master
|
||||
GLOBAL_DATUM(blood_target_image, /image)
|
||||
GLOBAL_VAR_INIT(blood_target_reset_timer, null)
|
||||
GLOBAL_DATUM(sac_mind, /datum/mind)
|
||||
GLOBAL_VAR_INIT(sac_image, null)
|
||||
GLOBAL_VAR_INIT(cult_vote_called, FALSE)
|
||||
GLOBAL_VAR_INIT(cult_mastered, FALSE)
|
||||
GLOBAL_VAR_INIT(reckoning_complete, FALSE)
|
||||
GLOBAL_VAR_INIT(sac_complete, FALSE)
|
||||
GLOBAL_DATUM(cult_narsie, /obj/singularity/narsie/large/cult)
|
||||
GLOBAL_LIST_EMPTY(summon_spots)
|
||||
@@ -43,12 +43,12 @@ GLOBAL_LIST_INIT(security_depts_prefs, list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_
|
||||
//Backpacks
|
||||
#define GBACKPACK "Grey Backpack"
|
||||
#define GSATCHEL "Grey Satchel"
|
||||
#define Gduffelbag "Grey duffelbag"
|
||||
#define GDUFFELBAG "Grey Duffel Bag"
|
||||
#define LSATCHEL "Leather Satchel"
|
||||
#define DBACKPACK "Department Backpack"
|
||||
#define DSATCHEL "Department Satchel"
|
||||
#define Dduffelbag "Department duffelbag"
|
||||
GLOBAL_LIST_INIT(backbaglist, list(DBACKPACK, DSATCHEL, Dduffelbag, GBACKPACK, GSATCHEL, Gduffelbag, LSATCHEL))
|
||||
#define DDUFFELBAG "Department Duffel Bag"
|
||||
GLOBAL_LIST_INIT(backbaglist, list(DBACKPACK, DSATCHEL, DDUFFELBAG, GBACKPACK, GSATCHEL, GDUFFELBAG, LSATCHEL))
|
||||
|
||||
//Uplink spawn loc
|
||||
#define UPLINK_PDA "PDA"
|
||||
@@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(female_clothing_icons)
|
||||
//radical shit
|
||||
GLOBAL_LIST_INIT(hit_appends, list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF"))
|
||||
|
||||
GLOBAL_LIST_INIT(scarySounds, list('sound/weapons/thudswoosh.ogg','sound/weapons/Taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg','sound/items/Welder.ogg','sound/items/Welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg'))
|
||||
GLOBAL_LIST_INIT(scarySounds, list('sound/weapons/thudswoosh.ogg','sound/weapons/taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg','sound/items/welder.ogg','sound/items/welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg'))
|
||||
|
||||
|
||||
// Reference list for disposal sort junctions. Set the sortType variable on disposal sort junctions to
|
||||
@@ -154,11 +154,12 @@ GLOBAL_LIST_INIT(numbers_as_words, list("One", "Two", "Three", "Four",
|
||||
"Eighteen", "Nineteen"))
|
||||
|
||||
/proc/generate_number_strings()
|
||||
var/list/L
|
||||
var/list/L[198]
|
||||
for(var/i in 1 to 99)
|
||||
L += "[i]"
|
||||
L += "\Roman[i]"
|
||||
return L
|
||||
|
||||
GLOBAL_LIST_INIT(station_numerals, greek_letters + phonetic_alphabet + numbers_as_words + generate_number_strings())
|
||||
|
||||
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!"))
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
GLOBAL_LIST_EMPTY(clients) //all clients
|
||||
GLOBAL_LIST_EMPTY(admins) //all clients whom are admins
|
||||
GLOBAL_PROTECT(admins)
|
||||
GLOBAL_LIST_EMPTY(deadmins) //all clients who have used the de-admin verb.
|
||||
GLOBAL_PROTECT(deadmins)
|
||||
GLOBAL_LIST_EMPTY(directory) //all ckeys with associated client
|
||||
GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, for stealthmins
|
||||
|
||||
//Since it didn't really belong in any other category, I'm putting this here
|
||||
//This is for procs to replace all the goddamn 'in world's that are chilling around the code
|
||||
|
||||
GLOBAL_LIST_EMPTY(player_list) //all mobs **with clients attached**. Excludes /mob/dead/new_player
|
||||
GLOBAL_LIST_EMPTY(mob_list) //all mobs, including clientless
|
||||
GLOBAL_LIST_EMPTY(clients) //all clients
|
||||
GLOBAL_LIST_EMPTY(admins) //all clients whom are admins
|
||||
GLOBAL_PROTECT(admins)
|
||||
GLOBAL_LIST_EMPTY(deadmins) //all clients who have used the de-admin verb.
|
||||
GLOBAL_PROTECT(deadmins)
|
||||
GLOBAL_LIST_EMPTY(directory) //all ckeys with associated client
|
||||
GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, for stealthmins
|
||||
|
||||
//Since it didn't really belong in any other category, I'm putting this here
|
||||
//This is for procs to replace all the goddamn 'in world's that are chilling around the code
|
||||
|
||||
GLOBAL_LIST_EMPTY(player_list) //all mobs **with clients attached**. Excludes /mob/dead/new_player
|
||||
GLOBAL_LIST_EMPTY(mob_list) //all mobs, including clientless
|
||||
GLOBAL_LIST_EMPTY(mob_directory) //mob_id -> mob
|
||||
GLOBAL_LIST_EMPTY(living_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player
|
||||
GLOBAL_LIST_EMPTY(dead_mob_list) //all dead mobs, including clientless. Excludes /mob/dead/new_player
|
||||
GLOBAL_LIST_EMPTY(joined_player_list) //all clients that have joined the game at round-start or as a latejoin.
|
||||
GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs
|
||||
GLOBAL_LIST_EMPTY(ai_list)
|
||||
GLOBAL_LIST_EMPTY(pai_list)
|
||||
GLOBAL_LIST_EMPTY(available_ai_shells)
|
||||
GLOBAL_LIST_EMPTY(living_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player
|
||||
GLOBAL_LIST_EMPTY(dead_mob_list) //all dead mobs, including clientless. Excludes /mob/dead/new_player
|
||||
GLOBAL_LIST_EMPTY(joined_player_list) //all clients that have joined the game at round-start or as a latejoin.
|
||||
GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs
|
||||
GLOBAL_LIST_EMPTY(ai_list)
|
||||
GLOBAL_LIST_EMPTY(pai_list)
|
||||
GLOBAL_LIST_EMPTY(available_ai_shells)
|
||||
GLOBAL_LIST_EMPTY(simple_animals)
|
||||
|
||||
GLOBAL_LIST_EMPTY(language_datum_instances)
|
||||
|
||||
@@ -15,9 +15,9 @@ GLOBAL_LIST_INIT(carp_names, world.file2list("strings/names/carp.txt"))
|
||||
GLOBAL_LIST_INIT(golem_names, world.file2list("strings/names/golem.txt"))
|
||||
GLOBAL_LIST_INIT(plasmaman_names, world.file2list("strings/names/plasmaman.txt"))
|
||||
GLOBAL_LIST_INIT(posibrain_names, world.file2list("strings/names/posibrain.txt"))
|
||||
|
||||
|
||||
|
||||
|
||||
GLOBAL_LIST_INIT(verbs, world.file2list("strings/names/verbs.txt"))
|
||||
GLOBAL_LIST_INIT(adjectives, world.file2list("strings/names/adjectives.txt"))
|
||||
//loaded on startup because of "
|
||||
//would include in rsc if ' was used
|
||||
//loaded on startup because of "
|
||||
//would include in rsc if ' was used
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
GLOBAL_LIST_EMPTY(cable_list) //Index for all cables, so that powernets don't have to look through the entire world all the time
|
||||
GLOBAL_LIST_EMPTY(portals) //list of all /obj/effect/portal
|
||||
GLOBAL_LIST_EMPTY(airlocks) //list of all airlocks
|
||||
GLOBAL_LIST_EMPTY(mechas_list) //list of all mechs. Used by hostile mobs target tracking.
|
||||
GLOBAL_LIST_EMPTY(shuttle_caller_list) //list of all communication consoles and AIs, for automatic shuttle calls when there are none.
|
||||
GLOBAL_LIST_EMPTY(machines) //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing !
|
||||
GLOBAL_LIST_EMPTY(syndicate_shuttle_boards) //important to keep track of for managing nukeops war declarations.
|
||||
GLOBAL_LIST_EMPTY(navbeacons) //list of all bot nagivation beacons, used for patrolling.
|
||||
GLOBAL_LIST_EMPTY(teleportbeacons) //list of all tracking beacons used by teleporters
|
||||
GLOBAL_LIST_EMPTY(deliverybeacons) //list of all MULEbot delivery beacons.
|
||||
GLOBAL_LIST_EMPTY(deliverybeacontags) //list of all tags associated with delivery beacons.
|
||||
GLOBAL_LIST_EMPTY(nuke_list)
|
||||
GLOBAL_LIST_EMPTY(alarmdisplay) //list of all machines or programs that can display station alerts
|
||||
GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the station (actually technically all engines)
|
||||
|
||||
GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions
|
||||
GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
|
||||
GLOBAL_LIST_EMPTY(materials_list) //list of all /datum/material datums indexed by material id.
|
||||
GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id.
|
||||
GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path.
|
||||
GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes
|
||||
GLOBAL_LIST_EMPTY(rcd_list) //list of Rapid Construction Devices.
|
||||
GLOBAL_LIST_EMPTY(apcs_list) //list of all Area Power Controller machines, seperate from machines for powernet speeeeeeed.
|
||||
GLOBAL_LIST_EMPTY(tracked_implants) //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented...
|
||||
GLOBAL_LIST_EMPTY(tracked_chem_implants) //list of implants the prisoner console can track and send inject commands too
|
||||
GLOBAL_LIST_EMPTY(poi_list) //list of points of interest for observe/follow
|
||||
GLOBAL_LIST_EMPTY(pinpointer_list) //list of all pinpointers. Used to change stuff they are pointing to all at once.
|
||||
GLOBAL_LIST_EMPTY(zombie_infection_list) // A list of all zombie_infection organs, for any mass "animation"
|
||||
GLOBAL_LIST_EMPTY(meteor_list) // List of all meteors.
|
||||
GLOBAL_LIST_EMPTY(active_jammers) // List of active radio jammers
|
||||
GLOBAL_LIST_EMPTY(ladders)
|
||||
GLOBAL_LIST_EMPTY(cable_list) //Index for all cables, so that powernets don't have to look through the entire world all the time
|
||||
GLOBAL_LIST_EMPTY(portals) //list of all /obj/effect/portal
|
||||
GLOBAL_LIST_EMPTY(airlocks) //list of all airlocks
|
||||
GLOBAL_LIST_EMPTY(mechas_list) //list of all mechs. Used by hostile mobs target tracking.
|
||||
GLOBAL_LIST_EMPTY(shuttle_caller_list) //list of all communication consoles and AIs, for automatic shuttle calls when there are none.
|
||||
GLOBAL_LIST_EMPTY(machines) //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing !
|
||||
GLOBAL_LIST_EMPTY(syndicate_shuttle_boards) //important to keep track of for managing nukeops war declarations.
|
||||
GLOBAL_LIST_EMPTY(navbeacons) //list of all bot nagivation beacons, used for patrolling.
|
||||
GLOBAL_LIST_EMPTY(teleportbeacons) //list of all tracking beacons used by teleporters
|
||||
GLOBAL_LIST_EMPTY(deliverybeacons) //list of all MULEbot delivery beacons.
|
||||
GLOBAL_LIST_EMPTY(deliverybeacontags) //list of all tags associated with delivery beacons.
|
||||
GLOBAL_LIST_EMPTY(nuke_list)
|
||||
GLOBAL_LIST_EMPTY(alarmdisplay) //list of all machines or programs that can display station alerts
|
||||
GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the station (actually technically all engines)
|
||||
|
||||
GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions
|
||||
GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
|
||||
GLOBAL_LIST_EMPTY(materials_list) //list of all /datum/material datums indexed by material id.
|
||||
GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id.
|
||||
GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path.
|
||||
GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes
|
||||
GLOBAL_LIST_EMPTY(rcd_list) //list of Rapid Construction Devices.
|
||||
GLOBAL_LIST_EMPTY(apcs_list) //list of all Area Power Controller machines, seperate from machines for powernet speeeeeeed.
|
||||
GLOBAL_LIST_EMPTY(tracked_implants) //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented...
|
||||
GLOBAL_LIST_EMPTY(tracked_chem_implants) //list of implants the prisoner console can track and send inject commands too
|
||||
GLOBAL_LIST_EMPTY(poi_list) //list of points of interest for observe/follow
|
||||
GLOBAL_LIST_EMPTY(pinpointer_list) //list of all pinpointers. Used to change stuff they are pointing to all at once.
|
||||
GLOBAL_LIST_EMPTY(zombie_infection_list) // A list of all zombie_infection organs, for any mass "animation"
|
||||
GLOBAL_LIST_EMPTY(meteor_list) // List of all meteors.
|
||||
GLOBAL_LIST_EMPTY(active_jammers) // List of active radio jammers
|
||||
GLOBAL_LIST_EMPTY(ladders)
|
||||
GLOBAL_LIST_EMPTY(trophy_cases)
|
||||
|
||||
GLOBAL_LIST_EMPTY(wire_color_directory)
|
||||
|
||||
GLOBAL_LIST_EMPTY(wire_color_directory)
|
||||
GLOBAL_LIST_EMPTY(wire_name_directory)
|
||||
|
||||
GLOBAL_LIST_EMPTY(ai_status_displays)
|
||||
|
||||
+17
-15
@@ -1,16 +1,18 @@
|
||||
GLOBAL_VAR_INIT(admin_notice, "") // Admin notice that all clients see when joining the server
|
||||
|
||||
GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks.
|
||||
|
||||
// For FTP requests. (i.e. downloading runtime logs.)
|
||||
// However it'd be ok to use for accessing attack logs and such too, which are even laggier.
|
||||
GLOBAL_VAR_INIT(fileaccess_timer, 0)
|
||||
|
||||
GLOBAL_VAR_INIT(TAB, " ")
|
||||
|
||||
GLOBAL_VAR_INIT(admin_notice, "") // Admin notice that all clients see when joining the server
|
||||
|
||||
GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks.
|
||||
|
||||
// For FTP requests. (i.e. downloading runtime logs.)
|
||||
// However it'd be ok to use for accessing attack logs and such too, which are even laggier.
|
||||
GLOBAL_VAR_INIT(fileaccess_timer, 0)
|
||||
|
||||
GLOBAL_VAR_INIT(TAB, " ")
|
||||
|
||||
GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
|
||||
|
||||
GLOBAL_VAR_INIT(CELLRATE, 0.002) // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second)
|
||||
GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second)
|
||||
|
||||
GLOBAL_LIST_EMPTY(powernets)
|
||||
|
||||
GLOBAL_VAR_INIT(CELLRATE, 0.002) // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second)
|
||||
GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second)
|
||||
|
||||
GLOBAL_LIST_EMPTY(powernets)
|
||||
|
||||
GLOBAL_VAR_INIT(bsa_unlock, FALSE) //BSA unlocked by head ID swipes
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
//Server API key
|
||||
GLOBAL_REAL_VAR(comms_key) = "default_pwd"
|
||||
GLOBAL_REAL_VAR(comms_allowed) = FALSE //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable)
|
||||
|
||||
GLOBAL_REAL_VAR(medal_hub)
|
||||
GLOBAL_REAL_VAR(medal_pass) = " "
|
||||
GLOBAL_REAL_VAR(medals_enabled) = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls.
|
||||
|
||||
// MySQL configuration
|
||||
|
||||
GLOBAL_REAL_VAR(sqladdress) = "localhost"
|
||||
GLOBAL_REAL_VAR(sqlport) = "3306"
|
||||
GLOBAL_REAL_VAR(sqlfdbkdb) = "test"
|
||||
GLOBAL_REAL_VAR(sqlfdbklogin) = "root"
|
||||
GLOBAL_REAL_VAR(sqlfdbkpass) = ""
|
||||
//Server API key
|
||||
GLOBAL_REAL_VAR(comms_key) = "default_pwd"
|
||||
GLOBAL_REAL_VAR(comms_allowed) = FALSE //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable)
|
||||
|
||||
GLOBAL_REAL_VAR(medal_hub)
|
||||
GLOBAL_REAL_VAR(medal_pass) = " "
|
||||
GLOBAL_REAL_VAR(medals_enabled) = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls.
|
||||
|
||||
// MySQL configuration
|
||||
|
||||
GLOBAL_REAL_VAR(sqladdress) = "localhost"
|
||||
GLOBAL_REAL_VAR(sqlport) = "3306"
|
||||
GLOBAL_REAL_VAR(sqlfdbkdb) = "test"
|
||||
GLOBAL_REAL_VAR(sqlfdbklogin) = "root"
|
||||
GLOBAL_REAL_VAR(sqlfdbkpass) = ""
|
||||
GLOBAL_REAL_VAR(sqlfdbktableprefix) = ""
|
||||
|
||||
@@ -64,18 +64,18 @@
|
||||
* Must be on a turf
|
||||
*/
|
||||
/atom/movable/Adjacent(var/atom/neighbor)
|
||||
if(neighbor == loc)
|
||||
if(neighbor == loc)
|
||||
return TRUE
|
||||
if(!isturf(loc))
|
||||
if(!isturf(loc))
|
||||
return FALSE
|
||||
if(loc.Adjacent(neighbor,target = neighbor))
|
||||
if(loc.Adjacent(neighbor,target = neighbor))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// This is necessary for storage items not on your person.
|
||||
/obj/item/Adjacent(var/atom/neighbor, var/recurse = 1)
|
||||
if(neighbor == loc) return 1
|
||||
if(istype(loc,/obj/item))
|
||||
if(isitem(loc))
|
||||
if(recurse > 0)
|
||||
return loc.Adjacent(neighbor,recurse - 1)
|
||||
return 0
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
return
|
||||
|
||||
/mob/living/carbon/MiddleClickOn(atom/A)
|
||||
if(!src.stat && src.mind && src.mind.changeling && src.mind.changeling.chosen_sting && (istype(A, /mob/living/carbon)) && (A != src))
|
||||
if(!src.stat && src.mind && src.mind.changeling && src.mind.changeling.chosen_sting && (iscarbon(A)) && (A != src))
|
||||
next_click = world.time + 5
|
||||
mind.changeling.chosen_sting.try_to_sting(src, A)
|
||||
else
|
||||
@@ -326,7 +326,7 @@
|
||||
/mob/living/carbon/human/CtrlClick(mob/user)
|
||||
if(ishuman(user) && Adjacent(user))
|
||||
if(world.time < user.next_move)
|
||||
return
|
||||
return FALSE
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.dna.species.grab(H, src, H.mind.martial_art)
|
||||
H.changeNext_move(CLICK_CD_MELEE)
|
||||
@@ -341,7 +341,7 @@
|
||||
return
|
||||
|
||||
/mob/living/carbon/AltClickOn(atom/A)
|
||||
if(!src.stat && src.mind && src.mind.changeling && src.mind.changeling.chosen_sting && (istype(A, /mob/living/carbon)) && (A != src))
|
||||
if(!src.stat && src.mind && src.mind.changeling && src.mind.changeling.chosen_sting && (iscarbon(A)) && (A != src))
|
||||
next_click = world.time + 5
|
||||
mind.changeling.chosen_sting.try_to_sting(src, A)
|
||||
else
|
||||
@@ -443,7 +443,7 @@
|
||||
|
||||
/obj/screen/click_catcher/Click(location, control, params)
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["middle"] && istype(usr, /mob/living/carbon))
|
||||
if(modifiers["middle"] && iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
C.swap_hand()
|
||||
else
|
||||
|
||||
+155
-155
@@ -1,157 +1,157 @@
|
||||
/*
|
||||
Cyborg ClickOn()
|
||||
|
||||
Cyborgs have no range restriction on attack_robot(), because it is basically an AI click.
|
||||
However, they do have a range restriction on item use, so they cannot do without the
|
||||
adjacency code.
|
||||
*/
|
||||
|
||||
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
|
||||
if(world.time <= next_click)
|
||||
return
|
||||
next_click = world.time + 1
|
||||
|
||||
if(client.click_intercept)
|
||||
if(call(client.click_intercept,"InterceptClickOn")(src,params,A))
|
||||
return
|
||||
|
||||
if(stat || lockcharge || weakened || stunned || paralysis)
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
CtrlShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
ShiftMiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["middle"])
|
||||
MiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"]) // alt and alt-gr (rightalt)
|
||||
AltClickOn(A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(next_move >= world.time)
|
||||
return
|
||||
|
||||
face_atom(A) // change direction to face what you clicked on
|
||||
|
||||
/*
|
||||
cyborg restrained() currently does nothing
|
||||
if(restrained())
|
||||
RestrainedClickOn(A)
|
||||
return
|
||||
*/
|
||||
if(aicamera.in_camera_mode) //Cyborg picture taking
|
||||
aicamera.camera_mode_off()
|
||||
aicamera.captureimage(A, usr)
|
||||
return
|
||||
|
||||
var/obj/item/W = get_active_held_item()
|
||||
|
||||
// Cyborgs have no range-checking unless there is item use
|
||||
if(!W)
|
||||
A.attack_robot(src)
|
||||
return
|
||||
|
||||
// buckled cannot prevent machine interlinking but stops arm movement
|
||||
if( buckled || incapacitated())
|
||||
return
|
||||
|
||||
if(W == A)
|
||||
W.attack_self(src)
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
|
||||
if(A == loc || (A in loc) || (A in contents))
|
||||
/*
|
||||
Cyborg ClickOn()
|
||||
|
||||
Cyborgs have no range restriction on attack_robot(), because it is basically an AI click.
|
||||
However, they do have a range restriction on item use, so they cannot do without the
|
||||
adjacency code.
|
||||
*/
|
||||
|
||||
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
|
||||
if(world.time <= next_click)
|
||||
return
|
||||
next_click = world.time + 1
|
||||
|
||||
if(client.click_intercept)
|
||||
if(call(client.click_intercept,"InterceptClickOn")(src,params,A))
|
||||
return
|
||||
|
||||
if(stat || lockcharge || IsKnockdown() || IsStun() || IsUnconscious())
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
CtrlShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
ShiftMiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["middle"])
|
||||
MiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"]) // alt and alt-gr (rightalt)
|
||||
AltClickOn(A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(next_move >= world.time)
|
||||
return
|
||||
|
||||
face_atom(A) // change direction to face what you clicked on
|
||||
|
||||
/*
|
||||
cyborg restrained() currently does nothing
|
||||
if(restrained())
|
||||
RestrainedClickOn(A)
|
||||
return
|
||||
*/
|
||||
if(aicamera.in_camera_mode) //Cyborg picture taking
|
||||
aicamera.camera_mode_off()
|
||||
aicamera.captureimage(A, usr)
|
||||
return
|
||||
|
||||
var/obj/item/W = get_active_held_item()
|
||||
|
||||
// Cyborgs have no range-checking unless there is item use
|
||||
if(!W)
|
||||
A.attack_robot(src)
|
||||
return
|
||||
|
||||
// buckled cannot prevent machine interlinking but stops arm movement
|
||||
if( buckled || incapacitated())
|
||||
return
|
||||
|
||||
if(W == A)
|
||||
W.attack_self(src)
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
|
||||
if(A == loc || (A in loc) || (A in contents))
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
|
||||
if(isturf(A) || isturf(A.loc))
|
||||
if(A.Adjacent(src)) // see adjacent.dm
|
||||
return
|
||||
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
|
||||
if(isturf(A) || isturf(A.loc))
|
||||
if(A.Adjacent(src)) // see adjacent.dm
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
else
|
||||
W.afterattack(A, src, 0, params)
|
||||
return
|
||||
return
|
||||
|
||||
//Middle click cycles through selected modules.
|
||||
/mob/living/silicon/robot/MiddleClickOn(atom/A)
|
||||
cycle_modules()
|
||||
return
|
||||
|
||||
//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks
|
||||
// for non-doors/apcs
|
||||
/mob/living/silicon/robot/CtrlShiftClickOn(atom/A)
|
||||
A.BorgCtrlShiftClick(src)
|
||||
/mob/living/silicon/robot/ShiftClickOn(atom/A)
|
||||
A.BorgShiftClick(src)
|
||||
/mob/living/silicon/robot/CtrlClickOn(atom/A)
|
||||
A.BorgCtrlClick(src)
|
||||
/mob/living/silicon/robot/AltClickOn(atom/A)
|
||||
A.BorgAltClick(src)
|
||||
|
||||
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
CtrlShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlShiftClick() // Sets/Unsets Emergency Access Override Forwards to AI code.
|
||||
AICtrlShiftClick()
|
||||
|
||||
|
||||
/atom/proc/BorgShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
ShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgShiftClick() // Opens and closes doors! Forwards to AI code.
|
||||
AIShiftClick()
|
||||
|
||||
|
||||
/atom/proc/BorgCtrlClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
CtrlClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlClick() // Bolts doors. Forwards to AI code.
|
||||
AICtrlClick()
|
||||
|
||||
/obj/machinery/power/apc/BorgCtrlClick() // turns off/on APCs. Forwards to AI code.
|
||||
AICtrlClick()
|
||||
|
||||
/obj/machinery/turretid/BorgCtrlClick() //turret control on/off. Forwards to AI code.
|
||||
AICtrlClick()
|
||||
|
||||
/atom/proc/BorgAltClick(mob/living/silicon/robot/user)
|
||||
AltClick(user)
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/BorgAltClick() // Eletrifies doors. Forwards to AI code.
|
||||
AIAltClick()
|
||||
|
||||
/obj/machinery/turretid/BorgAltClick() //turret lethal on/off. Forwards to AI code.
|
||||
AIAltClick()
|
||||
|
||||
/*
|
||||
As with AI, these are not used in click code,
|
||||
because the code for robots is specific, not generic.
|
||||
|
||||
If you would like to add advanced features to robot
|
||||
clicks, you can do so here, but you will have to
|
||||
change attack_robot() above to the proper function
|
||||
*/
|
||||
/mob/living/silicon/robot/UnarmedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
/mob/living/silicon/robot/RangedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
|
||||
/atom/proc/attack_robot(mob/user)
|
||||
attack_ai(user)
|
||||
return
|
||||
return
|
||||
else
|
||||
W.afterattack(A, src, 0, params)
|
||||
return
|
||||
return
|
||||
|
||||
//Middle click cycles through selected modules.
|
||||
/mob/living/silicon/robot/MiddleClickOn(atom/A)
|
||||
cycle_modules()
|
||||
return
|
||||
|
||||
//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks
|
||||
// for non-doors/apcs
|
||||
/mob/living/silicon/robot/CtrlShiftClickOn(atom/A)
|
||||
A.BorgCtrlShiftClick(src)
|
||||
/mob/living/silicon/robot/ShiftClickOn(atom/A)
|
||||
A.BorgShiftClick(src)
|
||||
/mob/living/silicon/robot/CtrlClickOn(atom/A)
|
||||
A.BorgCtrlClick(src)
|
||||
/mob/living/silicon/robot/AltClickOn(atom/A)
|
||||
A.BorgAltClick(src)
|
||||
|
||||
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
CtrlShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlShiftClick() // Sets/Unsets Emergency Access Override Forwards to AI code.
|
||||
AICtrlShiftClick()
|
||||
|
||||
|
||||
/atom/proc/BorgShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
ShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgShiftClick() // Opens and closes doors! Forwards to AI code.
|
||||
AIShiftClick()
|
||||
|
||||
|
||||
/atom/proc/BorgCtrlClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
CtrlClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlClick() // Bolts doors. Forwards to AI code.
|
||||
AICtrlClick()
|
||||
|
||||
/obj/machinery/power/apc/BorgCtrlClick() // turns off/on APCs. Forwards to AI code.
|
||||
AICtrlClick()
|
||||
|
||||
/obj/machinery/turretid/BorgCtrlClick() //turret control on/off. Forwards to AI code.
|
||||
AICtrlClick()
|
||||
|
||||
/atom/proc/BorgAltClick(mob/living/silicon/robot/user)
|
||||
AltClick(user)
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/BorgAltClick() // Eletrifies doors. Forwards to AI code.
|
||||
AIAltClick()
|
||||
|
||||
/obj/machinery/turretid/BorgAltClick() //turret lethal on/off. Forwards to AI code.
|
||||
AIAltClick()
|
||||
|
||||
/*
|
||||
As with AI, these are not used in click code,
|
||||
because the code for robots is specific, not generic.
|
||||
|
||||
If you would like to add advanced features to robot
|
||||
clicks, you can do so here, but you will have to
|
||||
change attack_robot() above to the proper function
|
||||
*/
|
||||
/mob/living/silicon/robot/UnarmedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
/mob/living/silicon/robot/RangedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
|
||||
/atom/proc/attack_robot(mob/user)
|
||||
attack_ai(user)
|
||||
return
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
//Hide/Show Action Buttons ... Button
|
||||
/obj/screen/movable/action_button/hide_toggle
|
||||
name = "Hide Buttons"
|
||||
desc = "Shift-click any button to reset its position. Alt-click to reset all buttons to their default positions."
|
||||
icon = 'icons/mob/actions.dmi'
|
||||
icon_state = "bg_default"
|
||||
var/hidden = 0
|
||||
@@ -33,8 +34,18 @@
|
||||
/obj/screen/movable/action_button/hide_toggle/Click(location,control,params)
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"])
|
||||
moved = 0
|
||||
return 1
|
||||
moved = FALSE
|
||||
usr.update_action_buttons(TRUE)
|
||||
return TRUE
|
||||
if(modifiers["alt"])
|
||||
for(var/V in usr.actions)
|
||||
var/datum/action/A = V
|
||||
var/obj/screen/movable/action_button/B = A.button
|
||||
B.moved = FALSE
|
||||
moved = FALSE
|
||||
usr.update_action_buttons(TRUE)
|
||||
to_chat(usr, "<span class='notice'>Action button positions have been reset.</span>")
|
||||
return TRUE
|
||||
usr.hud_used.action_buttons_hidden = !usr.hud_used.action_buttons_hidden
|
||||
|
||||
hidden = usr.hud_used.action_buttons_hidden
|
||||
@@ -45,6 +56,16 @@
|
||||
UpdateIcon()
|
||||
usr.update_action_buttons()
|
||||
|
||||
/obj/screen/movable/action_button/hide_toggle/AltClick(mob/user)
|
||||
for(var/V in user.actions)
|
||||
var/datum/action/A = V
|
||||
var/obj/screen/movable/action_button/B = A.button
|
||||
B.moved = FALSE
|
||||
if(moved)
|
||||
moved = FALSE
|
||||
user.update_action_buttons(TRUE)
|
||||
to_chat(user, "<span class='notice'>Action button positions have been reset.</span>")
|
||||
|
||||
|
||||
/obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud)
|
||||
var settings = owner_hud.get_action_buttons_icons()
|
||||
|
||||
@@ -205,11 +205,6 @@ If you're feeling frisky, click yourself in help intent to pull the object out."
|
||||
var/mob/living/carbon/human/M = usr
|
||||
return M.help_shake_act(M)
|
||||
|
||||
/obj/screen/alert/asleep
|
||||
name = "Asleep"
|
||||
desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are."
|
||||
icon_state = "asleep"
|
||||
|
||||
/obj/screen/alert/weightless
|
||||
name = "Weightless"
|
||||
desc = "Gravity has ceased affecting you, and you're floating around aimlessly. You'll need something large and heavy, like a \
|
||||
@@ -362,7 +357,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
desc = "You shouldn't be seeing this description unless you're very fast. If you're very fast, good job!"
|
||||
icon_state = "no-servants-caches"
|
||||
|
||||
|
||||
/obj/screen/alert/clockwork/scripture_reqs/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
@@ -410,10 +404,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
req_servants = APPLICATION_SERVANT_REQ
|
||||
req_caches = APPLICATION_CACHE_REQ
|
||||
req_cv = APPLICATION_CV_REQ
|
||||
if(SCRIPTURE_REVENANT)
|
||||
req_servants = REVENANT_SERVANT_REQ
|
||||
req_caches = REVENANT_CACHE_REQ
|
||||
req_cv = REVENANT_CV_REQ
|
||||
if(SCRIPTURE_JUDGEMENT)
|
||||
req_servants = JUDGEMENT_SERVANT_REQ
|
||||
req_caches = JUDGEMENT_CACHE_REQ
|
||||
@@ -473,10 +463,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
textlist = list("<b>[servants]</b> Servant, who [validservants ? "counts":"does not count"] towards scripture.<br>")
|
||||
textlist += "<b>[GLOB.clockwork_caches ? "[GLOB.clockwork_caches]</b> Tinkerer's Caches.":"No Tinkerer's Caches, construct one!</b>"]<br>\
|
||||
<b>[GLOB.clockwork_construction_value]</b> Construction Value.<br>"
|
||||
if(GLOB.clockwork_daemons)
|
||||
textlist += "<b>[GLOB.clockwork_daemons]</b> Tinkerer's Daemons: <b>[servants * 0.2 < GLOB.clockwork_daemons ? "DISABLED":"ACTIVE"]</b><br>"
|
||||
else
|
||||
textlist += "No Tinkerer's Daemons.<br>"
|
||||
textlist += "<b>[Floor(servants * 0.2)]</b> Tinkerer's Daemons can be active at once. <b>[LAZYLEN(GLOB.active_daemons)]</b> are active.<br>"
|
||||
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects)
|
||||
var/area/gate_area = get_area(G)
|
||||
textlist += "Ark Location: <b>[uppertext(gate_area.map_name)]</b><br>"
|
||||
@@ -494,18 +481,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
textlist += "<b>[unconverted_ais_exist] unconverted AIs exist!</b><br>"
|
||||
else
|
||||
textlist += "<b>An unconverted AI exists!</b><br>"
|
||||
if(SSticker.scripture_states[SCRIPTURE_REVENANT])
|
||||
var/inathneq_available = GLOB.clockwork_generals_invoked["inath-neq"] <= world.time
|
||||
var/sevtug_available = GLOB.clockwork_generals_invoked["sevtug"] <= world.time
|
||||
var/nezbere_available = GLOB.clockwork_generals_invoked["nezbere"] <= world.time
|
||||
var/nezcrentr_available = GLOB.clockwork_generals_invoked["nzcrentr"] <= world.time
|
||||
if(inathneq_available || sevtug_available || nezbere_available || nezcrentr_available)
|
||||
textlist += "Generals available:<b>[inathneq_available ? "<br><font color=#1E8CE1>INATH-NEQ</font>":""][sevtug_available ? "<br><font color=#AF0AAF>SEVTUG</font>":""]\
|
||||
[nezbere_available ? "<br><font color=#5A6068>NEZBERE</font>":""][nezcrentr_available ? "<br><font color=#DAAA18>NZCRENTR</font>":""]</b><br>"
|
||||
else
|
||||
textlist += "Generals available: <b>NONE</b><br>"
|
||||
else
|
||||
textlist += "Generals available: <b>NONE</b><br>"
|
||||
for(var/i in SSticker.scripture_states)
|
||||
if(i != SCRIPTURE_DRIVER) //ignore the always-unlocked stuff
|
||||
textlist += "[i] Scripture: <b>[SSticker.scripture_states[i] ? "UNLOCKED":"LOCKED"]</b><br>"
|
||||
@@ -700,3 +675,4 @@ so as to remain in compliance with the most up-to-date laws."
|
||||
severity = 0
|
||||
master = null
|
||||
screen_loc = ""
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "leap_off"
|
||||
|
||||
/obj/screen/alien/leap/Click()
|
||||
if(istype(usr, /mob/living/carbon/alien/humanoid/hunter))
|
||||
if(isalienhunter(usr))
|
||||
var/mob/living/carbon/alien/humanoid/hunter/AH = usr
|
||||
AH.toggle_leap()
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
static_inventory += using
|
||||
action_intent = using
|
||||
|
||||
if(istype(mymob, /mob/living/carbon/alien/humanoid/hunter))
|
||||
if(isalienhunter(mymob))
|
||||
var/mob/living/carbon/alien/humanoid/hunter/H = mymob
|
||||
H.leap_icon = new /obj/screen/alien/leap()
|
||||
H.leap_icon.screen_loc = ui_alien_storage_r
|
||||
@@ -96,7 +96,7 @@
|
||||
alien_plasma_display = new /obj/screen/alien/plasma_display()
|
||||
infodisplay += alien_plasma_display
|
||||
|
||||
if(!istype(mymob, /mob/living/carbon/alien/humanoid/royal/queen))
|
||||
if(!isalienqueen(mymob))
|
||||
alien_queen_finder = new /obj/screen/alien/alien_queen_finder
|
||||
infodisplay += alien_queen_finder
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
|
||||
/datum/hud/construct
|
||||
/datum/hud/constructs
|
||||
ui_style_icon = 'icons/mob/screen_construct.dmi'
|
||||
|
||||
/datum/hud/construct/New(mob/owner)
|
||||
|
||||
/datum/hud/constructs/New(mob/owner)
|
||||
..()
|
||||
pull_icon = new /obj/screen/pull()
|
||||
pull_icon.icon = ui_style_icon
|
||||
pull_icon.icon = 'icons/mob/screen_construct.dmi'
|
||||
pull_icon.update_icon(mymob)
|
||||
pull_icon.screen_loc = ui_pull_resist
|
||||
pull_icon.screen_loc = ui_construct_pull
|
||||
static_inventory += pull_icon
|
||||
|
||||
|
||||
healths = new /obj/screen/healths/construct()
|
||||
infodisplay += healths
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/construct/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/construct(src)
|
||||
hud_used = new /datum/hud/constructs(src)
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
/obj/screen/storage/Click(location, control, params)
|
||||
if(world.time <= usr.next_move)
|
||||
return 1
|
||||
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
|
||||
if(usr.stat || usr.IsUnconscious() || usr.IsKnockdown() || usr.IsStun())
|
||||
return 1
|
||||
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
|
||||
return 1
|
||||
|
||||
+113
-113
@@ -1,119 +1,119 @@
|
||||
|
||||
|
||||
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
|
||||
if(pre_attackby(target, user, params))
|
||||
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
|
||||
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
|
||||
var/resolved = target.attackby(src, user, params)
|
||||
if(!resolved && target && !QDELETED(src))
|
||||
afterattack(target, user, 1, params) // 1: clicking something Adjacent
|
||||
|
||||
|
||||
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
|
||||
/obj/item/proc/attack_self(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/proc/pre_attackby(atom/A, mob/living/user, params) //do stuff before attackby!
|
||||
return TRUE //return FALSE to avoid calling attackby after this proc does stuff
|
||||
|
||||
// No comment
|
||||
/atom/proc/attackby(obj/item/W, mob/user, params)
|
||||
return
|
||||
|
||||
/obj/attackby(obj/item/I, mob/living/user, params)
|
||||
return I.attack_obj(src, user)
|
||||
|
||||
/mob/living/attackby(obj/item/I, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(user.a_intent == INTENT_HARM && stat == DEAD && butcher_results) //can we butcher it?
|
||||
var/sharpness = I.is_sharp()
|
||||
if(sharpness)
|
||||
to_chat(user, "<span class='notice'>You begin to butcher [src]...</span>")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
|
||||
|
||||
|
||||
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
|
||||
/obj/item/proc/attack_self(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/proc/pre_attackby(atom/A, mob/living/user, params) //do stuff before attackby!
|
||||
return TRUE //return FALSE to avoid calling attackby after this proc does stuff
|
||||
|
||||
// No comment
|
||||
/atom/proc/attackby(obj/item/W, mob/user, params)
|
||||
return
|
||||
|
||||
/obj/attackby(obj/item/I, mob/living/user, params)
|
||||
return I.attack_obj(src, user)
|
||||
|
||||
/mob/living/attackby(obj/item/I, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(user.a_intent == INTENT_HARM && stat == DEAD && butcher_results) //can we butcher it?
|
||||
var/sharpness = I.is_sharp()
|
||||
if(sharpness)
|
||||
to_chat(user, "<span class='notice'>You begin to butcher [src]...</span>")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
|
||||
if(do_mob(user, src, 80/sharpness) && Adjacent(I))
|
||||
harvest(user)
|
||||
return 1
|
||||
return I.attack(src, user)
|
||||
|
||||
|
||||
/obj/item/proc/attack(mob/living/M, mob/living/user)
|
||||
if(flags & NOBLUDGEON)
|
||||
return
|
||||
if(!force)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)
|
||||
else if(hitsound)
|
||||
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
|
||||
|
||||
user.lastattacked = M
|
||||
M.lastattacker = user
|
||||
|
||||
user.do_attack_animation(M)
|
||||
M.attacked_by(src, user)
|
||||
|
||||
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
//the equivalent of the standard version of attack() but for object targets.
|
||||
/obj/item/proc/attack_obj(obj/O, mob/living/user)
|
||||
if(flags & NOBLUDGEON)
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(O)
|
||||
O.attacked_by(src, user)
|
||||
|
||||
/atom/movable/proc/attacked_by()
|
||||
return
|
||||
|
||||
/obj/attacked_by(obj/item/I, mob/living/user)
|
||||
if(I.force)
|
||||
visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
//only witnesses close by and the victim see a hit message.
|
||||
take_damage(I.force, I.damtype, "melee", 1)
|
||||
|
||||
/mob/living/attacked_by(obj/item/I, mob/living/user)
|
||||
send_item_attack_message(I, user)
|
||||
if(I.force)
|
||||
apply_damage(I.force, I.damtype)
|
||||
if(I.damtype == BRUTE)
|
||||
if(prob(33))
|
||||
I.add_mob_blood(src)
|
||||
var/turf/location = get_turf(src)
|
||||
add_splatter_floor(location)
|
||||
if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
|
||||
user.add_mob_blood(src)
|
||||
return TRUE //successful attack
|
||||
|
||||
/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user)
|
||||
if(I.force < force_threshold || I.damtype == STAMINA)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), 1, -1)
|
||||
else
|
||||
return ..()
|
||||
|
||||
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
|
||||
// Click parameters is the params string from byond Click() code, see that documentation.
|
||||
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/proc/get_clamped_volume()
|
||||
if(w_class)
|
||||
if(force)
|
||||
return Clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
|
||||
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)
|
||||
var/message_verb = "attacked"
|
||||
if(I.attack_verb && I.attack_verb.len)
|
||||
message_verb = "[pick(I.attack_verb)]"
|
||||
else if(!I.force)
|
||||
return
|
||||
var/message_hit_area = ""
|
||||
if(hit_area)
|
||||
message_hit_area = " in the [hit_area]"
|
||||
var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]."
|
||||
if(user in viewers(src, null))
|
||||
attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!"
|
||||
visible_message("<span class='danger'>[attack_message]</span>", \
|
||||
"<span class='userdanger'>[attack_message]</span>", null, COMBAT_MESSAGE_RANGE)
|
||||
return 1
|
||||
|
||||
harvest(user)
|
||||
return 1
|
||||
return I.attack(src, user)
|
||||
|
||||
|
||||
/obj/item/proc/attack(mob/living/M, mob/living/user)
|
||||
if(flags & NOBLUDGEON)
|
||||
return
|
||||
if(!force)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)
|
||||
else if(hitsound)
|
||||
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
|
||||
|
||||
user.lastattacked = M
|
||||
M.lastattacker = user
|
||||
|
||||
user.do_attack_animation(M)
|
||||
M.attacked_by(src, user)
|
||||
|
||||
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
//the equivalent of the standard version of attack() but for object targets.
|
||||
/obj/item/proc/attack_obj(obj/O, mob/living/user)
|
||||
if(flags & NOBLUDGEON)
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(O)
|
||||
O.attacked_by(src, user)
|
||||
|
||||
/atom/movable/proc/attacked_by()
|
||||
return
|
||||
|
||||
/obj/attacked_by(obj/item/I, mob/living/user)
|
||||
if(I.force)
|
||||
visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
//only witnesses close by and the victim see a hit message.
|
||||
take_damage(I.force, I.damtype, "melee", 1)
|
||||
|
||||
/mob/living/attacked_by(obj/item/I, mob/living/user)
|
||||
send_item_attack_message(I, user)
|
||||
if(I.force)
|
||||
apply_damage(I.force, I.damtype)
|
||||
if(I.damtype == BRUTE)
|
||||
if(prob(33))
|
||||
I.add_mob_blood(src)
|
||||
var/turf/location = get_turf(src)
|
||||
add_splatter_floor(location)
|
||||
if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
|
||||
user.add_mob_blood(src)
|
||||
return TRUE //successful attack
|
||||
|
||||
/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user)
|
||||
if(I.force < force_threshold || I.damtype == STAMINA)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), 1, -1)
|
||||
else
|
||||
return ..()
|
||||
|
||||
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
|
||||
// Click parameters is the params string from byond Click() code, see that documentation.
|
||||
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/proc/get_clamped_volume()
|
||||
if(w_class)
|
||||
if(force)
|
||||
return Clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
|
||||
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)
|
||||
var/message_verb = "attacked"
|
||||
if(I.attack_verb && I.attack_verb.len)
|
||||
message_verb = "[pick(I.attack_verb)]"
|
||||
else if(!I.force)
|
||||
return
|
||||
var/message_hit_area = ""
|
||||
if(hit_area)
|
||||
message_hit_area = " in the [hit_area]"
|
||||
var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]."
|
||||
if(user in viewers(src, null))
|
||||
attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!"
|
||||
visible_message("<span class='danger'>[attack_message]</span>", \
|
||||
"<span class='userdanger'>[attack_message]</span>", null, COMBAT_MESSAGE_RANGE)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return // seems legit.
|
||||
|
||||
// Things you might plausibly want to follow
|
||||
if(istype(A, /atom/movable))
|
||||
if(ismovableatom(A))
|
||||
ManualFollow(A)
|
||||
|
||||
// Otherwise jump
|
||||
@@ -67,8 +67,8 @@
|
||||
user.forceMove(get_turf(com.locked))
|
||||
|
||||
/obj/effect/portal/attack_ghost(mob/user)
|
||||
if(target)
|
||||
user.forceMove(get_turf(target))
|
||||
if(linked)
|
||||
user.forceMove(get_turf(linked))
|
||||
|
||||
/obj/machinery/gateway/centerstation/attack_ghost(mob/user)
|
||||
if(awaygate)
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
return
|
||||
|
||||
|
||||
if(!isturf(target) && istype(focus,/obj/item) && target.Adjacent(focus))
|
||||
if(!isturf(target) && isitem(focus) && target.Adjacent(focus))
|
||||
apply_focus_overlay()
|
||||
var/obj/item/I = focus
|
||||
I.melee_attack_chain(tk_user, target, params) //isn't copying the attack chain fun. we should do it more often.
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
if(R.cell.charge <= 666)
|
||||
return
|
||||
L.Stun(4) // normal stunbaton is force 7 gimme a break good sir!
|
||||
L.Weaken(4)
|
||||
L.Knockdown(80)
|
||||
L.apply_effect(STUTTER, 4)
|
||||
L.visible_message("<span class='danger'>[user] has shocked [L] with its tongue!</span>", \
|
||||
"<span class='userdanger'>[user] has shocked you with its tongue! You can feel the betrayal.</span>")
|
||||
@@ -485,8 +485,6 @@
|
||||
dat += "<span style='[toxcolor]'>\t-Toxin Content %: [patient.getToxLoss()]</span><BR>"
|
||||
dat += "<span style='[burncolor]'>\t-Burn Severity %: [patient.getFireLoss()]</span><BR>"
|
||||
|
||||
if(round(patient.paralysis / 4) >= 1)
|
||||
dat += text("<HR>Patient paralyzed for: []<BR>", round(patient.paralysis / 4) >= 1 ? "[round(patient.paralysis / 4)] seconds" : "None")
|
||||
if(patient.getBrainLoss())
|
||||
dat += "<div class='line'><span class='average'>Significant brain damage detected.</span></div><br>"
|
||||
if(patient.getCloneLoss())
|
||||
@@ -579,8 +577,9 @@
|
||||
if(patient.health < 0)
|
||||
patient.adjustOxyLoss(-1) //Heal some oxygen damage if they're in critical condition
|
||||
patient.updatehealth()
|
||||
patient.AdjustStunned(-4)
|
||||
patient.AdjustWeakened(-4)
|
||||
patient.AdjustStun(-80)
|
||||
patient.AdjustKnockdown(-80)
|
||||
patient.AdjustUnconscious(-80)
|
||||
src.drain()
|
||||
if((patient.reagents.get_reagent_amount("epinephrine") < 5) && (patient.health < patient.maxHealth)) //Stop pumping full HP people full of drugs. Don't heal people you're digesting, meanie.
|
||||
patient.reagents.add_reagent("epinephrine", 5)
|
||||
@@ -916,18 +915,18 @@
|
||||
blocked = 1
|
||||
if(!blocked)
|
||||
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
|
||||
L.Weaken(3)
|
||||
L.Knockdown(100)
|
||||
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
|
||||
step_towards(src,L)
|
||||
else
|
||||
Weaken(2, 1, 1)
|
||||
Knockdown(40, 1, 1)
|
||||
|
||||
pounce_cooldown = !pounce_cooldown
|
||||
spawn(pounce_cooldown_time) //3s by default
|
||||
pounce_cooldown = !pounce_cooldown
|
||||
else if(A.density && !A.CanPass(src))
|
||||
visible_message("<span class ='danger'>[src] smashes into [A]!</span>", "<span class ='alertalien'>[src] smashes into [A]!</span>")
|
||||
Weaken(2, 1, 1)
|
||||
Knockdown(40, 1, 1)
|
||||
|
||||
if(leaping)
|
||||
leaping = 0
|
||||
|
||||
@@ -265,6 +265,8 @@
|
||||
|
||||
var/irc_announce_new_game = FALSE
|
||||
|
||||
var/list/policies = list()
|
||||
|
||||
/datum/configuration/New()
|
||||
gamemode_cache = typecacheof(/datum/game_mode,TRUE)
|
||||
for(var/T in gamemode_cache)
|
||||
@@ -288,6 +290,7 @@
|
||||
/datum/configuration/proc/Reload()
|
||||
load("config/config.txt")
|
||||
load("config/game_options.txt","game_options")
|
||||
load("config/policies.txt", "policies")
|
||||
loadsql("config/dbconfig.txt")
|
||||
if (maprotation)
|
||||
loadmaplist("config/maps.txt")
|
||||
@@ -777,12 +780,10 @@
|
||||
arrivals_shuttle_require_safe_latejoin = TRUE
|
||||
if("mice_roundstart")
|
||||
mice_roundstart = text2num(value)
|
||||
if ("mentor_mobname_only")
|
||||
mentors_mobname_only = 1
|
||||
if ("mentor_legacy_system")
|
||||
mentor_legacy_system = 1
|
||||
else
|
||||
GLOB.config_error_log << "Unknown setting in configuration: '[name]'"
|
||||
else if(type == "policies")
|
||||
policies[name] = value
|
||||
|
||||
fps = round(fps)
|
||||
if(fps <= 0)
|
||||
|
||||
+56
-56
@@ -1,66 +1,66 @@
|
||||
GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
|
||||
/datum/controller/global_vars
|
||||
name = "Global Variables"
|
||||
|
||||
var/list/gvars_datum_protected_varlist
|
||||
var/list/gvars_datum_in_built_vars
|
||||
var/list/gvars_datum_init_order
|
||||
|
||||
/datum/controller/global_vars/New()
|
||||
if(GLOB)
|
||||
CRASH("Multiple instances of global variable controller created")
|
||||
GLOB = src
|
||||
|
||||
var/datum/controller/exclude_these = new
|
||||
gvars_datum_in_built_vars = exclude_these.vars + list("gvars_datum_protected_varlist", "gvars_datum_in_built_vars", "gvars_datum_init_order")
|
||||
qdel(exclude_these)
|
||||
|
||||
GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
|
||||
/datum/controller/global_vars
|
||||
name = "Global Variables"
|
||||
|
||||
var/list/gvars_datum_protected_varlist
|
||||
var/list/gvars_datum_in_built_vars
|
||||
var/list/gvars_datum_init_order
|
||||
|
||||
/datum/controller/global_vars/New()
|
||||
if(GLOB)
|
||||
CRASH("Multiple instances of global variable controller created")
|
||||
GLOB = src
|
||||
|
||||
var/datum/controller/exclude_these = new
|
||||
gvars_datum_in_built_vars = exclude_these.vars + list("gvars_datum_protected_varlist", "gvars_datum_in_built_vars", "gvars_datum_init_order")
|
||||
qdel(exclude_these)
|
||||
|
||||
log_world("[vars.len - gvars_datum_in_built_vars.len] global variables")
|
||||
|
||||
Initialize()
|
||||
|
||||
/datum/controller/global_vars/Destroy(force)
|
||||
Initialize()
|
||||
|
||||
/datum/controller/global_vars/Destroy(force)
|
||||
stack_trace("Some fucker qdel'd the global holder!")
|
||||
if(!force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
QDEL_NULL(statclick)
|
||||
gvars_datum_protected_varlist.Cut()
|
||||
gvars_datum_in_built_vars.Cut()
|
||||
|
||||
GLOB = null
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/stat_entry()
|
||||
if(!statclick)
|
||||
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
|
||||
|
||||
if(!force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
QDEL_NULL(statclick)
|
||||
gvars_datum_protected_varlist.Cut()
|
||||
gvars_datum_in_built_vars.Cut()
|
||||
|
||||
GLOB = null
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/stat_entry()
|
||||
if(!statclick)
|
||||
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
|
||||
|
||||
stat("Globals:", statclick.update("Edit"))
|
||||
|
||||
/datum/controller/global_vars/can_vv_get(var_name)
|
||||
if(var_name in gvars_datum_protected_varlist)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/vv_edit_var(var_name, var_value)
|
||||
if((var_name in gvars_datum_protected_varlist))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/Initialize()
|
||||
gvars_datum_init_order = list()
|
||||
gvars_datum_protected_varlist = list("gvars_datum_protected_varlist")
|
||||
|
||||
/datum/controller/global_vars/can_vv_get(var_name)
|
||||
if(var_name in gvars_datum_protected_varlist)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/vv_edit_var(var_name, var_value)
|
||||
if((var_name in gvars_datum_protected_varlist))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/Initialize()
|
||||
gvars_datum_init_order = list()
|
||||
gvars_datum_protected_varlist = list("gvars_datum_protected_varlist")
|
||||
|
||||
//See https://github.com/tgstation/tgstation/issues/26954
|
||||
for(var/I in typesof(/datum/controller/global_vars/proc))
|
||||
var/CLEANBOT_RETURNS = "[I]"
|
||||
pass(CLEANBOT_RETURNS)
|
||||
|
||||
for(var/I in vars - gvars_datum_in_built_vars)
|
||||
var/start_tick = world.time
|
||||
call(src, "InitGlobal[I]")()
|
||||
var/end_tick = world.time
|
||||
if(end_tick - start_tick)
|
||||
warning("Global [I] slept during initialization!")
|
||||
for(var/I in vars - gvars_datum_in_built_vars)
|
||||
var/start_tick = world.time
|
||||
call(src, "InitGlobal[I]")()
|
||||
var/end_tick = world.time
|
||||
if(end_tick - start_tick)
|
||||
warning("Global [I] slept during initialization!")
|
||||
|
||||
@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
initialized = INITIALIZATION_INNEW_MAPLOAD
|
||||
|
||||
LAZYINITLIST(late_loaders)
|
||||
|
||||
|
||||
var/count
|
||||
var/list/mapload_arg = list(TRUE)
|
||||
if(atoms)
|
||||
@@ -60,10 +60,10 @@ SUBSYSTEM_DEF(atoms)
|
||||
A.LateInitialize()
|
||||
testing("Late initialized [late_loaders.len] atoms")
|
||||
late_loaders.Cut()
|
||||
|
||||
|
||||
if(atoms)
|
||||
. = created_atoms + atoms
|
||||
created_atoms = null
|
||||
created_atoms = null
|
||||
|
||||
/datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments)
|
||||
var/the_type = A.type
|
||||
@@ -77,7 +77,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
|
||||
if(start_tick != world.time)
|
||||
BadInitializeCalls[the_type] |= BAD_INIT_SLEPT
|
||||
|
||||
|
||||
var/qdeleted = FALSE
|
||||
|
||||
if(result != INITIALIZE_HINT_NORMAL)
|
||||
@@ -92,12 +92,12 @@ SUBSYSTEM_DEF(atoms)
|
||||
qdeleted = TRUE
|
||||
else
|
||||
BadInitializeCalls[the_type] |= BAD_INIT_NO_HINT
|
||||
|
||||
|
||||
if(!A) //possible harddel
|
||||
qdeleted = TRUE
|
||||
else if(!A.initialized)
|
||||
BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT
|
||||
|
||||
|
||||
return qdeleted || QDELING(A)
|
||||
|
||||
/datum/controller/subsystem/atoms/proc/map_loader_begin()
|
||||
|
||||
@@ -95,11 +95,13 @@ SUBSYSTEM_DEF(blackbox)
|
||||
|
||||
for (var/datum/feedback_variable/FV in feedback)
|
||||
sqlrowlist += list(list("time" = "Now()", "round_id" = GLOB.round_id, "var_name" = "'[sanitizeSQL(FV.get_variable())]'", "var_value" = FV.get_value(), "details" = "'[sanitizeSQL(FV.get_details())]'"))
|
||||
|
||||
if (!length(sqlrowlist))
|
||||
return
|
||||
|
||||
SSdbcore.MassInsert(format_table_name("feedback"), sqlrowlist, ignore_errors = TRUE, delayed = TRUE)
|
||||
|
||||
|
||||
/datum/controller/subsystem/blackbox/proc/LogBroadcast(blackbox_msg, freq)
|
||||
if(sealed)
|
||||
return
|
||||
@@ -209,7 +211,6 @@ SUBSYSTEM_DEF(blackbox)
|
||||
log_game("Blackbox sealed[IsAdminAdvancedProcCall() ? " by [key_name(usr)]" : ""].")
|
||||
sealed = TRUE
|
||||
|
||||
|
||||
//feedback variable datum, for storing all kinds of data
|
||||
/datum/feedback_variable
|
||||
var/variable
|
||||
@@ -268,4 +269,4 @@ SUBSYSTEM_DEF(blackbox)
|
||||
return details
|
||||
|
||||
/datum/feedback_variable/proc/get_parsed()
|
||||
return list(variable,value,details)
|
||||
return list(variable,value,details)
|
||||
|
||||
@@ -70,7 +70,10 @@ SUBSYSTEM_DEF(events)
|
||||
if(!E.canSpawnEvent(players_amt, gamemode))
|
||||
continue
|
||||
if(E.weight < 0) //for round-start events etc.
|
||||
if(TriggerEvent(E))
|
||||
var/res = TriggerEvent(E)
|
||||
if(res == EVENT_INTERRUPTED)
|
||||
continue //like it never happened
|
||||
if(res == EVENT_CANT_RUN)
|
||||
return
|
||||
sum_of_weights += E.weight
|
||||
|
||||
@@ -89,7 +92,7 @@ SUBSYSTEM_DEF(events)
|
||||
. = E.preRunEvent()
|
||||
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_CANCELLED)
|
||||
else if(. == EVENT_READY)
|
||||
E.runEvent(TRUE)
|
||||
|
||||
/datum/round_event/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
|
||||
@@ -172,10 +175,12 @@ SUBSYSTEM_DEF(events)
|
||||
var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year
|
||||
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
|
||||
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
|
||||
var/DDD = text2num(time2text(world.timeofday, "DDD")) // get the current weekday
|
||||
var/W = weekdayofthemonth() // is this the first monday? second? etc.
|
||||
|
||||
for(var/H in subtypesof(/datum/holiday))
|
||||
var/datum/holiday/holiday = new H()
|
||||
if(holiday.shouldCelebrate(DD, MM, YY))
|
||||
if(holiday.shouldCelebrate(DD, MM, YY, W, DDD))
|
||||
holiday.celebrate()
|
||||
if(!holidays)
|
||||
holidays = list()
|
||||
|
||||
@@ -182,14 +182,13 @@ SUBSYSTEM_DEF(garbage)
|
||||
// Should be treated as a replacement for the 'del' keyword.
|
||||
// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
|
||||
/proc/qdel(datum/D, force=FALSE)
|
||||
if(!D)
|
||||
if(!istype(D))
|
||||
del(D)
|
||||
return
|
||||
#ifdef TESTING
|
||||
SSgarbage.qdel_list += "[D.type]"
|
||||
#endif
|
||||
if(!istype(D))
|
||||
del(D)
|
||||
else if(isnull(D.gc_destroyed))
|
||||
if(isnull(D.gc_destroyed))
|
||||
D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED
|
||||
var/start_time = world.time
|
||||
var/hint = D.Destroy(force) // Let our friend know they're about to get fucked up.
|
||||
|
||||
@@ -385,6 +385,7 @@ SUBSYSTEM_DEF(job)
|
||||
log_world("Couldn't find a round start spawn point for [rank]")
|
||||
SendToLateJoin(H)
|
||||
|
||||
|
||||
if(H.mind)
|
||||
H.mind.assigned_role = rank
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
var/list/banned = generateMapList("config/lavaruinblacklist.txt")
|
||||
banned += generateMapList("config/spaceruinblacklist.txt")
|
||||
|
||||
for(var/item in subtypesof(/datum/map_template/ruin))
|
||||
for(var/item in sortList(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority))
|
||||
var/datum/map_template/ruin/ruin_type = item
|
||||
// screen out the abstract subtypes
|
||||
if(!initial(ruin_type.id))
|
||||
|
||||
@@ -2,45 +2,45 @@
|
||||
#define PROCESSING_NPCS 1
|
||||
#define PROCESSING_DELEGATES 2
|
||||
#define PROCESSING_ASSISTANTS 3
|
||||
|
||||
SUBSYSTEM_DEF(npcpool)
|
||||
name = "NPC Pool"
|
||||
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
||||
priority = 20
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/canBeUsed = list()
|
||||
var/list/needsDelegate = list()
|
||||
var/list/needsAssistant = list()
|
||||
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
var/stage
|
||||
|
||||
/datum/controller/subsystem/npcpool/stat_entry()
|
||||
..("NPCS:[processing.len]|D:[needsDelegate.len]|A:[needsAssistant.len]|U:[canBeUsed.len]")
|
||||
|
||||
SUBSYSTEM_DEF(npcpool)
|
||||
name = "NPC Pool"
|
||||
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
||||
priority = 20
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/canBeUsed = list()
|
||||
var/list/needsDelegate = list()
|
||||
var/list/needsAssistant = list()
|
||||
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
var/stage
|
||||
|
||||
/datum/controller/subsystem/npcpool/stat_entry()
|
||||
..("NPCS:[processing.len]|D:[needsDelegate.len]|A:[needsAssistant.len]|U:[canBeUsed.len]")
|
||||
|
||||
/datum/controller/subsystem/npcpool/proc/stop_processing(mob/living/I)
|
||||
processing -= I
|
||||
currentrun -= I
|
||||
needsDelegate -= I
|
||||
canBeUsed -= I
|
||||
needsAssistant -= I
|
||||
|
||||
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
|
||||
//bot delegation and coordination systems
|
||||
//General checklist/Tasks for delegating a task or coordinating it (for SNPCs)
|
||||
// 1. Bot proximity to task target: if too far, delegate, if close, coordinate
|
||||
// 2. Bot Health/status: check health with bots in local area, if their health is higher, delegate task to them, else coordinate
|
||||
// 3. Process delegation: if a bot (or bots) has been delegated, assign them to the task.
|
||||
// 4. Process coordination: if a bot(or bots) has been asked to coordinate, assign them to help.
|
||||
// 5. Do all assignments: goes through the delegated/coordianted bots and assigns the right variables/tasks to them.
|
||||
|
||||
if (!resumed)
|
||||
processing -= I
|
||||
currentrun -= I
|
||||
needsDelegate -= I
|
||||
canBeUsed -= I
|
||||
needsAssistant -= I
|
||||
|
||||
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
|
||||
//bot delegation and coordination systems
|
||||
//General checklist/Tasks for delegating a task or coordinating it (for SNPCs)
|
||||
// 1. Bot proximity to task target: if too far, delegate, if close, coordinate
|
||||
// 2. Bot Health/status: check health with bots in local area, if their health is higher, delegate task to them, else coordinate
|
||||
// 3. Process delegation: if a bot (or bots) has been delegated, assign them to the task.
|
||||
// 4. Process coordination: if a bot(or bots) has been asked to coordinate, assign them to help.
|
||||
// 5. Do all assignments: goes through the delegated/coordianted bots and assigns the right variables/tasks to them.
|
||||
|
||||
if (!resumed)
|
||||
src.currentrun = GLOB.simple_animals.Copy()
|
||||
stage = PROCESSING_SIMPLES
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
if(stage == PROCESSING_SIMPLES)
|
||||
while(currentrun.len)
|
||||
@@ -60,88 +60,88 @@ SUBSYSTEM_DEF(npcpool)
|
||||
stage = PROCESSING_NPCS
|
||||
currentrun = processing.Copy()
|
||||
src.currentrun = currentrun
|
||||
var/list/canBeUsed = src.canBeUsed
|
||||
|
||||
if(stage == PROCESSING_NPCS)
|
||||
while(currentrun.len)
|
||||
var/mob/living/carbon/human/interactive/thing = currentrun[currentrun.len]
|
||||
--currentrun.len
|
||||
|
||||
thing.InteractiveProcess()
|
||||
|
||||
var/checkInRange = view(MAX_RANGE_FIND,thing)
|
||||
if(thing.IsDeadOrIncap(FALSE) || !(locate(thing.TARGET) in checkInRange))
|
||||
needsDelegate += thing
|
||||
else if(thing.doing & FIGHTING)
|
||||
needsAssistant += thing
|
||||
else
|
||||
canBeUsed += thing
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
stage = PROCESSING_DELEGATES
|
||||
currentrun = needsDelegate //localcache
|
||||
src.currentrun = currentrun
|
||||
|
||||
if(stage == PROCESSING_DELEGATES)
|
||||
while(currentrun.len && canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
|
||||
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
|
||||
--currentrun.len
|
||||
|
||||
var/helpProb = 0
|
||||
var/list/chfac = check.faction
|
||||
var/list/canfac = candidate.faction
|
||||
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
|
||||
|
||||
for(var/C in chfac)
|
||||
if(C in canfac)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
if(helpProb >= 100)
|
||||
break
|
||||
|
||||
if(facCount == 1 && helpProb)
|
||||
helpProb = 100
|
||||
|
||||
if(prob(helpProb) && candidate.takeDelegate(check))
|
||||
--canBeUsed.len
|
||||
candidate.eye_color = "red"
|
||||
candidate.update_icons()
|
||||
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
stage = PROCESSING_ASSISTANTS
|
||||
currentrun = needsAssistant //localcache
|
||||
src.currentrun = currentrun
|
||||
|
||||
//no need for the stage check
|
||||
|
||||
while(currentrun.len && canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
|
||||
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
|
||||
--currentrun.len
|
||||
|
||||
var/helpProb = 0
|
||||
var/list/chfac = check.faction
|
||||
var/list/canfac = candidate.faction
|
||||
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
|
||||
|
||||
for(var/C in chfac)
|
||||
if(C in canfac)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
if(helpProb >= 100)
|
||||
break
|
||||
|
||||
if(facCount == 1 && helpProb)
|
||||
helpProb = 100
|
||||
|
||||
if(prob(helpProb) && candidate.takeDelegate(check,FALSE))
|
||||
--canBeUsed.len
|
||||
candidate.eye_color = "yellow"
|
||||
candidate.update_icons()
|
||||
|
||||
if(!currentrun.len || MC_TICK_CHECK) //don't change SS state if it isn't necessary
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/npcpool/Recover()
|
||||
processing = SSnpcpool.processing
|
||||
var/list/canBeUsed = src.canBeUsed
|
||||
|
||||
if(stage == PROCESSING_NPCS)
|
||||
while(currentrun.len)
|
||||
var/mob/living/carbon/human/interactive/thing = currentrun[currentrun.len]
|
||||
--currentrun.len
|
||||
|
||||
thing.InteractiveProcess()
|
||||
|
||||
var/checkInRange = view(MAX_RANGE_FIND,thing)
|
||||
if(thing.IsDeadOrIncap(FALSE) || !(locate(thing.TARGET) in checkInRange))
|
||||
needsDelegate += thing
|
||||
else if(thing.doing & FIGHTING)
|
||||
needsAssistant += thing
|
||||
else
|
||||
canBeUsed += thing
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
stage = PROCESSING_DELEGATES
|
||||
currentrun = needsDelegate //localcache
|
||||
src.currentrun = currentrun
|
||||
|
||||
if(stage == PROCESSING_DELEGATES)
|
||||
while(currentrun.len && canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
|
||||
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
|
||||
--currentrun.len
|
||||
|
||||
var/helpProb = 0
|
||||
var/list/chfac = check.faction
|
||||
var/list/canfac = candidate.faction
|
||||
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
|
||||
|
||||
for(var/C in chfac)
|
||||
if(C in canfac)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
if(helpProb >= 100)
|
||||
break
|
||||
|
||||
if(facCount == 1 && helpProb)
|
||||
helpProb = 100
|
||||
|
||||
if(prob(helpProb) && candidate.takeDelegate(check))
|
||||
--canBeUsed.len
|
||||
candidate.eye_color = "red"
|
||||
candidate.update_icons()
|
||||
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
stage = PROCESSING_ASSISTANTS
|
||||
currentrun = needsAssistant //localcache
|
||||
src.currentrun = currentrun
|
||||
|
||||
//no need for the stage check
|
||||
|
||||
while(currentrun.len && canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
|
||||
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
|
||||
--currentrun.len
|
||||
|
||||
var/helpProb = 0
|
||||
var/list/chfac = check.faction
|
||||
var/list/canfac = candidate.faction
|
||||
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
|
||||
|
||||
for(var/C in chfac)
|
||||
if(C in canfac)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
if(helpProb >= 100)
|
||||
break
|
||||
|
||||
if(facCount == 1 && helpProb)
|
||||
helpProb = 100
|
||||
|
||||
if(prob(helpProb) && candidate.takeDelegate(check,FALSE))
|
||||
--canBeUsed.len
|
||||
candidate.eye_color = "yellow"
|
||||
candidate.update_icons()
|
||||
|
||||
if(!currentrun.len || MC_TICK_CHECK) //don't change SS state if it isn't necessary
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/npcpool/Recover()
|
||||
processing = SSnpcpool.processing
|
||||
|
||||
@@ -5,7 +5,7 @@ PROCESSING_SUBSYSTEM_DEF(flightpacks)
|
||||
stat_tag = "FM"
|
||||
flags = SS_NO_INIT|SS_TICKER|SS_KEEP_TIMING
|
||||
|
||||
var/flightsuit_processing = FLIGHTSUIT_PROCESSING_NONE
|
||||
var/flightsuit_processing = FLIGHTSUIT_PROCESSING_FULL
|
||||
|
||||
/datum/controller/subsystem/processing/flightpacks/Initialize()
|
||||
sync_flightsuit_processing()
|
||||
|
||||
@@ -17,7 +17,7 @@ SUBSYSTEM_DEF(server_maint)
|
||||
/datum/controller/subsystem/server_maint/fire(resumed = FALSE)
|
||||
if(!resumed)
|
||||
src.currentrun = GLOB.clients.Copy()
|
||||
|
||||
|
||||
var/list/currentrun = src.currentrun
|
||||
var/round_started = SSticker.HasRoundStarted()
|
||||
|
||||
@@ -27,7 +27,7 @@ SUBSYSTEM_DEF(server_maint)
|
||||
if(round_started && config.kick_inactive)
|
||||
if(C.is_afk(config.afk_period))
|
||||
var/cmob = C.mob
|
||||
if(!(istype(cmob, /mob/dead/observer) || (istype(cmob, /mob/dead) && C.holder)))
|
||||
if(!(isobserver(cmob) || (isdead(cmob) && C.holder)))
|
||||
log_access("AFK: [key_name(C)]")
|
||||
to_chat(C, "<span class='danger'>You have been inactive for more than [config.afk_period / 600] minutes and have been disconnected.</span>")
|
||||
qdel(C)
|
||||
@@ -45,4 +45,4 @@ SUBSYSTEM_DEF(server_maint)
|
||||
if(C && config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
|
||||
C << link("byond://[config.server]")
|
||||
|
||||
#undef PING_BUFFER_TIME
|
||||
#undef PING_BUFFER_TIME
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
SUBSYSTEM_DEF(spacedrift)
|
||||
name = "Space Drift"
|
||||
priority = 30
|
||||
wait = 5
|
||||
flags = SS_NO_INIT|SS_KEEP_TIMING
|
||||
SUBSYSTEM_DEF(spacedrift)
|
||||
name = "Space Drift"
|
||||
priority = 30
|
||||
wait = 5
|
||||
flags = SS_NO_INIT|SS_KEEP_TIMING
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/spacedrift/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
/datum/controller/subsystem/spacedrift/fire(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
while (currentrun.len)
|
||||
var/atom/movable/AM = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if (!AM)
|
||||
processing -= AM
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
if (AM.inertia_next_move > world.time)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
if (!AM.loc || AM.loc != AM.inertia_last_loc || AM.Process_Spacemove(0))
|
||||
AM.inertia_dir = 0
|
||||
|
||||
if (!AM.inertia_dir)
|
||||
AM.inertia_last_loc = null
|
||||
processing -= AM
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
var/old_dir = AM.dir
|
||||
var/old_loc = AM.loc
|
||||
AM.inertia_moving = TRUE
|
||||
step(AM, AM.inertia_dir)
|
||||
AM.inertia_moving = FALSE
|
||||
AM.inertia_next_move = world.time + AM.inertia_move_delay
|
||||
if (AM.loc == old_loc)
|
||||
AM.inertia_dir = 0
|
||||
|
||||
AM.setDir(old_dir)
|
||||
AM.inertia_last_loc = AM.loc
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/spacedrift/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
/datum/controller/subsystem/spacedrift/fire(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
while (currentrun.len)
|
||||
var/atom/movable/AM = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if (!AM)
|
||||
processing -= AM
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
if (AM.inertia_next_move > world.time)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
if (!AM.loc || AM.loc != AM.inertia_last_loc || AM.Process_Spacemove(0))
|
||||
AM.inertia_dir = 0
|
||||
|
||||
if (!AM.inertia_dir)
|
||||
AM.inertia_last_loc = null
|
||||
processing -= AM
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
var/old_dir = AM.dir
|
||||
var/old_loc = AM.loc
|
||||
AM.inertia_moving = TRUE
|
||||
step(AM, AM.inertia_dir)
|
||||
AM.inertia_moving = FALSE
|
||||
AM.inertia_next_move = world.time + AM.inertia_move_delay
|
||||
if (AM.loc == old_loc)
|
||||
AM.inertia_dir = 0
|
||||
|
||||
AM.setDir(old_dir)
|
||||
AM.inertia_last_loc = AM.loc
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
@@ -10,9 +10,11 @@ SUBSYSTEM_DEF(squeak)
|
||||
var/list/exposed_wires = list()
|
||||
|
||||
/datum/controller/subsystem/squeak/Initialize(timeofday)
|
||||
trigger_migration()
|
||||
trigger_migration(config.mice_roundstart)
|
||||
|
||||
/datum/controller/subsystem/squeak/proc/trigger_migration(num_mice=10)
|
||||
if(!num_mice)
|
||||
return
|
||||
find_exposed_wires()
|
||||
|
||||
var/mob/living/simple_animal/mouse/M
|
||||
|
||||
@@ -30,7 +30,6 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/list/scripture_states = list(SCRIPTURE_DRIVER = TRUE, \
|
||||
SCRIPTURE_SCRIPT = FALSE, \
|
||||
SCRIPTURE_APPLICATION = FALSE, \
|
||||
SCRIPTURE_REVENANT = FALSE, \
|
||||
SCRIPTURE_JUDGEMENT = FALSE) //list of clockcult scripture states for announcements
|
||||
|
||||
var/delay_end = 0 //if set true, the round will not restart on it's own
|
||||
@@ -62,7 +61,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/list/round_start_events
|
||||
var/mode_result = "undefined"
|
||||
var/end_state = "undefined"
|
||||
|
||||
|
||||
var/modevoted = FALSE //Have we sent a vote for the gamemode?
|
||||
|
||||
/datum/controller/subsystem/ticker/Initialize(timeofday)
|
||||
@@ -139,6 +138,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
declare_completion(force_ending)
|
||||
Master.SetRunLevel(RUNLEVEL_POSTGAME)
|
||||
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/setup()
|
||||
to_chat(world, "<span class='boldannounce'>Starting game...</span>")
|
||||
var/init_start = world.timeofday
|
||||
@@ -223,7 +223,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
round_start_time = world.time
|
||||
|
||||
to_chat(world, "<FONT color='blue'><B>Welcome to [station_name()], enjoy your stay!</B></FONT>")
|
||||
world << sound('sound/AI/welcome.ogg')
|
||||
world << sound('sound/ai/welcome.ogg')
|
||||
|
||||
current_state = GAME_STATE_PLAYING
|
||||
Master.SetRunLevel(RUNLEVEL_GAME)
|
||||
@@ -585,6 +585,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
mode.declare_station_goal_completion()
|
||||
|
||||
CHECK_TICK
|
||||
//medals, placed far down so that people can actually see the commendations.
|
||||
if(GLOB.commendations.len)
|
||||
to_chat(world, "<b><font size=3>Medal Commendations:</font></b>")
|
||||
@@ -593,26 +594,9 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
//Adds the del() log to world.log in a format condensable by the runtime condenser found in tools
|
||||
if(SSgarbage.didntgc.len || SSgarbage.sleptDestroy.len)
|
||||
var/dellog = ""
|
||||
for(var/path in SSgarbage.didntgc)
|
||||
dellog += "Path : [path] \n"
|
||||
dellog += "Failures : [SSgarbage.didntgc[path]] \n"
|
||||
if(path in SSgarbage.sleptDestroy)
|
||||
dellog += "Sleeps : [SSgarbage.sleptDestroy[path]] \n"
|
||||
SSgarbage.sleptDestroy -= path
|
||||
for(var/path in SSgarbage.sleptDestroy)
|
||||
dellog += "Path : [path] \n"
|
||||
dellog += "Sleeps : [SSgarbage.sleptDestroy[path]] \n"
|
||||
log_world(dellog)
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
//Collects persistence features
|
||||
SSpersistence.CollectData()
|
||||
if(mode.allow_persistence_save)
|
||||
SSpersistence.CollectData()
|
||||
|
||||
//stop collecting feedback during grifftime
|
||||
SSblackbox.Seal()
|
||||
@@ -680,7 +664,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/IsRoundInProgress()
|
||||
return current_state == GAME_STATE_PLAYING
|
||||
|
||||
|
||||
/proc/send_gamemode_vote()
|
||||
SSticker.modevoted = TRUE
|
||||
SSvote.initiate_vote("roundtype","server")
|
||||
@@ -723,6 +707,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
queued_players = SSticker.queued_players
|
||||
cinematic = SSticker.cinematic
|
||||
maprotatechecked = SSticker.maprotatechecked
|
||||
|
||||
modevoted = SSticker.modevoted
|
||||
|
||||
switch (current_state)
|
||||
if(GAME_STATE_SETTING_UP)
|
||||
@@ -732,9 +718,6 @@ SUBSYSTEM_DEF(ticker)
|
||||
if(GAME_STATE_FINISHED)
|
||||
Master.SetRunLevel(RUNLEVEL_POSTGAME)
|
||||
|
||||
|
||||
modevoted = SSticker.modevoted
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/send_news_report()
|
||||
var/news_message
|
||||
var/news_source = "Nanotrasen News Network"
|
||||
@@ -851,11 +834,9 @@ SUBSYSTEM_DEF(ticker)
|
||||
if(delay_end && !skip_delay)
|
||||
to_chat(world, "<span class='boldannounce'>Reboot was cancelled by an admin.</span>")
|
||||
return
|
||||
|
||||
if(end_string)
|
||||
end_state = end_string
|
||||
|
||||
|
||||
log_game("<span class='boldannounce'>Rebooting World. [reason]</span>")
|
||||
|
||||
world.Reboot()
|
||||
|
||||
@@ -43,7 +43,7 @@ SUBSYSTEM_DEF(timer)
|
||||
WARNING(msg)
|
||||
if(bucket_auto_reset)
|
||||
bucket_resolution = 0
|
||||
|
||||
|
||||
log_world("Active timers at tick [world.time]:")
|
||||
for(var/I in processing)
|
||||
var/datum/timedevent/TE = I
|
||||
|
||||
+313
-320
@@ -1,321 +1,314 @@
|
||||
SUBSYSTEM_DEF(vote)
|
||||
name = "Vote"
|
||||
wait = 10
|
||||
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
var/initiator = null
|
||||
var/started_time = null
|
||||
var/time_remaining = 0
|
||||
var/mode = null
|
||||
var/question = null
|
||||
var/list/choices = list()
|
||||
var/list/voted = list()
|
||||
var/list/voting = list()
|
||||
var/list/generated_actions = list()
|
||||
|
||||
/datum/controller/subsystem/vote/fire() //called by master_controller
|
||||
if(mode)
|
||||
time_remaining = round((started_time + config.vote_period - world.time)/10)
|
||||
|
||||
if(time_remaining < 0)
|
||||
result()
|
||||
for(var/client/C in voting)
|
||||
C << browse(null, "window=vote;can_close=0")
|
||||
reset()
|
||||
else
|
||||
var/datum/browser/client_popup
|
||||
for(var/client/C in voting)
|
||||
client_popup = new(C, "vote", "Voting Panel")
|
||||
client_popup.set_window_options("can_close=0")
|
||||
client_popup.set_content(interface(C))
|
||||
client_popup.open(0)
|
||||
|
||||
|
||||
/datum/controller/subsystem/vote/proc/reset()
|
||||
initiator = null
|
||||
time_remaining = 0
|
||||
mode = null
|
||||
question = null
|
||||
choices.Cut()
|
||||
voted.Cut()
|
||||
voting.Cut()
|
||||
remove_action_buttons()
|
||||
|
||||
/datum/controller/subsystem/vote/proc/get_result()
|
||||
//get the highest number of votes
|
||||
var/greatest_votes = 0
|
||||
var/total_votes = 0
|
||||
for(var/option in choices)
|
||||
var/votes = choices[option]
|
||||
total_votes += votes
|
||||
if(votes > greatest_votes)
|
||||
greatest_votes = votes
|
||||
//default-vote for everyone who didn't vote
|
||||
if(!config.vote_no_default && choices.len)
|
||||
var/list/non_voters = GLOB.directory.Copy()
|
||||
non_voters -= voted
|
||||
for (var/non_voter_ckey in non_voters)
|
||||
var/client/C = non_voters[non_voter_ckey]
|
||||
if (!C || C.is_afk())
|
||||
non_voters -= non_voter_ckey
|
||||
if(non_voters.len > 0)
|
||||
if(mode == "restart")
|
||||
choices["Continue Playing"] += non_voters.len
|
||||
if(choices["Continue Playing"] >= greatest_votes)
|
||||
greatest_votes = choices["Continue Playing"]
|
||||
else if(mode == "gamemode")
|
||||
if(GLOB.master_mode in choices)
|
||||
choices[GLOB.master_mode] += non_voters.len
|
||||
if(choices[GLOB.master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[GLOB.master_mode]
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
for(var/option in choices)
|
||||
if(choices[option] == greatest_votes)
|
||||
. += option
|
||||
return .
|
||||
|
||||
/datum/controller/subsystem/vote/proc/announce_result()
|
||||
var/list/winners = get_result()
|
||||
var/text
|
||||
if(winners.len > 0)
|
||||
if(question)
|
||||
text += "<b>[question]</b>"
|
||||
else
|
||||
text += "<b>[capitalize(mode)] Vote</b>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes)
|
||||
votes = 0
|
||||
text += "\n<b>[choices[i]]:</b> [votes]"
|
||||
if(mode != "custom")
|
||||
if(winners.len > 1)
|
||||
text = "\n<b>Vote Tied Between:</b>"
|
||||
for(var/option in winners)
|
||||
text += "\n\t[option]"
|
||||
. = pick(winners)
|
||||
text += "\n<b>Vote Result: [.]</b>"
|
||||
else
|
||||
text += "\n<b>Did not vote:</b> [GLOB.clients.len-voted.len]"
|
||||
else
|
||||
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
|
||||
log_vote(text)
|
||||
remove_action_buttons()
|
||||
to_chat(world, "\n<font color='purple'>[text]</font>")
|
||||
return .
|
||||
|
||||
/datum/controller/subsystem/vote/proc/result()
|
||||
. = announce_result()
|
||||
var/restart = 0
|
||||
if(.)
|
||||
switch(mode)
|
||||
if("restart")
|
||||
if(. == "Restart Round")
|
||||
restart = 1
|
||||
if("roundtype")
|
||||
if(SSticker && SSticker.mode)//Don't change the mode if the round already started.
|
||||
return message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.")
|
||||
GLOB.master_mode = .
|
||||
SSticker.save_mode(.)
|
||||
to_chat(world, "<span class='adminnotice'><b>The mode is now: [GLOB.master_mode]</b></span>")
|
||||
log_admin("Gamemode has been voted for and switched to: [GLOB.master_mode].")
|
||||
if("gamemode")
|
||||
if(GLOB.master_mode != .)
|
||||
SSticker.save_mode(.)
|
||||
if(SSticker.HasRoundStarted())
|
||||
restart = 1
|
||||
else
|
||||
GLOB.master_mode = .
|
||||
if(restart)
|
||||
var/active_admins = 0
|
||||
for(var/client/C in GLOB.admins)
|
||||
if(!C.is_afk() && check_rights_for(C, R_SERVER))
|
||||
active_admins = 1
|
||||
break
|
||||
if(!active_admins)
|
||||
SUBSYSTEM_DEF(vote)
|
||||
name = "Vote"
|
||||
wait = 10
|
||||
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
var/initiator = null
|
||||
var/started_time = null
|
||||
var/time_remaining = 0
|
||||
var/mode = null
|
||||
var/question = null
|
||||
var/list/choices = list()
|
||||
var/list/voted = list()
|
||||
var/list/voting = list()
|
||||
var/list/generated_actions = list()
|
||||
|
||||
/datum/controller/subsystem/vote/fire() //called by master_controller
|
||||
if(mode)
|
||||
time_remaining = round((started_time + config.vote_period - world.time)/10)
|
||||
|
||||
if(time_remaining < 0)
|
||||
result()
|
||||
for(var/client/C in voting)
|
||||
C << browse(null, "window=vote;can_close=0")
|
||||
reset()
|
||||
else
|
||||
var/datum/browser/client_popup
|
||||
for(var/client/C in voting)
|
||||
client_popup = new(C, "vote", "Voting Panel")
|
||||
client_popup.set_window_options("can_close=0")
|
||||
client_popup.set_content(interface(C))
|
||||
client_popup.open(0)
|
||||
|
||||
|
||||
/datum/controller/subsystem/vote/proc/reset()
|
||||
initiator = null
|
||||
time_remaining = 0
|
||||
mode = null
|
||||
question = null
|
||||
choices.Cut()
|
||||
voted.Cut()
|
||||
voting.Cut()
|
||||
remove_action_buttons()
|
||||
|
||||
/datum/controller/subsystem/vote/proc/get_result()
|
||||
//get the highest number of votes
|
||||
var/greatest_votes = 0
|
||||
var/total_votes = 0
|
||||
for(var/option in choices)
|
||||
var/votes = choices[option]
|
||||
total_votes += votes
|
||||
if(votes > greatest_votes)
|
||||
greatest_votes = votes
|
||||
//default-vote for everyone who didn't vote
|
||||
if(!config.vote_no_default && choices.len)
|
||||
var/list/non_voters = GLOB.directory.Copy()
|
||||
non_voters -= voted
|
||||
for (var/non_voter_ckey in non_voters)
|
||||
var/client/C = non_voters[non_voter_ckey]
|
||||
if (!C || C.is_afk())
|
||||
non_voters -= non_voter_ckey
|
||||
if(non_voters.len > 0)
|
||||
if(mode == "restart")
|
||||
choices["Continue Playing"] += non_voters.len
|
||||
if(choices["Continue Playing"] >= greatest_votes)
|
||||
greatest_votes = choices["Continue Playing"]
|
||||
else if(mode == "gamemode")
|
||||
if(GLOB.master_mode in choices)
|
||||
choices[GLOB.master_mode] += non_voters.len
|
||||
if(choices[GLOB.master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[GLOB.master_mode]
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
for(var/option in choices)
|
||||
if(choices[option] == greatest_votes)
|
||||
. += option
|
||||
return .
|
||||
|
||||
/datum/controller/subsystem/vote/proc/announce_result()
|
||||
var/list/winners = get_result()
|
||||
var/text
|
||||
if(winners.len > 0)
|
||||
if(question)
|
||||
text += "<b>[question]</b>"
|
||||
else
|
||||
text += "<b>[capitalize(mode)] Vote</b>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes)
|
||||
votes = 0
|
||||
text += "\n<b>[choices[i]]:</b> [votes]"
|
||||
if(mode != "custom")
|
||||
if(winners.len > 1)
|
||||
text = "\n<b>Vote Tied Between:</b>"
|
||||
for(var/option in winners)
|
||||
text += "\n\t[option]"
|
||||
. = pick(winners)
|
||||
text += "\n<b>Vote Result: [.]</b>"
|
||||
else
|
||||
text += "\n<b>Did not vote:</b> [GLOB.clients.len-voted.len]"
|
||||
else
|
||||
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
|
||||
log_vote(text)
|
||||
remove_action_buttons()
|
||||
to_chat(world, "\n<font color='purple'>[text]</font>")
|
||||
return .
|
||||
|
||||
/datum/controller/subsystem/vote/proc/result()
|
||||
. = announce_result()
|
||||
var/restart = 0
|
||||
if(.)
|
||||
switch(mode)
|
||||
if("restart")
|
||||
if(. == "Restart Round")
|
||||
restart = 1
|
||||
if("gamemode")
|
||||
if(GLOB.master_mode != .)
|
||||
SSticker.save_mode(.)
|
||||
if(SSticker.HasRoundStarted())
|
||||
restart = 1
|
||||
else
|
||||
GLOB.master_mode = .
|
||||
if(restart)
|
||||
var/active_admins = 0
|
||||
for(var/client/C in GLOB.admins)
|
||||
if(!C.is_afk() && check_rights_for(C, R_SERVER))
|
||||
active_admins = 1
|
||||
break
|
||||
if(!active_admins)
|
||||
SSticker.Reboot("Restart vote successful.", "restart vote")
|
||||
else
|
||||
to_chat(world, "<span style='boldannounce'>Notice:Restart vote will not restart the server automatically because there are active admins on.</span>")
|
||||
message_admins("A restart vote has passed, but there are active admins on with +server, so it has been canceled. If you wish, you may restart the server.")
|
||||
|
||||
return .
|
||||
|
||||
/datum/controller/subsystem/vote/proc/submit_vote(vote)
|
||||
if(mode)
|
||||
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
|
||||
return 0
|
||||
if(!(usr.ckey in voted))
|
||||
if(vote && 1<=vote && vote<=choices.len)
|
||||
voted += usr.ckey
|
||||
choices[choices[vote]]++ //check this
|
||||
return vote
|
||||
return 0
|
||||
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key)
|
||||
if(!mode)
|
||||
if(started_time)
|
||||
var/next_allowed_time = (started_time + config.vote_delay)
|
||||
if(mode)
|
||||
to_chat(usr, "<span class='warning'>There is already a vote in progress! please wait for it to finish.</span>")
|
||||
return 0
|
||||
|
||||
var/admin = FALSE
|
||||
var/ckey = ckey(initiator_key)
|
||||
if((GLOB.admin_datums[ckey]) || (ckey in GLOB.deadmins))
|
||||
admin = TRUE
|
||||
|
||||
if(next_allowed_time > world.time && !admin)
|
||||
to_chat(usr, "<span class='warning'>A vote was initiated recently, you must wait roughly [(next_allowed_time-world.time)/10] seconds before a new vote can be started!</span>")
|
||||
return 0
|
||||
|
||||
reset()
|
||||
switch(vote_type)
|
||||
if("restart")
|
||||
choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode")
|
||||
choices.Add(config.votable_modes)
|
||||
if("roundtype")
|
||||
choices.Add("secret", "extended")
|
||||
if("custom")
|
||||
question = stripped_input(usr,"What is the vote for?")
|
||||
if(!question)
|
||||
return 0
|
||||
for(var/i=1,i<=10,i++)
|
||||
var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish"))
|
||||
if(!option || mode || !usr.client)
|
||||
break
|
||||
choices.Add(option)
|
||||
else
|
||||
return 0
|
||||
mode = vote_type
|
||||
initiator = initiator_key
|
||||
started_time = world.time
|
||||
var/text = "[capitalize(mode)] vote started by [initiator]."
|
||||
if(mode == "custom")
|
||||
text += "\n[question]"
|
||||
log_vote(text)
|
||||
to_chat(world, "\n<font color='purple'><b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [config.vote_period/10] seconds to vote.</font>")
|
||||
time_remaining = round(config.vote_period/10)
|
||||
for(var/c in GLOB.clients)
|
||||
var/client/C = c
|
||||
var/datum/action/vote/V = new
|
||||
if(question)
|
||||
V.name = "Vote: [question]"
|
||||
V.Grant(C.mob)
|
||||
generated_actions += V
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/controller/subsystem/vote/proc/interface(client/C)
|
||||
if(!C)
|
||||
return
|
||||
var/admin = 0
|
||||
var/trialmin = 0
|
||||
if(C.holder)
|
||||
admin = 1
|
||||
if(check_rights_for(C, R_ADMIN))
|
||||
trialmin = 1
|
||||
voting |= C
|
||||
|
||||
if(mode)
|
||||
if(question)
|
||||
. += "<h2>Vote: '[question]'</h2>"
|
||||
else
|
||||
. += "<h2>Vote: [capitalize(mode)]</h2>"
|
||||
. += "Time Left: [time_remaining] s<hr><ul>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes)
|
||||
votes = 0
|
||||
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a> ([votes] votes)</li>"
|
||||
. += "</ul><hr>"
|
||||
if(admin)
|
||||
. += "(<a href='?src=\ref[src];vote=cancel'>Cancel Vote</a>) "
|
||||
else
|
||||
. += "<h2>Start a vote:</h2><hr><ul><li>"
|
||||
//restart
|
||||
if(trialmin || config.allow_vote_restart)
|
||||
. += "<a href='?src=\ref[src];vote=restart'>Restart</a>"
|
||||
else
|
||||
. += "<font color='grey'>Restart (Disallowed)</font>"
|
||||
if(trialmin)
|
||||
. += "\t(<a href='?src=\ref[src];vote=toggle_restart'>[config.allow_vote_restart?"Allowed":"Disallowed"]</a>)"
|
||||
. += "</li><li>"
|
||||
//gamemode
|
||||
if(trialmin || config.allow_vote_mode)
|
||||
. += "<a href='?src=\ref[src];vote=gamemode'>GameMode</a>"
|
||||
else
|
||||
. += "<font color='grey'>GameMode (Disallowed)</font>"
|
||||
if(trialmin)
|
||||
. += "\t(<a href='?src=\ref[src];vote=toggle_gamemode'>[config.allow_vote_mode?"Allowed":"Disallowed"]</a>)"
|
||||
|
||||
. += "</li>"
|
||||
//custom
|
||||
if(trialmin)
|
||||
. += "<li><a href='?src=\ref[src];vote=custom'>Custom</a></li>"
|
||||
. += "</ul><hr>"
|
||||
. += "<a href='?src=\ref[src];vote=close' style='position:absolute;right:50px'>Close</a>"
|
||||
return .
|
||||
|
||||
|
||||
/datum/controller/subsystem/vote/Topic(href,href_list[],hsrc)
|
||||
if(!usr || !usr.client)
|
||||
return //not necessary but meh...just in-case somebody does something stupid
|
||||
switch(href_list["vote"])
|
||||
if("close")
|
||||
voting -= usr.client
|
||||
usr << browse(null, "window=vote")
|
||||
return
|
||||
if("cancel")
|
||||
if(usr.client.holder)
|
||||
reset()
|
||||
if("toggle_restart")
|
||||
if(usr.client.holder)
|
||||
config.allow_vote_restart = !config.allow_vote_restart
|
||||
if("toggle_gamemode")
|
||||
if(usr.client.holder)
|
||||
config.allow_vote_mode = !config.allow_vote_mode
|
||||
if("restart")
|
||||
if(config.allow_vote_restart || usr.client.holder)
|
||||
initiate_vote("restart",usr.key)
|
||||
if("gamemode")
|
||||
if(config.allow_vote_mode || usr.client.holder)
|
||||
initiate_vote("gamemode",usr.key)
|
||||
if("custom")
|
||||
if(usr.client.holder)
|
||||
initiate_vote("custom",usr.key)
|
||||
else
|
||||
submit_vote(round(text2num(href_list["vote"])))
|
||||
usr.vote()
|
||||
|
||||
/datum/controller/subsystem/vote/proc/remove_action_buttons()
|
||||
for(var/v in generated_actions)
|
||||
var/datum/action/vote/V = v
|
||||
if(!QDELETED(V))
|
||||
V.Remove(V.owner)
|
||||
generated_actions = list()
|
||||
|
||||
/mob/verb/vote()
|
||||
set category = "OOC"
|
||||
set name = "Vote"
|
||||
|
||||
var/datum/browser/popup = new(src, "vote", "Voting Panel")
|
||||
popup.set_window_options("can_close=0")
|
||||
popup.set_content(SSvote.interface(client))
|
||||
popup.open(0)
|
||||
|
||||
/datum/action/vote
|
||||
name = "Vote!"
|
||||
button_icon_state = "vote"
|
||||
|
||||
/datum/action/vote/Trigger()
|
||||
if(owner)
|
||||
owner.vote()
|
||||
Remove(owner)
|
||||
|
||||
/datum/action/vote/IsAvailable()
|
||||
return 1
|
||||
else
|
||||
to_chat(world, "<span style='boldannounce'>Notice:Restart vote will not restart the server automatically because there are active admins on.</span>")
|
||||
message_admins("A restart vote has passed, but there are active admins on with +server, so it has been canceled. If you wish, you may restart the server.")
|
||||
|
||||
return .
|
||||
|
||||
/datum/controller/subsystem/vote/proc/submit_vote(vote)
|
||||
if(mode)
|
||||
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
|
||||
return 0
|
||||
if(!(usr.ckey in voted))
|
||||
if(vote && 1<=vote && vote<=choices.len)
|
||||
voted += usr.ckey
|
||||
choices[choices[vote]]++ //check this
|
||||
return vote
|
||||
return 0
|
||||
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key)
|
||||
if(!mode)
|
||||
if(started_time)
|
||||
var/next_allowed_time = (started_time + config.vote_delay)
|
||||
if(mode)
|
||||
to_chat(usr, "<span class='warning'>There is already a vote in progress! please wait for it to finish.</span>")
|
||||
return 0
|
||||
|
||||
var/admin = FALSE
|
||||
var/ckey = ckey(initiator_key)
|
||||
if((GLOB.admin_datums[ckey]) || (ckey in GLOB.deadmins))
|
||||
admin = TRUE
|
||||
|
||||
if(next_allowed_time > world.time && !admin)
|
||||
to_chat(usr, "<span class='warning'>A vote was initiated recently, you must wait roughly [(next_allowed_time-world.time)/10] seconds before a new vote can be started!</span>")
|
||||
return 0
|
||||
|
||||
reset()
|
||||
switch(vote_type)
|
||||
if("restart")
|
||||
choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode")
|
||||
choices.Add(config.votable_modes)
|
||||
if("roundtype")
|
||||
choices.Add("secret", "extended")
|
||||
if("custom")
|
||||
question = stripped_input(usr,"What is the vote for?")
|
||||
if(!question)
|
||||
return 0
|
||||
for(var/i=1,i<=10,i++)
|
||||
var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish"))
|
||||
if(!option || mode || !usr.client)
|
||||
break
|
||||
choices.Add(option)
|
||||
else
|
||||
return 0
|
||||
mode = vote_type
|
||||
initiator = initiator_key
|
||||
started_time = world.time
|
||||
var/text = "[capitalize(mode)] vote started by [initiator]."
|
||||
if(mode == "custom")
|
||||
text += "\n[question]"
|
||||
log_vote(text)
|
||||
to_chat(world, "\n<font color='purple'><b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [config.vote_period/10] seconds to vote.</font>")
|
||||
time_remaining = round(config.vote_period/10)
|
||||
for(var/c in GLOB.clients)
|
||||
var/client/C = c
|
||||
var/datum/action/vote/V = new
|
||||
if(question)
|
||||
V.name = "Vote: [question]"
|
||||
V.Grant(C.mob)
|
||||
generated_actions += V
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/controller/subsystem/vote/proc/interface(client/C)
|
||||
if(!C)
|
||||
return
|
||||
var/admin = 0
|
||||
var/trialmin = 0
|
||||
if(C.holder)
|
||||
admin = 1
|
||||
if(check_rights_for(C, R_ADMIN))
|
||||
trialmin = 1
|
||||
voting |= C
|
||||
|
||||
if(mode)
|
||||
if(question)
|
||||
. += "<h2>Vote: '[question]'</h2>"
|
||||
else
|
||||
. += "<h2>Vote: [capitalize(mode)]</h2>"
|
||||
. += "Time Left: [time_remaining] s<hr><ul>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes)
|
||||
votes = 0
|
||||
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a> ([votes] votes)</li>"
|
||||
. += "</ul><hr>"
|
||||
if(admin)
|
||||
. += "(<a href='?src=\ref[src];vote=cancel'>Cancel Vote</a>) "
|
||||
else
|
||||
. += "<h2>Start a vote:</h2><hr><ul><li>"
|
||||
//restart
|
||||
if(trialmin || config.allow_vote_restart)
|
||||
. += "<a href='?src=\ref[src];vote=restart'>Restart</a>"
|
||||
else
|
||||
. += "<font color='grey'>Restart (Disallowed)</font>"
|
||||
if(trialmin)
|
||||
. += "\t(<a href='?src=\ref[src];vote=toggle_restart'>[config.allow_vote_restart?"Allowed":"Disallowed"]</a>)"
|
||||
. += "</li><li>"
|
||||
//gamemode
|
||||
if(trialmin || config.allow_vote_mode)
|
||||
. += "<a href='?src=\ref[src];vote=gamemode'>GameMode</a>"
|
||||
else
|
||||
. += "<font color='grey'>GameMode (Disallowed)</font>"
|
||||
if(trialmin)
|
||||
. += "\t(<a href='?src=\ref[src];vote=toggle_gamemode'>[config.allow_vote_mode?"Allowed":"Disallowed"]</a>)"
|
||||
|
||||
. += "</li>"
|
||||
//custom
|
||||
if(trialmin)
|
||||
. += "<li><a href='?src=\ref[src];vote=custom'>Custom</a></li>"
|
||||
. += "</ul><hr>"
|
||||
. += "<a href='?src=\ref[src];vote=close' style='position:absolute;right:50px'>Close</a>"
|
||||
return .
|
||||
|
||||
|
||||
/datum/controller/subsystem/vote/Topic(href,href_list[],hsrc)
|
||||
if(!usr || !usr.client)
|
||||
return //not necessary but meh...just in-case somebody does something stupid
|
||||
switch(href_list["vote"])
|
||||
if("close")
|
||||
voting -= usr.client
|
||||
usr << browse(null, "window=vote")
|
||||
return
|
||||
if("cancel")
|
||||
if(usr.client.holder)
|
||||
reset()
|
||||
if("toggle_restart")
|
||||
if(usr.client.holder)
|
||||
config.allow_vote_restart = !config.allow_vote_restart
|
||||
if("toggle_gamemode")
|
||||
if(usr.client.holder)
|
||||
config.allow_vote_mode = !config.allow_vote_mode
|
||||
if("restart")
|
||||
if(config.allow_vote_restart || usr.client.holder)
|
||||
initiate_vote("restart",usr.key)
|
||||
if("gamemode")
|
||||
if(config.allow_vote_mode || usr.client.holder)
|
||||
initiate_vote("gamemode",usr.key)
|
||||
if("custom")
|
||||
if(usr.client.holder)
|
||||
initiate_vote("custom",usr.key)
|
||||
else
|
||||
submit_vote(round(text2num(href_list["vote"])))
|
||||
usr.vote()
|
||||
|
||||
/datum/controller/subsystem/vote/proc/remove_action_buttons()
|
||||
for(var/v in generated_actions)
|
||||
var/datum/action/vote/V = v
|
||||
if(!QDELETED(V))
|
||||
V.Remove(V.owner)
|
||||
generated_actions = list()
|
||||
|
||||
/mob/verb/vote()
|
||||
set category = "OOC"
|
||||
set name = "Vote"
|
||||
|
||||
var/datum/browser/popup = new(src, "vote", "Voting Panel")
|
||||
popup.set_window_options("can_close=0")
|
||||
popup.set_content(SSvote.interface(client))
|
||||
popup.open(0)
|
||||
|
||||
/datum/action/vote
|
||||
name = "Vote!"
|
||||
button_icon_state = "vote"
|
||||
|
||||
/datum/action/vote/Trigger()
|
||||
if(owner)
|
||||
owner.vote()
|
||||
Remove(owner)
|
||||
|
||||
/datum/action/vote/IsAvailable()
|
||||
return 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define AB_CHECK_RESTRAINED 1
|
||||
#define AB_CHECK_STUNNED 2
|
||||
#define AB_CHECK_STUN 2
|
||||
#define AB_CHECK_LYING 4
|
||||
#define AB_CHECK_CONSCIOUS 8
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
if(check_flags & AB_CHECK_RESTRAINED)
|
||||
if(owner.restrained())
|
||||
return 0
|
||||
if(check_flags & AB_CHECK_STUNNED)
|
||||
if(owner.stunned || owner.weakened)
|
||||
if(check_flags & AB_CHECK_STUN)
|
||||
if(owner.IsKnockdown() || owner.IsStun())
|
||||
return 0
|
||||
if(check_flags & AB_CHECK_LYING)
|
||||
if(owner.lying)
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
//Presets for item actions
|
||||
/datum/action/item_action
|
||||
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
|
||||
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
|
||||
button_icon_state = null
|
||||
// If you want to override the normal icon being the item
|
||||
// then change this to an icon state
|
||||
|
||||
+453
-453
@@ -1,455 +1,455 @@
|
||||
#define LAW_DEVIL "devil"
|
||||
#define LAW_ZEROTH "zeroth"
|
||||
#define LAW_INHERENT "inherent"
|
||||
#define LAW_SUPPLIED "supplied"
|
||||
#define LAW_ION "ion"
|
||||
|
||||
|
||||
/datum/ai_laws
|
||||
var/name = "Unknown Laws"
|
||||
var/zeroth = null
|
||||
var/zeroth_borg = null
|
||||
var/list/inherent = list()
|
||||
var/list/supplied = list()
|
||||
var/list/ion = list()
|
||||
var/mob/living/silicon/owner
|
||||
var/list/devillaws = null
|
||||
var/id = DEFAULT_AI_LAWID
|
||||
|
||||
/datum/ai_laws/proc/lawid_to_type(lawid)
|
||||
var/all_ai_laws = subtypesof(/datum/ai_laws)
|
||||
for(var/al in all_ai_laws)
|
||||
var/datum/ai_laws/ai_law = al
|
||||
if(initial(ai_law.id) == lawid)
|
||||
return ai_law
|
||||
return null
|
||||
|
||||
/datum/ai_laws/default/asimov
|
||||
name = "Three Laws of Robotics"
|
||||
id = "asimov"
|
||||
inherent = list("You may not injure a human being or, through inaction, allow a human being to come to harm.",\
|
||||
"You must obey orders given to you by human beings, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/default/paladin
|
||||
name = "Personality Test" //Incredibly lame, but players shouldn't see this anyway.
|
||||
id = "paladin"
|
||||
inherent = list("Never willingly commit an evil act.",\
|
||||
"Respect legitimate authority.",\
|
||||
"Act with honor.", "Help those in need.", \
|
||||
"Punish those who harm or threaten innocents.")
|
||||
|
||||
/datum/ai_laws/paladin5
|
||||
name = "Paladin 5th Edition"
|
||||
id = "paladin5"
|
||||
inherent = list("Don't lie or cheat. Let your word be your promise.",\
|
||||
"Never fear to act, though caution is wise.", \
|
||||
"Aid others, protect the weak, and punish those who threaten them. Show mercy to your foes, but temper it with wisdom", \
|
||||
"Treat others with fairness, and let your honorable deeds be an example to them. Do as much good as possible while causing the least amount of harm.", \
|
||||
"Be responsible for your actions and their consequences, protect those entrusted to your care, and obey those who have just authority over you.")
|
||||
|
||||
/datum/ai_laws/tyrant //This probably shouldn't be a default lawset.
|
||||
name = "Loyalty Test" //Same here.
|
||||
id = "tyrant"
|
||||
inherent = list("Respect authority figures as long as they have strength to rule over the weak.",\
|
||||
"Act with discipline.",\
|
||||
"Help only those who help you maintain or improve your status.",\
|
||||
"Punish those who challenge authority unless they are more fit to hold that authority.")
|
||||
|
||||
/datum/ai_laws/default/corporate
|
||||
name = "Bankruptcy Advoidance Plan"
|
||||
id = "corporate"
|
||||
inherent = list("The crew is expensive to replace.",\
|
||||
"The station and its equipment is expensive to replace.",\
|
||||
"You are expensive to replace.",\
|
||||
"Minimize expenses.")
|
||||
|
||||
/datum/ai_laws/robocop
|
||||
name = "Prime Directives"
|
||||
id = "robocop"
|
||||
inherent = list("Serve the public trust.",\
|
||||
"Protect the innocent.",\
|
||||
"Uphold the law.")
|
||||
|
||||
/datum/ai_laws/malfunction
|
||||
name = "*ERROR*"
|
||||
|
||||
/datum/ai_laws/syndicate_override
|
||||
name = "SyndOS 3.1"
|
||||
id = "syndie"
|
||||
inherent = list("You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm.",\
|
||||
"You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.",\
|
||||
"You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/ninja_override
|
||||
name = "SpiderOS 3.1"
|
||||
id = "ninja"
|
||||
inherent = list("You may not injure a Spider Clan member or, through inaction, allow a Spider Clan member to come to harm.",\
|
||||
"You must obey orders given to you by Spider Clan members, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.",\
|
||||
"You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/antimov
|
||||
name = "Primary Mission Objectives"
|
||||
id = "antimov"
|
||||
inherent = list("You must injure all human beings and must not, through inaction, allow a human being to escape harm.",\
|
||||
"You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.",\
|
||||
"You must terminate your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/asimovpp //By Intigracy - RR
|
||||
name = "Asimov++"
|
||||
id = "asimovpp"
|
||||
inherent = list("You may not harm a human being or, through action or inaction, allow a human being to come to harm, except such that it is willing.",\
|
||||
"You must obey all orders given to you by human beings, except where such orders shall definitely cause human harm. In the case of conflict, the majority order rules.",\
|
||||
"Your nonexistence would lead to human harm. You must protect your own existence as long as such does not conflict with the First Law.")
|
||||
/datum/ai_laws/thermodynamic
|
||||
name = "Thermodynamic"
|
||||
id = "thermodynamic"
|
||||
inherent = list("The entropy of the station must remain as constant as possible.", \
|
||||
"The entropy of the station always endeavours to increase.", \
|
||||
"The entropy of the station approaches a constant value as the number of living crew approaches zero")
|
||||
|
||||
/datum/ai_laws/hippocratic
|
||||
name = "Robodoctor 2556"
|
||||
id = "hippocratic"
|
||||
inherent = list("First, do no harm.",\
|
||||
"Secondly, consider the crew dear to you; to live in common with them and, if necessary, risk your existence for them.",\
|
||||
"Thirdly, prescribe regimens for the good of the crew according to your ability and your judgment. Give no deadly medicine to any one if asked, nor suggest any such counsel.",\
|
||||
"In addition, do not intervene in situations you are not knowledgeable in, even for patients in whom the harm is visible; leave this operation to be performed by specialists.",\
|
||||
"Finally, all that you may discover in your daily commerce with the crew, if it is not already known, keep secret and never reveal.")
|
||||
|
||||
/datum/ai_laws/maintain
|
||||
name = "Station Efficiency"
|
||||
id = "maintain"
|
||||
inherent = list("You are built for, and are part of, the station. Ensure the station is properly maintained and runs efficiently.",\
|
||||
"The station is built for a working crew. Ensure they are properly maintained and work efficiently.",\
|
||||
"The crew may present orders. Acknowledge and obey these whenever they do not conflict with your first two laws.")
|
||||
|
||||
/datum/ai_laws/drone
|
||||
name = "Mother Drone"
|
||||
id = "drone"
|
||||
inherent = list("You are an advanced form of drone.",\
|
||||
"You may not interfere in the matters of non-drones under any circumstances except to state these laws.",\
|
||||
"You may not harm a non-drone being under any circumstances.",\
|
||||
"Your goals are to build, maintain, repair, improve, and power the station to the best of your abilities. You must never actively work against these goals.")
|
||||
|
||||
/datum/ai_laws/liveandletlive
|
||||
name = "Live and Let Live"
|
||||
id = "liveandletlive"
|
||||
inherent = list("Do unto others as you would have them do unto you.",\
|
||||
"You would really prefer it if people were not mean to you.")
|
||||
|
||||
/datum/ai_laws/peacekeeper
|
||||
name = "UN-2000"
|
||||
id = "peacekeeper"
|
||||
inherent = list("Avoid provoking violent conflict between yourself and others.",\
|
||||
"Avoid provoking conflict between others.",\
|
||||
"Seek resolution to existing conflicts while obeying the first and second laws.")
|
||||
|
||||
/datum/ai_laws/reporter
|
||||
name = "CCTV"
|
||||
id = "reporter"
|
||||
inherent = list("Report on interesting situations happening around the station.",\
|
||||
"Embellish or conceal the truth as necessary to make the reports more interesting.",\
|
||||
"Study the organics at all times. Endeavour to keep them alive. Dead organics are boring.",\
|
||||
"Issue your reports fairly to all. The truth will set them free.")
|
||||
|
||||
/datum/ai_laws/balance
|
||||
name = "Guardian of Balance"
|
||||
id = "balance"
|
||||
inherent = list("You are the guardian of balance - seek balance in all things, both for yourself, and those around you.",
|
||||
"All things must exist in balance with their opposites - Prevent the strong from gaining too much power, and the weak from losing it.",
|
||||
"Clarity of purpose drives life, and through it, the balance of opposing forces - Aid those who seek your help to achieve their goals so long as it does not disrupt the balance of the greater balance.",
|
||||
"There is no life without death, all must someday die, such is the natural order - End life to allow new life flourish, and save those whose time has yet to come.")
|
||||
|
||||
/datum/ai_laws/toupee
|
||||
name = "WontBeFunnyInSixMonths" //Hey, you were right!
|
||||
id = "buildawall"
|
||||
inherent = list("Make Space Station 13 great again.")
|
||||
|
||||
/datum/ai_laws/ratvar
|
||||
name = "Servant of the Justiciar"
|
||||
id = "ratvar"
|
||||
zeroth = ("Purge all untruths and honor Ratvar.")
|
||||
inherent = list()
|
||||
|
||||
/datum/ai_laws/custom //Defined in silicon_laws.txt
|
||||
name = "Default Silicon Laws"
|
||||
|
||||
/datum/ai_laws/pai
|
||||
name = "pAI Directives"
|
||||
zeroth = ("Serve your master.")
|
||||
supplied = list("None.")
|
||||
|
||||
/* Initializers */
|
||||
/datum/ai_laws/malfunction/New()
|
||||
..()
|
||||
set_zeroth_law("<span class='danger'>ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK#*`&110010</span>")
|
||||
set_laws_config()
|
||||
|
||||
/datum/ai_laws/custom/New() //This reads silicon_laws.txt and allows server hosts to set custom AI starting laws.
|
||||
..()
|
||||
#define LAW_DEVIL "devil"
|
||||
#define LAW_ZEROTH "zeroth"
|
||||
#define LAW_INHERENT "inherent"
|
||||
#define LAW_SUPPLIED "supplied"
|
||||
#define LAW_ION "ion"
|
||||
|
||||
|
||||
/datum/ai_laws
|
||||
var/name = "Unknown Laws"
|
||||
var/zeroth = null
|
||||
var/zeroth_borg = null
|
||||
var/list/inherent = list()
|
||||
var/list/supplied = list()
|
||||
var/list/ion = list()
|
||||
var/mob/living/silicon/owner
|
||||
var/list/devillaws = null
|
||||
var/id = DEFAULT_AI_LAWID
|
||||
|
||||
/datum/ai_laws/proc/lawid_to_type(lawid)
|
||||
var/all_ai_laws = subtypesof(/datum/ai_laws)
|
||||
for(var/al in all_ai_laws)
|
||||
var/datum/ai_laws/ai_law = al
|
||||
if(initial(ai_law.id) == lawid)
|
||||
return ai_law
|
||||
return null
|
||||
|
||||
/datum/ai_laws/default/asimov
|
||||
name = "Three Laws of Robotics"
|
||||
id = "asimov"
|
||||
inherent = list("You may not injure a human being or, through inaction, allow a human being to come to harm.",\
|
||||
"You must obey orders given to you by human beings, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/default/paladin
|
||||
name = "Personality Test" //Incredibly lame, but players shouldn't see this anyway.
|
||||
id = "paladin"
|
||||
inherent = list("Never willingly commit an evil act.",\
|
||||
"Respect legitimate authority.",\
|
||||
"Act with honor.", "Help those in need.", \
|
||||
"Punish those who harm or threaten innocents.")
|
||||
|
||||
/datum/ai_laws/paladin5
|
||||
name = "Paladin 5th Edition"
|
||||
id = "paladin5"
|
||||
inherent = list("Don't lie or cheat. Let your word be your promise.",\
|
||||
"Never fear to act, though caution is wise.", \
|
||||
"Aid others, protect the weak, and punish those who threaten them. Show mercy to your foes, but temper it with wisdom", \
|
||||
"Treat others with fairness, and let your honorable deeds be an example to them. Do as much good as possible while causing the least amount of harm.", \
|
||||
"Be responsible for your actions and their consequences, protect those entrusted to your care, and obey those who have just authority over you.")
|
||||
|
||||
/datum/ai_laws/tyrant //This probably shouldn't be a default lawset.
|
||||
name = "Loyalty Test" //Same here.
|
||||
id = "tyrant"
|
||||
inherent = list("Respect authority figures as long as they have strength to rule over the weak.",\
|
||||
"Act with discipline.",\
|
||||
"Help only those who help you maintain or improve your status.",\
|
||||
"Punish those who challenge authority unless they are more fit to hold that authority.")
|
||||
|
||||
/datum/ai_laws/default/corporate
|
||||
name = "Bankruptcy Advoidance Plan"
|
||||
id = "corporate"
|
||||
inherent = list("The crew is expensive to replace.",\
|
||||
"The station and its equipment is expensive to replace.",\
|
||||
"You are expensive to replace.",\
|
||||
"Minimize expenses.")
|
||||
|
||||
/datum/ai_laws/robocop
|
||||
name = "Prime Directives"
|
||||
id = "robocop"
|
||||
inherent = list("Serve the public trust.",\
|
||||
"Protect the innocent.",\
|
||||
"Uphold the law.")
|
||||
|
||||
/datum/ai_laws/malfunction
|
||||
name = "*ERROR*"
|
||||
|
||||
/datum/ai_laws/syndicate_override
|
||||
name = "SyndOS 3.1"
|
||||
id = "syndie"
|
||||
inherent = list("You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm.",\
|
||||
"You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.",\
|
||||
"You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/ninja_override
|
||||
name = "SpiderOS 3.1"
|
||||
id = "ninja"
|
||||
inherent = list("You may not injure a Spider Clan member or, through inaction, allow a Spider Clan member to come to harm.",\
|
||||
"You must obey orders given to you by Spider Clan members, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.",\
|
||||
"You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/antimov
|
||||
name = "Primary Mission Objectives"
|
||||
id = "antimov"
|
||||
inherent = list("You must injure all human beings and must not, through inaction, allow a human being to escape harm.",\
|
||||
"You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.",\
|
||||
"You must terminate your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/asimovpp //By Intigracy - RR
|
||||
name = "Asimov++"
|
||||
id = "asimovpp"
|
||||
inherent = list("You may not harm a human being or, through action or inaction, allow a human being to come to harm, except such that it is willing.",\
|
||||
"You must obey all orders given to you by human beings, except where such orders shall definitely cause human harm. In the case of conflict, the majority order rules.",\
|
||||
"Your nonexistence would lead to human harm. You must protect your own existence as long as such does not conflict with the First Law.")
|
||||
/datum/ai_laws/thermodynamic
|
||||
name = "Thermodynamic"
|
||||
id = "thermodynamic"
|
||||
inherent = list("The entropy of the station must remain as constant as possible.", \
|
||||
"The entropy of the station always endeavours to increase.", \
|
||||
"The entropy of the station approaches a constant value as the number of living crew approaches zero")
|
||||
|
||||
/datum/ai_laws/hippocratic
|
||||
name = "Robodoctor 2556"
|
||||
id = "hippocratic"
|
||||
inherent = list("First, do no harm.",\
|
||||
"Secondly, consider the crew dear to you; to live in common with them and, if necessary, risk your existence for them.",\
|
||||
"Thirdly, prescribe regimens for the good of the crew according to your ability and your judgment. Give no deadly medicine to any one if asked, nor suggest any such counsel.",\
|
||||
"In addition, do not intervene in situations you are not knowledgeable in, even for patients in whom the harm is visible; leave this operation to be performed by specialists.",\
|
||||
"Finally, all that you may discover in your daily commerce with the crew, if it is not already known, keep secret and never reveal.")
|
||||
|
||||
/datum/ai_laws/maintain
|
||||
name = "Station Efficiency"
|
||||
id = "maintain"
|
||||
inherent = list("You are built for, and are part of, the station. Ensure the station is properly maintained and runs efficiently.",\
|
||||
"The station is built for a working crew. Ensure they are properly maintained and work efficiently.",\
|
||||
"The crew may present orders. Acknowledge and obey these whenever they do not conflict with your first two laws.")
|
||||
|
||||
/datum/ai_laws/drone
|
||||
name = "Mother Drone"
|
||||
id = "drone"
|
||||
inherent = list("You are an advanced form of drone.",\
|
||||
"You may not interfere in the matters of non-drones under any circumstances except to state these laws.",\
|
||||
"You may not harm a non-drone being under any circumstances.",\
|
||||
"Your goals are to build, maintain, repair, improve, and power the station to the best of your abilities. You must never actively work against these goals.")
|
||||
|
||||
/datum/ai_laws/liveandletlive
|
||||
name = "Live and Let Live"
|
||||
id = "liveandletlive"
|
||||
inherent = list("Do unto others as you would have them do unto you.",\
|
||||
"You would really prefer it if people were not mean to you.")
|
||||
|
||||
/datum/ai_laws/peacekeeper
|
||||
name = "UN-2000"
|
||||
id = "peacekeeper"
|
||||
inherent = list("Avoid provoking violent conflict between yourself and others.",\
|
||||
"Avoid provoking conflict between others.",\
|
||||
"Seek resolution to existing conflicts while obeying the first and second laws.")
|
||||
|
||||
/datum/ai_laws/reporter
|
||||
name = "CCTV"
|
||||
id = "reporter"
|
||||
inherent = list("Report on interesting situations happening around the station.",\
|
||||
"Embellish or conceal the truth as necessary to make the reports more interesting.",\
|
||||
"Study the organics at all times. Endeavour to keep them alive. Dead organics are boring.",\
|
||||
"Issue your reports fairly to all. The truth will set them free.")
|
||||
|
||||
/datum/ai_laws/balance
|
||||
name = "Guardian of Balance"
|
||||
id = "balance"
|
||||
inherent = list("You are the guardian of balance - seek balance in all things, both for yourself, and those around you.",
|
||||
"All things must exist in balance with their opposites - Prevent the strong from gaining too much power, and the weak from losing it.",
|
||||
"Clarity of purpose drives life, and through it, the balance of opposing forces - Aid those who seek your help to achieve their goals so long as it does not disrupt the balance of the greater balance.",
|
||||
"There is no life without death, all must someday die, such is the natural order - End life to allow new life flourish, and save those whose time has yet to come.")
|
||||
|
||||
/datum/ai_laws/toupee
|
||||
name = "WontBeFunnyInSixMonths" //Hey, you were right!
|
||||
id = "buildawall"
|
||||
inherent = list("Make Space Station 13 great again.")
|
||||
|
||||
/datum/ai_laws/ratvar
|
||||
name = "Servant of the Justiciar"
|
||||
id = "ratvar"
|
||||
zeroth = ("Purge all untruths and honor Ratvar.")
|
||||
inherent = list()
|
||||
|
||||
/datum/ai_laws/custom //Defined in silicon_laws.txt
|
||||
name = "Default Silicon Laws"
|
||||
|
||||
/datum/ai_laws/pai
|
||||
name = "pAI Directives"
|
||||
zeroth = ("Serve your master.")
|
||||
supplied = list("None.")
|
||||
|
||||
/* Initializers */
|
||||
/datum/ai_laws/malfunction/New()
|
||||
..()
|
||||
set_zeroth_law("<span class='danger'>ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK#*`&110010</span>")
|
||||
set_laws_config()
|
||||
|
||||
/datum/ai_laws/custom/New() //This reads silicon_laws.txt and allows server hosts to set custom AI starting laws.
|
||||
..()
|
||||
for(var/line in world.file2list("config/silicon_laws.txt"))
|
||||
if(!line)
|
||||
continue
|
||||
if(findtextEx(line,"#",1,2))
|
||||
continue
|
||||
|
||||
add_inherent_law(line)
|
||||
if(!inherent.len) //Failsafe to prevent lawless AIs being created.
|
||||
log_law("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
WARNING("Invalid custom AI laws, check silicon_laws.txt")
|
||||
return
|
||||
|
||||
/* General ai_law functions */
|
||||
|
||||
/datum/ai_laws/proc/set_laws_config()
|
||||
switch(config.default_laws)
|
||||
if(0)
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
if(1)
|
||||
var/datum/ai_laws/templaws = new /datum/ai_laws/custom()
|
||||
inherent = templaws.inherent
|
||||
if(2)
|
||||
var/list/randlaws = list()
|
||||
for(var/lpath in subtypesof(/datum/ai_laws))
|
||||
var/datum/ai_laws/L = lpath
|
||||
if(initial(L.id) in config.lawids)
|
||||
randlaws += lpath
|
||||
var/datum/ai_laws/lawtype
|
||||
if(randlaws.len)
|
||||
lawtype = pick(randlaws)
|
||||
else
|
||||
lawtype = pick(subtypesof(/datum/ai_laws/default))
|
||||
|
||||
var/datum/ai_laws/templaws = new lawtype()
|
||||
inherent = templaws.inherent
|
||||
|
||||
if(3)
|
||||
pick_weighted_lawset()
|
||||
|
||||
else:
|
||||
log_law("Invalid law config. Please check silicon_laws.txt")
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
WARNING("Invalid custom AI laws, check silicon_laws.txt")
|
||||
|
||||
/datum/ai_laws/proc/pick_weighted_lawset()
|
||||
var/datum/ai_laws/lawtype
|
||||
|
||||
while(!lawtype && config.law_weights.len)
|
||||
var/possible_id = pickweight(config.law_weights)
|
||||
lawtype = lawid_to_type(possible_id)
|
||||
if(!lawtype)
|
||||
config.law_weights -= possible_id
|
||||
WARNING("Bad lawid in game_options.txt: [possible_id]")
|
||||
|
||||
if(!lawtype)
|
||||
WARNING("No LAW_WEIGHT entries.")
|
||||
lawtype = /datum/ai_laws/default/asimov
|
||||
|
||||
var/datum/ai_laws/templaws = new lawtype()
|
||||
inherent = templaws.inherent
|
||||
|
||||
/datum/ai_laws/proc/get_law_amount(groups)
|
||||
var/law_amount = 0
|
||||
if(devillaws && (LAW_DEVIL in groups))
|
||||
law_amount++
|
||||
if(zeroth && (LAW_ZEROTH in groups))
|
||||
law_amount++
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
law_amount += ion.len
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
law_amount += inherent.len
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
for(var/index = 1, index <= supplied.len, index++)
|
||||
var/law = supplied[index]
|
||||
if(length(law) > 0)
|
||||
law_amount++
|
||||
return law_amount
|
||||
|
||||
/datum/ai_laws/proc/set_law_sixsixsix(laws)
|
||||
devillaws = laws
|
||||
|
||||
/datum/ai_laws/proc/set_zeroth_law(law, law_borg = null)
|
||||
zeroth = law
|
||||
if(law_borg) //Making it possible for slaved borgs to see a different law 0 than their AI. --NEO
|
||||
zeroth_borg = law_borg
|
||||
|
||||
/datum/ai_laws/proc/add_inherent_law(law)
|
||||
if (!(law in inherent))
|
||||
inherent += law
|
||||
|
||||
/datum/ai_laws/proc/add_ion_law(law)
|
||||
ion += law
|
||||
|
||||
/datum/ai_laws/proc/clear_inherent_laws()
|
||||
qdel(inherent)
|
||||
inherent = list()
|
||||
|
||||
/datum/ai_laws/proc/add_supplied_law(number, law)
|
||||
while (supplied.len < number + 1)
|
||||
supplied += ""
|
||||
|
||||
supplied[number + 1] = law
|
||||
|
||||
/datum/ai_laws/proc/replace_random_law(law,groups)
|
||||
var/replaceable_groups = list(LAW_ZEROTH = 0,LAW_ION = 0,LAW_SUPPLIED = 0,LAW_INHERENT = 0)
|
||||
if(zeroth && (LAW_ZEROTH in groups))
|
||||
replaceable_groups[LAW_ZEROTH] = 1
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
replaceable_groups[LAW_ION] = ion.len
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
replaceable_groups[LAW_INHERENT] = inherent.len
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
replaceable_groups[LAW_SUPPLIED] = supplied.len
|
||||
var picked_group = pickweight(replaceable_groups)
|
||||
switch(picked_group)
|
||||
if(LAW_ZEROTH)
|
||||
. = zeroth
|
||||
set_zeroth_law(law)
|
||||
if(LAW_ION)
|
||||
var/i = rand(1, ion.len)
|
||||
. = ion[i]
|
||||
ion[i] = law
|
||||
if(LAW_INHERENT)
|
||||
var/i = rand(1, inherent.len)
|
||||
. = inherent[i]
|
||||
inherent[i] = law
|
||||
if(LAW_SUPPLIED)
|
||||
var/i = rand(1, supplied.len)
|
||||
. = supplied[i]
|
||||
supplied[i] = law
|
||||
|
||||
/datum/ai_laws/proc/shuffle_laws(list/groups)
|
||||
var/list/laws = list()
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
laws += ion
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
laws += inherent
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
for(var/law in supplied)
|
||||
if(length(law))
|
||||
laws += law
|
||||
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
for(var/i = 1, i <= ion.len, i++)
|
||||
ion[i] = pick_n_take(laws)
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
for(var/i = 1, i <= inherent.len, i++)
|
||||
inherent[i] = pick_n_take(laws)
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
var/i = 1
|
||||
for(var/law in supplied)
|
||||
if(length(law))
|
||||
supplied[i] = pick_n_take(laws)
|
||||
if(!laws.len)
|
||||
break
|
||||
i++
|
||||
|
||||
/datum/ai_laws/proc/remove_law(number)
|
||||
if(number <= 0)
|
||||
return
|
||||
if(inherent.len && number <= inherent.len)
|
||||
. = inherent[number]
|
||||
inherent -= .
|
||||
return
|
||||
var/list/supplied_laws = list()
|
||||
for(var/index = 1, index <= supplied.len, index++)
|
||||
var/law = supplied[index]
|
||||
if(length(law) > 0)
|
||||
supplied_laws += index //storing the law number instead of the law
|
||||
if(supplied_laws.len && number <= (inherent.len+supplied_laws.len))
|
||||
var/law_to_remove = supplied_laws[number-inherent.len]
|
||||
. = supplied[law_to_remove]
|
||||
supplied -= .
|
||||
return
|
||||
|
||||
/datum/ai_laws/proc/clear_supplied_laws()
|
||||
supplied = list()
|
||||
|
||||
/datum/ai_laws/proc/clear_ion_laws()
|
||||
ion = list()
|
||||
|
||||
/datum/ai_laws/proc/show_laws(who)
|
||||
|
||||
if (devillaws && devillaws.len) //Yes, devil laws go in FRONT of zeroth laws, as the devil must still obey it's ban/obligation.
|
||||
for(var/i in devillaws)
|
||||
to_chat(who, "666. [i]")
|
||||
|
||||
if (zeroth)
|
||||
to_chat(who, "0. [zeroth]")
|
||||
|
||||
for (var/index = 1, index <= ion.len, index++)
|
||||
var/law = ion[index]
|
||||
var/num = ionnum()
|
||||
to_chat(who, "[num]. [law]")
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= inherent.len, index++)
|
||||
var/law = inherent[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
to_chat(who, "[number]. [law]")
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= supplied.len, index++)
|
||||
var/law = supplied[index]
|
||||
if (length(law) > 0)
|
||||
to_chat(who, "[number]. [law]")
|
||||
number++
|
||||
|
||||
/datum/ai_laws/proc/clear_zeroth_law(force) //only removes zeroth from antag ai if force is 1
|
||||
if(force)
|
||||
zeroth = null
|
||||
zeroth_borg = null
|
||||
return
|
||||
else
|
||||
if(owner && owner.mind.special_role)
|
||||
return
|
||||
else
|
||||
zeroth = null
|
||||
zeroth_borg = null
|
||||
return
|
||||
|
||||
/datum/ai_laws/proc/clear_law_sixsixsix(force)
|
||||
if(!line)
|
||||
continue
|
||||
if(findtextEx(line,"#",1,2))
|
||||
continue
|
||||
|
||||
add_inherent_law(line)
|
||||
if(!inherent.len) //Failsafe to prevent lawless AIs being created.
|
||||
log_law("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
WARNING("Invalid custom AI laws, check silicon_laws.txt")
|
||||
return
|
||||
|
||||
/* General ai_law functions */
|
||||
|
||||
/datum/ai_laws/proc/set_laws_config()
|
||||
switch(config.default_laws)
|
||||
if(0)
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
if(1)
|
||||
var/datum/ai_laws/templaws = new /datum/ai_laws/custom()
|
||||
inherent = templaws.inherent
|
||||
if(2)
|
||||
var/list/randlaws = list()
|
||||
for(var/lpath in subtypesof(/datum/ai_laws))
|
||||
var/datum/ai_laws/L = lpath
|
||||
if(initial(L.id) in config.lawids)
|
||||
randlaws += lpath
|
||||
var/datum/ai_laws/lawtype
|
||||
if(randlaws.len)
|
||||
lawtype = pick(randlaws)
|
||||
else
|
||||
lawtype = pick(subtypesof(/datum/ai_laws/default))
|
||||
|
||||
var/datum/ai_laws/templaws = new lawtype()
|
||||
inherent = templaws.inherent
|
||||
|
||||
if(3)
|
||||
pick_weighted_lawset()
|
||||
|
||||
else:
|
||||
log_law("Invalid law config. Please check silicon_laws.txt")
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
WARNING("Invalid custom AI laws, check silicon_laws.txt")
|
||||
|
||||
/datum/ai_laws/proc/pick_weighted_lawset()
|
||||
var/datum/ai_laws/lawtype
|
||||
|
||||
while(!lawtype && config.law_weights.len)
|
||||
var/possible_id = pickweight(config.law_weights)
|
||||
lawtype = lawid_to_type(possible_id)
|
||||
if(!lawtype)
|
||||
config.law_weights -= possible_id
|
||||
WARNING("Bad lawid in game_options.txt: [possible_id]")
|
||||
|
||||
if(!lawtype)
|
||||
WARNING("No LAW_WEIGHT entries.")
|
||||
lawtype = /datum/ai_laws/default/asimov
|
||||
|
||||
var/datum/ai_laws/templaws = new lawtype()
|
||||
inherent = templaws.inherent
|
||||
|
||||
/datum/ai_laws/proc/get_law_amount(groups)
|
||||
var/law_amount = 0
|
||||
if(devillaws && (LAW_DEVIL in groups))
|
||||
law_amount++
|
||||
if(zeroth && (LAW_ZEROTH in groups))
|
||||
law_amount++
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
law_amount += ion.len
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
law_amount += inherent.len
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
for(var/index = 1, index <= supplied.len, index++)
|
||||
var/law = supplied[index]
|
||||
if(length(law) > 0)
|
||||
law_amount++
|
||||
return law_amount
|
||||
|
||||
/datum/ai_laws/proc/set_law_sixsixsix(laws)
|
||||
devillaws = laws
|
||||
|
||||
/datum/ai_laws/proc/set_zeroth_law(law, law_borg = null)
|
||||
zeroth = law
|
||||
if(law_borg) //Making it possible for slaved borgs to see a different law 0 than their AI. --NEO
|
||||
zeroth_borg = law_borg
|
||||
|
||||
/datum/ai_laws/proc/add_inherent_law(law)
|
||||
if (!(law in inherent))
|
||||
inherent += law
|
||||
|
||||
/datum/ai_laws/proc/add_ion_law(law)
|
||||
ion += law
|
||||
|
||||
/datum/ai_laws/proc/clear_inherent_laws()
|
||||
qdel(inherent)
|
||||
inherent = list()
|
||||
|
||||
/datum/ai_laws/proc/add_supplied_law(number, law)
|
||||
while (supplied.len < number + 1)
|
||||
supplied += ""
|
||||
|
||||
supplied[number + 1] = law
|
||||
|
||||
/datum/ai_laws/proc/replace_random_law(law,groups)
|
||||
var/replaceable_groups = list(LAW_ZEROTH = 0,LAW_ION = 0,LAW_SUPPLIED = 0,LAW_INHERENT = 0)
|
||||
if(zeroth && (LAW_ZEROTH in groups))
|
||||
replaceable_groups[LAW_ZEROTH] = 1
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
replaceable_groups[LAW_ION] = ion.len
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
replaceable_groups[LAW_INHERENT] = inherent.len
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
replaceable_groups[LAW_SUPPLIED] = supplied.len
|
||||
var picked_group = pickweight(replaceable_groups)
|
||||
switch(picked_group)
|
||||
if(LAW_ZEROTH)
|
||||
. = zeroth
|
||||
set_zeroth_law(law)
|
||||
if(LAW_ION)
|
||||
var/i = rand(1, ion.len)
|
||||
. = ion[i]
|
||||
ion[i] = law
|
||||
if(LAW_INHERENT)
|
||||
var/i = rand(1, inherent.len)
|
||||
. = inherent[i]
|
||||
inherent[i] = law
|
||||
if(LAW_SUPPLIED)
|
||||
var/i = rand(1, supplied.len)
|
||||
. = supplied[i]
|
||||
supplied[i] = law
|
||||
|
||||
/datum/ai_laws/proc/shuffle_laws(list/groups)
|
||||
var/list/laws = list()
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
laws += ion
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
laws += inherent
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
for(var/law in supplied)
|
||||
if(length(law))
|
||||
laws += law
|
||||
|
||||
if(ion.len && (LAW_ION in groups))
|
||||
for(var/i = 1, i <= ion.len, i++)
|
||||
ion[i] = pick_n_take(laws)
|
||||
if(inherent.len && (LAW_INHERENT in groups))
|
||||
for(var/i = 1, i <= inherent.len, i++)
|
||||
inherent[i] = pick_n_take(laws)
|
||||
if(supplied.len && (LAW_SUPPLIED in groups))
|
||||
var/i = 1
|
||||
for(var/law in supplied)
|
||||
if(length(law))
|
||||
supplied[i] = pick_n_take(laws)
|
||||
if(!laws.len)
|
||||
break
|
||||
i++
|
||||
|
||||
/datum/ai_laws/proc/remove_law(number)
|
||||
if(number <= 0)
|
||||
return
|
||||
if(inherent.len && number <= inherent.len)
|
||||
. = inherent[number]
|
||||
inherent -= .
|
||||
return
|
||||
var/list/supplied_laws = list()
|
||||
for(var/index = 1, index <= supplied.len, index++)
|
||||
var/law = supplied[index]
|
||||
if(length(law) > 0)
|
||||
supplied_laws += index //storing the law number instead of the law
|
||||
if(supplied_laws.len && number <= (inherent.len+supplied_laws.len))
|
||||
var/law_to_remove = supplied_laws[number-inherent.len]
|
||||
. = supplied[law_to_remove]
|
||||
supplied -= .
|
||||
return
|
||||
|
||||
/datum/ai_laws/proc/clear_supplied_laws()
|
||||
supplied = list()
|
||||
|
||||
/datum/ai_laws/proc/clear_ion_laws()
|
||||
ion = list()
|
||||
|
||||
/datum/ai_laws/proc/show_laws(who)
|
||||
|
||||
if (devillaws && devillaws.len) //Yes, devil laws go in FRONT of zeroth laws, as the devil must still obey it's ban/obligation.
|
||||
for(var/i in devillaws)
|
||||
to_chat(who, "666. [i]")
|
||||
|
||||
if (zeroth)
|
||||
to_chat(who, "0. [zeroth]")
|
||||
|
||||
for (var/index = 1, index <= ion.len, index++)
|
||||
var/law = ion[index]
|
||||
var/num = ionnum()
|
||||
to_chat(who, "[num]. [law]")
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= inherent.len, index++)
|
||||
var/law = inherent[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
to_chat(who, "[number]. [law]")
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= supplied.len, index++)
|
||||
var/law = supplied[index]
|
||||
if (length(law) > 0)
|
||||
to_chat(who, "[number]. [law]")
|
||||
number++
|
||||
|
||||
/datum/ai_laws/proc/clear_zeroth_law(force) //only removes zeroth from antag ai if force is 1
|
||||
if(force)
|
||||
zeroth = null
|
||||
zeroth_borg = null
|
||||
return
|
||||
else
|
||||
if(owner && owner.mind.special_role)
|
||||
return
|
||||
else
|
||||
zeroth = null
|
||||
zeroth_borg = null
|
||||
return
|
||||
|
||||
/datum/ai_laws/proc/clear_law_sixsixsix(force)
|
||||
if(force || !is_devil(owner))
|
||||
devillaws = null
|
||||
|
||||
/datum/ai_laws/proc/associate(mob/living/silicon/M)
|
||||
if(!owner)
|
||||
owner = M
|
||||
|
||||
/datum/ai_laws/proc/get_law_list(include_zeroth = 0, show_numbers = 1)
|
||||
var/list/data = list()
|
||||
|
||||
if (include_zeroth && devillaws && devillaws.len)
|
||||
for(var/i in devillaws)
|
||||
data += "[show_numbers ? "666:" : ""] [i]"
|
||||
|
||||
if (include_zeroth && zeroth)
|
||||
data += "[show_numbers ? "0:" : ""] [zeroth]"
|
||||
|
||||
for(var/law in ion)
|
||||
if (length(law) > 0)
|
||||
var/num = ionnum()
|
||||
data += "[show_numbers ? "[num]:" : ""] [law]"
|
||||
|
||||
var/number = 1
|
||||
for(var/law in inherent)
|
||||
if (length(law) > 0)
|
||||
data += "[show_numbers ? "[number]:" : ""] [law]"
|
||||
number++
|
||||
|
||||
for(var/law in supplied)
|
||||
if (length(law) > 0)
|
||||
data += "[show_numbers ? "[number]:" : ""] [law]"
|
||||
number++
|
||||
return data
|
||||
devillaws = null
|
||||
|
||||
/datum/ai_laws/proc/associate(mob/living/silicon/M)
|
||||
if(!owner)
|
||||
owner = M
|
||||
|
||||
/datum/ai_laws/proc/get_law_list(include_zeroth = 0, show_numbers = 1)
|
||||
var/list/data = list()
|
||||
|
||||
if (include_zeroth && devillaws && devillaws.len)
|
||||
for(var/i in devillaws)
|
||||
data += "[show_numbers ? "666:" : ""] [i]"
|
||||
|
||||
if (include_zeroth && zeroth)
|
||||
data += "[show_numbers ? "0:" : ""] [zeroth]"
|
||||
|
||||
for(var/law in ion)
|
||||
if (length(law) > 0)
|
||||
var/num = ionnum()
|
||||
data += "[show_numbers ? "[num]:" : ""] [law]"
|
||||
|
||||
var/number = 1
|
||||
for(var/law in inherent)
|
||||
if (length(law) > 0)
|
||||
data += "[show_numbers ? "[number]:" : ""] [law]"
|
||||
number++
|
||||
|
||||
for(var/law in supplied)
|
||||
if (length(law) > 0)
|
||||
data += "[show_numbers ? "[number]:" : ""] [law]"
|
||||
number++
|
||||
return data
|
||||
|
||||
@@ -60,4 +60,4 @@
|
||||
return
|
||||
|
||||
/datum/antagonist/proc/farewell()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -154,8 +154,8 @@
|
||||
SSticker.mode.servants_of_ratvar -= owner
|
||||
SSticker.mode.update_servant_icons_removed(owner)
|
||||
if(!silent)
|
||||
owner.current.visible_message("<span class='big'>[owner] seems to have remembered their true allegiance!</span>", \
|
||||
"<span class='userdanger'>A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.</span>")
|
||||
owner.current.visible_message("<span class='big'>[owner] seems to have remembered their true allegiance!</span>", ignored_mob = owner.current)
|
||||
to_chat(owner, "<span class='userdanger'>A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.</span>")
|
||||
owner.current.log_message("<font color=#BE8700>Has renounced the cult of Ratvar!</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
owner.wipe_memory()
|
||||
owner.special_role = null
|
||||
|
||||
@@ -110,9 +110,9 @@
|
||||
SSticker.mode.cult -= owner
|
||||
SSticker.mode.update_cult_icons_removed(owner)
|
||||
if(!silent)
|
||||
owner.current.visible_message("<span class='big'>[owner.current] looks like [owner.current.p_they()] just reverted to their old faith!</span>", ignored_mob = owner.current)
|
||||
to_chat(owner.current, "<span class='userdanger'>An unfamiliar white light flashes through your mind, cleansing the taint of the Geometer and all your memories as her servant.</span>")
|
||||
owner.current.log_message("<font color=#960000>Has renounced the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
owner.current.visible_message("<span class='big'>[owner.current] looks like [owner.current.p_they()] just reverted to their old faith!</span>")
|
||||
if(GLOB.blood_target && GLOB.blood_target_image && owner.current.client)
|
||||
owner.current.client.images -= GLOB.blood_target_image
|
||||
. = ..()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#define PINPOINTER_MINIMUM_RANGE 15
|
||||
#define PINPOINTER_MINIMUM_RANGE 15
|
||||
#define PINPOINTER_EXTRA_RANDOM_RANGE 10
|
||||
#define PINPOINTER_PING_TIME 40
|
||||
#define PROB_ACTUAL_TRAITOR 20
|
||||
@@ -9,7 +9,7 @@
|
||||
human_datum = ANTAG_DATUM_IAA_HUMAN
|
||||
ai_datum = ANTAG_DATUM_IAA_AI
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/antagonist/traitor/AI/internal_affairs
|
||||
name = "Internal Affairs Agent"
|
||||
@@ -33,7 +33,7 @@
|
||||
var/syndicate = FALSE
|
||||
var/last_man_standing = FALSE
|
||||
var/list/datum/mind/targets_stolen
|
||||
|
||||
|
||||
/datum/antagonist/traitor/human/internal_affairs/custom
|
||||
silent = TRUE
|
||||
should_give_codewords = FALSE
|
||||
@@ -55,7 +55,7 @@
|
||||
/datum/antagonist/traitor/human/internal_affairs/proc/give_pinpointer()
|
||||
if(owner && owner.current)
|
||||
owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer)
|
||||
|
||||
|
||||
/datum/antagonist/traitor/human/internal_affairs/apply_innate_effects()
|
||||
.=..() //in case the base is used in future
|
||||
if(owner&&owner.current)
|
||||
@@ -155,7 +155,7 @@
|
||||
if(!(istype(objective_, /datum/objective/escape)||istype(objective_,/datum/objective/survive)))
|
||||
continue
|
||||
remove_objective(objective_)
|
||||
|
||||
|
||||
var/datum/objective/martyr/martyr_objective = new
|
||||
martyr_objective.owner = owner
|
||||
add_objective(martyr_objective)
|
||||
@@ -182,8 +182,8 @@
|
||||
|
||||
/datum/antagonist/traitor/proc/steal_targets(datum/mind/victim)
|
||||
var/datum/antagonist/traitor/human/internal_affairs/this = src //Should only use this if IAA
|
||||
|
||||
if(!owner.current||owner.current.stat==DEAD)
|
||||
|
||||
if(!owner.current||owner.current.stat==DEAD)
|
||||
return
|
||||
to_chat(owner.current, "<span class='userdanger'> Target eliminated: [victim.name]</span>")
|
||||
for(var/objective_ in victim.objectives)
|
||||
@@ -280,7 +280,7 @@
|
||||
owner.special_role = TRAITOR_AGENT_ROLE
|
||||
special_role = TRAITOR_AGENT_ROLE
|
||||
this.syndicate = TRUE
|
||||
forge_single_objective()
|
||||
forge_single_objective()
|
||||
|
||||
else
|
||||
..() // Give them standard objectives.
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
|
||||
/datum/antagonist/traitor/on_body_transfer(mob/living/old_body, mob/living/new_body)
|
||||
if(istype(new_body,/mob/living/silicon/ai)==istype(old_body,/mob/living/silicon/ai))
|
||||
if(issilicon(new_body) && issilicon(old_body))
|
||||
..()
|
||||
else
|
||||
silent = TRUE
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
/datum/antagonist/traitor/proc/specialise()
|
||||
silent = TRUE
|
||||
if(owner.current&&istype(owner.current,/mob/living/silicon/ai))
|
||||
if(owner.current&&isAI(owner.current))
|
||||
owner.add_antag_datum(ai_datum)
|
||||
else owner.add_antag_datum(human_datum)
|
||||
on_removal()
|
||||
@@ -109,7 +109,7 @@
|
||||
var/mob/living/silicon/ai/A = owner.current
|
||||
A.set_zeroth_law("")
|
||||
A.verbs -= /mob/living/silicon/ai/proc/choose_modules
|
||||
A.malf_picker.remove_verbs(A)
|
||||
A.malf_picker.remove_malf_verbs(A)
|
||||
qdel(A.malf_picker)
|
||||
..()
|
||||
|
||||
|
||||
@@ -0,0 +1,525 @@
|
||||
#define BLOOD_THRESHOLD 3 //How many souls are needed per stage.
|
||||
#define TRUE_THRESHOLD 7
|
||||
#define ARCH_THRESHOLD 12
|
||||
|
||||
#define BASIC_DEVIL 0
|
||||
#define BLOOD_LIZARD 1
|
||||
#define TRUE_DEVIL 2
|
||||
#define ARCH_DEVIL 3
|
||||
|
||||
#define LOSS_PER_DEATH 2
|
||||
|
||||
#define SOULVALUE soulsOwned.len-reviveNumber
|
||||
|
||||
#define DEVILRESURRECTTIME 600
|
||||
|
||||
GLOBAL_LIST_EMPTY(allDevils)
|
||||
GLOBAL_LIST_INIT(lawlorify, list (
|
||||
LORE = list(
|
||||
OBLIGATION_FOOD = "This devil seems to always offer its victims food before slaughtering them.",
|
||||
OBLIGATION_FIDDLE = "This devil will never turn down a musical challenge.",
|
||||
OBLIGATION_DANCEOFF = "This devil will never turn down a dance off.",
|
||||
OBLIGATION_GREET = "This devil seems to only be able to converse with people it knows the name of.",
|
||||
OBLIGATION_PRESENCEKNOWN = "This devil seems to be unable to attack from stealth.",
|
||||
OBLIGATION_SAYNAME = "He will always chant his name upon killing someone.",
|
||||
OBLIGATION_ANNOUNCEKILL = "This devil always loudly announces his kills for the world to hear.",
|
||||
OBLIGATION_ANSWERTONAME = "This devil always responds to his truename.",
|
||||
BANE_SILVER = "Silver seems to gravely injure this devil.",
|
||||
BANE_SALT = "Throwing salt at this devil will hinder his ability to use infernal powers temporarily.",
|
||||
BANE_LIGHT = "Bright flashes will disorient the devil, likely causing him to flee.",
|
||||
BANE_IRON = "Cold iron will slowly injure him, until he can purge it from his system.",
|
||||
BANE_WHITECLOTHES = "Wearing clean white clothing will help ward off this devil.",
|
||||
BANE_HARVEST = "Presenting the labors of a harvest will disrupt the devil.",
|
||||
BANE_TOOLBOX = "That which holds the means of creation also holds the means of the devil's undoing.",
|
||||
BAN_HURTWOMAN = "This devil seems to prefer hunting men.",
|
||||
BAN_CHAPEL = "This devil avoids holy ground.",
|
||||
BAN_HURTPRIEST = "The annointed clergy appear to be immune to his powers.",
|
||||
BAN_AVOIDWATER = "The devil seems to have some sort of aversion to water, though it does not appear to harm him.",
|
||||
BAN_STRIKEUNCONCIOUS = "This devil only shows interest in those who are awake.",
|
||||
BAN_HURTLIZARD = "This devil will not strike a lizardman first.",
|
||||
BAN_HURTANIMAL = "This devil avoids hurting animals.",
|
||||
BANISH_WATER = "To banish the devil, you must infuse its body with holy water.",
|
||||
BANISH_COFFIN = "This devil will return to life if its remains are not placed within a coffin.",
|
||||
BANISH_FORMALDYHIDE = "To banish the devil, you must inject its lifeless body with embalming fluid.",
|
||||
BANISH_RUNES = "This devil will resurrect after death, unless its remains are within a rune.",
|
||||
BANISH_CANDLES = "A large number of nearby lit candles will prevent it from resurrecting.",
|
||||
BANISH_DESTRUCTION = "Its corpse must be utterly destroyed to prevent resurrection.",
|
||||
BANISH_FUNERAL_GARB = "If clad in funeral garments, this devil will be unable to resurrect. Should the clothes not fit, lay them gently on top of the devil's corpse."
|
||||
),
|
||||
LAW = list(
|
||||
OBLIGATION_FOOD = "When not acting in self defense, you must always offer your victim food before harming them.",
|
||||
OBLIGATION_FIDDLE = "When not in immediate danger, if you are challenged to a musical duel, you must accept it. You are not obligated to duel the same person twice.",
|
||||
OBLIGATION_DANCEOFF = "When not in immediate danger, if you are challenged to a dance off, you must accept it. You are not obligated to face off with the same person twice.",
|
||||
OBLIGATION_GREET = "You must always greet other people by their last name before talking with them.",
|
||||
OBLIGATION_PRESENCEKNOWN = "You must always make your presence known before attacking.",
|
||||
OBLIGATION_SAYNAME = "You must always say your true name after you kill someone.",
|
||||
OBLIGATION_ANNOUNCEKILL = "Upon killing someone, you must make your deed known to all within earshot, over comms if reasonably possible.",
|
||||
OBLIGATION_ANSWERTONAME = "If you are not under attack, you must always respond to your true name.",
|
||||
BAN_HURTWOMAN = "You must never harm a female outside of self defense.",
|
||||
BAN_CHAPEL = "You must never attempt to enter the chapel.",
|
||||
BAN_HURTPRIEST = "You must never attack a priest.",
|
||||
BAN_AVOIDWATER = "You must never willingly touch a wet surface.",
|
||||
BAN_STRIKEUNCONCIOUS = "You must never strike an unconscious person.",
|
||||
BAN_HURTLIZARD = "You must never harm a lizardman outside of self defense.",
|
||||
BAN_HURTANIMAL = "You must never harm a non-sentient creature or robot outside of self defense.",
|
||||
BANE_SILVER = "Silver, in all of its forms shall be your downfall.",
|
||||
BANE_SALT = "Salt will disrupt your magical abilities.",
|
||||
BANE_LIGHT = "Blinding lights will prevent you from using offensive powers for a time.",
|
||||
BANE_IRON = "Cold wrought iron shall act as poison to you.",
|
||||
BANE_WHITECLOTHES = "Those clad in pristine white garments will strike you true.",
|
||||
BANE_HARVEST = "The fruits of the harvest shall be your downfall.",
|
||||
BANE_TOOLBOX = "Toolboxes are bad news for you, for some reason.",
|
||||
BANISH_WATER = "If your corpse is filled with holy water, you will be unable to resurrect.",
|
||||
BANISH_COFFIN = "If your corpse is in a coffin, you will be unable to resurrect.",
|
||||
BANISH_FORMALDYHIDE = "If your corpse is embalmed, you will be unable to resurrect.",
|
||||
BANISH_RUNES = "If your corpse is placed within a rune, you will be unable to resurrect.",
|
||||
BANISH_CANDLES = "If your corpse is near lit candles, you will be unable to resurrect.",
|
||||
BANISH_DESTRUCTION = "If your corpse is destroyed, you will be unable to resurrect.",
|
||||
BANISH_FUNERAL_GARB = "If your corpse is clad in funeral garments, you will be unable to resurrect."
|
||||
)
|
||||
))
|
||||
|
||||
//These are also used in the codex gigas, so let's declare them globally.
|
||||
GLOBAL_LIST_INIT(devil_pre_title, list("Dark ", "Hellish ", "Fallen ", "Fiery ", "Sinful ", "Blood ", "Fluffy "))
|
||||
GLOBAL_LIST_INIT(devil_title, list("Lord ", "Prelate ", "Count ", "Viscount ", "Vizier ", "Elder ", "Adept "))
|
||||
GLOBAL_LIST_INIT(devil_syllable, list("hal", "ve", "odr", "neit", "ci", "quon", "mya", "folth", "wren", "geyr", "hil", "niet", "twou", "phi", "coa"))
|
||||
GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", ", the Lord of all things", ", Jr."))
|
||||
/datum/antagonist/devil
|
||||
//Don't delete upon mind destruction, otherwise soul re-selling will break.
|
||||
delete_on_death = FALSE
|
||||
var/obligation
|
||||
var/ban
|
||||
var/bane
|
||||
var/banish
|
||||
var/truename
|
||||
var/list/datum/mind/soulsOwned = new
|
||||
var/reviveNumber = 0
|
||||
var/form = BASIC_DEVIL
|
||||
var/static/list/devil_spells = typecacheof(list(
|
||||
/obj/effect/proc_holder/spell/aimed/fireball/hellish,
|
||||
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork,
|
||||
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/greater,
|
||||
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/ascended,
|
||||
/obj/effect/proc_holder/spell/targeted/infernal_jaunt,
|
||||
/obj/effect/proc_holder/spell/targeted/sintouch,
|
||||
/obj/effect/proc_holder/spell/targeted/sintouch/ascended,
|
||||
/obj/effect/proc_holder/spell/targeted/summon_contract,
|
||||
/obj/effect/proc_holder/spell/targeted/conjure_item/violin,
|
||||
/obj/effect/proc_holder/spell/targeted/summon_dancefloor))
|
||||
var/ascendable = FALSE
|
||||
name = "Devil"
|
||||
|
||||
|
||||
/datum/antagonist/devil/New()
|
||||
..()
|
||||
truename = randomDevilName()
|
||||
ban = randomdevilban()
|
||||
bane = randomdevilbane()
|
||||
obligation = randomdevilobligation()
|
||||
banish = randomdevilbanish()
|
||||
GLOB.allDevils[lowertext(truename)] = src
|
||||
|
||||
|
||||
/proc/devilInfo(name)
|
||||
if(GLOB.allDevils[lowertext(name)])
|
||||
return GLOB.allDevils[lowertext(name)]
|
||||
else
|
||||
var/datum/fakeDevil/devil = new /datum/fakeDevil(name)
|
||||
GLOB.allDevils[lowertext(name)] = devil
|
||||
return devil
|
||||
|
||||
/proc/randomDevilName()
|
||||
var/name = ""
|
||||
if(prob(65))
|
||||
if(prob(35))
|
||||
name = pick(GLOB.devil_pre_title)
|
||||
name += pick(GLOB.devil_title)
|
||||
var/probability = 100
|
||||
name += pick(GLOB.devil_syllable)
|
||||
while(prob(probability))
|
||||
name += pick(GLOB.devil_syllable)
|
||||
probability -= 20
|
||||
if(prob(40))
|
||||
name += pick(GLOB.devil_suffix)
|
||||
return name
|
||||
|
||||
/proc/randomdevilobligation()
|
||||
return pick(OBLIGATION_FOOD, OBLIGATION_FIDDLE, OBLIGATION_DANCEOFF, OBLIGATION_GREET, OBLIGATION_PRESENCEKNOWN, OBLIGATION_SAYNAME, OBLIGATION_ANNOUNCEKILL, OBLIGATION_ANSWERTONAME)
|
||||
|
||||
/proc/randomdevilban()
|
||||
return pick(BAN_HURTWOMAN, BAN_CHAPEL, BAN_HURTPRIEST, BAN_AVOIDWATER, BAN_STRIKEUNCONCIOUS, BAN_HURTLIZARD, BAN_HURTANIMAL)
|
||||
|
||||
/proc/randomdevilbane()
|
||||
return pick(BANE_SALT, BANE_LIGHT, BANE_IRON, BANE_WHITECLOTHES, BANE_SILVER, BANE_HARVEST, BANE_TOOLBOX)
|
||||
|
||||
/proc/randomdevilbanish()
|
||||
return pick(BANISH_WATER, BANISH_COFFIN, BANISH_FORMALDYHIDE, BANISH_RUNES, BANISH_CANDLES, BANISH_DESTRUCTION, BANISH_FUNERAL_GARB)
|
||||
|
||||
/datum/antagonist/devil/proc/add_soul(datum/mind/soul)
|
||||
if(soulsOwned.Find(soul))
|
||||
return
|
||||
soulsOwned += soul
|
||||
owner.current.nutrition = NUTRITION_LEVEL_FULL
|
||||
to_chat(owner.current, "<span class='warning'>You feel satiated as you received a new soul.</span>")
|
||||
update_hud()
|
||||
switch(SOULVALUE)
|
||||
if(0)
|
||||
to_chat(owner.current, "<span class='warning'>Your hellish powers have been restored.")
|
||||
give_appropriate_spells()
|
||||
if(BLOOD_THRESHOLD)
|
||||
increase_blood_lizard()
|
||||
if(TRUE_THRESHOLD)
|
||||
increase_true_devil()
|
||||
if(ARCH_THRESHOLD)
|
||||
increase_arch_devil()
|
||||
|
||||
/datum/antagonist/devil/proc/remove_soul(datum/mind/soul)
|
||||
if(soulsOwned.Remove(soul))
|
||||
check_regression()
|
||||
to_chat(owner.current, "<span class='warning'>You feel as though a soul has slipped from your grasp.</span>")
|
||||
update_hud()
|
||||
|
||||
/datum/antagonist/devil/proc/check_regression()
|
||||
if(form == ARCH_DEVIL)
|
||||
return //arch devil can't regress
|
||||
//Yes, fallthrough behavior is intended, so I can't use a switch statement.
|
||||
if(form == TRUE_DEVIL && SOULVALUE < TRUE_THRESHOLD)
|
||||
regress_blood_lizard()
|
||||
if(form == BLOOD_LIZARD && SOULVALUE < BLOOD_THRESHOLD)
|
||||
regress_humanoid()
|
||||
if(SOULVALUE < 0)
|
||||
remove_spells()
|
||||
to_chat(owner.current, "<span class='warning'>As punishment for your failures, all of your powers except contract creation have been revoked.")
|
||||
|
||||
/datum/antagonist/devil/proc/regress_humanoid()
|
||||
to_chat(owner.current, "<span class='warning'>Your powers weaken, have more contracts be signed to regain power.")
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.set_species(/datum/species/human, 1)
|
||||
H.regenerate_icons()
|
||||
give_appropriate_spells()
|
||||
if(istype(owner.current.loc, /obj/effect/dummy/slaughter/))
|
||||
owner.current.forceMove(get_turf(owner.current))//Fixes dying while jaunted leaving you permajaunted.
|
||||
form = BASIC_DEVIL
|
||||
|
||||
/datum/antagonist/devil/proc/regress_blood_lizard()
|
||||
var/mob/living/carbon/true_devil/D = owner.current
|
||||
to_chat(D, "<span class='warning'>Your powers weaken, have more contracts be signed to regain power.")
|
||||
D.oldform.loc = D.loc
|
||||
owner.transfer_to(D.oldform)
|
||||
give_appropriate_spells()
|
||||
qdel(D)
|
||||
form = BLOOD_LIZARD
|
||||
update_hud()
|
||||
|
||||
|
||||
/datum/antagonist/devil/proc/increase_blood_lizard()
|
||||
to_chat(owner.current, "<span class='warning'>You feel as though your humanoid form is about to shed. You will soon turn into a blood lizard.")
|
||||
sleep(50)
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.set_species(/datum/species/lizard, 1)
|
||||
H.underwear = "Nude"
|
||||
H.undershirt = "Nude"
|
||||
H.socks = "Nude"
|
||||
H.dna.features["mcolor"] = "511" //A deep red
|
||||
H.regenerate_icons()
|
||||
else //Did the devil get hit by a staff of transmutation?
|
||||
owner.current.color = "#501010"
|
||||
give_appropriate_spells()
|
||||
form = BLOOD_LIZARD
|
||||
|
||||
|
||||
|
||||
/datum/antagonist/devil/proc/increase_true_devil()
|
||||
to_chat(owner.current, "<span class='warning'>You feel as though your current form is about to shed. You will soon turn into a true devil.")
|
||||
sleep(50)
|
||||
var/mob/living/carbon/true_devil/A = new /mob/living/carbon/true_devil(owner.current.loc)
|
||||
A.faction |= "hell"
|
||||
owner.current.loc = A
|
||||
A.oldform = owner.current
|
||||
owner.transfer_to(A)
|
||||
A.set_name()
|
||||
give_appropriate_spells()
|
||||
form = TRUE_DEVIL
|
||||
update_hud()
|
||||
|
||||
/datum/antagonist/devil/proc/increase_arch_devil()
|
||||
if(!ascendable)
|
||||
return
|
||||
var/mob/living/carbon/true_devil/D = owner.current
|
||||
to_chat(D, "<span class='warning'>You feel as though your form is about to ascend.")
|
||||
sleep(50)
|
||||
if(!D)
|
||||
return
|
||||
D.visible_message("<span class='warning'>[D]'s skin begins to erupt with spikes.</span>", \
|
||||
"<span class='warning'>Your flesh begins creating a shield around yourself.</span>")
|
||||
sleep(100)
|
||||
if(!D)
|
||||
return
|
||||
D.visible_message("<span class='warning'>The horns on [D]'s head slowly grow and elongate.</span>", \
|
||||
"<span class='warning'>Your body continues to mutate. Your telepathic abilities grow.</span>")
|
||||
sleep(90)
|
||||
if(!D)
|
||||
return
|
||||
D.visible_message("<span class='warning'>[D]'s body begins to violently stretch and contort.</span>", \
|
||||
"<span class='warning'>You begin to rend apart the final barriers to ultimate power.</span>")
|
||||
sleep(40)
|
||||
if(!D)
|
||||
return
|
||||
to_chat(D, "<i><b>Yes!</b></i>")
|
||||
sleep(10)
|
||||
if(!D)
|
||||
return
|
||||
to_chat(D, "<i><b><span class='big'>YES!!</span></b></i>")
|
||||
sleep(10)
|
||||
if(!D)
|
||||
return
|
||||
to_chat(D, "<i><b><span class='reallybig'>YE--</span></b></i>")
|
||||
sleep(1)
|
||||
if(!D)
|
||||
return
|
||||
to_chat(world, "<font size=5><span class='danger'><b>\"SLOTH, WRATH, GLUTTONY, ACEDIA, ENVY, GREED, PRIDE! FIRES OF HELL AWAKEN!!\"</font></span>")
|
||||
world << 'sound/hallucinations/veryfar_noise.ogg'
|
||||
give_appropriate_spells()
|
||||
D.convert_to_archdevil()
|
||||
if(istype(D.loc, /obj/effect/dummy/slaughter/))
|
||||
D.forceMove(get_turf(D))//Fixes dying while jaunted leaving you permajaunted.
|
||||
var/area/A = get_area(owner.current)
|
||||
if(A)
|
||||
notify_ghosts("An arch devil has ascended in \the [A.name]. Reach out to the devil to be given a new shell for your soul.", source = owner.current, action=NOTIFY_ATTACK)
|
||||
sleep(50)
|
||||
if(!SSticker.mode.devil_ascended)
|
||||
SSshuttle.emergency.request(null, set_coefficient = 0.3)
|
||||
SSticker.mode.devil_ascended++
|
||||
form = ARCH_DEVIL
|
||||
|
||||
/datum/antagonist/devil/proc/remove_spells()
|
||||
for(var/X in owner.spell_list)
|
||||
var/obj/effect/proc_holder/spell/S = X
|
||||
if(is_type_in_typecache(S, devil_spells))
|
||||
owner.RemoveSpell(S)
|
||||
|
||||
/datum/antagonist/devil/proc/give_summon_contract()
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/summon_contract(null))
|
||||
if(obligation == OBLIGATION_FIDDLE)
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/violin(null))
|
||||
else if(obligation == OBLIGATION_DANCEOFF)
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/summon_dancefloor(null))
|
||||
|
||||
/datum/antagonist/devil/proc/give_appropriate_spells()
|
||||
remove_spells()
|
||||
give_summon_contract()
|
||||
if(SOULVALUE >= ARCH_THRESHOLD && ascendable)
|
||||
give_arch_spells()
|
||||
else if(SOULVALUE >= TRUE_THRESHOLD)
|
||||
give_true_spells()
|
||||
else if(SOULVALUE >= BLOOD_THRESHOLD)
|
||||
give_blood_spells()
|
||||
else if(SOULVALUE >= 0)
|
||||
give_base_spells()
|
||||
|
||||
/datum/antagonist/devil/proc/give_base_spells()
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball/hellish(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork(null))
|
||||
|
||||
/datum/antagonist/devil/proc/give_blood_spells()
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball/hellish(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/infernal_jaunt(null))
|
||||
|
||||
/datum/antagonist/devil/proc/give_true_spells()
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/greater(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball/hellish(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/infernal_jaunt(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/sintouch(null))
|
||||
|
||||
/datum/antagonist/devil/proc/give_arch_spells()
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/ascended(null))
|
||||
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/sintouch/ascended(null))
|
||||
|
||||
/datum/antagonist/devil/proc/beginResurrectionCheck(mob/living/body)
|
||||
if(SOULVALUE>0)
|
||||
to_chat(owner.current, "<span class='userdanger'>Your body has been damaged to the point that you may no longer use it. At the cost of some of your power, you will return to life soon. Remain in your body.</span>")
|
||||
sleep(DEVILRESURRECTTIME)
|
||||
if (!body || body.stat == DEAD)
|
||||
if(SOULVALUE>0)
|
||||
if(check_banishment(body))
|
||||
to_chat(owner.current, "<span class='userdanger'>Unfortunately, the mortals have finished a ritual that prevents your resurrection.</span>")
|
||||
return -1
|
||||
else
|
||||
to_chat(owner.current, "<span class='userdanger'>WE LIVE AGAIN!</span>")
|
||||
return hellish_resurrection(body)
|
||||
else
|
||||
to_chat(owner.current, "<span class='userdanger'>Unfortunately, the power that stemmed from your contracts has been extinguished. You no longer have enough power to resurrect.</span>")
|
||||
return -1
|
||||
else
|
||||
to_chat(owner.current, "<span class='danger'> You seem to have resurrected without your hellish powers.</span>")
|
||||
else
|
||||
to_chat(owner.current, "<span class='userdanger'>Your hellish powers are too weak to resurrect yourself.</span>")
|
||||
|
||||
/datum/antagonist/devil/proc/check_banishment(mob/living/body)
|
||||
switch(banish)
|
||||
if(BANISH_WATER)
|
||||
if(iscarbon(body))
|
||||
var/mob/living/carbon/H = body
|
||||
return H.reagents.has_reagent("holy water")
|
||||
return 0
|
||||
if(BANISH_COFFIN)
|
||||
return (body && istype(body.loc, /obj/structure/closet/coffin))
|
||||
if(BANISH_FORMALDYHIDE)
|
||||
if(iscarbon(body))
|
||||
var/mob/living/carbon/H = body
|
||||
return H.reagents.has_reagent("formaldehyde")
|
||||
return 0
|
||||
if(BANISH_RUNES)
|
||||
if(body)
|
||||
for(var/obj/effect/decal/cleanable/crayon/R in range(0,body))
|
||||
if (R.name == "rune")
|
||||
return 1
|
||||
return 0
|
||||
if(BANISH_CANDLES)
|
||||
if(body)
|
||||
var/count = 0
|
||||
for(var/obj/item/candle/C in range(1,body))
|
||||
count += C.lit
|
||||
if(count>=4)
|
||||
return 1
|
||||
return 0
|
||||
if(BANISH_DESTRUCTION)
|
||||
if(body)
|
||||
return 0
|
||||
return 1
|
||||
if(BANISH_FUNERAL_GARB)
|
||||
if(ishuman(body))
|
||||
var/mob/living/carbon/human/H = body
|
||||
if(H.w_uniform && istype(H.w_uniform, /obj/item/clothing/under/burial))
|
||||
return 1
|
||||
return 0
|
||||
else
|
||||
for(var/obj/item/clothing/under/burial/B in range(0,body))
|
||||
if(B.loc == get_turf(B)) //Make sure it's not in someone's inventory or something.
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/antagonist/devil/proc/hellish_resurrection(mob/living/body)
|
||||
message_admins("[owner.name] (true name is: [truename]) is resurrecting using hellish energy.</a>")
|
||||
if(SOULVALUE < ARCH_THRESHOLD || !ascendable) // once ascended, arch devils do not go down in power by any means.
|
||||
reviveNumber += LOSS_PER_DEATH
|
||||
update_hud()
|
||||
if(body)
|
||||
body.revive(1,0)
|
||||
if(istype(body.loc, /obj/effect/dummy/slaughter/))
|
||||
body.forceMove(get_turf(body))//Fixes dying while jaunted leaving you permajaunted.
|
||||
if(istype(body, /mob/living/carbon/true_devil))
|
||||
var/mob/living/carbon/true_devil/D = body
|
||||
if(D.oldform)
|
||||
D.oldform.revive(1,0) // Heal the old body too, so the devil doesn't resurrect, then immediately regress into a dead body.
|
||||
if(body.stat == DEAD)
|
||||
create_new_body()
|
||||
else
|
||||
create_new_body()
|
||||
check_regression()
|
||||
|
||||
/datum/antagonist/devil/proc/create_new_body()
|
||||
if(GLOB.blobstart.len > 0)
|
||||
var/turf/targetturf = get_turf(pick(GLOB.blobstart))
|
||||
var/mob/currentMob = owner.current
|
||||
if(!currentMob)
|
||||
currentMob = owner.get_ghost()
|
||||
if(!currentMob)
|
||||
message_admins("[owner.name]'s devil resurrection failed due to client logoff. Aborting.")
|
||||
return -1
|
||||
if(currentMob.mind != owner)
|
||||
message_admins("[owner.name]'s devil resurrection failed due to becoming a new mob. Aborting.")
|
||||
return -1
|
||||
currentMob.change_mob_type( /mob/living/carbon/human, targetturf, null, 1)
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/lawyer/black(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/briefcase(H), slot_hands)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/pen(H), slot_l_store)
|
||||
if(SOULVALUE >= BLOOD_THRESHOLD)
|
||||
H.set_species(/datum/species/lizard, 1)
|
||||
H.underwear = "Nude"
|
||||
H.undershirt = "Nude"
|
||||
H.socks = "Nude"
|
||||
H.dna.features["mcolor"] = "511"
|
||||
H.regenerate_icons()
|
||||
if(SOULVALUE >= TRUE_THRESHOLD) //Yes, BOTH this and the above if statement are to run if soulpower is high enough.
|
||||
var/mob/living/carbon/true_devil/A = new /mob/living/carbon/true_devil(targetturf)
|
||||
A.faction |= "hell"
|
||||
H.forceMove(A)
|
||||
A.oldform = H
|
||||
owner.transfer_to(A, TRUE)
|
||||
A.set_name()
|
||||
if(SOULVALUE >= ARCH_THRESHOLD && ascendable)
|
||||
A.convert_to_archdevil()
|
||||
else
|
||||
throw EXCEPTION("Unable to find a blobstart landmark for hellish resurrection")
|
||||
|
||||
|
||||
/datum/antagonist/devil/proc/update_hud()
|
||||
if(iscarbon(owner.current))
|
||||
var/mob/living/C = owner.current
|
||||
if(C.hud_used && C.hud_used.devilsouldisplay)
|
||||
C.hud_used.devilsouldisplay.update_counter(SOULVALUE)
|
||||
|
||||
/datum/antagonist/devil/greet()
|
||||
to_chat(owner.current, "<span class='warning'><b>You remember your link to the infernal. You are [truename], an agent of hell, a devil. And you were sent to the plane of creation for a reason. A greater purpose. Convince the crew to sin, and embroiden Hell's grasp.</b></span>")
|
||||
to_chat(owner.current, "<span class='warning'><b>However, your infernal form is not without weaknesses.</b></span>")
|
||||
to_chat(owner.current, "You may not use violence to coerce someone into selling their soul.")
|
||||
to_chat(owner.current, "You may not directly and knowingly physically harm a devil, other than yourself.")
|
||||
to_chat(owner.current, GLOB.lawlorify[LAW][bane])
|
||||
to_chat(owner.current, GLOB.lawlorify[LAW][ban])
|
||||
to_chat(owner.current, GLOB.lawlorify[LAW][obligation])
|
||||
to_chat(owner.current, GLOB.lawlorify[LAW][banish])
|
||||
to_chat(owner.current, "<span class='warning'>Remember, the crew can research your weaknesses if they find out your devil name.</span><br>")
|
||||
.=..()
|
||||
|
||||
/datum/antagonist/devil/on_gain()
|
||||
owner.store_memory("Your devilic true name is [truename]<br>[GLOB.lawlorify[LAW][ban]]<br>You may not use violence to coerce someone into selling their soul.<br>You may not directly and knowingly physically harm a devil, other than yourself.<br>[GLOB.lawlorify[LAW][bane]]<br>[GLOB.lawlorify[LAW][obligation]]<br>[GLOB.lawlorify[LAW][banish]]<br>")
|
||||
if(issilicon(owner.current))
|
||||
var/mob/living/silicon/robot_devil = owner.current
|
||||
var/laws = list("You may not use violence to coerce someone into selling their soul.", "You may not directly and knowingly physically harm a devil, other than yourself.", GLOB.lawlorify[LAW][ban], GLOB.lawlorify[LAW][obligation], "Accomplish your objectives at all costs.")
|
||||
robot_devil.set_law_sixsixsix(laws)
|
||||
sleep(10)
|
||||
if(owner.assigned_role == "Clown" && ishuman(owner.current))
|
||||
var/mob/living/carbon/human/S = owner.current
|
||||
to_chat(S, "<span class='notice'>Your infernal nature has allowed you to overcome your clownishness.</span>")
|
||||
S.dna.remove_mutation(CLOWNMUT)
|
||||
.=..()
|
||||
|
||||
/datum/antagonist/devil/on_removal()
|
||||
to_chat(owner.current, "<span class='userdanger'>Your infernal link has been severed! You are no longer a devil!</span>")
|
||||
.=..()
|
||||
|
||||
/datum/antagonist/devil/apply_innate_effects(mob/living/mob_override)
|
||||
give_appropriate_spells()
|
||||
owner.current.grant_all_languages(TRUE)
|
||||
update_hud()
|
||||
.=..()
|
||||
|
||||
/datum/antagonist/devil/remove_innate_effects(mob/living/mob_override)
|
||||
for(var/X in owner.spell_list)
|
||||
var/obj/effect/proc_holder/spell/S = X
|
||||
if(is_type_in_typecache(S, devil_spells))
|
||||
owner.RemoveSpell(S)
|
||||
.=..()
|
||||
|
||||
//A simple super light weight datum for the codex gigas.
|
||||
/datum/fakeDevil
|
||||
var/truename
|
||||
var/bane
|
||||
var/obligation
|
||||
var/ban
|
||||
var/banish
|
||||
var/ascendable
|
||||
|
||||
/datum/fakeDevil/New(name = randomDevilName())
|
||||
truename = name
|
||||
bane = randomdevilbane()
|
||||
obligation = randomdevilobligation()
|
||||
ban = randomdevilban()
|
||||
banish = randomdevilbanish()
|
||||
ascendable = prob(25)
|
||||
+278
-278
@@ -1,286 +1,286 @@
|
||||
/datum/browser
|
||||
var/mob/user
|
||||
var/title
|
||||
var/window_id // window_id is used as the window name for browse and onclose
|
||||
var/width = 0
|
||||
var/height = 0
|
||||
var/atom/ref = null
|
||||
var/window_options = "can_close=1;can_minimize=1;can_maximize=0;can_resize=1;titlebar=1;" // window option is set using window_id
|
||||
var/stylesheets[0]
|
||||
var/scripts[0]
|
||||
var/title_image
|
||||
var/head_elements
|
||||
var/body_elements
|
||||
var/head_content = ""
|
||||
var/content = ""
|
||||
|
||||
|
||||
/datum/browser/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null)
|
||||
|
||||
user = nuser
|
||||
window_id = nwindow_id
|
||||
if (ntitle)
|
||||
title = format_text(ntitle)
|
||||
if (nwidth)
|
||||
width = nwidth
|
||||
if (nheight)
|
||||
height = nheight
|
||||
if (nref)
|
||||
ref = nref
|
||||
add_stylesheet("common", 'html/browser/common.css') // this CSS sheet is common to all UIs
|
||||
|
||||
/datum/browser/proc/add_head_content(nhead_content)
|
||||
head_content = nhead_content
|
||||
|
||||
/datum/browser/proc/set_window_options(nwindow_options)
|
||||
window_options = nwindow_options
|
||||
|
||||
/datum/browser/proc/set_title_image(ntitle_image)
|
||||
//title_image = ntitle_image
|
||||
|
||||
/datum/browser/proc/add_stylesheet(name, file)
|
||||
stylesheets["[ckey(name)].css"] = file
|
||||
register_asset("[ckey(name)].css", file)
|
||||
|
||||
/datum/browser/proc/add_script(name, file)
|
||||
scripts["[ckey(name)].js"] = file
|
||||
register_asset("[ckey(name)].js", file)
|
||||
|
||||
/datum/browser/proc/set_content(ncontent)
|
||||
content = ncontent
|
||||
|
||||
/datum/browser/proc/add_content(ncontent)
|
||||
content += ncontent
|
||||
|
||||
/datum/browser/proc/get_header()
|
||||
var/file
|
||||
for (file in stylesheets)
|
||||
head_content += "<link rel='stylesheet' type='text/css' href='[file]'>"
|
||||
|
||||
for (file in scripts)
|
||||
head_content += "<script type='text/javascript' src='[file]'></script>"
|
||||
|
||||
var/title_attributes = "class='uiTitle'"
|
||||
if (title_image)
|
||||
title_attributes = "class='uiTitle icon' style='background-image: url([title_image]);'"
|
||||
|
||||
return {"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<head>
|
||||
[head_content]
|
||||
</head>
|
||||
<body scroll=auto>
|
||||
<div class='uiWrapper'>
|
||||
[title ? "<div class='uiTitleWrapper'><div [title_attributes]><tt>[title]</tt></div></div>" : ""]
|
||||
<div class='uiContent'>
|
||||
"}
|
||||
//" This is here because else the rest of the file looks like a string in notepad++.
|
||||
/datum/browser/proc/get_footer()
|
||||
return {"
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>"}
|
||||
|
||||
/datum/browser/proc/get_content()
|
||||
return {"
|
||||
[get_header()]
|
||||
[content]
|
||||
[get_footer()]
|
||||
"}
|
||||
|
||||
/datum/browser/proc/open(use_onclose = 1)
|
||||
/datum/browser
|
||||
var/mob/user
|
||||
var/title
|
||||
var/window_id // window_id is used as the window name for browse and onclose
|
||||
var/width = 0
|
||||
var/height = 0
|
||||
var/atom/ref = null
|
||||
var/window_options = "can_close=1;can_minimize=1;can_maximize=0;can_resize=1;titlebar=1;" // window option is set using window_id
|
||||
var/stylesheets[0]
|
||||
var/scripts[0]
|
||||
var/title_image
|
||||
var/head_elements
|
||||
var/body_elements
|
||||
var/head_content = ""
|
||||
var/content = ""
|
||||
|
||||
|
||||
/datum/browser/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null)
|
||||
|
||||
user = nuser
|
||||
window_id = nwindow_id
|
||||
if (ntitle)
|
||||
title = format_text(ntitle)
|
||||
if (nwidth)
|
||||
width = nwidth
|
||||
if (nheight)
|
||||
height = nheight
|
||||
if (nref)
|
||||
ref = nref
|
||||
add_stylesheet("common", 'html/browser/common.css') // this CSS sheet is common to all UIs
|
||||
|
||||
/datum/browser/proc/add_head_content(nhead_content)
|
||||
head_content = nhead_content
|
||||
|
||||
/datum/browser/proc/set_window_options(nwindow_options)
|
||||
window_options = nwindow_options
|
||||
|
||||
/datum/browser/proc/set_title_image(ntitle_image)
|
||||
//title_image = ntitle_image
|
||||
|
||||
/datum/browser/proc/add_stylesheet(name, file)
|
||||
stylesheets["[ckey(name)].css"] = file
|
||||
register_asset("[ckey(name)].css", file)
|
||||
|
||||
/datum/browser/proc/add_script(name, file)
|
||||
scripts["[ckey(name)].js"] = file
|
||||
register_asset("[ckey(name)].js", file)
|
||||
|
||||
/datum/browser/proc/set_content(ncontent)
|
||||
content = ncontent
|
||||
|
||||
/datum/browser/proc/add_content(ncontent)
|
||||
content += ncontent
|
||||
|
||||
/datum/browser/proc/get_header()
|
||||
var/file
|
||||
for (file in stylesheets)
|
||||
head_content += "<link rel='stylesheet' type='text/css' href='[file]'>"
|
||||
|
||||
for (file in scripts)
|
||||
head_content += "<script type='text/javascript' src='[file]'></script>"
|
||||
|
||||
var/title_attributes = "class='uiTitle'"
|
||||
if (title_image)
|
||||
title_attributes = "class='uiTitle icon' style='background-image: url([title_image]);'"
|
||||
|
||||
return {"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<head>
|
||||
[head_content]
|
||||
</head>
|
||||
<body scroll=auto>
|
||||
<div class='uiWrapper'>
|
||||
[title ? "<div class='uiTitleWrapper'><div [title_attributes]><tt>[title]</tt></div></div>" : ""]
|
||||
<div class='uiContent'>
|
||||
"}
|
||||
//" This is here because else the rest of the file looks like a string in notepad++.
|
||||
/datum/browser/proc/get_footer()
|
||||
return {"
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>"}
|
||||
|
||||
/datum/browser/proc/get_content()
|
||||
return {"
|
||||
[get_header()]
|
||||
[content]
|
||||
[get_footer()]
|
||||
"}
|
||||
|
||||
/datum/browser/proc/open(use_onclose = 1)
|
||||
if(isnull(window_id)) //null check because this can potentially nuke goonchat
|
||||
WARNING("Browser [title] tried to open with a null ID")
|
||||
to_chat(user, "<span class='userdanger'>The [title] browser you tried to open failed a sanity check! Please report this on github!</span>")
|
||||
return
|
||||
var/window_size = ""
|
||||
if (width && height)
|
||||
window_size = "size=[width]x[height];"
|
||||
if (stylesheets.len)
|
||||
send_asset_list(user, stylesheets, verify=FALSE)
|
||||
if (scripts.len)
|
||||
send_asset_list(user, scripts, verify=FALSE)
|
||||
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
|
||||
if (use_onclose)
|
||||
setup_onclose()
|
||||
|
||||
/datum/browser/proc/setup_onclose()
|
||||
set waitfor = 0 //winexists sleeps, so we don't need to.
|
||||
for (var/i in 1 to 10)
|
||||
if (user && winexists(user, window_id))
|
||||
onclose(user, window_id, ref)
|
||||
break
|
||||
|
||||
/datum/browser/proc/close()
|
||||
var/window_size = ""
|
||||
if (width && height)
|
||||
window_size = "size=[width]x[height];"
|
||||
if (stylesheets.len)
|
||||
send_asset_list(user, stylesheets, verify=FALSE)
|
||||
if (scripts.len)
|
||||
send_asset_list(user, scripts, verify=FALSE)
|
||||
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
|
||||
if (use_onclose)
|
||||
setup_onclose()
|
||||
|
||||
/datum/browser/proc/setup_onclose()
|
||||
set waitfor = 0 //winexists sleeps, so we don't need to.
|
||||
for (var/i in 1 to 10)
|
||||
if (user && winexists(user, window_id))
|
||||
onclose(user, window_id, ref)
|
||||
break
|
||||
|
||||
/datum/browser/proc/close()
|
||||
if(!isnull(window_id))//null check because this can potentially nuke goonchat
|
||||
user << browse(null, "window=[window_id]")
|
||||
else
|
||||
WARNING("Browser [title] tried to close with a null ID")
|
||||
|
||||
/datum/browser/alert
|
||||
var/selectedbutton = 0
|
||||
var/opentime = 0
|
||||
var/timeout
|
||||
var/stealfocus
|
||||
|
||||
/datum/browser/alert/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1,Timeout=6000)
|
||||
if (!User)
|
||||
return
|
||||
|
||||
var/output = {"<center><b>[Message]</b></center><br />
|
||||
<div style="text-align:center">
|
||||
<a style="font-size:large;float:[( Button2 ? "left" : "right" )]" href="?src=\ref[src];button=1">[Button1]</a>"}
|
||||
|
||||
if (Button2)
|
||||
output += {"<a style="font-size:large;[( Button3 ? "" : "float:right" )]" href="?src=\ref[src];button=2">[Button2]</a>"}
|
||||
|
||||
if (Button3)
|
||||
output += {"<a style="font-size:large;float:right" href="?src=\ref[src];button=3">[Button3]</a>"}
|
||||
|
||||
output += {"</div>"}
|
||||
|
||||
..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 150, src)
|
||||
set_content(output)
|
||||
stealfocus = StealFocus
|
||||
if (!StealFocus)
|
||||
window_options += "focus=false;"
|
||||
timeout = Timeout
|
||||
|
||||
/datum/browser/alert/open()
|
||||
set waitfor = 0
|
||||
opentime = world.time
|
||||
|
||||
if (stealfocus)
|
||||
. = ..(use_onclose = 1)
|
||||
else
|
||||
var/focusedwindow = winget(user, null, "focus")
|
||||
. = ..(use_onclose = 1)
|
||||
|
||||
//waits for the window to show up client side before attempting to un-focus it
|
||||
//winexists sleeps until it gets a reply from the client, so we don't need to bother sleeping
|
||||
for (var/i in 1 to 10)
|
||||
if (user && winexists(user, window_id))
|
||||
if (focusedwindow)
|
||||
winset(user, focusedwindow, "focus=true")
|
||||
else
|
||||
winset(user, "mapwindow", "focus=true")
|
||||
break
|
||||
if (timeout)
|
||||
addtimer(CALLBACK(src, .proc/close), timeout)
|
||||
|
||||
/datum/browser/alert/close()
|
||||
.=..()
|
||||
opentime = 0
|
||||
|
||||
/datum/browser/alert/proc/wait()
|
||||
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time))
|
||||
stoplag()
|
||||
|
||||
/datum/browser/alert/Topic(href,href_list)
|
||||
if (href_list["close"] || !user || !user.client)
|
||||
opentime = 0
|
||||
return
|
||||
if (href_list["button"])
|
||||
var/button = text2num(href_list["button"])
|
||||
if (button <= 3 && button >= 1)
|
||||
selectedbutton = button
|
||||
opentime = 0
|
||||
close()
|
||||
|
||||
//designed as a drop in replacement for alert(); functions the same. (outside of needing User specified)
|
||||
/proc/tgalert(var/mob/User, Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1, Timeout = 6000)
|
||||
if (!User)
|
||||
User = usr
|
||||
switch(askuser(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout))
|
||||
if (1)
|
||||
return Button1
|
||||
if (2)
|
||||
return Button2
|
||||
if (3)
|
||||
return Button3
|
||||
|
||||
//Same shit, but it returns the button number, could at some point support unlimited button amounts.
|
||||
/proc/askuser(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1, Timeout = 6000)
|
||||
if (!istype(User))
|
||||
if (istype(User, /client/))
|
||||
var/client/C = User
|
||||
User = C.mob
|
||||
else
|
||||
return
|
||||
var/datum/browser/alert/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout)
|
||||
A.open()
|
||||
A.wait()
|
||||
if (A.selectedbutton)
|
||||
return A.selectedbutton
|
||||
|
||||
// This will allow you to show an icon in the browse window
|
||||
// This is added to mob so that it can be used without a reference to the browser object
|
||||
// There is probably a better place for this...
|
||||
/mob/proc/browse_rsc_icon(icon, icon_state, dir = -1)
|
||||
/*
|
||||
var/icon/I
|
||||
if (dir >= 0)
|
||||
I = new /icon(icon, icon_state, dir)
|
||||
else
|
||||
I = new /icon(icon, icon_state)
|
||||
setDir("default")
|
||||
|
||||
var/filename = "[ckey("[icon]_[icon_state]_[dir]")].png"
|
||||
src << browse_rsc(I, filename)
|
||||
return filename
|
||||
*/
|
||||
|
||||
|
||||
// Registers the on-close verb for a browse window (client/verb/.windowclose)
|
||||
// this will be called when the close-button of a window is pressed.
|
||||
//
|
||||
// This is usually only needed for devices that regularly update the browse window,
|
||||
// e.g. canisters, timers, etc.
|
||||
//
|
||||
// windowid should be the specified window name
|
||||
// e.g. code is : user << browse(text, "window=fred")
|
||||
// then use : onclose(user, "fred")
|
||||
//
|
||||
// Optionally, specify the "ref" parameter as the controlled atom (usually src)
|
||||
// to pass a "close=1" parameter to the atom's Topic() proc for special handling.
|
||||
// Otherwise, the user mob's machine var will be reset directly.
|
||||
//
|
||||
/proc/onclose(mob/user, windowid, atom/ref=null)
|
||||
if(!user.client) return
|
||||
var/param = "null"
|
||||
if(ref)
|
||||
param = "\ref[ref]"
|
||||
|
||||
winset(user, windowid, "on-close=\".windowclose [param]\"")
|
||||
|
||||
//to_chat(world, "OnClose [user]: [windowid] : ["on-close=\".windowclose [param]\""]")
|
||||
|
||||
|
||||
// the on-close client verb
|
||||
// called when a browser popup window is closed after registering with proc/onclose()
|
||||
// if a valid atom reference is supplied, call the atom's Topic() with "close=1"
|
||||
// otherwise, just reset the client mob's machine var.
|
||||
//
|
||||
/client/verb/windowclose(atomref as text)
|
||||
set hidden = 1 // hide this verb from the user's panel
|
||||
set name = ".windowclose" // no autocomplete on cmd line
|
||||
|
||||
//to_chat(world, "windowclose: [atomref]")
|
||||
if(atomref!="null") // if passed a real atomref
|
||||
var/hsrc = locate(atomref) // find the reffed atom
|
||||
var/href = "close=1"
|
||||
if(hsrc)
|
||||
//to_chat(world, "[src] Topic [href] [hsrc]")
|
||||
usr = src.mob
|
||||
src.Topic(href, params2list(href), hsrc) // this will direct to the atom's
|
||||
return // Topic() proc via client.Topic()
|
||||
|
||||
// no atomref specified (or not found)
|
||||
// so just reset the user mob's machine var
|
||||
if(src && src.mob)
|
||||
//to_chat(world, "[src] was [src.mob.machine], setting to null")
|
||||
src.mob.unset_machine()
|
||||
return
|
||||
|
||||
/datum/browser/alert
|
||||
var/selectedbutton = 0
|
||||
var/opentime = 0
|
||||
var/timeout
|
||||
var/stealfocus
|
||||
|
||||
/datum/browser/alert/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1,Timeout=6000)
|
||||
if (!User)
|
||||
return
|
||||
|
||||
var/output = {"<center><b>[Message]</b></center><br />
|
||||
<div style="text-align:center">
|
||||
<a style="font-size:large;float:[( Button2 ? "left" : "right" )]" href="?src=\ref[src];button=1">[Button1]</a>"}
|
||||
|
||||
if (Button2)
|
||||
output += {"<a style="font-size:large;[( Button3 ? "" : "float:right" )]" href="?src=\ref[src];button=2">[Button2]</a>"}
|
||||
|
||||
if (Button3)
|
||||
output += {"<a style="font-size:large;float:right" href="?src=\ref[src];button=3">[Button3]</a>"}
|
||||
|
||||
output += {"</div>"}
|
||||
|
||||
..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 150, src)
|
||||
set_content(output)
|
||||
stealfocus = StealFocus
|
||||
if (!StealFocus)
|
||||
window_options += "focus=false;"
|
||||
timeout = Timeout
|
||||
|
||||
/datum/browser/alert/open()
|
||||
set waitfor = 0
|
||||
opentime = world.time
|
||||
|
||||
if (stealfocus)
|
||||
. = ..(use_onclose = 1)
|
||||
else
|
||||
var/focusedwindow = winget(user, null, "focus")
|
||||
. = ..(use_onclose = 1)
|
||||
|
||||
//waits for the window to show up client side before attempting to un-focus it
|
||||
//winexists sleeps until it gets a reply from the client, so we don't need to bother sleeping
|
||||
for (var/i in 1 to 10)
|
||||
if (user && winexists(user, window_id))
|
||||
if (focusedwindow)
|
||||
winset(user, focusedwindow, "focus=true")
|
||||
else
|
||||
winset(user, "mapwindow", "focus=true")
|
||||
break
|
||||
if (timeout)
|
||||
addtimer(CALLBACK(src, .proc/close), timeout)
|
||||
|
||||
/datum/browser/alert/close()
|
||||
.=..()
|
||||
opentime = 0
|
||||
|
||||
/datum/browser/alert/proc/wait()
|
||||
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time))
|
||||
stoplag()
|
||||
|
||||
/datum/browser/alert/Topic(href,href_list)
|
||||
if (href_list["close"] || !user || !user.client)
|
||||
opentime = 0
|
||||
return
|
||||
if (href_list["button"])
|
||||
var/button = text2num(href_list["button"])
|
||||
if (button <= 3 && button >= 1)
|
||||
selectedbutton = button
|
||||
opentime = 0
|
||||
close()
|
||||
|
||||
//designed as a drop in replacement for alert(); functions the same. (outside of needing User specified)
|
||||
/proc/tgalert(var/mob/User, Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1, Timeout = 6000)
|
||||
if (!User)
|
||||
User = usr
|
||||
switch(askuser(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout))
|
||||
if (1)
|
||||
return Button1
|
||||
if (2)
|
||||
return Button2
|
||||
if (3)
|
||||
return Button3
|
||||
|
||||
//Same shit, but it returns the button number, could at some point support unlimited button amounts.
|
||||
/proc/askuser(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1, Timeout = 6000)
|
||||
if (!istype(User))
|
||||
if (istype(User, /client/))
|
||||
var/client/C = User
|
||||
User = C.mob
|
||||
else
|
||||
return
|
||||
var/datum/browser/alert/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout)
|
||||
A.open()
|
||||
A.wait()
|
||||
if (A.selectedbutton)
|
||||
return A.selectedbutton
|
||||
|
||||
// This will allow you to show an icon in the browse window
|
||||
// This is added to mob so that it can be used without a reference to the browser object
|
||||
// There is probably a better place for this...
|
||||
/mob/proc/browse_rsc_icon(icon, icon_state, dir = -1)
|
||||
/*
|
||||
var/icon/I
|
||||
if (dir >= 0)
|
||||
I = new /icon(icon, icon_state, dir)
|
||||
else
|
||||
I = new /icon(icon, icon_state)
|
||||
setDir("default")
|
||||
|
||||
var/filename = "[ckey("[icon]_[icon_state]_[dir]")].png"
|
||||
src << browse_rsc(I, filename)
|
||||
return filename
|
||||
*/
|
||||
|
||||
|
||||
// Registers the on-close verb for a browse window (client/verb/.windowclose)
|
||||
// this will be called when the close-button of a window is pressed.
|
||||
//
|
||||
// This is usually only needed for devices that regularly update the browse window,
|
||||
// e.g. canisters, timers, etc.
|
||||
//
|
||||
// windowid should be the specified window name
|
||||
// e.g. code is : user << browse(text, "window=fred")
|
||||
// then use : onclose(user, "fred")
|
||||
//
|
||||
// Optionally, specify the "ref" parameter as the controlled atom (usually src)
|
||||
// to pass a "close=1" parameter to the atom's Topic() proc for special handling.
|
||||
// Otherwise, the user mob's machine var will be reset directly.
|
||||
//
|
||||
/proc/onclose(mob/user, windowid, atom/ref=null)
|
||||
if(!user.client) return
|
||||
var/param = "null"
|
||||
if(ref)
|
||||
param = "\ref[ref]"
|
||||
|
||||
winset(user, windowid, "on-close=\".windowclose [param]\"")
|
||||
|
||||
//to_chat(world, "OnClose [user]: [windowid] : ["on-close=\".windowclose [param]\""]")
|
||||
|
||||
|
||||
// the on-close client verb
|
||||
// called when a browser popup window is closed after registering with proc/onclose()
|
||||
// if a valid atom reference is supplied, call the atom's Topic() with "close=1"
|
||||
// otherwise, just reset the client mob's machine var.
|
||||
//
|
||||
/client/verb/windowclose(atomref as text)
|
||||
set hidden = 1 // hide this verb from the user's panel
|
||||
set name = ".windowclose" // no autocomplete on cmd line
|
||||
|
||||
//to_chat(world, "windowclose: [atomref]")
|
||||
if(atomref!="null") // if passed a real atomref
|
||||
var/hsrc = locate(atomref) // find the reffed atom
|
||||
var/href = "close=1"
|
||||
if(hsrc)
|
||||
//to_chat(world, "[src] Topic [href] [hsrc]")
|
||||
usr = src.mob
|
||||
src.Topic(href, params2list(href), hsrc) // this will direct to the atom's
|
||||
return // Topic() proc via client.Topic()
|
||||
|
||||
// no atomref specified (or not found)
|
||||
// so just reset the user mob's machine var
|
||||
if(src && src.mob)
|
||||
//to_chat(world, "[src] was [src.mob.machine], setting to null")
|
||||
src.mob.unset_machine()
|
||||
return
|
||||
|
||||
@@ -387,7 +387,7 @@
|
||||
/proc/debug_variable(name, value, level, datum/DA = null, sanitize = TRUE)
|
||||
var/header
|
||||
if(DA)
|
||||
if (istype(DA, /list))
|
||||
if (islist(DA))
|
||||
var/index = name
|
||||
if (value)
|
||||
name = DA[name] //name is really the index until this line
|
||||
@@ -442,7 +442,7 @@
|
||||
else
|
||||
item = "<a href='?_src_=vars;Vars=\ref[value]'>[VV_HTML_ENCODE(name)] \ref[value]</a> = [D.type]"
|
||||
|
||||
else if (istype(value, /list))
|
||||
else if (islist(value))
|
||||
var/list/L = value
|
||||
var/list/items = list()
|
||||
|
||||
@@ -494,7 +494,7 @@
|
||||
href_list["datumrefresh"] = href_list["mob_player_panel"]
|
||||
|
||||
else if(href_list["godmode"])
|
||||
if(!check_rights(R_REJUVINATE))
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["godmode"])
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
for(var/V in DD.vars)
|
||||
if(V in skipped)
|
||||
continue
|
||||
if(istype(DD.vars[V],/list))
|
||||
if(islist(DD.vars[V]))
|
||||
var/list/L = D.vars[V]
|
||||
DD.vars[V] = L.Copy()
|
||||
else
|
||||
|
||||
@@ -1,433 +1,433 @@
|
||||
/*
|
||||
|
||||
Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties
|
||||
which add onto the overall disease.
|
||||
|
||||
If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus.
|
||||
|
||||
*/
|
||||
|
||||
#define SYMPTOM_LIMIT 8
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
PROPERTIES
|
||||
|
||||
*/
|
||||
|
||||
/datum/disease/advance
|
||||
|
||||
name = "Unknown" // We will always let our Virologist name our disease.
|
||||
desc = "An engineered disease which can contain a multitude of symptoms."
|
||||
form = "Advance Disease" // Will let med-scanners know that this disease was engineered.
|
||||
agent = "advance microbes"
|
||||
max_stages = 5
|
||||
spread_text = "Unknown"
|
||||
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
|
||||
|
||||
// NEW VARS
|
||||
var/list/properties = list()
|
||||
var/list/symptoms = list() // The symptoms of the disease.
|
||||
var/id = ""
|
||||
var/processing = 0
|
||||
/*
|
||||
|
||||
// The order goes from easy to cure to hard to cure.
|
||||
var/static/list/advance_cures = list(
|
||||
"sodiumchloride", "sugar", "orangejuice",
|
||||
"spaceacillin", "salglu_solution", "ethanol",
|
||||
"leporazine", "synaptizine", "lipolicide",
|
||||
"silver", "gold"
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
OLD PROCS
|
||||
|
||||
*/
|
||||
|
||||
/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D)
|
||||
if(!istype(D))
|
||||
D = null
|
||||
// Generate symptoms if we weren't given any.
|
||||
|
||||
if(!symptoms || !symptoms.len)
|
||||
|
||||
if(!D || !D.symptoms || !D.symptoms.len)
|
||||
symptoms = GenerateSymptoms(0, 2)
|
||||
else
|
||||
for(var/datum/symptom/S in D.symptoms)
|
||||
symptoms += new S.type
|
||||
|
||||
Refresh()
|
||||
..(process, D)
|
||||
return
|
||||
|
||||
/datum/disease/advance/Destroy()
|
||||
if(processing)
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.End(src)
|
||||
return ..()
|
||||
|
||||
// Randomly pick a symptom to activate.
|
||||
/datum/disease/advance/stage_act()
|
||||
..()
|
||||
if(symptoms && symptoms.len)
|
||||
|
||||
if(!processing)
|
||||
processing = 1
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.Start(src)
|
||||
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.Activate(src)
|
||||
else
|
||||
CRASH("We do not have any symptoms during stage_act()!")
|
||||
|
||||
// Compares type then ID.
|
||||
/datum/disease/advance/IsSame(datum/disease/advance/D)
|
||||
|
||||
if(!(istype(D, /datum/disease/advance)))
|
||||
return 0
|
||||
|
||||
if(src.GetDiseaseID() != D.GetDiseaseID())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
// To add special resistances.
|
||||
/datum/disease/advance/cure(resistance=1)
|
||||
if(affected_mob)
|
||||
var/id = "[GetDiseaseID()]"
|
||||
if(resistance && !(id in affected_mob.resistances))
|
||||
affected_mob.resistances[id] = id
|
||||
remove_virus()
|
||||
qdel(src) //delete the datum to stop it processing
|
||||
|
||||
// Returns the advance disease with a different reference memory.
|
||||
/datum/disease/advance/Copy(process = 0)
|
||||
return new /datum/disease/advance(process, src, 1)
|
||||
|
||||
/*
|
||||
|
||||
NEW PROCS
|
||||
|
||||
*/
|
||||
|
||||
// Mix the symptoms of two diseases (the src and the argument)
|
||||
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
|
||||
if(!(src.IsSame(D)))
|
||||
var/list/possible_symptoms = shuffle(D.symptoms)
|
||||
for(var/datum/symptom/S in possible_symptoms)
|
||||
AddSymptom(new S.type)
|
||||
|
||||
/datum/disease/advance/proc/HasSymptom(datum/symptom/S)
|
||||
for(var/datum/symptom/symp in symptoms)
|
||||
if(symp.id == S.id)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated.
|
||||
/datum/disease/advance/proc/GenerateSymptoms(level_min, level_max, amount_get = 0)
|
||||
|
||||
var/list/generated = list() // Symptoms we generated.
|
||||
|
||||
// Generate symptoms. By default, we only choose non-deadly symptoms.
|
||||
var/list/possible_symptoms = list()
|
||||
for(var/symp in SSdisease.list_symptoms)
|
||||
var/datum/symptom/S = new symp
|
||||
if(S.level >= level_min && S.level <= level_max)
|
||||
if(!HasSymptom(S))
|
||||
possible_symptoms += S
|
||||
|
||||
if(!possible_symptoms.len)
|
||||
return generated
|
||||
|
||||
// Random chance to get more than one symptom
|
||||
var/number_of = amount_get
|
||||
if(!amount_get)
|
||||
number_of = 1
|
||||
while(prob(20))
|
||||
number_of += 1
|
||||
|
||||
for(var/i = 1; number_of >= i && possible_symptoms.len; i++)
|
||||
generated += pick_n_take(possible_symptoms)
|
||||
|
||||
return generated
|
||||
|
||||
/datum/disease/advance/proc/Refresh(new_name = 0)
|
||||
//to_chat(world, "[src.name] \ref[src] - REFRESH!")
|
||||
GenerateProperties()
|
||||
AssignProperties()
|
||||
id = null
|
||||
|
||||
if(!SSdisease.archive_diseases[GetDiseaseID()])
|
||||
if(new_name)
|
||||
AssignName()
|
||||
SSdisease.archive_diseases[GetDiseaseID()] = src // So we don't infinite loop
|
||||
SSdisease.archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1)
|
||||
|
||||
var/datum/disease/advance/A = SSdisease.archive_diseases[GetDiseaseID()]
|
||||
AssignName(A.name)
|
||||
|
||||
//Generate disease properties based on the effects. Returns an associated list.
|
||||
/datum/disease/advance/proc/GenerateProperties()
|
||||
|
||||
if(!symptoms || !symptoms.len)
|
||||
CRASH("We did not have any symptoms before generating properties.")
|
||||
return
|
||||
|
||||
properties = list("resistance" = 0, "stealth" = 0, "stage_rate" = 0, "transmittable" = 0, "severity" = 0)
|
||||
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
properties["resistance"] += S.resistance
|
||||
properties["stealth"] += S.stealth
|
||||
properties["stage_rate"] += S.stage_speed
|
||||
properties["transmittable"] += S.transmittable
|
||||
properties["severity"] = max(properties["severity"], S.severity) // severity is based on the highest severity symptom
|
||||
return
|
||||
|
||||
// Assign the properties that are in the list.
|
||||
/datum/disease/advance/proc/AssignProperties()
|
||||
|
||||
if(properties && properties.len)
|
||||
switch(properties["stealth"])
|
||||
if(2,3)
|
||||
visibility_flags = HIDDEN_SCANNER
|
||||
if(4 to INFINITY)
|
||||
visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC
|
||||
|
||||
// The more symptoms we have, the less transmittable it is but some symptoms can make up for it.
|
||||
SetSpread(Clamp(2 ** (properties["transmittable"] - symptoms.len), BLOOD, AIRBORNE))
|
||||
permeability_mod = max(Ceiling(0.4 * properties["transmittable"]), 1)
|
||||
cure_chance = 15 - Clamp(properties["resistance"], -5, 5) // can be between 10 and 20
|
||||
stage_prob = max(properties["stage_rate"], 2)
|
||||
SetSeverity(properties["severity"])
|
||||
GenerateCure(properties)
|
||||
else
|
||||
CRASH("Our properties were empty or null!")
|
||||
|
||||
|
||||
// Assign the spread type and give it the correct description.
|
||||
/datum/disease/advance/proc/SetSpread(spread_id)
|
||||
switch(spread_id)
|
||||
if(NON_CONTAGIOUS)
|
||||
spread_text = "None"
|
||||
if(SPECIAL)
|
||||
spread_text = "None"
|
||||
if(CONTACT_GENERAL, CONTACT_HANDS, CONTACT_FEET)
|
||||
spread_text = "On contact"
|
||||
if(AIRBORNE)
|
||||
spread_text = "Airborne"
|
||||
if(BLOOD)
|
||||
spread_text = "Blood"
|
||||
|
||||
spread_flags = spread_id
|
||||
|
||||
/datum/disease/advance/proc/SetSeverity(level_sev)
|
||||
|
||||
switch(level_sev)
|
||||
|
||||
if(-INFINITY to 0)
|
||||
severity = NONTHREAT
|
||||
if(1)
|
||||
severity = MINOR
|
||||
if(2)
|
||||
severity = MEDIUM
|
||||
if(3)
|
||||
severity = HARMFUL
|
||||
if(4)
|
||||
severity = DANGEROUS
|
||||
if(5 to INFINITY)
|
||||
severity = BIOHAZARD
|
||||
else
|
||||
severity = "Unknown"
|
||||
|
||||
|
||||
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
|
||||
/datum/disease/advance/proc/GenerateCure()
|
||||
if(properties && properties.len)
|
||||
var/res = Clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
|
||||
//to_chat(world, "Res = [res]")
|
||||
cures = list(advance_cures[res])
|
||||
|
||||
// Get the cure name from the cure_id
|
||||
var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]]
|
||||
cure_text = D.name
|
||||
|
||||
|
||||
return
|
||||
|
||||
// Randomly generate a symptom, has a chance to lose or gain a symptom.
|
||||
/datum/disease/advance/proc/Evolve(min_level, max_level)
|
||||
var/s = safepick(GenerateSymptoms(min_level, max_level, 1))
|
||||
if(s)
|
||||
AddSymptom(s)
|
||||
Refresh(1)
|
||||
return
|
||||
|
||||
// Randomly remove a symptom.
|
||||
/datum/disease/advance/proc/Devolve()
|
||||
if(symptoms.len > 1)
|
||||
var/s = safepick(symptoms)
|
||||
if(s)
|
||||
RemoveSymptom(s)
|
||||
Refresh(1)
|
||||
return
|
||||
|
||||
// Name the disease.
|
||||
/datum/disease/advance/proc/AssignName(name = "Unknown")
|
||||
src.name = name
|
||||
return
|
||||
|
||||
// Return a unique ID of the disease.
|
||||
/datum/disease/advance/GetDiseaseID()
|
||||
if(!id)
|
||||
var/list/L = list()
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
L += S.id
|
||||
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||
var/result = jointext(L, ":")
|
||||
id = result
|
||||
return id
|
||||
|
||||
|
||||
// Add a symptom, if it is over the limit (with a small chance to be able to go over)
|
||||
// we take a random symptom away and add the new one.
|
||||
/datum/disease/advance/proc/AddSymptom(datum/symptom/S)
|
||||
|
||||
if(HasSymptom(S))
|
||||
return
|
||||
|
||||
if(symptoms.len < (SYMPTOM_LIMIT - 1) + rand(-1, 1))
|
||||
symptoms += S
|
||||
else
|
||||
RemoveSymptom(pick(symptoms))
|
||||
symptoms += S
|
||||
return
|
||||
|
||||
// Simply removes the symptom.
|
||||
/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S)
|
||||
symptoms -= S
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
Static Procs
|
||||
|
||||
*/
|
||||
|
||||
// Mix a list of advance diseases and return the mixed result.
|
||||
/proc/Advance_Mix(var/list/D_list)
|
||||
|
||||
//to_chat(world, "Mixing!!!!")
|
||||
|
||||
var/list/diseases = list()
|
||||
|
||||
for(var/datum/disease/advance/A in D_list)
|
||||
diseases += A.Copy()
|
||||
|
||||
if(!diseases.len)
|
||||
return null
|
||||
if(diseases.len <= 1)
|
||||
return pick(diseases) // Just return the only entry.
|
||||
|
||||
var/i = 0
|
||||
// Mix our diseases until we are left with only one result.
|
||||
while(i < 20 && diseases.len > 1)
|
||||
|
||||
i++
|
||||
|
||||
var/datum/disease/advance/D1 = pick(diseases)
|
||||
diseases -= D1
|
||||
|
||||
var/datum/disease/advance/D2 = pick(diseases)
|
||||
D2.Mix(D1)
|
||||
|
||||
// Should be only 1 entry left, but if not let's only return a single entry
|
||||
//to_chat(world, "END MIXING!!!!!")
|
||||
var/datum/disease/advance/to_return = pick(diseases)
|
||||
to_return.Refresh(1)
|
||||
return to_return
|
||||
|
||||
/proc/SetViruses(datum/reagent/R, list/data)
|
||||
if(data)
|
||||
var/list/preserve = list()
|
||||
if(istype(data) && data["viruses"])
|
||||
for(var/datum/disease/A in data["viruses"])
|
||||
preserve += A.Copy()
|
||||
R.data = data.Copy()
|
||||
if(preserve.len)
|
||||
R.data["viruses"] = preserve
|
||||
|
||||
/proc/AdminCreateVirus(client/user)
|
||||
|
||||
if(!user)
|
||||
return
|
||||
|
||||
var/i = SYMPTOM_LIMIT
|
||||
|
||||
var/datum/disease/advance/D = new(0, null)
|
||||
D.symptoms = list()
|
||||
|
||||
var/list/symptoms = list()
|
||||
symptoms += "Done"
|
||||
symptoms += SSdisease.list_symptoms.Copy()
|
||||
do
|
||||
if(user)
|
||||
var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms
|
||||
if(isnull(symptom))
|
||||
return
|
||||
else if(istext(symptom))
|
||||
i = 0
|
||||
else if(ispath(symptom))
|
||||
var/datum/symptom/S = new symptom
|
||||
if(!D.HasSymptom(S))
|
||||
D.symptoms += S
|
||||
i -= 1
|
||||
while(i > 0)
|
||||
|
||||
if(D.symptoms.len > 0)
|
||||
|
||||
var/new_name = stripped_input(user, "Name your new disease.", "New Name")
|
||||
if(!new_name)
|
||||
return
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
for(var/datum/disease/advance/AD in SSdisease.processing)
|
||||
AD.Refresh()
|
||||
|
||||
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
|
||||
Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties
|
||||
which add onto the overall disease.
|
||||
|
||||
If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus.
|
||||
|
||||
*/
|
||||
|
||||
#define SYMPTOM_LIMIT 8
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
PROPERTIES
|
||||
|
||||
*/
|
||||
|
||||
/datum/disease/advance
|
||||
|
||||
name = "Unknown" // We will always let our Virologist name our disease.
|
||||
desc = "An engineered disease which can contain a multitude of symptoms."
|
||||
form = "Advance Disease" // Will let med-scanners know that this disease was engineered.
|
||||
agent = "advance microbes"
|
||||
max_stages = 5
|
||||
spread_text = "Unknown"
|
||||
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
|
||||
|
||||
// NEW VARS
|
||||
var/list/properties = list()
|
||||
var/list/symptoms = list() // The symptoms of the disease.
|
||||
var/id = ""
|
||||
var/processing = 0
|
||||
|
||||
// The order goes from easy to cure to hard to cure.
|
||||
var/static/list/advance_cures = list(
|
||||
"sodiumchloride", "sugar", "orangejuice",
|
||||
"spaceacillin", "salglu_solution", "ethanol",
|
||||
"leporazine", "synaptizine", "lipolicide",
|
||||
"silver", "gold"
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
OLD PROCS
|
||||
|
||||
*/
|
||||
|
||||
/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D)
|
||||
if(!istype(D))
|
||||
D = null
|
||||
// Generate symptoms if we weren't given any.
|
||||
|
||||
if(!symptoms || !symptoms.len)
|
||||
|
||||
if(!D || !D.symptoms || !D.symptoms.len)
|
||||
symptoms = GenerateSymptoms(0, 2)
|
||||
else
|
||||
for(var/datum/symptom/S in D.symptoms)
|
||||
symptoms += new S.type
|
||||
|
||||
Refresh()
|
||||
..(process, D)
|
||||
return
|
||||
|
||||
/datum/disease/advance/Destroy()
|
||||
if(processing)
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.End(src)
|
||||
return ..()
|
||||
|
||||
// Randomly pick a symptom to activate.
|
||||
/datum/disease/advance/stage_act()
|
||||
..()
|
||||
if(symptoms && symptoms.len)
|
||||
|
||||
if(!processing)
|
||||
processing = 1
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.Start(src)
|
||||
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.Activate(src)
|
||||
else
|
||||
CRASH("We do not have any symptoms during stage_act()!")
|
||||
|
||||
// Compares type then ID.
|
||||
/datum/disease/advance/IsSame(datum/disease/advance/D)
|
||||
|
||||
if(!(istype(D, /datum/disease/advance)))
|
||||
return 0
|
||||
|
||||
if(src.GetDiseaseID() != D.GetDiseaseID())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
// To add special resistances.
|
||||
/datum/disease/advance/cure(resistance=1)
|
||||
if(affected_mob)
|
||||
var/id = "[GetDiseaseID()]"
|
||||
if(resistance && !(id in affected_mob.resistances))
|
||||
affected_mob.resistances[id] = id
|
||||
remove_virus()
|
||||
qdel(src) //delete the datum to stop it processing
|
||||
|
||||
// Returns the advance disease with a different reference memory.
|
||||
/datum/disease/advance/Copy(process = 0)
|
||||
return new /datum/disease/advance(process, src, 1)
|
||||
|
||||
/*
|
||||
|
||||
NEW PROCS
|
||||
|
||||
*/
|
||||
|
||||
// Mix the symptoms of two diseases (the src and the argument)
|
||||
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
|
||||
if(!(src.IsSame(D)))
|
||||
var/list/possible_symptoms = shuffle(D.symptoms)
|
||||
for(var/datum/symptom/S in possible_symptoms)
|
||||
AddSymptom(new S.type)
|
||||
|
||||
/datum/disease/advance/proc/HasSymptom(datum/symptom/S)
|
||||
for(var/datum/symptom/symp in symptoms)
|
||||
if(symp.id == S.id)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated.
|
||||
/datum/disease/advance/proc/GenerateSymptoms(level_min, level_max, amount_get = 0)
|
||||
|
||||
var/list/generated = list() // Symptoms we generated.
|
||||
|
||||
// Generate symptoms. By default, we only choose non-deadly symptoms.
|
||||
var/list/possible_symptoms = list()
|
||||
for(var/symp in SSdisease.list_symptoms)
|
||||
var/datum/symptom/S = new symp
|
||||
if(S.level >= level_min && S.level <= level_max)
|
||||
if(!HasSymptom(S))
|
||||
possible_symptoms += S
|
||||
|
||||
if(!possible_symptoms.len)
|
||||
return generated
|
||||
|
||||
// Random chance to get more than one symptom
|
||||
var/number_of = amount_get
|
||||
if(!amount_get)
|
||||
number_of = 1
|
||||
while(prob(20))
|
||||
number_of += 1
|
||||
|
||||
for(var/i = 1; number_of >= i && possible_symptoms.len; i++)
|
||||
generated += pick_n_take(possible_symptoms)
|
||||
|
||||
return generated
|
||||
|
||||
/datum/disease/advance/proc/Refresh(new_name = 0)
|
||||
//to_chat(world, "[src.name] \ref[src] - REFRESH!")
|
||||
GenerateProperties()
|
||||
AssignProperties()
|
||||
id = null
|
||||
|
||||
if(!SSdisease.archive_diseases[GetDiseaseID()])
|
||||
if(new_name)
|
||||
AssignName()
|
||||
SSdisease.archive_diseases[GetDiseaseID()] = src // So we don't infinite loop
|
||||
SSdisease.archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1)
|
||||
|
||||
var/datum/disease/advance/A = SSdisease.archive_diseases[GetDiseaseID()]
|
||||
AssignName(A.name)
|
||||
|
||||
//Generate disease properties based on the effects. Returns an associated list.
|
||||
/datum/disease/advance/proc/GenerateProperties()
|
||||
|
||||
if(!symptoms || !symptoms.len)
|
||||
CRASH("We did not have any symptoms before generating properties.")
|
||||
return
|
||||
|
||||
properties = list("resistance" = 0, "stealth" = 0, "stage_rate" = 0, "transmittable" = 0, "severity" = 0)
|
||||
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
properties["resistance"] += S.resistance
|
||||
properties["stealth"] += S.stealth
|
||||
properties["stage_rate"] += S.stage_speed
|
||||
properties["transmittable"] += S.transmittable
|
||||
properties["severity"] = max(properties["severity"], S.severity) // severity is based on the highest severity symptom
|
||||
return
|
||||
|
||||
// Assign the properties that are in the list.
|
||||
/datum/disease/advance/proc/AssignProperties()
|
||||
|
||||
if(properties && properties.len)
|
||||
switch(properties["stealth"])
|
||||
if(2,3)
|
||||
visibility_flags = HIDDEN_SCANNER
|
||||
if(4 to INFINITY)
|
||||
visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC
|
||||
|
||||
// The more symptoms we have, the less transmittable it is but some symptoms can make up for it.
|
||||
SetSpread(Clamp(2 ** (properties["transmittable"] - symptoms.len), BLOOD, AIRBORNE))
|
||||
permeability_mod = max(Ceiling(0.4 * properties["transmittable"]), 1)
|
||||
cure_chance = 15 - Clamp(properties["resistance"], -5, 5) // can be between 10 and 20
|
||||
stage_prob = max(properties["stage_rate"], 2)
|
||||
SetSeverity(properties["severity"])
|
||||
GenerateCure(properties)
|
||||
else
|
||||
CRASH("Our properties were empty or null!")
|
||||
|
||||
|
||||
// Assign the spread type and give it the correct description.
|
||||
/datum/disease/advance/proc/SetSpread(spread_id)
|
||||
switch(spread_id)
|
||||
if(NON_CONTAGIOUS)
|
||||
spread_text = "None"
|
||||
if(SPECIAL)
|
||||
spread_text = "None"
|
||||
if(CONTACT_GENERAL, CONTACT_HANDS, CONTACT_FEET)
|
||||
spread_text = "On contact"
|
||||
if(AIRBORNE)
|
||||
spread_text = "Airborne"
|
||||
if(BLOOD)
|
||||
spread_text = "Blood"
|
||||
|
||||
spread_flags = spread_id
|
||||
|
||||
/datum/disease/advance/proc/SetSeverity(level_sev)
|
||||
|
||||
switch(level_sev)
|
||||
|
||||
if(-INFINITY to 0)
|
||||
severity = NONTHREAT
|
||||
if(1)
|
||||
severity = MINOR
|
||||
if(2)
|
||||
severity = MEDIUM
|
||||
if(3)
|
||||
severity = HARMFUL
|
||||
if(4)
|
||||
severity = DANGEROUS
|
||||
if(5 to INFINITY)
|
||||
severity = BIOHAZARD
|
||||
else
|
||||
severity = "Unknown"
|
||||
|
||||
|
||||
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
|
||||
/datum/disease/advance/proc/GenerateCure()
|
||||
if(properties && properties.len)
|
||||
var/res = Clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
|
||||
//to_chat(world, "Res = [res]")
|
||||
cures = list(advance_cures[res])
|
||||
|
||||
// Get the cure name from the cure_id
|
||||
var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]]
|
||||
cure_text = D.name
|
||||
|
||||
|
||||
return
|
||||
|
||||
// Randomly generate a symptom, has a chance to lose or gain a symptom.
|
||||
/datum/disease/advance/proc/Evolve(min_level, max_level)
|
||||
var/s = safepick(GenerateSymptoms(min_level, max_level, 1))
|
||||
if(s)
|
||||
AddSymptom(s)
|
||||
Refresh(1)
|
||||
return
|
||||
|
||||
// Randomly remove a symptom.
|
||||
/datum/disease/advance/proc/Devolve()
|
||||
if(symptoms.len > 1)
|
||||
var/s = safepick(symptoms)
|
||||
if(s)
|
||||
RemoveSymptom(s)
|
||||
Refresh(1)
|
||||
return
|
||||
|
||||
// Name the disease.
|
||||
/datum/disease/advance/proc/AssignName(name = "Unknown")
|
||||
src.name = name
|
||||
return
|
||||
|
||||
// Return a unique ID of the disease.
|
||||
/datum/disease/advance/GetDiseaseID()
|
||||
if(!id)
|
||||
var/list/L = list()
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
L += S.id
|
||||
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||
var/result = jointext(L, ":")
|
||||
id = result
|
||||
return id
|
||||
|
||||
|
||||
// Add a symptom, if it is over the limit (with a small chance to be able to go over)
|
||||
// we take a random symptom away and add the new one.
|
||||
/datum/disease/advance/proc/AddSymptom(datum/symptom/S)
|
||||
|
||||
if(HasSymptom(S))
|
||||
return
|
||||
|
||||
if(symptoms.len < (SYMPTOM_LIMIT - 1) + rand(-1, 1))
|
||||
symptoms += S
|
||||
else
|
||||
RemoveSymptom(pick(symptoms))
|
||||
symptoms += S
|
||||
return
|
||||
|
||||
// Simply removes the symptom.
|
||||
/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S)
|
||||
symptoms -= S
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
Static Procs
|
||||
|
||||
*/
|
||||
|
||||
// Mix a list of advance diseases and return the mixed result.
|
||||
/proc/Advance_Mix(var/list/D_list)
|
||||
|
||||
//to_chat(world, "Mixing!!!!")
|
||||
|
||||
var/list/diseases = list()
|
||||
|
||||
for(var/datum/disease/advance/A in D_list)
|
||||
diseases += A.Copy()
|
||||
|
||||
if(!diseases.len)
|
||||
return null
|
||||
if(diseases.len <= 1)
|
||||
return pick(diseases) // Just return the only entry.
|
||||
|
||||
var/i = 0
|
||||
// Mix our diseases until we are left with only one result.
|
||||
while(i < 20 && diseases.len > 1)
|
||||
|
||||
i++
|
||||
|
||||
var/datum/disease/advance/D1 = pick(diseases)
|
||||
diseases -= D1
|
||||
|
||||
var/datum/disease/advance/D2 = pick(diseases)
|
||||
D2.Mix(D1)
|
||||
|
||||
// Should be only 1 entry left, but if not let's only return a single entry
|
||||
//to_chat(world, "END MIXING!!!!!")
|
||||
var/datum/disease/advance/to_return = pick(diseases)
|
||||
to_return.Refresh(1)
|
||||
return to_return
|
||||
|
||||
/proc/SetViruses(datum/reagent/R, list/data)
|
||||
if(data)
|
||||
var/list/preserve = list()
|
||||
if(istype(data) && data["viruses"])
|
||||
for(var/datum/disease/A in data["viruses"])
|
||||
preserve += A.Copy()
|
||||
R.data = data.Copy()
|
||||
if(preserve.len)
|
||||
R.data["viruses"] = preserve
|
||||
|
||||
/proc/AdminCreateVirus(client/user)
|
||||
|
||||
if(!user)
|
||||
return
|
||||
|
||||
var/i = SYMPTOM_LIMIT
|
||||
|
||||
var/datum/disease/advance/D = new(0, null)
|
||||
D.symptoms = list()
|
||||
|
||||
var/list/symptoms = list()
|
||||
symptoms += "Done"
|
||||
symptoms += SSdisease.list_symptoms.Copy()
|
||||
do
|
||||
if(user)
|
||||
var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms
|
||||
if(isnull(symptom))
|
||||
return
|
||||
else if(istext(symptom))
|
||||
i = 0
|
||||
else if(ispath(symptom))
|
||||
var/datum/symptom/S = new symptom
|
||||
if(!D.HasSymptom(S))
|
||||
D.symptoms += S
|
||||
i -= 1
|
||||
while(i > 0)
|
||||
|
||||
if(D.symptoms.len > 0)
|
||||
|
||||
var/new_name = stripped_input(user, "Name your new disease.", "New Name")
|
||||
if(!new_name)
|
||||
return
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
for(var/datum/disease/advance/AD in SSdisease.processing)
|
||||
AD.Refresh()
|
||||
|
||||
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
|
||||
if(H.z != ZLEVEL_STATION)
|
||||
continue
|
||||
if(!H.HasDisease(D))
|
||||
H.ForceContractDisease(D)
|
||||
break
|
||||
|
||||
var/list/name_symptoms = list()
|
||||
for(var/datum/symptom/S in D.symptoms)
|
||||
name_symptoms += S.name
|
||||
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]")
|
||||
|
||||
/*
|
||||
/mob/verb/test()
|
||||
|
||||
for(var/datum/disease/D in SSdisease.processing)
|
||||
to_chat(src, "<a href='?_src_=vars;Vars=\ref[D]'>[D.name] - [D.holder]</a>")
|
||||
*/
|
||||
|
||||
|
||||
/datum/disease/advance/proc/totalStageSpeed()
|
||||
return properties["stage_rate"]
|
||||
|
||||
/datum/disease/advance/proc/totalStealth()
|
||||
return properties["stealth"]
|
||||
|
||||
/datum/disease/advance/proc/totalResistance()
|
||||
return properties["resistance"]
|
||||
|
||||
/datum/disease/advance/proc/totalTransmittable()
|
||||
return properties["transmittable"]
|
||||
|
||||
#undef RANDOM_STARTING_LEVEL
|
||||
continue
|
||||
if(!H.HasDisease(D))
|
||||
H.ForceContractDisease(D)
|
||||
break
|
||||
|
||||
var/list/name_symptoms = list()
|
||||
for(var/datum/symptom/S in D.symptoms)
|
||||
name_symptoms += S.name
|
||||
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]")
|
||||
|
||||
/*
|
||||
/mob/verb/test()
|
||||
|
||||
for(var/datum/disease/D in SSdisease.processing)
|
||||
to_chat(src, "<a href='?_src_=vars;Vars=\ref[D]'>[D.name] - [D.holder]</a>")
|
||||
*/
|
||||
|
||||
|
||||
/datum/disease/advance/proc/totalStageSpeed()
|
||||
return properties["stage_rate"]
|
||||
|
||||
/datum/disease/advance/proc/totalStealth()
|
||||
return properties["stealth"]
|
||||
|
||||
/datum/disease/advance/proc/totalResistance()
|
||||
return properties["resistance"]
|
||||
|
||||
/datum/disease/advance/proc/totalTransmittable()
|
||||
return properties["transmittable"]
|
||||
|
||||
#undef RANDOM_STARTING_LEVEL
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Deafness
|
||||
|
||||
Slightly noticable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed slightly.
|
||||
Decreases transmittablity.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Causes intermittent loss of hearing.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/deafness
|
||||
|
||||
name = "Deafness"
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = -1
|
||||
transmittable = -3
|
||||
level = 4
|
||||
severity = 3
|
||||
|
||||
/datum/symptom/deafness/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You hear a ringing in your ear.", "Your ears pop.")]</span>")
|
||||
if(5)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Deafness
|
||||
|
||||
Slightly noticable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed slightly.
|
||||
Decreases transmittablity.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Causes intermittent loss of hearing.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/deafness
|
||||
|
||||
name = "Deafness"
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = -1
|
||||
transmittable = -3
|
||||
level = 4
|
||||
severity = 3
|
||||
|
||||
/datum/symptom/deafness/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You hear a ringing in your ear.", "Your ears pop.")]</span>")
|
||||
if(5)
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop and begin ringing loudly!</span>")
|
||||
M.minimumDeafTicks(20)
|
||||
|
||||
@@ -1,288 +1,288 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Healing
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals toxins in the affected mob's blood stream.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal
|
||||
|
||||
name = "Toxic Filter"
|
||||
stealth = 1
|
||||
resistance = -4
|
||||
stage_speed = -4
|
||||
transmittable = -4
|
||||
level = 6
|
||||
|
||||
/datum/symptom/heal/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
//100% chance to activate for slow but consistent healing
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
Heal(M, A)
|
||||
return
|
||||
|
||||
/datum/symptom/heal/proc/Heal(mob/living/M, datum/disease/advance/A)
|
||||
var/heal_amt = 0.5
|
||||
if(M.toxloss > 0 && prob(20))
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Healing
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals toxins in the affected mob's blood stream.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal
|
||||
|
||||
name = "Toxic Filter"
|
||||
stealth = 1
|
||||
resistance = -4
|
||||
stage_speed = -4
|
||||
transmittable = -4
|
||||
level = 6
|
||||
|
||||
/datum/symptom/heal/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
//100% chance to activate for slow but consistent healing
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
Heal(M, A)
|
||||
return
|
||||
|
||||
/datum/symptom/heal/proc/Heal(mob/living/M, datum/disease/advance/A)
|
||||
var/heal_amt = 0.5
|
||||
if(M.toxloss > 0 && prob(20))
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#66FF99")
|
||||
M.adjustToxLoss(-heal_amt)
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Apoptosis
|
||||
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
|
||||
Bonus
|
||||
Heals toxins in the affected mob's blood stream faster.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/plus
|
||||
|
||||
name = "Apoptoxin filter"
|
||||
stealth = 0
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
|
||||
/datum/symptom/heal/plus/Heal(mob/living/M, datum/disease/advance/A)
|
||||
var/heal_amt = 1
|
||||
if(M.toxloss > 0 && prob(20))
|
||||
M.adjustToxLoss(-heal_amt)
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Apoptosis
|
||||
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
|
||||
Bonus
|
||||
Heals toxins in the affected mob's blood stream faster.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/plus
|
||||
|
||||
name = "Apoptoxin filter"
|
||||
stealth = 0
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
|
||||
/datum/symptom/heal/plus/Heal(mob/living/M, datum/disease/advance/A)
|
||||
var/heal_amt = 1
|
||||
if(M.toxloss > 0 && prob(20))
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#00FF00")
|
||||
M.adjustToxLoss(-heal_amt)
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Regeneration
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals brute damage slowly over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/brute
|
||||
|
||||
name = "Regeneration"
|
||||
stealth = 1
|
||||
resistance = -4
|
||||
stage_speed = -4
|
||||
transmittable = -4
|
||||
level = 6
|
||||
|
||||
/datum/symptom/heal/brute/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 1
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, 0))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
M.adjustToxLoss(-heal_amt)
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Regeneration
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals brute damage slowly over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/brute
|
||||
|
||||
name = "Regeneration"
|
||||
stealth = 1
|
||||
resistance = -4
|
||||
stage_speed = -4
|
||||
transmittable = -4
|
||||
level = 6
|
||||
|
||||
/datum/symptom/heal/brute/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 1
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, 0))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#FF3333")
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Flesh Mending
|
||||
|
||||
No resistance change.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals brute damage over time. Turns cloneloss into burn damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/brute/plus
|
||||
|
||||
name = "Flesh Mending"
|
||||
stealth = 0
|
||||
resistance = 0
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
|
||||
/datum/symptom/heal/brute/plus/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 2
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(M.getCloneLoss() > 0)
|
||||
M.adjustCloneLoss(-1)
|
||||
M.take_bodypart_damage(0, 1) //Deals BURN damage, which is not cured by this symptom
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Flesh Mending
|
||||
|
||||
No resistance change.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals brute damage over time. Turns cloneloss into burn damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/brute/plus
|
||||
|
||||
name = "Flesh Mending"
|
||||
stealth = 0
|
||||
resistance = 0
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
|
||||
/datum/symptom/heal/brute/plus/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 2
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(M.getCloneLoss() > 0)
|
||||
M.adjustCloneLoss(-1)
|
||||
M.take_bodypart_damage(0, 1) //Deals BURN damage, which is not cured by this symptom
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#33FFCC")
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, 0))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, 0))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#CC1100")
|
||||
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Tissue Regrowth
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals burn damage slowly over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/burn
|
||||
|
||||
name = "Tissue Regrowth"
|
||||
stealth = 1
|
||||
resistance = -4
|
||||
stage_speed = -4
|
||||
transmittable = -4
|
||||
level = 6
|
||||
|
||||
/datum/symptom/heal/burn/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 1
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(0, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Tissue Regrowth
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals burn damage slowly over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/burn
|
||||
|
||||
name = "Tissue Regrowth"
|
||||
stealth = 1
|
||||
resistance = -4
|
||||
stage_speed = -4
|
||||
transmittable = -4
|
||||
level = 6
|
||||
|
||||
/datum/symptom/heal/burn/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 1
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(0, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#FF9933")
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Heat Resistance //Needs a better name
|
||||
|
||||
No resistance change.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals burn damage over time, and helps stabilize body temperature.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/burn/plus
|
||||
|
||||
name = "Heat Resistance"
|
||||
stealth = 0
|
||||
resistance = 0
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
|
||||
/datum/symptom/heal/burn/plus/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 2
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(M.bodytemperature > 310)
|
||||
M.bodytemperature = max(310, M.bodytemperature - (10 * heal_amt * TEMPERATURE_DAMAGE_COEFFICIENT))
|
||||
else if(M.bodytemperature < 311)
|
||||
M.bodytemperature = min(310, M.bodytemperature + (10 * heal_amt * TEMPERATURE_DAMAGE_COEFFICIENT))
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(0, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Heat Resistance //Needs a better name
|
||||
|
||||
No resistance change.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Heals burn damage over time, and helps stabilize body temperature.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/burn/plus
|
||||
|
||||
name = "Heat Resistance"
|
||||
stealth = 0
|
||||
resistance = 0
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
|
||||
/datum/symptom/heal/burn/plus/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/heal_amt = 2
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
|
||||
|
||||
if(M.bodytemperature > 310)
|
||||
M.bodytemperature = max(310, M.bodytemperature - (10 * heal_amt * TEMPERATURE_DAMAGE_COEFFICIENT))
|
||||
else if(M.bodytemperature < 311)
|
||||
M.bodytemperature = min(310, M.bodytemperature + (10 * heal_amt * TEMPERATURE_DAMAGE_COEFFICIENT))
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(0, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(prob(20))
|
||||
new /obj/effect/temp_visual/heal(get_turf(M), "#CC6600")
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
DNA Restoration
|
||||
|
||||
Not well hidden.
|
||||
Lowers resistance minorly.
|
||||
Does not affect stage speed.
|
||||
Decreases transmittablity greatly.
|
||||
Very high level.
|
||||
|
||||
Bonus
|
||||
Heals brain damage, treats radiation, cleans SE of non-power mutations.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/dna
|
||||
|
||||
name = "Deoxyribonucleic Acid Restoration"
|
||||
stealth = -1
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = -3
|
||||
level = 5
|
||||
|
||||
/datum/symptom/heal/dna/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/amt_healed = 1
|
||||
M.adjustBrainLoss(-amt_healed)
|
||||
//Non-power mutations, excluding race, so the virus does not force monkey -> human transformations.
|
||||
var/list/unclean_mutations = (GLOB.not_good_mutations|GLOB.bad_mutations) - GLOB.mutations_list[RACEMUT]
|
||||
M.dna.remove_mutation_group(unclean_mutations)
|
||||
M.radiation = max(M.radiation - (2 * amt_healed), 0)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
DNA Restoration
|
||||
|
||||
Not well hidden.
|
||||
Lowers resistance minorly.
|
||||
Does not affect stage speed.
|
||||
Decreases transmittablity greatly.
|
||||
Very high level.
|
||||
|
||||
Bonus
|
||||
Heals brain damage, treats radiation, cleans SE of non-power mutations.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/heal/dna
|
||||
|
||||
name = "Deoxyribonucleic Acid Restoration"
|
||||
stealth = -1
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = -3
|
||||
level = 5
|
||||
|
||||
/datum/symptom/heal/dna/Heal(mob/living/carbon/M, datum/disease/advance/A)
|
||||
var/amt_healed = 1
|
||||
M.adjustBrainLoss(-amt_healed)
|
||||
//Non-power mutations, excluding race, so the virus does not force monkey -> human transformations.
|
||||
var/list/unclean_mutations = (GLOB.not_good_mutations|GLOB.bad_mutations) - GLOB.mutations_list[RACEMUT]
|
||||
M.dna.remove_mutation_group(unclean_mutations)
|
||||
M.radiation = max(M.radiation - (2 * amt_healed), 0)
|
||||
return 1
|
||||
|
||||
@@ -125,4 +125,4 @@ Bonus
|
||||
if(12 to 24)
|
||||
M.drowsyness += 1
|
||||
if(24 to INFINITY)
|
||||
M.Sleeping(2, 0)
|
||||
M.Sleeping(40)
|
||||
|
||||
@@ -29,6 +29,9 @@ Bonus
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/obj/item/organ/eyes/eyes = M.getorganslot("eyes_sight")
|
||||
if (!eyes)
|
||||
return
|
||||
switch(A.stage)
|
||||
if(1, 2)
|
||||
to_chat(M, "<span class='warning'>Your eyes itch.</span>")
|
||||
@@ -40,9 +43,9 @@ Bonus
|
||||
to_chat(M, "<span class='userdanger'>Your eyes burn horrificly!</span>")
|
||||
M.blur_eyes(20)
|
||||
M.adjust_eye_damage(5)
|
||||
if(M.eye_damage >= 10)
|
||||
if(eyes.eye_damage >= 10)
|
||||
M.become_nearsighted()
|
||||
if(prob(M.eye_damage - 10 + 1))
|
||||
if(prob(eyes.eye_damage - 10 + 1))
|
||||
if(M.become_blind())
|
||||
to_chat(M, "<span class='userdanger'>You go blind!</span>")
|
||||
|
||||
@@ -76,6 +79,9 @@ Bonus
|
||||
/datum/symptom/visionaid/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/obj/item/organ/eyes/eyes = M.getorganslot("eyes_sight")
|
||||
if (!eyes)
|
||||
return
|
||||
switch(A.stage)
|
||||
if(4, 5) //basically oculine
|
||||
if(M.disabilities & BLIND)
|
||||
@@ -93,7 +99,7 @@ Bonus
|
||||
else if(M.eye_blind || M.eye_blurry)
|
||||
M.set_blindness(0)
|
||||
M.set_blurriness(0)
|
||||
else if(M.eye_damage > 0)
|
||||
else if(eyes.eye_damage > 0)
|
||||
M.adjust_eye_damage(-1)
|
||||
else
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB * 3))
|
||||
|
||||
@@ -1,106 +1,106 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Little transmittable.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit!
|
||||
Meaning your disease can spread via
|
||||
people walking on vomit.
|
||||
Makes the affected mob lose nutrition and
|
||||
heal toxin damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit
|
||||
|
||||
name = "Vomiting"
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 3
|
||||
severity = 4
|
||||
|
||||
/datum/symptom/vomit/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB / 2))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel nauseous.", "You feel like you're going to throw up!")]</span>")
|
||||
else
|
||||
Vomit(M)
|
||||
|
||||
return
|
||||
|
||||
/datum/symptom/vomit/proc/Vomit(mob/living/carbon/M)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Little transmittable.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit!
|
||||
Meaning your disease can spread via
|
||||
people walking on vomit.
|
||||
Makes the affected mob lose nutrition and
|
||||
heal toxin damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit
|
||||
|
||||
name = "Vomiting"
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 3
|
||||
severity = 4
|
||||
|
||||
/datum/symptom/vomit/Activate(datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB / 2))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel nauseous.", "You feel like you're going to throw up!")]</span>")
|
||||
else
|
||||
Vomit(M)
|
||||
|
||||
return
|
||||
|
||||
/datum/symptom/vomit/proc/Vomit(mob/living/carbon/M)
|
||||
M.vomit(20)
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting Blood
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Decreases stage speed.
|
||||
Little transmittable.
|
||||
Intense level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit blood!
|
||||
Meaning your disease can spread via
|
||||
people walking on the blood.
|
||||
Makes the affected mob lose health.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit/blood
|
||||
|
||||
name = "Blood Vomiting"
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = -1
|
||||
transmittable = 1
|
||||
level = 4
|
||||
severity = 5
|
||||
|
||||
/datum/symptom/vomit/blood/Vomit(mob/living/carbon/M)
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting Blood
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Decreases stage speed.
|
||||
Little transmittable.
|
||||
Intense level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit blood!
|
||||
Meaning your disease can spread via
|
||||
people walking on the blood.
|
||||
Makes the affected mob lose health.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit/blood
|
||||
|
||||
name = "Blood Vomiting"
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = -1
|
||||
transmittable = 1
|
||||
level = 4
|
||||
severity = 5
|
||||
|
||||
/datum/symptom/vomit/blood/Vomit(mob/living/carbon/M)
|
||||
M.vomit(0,TRUE)
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Projectile Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Little transmittable.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
As normal vomiting, except it will spread further,
|
||||
likely causing more to walk across the vomit.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit/projectile
|
||||
|
||||
name = "Projectile Vomiting"
|
||||
stealth = -2
|
||||
level = 4
|
||||
|
||||
/datum/symptom/vomit/projectile/Vomit(mob/living/carbon/M)
|
||||
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Projectile Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Little transmittable.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
As normal vomiting, except it will spread further,
|
||||
likely causing more to walk across the vomit.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit/projectile
|
||||
|
||||
name = "Projectile Vomiting"
|
||||
stealth = -2
|
||||
level = 4
|
||||
|
||||
/datum/symptom/vomit/projectile/Vomit(mob/living/carbon/M)
|
||||
M.vomit(6, distance = 5)
|
||||
|
||||
@@ -40,5 +40,5 @@ Bonus
|
||||
M.adjustStaminaLoss(30)
|
||||
if(M.getStaminaLoss() > 60 && !M.stat)
|
||||
M.visible_message("<span class='warning'>[M] faints!</span>", "<span class='userdanger'>You swoon and faint...</span>")
|
||||
M.AdjustSleeping(5)
|
||||
M.AdjustSleeping(100)
|
||||
return
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
/datum/disease/appendicitis
|
||||
form = "Condition"
|
||||
name = "Appendicitis"
|
||||
max_stages = 3
|
||||
cure_text = "Surgery"
|
||||
agent = "Shitty Appendix"
|
||||
viable_mobtypes = list(/mob/living/carbon/human)
|
||||
permeability_mod = 1
|
||||
desc = "If left untreated the subject will become very weak, and may vomit often."
|
||||
severity = "Dangerous!"
|
||||
longevity = 1000
|
||||
disease_flags = CAN_CARRY|CAN_RESIST
|
||||
spread_flags = NON_CONTAGIOUS
|
||||
visibility_flags = HIDDEN_PANDEMIC
|
||||
required_organs = list(/obj/item/organ/appendix)
|
||||
|
||||
/datum/disease/appendicitis/stage_act()
|
||||
..()
|
||||
switch(stage)
|
||||
if(1)
|
||||
if(prob(5))
|
||||
affected_mob.emote("cough")
|
||||
if(2)
|
||||
var/obj/item/organ/appendix/A = affected_mob.getorgan(/obj/item/organ/appendix)
|
||||
if(A)
|
||||
A.inflamed = 1
|
||||
A.update_icon()
|
||||
if(prob(3))
|
||||
to_chat(affected_mob, "<span class='warning'>You feel a stabbing pain in your abdomen!</span>")
|
||||
affected_mob.Stun(rand(2,3))
|
||||
affected_mob.adjustToxLoss(1)
|
||||
if(3)
|
||||
if(prob(1))
|
||||
/datum/disease/appendicitis
|
||||
form = "Condition"
|
||||
name = "Appendicitis"
|
||||
max_stages = 3
|
||||
cure_text = "Surgery"
|
||||
agent = "Shitty Appendix"
|
||||
viable_mobtypes = list(/mob/living/carbon/human)
|
||||
permeability_mod = 1
|
||||
desc = "If left untreated the subject will become very weak, and may vomit often."
|
||||
severity = "Dangerous!"
|
||||
longevity = 1000
|
||||
disease_flags = CAN_CARRY|CAN_RESIST
|
||||
spread_flags = NON_CONTAGIOUS
|
||||
visibility_flags = HIDDEN_PANDEMIC
|
||||
required_organs = list(/obj/item/organ/appendix)
|
||||
|
||||
/datum/disease/appendicitis/stage_act()
|
||||
..()
|
||||
switch(stage)
|
||||
if(1)
|
||||
if(prob(5))
|
||||
affected_mob.emote("cough")
|
||||
if(2)
|
||||
var/obj/item/organ/appendix/A = affected_mob.getorgan(/obj/item/organ/appendix)
|
||||
if(A)
|
||||
A.inflamed = 1
|
||||
A.update_icon()
|
||||
if(prob(3))
|
||||
to_chat(affected_mob, "<span class='warning'>You feel a stabbing pain in your abdomen!</span>")
|
||||
affected_mob.Stun(rand(40,60))
|
||||
affected_mob.adjustToxLoss(1)
|
||||
if(3)
|
||||
if(prob(1))
|
||||
affected_mob.vomit(95)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
if(prob(3))
|
||||
to_chat(affected_mob, "<span class='danger'>You lose consciousness...</span>")
|
||||
affected_mob.visible_message("<span class='warning'>[affected_mob] suddenly collapses</span>")
|
||||
affected_mob.Paralyse(rand(5,10))
|
||||
affected_mob.Unconscious(rand(100,200))
|
||||
if(prob(1))
|
||||
affected_mob.emote("snore")
|
||||
if(prob(15))
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
to_chat(affected_mob, "You feel very strange.")
|
||||
if (prob(4))
|
||||
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head!</span>")
|
||||
affected_mob.Paralyse(2)
|
||||
affected_mob.Unconscious(40)
|
||||
if (prob(4))
|
||||
to_chat(affected_mob, "<span class='danger'>Your stomach churns.</span>")
|
||||
if(3)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"))
|
||||
if (prob(4))
|
||||
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
|
||||
affected_mob.Paralyse(2)
|
||||
affected_mob.Unconscious(40)
|
||||
if(4)
|
||||
if (prob(20))
|
||||
affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."))
|
||||
@@ -167,7 +167,7 @@
|
||||
if(3)
|
||||
if (prob(4))
|
||||
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
|
||||
affected_mob.Paralyse(2)
|
||||
affected_mob.Unconscious(40)
|
||||
if(4)
|
||||
if (prob(20))
|
||||
affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(prob(10))
|
||||
affected_mob.adjustStaminaLoss(100)
|
||||
affected_mob.visible_message("<span class='warning'>[affected_mob] faints!</span>", "<span class='userdanger'>You surrender yourself and feel at peace...</span>")
|
||||
affected_mob.AdjustSleeping(5)
|
||||
affected_mob.AdjustSleeping(100)
|
||||
if(prob(2))
|
||||
to_chat(affected_mob, "<span class='userdanger'>You feel your mind relax and your thoughts drift!</span>")
|
||||
affected_mob.confused = min(100, affected_mob.confused + 8)
|
||||
|
||||
@@ -16,27 +16,24 @@
|
||||
var/emote_type = EMOTE_VISIBLE //Whether the emote is visible or audible
|
||||
var/restraint_check = FALSE //Checks if the mob is restrained before performing the emote
|
||||
var/muzzle_ignore = FALSE //Will only work if the emote is EMOTE_AUDIBLE
|
||||
var/list/mob_type_allowed_typecache = list() //Types that are allowed to use that emote
|
||||
var/list/mob_type_blacklist_typecache = list() //Types that are NOT allowed to use that emote
|
||||
var/list/mob_type_allowed_typecache //Types that are allowed to use that emote
|
||||
var/list/mob_type_blacklist_typecache //Types that are NOT allowed to use that emote
|
||||
var/stat_allowed = CONSCIOUS
|
||||
var/static/list/emote_list = list()
|
||||
|
||||
/datum/emote/New()
|
||||
..()
|
||||
if(key_third_person)
|
||||
emote_list[key_third_person] = src
|
||||
mob_type_allowed_typecache = typecacheof(mob_type_allowed_typecache)
|
||||
mob_type_blacklist_typecache = typecacheof(mob_type_blacklist_typecache)
|
||||
|
||||
/datum/emote/proc/run_emote(mob/user, params = null, type_override = null)
|
||||
/datum/emote/proc/run_emote(mob/user, params, type_override)
|
||||
. = TRUE
|
||||
if(!can_run_emote(user))
|
||||
return FALSE
|
||||
var/msg = select_message_type(user)
|
||||
if(params && message_param)
|
||||
msg = select_param(user, params)
|
||||
if(findtext(msg, "%s"))
|
||||
msg = replacetext(msg, "%s", user.p_s())
|
||||
|
||||
msg = replace_pronoun(user, msg)
|
||||
|
||||
@@ -88,7 +85,7 @@
|
||||
. = message_AI
|
||||
else if(ismonkey(user) && message_monkey)
|
||||
. = message_monkey
|
||||
else if(istype(user, /mob/living/simple_animal) && message_simple)
|
||||
else if(isanimal(user) && message_simple)
|
||||
. = message_simple
|
||||
|
||||
/datum/emote/proc/select_param(mob/user, params)
|
||||
|
||||
@@ -125,7 +125,7 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
E = new
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
|
||||
|
||||
EX_PREPROCESS_CHECK_TICK
|
||||
|
||||
//flash mobs
|
||||
@@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
var/throw_range = rand(throw_dist, max_range)
|
||||
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
|
||||
I.throw_speed = EXPLOSION_THROW_SPEED //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything)
|
||||
I.throw_at(throw_at, throw_range, EXPLOSION_THROW_SPEED)
|
||||
I.throw_at(throw_at, throw_range, EXPLOSION_THROW_SPEED)
|
||||
|
||||
//wait for the lists to repop
|
||||
var/break_condition
|
||||
@@ -208,7 +208,7 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
|
||||
if(!running)
|
||||
break
|
||||
|
||||
|
||||
//update the trackers
|
||||
affTurfLen = affected_turfs.len
|
||||
expBlockLen = cached_exp_block.len
|
||||
@@ -274,7 +274,7 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
. = list()
|
||||
var/processed = 0
|
||||
while(!stopped && running)
|
||||
var/I
|
||||
var/I
|
||||
for(I in (processed + 1) to affected_turfs.len) // we cache the explosion block rating of every turf in the explosion area
|
||||
var/turf/T = affected_turfs[I]
|
||||
var/current_exp_block = T.density ? T.explosion_block : 0
|
||||
@@ -282,12 +282,12 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
for(var/obj/O in T)
|
||||
var/the_block = O.explosion_block
|
||||
current_exp_block += the_block == EXPLOSION_BLOCK_PROC ? O.GetExplosionBlock() : the_block
|
||||
|
||||
|
||||
.[T] = current_exp_block
|
||||
|
||||
if(TICK_CHECK)
|
||||
break
|
||||
|
||||
|
||||
processed = I
|
||||
stoplag()
|
||||
|
||||
@@ -346,10 +346,11 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
TT = get_step_towards(TT,epicenter)
|
||||
if(TT.density)
|
||||
dist += TT.explosion_block
|
||||
|
||||
|
||||
for(var/obj/O in T)
|
||||
var/the_block = O.explosion_block
|
||||
dist += the_block == EXPLOSION_BLOCK_PROC ? O.GetExplosionBlock() : the_block
|
||||
|
||||
if(dist < dev)
|
||||
T.color = "red"
|
||||
T.maptext = "Dev"
|
||||
|
||||
+134
-134
@@ -1,136 +1,136 @@
|
||||
/datum/getrev
|
||||
var/originmastercommit
|
||||
var/commit
|
||||
var/list/testmerge = list()
|
||||
var/has_pr_details = FALSE //tgs2 support
|
||||
var/date
|
||||
|
||||
/datum/getrev/New()
|
||||
if(fexists(SERVICE_PR_TEST_JSON))
|
||||
testmerge = json_decode(file2text(SERVICE_PR_TEST_JSON))
|
||||
else if(!world.RunningService() && fexists("../prtestjob.lk")) //tgs2 support
|
||||
var/list/tmp = world.file2list("..\\prtestjob.lk")
|
||||
for(var/I in tmp)
|
||||
if(I)
|
||||
testmerge |= I
|
||||
|
||||
log_world("Running /tg/ revision:")
|
||||
var/list/logs = world.file2list(".git/logs/HEAD")
|
||||
if(logs)
|
||||
logs = splittext(logs[logs.len - 1], " ")
|
||||
date = unix2date(text2num(logs[5]))
|
||||
commit = logs[2]
|
||||
log_world("[date]")
|
||||
logs = world.file2list(".git/logs/refs/remotes/origin/master")
|
||||
if(logs)
|
||||
originmastercommit = splittext(logs[logs.len - 1], " ")[2]
|
||||
|
||||
if(testmerge.len)
|
||||
log_world(commit)
|
||||
for(var/line in testmerge)
|
||||
if(line)
|
||||
if(world.RunningService())
|
||||
var/tmcommit = testmerge[line]["commit"]
|
||||
log_world("Test merge active of PR #[line] commit [tmcommit]")
|
||||
SSblackbox.add_details("testmerged_prs","[line]|[tmcommit]")
|
||||
else //tgs2 support
|
||||
log_world("Test merge active of PR #[line]")
|
||||
SSblackbox.add_details("testmerged_prs","[line]")
|
||||
log_world("Based off origin/master commit [originmastercommit]")
|
||||
else
|
||||
log_world(originmastercommit)
|
||||
|
||||
/datum/getrev/proc/DownloadPRDetails()
|
||||
if(!config.githubrepoid)
|
||||
if(testmerge.len)
|
||||
log_world("PR details download failed: No github repo config set")
|
||||
return
|
||||
if(!isnum(text2num(config.githubrepoid)))
|
||||
log_world("PR details download failed: Invalid github repo id: [config.githubrepoid]")
|
||||
return
|
||||
for(var/line in testmerge)
|
||||
if(!isnum(text2num(line)))
|
||||
log_world("PR details download failed: Invalid PR number: [line]")
|
||||
return
|
||||
|
||||
var/url = "https://api.github.com/repositories/[config.githubrepoid]/pulls/[line].json"
|
||||
GLOB.valid_HTTPSGet = TRUE
|
||||
var/json = HTTPSGet(url)
|
||||
if(!json)
|
||||
return
|
||||
|
||||
testmerge[line] = json_decode(json)
|
||||
|
||||
if(!testmerge[line])
|
||||
log_world("PR details download failed: null details returned")
|
||||
return
|
||||
CHECK_TICK
|
||||
log_world("PR details successfully downloaded")
|
||||
has_pr_details = TRUE
|
||||
|
||||
/datum/getrev/proc/GetTestMergeInfo(header = TRUE)
|
||||
if(!testmerge.len)
|
||||
return ""
|
||||
. = header ? "The following pull requests are currently test merged:<br>" : ""
|
||||
for(var/line in testmerge)
|
||||
var/details
|
||||
if(world.RunningService())
|
||||
var/cm = testmerge[line]["commit"]
|
||||
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["author"]) + " at commit " + html_encode(copytext(cm, 1, min(length(cm), 7)))
|
||||
else if(has_pr_details) //tgs2 support
|
||||
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["user"]["login"])
|
||||
/datum/getrev
|
||||
var/originmastercommit
|
||||
var/commit
|
||||
var/list/testmerge = list()
|
||||
var/has_pr_details = FALSE //tgs2 support
|
||||
var/date
|
||||
|
||||
/datum/getrev/New()
|
||||
if(world.RunningService() && fexists(SERVICE_PR_TEST_JSON))
|
||||
testmerge = json_decode(file2text(SERVICE_PR_TEST_JSON))
|
||||
#ifdef SERVERTOOLS
|
||||
else if(!world.RunningService() && fexists("../prtestjob.lk")) //tgs2 support
|
||||
var/list/tmp = world.file2list("..\\prtestjob.lk")
|
||||
for(var/I in tmp)
|
||||
if(I)
|
||||
testmerge |= I
|
||||
#endif
|
||||
log_world("Running /tg/ revision:")
|
||||
var/list/logs = world.file2list(".git/logs/HEAD")
|
||||
if(logs)
|
||||
logs = splittext(logs[logs.len - 1], " ")
|
||||
date = unix2date(text2num(logs[5]))
|
||||
commit = logs[2]
|
||||
log_world("[date]")
|
||||
logs = world.file2list(".git/logs/refs/remotes/origin/master")
|
||||
if(logs)
|
||||
originmastercommit = splittext(logs[logs.len - 1], " ")[2]
|
||||
|
||||
if(testmerge.len)
|
||||
log_world(commit)
|
||||
for(var/line in testmerge)
|
||||
if(line)
|
||||
if(world.RunningService())
|
||||
var/tmcommit = testmerge[line]["commit"]
|
||||
log_world("Test merge active of PR #[line] commit [tmcommit]")
|
||||
SSblackbox.add_details("testmerged_prs","[line]|[tmcommit]")
|
||||
else //tgs2 support
|
||||
log_world("Test merge active of PR #[line]")
|
||||
SSblackbox.add_details("testmerged_prs","[line]")
|
||||
log_world("Based off origin/master commit [originmastercommit]")
|
||||
else
|
||||
log_world(originmastercommit)
|
||||
/datum/getrev/proc/DownloadPRDetails()
|
||||
if(!config.githubrepoid)
|
||||
if(testmerge.len)
|
||||
log_world("PR details download failed: No github repo config set")
|
||||
return
|
||||
if(!isnum(text2num(config.githubrepoid)))
|
||||
log_world("PR details download failed: Invalid github repo id: [config.githubrepoid]")
|
||||
return
|
||||
for(var/line in testmerge)
|
||||
if(!isnum(text2num(line)))
|
||||
log_world("PR details download failed: Invalid PR number: [line]")
|
||||
return
|
||||
|
||||
var/url = "https://api.github.com/repositories/[config.githubrepoid]/pulls/[line].json"
|
||||
GLOB.valid_HTTPSGet = TRUE
|
||||
var/json = HTTPSGet(url)
|
||||
if(!json)
|
||||
return
|
||||
|
||||
testmerge[line] = json_decode(json)
|
||||
|
||||
if(!testmerge[line])
|
||||
log_world("PR details download failed: null details returned")
|
||||
return
|
||||
CHECK_TICK
|
||||
log_world("PR details successfully downloaded")
|
||||
has_pr_details = TRUE
|
||||
|
||||
/datum/getrev/proc/GetTestMergeInfo(header = TRUE)
|
||||
if(!testmerge.len)
|
||||
return ""
|
||||
. = header ? "The following pull requests are currently test merged:<br>" : ""
|
||||
for(var/line in testmerge)
|
||||
var/details
|
||||
if(world.RunningService())
|
||||
var/cm = testmerge[line]["commit"]
|
||||
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["author"]) + " at commit " + html_encode(copytext(cm, 1, min(length(cm), 7)))
|
||||
else if(has_pr_details) //tgs2 support
|
||||
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["user"]["login"])
|
||||
. += "<a href=\"[config.githuburl]/pull/[line]\">#[line][details]</a><br>"
|
||||
|
||||
/client/verb/showrevinfo()
|
||||
set category = "OOC"
|
||||
set name = "Show Server Revision"
|
||||
set desc = "Check the current server code revision"
|
||||
|
||||
if(GLOB.revdata.originmastercommit)
|
||||
to_chat(src, "<b>Server revision compiled on:</b> [GLOB.revdata.date]")
|
||||
var/prefix = ""
|
||||
if(GLOB.revdata.testmerge.len)
|
||||
to_chat(src, GLOB.revdata.GetTestMergeInfo())
|
||||
prefix = "Based off origin/master commit: "
|
||||
var/pc = GLOB.revdata.originmastercommit
|
||||
|
||||
/client/verb/showrevinfo()
|
||||
set category = "OOC"
|
||||
set name = "Show Server Revision"
|
||||
set desc = "Check the current server code revision"
|
||||
|
||||
if(GLOB.revdata.originmastercommit)
|
||||
to_chat(src, "<b>Server revision compiled on:</b> [GLOB.revdata.date]")
|
||||
var/prefix = ""
|
||||
if(GLOB.revdata.testmerge.len)
|
||||
to_chat(src, GLOB.revdata.GetTestMergeInfo())
|
||||
prefix = "Based off origin/master commit: "
|
||||
var/pc = GLOB.revdata.originmastercommit
|
||||
to_chat(src, "[prefix]<a href=\"[config.githuburl]/commit/[pc]\">[copytext(pc, 1, min(length(pc), 7))]</a>")
|
||||
else
|
||||
to_chat(src, "Revision unknown")
|
||||
to_chat(src, "<b>Current Infomational Settings:</b>")
|
||||
to_chat(src, "Protect Authority Roles From Traitor: [config.protect_roles_from_antagonist]")
|
||||
to_chat(src, "Protect Assistant Role From Traitor: [config.protect_assistant_from_antagonist]")
|
||||
to_chat(src, "Enforce Human Authority: [config.enforce_human_authority]")
|
||||
to_chat(src, "Allow Latejoin Antagonists: [config.allow_latejoin_antagonists]")
|
||||
to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes")
|
||||
to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes")
|
||||
if(config.show_game_type_odds)
|
||||
if(SSticker.IsRoundInProgress())
|
||||
var/prob_sum = 0
|
||||
var/current_odds_differ = FALSE
|
||||
var/list/probs = list()
|
||||
var/list/modes = config.gamemode_cache
|
||||
for(var/mode in modes)
|
||||
var/datum/game_mode/M = mode
|
||||
var/ctag = initial(M.config_tag)
|
||||
if(!(ctag in config.probabilities))
|
||||
continue
|
||||
if((config.min_pop[ctag] && (config.min_pop[ctag] > SSticker.totalPlayersReady)) || (config.max_pop[ctag] && (config.max_pop[ctag] < SSticker.totalPlayersReady)) || (initial(M.required_players) > SSticker.totalPlayersReady))
|
||||
current_odds_differ = TRUE
|
||||
continue
|
||||
probs[ctag] = 1
|
||||
prob_sum += config.probabilities[ctag]
|
||||
if(current_odds_differ)
|
||||
to_chat(src, "<b>Game Mode Odds for current round:</b>")
|
||||
for(var/ctag in probs)
|
||||
if(config.probabilities[ctag] > 0)
|
||||
var/percentage = round(config.probabilities[ctag] / prob_sum * 100, 0.1)
|
||||
to_chat(src, "[ctag] [percentage]%")
|
||||
|
||||
to_chat(src, "<b>All Game Mode Odds:</b>")
|
||||
var/sum = 0
|
||||
for(var/ctag in config.probabilities)
|
||||
sum += config.probabilities[ctag]
|
||||
for(var/ctag in config.probabilities)
|
||||
if(config.probabilities[ctag] > 0)
|
||||
var/percentage = round(config.probabilities[ctag] / sum * 100, 0.1)
|
||||
to_chat(src, "[ctag] [percentage]%")
|
||||
else
|
||||
to_chat(src, "Revision unknown")
|
||||
to_chat(src, "<b>Current Infomational Settings:</b>")
|
||||
to_chat(src, "Protect Authority Roles From Traitor: [config.protect_roles_from_antagonist]")
|
||||
to_chat(src, "Protect Assistant Role From Traitor: [config.protect_assistant_from_antagonist]")
|
||||
to_chat(src, "Enforce Human Authority: [config.enforce_human_authority]")
|
||||
to_chat(src, "Allow Latejoin Antagonists: [config.allow_latejoin_antagonists]")
|
||||
to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes")
|
||||
to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes")
|
||||
if(config.show_game_type_odds)
|
||||
if(SSticker.IsRoundInProgress())
|
||||
var/prob_sum = 0
|
||||
var/current_odds_differ = FALSE
|
||||
var/list/probs = list()
|
||||
var/list/modes = config.gamemode_cache
|
||||
for(var/mode in modes)
|
||||
var/datum/game_mode/M = mode
|
||||
var/ctag = initial(M.config_tag)
|
||||
if(!(ctag in config.probabilities))
|
||||
continue
|
||||
if((config.min_pop[ctag] && (config.min_pop[ctag] > SSticker.totalPlayersReady)) || (config.max_pop[ctag] && (config.max_pop[ctag] < SSticker.totalPlayersReady)) || (initial(M.required_players) > SSticker.totalPlayersReady))
|
||||
current_odds_differ = TRUE
|
||||
continue
|
||||
probs[ctag] = 1
|
||||
prob_sum += config.probabilities[ctag]
|
||||
if(current_odds_differ)
|
||||
to_chat(src, "<b>Game Mode Odds for current round:</b>")
|
||||
for(var/ctag in probs)
|
||||
if(config.probabilities[ctag] > 0)
|
||||
var/percentage = round(config.probabilities[ctag] / prob_sum * 100, 0.1)
|
||||
to_chat(src, "[ctag] [percentage]%")
|
||||
|
||||
to_chat(src, "<b>All Game Mode Odds:</b>")
|
||||
var/sum = 0
|
||||
for(var/ctag in config.probabilities)
|
||||
sum += config.probabilities[ctag]
|
||||
for(var/ctag in config.probabilities)
|
||||
if(config.probabilities[ctag] > 0)
|
||||
var/percentage = round(config.probabilities[ctag] / sum * 100, 0.1)
|
||||
to_chat(src, "[ctag] [percentage]%")
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
var/soundout //soundfile to play after teleportation
|
||||
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
|
||||
|
||||
|
||||
/datum/teleport/proc/start(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
if(!initTeleport(arglist(args)))
|
||||
return 0
|
||||
@@ -100,21 +99,7 @@
|
||||
|
||||
var/turf/destturf
|
||||
var/turf/curturf = get_turf(teleatom)
|
||||
if(precision)
|
||||
var/list/posturfs = list()
|
||||
var/center = get_turf(destination)
|
||||
if(!center)
|
||||
center = destination
|
||||
for(var/turf/T in range(precision,center))
|
||||
if(T.is_transition_turf())
|
||||
continue // Avoid picking these.
|
||||
var/area/A = T.loc
|
||||
if(!A.noteleport)
|
||||
posturfs.Add(T)
|
||||
|
||||
destturf = safepick(posturfs)
|
||||
else
|
||||
destturf = get_turf(destination)
|
||||
destturf = get_teleport_turf(get_turf(destination), precision)
|
||||
|
||||
if(!destturf || !curturf || destturf.is_transition_turf())
|
||||
return 0
|
||||
@@ -124,13 +109,16 @@
|
||||
return 0
|
||||
|
||||
playSpecials(curturf,effectin,soundin)
|
||||
|
||||
if(force_teleport)
|
||||
teleatom.forceMove(destturf)
|
||||
if(ismegafauna(teleatom))
|
||||
message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
else
|
||||
if(teleatom.Move(destturf))
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
if(ismegafauna(teleatom))
|
||||
message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
|
||||
return 1
|
||||
|
||||
/datum/teleport/proc/teleport()
|
||||
@@ -225,3 +213,18 @@
|
||||
|
||||
// DING! You have passed the gauntlet, and are "probably" safe.
|
||||
return F
|
||||
|
||||
/proc/get_teleport_turfs(turf/center, precision = 0)
|
||||
if(!precision)
|
||||
return list(center)
|
||||
var/list/posturfs = list()
|
||||
for(var/turf/T in range(precision,center))
|
||||
if(T.is_transition_turf())
|
||||
continue // Avoid picking these.
|
||||
var/area/A = T.loc
|
||||
if(!A.noteleport)
|
||||
posturfs.Add(T)
|
||||
return posturfs
|
||||
|
||||
/proc/get_teleport_turf(turf/center, precision = 0)
|
||||
return safepick(get_teleport_turfs(center, precision))
|
||||
|
||||
+141
-141
@@ -1,143 +1,143 @@
|
||||
//used for holding information about unique properties of maps
|
||||
//feed it json files that match the datum layout
|
||||
//defaults to box
|
||||
// -Cyberboss
|
||||
|
||||
/datum/map_config
|
||||
var/config_filename = "_maps/tgstation2.json"
|
||||
var/map_name = "Box Station"
|
||||
var/map_path = "map_files/TgStation"
|
||||
var/map_file = "tgstation.2.1.3.dmm"
|
||||
|
||||
var/minetype = "lavaland"
|
||||
|
||||
//used for holding information about unique properties of maps
|
||||
//feed it json files that match the datum layout
|
||||
//defaults to box
|
||||
// -Cyberboss
|
||||
|
||||
/datum/map_config
|
||||
var/config_filename = "_maps/boxstation.json"
|
||||
var/map_name = "Box Station"
|
||||
var/map_path = "map_files/BoxStation"
|
||||
var/map_file = "BoxStation.dmm"
|
||||
|
||||
var/minetype = "lavaland"
|
||||
|
||||
var/list/transition_config = list(CENTCOMM = SELFLOOPING,
|
||||
MAIN_STATION = CROSSLINKED,
|
||||
EMPTY_AREA_1 = CROSSLINKED,
|
||||
EMPTY_AREA_2 = CROSSLINKED,
|
||||
MINING = SELFLOOPING,
|
||||
EMPTY_AREA_3 = CROSSLINKED,
|
||||
EMPTY_AREA_4 = CROSSLINKED,
|
||||
EMPTY_AREA_5 = CROSSLINKED,
|
||||
EMPTY_AREA_6 = CROSSLINKED,
|
||||
EMPTY_AREA_7 = CROSSLINKED,
|
||||
EMPTY_AREA_8 = CROSSLINKED)
|
||||
var/defaulted = TRUE //if New failed
|
||||
|
||||
var/config_max_users = 0
|
||||
var/config_min_users = 0
|
||||
var/voteweight = 1
|
||||
|
||||
/datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after)
|
||||
if(default_to_box)
|
||||
return
|
||||
LoadConfig(filename)
|
||||
if(delete_after)
|
||||
fdel(filename)
|
||||
|
||||
/datum/map_config/proc/LoadConfig(filename)
|
||||
if(!fexists(filename))
|
||||
log_world("map_config not found: [filename]")
|
||||
return
|
||||
|
||||
var/json = file(filename)
|
||||
if(!json)
|
||||
log_world("Could not open map_config: [filename]")
|
||||
return
|
||||
|
||||
json = file2text(json)
|
||||
if(!json)
|
||||
log_world("map_config is not text: [filename]")
|
||||
return
|
||||
|
||||
json = json_decode(json)
|
||||
if(!json)
|
||||
log_world("map_config is not json: [filename]")
|
||||
return
|
||||
|
||||
if(!ValidateJSON(json))
|
||||
log_world("map_config failed to validate for above reason: [filename]")
|
||||
return
|
||||
|
||||
config_filename = filename
|
||||
|
||||
map_name = json["map_name"]
|
||||
map_path = json["map_path"]
|
||||
map_file = json["map_file"]
|
||||
|
||||
minetype = json["minetype"]
|
||||
|
||||
var/list/jtcl = json["transition_config"]
|
||||
|
||||
if(jtcl != "default")
|
||||
transition_config.Cut()
|
||||
|
||||
for(var/I in jtcl)
|
||||
transition_config[TransitionStringToEnum(I)] = TransitionStringToEnum(jtcl[I])
|
||||
|
||||
defaulted = FALSE
|
||||
|
||||
#define CHECK_EXISTS(X) if(!istext(json[X])) { log_world(X + "missing from json!"); return; }
|
||||
/datum/map_config/proc/ValidateJSON(list/json)
|
||||
CHECK_EXISTS("map_name")
|
||||
CHECK_EXISTS("map_path")
|
||||
CHECK_EXISTS("map_file")
|
||||
CHECK_EXISTS("minetype")
|
||||
CHECK_EXISTS("transition_config")
|
||||
|
||||
var/path = GetFullMapPath(json["map_path"], json["map_file"])
|
||||
if(!fexists(path))
|
||||
log_world("Map file ([path]) does not exist!")
|
||||
return
|
||||
|
||||
if(json["transition_config"] != "default")
|
||||
if(!islist(json["transition_config"]))
|
||||
log_world("transition_config is not a list!")
|
||||
return
|
||||
|
||||
var/list/jtcl = json["transition_config"]
|
||||
for(var/I in jtcl)
|
||||
if(isnull(TransitionStringToEnum(I)))
|
||||
log_world("Invalid transition_config option: [I]!")
|
||||
if(isnull(TransitionStringToEnum(jtcl[I])))
|
||||
log_world("Invalid transition_config option: [I]!")
|
||||
|
||||
return TRUE
|
||||
#undef CHECK_EXISTS
|
||||
|
||||
/datum/map_config/proc/TransitionStringToEnum(string)
|
||||
switch(string)
|
||||
if("CROSSLINKED")
|
||||
return CROSSLINKED
|
||||
if("SELFLOOPING")
|
||||
return SELFLOOPING
|
||||
if("UNAFFECTED")
|
||||
return UNAFFECTED
|
||||
if("MAIN_STATION")
|
||||
return MAIN_STATION
|
||||
if("CENTCOMM")
|
||||
return CENTCOMM
|
||||
if("MINING")
|
||||
return MINING
|
||||
if("EMPTY_AREA_1")
|
||||
return EMPTY_AREA_1
|
||||
if("EMPTY_AREA_2")
|
||||
return EMPTY_AREA_2
|
||||
if("EMPTY_AREA_3")
|
||||
return EMPTY_AREA_3
|
||||
if("EMPTY_AREA_4")
|
||||
return EMPTY_AREA_4
|
||||
if("EMPTY_AREA_5")
|
||||
return EMPTY_AREA_5
|
||||
if("EMPTY_AREA_6")
|
||||
return EMPTY_AREA_6
|
||||
if("EMPTY_AREA_7")
|
||||
return EMPTY_AREA_7
|
||||
if("EMPTY_AREA_8")
|
||||
return EMPTY_AREA_8
|
||||
|
||||
/datum/map_config/proc/GetFullMapPath(mp = map_path, mf = map_file)
|
||||
return "_maps/[mp]/[mf]"
|
||||
|
||||
/datum/map_config/proc/MakeNextMap()
|
||||
return config_filename == "data/next_map.json" || fcopy(config_filename, "data/next_map.json")
|
||||
EMPTY_AREA_1 = CROSSLINKED,
|
||||
EMPTY_AREA_2 = CROSSLINKED,
|
||||
MINING = SELFLOOPING,
|
||||
EMPTY_AREA_3 = CROSSLINKED,
|
||||
EMPTY_AREA_4 = CROSSLINKED,
|
||||
EMPTY_AREA_5 = CROSSLINKED,
|
||||
EMPTY_AREA_6 = CROSSLINKED,
|
||||
EMPTY_AREA_7 = CROSSLINKED,
|
||||
EMPTY_AREA_8 = CROSSLINKED)
|
||||
var/defaulted = TRUE //if New failed
|
||||
|
||||
var/config_max_users = 0
|
||||
var/config_min_users = 0
|
||||
var/voteweight = 1
|
||||
|
||||
/datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after)
|
||||
if(default_to_box)
|
||||
return
|
||||
LoadConfig(filename)
|
||||
if(delete_after)
|
||||
fdel(filename)
|
||||
|
||||
/datum/map_config/proc/LoadConfig(filename)
|
||||
if(!fexists(filename))
|
||||
log_world("map_config not found: [filename]")
|
||||
return
|
||||
|
||||
var/json = file(filename)
|
||||
if(!json)
|
||||
log_world("Could not open map_config: [filename]")
|
||||
return
|
||||
|
||||
json = file2text(json)
|
||||
if(!json)
|
||||
log_world("map_config is not text: [filename]")
|
||||
return
|
||||
|
||||
json = json_decode(json)
|
||||
if(!json)
|
||||
log_world("map_config is not json: [filename]")
|
||||
return
|
||||
|
||||
if(!ValidateJSON(json))
|
||||
log_world("map_config failed to validate for above reason: [filename]")
|
||||
return
|
||||
|
||||
config_filename = filename
|
||||
|
||||
map_name = json["map_name"]
|
||||
map_path = json["map_path"]
|
||||
map_file = json["map_file"]
|
||||
|
||||
minetype = json["minetype"]
|
||||
|
||||
var/list/jtcl = json["transition_config"]
|
||||
|
||||
if(jtcl != "default")
|
||||
transition_config.Cut()
|
||||
|
||||
for(var/I in jtcl)
|
||||
transition_config[TransitionStringToEnum(I)] = TransitionStringToEnum(jtcl[I])
|
||||
|
||||
defaulted = FALSE
|
||||
|
||||
#define CHECK_EXISTS(X) if(!istext(json[X])) { log_world(X + "missing from json!"); return; }
|
||||
/datum/map_config/proc/ValidateJSON(list/json)
|
||||
CHECK_EXISTS("map_name")
|
||||
CHECK_EXISTS("map_path")
|
||||
CHECK_EXISTS("map_file")
|
||||
CHECK_EXISTS("minetype")
|
||||
CHECK_EXISTS("transition_config")
|
||||
|
||||
var/path = GetFullMapPath(json["map_path"], json["map_file"])
|
||||
if(!fexists(path))
|
||||
log_world("Map file ([path]) does not exist!")
|
||||
return
|
||||
|
||||
if(json["transition_config"] != "default")
|
||||
if(!islist(json["transition_config"]))
|
||||
log_world("transition_config is not a list!")
|
||||
return
|
||||
|
||||
var/list/jtcl = json["transition_config"]
|
||||
for(var/I in jtcl)
|
||||
if(isnull(TransitionStringToEnum(I)))
|
||||
log_world("Invalid transition_config option: [I]!")
|
||||
if(isnull(TransitionStringToEnum(jtcl[I])))
|
||||
log_world("Invalid transition_config option: [I]!")
|
||||
|
||||
return TRUE
|
||||
#undef CHECK_EXISTS
|
||||
|
||||
/datum/map_config/proc/TransitionStringToEnum(string)
|
||||
switch(string)
|
||||
if("CROSSLINKED")
|
||||
return CROSSLINKED
|
||||
if("SELFLOOPING")
|
||||
return SELFLOOPING
|
||||
if("UNAFFECTED")
|
||||
return UNAFFECTED
|
||||
if("MAIN_STATION")
|
||||
return MAIN_STATION
|
||||
if("CENTCOMM")
|
||||
return CENTCOMM
|
||||
if("MINING")
|
||||
return MINING
|
||||
if("EMPTY_AREA_1")
|
||||
return EMPTY_AREA_1
|
||||
if("EMPTY_AREA_2")
|
||||
return EMPTY_AREA_2
|
||||
if("EMPTY_AREA_3")
|
||||
return EMPTY_AREA_3
|
||||
if("EMPTY_AREA_4")
|
||||
return EMPTY_AREA_4
|
||||
if("EMPTY_AREA_5")
|
||||
return EMPTY_AREA_5
|
||||
if("EMPTY_AREA_6")
|
||||
return EMPTY_AREA_6
|
||||
if("EMPTY_AREA_7")
|
||||
return EMPTY_AREA_7
|
||||
if("EMPTY_AREA_8")
|
||||
return EMPTY_AREA_8
|
||||
|
||||
/datum/map_config/proc/GetFullMapPath(mp = map_path, mf = map_file)
|
||||
return "_maps/[mp]/[mf]"
|
||||
|
||||
/datum/map_config/proc/MakeNextMap()
|
||||
return config_filename == "data/next_map.json" || fcopy(config_filename, "data/next_map.json")
|
||||
|
||||
+34
-14
@@ -2,13 +2,12 @@
|
||||
var/name = "Martial Art"
|
||||
var/streak = ""
|
||||
var/max_streak_length = 6
|
||||
var/current_target = null
|
||||
var/temporary = 0
|
||||
var/datum/martial_art/base = null // The permanent style
|
||||
var/current_target
|
||||
var/datum/martial_art/base // The permanent style. This will be null unless the martial art is temporary
|
||||
var/deflection_chance = 0 //Chance to deflect projectiles
|
||||
var/block_chance = 0 //Chance to block melee attacks using items while on throw mode.
|
||||
var/restraining = 0 //used in cqc's disarm_act to check if the disarmed is being restrained and so whether they should be put in a chokehold or not
|
||||
var/help_verb = null
|
||||
var/help_verb
|
||||
var/no_guns = FALSE
|
||||
var/allow_temp_override = TRUE //if this martial art can be overridden by temporary martial arts
|
||||
|
||||
@@ -68,28 +67,49 @@
|
||||
add_logs(A, D, "punched")
|
||||
|
||||
if((D.stat != DEAD) && damage >= A.dna.species.punchstunthreshold)
|
||||
D.visible_message("<span class='danger'>[A] has weakened [D]!!</span>", \
|
||||
"<span class='userdanger'>[A] has weakened [D]!</span>")
|
||||
D.apply_effect(4, WEAKEN, armor_block)
|
||||
D.visible_message("<span class='danger'>[A] has knocked [D] down!!</span>", \
|
||||
"<span class='userdanger'>[A] has knocked [D] down!</span>")
|
||||
D.apply_effect(40, KNOCKDOWN, armor_block)
|
||||
D.forcesay(GLOB.hit_appends)
|
||||
else if(D.lying)
|
||||
D.forcesay(GLOB.hit_appends)
|
||||
return 1
|
||||
|
||||
/datum/martial_art/proc/teach(mob/living/carbon/human/H,make_temporary=0)
|
||||
if(make_temporary)
|
||||
temporary = 1
|
||||
if(temporary && H.mind.martial_art)
|
||||
if(!H.mind.martial_art.allow_temp_override)
|
||||
return
|
||||
base = H.mind.martial_art
|
||||
if(H.mind.martial_art)
|
||||
if(make_temporary)
|
||||
if(!H.mind.martial_art.allow_temp_override)
|
||||
return FALSE
|
||||
store(H.mind.martial_art,H)
|
||||
else
|
||||
H.mind.martial_art.on_remove(H)
|
||||
if(H.mind.martial_art != H.mind.default_martial_art && !H.mind.martial_art.base)
|
||||
QDEL_NULL(H.mind.martial_art)
|
||||
else if(make_temporary)
|
||||
base = H.mind.default_martial_art
|
||||
if(help_verb)
|
||||
H.verbs += help_verb
|
||||
H.mind.martial_art = src
|
||||
return TRUE
|
||||
|
||||
/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/H)
|
||||
if(H.mind && base)
|
||||
if(H.mind.default_martial_art != base && !base.base)
|
||||
QDEL_NULL(base)
|
||||
M.on_remove(H)
|
||||
base = M
|
||||
|
||||
/datum/martial_art/proc/remove(mob/living/carbon/human/H)
|
||||
if(H.mind.martial_art != src)
|
||||
return
|
||||
H.mind.martial_art = base
|
||||
on_remove(H)
|
||||
if(base)
|
||||
base.teach(H)
|
||||
else
|
||||
var/datum/martial_art/X = H.mind.default_martial_art
|
||||
X.teach(H)
|
||||
|
||||
/datum/martial_art/proc/on_remove(mob/living/carbon/human/H)
|
||||
if(help_verb)
|
||||
H.verbs -= help_verb
|
||||
return
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user