Admin Damage Menu (#11386)

This commit is contained in:
Geeves
2021-04-08 12:12:32 -03:00
committed by GitHub
parent aea6b3af65
commit 44222f1cc8
8 changed files with 291 additions and 12 deletions
+13 -12
View File
@@ -1337,21 +1337,22 @@ proc/admin_notice(var/message, var/rights)
set name = "Toggle Wind"
set desc = "Paralyzes a player. Or unparalyses them."
toggle_wind_paralysis(H, usr)
/proc/toggle_wind_paralysis(var/mob/living/target, var/mob/user)
var/msg
if(check_rights(R_ADMIN|R_MOD))
if (H.paralysis == 0)
msg = "has paralyzed [key_name_admin(H)]."
H.visible_message("<font color='#002eb8'><b>OOC Information:</b></font> <span class='warning'>[H] has been winded by a member of staff! Please freeze all roleplay involving their character until the matter is resolved! Adminhelp if you have further questions.</span>", "<span class='warning'><b>You have been winded by a member of staff! Please stand by until they contact you!</b></span>")
H.paralysis = 8000
if(check_rights(R_ADMIN|R_MOD, user))
if (target.paralysis == 0)
msg = "has paralyzed [key_name_admin(target)]."
target.visible_message("<font color='#002eb8'><b>OOC Information:</b></font> <span class='warning'>[user] has been winded by a member of staff! Please freeze all roleplay involving their character until the matter is resolved! Adminhelp if you have further questions.</span>", "<span class='warning'><b>You have been winded by a member of staff! Please stand by until they contact you!</b></span>")
target.paralysis = 8000
else
if (alert("The player is currently winded. Do you want to unwind him?", "Unwind player?", "Yes", "No") == "No")
if (alert(user, "The player is currently winded. Do you want to unwind him?", "Unwind player?", "Yes", "No") == "No")
return
H.paralysis = 0
msg = "has unparalyzed [key_name_admin(H)]."
H.visible_message("<font color='#002eb8'><b>OOC Information:</b></font> <font color='green'>[H] has been unwinded by a member of staff!</font>", "<span class='warning'><b>You have been unwinded by a member of staff!</b></span>")
log_and_message_admins(msg)
target.paralysis = 0
msg = "has unparalyzed [key_name_admin(target)]."
target.visible_message("<font color='#002eb8'><b>OOC Information:</b></font> <font color='green'>[user] has been unwinded by a member of staff!</font>", "<span class='warning'><b>You have been unwinded by a member of staff!</b></span>")
log_and_message_admins(msg, user)
feedback_add_details("admin_verb", "WIND")
/datum/admins/proc/toggle_round_spookyness()
+9
View File
@@ -72,6 +72,7 @@ var/list/admin_verbs_admin = list(
/client/proc/toggleghostwriters,
/client/proc/toggledrones,
/datum/admins/proc/show_skills,
/client/proc/damage_menu,
/client/proc/man_up,
/client/proc/global_man_up,
/client/proc/response_team, // Response Teams admin verb,
@@ -261,6 +262,7 @@ var/list/admin_verbs_hideable = list(
/client/proc/toggledrones,
/datum/admins/proc/show_skills,
/client/proc/restart_sql,
/client/proc/damage_menu,
/client/proc/man_up,
/client/proc/global_man_up,
/client/proc/connect_ntsl,
@@ -1044,6 +1046,13 @@ var/list/admin_verbs_cciaa = list(
else
to_chat(usr, "You now won't get debug log messages")
/client/proc/damage_menu(mob/living/carbon/human/H as null|mob in human_mob_list)
set name = "Damage Menu"
set desc = "Access a human mob's damage menu, allowing you to make their life hell."
set category = "Fun"
if(H)
new /datum/vueui_module/damage_menu(WEAKREF(H), usr)
/client/proc/man_up(mob/T as mob in mob_list)
set category = "Fun"
@@ -0,0 +1,151 @@
// the damage menu is a menu which you can use to damage human mobs
// it's accessible via the drop down list when you VV a human mob
/datum/vueui_module/damage_menu
var/datum/weakref/target_human
/datum/vueui_module/damage_menu/New(var/datum/weakref/target, var/mob/user)
var/mob/living/carbon/human/H = target.resolve()
if(istype(H))
target_human = target
ui_interact(user)
/datum/vueui_module/damage_menu/ui_interact(mob/user)
if(!user.client.holder)
return
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
if(!ui)
var/human_name = "Geoff"
var/human_ckey = "None"
var/mob/living/carbon/H = target_human.resolve()
if(H)
human_name = H.real_name
if(H.ckey)
human_ckey = H.ckey
ui = new(user, src, "admin-damage-menu", 600, 600, "Damage Menu | [human_name] | [human_ckey]", state = interactive_state)
ui.header = "minimal"
ui.open()
/datum/vueui_module/damage_menu/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
if(!data)
data = list()
if(!user.client.holder)
return
var/mob/living/carbon/H = target_human.resolve()
if(!istype(H))
to_chat(user, SPAN_DANGER("The humanoid target couldn't be found, closing UI."))
ui.close()
var/list/limbs = list()
for(var/name in H.species.has_limbs)
limbs[capitalize_first_letters(parse_zone(name))] = !!H.organs_by_name[name]
var/list/organs = list()
for(var/name in H.species.has_organ)
organs[capitalize_first_letters(name)] = !!H.internal_organs_by_name[name]
data["limbs"] = limbs
data["organs"] = organs
return data
/datum/vueui_module/damage_menu/Topic(href, href_list)
if(!check_rights(R_ADMIN))
return
var/mob/living/carbon/human/H = target_human.resolve()
if(!istype(H))
return
switch(href_list["target"])
if("limb")
var/obj/item/organ/external/L = H.organs_by_name[reverse_parse_zone(lowertext(href_list["name"]))]
if(!L)
to_chat(usr, SPAN_WARNING("\The [H] doesn't have that limb!"))
return
switch(href_list["action"])
if("brute")
var/damage_dealt = input(usr, "How much brute damage do you want to deal? (Current Brute: [L.brute_dam] | Current Burn; [L.burn_dam])", "Brute Damage") as null|num
if(damage_dealt)
L.take_damage(damage_dealt, 0)
log_and_message_admins("used the Damage Menu to deploy deal [damage_dealt] [href_list["action"]] to [H]'s [href_list["name"]]", usr, get_turf(H))
if("burn")
var/damage_dealt = input(usr, "How much burn damage do you want to deal? (Current Brute: [L.brute_dam] | Current Burn; [L.burn_dam])", "Burn Damage") as null|num
if(damage_dealt)
L.take_damage(0, damage_dealt)
log_and_message_admins("used the Damage Menu to deploy deal [damage_dealt] [href_list["action"]] to [H]'s [href_list["name"]]", usr, get_turf(H))
if("infection")
switch(alert(usr, "Do you want to increase or decrease the infection level? (Current: [L.estimated_infection_level()])", "Infection Level", "Increase", "Decrease", "Cancel"))
if("Increase")
L.increase_germ_level()
log_and_message_admins("used the Damage Menu to increase the infection level of [H]'s [href_list["name"]]", usr, get_turf(H))
if("Decrease")
L.decrease_germ_level()
log_and_message_admins("used the Damage Menu to decrease the infection level of [H]'s [href_list["name"]]", usr, get_turf(H))
if("shatter")
if(L.brute_dam < L.min_broken_damage * config.organ_health_multiplier)
L.take_damage(L.brute_dam + ((L.min_broken_damage * config.organ_health_multiplier) - L.brute_dam))
L.fracture()
log_and_message_admins("used the Damage Menu to shatter [H]'s [href_list["name"]]", usr, get_turf(H))
if("arterial")
if(L.status & ORGAN_ARTERY_CUT)
if(alert(usr, "Do you want to stop the arterial bleeding?", "Arterial Bleeding", "Yes", "No") == "Yes")
L.status &= ~ORGAN_ARTERY_CUT
L.update_damages()
log_and_message_admins("used the Damage Menu to stop an arterial bleed in [H]'s [href_list["name"]]", usr, get_turf(H))
else
if(alert(usr, "Do you want to start an arterial bleed?", "Arterial Bleeding", "Yes", "No") == "Yes")
if(L.sever_artery())
log_and_message_admins("used the Damage Menu to start an arterial bleed in [H]'s [href_list["name"]]", usr, get_turf(H))
else
to_chat(usr, SPAN_WARNING("For whatever reason, \the [L] cannot gain an arterial bleed!"))
if("sever")
switch(alert(usr, "Do you want to cleanly sever the limb, or gib it into blood and gore?", "Sever Limb", "Cleanly Sever", "Gib", "Cancel"))
if("Cleanly Sever")
L.droplimb(TRUE, DROPLIMB_EDGE)
log_and_message_admins("used the Damage Menu to cleanly sever [H]'s [href_list["name"]]", usr, get_turf(H))
if("Gib")
L.droplimb(FALSE, DROPLIMB_BLUNT)
log_and_message_admins("used the Damage Menu to gib [H]'s [href_list["name"]]", usr, get_turf(H))
if("organ")
var/obj/item/organ/internal/O = H.internal_organs_by_name[lowertext(href_list["name"])]
if(!O)
to_chat(usr, SPAN_WARNING("\The [H] doesn't have that organ!"))
return
switch(href_list["action"])
if("damage")
var/damage_dealt = input(usr, "How much damage do you want to deal? (Current Damage: [O.damage])", "Brute Damage") as null|num
if(damage_dealt)
O.take_internal_damage(damage_dealt)
log_and_message_admins("used the Damage Menu to deal [damage_dealt] [href_list["action"]] to [H]'s [href_list["name"]]", usr, get_turf(H))
if("infection")
switch(alert(usr, "Do you want to increase or decrease the infection level? (Current: [O.estimated_infection_level()])", "Infection Level", "Increase", "Decrease", "Cancel"))
if("Increase")
O.increase_germ_level()
log_and_message_admins("used the Damage Menu to increase the infection level of [H]'s [href_list["name"]]", usr, get_turf(H))
if("Decrease")
O.decrease_germ_level()
log_and_message_admins("used the Damage Menu to decrease the infection level of [H]'s [href_list["name"]]", usr, get_turf(H))
if("bruise")
if(O.damage < O.min_bruised_damage)
O.take_damage(O.damage + (O.min_bruised_damage - O.damage) + 1)
log_and_message_admins("used the Damage Menu to bruise [H]'s [href_list["name"]]", usr, get_turf(H))
if("break")
if(O.damage < O.min_broken_damage)
O.take_damage(O.damage + (O.min_broken_damage - O.damage) + 1)
log_and_message_admins("used the Damage Menu to break [H]'s [href_list["name"]]", usr, get_turf(H))
if("remove")
O.removed(H)
qdel(O)
log_and_message_admins("used the Damage Menu to remove and delete [H]'s [href_list["name"]]", usr, get_turf(H))
if("misc")
log_and_message_admins("used the Damage Menu to deploy [href_list["action"]] on [H]", usr, get_turf(H))
switch(href_list["action"])
if("wind")
toggle_wind_paralysis(H, usr)
if("gigashatter")
H.gigashatter()
if("kill")
H.death(FALSE)
if("gib")
H.gib()
+28
View File
@@ -287,6 +287,34 @@
/obj/item/organ/proc/is_infected()
return (germ_level >= INFECTION_LEVEL_ONE)
/obj/item/organ/proc/estimated_infection_level()
if(germ_level < INFECTION_LEVEL_ONE)
return "Healthy"
else if(germ_level >= INFECTION_LEVEL_ONE && germ_level < INFECTION_LEVEL_TWO)
return "Infection Level One"
else if(germ_level >= INFECTION_LEVEL_TWO && germ_level < INFECTION_LEVEL_THREE)
return "Infection Level Two"
else
return "Infection Level Three"
/obj/item/organ/proc/increase_germ_level()
switch(estimated_infection_level())
if("Healthy")
germ_level = INFECTION_LEVEL_ONE
if("Infection Level One")
germ_level = INFECTION_LEVEL_TWO
if("Infection Level Two")
germ_level = INFECTION_LEVEL_THREE
/obj/item/organ/proc/decrease_germ_level()
switch(estimated_infection_level())
if("Infection Level One")
germ_level = 0
if("Infection Level Two")
germ_level = INFECTION_LEVEL_ONE
if("Infection Level Three")
germ_level = INFECTION_LEVEL_TWO
//Germs
/obj/item/organ/proc/handle_antibiotics()
if(!owner || !(CE_ANTIBIOTIC in owner.chem_effects) || (germ_level <= 0))