Class AdventureBossHelper
public static class AdventureBossHelper
- Inheritance
-
AdventureBossHelper
- Inherited Members
Fields
FixedRewardRatio
public const decimal FixedRewardRatio = 0.7
Field Value
RaffleRewardPercent
public const int RaffleRewardPercent = 5
Field Value
RandomRewardRatio
public const decimal RandomRewardRatio = 0.3
Field Value
TotalRewardMultiplier
public const decimal TotalRewardMultiplier = 1.2
Field Value
Methods
AddExploreRewards(IActionContext, IWorld, Address, Inventory, IEnumerable<RewardAmountData>)
public static IWorld AddExploreRewards(IActionContext context, IWorld states, Address avatarAddress, Inventory inventory, IEnumerable<AdventureBossSheet.RewardAmountData> rewardList)
Parameters
context
IActionContextstates
IWorldavatarAddress
Addressinventory
InventoryrewardList
IEnumerable<AdventureBossSheet.RewardAmountData>
Returns
- IWorld
CalculateExploreReward(ClaimableReward, BountyBoard, ExploreBoard, Explorer, Address, AdventureBossNcgRewardRatioSheet, decimal, decimal, bool, out FungibleAssetValue)
Calculate reward for adventure boss explorers. This method only calculates reward for given avatar, not actually give rewards.
public static AdventureBossGameData.ClaimableReward CalculateExploreReward(AdventureBossGameData.ClaimableReward reward, BountyBoard bountyBoard, ExploreBoard exploreBoard, Explorer explorer, Address avatarAddress, AdventureBossNcgRewardRatioSheet sheet, decimal ncgApRatio, decimal ncgRuneRatio, bool isReal, out FungibleAssetValue ncgReward)
Parameters
reward
AdventureBossGameData.ClaimableRewardClaimable reward for this avatar so far.
bountyBoard
BountyBoardBounty board for this season. NCG reward is based on totalBounty on this board.
exploreBoard
ExploreBoardExplore board for this season. Total reward amount is base on usedApPotion on this board.
explorer
ExplorerTarget explorer to calculate reward
avatarAddress
AddressTarget avatar address to calculate reward.
sheet
AdventureBossNcgRewardRatioSheetNCG to reward exchange ratio sheet. Calculate total reward amount based on this sheet.
ncgApRatio
decimalExchange ratio between used AP potion to NCG. Used to set total reward amount.
ncgRuneRatio
decimalIf a reward is rune, use this fixed ratio, not in sheet.
isReal
boolncgReward
FungibleAssetValueout value: calculated NCG reward in this function. We must handle NCG reward separately because NCG reward must be transferred from each season's bounty address.
Returns
- AdventureBossGameData.ClaimableReward
Updated Claimable reward after calculation.
CalculateRaffleReward(BountyBoard)
public static FungibleAssetValue CalculateRaffleReward(BountyBoard bountyBoard)
Parameters
bountyBoard
BountyBoard
Returns
- FungibleAssetValue
CalculateWantedReward(ClaimableReward, BountyBoard, Address, AdventureBossNcgRewardRatioSheet, decimal, out FungibleAssetValue)
Calculate reward for adventure boss operators. This method only calculates reward for given avatar, not actually give rewards.
public static AdventureBossGameData.ClaimableReward CalculateWantedReward(AdventureBossGameData.ClaimableReward reward, BountyBoard bountyBoard, Address avatarAddress, AdventureBossNcgRewardRatioSheet sheet, decimal ncgRuneRatio, out FungibleAssetValue ncgReward)
Parameters
reward
AdventureBossGameData.ClaimableRewardClaimable reward for this avatar so far.
bountyBoard
BountyBoardBounty board for this season. All the reward amount is based on totalBounty on this board.
avatarAddress
AddressTarget avatar address to calculate reward.
sheet
AdventureBossNcgRewardRatioSheetNCG to reward exchange ratio sheet. Calculate total reward amount based on this sheet.
ncgRuneRatio
decimalIf a reward is rune, use this fixed ratio, not in sheet.
ncgReward
FungibleAssetValueout value: calculated NCG reward in this function. We must handle NCG reward separately because NCG reward must be transferred from each season's bounty address.
Returns
- AdventureBossGameData.ClaimableReward
Updated Claimable reward after calculation.
CollectExploreReward(ClaimableReward, GameConfigState, AdventureBossNcgRewardRatioSheet, SeasonInfo, BountyBoard, ExploreBoard, Explorer, long, Address, ref ClaimableReward, out FungibleAssetValue)
public static bool CollectExploreReward(AdventureBossGameData.ClaimableReward reward, GameConfigState gameConfig, AdventureBossNcgRewardRatioSheet ncgRewardRatioSheet, SeasonInfo seasonInfo, BountyBoard bountyBoard, ExploreBoard exploreBoard, Explorer explorer, long currentBlockIndex, Address avatarAddress, ref AdventureBossGameData.ClaimableReward updatedReward, out FungibleAssetValue ncgReward)
Parameters
reward
AdventureBossGameData.ClaimableRewardgameConfig
GameConfigStatencgRewardRatioSheet
AdventureBossNcgRewardRatioSheetseasonInfo
SeasonInfobountyBoard
BountyBoardexploreBoard
ExploreBoardexplorer
ExplorercurrentBlockIndex
longavatarAddress
AddressupdatedReward
AdventureBossGameData.ClaimableRewardncgReward
FungibleAssetValue
Returns
CollectWantedReward(ClaimableReward, GameConfigState, AdventureBossNcgRewardRatioSheet, SeasonInfo, BountyBoard, Investor, long, Address, ref ClaimableReward)
public static bool CollectWantedReward(AdventureBossGameData.ClaimableReward reward, GameConfigState gameConfig, AdventureBossNcgRewardRatioSheet ncgRewardRatioSheet, SeasonInfo seasonInfo, BountyBoard bountyBoard, Investor investor, long currentBlockIndex, Address avatarAddress, ref AdventureBossGameData.ClaimableReward updatedReward)
Parameters
reward
AdventureBossGameData.ClaimableRewardgameConfig
GameConfigStatencgRewardRatioSheet
AdventureBossNcgRewardRatioSheetseasonInfo
SeasonInfobountyBoard
BountyBoardinvestor
InvestorcurrentBlockIndex
longavatarAddress
AddressupdatedReward
AdventureBossGameData.ClaimableReward
Returns
GetSeasonAsAddressForm(long)
public static string GetSeasonAsAddressForm(long season)
Parameters
season
long
Returns
PickExploreRaffle(BountyBoard, ExploreBoard, ExplorerList, IRandom)
public static ExploreBoard PickExploreRaffle(BountyBoard bountyBoard, ExploreBoard exploreBoard, ExplorerList explorerList, IRandom random)
Parameters
bountyBoard
BountyBoardexploreBoard
ExploreBoardexplorerList
ExplorerListrandom
IRandom
Returns
PickReward(IRandom, IEnumerable<RewardRatioData>)
public static (int?, int?) PickReward(IRandom random, IEnumerable<AdventureBossSheet.RewardRatioData> rewardData)
Parameters
random
IRandomrewardData
IEnumerable<AdventureBossSheet.RewardRatioData>