Added wager option to normal and pvp races #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the ability to put wager on races:
/race option wager [minimum]
/race wager increase [amount]
), and decrease the additional wager they put in the race (/race wager decrease [amount]
)Changes should be fairly self explanatory, added some comments here and there for more clarity if needed. Most notable changes:
/race join [player]
command. It will now check if the race has a minimum entry wager and if it has, it will show a message to the player to confirm whether they want to join the race or not.If they confirm to join the race, the same command is runned with an extra, new parameter:
/race join [player] true
.In both cases, checks are made to see whether the player actually has enough parcoins to pay the entry wager.
wager
andadditionalWager
inRacePlayer
, along with getters and setterstotalPrizePool
toRace
. This is used to show the prize pool of the race. When the race starts, it re-calculates it just to be sure, and adds the prizes from the prize pool to the existing prizes. This means that players can increase the prizepool of an event without overriding the event prizesgetPlayerPoints
andtakePlayerPoints
toPlayerWrapper