Skip to content

fix(gameplay): Restore upkeep cube visuals on game load#6

Merged
cloudwu merged 10 commits intocloudwu:masterfrom
xhacker5000:fix/upkeep-visual-bug
Sep 6, 2025
Merged

fix(gameplay): Restore upkeep cube visuals on game load#6
cloudwu merged 10 commits intocloudwu:masterfrom
xhacker5000:fix/upkeep-visual-bug

Conversation

@xhacker5000
Copy link
Copy Markdown
Contributor

@xhacker5000 xhacker5000 commented Sep 5, 2025

更新内容

1. 维护方块视觉显示修复

  • 修复关于维护方块未加载的bug issue
  • 在card.load()函数中添加维护方块视觉恢复逻辑

2. 实现完整的胜利检查逻辑(轨道/领土/人口胜利)

Image

3.其他BUG修复:

  • 修复科技牌出现后save/load导致崩溃
  • 修复殖民卡adv在SL之后丢失BUG
  • 胜利画面增加 【创造文明奇观】按钮
  • 全量中文1.6规则整理

🎯 文件变更
gameplay/victory.lua - 新增胜利检查逻辑
gameplay/win.lua - 胜利画面和流程控制
gameplay/card.lua - 维护方块恢复修复
localization/schinese.dl - 中文本地化更新
rules/Deep_Future_Rules_1_6_CN.md - 完整中文规则

📚 文档更新
完整中文规则 - 整理Deep Future 1.6版本完整中文规则文档
本地化改进 - 添加胜利相关的中文文本

测试状态: ✅ 已测试胜利条件检查和画面显示
向后兼容: ✅ 完全兼容现有存档
文档完整性: ✅ 包含完整的中文规则文档

Upkeep cubes were not being visually rendered after loading a saved
game, although their data was correctly restored in the `GAME.upkeep`
table. This could cause player confusion as the cubes were functionally
present but invisible.

This commit adds logic to the `card.load()` function to iterate through
the restored `GAME.upkeep` data. For each card with upkeep, it sets the
`c._upkeep` visual property, ensuring the cube display is consistent
with the game state upon loading. This mirrors the existing logic in
`card.upkeep_change()`.

fix(gameplay): Restore upkeep cube visuals on game load

Upkeep cubes were not being visually rendered after loading a saved
game, although their data was correctly restored in the `GAME.upkeep`
table. This could cause player confusion as the cubes were functionally
present but invisible.

This commit adds logic to the `card.load()` function to iterate through
the restored `GAME.upkeep` data. For each card with upkeep, it sets the
`c._upkeep` visual property, ensuring the cube display is consistent
with the game state upon loading. This mirrors the existing logic in
`card.upkeep_change()`.
@cloudwu
Copy link
Copy Markdown
Owner

cloudwu commented Sep 6, 2025

有几个小问题,我来改,先合并。

@cloudwu cloudwu merged commit 9fc186a into cloudwu:master Sep 6, 2025
Comment thread gameplay/victory.lua
local VICTORY_REQUIREMENTS = {
TERRITORY_SECTORS = 12, -- 领土胜利需要控制的星区数
POPULATION_CUBES = 25, -- 人口胜利需要的方块数
REQUIRED_TECHS = 3, -- 需要的完整技术数量
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个常量应转移到 https://github.com/cloudwu/deepfuture/blob/master/asset/gameplay/phase.dl 或新起一个配置文件。代码里减少游戏规则相关的常量。

另外,胜利规则还需要判定殖民地数量和 wonder 数量。当然现在 wonder 还没做。做了以后再加。

Comment thread gameplay/sync.lua
for i = 1, card.count "colony" do
local c = card.card("colony", i)
map.settle(c.sector)
-- 只对世界卡片调用 map.settle,技术卡没有 sector 字段
Copy link
Copy Markdown
Owner

@cloudwu cloudwu Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

colony 区应该没有 tech 卡,如果发现了应该 assert ?

@xhacker5000 xhacker5000 deleted the fix/upkeep-visual-bug branch September 6, 2025 14:58
@cloudwu
Copy link
Copy Markdown
Owner

cloudwu commented Sep 9, 2025

我今天打算开始做胜利部分,发现这里的胜利条件判断是错的:判断母星区的科技卡不对。母星也没有判断发展完全。

6014467

我现在重构了相关模块。胜利图暂时去掉了,但图我挺喜欢,待我重新设计版面后再加回来。

运行时加命令行参数 test=win 可以测试所有胜利条件。

另外,胜利结算需要统计所有胜利情况,这样才能正确创建文明卡。这部分已经重构。

cloudwu added a commit that referenced this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants