Files
GS13NG/code/modules/cargo/bounties/item.dm
deathride58 2f9e3e403d Hard upstream sync (#6951)
* maps - none of our changes included yet i'll get them in after i finish up the rest of the sync

* sync part 1 - underscore folders in code

* controllers folder

* datums folder

* game folder

* cmon, work

* modules - admin to awaymissions

* cargo to events

* fields to lighting

* mapping > ruins

* rest of the code folder

* rest of the folders in the root directory

* DME

* fixes compiling errors. it compiles so it works

* readds map changes

* fixes dogborg module select

* fixes typo in moduleselect_alternate_icon filepath
2018-05-31 16:03:18 -07:00

36 lines
1.0 KiB
Plaintext

/datum/bounty/item
var/required_count = 1
var/shipped_count = 0
var/list/wanted_types // Types accepted for the bounty.
var/include_subtypes = TRUE // Set to FALSE to make the datum apply only to a strict type.
var/list/exclude_types // Types excluded.
/datum/bounty/item/New()
..()
wanted_types = typecacheof(wanted_types)
exclude_types = typecacheof(exclude_types)
/datum/bounty/item/completion_string()
return {"[shipped_count]/[required_count]"}
/datum/bounty/item/can_claim()
return ..() && shipped_count >= required_count
/datum/bounty/item/applies_to(obj/O)
if(!include_subtypes && !(O.type in wanted_types))
return FALSE
if(include_subtypes && (!is_type_in_typecache(O, wanted_types) || is_type_in_typecache(O, exclude_types)))
return FALSE
if(O.flags_1 & HOLOGRAM_1)
return FALSE
return shipped_count < required_count
/datum/bounty/item/ship(obj/O)
if(!applies_to(O))
return
shipped_count += 1
/datum/bounty/item/compatible_with(datum/other_bounty)
return type != other_bounty.type