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
contextIActionContextstatesIWorldavatarAddressAddressinventoryInventoryrewardListIEnumerable<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
rewardAdventureBossGameData.ClaimableRewardClaimable reward for this avatar so far.
bountyBoardBountyBoardBounty board for this season. NCG reward is based on totalBounty on this board.
exploreBoardExploreBoardExplore board for this season. Total reward amount is base on usedApPotion on this board.
explorerExplorerTarget explorer to calculate reward
avatarAddressAddressTarget avatar address to calculate reward.
sheetAdventureBossNcgRewardRatioSheetNCG to reward exchange ratio sheet. Calculate total reward amount based on this sheet.
ncgApRatiodecimalExchange ratio between used AP potion to NCG. Used to set total reward amount.
ncgRuneRatiodecimalIf a reward is rune, use this fixed ratio, not in sheet.
isRealboolncgRewardFungibleAssetValueout 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
bountyBoardBountyBoard
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
rewardAdventureBossGameData.ClaimableRewardClaimable reward for this avatar so far.
bountyBoardBountyBoardBounty board for this season. All the reward amount is based on totalBounty on this board.
avatarAddressAddressTarget avatar address to calculate reward.
sheetAdventureBossNcgRewardRatioSheetNCG to reward exchange ratio sheet. Calculate total reward amount based on this sheet.
ncgRuneRatiodecimalIf a reward is rune, use this fixed ratio, not in sheet.
ncgRewardFungibleAssetValueout 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
rewardAdventureBossGameData.ClaimableRewardgameConfigGameConfigStatencgRewardRatioSheetAdventureBossNcgRewardRatioSheetseasonInfoSeasonInfobountyBoardBountyBoardexploreBoardExploreBoardexplorerExplorercurrentBlockIndexlongavatarAddressAddressupdatedRewardAdventureBossGameData.ClaimableRewardncgRewardFungibleAssetValue
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
rewardAdventureBossGameData.ClaimableRewardgameConfigGameConfigStatencgRewardRatioSheetAdventureBossNcgRewardRatioSheetseasonInfoSeasonInfobountyBoardBountyBoardinvestorInvestorcurrentBlockIndexlongavatarAddressAddressupdatedRewardAdventureBossGameData.ClaimableReward
Returns
GetSeasonAsAddressForm(long)
public static string GetSeasonAsAddressForm(long season)
Parameters
seasonlong
Returns
PickExploreRaffle(BountyBoard, ExploreBoard, ExplorerList, IRandom)
public static ExploreBoard PickExploreRaffle(BountyBoard bountyBoard, ExploreBoard exploreBoard, ExplorerList explorerList, IRandom random)
Parameters
bountyBoardBountyBoardexploreBoardExploreBoardexplorerListExplorerListrandomIRandom
Returns
PickReward(IRandom, IEnumerable<RewardRatioData>)
public static (int?, int?) PickReward(IRandom random, IEnumerable<AdventureBossSheet.RewardRatioData> rewardData)
Parameters
randomIRandomrewardDataIEnumerable<AdventureBossSheet.RewardRatioData>