Yogstation 13 - Modules - TypesVar Details - Proc Details

Department goal

Goals that a department can complete for monetary (or other) rewards.

Can be either do-once-and-complete goals that you just need to do once, or continuous goals that check every specified interval, and reward the department if they're still true. You shouldn't make direct subtypes of /datum/department_goal, instead make subtypes of each subtype, IE /datum/department_goal/sec or /datum/department_goal/eng.

Each subtype is already preset to payout and show to the correct accounts, if you want to add more, you need to update /datum/controller/subsystem/Yogs/proc/getDepartmentFromAccount.

Vars

accountThe account that the goal is tied to. Should probably not be fiddled with as most things rely on it.
completedWhether its already been completed. If true, SSYogs won't check it again
continuousWhether the goal can be completed multiple times with multiple payouts, or just once. Will be 0 if it's completed-once, otherwise it'll be the amount of time inbetween checks
descThe description of the goal - Describe how to accomplish it
endroundIf true, this goal will only be checked at round-end, otherwise it'll get checked every time SSYogs fires
fail_if_failedIf false, it'll stop checking once failed, otherwise it'll keep checking but only reward when it's completed
nameThe name of the goal - Should be kept short
rewardIf defined, this will be paid in to the given account on completion. Otherwise, define your own reward in /datum/department_goal/proc/complete

Procs

DestroyDestroys the goal.
NewCreates the new goal.
check_completeWhether the goal is completed. On subtypes, contains all the logic for determining whether it's complete.
completeCalled to complete the goal. If a reward is set, it doles it out automatically. Otherwise, put your own reward in it.
continuingIf the goal is continuous, this will set the timer to now + how-ever-long-the-timer-is
get_nameReturns a string containing the name and the description of the goal
get_resultCalled at the end of the round, returns a string saying either completed or not completed
is_availableReturns true if the goal is available to be run, returns false otherwise. Used for conditional goals. See /datum/department_goal/eng/additional_singularity
message_playersMessages the players of the goal's department, dependent on input

Var Details

account

The account that the goal is tied to. Should probably not be fiddled with as most things rely on it.

completed

Whether its already been completed. If true, SSYogs won't check it again

continuous

Whether the goal can be completed multiple times with multiple payouts, or just once. Will be 0 if it's completed-once, otherwise it'll be the amount of time inbetween checks

desc

The description of the goal - Describe how to accomplish it

endround

If true, this goal will only be checked at round-end, otherwise it'll get checked every time SSYogs fires

fail_if_failed

If false, it'll stop checking once failed, otherwise it'll keep checking but only reward when it's completed

name

The name of the goal - Should be kept short

reward

If defined, this will be paid in to the given account on completion. Otherwise, define your own reward in /datum/department_goal/proc/complete

Proc Details

Destroy

Destroys the goal.

Removes the goal from the list of goals in SSYogs, and if the game is currently running, messages players. See: /datum/department_goal/proc/message_players

New

Creates the new goal.

Adds the goal to the list of goals in SSYogs, and if the game is currently running, messages players. See: /datum/department_goal/proc/message_players

check_complete

Whether the goal is completed. On subtypes, contains all the logic for determining whether it's complete.

complete

Called to complete the goal. If a reward is set, it doles it out automatically. Otherwise, put your own reward in it.

Arguments:

continuing

If the goal is continuous, this will set the timer to now + how-ever-long-the-timer-is

get_name

Returns a string containing the name and the description of the goal

get_result

Called at the end of the round, returns a string saying either completed or not completed

is_available

Returns true if the goal is available to be run, returns false otherwise. Used for conditional goals. See /datum/department_goal/eng/additional_singularity

message_players

Messages the players of the goal's department, dependent on input

Arguments: