Class RandomRewards
java.lang.Object
server.RandomRewards
各類寶箱、事件、垂釣與掉落的隨機獎勵道具池,於類別載入時一次性預編譯。
靜態初始化區塊讀取 GameConstants 中定義的原始獎勵陣列
(金箱、銀箱、垂釣、聖誕、驚喜、事件三階、花生、普通/稀有/超稀掉落等),
依機率權重展開並隨機洗牌後存入對應的 compiled* 清單。
各 get*Reward() 方法呼叫 Randomizer 從對應清單中隨機抽取一個道具 ID 回傳;
事件與掉落類方法另外套用機率分層(普通 66%、非普通 20%、稀有 10%、超稀 4% 等)。
本類別為純靜態工具類,不持有任何玩家狀態;
由 Start 啟動序列呼叫 load() 觸發類別初始化,
之後在遊戲內容處理器與腳本中透過靜態方法取用。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic int
-
Constructor Details
-
RandomRewards
public RandomRewards()
-
-
Method Details
-
getGoldBoxReward
public static int getGoldBoxReward() -
getSilverBoxReward
public static int getSilverBoxReward() -
getFishingReward
public static int getFishingReward() -
getXmasReward
public static int getXmasReward() -
getSurpriseStyleBoxReward
public static int getSurpriseStyleBoxReward() -
getPeanutReward
public static int getPeanutReward() -
getEventReward
public static int getEventReward() -
getDropReward
public static int getDropReward() -
getTenPercent
-