-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wisdom runes spawning. Game is paused. Roshan's minimum respawn time is reached.
- Loading branch information
Showing
20 changed files
with
560 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/kotlin/com/github/mrbean355/admiralbulldog/game/Roshan.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2023 Michael Johnston | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.github.mrbean355.admiralbulldog.game | ||
|
||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.StateFlow | ||
import kotlinx.coroutines.flow.asStateFlow | ||
|
||
object Roshan { | ||
const val AEGIS_DURATION: Int = 5 * 60 | ||
const val MIN_RESPAWN_TIME: Int = 8 * 60 | ||
const val MAX_RESPAWN_TIME: Int = 11 * 60 | ||
|
||
const val AEGIS_DURATION_TURBO: Int = 4 * 60 | ||
const val MIN_RESPAWN_TIME_TURBO: Int = MIN_RESPAWN_TIME / 2 | ||
const val MAX_RESPAWN_TIME_TURBO: Int = MAX_RESPAWN_TIME / 2 | ||
|
||
private val _deathTime: MutableStateFlow<Int?> = MutableStateFlow(null) | ||
|
||
val deathTime: StateFlow<Int?> = _deathTime.asStateFlow() | ||
|
||
fun setDeathTime(deathTime: Int) { | ||
_deathTime.value = deathTime | ||
} | ||
|
||
fun reset() { | ||
_deathTime.value = null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ain/kotlin/com/github/mrbean355/admiralbulldog/persistence/migration/From3To4Migration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2023 Michael Johnston | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.github.mrbean355.admiralbulldog.persistence.migration | ||
|
||
import com.google.gson.JsonArray | ||
import com.google.gson.JsonObject | ||
|
||
class From3To4Migration : Migration(from = 3, to = 4) { | ||
|
||
override fun migrate(config: JsonObject) { | ||
// New property: wisdom rune timer. | ||
config.getAsJsonObject("special")["wisdomRuneTimer"] = 45 | ||
|
||
// New triggers: OnWisdomRunesSpawn, OnPause, RoshanTimer. | ||
config.getAsJsonObject("sounds").apply { | ||
add("OnWisdomRunesSpawn", triggerConfig()) | ||
add("OnPause", triggerConfig()) | ||
add("RoshanTimer", triggerConfig()) | ||
} | ||
} | ||
|
||
private fun triggerConfig() = JsonObject().apply { | ||
addProperty("enabled", false) | ||
addProperty("chance", 100) | ||
addProperty("minRate", 100) | ||
addProperty("maxRate", 100) | ||
addProperty("playThroughDiscord", false) | ||
add("sounds", JsonArray()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.