Skip to content

[Generator] Create a Generator plugin #137

@Ishadijcks

Description

@Ishadijcks

A Generator is a mechanic that produces an Output over time, optionally consumes an Input

interface GeneratorDefinition {
  id: string
  output: Output | Output[]
  conditions?: Condition | Condition[]
  input?: Input | Input[]
}

interface GeneratorState {
isActive: boolean
}

TODO

  • How to deal when you cannot consume the input, does it turn off or not produce/consume that tick?
  • Currently outputs don't have support for being applied fractionally over time, which would be needed for this plugin. We could add something like fracture(fraction: number) next to modify(). Since all input and output is handled through the engine, you could update engine.produce() to add a fraction. I think that is fine for now as it is always a linear scaling fraction
  • This would work for now, but not when we have complex outputs that require functions to calculate their amount, which is always static now.

Other

  • This is similar to a previous mechanic I had designed called Boosters, which are more focused on modifiers
  • This is also similar to another mechanic call Actions, but those are transactions after time has elapsed

But it is probably best to keep them separated into different plugins!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededpluginRegarding a specific plugin

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions