Merge remote-tracking branch 'citadel/master' into combat_rework
This commit is contained in:
@@ -112,7 +112,7 @@ GLOBAL_VAR_INIT(miscreants_allowed, FALSE)
|
||||
set desc = "Toggles seeing LocalOutOfCharacter chat"
|
||||
prefs.chat_toggles ^= CHAT_LOOC
|
||||
prefs.save_preferences()
|
||||
src << "You will [(prefs.chat_toggles & CHAT_LOOC) ? "now" : "no longer"] see messages on the LOOC channel."
|
||||
to_chat(src, "You will [(prefs.chat_toggles & CHAT_LOOC) ? "now" : "no longer"] see messages on the LOOC channel.")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/mob/living/carbon/proc/has_penis()
|
||||
|
||||
+119
-40
@@ -11,6 +11,7 @@
|
||||
|
||||
#define LAZYINITLIST(L) if (!L) L = list()
|
||||
#define UNSETEMPTY(L) if (L && !length(L)) L = null
|
||||
#define LAZYCOPY(L) (L ? L.Copy() : list() )
|
||||
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } }
|
||||
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
|
||||
#define LAZYOR(L, I) if(!L) { L = list(); } L |= I;
|
||||
@@ -21,34 +22,47 @@
|
||||
#define LAZYCLEARLIST(L) if(L) L.Cut()
|
||||
#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
|
||||
#define reverseList(L) reverseRange(L.Copy())
|
||||
#define LAZYADDASSOC(L, K, V) if(!L) { L = list(); } L[K] += list(V);
|
||||
#define LAZYREMOVEASSOC(L, K, V) if(L) { if(L[K]) { L[K] -= V; if(!length(L[K])) L -= K; } if(!length(L)) L = null; }
|
||||
|
||||
// binary search sorted insert
|
||||
// IN: Object to be inserted
|
||||
// LIST: List to insert object into
|
||||
// TYPECONT: The typepath of the contents of the list
|
||||
// COMPARE: The variable on the objects to compare
|
||||
#define BINARY_INSERT(IN, LIST, TYPECONT, COMPARE) \
|
||||
var/__BIN_CTTL = length(LIST);\
|
||||
if(!__BIN_CTTL) {\
|
||||
LIST += IN;\
|
||||
} else {\
|
||||
var/__BIN_LEFT = 1;\
|
||||
var/__BIN_RIGHT = __BIN_CTTL;\
|
||||
var/__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
|
||||
var/##TYPECONT/__BIN_ITEM;\
|
||||
while(__BIN_LEFT < __BIN_RIGHT) {\
|
||||
__BIN_ITEM = LIST[__BIN_MID];\
|
||||
if(__BIN_ITEM.##COMPARE <= IN.##COMPARE) {\
|
||||
__BIN_LEFT = __BIN_MID + 1;\
|
||||
} else {\
|
||||
__BIN_RIGHT = __BIN_MID;\
|
||||
/// Passed into BINARY_INSERT to compare keys
|
||||
#define COMPARE_KEY __BIN_LIST[__BIN_MID]
|
||||
/// Passed into BINARY_INSERT to compare values
|
||||
#define COMPARE_VALUE __BIN_LIST[__BIN_LIST[__BIN_MID]]
|
||||
|
||||
/****
|
||||
* Binary search sorted insert
|
||||
* INPUT: Object to be inserted
|
||||
* LIST: List to insert object into
|
||||
* TYPECONT: The typepath of the contents of the list
|
||||
* COMPARE: The object to compare against, usualy the same as INPUT
|
||||
* COMPARISON: The variable on the objects to compare
|
||||
*/
|
||||
#define BINARY_INSERT(INPUT, LIST, TYPECONT, COMPARE, COMPARISON, COMPTYPE) \
|
||||
do {\
|
||||
var/list/__BIN_LIST = LIST;\
|
||||
var/__BIN_CTTL = length(__BIN_LIST);\
|
||||
if(!__BIN_CTTL) {\
|
||||
__BIN_LIST += INPUT;\
|
||||
} else {\
|
||||
var/__BIN_LEFT = 1;\
|
||||
var/__BIN_RIGHT = __BIN_CTTL;\
|
||||
var/__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
|
||||
var/##TYPECONT/__BIN_ITEM;\
|
||||
while(__BIN_LEFT < __BIN_RIGHT) {\
|
||||
__BIN_ITEM = COMPTYPE;\
|
||||
if(__BIN_ITEM.##COMPARISON <= COMPARE.##COMPARISON) {\
|
||||
__BIN_LEFT = __BIN_MID + 1;\
|
||||
} else {\
|
||||
__BIN_RIGHT = __BIN_MID;\
|
||||
};\
|
||||
__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
|
||||
};\
|
||||
__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
|
||||
__BIN_ITEM = COMPTYPE;\
|
||||
__BIN_MID = __BIN_ITEM.##COMPARISON > COMPARE.##COMPARISON ? __BIN_MID : __BIN_MID + 1;\
|
||||
__BIN_LIST.Insert(__BIN_MID, INPUT);\
|
||||
};\
|
||||
__BIN_ITEM = LIST[__BIN_MID];\
|
||||
__BIN_MID = __BIN_ITEM.##COMPARE > IN.##COMPARE ? __BIN_MID : __BIN_MID + 1;\
|
||||
LIST.Insert(__BIN_MID, IN);\
|
||||
}
|
||||
} while(FALSE)
|
||||
|
||||
//Returns a list in plain english as a string
|
||||
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
|
||||
@@ -231,40 +245,77 @@
|
||||
|
||||
//Picks a random element from a list based on a weighting system:
|
||||
//1. Adds up the total of weights for each element
|
||||
//2. Gets a number between 1 and that total
|
||||
//2. Gets the total from 0% to 100% of previous total value.
|
||||
//3. For each element in the list, subtracts its weighting from that number
|
||||
//4. If that makes the number 0 or less, return that element.
|
||||
/proc/pickweight(list/L)
|
||||
/proc/pickweight(list/L, base_weight = 1)
|
||||
var/total = 0
|
||||
var/item
|
||||
for (item in L)
|
||||
if (!L[item])
|
||||
L[item] = 1
|
||||
L[item] = base_weight
|
||||
total += L[item]
|
||||
|
||||
total = rand(1, total)
|
||||
total = rand() * total
|
||||
for (item in L)
|
||||
total -=L [item]
|
||||
total -= L[item]
|
||||
if (total <= 0)
|
||||
return item
|
||||
|
||||
return null
|
||||
|
||||
/proc/pickweightAllowZero(list/L) //The original pickweight proc will sometimes pick entries with zero weight. I'm not sure if changing the original will break anything, so I left it be.
|
||||
//Picks a number of elements from a list based on weight.
|
||||
//This is highly optimised and good for things like grabbing 200 items from a list of 40,000
|
||||
//Much more efficient than many pickweight calls
|
||||
/proc/pickweight_mult(list/L, quantity, base_weight = 1)
|
||||
//First we total the list as normal
|
||||
var/total = 0
|
||||
var/item
|
||||
for (item in L)
|
||||
if (!L[item])
|
||||
L[item] = 0
|
||||
L[item] = base_weight
|
||||
total += L[item]
|
||||
|
||||
total = rand(0, total)
|
||||
for (item in L)
|
||||
total -=L [item]
|
||||
if (total <= 0 && L[item])
|
||||
return item
|
||||
//Next we will make a list of randomly generated numbers, called Requests
|
||||
//It is critical that this list be sorted in ascending order, so we will build it in that order
|
||||
//First one is free, so we start counting at 2
|
||||
var/list/requests = list(rand(1, total))
|
||||
for (var/i in 2 to quantity)
|
||||
//Each time we generate the next request
|
||||
var/newreq = rand()* total
|
||||
//We will loop through all existing requests
|
||||
for (var/j in 1 to requests.len)
|
||||
//We keep going through the list until we find an element which is bigger than the one we want to add
|
||||
if (requests[j] > newreq)
|
||||
//And then we insert the newqreq at that point, pushing everything else forward
|
||||
requests.Insert(j, newreq)
|
||||
break
|
||||
|
||||
return null
|
||||
|
||||
|
||||
//Now when we get here, we have a list of random numbers sorted in ascending order.
|
||||
//The length of that list is equal to Quantity passed into this function
|
||||
//Next we make a list to store results
|
||||
var/list/results = list()
|
||||
|
||||
//Zero the total, we'll reuse it
|
||||
total = 0
|
||||
|
||||
//Now we will iterate forward through the items list, adding each weight to the total
|
||||
for (item in L)
|
||||
total += L[item]
|
||||
|
||||
//After each item we do a while loop
|
||||
while (requests.len && total >= requests[1])
|
||||
//If the total is higher than the value of the first request
|
||||
results += item //We add this item to the results list
|
||||
requests.Cut(1,2) //And we cut off the top of the requests list
|
||||
|
||||
//This while loop will repeat until the next request is higher than the total.
|
||||
//The current item might be added to the results list many times, in this process
|
||||
|
||||
//By the time we get here:
|
||||
//Requests will be empty
|
||||
//Results will have a length of quality
|
||||
return results
|
||||
|
||||
//Pick a random element from the list and remove it from the list.
|
||||
/proc/pick_n_take(list/L)
|
||||
@@ -274,6 +325,13 @@
|
||||
. = L[picked]
|
||||
L.Cut(picked,picked+1) //Cut is far more efficient that Remove()
|
||||
|
||||
//Pick a random element from the list by weight and remove it from the list.
|
||||
//Result is returned as a list in the format list(key, value)
|
||||
/proc/pickweight_n_take(list/L, base_weight = 1)
|
||||
if (L.len)
|
||||
. = pickweight(L, base_weight)
|
||||
L.Remove(.)
|
||||
|
||||
//Returns the top(last) element from the list and removes it from the list (typical stack function)
|
||||
/proc/pop(list/L)
|
||||
if(L.len)
|
||||
@@ -550,6 +608,27 @@
|
||||
for(var/thing in flat_list)
|
||||
.[thing] = TRUE
|
||||
|
||||
/proc/deep_list2params(list/deep_list)
|
||||
var/list/L = list()
|
||||
for(var/i in deep_list)
|
||||
var/key = i
|
||||
if(isnum(key))
|
||||
L += "[key]"
|
||||
continue
|
||||
if(islist(key))
|
||||
key = deep_list2params(key)
|
||||
else if(!istext(key))
|
||||
key = "[REF(key)]"
|
||||
L += "[key]"
|
||||
var/value = deep_list[key]
|
||||
if(!isnull(value))
|
||||
if(islist(value))
|
||||
value = deep_list2params(value)
|
||||
else if(!(istext(key) || isnum(key)))
|
||||
value = "[REF(value)]"
|
||||
L["[key]"] = "[value]"
|
||||
return list2params(L)
|
||||
|
||||
//Picks from the list, with some safeties, and returns the "default" arg if it fails
|
||||
#define DEFAULTPICK(L, default) ((islist(L) && length(L)) ? pick(L) : default)
|
||||
|
||||
|
||||
@@ -167,15 +167,10 @@
|
||||
if((do_after_flags & DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL) && (!living_user?.is_holding(tool) && !length(living_user?.get_empty_held_indexes())))
|
||||
return FALSE
|
||||
|
||||
/// Requires absolute stillness in the user
|
||||
#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER (1<<0)
|
||||
/// Requires relative stillness to our target
|
||||
#define DO_AFTER_DISALLOW_MOVING_RELATIVE_TARGET (1<<1)
|
||||
|
||||
#undef INVOKE_CALLBACK
|
||||
#undef CHECK_FLAG_FAILURE
|
||||
|
||||
/proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks = null, ignorehelditem = 0)
|
||||
/proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks = null, ignorehelditem = FALSE, resume_time = 0 SECONDS)
|
||||
if(!user || !target)
|
||||
return 0
|
||||
var/user_loc = user.loc
|
||||
@@ -194,10 +189,10 @@
|
||||
var/endtime = world.time+time
|
||||
var/starttime = world.time
|
||||
. = 1
|
||||
while (world.time < endtime)
|
||||
while (world.time + resume_time < endtime)
|
||||
stoplag(1)
|
||||
if (progress)
|
||||
progbar.update(world.time - starttime)
|
||||
progbar.update(world.time - starttime + resume_time)
|
||||
if(QDELETED(user) || QDELETED(target))
|
||||
. = 0
|
||||
break
|
||||
@@ -229,7 +224,7 @@
|
||||
checked_health["health"] = health
|
||||
return ..()
|
||||
|
||||
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_USE|MOBILITY_MOVE))
|
||||
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_USE|MOBILITY_MOVE), resume_time = 0 SECONDS)
|
||||
if(!user)
|
||||
return 0
|
||||
var/atom/Tloc = null
|
||||
@@ -258,10 +253,10 @@
|
||||
var/starttime = world.time
|
||||
. = 1
|
||||
var/mob/living/L = isliving(user) && user //evals to last thing eval'd
|
||||
while (world.time < endtime)
|
||||
while (world.time + resume_time < endtime)
|
||||
stoplag(1)
|
||||
if (progress)
|
||||
progbar.update(world.time - starttime)
|
||||
progbar.update(world.time - starttime + resume_time)
|
||||
|
||||
if(drifting && !user.inertia_dir)
|
||||
drifting = 0
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
return
|
||||
|
||||
|
||||
// Better recursive loop, technically sort of not actually recursive cause that shit is retarded, enjoy.
|
||||
// Better recursive loop, technically sort of not actually recursive cause that shit is stupid, enjoy.
|
||||
//No need for a recursive limit either
|
||||
/proc/recursive_mob_check(atom/O,client_check=1,sight_check=1,include_radio=1)
|
||||
|
||||
@@ -425,8 +425,7 @@
|
||||
candidates -= M
|
||||
|
||||
/proc/pollGhostCandidates(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, ignore_category = null, flashwindow = TRUE)
|
||||
var/datum/element/ghost_role_eligibility/eligibility = SSdcs.GetElement(list(/datum/element/ghost_role_eligibility))
|
||||
var/list/candidates = eligibility.get_all_ghost_role_eligible()
|
||||
var/list/candidates = get_all_ghost_role_eligible()
|
||||
return pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates)
|
||||
|
||||
/proc/pollCandidates(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, ignore_category = null, flashwindow = TRUE, list/group = null)
|
||||
@@ -581,4 +580,4 @@
|
||||
var/area/A = C.area
|
||||
if(GLOB.typecache_powerfailure_safe_areas[A.type])
|
||||
continue
|
||||
C.energy_fail(rand(duration_min,duration_max))
|
||||
C.energy_fail(rand(duration_min,duration_max))
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes)
|
||||
|
||||
INVOKE_ASYNC(GLOBAL_PROC, /proc/init_ref_coin_values) //so the current procedure doesn't sleep because of UNTIL()
|
||||
INVOKE_ASYNC(GLOBAL_PROC, /proc/setupGenetics)
|
||||
|
||||
//creates every subtype of prototype (excluding prototype) and adds it to list L.
|
||||
//if no list/L is provided, one is created.
|
||||
@@ -113,3 +114,25 @@
|
||||
UNTIL(C.flags_1 & INITIALIZED_1) //we want to make sure the value is calculated and not null.
|
||||
GLOB.coin_values[path] = C.value
|
||||
qdel(C)
|
||||
|
||||
/proc/setupGenetics()
|
||||
var/list/mutations = subtypesof(/datum/mutation/human)
|
||||
shuffle_inplace(mutations)
|
||||
for(var/A in subtypesof(/datum/generecipe))
|
||||
var/datum/generecipe/GR = A
|
||||
GLOB.mutation_recipes[initial(GR.required)] = initial(GR.result)
|
||||
for(var/i in 1 to LAZYLEN(mutations))
|
||||
var/path = mutations[i] //byond gets pissy when we do it in one line
|
||||
var/datum/mutation/human/B = new path ()
|
||||
B.alias = "Mutation #[i]"
|
||||
GLOB.all_mutations[B.type] = B
|
||||
GLOB.full_sequences[B.type] = generate_gene_sequence(B.blocks)
|
||||
if(B.locked)
|
||||
continue
|
||||
if(B.quality == POSITIVE)
|
||||
GLOB.good_mutations |= B
|
||||
else if(B.quality == NEGATIVE)
|
||||
GLOB.bad_mutations |= B
|
||||
else if(B.quality == MINOR_NEGATIVE)
|
||||
GLOB.not_good_mutations |= B
|
||||
CHECK_TICK
|
||||
@@ -61,7 +61,7 @@
|
||||
var/adjacencies = 0
|
||||
|
||||
var/atom/movable/AM
|
||||
if(ismovableatom(A))
|
||||
if(ismovable(A))
|
||||
AM = A
|
||||
if(AM.can_be_unanchored && !AM.anchored)
|
||||
return 0
|
||||
|
||||
@@ -12,3 +12,5 @@
|
||||
#define is_reserved_level(z) SSmapping.level_trait(z, ZTRAIT_RESERVED)
|
||||
|
||||
#define is_away_level(z) SSmapping.level_trait(z, ZTRAIT_AWAY)
|
||||
|
||||
#define is_vr_level(z) SSmapping.level_trait(z, ZTRAIT_VR)
|
||||
|
||||
+30
-18
@@ -47,7 +47,7 @@
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear/socks, GLOB.socks_list)
|
||||
return pick(GLOB.socks_list)
|
||||
|
||||
/proc/random_features(intendedspecies)
|
||||
/proc/random_features(intendedspecies, intended_gender)
|
||||
if(!GLOB.tails_list_human.len)
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human)
|
||||
if(!GLOB.tails_list_lizard.len)
|
||||
@@ -149,7 +149,13 @@
|
||||
var/color2 = random_short_color()
|
||||
var/color3 = random_short_color()
|
||||
|
||||
//CIT CHANGE - changes this entire return to support cit's snowflake parts
|
||||
var/body_model = MALE
|
||||
switch(intended_gender)
|
||||
if(MALE, FEMALE)
|
||||
body_model = intended_gender
|
||||
if(PLURAL)
|
||||
body_model = pick(MALE,FEMALE)
|
||||
|
||||
return(list(
|
||||
"mcolor" = color1,
|
||||
"mcolor2" = color2,
|
||||
@@ -209,7 +215,8 @@
|
||||
"ipc_antenna" = "None",
|
||||
"flavor_text" = "",
|
||||
"meat_type" = "Mammalian",
|
||||
"body_model" = MALE
|
||||
"body_model" = body_model,
|
||||
"body_size" = RESIZE_DEFAULT_SIZE
|
||||
))
|
||||
|
||||
/proc/random_hair_style(gender)
|
||||
@@ -261,24 +268,30 @@
|
||||
if(!findname(.))
|
||||
break
|
||||
|
||||
/proc/random_skin_tone()
|
||||
return pick(GLOB.skin_tones)
|
||||
#define SKINTONE2HEX(skin_tone) GLOB.skin_tones[skin_tone] || skin_tone
|
||||
|
||||
/proc/random_skin_tone()
|
||||
return pick(GLOB.skin_tones - GLOB.nonstandard_skin_tones)
|
||||
|
||||
//ordered by amount of tan. Keep the nonstandard skin tones last.
|
||||
GLOBAL_LIST_INIT(skin_tones, list(
|
||||
"albino",
|
||||
"caucasian1",
|
||||
"caucasian2",
|
||||
"caucasian3",
|
||||
"latino",
|
||||
"mediterranean",
|
||||
"asian1",
|
||||
"asian2",
|
||||
"arab",
|
||||
"indian",
|
||||
"african1",
|
||||
"african2"
|
||||
"albino" = "#fff4e6",
|
||||
"caucasian1" = "#ffe0d1",
|
||||
"caucasian2" = "#fcccb3",
|
||||
"caucasian3" = "#e8b59b",
|
||||
"latino" = "#d9ae96",
|
||||
"mediterranean" = "#c79b8b",
|
||||
"asian1" = "#ffdeb3",
|
||||
"asian2" = "#e3ba84",
|
||||
"arab" = "#c4915e",
|
||||
"indian" = "#b87840",
|
||||
"african1" = "#754523",
|
||||
"african2" = "#471c18",
|
||||
"orange" = "#ffc905" //Spray tan overdose.
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(nonstandard_skin_tones, list("orange"))
|
||||
|
||||
GLOBAL_LIST_EMPTY(species_list)
|
||||
|
||||
/proc/age2agedescription(age)
|
||||
@@ -304,7 +317,6 @@ GLOBAL_LIST_EMPTY(species_list)
|
||||
else
|
||||
return "unknown"
|
||||
|
||||
|
||||
/proc/is_species(A, species_datum)
|
||||
. = FALSE
|
||||
if(ishuman(A))
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
var/screenviewY = screenview[2] * world.icon_size
|
||||
var/ox = round(screenviewX/2) - client.pixel_x //"origin" x
|
||||
var/oy = round(screenviewY/2) - client.pixel_y //"origin" y
|
||||
var/angle = SIMPLIFY_DEGREES(ATAN2(y - oy, x - ox))
|
||||
var/angle = SIMPLIFY_DEGREES(arctan(y - oy, x - ox))
|
||||
return angle
|
||||
|
||||
//Wow, specific name!
|
||||
|
||||
@@ -25,8 +25,22 @@
|
||||
/proc/radiation_pulse(atom/source, intensity, range_modifier, log=FALSE, can_contaminate=TRUE)
|
||||
if(!SSradiation.can_fire)
|
||||
return
|
||||
for(var/dir in GLOB.cardinals)
|
||||
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate)
|
||||
var/area/A = get_area(source)
|
||||
var/atom/nested_loc = source.loc
|
||||
var/spawn_waves = TRUE
|
||||
while(nested_loc != A)
|
||||
if(nested_loc.rad_flags & RAD_PROTECT_CONTENTS)
|
||||
spawn_waves = FALSE
|
||||
break
|
||||
nested_loc = nested_loc.loc
|
||||
if(spawn_waves)
|
||||
for(var/dir in GLOB.cardinals)
|
||||
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate)
|
||||
|
||||
var/static/last_huge_pulse = 0
|
||||
if(intensity > 3000 && world.time > last_huge_pulse + 200)
|
||||
last_huge_pulse = world.time
|
||||
log = TRUE
|
||||
|
||||
var/list/things = get_rad_contents(source) //copypasta because I don't want to put special code in waves to handle their origin
|
||||
for(var/k in 1 to things.len)
|
||||
@@ -35,11 +49,7 @@
|
||||
continue
|
||||
thing.rad_act(intensity)
|
||||
|
||||
var/static/last_huge_pulse = 0
|
||||
if(intensity > 3000 && world.time > last_huge_pulse + 200)
|
||||
last_huge_pulse = world.time
|
||||
log = TRUE
|
||||
if(log)
|
||||
var/turf/_source_T = isturf(source) ? source : get_turf(source)
|
||||
log_game("Radiation pulse with intensity: [intensity] and range modifier: [range_modifier] in [loc_name(_source_T)] ")
|
||||
var/turf/_source_T = get_turf(source)
|
||||
log_game("Radiation pulse with intensity: [intensity] and range modifier: [range_modifier] in [loc_name(_source_T)][spawn_waves ? "" : " (contained by [nested_loc.name])"]")
|
||||
return TRUE
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/proc/sanitize_frequency(frequency, free = FALSE)
|
||||
frequency = round(frequency)
|
||||
if(free)
|
||||
. = CLAMP(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
|
||||
. = clamp(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
|
||||
else
|
||||
. = CLAMP(frequency, MIN_FREQ, MAX_FREQ)
|
||||
. = clamp(frequency, MIN_FREQ, MAX_FREQ)
|
||||
if(!(. % 2)) // Ensure the last digit is an odd number
|
||||
. += 1
|
||||
|
||||
|
||||
@@ -320,8 +320,10 @@
|
||||
parts += "[FOURSPACES]<i>Nobody died this shift!</i>"
|
||||
if(istype(SSticker.mode, /datum/game_mode/dynamic))
|
||||
var/datum/game_mode/dynamic/mode = SSticker.mode
|
||||
mode.update_playercounts()
|
||||
parts += "[FOURSPACES]Final threat level: [mode.threat_level]"
|
||||
parts += "[FOURSPACES]Final threat: [mode.threat]"
|
||||
parts += "[FOURSPACES]Average threat: [mode.threat_average]"
|
||||
parts += "[FOURSPACES]Executed rules:"
|
||||
for(var/datum/dynamic_ruleset/rule in mode.executed_rules)
|
||||
parts += "[FOURSPACES][FOURSPACES][rule.ruletype] - <b>[rule.name]</b>: -[rule.cost + rule.scaled_times * rule.scaling_cost] threat"
|
||||
@@ -511,7 +513,7 @@
|
||||
if(owner && GLOB.common_report && SSticker.current_state == GAME_STATE_FINISHED)
|
||||
SSticker.show_roundend_report(owner.client, FALSE)
|
||||
|
||||
/datum/action/report/IsAvailable()
|
||||
/datum/action/report/IsAvailable(silent = FALSE)
|
||||
return 1
|
||||
|
||||
/datum/action/report/Topic(href,href_list)
|
||||
@@ -561,7 +563,7 @@
|
||||
if(objective.completable)
|
||||
var/completion = objective.check_completion()
|
||||
if(completion >= 1)
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text] <span class='greentext'><B>Success!</span>"
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text] <span class='greentext'><B>Success!</B></span>"
|
||||
else if(completion <= 0)
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text] <span class='redtext'>Fail.</span>"
|
||||
else
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
return number
|
||||
return default
|
||||
|
||||
/proc/sanitize_num_clamp(number, min=0, max=1, default=0, quantize=0)
|
||||
if(!isnum(number))
|
||||
return default
|
||||
. = clamp(number, min, max)
|
||||
if(quantize)
|
||||
. = round(number, quantize)
|
||||
|
||||
/proc/sanitize_text(text, default="")
|
||||
if(istext(text))
|
||||
return text
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
/proc/invertHTML(HTMLstring)
|
||||
if(!istext(HTMLstring))
|
||||
CRASH("Given non-text argument!")
|
||||
return
|
||||
else if(length(HTMLstring) != 7)
|
||||
CRASH("Given non-HTML argument!")
|
||||
return
|
||||
else if(length_char(HTMLstring) != 7)
|
||||
CRASH("Given non-hex symbols in argument!")
|
||||
var/textr = copytext(HTMLstring, 2, 4)
|
||||
@@ -779,8 +777,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
|
||||
tX = splittext(tX[1], ":")
|
||||
tX = tX[1]
|
||||
var/list/actual_view = getviewsize(C ? C.view : world.view)
|
||||
tX = CLAMP(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
|
||||
tY = CLAMP(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
|
||||
tX = clamp(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
|
||||
tY = clamp(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
|
||||
return locate(tX, tY, tZ)
|
||||
|
||||
/proc/screen_loc2turf(text, turf/origin, client/C)
|
||||
@@ -793,8 +791,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
|
||||
tX = text2num(tX[2])
|
||||
tZ = origin.z
|
||||
var/list/actual_view = getviewsize(C ? C.view : world.view)
|
||||
tX = CLAMP(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
|
||||
tY = CLAMP(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
|
||||
tX = clamp(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
|
||||
tY = clamp(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
|
||||
return locate(tX, tY, tZ)
|
||||
|
||||
/proc/IsValidSrc(datum/D)
|
||||
@@ -1565,3 +1563,16 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
|
||||
if(channels_to_use.len)
|
||||
world.TgsChatBroadcast()
|
||||
|
||||
//Checks to see if either the victim has a garlic necklace or garlic in their blood
|
||||
/proc/blood_sucking_checks(var/mob/living/carbon/target, check_neck, check_blood)
|
||||
//Bypass this if the target isnt carbon.
|
||||
if(!iscarbon(target))
|
||||
return TRUE
|
||||
if(check_neck)
|
||||
if(istype(target.get_item_by_slot(SLOT_NECK), /obj/item/clothing/neck/garlic_necklace))
|
||||
return FALSE
|
||||
if(check_blood)
|
||||
if(target.reagents.has_reagent(/datum/reagent/consumable/garlic))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user