mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
N6/C3 review cleanup: retire the combined-level reducer duplication
The W1 extraction added combinedAdvLevel but left twinBeeMaxTier and distributeTwinBeeRewards inlining the identical dndLevel+3-skills expression, so the reducer lived in three places. Rewire both twinbee sites to combinedAdvLevel — pure refactor, byte-identical arithmetic. Deliberately did NOT share tierForCombinedLevel's switch into twinbee: its default arm is worldBossMinTier, a world-boss knob, and coupling twinbee's tier floor to it would let a world-boss retune silently leak into TwinBee's activity selection. The reducer is the safe shared piece; the tier thresholds stay independent. Suite green, combat golden byte-identical. Claude-Session: https://claude.ai/code/session_017mEwUmmS7aQTP2NQXj6rUa
This commit is contained in:
@@ -40,7 +40,7 @@ func twinBeeMaxTier() int {
|
||||
if !c.Alive {
|
||||
continue
|
||||
}
|
||||
combined := dndLevelForUser(c.UserID) + c.MiningSkill + c.ForagingSkill + c.FishingSkill
|
||||
combined := combinedAdvLevel(&c)
|
||||
if combined > bestLevel {
|
||||
bestLevel = combined
|
||||
}
|
||||
@@ -283,7 +283,7 @@ func (p *AdventurePlugin) distributeTwinBeeRewards(result *TwinBeeResult) TwinBe
|
||||
weight := 4 // minimum (level 1 in all 4 skills)
|
||||
for _, c := range chars {
|
||||
if c.UserID == uid {
|
||||
weight = dndLevelForUser(c.UserID) + c.MiningSkill + c.ForagingSkill + c.FishingSkill
|
||||
weight = combinedAdvLevel(&c)
|
||||
if weight < 4 {
|
||||
weight = 4
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user