mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
da0843e96d
* Add Variety of Food secondary goal, small tweaks. * oops * Apply suggestions from code review Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * No slasher movies, please. * No prions for CC, please. * Update code/modules/station_goals/secondary/botany/kudzu_goal.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Update code/modules/station_goals/secondary/kitchen/variety_food.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Update variety_food.dm --------- Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com> Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
103 lines
3.4 KiB
Plaintext
103 lines
3.4 KiB
Plaintext
/datum/station_goal/secondary/random_bulk_reagent
|
|
name = "Random Bulk Reagent"
|
|
progress_type = /datum/secondary_goal_progress/random_bulk_reagent
|
|
var/datum/reagent/reagent_type
|
|
var/amount
|
|
var/department_account
|
|
var/reward
|
|
|
|
/datum/station_goal/secondary/random_bulk_reagent/Initialize(requester_account)
|
|
..()
|
|
admin_desc = "[amount] units of [initial(reagent_type.name)]"
|
|
|
|
/datum/station_goal/secondary/random_bulk_reagent/randomize_params()
|
|
var/list/valid_reagents = list()
|
|
for(var/R in subtypesof(/datum/reagent))
|
|
var/datum/reagent/candidate = R
|
|
if(initial(candidate.goal_department) != department)
|
|
continue
|
|
if(initial(candidate.goal_difficulty) == REAGENT_GOAL_SKIP)
|
|
// Too easy, don't want.
|
|
continue
|
|
if(initial(candidate.goal_difficulty) == REAGENT_GOAL_EXCESSIVE)
|
|
// Too hard, don't ask for.
|
|
continue
|
|
valid_reagents += candidate
|
|
|
|
if(!valid_reagents)
|
|
reagent_type = /datum/reagent/water
|
|
amount = 100
|
|
return
|
|
|
|
reagent_type = pick(valid_reagents)
|
|
switch(initial(reagent_type.goal_difficulty))
|
|
if(REAGENT_GOAL_EASY)
|
|
amount = 600
|
|
reward = SSeconomy.credits_per_easy_reagent_goal
|
|
if(REAGENT_GOAL_NORMAL)
|
|
amount = 300
|
|
reward = SSeconomy.credits_per_normal_reagent_goal
|
|
else // REAGENT_GOAL_HARD
|
|
amount = 50
|
|
reward = SSeconomy.credits_per_hard_reagent_goal
|
|
|
|
|
|
/datum/secondary_goal_progress/random_bulk_reagent
|
|
var/datum/reagent/reagent_type
|
|
var/needed
|
|
var/sent = 0
|
|
var/department
|
|
var/department_account
|
|
var/reward
|
|
|
|
/datum/secondary_goal_progress/random_bulk_reagent/configure(datum/station_goal/secondary/random_bulk_reagent/goal)
|
|
..(goal)
|
|
reagent_type = goal.reagent_type
|
|
needed = goal.amount
|
|
department = goal.department
|
|
department_account = goal.department_account
|
|
reward = goal.reward
|
|
|
|
/datum/secondary_goal_progress/random_bulk_reagent/Copy()
|
|
var/datum/secondary_goal_progress/random_bulk_reagent/copy = ..()
|
|
copy.reagent_type = reagent_type
|
|
copy.needed = needed
|
|
copy.sent = sent
|
|
// These ones aren't really needed in the intended use case, they're
|
|
// just here in case someone uses this method somewhere else.
|
|
copy.department = department
|
|
copy.department_account = department_account
|
|
copy.reward = reward
|
|
return copy
|
|
|
|
/datum/secondary_goal_progress/random_bulk_reagent/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
|
|
// Not in a matching personal crate? Ignore.
|
|
if(!check_personal_crate(AM))
|
|
return
|
|
|
|
var/amount = AM.reagents?.get_reagent_amount(initial(reagent_type.id))
|
|
if(!amount)
|
|
return
|
|
sent += amount
|
|
if(!manifest)
|
|
return COMSIG_CARGO_SELL_PRIORITY
|
|
|
|
SSblackbox.record_feedback("nested tally", "secondary goals", 1, list(goal_name, "reagents", initial(reagent_type.id), "containers"))
|
|
SSblackbox.record_feedback("nested tally", "secondary goals", amount, list(goal_name, "reagents", initial(reagent_type.id), "units"))
|
|
var/datum/economy/line_item/item = new
|
|
item.account = department_account
|
|
item.credits = 0
|
|
item.reason = "Received [amount] units of [initial(reagent_type.name)]."
|
|
item.requests_console_department = department
|
|
item.zero_is_good = TRUE
|
|
manifest.line_items += item
|
|
|
|
return COMSIG_CARGO_SELL_PRIORITY
|
|
|
|
/datum/secondary_goal_progress/random_bulk_reagent/check_complete(datum/economy/cargo_shuttle_manifest/manifest)
|
|
if(sent < needed - REAGENT_GOAL_FORGIVENESS)
|
|
return
|
|
|
|
three_way_reward(manifest, department, department_account, reward, "Secondary goal complete: [needed] units of [initial(reagent_type.name)].")
|
|
return TRUE
|