Skip to content

Commit

Permalink
feat: RABBIT persona를 추가한다
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Jun 6, 2024
1 parent 79a9bb4 commit 5e1934f
Show file tree
Hide file tree
Showing 7 changed files with 381 additions and 85 deletions.
1 change: 1 addition & 0 deletions ENGLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ _New contributions may take up to 1 hour to be reflected._

| name | ratio | Description |
|------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| RABBIT <br> <img src = "docs/rabbit.svg" width="40px" height="55px"/> | 0.9 | |
| MOLE <br> <img src = "docs/mole.svg" width="40px" height="45px" /> | 0.3 | |
| MOLE_GRASS <br> <img src = "docs/mole-grass.svg" width="45px" height="45px" /> | 0.1 | |
| QUOKKA <br> <img src = "docs/quokka.svg" width="23px" height="42px" /> | 0.3 | |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ _새로운 contribution은 반영은 최대 1시간이 소요될 수 있어요._

| name | ratio | Description |
|------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| RABBIT <br> <img src = "docs/rabbit.svg" width="40px" height="55px"/> | 0.9 | |
| MOLE <br> <img src = "docs/mole.svg" width="40px" height="45px" /> | 0.3 | |
| MOLE_GRASS <br> <img src = "docs/mole-grass.svg" width="45px" height="45px" /> | 0.1 | |
| QUOKKA <br> <img src = "docs/quokka.svg" width="23px" height="42px" /> | 0.3 | |
Expand Down
110 changes: 110 additions & 0 deletions docs/rabbit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,21 @@ enum class PersonaType(private val weight: Double) {
StringBuilder().moveRandomly("mole", id, 40, "180s", 5, 14.0)
.toString()
},
RABBIT(0.9){
override fun loadSvg(user: User, persona: Persona, mode: Mode): String {
return rabbitSvg.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()
},
;

init {
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/org/gitanimals/render/domain/Svgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ val moleSvg: String = ClassPathResource("persona/animal/mole.svg")
val moleGrassSvg: String = ClassPathResource("persona/animal/mole-grass.svg")
.getContentAsString(Charset.defaultCharset())

val rabbitSvg: String = ClassPathResource("persona/animal/rabbit.svg")
.getContentAsString(Charset.defaultCharset())

val largeTextSvgs = lazy {
val map = mutableMapOf<String, String>()
for (i in 'A'..'Z') {
Expand Down
157 changes: 157 additions & 0 deletions src/main/resources/persona/animal/rabbit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5e1934f

Please sign in to comment.