mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Ported 'Add reagents' option in VV from TG
This commit is contained in:
@@ -275,6 +275,7 @@ client
|
||||
if(isobj(D))
|
||||
body += "<option value='?_src_=vars;delall=\ref[D]'>Delete all of type</option>"
|
||||
if(isobj(D) || ismob(D) || isturf(D))
|
||||
body += "<option value='?_src_=vars;addreagent=\ref[D]'>Add reagent</option>"
|
||||
body += "<option value='?_src_=vars;explode=\ref[D]'>Trigger explosion</option>"
|
||||
body += "<option value='?_src_=vars;emp=\ref[D]'>Trigger EM pulse</option>"
|
||||
|
||||
@@ -612,6 +613,36 @@ client
|
||||
log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ")
|
||||
message_admins("\blue [key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ")
|
||||
|
||||
else if(href_list["addreagent"]) /* Made on /TG/, credit to them. */
|
||||
if(!check_rights(0)) return
|
||||
|
||||
var/atom/A = locate(href_list["addreagent"])
|
||||
|
||||
if(!A.reagents)
|
||||
var/amount = input(usr, "Specify the reagent size of [A]", "Set Reagent Size", 50) as num
|
||||
if(amount)
|
||||
A.create_reagents(amount)
|
||||
|
||||
if(A.reagents)
|
||||
var/list/reagent_options = list()
|
||||
for(var/r_id in chemical_reagents_list)
|
||||
var/datum/reagent/R = chemical_reagents_list[r_id]
|
||||
reagent_options[R.name] = r_id
|
||||
|
||||
if(reagent_options.len)
|
||||
reagent_options = sortAssoc(reagent_options)
|
||||
reagent_options.Insert(1, "CANCEL")
|
||||
|
||||
var/chosen = input(usr, "Choose a reagent to add.", "Choose a reagent.") in reagent_options
|
||||
var/chosen_id = reagent_options[chosen]
|
||||
|
||||
if(chosen_id)
|
||||
var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num
|
||||
if(amount)
|
||||
A.reagents.add_reagent(chosen_id, amount)
|
||||
log_admin("[key_name(usr)] has added [amount] units of [chosen] to \the [A]")
|
||||
message_admins("\blue [key_name(usr)] has added [amount] units of [chosen] to \the [A]")
|
||||
|
||||
else if(href_list["explode"])
|
||||
if(!check_rights(R_DEBUG|R_FUN)) return
|
||||
|
||||
@@ -813,9 +844,9 @@ client
|
||||
|
||||
else if(href_list["addverb"])
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
|
||||
|
||||
var/mob/living/H = locate(href_list["addverb"])
|
||||
|
||||
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living"
|
||||
return
|
||||
@@ -831,7 +862,7 @@ client
|
||||
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/ai/proc,/mob/living/silicon/ai/verb)
|
||||
possibleverbs -= H.verbs
|
||||
possibleverbs += "Cancel" // ...And one for the bottom
|
||||
|
||||
|
||||
var/verb = input("Select a verb!", "Verbs",null) as anything in possibleverbs
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
@@ -840,7 +871,7 @@ client
|
||||
return
|
||||
else
|
||||
H.verbs += verb
|
||||
|
||||
|
||||
else if(href_list["remverb"])
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
|
||||
@@ -858,7 +889,7 @@ client
|
||||
else
|
||||
H.verbs -= verb
|
||||
|
||||
|
||||
|
||||
|
||||
else if(href_list["regenerateicons"])
|
||||
if(!check_rights(0)) return
|
||||
|
||||
Reference in New Issue
Block a user