mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 19:14:15 +01:00
[Ready] Skillcapes II: Revenge of the broken github: A Skill Menu Special: New Sprites Edition (#50656)
* 10K hours 60,000 minutes hahah sure if you want a trailing newline i can do that default cloak gets default skill lazy list and no equip good necessary ig Update code/datums/skills/_skill.dm Co-Authored-By: nemvar <47324920+nemvar@users.noreply.github.com> Update code/datums/skills/gaming.dm Co-Authored-By: Angust <46400996+Angustmeta@users.noreply.github.com> WIP PDA skill monitor program hacky fixes till i refactor skills refactors skills a bit, adds admin skill edit menu If you have a failing, it's that you're always demanding perfection ...IF you have a failing i think that's it for the admin skill manger appeases lord flord bruh level names FUCK!! unga Update code/modules/vehicles/vehicle_key.dm Co-authored-by: Rohesie <rohesie@gmail.com> Update code/modules/admin/topic.dm Co-authored-by: Rohesie <rohesie@gmail.com> Update code/modules/admin/skill_panel.dm Co-authored-by: Rohesie <rohesie@gmail.com> Update code/modules/admin/skill_panel.dm Co-authored-by: Rohesie <rohesie@gmail.com> Apply suggestions from code review frick Co-authored-by: Rohesie <rohesie@gmail.com> EOL and dumb spaces more rohsie bait tgui: Query Windows Registry for BYOND cache directory hell yeah brother update tgui and dmi CLRF and bat file typo ig * tgui and new janicloak that i accdiently changed on another branch * jani * gamer cloak * trim trailing whitespace * tgui * bruh * variable renaming
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
body += "<a href='?_src_=vars;[HrefToken()];Vars=[REF(M)]'>VV</a> - "
|
||||
if(M.mind)
|
||||
body += "<a href='?_src_=holder;[HrefToken()];traitor=[REF(M)]'>TP</a> - "
|
||||
body += "<a href='?_src_=holder;[HrefToken()];skill=[REF(M)]'>SKILLS</a> - "
|
||||
else
|
||||
body += "<a href='?_src_=holder;[HrefToken()];initmind=[REF(M)]'>Init Mind</a> - "
|
||||
if (iscyborg(M))
|
||||
@@ -739,22 +740,35 @@
|
||||
log_admin("[key_name(usr)] spawned cargo pack [chosen] at [AREACOORD(usr)]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Cargo") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
/datum/admins/proc/show_traitor_panel(mob/M in GLOB.mob_list)
|
||||
/datum/admins/proc/show_traitor_panel(mob/target_mob in GLOB.mob_list)
|
||||
set category = "Admin - Game"
|
||||
set desc = "Edit mobs's memory and role"
|
||||
set name = "Show Traitor Panel"
|
||||
|
||||
if(!istype(M))
|
||||
to_chat(usr, "This can only be used on instances of type /mob", confidential = TRUE)
|
||||
return
|
||||
if(!M.mind)
|
||||
var/datum/mind/target_mind = target_mob.mind
|
||||
if(!target_mind)
|
||||
to_chat(usr, "This mob has no mind!", confidential = TRUE)
|
||||
return
|
||||
|
||||
M.mind.traitor_panel()
|
||||
if(!istype(target_mob) && !istype(target_mind))
|
||||
to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE)
|
||||
return
|
||||
target_mind.traitor_panel()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Traitor Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/show_skill_panel(var/target)
|
||||
set category = "Admin - Game"
|
||||
set desc = "Edit mobs's experience and skill levels"
|
||||
set name = "Show Skill Panel"
|
||||
var/datum/mind/target_mind
|
||||
if(ismob(target))
|
||||
var/mob/target_mob = target
|
||||
target_mind = target_mob.mind
|
||||
else if (istype(target, /datum/mind))
|
||||
target_mind = target
|
||||
else
|
||||
to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE)
|
||||
return
|
||||
var/datum/skill_panel/SP = new(usr, target_mind)
|
||||
SP.ui_interact(usr)
|
||||
|
||||
/datum/admins/proc/toggletintedweldhelmets()
|
||||
set category = "Debug"
|
||||
|
||||
@@ -180,6 +180,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
|
||||
/client/proc/reset_ooc,
|
||||
/client/proc/deadmin,
|
||||
/datum/admins/proc/show_traitor_panel,
|
||||
/datum/admins/proc/show_skill_panel,
|
||||
/datum/admins/proc/toggleenter,
|
||||
/datum/admins/proc/toggleguests,
|
||||
/datum/admins/proc/announce,
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
body += "<a href='?_src_=holder;[HrefToken()];adminplayeropts="+ref+"'>PP</a> - "
|
||||
body += "<a href='?_src_=holder;[HrefToken()];showmessageckey="+ckey+"'>N</a> - "
|
||||
body += "<a href='?_src_=vars;[HrefToken()];Vars="+ref+"'>VV</a> - "
|
||||
body += "<a href='?_src_=vars;[HrefToken()];skill="+ref+"'>SP</a> - "
|
||||
body += "<a href='?_src_=holder;[HrefToken()];traitor="+ref+"'>TP</a> - "
|
||||
if (job == "Cyborg")
|
||||
body += "<a href='?_src_=holder;[HrefToken()];borgpanel="+ref+"'>BP</a> - "
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/datum/skill_panel
|
||||
var/datum/mind/targetmind
|
||||
var/client/holder //client of whoever is using this datum
|
||||
|
||||
/datum/skill_panel/New(user, datum/mind/mind)//H can either be a client or a mob due to byondcode(tm)
|
||||
targetmind = mind
|
||||
if (istype(user,/client))
|
||||
var/client/userClient = user
|
||||
holder = userClient //if its a client, assign it to holder
|
||||
else
|
||||
var/mob/userMob = user
|
||||
holder = userMob.client //if its a mob, assign the mob's client to holder
|
||||
|
||||
/datum/skill_panel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, \
|
||||
force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)//ui_interact is called when the client verb is called.
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "SkillPanel", "Manage Skills", 600, 500, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/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)]))
|
||||
|
||||
/datum/skill_panel/ui_act(action, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
switch (action)
|
||||
if ("adj_exp")
|
||||
var/skill = text2path(params["skill"])
|
||||
var/number = input("Please insert the amount of experience you'd like to add/subtract:") as num|null
|
||||
if (number)
|
||||
targetmind.adjust_experience(skill, number)
|
||||
if ("set_exp")
|
||||
var/skill = text2path(params["skill"])
|
||||
var/number = input("Please insert the number you want to set the player's exp to:") as num|null
|
||||
if (number)
|
||||
targetmind.set_experience(skill, number)
|
||||
if ("set_lvl")
|
||||
var/skill = text2path(params["skill"])
|
||||
var/max_skill = length(SKILL_EXP_LIST)
|
||||
var/number = input("Please insert a whole number between 1 (NONE) and [max_skill] (LEGENDARY) corresponding to the level you'd like to set the player to.") as num|null
|
||||
if (number > 0 && number <= max_skill )
|
||||
targetmind.set_level(skill, number)
|
||||
@@ -1545,6 +1545,26 @@
|
||||
else
|
||||
show_traitor_panel(M)
|
||||
|
||||
else if(href_list["skill"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
if(!SSticker.HasRoundStarted())
|
||||
alert("The game hasn't started yet!")
|
||||
return
|
||||
|
||||
var/target = locate(href_list["skill"])
|
||||
var/datum/mind/target_mind
|
||||
if(ismob(target))
|
||||
var/mob/target_mob = target
|
||||
target_mind = target_mob.mind
|
||||
else if (istype(target, /datum/mind))
|
||||
target_mind = target
|
||||
else
|
||||
to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE)
|
||||
return
|
||||
show_skill_panel(target_mind)
|
||||
|
||||
else if(href_list["borgpanel"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user