This commit is contained in:
Ghommie
2020-05-05 05:09:29 +02:00
109 changed files with 1370 additions and 468 deletions
-8
View File
@@ -914,11 +914,3 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
. = ..()
if(var_name == NAMEOF(src, slowdown))
set_slowdown(var_value) //don't care if it's a duplicate edit as slowdown'll be set, do it anyways to force normal behavior.
//Called when the object is constructed by an autolathe
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A)
return
/obj/item/proc/rnd_crafted(obj/machinery/rnd/production/P)
return
+4 -5
View File
@@ -726,13 +726,12 @@
to_chat(usr, "<span class='warning'>A color that dark on an object like this? Surely not...</span>")
return FALSE
target.add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
if(istype(target, /obj/structure/window))
if(color_hex2num(paint_color) < 255)
target.set_opacity(255)
else
target.set_opacity(initial(target.opacity))
var/obj/structure/window/W = target
W.spraycan_paint(paint_color)
else
target.add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
. = use_charges(user, 2)
var/fraction = min(1, . / reagents.maximum_volume)
@@ -0,0 +1,14 @@
/obj/item/electronics/electrochromatic_kit
name = "electrochromatic kit"
desc = "A kit for upgrading a window into an electrochromatic one."
/// Electrochromatic ID
var/id
/obj/item/electronics/electrochromatic_kit/attack_self(mob/user)
. = ..()
if(.)
return
var/new_id = input(user, "Set this kit's electrochromatic ID", "Set ID", id) as text|null
if(isnull(new_id))
return
id = new_id
+2 -3
View File
@@ -68,10 +68,9 @@
update_icon()
/obj/item/multitool/update_icon_state()
icon_state = initial(icon_state)
if(selected_io)
icon_state = "multitool_red"
else
icon_state = "multitool"
icon_state += "_red"
/obj/item/multitool/proc/wire(var/datum/integrated_io/io, mob/user)
if(!io.holder.assembly)
+1 -1
View File
@@ -648,7 +648,7 @@
item_state = "mace_greyscale"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Material type changes the prefix as well as the color.
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS | MATERIAL_EFFECTS //Material type changes the prefix as well as the color.
custom_materials = list(/datum/material/iron = 12000) //Defaults to an Iron Mace.
slot_flags = ITEM_SLOT_BELT
force = 14
+1 -1
View File
@@ -112,7 +112,7 @@
. = ..()
if(!proximity)
return
if(!isturf(target) || !isobj(target))
if(!isturf(target) && !isobj(target))
return
if(target.color != initial(target.color))
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
+2
View File
@@ -107,6 +107,8 @@
return TRUE
/obj/item/shield/proc/user_shieldbash(mob/living/user, atom/target, harmful)
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)) //Combat mode has to be enabled for shield bashing
return FALSE
if(!(shield_flags & SHIELD_CAN_BASH))
to_chat(user, "<span class='warning'>[src] can't be used to shield bash!</span>")
return FALSE
@@ -109,7 +109,6 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
merge_type = /obj/item/stack/sheet/plasmaglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10)
tableVariant = /obj/structure/table/plasmaglass
material_flags = MATERIAL_NO_EFFECTS
shard_type = /obj/item/shard/plasma
/obj/item/stack/sheet/plasmaglass/fifty
@@ -209,7 +208,6 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \
custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron=MINERAL_MATERIAL_AMOUNT * 0.5,)
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
material_flags = MATERIAL_NO_EFFECTS
merge_type = /obj/item/stack/sheet/plasmarglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10, /datum/reagent/iron = 10)
point_value = 23
@@ -259,7 +257,6 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
item_state = "sheet-plastitaniumglass"
custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
material_flags = MATERIAL_NO_EFFECTS
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plastitaniumglass
shard_type = /obj/item/shard
@@ -324,7 +324,6 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \
custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
point_value = 45
merge_type = /obj/item/stack/sheet/mineral/plastitanium
material_flags = MATERIAL_NO_EFFECTS
/obj/item/stack/sheet/mineral/plastitanium/fifty
amount = 50
@@ -215,7 +215,6 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \
grind_results = list(/datum/reagent/iron = 20, /datum/reagent/toxin/plasma = 20)
point_value = 23
tableVariant = /obj/structure/table/reinforced
material_flags = MATERIAL_NO_EFFECTS
/obj/item/stack/sheet/plasteel/get_main_recipes()
. = ..()
@@ -78,4 +78,3 @@
turf_type = /turf/open/floor/mineral/plastitanium
mineralType = "plastitanium"
custom_materials = list(/datum/material/titanium=250, /datum/material/plasma=250)
material_flags = MATERIAL_NO_EFFECTS
+8
View File
@@ -315,3 +315,11 @@
current_skin = choice
icon_state = unique_reskin[choice]
to_chat(M, "[src] is now skinned as '[choice]'.")
//Called when the object is constructed by an autolathe
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
/obj/proc/autolathe_crafted(obj/machinery/autolathe/A)
return
/obj/proc/rnd_crafted(obj/machinery/rnd/production/P)
return
@@ -153,7 +153,7 @@
///Material chair
/obj/structure/chair/greyscale
icon_state = "chair_greyscale"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS | MATERIAL_EFFECTS
item_chair = /obj/item/chair/greyscale
buildstacktype = null //Custom mats handle this
@@ -382,7 +382,7 @@
/obj/item/chair/greyscale
icon_state = "chair_greyscale_toppled"
item_state = "chair_greyscale"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS | MATERIAL_EFFECTS
origin_type = /obj/structure/chair/greyscale
/obj/item/chair/stool
+66
View File
@@ -0,0 +1,66 @@
/*
* Loot piles structures, somewhat inspired from Polaris 13 ones but without the one search per pile ckey/mind restriction
* because the actual code is located its own element and has enough variables already. the piles themselves merely cosmetical.
*/
/obj/structure/loot_pile
name = "pile of junk"
desc = "Lots of junk lying around. They say one man's trash is another man's treasure."
icon = 'icons/obj/loot_piles.dmi'
icon_state = "randompile"
density = FALSE
anchored = TRUE
var/loot_amount = 5
var/delete_on_depletion = FALSE
var/can_use_hands = TRUE
var/scavenge_time = 12 SECONDS
var/allowed_tools = list(TOOL_SHOVEL = 0.6) //list of tool_behaviours with associated speed multipliers (lower is better)
var/icon_states_to_use = list("junk_pile1", "junk_pile2", "junk_pile3", "junk_pile4", "junk_pile5")
var/list/loot
/*
* Associated values in this list are not weights but numbers of times the kery can be rolled
* before being removed from ALL piles with same kind. This is why I wanted 'scavenging' to be an element and not a component.
*/
var/list/unique_loot
/*
* used for restrictions such as "one per mind", "one per ckey". Depending on the setting, these can be either limited to
* the current pile or shared throughout all atoms attached to this element.
*/
var/loot_restriction = NO_LOOT_RESTRICTION
var/maximum_loot_per_player = 1
/obj/structure/loot_pile/Initialize()
. = ..()
icon_state = pick(icon_states_to_use)
/obj/structure/loot_pile/ComponentInitialize()
. = ..()
if(loot)
AddElement(/datum/element/scavenging, loot_amount, loot, unique_loot, scavenge_time, can_use_hands, allowed_tools, null, delete_on_depletion, loot_restriction, maximum_loot_per_player)
//uses the maintenance_loot global list, mostly boring stuff and mices.
/obj/structure/loot_pile/maint
name = "trash pile"
desc = "A heap of garbage, but maybe there's something interesting inside?"
density = TRUE
layer = TABLE_LAYER
climbable = TRUE
pass_flags = LETPASSTHROW
loot = list(
SCAVENGING_FOUND_NOTHING = 50,
SCAVENGING_SPAWN_MOUSE = 10,
SCAVENGING_SPAWN_MICE = 5,
SCAVENGING_SPAWN_TOM = 1,
/obj/item/clothing/gloves/color/yellow = 0.5)
unique_loot = list(/obj/item/clothing/gloves/color/yellow = 5, SCAVENGING_SPAWN_TOM = 1)
/obj/structure/loot_pile/maint/ComponentInitialize()
var/static/safe_maint_items
if(!safe_maint_items)
safe_maint_items = list()
for(var/A in GLOB.maintenance_loot)
if(ispath(A, /obj/item))
safe_maint_items[A] = GLOB.maintenance_loot[A]
loot += safe_maint_items
return ..()
+1 -1
View File
@@ -211,7 +211,7 @@
/obj/structure/table/greyscale
icon = 'icons/obj/smooth_structures/table_greyscale.dmi'
icon_state = "table"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS | MATERIAL_EFFECTS
buildstack = null //No buildstack, so generate from mat datums
/*
+143 -3
View File
@@ -1,3 +1,18 @@
#define NOT_ELECTROCHROMATIC 0
#define ELECTROCHROMATIC_OFF 1
#define ELECTROCHROMATIC_DIMMED 2
GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
/proc/do_electrochromatic_toggle(new_status, id)
var/list/windows = GLOB.electrochromatic_window_lookup["[id]"]
if(!windows)
return
var/obj/structure/window/W //define outside for performance because obviously this matters.
for(var/i in windows)
W = i
new_status? W.electrochromatic_dim() : W.electrochromatic_off()
/obj/structure/window
name = "window"
desc = "A window."
@@ -28,8 +43,15 @@
rad_insulation = RAD_VERY_LIGHT_INSULATION
rad_flags = RAD_PROTECT_CONTENTS
/// Electrochromatic status
var/electrochromatic_status = NOT_ELECTROCHROMATIC
/// Electrochromatic ID. Set the first character to ! to replace with a SSmapping generated pseudorandom obfuscated ID for mapping purposes.
var/electrochromatic_id
/obj/structure/window/examine(mob/user)
. = ..()
if(electrochromatic_status != NOT_ELECTROCHROMATIC)
. += "<span class='notice'>The window has electrochromatic circuitry on it.</span>"
if(reinf)
if(anchored && state == WINDOW_SCREWED_TO_FRAME)
. += "<span class='notice'>The window is <b>screwed</b> to the frame.</span>"
@@ -52,6 +74,10 @@
if(reinf && anchored)
state = WINDOW_SCREWED_TO_FRAME
if(mapload && electrochromatic_id)
if(copytext(electrochromatic_id, 1, 2) == "!")
electrochromatic_id = SSmapping.get_obfuscated_id(electrochromatic_id)
ini_dir = dir
air_update_turf(1)
@@ -62,6 +88,12 @@
real_explosion_block = explosion_block
explosion_block = EXPLOSION_BLOCK_PROC
if(electrochromatic_status != NOT_ELECTROCHROMATIC)
var/old = electrochromatic_status
make_electrochromatic()
if(old == ELECTROCHROMATIC_DIMMED)
electrochromatic_dim()
/obj/structure/window/ComponentInitialize()
. = ..()
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS ,null,CALLBACK(src, .proc/can_be_rotated),CALLBACK(src,.proc/after_rotation))
@@ -177,6 +209,24 @@
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
if(istype(I, /obj/item/electronics/electrochromatic_kit) && user.a_intent == INTENT_HELP)
var/obj/item/electronics/electrochromatic_kit/K = I
if(electrochromatic_status != NOT_ELECTROCHROMATIC)
to_chat(user, "<span class='warning'>[src] is already electrochromatic!</span>")
return
if(anchored)
to_chat(user, "<span class='warning'>[src] must not be attached to the floor!</span>")
return
if(!K.id)
to_chat(user, "<span class='warning'>[K] has no ID set!</span>")
return
if(!user.temporarilyRemoveItemFromInventory(K))
to_chat(user, "<span class='warning'>[K] is stuck to your hand!</span>")
return
user.visible_message("<span class='notice'>[user] upgrades [src] with [I].</span>", "<span class='notice'>You upgrade [src] with [I].</span>")
make_electrochromatic(K.id)
qdel(K)
if(!(flags_1&NODECONSTRUCT_1))
if(istype(I, /obj/item/screwdriver))
I.play_tool_sound(src, 75)
@@ -224,6 +274,91 @@
air_update_turf(TRUE)
update_nearby_icons()
/obj/structure/window/proc/spraycan_paint(paint_color)
if(color_hex2num(paint_color) < 255)
set_opacity(255)
else
set_opacity(initial(opacity))
add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
/obj/structure/window/proc/electrochromatic_dim()
if(electrochromatic_status == ELECTROCHROMATIC_DIMMED)
return
electrochromatic_status = ELECTROCHROMATIC_DIMMED
animate(src, color = "#222222", time = 2)
set_opacity(TRUE)
/obj/structure/window/proc/electrochromatic_off()
if(electrochromatic_status == ELECTROCHROMATIC_OFF)
return
electrochromatic_status = ELECTROCHROMATIC_OFF
var/current = color
update_atom_colour()
var/newcolor = color
color = current
animate(src, color = newcolor, time = 2)
/obj/structure/window/proc/remove_electrochromatic()
electrochromatic_off()
electrochromatic_status = NOT_ELECTROCHROMATIC
if(!electrochromatic_id)
return
var/list/L = GLOB.electrochromatic_window_lookup["[electrochromatic_id]"]
if(L)
L -= src
electrochromatic_id = null
/obj/structure/window/vv_edit_var(var_name, var_value)
var/check_status
if(var_name == NAMEOF(src, electrochromatic_id))
if(electrochromatic_id && GLOB.electrochromatic_window_lookup["[electrochromatic_id]"])
GLOB.electrochromatic_window_lookup[electrochromatic_id] -= src
if(var_name == NAMEOF(src, electrochromatic_status))
check_status = TRUE
. = ..() //do this first incase it runtimes.
if(var_name == NAMEOF(src, electrochromatic_id))
if((electrochromatic_status != NOT_ELECTROCHROMATIC) && electrochromatic_id)
LAZYINITLIST(GLOB.electrochromatic_window_lookup[electrochromatic_id])
GLOB.electrochromatic_window_lookup[electrochromatic_id] += src
if(check_status)
if(electrochromatic_status == NOT_ELECTROCHROMATIC)
remove_electrochromatic()
return
else if(electrochromatic_status == ELECTROCHROMATIC_OFF)
if(!electrochromatic_id)
return
else
make_electrochromatic()
electrochromatic_off()
return
else if(electrochromatic_status == ELECTROCHROMATIC_DIMMED)
if(!electrochromatic_id)
return
else
make_electrochromatic()
electrochromatic_dim()
return
else
remove_electrochromatic()
/obj/structure/window/proc/make_electrochromatic(new_id = electrochromatic_id)
remove_electrochromatic()
if(!new_id)
CRASH("Attempted to make electrochromatic with null ID.")
electrochromatic_id = new_id
electrochromatic_status = ELECTROCHROMATIC_OFF
LAZYINITLIST(GLOB.electrochromatic_window_lookup["[electrochromatic_id]"])
GLOB.electrochromatic_window_lookup[electrochromatic_id] |= src
/obj/structure/window/update_atom_colour()
if((electrochromatic_status != ELECTROCHROMATIC_OFF) && (electrochromatic_status != ELECTROCHROMATIC_DIMMED))
return FALSE
. = ..()
if(color && (color_hex2num(color) < 255))
set_opacity(255)
else
set_opacity(FALSE)
/obj/structure/window/proc/check_state(checked_state)
if(state == checked_state)
return TRUE
@@ -263,7 +398,6 @@
if(BURN)
playsound(src, 'sound/items/Welder.ogg', 100, 1)
/obj/structure/window/deconstruct(disassembled = TRUE)
if(QDELETED(src))
return
@@ -272,6 +406,9 @@
if(!(flags_1 & NODECONSTRUCT_1))
for(var/obj/item/shard/debris in spawnDebris(drop_location()))
transfer_fingerprints_to(debris) // transfer fingerprints to shards only
if(electrochromatic_status != NOT_ELECTROCHROMATIC) //eh fine keep your kit.
new /obj/item/electronics/electrochromatic_kit(drop_location())
// Intentionally not setting the ID so you can't decon one to know all of the IDs.
qdel(src)
update_nearby_icons()
@@ -315,9 +452,9 @@
density = FALSE
air_update_turf(1)
update_nearby_icons()
remove_electrochromatic()
return ..()
/obj/structure/window/Move()
var/turf/T = loc
. = ..()
@@ -731,7 +868,6 @@
set_opacity(TRUE)
queue_smooth(src)
/obj/structure/window/paperframe/attackby(obj/item/W, mob/user)
if(W.get_temperature())
fire_act(W.get_temperature())
@@ -749,3 +885,7 @@
return
..()
update_icon()
#undef NOT_ELECTROCHROMATIC
#undef ELECTROCHROMATIC_OFF
#undef ELECTROCHROMATIC_DIMMED