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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package world.gregs.voidps.engine.entity.character.mode.combat

import world.gregs.voidps.engine.client.ui.dialogue
import world.gregs.voidps.engine.client.variable.hasClock
import world.gregs.voidps.engine.data.config.CombatDefinition
import world.gregs.voidps.engine.data.definition.CombatDefinitions
Expand Down Expand Up @@ -43,9 +42,6 @@ class CombatMovement(
}

override fun tick() {
if (character is Player && character.dialogue != null) {
return
}
if (target.tile.level != character.tile.level) {
character.mode = EmptyMode
return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package world.gregs.voidps.engine.queue

import kotlinx.coroutines.*
import world.gregs.voidps.engine.client.ui.closeDialogue
import world.gregs.voidps.engine.client.ui.closeMenu
import world.gregs.voidps.engine.client.ui.dialogue
import world.gregs.voidps.engine.client.ui.hasMenuOpen
Expand Down Expand Up @@ -34,6 +35,7 @@ class ActionQueue<C : Character>(
fun tick() {
if (queue.contains(ActionPriority.Strong)) {
(character as? Player)?.closeMenu()
(character as? Player)?.closeDialogue()
weakQueue.clear()
}
process(queue)
Expand All @@ -45,7 +47,7 @@ class ActionQueue<C : Character>(
while (action != null) {
// Cache end to exit before the last action can add any children
val end = action.next == null
if (action.process() && canProcess()) {
if (action.process() && (action.priority == ActionPriority.Strong || canProcess())) {
val next = action.next
queue.remove(action)
scope.launch(action)
Expand Down
8 changes: 2 additions & 6 deletions game/src/main/kotlin/content/entity/combat/Combat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import content.skill.magic.Magic
import content.skill.melee.weapon.*
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.client.message
import world.gregs.voidps.engine.client.ui.dialogue
import world.gregs.voidps.engine.client.variable.hasClock
import world.gregs.voidps.engine.client.variable.start
import world.gregs.voidps.engine.client.variable.stop
Expand Down Expand Up @@ -165,11 +164,8 @@ class Combat(val combatDefinitions: CombatDefinitions) :
character.mode = CombatMovement(character, target)
character.target = target
}
val movement = character.mode as CombatMovement
if (character is Player && character.dialogue != null) {
return
}
if (character.target == null || !Target.attackable(character, target)) {
val movement = character.mode as CombatMovement
if (character.target == null || !Target.attackable(character, target)) {
character.mode = EmptyMode
return
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package content.entity.player.dialogue.type

import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.client.message
import world.gregs.voidps.engine.client.ui.*
import world.gregs.voidps.engine.client.ui.chat.an
import world.gregs.voidps.engine.client.ui.close
Expand Down Expand Up @@ -66,6 +67,7 @@ class LevelUp : Script {
jingle("level_up_${skill.name.lowercase()}${if (unlock) "_unlock" else ""}", 0.5)
addVarbit("skill_stat_flash", skill.name.lowercase())
val level = if (skill == Constitution) to / 10 else to
message("Congratulations! You've just advanced${skill.name.an()} ${skill.name} level! You have now reached level $level!")
weakQueue("level_up") {
levelUp(
this,
Expand Down