mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-15 19:22:25 +08:00
parent
d38b0ca805
commit
24a8020d1e
|
@ -122,23 +122,7 @@ function GameLogic:chooseGenerals()
|
|||
end
|
||||
|
||||
room:setPlayerGeneral(lord, lord_general, true)
|
||||
if lord.kingdom == "god" or Fk.generals[lord_general].subkingdom then
|
||||
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:askForChooseKingdom({lord})
|
||||
room:broadcastProperty(lord, "general")
|
||||
room:setDeputyGeneral(lord, deputy)
|
||||
room:broadcastProperty(lord, "deputyGeneral")
|
||||
|
|
|
@ -30,7 +30,7 @@ local function tellRoomToObserver(self, player)
|
|||
for _, p in ipairs(self.players) do
|
||||
self:notifyProperty(player, p, "general")
|
||||
self:notifyProperty(player, p, "deputyGeneral")
|
||||
p:marshal(player)
|
||||
p:marshal(player, true)
|
||||
end
|
||||
|
||||
player:doNotify("UpdateDrawPile", #self.draw_pile)
|
||||
|
|
|
@ -180,7 +180,8 @@ function ServerPlayer:waitForReply(timeout)
|
|||
end
|
||||
|
||||
---@param player ServerPlayer
|
||||
function ServerPlayer:marshal(player)
|
||||
---@param observe boolean|nil
|
||||
function ServerPlayer:marshal(player, observe)
|
||||
local room = self.room
|
||||
if not room.game_started then
|
||||
-- If game does not starts, that mean we are entering room that
|
||||
|
@ -269,7 +270,7 @@ function ServerPlayer:marshal(player)
|
|||
end
|
||||
|
||||
if #card_moves > 0 then
|
||||
room:notifyMoveCards({ player }, card_moves)
|
||||
room:notifyMoveCards({ player }, card_moves, observe and self.seat == 1)
|
||||
end
|
||||
|
||||
for k, v in pairs(self.mark) do
|
||||
|
|
|
@ -7,8 +7,15 @@ local discardSkill = fk.CreateActiveSkill{
|
|||
return false
|
||||
end
|
||||
|
||||
if Fk:currentRoom():getCardArea(to_select) == Player.Special then
|
||||
return false
|
||||
if Fk:currentRoom():getCardArea(to_select) == Card.PlayerSpecial then
|
||||
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
|
||||
|
||||
local checkpoint = true
|
||||
|
@ -50,8 +57,8 @@ local chooseCardsSkill = fk.CreateActiveSkill{
|
|||
return false
|
||||
end
|
||||
|
||||
if Fk:currentRoom():getCardArea(to_select) == Player.Special then
|
||||
return false
|
||||
if Fk:currentRoom():getCardArea(to_select) == Card.PlayerSpecial then
|
||||
if not string.find(self.pattern or "", self.expand_pile or "") then return false end
|
||||
end
|
||||
|
||||
local checkpoint = true
|
||||
|
|
Loading…
Reference in New Issue
Block a user