0.1.40: 天命系统 + NPC演化增强 + 建筑专精 (P0-1~P1-1)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { BUILDINGS, buildingById, listBuildingDefs } from '../../game/data/buildings'
|
||||
import { BUILDINGS, buildingById, listBuildingDefs, SPECIALTY_MULT } from '../../game/data/buildings'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
export default function TerritoryPanel() {
|
||||
@@ -32,12 +32,13 @@ export default function TerritoryPanel() {
|
||||
!!cost &&
|
||||
fam.stones >= cost.stones &&
|
||||
fam.inventory['lingkuang'] >= cost.lingkuang
|
||||
const isSpecialtyBuilding = fam.flag['buildingSpecialty'] === id
|
||||
return (
|
||||
<div key={id} className={`bld-card ${built ? '' : 'uc'}`}>
|
||||
<div key={id} className={`bld-card ${built ? '' : 'uc'} ${isSpecialtyBuilding ? 'bld-specialty' : ''}`}>
|
||||
<div className="bld-head">
|
||||
<span className="bld-icon">{def.icon}</span>
|
||||
<div>
|
||||
<div>{def.name}</div>
|
||||
<div>{def.name}{isSpecialtyBuilding && <span className="gold" style={{ marginLeft: 4, fontSize: '0.75rem' }}>【专精】</span>}</div>
|
||||
<div className="dim2" style={{ fontSize: '0.75rem' }}>{def.kind === 'produce' ? '产出' : '功效'}</div>
|
||||
</div>
|
||||
<span className="bld-lv">{built ? `${level}级` : ''}</span>
|
||||
@@ -95,6 +96,26 @@ export default function TerritoryPanel() {
|
||||
祭祖{world.state.year - ((fam.flag['lastRiteYear'] as number) ?? -9) < 2 ? '(冷却)' : '150灵石'}
|
||||
</button>
|
||||
)}
|
||||
{built && def.extra && Object.keys(def.extra).length > 0 && (
|
||||
<button
|
||||
className="btn btn-sm"
|
||||
style={{ marginLeft: 4, fontSize: '0.7rem' }}
|
||||
disabled={isSpecialtyBuilding ? false : fam.stones < 200}
|
||||
title={isSpecialtyBuilding ? '取消专精(免费)' : `设为专精(耗200灵石)· extra 加成 ×${SPECIALTY_MULT}`}
|
||||
onClick={() => {
|
||||
if (isSpecialtyBuilding) {
|
||||
delete fam.flag['buildingSpecialty']
|
||||
} else {
|
||||
if (fam.stones < 200) return
|
||||
fam.stones -= 200
|
||||
fam.flag['buildingSpecialty'] = id
|
||||
}
|
||||
bump()
|
||||
}}
|
||||
>
|
||||
{isSpecialtyBuilding ? '取消专精' : '设为专精'}
|
||||
</button>
|
||||
)}
|
||||
<span className="dim2" style={{ marginLeft: 'auto' }}>{levelLabel(level)}</span>
|
||||
</>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user