Table of Contents

Class AdventureBossHelper

Namespace
Nekoyume.Helper
Assembly
Lib9c.dll
public static class AdventureBossHelper
Inheritance
AdventureBossHelper
Inherited Members

Fields

FixedRewardRatio

public const decimal FixedRewardRatio = 0.7

Field Value

decimal

RaffleRewardPercent

public const int RaffleRewardPercent = 5

Field Value

int

RandomRewardRatio

public const decimal RandomRewardRatio = 0.3

Field Value

decimal

TotalRewardMultiplier

public const decimal TotalRewardMultiplier = 1.2

Field Value

decimal

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 IActionContext
states IWorld
avatarAddress Address
inventory Inventory
rewardList 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.ClaimableReward

Claimable reward for this avatar so far.

bountyBoard BountyBoard

Bounty board for this season. NCG reward is based on totalBounty on this board.

exploreBoard ExploreBoard

Explore board for this season. Total reward amount is base on usedApPotion on this board.

explorer Explorer

Target explorer to calculate reward

avatarAddress Address

Target avatar address to calculate reward.

sheet AdventureBossNcgRewardRatioSheet

NCG to reward exchange ratio sheet. Calculate total reward amount based on this sheet.

ncgApRatio decimal

Exchange ratio between used AP potion to NCG. Used to set total reward amount.

ncgRuneRatio decimal

If a reward is rune, use this fixed ratio, not in sheet.

isReal bool
ncgReward FungibleAssetValue

out 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.ClaimableReward

Claimable reward for this avatar so far.

bountyBoard BountyBoard

Bounty board for this season. All the reward amount is based on totalBounty on this board.

avatarAddress Address

Target avatar address to calculate reward.

sheet AdventureBossNcgRewardRatioSheet

NCG to reward exchange ratio sheet. Calculate total reward amount based on this sheet.

ncgRuneRatio decimal

If a reward is rune, use this fixed ratio, not in sheet.

ncgReward FungibleAssetValue

out 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.ClaimableReward
gameConfig GameConfigState
ncgRewardRatioSheet AdventureBossNcgRewardRatioSheet
seasonInfo SeasonInfo
bountyBoard BountyBoard
exploreBoard ExploreBoard
explorer Explorer
currentBlockIndex long
avatarAddress Address
updatedReward AdventureBossGameData.ClaimableReward
ncgReward FungibleAssetValue

Returns

bool

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.ClaimableReward
gameConfig GameConfigState
ncgRewardRatioSheet AdventureBossNcgRewardRatioSheet
seasonInfo SeasonInfo
bountyBoard BountyBoard
investor Investor
currentBlockIndex long
avatarAddress Address
updatedReward AdventureBossGameData.ClaimableReward

Returns

bool

GetSeasonAsAddressForm(long)

public static string GetSeasonAsAddressForm(long season)

Parameters

season long

Returns

string

PickExploreRaffle(BountyBoard, ExploreBoard, ExplorerList, IRandom)

public static ExploreBoard PickExploreRaffle(BountyBoard bountyBoard, ExploreBoard exploreBoard, ExplorerList explorerList, IRandom random)

Parameters

bountyBoard BountyBoard
exploreBoard ExploreBoard
explorerList ExplorerList
random IRandom

Returns

ExploreBoard

PickReward(IRandom, IEnumerable<RewardRatioData>)

public static (int?, int?) PickReward(IRandom random, IEnumerable<AdventureBossSheet.RewardRatioData> rewardData)

Parameters

random IRandom
rewardData IEnumerable<AdventureBossSheet.RewardRatioData>

Returns

(int?, int?)