Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
96412c8
Fix: NPCs spawned under a target couldn't attack
HarleyGilpin Apr 10, 2026
15f8f32
Fix: NPCs spawned under a target couldn't attack
HarleyGilpin Apr 10, 2026
79de0ee
Merge remote-tracking branch 'origin/main'
HarleyGilpin Apr 11, 2026
1bf5b14
Fix: NPCs spawned under a target couldn't attack
HarleyGilpin Apr 11, 2026
635e183
Fix: character creation screen skipped for new accounts
HarleyGilpin Apr 11, 2026
d15e006
Fix: game loop crash when dying to TzTok-Jad in Fight Cave
HarleyGilpin Apr 12, 2026
8bc6b1b
chore: add missing dragon arrow items to ammo_groups.toml
HarleyGilpin Apr 12, 2026
2e8369f
Fix: dragon claws special attack damage and hit timing
HarleyGilpin Apr 12, 2026
2b13373
Fix: dragon claws special attack damage and hit timing
HarleyGilpin Apr 12, 2026
116b520
feat: add clan wars safe and dangerous free-for-all portals.
HarleyGilpin Apr 12, 2026
78ff78b
Fix: bank tab creation and collapse
HarleyGilpin Apr 13, 2026
725153d
Merge branch 'GregHib:main' into main
HarleyGilpin Apr 13, 2026
7b9f6ef
chore: replaced redundant code with stepOut function.
HarleyGilpin Apr 13, 2026
1fd24cd
Update game/src/main/kotlin/content/minigame/clan_wars/ClanWarsFreeFo…
HarleyGilpin Apr 13, 2026
3869de9
Update game/src/main/kotlin/content/minigame/clan_wars/ClanWarsFreeFo…
HarleyGilpin Apr 13, 2026
cebe42e
Merge remote-tracking branch 'origin/main'
HarleyGilpin Apr 13, 2026
889b863
Fix: Clan Wars FFA "Don't show gain" toggle
HarleyGilpin Apr 14, 2026
99d61bc
bug: fixed the dragon claws delayed special attack.
HarleyGilpin Apr 14, 2026
9f11324
chore: spotlessApply ran
HarleyGilpin Apr 14, 2026
27697ef
Fix: Iterate cardinal directions in random order and queue the first …
HarleyGilpin Apr 14, 2026
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
5 changes: 5 additions & 0 deletions data/area/wilderness/wilderness.areas.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,8 @@ tags = ["teleport", "obelisk"]
[wilderness_fishing_area]
x = [3347, 3368]
y = [3793, 3817]

[clan_wars]
x = [3264, 3279]
y = [3672, 3695]
tags = ["safe_zone"]
5 changes: 0 additions & 5 deletions data/area/wilderness/wilderness.npc-spawns.toml
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,6 @@ spawns = [
{ id = "black_salamander", x = 3321, y = 3661 },
{ id = "red_dragon", x = 3212, y = 3820 },
{ id = "red_dragon", x = 3222, y = 3829 },
{ id = "skeleton_axe_shield", x = 3275, y = 3686 },
{ id = "skeleton_sword_shield", x = 3270, y = 3681 },
{ id = "skeleton_longsword", x = 3275, y = 3676 },
{ id = "skeleton_flail", x = 3269, y = 3672 },
{ id = "waterfiend", x = 3362, y = 3642, members = true },
{ id = "waterfiend", x = 3363, y = 3647, members = true },
{ id = "waterfiend", x = 3365, y = 3639, members = true },
Expand Down Expand Up @@ -375,7 +371,6 @@ spawns = [
{ id = "giant_rat_wilderness_2", x = 3248, y = 3553, members = true },
{ id = "giant_rat_wilderness_2", x = 3256, y = 3541, members = true },
{ id = "goblin_musician", x = 3140, y = 3642 },
{ id = "skeleton_mace_shield", x = 3268, y = 3688 },
{ id = "green_dragon", x = 2982, y = 3618 },
{ id = "green_dragon", x = 3118, y = 3820 },
{ id = "green_dragon", x = 3338, y = 3676 },
Expand Down
4 changes: 2 additions & 2 deletions data/entity/player/modal/chat_box/warning.varbits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ format = "int"
[warning_clan_wars_ffa_safe]
id = 5294
persist = true
format = "boolean"
format = "int"

[warning_ranging_guild_tower]
id = 3871
Expand Down Expand Up @@ -146,7 +146,7 @@ format = "int"
[warning_clan_wars_ffa_dangerous]
id = 5295
persist = true
format = "boolean"
format = "int"

[warning_living_rock_caverns]
id = 6500
Expand Down
13 changes: 13 additions & 0 deletions data/entity/player/modal/chat_box/warnings.ifaces.toml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,19 @@ id = 82
[.living_rock_caverns]
id = 83

[warning_clan_wars_ffa_safe]
id = 793
type = "main_screen"

[.yes]
id = 15

[.no]
id = 14

[.dont_ask]
id = 9

[warning_godwars_wilderness_agility_route]
id = 600
type = "main_screen"
Expand Down
22 changes: 22 additions & 0 deletions data/minigame/clan_wars/clan_wars.areas.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,25 @@
x = [3266, 3270]
y = [3679, 3682]
tags = ["teleport"]

[clan_wars_ffa]
x = [2740, 3090]
y = [5490, 5640]

[clan_wars_ffa_safe_arena]
x = [2756, 2878]
y = [5512, 5630]

[clan_wars_ffa_safe_multi]
x = [2756, 2878]
y = [5571, 5630]
tags = ["multi_combat"]

[clan_wars_ffa_dangerous_arena]
x = [2948, 3071]
y = [5512, 5631]

[clan_wars_ffa_dangerous_multi]
x = [2948, 3071]
y = [5571, 5631]
tags = ["multi_combat"]
4 changes: 1 addition & 3 deletions data/minigame/clan_wars/clan_wars.ifaces.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[clan_wars]
id = 789
type = "overlay"

[clan_wars_defeat]
id = 790
Expand All @@ -10,6 +11,3 @@ id = 791
[clan_wars_overview]
id = 792

[clan_wars_respawn]
id = 793

15 changes: 15 additions & 0 deletions data/minigame/clan_wars/clan_wars.objs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[clan_wars_portal_ffa_safe]
id = 38698
examine = "A portal to a safe free-for-all fighting area."

[clan_wars_portal_ffa_dangerous]
id = 38699
examine = "A portal to a dangerous free-for-all fighting area."

[clan_wars_challenge_portal]
id = 28213
examine = "A portal to the Clan Wars arena."

[clan_wars_portal_ffa_safe_exit]
id = 38700
examine = "Leave the free-for-all fighting area."
3 changes: 3 additions & 0 deletions data/minigame/clan_wars/clan_wars.varbits.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[clan_wars_ffa_portal]
id = 5279
format = "int"
4 changes: 4 additions & 0 deletions data/skill/range/ammo_groups.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ items = [
"rune_arrow",
"rune_fire_arrows_lit",
"rune_fire_arrows_unlit",
"dragon_arrow",
"dragon_arrow_p",
"dragon_arrow_p+",
"dragon_arrow_p++",
"ice_arrows",
"broad_arrows",
"saradomin_arrows",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class AccountManager(
get() = Tile(Settings["world.home.x", 0], Settings["world.home.y", 0], Settings["world.home.level", 0])

fun create(name: String, passwordHash: String): Player = Player(tile = homeTile, accountName = name, passwordHash = passwordHash).apply {
this["creation"] = System.currentTimeMillis()
this["new_player"] = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import world.gregs.voidps.engine.entity.character.player.chat.cantReach
import world.gregs.voidps.engine.entity.item.Item
import world.gregs.voidps.engine.get
import world.gregs.voidps.engine.map.Overlap
import world.gregs.voidps.type.Direction
import world.gregs.voidps.type.Tile
import world.gregs.voidps.type.random
import kotlin.math.abs

/**
Expand Down Expand Up @@ -60,7 +58,6 @@ class CombatMovement(
if (!attack()) {
var skip: Boolean
if (Overlap.isUnder(character.tile, character.size, target.tile, target.size)) {
stepOut()
skip = true
} else {
val wasEmpty = character.steps.isEmpty()
Expand All @@ -81,17 +78,8 @@ class CombatMovement(
}
}

private fun stepOut() {
clearSteps()
if (target.mode is CombatMovement || target.mode is Interact) {
return
}
val direction = Direction.cardinal.random(random)
if (!canStep(direction.delta.x, direction.delta.y)) {
return
}
character.steps.queueStep(strategy.tile.add(direction))
}
override fun shouldQueueStepOut(): Boolean =
target.mode !is CombatMovement && target.mode !is Interact

private fun attack(): Boolean {
val attackRange = attackRange()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import world.gregs.voidps.engine.entity.character.Character
import world.gregs.voidps.engine.entity.character.mode.EmptyMode
import world.gregs.voidps.engine.entity.character.mode.move.Movement
import world.gregs.voidps.engine.entity.character.mode.move.target.TargetStrategy
import world.gregs.voidps.engine.entity.character.npc.NPC
import world.gregs.voidps.engine.entity.character.player.Player
import world.gregs.voidps.engine.entity.character.player.chat.cantReach
import world.gregs.voidps.engine.entity.character.player.chat.noInterest
import world.gregs.voidps.engine.map.Overlap
import world.gregs.voidps.engine.suspend.resumeSuspension
import world.gregs.voidps.type.Direction
import world.gregs.voidps.type.random

/**
* Moves a player within interact distance of [target]
Expand Down Expand Up @@ -86,6 +90,18 @@ open class Interact(
return
}
updateRange = false
val target = target
val npc = character as? NPC
if (npc != null && !npc.def["allowed_under", false] && target is Character &&
Overlap.isUnder(npc.tile, npc.size, target.tile, target.size)) {
clearSteps()
val direction = Direction.cardinal.random(random)
if (canStep(direction.delta.x, direction.delta.y)) {
character.steps.queueStep(npc.tile.add(direction))
}
super.tick()
return
}
Comment thread
HarleyGilpin marked this conversation as resolved.
Outdated
calculate()
val interacted = processInteraction()
if (interacted && interactionFinished()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import world.gregs.voidps.type.Delta
import world.gregs.voidps.type.Direction
import world.gregs.voidps.type.Tile
import world.gregs.voidps.type.equals
import world.gregs.voidps.type.random
import kotlin.math.sign

open class Movement(
Expand Down Expand Up @@ -53,6 +54,30 @@ open class Movement(
needsCalculation = false
}

/**
* Clears steps and queues a random cardinal step when an NPC overlaps its character target and isn't permitted to stand there.
*/
protected open fun stepOut(): Boolean {
val strategy = strategy ?: return false
if (strategy.shape != -2) return false
val npc = character as? NPC ?: return false
if (npc.def["allowed_under", false]) return false
if (!Overlap.isUnder(npc.tile, npc.size, npc.size, strategy.tile, strategy.width, strategy.height)) return false
clearSteps()
if (shouldQueueStepOut()) {
val direction = Direction.cardinal.random(random)
if (canStep(direction.delta.x, direction.delta.y)) {
character.steps.queueStep(npc.tile.add(direction))
}
}
return true
}

/**
* Whether [stepOut] should queue a random step after clearing, or let normal recalculation handle repositioning.
*/
protected open fun shouldQueueStepOut(): Boolean = true

override fun tick() {
val character = character
if (character is Player && character.viewport?.loaded == false) {
Expand All @@ -61,7 +86,9 @@ open class Movement(
if (hasDelay() && !canMove() && !character.steps.destination.noCollision) {
return
}
calculate()
if (!stepOut()) {
calculate()
}
if (step(runStep = false) && character.running) {
if (character.steps.isNotEmpty()) {
step(runStep = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ class AccountManagerTest : KoinMock() {

@Test
fun `Create a new player`() {
val start = System.currentTimeMillis()
val player = manager.create("name", "hash")
assertTrue(player["creation", 0L] >= start)
assertTrue(player["new_player", false])
assertEquals(Tile(1234, 5432), player.tile)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class TzhaarFightCave(
return@npcDespawn
}
val wave = killer.wave
if (wave == -1) {
return@npcDespawn
}
if (wave == 63 && id == "tztok_jad") {
killer.leave(wave, true)
} else if (wave < 63) {
Expand Down
Loading