Upgrade waves - choose item slot for each item
Feature request
Short description We can already replace armour in upgrade waves, how about we can replace anything?
Implementation details Each inventory slot has a assaign number 0-1-2-3 etc, i'm not too sure what is what. But it should be easy to figure out. Lets pretend 0 is the first slot to the left. Config example:
upgrade1:
type: upgrade
wave: 5
upgrades:
Gladiator:
item: iron_sword:1
slot: 0
armor: diamond_chestplate, diamond_boots
This would make it replace whatever the player has in slot 1.
Hopefully this makes it in a future update! :)
What happens when someone moves the item that's meant to be upgraded out of the slot we expect it to be in?
Maybe we should make items un-movable? Config option perhaps?
We replace whatever is in that slot, no matter what. You put your helmet there? too bad it's a sword now
I'm very strongly against punishing players for stumbling into little quirks in the plugin behavior. It breeds uncertainty and distrust in the plugin and the server owners, because players will (to them) be punished for doing random things that they didn't have any means of knowing they shouldn't do. Shifting inventory around is a pretty normal thing to do, and it can be super annoying having to adapt your play style "just because" (to them).
There may be a way to give items "identities" by using display names and lore (no, we can't use NBTs). If we take a step back and consider a rework of the item syntax where you could potentially give all sorts of attributes to the items, this sort of setup could be viable:
items:
- display-name: Axel the Axe
lore:
- He is an axe, wow good
material: wooden_axe
amount: 1
- display-name: Thunder Axe
lore:
- It is big and very ouch
material: diamond_axe
amount: 1
...
upgrades:
Knight:
- type: add
item: dirt
- type: replace
old-item: Axel the Axe
new-item: Thunder Axe
Then when MobArena encounters an upgrade of type replace, it will look for an item whose name matches the value in old-item and replace that with the item denoted by new-item.
This isn't necessarily "the way" or at all feasible to implement (the Things API will probably need a bit of an overhaul to support this), but it's at least a lot more robust and doesn't punish anyone. Of course, what happens then when we want to "replace all arrows with exactly 10 ice tipped arrows" or something like that?
Perhaps a different approach would be to make multiple "levels" for each class and then "activate" them by wiping the current inventory and granting the items from the next level.
I was just sitting here thinking about the wiping of inventory to apply a new class! Great minds think alike hey!
I do like both of your suggestions tho, different server owners might like one over the other. So why not have both be available?