bugfix (#339)
- 改造常备主逻辑,现在常备主会根据可用多余将数调整 - 改良了getCardArea - 重新启用将框不足提醒 - 修复了司马懿问打出牌的bug - 修复了白名单武将不存在时无法创房的bug --------- Co-authored-by: notify <notify-ctrl@qq.com>
This commit is contained in:
parent
30e33f92c7
commit
e75836ff8d
|
@ -172,9 +172,11 @@ Flickable {
|
|||
arr = config.curScheme.banPkg[k];
|
||||
if (arr.length !== 0) {
|
||||
const generals = lcall("GetGenerals", k);
|
||||
if (generals.length !== 0) {
|
||||
disabledGenerals.push(...generals.filter(g => !arr.includes(g)));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (k in config.curScheme.normalPkg) {
|
||||
arr = config.curScheme.normalPkg[k] ?? [];
|
||||
if (arr.length !== 0)
|
||||
|
|
|
@ -634,8 +634,8 @@ Item {
|
|||
|
||||
function loadPackages() {
|
||||
if (loaded) return;
|
||||
const _mods = lcall("GetAllModNames")
|
||||
const modData = lcall("GetAllMods")
|
||||
const _mods = lcall("GetAllModNames");
|
||||
const modData = lcall("GetAllMods");
|
||||
const packs = lcall("GetAllGeneralPack");
|
||||
_mods.forEach(name => {
|
||||
const pkgs = modData[name].filter(p => packs.includes(p)
|
||||
|
|
|
@ -66,25 +66,28 @@ function Client:getPlayerById(id)
|
|||
return nil
|
||||
end
|
||||
|
||||
---@param cardId integer | card
|
||||
---@param cardId integer | Card
|
||||
---@return CardArea
|
||||
function Client:getCardArea(cardId)
|
||||
if type(cardId) ~= "number" then
|
||||
assert(cardId and cardId:isInstanceOf(Card))
|
||||
cardId = cardId:getEffectiveId()
|
||||
local cardIds = Card:getIdList(cardId)
|
||||
local resultPos = {}
|
||||
for _, cid in ipairs(cardIds) do
|
||||
if not table.contains(resultPos, Card.PlayerHand) and table.contains(Self.player_cards[Player.Hand], cid) then
|
||||
table.insert(resultPos, Card.PlayerHand)
|
||||
end
|
||||
if table.contains(Self.player_cards[Player.Hand], cardId) then
|
||||
return Card.PlayerHand
|
||||
end
|
||||
if table.contains(Self.player_cards[Player.Equip], cardId) then
|
||||
return Card.PlayerEquip
|
||||
if not table.contains(resultPos, Card.PlayerEquip) and table.contains(Self.player_cards[Player.Equip], cid) then
|
||||
table.insert(resultPos, Card.PlayerEquip)
|
||||
end
|
||||
for _, t in pairs(Self.special_cards) do
|
||||
if table.contains(t, cardId) then
|
||||
return Card.PlayerSpecial
|
||||
if table.contains(t, cid) then
|
||||
table.insertIfNeed(resultPos, Card.PlayerSpecial)
|
||||
end
|
||||
end
|
||||
error("Client:getCardArea can only judge cards in your hand or equip area")
|
||||
end
|
||||
if #resultPos == 1 then
|
||||
return resultPos[1]
|
||||
end
|
||||
return Card.Unknown
|
||||
end
|
||||
|
||||
function Client:moveCards(moves)
|
||||
|
|
|
@ -151,7 +151,7 @@ function GetAllGeneralPack()
|
|||
end
|
||||
|
||||
function GetGenerals(pack_name)
|
||||
if not Fk.packages[pack_name] then return "{}" end
|
||||
if not Fk.packages[pack_name] then return "[]" end
|
||||
local ret = {}
|
||||
for _, g in ipairs(Fk.packages[pack_name].generals) do
|
||||
if not g.total_hidden then
|
||||
|
|
|
@ -265,11 +265,8 @@ end
|
|||
---@param cardId integer | Card @ 要获得区域的那张牌,可以是Card或者一个id
|
||||
---@return CardArea @ 这张牌的区域
|
||||
function Room:getCardArea(cardId)
|
||||
if type(cardId) ~= "number" then
|
||||
assert(cardId and cardId:isInstanceOf(Card))
|
||||
cardId = cardId:getEffectiveId()
|
||||
end
|
||||
return self.card_place[cardId] or Card.Unknown
|
||||
local cardIds = table.map(Card:getIdList(cardId), function(cid) return self.card_place[cid] or Card.Unknown end)
|
||||
return #cardIds == 1 and cardIds[1] or Card.Unknown
|
||||
end
|
||||
|
||||
--- 获得拥有某一张牌的玩家。
|
||||
|
|
|
@ -71,6 +71,7 @@ fk.IceDamage = 4
|
|||
---@field public damageType? DamageType @ 伤害的属性
|
||||
---@field public skillName? string @ 造成本次伤害的技能名
|
||||
---@field public beginnerOfTheDamage? boolean @ 是否是本次铁索传导的起点
|
||||
---@field public by_user? boolean @ 是否由卡牌直接生效造成的伤害
|
||||
|
||||
--- 用来描述和回复体力有关的数据。
|
||||
---@class RecoverStruct
|
||||
|
|
|
@ -84,14 +84,14 @@ local guicai = fk.CreateTriggerSkill{
|
|||
on_cost = function(self, event, target, player, data)
|
||||
local room = player.room
|
||||
local prompt = "#guicai-ask::" .. target.id
|
||||
local card = room:askForResponse(player, self.name, ".|.|.|hand", prompt, true)
|
||||
if card ~= nil then
|
||||
self.cost_data = card
|
||||
local card = room:askForCard(player, 1, 1, false, self.name, true, ".|.|.|hand", prompt)
|
||||
if #card > 0 then
|
||||
self.cost_data = card[1]
|
||||
return true
|
||||
end
|
||||
end,
|
||||
on_use = function(self, event, target, player, data)
|
||||
player.room:retrial(self.cost_data, player, data, self.name)
|
||||
player.room:retrial(Fk:getCardById(self.cost_data), player, data, self.name)
|
||||
end,
|
||||
}
|
||||
local fankui = fk.CreateTriggerSkill{
|
||||
|
@ -1119,7 +1119,7 @@ local role_getlogic = function()
|
|||
if lord ~= nil then
|
||||
room.current = lord
|
||||
local a1 = #room.general_pile
|
||||
local a2 = #room.players * generalNum + lord_num
|
||||
local a2 = #room.players * generalNum
|
||||
if a1 < a2 then
|
||||
room:sendLog{
|
||||
type = "#NoEnoughGeneralDraw",
|
||||
|
@ -1129,6 +1129,7 @@ local role_getlogic = function()
|
|||
}
|
||||
room:gameOver("")
|
||||
end
|
||||
lord_num = math.min(a1 - a2, lord_num)
|
||||
local generals = table.connect(room:findGenerals(function(g)
|
||||
return table.find(Fk.generals[g].skills, function(s) return s.lordSkill end)
|
||||
end, lord_num), room:getNGenerals(generalNum))
|
||||
|
|
Loading…
Reference in New Issue