Uzi bug fixes. Now Zouwei and Zhuanhui work correctly.

This commit is contained in:
Baisebaoma 2023-12-01 23:33:41 +08:00
parent 5fa8c40d7c
commit 904bf4019c
1 changed files with 22 additions and 19 deletions

View File

@ -29,31 +29,30 @@ local hongwen = fk.CreateFilterSkill{
local zouwei = fk.CreateDistanceSkill{ local zouwei = fk.CreateDistanceSkill{
name = "zouwei", name = "zouwei",
correct_func = function(self, from, to) correct_func = function(self, from, to)
-- 装备区有牌,你视为装备-1 -- 装备时视为-1
if from:hasSkill(self) and from:getCardIds(from.Equip) ~= 0 then if from:hasSkill(self) and from:getCardIds(from.Equip) ~= 0 then
return -1 return -1
end end
-- 装备区没牌,你视为装备+1 -- 装备时视为+1
if to:hasSkill(self) and from:getCardIds(from.Equip) == 0 then if to:hasSkill(self) and to:getCardIds(to.Equip) == 0 then
return 1 return 1
end end
return 0 return 0
end, end,
} }
local zouwei_audio = fk.CreateTriggerSkill{ local zouwei_audio = fk.CreateTriggerSkill{
name = "#zouwei_audio", name = "#zouwei_audio",
refresh_events = {fk.EquipChanged}, refresh_events = {fk.HpChanged},
can_refresh = function(self, event, target, player, data) can_refresh = function(self, event, target, player, data)
return target == player and player:hasSkill("zouwei") and not player:isFakeSkill("zouwei") return target == player and player:hasSkill("zouwei") and not player:isFakeSkill("zouwei")
end, end,
on_refresh = function(self, event, target, player, data) on_refresh = function(self, event, target, player, data)
local room = player.room local room = player.room
if player:getCardIds(player.Equip) ~= 0 then if player.hp > 2 and data.num > 0 and player.hp - data.num < 3 then
room:notifySkillInvoked(player, "zouwei", "offensive") room:notifySkillInvoked(player, "zouwei", "offensive")
player:broadcastSkillInvoke("zouwei", 1) player:broadcastSkillInvoke("zouwei", 1)
elseif player:getCardIds(player.Equip) == 0 then elseif player.hp < 3 and data.num < 0 and player.hp - data.num > 2 then
room:notifySkillInvoked(player, "zouwei", "defensive") room:notifySkillInvoked(player, "zouwei", "defensive")
player:broadcastSkillInvoke("zouwei", 2) player:broadcastSkillInvoke("zouwei", 2)
end end
@ -61,7 +60,6 @@ local zouwei_audio = fk.CreateTriggerSkill{
} }
zouwei:addRelatedSkill(zouwei_audio) zouwei:addRelatedSkill(zouwei_audio)
-- 圣弩 -- 圣弩
-- 参考自formation包的君刘备 -- 参考自formation包的君刘备
local shengnu = fk.CreateTriggerSkill{ local shengnu = fk.CreateTriggerSkill{
@ -100,17 +98,22 @@ local shengnu = fk.CreateTriggerSkill{
-- 转会 -- 转会
local zhuanhui = fk.CreateMaxCardsSkill { local zhuanhui = fk.CreateTriggerSkill{
name = "zhuanhui", name = "zhuanhui", -- kaiju$是主公技
correct_func = function(self, player) anim_type = "masochism",
if player:hasSkill(self.name) then frequency = Skill.Compulsory,
local kingdoms = {} events = {}, -- 这里是故意的,因为本来这个技能就没有实际效果
for _, p in ipairs(Fk:currentRoom().alive_players) do can_trigger = function(self, event, target, player, data)
table.insertIfNeed(kingdoms, p.kingdom) return target == player and player:hasSkill(self.name) and player.phase == Player.Start
end,
on_use = function(self, event, target, player, data)
local room = player.room
for _, p in ipairs(room:getOtherPlayers(player, true)) do
if not p:isAllNude() then
local id = room:askForCardChosen(p, p, "#kaiju-choose", self.name) -- 他自己选一张牌
room:obtainCard(player, id, false, fk.ReasonPrey) -- 我从他那里拿一张牌来
room:useVirtualCard("slash", nil, p, player, self.name, true) -- 杀
end end
return #kingdoms
else
return 0
end end
end, end,
} }