diff --git a/README.md b/README.md index 10f844c..9985069 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,8 @@ _새로운 contribtuion은 반영은 최대 1시간이 소요될 수 있어요. | slime_green | 0.1 | | | slime_blue | 0.1 | | | flamingo
| 0.08 | | -| TEN_MM
| 0.00 | Character created by `10MM` donations
Only buy in shop
10MM | +| TEN_MM
| 0.00 | Character created by `10MM` donations
Only buy in shop
10MM | +| goblin
| 0.06 | | ## diff --git a/docs/goblin.svg b/docs/goblin.svg new file mode 100644 index 0000000..fa78ca6 --- /dev/null +++ b/docs/goblin.svg @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt index fd9ef75..d88c275 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt @@ -956,6 +956,24 @@ enum class PersonaType(private val weight: Double) { StringBuilder().moveRandomly("tenmm", id, 15, "180s", 5) .toString() }, + + GOBLIN(0.06) { + override fun loadSvg(user: User, persona: Persona, mode: Mode): String { + check(persona.id != null) { "Save persona first before call load()" } + + return goblinSvg.replace("*{act}", act(persona.id)) + .replace("*{id}", persona.id.toString()) + .replace("*{level}", persona.level.value.toSvg(14.0, 2.0)) + .replace( + "*{levelx}", + (-6.5 + (-1 * (persona.level.value.toString().length))).toString() + ) + } + + override fun act(id: Long): String = + StringBuilder().moveRandomly("goblin", id, 15, "180s", 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 4db4360..02b0a82 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -150,6 +150,9 @@ val flamingoSvg: String = ClassPathResource("persona/animal/flamingo.svg") val tenmmSvg: String = ClassPathResource("persona/animal/tenmm.svg") .getContentAsString(Charset.defaultCharset()) +val goblinSvg: String = ClassPathResource("persona/animal/goblin.svg") + .getContentAsString(Charset.defaultCharset()) + val largeTextSvgs = lazy { val map = mutableMapOf() for (i in 'A'..'Z') { diff --git a/src/main/resources/persona/animal/goblin.svg b/src/main/resources/persona/animal/goblin.svg new file mode 100644 index 0000000..c59f5c4 --- /dev/null +++ b/src/main/resources/persona/animal/goblin.svg @@ -0,0 +1,136 @@ + + + + + + + *{contribution} + + + + + + + + + + + *{level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/persona/goose/test.svg b/src/test/resources/persona/goose/test.svg index 98d6b28..fda8515 100644 --- a/src/test/resources/persona/goose/test.svg +++ b/src/test/resources/persona/goose/test.svg @@ -1,198 +1,137 @@ - + + + + + + *{contribution} - - + + - - - + *{level} + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - +