加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
work_heg.lua 19.75 KB
一键复制 编辑 原始数据 按行查看 历史
s1134s 提交于 2024-12-20 19:37 . update
-- Fk:loadTranslationTable{
-- ["work_heg"] = "国战-工作室",
-- ["wk_heg"] = "日月",
-- }
-- local chengyu = General(extension, "wk_heg__chengyu", "wei", 3)
-- chengyu.hidden = true
-- local shefu = fk.CreateTriggerSkill{
-- name = "wk_heg__shefu",
-- anim_type = "special",
-- events = {fk.Damaged},
-- can_trigger = function (self, event, target, player, data)
-- return player:hasSkill(self) and player == target and not player:isNude()
-- end,
-- on_cost = function (self, event, target, player, data)
-- local room = player.room
-- local chooses = table.map(table.filter(room.alive_players, function (p)
-- return p ~= room.current
-- end), Util.IdMapper)
-- local tos, id = room:askForChooseCardAndPlayers(player, chooses, 1, 2, ".", "#wk_heg__shefu-choose", self.name, true)
-- if #tos ~= 0 then
-- self.cost_data = {tos, id}
-- return true
-- end
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- local to = self.cost_data[1]
-- local id = self.cost_data[2]
-- room:throwCard({id}, self.name, player, player)
-- for i = 1, #to, 1 do
-- local too = room:getPlayerById(to[i])
-- room:setPlayerMark(too, "@@lure_tiger-turn", 1)
-- room:setPlayerMark(too, MarkEnum.PlayerRemoved .. "-turn", 1)
-- room:handleAddLoseSkills(too, "#lure_tiger_hp|#lure_tiger_prohibit", nil, false, true) -- global…
-- room.logic:trigger("fk.RemoveStateChanged", too, nil) -- FIXME
-- end
-- local targets = table.map(table.filter(room.alive_players, function (p)
-- return H.inSiegeRelation(p:getLastAlive(), p:getNextAlive(), p)
-- end), Util.IdMapper)
-- local damage_to_id = room:askForChoosePlayers(player, targets, 1, 1, "#wk_heg__shefu-choose-damage", self.name, true)
-- local damage_to = room:getPlayerById(damage_to_id[1])
-- if not player.dead and not damage_to.dead then
-- room:damage{
-- from = player,
-- to = damage_to,
-- damage = 1,
-- skillName = self.name
-- }
-- end
-- end,
-- }
-- local danli = fk.CreateTriggerSkill{
-- name = "wk_heg__danli",
-- events = {fk.EventPhaseStart},
-- anim_type = "special",
-- can_trigger = function (self, event, target, player, data)
-- return player:hasSkill(self) and player.phase == Player.Finish and player == target and H.hasGeneral(player, true)
-- end,
-- on_use = function (self, event, target, player, data)
-- local room = player.room
-- H.removeGeneral(room, player, true)
-- H.addHegMark(room, player, "companion")
-- local kingdom = H.getKingdom(player)
-- for _, p in ipairs(room:getAlivePlayers()) do
-- if p.kingdom == "unknown" and not p.dead then
-- if H.getKingdomPlayersNum(room)[kingdom] >= #room.players // 2 and not table.find(room.alive_players, function(_p) return _p.general == "ld__lordcaocao" end) then break end
-- local main, deputy = false, false
-- if H.compareExpectedKingdomWith(p, player) then
-- local general = Fk.generals[p:getMark("__heg_general")]
-- main = general.kingdom == kingdom or general.subkingdom == kingdom
-- general = Fk.generals[p:getMark("__heg_deputy")]
-- deputy = general.kingdom == kingdom or general.subkingdom == kingdom
-- end
-- H.askForRevealGenerals(room, p, self.name, main, deputy)
-- end
-- end
-- local targets = table.map(table.filter(room.alive_players, function(p) return H.compareKingdomWith(p, player) and p ~= player end), Util.IdMapper)
-- if #targets > 0 then
-- room:doIndicate(player.id, targets)
-- room:sortPlayersByAction(targets)
-- for _, pid in ipairs(targets) do
-- local p = room:getPlayerById(pid)
-- if not p.dead and H.hasGeneral(p, true) then
-- local choices = {"wk_heg__danli_remove", "Cancel"}
-- local choice = room:askForChoice(p, choices, self.name)
-- if choice ~= "Cancel" then
-- H.removeGeneral(room, p, true)
-- H.addHegMark(room, p, "companion")
-- end
-- end
-- end
-- end
-- end,
-- }
-- chengyu:addSkill(shefu)
-- chengyu:addSkill(danli)
-- Fk:loadTranslationTable{
-- ["wk_heg__chengyu"] = "程昱",
-- ["designer:wk_heg__chengyu"] = "猪",
-- ["wk_heg__shefu"] = "设伏",
-- [":wk_heg__shefu"] = "当你受到伤害后,你可调离至多两名非当前回合角色,然后你可对一名被围攻的角色造成1点伤害。",
-- ["wk_heg__danli"] = "胆戾",
-- [":wk_heg__danli"] = "结束阶段,你可移除副将并获得一个“珠联璧合”标记,然后你发起势力召唤,且与你势力相同的角色可依次移除副将并获得一个“珠联璧合”标记。",
-- ["#wk_heg__shefu-choose"] = "设伏:你可弃置一张牌,调离至多两名非当前回合角色",
-- ["#wk_heg__shefu-choose-damage"] = "设伏:你可对一名被围攻的角色造成1点伤害",
-- ["wk_heg__danli_remove"] = "移除副将并获得一个“珠联璧合”标记",
-- ["#wk_heg__shefu_viewas"] = "设伏",
-- ["$wk_heg__shefu1"] = "圈套已设,埋伏已完,只等敌军进来。",
-- ["$wk_heg__shefu2"] = "如此天网,谅你插翅也难逃。",
-- ["$wk_heg__danli1"] = "曹公智略乃上天所授。",
-- ["$wk_heg__danli2"] = "天下大乱,群雄并起,必有命世。",
-- ["~wk_heg__chengyu"] = "此诚报效国家之时,吾却休矣…",
-- }
-- local wangji = General(extension, "wk_heg__wangji", "wei", 3, 3, General.Male)
-- wangji.hidden = true
-- local qizhi = fk.CreateTriggerSkill{
-- name = "wk_heg__qizhi",
-- anim_type = "offensive",
-- events = {fk.Damage},
-- can_trigger = function(self, event, target, player, data)
-- if not (player:hasSkill(self) and target == player.room.current and H.compareKingdomWith(player, target)) then return false end
-- local room = player.room
-- local damage_event = room.logic:getCurrentEvent()
-- if not damage_event then return false end
-- local x = target:getMark("wk_heg__qizhi-turn")
-- if x == 0 then
-- room.logic:getEventsOfScope(GameEvent.ChangeHp, 1, function (e)
-- local reason = e.data[3]
-- if reason == "damage" then
-- local first_damage_event = e:findParent(GameEvent.Damage)
-- if first_damage_event and first_damage_event.data[1].from == target then
-- x = first_damage_event.id
-- room:setPlayerMark(target, "wk_heg__qizhi-turn", x)
-- return true
-- end
-- end
-- end, Player.HistoryTurn)
-- end
-- return damage_event.id == x
-- end,
-- on_cost = function(self, event, target, player, data)
-- local room = player.room
-- local targets = table.map(table.filter(room.alive_players, function(p) return p ~= data.to and not p:isNude() end), Util.IdMapper)
-- local to = room:askForChoosePlayers(player, targets, 1, 1, "#wk_heg__qizhi-choose", self.name, true)
-- if #to > 0 then
-- self.cost_data = to[1]
-- return true
-- end
-- end,
-- on_use = function (self, event, target, player, data)
-- local room = player.room
-- if self.cost_data then
-- local to = room:getPlayerById(self.cost_data)
-- local id = room:askForCardChosen(player, to, "he", self.name)
-- room:throwCard(id, self.name, to, player)
-- if not to.dead then
-- to:drawCards(1, self.name)
-- end
-- end
-- end,
-- }
-- local jinqu = fk.CreateTriggerSkill{
-- name = "wk_heg__jinqu",
-- anim_type = "drwacard",
-- events = {fk.AfterCardsMove},
-- can_trigger = function(self, event, target, player, data)
-- if player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 then
-- for _, move in ipairs(data) do
-- if move.from == player.id and move.moveReason ~= fk.ReasonUse and move.moveReason ~= fk.ReasonResonpse then
-- for _, info in ipairs(move.moveInfo) do
-- if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
-- return true
-- end
-- end
-- end
-- end
-- end
-- end,
-- on_cost = function(self, event, target, player, data)
-- local room = player.room
-- local targets = table.map(table.filter(room.alive_players, function(p) return H.compareKingdomWith(p, player) end), Util.IdMapper)
-- if #targets == 0 then return end
-- local to = room:askForChoosePlayers(player, targets, 1, 1, "#wk_heg__jinqu-choose", self.name, true)
-- if #to > 0 then
-- self.cost_data = to[1]
-- return true
-- end
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- if self.cost_data then
-- local to = room:getPlayerById(self.cost_data)
-- to:drawCards(2, self.name)
-- local turn_event = room.logic:getCurrentEvent():findParent(GameEvent.Turn, false)
-- if turn_event == nil then return false end
-- local end_id = turn_event.id
-- local cards = {}
-- U.getEventsByRule(room, GameEvent.MoveCards, 1, function (e)
-- for _, move in ipairs(e.data) do
-- if move.toArea == Card.DiscardPile then
-- for _, info in ipairs(move.moveInfo) do
-- local card_suit = Fk:getCardById(info.cardId, true).suit
-- if room:getCardArea(info.cardId) == Card.DiscardPile and not table.contains(cards, card_suit) and card_suit ~= 0 then
-- table.insertIfNeed(cards, card_suit)
-- end
-- end
-- end
-- end
-- return false
-- end, end_id)
-- local discard_num = to:getHandcardNum() - #cards
-- if discard_num > 0 then
-- room:askForDiscard(to, discard_num, discard_num, false, self.name, false)
-- end
-- end
-- end,
-- }
-- wangji:addSkill(qizhi)
-- wangji:addSkill(jinqu)
-- Fk:loadTranslationTable{
-- ["wk_heg__wangji"] = "王基", --魏国
-- ["designer:wk_heg__wangji"] = "教父",
-- ["wk_heg__qizhi"] = "奇制",
-- [":wk_heg__qizhi"] = "与你势力相同的角色于其回合内首次造成伤害后,你可以弃置不为受伤角色的一张牌,然后以此法失去牌的角色摸一张牌。",
-- ["wk_heg__jinqu"] = "进趋",
-- [":wk_heg__jinqu"] = "每回合限一次,当你不因使用或打出而失去牌后,你可令一名与你势力相同的角色摸两张牌,然后其将手牌弃至X张(X为此回合进入弃牌堆的牌花色数)。",
-- ["#wk_heg__qizhi-choose"] = "奇制:选择一名除受伤角色外的角色,弃置其一张牌",
-- ["#wk_heg__jinqu-choose"] = "进趋:选择一名与你势力相同的角色,令其摸两张牌",
-- ["$wk_heg__qizhi1"] = "声东击西,敌寇一网成擒。",
-- ["$wk_heg__qizhi2"] = "吾意不在此地,已遣别部出发。",
-- ["$wk_heg__jinqu1"] = "建上昶水城,以逼夏口!",
-- ["$wk_heg__jinqu2"] = "通川聚粮,伐吴之业,当步步为营。",
-- ["~wk_heg__wangji"] = "天下之势,必归大魏,可恨,未能得见呐!",
-- }
-- -- 封锁 判定区
-- local heg_judge_forbidden = fk.CreateTriggerSkill{
-- name = "#heg_judge_forbidden",
-- anim_type = "control",
-- events = {fk.EventPhaseStart},
-- frequency = Skill.Compulsory,
-- can_trigger = function (self, event, target, player, data)
-- return player:getMark("@@heg_judge_forbidden") ~= 0 and player == target and player.phase == Player.Judge
-- end,
-- on_use = Util.TrueFunc,
-- }
-- -- 封锁 手牌区
-- local heg_hand_forbidden = fk.CreateTriggerSkill{
-- name = "#heg_hand_forbidden",
-- anim_type = "control",
-- events = {fk.CardUsing},
-- frequency = Skill.Compulsory,
-- can_trigger = function (self, event, target, player, data)
-- return player:getMark("@@heg_hand_forbidden") ~= 0 and player == target
-- end,
-- on_use = function (self, event, target, player, data)
-- data.toCard = nil
-- data.tos = {}
-- end,
-- }
-- -- 封锁 装备区
-- local heg_equip_forbidden = fk.CreateInvaliditySkill {
-- name = "#heg_equip_forbidden",
-- global = true,
-- invalidity_func = function(self, from, skill)
-- if from:getMark("@@heg_equip_forbidden") > 0 and skill.attached_equip then
-- for _, card in ipairs(Fk.cards) do
-- if card.type == Card.TypeEquip and skill.attached_equip == card.name then
-- return true
-- end
-- end
-- end
-- end
-- }
-- Fk:loadTranslationTable{
-- ["heg_judge_forbidden"] = "封锁 判定区",
-- ["heg_hand_forbidden"] = "封锁 手牌区",
-- ["heg_equip_forbidden"] = "封锁 装备区",
-- ["@@heg_judge_forbidden"] = "封锁 判定区",
-- ["@@heg_hand_forbidden"] = "封锁 手牌区",
-- ["@@heg_equip_forbidden"] = "封锁 装备区",
-- ["heg_judge_recover"] = "恢复 判定区",
-- ["heg_hand_recover"] = "恢复 手牌区",
-- ["heg_equip_recover"] = "恢复 装备区",
-- ["#heg_equip_forbidden"] = "封锁",
-- ["#heg_hand_forbidden"] = "封锁",
-- ["#heg_judge_forbidden"] = "封锁",
-- }
-- -- local lihui = General(extension, "wk_heg__lihui", "shu", 3)
-- -- local ziqi = fk.CreateTriggerSkill{
-- -- name = "wk_heg__ziqi",
-- -- anim_type = "offensive",
-- -- events = {fk.EventPhaseStart},
-- -- can_trigger = function (self, event, target, player, data)
-- -- return player:hasSkill(self) and H.compareKingdomWith(player, target) and target.phase == Player.Start
-- -- and (player:getMark("@@heg_judge_forbidden") == 0 or player:getMark("@@heg_equip_forbidden") == 0 or player:getMark("@@heg_hand_forbidden") == 0)
-- -- end,
-- -- on_use = function (self, event, target, player, data)
-- -- local room = player.room
-- -- local choices = {}
-- -- if player:getMark("@@heg_judge_forbidden") == 0 then
-- -- table.insert(choices, "heg_judge_forbidden")
-- -- end
-- -- if player:getMark("@@heg_hand_forbidden") == 0 then
-- -- table.insert(choices, "heg_hand_forbidden")
-- -- end
-- -- if player:getMark("@@heg_equip_forbidden") == 0 then
-- -- table.insert(choices, "heg_equip_forbidden")
-- -- end
-- -- local choice = room:askForChoice(player, choices, self.name)
-- -- room:setPlayerMark(player, "wk_heg__ziqi_forbidden", 1)
-- -- if choice == "heg_judge_forbidden" then
-- -- room:setPlayerMark(player, "wk_heg__ziqi_judge-turn", 1)
-- -- room:setPlayerMark(player, "@@heg_judge_forbidden", 1)
-- -- elseif choice == "heg_hand_forbidden" then
-- -- room:setPlayerMark(player, "wk_heg__ziqi_hand-turn", 1)
-- -- room:setPlayerMark(player, "@@heg_hand_forbidden", 1)
-- -- else
-- -- room:setPlayerMark(player, "wk_heg__ziqi_equip-turn", 1)
-- -- room:setPlayerMark(player, "@@heg_equip_forbidden", 1)
-- -- end
-- -- end,
-- -- refresh_events = {fk.TurnStart, fk.BuryVictim},
-- -- can_refresh = function (self, event, target, player, data)
-- -- return player:getMark("wk_heg__ziqi_forbidden") > 0 and target == player
-- -- end,
-- -- on_refresh = function (self, event, target, player, data)
-- -- local room = player.room
-- -- room:setPlayerMark(player, "wk_heg__ziqi_forbidden", 0)
-- -- room:setPlayerMark(player, "@@heg_judge_forbidden", 0)
-- -- room:setPlayerMark(player, "@@heg_hand_forbidden", 0)
-- -- room:setPlayerMark(player, "@@heg_equip_forbidden", 0)
-- -- room.logic:trigger("fk.RecoverRegion", player, nil)
-- -- end
-- -- }
-- -- local ziqi_trigger = fk.CreateTriggerSkill{
-- -- name = "#wk_heg__ziqi_trigger",
-- -- anim_type = "offensive",
-- -- events = {fk.Damage},
-- -- can_trigger = function (self, event, target, player, data)
-- -- return target and target == player.room.current and not H.compareKingdomWith(data.to, target) and player:usedSkillTimes(ziqi.name, Player.HistoryTurn) == 1
-- -- end,
-- -- on_cost = Util.TrueFunc,
-- -- on_use = function (self, event, target, player, data)
-- -- if player:getMark("wk_heg__ziqi_judge-turn") == 1 then
-- -- player.room:setPlayerMark(data.to, "@@heg_judge_forbidden", 1)
-- -- end
-- -- if player:getMark("wk_heg__ziqi_hand-turn") == 1 then
-- -- player.room:setPlayerMark(data.to, "@@heg_hand_forbidden", 1)
-- -- end
-- -- if player:getMark("wk_heg__ziqi_equip-turn") == 1 then
-- -- player.room:setPlayerMark(data.to, "@@heg_equip_forbidden", 1)
-- -- end
-- -- end
-- -- }
-- -- ziqi:addRelatedSkill(ziqi_trigger)
-- -- ziqi:addRelatedSkill(heg_hand_forbidden)
-- -- ziqi:addRelatedSkill(heg_judge_forbidden)
-- -- ziqi:addRelatedSkill(heg_equip_forbidden)
-- -- local xingzhang = fk.CreateTriggerSkill{
-- -- name = "wk_heg__xingzhang",
-- -- anim_type = "control",
-- -- events = {"fk.AfterCommandUse", "fk.RecoverRegion", fk.AfterDying},
-- -- frequency = Skill.Compulsory,
-- -- can_trigger = function (self, event, target, player, data)
-- -- if not (player:hasSkill(self) and player:inMyAttackRange(target)) then return false end
-- -- if event == "fk.AfterCommandUse" then
-- -- return not target:isKongcheng()
-- -- elseif event == "fk.RecoverRegion" then
-- -- return true
-- -- else
-- -- return not target.dead
-- -- end
-- -- end,
-- -- on_use = function (self, event, target, player, data)
-- -- local room = player.room
-- -- if event == "fk.AfterCommandUse" then
-- -- local card = room:askForCard(target, 1, 1, false, self.name, false)
-- -- room:moveCardTo(card, Player.Hand, player, fk.ReasonGive, self.name, nil, false, player.id)
-- -- if not target.dead then
-- -- room:recover({
-- -- who = target,
-- -- num = 1,
-- -- recoverBy = player,
-- -- skillName = self.name,
-- -- })
-- -- end
-- -- elseif event == fk.AfterDying then
-- -- local choices = {}
-- -- if target:getMark("@@heg_judge_forbidden") ~= 0 then
-- -- table.insert(choices, "heg_judge_recover")
-- -- end
-- -- if target:getMark("@@heg_hand_forbidden") ~= 0 then
-- -- table.insert(choices, "heg_hand_recover")
-- -- end
-- -- if target:getMark("@@heg_equip_forbidden") ~= 0 then
-- -- table.insert(choices, "heg_equip_recover")
-- -- end
-- -- if #choices == 0 then return false end
-- -- local choice = room:askForChoice(target, choices, self.name)
-- -- if choice == "heg_judge_forbidden" then
-- -- room:setPlayerMark(target, "@@heg_judge_forbidden", 0)
-- -- elseif choice == "heg_hand_forbidden" then
-- -- room:setPlayerMark(target, "@@heg_hand_forbidden", 0)
-- -- else
-- -- room:setPlayerMark(target, "@@heg_equip_forbidden", 0)
-- -- end
-- -- room.logic:trigger("fk.RecoverRegion", target, nil)
-- -- else
-- -- H.askCommandTo(player, target, self.name, true)
-- -- end
-- -- end,
-- -- }
-- -- lihui:addSkill(ziqi)
-- -- lihui:addSkill(xingzhang)
-- -- Fk:loadTranslationTable{
-- -- ["wk_heg__lihui"] = "李恢", --蜀国
-- -- ["wk_heg__ziqi"] = "自器",
-- -- [":wk_heg__ziqi"] = "回合开始时,你恢复所有区域;准备阶段,你可以封锁一个区域,若如此做,直至此回合结束,你对与你势力不同的角色造成伤害后,受伤角色封锁对应的区域。"..
-- -- "<font color = 'gray'>封锁:部分技能拥有封锁区域的效果,被封锁的区域内所有牌的技能无效,但原始牌面信息有效。",
-- -- ["wk_heg__xingzhang"] = "刑张",
-- -- [":wk_heg__xingzhang"] = "锁定技,你攻击范围内的角色:1.恢复区域后,你对其发起强制执行的“军令”;2.成为“军令”的目标结算后,其交给你一张手牌并回复1点体力;3.进入濒死状态被救回后,其恢复一个区域。",
-- -- ["#wk_heg__ziqi_trigger"] = "自器",
-- -- }
-- return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化