diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index fa16c3fa834..a43c78643a0 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -284,7 +284,9 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( /obj/machinery/computer/arcade/battle/Topic(href, href_list) if(..()) return - var/gamerSkill = usr.mind?.get_skill_level(/datum/skill/gaming) + var/gamerSkill = 0 + if(usr?.mind) + gamerSkill = usr.mind.get_skill_level(/datum/skill/gaming) if (!blocked && !gameover) var/attackamt = rand(5,7) + rand(0, gamerSkill) @@ -614,7 +616,9 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( temp = "

If you die in the game, you die for real!

" max_passive = 6 bomb_cooldown = 18 - var/gamerSkill = usr.mind?.get_skill_level(/datum/skill/gaming) + var/gamerSkill = 0 + if(usr?.mind) + gamerSkill = usr.mind.get_skill_level(/datum/skill/gaming) enemy_setup(gamerSkill) enemy_hp += 100 //extra HP just to make cuban pete even more bullshit player_hp += 30 //the player will also get a few extra HP in order to have a fucking chance @@ -858,9 +862,16 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( return busy = TRUE - var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming) - var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_PROBS_MODIFIER) - var/gamerSkillRands = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) + var/gamerSkillLevel = 0 + var/gamerSkill = 0 + var/gamerSkillRands = 0 + + if(usr?.mind) + gamerSkillLevel = usr.mind.get_skill_level(/datum/skill/gaming) + gamerSkill = usr.mind.get_skill_modifier(/datum/skill/gaming, SKILL_PROBS_MODIFIER) + gamerSkillRands = usr.mind.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) + + var/xp_gained = 0 if (href_list["continue"]) //Continue your travels if(gameStatus == ORION_STATUS_NORMAL && !event && turns != 7) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 66fd960e582..05c1f9a114e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -820,7 +820,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb closeToolTip(usr) -/// Called when a mob tries to use the item as a tool.Handles most checks. +/// 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) // 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. @@ -830,11 +830,11 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb var/skill_modifier = 1 if(tool_behaviour == TOOL_MINING && ishuman(user)) - var/mob/living/carbon/human/H = user - skill_modifier = H.mind.get_skill_modifier(/datum/skill/mining, SKILL_SPEED_MODIFIER) + if(user.mind) + skill_modifier = user.mind.get_skill_modifier(/datum/skill/mining, SKILL_SPEED_MODIFIER) - if(H.mind.get_skill_level(/datum/skill/mining) >= SKILL_LEVEL_JOURNEYMAN && prob(H.mind.get_skill_modifier(/datum/skill/mining, SKILL_PROBS_MODIFIER))) // we check if the skill level is greater than Journeyman and then we check for the probality for that specific level. - mineral_scan_pulse(get_turf(H), SKILL_LEVEL_JOURNEYMAN - 2) //SKILL_LEVEL_JOURNEYMAN = 3 So to get range of 1+ we have to subtract 2 from it,. + if(user.mind.get_skill_level(/datum/skill/mining) >= SKILL_LEVEL_JOURNEYMAN && prob(user.mind.get_skill_modifier(/datum/skill/mining, SKILL_PROBS_MODIFIER))) // we check if the skill level is greater than Journeyman and then we check for the probality for that specific level. + mineral_scan_pulse(get_turf(user), SKILL_LEVEL_JOURNEYMAN - 2) //SKILL_LEVEL_JOURNEYMAN = 3 So to get range of 1+ we have to subtract 2 from it,. delay *= toolspeed * skill_modifier diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm index 944464f1b34..d4a188f29cb 100644 --- a/code/game/objects/items/clown_items.dm +++ b/code/game/objects/items/clown_items.dm @@ -97,8 +97,17 @@ new /obj/effect/particle_effect/foam(loc) return (TOXLOSS) +/** + * Decrease the number of uses the bar of soap has. + * + * The higher the cleaning skill, the less likely the soap will lose a use. + * Arguments + * * user - The mob that is using the soap to clean. + */ /obj/item/soap/proc/decreaseUses(mob/user) - var/skillcheck = user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER) + var/skillcheck = 1 + if(user?.mind) + skillcheck = user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER) if(prob(skillcheck*100)) //higher level = more uses assuming RNG is nice uses-- if(uses <= 0) @@ -109,7 +118,9 @@ . = ..() if(!proximity || !check_allowed_items(target)) return - var/clean_speedies = cleanspeed * min(user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER)+0.1,1) //less scaling for soapies + var/clean_speedies = 1 * cleanspeed + if(user.mind) + clean_speedies = cleanspeed * min(user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER)+0.1,1) //less scaling for soapies //I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing. //So this is a workaround. This also makes more sense from an IC standpoint. ~Carn if(user.client && ((target in user.client.screen) && !user.is_holding(target))) @@ -119,17 +130,17 @@ if(do_after(user, clean_speedies, target = target)) to_chat(user, "You scrub \the [target.name] out.") var/obj/effect/decal/cleanable/cleanies = target - user?.mind.adjust_experience(/datum/skill/cleaning, max(round(cleanies.beauty/CLEAN_SKILL_BEAUTY_ADJUSTMENT),0)) //again, intentional that this does NOT round but mops do. + user.mind?.adjust_experience(/datum/skill/cleaning, max(round(cleanies.beauty/CLEAN_SKILL_BEAUTY_ADJUSTMENT),0)) //again, intentional that this does NOT round but mops do. qdel(target) decreaseUses(user) else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH) - var/mob/living/carbon/human/H = user + var/mob/living/carbon/human/human_user = user user.visible_message("\the [user] washes \the [target]'s mouth out with [src.name]!", "You wash \the [target]'s mouth out with [src.name]!") //washes mouth out with soap sounds better than 'the soap' here if(user.zone_selected == "mouth") - if(H.lip_style) - user?.mind.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP) - H.lip_style = null //removes lipstick - H.update_body() + if(human_user.lip_style) + user.mind?.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP) + human_user.lip_style = null //removes lipstick + human_user.update_body() decreaseUses(user) return else if(istype(target, /obj/structure/window)) @@ -138,7 +149,7 @@ to_chat(user, "You clean \the [target.name].") target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) target.set_opacity(initial(target.opacity)) - user?.mind.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP) + user.mind?.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP) decreaseUses(user) else user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") @@ -146,10 +157,10 @@ to_chat(user, "You clean \the [target.name].") if(user && isturf(target)) for(var/obj/effect/decal/cleanable/cleanable_decal in target) - user.mind.adjust_experience(/datum/skill/cleaning, round(cleanable_decal.beauty / CLEAN_SKILL_BEAUTY_ADJUSTMENT)) + user.mind?.adjust_experience(/datum/skill/cleaning, round(cleanable_decal.beauty / CLEAN_SKILL_BEAUTY_ADJUSTMENT)) target.wash(CLEAN_SCRUB) target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - user?.mind.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP) + user.mind?.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP) decreaseUses(user) return diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 2f2418150d4..6ca39975765 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -363,28 +363,29 @@ GLOBAL_LIST_EMPTY(PDAs) dat += "Thank you for choosing ExperTrak® brand software! ExperTrak® inc. is proud to be a NanoTrasen employee expertise and effectiveness department subsidary!" dat += "

This software is designed to track and monitor your skill development as a NanoTrasen employee. Your job performance across different fields has been quantified and categorized below.
" var/datum/mind/targetmind = user.mind - for (var/type in GLOB.skill_types) - var/datum/skill/S = GetSkillRef(type) - var/lvl_num = targetmind.get_skill_level(type) - var/lvl_name = uppertext(targetmind.get_skill_level_name(type)) - var/exp = targetmind.get_skill_exp(type) - var/xp_prog_to_level = targetmind.exp_needed_to_level_up(type) - var/xp_req_to_level = 0 - if (xp_prog_to_level)//is it even possible to level up? - xp_req_to_level = SKILL_EXP_LIST[lvl_num+1] - SKILL_EXP_LIST[lvl_num] - dat += "
[S.name]" - dat += "
[S.desc]" - dat += "
  • EMPLOYEE SKILL LEVEL: [lvl_name]" - if (exp && xp_req_to_level) - var/progress_percent = (xp_req_to_level-xp_prog_to_level)/xp_req_to_level - var/overall_percent = exp / SKILL_EXP_LIST[length(SKILL_EXP_LIST)] - dat += "
    PROGRESS TO NEXT SKILL LEVEL:" - dat += "
    " + num2loadingbar(progress_percent) + "([progress_percent*100])%" - dat += "
    OVERALL DEVELOPMENT PROGRESS:" - dat += "
    " + num2loadingbar(overall_percent) + "([overall_percent*100])%" - if (lvl_num >= length(SKILL_EXP_LIST) && !(type in targetmind.skills_rewarded)) - dat += "
    Contact the Professional [S.title] Association" - dat += "
" + if(targetmind) + for (var/type in GLOB.skill_types) + var/datum/skill/S = GetSkillRef(type) + var/lvl_num = targetmind.get_skill_level(type) + var/lvl_name = uppertext(targetmind.get_skill_level_name(type)) + var/exp = targetmind.get_skill_exp(type) + var/xp_prog_to_level = targetmind.exp_needed_to_level_up(type) + var/xp_req_to_level = 0 + if (xp_prog_to_level)//is it even possible to level up? + xp_req_to_level = SKILL_EXP_LIST[lvl_num+1] - SKILL_EXP_LIST[lvl_num] + dat += "
[S.name]" + dat += "
[S.desc]" + dat += "
  • EMPLOYEE SKILL LEVEL: [lvl_name]" + if (exp && xp_req_to_level) + var/progress_percent = (xp_req_to_level-xp_prog_to_level)/xp_req_to_level + var/overall_percent = exp / SKILL_EXP_LIST[length(SKILL_EXP_LIST)] + dat += "
    PROGRESS TO NEXT SKILL LEVEL:" + dat += "
    " + num2loadingbar(progress_percent) + "([progress_percent*100])%" + dat += "
    OVERALL DEVELOPMENT PROGRESS:" + dat += "
    " + num2loadingbar(overall_percent) + "([overall_percent*100])%" + if (lvl_num >= length(SKILL_EXP_LIST) && !(type in targetmind.skills_rewarded)) + dat += "
    Contact the Professional [S.title] Association" + dat += "
" if(21) dat += "

[PDAIMG(mail)] SpaceMessenger V3.9.6

" dat += "[PDAIMG(blank)]Clear Messages" diff --git a/code/game/objects/items/mop.dm b/code/game/objects/items/mop.dm index 9b28a867703..f2ea96d0c36 100644 --- a/code/game/objects/items/mop.dm +++ b/code/game/objects/items/mop.dm @@ -26,8 +26,13 @@ /obj/item/mop/proc/clean(turf/A, mob/living/cleaner) if(reagents.has_reagent(/datum/reagent/water, 1) || reagents.has_reagent(/datum/reagent/water/holywater, 1) || reagents.has_reagent(/datum/reagent/consumable/ethanol/vodka, 1) || reagents.has_reagent(/datum/reagent/space_cleaner, 1)) - for(var/obj/effect/decal/cleanable/cleanable_decal in A) - cleaner?.mind.adjust_experience(/datum/skill/cleaning, max(round(cleanable_decal.beauty / CLEAN_SKILL_BEAUTY_ADJUSTMENT, 1), 0)) //it is intentional that the mop rounds xp but soap does not, USE THE SACRED TOOL + // If there's a cleaner with a mind, let's gain some experience! + if(cleaner?.mind) + var/total_experience_gain = 0 + for(var/obj/effect/decal/cleanable/cleanable_decal in A) + //it is intentional that the mop rounds xp but soap does not, USE THE SACRED TOOL + total_experience_gain += max(round(cleanable_decal.beauty / CLEAN_SKILL_BEAUTY_ADJUSTMENT, 1), 0) + cleaner.mind.adjust_experience(/datum/skill/cleaning, total_experience_gain) A.wash(CLEAN_SCRUB) reagents.expose(A, TOUCH, 10) //Needed for proper floor wetting. @@ -53,7 +58,9 @@ if(T) user.visible_message("[user] begins to clean \the [T] with [src].", "You begin to clean \the [T] with [src]...") - var/clean_speedies = user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER) + var/clean_speedies = 1 + if(user.mind) + clean_speedies = user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER) if(do_after(user, mopspeed*clean_speedies, target = T)) to_chat(user, "You finish mopping.") clean(T, user) diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index 64992e91758..ed4577363a6 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -740,8 +740,7 @@ if(!ishuman(user)) to_chat(usr, "Only a more advanced species could break a rock such as this one!") return FALSE - var/mob/living/carbon/human/H = user - if(H.mind.get_skill_level(/datum/skill/mining) >= SKILL_LEVEL_MASTER) + if(user.mind?.get_skill_level(/datum/skill/mining) >= SKILL_LEVEL_MASTER) . = ..() else to_chat(usr, "The rock seems to be too strong to destroy. Maybe I can break it once I become a master miner.") @@ -751,7 +750,7 @@ if(!ishuman(user)) return // see attackby var/mob/living/carbon/human/H = user - if(!(H.mind.get_skill_level(/datum/skill/mining) >= SKILL_LEVEL_MASTER)) + if(!(H.mind?.get_skill_level(/datum/skill/mining) >= SKILL_LEVEL_MASTER)) return drop_ores() H.client.give_award(/datum/award/achievement/skill/legendary_miner, H) @@ -761,7 +760,7 @@ ScrapeAway(flags=flags) addtimer(CALLBACK(src, .proc/AfterChange), 1, TIMER_UNIQUE) playsound(src, 'sound/effects/break_stone.ogg', 50, TRUE) //beautiful destruction - H.mind.adjust_experience(/datum/skill/mining, 100) //yay! + H.mind?.adjust_experience(/datum/skill/mining, 100) //yay! /turf/closed/mineral/strong/proc/drop_ores() if(prob(10)) diff --git a/code/modules/admin/skill_panel.dm b/code/modules/admin/skill_panel.dm index 5cffd773e9a..ec80768276d 100644 --- a/code/modules/admin/skill_panel.dm +++ b/code/modules/admin/skill_panel.dm @@ -22,17 +22,18 @@ /datum/skill_panel/ui_data(mob/user) //Sends info about the skills to UI . = list() - for (var/type in GLOB.skill_types) - var/datum/skill/S = GetSkillRef(type) - var/lvl_num = targetmind.get_skill_level(type) - var/lvl_name = uppertext(targetmind.get_skill_level_name(type)) - var/exp = targetmind.get_skill_exp(type) - var/xp_prog_to_level = targetmind.exp_needed_to_level_up(type) - var/xp_req_to_level = 0 - if (xp_prog_to_level)//is it even possible to level up? - xp_req_to_level = SKILL_EXP_LIST[lvl_num+1] - SKILL_EXP_LIST[lvl_num] - var/exp_percent = exp / SKILL_EXP_LIST[SKILL_LEVEL_LEGENDARY] - .["skills"] += list(list("playername" = targetmind.current, "path" = type, "name" = S.name, "desc" = S.desc, "lvlnum" = lvl_num, "lvl" = lvl_name, "exp" = exp, "exp_prog" = xp_req_to_level - xp_prog_to_level, "exp_req" = xp_req_to_level, "exp_percent" = exp_percent, "max_exp" = SKILL_EXP_LIST[length(SKILL_EXP_LIST)])) + if(user?.mind) + for (var/type in GLOB.skill_types) + var/datum/skill/S = GetSkillRef(type) + var/lvl_num = targetmind.get_skill_level(type) + var/lvl_name = uppertext(targetmind.get_skill_level_name(type)) + var/exp = targetmind.get_skill_exp(type) + var/xp_prog_to_level = targetmind.exp_needed_to_level_up(type) + var/xp_req_to_level = 0 + if (xp_prog_to_level)//is it even possible to level up? + xp_req_to_level = SKILL_EXP_LIST[lvl_num+1] - SKILL_EXP_LIST[lvl_num] + var/exp_percent = exp / SKILL_EXP_LIST[SKILL_LEVEL_LEGENDARY] + .["skills"] += list(list("playername" = targetmind.current, "path" = type, "name" = S.name, "desc" = S.desc, "lvlnum" = lvl_num, "lvl" = lvl_name, "exp" = exp, "exp_prog" = xp_req_to_level - xp_prog_to_level, "exp_req" = xp_req_to_level, "exp_percent" = exp_percent, "max_exp" = SKILL_EXP_LIST[length(SKILL_EXP_LIST)])) /datum/skill_panel/ui_act(action, params) . = ..() diff --git a/code/modules/modular_computers/file_system/programs/arcade.dm b/code/modules/modular_computers/file_system/programs/arcade.dm index e20eedc93b9..ac2731d9c62 100644 --- a/code/modules/modular_computers/file_system/programs/arcade.dm +++ b/code/modules/modular_computers/file_system/programs/arcade.dm @@ -97,8 +97,11 @@ if(computer) printer = computer.all_components[MC_PRINT] - var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming) - var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) + var/gamerSkillLevel = 0 + var/gamerSkill = 0 + if(usr?.mind) + gamerSkillLevel = usr.mind.get_skill_level(/datum/skill/gaming) + gamerSkill = usr.mind.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) switch(action) if("Attack") var/attackamt = 0 //Spam prevention. diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 1ba8f8d6168..bc705726ded 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -218,8 +218,11 @@ var/turf/closed/mineral/M = target_turf M.gets_drilled(firer, TRUE) if(iscarbon(firer)) - var/mob/living/carbon/C = firer - var/skill_modifier = C?.mind.get_skill_modifier(/datum/skill/mining, SKILL_SPEED_MODIFIER) + var/mob/living/carbon/carbon_firer = firer + var/skill_modifier = 1 + // If there is a mind, check for skill modifier to allow them to reload faster. + if(carbon_firer.mind) + skill_modifier = carbon_firer.mind.get_skill_modifier(/datum/skill/mining, SKILL_SPEED_MODIFIER) kinetic_gun.attempt_reload(kinetic_gun.overheat_time * skill_modifier) //If you hit a mineral, you might get a quicker reload. epic gamer style. var/obj/effect/temp_visual/kinetic_blast/K = new /obj/effect/temp_visual/kinetic_blast(target_turf) K.color = color diff --git a/code/modules/vehicles/vehicle_key.dm b/code/modules/vehicles/vehicle_key.dm index a39e2a25bf5..91652572d46 100644 --- a/code/modules/vehicles/vehicle_key.dm +++ b/code/modules/vehicles/vehicle_key.dm @@ -24,7 +24,7 @@ icon_state = "keyjanitor" /obj/item/key/janitor/suicide_act(mob/living/carbon/user) - switch(user.mind.get_skill_level(/datum/skill/cleaning)) + switch(user.mind?.get_skill_level(/datum/skill/cleaning)) if(SKILL_LEVEL_NONE to SKILL_LEVEL_NOVICE) //Their mind is too weak to ascend as a janny user.visible_message("[user] is putting \the [src] in [user.p_their()] mouth and is trying to become one with the janicart, but has no idea where to start! It looks like [user.p_theyre()] trying to commit suicide!") user.gib() @@ -55,7 +55,7 @@ if(user) user.remove_atom_colour(ADMIN_COLOUR_PRIORITY) user.visible_message("[user] forgot [user.p_they()] isn't actually a janicart! That's a paddlin'!") - if(user.mind.get_skill_level(/datum/skill/cleaning) >= SKILL_LEVEL_LEGENDARY) //Janny janny janny janny janny + if(user.mind?.get_skill_level(/datum/skill/cleaning) >= SKILL_LEVEL_LEGENDARY) //Janny janny janny janny janny playsound(src, 'sound/effects/adminhelp.ogg', 50, TRUE, -1) user.adjustOxyLoss(200) user.death(0)