mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Admin VV Typesetting Changes (#37103)
* unatomic typesetting * pomf requested
This commit is contained in:
@@ -157,6 +157,55 @@
|
||||
return
|
||||
return chosen
|
||||
|
||||
/*
|
||||
* Returns the length of a common prefix in a list, if any
|
||||
* Requires a SORTED list
|
||||
*/
|
||||
/proc/find_string_list_prefix(var/list/inputlist)
|
||||
if(!inputlist.len)
|
||||
return
|
||||
if(inputlist.len==1)
|
||||
return inputlist[1]
|
||||
var/i = 0
|
||||
var/first = "[inputlist[1]]"
|
||||
var/last = "[inputlist[inputlist.len]]"
|
||||
while(i < length(first) && first[i+1] == last[i+1])
|
||||
i++
|
||||
return i
|
||||
|
||||
/*
|
||||
* Returns a choice from an input typelist, given a string filter
|
||||
* If only one thing is returned, just gives us that with no input list.
|
||||
*/
|
||||
/proc/filter_typelist_input(input_text, input_heading, var/list/matches)
|
||||
if(!matches.len)
|
||||
return
|
||||
if(matches.len==1)
|
||||
return matches[1]
|
||||
matches = sortList(matches)
|
||||
var/prefix = ""
|
||||
var/common = find_string_list_prefix(matches)
|
||||
if(common)
|
||||
prefix = copytext("[matches[1]]", 1, common+1)
|
||||
var/foundpartial = findlasttext(prefix, "/")
|
||||
if(foundpartial)
|
||||
prefix = copytext(prefix, 1, foundpartial)
|
||||
common = foundpartial
|
||||
var/list/results = list()
|
||||
for(var/x in matches)
|
||||
if(common)
|
||||
results += copytext("[x]", common)
|
||||
else
|
||||
results += "[x]"
|
||||
var/newvalue = input("[input_text][(input_text && prefix) ? "\n" : ""][prefix ? "Prefix: [prefix]" : ""]",input_heading) as null|anything in results
|
||||
if(isnull(newvalue))
|
||||
return
|
||||
if(prefix)
|
||||
newvalue = text2path(prefix + newvalue)
|
||||
else
|
||||
newvalue = text2path(newvalue)
|
||||
return newvalue
|
||||
|
||||
/*
|
||||
* Returns list containing all the entries from first list that are not present in second.
|
||||
* If skiprep = 1, repeated elements are treated as one.
|
||||
|
||||
@@ -139,6 +139,8 @@
|
||||
body += "<option value='?_src_=vars;edit_transform=\ref[D]'>Edit Transform Matrix</option>"
|
||||
if(isapperanceeditable(D))
|
||||
body += "<option value='?_src_=vars;toggle_aliasing=\ref[D]'>Toggle Transform Aliasing</option>"
|
||||
if(istype(D,/obj/item/weapon/gun))
|
||||
body += "<option value='?_src_=vars;projectile_edit=\ref[D]'>Edit Projectile Variables</option>"
|
||||
|
||||
body += "<option value='?_src_=vars;proc_call=\ref[D]'>Proc call</option>"
|
||||
body += "<option value>---</option>"
|
||||
@@ -977,6 +979,17 @@ function loadPage(list) {
|
||||
|
||||
DAT.vars["transform"] = modify_matrix_menu(M)
|
||||
|
||||
else if(href_list["projectile_edit"])
|
||||
if (!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/gun/G = locate(href_list["projectile_edit"])
|
||||
if(!istype(G))
|
||||
to_chat(src, "Target must be a obj/item/weapon/gun!")
|
||||
return
|
||||
|
||||
gun_override(G)
|
||||
|
||||
else if(href_list["toggle_aliasing"])
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
@@ -1028,3 +1041,134 @@ function loadPage(list) {
|
||||
if(!istype(DAT, /datum))
|
||||
return
|
||||
src.debug_variables(DAT)
|
||||
|
||||
/**
|
||||
* A FUN proc that, when given a /obj/item/weapon/gun, can allow you to change most projectile variables and types.
|
||||
*/
|
||||
/proc/gun_override(var/obj/item/weapon/gun/G)
|
||||
if (!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/list/projectile_vars = list(
|
||||
//this is the ultimate
|
||||
"base projectile typepath",
|
||||
//damage/main vars
|
||||
"damage", "damage_type", "nodamage", "what armor resists (flag)", "projectile_speed", "travel_range",
|
||||
//effect vars
|
||||
"stun", "weaken", "paralyze", "irradiate", "eyeblur", "drowsy", "agony", "jittery",
|
||||
//appearance/misc vars
|
||||
"icon (upload dmi)", "icon_state", "color", "silenced", "manual variable entry"
|
||||
)
|
||||
|
||||
var/inputvar
|
||||
G.bullet_overrides ||= list()
|
||||
if(!G.bullet_overrides.len)
|
||||
inputvar = input(usr, "What variable would you like to change?", "Gun Variables") as null|anything in projectile_vars
|
||||
else
|
||||
var/existing_bullet_override_pick = input(usr, "Would you like to edit an existing variable or add a new one?", "Gun Variables") as null|anything in G.bullet_overrides + G.bullet_type_override + "(ADD VAR)"
|
||||
if(!existing_bullet_override_pick)
|
||||
return
|
||||
else if(G.bullet_type_override && G.bullet_type_override == existing_bullet_override_pick)
|
||||
inputvar = "base projectile typepath"
|
||||
else if(existing_bullet_override_pick == "(ADD VAR)")
|
||||
inputvar = input(usr, "What variable would you like to change?", "Gun Variables") as null|anything in projectile_vars
|
||||
else
|
||||
inputvar = existing_bullet_override_pick
|
||||
if(!inputvar)
|
||||
return
|
||||
var/newvalue
|
||||
switch(inputvar)
|
||||
if("base projectile typepath")
|
||||
newvalue = find_projectile_type(G)
|
||||
if("damage","irradiate")
|
||||
newvalue = input(usr, "How much damage should the projectile deal?", "Var: [inputvar]") as null|num
|
||||
if("damage_type")
|
||||
newvalue = input(usr, "What type of damage should the projectile deal (it can only deal one, sorry)?", "Var: [inputvar]") as null|anything in list("brute", "oxy", "tox", "fire", "clone", "brain")
|
||||
if("nodamage")
|
||||
newvalue = input(usr, "Should the gun NOT do damage on hit?", "Var: [inputvar]") as null|anything in list("True", "False")
|
||||
if(newvalue == "True")
|
||||
newvalue = TRUE
|
||||
else
|
||||
newvalue = FALSE
|
||||
if("what armor resists (flag)")
|
||||
newvalue = input(usr, "What armor type should resist this damage?", "Var: [inputvar]") as null|anything in list("melee", "bullet", "laser", "energy", "bomb", "bio", "rad")
|
||||
inputvar = "flag"
|
||||
if("projectile_speed")
|
||||
newvalue = input(usr, "How much time (in deciseconds) should the bullet delay between tile movements? (examples, Taser electrode is 1, Glock bullets are 0.5)?", "Var: [inputvar]") as null|num
|
||||
if("travel_range")
|
||||
newvalue = input(usr, "How far should the projectile travel before vanishing? (0 to go indefinitely)", "Gun Variables") as null|num
|
||||
if("stun","weaken","paralyze","eyeblur","agony","jittery")
|
||||
newvalue = input(usr, "New effect value? Most go down 1 per tick.", "Var: [inputvar]") as null|num
|
||||
if("color")
|
||||
newvalue = input(usr, "What color (RGB format, example: #00ff00)?", "Var: [inputvar]") as null|color
|
||||
if("silenced")
|
||||
newvalue = input(usr, "Should the gun have no text when fired?", "Var: [inputvar]") as null|anything in list(TRUE, FALSE)
|
||||
if("manual variable entry")
|
||||
inputvar = input(usr, "What variable name to manually insert and then edit (verify it!)?", "Var: [inputvar]") as null|text
|
||||
if(isnull(inputvar))
|
||||
return
|
||||
newvalue = variable_set(usr)
|
||||
if("icon (upload dmi)")
|
||||
newvalue = input(usr, "Choose an icon file for your new projectile!", "Var: [inputvar]") as null|icon
|
||||
inputvar = "icon"
|
||||
if("icon_state")
|
||||
newvalue = input(usr, "What icon_state to set?", "Var: [inputvar]") as null|text
|
||||
else
|
||||
newvalue = variable_set(usr)
|
||||
if(isnull(newvalue))
|
||||
return
|
||||
if(inputvar == "base projectile typepath")
|
||||
G.bullet_type_override = newvalue
|
||||
else
|
||||
G.bullet_overrides[inputvar] = newvalue
|
||||
to_chat(usr,"Current list of projectile edits:")
|
||||
if(G.bullet_type_override)
|
||||
to_chat(usr,"Type Override: [G.bullet_type_override]")
|
||||
for(var/result in G.bullet_overrides)
|
||||
to_chat(usr,"[result]: [G.bullet_overrides[result]]")
|
||||
log_admin("[key_name(usr)] overrode [G]'s projectile variable [inputvar] to [newvalue].")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] overrode [G]'s projectile variable [inputvar] to [newvalue].</span>", 1)
|
||||
feedback_add_details("admin_verb","GOR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/**
|
||||
* Allows you to pick a valid projectile that can fire out of a given /obj/item/weapon/gun
|
||||
*/
|
||||
/proc/find_projectile_type(var/obj/item/weapon/gun/G)
|
||||
var/newvalue
|
||||
//Hookshots crash the server if shot from anything that isn't a hookshot
|
||||
//And they lock up if they fire anything that isn't a hookshot projectile
|
||||
if(istype(G, /obj/item/weapon/gun/hookshot))
|
||||
newvalue = filter_typelist_input("What projectile type would you like to use?","Gun Variables", typesof(/obj/item/projectile/hookshot))
|
||||
return newvalue
|
||||
var/list/commontypes = list("taser", "laser", "glock", "low yield rocket", "pizza rocket", "Show me everything.", "manual typepath")
|
||||
var/projtype = input(usr, "What projectile type would you like to use?", "Gun Variables") as null|anything in commontypes
|
||||
switch(projtype)
|
||||
if("taser")
|
||||
newvalue = /obj/item/projectile/energy/electrode
|
||||
if("laser")
|
||||
newvalue = /obj/item/projectile/beam
|
||||
if("glock")
|
||||
newvalue = /obj/item/projectile/bullet/auto380
|
||||
if("low yield rocket")
|
||||
newvalue = /obj/item/projectile/rocket/lowyield
|
||||
if("pizza rocket")
|
||||
newvalue = /obj/item/projectile/rocket/clown/pizza
|
||||
if("Show me everything.")
|
||||
newvalue = filter_typelist_input("Here's everything.","Gun Variables", typesof(/obj/item/projectile) - typesof(/obj/item/projectile/hookshot))
|
||||
if(isnull(newvalue))
|
||||
return
|
||||
if("manual typepath")
|
||||
newvalue = text2path(input(usr, "What typepath?", "Gun Variables", "/obj/item/projectile") as null|text)
|
||||
if(!ispath(newvalue, /obj/item/projectile))
|
||||
return
|
||||
//Warning for manually avoiding the check
|
||||
if(ispath(newvalue, /obj/item/projectile/hookshot) && !istype(G, /obj/item/weapon/gun/hookshot))
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
var/warnthem = input(usr, "Hookshot projectiles will crash the server. Are you sure?", "WARNING") as anything in list("Yes, have me be deadminned", "No, cancel it!")
|
||||
if(warnthem == "No, cancel it!")
|
||||
return
|
||||
else
|
||||
log_admin("[key_name(usr)] was warned about crashing the server from hookshot projectiles.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] is doing something that might crash the server!</span>", 1)
|
||||
return newvalue
|
||||
|
||||
@@ -235,6 +235,9 @@
|
||||
else
|
||||
var/obj/item/weapon/gun/energy/E = installed
|
||||
A = new E.projectile_type(loc)
|
||||
var/obj/item/weapon/gun/G = installed
|
||||
if(G.bullet_type_override && ispath(G.bullet_type_override, /obj/item/projectile))
|
||||
A = new G.bullet_type_override
|
||||
A.original = target
|
||||
A.starting = T
|
||||
A.shot_from = installed
|
||||
@@ -243,7 +246,6 @@
|
||||
A.yo = U.y - T.y
|
||||
A.xo = U.x - T.x
|
||||
A.OnFired()
|
||||
var/obj/item/weapon/gun/G = installed
|
||||
if(G.bullet_overrides)
|
||||
for(var/bvar in A.vars)
|
||||
for(var/o in G.bullet_overrides)
|
||||
@@ -702,7 +704,7 @@
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/list/valid_turret_projectiles = existing_typesof(/obj/item/projectile/bullet) + existing_typesof(/obj/item/projectile/energy)
|
||||
var/userinput = filter_list_input("New projectile typepath", "You can only pick one!", valid_turret_projectiles)
|
||||
var/userinput = filter_typelist_input("New projectile typepath", "You can only pick one!", valid_turret_projectiles)
|
||||
if(!userinput)
|
||||
to_chat(usr, "<span class='warning'><b>No projetile typepath entered. The turret's projectile remains unchanged.</b></span>")
|
||||
return
|
||||
|
||||
@@ -1319,7 +1319,7 @@ var/global/floorIsLava = 0
|
||||
|
||||
object = copytext(object, 1, variables_start)
|
||||
|
||||
var/chosen = filter_list_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
|
||||
var/chosen = filter_typelist_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
|
||||
if(!chosen)
|
||||
return
|
||||
var/atom/location = usr.loc
|
||||
|
||||
@@ -133,7 +133,6 @@ var/list/admin_verbs_fun = list(
|
||||
/client/proc/add_centcomm_order,
|
||||
/client/proc/apes,
|
||||
/client/proc/force_next_map,
|
||||
/client/proc/gun_override,
|
||||
)
|
||||
var/list/admin_verbs_spawn = list(
|
||||
/datum/admins/proc/spawn_atom, // Allows us to spawn instances
|
||||
@@ -257,7 +256,6 @@ var/list/admin_verbs_hideable = list(
|
||||
/client/proc/play_local_sound,
|
||||
/client/proc/play_sound,
|
||||
/client/proc/object_talk,
|
||||
/client/proc/gun_override,
|
||||
/client/proc/cmd_admin_gib_self,
|
||||
/client/proc/drop_bomb,
|
||||
/client/proc/drop_emp,
|
||||
@@ -782,89 +780,6 @@ var/list/admin_verbs_mod = list(
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. say \"[message]\"</span>", 1)
|
||||
feedback_add_details("admin_verb","OT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/gun_override(var/obj/item/weapon/gun/G in world)
|
||||
set category = "Fun"
|
||||
set name = "Override Projectile Vars"
|
||||
set desc = "Give a gun special rules"
|
||||
|
||||
//dumb temporary override please fix this if we can get a list of these
|
||||
//remains here to remind you of what could have been.
|
||||
/*
|
||||
var/obj/item/projectile/tempproj = new
|
||||
var/list/projectile_vars = sortList(tempproj.vars)
|
||||
qdel(tempproj)
|
||||
*/
|
||||
|
||||
var/list/projectile_vars = list(
|
||||
//damage/main vars
|
||||
"damage", "damage_type", "nodamage", "what armor resists (flag)", "projectile_speed", "travel_range",
|
||||
//effect vars
|
||||
"stun", "weaken", "paralyze", "irradiate", "eyeblur", "drowsy", "agony", "jittery",
|
||||
//appearance/misc vars
|
||||
"icon (upload dmi)", "icon_state", "color", "silenced", "manual variable entry"
|
||||
)
|
||||
|
||||
var/inputvar
|
||||
G.bullet_overrides ||= list()
|
||||
if(!G.bullet_overrides.len)
|
||||
inputvar = input(usr, "What variable would you like to change?", "Gun Variables") as null|anything in projectile_vars
|
||||
else
|
||||
var/existing_bullet_override_pick = input(usr, "Would you like to edit an existing variable or add a new one?", "Gun Variables") as null|anything in G.bullet_overrides + "(ADD VAR)"
|
||||
if(!existing_bullet_override_pick)
|
||||
return
|
||||
else if(existing_bullet_override_pick == "(ADD VAR)")
|
||||
inputvar = input(usr, "What variable would you like to change?", "Gun Variables") as null|anything in projectile_vars
|
||||
else
|
||||
inputvar = existing_bullet_override_pick
|
||||
if(!inputvar)
|
||||
return
|
||||
var/newvalue
|
||||
switch(inputvar)
|
||||
if("damage","irradiate")
|
||||
newvalue = input(usr, "How much damage should the projectile deal?", "Var: [inputvar]") as null|num
|
||||
if("damage_type")
|
||||
newvalue = input(usr, "What type of damage should the projectile deal (it can only deal one, sorry)?", "Var: [inputvar]") as null|anything in list("brute", "oxy", "tox", "fire", "clone", "brain")
|
||||
if("nodamage")
|
||||
newvalue = input(usr, "Should the gun NOT do damage on hit?", "Var: [inputvar]") as null|anything in list("True", "False")
|
||||
if(newvalue == "True")
|
||||
newvalue = TRUE
|
||||
else
|
||||
newvalue = FALSE
|
||||
if("what armor resists (flag)")
|
||||
newvalue = input(usr, "What armor type should resist this damage?", "Var: [inputvar]") as null|anything in list("melee", "bullet", "laser", "energy", "bomb", "bio", "rad")
|
||||
inputvar = "flag"
|
||||
if("projectile_speed")
|
||||
newvalue = input(usr, "How much time (in deciseconds) should the bullet delay between tile movements? (examples, Taser electrode is 1, Glock bullets are 0.5)?", "Var: [inputvar]") as null|num
|
||||
if("travel_range")
|
||||
newvalue = input(usr, "How far should the projectile travel before vanishing? (0 to go indefinitely)", "Gun Variables") as null|num
|
||||
if("stun","weaken","paralyze","eyeblur","agony","jittery")
|
||||
newvalue = input(usr, "New effect value? Most go down 1 per tick.", "Var: [inputvar]") as null|num
|
||||
if("color")
|
||||
newvalue = input(usr, "What color (RGB format, example: #00ff00)?", "Var: [inputvar]") as null|color
|
||||
if("silenced")
|
||||
newvalue = input(usr, "Should the gun have no text when fired?", "Var: [inputvar]") as null|anything in list(TRUE, FALSE)
|
||||
if("manual variable entry")
|
||||
inputvar = input(usr, "What variable name to manually insert and then edit (verify it!)?", "Var: [inputvar]") as null|text
|
||||
if(isnull(inputvar))
|
||||
return
|
||||
newvalue = variable_set(usr)
|
||||
if("icon (upload dmi)")
|
||||
newvalue = input(usr, "Choose an icon file for your new projectile!", "Var: [inputvar]") as null|icon
|
||||
inputvar = "icon"
|
||||
if("icon_state")
|
||||
newvalue = input(usr, "What icon_state to set?", "Var: [inputvar]") as null|text
|
||||
else
|
||||
newvalue = variable_set(usr)
|
||||
if(isnull(newvalue))
|
||||
return
|
||||
G.bullet_overrides[inputvar] = newvalue
|
||||
to_chat(usr,"Current list of projectile edits:")
|
||||
for(var/result in G.bullet_overrides)
|
||||
to_chat(usr,"[result]: [G.bullet_overrides[result]]")
|
||||
log_admin("[key_name(usr)] overrode [G]'s projectile variable [inputvar] to [newvalue].")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] overrode [G]'s projectile variable [inputvar] to [newvalue].</span>", 1)
|
||||
feedback_add_details("admin_verb","GOR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/deadmin_self()
|
||||
set name = "De-admin self"
|
||||
set category = "Admin"
|
||||
|
||||
@@ -5813,7 +5813,7 @@ access_sec_doors,access_salvage_captain,access_cent_ert,access_syndicate,access_
|
||||
z_del = new_limit
|
||||
if ("type") // Lifted from "spawn" code.
|
||||
var/object = input(usr, "Enter a typepath. It will be autocompleted.", "Setting the type to delete.") as null|text
|
||||
var/chosen = filter_list_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
|
||||
var/chosen = filter_typelist_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
|
||||
if(!chosen)
|
||||
to_chat(usr, "<span class='warning'>No type chosen.</span>")
|
||||
return
|
||||
|
||||
@@ -1273,7 +1273,7 @@ var/global/blood_virus_spreading_disabled = 0
|
||||
|
||||
|
||||
//Exclude non-movable atoms
|
||||
var/chosen = filter_list_input("Select a datum type", "Spawn Datum", get_matching_types(object, /datum) - typesof(/turf, /area, /datum/admins))
|
||||
var/chosen = filter_typelist_input("Select a datum type", "Spawn Datum", get_matching_types(object, /datum) - typesof(/turf, /area, /datum/admins))
|
||||
if(!chosen)
|
||||
return
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
return
|
||||
|
||||
if(istext(target_type))
|
||||
target_type = filter_list_input("Select an object type to mass-modify", "Mass-editing", get_matching_types(target_type, /atom))
|
||||
target_type = filter_typelist_input("Select an object type to mass-modify", "Mass-editing", get_matching_types(target_type, /atom))
|
||||
|
||||
//get_vars_from_type() fails on turf and area objects. If you want to mass-edit a turf, you have to do it through the varedit window
|
||||
if(ispath(target_type, /atom) && !ispath(target_type, /atom/movable))
|
||||
|
||||
@@ -160,8 +160,10 @@ var/list/forbidden_varedit_object_types = list(
|
||||
new_value = input("Enter new number:", window_title, old_value) as num
|
||||
|
||||
if(V_TYPE)
|
||||
var/partial_type = input("Enter type, or leave blank to see all types", window_title, "[old_value]") as text|null
|
||||
new_value = filter_list_input("Select type", window_title, get_matching_types(partial_type, /datum))
|
||||
var/partial_type = input("Enter type, partial type, or leave blank to set null", window_title, "[old_value]") as text|null
|
||||
if(isnull(partial_type) || partial_type == "")
|
||||
return
|
||||
new_value = filter_typelist_input("Select type", window_title, get_matching_types(partial_type, /datum))
|
||||
|
||||
if(V_LIST_EMPTY)
|
||||
if (acceptsLists)
|
||||
|
||||
@@ -1134,7 +1134,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
|
||||
/proc/select_loadout()
|
||||
var/object = input(usr, "Enter a typepath. It will be autocompleted.", "Equip Outfit") as null|text
|
||||
var/outfit_type = filter_list_input("Outfit Type","Equip Outfit", get_matching_types(object, /datum/outfit) - /datum/outfit/ - /datum/outfit/striketeam/)
|
||||
var/outfit_type = filter_typelist_input("Outfit Type","Equip Outfit", get_matching_types(object, /datum/outfit) - /datum/outfit/ - /datum/outfit/striketeam/)
|
||||
if(!outfit_type || !ispath(outfit_type))
|
||||
return
|
||||
return outfit_type
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
|
||||
/mob/proc/Animalize()
|
||||
var/mobtext = input("Filter to a type name", "Choose a type") as text
|
||||
var/mobpath = filter_list_input("Which type of mob should [src] turn into?", "Choose a type", get_matching_types(mobtext, /mob/living/simple_animal))
|
||||
var/mobpath = filter_typelist_input("Which type of mob should [src] turn into?", "Choose a type", get_matching_types(mobtext, /mob/living/simple_animal))
|
||||
if(!mobpath)
|
||||
return
|
||||
if(!safe_animal(mobpath))
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
//Then set an associative value equal to the new value you want to change it to.
|
||||
//aka if you want to change the damage to 25, add a list with entry: text damage and associated value num 25
|
||||
var/list/bullet_overrides
|
||||
//And this overrides whatever's in the chamber.
|
||||
var/bullet_type_override
|
||||
|
||||
/obj/item/weapon/gun/New()
|
||||
..()
|
||||
@@ -259,6 +261,9 @@
|
||||
if(!process_chambered() || jammed) //CHECK
|
||||
return click_empty(user)
|
||||
|
||||
if(bullet_type_override && ispath(bullet_type_override, /obj/item/projectile))
|
||||
in_chamber = new bullet_type_override
|
||||
|
||||
if(!in_chamber)
|
||||
return
|
||||
if(defective)
|
||||
@@ -308,8 +313,6 @@
|
||||
|
||||
user.apply_inertia(get_dir(target, user))
|
||||
|
||||
play_firesound(user, reflex)
|
||||
|
||||
in_chamber.original = target
|
||||
in_chamber.forceMove(get_turf(user))
|
||||
in_chamber.starting = get_turf(user)
|
||||
@@ -346,6 +349,8 @@
|
||||
if(bvar == o)
|
||||
in_chamber.vars[bvar] = bullet_overrides[o]
|
||||
|
||||
play_firesound(user, reflex)
|
||||
|
||||
spawn()
|
||||
if(in_chamber)
|
||||
in_chamber.process()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
var/list/restricted_roulette_projectiles = list(
|
||||
/obj/item/projectile,
|
||||
/obj/item/projectile/energy,
|
||||
/obj/item/projectile/hookshot,
|
||||
/obj/item/projectile/bullet/blastwave,
|
||||
/obj/item/projectile/beam/lightning,
|
||||
/obj/item/projectile/beam/procjectile,
|
||||
@@ -21,6 +20,7 @@ var/list/restricted_roulette_projectiles = list(
|
||||
|
||||
var/list/restrict_with_subtypes = list(
|
||||
/obj/item/projectile/meteor,
|
||||
/obj/item/projectile/hookshot,
|
||||
/obj/item/projectile/immovablerod
|
||||
)
|
||||
|
||||
@@ -87,6 +87,9 @@ var/list/restrict_with_subtypes = list(
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/roulette_revolver/proc/choose_projectile()
|
||||
if(bullet_type_override)
|
||||
in_chamber = new bullet_type_override
|
||||
return
|
||||
var/chosen_projectile = pick(available_projectiles)
|
||||
for(var/I in restricted_roulette_projectiles)
|
||||
if(chosen_projectile == I)
|
||||
|
||||
Reference in New Issue
Block a user