diff --git a/ENGLISH.md b/ENGLISH.md index 6e67001..be3f983 100644 --- a/ENGLISH.md +++ b/ENGLISH.md @@ -119,6 +119,9 @@ _New contributions may take up to 1 hour to be reflected._ | name | ratio | Description | |---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| SLOTH_SUNGLASSES
| 0.06 | | +| SLOTH_KING
| 0.05 | | +| SLOTH
| 0.7 | | | DESSERT_FOX
| 0.05 | | | RABBIT
| 0.9 | | | MOLE
| 0.3 | | diff --git a/README.md b/README.md index 3ae8a8f..d13756d 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,9 @@ _새로운 contribution은 반영은 최대 1시간이 소요될 수 있어요._ | name | ratio | Description | |----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| SLOTH_SUNGLASSES
| 0.06 | | +| SLOTH_KING
| 0.05 | | +| SLOTH
| 0.7 | | | DESSERT_FOX
| 0.05 | | | RABBIT
| 0.9 | | | MOLE
| 0.3 | | diff --git a/docs/sloth-king.svg b/docs/sloth-king.svg new file mode 100644 index 0000000..d3b5bc6 --- /dev/null +++ b/docs/sloth-king.svg @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sloth-sunglasses.svg b/docs/sloth-sunglasses.svg new file mode 100644 index 0000000..a507b62 --- /dev/null +++ b/docs/sloth-sunglasses.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sloth.svg b/docs/sloth.svg new file mode 100644 index 0000000..543b234 --- /dev/null +++ b/docs/sloth.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle.properties b/gradle.properties index 9651458..91866ec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,7 @@ kotestExtensionSpringVersion=1.1.3 testContainerVersion=1.19.3 ### Netx ### -netxVersion=0.4.3 +netxVersion=0.4.4-beta-1 ### Sentry ### sentryVersion=4.4.0 diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index 86398c9..12224cc 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -1181,6 +1181,51 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null) StringBuilder().moveRandomly("dessert-fox", id, 40, "180s", 5, 26.0) .toString() }, + SLOTH(0.7) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return slothSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-6 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("sloth", id, 5, "180s", 5, 16.5) + .toString() + }, + SLOTH_KING(0.05) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return slothKingSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-6 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("sloth", id, 5, "180s", 5, 16.5) + .toString() + }, + SLOTH_SUNGLASSES(0.06) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + return slothSunglassesSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-6 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("sloth", id, 5, "180s", 5, 16.5) + .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 1fbbcf3..532869b 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -211,6 +211,14 @@ val dessertFoxSvg: String = ClassPathResource("persona/animal/dessert-fox.svg") val dessertFoxCollaboratorSvg: String = ClassPathResource("persona/animal/dessert-fox-collaborator.svg") .getContentAsString(Charset.defaultCharset()) +val slothSvg: String = ClassPathResource("persona/animal/sloth.svg") + .getContentAsString(Charset.defaultCharset()) + +val slothKingSvg: String = ClassPathResource("persona/animal/sloth-king.svg") + .getContentAsString(Charset.defaultCharset()) + +val slothSunglassesSvg: String = ClassPathResource("persona/animal/sloth-sunglasses.svg") + .getContentAsString(Charset.defaultCharset()) val largeTextSvgs = lazy { val map = mutableMapOf() diff --git a/src/main/resources/persona/animal/sloth-king.svg b/src/main/resources/persona/animal/sloth-king.svg new file mode 100644 index 0000000..acf0a44 --- /dev/null +++ b/src/main/resources/persona/animal/sloth-king.svg @@ -0,0 +1,199 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/persona/animal/sloth-sunglasses.svg b/src/main/resources/persona/animal/sloth-sunglasses.svg new file mode 100644 index 0000000..becf373 --- /dev/null +++ b/src/main/resources/persona/animal/sloth-sunglasses.svg @@ -0,0 +1,206 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/persona/animal/sloth.svg b/src/main/resources/persona/animal/sloth.svg new file mode 100644 index 0000000..53af3d6 --- /dev/null +++ b/src/main/resources/persona/animal/sloth.svg @@ -0,0 +1,197 @@ + + + + + + + + + + + + + *{contribution} + + + + + + + + + + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/persona/goose/test.svg b/src/test/resources/persona/goose/test.svg index 63feaec..66be4bb 100644 --- a/src/test/resources/persona/goose/test.svg +++ b/src/test/resources/persona/goose/test.svg @@ -2,203 +2,156 @@ - - - - - - - - - - - - - *{contribution} - - - - - - - - - - - - - - - - - - - - *{level} - - - + + - - + + - - + - + + + - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +