Merge branch 'master' into 91-files-changed-fml
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
move_resist = INFINITY
|
||||
obj_flags = 0
|
||||
|
||||
vis_flags = NONE
|
||||
vis_flags = VIS_INHERIT_PLANE
|
||||
|
||||
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
return
|
||||
|
||||
@@ -49,5 +49,6 @@
|
||||
/obj/effect/overlay/vis
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
anchored = TRUE
|
||||
vis_flags = NONE
|
||||
var/unused = 0 //When detected to be unused it gets set to world.time, after a while it gets removed
|
||||
var/cache_expiration = 2 MINUTES // overlays which go unused for 2 minutes get cleaned up
|
||||
|
||||
@@ -434,11 +434,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
// for items that can be placed in multiple slots
|
||||
// note this isn't called during the initial dressing of a player
|
||||
/obj/item/proc/equipped(mob/user, slot)
|
||||
SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
|
||||
A.Grant(user)
|
||||
. = SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot)
|
||||
if(!(. & COMPONENT_NO_GRANT_ACTIONS))
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
|
||||
A.Grant(user)
|
||||
item_flags |= IN_INVENTORY
|
||||
user.update_equipment_speed_mods()
|
||||
|
||||
|
||||
@@ -258,6 +258,8 @@ update_label("John Doe", "Clowny")
|
||||
chameleon_action.chameleon_type = /obj/item/card/id
|
||||
chameleon_action.chameleon_name = "ID Card"
|
||||
chameleon_action.initialize_disguises()
|
||||
if(!anyone)
|
||||
AddComponent(/datum/component/identification/syndicate, ID_COMPONENT_DEL_ON_IDENTIFY, ID_COMPONENT_EFFECT_NO_ACTIONS, NONE) //no deconstructive analyzer usage.
|
||||
|
||||
/obj/item/card/id/syndicate/afterattack(obj/item/O, mob/user, proximity)
|
||||
if(!proximity)
|
||||
|
||||
@@ -1054,9 +1054,9 @@
|
||||
build_path = /obj/machinery/vending/kink
|
||||
req_components = list(/obj/item/vending_refill/kink = 1)
|
||||
|
||||
/obj/item/circuitboard/machine/autoylathe
|
||||
/obj/item/circuitboard/machine/autolathe/toy
|
||||
name = "Autoylathe (Machine Board)"
|
||||
build_path = /obj/machinery/autoylathe
|
||||
build_path = /obj/machinery/autolathe/toy
|
||||
req_components = list(
|
||||
/obj/item/stock_parts/matter_bin = 3,
|
||||
/obj/item/stock_parts/manipulator = 1,
|
||||
|
||||
@@ -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)
|
||||
|
||||
14
code/game/objects/items/devices/electrochromatic_kit.dm
Normal file
14
code/game/objects/items/devices/electrochromatic_kit.dm
Normal file
@@ -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
|
||||
@@ -294,18 +294,18 @@
|
||||
name = "chameleon kit"
|
||||
|
||||
/obj/item/storage/box/syndie_kit/chameleon/PopulateContents()
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/clothing/suit/chameleon(src)
|
||||
new /obj/item/clothing/gloves/chameleon(src)
|
||||
new /obj/item/clothing/shoes/chameleon(src)
|
||||
new /obj/item/clothing/glasses/chameleon(src)
|
||||
new /obj/item/clothing/head/chameleon(src)
|
||||
new /obj/item/clothing/mask/chameleon(src)
|
||||
new /obj/item/storage/backpack/chameleon(src)
|
||||
new /obj/item/radio/headset/chameleon(src)
|
||||
new /obj/item/stamp/chameleon(src)
|
||||
new /obj/item/pda/chameleon(src)
|
||||
new /obj/item/clothing/neck/cloak/chameleon(src)
|
||||
new /obj/item/clothing/under/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/suit/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/gloves/chameleon/insulated/syndicate(src)
|
||||
new /obj/item/clothing/shoes/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/glasses/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/head/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/mask/chameleon/syndicate(src)
|
||||
new /obj/item/storage/backpack/chameleon/syndicate(src)
|
||||
new /obj/item/radio/headset/chameleon/syndicate(src)
|
||||
new /obj/item/stamp/chameleon/syndicate(src)
|
||||
new /obj/item/pda/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/neck/cloak/chameleon/syndicate(src)
|
||||
|
||||
//5*(2*4) = 5*8 = 45, 45 damage if you hit one person with all 5 stars.
|
||||
//Not counting the damage it will do while embedded (2*4 = 8, at 15% chance)
|
||||
@@ -510,4 +510,4 @@
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/storage/fancy/cigarettes/cigpack_syndicate(src)
|
||||
new /obj/item/lighter(src)
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
speech_span = SPAN_ROBOT
|
||||
vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of obj in openspace.
|
||||
var/obj_flags = CAN_BE_HIT
|
||||
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
|
||||
|
||||
|
||||
66
code/game/objects/structures/loot_pile.dm
Normal file
66
code/game/objects/structures/loot_pile.dm
Normal 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,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
|
||||
|
||||
Reference in New Issue
Block a user