123ishaTest / 123ishaTest/ludiek

[Generator] Create a Generator plugin

オープン
#137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
help wanted plugin
主要言語
TypeScript
スター
12
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

説明

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

```ts
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](https://123ishatest.github.io/igt-docs/docs/tools/boosters), which are more focused on modifiers
- This is also similar to another mechanic call [Actions](https://123ishatest.github.io/igt-docs/docs/tools/actions), but those are transactions after time has elapsed

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。