[Feature Request] Class-Specific Rewards

Short Description:
Rather simply put, I think it should be possible for rewards to be handed out to players based on their class choice.
Implementation Details:
I'm not very experienced in Java and how parameters work, but perhaps this isn't a too difficult modification since there's a system that already gives people class-specific items during Upgrade waves. Perhaps that code could be repurposed for or slightly modified to work with rewards items as well?
Thanks for the feature request!
This isn't a bad idea at all. By "implementation details", I'm mostly interested in how the config-file would look/work with a change like this, not so much the Java code (we'll leave that up to whoever tackles the issue).
How would you like to denote the per-class rewards in the config-file to set this up? Can we come up with a format that allows us to keep the current format valid for backwards compatibility so we don't break anything? A couple of examples that show "normal" setup and "per-class" setup and how they differ and how we can expect MobArena to tell the difference. What is the expected structure?
Hm. I have even less experience with how the legacy versions of MobArena were formatted, but I can try my best to come up with a few config file examples.
The structure I had in mind was similar to the way Upgrade Waves are set up. By that I mean 'Wave#': followed by "Class":<reward>. If you want to have classless rewards, just don't put any tag in front of the reward. In the case of both class specific and classless rewards being found in the same wave, all valid rewards are given to the player at an equal chance, regardless of exclusivity.
If no classes are specified in the rewards, then the all category is just blanket-added for every class. If this is what you mean by backwards compatibility, then the current rewards structure for config files should still work fine. All rewards will be given to everyone regardless of class still.
Example 1: Class-specific rewards for waves 5 and 10 mixed with normal rewards. Wave 5 gives Archers a (25%) chance of getting 16 arrows for their reward, while Wave 10 gives Archers a (25%) chance to get 32 arrows.
If a player is an Archer, they have a 25% chance of getting iron, gold, or money at a chance of 25% each.
If a player isn't an Archer, they have a chance of getting iron, gold, or money at a chance of 33% each.
rewards:
waves:
after:
'5': "Archer":arrow:16, iron_ingot:3, gold_ingot:2, money:50
'10': "Archer":arrow:32, iron_ingot:6, gold_ingot:4, money:100
Example 2: Class-specific rewards for waves 5 and 10 without normal rewards. Wave 5 gives a single item to each corresponding class, while wave 10 gives either a multitude of items or a random item/command/etc. to one of four classes.
rewards:
waves:
after:
'5': "Archer":arrow:16, "Knight":Chainmail_Chestplate, "Alchemist":potion:long_speed:1, "Tank":shield
'10': "Archer":all(bow, arrow:16), "Knight":random(diamond_sword, chainmail_helmet), "Alchemist":cmd:/say <player>, potspam isn't cool. Minus 10 reddit karma LUL, "Tank":random(all(iron_helmet, iron_chestplate), all(dirt, cobblestone))
Example 3: Class-specific rewards for only wave 5.
rewards:
waves:
after:
'5': "Archer":arrow:16, iron_ingot:3, gold_ingot:2, money:50
'10': iron_ingot:6, gold_ingot:4, money:100
Example 4: No class-specific rewards for wave 5 and 10. (The "control group")
rewards:
waves:
after:
'5': iron_ingot:3, gold_ingot:2, money:50
'10': iron_ingot:6, gold_ingot:4, money:100
Hopefully this doesn't cause any conflicts!
I would think defining it like we do upgrade-waves would make sense.
single:
upgrade1:
type: upgrade
wave: 1
upgrades:
skytter: potion:strong_instant_heal:3
skytter+: potion:strong_instant_heal:5
all: potion:strong_instant_heal:3
So:
rewards:
waves:
after:
'1':
all: stone:1, iron_ingot:2, nothing
knight: nothing, gold_ingot:1
That also works! I was thinking about something like that at first, but I changed the formatting because I thought it might conflict with legacy versions of MobArena.
If that config style works, by all means, do it that way, though. It's much easier to read than the way I suggested.