Fixbug (#319)
修bug... 虽然不知道是不是修了 修那个gameOver触发时机的 注意了休整下投降仍未修复哦 先放个PR在这了
This commit is contained in:
parent
c3cdb8dc50
commit
7779f06411
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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先检测到。
|
||||
|
|
Loading…
Reference in New Issue