Skip to content

Commit 5e1934f

Browse files
committed
feat: RABBIT persona를 추가한다
1 parent 79a9bb4 commit 5e1934f

File tree

7 files changed

+381
-85
lines changed

7 files changed

+381
-85
lines changed

ENGLISH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ _New contributions may take up to 1 hour to be reflected._
117117

118118
| name | ratio | Description |
119119
|------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
120+
| RABBIT <br> <img src = "docs/rabbit.svg" width="40px" height="55px"/> | 0.9 | |
120121
| MOLE <br> <img src = "docs/mole.svg" width="40px" height="45px" /> | 0.3 | |
121122
| MOLE_GRASS <br> <img src = "docs/mole-grass.svg" width="45px" height="45px" /> | 0.1 | |
122123
| QUOKKA <br> <img src = "docs/quokka.svg" width="23px" height="42px" /> | 0.3 | |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ _새로운 contribution은 반영은 최대 1시간이 소요될 수 있어요._
113113

114114
| name | ratio | Description |
115115
|------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
116+
| RABBIT <br> <img src = "docs/rabbit.svg" width="40px" height="55px"/> | 0.9 | |
116117
| MOLE <br> <img src = "docs/mole.svg" width="40px" height="45px" /> | 0.3 | |
117118
| MOLE_GRASS <br> <img src = "docs/mole-grass.svg" width="45px" height="45px" /> | 0.1 | |
118119
| QUOKKA <br> <img src = "docs/quokka.svg" width="23px" height="42px" /> | 0.3 | |

docs/rabbit.svg

Lines changed: 110 additions & 0 deletions
Loading

src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,21 @@ enum class PersonaType(private val weight: Double) {
10861086
StringBuilder().moveRandomly("mole", id, 40, "180s", 5, 14.0)
10871087
.toString()
10881088
},
1089+
RABBIT(0.9){
1090+
override fun loadSvg(user: User, persona: Persona, mode: Mode): String {
1091+
return rabbitSvg.replace("*{act}", act(persona.id))
1092+
.replace("*{id}", persona.id.toString())
1093+
.replace("*{level}", persona.level.value.toSvg(14.0, 2.0))
1094+
.replace(
1095+
"*{levelx}",
1096+
(-9 + (-1 * (persona.level.value.toString().length))).toString()
1097+
)
1098+
}
1099+
1100+
override fun act(id: Long): String =
1101+
StringBuilder().moveRandomly("rabbit", id, 40, "180s", 5, 10.0)
1102+
.toString()
1103+
},
10891104
;
10901105

10911106
init {

src/main/kotlin/org/gitanimals/render/domain/Svgs.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ val moleSvg: String = ClassPathResource("persona/animal/mole.svg")
193193
val moleGrassSvg: String = ClassPathResource("persona/animal/mole-grass.svg")
194194
.getContentAsString(Charset.defaultCharset())
195195

196+
val rabbitSvg: String = ClassPathResource("persona/animal/rabbit.svg")
197+
.getContentAsString(Charset.defaultCharset())
198+
196199
val largeTextSvgs = lazy {
197200
val map = mutableMapOf<String, String>()
198201
for (i in 'A'..'Z') {
Lines changed: 157 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)