Skip to content

Commit

Permalink
临时支持核废料配方
Browse files Browse the repository at this point in the history
  • Loading branch information
imsfc committed Sep 28, 2024
1 parent e4f16f2 commit 749842a
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 14 deletions.
Binary file modified bun.lockb
Binary file not shown.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
"dependencies": {
"@vueuse/core": "^11.1.0",
"decimal.js": "^10.4.3",
"naive-ui": "^2.39.0",
"naive-ui": "^2.40.1",
"nanoid": "^5.0.7",
"pinia": "^2.2.2",
"radash": "^12.1.0",
"vue": "^3.5.7",
"vue": "^3.5.10",
"vue-draggable-plus": "^0.5.3",
"vue-i18n": "^10.0.1",
"vue-i18n": "^10.0.3",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^5.0.0",
"@intlify/unplugin-vue-i18n": "^5.2.0",
"@rushstack/eslint-patch": "^1.10.4",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@tsconfig/node20": "^20.1.4",
"@types/jsdom": "^21.1.7",
"@types/node": "^20.16.5",
"@types/node": "^20.16.10",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/eslint-config-prettier": "^9.0.0",
Expand All @@ -45,9 +45,9 @@
"prettier": "^3.3.3",
"typescript": "~5.4.5",
"unocss": "^0.62.4",
"vite": "^5.4.7",
"vite": "^5.4.8",
"vite-imagetools": "^7.0.4",
"vitest": "^1.6.0",
"vue-tsc": "^2.1.6"
}
}
}
Binary file added src/assets/buildings/Nuclear_Power_Plant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src/components/PowerDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ export default defineComponent({
return () => (
<div class="flex flex-col gap-y-1">
<div class="text-sm leading-4">
<b>{decimalRound(props.averagePowerUsage, 1)}</b>
<b>
{props.averagePowerUsage.lt(0) && '+'}
{decimalRound(props.averagePowerUsage.abs(), 1)}
</b>
{' MW'}
</div>
{props.powerUsageRange && (
<div class="text-xs leading-3.5 opacity-75">
{decimalRound(props.powerUsageRange.min, 1)} MW -{' '}
{decimalRound(props.powerUsageRange.max, 1)} MW
{props.powerUsageRange.min.lt(0) && '+'}
{decimalRound(props.powerUsageRange.min.abs(), 1)} MW -{' '}
{props.powerUsageRange.max.lt(0) && '+'}
{decimalRound(props.powerUsageRange.max.abs(), 1)} MW
</div>
)}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/data/buildings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
{ "id": 8, "key": "Converter" },
{ "id": 9, "key": "Quantum_Encoder" },
{ "id": 10, "key": "Smelter", "powerUsage": 4 },
{ "id": 11, "key": "Foundry", "powerUsage": 16 }
{ "id": 11, "key": "Foundry", "powerUsage": 16 },
{ "id": 10001, "key": "Nuclear_Power_Plant", "powerUsage": -2500 }
]
22 changes: 22 additions & 0 deletions src/data/recipes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3048,5 +3048,27 @@
"outputs": [{ "itemId": 152, "quantityPerCycle": 1 }],
"producedInId": 3,
"productionDuration": 60
},
{
"id": 10001,
"key": "Uranium_Fuel_Rod_(burning)",
"inputs": [
{ "itemId": 114, "quantityPerCycle": 1 },
{ "itemId": 67, "quantityPerCycle": 1200 }
],
"outputs": [{ "itemId": 118, "quantityPerCycle": 50 }],
"producedInId": 10001,
"productionDuration": 300
},
{
"id": 10002,
"key": "Plutonium_Fuel_Rod_(burning)",
"inputs": [
{ "itemId": 121, "quantityPerCycle": 1 },
{ "itemId": 67, "quantityPerCycle": 2400 }
],
"outputs": [{ "itemId": 149, "quantityPerCycle": 10 }],
"producedInId": 10001,
"productionDuration": 600
}
]
1 change: 1 addition & 0 deletions src/locales/buildings/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ buildings:
Conveyor_Belt_Mk_6: Conveyor Belt Mk.6
Pipeline_Mk_1: Pipeline Mk.1
Pipeline_Mk_2: Pipeline Mk.2
Nuclear_Power_Plant: Nuclear Power Plant
1 change: 1 addition & 0 deletions src/locales/buildings/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ buildings:
Conveyor_Belt_Mk_6: 6级传送带
Pipeline_Mk_1: 1级管道
Pipeline_Mk_2: 2级管道
Nuclear_Power_Plant: 核电站
2 changes: 2 additions & 0 deletions src/locales/recipes/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,5 @@ recipes:
Ficsonium: Ficsonium
Singularity_Cell: Singularity Cell
Ballistic_Warp_Drive: Ballistic Warp Drive
Uranium_Fuel_Rod_(burning): Uranium Fuel Rod (burning)
Plutonium_Fuel_Rod_(burning): Plutonium Fuel Rod (burning)
2 changes: 2 additions & 0 deletions src/locales/recipes/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,5 @@ recipes:
Ficsonium:
Singularity_Cell: 奇点电池
Ballistic_Warp_Drive: 弹道跃迁引擎
Uranium_Fuel_Rod_(burning): 铀燃料棒 (燃烧)
Plutonium_Fuel_Rod_(burning): 钚燃料棒 (燃烧)
15 changes: 12 additions & 3 deletions src/utils/dataCalculators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ export const calculatePowerUsage = (
OVERCLOCKING_POWER_EXPONENT,
)
if (Decimal.isDecimal(powerUsage)) {
return Decimal.mul(powerUsage, overclockingPowerMultiplier)
return Decimal.mul(
powerUsage,
powerUsage.lt(0) ? clockSpeed : overclockingPowerMultiplier,
)
}
return {
min: Decimal.mul(powerUsage.min, overclockingPowerMultiplier),
max: Decimal.mul(powerUsage.max, overclockingPowerMultiplier),
min: Decimal.mul(
powerUsage.min,
powerUsage.min.lt(0) ? clockSpeed : overclockingPowerMultiplier,
),
max: Decimal.mul(
powerUsage.max,
powerUsage.min.lt(0) ? clockSpeed : overclockingPowerMultiplier,
),
}
}

Expand Down

0 comments on commit 749842a

Please sign in to comment.