fix(gameplay): Restore upkeep cube visuals on game load#6
Merged
cloudwu merged 10 commits intocloudwu:masterfrom Sep 6, 2025
Merged
fix(gameplay): Restore upkeep cube visuals on game load#6cloudwu merged 10 commits intocloudwu:masterfrom
cloudwu merged 10 commits intocloudwu:masterfrom
Conversation
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()`.
Owner
|
有几个小问题,我来改,先合并。 |
cloudwu
reviewed
Sep 6, 2025
| local VICTORY_REQUIREMENTS = { | ||
| TERRITORY_SECTORS = 12, -- 领土胜利需要控制的星区数 | ||
| POPULATION_CUBES = 25, -- 人口胜利需要的方块数 | ||
| REQUIRED_TECHS = 3, -- 需要的完整技术数量 |
Owner
There was a problem hiding this comment.
这几个常量应转移到 https://github.com/cloudwu/deepfuture/blob/master/asset/gameplay/phase.dl 或新起一个配置文件。代码里减少游戏规则相关的常量。
另外,胜利规则还需要判定殖民地数量和 wonder 数量。当然现在 wonder 还没做。做了以后再加。
cloudwu
reviewed
Sep 6, 2025
| for i = 1, card.count "colony" do | ||
| local c = card.card("colony", i) | ||
| map.settle(c.sector) | ||
| -- 只对世界卡片调用 map.settle,技术卡没有 sector 字段 |
Owner
There was a problem hiding this comment.
colony 区应该没有 tech 卡,如果发现了应该 assert ?
Owner
|
我今天打算开始做胜利部分,发现这里的胜利条件判断是错的:判断母星区的科技卡不对。母星也没有判断发展完全。 我现在重构了相关模块。胜利图暂时去掉了,但图我挺喜欢,待我重新设计版面后再加回来。 运行时加命令行参数 另外,胜利结算需要统计所有胜利情况,这样才能正确创建文明卡。这部分已经重构。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
更新内容
1. 维护方块视觉显示修复
2. 实现完整的胜利检查逻辑(轨道/领土/人口胜利)
3.其他BUG修复:
🎯 文件变更
gameplay/victory.lua - 新增胜利检查逻辑
gameplay/win.lua - 胜利画面和流程控制
gameplay/card.lua - 维护方块恢复修复
localization/schinese.dl - 中文本地化更新
rules/Deep_Future_Rules_1_6_CN.md - 完整中文规则
📚 文档更新
完整中文规则 - 整理Deep Future 1.6版本完整中文规则文档
本地化改进 - 添加胜利相关的中文文本
测试状态: ✅ 已测试胜利条件检查和画面显示
向后兼容: ✅ 完全兼容现有存档
文档完整性: ✅ 包含完整的中文规则文档