1. 修复旁观进入时的手牌无法查看
2. 修复武将牌上的牌
3. 主公选势力……
This commit is contained in:
Nyutanislavsky 2023-08-03 20:34:43 +08:00 committed by GitHub
parent d38b0ca805
commit 24a8020d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 24 deletions

View File

@ -122,23 +122,7 @@ function GameLogic:chooseGenerals()
end end
room:setPlayerGeneral(lord, lord_general, true) room:setPlayerGeneral(lord, lord_general, true)
if lord.kingdom == "god" or Fk.generals[lord_general].subkingdom then room:askForChooseKingdom({lord})
local allKingdoms = {}
if lord.kingdom == "god" then
allKingdoms = table.simpleClone(Fk.kingdoms)
local exceptedKingdoms = { "god", "qin" }
for _, kingdom in ipairs(exceptedKingdoms) do
table.removeOne(allKingdoms, kingdom)
end
else
local curGeneral = Fk.generals[lord_general]
allKingdoms = { curGeneral.kingdom, curGeneral.subkingdom }
end
lord.kingdom = room:askForChoice(lord, allKingdoms, "AskForKingdom", "#ChooseInitialKingdom")
room:broadcastProperty(lord, "kingdom")
end
room:broadcastProperty(lord, "general") room:broadcastProperty(lord, "general")
room:setDeputyGeneral(lord, deputy) room:setDeputyGeneral(lord, deputy)
room:broadcastProperty(lord, "deputyGeneral") room:broadcastProperty(lord, "deputyGeneral")

View File

@ -30,7 +30,7 @@ local function tellRoomToObserver(self, player)
for _, p in ipairs(self.players) do for _, p in ipairs(self.players) do
self:notifyProperty(player, p, "general") self:notifyProperty(player, p, "general")
self:notifyProperty(player, p, "deputyGeneral") self:notifyProperty(player, p, "deputyGeneral")
p:marshal(player) p:marshal(player, true)
end end
player:doNotify("UpdateDrawPile", #self.draw_pile) player:doNotify("UpdateDrawPile", #self.draw_pile)

View File

@ -180,7 +180,8 @@ function ServerPlayer:waitForReply(timeout)
end end
---@param player ServerPlayer ---@param player ServerPlayer
function ServerPlayer:marshal(player) ---@param observe boolean|nil
function ServerPlayer:marshal(player, observe)
local room = self.room local room = self.room
if not room.game_started then if not room.game_started then
-- If game does not starts, that mean we are entering room that -- If game does not starts, that mean we are entering room that
@ -269,7 +270,7 @@ function ServerPlayer:marshal(player)
end end
if #card_moves > 0 then if #card_moves > 0 then
room:notifyMoveCards({ player }, card_moves) room:notifyMoveCards({ player }, card_moves, observe and self.seat == 1)
end end
for k, v in pairs(self.mark) do for k, v in pairs(self.mark) do

View File

@ -7,8 +7,15 @@ local discardSkill = fk.CreateActiveSkill{
return false return false
end end
if Fk:currentRoom():getCardArea(to_select) == Player.Special then if Fk:currentRoom():getCardArea(to_select) == Card.PlayerSpecial then
return false local pile = ""
for p, t in pairs(Self.special_cards) do
if table.contains(t, to_select) then
pile = p
break
end
end
if not string.find(self.pattern or "", pile) then return false end
end end
local checkpoint = true local checkpoint = true
@ -50,8 +57,8 @@ local chooseCardsSkill = fk.CreateActiveSkill{
return false return false
end end
if Fk:currentRoom():getCardArea(to_select) == Player.Special then if Fk:currentRoom():getCardArea(to_select) == Card.PlayerSpecial then
return false if not string.find(self.pattern or "", self.expand_pile or "") then return false end
end end
local checkpoint = true local checkpoint = true