Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed May 26, 2024
1 parent 4976029 commit b9b8921
Show file tree
Hide file tree
Showing 9 changed files with 706 additions and 105 deletions.
2 changes: 2 additions & 0 deletions ENGLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ _New contributions may take up to 1 hour to be reflected._

| name | ratio | Description |
|------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 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 | |
| QUOKKA_LEAF <br> <img src = "docs/quokka-leaf.svg" width="23px" height="42px" /> | 0.1 | |
| QUOKKA_SUNGLASSES <br> <img src = "docs/quokka-sunglasses.svg" width="23px" height="42px" /> | 0.05 | |
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ _새로운 contribution은 반영은 최대 1시간이 소요될 수 있어요._

| name | ratio | Description |
|------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 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 | |
| QUOKKA_LEAF <br> <img src = "docs/quokka-leaf.svg" width="23px" height="42px" /> | 0.1 | |
| QUOKKA_SUNGLASSES <br> <img src = "docs/quokka-sunglasses.svg" width="23px" height="42px" /> | 0.05 | |
Expand Down
144 changes: 144 additions & 0 deletions docs/mole-grass.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 108 additions & 0 deletions docs/mole.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,36 @@ enum class PersonaType(private val weight: Double) {
StringBuilder().moveRandomly("quokka", id, 40, "180s", 5, 10.0)
.toString()
},
MOLE(0.3) {
override fun loadSvg(user: User, persona: Persona, mode: Mode): String {
return moleSvg.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()
},
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 {
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/org/gitanimals/render/domain/Svgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ val quokkaLeafSvg: String = ClassPathResource("persona/animal/quokka-leaf.svg")
val quokkaSunglassesSvg: String = ClassPathResource("persona/animal/quokka-sunglasses.svg")
.getContentAsString(Charset.defaultCharset())

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<String, String>()
Expand Down
Loading

0 comments on commit b9b8921

Please sign in to comment.