From cd11ee5d60bdaf8395d633147b4ad61e3aab4db0 Mon Sep 17 00:00:00 2001 From: devxb Date: Sun, 26 May 2024 16:09:45 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20MOLE=5FGRASS=20=EC=BA=90=EB=A6=AD?= =?UTF-8?q?=ED=84=B0=EB=A5=BC=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 --- .../gitanimals/render/domain/PersonaType.kt | 17 +- .../org/gitanimals/render/domain/Svgs.kt | 3 + .../resources/persona/animal/mole-grass.svg | 207 ++++++++++++++++++ 3 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/persona/animal/mole-grass.svg diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index 15e027d..8fd17a8 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1070,7 +1070,22 @@ enum class PersonaType(private val weight: Double) { override fun act(id: Long): String = StringBuilder().moveRandomly("mole", id, 40, "180s", 5, 14.0) .toString() - } + }, + MOLE_GRASS(0.1){ + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return moleGrassSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-8 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("mole", id, 40, "180s", 5, 14.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 b9fbc5d..25293e1 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -190,6 +190,9 @@ val quokkaSunglassesSvg: String = ClassPathResource("persona/animal/quokka-sungl val moleSvg: String = ClassPathResource("persona/animal/mole.svg") .getContentAsString(Charset.defaultCharset()) +val moleGrassSvg: String = ClassPathResource("persona/animal/mole-grass.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/mole-grass.svg b/src/main/resources/persona/animal/mole-grass.svg new file mode 100644 index 0000000..7017a9e --- /dev/null +++ b/src/main/resources/persona/animal/mole-grass.svg @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +