mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-15 19:22:25 +08:00
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();
|
||||
x = 0;
|
||||
|
||||
opacity = 1;
|
||||
opacity = sealed ? 1 : 0;
|
||||
text = ' ' + Backend.translate(subtype + "_sealed")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -343,6 +343,13 @@ Fk:loadTranslationTable{
|
|||
["weapon_sealed"] = "武器栏废除",
|
||||
["armor_sealed"] = "防具栏废除",
|
||||
["treasure_sealed"] = "宝物栏废除",
|
||||
|
||||
["WeaponSlot"] = "武器栏",
|
||||
["ArmorSlot"] = "防具栏",
|
||||
["OffensiveRideSlot"] = "进攻坐骑栏",
|
||||
["DefensiveRideSlot"] = "防御坐骑栏",
|
||||
["TreasureSlot"] = "宝物栏",
|
||||
["JudgeSlot"] = "判定区",
|
||||
}
|
||||
|
||||
-- related to sendLog
|
||||
|
|
|
@ -122,4 +122,7 @@ fk.AfterSkillEffect = 82
|
|||
-- 85 = xxx
|
||||
-- 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:askForChooseKingdom({lord})
|
||||
room:broadcastProperty(lord, "general")
|
||||
room:broadcastProperty(lord, "kingdom")
|
||||
room:setDeputyGeneral(lord, deputy)
|
||||
room:broadcastProperty(lord, "deputyGeneral")
|
||||
end
|
||||
|
|
|
@ -3258,7 +3258,7 @@ function Room:abortPlayerArea(player, playerSlots)
|
|||
end
|
||||
end
|
||||
|
||||
if next(slotsSealed) == nil then
|
||||
if #slotsToSeal == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -3271,6 +3271,31 @@ function Room:abortPlayerArea(player, playerSlots)
|
|||
|
||||
table.insertTable(player.sealedSlots, slotsToSeal)
|
||||
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
|
||||
|
||||
return Room
|
||||
|
|
Loading…
Reference in New Issue
Block a user