fix abort areas (#252)
Co-authored-by: Nyutanislavsky <nyutanislavsky@qq.com>
This commit is contained in:
parent
4284336825
commit
2f7d7d4a96
|
@ -158,7 +158,7 @@ Item {
|
||||||
hideAnime.stop();
|
hideAnime.stop();
|
||||||
x = 0;
|
x = 0;
|
||||||
|
|
||||||
opacity = 1;
|
opacity = sealed ? 1 : 0;
|
||||||
text = ' ' + Backend.translate(subtype + "_sealed")
|
text = ' ' + Backend.translate(subtype + "_sealed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,6 +343,13 @@ Fk:loadTranslationTable{
|
||||||
["weapon_sealed"] = "武器栏废除",
|
["weapon_sealed"] = "武器栏废除",
|
||||||
["armor_sealed"] = "防具栏废除",
|
["armor_sealed"] = "防具栏废除",
|
||||||
["treasure_sealed"] = "宝物栏废除",
|
["treasure_sealed"] = "宝物栏废除",
|
||||||
|
|
||||||
|
["WeaponSlot"] = "武器栏",
|
||||||
|
["ArmorSlot"] = "防具栏",
|
||||||
|
["OffensiveRideSlot"] = "进攻坐骑栏",
|
||||||
|
["DefensiveRideSlot"] = "防御坐骑栏",
|
||||||
|
["TreasureSlot"] = "宝物栏",
|
||||||
|
["JudgeSlot"] = "判定区",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- related to sendLog
|
-- related to sendLog
|
||||||
|
|
|
@ -122,4 +122,7 @@ fk.AfterSkillEffect = 82
|
||||||
-- 85 = xxx
|
-- 85 = xxx
|
||||||
-- 86 = AfterPhaseEnd
|
-- 86 = AfterPhaseEnd
|
||||||
|
|
||||||
fk.NumOfEvents = 83
|
fk.AreaAborted = 87
|
||||||
|
fk.AreaResumed = 88
|
||||||
|
|
||||||
|
fk.NumOfEvents = 89
|
||||||
|
|
|
@ -128,6 +128,7 @@ function GameLogic:chooseGenerals()
|
||||||
room:setPlayerGeneral(lord, lord_general, true)
|
room:setPlayerGeneral(lord, lord_general, true)
|
||||||
room:askForChooseKingdom({lord})
|
room:askForChooseKingdom({lord})
|
||||||
room:broadcastProperty(lord, "general")
|
room:broadcastProperty(lord, "general")
|
||||||
|
room:broadcastProperty(lord, "kingdom")
|
||||||
room:setDeputyGeneral(lord, deputy)
|
room:setDeputyGeneral(lord, deputy)
|
||||||
room:broadcastProperty(lord, "deputyGeneral")
|
room:broadcastProperty(lord, "deputyGeneral")
|
||||||
end
|
end
|
||||||
|
|
|
@ -3258,7 +3258,7 @@ function Room:abortPlayerArea(player, playerSlots)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if next(slotsSealed) == nil then
|
if #slotsToSeal == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3271,6 +3271,31 @@ function Room:abortPlayerArea(player, playerSlots)
|
||||||
|
|
||||||
table.insertTable(player.sealedSlots, slotsToSeal)
|
table.insertTable(player.sealedSlots, slotsToSeal)
|
||||||
self:broadcastProperty(player, "sealedSlots")
|
self:broadcastProperty(player, "sealedSlots")
|
||||||
|
|
||||||
|
self.logic:trigger(fk.AreaAborted, player, { slots = slotsSealed })
|
||||||
|
end
|
||||||
|
|
||||||
|
function Room:resumePlayerArea(player, playerSlots)
|
||||||
|
assert(type(playerSlots) == "string" or type(playerSlots) == "table")
|
||||||
|
|
||||||
|
if type(playerSlots) == "string" then
|
||||||
|
playerSlots = { playerSlots }
|
||||||
|
end
|
||||||
|
|
||||||
|
local slotsToResume = {}
|
||||||
|
for _, slot in ipairs(playerSlots) do
|
||||||
|
for i = 1, #player.sealedSlots do
|
||||||
|
if player.sealedSlots[i] == slot then
|
||||||
|
table.remove(player.sealedSlots, i)
|
||||||
|
table.insert(slotsToResume, slot)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if #slotsToResume > 0 then
|
||||||
|
self:broadcastProperty(player, "sealedSlots")
|
||||||
|
self.logic:trigger(fk.AreaResumed, player, { slots = slotsToResume })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return Room
|
return Room
|
||||||
|
|
Loading…
Reference in New Issue