From f3c69510b13895e7f6db524a864116905abdb341 Mon Sep 17 00:00:00 2001 From: devxb Date: Sun, 8 Sep 2024 20:11:20 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20RABBIT=5FCOLLABORATOR=20=ED=8E=AB?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitanimals/render/domain/PersonaType.kt | 15 ++ .../org/gitanimals/render/domain/Svgs.kt | 3 + .../persona/animal/rabbit-collaborator.svg | 170 ++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 src/main/resources/persona/animal/rabbit-collaborator.svg diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index 13f71e0..67e2f0b 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1152,6 +1152,21 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) StringBuilder().moveRandomly("rabbit", id, 40, "180s", 5, 10.0) .toString() }, + RABBIT_COLLABORATOR(0.0) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return rabbitCollaboratorSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-9 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("rabbit", id, 40, "180s", 5, 10.0) + .toString() + }, DESSERT_FOX(0.05) { override fun loadSvg(user: User, persona: Persona, mode: Mode): String { return dessertFoxSvg.replace("*{act}", act(persona.id)) diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index 532869b..98102c5 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -220,6 +220,9 @@ val slothKingSvg: String = ClassPathResource("persona/animal/sloth-king.svg") val slothSunglassesSvg: String = ClassPathResource("persona/animal/sloth-sunglasses.svg") .getContentAsString(Charset.defaultCharset()) +val rabbitCollaboratorSvg: String = ClassPathResource("persona/animal/rabbit-collaborator.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/rabbit-collaborator.svg b/src/main/resources/persona/animal/rabbit-collaborator.svg new file mode 100644 index 0000000..47a3379 --- /dev/null +++ b/src/main/resources/persona/animal/rabbit-collaborator.svg @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b32f314812ed0b354877b16d7b9fc3b0f932d0bb Mon Sep 17 00:00:00 2001 From: devxb Date: Sun, 8 Sep 2024 20:17:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20rabbit-collaborator=20=EB=A5=BC=20?= =?UTF-8?q?=EB=AC=B8=EC=84=9C=ED=99=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ENGLISH.md | 1 + README.md | 1 + docs/rabbit-collaborator.svg | 122 +++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 docs/rabbit-collaborator.svg diff --git a/ENGLISH.md b/ENGLISH.md index be3f983..d0d4e9d 100644 --- a/ENGLISH.md +++ b/ENGLISH.md @@ -189,6 +189,7 @@ _New contributions may take up to 1 hour to be reflected._ | dessert_fox_collaborator
| 0.0 | Pet made for collaborator [sumi-001](https://github.com/sumi-0011) | | white_cat_collaborator
| 0.0 | Pet made for collaborator [Ha youna](https://www.behance.net/hyn991022a6be) | | pig_collaborator
| 0.0 | Pet made for collaborator [hyesungoh](https://github.com/hyesungoh) | +| rabbit_collaborator
| 0.0 | Pet made for collaborator [Choi jiwoo](https://www.behance.net/sopungcjw42af) | ## diff --git a/README.md b/README.md index e7d6837..a4cf458 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ _새로운 contribution은 반영은 최대 1시간이 소요될 수 있어요._ | dessert_fox_collaborator
| 0.0 | Pet made for collaborator [sumi-001](https://github.com/sumi-0011) | | white_cat_collaborator
| 0.0 | Pet made for collaborator [Ha youna](https://www.behance.net/hyn991022a6be) | | pig_collaborator
| 0.0 | Pet made for collaborator [hyesungoh](https://github.com/hyesungoh) | +| rabbit_collaborator
| 0.0 | Pet made for collaborator [Choi jiwoo](https://www.behance.net/sopungcjw42af) | ## diff --git a/docs/rabbit-collaborator.svg b/docs/rabbit-collaborator.svg new file mode 100644 index 0000000..18cd147 --- /dev/null +++ b/docs/rabbit-collaborator.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +