diff --git a/code/game/gamemodes/objective_items.dm b/code/game/gamemodes/objective_items.dm index 2f756b21345..7b0c0360c62 100644 --- a/code/game/gamemodes/objective_items.dm +++ b/code/game/gamemodes/objective_items.dm @@ -113,9 +113,6 @@ targetitem = /obj/item/clothing/shoes/clown_shoes excludefromjob = list(JOB_CLOWN, JOB_CARGO_TECHNICIAN, JOB_QUARTERMASTER) -/obj/item/clothing/shoes/clown_shoes/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/clothing/shoes/clown_shoes) - /datum/objective_item/steal/low_risk/clown_shoes/TargetExists() for(var/mob/player as anything in GLOB.player_list) if(player.stat == DEAD) @@ -213,9 +210,6 @@ difficulty = 5 excludefromjob = list(JOB_CAPTAIN) -/obj/item/disk/nuclear/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/disk/nuclear) - /datum/objective_item/steal/nukedisc/check_special_completion(obj/item/disk/nuclear/N) return !N.fake @@ -283,9 +277,6 @@ valid_containers = list(/obj/item/nuke_core_container/supermatter) difficulty = 15 -/obj/item/nuke_core/supermatter_sliver/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/nuke_core/supermatter_sliver) - /datum/objective_item/steal/supermatter/New() special_equipment += /obj/item/storage/box/syndie_kit/supermatter ..() @@ -303,9 +294,6 @@ JOB_RESEARCH_DIRECTOR, JOB_SCIENTIST, JOB_ROBOTICIST, ) -/obj/item/tank/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/tank) - /datum/objective_item/steal/plasma/check_special_completion(obj/item/tank/T) var/target_amount = text2num(name) var/found_amount = 0 @@ -319,9 +307,6 @@ targetitem = /obj/item/aicard difficulty = 20 //beyond the impossible -/obj/item/aicard/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/aicard) - /datum/objective_item/steal/functionalai/check_special_completion(obj/item/aicard/C) for(var/mob/living/silicon/ai/A in C) if(isAI(A) && A.stat != DEAD) //See if any AI's are alive inside that card. @@ -354,9 +339,6 @@ difficulty = 3 excludefromjob = list(JOB_RESEARCH_DIRECTOR, JOB_SCIENTIST) -/obj/item/slime_extract/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/slime_extract) - /datum/objective_item/steal/slime/check_special_completion(obj/item/slime_extract/E) if(E.Uses > 0) return 1 @@ -399,49 +381,31 @@ targetitem = /obj/item/gun/energy/e_gun/nuclear difficulty = 10 -/obj/item/gun/energy/e_gun/nuclear/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/gun/energy/e_gun/nuclear) - /datum/objective_item/special/ddrill name = "a diamond drill" targetitem = /obj/item/pickaxe/drill/diamonddrill difficulty = 10 -/obj/item/pickaxe/drill/diamonddrill/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/pickaxe/drill/diamonddrill) - /datum/objective_item/special/boh name = "a bag of holding" targetitem = /obj/item/storage/backpack/holding difficulty = 10 -/obj/item/storage/backpack/holding/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/storage/backpack/holding) - /datum/objective_item/special/hypercell name = "a hyper-capacity power cell" targetitem = /obj/item/stock_parts/cell/hyper difficulty = 5 -/obj/item/stock_parts/cell/hyper/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/stock_parts/cell/hyper) - /datum/objective_item/special/laserpointer name = "a laser pointer" targetitem = /obj/item/laser_pointer difficulty = 5 -/obj/item/laser_pointer/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/laser_pointer) - /datum/objective_item/special/corgimeat name = "a piece of corgi meat" targetitem = /obj/item/food/meat/slab/corgi difficulty = 5 -/obj/item/food/meat/slab/corgi/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/food/meat/slab/corgi) - /datum/objective_item/stack/New() ..() if(TargetExists()) @@ -459,8 +423,6 @@ targetitem = /obj/item/stack/sheet/cardboard difficulty = 9001 -/obj/item/stack/sheet/cardboard/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/stack/sheet/cardboard) /datum/objective_item/stack/check_special_completion(obj/item/stack/S) var/target_amount = text2num(name) @@ -475,23 +437,14 @@ targetitem = /obj/item/stack/sheet/mineral/diamond difficulty = 10 -/obj/item/stack/sheet/mineral/diamond/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/stack/sheet/mineral/diamond) - /datum/objective_item/stack/gold name = "50 gold bars" targetitem = /obj/item/stack/sheet/mineral/gold difficulty = 15 -/obj/item/stack/sheet/mineral/gold/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/stack/sheet/mineral/gold) - /datum/objective_item/stack/uranium name = "25 refined uranium bars" targetitem = /obj/item/stack/sheet/mineral/uranium difficulty = 10 -/obj/item/stack/sheet/mineral/uranium/add_stealing_item_objective() - ADD_STEAL_ITEM(src, /obj/item/stack/sheet/mineral/uranium) - #undef ADD_STEAL_ITEM diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 8e4920b4952..8fa2fb10b79 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -243,7 +243,7 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_ITEM, src) if(LAZYLEN(embedding)) updateEmbedding() - if(mapload) + if(mapload && !GLOB.steal_item_handler.generated_items) add_stealing_item_objective() /obj/item/Destroy(force) diff --git a/code/modules/antagonists/traitor/objectives/steal.dm b/code/modules/antagonists/traitor/objectives/steal.dm index 37de558a352..69e8a34ead8 100644 --- a/code/modules/antagonists/traitor/objectives/steal.dm +++ b/code/modules/antagonists/traitor/objectives/steal.dm @@ -22,6 +22,7 @@ GLOBAL_DATUM_INIT(steal_item_handler, /datum/objective_item_handler, new()) /datum/objective_item_handler var/list/objectives_by_path + var/generated_items = FALSE /datum/objective_item_handler/New() . = ..() @@ -30,7 +31,6 @@ GLOBAL_DATUM_INIT(steal_item_handler, /datum/objective_item_handler, new()) objectives_by_path[initial(item.targetitem)] = list() RegisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE, .proc/save_items) -// Very inefficient proc, only gets called when the map finishes loading. /datum/objective_item_handler/proc/save_items() for(var/obj/item/typepath as anything in objectives_by_path) for(var/obj/item/object as anything in objectives_by_path[typepath]) @@ -39,6 +39,7 @@ GLOBAL_DATUM_INIT(steal_item_handler, /datum/objective_item_handler, new()) objectives_by_path[typepath] -= object continue RegisterSignal(object, COMSIG_PARENT_QDELETING, .proc/remove_item) + generated_items = TRUE /datum/objective_item_handler/proc/remove_item(atom/source) SIGNAL_HANDLER