Skip to content

Commit

Permalink
version(actions@0.1.1): Add Ultimate Refrigerate II-V
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWendelborn committed Dec 4, 2024
1 parent d478371 commit 407f6ed
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 3 deletions.
20 changes: 19 additions & 1 deletion packages/actions/data/$schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,25 @@
"const": "workbench"
}
},
"required": ["type"],
"required": ["type", "grid"],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"left": {
"$ref": "#/definitions/itemAction",
"type": "object"
},
"right": {
"$ref": "#/definitions/itemAction",
"type": "object"
},
"type": {
"const": "anvil"
}
},
"required": ["type", "left", "right"],
"type": "object"
}
],
Expand Down
124 changes: 124 additions & 0 deletions packages/actions/data/north-stars-crafts.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,130 @@
"type": "workbench"
}
]
},
{
"inputs": [
{
"amount": 2,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_1",
"type": "item"
}
],
"outputs": [
{
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_2",
"type": "item"
}
],
"place": [
{
"left": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_1",
"type": "item"
},
"right": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_1",
"type": "item"
},
"type": "anvil"
}
]
},
{
"inputs": [
{
"amount": 2,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_2",
"type": "item"
}
],
"outputs": [
{
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_3",
"type": "item"
}
],
"place": [
{
"left": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_2",
"type": "item"
},
"right": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_2",
"type": "item"
},
"type": "anvil"
}
]
},
{
"inputs": [
{
"amount": 2,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_3",
"type": "item"
}
],
"outputs": [
{
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_4",
"type": "item"
}
],
"place": [
{
"left": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_3",
"type": "item"
},
"right": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_3",
"type": "item"
},
"type": "anvil"
}
]
},
{
"inputs": [
{
"amount": 2,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_4",
"type": "item"
}
],
"outputs": [
{
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_5",
"type": "item"
}
],
"place": [
{
"left": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_4",
"type": "item"
},
"right": {
"amount": 1,
"id": "ENCHANTMENT_ULTIMATE_REFRIGERATE_4",
"type": "item"
},
"type": "anvil"
}
]
}
]
}
2 changes: 1 addition & 1 deletion packages/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"sideEffects": false,
"type": "commonjs",
"types": "dist/index.d.ts",
"version": "0.1.0"
"version": "0.1.1"
}
18 changes: 17 additions & 1 deletion packages/actions/source/data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test('sumUp works', () => {
)
})

describe('every action’s inputs match its crafing grid', () => {
describe('every action’s workbench inputs match its crafing grid', () => {
for (const action of allActions) {
for (const grid of action.place.filter((x) => x.type === 'workbench')) {
test(`${JSON.stringify(action.outputs)} is valid`, () => {
Expand All @@ -83,3 +83,19 @@ describe('every action’s inputs match its crafing grid', () => {
}
}
})

describe('every action’s anvil inputs match its crafing grid', () => {
for (const action of allActions) {
for (const grid of action.place.filter((x) => x.type === 'anvil')) {
test(`${JSON.stringify(action.outputs)} is valid`, () => {
assert(grid.type === 'anvil')

const actual = sumUp(action.inputs.filter((x) => x.type === 'item'))

const expected = sumUp([grid.left, grid.right])

expect(actual).toEqual(expected)
})
}
}
})
7 changes: 7 additions & 0 deletions packages/actions/source/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export const actionIoSchema = z.discriminatedUnion('type', [
])

export const actionPlaceSchema = z.discriminatedUnion('type', [
z
.object({
left: actionIoItemSchema,
right: actionIoItemSchema,
type: z.literal('anvil'),
})
.strict(),
z
.object({
id: z.string(),
Expand Down

0 comments on commit 407f6ed

Please sign in to comment.