mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-25 17:12:12 +00:00
96 lines
3.0 KiB
Plaintext
96 lines
3.0 KiB
Plaintext
/// How many jobs have bounties, minus the random civ bounties. PLEASE INCREASE THIS NUMBER AS MORE DEPTS ARE ADDED TO BOUNTIES.
|
|
#define MAXIMUM_BOUNTY_JOBS 14
|
|
|
|
/datum/bounty
|
|
var/name
|
|
var/description
|
|
var/reward = 1000 // In credits.
|
|
var/claimed = FALSE
|
|
var/high_priority = FALSE
|
|
|
|
/datum/bounty/proc/can_claim()
|
|
return !claimed
|
|
|
|
/// Called when the claim button is clicked. Override to provide fancy rewards.
|
|
/datum/bounty/proc/claim()
|
|
if(can_claim())
|
|
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR)
|
|
if(D)
|
|
D.adjust_money(reward * SSeconomy.bounty_modifier)
|
|
claimed = TRUE
|
|
|
|
/// If an item sent in the cargo shuttle can satisfy the bounty.
|
|
/datum/bounty/proc/applies_to(obj/O)
|
|
return FALSE
|
|
|
|
/// Called when an object is shipped on the cargo shuttle.
|
|
/datum/bounty/proc/ship(obj/O)
|
|
return
|
|
|
|
/** Returns a new bounty of random type, but does not add it to GLOB.bounties_list.
|
|
*
|
|
* *Guided determines what specific catagory of bounty should be chosen.
|
|
*/
|
|
/proc/random_bounty(guided = 0)
|
|
var/bounty_num
|
|
var/chosen_type
|
|
var/bounty_succeeded = FALSE
|
|
var/datum/bounty/item/bounty_ref
|
|
while(!bounty_succeeded)
|
|
if(guided && (guided != CIV_JOB_RANDOM))
|
|
bounty_num = guided
|
|
else
|
|
bounty_num = rand(1, MAXIMUM_BOUNTY_JOBS)
|
|
switch(bounty_num)
|
|
if(CIV_JOB_BASIC)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/assistant))
|
|
if(CIV_JOB_ROBO)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/mech))
|
|
if(CIV_JOB_CHEF)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/chef) + subtypesof(/datum/bounty/reagent/chef))
|
|
if(CIV_JOB_SEC)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/security))
|
|
if(CIV_JOB_DRINK)
|
|
if(prob(50))
|
|
chosen_type = /datum/bounty/reagent/simple_drink
|
|
else
|
|
chosen_type = /datum/bounty/reagent/complex_drink
|
|
if(CIV_JOB_CHEM)
|
|
if(prob(50))
|
|
chosen_type = /datum/bounty/reagent/chemical_simple
|
|
else
|
|
chosen_type = /datum/bounty/reagent/chemical_complex
|
|
if(CIV_JOB_VIRO)
|
|
chosen_type = pick(subtypesof(/datum/bounty/virus))
|
|
if(CIV_JOB_SCI)
|
|
if(prob(50))
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/science))
|
|
else
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/slime))
|
|
if(CIV_JOB_ENG)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/engineering))
|
|
if(CIV_JOB_MINE)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/mining))
|
|
if(CIV_JOB_MED)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/medical))
|
|
if(CIV_JOB_GROW)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/botany))
|
|
if(CIV_JOB_ATMOS)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/atmospherics))
|
|
if(CIV_JOB_BITRUN)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/bitrunning))
|
|
//BUBBER EDIT START
|
|
if(CIV_JOB_SMITH)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/blacksmith))
|
|
if(CIV_JOB_PRISONER)
|
|
chosen_type = pick(subtypesof(/datum/bounty/item/prisoner))
|
|
//BUBBER EDIT END
|
|
bounty_ref = new chosen_type
|
|
if(bounty_ref.can_get())
|
|
bounty_succeeded = TRUE
|
|
else
|
|
qdel(bounty_ref)
|
|
return bounty_ref
|
|
|
|
#undef MAXIMUM_BOUNTY_JOBS
|