Merge branch 'master' into fixes_compile

This commit is contained in:
alberyk
2022-02-04 14:22:38 -03:00
78 changed files with 1128 additions and 361 deletions
@@ -145,18 +145,14 @@
new /obj/item/clothing/glasses/sunglasses/sechud(src)
new /obj/item/clothing/glasses/sunglasses/sechud/head(src)
new /obj/item/shield/riot/tact(src)
new /obj/item/melee/baton/loaded(src)
new /obj/item/melee/telebaton(src)
new /obj/item/gun/energy/disruptorpistol(src)
new /obj/item/taperoll/police(src)
new /obj/item/device/flash(src)
new /obj/item/device/holowarrant(src)
new /obj/item/device/breath_analyzer(src)
new /obj/item/handcuffs(src)
new /obj/item/crowbar/red(src)
//Belts
new /obj/item/clothing/accessory/holster/waist(src)
new /obj/item/storage/belt/security(src)
new /obj/item/storage/belt/security/full(src)
new /obj/item/storage/box/fancy/keypouch/sec(src)
/obj/structure/closet/secure_closet/hos2
@@ -228,15 +224,11 @@
new /obj/item/clothing/glasses/sunglasses/sechud/aviator(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
new /obj/item/taperoll/police(src)
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/melee/baton/loaded(src)
new /obj/item/gun/energy/disruptorpistol(src)
new /obj/item/handcuffs(src)
new /obj/item/device/holowarrant(src)
//Belts
new /obj/item/clothing/accessory/storage/black_vest(src)
new /obj/item/clothing/accessory/holster/waist(src)
new /obj/item/storage/belt/security(src)
new /obj/item/storage/belt/security/full(src)
/obj/structure/closet/secure_closet/security_cadet
@@ -304,18 +296,13 @@
new /obj/item/clothing/glasses/sunglasses/sechud/aviator(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
new /obj/item/gun/energy/disruptorpistol/security(src)
new /obj/item/device/flash(src)
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/melee/baton/loaded(src)
new /obj/item/taperoll/police(src)
new /obj/item/device/hailer(src)
new /obj/item/device/holowarrant(src)
new /obj/item/device/flashlight/flare/glowstick/red(src)
new /obj/item/handcuffs(src)
//Belts
new /obj/item/clothing/accessory/storage/black_vest(src)
new /obj/item/clothing/accessory/holster/hip(src)
new /obj/item/storage/belt/security(src)
new /obj/item/storage/belt/security/full(src)
/obj/structure/closet/secure_closet/investigator
name = "investigator's locker"
+5 -1
View File
@@ -246,7 +246,7 @@
icon_state = "firstbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/attackby(var/obj/item/W as obj, var/mob/user as mob)
if(istype(W,/obj/item/material/scythe/sickle))
if(istype(W,/obj/item/material/scythe))
if(prob(50))
new /obj/item/stack/material/wood(get_turf(src), 2)
if(prob(40))
@@ -259,6 +259,10 @@
to_chat(usr, "<span class='notice'>You slice at the bush!</span>")
qdel(src)
playsound(src.loc, 'sound/effects/woodcutting.ogg', 50, 1)
if(istype(W,/obj/item/material/hatchet))//no items
to_chat(usr, SPAN_NOTICE("You chop at the bush!"))
qdel(src)
playsound(src.loc, 'sound/effects/woodcutting.ogg', 50, 1)
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
@@ -7,6 +7,14 @@
/*
* Beds
*/
#define CACHE_TYPE_PADDING "padding"
#define CACHE_TYPE_OVER "over"
#define CACHE_TYPE_PADDING_OVER "padding_over"
#define CACHE_TYPE_ARMREST "armrest"
#define CACHE_TYPE_PADDING_ARMREST "padding_armrest"
#define CACHE_TYPE_SPECIAL "special" // Currently being used for shuttle chair special buckles.
/obj/structure/bed
name = "bed"
desc = "This is used to lie in, sleep in or strap on."
@@ -32,7 +40,7 @@
gfi_layer_rotation = GFI_ROTATION_DEFDIR
var/makes_rolling_sound = FALSE
var/held_item = null // Set to null if you don't want people to pick this up.
var/held_item = null // Set to null if you don't want people to pick this up.
slowdown = 5
var/driving = FALSE // Shit for wheelchairs. Doesn't really get used here, but it's for code cleanliness.
@@ -68,33 +76,39 @@
// Reuse the cache/code from stools, todo maybe unify.
/obj/structure/bed/update_icon()
generate_strings()
// Prep icon.
icon_state = ""
cut_overlays()
// Base icon.
var/list/furniture_cache = SSicon_cache.furniture_cache
var/cache_key = "[base_icon]-[material.name]"
if(!furniture_cache[cache_key])
var/image/I = image('icons/obj/furniture.dmi', base_icon)
if(material_alteration & MATERIAL_ALTERATION_COLOR)
I.color = material.icon_colour
furniture_cache[cache_key] = I
add_overlay(furniture_cache[cache_key])
generate_overlay_cache(material) //Generate base icon cache
// Padding overlay.
if(padding_material)
var/padding_cache_key = "[base_icon]-[padding_material.name]-padding"
if(!furniture_cache[padding_cache_key] || painted_colour) //avoid having to regenerate the image everytime unless painted.
var/image/I = image(icon, "[base_icon]_padding")
if(material_alteration & MATERIAL_ALTERATION_COLOR)
if(painted_colour)
I.color = painted_colour
else
I.color = padding_material.icon_colour
furniture_cache[padding_cache_key] = I
add_overlay(furniture_cache[padding_cache_key])
generate_overlay_cache(padding_material, CACHE_TYPE_PADDING, apply_painted_colour = TRUE)
// Strings.
/obj/structure/bed/proc/generate_overlay_cache(var/new_material, var/cache_type, var/cache_layer = layer, var/apply_painted_colour = FALSE) // Cache type refers to what cache we're making. Material type refers if we're taking from the padding or the chair material itself.
var/material/overlay_material = new_material
var/list/furniture_cache = SSicon_cache.furniture_cache
var/cache_key = "[base_icon]-[overlay_material.name]" // Basically, generates a cache key for an overlay.
if(cache_type)
cache_key += "-[cache_type]"
if(painted_colour && apply_painted_colour)
cache_key += "-[painted_colour]"
else if(overlay_material.icon_colour)
cache_key += "-[overlay_material.icon_colour]"
if(!furniture_cache[cache_key]) // Check for cache key. Generate if image does not exist yet.
var/cache_icon_state = cache_type ? "[base_icon]_[cache_type]" : "[base_icon]" // Modularized. Just change cache_type when calling the proc if you ever wanted to add a different overlay. Not like you'd need to.
var/image/I = image(icon, cache_icon_state, layer = cache_layer) // Generate the icon.
if(material_alteration & MATERIAL_ALTERATION_COLOR)
if(painted_colour && apply_painted_colour) // apply_painted_color, when you only want the padding to be painted, NOT the chair itself.
I.color = painted_colour
else if(overlay_material.icon_colour) // Either that, or just fall back on the regular material color.
I.color = overlay_material.icon_colour
furniture_cache[cache_key] = I
add_overlay(furniture_cache[cache_key]) // Use image from cache key!
/obj/structure/bed/proc/generate_strings()
if(material_alteration & MATERIAL_ALTERATION_NAME)
name = padding_material ? "[padding_material.adjective_name] [initial(name)]" : "[material.adjective_name] [initial(name)]" //this is not perfect but it will do for now.
@@ -26,51 +26,15 @@
/obj/structure/bed/stool/chair/update_icon()
..() // This handles all chair-specific funky stuff, such as chair backrests, armrests, padding and buckles.
var/list/furniture_cache = SSicon_cache.furniture_cache
var/cache_key = "[base_icon]-[material.name]-over"
if(!furniture_cache[cache_key])
var/image/I = image('icons/obj/furniture.dmi', "[base_icon]_over")
if(material_alteration & MATERIAL_ALTERATION_COLOR)
I.color = material.icon_colour
I.layer = FLY_LAYER
furniture_cache[cache_key] = I
add_overlay(furniture_cache[cache_key])
generate_overlay_cache(material, CACHE_TYPE_OVER, FLY_LAYER) // Generate overlay for backrest
// Padding overlay.
if(padding_material)
var/padding_cache_key = "[base_icon]-[padding_material.name]-padding-over"
if(!furniture_cache[padding_cache_key])
var/image/I = image(icon, "[base_icon]_padding_over")
if(material_alteration & MATERIAL_ALTERATION_COLOR)
if(painted_colour)
I.color = painted_colour
else if(padding_material.icon_colour)
I.color = padding_material.icon_colour
I.layer = FLY_LAYER
furniture_cache[padding_cache_key] = I
add_overlay(furniture_cache[padding_cache_key])
generate_overlay_cache(padding_material, CACHE_TYPE_PADDING_OVER, FLY_LAYER, TRUE) // Generate padding overlay for backrest
if(buckled)
cache_key = "[base_icon]-[material.name]-armrest"
if(!furniture_cache[cache_key])
var/image/I = image(icon, "[base_icon]_armrest")
I.layer = FLY_LAYER
if(material_alteration & MATERIAL_ALTERATION_COLOR)
I.color = material.icon_colour
furniture_cache[cache_key] = I
add_overlay(furniture_cache[cache_key])
generate_overlay_cache(material, CACHE_TYPE_ARMREST, FLY_LAYER) // Generate armrests
if(padding_material)
cache_key = "[base_icon]-[padding_material.name]-padding-armrest"
if(!furniture_cache[cache_key])
var/image/I = image(icon, "[base_icon]_padding_armrest")
I.layer = FLY_LAYER
if(material_alteration & MATERIAL_ALTERATION_COLOR)
if(painted_colour)
I.color = painted_colour
else if(padding_material.icon_colour)
I.color = padding_material.icon_colour
furniture_cache[cache_key] = I
add_overlay(furniture_cache[cache_key])
generate_overlay_cache(padding_material, CACHE_TYPE_PADDING_ARMREST, FLY_LAYER, TRUE) // Generate padding overlay for armrest
/obj/structure/bed/stool/chair/set_dir()
. = ..()
@@ -90,7 +54,7 @@
if(mover.density && isliving(mover) && (reverse_dir[dir] & angle2dir(Get_Angle(src, mover))))
return FALSE
return ..()
/obj/structure/bed/stool/chair/padded/brown/New(var/newloc)
..(newloc, MATERIAL_STEEL, MATERIAL_LEATHER)
@@ -400,11 +364,7 @@
/obj/structure/bed/stool/chair/shuttle/update_icon()
..()
if(!buckled)
var/image/I = image(icon, "[base_icon]_special")
I.layer = ABOVE_MOB_LAYER
if(material_alteration & MATERIAL_ALTERATION_COLOR)
I.color = material.icon_colour
overlays |= I
generate_overlay_cache(material, CACHE_TYPE_SPECIAL, ABOVE_MOB_LAYER)
// pool chair, to sit with your feet in the water. only works when facing south, because water overlays weirdly otherwise
/obj/structure/bed/stool/chair/pool
@@ -457,6 +417,7 @@
item_state = "woodenchair"
base_icon = "wooden_chair"
origin_type = /obj/structure/bed/stool/chair/wood
applies_material_colour = FALSE
/obj/item/material/stool/chair/wood/wings
icon_state = "wooden_chair_wings_item"
@@ -155,7 +155,7 @@
..(newloc, MATERIAL_SHUTTLE_SKRELL)
set_light(1,1,LIGHT_COLOR_CYAN)
/obj/item/material/stool // Not intended to be spawned in. You will be sad. Thankfully will self-correct.
/obj/item/material/stool
icon = 'icons/obj/furniture.dmi'
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_chairs.dmi',
@@ -173,7 +173,6 @@
force_divisor = 0.4
w_class = ITEMSIZE_HUGE
use_material_name = FALSE
applies_material_colour = FALSE
var/material/padding_material
var/obj/structure/bed/stool/origin_type = /obj/structure/bed/stool
var/deploy_verb = "right"