mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Merge pull request #3851 from eswordthecat/wonk
Use the new recursive contents checker at steal items objective
This commit is contained in:
@@ -133,7 +133,7 @@
|
||||
/proc/recursive_hear_check(atom/O)
|
||||
var/list/processing_list = list(O)
|
||||
var/list/processed_list = list()
|
||||
var/list/found_atoms = list()
|
||||
var/found_atoms = list()
|
||||
|
||||
while (processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
@@ -153,7 +153,7 @@
|
||||
/proc/recursive_type_check(atom/O, type = /atom)
|
||||
var/list/processing_list = list(O)
|
||||
var/list/processed_list = new/list()
|
||||
var/list/found_atoms = new/list()
|
||||
var/found_atoms = new/list()
|
||||
|
||||
while (processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
@@ -232,7 +232,7 @@
|
||||
|
||||
return hear
|
||||
|
||||
/proc/get_contents_in_object(atom/O, type_path)
|
||||
/proc/get_contents_in_object(atom/O, type_path = /atom/movable)
|
||||
if (O)
|
||||
return recursive_type_check(O, type_path) - O
|
||||
else
|
||||
|
||||
@@ -209,7 +209,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
var/search_pda = TRUE
|
||||
|
||||
for (var/object in get_contents_in_object(src, /atom/movable))
|
||||
for (var/object in get_contents_in_object(src))
|
||||
if (search_id && istype(object, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/ID = object
|
||||
|
||||
|
||||
@@ -34,30 +34,28 @@
|
||||
L += get_contents(D.wrapped)
|
||||
return L
|
||||
|
||||
/datum/theft_objective/proc/check_completion(var/datum/mind/owner)
|
||||
if(!owner.current)
|
||||
return 0
|
||||
var/list/all_items = list()
|
||||
if(isliving(owner.current))
|
||||
all_items = owner.current.get_contents()
|
||||
if(areas.len)
|
||||
for(var/areatype in areas)
|
||||
var/area/area = locate(areatype)
|
||||
for(var/obj/O in area)
|
||||
all_items += O
|
||||
all_items += get_contents(O)
|
||||
if(all_items.len)
|
||||
for(var/obj/I in all_items) //Check for items
|
||||
if(istype(I, typepath))
|
||||
//Stealing the cheap autoinjector doesn't count
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/hypospray/autoinjector))
|
||||
continue
|
||||
if(areas.len)
|
||||
if(!is_type_in_list(get_area_master(I),areas))
|
||||
continue
|
||||
return 1
|
||||
return 0
|
||||
/datum/theft_objective/proc/check_completion(datum/mind/owner)
|
||||
if (owner && owner.current)
|
||||
var/all_items = new/list()
|
||||
|
||||
if (isliving(owner.current))
|
||||
all_items += get_contents_in_object(owner.current)
|
||||
|
||||
owner = null
|
||||
|
||||
for (var/area_type in areas)
|
||||
all_items += get_contents_in_object(locate(area_type), /obj)
|
||||
|
||||
for (var/obj/O in all_items)
|
||||
if (istype(O, typepath))
|
||||
if (istype(O, /obj/item/weapon/reagent_containers/hypospray/autoinjector)) // stealing the cheap autoinjector doesn't count
|
||||
continue
|
||||
|
||||
if (areas.len)
|
||||
if (is_type_in_list(get_area_master(O), areas))
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/datum/theft_objective/traitor/antique_laser_gun
|
||||
name = "the captain's antique laser gun"
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
return
|
||||
|
||||
else
|
||||
var/inside = get_contents_in_object(src, /atom/movable)
|
||||
var/inside = get_contents_in_object(src)
|
||||
|
||||
if (locate(/obj/item/weapon/disk/nuclear) in inside)
|
||||
user << "<SPAN CLASS='warning'>You get the feeling that you shouldn't cremate one of the items in the cremator.</SPAN>"
|
||||
|
||||
@@ -807,7 +807,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set category = "Special Verbs"
|
||||
set name = "Check Mob Contents"
|
||||
|
||||
for (var/content in get_contents_in_object(L, /atom/movable))
|
||||
for (var/content in get_contents_in_object(L))
|
||||
if (content)
|
||||
usr << "\icon[content] [content]"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user