Implemented save file versioning

Players who likely bought their crafting capes back when the hood was not obtainable will be given the complementary hood
Unlocked Surok's Theme for players who are eligible
Fixed some bugs relating to the handling of edge cases for random events
Fixed tutorial island quest completion
Made it possible to collapse interface stones in resizable HD
This commit is contained in:
Player Name
2024-05-31 11:32:48 +00:00
committed by Ryan
parent 2776270c7f
commit 49a10d192a
14 changed files with 132 additions and 28 deletions
+20
View File
@@ -378,6 +378,26 @@ fun addItemOrDrop(player: Player, id: Int, amount: Int = 1) {
}
}
/**
* Add an item with a variable quantity or bank it if a player does not have enough space, or drop it if that still doesn't work
* @param player the player whose inventory to add to
* @param id the ID of the item to add to the player's inventory
* @param amount the amount of the ID to add to the player's inventory, defaults to 1
*/
fun addItemOrBank(player: Player, id: Int, amount: Int = 1) {
val item = Item(id, amount)
if (!player.inventory.add(item)) {
if (player.bankPrimary.add(item)) {
sendMessage(player, colorize("%RThe ${item.name} has been sent to your bank."))
} else if (player.bankSecondary.add(item)) {
sendMessage(player, colorize("%RThe ${item.name} has been sent to your secondary bank."))
} else {
GroundItemManager.create(item, player)
sendMessage(player, colorize("%RAs your inventory and bank account(s) are all full, the ${item.name} has been placed on the ground under your feet. Don't forget to grab it. (Also consider cleaning out some stuff, maybe? I mean, Jesus!)"))
}
}
}
/**
* Clears an NPC with the "poof" smoke graphics commonly seen with random event NPCs.
* @param npc the NPC object to initialize