Merge pull request #12677 from Ghommie/Ghommie-cit830

Fixes items' skills list keys missing associated traits and improves modulability a little.
This commit is contained in:
silicons
2020-07-04 00:12:37 -07:00
committed by GitHub
13 changed files with 39 additions and 25 deletions
+8 -2
View File
@@ -180,6 +180,11 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
if(damtype == "brute")
hitsound = "swing_hit"
if(used_skills)
for(var/path in used_skills)
var/datum/skill/S = GLOB.skill_datums[path]
LAZYADD(used_skills[path], S.skill_traits)
/obj/item/Destroy()
item_flags &= ~DROPDEL //prevent reqdels
if(ismob(loc))
@@ -848,7 +853,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
// Called when a mob tries to use the item as a tool.
// Handles most checks.
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks, skill_gain_mult = 1, max_level = INFINITY)
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks, skill_gain_mult = STD_USE_TOOL_MULT)
// No delay means there is no start message, and no reason to call tool_start_check before use_tool.
// Run the start check here so we wouldn't have to call it manually.
if(!delay && !tool_start_check(user, amount))
@@ -893,7 +898,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
for(var/skill in used_skills)
if(!(SKILL_TRAINING_TOOL in used_skills[skill]))
continue
user.mind.auto_gain_experience(skill, gain*skill_gain_mult, GET_STANDARD_LVL(max_level))
var/datum/skill/S = GLOB.skill_datums[skill]
user.mind.auto_gain_experience(skill, gain*skill_gain_mult*S.item_skill_gain_multi)
return TRUE