SkillsTab Modifications (Bugs 9,11,12,13)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m12s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m12s
This commit is contained in:
@@ -211,8 +211,19 @@ export function SkillsTab({ store }: SkillsTabProps) {
|
||||
const baseCost = def.base * (level + 1) * currentTier;
|
||||
const cost = Math.floor(baseCost * costMult);
|
||||
|
||||
// Additional cost (element mana)
|
||||
const additionalCost = def.cost;
|
||||
|
||||
// Can start studying?
|
||||
const canStudy = !maxed && prereqMet && store.rawMana >= cost && !isStudying;
|
||||
let canStudy = !maxed && prereqMet && store.rawMana >= cost && !isStudying;
|
||||
|
||||
// Check additional cost (element mana)
|
||||
if (def.cost && def.cost.type === 'element') {
|
||||
const element = store.elements[def.cost.element];
|
||||
if (!element || element.current < def.cost.amount) {
|
||||
canStudy = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for milestone upgrades
|
||||
const milestoneInfo = hasMilestoneUpgrade(tieredSkillId, level, store.skillTiers || {}, store.skillUpgrades);
|
||||
@@ -266,6 +277,11 @@ export function SkillsTab({ store }: SkillsTabProps) {
|
||||
{' • '}
|
||||
<span className={costMult < 1 ? 'text-green-400' : ''}>
|
||||
Cost: {fmt(cost)} mana{costMult < 1 && <span className="text-xs ml-1">({Math.round(costMult * 100)}% cost)</span>}
|
||||
{additionalCost && additionalCost.type === 'element' && (
|
||||
<span className="ml-2" style={{ color: ELEMENTS[additionalCost.element]?.color }}>
|
||||
+ {additionalCost.amount} {ELEMENTS[additionalCost.element]?.sym} {additionalCost.element}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -325,7 +341,7 @@ export function SkillsTab({ store }: SkillsTabProps) {
|
||||
className={canStudy ? 'bg-purple-600 hover:bg-purple-700' : 'opacity-50'}
|
||||
onClick={() => store.startStudyingSkill(tieredSkillId)}
|
||||
>
|
||||
Study ({fmt(cost)})
|
||||
Study ({fmt(cost)}{additionalCost && additionalCost.type === 'element' && ` + ${additionalCost.amount} ${ELEMENTS[additionalCost.element]?.sym}`}
|
||||
</Button>
|
||||
{/* Parallel Study button */}
|
||||
{hasSpecial(upgradeEffects, SPECIAL_EFFECTS.PARALLEL_STUDY) &&
|
||||
|
||||
Reference in New Issue
Block a user