Skip to content

Commit

Permalink
Add temp fix for losing skull on death GregHib#563
Browse files Browse the repository at this point in the history
  • Loading branch information
GregHib committed Dec 9, 2024
1 parent c467e9f commit 6ba02d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,21 @@ fun dropItems(player: Player, killer: Character?, tile: Tile, inWilderness: Bool
val items = ItemsKeptOnDeath.getAllOrdered(player)
val kept = ItemsKeptOnDeath.kept(player, items, enums)

// Remove kept so they aren't dropped
for (item in kept) {
if (player.inventory.remove(item.id, item.amount) || player.equipment.remove(item.id, item.amount)) {
continue
}
}
// Drop everything
drop(player, Item("bones", 1), tile, inWilderness, killer)
drop(player, player.inventory, tile, inWilderness, killer)
drop(player, player.equipment, tile, inWilderness, killer)
// Clear everything
player.inventory.clear()
player.equipment.clear()

// Return kept items
for (item in kept) {
player.inventory.add(item.id, item.amount)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ objectOperate("Search", "rocks_no_skull_restless_ghost_quest") {
}
}

canDestroy("muddy_skull") { player ->
playerDeath { player ->
if (!player.ownsItem("muddy_skull")) {
player["rocks_restless_ghost"] = "skull"
}
}

destroyed("muddy_skull") { player ->
player["rocks_restless_ghost"] = "skull"
}

0 comments on commit 6ba02d5

Please sign in to comment.