Merge branch 'master' into upstream-merge-29523

This commit is contained in:
LetterJay
2017-08-14 08:30:40 -05:00
committed by GitHub
735 changed files with 67775 additions and 63573 deletions
+3
View File
@@ -175,6 +175,9 @@ Actual Adjacent procs :
for(var/obj/structure/window/W in src)
if(!W.CanAStarPass(ID, adir))
return 1
for(var/obj/machinery/door/window/W in src)
if(!W.CanAStarPass(ID, adir))
return 1
for(var/obj/O in T)
if(!O.CanAStarPass(ID, rdir, caller))
return 1
+15 -4
View File
@@ -91,16 +91,23 @@
//returns a new list with only atoms that are in typecache L
/proc/typecache_filter_list(list/atoms, list/typecache)
. = list()
for (var/thing in atoms)
for(var/thing in atoms)
var/atom/A = thing
if (typecache[A.type])
. += A
/proc/typecache_filter_list_reverse(list/atoms, list/typecache)
. = list()
for (var/thing in atoms)
for(var/thing in atoms)
var/atom/A = thing
if (!typecache[A.type])
if(!typecache[A.type])
. += A
/proc/typecache_filter_multi_list_exclusion(list/atoms, list/typecache_include, list/typecache_exclude)
. = list()
for(var/thing in atoms)
var/atom/A = thing
if(typecache_include[A.type] && !typecache_exclude[A.type])
. += A
//Like typesof() or subtypesof(), but returns a typecache instead of a list
@@ -177,7 +184,11 @@
result = first ^ second
return result
//Pretends to pick an element based on its weight but really just seems to pick a random element.
//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
//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)
var/total = 0
var/item
View File
+5
View File
@@ -48,6 +48,11 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_dorsal, GLOB.xeno_dorsal_list)
//genitals
init_sprite_accessory_subtypes(/datum/sprite_accessory/penis, GLOB.cock_shapes_list)
for(var/K in GLOB.cock_shapes_list)
var/datum/sprite_accessory/penis/value = GLOB.cock_shapes_list[K]
GLOB.cock_shapes_icons[K] = value.icon_state
init_sprite_accessory_subtypes(/datum/sprite_accessory/vagina, GLOB.vagina_shapes_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/breasts, GLOB.breasts_shapes_list)
GLOB.breasts_size_list = list("a","b","c","d","e") //We need the list to choose from initialized, but it's no longer a sprite_accessory thing.
+15 -19
View File
@@ -968,32 +968,28 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
/image/proc/setDir(newdir)
dir = newdir
/atom/proc/freeze_icon_index()
return "\ref[initial(icon)]-[initial(icon_state)]"
#define FROZEN_RED_COLOR "#2E5E69"
#define FROZEN_GREEN_COLOR "#60A2A8"
#define FROZEN_BLUE_COLOR "#A1AFB1"
/obj/proc/make_frozen_visual()
// Used to make the frozen item visuals for Freon.
var/static/list/freeze_item_icons = list()
if(resistance_flags & FREEZE_PROOF)
return
if(!HAS_SECONDARY_FLAG(src, FROZEN) && (initial(icon) && initial(icon_state)))
var/index = freeze_icon_index()
var/icon/IC
var/icon/P = freeze_item_icons[index]
if(!P)
P = new /icon
for(var/iconstate in icon_states(icon))
var/icon/O = new('icons/effects/freeze.dmi', "ice_cube")
IC = new(icon, iconstate)
O.Blend(IC, ICON_ADD)
P.Insert(O, iconstate)
freeze_item_icons[index] = P
icon = P
if(!HAS_SECONDARY_FLAG(src, FROZEN))
name = "frozen [name]"
add_atom_colour(list(FROZEN_RED_COLOR, FROZEN_GREEN_COLOR, FROZEN_BLUE_COLOR, rgb(0,0,0)), TEMPORARY_COLOUR_PRIORITY)
alpha -= 25
SET_SECONDARY_FLAG(src, FROZEN)
//Assumes already frozed
/obj/proc/make_unfrozen()
icon = initial(icon)
name = replacetext(name, "frozen ", "")
CLEAR_SECONDARY_FLAG(src, FROZEN)
if(HAS_SECONDARY_FLAG(src, FROZEN))
name = replacetext(name, "frozen ", "")
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, list(FROZEN_RED_COLOR, FROZEN_GREEN_COLOR, FROZEN_BLUE_COLOR, rgb(0,0,0)))
alpha += 25
CLEAR_SECONDARY_FLAG(src, FROZEN)
#undef FROZEN_RED_COLOR
#undef FROZEN_GREEN_COLOR
#undef FROZEN_BLUE_COLOR
+38
View File
@@ -182,3 +182,41 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
gaussian_next = R2 * working
return (mean + stddev * R1)
#undef ACCURACY
/proc/mouse_angle_from_client(client/client)
var/list/mouse_control = params2list(client.mouseParams)
if(mouse_control["screen-loc"])
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
var/x = (text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32)
var/y = (text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32)
var/screenview = (client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
var/ox = round(screenview/2) - client.pixel_x //"origin" x
var/oy = round(screenview/2) - client.pixel_y //"origin" y
var/angle = NORM_ROT(Atan2(y - oy, x - ox))
return angle
/proc/get_turf_in_angle(angle, turf/starting, increments)
var/pixel_x = 0
var/pixel_y = 0
for(var/i in 1 to increments)
pixel_x += sin(angle)+16*sin(angle)*2
pixel_y += cos(angle)+16*cos(angle)*2
var/new_x = starting.x
var/new_y = starting.y
while(pixel_x > 16)
pixel_x -= 32
new_x++
while(pixel_x < -16)
pixel_x += 32
new_x--
while(pixel_y > 16)
pixel_y -= 32
new_y++
while(pixel_y < -16)
pixel_y += 32
new_y--
new_x = Clamp(new_x, 0, world.maxx)
new_y = Clamp(new_y, 0, world.maxy)
return locate(new_x, new_y, starting.z)
+4 -2
View File
@@ -116,6 +116,7 @@
"xenohead" = "None",
"xenotail" = "None",
"exhibitionist" = FALSE,
"genitals_use_skintone" = FALSE,
"has_cock" = FALSE,
"cock_shape" = pick(GLOB.cock_shapes_list),
"cock_length" = 6,
@@ -158,8 +159,9 @@
"womb_cum_rate" = CUM_RATE,
"womb_cum_mult" = CUM_RATE_MULT,
"womb_efficiency" = CUM_EFFICIENCY,
"womb_fluid" = "femcum"))
"womb_fluid" = "femcum",
"flavor_text" = ""))
/proc/random_hair_style(gender)
switch(gender)
if(MALE)
+1 -1
View File
@@ -8,7 +8,7 @@
//When we get into galloping mode, we stay there until both runs win less often than MIN_GALLOP consecutive times.
#define MIN_GALLOP 7
//This is a global instance to allow much of this code to be reused. The interfaces are kept seperately
//This is a global instance to allow much of this code to be reused. The interfaces are kept separately
GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new())
/datum/sortInstance
//The array being sorted.
+16 -7
View File
@@ -48,7 +48,7 @@ Location where the teleport begins, target that will teleport, distance to go, d
Random error in tile placement x, error in tile placement y, and block offset.
Block offset tells the proc how to place the box. Behind teleport location, relative to starting location, forward, etc.
Negative values for offset are accepted, think of it in relation to North, -x is west, -y is south. Error defaults to positive.
Turf and target are seperate in case you want to teleport some distance from a turf the target is not standing on or something.
Turf and target are separate in case you want to teleport some distance from a turf the target is not standing on or something.
*/
var/dirx = 0//Generic location finding variable.
@@ -491,17 +491,26 @@ Turf and target are seperate in case you want to teleport some distance from a t
var/y=arcsin(x/sqrt(1+x*x))
return y
/atom/proc/GetAllContents()
/atom/proc/GetAllContents(list/ignore_typecache)
var/list/processing_list = list(src)
var/list/assembled = list()
if(ignore_typecache) //If there's a typecache, use it.
while(processing_list.len)
var/atom/A = processing_list[1]
processing_list -= A
if(ignore_typecache[A.type])
continue
processing_list |= (A.contents - assembled)
assembled |= A
while(processing_list.len)
var/atom/A = processing_list[1]
processing_list -= A
else //If there's none, only make this check once for performance.
while(processing_list.len)
var/atom/A = processing_list[1]
processing_list -= A
processing_list |= (A.contents - assembled)
processing_list |= (A.contents - assembled)
assembled |= A
assembled |= A
return assembled