Skip to content

Commit cf4841c

Browse files
committed
feat: New evolution pet 🤖GOOSE_ROBOT🤖
1 parent 74b8ad1 commit cf4841c

11 files changed

Lines changed: 347 additions & 11 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ bin/
4343

4444
.idea
4545
logs
46+
.profileconfig.json

README-en.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ _New contributions may take up to 1 hour to be reflected._
144144

145145
| name | ratio | Description |
146146
|---------------------------------------------------------------------------------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
147+
| GOOSE_ROBOT <br> <img src = "docs/goose-robot.svg" width="100px" height="60px"/> | Evolution | Only for evolution |
147148
| FLAMINGO_WHITE <br> <img src = "docs/flamingo-white.svg" width="50px" height="110px"/> | Evolution | Only for evolution |
148149
| SLIME_ANGEL <br> <img src = "docs/slime-angel.svg" width="70px" height="60px"/> | Evolution | Only for evolution |
149150
| CAT_WINDOW <br> <img src = "docs/cat-window.svg" width="100px" height="70px"/> | Evolution | Only for evolution |

README-ja.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ _新しいコントリビューションの反映には最大で1時間かかる
141141

142142
| 名前 | 比率 | 説明 |
143143
|----------------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
144+
| GOOSE_ROBOT <br> <img src = "docs/goose-robot.svg" width="100px" height="60px"/> | Evolution | Only for evolution |
144145
| FLAMINGO_WHITE <br> <img src = "docs/flamingo-white.svg" width="50px" height="110px"/> | Evolution | Only for evolution |
145146
| SLIME_ANGEL <br> <img src = "docs/slime-angel.svg" width="70px" height="60px"/> | Evolution | Only for evolution |
146147
| CAT_WINDOW <br> <img src = "docs/cat-window.svg" width="100px" height="70px"/> | Evolution | Only for evolution |

README-zhcn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ _新的贡献可能需要1个小时才能显示_
143143

144144
| 名字 | 概率 | 描述 |
145145
|---------------------------------------------------------------------------------------------------------|-----------|--------------------------------------------------------------------------------------------------------------------|
146+
| GOOSE_ROBOT <br> <img src = "docs/goose-robot.svg" width="100px" height="60px"/> | Evolution | Only for evolution |
146147
| FLAMINGO_WHITE <br> <img src = "docs/flamingo-white.svg" width="50px" height="110px"/> | Evolution | Only for evolution |
147148
| SLIME_ANGEL <br> <img src = "docs/slime-angel.svg" width="70px" height="60px"/> | Evolution | Only for evolution |
148149
| CAT_WINDOW <br> <img src = "docs/cat-window.svg" width="100px" height="70px"/> | Evolution | Only for evolution |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ _새로운 contribution 반영은 최대 1시간이 소요될 수 있어요._
140140

141141
| name | ratio | Description |
142142
|----------------------------------------------------------------------------------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
143+
| GOOSE_ROBOT <br> <img src = "docs/goose-robot.svg" width="100px" height="60px"/> | Evolution | Only for evolution |
143144
| FLAMINGO_WHITE <br> <img src = "docs/flamingo-white.svg" width="50px" height="110px"/> | Evolution | Only for evolution |
144145
| SLIME_ANGEL <br> <img src = "docs/slime-angel.svg" width="70px" height="60px"/> | Evolution | Only for evolution |
145146
| CAT_WINDOW <br> <img src = "docs/cat-window.svg" width="100px" height="70px"/> | Evolution | Only for evolution |

docs/goose-robot.svg

Lines changed: 114 additions & 0 deletions
Loading

src/main/kotlin/org/gitanimals/core/PersonaEvolutionType.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ enum class PersonaEvolutionType {
2222
FLAMINGO,
2323
SLIME,
2424
CAT,
25+
GOOSE,
2526
;
2627
}

src/main/kotlin/org/gitanimals/core/PersonaType.kt

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ enum class PersonaType(
1010
val weight: Double,
1111
val grade: PersonaGrade = PersonaGrade.DEFAULT,
1212
val personaEvolution: PersonaEvolution = PersonaEvolution.nothing,
13-
private var dropRate: String? = null,
1413
) {
15-
GOOSE(1.0) {
14+
GOOSE(1.0, personaEvolution = PersonaEvolution(weight = 0.8, type = PersonaEvolutionType.GOOSE)) {
1615
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
1716
val goose = gooseSvg.replace("*{act}", act(animationId))
1817
.replace("*{id}", animationId.toString())
@@ -38,7 +37,7 @@ enum class PersonaType(
3837
.toString()
3938
},
4039

41-
GOOSE_SUNGLASSES(0.05) {
40+
GOOSE_SUNGLASSES(0.05, personaEvolution = PersonaEvolution(weight = 0.05, type = PersonaEvolutionType.GOOSE)) {
4241
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
4342
val goose = gooseSunglassesSvg.replace("*{act}", act(animationId))
4443
.replace("*{id}", animationId.toString())
@@ -64,7 +63,7 @@ enum class PersonaType(
6463
.toString()
6564
},
6665

67-
GOOSE_KOTLIN(0.01) {
66+
GOOSE_KOTLIN(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
6867
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
6968
val goose = gooseKotlinSvg.replace("*{act}", act(animationId))
7069
.replace("*{id}", animationId.toString())
@@ -90,7 +89,7 @@ enum class PersonaType(
9089
.toString()
9190
},
9291

93-
GOOSE_JAVA(0.01) {
92+
GOOSE_JAVA(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
9493
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
9594
val goose = gooseJavaSvg.replace("*{act}", act(animationId))
9695
.replace("*{id}", animationId.toString())
@@ -116,7 +115,7 @@ enum class PersonaType(
116115
.toString()
117116
},
118117

119-
GOOSE_JS(0.01) {
118+
GOOSE_JS(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
120119
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
121120
val goose = gooseJsSvg.replace("*{act}", act(animationId))
122121
.replace("*{id}", animationId.toString())
@@ -142,7 +141,7 @@ enum class PersonaType(
142141
.toString()
143142
},
144143

145-
GOOSE_NODE(0.01) {
144+
GOOSE_NODE(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
146145
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
147146
val goose = gooseNodeSvg.replace("*{act}", act(animationId))
148147
.replace("*{id}", animationId.toString())
@@ -168,7 +167,7 @@ enum class PersonaType(
168167
.toString()
169168
},
170169

171-
GOOSE_SWIFT(0.01) {
170+
GOOSE_SWIFT(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
172171
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
173172
val goose = gooseSwiftSvg.replace("*{act}", act(animationId))
174173
.replace("*{id}", animationId.toString())
@@ -194,7 +193,7 @@ enum class PersonaType(
194193
.toString()
195194
},
196195

197-
GOOSE_LINUX(0.01) {
196+
GOOSE_LINUX(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
198197
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
199198
val goose = gooseLinuxSvg.replace("*{act}", act(animationId))
200199
.replace("*{id}", animationId.toString())
@@ -215,7 +214,7 @@ enum class PersonaType(
215214
.toString()
216215
},
217216

218-
GOOSE_SPRING(0.01) {
217+
GOOSE_SPRING(0.01, personaEvolution = PersonaEvolution(weight = 0.01, type = PersonaEvolutionType.GOOSE)) {
219218
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
220219
val goose = gooseSpringSvg.replace("*{act}", act(animationId))
221220
.replace("*{id}", animationId.toString())
@@ -241,6 +240,32 @@ enum class PersonaType(
241240
.toString()
242241
},
243242

243+
GOOSE_ROBOT(weight = 0.00, grade = PersonaGrade.EVOLUTION, personaEvolution = PersonaEvolution(weight = 0.3, type = PersonaEvolutionType.GOOSE)) {
244+
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
245+
val goose = gooseRobotSvg.replace("*{act}", act(animationId))
246+
.replace("*{id}", animationId.toString())
247+
.replace("*{leg-iteration-count}", "360")
248+
.replace("*{level}", level.toSvg(14.0, 2.0))
249+
.replace(
250+
"*{levelx}",
251+
(-1 * (level.toString().length)).toString()
252+
)
253+
.replace("*{username}", name.toSvg(14.0, 25.0))
254+
.replace(
255+
"*{usernamex}",
256+
(32 + (-3 * name.length)).toString()
257+
)
258+
259+
return StringBuilder()
260+
.append(goose)
261+
.toString()
262+
}
263+
264+
override fun act(id: Long, flippedWidth: Double): String = StringBuilder()
265+
.moveRandomly("goose", id, 20, "180s", 7, 33.0)
266+
.toString()
267+
},
268+
244269
LITTLE_CHICK(weight = 0.9, personaEvolution = PersonaEvolution(weight = 0.3, type = PersonaEvolutionType.LITTLE_CHICK)) {
245270
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
246271
val littleChick = littleChickSvg.replace("*{act}", act(animationId))
@@ -2381,6 +2406,8 @@ enum class PersonaType(
23812406
},
23822407
;
23832408

2409+
private var dropRate: String? = null
2410+
23842411
init {
23852412
require(weight in 0.000..1.0) { "PersonaType's weight should be between 0.000 to 1.0" }
23862413
}

src/main/kotlin/org/gitanimals/core/Svgs.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ val slimeAngelSvg: String = ClassPathResource("persona/animal/evolution/slime-an
380380
val catWindowSvg: String = ClassPathResource("persona/animal/evolution/cat-window.svg")
381381
.getContentAsString(Charset.defaultCharset())
382382

383+
val gooseRobotSvg: String = ClassPathResource("persona/animal/evolution/goose-robot.svg")
384+
.getContentAsString(Charset.defaultCharset())
385+
383386
val largeTextSvgs = lazy {
384387
val map = mutableMapOf<String, String>()
385388
for (i in 'A'..'Z') {

0 commit comments

Comments
 (0)