From 8056579476577135d48bcd2ca66faf967633fc20 Mon Sep 17 00:00:00 2001 From: notify Date: Sun, 4 Jun 2023 20:00:35 +0800 Subject: [PATCH] Changelog: v0.2.1 --- CHANGELOG.md | 25 +++++++++++++++++++++++++ CMakeLists.txt | 2 +- Fk/Pages/Lobby.qml | 7 ++++--- Fk/Pages/Room.qml | 22 +++++++++++++++++++++- Fk/RoomElement/GameOverBox.qml | 1 + android/AndroidManifest.xml | 4 ++-- lua/client/client.lua | 13 ++++++++++++- lua/client/client_util.lua | 22 ++++++++++++++++++++++ lua/client/i18n/zh_CN.lua | 32 ++++++++++++++++++++++---------- packages/test/init.lua | 14 ++++++++++++-- 10 files changed, 122 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd9c59b3..fcc1dd12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ ___ +## v0.2.1 + +大引流之后的第一次更新。感觉很仓促。 + +1. 扣上限心碎 +2. 进服维护的各种跟后端稳定性有关的代码 +3. 断线重连/旁观时候计入技能次数 +4. ban人和banip,相应的也有解禁 +5. 开房设置现在可以滑动 +6. 完善网络错误报错 +7. 现在开始游戏之前需要等待和所有人准备 +8. 指示掉线之人和走小道之人 +9. 掉线和走小道的人不再被AI接管 +10. 延时锦囊牌素材从拓展包找 +11. 拓展包管理界面UI优化,下载失败的包可以在管理拓展包中删除 +12. 手牌上限显示:体力值为负数和手牌上限为无限时显示优化 +13. 观星新增提示,修复观星 +14. 手牌上限技中,增加不计入手牌上限技 +15. 修复变更武将 +16. 修复奸雄和救援 +17. 修复选角色的cancelble +18. 增强谋徐盛 + +___ + ## v0.2.0 修复了标准版吕布属性杀不触发无双、貂蝉决斗可被无懈。 diff --git a/CMakeLists.txt b/CMakeLists.txt index 48e82714..0e3f9cd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16) -project(FreeKill VERSION 0.2.0) +project(FreeKill VERSION 0.2.1) add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\") find_package(Qt6 REQUIRED COMPONENTS diff --git a/Fk/Pages/Lobby.qml b/Fk/Pages/Lobby.qml index 10ecebb0..3769753c 100644 --- a/Fk/Pages/Lobby.qml +++ b/Fk/Pages/Lobby.qml @@ -33,13 +33,14 @@ Item { flickableDirection: Flickable.VerticalFlick width: parent.width - 10 height: parent.height - 10 - contentWidth: flickableContainer.width - contentHeight: flickableContainer.height + contentHeight: bulletin_info.height clip: true Text { - anchors.fill: parent + id: bulletin_info + width: parent.width wrapMode: TextEdit.WrapAnywhere + textFormat: Text.MarkdownText text: Backend.translate('Bulletin Info') } } diff --git a/Fk/Pages/Room.qml b/Fk/Pages/Room.qml index 67892706..c4d55001 100644 --- a/Fk/Pages/Room.qml +++ b/Fk/Pages/Room.qml @@ -112,6 +112,25 @@ Item { ClientInstance.notifyServer("Ready", ""); } } + Rectangle { + x: parent.width / 2 + 80 + y: parent.height / 2 + color: "snow" + opacity: 0.8 + radius: 6 + height: childrenRect.height + 16 + width: childrenRect.width + 16 + visible: !isStarted + + Text { + x: 8; y: 8 + Component.onCompleted: { + let data = JSON.parse(Backend.callLuaFunction("GetRoomConfig", [])); + text = "手气卡次数:" + data.luckTime + "
出手时间:" + config.roomTimeout + + "
选将框数:" + data.generalNum + } + } + } states: [ State { name: "notactive" }, // Normal status @@ -873,6 +892,7 @@ Item { } } mainStack.pop(); + Backend.callLuaFunction("ResetClientLua", []); mainStack.push(room); mainStack.currentItem.loadPlayerData(datalist); } @@ -882,7 +902,7 @@ Item { if (d.id == Self.id) { roomScene.isOwner = d.isOwner; } else { - callbacks["AddPlayer"](JSON.stringify([d.id, d.name, d.avatar, d.ready])); + Backend.callLuaFunction("ResetAddPlayer", [JSON.stringify([d.id, d.name, d.avatar, d.ready])]); } Logic.getPhotoModel(d.id).isOwner = d.isOwner; }); diff --git a/Fk/RoomElement/GameOverBox.qml b/Fk/RoomElement/GameOverBox.qml index d7b74e34..8b659491 100644 --- a/Fk/RoomElement/GameOverBox.qml +++ b/Fk/RoomElement/GameOverBox.qml @@ -25,6 +25,7 @@ GraphicsBox { MetroButton { text: Backend.translate("Back To Room") anchors.horizontalCenter: parent.horizontalCenter + visible: !config.observing onClicked: { roomScene.resetToInit(); diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 6f28b41f..bdde2784 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -3,8 +3,8 @@ + android:versionCode="201" + android:versionName="0.2.1"> diff --git a/lua/client/client.lua b/lua/client/client.lua index bfd8fb6e..f6528847 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -212,6 +212,7 @@ fk.client_callback["EnterRoom"] = function(jsonData) ClientInstance.discard_pile = {} local data = json.decode(jsonData)[3] + ClientInstance.room_settings = data Fk.disabled_packs = data.disabledPack Fk.disabled_generals = data.disabledGenerals ClientInstance:notifyUI("EnterRoom", jsonData) @@ -296,7 +297,17 @@ fk.client_callback["PropertyUpdate"] = function(jsonData) -- jsonData: [ int id, string property_name, value ] local data = json.decode(jsonData) local id, name, value = data[1], data[2], data[3] - ClientInstance:getPlayerById(id)[name] = value + local p = ClientInstance:getPlayerById(id) + p[name] = value + + if name == "dead" then + if value == true then + table.removeOne(ClientInstance.alive_players, p) + else + table.insertIfNeed(ClientInstance.alive_players, p) + end + end + ClientInstance:notifyUI("PropertyUpdate", jsonData) ClientInstance:notifyUI("MaxCard", json.encode{ pcardMax = ClientInstance:getPlayerById(id):getMaxCards(), diff --git a/lua/client/client_util.lua b/lua/client/client_util.lua index e8112c13..40f306f9 100644 --- a/lua/client/client_util.lua +++ b/lua/client/client_util.lua @@ -494,4 +494,26 @@ function GetPlayerHandcards(pid) return json.encode(p.player_cards[Player.Hand]) end +function ResetClientLua() + local data = ClientInstance.room_settings + Self = ClientPlayer:new(fk.Self) + ClientInstance = Client:new() -- clear old client data + ClientInstance.players = {Self} + ClientInstance.alive_players = {Self} + ClientInstance.discard_pile = {} + ClientInstance.room_settings = data + + Fk.disabled_packs = data.disabledPack + Fk.disabled_generals = data.disabledGenerals + -- ClientInstance:notifyUI("EnterRoom", jsonData) +end + +function ResetAddPlayer(j) + fk.client_callback["AddPlayer"](j) +end + +function GetRoomConfig() + return json.encode(ClientInstance.room_settings) +end + dofile "lua/client/i18n/init.lua" diff --git a/lua/client/i18n/zh_CN.lua b/lua/client/i18n/zh_CN.lua index fa2c1064..64f586f4 100644 --- a/lua/client/i18n/zh_CN.lua +++ b/lua/client/i18n/zh_CN.lua @@ -214,18 +214,30 @@ FreeKill使用的是libgit2的C API,与此同时使用Git完成拓展包的下 ["Back To Room"] = "回到房间", ["Back To Lobby"] = "返回大厅", - ["Bulletin Info"] = [==[

v0.2.0 更新说明

- 修复了标准版吕布属性杀不触发无双、貂蝉决斗可被无懈。
+ ["Bulletin Info"] = [==[ + ## v0.2.1 - 由于标准包更加完善了,所以增加一位中版本号。
+ 大引流之后的第一次更新。感觉很仓促。 - 1. 获得了中文名“新月杀”
- 2. 房间可设置密码
- 3. 手牌上限不等于HP时会显示
- 4. 修禁用铁锁无法重铸
- 5. 修视为技按钮一直亮着
- 6. 使命技机制,完善游戏逻辑
- 7. 砸拖鞋
]==], + - 扣上限心碎 + - 进服维护的各种跟后端稳定性有关的代码 + - 断线重连/旁观时候计入技能次数 + - ban人和banip,相应的也有解禁 + - 开房设置现在可以滑动 + - 完善网络错误报错 + - 现在开始游戏之前需要等待和所有人准备 + - 指示掉线之人和走小道之人 + - 掉线和走小道的人不再被AI接管 + - 延时锦囊牌素材从拓展包找 + - 拓展包管理界面UI优化,下载失败的包可以在管理拓展包中删除 + - 手牌上限显示:体力值为负数和手牌上限为无限时显示优化 + - 观星新增提示,修复观星 + - 手牌上限技中,增加不计入手牌上限技 + - 修复变更武将 + - 修复奸雄和救援 + - 修复选角色的cancelble + - 增强谋徐盛 + ]==], } -- Game concepts diff --git a/packages/test/init.lua b/packages/test/init.lua index 454d2422..d717c193 100644 --- a/packages/test/init.lua +++ b/packages/test/init.lua @@ -58,6 +58,7 @@ local test_filter = fk.CreateFilterSkill{ } local control = fk.CreateActiveSkill{ name = "control", + anim_type = "control", can_use = function(self, player) return true end, @@ -168,6 +169,7 @@ local test_trig = fk.CreateTriggerSkill{ } local damage_maker = fk.CreateActiveSkill{ name = "damage_maker", + anim_type = "offensive", can_use = function(self, player) return true end, @@ -256,12 +258,20 @@ Fk:loadTranslationTable{ ["test_filter"] = "破军", [":test_filter"] = "你的点数大于11的牌视为无中生有。", ["mouxusheng"] = "谋徐盛", - --["cheat"] = "开挂", + -- ["cheat"] = "小开", [":cheat"] = "出牌阶段,你可以获得一张想要的牌。", --["#test_trig-ask"] = "你可弃置一张手牌", ["control"] = "控制", - ["damage_maker"] = "制伤器", + [":control"] = "出牌阶段,你可以控制/解除控制若干名其他角色。", + + ["test_vs"] = "视为", + [":test_vs"] = "你可以将牌当包含无懈在内的某张锦囊使用。", + + ["damage_maker"] = "制伤", + [":damage_maker"] = "出牌阶段,你可以进行一次伤害制造器。", + ["change_hero"] = "变更", + [":change_hero"] = "出牌阶段,你可以变更一名角色武将牌。", } return { extension }