mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
-Added a purchasing log for uplinks. To view it, view the variables of the item with the uplink, navigate to hidden_uplink, click on it and then look at the purchase log variable.
-Sorted the following admin commands/verbs: Get Key, Get Mob, Jump to Area, Jump to Key, Jump to Mob, Player Panel, Player Panel New, Send Mob, Show Player Panel, Show Traitor Panel -Because of the recent player poll, electrified grilles will now shock you when you bump into them. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4560 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -173,6 +173,29 @@ proc/listclearnulls(list/list)
|
|||||||
K += item
|
K += item
|
||||||
return K
|
return K
|
||||||
|
|
||||||
|
//Mergesort: divides up the list into halves to begin the sort
|
||||||
|
/proc/sortKey(var/list/client/L, var/order = 1)
|
||||||
|
if(isnull(L) || L.len < 2)
|
||||||
|
return L
|
||||||
|
var/middle = L.len / 2 + 1
|
||||||
|
return mergeKey(sortKey(L.Copy(0,middle)), sortKey(L.Copy(middle)), order)
|
||||||
|
|
||||||
|
//Mergsort: does the actual sorting and returns the results back to sortAtom
|
||||||
|
/proc/mergeKey(var/list/client/L, var/list/client/R, var/order = 1)
|
||||||
|
var/Li=1
|
||||||
|
var/Ri=1
|
||||||
|
var/list/result = new()
|
||||||
|
while(Li <= L.len && Ri <= R.len)
|
||||||
|
var/client/rL = L[Li]
|
||||||
|
var/client/rR = R[Ri]
|
||||||
|
if(sorttext(rL.ckey, rR.ckey) == order)
|
||||||
|
result += L[Li++]
|
||||||
|
else
|
||||||
|
result += R[Ri++]
|
||||||
|
|
||||||
|
if(Li <= L.len)
|
||||||
|
return (result + L.Copy(Li, 0))
|
||||||
|
return (result + R.Copy(Ri, 0))
|
||||||
|
|
||||||
//Mergesort: divides up the list into halves to begin the sort
|
//Mergesort: divides up the list into halves to begin the sort
|
||||||
/proc/sortAtom(var/list/atom/L, var/order = 1)
|
/proc/sortAtom(var/list/atom/L, var/order = 1)
|
||||||
|
|||||||
@@ -403,30 +403,31 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
|||||||
|
|
||||||
return creatures
|
return creatures
|
||||||
|
|
||||||
//Orders mobs by type
|
//Orders mobs by type then by name
|
||||||
/proc/sortmobs()
|
/proc/sortmobs()
|
||||||
var/list/moblist = list()
|
var/list/moblist = list()
|
||||||
for(var/mob/living/silicon/ai/M in mob_list)
|
var/list/sortmob = sortAtom(mob_list)
|
||||||
|
for(var/mob/living/silicon/ai/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/silicon/pai/M in mob_list)
|
for(var/mob/living/silicon/pai/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/silicon/robot/M in mob_list)
|
for(var/mob/living/silicon/robot/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/carbon/human/M in mob_list)
|
for(var/mob/living/carbon/human/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/carbon/brain/M in mob_list)
|
for(var/mob/living/carbon/brain/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/carbon/alien/M in mob_list)
|
for(var/mob/living/carbon/alien/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/dead/observer/M in mob_list)
|
for(var/mob/dead/observer/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/new_player/M in mob_list)
|
for(var/mob/new_player/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/carbon/monkey/M in mob_list)
|
for(var/mob/living/carbon/monkey/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/carbon/metroid/M in mob_list)
|
for(var/mob/living/carbon/metroid/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
for(var/mob/living/simple_animal/M in mob_list)
|
for(var/mob/living/simple_animal/M in sortmob)
|
||||||
moblist.Add(M)
|
moblist.Add(M)
|
||||||
// for(var/mob/living/silicon/hivebot/M in world)
|
// for(var/mob/living/silicon/hivebot/M in world)
|
||||||
// mob_list.Add(M)
|
// mob_list.Add(M)
|
||||||
@@ -766,6 +767,17 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
|
|||||||
if(A.vars.Find(lowertext(varname))) return 1
|
if(A.vars.Find(lowertext(varname))) return 1
|
||||||
else return 0
|
else return 0
|
||||||
|
|
||||||
|
//Returns: all the areas in the world
|
||||||
|
/proc/return_areas()
|
||||||
|
var/list/area/areas = list()
|
||||||
|
for(var/area/A in world)
|
||||||
|
areas += A
|
||||||
|
return areas
|
||||||
|
|
||||||
|
//Returns: all the areas in the world, sorted.
|
||||||
|
/proc/return_sorted_areas()
|
||||||
|
return sortAtom(return_areas())
|
||||||
|
|
||||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||||
//Returns: A list of all areas of that type in the world.
|
//Returns: A list of all areas of that type in the world.
|
||||||
/proc/get_areas(var/areatype)
|
/proc/get_areas(var/areatype)
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
|
|||||||
name = "Hidden Uplink."
|
name = "Hidden Uplink."
|
||||||
desc = "There is something wrong if you're examining this."
|
desc = "There is something wrong if you're examining this."
|
||||||
var/active = 0
|
var/active = 0
|
||||||
|
var/list/purchase_log = list()
|
||||||
|
|
||||||
// The hidden uplink MUST be inside an obj/item's contents.
|
// The hidden uplink MUST be inside an obj/item's contents.
|
||||||
/obj/item/device/uplink/hidden/New()
|
/obj/item/device/uplink/hidden/New()
|
||||||
@@ -336,6 +337,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
|
|||||||
if(ishuman(usr))
|
if(ishuman(usr))
|
||||||
var/mob/living/carbon/human/A = usr
|
var/mob/living/carbon/human/A = usr
|
||||||
A.put_in_any_hand_if_possible(I)
|
A.put_in_any_hand_if_possible(I)
|
||||||
|
purchase_log += "[usr] ([usr.ckey]) bought [I]."
|
||||||
interact(usr)
|
interact(usr)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@
|
|||||||
del(src)
|
del(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Bumped(atom/user)
|
||||||
|
if(ismob(user)) shock(user, 70)
|
||||||
|
|
||||||
|
|
||||||
meteorhit(var/obj/M)
|
meteorhit(var/obj/M)
|
||||||
if (M.icon_state == "flaming")
|
if (M.icon_state == "flaming")
|
||||||
|
|||||||
@@ -3009,7 +3009,7 @@ var/global/BSACooldown = 0
|
|||||||
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|
||||||
|
|
||||||
/obj/admins/proc/show_traitor_panel(var/mob/M in mob_list)
|
/obj/admins/proc/show_traitor_panel(var/mob/M in sortmobs())
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set desc = "Edit mobs's memory and role"
|
set desc = "Edit mobs's memory and role"
|
||||||
set name = "Show Traitor Panel"
|
set name = "Show Traitor Panel"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/client/proc/Jump(var/area/A in world)
|
/client/proc/Jump(var/area/A in return_sorted_areas())
|
||||||
set name = "Jump to Area"
|
set name = "Jump to Area"
|
||||||
set desc = "Area to jump to"
|
set desc = "Area to jump to"
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
alert("Admin jumping disabled")
|
alert("Admin jumping disabled")
|
||||||
return
|
return
|
||||||
|
|
||||||
/client/proc/jumptomob(var/mob/M in mob_list)
|
/client/proc/jumptomob(var/mob/M in sortmobs())
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Jump to Mob"
|
set name = "Jump to Mob"
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
var/list/keys = list()
|
var/list/keys = list()
|
||||||
for(var/mob/M in player_list)
|
for(var/mob/M in player_list)
|
||||||
keys += M.client
|
keys += M.client
|
||||||
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in keys
|
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys)
|
||||||
if(!selection)
|
if(!selection)
|
||||||
return
|
return
|
||||||
var/mob/M = selection:mob
|
var/mob/M = selection:mob
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
else
|
else
|
||||||
alert("Admin jumping disabled")
|
alert("Admin jumping disabled")
|
||||||
|
|
||||||
/client/proc/Getmob(var/mob/M in mob_list)
|
/client/proc/Getmob(var/mob/M in sortmobs())
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Get Mob"
|
set name = "Get Mob"
|
||||||
set desc = "Mob to teleport"
|
set desc = "Mob to teleport"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
var/list/keys = list()
|
var/list/keys = list()
|
||||||
for(var/mob/M in player_list)
|
for(var/mob/M in player_list)
|
||||||
keys += M.client
|
keys += M.client
|
||||||
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in keys
|
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys)
|
||||||
if(!selection)
|
if(!selection)
|
||||||
return
|
return
|
||||||
var/mob/M = selection:mob
|
var/mob/M = selection:mob
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
else
|
else
|
||||||
alert("Admin jumping disabled")
|
alert("Admin jumping disabled")
|
||||||
|
|
||||||
/client/proc/sendmob(var/mob/M in mob_list, var/area/A in world)
|
/client/proc/sendmob(var/mob/M in sortmobs(), var/area/A in return_sorted_areas())
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Send Mob"
|
set name = "Send Mob"
|
||||||
if(!src.holder)
|
if(!src.holder)
|
||||||
|
|||||||
Reference in New Issue
Block a user