From f1609182c60dfabfe496ead773eba031970e1e02 Mon Sep 17 00:00:00 2001 From: devxb Date: Sat, 16 Nov 2024 20:49:54 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20HAMSTER=F0=9F=90=B9=20=ED=8E=AB?= =?UTF-8?q?=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 1 + README-zhcn.md | 1 + README.md | 1 + docs/hamster.svg | 139 +++++++++++++ .../gitanimals/render/domain/PersonaType.kt | 17 +- .../org/gitanimals/render/domain/Svgs.kt | 3 + src/main/resources/persona/animal/hamster.svg | 185 ++++++++++++++++++ 7 files changed, 346 insertions(+), 1 deletion(-) create mode 100644 docs/hamster.svg create mode 100644 src/main/resources/persona/animal/hamster.svg diff --git a/README-en.md b/README-en.md index 7bfb6b2..22dbace 100644 --- a/README-en.md +++ b/README-en.md @@ -121,6 +121,7 @@ _New contributions may take up to 1 hour to be reflected._ | name | ratio | Description | |---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | SCREAM
| 0.005 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | GHOST_KING
| 0.01 | ๐Ÿ‘ป2024 Halloween pet๐Ÿ‘ป | diff --git a/README-zhcn.md b/README-zhcn.md index 430a05a..2b7f2af 100644 --- a/README-zhcn.md +++ b/README-zhcn.md @@ -120,6 +120,7 @@ _ๆ–ฐ็š„่ดก็Œฎๅฏ่ƒฝ้œ€่ฆ1ไธชๅฐๆ—ถๆ‰่ƒฝๆ˜พ็คบ_ | ๅๅญ— | ๆฆ‚็Ž‡ | ๆ่ฟฐ | |---------------------------------------------------------------------------------------------------------|-------|--------------------------------------------------------------------------------------------------------------------| +| HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | SCREAM
| 0.005 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | GHOST_KING
| 0.01 | ๐Ÿ‘ป2024 Halloween pet๐Ÿ‘ป | diff --git a/README.md b/README.md index 2a2afba..37f07ee 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ _์ƒˆ๋กœ์šด contribution ๋ฐ˜์˜์€ ์ตœ๋Œ€ 1์‹œ๊ฐ„์ด ์†Œ์š”๋  ์ˆ˜ ์žˆ์–ด์š”._ | name | ratio | Description | |----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | SCREAM
| 0.005 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | GHOST_KING
| 0.01 | ๐Ÿ‘ป2024 Halloween pet๐Ÿ‘ป | diff --git a/docs/hamster.svg b/docs/hamster.svg new file mode 100644 index 0000000..fb71de6 --- /dev/null +++ b/docs/hamster.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index 40df748..65186b8 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1346,6 +1346,21 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) StringBuilder().moveRandomly("slime", id, 15, "180s", 5, 21.0) .toString() }, + HAMSTER(0.8) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return hamsterSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-5 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) + .toString() + } ; init { @@ -1385,7 +1400,7 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) Mode.LINE -> { this.replace( "*{contributionx}", - (12 + (-1 * (user.contributionCount().toString().length))).toString() + (12.8 + (-1 * (user.contributionCount().toString().length))).toString() ) .replace( "*{contribution}", diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index cce1736..8e48a28 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -253,6 +253,9 @@ val slimePumpkin1Svg: String = ClassPathResource("persona/animal/slime-pumpkin-1 val slimePumpkin2Svg: String = ClassPathResource("persona/animal/slime-pumpkin-2.svg") .getContentAsString(Charset.defaultCharset()) +val hamsterSvg: String = ClassPathResource("persona/animal/hamster.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/hamster.svg b/src/main/resources/persona/animal/hamster.svg new file mode 100644 index 0000000..b547a41 --- /dev/null +++ b/src/main/resources/persona/animal/hamster.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9b920ff82fb63072893d797560a7e6ba684668a8 Mon Sep 17 00:00:00 2001 From: devxb Date: Sat, 16 Nov 2024 21:03:19 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20hamster=20spring=F0=9F=90=B9=20?= =?UTF-8?q?=ED=8E=AB=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 1 + README-zhcn.md | 1 + README.md | 1 + docs/hamster-spring.svg | 182 +++++++++++++++++ .../gitanimals/render/domain/PersonaType.kt | 17 +- .../org/gitanimals/render/domain/Svgs.kt | 3 + .../persona/animal/hamster-spring.svg | 187 ++++++++++++++++++ 7 files changed, 391 insertions(+), 1 deletion(-) create mode 100644 docs/hamster-spring.svg create mode 100644 src/main/resources/persona/animal/hamster-spring.svg diff --git a/README-en.md b/README-en.md index 22dbace..148d788 100644 --- a/README-en.md +++ b/README-en.md @@ -121,6 +121,7 @@ _New contributions may take up to 1 hour to be reflected._ | name | ratio | Description | |---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | SCREAM
| 0.005 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | diff --git a/README-zhcn.md b/README-zhcn.md index 2b7f2af..9a65182 100644 --- a/README-zhcn.md +++ b/README-zhcn.md @@ -120,6 +120,7 @@ _ๆ–ฐ็š„่ดก็Œฎๅฏ่ƒฝ้œ€่ฆ1ไธชๅฐๆ—ถๆ‰่ƒฝๆ˜พ็คบ_ | ๅๅญ— | ๆฆ‚็Ž‡ | ๆ่ฟฐ | |---------------------------------------------------------------------------------------------------------|-------|--------------------------------------------------------------------------------------------------------------------| +| HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | SCREAM
| 0.005 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | diff --git a/README.md b/README.md index 37f07ee..1d1ae2c 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ _์ƒˆ๋กœ์šด contribution ๋ฐ˜์˜์€ ์ตœ๋Œ€ 1์‹œ๊ฐ„์ด ์†Œ์š”๋  ์ˆ˜ ์žˆ์–ด์š”._ | name | ratio | Description | |----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | | SCREAM
| 0.005 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | diff --git a/docs/hamster-spring.svg b/docs/hamster-spring.svg new file mode 100644 index 0000000..0f0f1ad --- /dev/null +++ b/docs/hamster-spring.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index 65186b8..d7a7c1e 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1360,7 +1360,22 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) override fun act(id: Long): String = StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) .toString() - } + }, + HAMSTER_SPRING(0.01) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return hamsterSpringSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-5 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) + .toString() + }, ; init { diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index 8e48a28..f9ab3a7 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -256,6 +256,9 @@ val slimePumpkin2Svg: String = ClassPathResource("persona/animal/slime-pumpkin-2 val hamsterSvg: String = ClassPathResource("persona/animal/hamster.svg") .getContentAsString(Charset.defaultCharset()) +val hamsterSpringSvg: String = ClassPathResource("persona/animal/hamster-spring.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/hamster-spring.svg b/src/main/resources/persona/animal/hamster-spring.svg new file mode 100644 index 0000000..3819cd3 --- /dev/null +++ b/src/main/resources/persona/animal/hamster-spring.svg @@ -0,0 +1,187 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 60270aa85e3857b5629bd7144ee243176afaf471 Mon Sep 17 00:00:00 2001 From: devxb Date: Sat, 16 Nov 2024 21:10:03 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20hamster=20java=F0=9F=90=B9=20?= =?UTF-8?q?=ED=8E=AB=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 1 + README-zhcn.md | 1 + README.md | 1 + docs/hamster-java.svg | 187 +++++++++++++++++ .../gitanimals/render/domain/PersonaType.kt | 15 ++ .../org/gitanimals/render/domain/Svgs.kt | 3 + .../resources/persona/animal/hamster-java.svg | 192 ++++++++++++++++++ 7 files changed, 400 insertions(+) create mode 100644 docs/hamster-java.svg create mode 100644 src/main/resources/persona/animal/hamster-java.svg diff --git a/README-en.md b/README-en.md index 148d788..6bdcadf 100644 --- a/README-en.md +++ b/README-en.md @@ -121,6 +121,7 @@ _New contributions may take up to 1 hour to be reflected._ | name | ratio | Description | |---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | diff --git a/README-zhcn.md b/README-zhcn.md index 9a65182..541db8f 100644 --- a/README-zhcn.md +++ b/README-zhcn.md @@ -120,6 +120,7 @@ _ๆ–ฐ็š„่ดก็Œฎๅฏ่ƒฝ้œ€่ฆ1ไธชๅฐๆ—ถๆ‰่ƒฝๆ˜พ็คบ_ | ๅๅญ— | ๆฆ‚็Ž‡ | ๆ่ฟฐ | |---------------------------------------------------------------------------------------------------------|-------|--------------------------------------------------------------------------------------------------------------------| +| HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | diff --git a/README.md b/README.md index 1d1ae2c..108dc16 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ _์ƒˆ๋กœ์šด contribution ๋ฐ˜์˜์€ ์ตœ๋Œ€ 1์‹œ๊ฐ„์ด ์†Œ์š”๋  ์ˆ˜ ์žˆ์–ด์š”._ | name | ratio | Description | |----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | | SCREAM_GHOST
| 0.001 | ๐Ÿ˜ฑ2024 Halloween pet๐Ÿ˜ฑ | diff --git a/docs/hamster-java.svg b/docs/hamster-java.svg new file mode 100644 index 0000000..591a0b6 --- /dev/null +++ b/docs/hamster-java.svg @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index d7a7c1e..cc240b1 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1376,6 +1376,21 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) .toString() }, + HAMSTER_JAVA(0.01) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return hamsterJavaSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-5 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) + .toString() + }, ; init { diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index f9ab3a7..da0ffe3 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -259,6 +259,9 @@ val hamsterSvg: String = ClassPathResource("persona/animal/hamster.svg") val hamsterSpringSvg: String = ClassPathResource("persona/animal/hamster-spring.svg") .getContentAsString(Charset.defaultCharset()) +val hamsterJavaSvg: String = ClassPathResource("persona/animal/hamster-java.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/hamster-java.svg b/src/main/resources/persona/animal/hamster-java.svg new file mode 100644 index 0000000..5df2e06 --- /dev/null +++ b/src/main/resources/persona/animal/hamster-java.svg @@ -0,0 +1,192 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4b28e2cfde13d675d5f96ebbb04fbece57324adf Mon Sep 17 00:00:00 2001 From: devxb Date: Sat, 16 Nov 2024 21:14:58 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20hamster=20kotlin=F0=9F=90=B9=20?= =?UTF-8?q?=ED=8E=AB=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 1 + README-zhcn.md | 1 + README.md | 1 + docs/hamster-java.svg | 41 ----- docs/hamster-kotlin.svg | 126 +++++++++++++ docs/hamster-spring.svg | 41 ----- .../gitanimals/render/domain/PersonaType.kt | 15 ++ .../org/gitanimals/render/domain/Svgs.kt | 3 + .../persona/animal/hamster-kotlin.svg | 172 ++++++++++++++++++ 9 files changed, 319 insertions(+), 82 deletions(-) create mode 100644 docs/hamster-kotlin.svg create mode 100644 src/main/resources/persona/animal/hamster-kotlin.svg diff --git a/README-en.md b/README-en.md index 6bdcadf..d376d36 100644 --- a/README-en.md +++ b/README-en.md @@ -121,6 +121,7 @@ _New contributions may take up to 1 hour to be reflected._ | name | ratio | Description | |---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_KOTLIN
| 0.01 | | | HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | diff --git a/README-zhcn.md b/README-zhcn.md index 541db8f..9d637c4 100644 --- a/README-zhcn.md +++ b/README-zhcn.md @@ -120,6 +120,7 @@ _ๆ–ฐ็š„่ดก็Œฎๅฏ่ƒฝ้œ€่ฆ1ไธชๅฐๆ—ถๆ‰่ƒฝๆ˜พ็คบ_ | ๅๅญ— | ๆฆ‚็Ž‡ | ๆ่ฟฐ | |---------------------------------------------------------------------------------------------------------|-------|--------------------------------------------------------------------------------------------------------------------| +| HAMSTER_KOTLIN
| 0.01 | | | HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | diff --git a/README.md b/README.md index 108dc16..b5adce3 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ _์ƒˆ๋กœ์šด contribution ๋ฐ˜์˜์€ ์ตœ๋Œ€ 1์‹œ๊ฐ„์ด ์†Œ์š”๋  ์ˆ˜ ์žˆ์–ด์š”._ | name | ratio | Description | |----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_KOTLIN
| 0.01 | | | HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | | HAMSTER
| 0.8 | | diff --git a/docs/hamster-java.svg b/docs/hamster-java.svg index 591a0b6..6aebbc1 100644 --- a/docs/hamster-java.svg +++ b/docs/hamster-java.svg @@ -37,47 +37,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/hamster-kotlin.svg b/docs/hamster-kotlin.svg new file mode 100644 index 0000000..d3e65dd --- /dev/null +++ b/docs/hamster-kotlin.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/hamster-spring.svg b/docs/hamster-spring.svg index 0f0f1ad..b8ed2c3 100644 --- a/docs/hamster-spring.svg +++ b/docs/hamster-spring.svg @@ -37,47 +37,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index cc240b1..34f282c 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1391,6 +1391,21 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) .toString() }, + HAMSTER_KOTLIN(0.01) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return hamsterKotlinSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-5 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) + .toString() + }, ; init { diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index da0ffe3..0c10293 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -262,6 +262,9 @@ val hamsterSpringSvg: String = ClassPathResource("persona/animal/hamster-spring. val hamsterJavaSvg: String = ClassPathResource("persona/animal/hamster-java.svg") .getContentAsString(Charset.defaultCharset()) +val hamsterKotlinSvg: String = ClassPathResource("persona/animal/hamster-kotlin.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/hamster-kotlin.svg b/src/main/resources/persona/animal/hamster-kotlin.svg new file mode 100644 index 0000000..3fbebb8 --- /dev/null +++ b/src/main/resources/persona/animal/hamster-kotlin.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 48ae7871652038560a302cd6aa56a5980c400f8e Mon Sep 17 00:00:00 2001 From: devxb Date: Sat, 16 Nov 2024 21:21:19 +0900 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20hamster=20js=F0=9F=90=B9=20?= =?UTF-8?q?=ED=8E=AB=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 1 + README-zhcn.md | 1 + README.md | 1 + docs/hamster-js.svg | 120 +++++++++++++ .../gitanimals/render/domain/PersonaType.kt | 15 ++ .../org/gitanimals/render/domain/Svgs.kt | 3 + .../resources/persona/animal/hamster-js.svg | 166 ++++++++++++++++++ 7 files changed, 307 insertions(+) create mode 100644 docs/hamster-js.svg create mode 100644 src/main/resources/persona/animal/hamster-js.svg diff --git a/README-en.md b/README-en.md index d376d36..611b196 100644 --- a/README-en.md +++ b/README-en.md @@ -121,6 +121,7 @@ _New contributions may take up to 1 hour to be reflected._ | name | ratio | Description | |---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_JS
| 0.01 | | | HAMSTER_KOTLIN
| 0.01 | | | HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | diff --git a/README-zhcn.md b/README-zhcn.md index 9d637c4..4d9b61e 100644 --- a/README-zhcn.md +++ b/README-zhcn.md @@ -120,6 +120,7 @@ _ๆ–ฐ็š„่ดก็Œฎๅฏ่ƒฝ้œ€่ฆ1ไธชๅฐๆ—ถๆ‰่ƒฝๆ˜พ็คบ_ | ๅๅญ— | ๆฆ‚็Ž‡ | ๆ่ฟฐ | |---------------------------------------------------------------------------------------------------------|-------|--------------------------------------------------------------------------------------------------------------------| +| HAMSTER_JS
| 0.01 | | | HAMSTER_KOTLIN
| 0.01 | | | HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | diff --git a/README.md b/README.md index b5adce3..29147b3 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ _์ƒˆ๋กœ์šด contribution ๋ฐ˜์˜์€ ์ตœ๋Œ€ 1์‹œ๊ฐ„์ด ์†Œ์š”๋  ์ˆ˜ ์žˆ์–ด์š”._ | name | ratio | Description | |----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| HAMSTER_JS
| 0.01 | | | HAMSTER_KOTLIN
| 0.01 | | | HAMSTER_JAVA
| 0.01 | | | HAMSTER_SPRING
| 0.01 | | diff --git a/docs/hamster-js.svg b/docs/hamster-js.svg new file mode 100644 index 0000000..a53574a --- /dev/null +++ b/docs/hamster-js.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index 34f282c..4889bde 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1406,6 +1406,21 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) .toString() }, + HAMSTER_JS(0.01) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return hamsterJsSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-5 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0) + .toString() + }, ; init { diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index 0c10293..4e04d07 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -265,6 +265,9 @@ val hamsterJavaSvg: String = ClassPathResource("persona/animal/hamster-java.svg" val hamsterKotlinSvg: String = ClassPathResource("persona/animal/hamster-kotlin.svg") .getContentAsString(Charset.defaultCharset()) +val hamsterJsSvg: String = ClassPathResource("persona/animal/hamster-js.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/hamster-js.svg b/src/main/resources/persona/animal/hamster-js.svg new file mode 100644 index 0000000..2677b3d --- /dev/null +++ b/src/main/resources/persona/animal/hamster-js.svg @@ -0,0 +1,166 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +