修bug... 虽然不知道是不是修了
修那个gameOver触发时机的
注意了休整下投降仍未修复哦
先放个PR在这了
This commit is contained in:
notify 2024-02-17 09:47:17 +08:00 committed by GitHub
parent c3cdb8dc50
commit 7779f06411
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 19 additions and 26 deletions

View File

@ -1,4 +1,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# ------------------------------------------------------------
# CMake+QT
# 2022-01-24 2023-02-21 v0.0.1
# ------------------------------------------------------------
cmake_minimum_required(VERSION 3.16)

View File

@ -255,9 +255,9 @@ Item {
const gdata = lcall("GetGeneralData", modelData);
const pack = gdata.package;
if (s.banPkg[pack]) {
if (!s.banPkg[pack].includes(modelData)) return 0.7;
if (!s.banPkg[pack].includes(modelData)) return 0.5;
} else {
if (!!s.normalPkg[pack]?.includes(modelData)) return 0.7;
if (!!s.normalPkg[pack]?.includes(modelData)) return 0.5;
}
return 0;
}

View File

@ -768,9 +768,7 @@ fk.client_callback["AskForUseActiveSkill"] = function(jsonData)
local data = json.decode(jsonData)
local skill = Fk.skills[data[1]]
local extra_data = data[4]
for k, v in pairs(extra_data) do
skill[k] = v
end
skill._extra_data = extra_data
Fk.currentResponseReason = extra_data.skillName
ClientInstance:notifyUI("AskForUseActiveSkill", jsonData)

View File

@ -414,14 +414,6 @@ function Card:getMark(mark)
return ret
end
--- 判定卡牌是否拥有对应的Mark。
---@param mark string @ 标记
---@return boolean
function Card:hasMark(mark)
fk.qWarning("hasMark will be deleted in future version!")
return self:getMark(mark) ~= 0
end
--- 获取卡牌有哪些Mark。
function Card:getMarkNames()
local ret = {}

View File

@ -221,14 +221,6 @@ function Player:getMark(mark)
return mark
end
--- 判定角色是否拥有对应的Mark。
---@param mark string @ 标记
---@return boolean
function Player:hasMark(mark)
fk.qWarning("hasMark will be deleted in future version!")
return self:getMark(mark) ~= 0
end
--- 获取角色有哪些Mark。
function Player:getMarkNames()
local ret = {}

View File

@ -44,6 +44,7 @@ function Skill:initialize(name, frequency)
self.anim_type = ""
self.related_skills = {}
self.attachedKingdom = {}
self._extra_data = {}
local name_splited = name:split("__")
self.trueName = name_splited[#name_splited]
@ -63,6 +64,8 @@ end
function Skill:__index(k)
if k == "cost_data" then
return Fk:currentRoom().skill_costs[self.name]
else
return self._extra_data[k]
end
end

View File

@ -114,9 +114,7 @@ smart_cb["AskForUseActiveSkill"] = function(self, jsonData)
local skillName, prompt, cancelable, extra_data = table.unpack(data)
local skill = Fk.skills[skillName]
for k, v in pairs(extra_data) do
skill[k] = v
end
skill._extra_data = extra_data
local ret = self:callFromTable(fk.ai_active_skill, nil, skillName,
self, prompt, cancelable, extra_data)

View File

@ -3429,7 +3429,13 @@ end
function Room:gameOver(winner)
if not self.game_started then return end
self.logic:trigger(fk.GameFinished, nil, winner)
if table.contains(
{ "running", "normal" },
coroutine.status(self.main_co)
) then
self.logic:trigger(fk.GameFinished, nil, winner)
end
self.game_started = false
self.game_finished = true

View File

@ -517,7 +517,7 @@ void Server::handleNameAndPassword(ClientSocket *client, const QString &name,
void Server::onRoomAbandoned() {
Room *room = qobject_cast<Room *>(sender());
room->gameOver();
// room->gameOver(); // Lua会出手
rooms.remove(room->getId());
updateOnlineInfo();
// 按理说这时候就可以删除了但是这里肯定比Lua先检测到。