parent
d38b0ca805
commit
24a8020d1e
|
@ -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")
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue