Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-03-15

# Conflicts:
#	README.md
#	code/__defines/mobs.dm
#	code/__defines/subsystems.dm
#	code/_helpers/global_lists.dm
#	code/controllers/subsystems/garbage.dm
#	code/controllers/subsystems/overlays.dm
#	code/datums/datacore.dm
#	code/datums/supplypacks/munitions.dm
#	code/game/machinery/suit_storage_unit.dm
#	code/game/objects/items/devices/communicator/UI.dm
#	code/game/objects/items/weapons/id cards/station_ids.dm
#	code/game/objects/random/random.dm
#	code/game/turfs/simulated/floor.dm
#	code/game/turfs/simulated/floor_icon.dm
#	code/modules/awaymissions/gateway.dm
#	code/modules/client/preferences.dm
#	code/modules/ext_scripts/python.dm
#	code/modules/mob/living/carbon/human/human.dm
#	code/modules/mob/living/carbon/human/life.dm
#	code/modules/mob/living/carbon/human/species/station/station.dm
#	code/modules/mob/living/carbon/human/species/virtual_reality/avatar.dm
#	code/modules/mob/living/carbon/human/update_icons.dm
#	code/modules/mob/living/living.dm
#	code/modules/mob/living/living_defines.dm
#	code/modules/mob/living/simple_animal/animals/bear.dm
#	code/modules/mob/mob_helpers.dm
#	code/modules/mob/new_player/new_player.dm
#	code/modules/mob/new_player/preferences_setup.dm
#	code/modules/mob/new_player/sprite_accessories.dm
#	code/modules/organs/organ_external.dm
#	code/modules/organs/organ_icon.dm
#	code/modules/organs/robolimbs.dm
#	code/modules/reagents/reagent_containers/glass.dm
#	code/modules/reagents/reagent_containers/syringes.dm
#	html/changelogs/.all_changelog.yml
#	maps/southern_cross/southern_cross-1.dmm
#	maps/southern_cross/southern_cross-3.dmm
#	maps/southern_cross/southern_cross-4.dmm
#	maps/southern_cross/southern_cross-6.dmm
#	vorestation.dme
This commit is contained in:
Leshana
2018-03-15 22:41:14 -04:00
242 changed files with 21216 additions and 547364 deletions
+118 -2
View File
@@ -69,7 +69,7 @@
/* Species-specific sprites, concept stolen from Paradise//vg/.
ex:
sprite_sheets = list(
"Tajara" = 'icons/cat/are/bad'
SPECIES_TAJ = 'icons/cat/are/bad'
)
If index term exists and icon_override is not set, this sprite sheet will be used.
*/
@@ -84,6 +84,9 @@
var/reach = 1 // Length of tiles it can reach, 1 is adjacent.
var/addblends // Icon overlay for ADD highlights when applicable.
var/icon/default_worn_icon //Default on-mob icon
var/worn_layer //Default on-mob layer
/obj/item/New()
..()
if(embed_chance < 0)
@@ -280,6 +283,7 @@
// note this isn't called during the initial dressing of a player
/obj/item/proc/equipped(var/mob/user, var/slot)
hud_layerise()
user.position_hud_item(src,slot)
if(user.client) user.client.screen |= src
if(user.pulling == src) user.stop_pulling()
return
@@ -676,4 +680,116 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
// My best guess as to why this is here would be that it does so little. Still, keep it under all the procs, for sanity's sake.
/obj/item/device
icon = 'icons/obj/device.dmi'
icon = 'icons/obj/device.dmi'
//Worn icon generation for on-mob sprites
/obj/item/proc/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer)
//Get the required information about the base icon
var/icon/icon2use = get_worn_icon_file(body_type = body_type, slot_name = slot_name, default_icon = default_icon, inhands = inhands)
var/state2use = get_worn_icon_state(slot_name = slot_name)
var/layer2use = get_worn_layer(default_layer = default_layer)
//Snowflakey inhand icons in a specific slot
if(inhands && icon2use == icon_override)
switch(slot_name)
if(slot_r_hand_str)
state2use += "_r"
if(slot_l_hand_str)
state2use += "_l"
// testing("[src] (\ref[src]) - Slot: [slot_name], Inhands: [inhands], Worn Icon:[icon2use], Worn State:[state2use], Worn Layer:[layer2use]")
//Generate the base onmob icon
var/icon/standing_icon = icon(icon = icon2use, icon_state = state2use)
if(!inhands)
apply_custom(standing_icon) //Pre-image overridable proc to customize the thing
apply_addblends(icon2use,standing_icon) //Some items have ICON_ADD blend shaders
var/image/standing = image(standing_icon)
standing.alpha = alpha
standing.color = color
standing.layer = layer2use
//Apply any special features
if(!inhands)
apply_blood(standing) //Some items show blood when bloodied
apply_accessories(standing) //Some items sport accessories like webbing
//Return our icon
return standing
//Returns the icon object that should be used for the worn icon
/obj/item/proc/get_worn_icon_file(var/body_type,var/slot_name,var/default_icon,var/inhands)
//1: icon_override var
if(icon_override)
return icon_override
//2: species-specific sprite sheets (skipped for inhands)
var/sheet = sprite_sheets[body_type]
if(sheet && !inhands)
return sheet
//3: slot-specific sprite sheets
sheet = item_icons[slot_name]
if(sheet)
return sheet
//4: item's default icon
if(default_worn_icon)
return default_worn_icon
//5: provided default_icon
if(default_icon)
return default_icon
//6: give up
return
//Returns the state that should be used for the worn icon
/obj/item/proc/get_worn_icon_state(var/slot_name)
//1: slot-specific sprite sheets
var/state = item_state_slots[slot_name]
if(state)
return state
//2: item_state variable
if(item_state)
return item_state
//3: icon_state variable
if(icon_state)
return icon_state
//Returns the layer that should be used for the worn icon (as a FLOAT_LAYER layer, so negative)
/obj/item/proc/get_worn_layer(var/default_layer = 0)
//1: worn_layer variable
if(!isnull(worn_layer)) //Can be zero, so...
return BODY_LAYER+worn_layer
//2: your default
return BODY_LAYER+default_layer
//Apply the addblend blends onto the icon
/obj/item/proc/apply_addblends(var/source_icon, var/icon/standing_icon)
//If we have addblends, blend them onto the provided icon
if(addblends && standing_icon && source_icon)
var/addblend_icon = icon("icon" = source_icon, "icon_state" = addblends)
standing_icon.Blend(addblend_icon, ICON_ADD)
//STUB
/obj/item/proc/apply_custom(var/icon/standing_icon)
return standing_icon
//STUB
/obj/item/proc/apply_blood(var/image/standing)
return standing
//STUB
/obj/item/proc/apply_accessories(var/image/standing)
return standing