mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-09 23:21:02 +01:00
Heirloom Objective Framework
This commit is contained in:
@@ -41,6 +41,8 @@
|
||||
var/obj/item/heirloom
|
||||
var/where
|
||||
|
||||
GLOBAL_LIST_EMPTY(family_heirlooms)
|
||||
|
||||
/datum/quirk/family_heirloom/on_spawn()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
var/obj/item/heirloom_type
|
||||
@@ -79,6 +81,7 @@
|
||||
/obj/item/lighter,
|
||||
/obj/item/dice/d20)
|
||||
heirloom = new heirloom_type(get_turf(quirk_holder))
|
||||
GLOB.family_heirlooms += heirloom
|
||||
var/list/slots = list(
|
||||
"in your left pocket" = SLOT_L_STORE,
|
||||
"in your right pocket" = SLOT_R_STORE,
|
||||
|
||||
@@ -883,3 +883,40 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
/datum/objective/changeling_team_objective/impersonate_department/impersonate_heads
|
||||
explanation_text = "Have X or more heads of staff escape on the shuttle disguised as heads, while the real heads are dead"
|
||||
command_staff_only = TRUE
|
||||
|
||||
/datum/objective/hoard
|
||||
explanation_text = "Hoard items!"
|
||||
var/obj/item/hoarded_item = null
|
||||
|
||||
/datum/objective/hoard/get_target()
|
||||
return hoarded_item
|
||||
|
||||
/datum/objective/hoard/proc/set_target(obj/item/I)
|
||||
if(I)
|
||||
hoarded_item = I
|
||||
explanation_text = "Keep [I] on your person at all times."
|
||||
return hoarded_item
|
||||
else
|
||||
explanation_text = "Free objective"
|
||||
return
|
||||
|
||||
/datum/objective/hoard/check_completion()
|
||||
var/list/datum/mind/owners = get_owners()
|
||||
if(!hoarded_item)
|
||||
return TRUE
|
||||
for(var/datum/mind/M in owners)
|
||||
if(!isliving(M.current))
|
||||
continue
|
||||
|
||||
var/list/all_items = M.current.GetAllContents() //this should get things in cheesewheels, books, etc.
|
||||
|
||||
for(var/obj/I in all_items) //Check for items
|
||||
if(I == hoarded_item)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/objective/hoard/heirloom
|
||||
explanation_text = "Steal target heirloom!"
|
||||
|
||||
/datum/objective/hoard/heirloom/find_target()
|
||||
set_target(pick(GLOB.family_heirlooms))
|
||||
|
||||
Reference in New Issue
Block a user