mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-14 17:36:52 +01:00
Merge remote-tracking branch 'bay12-upstream/master' into development
This commit is contained in:
@@ -14,140 +14,9 @@
|
||||
|
||||
feedback_add_details("admin_verb","DG2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
// callproc moved to code/modules/admin/callproc
|
||||
|
||||
|
||||
/* 21st Sept 2010
|
||||
Updated by Skie -- Still not perfect but better!
|
||||
Stuff you can't do:
|
||||
Call proc /mob/proc/make_dizzy() for some player
|
||||
Because if you select a player mob as owner it tries to do the proc for
|
||||
/mob/living/carbon/human/ instead. And that gives a run-time error.
|
||||
But you can call procs that are of type /mob/living/carbon/human/proc/ for that player.
|
||||
*/
|
||||
|
||||
/client/proc/callproc()
|
||||
set category = "Debug"
|
||||
set name = "Advanced ProcCall"
|
||||
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
if(config.debugparanoid && !check_rights(R_ADMIN)) return
|
||||
|
||||
spawn(0)
|
||||
var/target = null
|
||||
var/targetselected = 0
|
||||
var/lst[] // List reference
|
||||
lst = new/list() // Make the list
|
||||
var/returnval = null
|
||||
var/class = null
|
||||
|
||||
switch(alert("Proc owned by something?",,"Yes","No"))
|
||||
if("Yes")
|
||||
targetselected = 1
|
||||
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client")
|
||||
switch(class)
|
||||
if("Obj")
|
||||
target = input("Enter target:","Target",usr) as obj in world
|
||||
if("Mob")
|
||||
target = input("Enter target:","Target",usr) as mob in world
|
||||
if("Area or Turf")
|
||||
target = input("Enter target:","Target",usr.loc) as area|turf in world
|
||||
if("Client")
|
||||
var/list/keys = list()
|
||||
for(var/client/C)
|
||||
keys += C
|
||||
target = input("Please, select a player!", "Selection", null, null) as null|anything in keys
|
||||
else
|
||||
return
|
||||
if("No")
|
||||
target = null
|
||||
targetselected = 0
|
||||
|
||||
var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null
|
||||
if(!procname) return
|
||||
|
||||
if(targetselected)
|
||||
if(!target)
|
||||
usr << "<span class='danger'>Your target no longer exists.</span>"
|
||||
return
|
||||
if(!hascall(target,procname))
|
||||
usr << "<font color='red'>Error: callproc(): target has no such call [procname].</font>"
|
||||
return
|
||||
else
|
||||
if(copytext(procname, 1, 7) == "/proc/")
|
||||
// nothing
|
||||
else if(copytext(procname, 1, 6) == "proc/")
|
||||
procname = "/[procname]"
|
||||
else if(copytext(procname, 1, 2) == "/")
|
||||
procname = "/proc[procname]"
|
||||
else
|
||||
procname = "/proc/[procname]"
|
||||
// Procs have the strange property that text2path will return non-null, but ispath() will return false.
|
||||
var/path = text2path(procname)
|
||||
if(!path || ispath(path))
|
||||
usr << "<span class='danger'>Invalid proc [procname]</span>"
|
||||
return
|
||||
|
||||
var/argnum = input("Number of arguments","Number:",0) as num|null
|
||||
if(!argnum && (argnum!=0)) return
|
||||
|
||||
lst.len = argnum // Expand to right length
|
||||
//TODO: make a list to store whether each argument was initialised as null.
|
||||
//Reason: So we can abort the proccall if say, one of our arguments was a mob which no longer exists
|
||||
//this will protect us from a fair few errors ~Carn
|
||||
|
||||
var/i
|
||||
for(i=1, i<argnum+1, i++) // Lists indexed from 1 forwards in byond
|
||||
|
||||
// Make a list with each index containing one variable, to be given to the proc
|
||||
class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","icon","file","client","mob's area","CANCEL")
|
||||
switch(class)
|
||||
if("CANCEL")
|
||||
return
|
||||
|
||||
if("text")
|
||||
lst[i] = input("Enter new text:","Text",null) as text
|
||||
|
||||
if("num")
|
||||
lst[i] = input("Enter new number:","Num",0) as num
|
||||
|
||||
if("type")
|
||||
lst[i] = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
||||
|
||||
if("reference")
|
||||
lst[i] = input("Select reference:","Reference",src) as mob|obj|turf|area in world
|
||||
|
||||
if("mob reference")
|
||||
lst[i] = input("Select reference:","Reference",usr) as mob in world
|
||||
|
||||
if("file")
|
||||
lst[i] = input("Pick file:","File") as file
|
||||
|
||||
if("icon")
|
||||
lst[i] = input("Pick icon:","Icon") as icon
|
||||
|
||||
if("client")
|
||||
var/list/keys = list()
|
||||
for(var/mob/M in world)
|
||||
keys += M.client
|
||||
lst[i] = input("Please, select a player!", "Selection", null, null) as null|anything in keys
|
||||
|
||||
if("mob's area")
|
||||
var/mob/temp = input("Select mob", "Selection", usr) as mob in world
|
||||
lst[i] = temp.loc
|
||||
|
||||
if(targetselected)
|
||||
if(!target)
|
||||
usr << "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>"
|
||||
return
|
||||
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
|
||||
else
|
||||
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
|
||||
|
||||
usr << "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
|
||||
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/Cell()
|
||||
set category = "Debug"
|
||||
set name = "Cell"
|
||||
@@ -232,23 +101,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
paiController.pai_candidates.Remove(candidate)
|
||||
feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_alienize(var/mob/M in mob_list)
|
||||
set category = "Fun"
|
||||
set name = "Make Alien"
|
||||
|
||||
if(!ticker)
|
||||
alert("Wait until the game starts")
|
||||
return
|
||||
if(ishuman(M))
|
||||
log_admin("[key_name(src)] has alienized [M.key].")
|
||||
spawn(10)
|
||||
M:Alienize()
|
||||
feedback_add_details("admin_verb","MKAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] made [key_name(M)] into an alien.")
|
||||
message_admins("\blue [key_name_admin(usr)] made [key_name(M)] into an alien.", 1)
|
||||
else
|
||||
alert("Invalid mob")
|
||||
|
||||
/client/proc/cmd_admin_slimeize(var/mob/M in mob_list)
|
||||
set category = "Fun"
|
||||
set name = "Make slime"
|
||||
@@ -267,7 +119,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
alert("Invalid mob")
|
||||
|
||||
/*
|
||||
/client/proc/cmd_admin_monkeyize(var/mob/M in world)
|
||||
/client/proc/cmd_admin_monkeyize(var/mob/M in mob_list)
|
||||
set category = "Fun"
|
||||
set name = "Make Monkey"
|
||||
|
||||
@@ -282,7 +134,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
else
|
||||
alert("Invalid mob")
|
||||
|
||||
/client/proc/cmd_admin_changelinginize(var/mob/M in world)
|
||||
/client/proc/cmd_admin_changelinginize(var/mob/M in mob_list)
|
||||
set category = "Fun"
|
||||
set name = "Make Changeling"
|
||||
|
||||
@@ -300,7 +152,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
alert("Invalid mob")
|
||||
*/
|
||||
/*
|
||||
/client/proc/cmd_admin_abominize(var/mob/M in world)
|
||||
/client/proc/cmd_admin_abominize(var/mob/M in mob_list)
|
||||
set category = null
|
||||
set name = "Make Abomination"
|
||||
|
||||
@@ -317,7 +169,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
*/
|
||||
/*
|
||||
/client/proc/make_cultist(var/mob/M in world) // -- TLE, modified by Urist
|
||||
/client/proc/make_cultist(var/mob/M in mob_list) // -- TLE, modified by Urist
|
||||
set category = "Fun"
|
||||
set name = "Make Cultist"
|
||||
set desc = "Makes target a cultist"
|
||||
@@ -405,11 +257,11 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/obj/item/device/pda/pda = H.wear_id
|
||||
id = pda.id
|
||||
id.icon_state = "gold"
|
||||
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
|
||||
id.access = get_all_accesses()
|
||||
else
|
||||
var/obj/item/weapon/card/id/id = new/obj/item/weapon/card/id(M);
|
||||
id.icon_state = "gold"
|
||||
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
|
||||
id.access = get_all_accesses()
|
||||
id.registered_name = H.real_name
|
||||
id.assignment = "Captain"
|
||||
id.name = "[id.registered_name]'s ID Card ([id.assignment])"
|
||||
@@ -624,9 +476,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/under/det(M), slot_w_uniform)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/det_suit(M), slot_wear_suit)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/det_trench(M), slot_wear_suit)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/plain/monocle(M), slot_glasses)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(M), slot_head)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/head/det(M), slot_head)
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store)
|
||||
|
||||
@@ -659,13 +511,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_r_store)
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_l_store)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
M.equip_to_slot_or_del(new /obj/item/stack/tile/floor(M), slot_in_backpack)
|
||||
|
||||
if ("pirate")
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform)
|
||||
@@ -701,7 +553,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.assignment = "Tunnel Clown!"
|
||||
W.registered_name = M.real_name
|
||||
M.equip_to_slot_or_del(W, slot_wear_id)
|
||||
@@ -758,7 +610,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/obj/item/weapon/card/id/syndicate/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.assignment = "Reaper"
|
||||
W.registered_name = M.real_name
|
||||
M.equip_to_slot_or_del(W, slot_wear_id)
|
||||
@@ -788,7 +640,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.icon_state = "centcom"
|
||||
W.item_state = "id_inv"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.access += list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer")
|
||||
W.assignment = "NanoTrasen Navy Representative"
|
||||
W.registered_name = M.real_name
|
||||
@@ -812,7 +664,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/obj/item/weapon/card/id/centcom/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "NanoTrasen Navy Officer"
|
||||
W.registered_name = M.real_name
|
||||
@@ -837,7 +689,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/obj/item/weapon/card/id/centcom/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "NanoTrasen Navy Captain"
|
||||
W.registered_name = M.real_name
|
||||
@@ -855,7 +707,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.icon_state = "centcom"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "Emergency Response Team"
|
||||
W.registered_name = M.real_name
|
||||
@@ -877,7 +729,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.icon_state = "centcom"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "Special Operations Officer"
|
||||
W.registered_name = M.real_name
|
||||
@@ -931,7 +783,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
W.icon_state = "centcom"
|
||||
W.access = get_all_accesses()
|
||||
W.access = get_all_station_access()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "Admiral"
|
||||
W.registered_name = M.real_name
|
||||
@@ -994,89 +846,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(SMES.anchored)
|
||||
SMES.input_attempt = 1
|
||||
|
||||
/client/proc/setup_supermatter_engine()
|
||||
set category = "Debug"
|
||||
set name = "Setup supermatter"
|
||||
set desc = "Sets up the supermatter engine"
|
||||
|
||||
if(!check_rights(R_DEBUG|R_ADMIN)) return
|
||||
|
||||
var/response = alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Setup Completely","Setup except coolant","No")
|
||||
|
||||
if(response == "No")
|
||||
return
|
||||
|
||||
var/found_the_pump = 0
|
||||
var/obj/machinery/power/supermatter/SM
|
||||
|
||||
for(var/obj/machinery/M in world)
|
||||
if(!M)
|
||||
continue
|
||||
if(!M.loc)
|
||||
continue
|
||||
if(!M.loc.loc)
|
||||
continue
|
||||
|
||||
if(istype(M.loc.loc,/area/engineering/engine_room))
|
||||
if(istype(M,/obj/machinery/power/rad_collector))
|
||||
var/obj/machinery/power/rad_collector/Rad = M
|
||||
Rad.anchored = 1
|
||||
Rad.connect_to_network()
|
||||
|
||||
var/obj/item/weapon/tank/phoron/Phoron = new/obj/item/weapon/tank/phoron(Rad)
|
||||
|
||||
Phoron.air_contents.gas["phoron"] = 29.1154 //This is a full tank if you filled it from a canister
|
||||
Rad.P = Phoron
|
||||
|
||||
Phoron.loc = Rad
|
||||
|
||||
if(!Rad.active)
|
||||
Rad.toggle_power()
|
||||
Rad.update_icon()
|
||||
|
||||
else if(istype(M,/obj/machinery/atmospherics/binary/pump)) //Turning on every pump.
|
||||
var/obj/machinery/atmospherics/binary/pump/Pump = M
|
||||
if(Pump.name == "Engine Feed" && response == "Setup Completely")
|
||||
found_the_pump = 1
|
||||
Pump.air2.gas["nitrogen"] = 3750 //The contents of 2 canisters.
|
||||
Pump.air2.temperature = 50
|
||||
Pump.air2.update_values()
|
||||
Pump.use_power=1
|
||||
Pump.target_pressure = 4500
|
||||
Pump.update_icon()
|
||||
|
||||
else if(istype(M,/obj/machinery/power/supermatter))
|
||||
SM = M
|
||||
spawn(50)
|
||||
SM.power = 320
|
||||
|
||||
else if(istype(M,/obj/machinery/power/smes)) //This is the SMES inside the engine room. We don't need much power.
|
||||
var/obj/machinery/power/smes/SMES = M
|
||||
SMES.input_attempt = 1
|
||||
SMES.input_level = 200000
|
||||
SMES.output_level = 75000
|
||||
|
||||
else if(istype(M.loc.loc,/area/engineering/engine_smes)) //Set every SMES to charge and spit out 300,000 power between the 4 of them.
|
||||
if(istype(M,/obj/machinery/power/smes))
|
||||
var/obj/machinery/power/smes/SMES = M
|
||||
SMES.input_attempt = 1
|
||||
SMES.input_level = 200000
|
||||
SMES.output_level = 75000
|
||||
|
||||
if(!found_the_pump && response == "Setup Completely")
|
||||
src << "\red Unable to locate air supply to fill up with coolant, adding some coolant around the supermatter"
|
||||
var/turf/simulated/T = SM.loc
|
||||
T.zone.air.gas["nitrogen"] += 450
|
||||
T.zone.air.temperature = 50
|
||||
T.zone.air.update_values()
|
||||
|
||||
|
||||
log_admin("[key_name(usr)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant" : ""]")
|
||||
message_admins("\blue [key_name_admin(usr)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant": ""]", 1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/client/proc/cmd_debug_mob_lists()
|
||||
set category = "Debug"
|
||||
set name = "Debug Mob Lists"
|
||||
|
||||
Reference in New Issue
Block a user