mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Merge pull request #13720 from dearmochi/armor-vv
Add ability to VV an object's armor easily
This commit is contained in:
@@ -819,6 +819,59 @@
|
||||
message_admins("<span class='notice'>[key_name(usr)] has made [A] process normally</span>")
|
||||
return TRUE
|
||||
|
||||
else if(href_list["modifyarmor"])
|
||||
if(!check_rights(R_DEBUG|R_ADMIN))
|
||||
return
|
||||
var/obj/A = locateUID(href_list["modifyarmor"])
|
||||
if(!istype(A))
|
||||
return
|
||||
A.var_edited = TRUE
|
||||
var/list/armorlist = A.armor.getList()
|
||||
var/list/displaylist
|
||||
|
||||
var/result
|
||||
do
|
||||
displaylist = list()
|
||||
for(var/key in armorlist)
|
||||
displaylist += "[key] = [armorlist[key]]"
|
||||
result = input(usr, "Select an armor type to modify..", "Modify armor") as null|anything in displaylist + "(ADD ALL)" + "(SET ALL)" + "(DONE)"
|
||||
|
||||
if(result == "(DONE)")
|
||||
break
|
||||
else if(result == "(ADD ALL)" || result == "(SET ALL)")
|
||||
var/new_amount = input(usr, result == "(ADD ALL)" ? "Enter armor to add to all types:" : "Enter new armor value for all types:", "Modify all types") as num|null
|
||||
if(isnull(new_amount))
|
||||
continue
|
||||
var/proper_amount = text2num(new_amount)
|
||||
if(isnull(proper_amount))
|
||||
continue
|
||||
for(var/key in armorlist)
|
||||
armorlist[key] = (result == "(ADD ALL)" ? armorlist[key] : 0) + proper_amount
|
||||
else if(result)
|
||||
var/list/fields = splittext(result, " = ")
|
||||
if(length(fields) != 2)
|
||||
continue
|
||||
var/type = fields[1]
|
||||
if(isnull(armorlist[type]))
|
||||
continue
|
||||
var/new_amount = input(usr, "Enter new armor value for [type]:", "Modify [type]") as num|null
|
||||
if(isnull(new_amount))
|
||||
continue
|
||||
var/proper_amount = text2num(new_amount)
|
||||
if(isnull(proper_amount))
|
||||
continue
|
||||
armorlist[type] = proper_amount
|
||||
while(result)
|
||||
|
||||
if(!result || !A)
|
||||
return TRUE
|
||||
|
||||
A.armor = A.armor.setRating(armorlist["melee"], armorlist["bullet"], armorlist["laser"], armorlist["energy"], armorlist["bomb"], armorlist["bio"], armorlist["rad"], armorlist["fire"], armorlist["acid"], armorlist["magic"])
|
||||
|
||||
log_admin("[key_name(usr)] modified the armor on [A] to: melee = [armorlist["melee"]], bullet = [armorlist["bullet"]], laser = [armorlist["laser"]], energy = [armorlist["energy"]], bomb = [armorlist["bomb"]], bio = [armorlist["bio"]], rad = [armorlist["rad"]], fire = [armorlist["fire"]], acid = [armorlist["acid"]], magic = [armorlist["magic"]]")
|
||||
message_admins("<span class='notice'>[key_name(usr)] modified the armor on [A] to: melee = [armorlist["melee"]], bullet = [armorlist["bullet"]], laser = [armorlist["laser"]], energy = [armorlist["energy"]], bomb = [armorlist["bomb"]], bio = [armorlist["bio"]], rad = [armorlist["rad"]], fire = [armorlist["fire"]], acid = [armorlist["acid"]], magic = [armorlist["magic"]]")
|
||||
return TRUE
|
||||
|
||||
else if(href_list["addreagent"]) /* Made on /TG/, credit to them. */
|
||||
if(!check_rights(R_DEBUG|R_ADMIN)) return
|
||||
|
||||
|
||||
@@ -347,6 +347,7 @@ a {
|
||||
.["Make speed process"] = "?_src_=vars;makespeedy=[UID()]"
|
||||
else
|
||||
.["Make normal process"] = "?_src_=vars;makenormalspeed=[UID()]"
|
||||
.["Modify armor values"] = "?_src_=vars;modifyarmor=[UID()]"
|
||||
|
||||
/obj/proc/check_uplink_validity()
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user