MCIndustry

【Mindustry】磁铜工业模组

公开 0
返回提交历史

XFEstudio/MCIndustry

添加磁铜仓库

4bebde4
XFEstudio <mail@xfegzs.com>
提交于

代码差异

6 个文件 +233 -1
Added art-tools/generate-storage-sprites.ps1 +186 -0
@@ -0,0 +1,186 @@
1 param(
2 [Parameter(Mandatory = $true)]
3 [string]$OutputDirectory
4 )
5
6 $ErrorActionPreference = "Stop"
7 Add-Type -AssemblyName System.Drawing
8
9 function New-Brush([string]$hex) {
10 return [System.Drawing.SolidBrush]::new(
11 [System.Drawing.ColorTranslator]::FromHtml($hex)
12 )
13 }
14
15 function Add-Polygon($graphics, [string]$color, [int[][]]$coordinates) {
16 $points = foreach ($coordinate in $coordinates) {
17 [System.Drawing.Point]::new(
18 [int]($coordinate[0]),
19 [int]($coordinate[1])
20 )
21 }
22 $brush = New-Brush $color
23 try {
24 $graphics.FillPolygon($brush, $points)
25 } finally {
26 $brush.Dispose()
27 }
28 }
29
30 function Add-Rectangle($graphics, [string]$color, [int]$x, [int]$y, [int]$width, [int]$height) {
31 $brush = New-Brush $color
32 try {
33 $graphics.FillRectangle($brush, $x, $y, $width, $height)
34 } finally {
35 $brush.Dispose()
36 }
37 }
38
39 function Add-Diamond($graphics, [string]$color, [int]$centerX, [int]$centerY, [int]$radius) {
40 Add-Polygon -graphics $graphics -color $color -coordinates @(
41 @($centerX, ($centerY - $radius)),
42 @(($centerX + $radius), $centerY),
43 @($centerX, ($centerY + $radius)),
44 @(($centerX - $radius), $centerY)
45 )
46 }
47
48 function Add-BeveledCell($graphics, [int]$x, [int]$y, [int]$size, [string]$accent) {
49 $cut = [Math]::Max(2, [int]($size / 6))
50 Add-Polygon -graphics $graphics -color "#29263d" -coordinates @(
51 @(($x + $cut), $y),
52 @(($x + $size - $cut), $y),
53 @(($x + $size), ($y + $cut)),
54 @(($x + $size), ($y + $size - $cut)),
55 @(($x + $size - $cut), ($y + $size)),
56 @(($x + $cut), ($y + $size)),
57 @($x, ($y + $size - $cut)),
58 @($x, ($y + $cut))
59 )
60 Add-Rectangle $graphics "#666a7e" ($x + $cut) ($y + $cut) ($size - $cut * 2) ($size - $cut * 2)
61 Add-Rectangle $graphics "#8d91a5" ($x + $cut + 2) ($y + $cut + 2) ($size - $cut * 2 - 4) 3
62 Add-Diamond -graphics $graphics -color $accent `
63 -centerX ($x + [int]($size / 2)) `
64 -centerY ($y + [int]($size / 2)) `
65 -radius ([Math]::Max(2, [int]($size / 6)))
66 }
67
68 function New-MagneticCopperWarehouse([string]$path) {
69 $bitmap = [System.Drawing.Bitmap]::new(
70 64,
71 64,
72 [System.Drawing.Imaging.PixelFormat]::Format32bppArgb
73 )
74 $graphics = [System.Drawing.Graphics]::FromImage($bitmap)
75 $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::None
76 $graphics.CompositingMode = [System.Drawing.Drawing2D.CompositingMode]::SourceCopy
77
78 Add-Polygon $graphics "#242235" @(
79 @(5, 0), @(59, 0), @(64, 5), @(64, 59),
80 @(59, 64), @(5, 64), @(0, 59), @(0, 5)
81 )
82 Add-Polygon $graphics "#7350ed" @(
83 @(7, 2), @(57, 2), @(62, 7), @(62, 57),
84 @(57, 62), @(7, 62), @(2, 57), @(2, 7)
85 )
86 Add-Polygon $graphics "#4e5063" @(
87 @(9, 6), @(55, 6), @(58, 9), @(58, 55),
88 @(55, 58), @(9, 58), @(6, 55), @(6, 9)
89 )
90
91 foreach ($cell in @(@(8, 8), @(38, 8), @(8, 38), @(38, 38))) {
92 Add-BeveledCell -graphics $graphics -x ([int]($cell[0])) -y ([int]($cell[1])) -size 18 -accent "#c77b67"
93 }
94
95 Add-Rectangle $graphics "#c77b67" 28 3 8 8
96 Add-Rectangle $graphics "#c77b67" 28 53 8 8
97 Add-Rectangle $graphics "#c77b67" 3 28 8 8
98 Add-Rectangle $graphics "#c77b67" 53 28 8 8
99
100 Add-Diamond -graphics $graphics -color "#26213c" -centerX 32 -centerY 32 -radius 20
101 Add-Diamond -graphics $graphics -color "#5e3fd2" -centerX 32 -centerY 32 -radius 16
102 Add-Diamond -graphics $graphics -color "#989bad" -centerX 32 -centerY 32 -radius 12
103 Add-Diamond -graphics $graphics -color "#30284f" -centerX 32 -centerY 32 -radius 8
104 Add-Diamond -graphics $graphics -color "#8f53fb" -centerX 32 -centerY 32 -radius 5
105 Add-Diamond -graphics $graphics -color "#c8b8ff" -centerX 32 -centerY 32 -radius 2
106
107 $graphics.Dispose()
108 try {
109 $bitmap.Save($path, [System.Drawing.Imaging.ImageFormat]::Png)
110 } finally {
111 $bitmap.Dispose()
112 }
113 }
114
115 function New-MagneticSurgeWarehouse([string]$path) {
116 $bitmap = [System.Drawing.Bitmap]::new(
117 128,
118 128,
119 [System.Drawing.Imaging.PixelFormat]::Format32bppArgb
120 )
121 $graphics = [System.Drawing.Graphics]::FromImage($bitmap)
122 $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::None
123 $graphics.CompositingMode = [System.Drawing.Drawing2D.CompositingMode]::SourceCopy
124
125 Add-Polygon $graphics "#1d1b2e" @(
126 @(8, 0), @(120, 0), @(128, 8), @(128, 120),
127 @(120, 128), @(8, 128), @(0, 120), @(0, 8)
128 )
129 Add-Polygon $graphics "#4b2fb1" @(
130 @(10, 3), @(118, 3), @(125, 10), @(125, 118),
131 @(118, 125), @(10, 125), @(3, 118), @(3, 10)
132 )
133 Add-Polygon $graphics "#666a80" @(
134 @(14, 8), @(114, 8), @(120, 14), @(120, 114),
135 @(114, 120), @(14, 120), @(8, 114), @(8, 14)
136 )
137 Add-Polygon $graphics "#29273d" @(
138 @(20, 13), @(108, 13), @(115, 20), @(115, 108),
139 @(108, 115), @(20, 115), @(13, 108), @(13, 20)
140 )
141
142 foreach ($cell in @(
143 @(18, 18), @(48, 18), @(80, 18),
144 @(18, 48), @(80, 48),
145 @(18, 80), @(48, 80), @(80, 80)
146 )) {
147 Add-BeveledCell -graphics $graphics -x ([int]($cell[0])) -y ([int]($cell[1])) -size 28 -accent "#8f53fb"
148 }
149
150 Add-Rectangle $graphics "#aeb4c7" 57 8 14 24
151 Add-Rectangle $graphics "#6f45e8" 61 8 6 24
152 Add-Rectangle $graphics "#aeb4c7" 57 96 14 24
153 Add-Rectangle $graphics "#6f45e8" 61 96 6 24
154 Add-Rectangle $graphics "#aeb4c7" 8 57 24 14
155 Add-Rectangle $graphics "#6f45e8" 8 61 24 6
156 Add-Rectangle $graphics "#aeb4c7" 96 57 24 14
157 Add-Rectangle $graphics "#6f45e8" 96 61 24 6
158
159 Add-Diamond -graphics $graphics -color "#171426" -centerX 64 -centerY 64 -radius 31
160 Add-Diamond -graphics $graphics -color "#40268f" -centerX 64 -centerY 64 -radius 26
161 Add-Diamond -graphics $graphics -color "#c77b67" -centerX 64 -centerY 64 -radius 21
162 Add-Diamond -graphics $graphics -color "#5c6075" -centerX 64 -centerY 64 -radius 17
163 Add-Diamond -graphics $graphics -color "#28213f" -centerX 64 -centerY 64 -radius 12
164 Add-Diamond -graphics $graphics -color "#8f53fb" -centerX 64 -centerY 64 -radius 8
165 Add-Diamond -graphics $graphics -color "#d8ccff" -centerX 64 -centerY 64 -radius 3
166
167 foreach ($offset in 0, 1, 2) {
168 Add-Rectangle $graphics "#8f53fb" (25 + $offset * 39) 3 8 5
169 Add-Rectangle $graphics "#8f53fb" (25 + $offset * 39) 120 8 5
170 Add-Rectangle $graphics "#8f53fb" 3 (25 + $offset * 39) 5 8
171 Add-Rectangle $graphics "#8f53fb" 120 (25 + $offset * 39) 5 8
172 }
173
174 $graphics.Dispose()
175 try {
176 $bitmap.Save($path, [System.Drawing.Imaging.ImageFormat]::Png)
177 } finally {
178 $bitmap.Dispose()
179 }
180 }
181
182 New-Item -ItemType Directory -Force -Path $OutputDirectory | Out-Null
183 $magneticCopperName = (-join [char[]]@(0x78c1, 0x94dc, 0x538b, 0x7f29, 0x4ed3, 0x5e93)) + ".png"
184 $magneticSurgeName = (-join [char[]]@(0x78c1, 0x6d8c, 0x6269, 0x5c55, 0x4ed3, 0x5e93)) + ".png"
185 New-MagneticCopperWarehouse (Join-Path $OutputDirectory $magneticCopperName)
186 New-MagneticSurgeWarehouse (Join-Path $OutputDirectory $magneticSurgeName)
Added content/blocks/磁涌扩展仓库.hjson +23 -0
@@ -0,0 +1,23 @@
1 type: StorageBlock
2 name: 磁涌扩展仓库
3 description: 以磁涌合金稳定超高密度储存空间的后期仓库,每种物资均拥有独立储存空间。
4
5 size: 4
6 health: 4200
7 itemCapacity: 120000
8 separateItemCapacity: true
9 coreMerge: false
10
11 category: effect
12 requirements: [
13 磁铜/2200
14 磁涌合金/1200
15 titanium/1600
16 ]
17
18 research: 磁涌合金
19 researchCost: [
20 磁铜/7000
21 磁涌合金/4000
22 titanium/5000
23 ]
Added content/blocks/磁铜压缩仓库.hjson +23 -0
@@ -0,0 +1,23 @@
1 type: StorageBlock
2 name: 磁铜压缩仓库
3 description: 利用磁铜约束场将不同物资分别压缩存放的大型仓库,每种物资均拥有独立储存空间。
4
5 size: 2
6 health: 1300
7 itemCapacity: 40000
8 separateItemCapacity: true
9 coreMerge: false
10
11 category: effect
12 requirements: [
13 copper/800
14 graphite/500
15 磁铜/400
16 ]
17
18 research: 磁铜
19 researchCost: [
20 copper/3000
21 graphite/2000
22 磁铜/1200
23 ]
Modified mod.hjson +1 -1
@@ -2,6 +2,6 @@
2 2 name:磁铜工业
3 3 author:XFEstudio
4 4 "description":"[purple]磁铜工业,适合度过前期,以及为后期增加各类工厂工业制造模块,方便传输,增加新炮塔及工厂,全工业基于磁铜,持续测试中"
5 version:"2.54"
5 version:"2.55"
6 6 minGameVersion:136
7 7 }
Added sprites/books/磁涌扩展仓库.png +0 -0
二进制文件已变更,无法进行逐行预览。
Added sprites/books/磁铜压缩仓库.png +0 -0
二进制文件已变更,无法进行逐行预览。