Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 57 additions & 3 deletions src/main/kotlin/org/gitanimals/core/PersonaType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,26 @@ enum class PersonaType(
.toString()
},

LITTLE_CHICK(weight = 0.9, personaEvolution = PersonaEvolution(weight = 0.3, type = PersonaEvolutionType.LITTLE_CHICK)) {
LITTLE_CHICK(weight = 0.9, haveAnimation = true, personaEvolution = PersonaEvolution(weight = 0.3, type = PersonaEvolutionType.LITTLE_CHICK)) {
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
val emotion = buildEmotionAnimation(
idPrefix = "little-chick",
animationId = animationId,
totalDuration = 180.0,
emotionDuration = 3.0,
emotionSvgs = listOf(
littleChickIdleFollowEmotionSvg,
littleChickThinkingEmotionSvg,
littleChickTypingEmotionSvg,
),
emotionYOffsets = listOf(0.0, 0.0, 0.0),
minGap = 1.0,
maxGap = 1.0,
)

val littleChick = littleChickSvg.replace("*{act}", act(animationId))
.replace("*{emotion-style}", emotion.css)
.replace("*{emotions}", emotion.content)
.replace("*{id}", animationId.toString())
.replace("*{leg-iteration-count}", "360")
.replace("*{level}", level.toSvg(14.0, 2.0))
Expand All @@ -293,9 +310,26 @@ enum class PersonaType(
.toString()
},

LITTLE_CHICK_SUNGLASSES(weight = 0.4, personaEvolution = PersonaEvolution(weight = 0.4, type = PersonaEvolutionType.LITTLE_CHICK)) {
LITTLE_CHICK_SUNGLASSES(weight = 0.4, haveAnimation = true, personaEvolution = PersonaEvolution(weight = 0.4, type = PersonaEvolutionType.LITTLE_CHICK)) {
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
val emotion = buildEmotionAnimation(
idPrefix = "little-chick",
animationId = animationId,
totalDuration = 180.0,
emotionDuration = 3.0,
emotionSvgs = listOf(
littleChickIdleFollowEmotionSvg,
littleChickThinkingEmotionSvg,
littleChickTypingEmotionSvg,
),
emotionYOffsets = listOf(0.0, 0.0, 0.0),
minGap = 1.0,
maxGap = 1.0,
)

val littleChick = littleChickSunglassesSvg.replace("*{act}", act(animationId))
.replace("*{emotion-style}", emotion.css)
.replace("*{emotions}", emotion.content)
.replace("*{id}", animationId.toString())
.replace("*{leg-iteration-count}", "360")
.replace("*{level}", level.toSvg(14.0, 2.0))
Expand Down Expand Up @@ -2459,9 +2493,29 @@ enum class PersonaType(
.toString()
},

CAPYBARA_CARROT(0.6) {
CAPYBARA_CARROT(0.6, haveAnimation = true) {
override fun loadSvg(name: String, animationId: Long, level: Long, mode: Mode): String {
val emotion = buildEmotionAnimation(
idPrefix = "capybara-carrot",
animationId = animationId,
totalDuration = 180.0,
emotionDuration = 3.0,
emotionSvgs = listOf(
capybaraCarrotErrorEmotionSvg,
capybaraCarrotHappyEmotionSvg,
capybaraCarrotIdleFollowEmotionSvg,
capybaraCarrotNotificationEmotionSvg,
capybaraCarrotThinkingEmotionSvg,
capybaraCarrotTypingEmotionSvg,
),
emotionYOffsets = listOf(0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
minGap = 1.0,
maxGap = 1.0,
)

return capybaraCarrotSvg.replace("*{act}", act(animationId))
.replace("*{emotion-style}", emotion.css)
.replace("*{emotions}", emotion.content)
.replace("*{id}", animationId.toString())
.replace("*{leg-iteration-count}", "360")
.replace("*{level}", level.toSvg(14.0, 2.0))
Expand Down
36 changes: 36 additions & 0 deletions src/main/kotlin/org/gitanimals/core/Svgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ val littleChickLinuxSvg: String = ClassPathResource("persona/animal/little-chick
val littleChickSpringSvg: String = ClassPathResource("persona/animal/little-chick-spring.svg")
.getContentAsString(Charset.defaultCharset())

val littleChickIdleFollowEmotionSvg: String =
ClassPathResource("persona/animal/emotion/little-chick/idle-follow.svg")
.getContentAsString(Charset.defaultCharset())

val littleChickThinkingEmotionSvg: String =
ClassPathResource("persona/animal/emotion/little-chick/thinking.svg")
.getContentAsString(Charset.defaultCharset())

val littleChickTypingEmotionSvg: String =
ClassPathResource("persona/animal/emotion/little-chick/typing.svg")
.getContentAsString(Charset.defaultCharset())

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

Expand Down Expand Up @@ -377,6 +389,30 @@ val capybaraCarrotSvg: String = ClassPathResource("persona/animal/capybara-carro
val capybaraSwimSvg: String = ClassPathResource("persona/animal/capybara-swim.svg")
.getContentAsString(Charset.defaultCharset())

val capybaraCarrotErrorEmotionSvg: String =
ClassPathResource("persona/animal/emotion/capybara-carrot/error.svg")
.getContentAsString(Charset.defaultCharset())

val capybaraCarrotHappyEmotionSvg: String =
ClassPathResource("persona/animal/emotion/capybara-carrot/happy.svg")
.getContentAsString(Charset.defaultCharset())

val capybaraCarrotIdleFollowEmotionSvg: String =
ClassPathResource("persona/animal/emotion/capybara-carrot/idle-follow.svg")
.getContentAsString(Charset.defaultCharset())

val capybaraCarrotNotificationEmotionSvg: String =
ClassPathResource("persona/animal/emotion/capybara-carrot/notification.svg")
.getContentAsString(Charset.defaultCharset())

val capybaraCarrotThinkingEmotionSvg: String =
ClassPathResource("persona/animal/emotion/capybara-carrot/thinking.svg")
.getContentAsString(Charset.defaultCharset())

val capybaraCarrotTypingEmotionSvg: String =
ClassPathResource("persona/animal/emotion/capybara-carrot/typing.svg")
.getContentAsString(Charset.defaultCharset())

val littleChickEggOnHatSvg: String = ClassPathResource("persona/animal/evolution/little-chick-egg-on-hat.svg")
.getContentAsString(Charset.defaultCharset())

Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/persona/animal/capybara-carrot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
118 changes: 118 additions & 0 deletions src/main/resources/persona/animal/emotion/capybara-carrot/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
118 changes: 118 additions & 0 deletions src/main/resources/persona/animal/emotion/capybara-carrot/happy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading