Merge branch 'master' into 91-files-changed-fml
This commit is contained in:
@@ -1,95 +0,0 @@
|
||||
/datum/component/archaeology
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
var/list/archdrops = list(/obj/item/bikehorn = list(ARCH_PROB = 100, ARCH_MAXDROP = 1)) // honk~
|
||||
var/prob2drop
|
||||
var/dug
|
||||
var/datum/callback/callback
|
||||
|
||||
/datum/component/archaeology/Initialize(list/_archdrops = list(), datum/callback/_callback)
|
||||
archdrops = _archdrops
|
||||
for(var/i in archdrops)
|
||||
if(isnull(archdrops[i][ARCH_MAXDROP]))
|
||||
archdrops[i][ARCH_MAXDROP] = 1
|
||||
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null max_drop value in [i].")
|
||||
if(isnull(archdrops[i][ARCH_PROB]))
|
||||
archdrops[i][ARCH_PROB] = 100
|
||||
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null probability value in [i].")
|
||||
callback = _callback
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY,.proc/Dig)
|
||||
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/BombDig)
|
||||
RegisterSignal(parent, COMSIG_ATOM_SING_PULL, .proc/SingDig)
|
||||
|
||||
/datum/component/archaeology/InheritComponent(datum/component/archaeology/A, i_am_original)
|
||||
var/list/other_archdrops = A.archdrops
|
||||
var/list/_archdrops = archdrops
|
||||
for(var/I in other_archdrops)
|
||||
_archdrops[I] += other_archdrops[I]
|
||||
|
||||
/datum/component/archaeology/proc/Dig(datum/source, obj/item/I, mob/living/user)
|
||||
if(dug)
|
||||
to_chat(user, "<span class='notice'>Looks like someone has dug here already.</span>")
|
||||
return
|
||||
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
|
||||
if(I.tool_behaviour == TOOL_SHOVEL || I.tool_behaviour == TOOL_MINING)
|
||||
to_chat(user, "<span class='notice'>You start digging...</span>")
|
||||
|
||||
if(I.use_tool(parent, user, 40, volume=50))
|
||||
to_chat(user, "<span class='notice'>You dig a hole.</span>")
|
||||
gets_dug()
|
||||
dug = TRUE
|
||||
SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type)
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
/datum/component/archaeology/proc/gets_dug()
|
||||
if(dug)
|
||||
return
|
||||
else
|
||||
var/turf/open/OT = get_turf(parent)
|
||||
for(var/thing in archdrops)
|
||||
var/maxtodrop = archdrops[thing][ARCH_MAXDROP]
|
||||
for(var/i in 1 to maxtodrop)
|
||||
if(prob(archdrops[thing][ARCH_PROB])) // can't win them all!
|
||||
new thing(OT)
|
||||
|
||||
if(isopenturf(OT))
|
||||
if(OT.postdig_icon_change)
|
||||
if(istype(OT, /turf/open/floor/plating/asteroid/) && !OT.postdig_icon)
|
||||
var/turf/open/floor/plating/asteroid/AOT = parent
|
||||
AOT.icon_plating = "[AOT.environment_type]_dug"
|
||||
AOT.icon_state = "[AOT.environment_type]_dug"
|
||||
else
|
||||
if(isplatingturf(OT))
|
||||
var/turf/open/floor/plating/POT = parent
|
||||
POT.icon_plating = "[POT.postdig_icon]"
|
||||
POT.icon_state = "[OT.postdig_icon]"
|
||||
|
||||
if(OT.slowdown) //Things like snow slow you down until you dig them.
|
||||
OT.slowdown = 0
|
||||
dug = TRUE
|
||||
if(callback)
|
||||
callback.Invoke()
|
||||
|
||||
/datum/component/archaeology/proc/SingDig(datum/source, S, current_size)
|
||||
switch(current_size)
|
||||
if(STAGE_THREE)
|
||||
if(prob(30))
|
||||
gets_dug()
|
||||
if(STAGE_FOUR)
|
||||
if(prob(50))
|
||||
gets_dug()
|
||||
else
|
||||
if(current_size >= STAGE_FIVE && prob(70))
|
||||
gets_dug()
|
||||
|
||||
/datum/component/archaeology/proc/BombDig(datum/source, severity, target)
|
||||
switch(severity)
|
||||
if(3)
|
||||
return
|
||||
if(2)
|
||||
if(prob(20))
|
||||
gets_dug()
|
||||
if(1)
|
||||
gets_dug()
|
||||
@@ -260,6 +260,15 @@
|
||||
subcategory = CAT_TOOL
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/electrochromatic_kit
|
||||
name = "Electrochromatic Kit"
|
||||
result = /obj/item/electronics/electrochromatic_kit
|
||||
reqs = list(/obj/item/stack/sheet/metal = 1,
|
||||
/obj/item/stack/cable_coil = 1)
|
||||
time = 5
|
||||
subcategory = CAT_TOOL
|
||||
category = CAT_MISC
|
||||
|
||||
////////////
|
||||
//Vehicles//
|
||||
////////////
|
||||
|
||||
88
code/datums/components/identification.dm
Normal file
88
code/datums/components/identification.dm
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Identification components
|
||||
*/
|
||||
/datum/component/identification
|
||||
/// General flags for how we should work.
|
||||
var/identification_flags = NONE
|
||||
/// General flags for what we should do.
|
||||
var/identification_effect_flags = NONE
|
||||
/// General flags for how we can be identified.
|
||||
var/identification_method_flags = NONE
|
||||
/// If this is set, show this on examine to the examiner if they know how to use it.
|
||||
var/additional_examine_text = "<span class='notice'>You seem to know more about this item than others..</span>"
|
||||
/// Added to deconstructive analyzer say on success if set
|
||||
var/deconstructor_reveal_text = "item operation instructions"
|
||||
|
||||
/datum/component/identification/Initialize(id_flags, id_effect_flags, id_method_flags)
|
||||
if(!isobj(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
. = ..()
|
||||
if(. & COMPONENT_INCOMPATIBLE)
|
||||
return
|
||||
identification_flags = id_flags
|
||||
identification_effect_flags = id_effect_flags
|
||||
identification_method_flags = id_method_flags
|
||||
|
||||
/datum/component/identification/RegisterWithParent()
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
||||
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
|
||||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
|
||||
if(identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR)
|
||||
RegisterSignal(parent, COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN, .proc/on_deconstructor_deepscan)
|
||||
|
||||
/datum/component/identification/UnregisterFromParent()
|
||||
var/list/unregister = list(COMSIG_PARENT_EXAMINE)
|
||||
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
|
||||
unregister += COMSIG_ITEM_EQUIPPED
|
||||
if(identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR)
|
||||
unregister += COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN
|
||||
UnregisterSignal(parent, unregister)
|
||||
|
||||
/datum/component/identification/proc/on_examine(datum/source, mob/user, list/returnlist)
|
||||
if(check_knowledge(user) != ID_COMPONENT_KNOWLEDGE_FULL)
|
||||
return
|
||||
if(!additional_examine_text)
|
||||
return
|
||||
returnlist += additional_examine_text
|
||||
|
||||
/datum/component/identification/vv_edit_var(var_name, var_value)
|
||||
// since i care SOOO much about memory optimization, we only register signals we need to
|
||||
// so when someone vv's us, we should probably make sure we have the ones we need to with an update.
|
||||
if((var_value == NAMEOF(src, identification_flags)) || (var_value == NAMEOF(src, identification_effect_flags)) || (var_value == NAMEOF(src, identification_method_flags)))
|
||||
UnregisterFromParent()
|
||||
. = ..()
|
||||
if((var_value == NAMEOF(src, identification_flags)) || (var_value == NAMEOF(src, identification_effect_flags)) || (var_value == NAMEOF(src, identification_method_flags)))
|
||||
RegisterWithParent()
|
||||
|
||||
/datum/component/identification/proc/on_equip(datum/source, mob/user)
|
||||
if(check_knowledge(user) == ID_COMPONENT_KNOWLEDGE_FULL)
|
||||
return
|
||||
if(identification_method_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
|
||||
return COMPONENT_NO_GRANT_ACTIONS
|
||||
|
||||
/datum/component/identification/proc/check_knowledge(mob/user)
|
||||
return ID_COMPONENT_KNOWLEDGE_NONE
|
||||
|
||||
/datum/component/identification/proc/on_identify(mob/user)
|
||||
if(identification_flags & ID_COMPONENT_DEL_ON_IDENTIFY)
|
||||
qdel(src)
|
||||
|
||||
/datum/component/identification/proc/on_deconstructor_deepscan(datum/source, obj/machinery/rnd/destructive_analyzer/analyzer, mob/user, list/information = list())
|
||||
if((identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR) && !(identification_flags & ID_COMPONENT_DECONSTRUCTOR_DEEPSCANNED))
|
||||
identification_flags |= ID_COMPONENT_DECONSTRUCTOR_DEEPSCANNED
|
||||
on_identify(user)
|
||||
if(deconstructor_reveal_text)
|
||||
information += deconstructor_reveal_text
|
||||
return COMPONENT_DEEPSCAN_UNCOVERED_INFORMATION
|
||||
|
||||
/**
|
||||
* Identification component subtype - Syndicate
|
||||
*
|
||||
* Checks if the user is a traitor.
|
||||
*/
|
||||
/datum/component/identification/syndicate
|
||||
|
||||
/datum/component/identification/syndicate/check_knowledge(mob/user)
|
||||
. = ..()
|
||||
if(user?.mind?.has_antag_datum(/datum/antagonist/traitor))
|
||||
. = max(., ID_COMPONENT_KNOWLEDGE_FULL)
|
||||
Reference in New Issue
Block a user