代码拉取完成,页面将自动刷新
local extension = Package:new("majiang_ciyuan")
extension.extensionName = "MahjongSoul"
extension.game_modes_blacklist = { "as_StonehengEarena_mode" }
Fk:loadTranslationTable {
["majiang_ciyuan"] = "雀魂-幻海",
["benghuai"] = "崩坏",
["bh2"] = "崩坏2",
}
local U = require "packages/utility/utility"
local xilin = General(extension, "bh2__xilin", "benghuai", 3, 3, General.Female) --此武将代码可用于教学和学习
Fk:loadTranslationTable {
["bh2__xilin"] = "西琳",
["~bh2__xilin"] = "西琳,好累....",
}
local sw_xingmeng = fk.CreateTriggerSkill { --技能name
name = "sw_xingmeng", --技能truename,用于调用和判断truename
anim_type = "control", --技能特效类型,无用
frequency = Skill.Compulsory, --技能标签,锁定技
events = { fk.EventPhaseChanging, fk.Damage, fk.EventPhaseStart, fk.Damaged, "fk.xingxieG" }, --时机表,双引号为人造时机
can_trigger = function(self, event, target, player, data) --需要达成的条件才能触发
if event == fk.EventPhaseChanging then
return player:hasSkill(self.name) and data.to == player.Start and target == player
elseif event == fk.Damage then
return data.to and not data.to.dead and data.to ~= player and data.from == player and player:hasSkill(self) and
player:getMark("@xl_xingxie") > 0 and
data.to:getMark("@xl_xingxiegive") == 0 ---U.mark为列表标记,如向其中添加东西的标记,getmark为普通标记,常规标记
elseif event == fk.EventPhaseStart then
return target:getMark("@xl_xingxiegive") ~= 0 and target.phase == Player.Start
elseif event == fk.Damaged then
return player:hasSkill(self) and data.from and not data.from.dead and data.from ~= player and target == player and
player:getMark("@xl_xingxie") > 0 and
data.from:getMark("@xl_xingxiegive") == 0 --此处用于判断来源的标记
elseif event == "fk.xingxieG" then
return target:getMark("@xl_xingxiegive") ~= 0 --人造标记,看不懂可以跳过,角色专属
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.EventPhaseChanging then
room:addPlayerMark(player, "@xl_xingxie", 2) --准备阶段给予两个标记
elseif event == fk.Damage or event == fk.Damaged then --若触发技能的效果类似,可以写在一起,比如这个
local names = {} --先列一个空表
for _, id in ipairs(Fk:getAllCardIds()) do --遍历一下已经开启的卡牌
local card = Fk:getCardById(id) --获取遍历到的卡牌的ID,也就是卡牌名字
if not card.is_derived then --排除掉指定的牌类,这里是排除掉了衍生牌,其他同理
if card.trueName ~= "peach" and card.trueName ~= "analeptic" then
table.insertIfNeed(names, card.trueName) --把最终筛选出来的牌加入到names
end
end
end
if #names > 0 then --如果names不为0,接着往下执行,否则停在这里
if room:askForSkillInvoke(player, self.name) then --虽然是锁定技,但是是锁定触发(嘻嘻),这里询问是否给予目标标记
local choice = room:askForChoice(player, names, self.name) --询问玩家从names中选择出来一个,也可以询问别人,看自己怎么用
-- local choice = room:askForChoice(player, { "basic", "trick", "equip" }, self.name) --原来是选类型的,但是太拉了,改掉改掉
if event == fk.Damage then --这里开始区分是受到伤害还是打出伤害
room:setPlayerMark(data.to, "@xl_xingxiegive", choice) --向标记中添加所选择的类型type
room:setPlayerMark(data.to, "xl_xingxiefrom", player.id) --设置一个隐藏标记,这个标记中记录了发动技能者的ID --目标标记 用from区分
room:removePlayerMark(player, "@xl_xingxie", 1) --移去玩家自己的一个指定标记
else
room:setPlayerMark(data.from, "@xl_xingxiegive", choice) --同上,不过是用来区分受到伤害的
room:setPlayerMark(data.from, "xl_xingxieto", player.id) --来源标记,用to区分
room:removePlayerMark(player, "@xl_xingxie", 1)
room.logic:trigger("fk.xingxieG", data.from, nil) --如果受到伤害的情况,触发一次人造时机,我觉得很好用
end
end
end
elseif event == fk.EventPhaseStart or event == "fk.xingxieG" then --效果一模一样,所以这里放在了一起,只不过是准备阶段和人造时机触发阶段的区别罢了
local n = 0
for _, p in ipairs(room:getAlivePlayers()) do --遍历存活的玩家持有的标记数,每有一个便+1
if p:getMark("@xl_xingxiegive") ~= 0 then
n = n + 1
end
end
local cardname = target:getMark("@xl_xingxiegive") --获取标记中记录的那张牌的ID
local puid --这里定义一个空的puid用于后续赋值一个变量 多个不同的值
-- local type = target:getMark("@xl_xingxiegive") --原来是获取类型,太垃了
local cardtype = Fk:cloneCard(cardname):getTypeString() --clone出来是虚拟卡 会被内存销毁 打印出来可是真卡 会停留在虚空区,若使用标记记录牌名,可以用到Fk:cloneCard来获取此牌的信息 --先获取标记内的type(即玩家选择的类型)
if event == fk.EventPhaseStart then --这里用于区分是准备阶段触发还是人造时机触发
puid = target:getMark("xl_xingxiefrom") --获取标记中记录的玩家id
else
puid = target:getMark("xl_xingxieto")
end
local chc = { "xx_losehp:::" .. n } --这里选项表先给一个无条件就能选的
if not room:getPlayerById(puid).dead then --此处用于判断标记中记录的id是否存活
table.insertIfNeed(chc, "xx_movecard:" .. puid .. "::" .. cardname .. ":" .. cardtype) --若西琳或技能持有者存活 添加一个选项,若没有则直接跳过
-- local ids = table.filter(target:getCardIds("h"),
-- function(id) return Fk:getCardById(id):getTypeString() == type end) --此处返回的type应该用:getTypeString()而非type
local ids = table.filter(target:getCardIds("h"),
function(id) return Fk:getCardById(id).trueName == cardname end) --这里用于寻找该玩家手中是否有你指定的牌名,若有则添加一个选项
if #ids > 0 then
table.insertIfNeed(chc, "xx_givecard:" .. puid .. "::" .. cardname) --添加!
end
end
local chs = room:askForChoice(target, chc, self.name) --所有选项已经筛选完毕,询问选择
if chs:startsWith("xx_losehp") then --这里chs:startsWith会自动获取选项中的字符串,方便!
room:loseHp(target, n, self.name)
room:setPlayerMark(target, "@xl_xingxiegive", 0)
room:setPlayerMark(target, "xl_xingxiefrom", 0)
elseif chs:startsWith("xx_movecard") then --这些行是选项效果,能看懂不记录了
-- local cards = room:getCardsFromPileByRule(".|.|.|.|.|" .. type, 2) --原来可以用..xx来代写入,真特么方便
local card1 = room:getCardsFromPileByRule(cardname, 1, "allPiles") --从所有牌堆中(仅限游戏内)查找这张牌
if #card1 == 0 then room:getPlayerById(puid):drawCards(2, self.name) end ---如果没有,一般不会没有,除非他带着你选的装备
if #card1 > 0 then --如果有,获得这张牌
room:moveCards({
ids = card1,
to = puid, --不需要.id,因为已经记录了.id了
toArea = Card.PlayerHand,
moveReason = fk.ReasonJustMove,
proposer = player.id,
skillName = self.name,
})
end
local card2 = room:getCardsFromPileByRule(".|.|.|.|.|" .. cardtype, 1, "allPiles") --附加一张同类型的牌,前面已经定义过了这张牌的类型,这个不可能没有
if #card2 > 0 then
room:moveCards({
ids = card2,
to = puid,
toArea = Card.PlayerHand,
moveReason = fk.ReasonJustMove,
proposer = player.id,
skillName = self.name,
})
end
room:setPlayerMark(target, "@xl_xingxiegive", 0) --清理标记
room:setPlayerMark(target, "xl_xingxiefrom", 0) --清理标记
else
local card = room:askForCard(target, 1, 1, false, "sw_xingmeng", false, cardname,
"#sw_xingmeng-invoke:" .. puid .. "::" .. cardname) --选择出符合标记内记录的卡牌名,既然到这了肯定是有的
if #card > 0 then
room:moveCardTo(Fk:getCardById(card[1]), Card.PlayerHand, room:getPlayerById(puid), fk.ReasonGive,
"sw_xingmeng", nil, false, target.id) --仅有一名角色且位于标记中,使用getplayerbyid确定此人的id
end
room:setPlayerMark(target, "@xl_xingxiegive", 0)
room:setPlayerMark(target, "xl_xingxiefrom", 0) --清理标记
end
end
end
}
xilin:addSkill(sw_xingmeng) --好了,做完了技能,给西琳添加上!
Fk:loadTranslationTable {
["sw_xingmeng"] = "星梦",
[":sw_xingmeng"] = "锁定技,准备阶段,获得两枚『星屑』;当你造成伤害后,如目标不为你,你选择一种牌名并交给其此牌名的『星屑』;当你受到伤害后,对伤害来源发动一次立刻执行的〖星梦〗;" ..
"有『星屑』的其他角色准备阶段选择一项:<br>1.令你获得此牌和一张同类型的牌;<br>2.交给你一张此牌;<br>3.失去全场星屑等量的体力;<br>选择完成后移去『星屑』",
["@xl_xingxie"] = "星屑",
["@xl_xingxiegive"] = "星屑",
["xx_losehp"] = "失去 %arg 点体力",
["xx_movecard"] = "令 %src 获得 %arg 和一张 %arg2 牌",
["xx_givecard"] = "交给 %src 一张%arg ",
["#sw_xingmeng-invoke"] = "星屑:交给 %src 一张%arg",
["$sw_xingmeng1"] = "西琳可不会手下留情哦~",
["$sw_xingmeng2"] = "那我就不客气啦~",
}
local sw_baozou = fk.CreateTriggerSkill {
name = "sw_baozou",
anim_type = "control",
frequency = Skill.Limited, --限定技,不多说
events = { fk.EnterDying },
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target == player and
player:usedSkillTimes(self.name, Player.HistoryGame) ==
0 --限定技,当然是一局游戏一次啦!
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = table.map(table.filter(room:getOtherPlayers(player), function(p) --寻找参与游戏的玩家中,符合条件的玩家
return not p.dead and p:getMark("@xl_xingxiegive") == 0
end), Util.IdMapper)
if #targets == 0 then return false end --如果没有,就不能发动,不会有人真的能挂满所有人的星屑吧,早被干死了
local tar = room:askForChoosePlayers(player, targets, 1, 1, "#baozou-askchosplayer", self.name, true) --筛选好了,选一个吧
if #tar > 0 then
player.room:doIndicate(player.id, tar) --这个就是单纯的画个线,告诉所有人,你选了谁,无关紧要
self.cost_data = tar
[1] --赋值一下,方便调用和跨词条使用
return true --别忘了返回true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
-- room:doSuperLightBox("packages/MahjongSoul/qml/xilinskillgif.qml") --这个就调用一下gif动画的路径
player:broadcastSkillInvoke("sw_baozou", math.random(1, 2)) --随机播放一下技能语音
-- room:delay(2200) --房间延迟,用于匹配gif动画
local n = 0
local x = 0 --x和n是用来当记录器的,方便而且也不是标记,不担心
local first = room:getPlayerById(self.cost_data) --这里准备开始循环了,先确定车头
local targets = { first } --向targets表中先添加车头
local temp = first
.next --定义一下下一位选手,也就是车头的下个人,next短,其实也可以用getNextAlive巴拉巴拉的
while temp ~= first do --开始循环,首先判定不是车头
if not temp.dead then -- 如果这个人没死,就给他塞进targets
table.insert(targets, temp)
end
temp = temp.next --然后这里已经吧temp塞进去了,所以temp就等于temp的下一个人,这样就能实现按顺序塞进去了
end
table.removeOne(targets, player) --然后把玩家自己从targets里挪出来,怎么能打自己呢是吧?
for _, id in ipairs(targets) do --开始遍历targets里的每个受害者
if not id.dead then --他要是没死,就往下线发展
local chs = { "baozou_givecard", "baozou_givebiaoji" } --让这个没死的选个选项,理论是按照初始角色依次选择的,理论...
if #id:getCardIds("h") == 0 then --这里用于摘除部分选项,比如他没牌,那他就不能选这个,虽然可以用黑色不可选代替,但是我觉得这个好
table.removeOne(chs, "baozou_givecard") --removeone,移除,不必多言
end
if id:getMark("@xl_xingxiegive") ~= 0 then
table.removeOne(chs, "baozou_givebiaoji") --同上,不过这里是判断是否有标记,不能重复上,所以只能给牌
end
if id:getMark("@xl_xingxiegive") ~= 0 and #id:getCardIds("h") == 0 then --如果他又有标记又没牌,那就纯呆逼了,呆逼不用说了,-1-1-1-1
table.insertIfNeed(chs, "baozou_changehp")
end
local chc = room:askForChoice(id, chs, self.name) --判断完他能选什么,开始问他选
if chc == "baozou_givebiaoji" then
local names = {} --这里就和一技能是一样的,不做过多解释,往下看
for _, ids in ipairs(Fk:getAllCardIds()) do
local card = Fk:getCardById(ids)
if not card.is_derived then
if card.trueName ~= "peach" and card.trueName ~= "analeptic" then
table.insertIfNeed(names, card.trueName) --把最终筛选出来的牌加入到names
end
end
end
if #names > 0 then
local choice = room:askForChoice(player, names, self.name)
room:setPlayerMark(id, "@xl_xingxiegive", choice)
room:setPlayerMark(id, "xl_xingxiefrom", player.id)
end
n = n +
1 --这里这里,n+1,虽然没什么B用,但是用于判断他和x哪个更大,更大的一方更大
elseif chc == "baozou_givecard" then
local card = room:askForCard(id, 1, 1, false, self.name, false, nil, "#baozou-choscard:" .. player.id) --他要是选了这个,那就必须给牌,不可能不给的,毕竟没牌就不会有这个选项
if #card > 0 then
room:moveCardTo(Fk:getCardById(card[1]), Card.PlayerHand, player, fk.ReasonGive,
"sw_baozou", nil, false, player.id) --这里用movecardto,我不知道另一个给牌为什么不能用,很迷惑,可能是我写错了,但是这个好用,还能加提示
end
x = x + 1 --同n,更大的就更大
else
room:changeMaxHp(id, -1) --俩选项都不能选那还能怎么办!你还要我怎么办!扣血上限,死死死
end
end
end
if x > n then --这这这 n和x的作用来了,伪装记录器(,如果有人送你的礼比你送别人礼多,那你还能回一口,希望都能让我送礼而不是送我礼,除非我没桃
room:recover({
who = player,
num = 1,
recoverBy = player,
skillName = self.name
})
end
end
}
xilin:addSkill(sw_baozou)
Fk:loadTranslationTable {
["sw_baozou"] = "暴走",
[":sw_baozou"] = "限定技,当你进入濒死状态时,你选择一名其他角色,由其开始,按逆时针顺序的所有其他角色依次选择一项:<br>1.获得一枚『星屑』;<br>2.交给你一张手牌;<br>" ..
"若有角色有『星屑』且没有手牌,其失去一点体力上限;选择完成后,若选择2的角色大于选择1的角色,你回复体力至1点",
["#baozou-askchosplayer"] = "暴走:选择一名其他角色,从其开始的所有其他角色,逆时针依次选择获得『星屑』或交给你一张牌",
["#baozou-choice"] = "暴走:为 %src 选择一个『星屑』",
["#baozou-choscard"] = "暴走:你需交给 %src 一张牌",
["baozou_givecard"] = "交出一张牌",
["baozou_givebiaoji"] = "获得『星屑』",
["baozou_changehp"] = "失去一点体力上限",
["$sw_baozou1"] = "我已经玩够啦~该请你们退场啦",
["$sw_baozou2"] = "别过来!不许过来!!",
}
local xilin_ganshe = { { "xl_cygs", Card.Spade, 6 } } --这里是为了方便获得这张牌,加个表
local sw_yineng = fk.CreateTriggerSkill {
name = "sw_yineng",
frequency = Skill.Compulsory,
mute = true, --不静音有点吵,语音有点多。。。
events = { fk.EventPhaseStart },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Start
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke("sw_yineng", math.random(1, 2))
if table.find(player:getEquipments(Card.SubtypeTreasure), function(id)
return Fk:getCardById(id).name == "xl_cygs" --这里find一下玩家的宝物区有没有这个牌,这里是判断有的,转摸牌和获得额外标记
end) then
room:addPlayerMark(player, "@xl_xingxie", 1)
player:drawCards(1)
else
local cygs = table.find(U.prepareDeriveCards(room, xilin_ganshe, "xl_cygs"), function(id) --如果没有,就找这张牌,从场外void
return room:getCardArea(id) == Card.Void
end)
if cygs then --就是定义一下,单纯的定义,如果达到了就往下执行
room:setCardMark(Fk:getCardById(cygs), MarkEnum.DestructOutMyEquip, 1) --上一个标记,离开装备栏就炸了
U.moveCardIntoEquip(room, player, cygs, self.name, true, player) --公主的Umovecard真的好用吧。用于替换装备
end
end
end,
}
xilin:addSkill(sw_yineng)
Fk:loadTranslationTable {
["sw_yineng"] = "溢能",
[":sw_yineng"] = "锁定技,准备阶段,将〖次元干涉〗置入你的装备区,若已有,则改为获得一枚『星屑』并摸一张牌。<br>" ..
"<font color='grey'>【次元干涉】♠6 装备牌·宝物<br /><b>装备技能</b>:出牌阶段限一次,你选择一名角色,从其开始的其他所有角色依次视为对自己上家使用一张【杀】," ..
"所有角色均结算完毕后,你令受到伤害的角色获得『星屑』,然后将其体力调整至发动此效果前,若没有角色因此受伤,你摸X张牌(X为存活角色数);此装备离开装备区时销毁",
["$sw_yineng1"] = "哇~在发光呢,这是什么好东西呀~",
["$sw_yineng2"] = "哇~好像有好东西呢~~",
["$sw_yineng3"] = "来再多也没有用哒~",
["$sw_yineng4"] = "你们才不会是西琳魔法的对手呢~",
}
local yuezhihu = General(extension, "bh2__yuezhihu", "benghuai", 4, 4, General.Female)
-- yuezhihu.shield = 1 -- 添加护甲
Fk:loadTranslationTable {
["bh2__yuezhihu"] = "阿尔忒尼斯",
["~bh2__yuezhihu"] = "请再相信一次..你心中所存在的仙子...",
}
local sw_zuifa = fk.CreateTriggerSkill {
name = "sw_zuifa",
frequency = Skill.Compulsory,
mute = true, --mute 静音,也就是不发动技能语音和特效
events = { fk.GamePrepared, fk.EnterDying, fk.DrawNCards, fk.EventPhaseStart, "fk.zuifaChanged" },
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end --如果虽有条件都需要某个参数,直接写没有这个的pass
if event == fk.GamePrepared then --gameprerared 特殊的时机,没发牌之前,真正的游戏开始时(?)
return true
elseif event == fk.EnterDying then
return target:getMark("@@sw_zuifa") > 0
elseif event == fk.DrawNCards then
return target:getMark("@@sw_zuifa") > 0
elseif event == fk.EventPhaseStart then
return target.phase == Player.Finish and target ~= player and target:getMark("@@sw_zuifa") > 0
else
return data.name == "@@sw_zuifa" and data.num < 0 --人造时机的返回值,自己写就行了
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.GamePrepared then
local zuifa --设定一个空的变量
for _, p in ipairs(room.alive_players) do --遍历一下
if p ~= player and p.seat == 1 then --由于是开局就上,而且是上给一号位
zuifa = p --给zuifa赋值,值等于遍历出来的角色
room:setPlayerMark(zuifa, "@@sw_zuifa", 1)
elseif p == player and p.seat == 1 then --排除玩家,为了获取玩家下家
zuifa = p:getNextAlive() --fix一下zuifa
room:setPlayerMark(zuifa, "@@sw_zuifa", 1)
end
end
-- room.logic:trigger("fk.zuifaChanged", target, { name = "@@sw_zuifa", num = -1 }) --触发人造时机,需要手动调用
player:broadcastSkillInvoke("sw_zuifa", math.random(3, 4)) --播放技能语音
room:notifySkillInvoked(player, "sw_zuifa", "control") --播放技能特效
elseif event == fk.EnterDying then
player:broadcastSkillInvoke("sw_zuifa", math.random(1, 2))
room:notifySkillInvoked(player, "sw_zuifa", "control")
room:removePlayerMark(target, "@@sw_zuifa")
room.logic:trigger("fk.zuifaChanged", target, { name = "@@sw_zuifa", num = -1 })
local next = target:getNextAlive() --定义next为下家
if next == player then
next = player:getNextAlive() --排除玩家,如果目标是玩家,那就是玩家的下家
end
if next:getMark("@@sw_zuifa") ~= 0 then
next = next:getNextAlive()
end
room:addPlayerMark(next, "@@sw_zuifa")
elseif event == fk.DrawNCards then
data.n = data.n + 1 --摸牌+1
player:broadcastSkillInvoke("sw_zuifa", math.random(1, 2))
room:notifySkillInvoked(player, "sw_zuifa", "control")
elseif event == fk.EventPhaseStart then
-- room:damage { --不写from就是没有来源
-- to = target,
-- damage = 1,
-- damageType = fk.ThunderDamage,
-- skillName = self.name,
-- }
room:removePlayerMark(target, "@@sw_zuifa")
room.logic:trigger("fk.zuifaChanged", target, { name = "@@sw_zuifa", num = -1 })
local next = target:getNextAlive()
if next == player then
next = player:getNextAlive()
end
if next:getMark("@@sw_zuifa") ~= 0 then
next = next:getNextAlive()
if next == player then
return
end
end
room:addPlayerMark(next, "@@sw_zuifa")
else
player:drawCards(1) --摸一张,理论上不写self.name也是可以的
end
end
}
local sw_zuifa_maxcards = fk.CreateMaxCardsSkill {
name = "#sw_zuifa_maxcards",
correct_func = function(self, player)
if player:getMark("@@sw_zuifa") > 0 then --正常的增加减少手牌上限的技能
return -1
else
return 0
end
end,
}
sw_zuifa:addRelatedSkill(sw_zuifa_maxcards)
yuezhihu:addSkill(sw_zuifa)
Fk:loadTranslationTable {
["sw_zuifa"] = "罪罚",
[":sw_zuifa"] = "锁定技,①游戏开始时,除你外最前置的角色获得『罪罚』;<br>②有『罪罚』的角色濒死时,将『罪罚』向除你外的下家移动;<br>" ..
"③拥有『罪罚』的角色摸牌阶段多摸一张牌,手牌上限-1,其准备阶段,将『罪罚』向除你外的下家移动;<br>④当『罪罚』移动时,你摸一张牌。<br>",
["@@sw_zuifa"] = "罪罚",
["$sw_zuifa1"] = "我要喊人了!",
["$sw_zuifa2"] = "你这傻瓜!",
["$sw_zuifa3"] = "讨厌你们!",
["$sw_zuifa4"] = "呸呸呸!",
}
local sw_hunshou = fk.CreateTriggerSkill {
name = "sw_hunshou",
anim_type = "offensive",
events = { fk.Damage, fk.EnterDying, fk.DamageCaused },
can_trigger = function(self, event, target, player, data)
if event == fk.Damage then
return target == player and player:hasSkill(self) and data.damage > 1 --data.damage是伤害数据
elseif event == fk.EnterDying then
return data.damage and data.damage.damage > 1 and data.damage.from and player:hasSkill(self) and
data.damage.from == player and target ~= player --这里判定一下濒死的人和令其濒死的人
else
return player:hasSkill(self) and data.from == player and data.from:getMark("@sw_yueji") > 0 -- data.from判断来源
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.Damage then
return player.room:askForSkillInvoke(player, self.name, nil, "#sw_hunshou-askplayer")
else
return true --默认发动就填写true或者不需要on_cost
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local n = 0
for _, p in ipairs(room.alive_players) do
n = n + p:getMark("@@sw_zuifa") -- 遍历全场的标记数量
end
if event == fk.Damage then
if n < #room.alive_players then
local tos = room:askForChoosePlayers(player, table.map(player.room.alive_players,
function(p) return p:getMark("@@sw_zuifa") == 0 and p.id end), 1, 1, --这里选择出符合条件的人,也就是头上没有标记的人
"#sw_hunshou-choose", self.name, true, false)
if #tos > 0 then
room:setPlayerMark(room:getPlayerById(tos[1]), "@@sw_zuifa", 1)
room:setPlayerMark(room:getPlayerById(tos[1]), "sw_zuifaaddmark-turn", 1)
room.logic:trigger("fk.zuifaChanged", target, { name = "@@sw_zuifa", num = -1 }) --手动触发人造时机
end
end
local to = player.room:askForChoosePlayers(player, table.map(player.room.alive_players,
function(p) return p:getMark("@@sw_zuifa") > 0 and p:getMark("sw_zuifaaddmark-turn") == 0 and p.id end), 1, 1, --移除一个,一样的,先找目标,不用targets了,直接写进来,因为不需要多判
"#sw_hunshou-chose", self.name, true)
if #to > 0 then
room:setPlayerMark(room:getPlayerById(to[1]), "@@sw_zuifa", 0)
room.logic:trigger("fk.zuifaChanged", target, { name = "@@sw_zuifa", num = -1 })
end
elseif event == fk.EnterDying then
player:drawCards(n)
else
data.damage = data.damage + data.from:getMark("@sw_yueji") --这是觉醒技里的附加技能,不想给觉醒技写trigger,就给觉醒技加到这吧
end
end,
}
yuezhihu:addSkill(sw_hunshou)
Fk:loadTranslationTable {
["sw_hunshou"] = "魂狩",
[":sw_hunshou"] = "当你造成伤害后,若此伤害大于1,你可以令一名没有『罪罚』的角色获得『罪罚』,然后你可以移去一枚不因此获得的『罪罚』;当你造成大于1的伤害致其他角色进入濒死时,你摸X张牌(X为全场『罪罚』数)。<br>",
["#sw_hunshou-askplayer"] = "魂狩:是否发动〖魂狩〗,增加或移去『罪罚』",
["#sw_hunshou-choose"] = "魂狩:选择一名其他角色,令其获得『罪罚』",
["#sw_hunshou-chose"] = "魂狩:选择一名其他角色,移去其『罪罚』",
["$sw_hunshou1"] = "真正的敌人,是不断长大的自己才对",
["$sw_hunshou2"] = "永无岛的敌人,用不着彼得出手",
["$sw_hunshou3"] = "飞到天上去吧,前往童真的国度",
["$sw_hunshou4"] = "这戏服..太大胆了...",
}
local sw_yueji = fk.CreateActiveSkill {
name = "sw_yueji",
prompt = "#sw_yueji-active",
card_num = 0,
target_num = 0,
frequency = Skill.Limited,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
card_filter = Util.FalseFunc,
on_use = function(self, room, effect)
-- room:doSuperLightBox("packages/MahjongSoul/qml/yuezhihugif.qml") --播放一下gif动画,要提前做gif
room:getPlayerById(effect.from):broadcastSkillInvoke("sw_yueji", math.random(1, 2))
-- room:delay(2400)
local n = 0
for _, p in ipairs(room.alive_players) do
n = n + p:getMark("@@sw_zuifa")
end
room:changeMaxHp(room:getPlayerById(effect.from), -1)
room:setPlayerMark(room:getPlayerById(effect.from), "@sw_yueji", n)
for _, p in ipairs(room:getAlivePlayers()) do
if p:getMark("@@sw_zuifa") > 0 then
room:setPlayerMark(p, "@@sw_zuifa", 0)
end
end
for i = 1, n, 1 do --场上有几个标记就触发几次,毕竟每个标记的移出,理论都算一次标记移动
room.logic:trigger("fk.zuifaChanged", room:getPlayerById(effect.from), { name = "@@sw_zuifa", num = -1 })
end
end,
}
yuezhihu:addSkill(sw_yueji)
Fk:loadTranslationTable {
["sw_yueji"] = "月祭",
[":sw_yueji"] = "限定技,出牌阶段,你可以减去一点体力上限,为〖魂狩〗增加造成的伤害+X效果,然后移去所有『罪罚』(X为场上的『罪罚』数)。",
["@sw_yueji"] = "月祭",
["#sw_yueji-active"] = "月祭:你可以减去一点体力上限,为〖魂狩〗增加造成的伤害+X效果,然后移去所有『罪罚』,X为场上的『罪罚』数",
["$sw_yueji1"] = "我真想马上告诉大家你找到的好东西",
["$sw_yueji2"] = "这个,可以当永无岛的藏品吗?",
}
local jiuxiao = General(extension, "bh2__jiuxiao", "benghuai", 5, 5, General.Female)
Fk:loadTranslationTable {
["bh2__jiuxiao"] = "九霄",
["~bh2__jiuxiao"] = "死亡...是新生轮回的开端...",
}
local sw_zhuhuo = fk.CreateTriggerSkill {
name = "sw_zhuhuo",
anim_type = "defensive",
events = { fk.GameStart, fk.AfterCardsMove },
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
local room = player.room
if not player:hasSkill(self) then return false end
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
self.cost_data = {} --创建一个空表
if player.phase == Player.NotActive and move.toArea == Card.DiscardPile and move.moveReason ~= fk.ReasonUse and move.from then --要素:有来源,目标是弃牌堆,玩家的空闲时间,不因为使用
for _, info in ipairs(move.moveInfo) do
if Fk:getCardById(info.cardId, true).trueName == "zhuhuo_jiuxiao" then --如果牌名一样,加进表
table.insertIfNeed(self.cost_data, info.cardId)
end --这里不着急返回,不然就只能拿到同时进去的第一张
end
if #self.cost_data > 0 then
return true --嗯嗯这里才是正确的返回时间!
end
elseif move.moveReason == fk.ReasonJudge then
local judge_event = room.logic:getCurrentEvent():findParent(GameEvent.Judge)
if judge_event and judge_event.data[1].who ~= player then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.Processing and Fk:getCardById(info.cardId, true).trueName == "zhuhuo_jiuxiao" and --这是另一种方式的移动,因为判定,虽然没必要写,但是既然描述写了,那还是写吧····
room:getCardArea(info.cardId) == Card.DiscardPile then
table.insertIfNeed(self.cost_data, info.cardId)
end
end
end
if #self.cost_data > 0 then
return true --.....
end
end
end
else
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
if player:getMark("@jx_chongneng") == 0 then
room:setPlayerMark(player, "@jx_chongneng", zsbfb(8)) --?
elseif player:getMark("@jx_chongneng") ~= 0 then
local num1 = tonumber(string.sub(player:getMark("@jx_chongneng"), 1, -2))
room:setPlayerMark(player, "@jx_chongneng", zsbfb(num1 + 8)) --看不懂,过,下次不许这么写了,整点看得懂的
end --哦!补充,这是函数,自己写的自己忘了,鼠标放上去看看,zsbfb是汉语拼音缩写的整数百分比。。。。
local dummy = Fk:cloneCard("dilu") --变个魔术,的卢马!
dummy:addSubcards(self.cost_data)
room:obtainCard(player.id, dummy, true, fk.ReasonJustMove) --OBTAIN!!!!!!!
else
local name =
"zhuhuo_jiuxiao" --?这是什么定义
local tianzuo_derivecards = { { name, Card.Heart, 1 }, { name, Card.Heart, 2 }, { name, Card.Heart, 3 }, { name, Card.Heart, 4 },
{ name, Card.Heart, 5 }, { name, Card.Heart, 6 }, { name, Card.Heart, 7 }, { name, Card.Heart, 8 }, { name, Card.Heart, 9 },
{ name, Card.Heart, 10 }, { name, Card.Heart, 11 }, { name, Card.Heart, 12 }, { name, Card.Heart, 13 } } --明明可以单独设置一个表,算了,写都写了 下次一定
for _, id in ipairs(U.prepareDeriveCards(room, tianzuo_derivecards, "zhuhuo_derivecards")) do
if room:getCardArea(id) == Card.Void then
table.removeOne(room.void, id)
table.insert(room.draw_pile, math.random(1, #room.draw_pile), id)
room:setCardArea(id, Card.DrawPile, nil) --其实这里不太明白,我抄的哈哈哈,如果想研究可以看看手杀必胜客
end
end
room:doBroadcastNotify("UpdateDrawPile", tostring(#room.draw_pile)) --这里也是,看不懂,不学不看不爱看
end
end,
}
jiuxiao:addSkill(sw_zhuhuo)
Fk:loadTranslationTable {
["sw_zhuhuo"] = "逐火",
[":sw_zhuhuo"] = "锁定技,游戏开始时,向牌堆洗入13张【逐火之蛾】;当有【逐火之蛾】于你的回合外不因拼点进入弃牌堆时,你获得8%充能并获得此牌",
["$sw_zhuhuo1"] = "混沌,已经降临!",
["$sw_zhuhuo2"] = "黑暗,无法消散!",
}
local sw_zhongyant = fk.CreateTriggerSkill {
name = "sw_zhongyant",
anim_type = "negative",
frequency = Skill.Compulsory,
events = { fk.EventPhaseChanging, fk.AfterCardsMove },
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if event == fk.EventPhaseChanging then
return target == player and data.to == Player.Start and
player:getMark("zy_yfd") == 0
else
if player:usedSkillTimes("sw_benghuai", Player.HistoryGame) == 0 then
local weapons = { "zy_zhongpao", "zy_jujian", "zy_shuangbi" } --三把武器整装列队!!
for _, move in ipairs(data) do
self.cost_data = {} --同上技能,一样的
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if table.contains(weapons, Fk:getCardById(info.cardId).trueName) then --这张卡的真名如果在列队里,那就把他塞进表里
table.insertIfNeed(self.cost_data, info.cardId)
end
end
end
if #self.cost_data > 0 then
return true
end
end
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local weapons = { "zy_zhongpao", "zy_jujian", "zy_shuangbi" }
if event == fk.EventPhaseChanging then
local pile = table.connect(room.void) --从场外拿,因为这张卡塞进牌堆不知道为什么会被AI玩坏
local cards = {}
for _, id in ipairs(pile) do
if table.contains(weapons, Fk:getCardById(id).name) then
table.insertIfNeed(cards, id)
end
end
player:addToPile("zy_zhongyan", cards, true, self.name)
if target:getMark("@jx_chongneng") == 0 then
room:setPlayerMark(target, "@jx_chongneng", zsbfb(120))
elseif target:getMark("@jx_chongneng") ~= 0 then
local num1 = tonumber(string.sub(target:getMark("@jx_chongneng"), 1, -2))
room:setPlayerMark(target, "@jx_chongneng", zsbfb(num1 + 120))
end
room:setPlayerMark(target, "zy_yfd", 1)
else
player:addToPile("zy_zhongyan", self.cost_data, true, self.name) --触发就直接放到头上
end
end,
}
jiuxiao:addSkill(sw_zhongyant)
Fk:loadTranslationTable {
["sw_zhongyant"] = "终焉",
[":sw_zhongyant"] = "锁定技,你的首个回合开始时,将三张〔终焉神兵〕置于你的武将牌上,获得120%充能;当〔终焉神兵〕进入弃牌堆时,将其置于你的武将牌上",
["@jx_chongneng"] = "充能",
["zy_zhongyan"] = "终焉神兵",
["$sw_zhongyant1"] = "至红之光,正在召唤着我!",
["$sw_zhongyant2"] = "深埋于远古的灾厄之力觉醒啦~",
}
local sw_linjie = fk.CreateActiveSkill {
name = "sw_linjie",
prompt = "#sw_linjie-active",
card_num = 0,
target_num = 0,
can_use = function(self, player)
return #player:getPile("zy_zhongyan") ~= 0 and player:usedSkillTimes(self.name, Player.HistoryPhase) < 3
end,
card_filter = Util.FalseFunc,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:fillAG(player, player:getPile("zy_zhongyan"))
local ids = room:askForAG(player, player:getPile("zy_zhongyan"), false, self.name)
U.moveCardIntoEquip(room, player, ids, self.name, true, player)
room:closeAG(player) --打开AG 选卡 然后关闭AG,必须要关闭,不然卡脸
end,
}
jiuxiao:addSkill(sw_linjie)
Fk:loadTranslationTable {
["sw_linjie"] = "临界",
[":sw_linjie"] = "出牌阶段限三次,你可以切换你的〔终焉神兵〕",
["#sw_linjie-active"] = "临界:你可以切换你的〔终焉神兵〕",
["$sw_linjie1"] = "终于窥视到了世界的真理!",
["$sw_linjie2"] = "救世主降临!",
}
local sw_benghuai = fk.CreateTriggerSkill {
name = "sw_benghuai",
anim_type = "negative",
frequency = Skill.Wake,
events = { fk.EventPhaseStart },
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
return target == player and player.phase == Player.Start and #player:getPile("zy_zhongyan") ~= 0 and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
can_wake = function(self, event, target, player, data)
local n = tonumber(string.sub(player:getMark("@jx_chongneng"), 1, -2))
return n >= 200 --233
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:moveCards({
from = player.id,
ids = player:getPile("zy_zhongyan"),
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
skillName = self.name,
})
room:handleAddLoseSkills(player, "zy_zp_ex|zy_jj_ex|zy_sb_ex") --.....emmm,一直以为只能一个一个一个加
room:handleAddLoseSkills(player, "-sw_linjie")
end,
}
jiuxiao:addSkill(sw_benghuai)
jiuxiao:addRelatedSkill("zy_zp_ex")
jiuxiao:addRelatedSkill("zy_jj_ex")
jiuxiao:addRelatedSkill("zy_sb_ex")
Fk:loadTranslationTable {
["sw_benghuai"] = "崩坏",
[":sw_benghuai"] = "觉醒技,准备阶段开始时,若你的武器充能不小于200%,你减去一点体力上限,将所有〔终焉神兵〕〖超限〗并赋予自身(赋予技能仅九霄可用)",
["$sw_benghuai1"] = "向着新世界,进发!",
["$sw_benghuai2"] = "这个世界~需要新的救世主!",
}
local zy_zp_ex = fk.CreateTriggerSkill { --以下三个技能,是武器技能的独立版,为的就是为了防止获取武器技能时出现问题,而且直接升级武器很麻烦,不如直接单独写技能出来
name = "zy_zp_ex",
events = { fk.DamageCaused },
can_trigger = function(self, event, target, player, data)
local n = tonumber(string.sub(player:getMark("@jx_chongneng"), 1, -2))
return target == player and player:hasSkill(self) and n > 24 and
(player.general == "bh2__jiuxiao" or player.deputyGeneral == "bh2__jiuxiao")
end,
on_cost = function(self, event, target, player, data)
local n = 0
for _, p in ipairs(player.room.alive_players) do
if player:inMyAttackRange(p) then
n = n + 1
end
end
return player.room:askForSkillInvoke(player, self.name, nil, "#zpex-invoke:::" .. n)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local num1 = tonumber(string.sub(target:getMark("@jx_chongneng"), 1, -2))
if num1 >= 26 then
room:setPlayerMark(target, "@jx_chongneng", zsbfb(num1 - 25))
else
room:setPlayerMark(target, "@jx_chongneng", 0)
end
local tar = data.to
local n = 0
for _, p in ipairs(room.alive_players) do
if player:inMyAttackRange(p) then
n = n + 1
end
end
if #tar:getCardIds(player.Hand) > n then
room:askForDiscard(tar, n, n, false, self.name, false, nil, "#zpex_dis-ask:::" .. n)
else
tar:throwAllCards("h")
room:addPlayerMark(tar, "@zp_juli-", 1)
end
room:addPlayerMark(tar, "@zp_juli-", 1)
end
}
local zy_zp_ex_attackrange = fk.CreateAttackRangeSkill {
name = "#zy_zp_ex_attackrange",
correct_func = function(self, from, to)
if from:getMark("@zp_juli-") > 0 then
return -from:getMark("@zp_juli-")
end
end,
}
zy_zp_ex:addRelatedSkill(zy_zp_ex_attackrange)
Fk:addSkill(zy_zp_ex)
Fk:loadTranslationTable {
["zy_zp_ex"] = "重炮",
[":zy_zp_ex"] = "当你对其他角色造成伤害时,你可以消耗25%充能,令其弃置X张手牌并使攻击距离-1,若不足,弃置所有手牌,改为-2(X为你攻击范围内的角色数)",
["#zpex-invoke"] = "重炮:是否令其弃置%arg张手牌并使其攻击距离-1",
["#zpex_dis-ask"] = "重炮:弃置%arg张手牌",
["$zy_zp_ex_bh2__jiuxiao1"] = "这个腐朽的世界,需要我来拯救!",
}
local zy_sb_ex = fk.CreateTriggerSkill {
name = "zy_sb_ex",
events = { fk.TargetSpecified },
can_trigger = function(self, event, target, player, data)
local n = tonumber(string.sub(player:getMark("@jx_chongneng"), 1, -2))
return player:hasSkill(self) and data.card and n > 24 and target == player and data.card.trueName == "slash" and
player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and
(player.general == "bh2__jiuxiao" or player.deputyGeneral == "bh2__jiuxiao")
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#shuangbiex-invoke")
end,
on_use = function(self, event, target, player, data)
local room = player.room
local num1 = tonumber(string.sub(target:getMark("@jx_chongneng"), 1, -2))
if num1 >= 26 then
room:setPlayerMark(target, "@jx_chongneng", zsbfb(num1 - 25))
else
room:setPlayerMark(target, "@jx_chongneng", 0)
end
local use = {
from = player.id,
tos = { { data.to } },
card = Fk:cloneCard("thunder__slash"),
extraUse = true,
}
use.card.skillName = self.name
room:useCard(use)
if use.damageDealt then
for _, p in ipairs(room.players) do
if use.damageDealt[p.id] then
if p:getMark("@@shuangbi_jl-round") == 0 then
room:setPlayerMark(p, "@@shuangbi_jl-round", 1)
end
end
end
end
local use1 = {
from = player.id,
tos = { { data.to } },
card = Fk:cloneCard("fire__slash"),
extraUse = true,
}
use1.card.skillName = self.name
room:useCard(use1)
if use1.damageDealt then
for _, p in ipairs(room.players) do
if use1.damageDealt[p.id] then
if p:getMark("@@shuangbi_jl-round") == 0 then
room:setPlayerMark(p, "@@shuangbi_jl-round", 1)
end
end
end
end
end,
refresh_events = { fk.PreHpRecover },
can_refresh = function(self, event, target, player, data)
return target:getMark("@@shuangbi_jl-round") > 0
end,
on_refresh = function(self, event, target, player, data)
data.num = 0
end
}
Fk:addSkill(zy_sb_ex)
Fk:loadTranslationTable {
["zy_sb_ex"] = "双匕",
[":zy_sb_ex"] = "每阶段限一次,当你使用【杀】指定目标后,你可以消耗25%充能,视为对其使用一张雷【杀】和一张火【杀】,若造成伤害,其本轮无法回复体力",
["@@shuangbi_jl-round"] = "禁疗",
["#shuangbiex-invoke"] = "双匕:是否对其追加雷【杀】和火【杀】,若造成伤害对其附加禁疗效果",
["$zy_sb_ex_bh2__jiuxiao1"] = "淹没于深暗幻想之中吧!",
}
local zy_jj_ex = fk.CreateTriggerSkill {
name = "zy_jj_ex",
events = { fk.DamageInflicted },
can_trigger = function(self, event, target, player, data)
local n = tonumber(string.sub(player:getMark("@jx_chongneng"), 1, -2))
return player:hasSkill(self.name) and target == player and data.from and data.from ~= player and n > 29 and
player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 and
(player.general == "bh2__jiuxiao" or player.deputyGeneral == "bh2__jiuxiao")
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#jujianex-invoke:" .. data.from.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local num1 = tonumber(string.sub(target:getMark("@jx_chongneng"), 1, -2))
if num1 >= 31 then
room:setPlayerMark(target, "@jx_chongneng", zsbfb(num1 - 30))
else
room:setPlayerMark(target, "@jx_chongneng", 0)
end
data.damage = data.damage - data.damage
local use = {
from = player.id,
tos = { { data.from.id } },
card = Fk:cloneCard("slash"),
extraUse = true,
}
use.card.skillName = self.name
room:useCard(use)
end,
refresh_events = { fk.DamageCaused },
can_refresh = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
return data.from == player and data.card and data.card.trueName == "slash" and
table.contains(data.card.skillNames, self.name)
end,
on_refresh = function(self, event, target, player, data)
data.damage = data.damage + 2
end,
}
Fk:addSkill(zy_jj_ex)
Fk:loadTranslationTable {
["zy_jj_ex"] = "巨剑",
[":zy_jj_ex"] = "每回合限一次,当你受到伤害时,你可以消耗30%充能,防止此伤害并视为对伤害来源使用一张伤害+2的【杀】",
["#jujianex-invoke"] = "巨剑:防止此伤害,对 %src 使用一张伤害+2的【杀】",
["$zy_jj_ex_bh2__jiuxiao1"] = "审判的时刻到了!",
}
local yyqyn = General(extension, "bh2__yyqyn", "benghuai", 6, 6, General.Female)
Fk:loadTranslationTable {
["bh2__yyqyn"] = "芽衣琪亚娜",
}
local cymy = { { "qyn_cymy", Card.Diamond, 5 } }
local ydjm = { { "yy_ydjm", Card.Club, 5 } }
local sw_biyi = fk.CreateTriggerSkill {
name = "sw_biyi",
events = { fk.EventPhaseChanging },
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self.name) and data.to == Player.Start
end,
on_use = function(self, event, target, player, data)
local room = player.room
local choice = { "bh2__qiyana", "bh2__yayi" } --变变变!
local heixin = room:askForChoice(player, choice, self.name)
if heixin == "bh2__yayi" then
local n = player.hp - 4 --这里是为了控制血量,和下面琪亚娜一样的
player:drawCards(n, self.name)
if player.hp > 4 then
room:changeHp(player, -n)
end
if player.maxHp > 4 then
room:changeMaxHp(player, -(player.maxHp - 4)) --血量多退少补,虽然感觉方法很笨,但是很稳定
end
local jimie = table.find(U.prepareDeriveCards(room, ydjm, "yy_ydjm"), function(id)
return room:getCardArea(id) == Card.Void --把老子的刀拿来!
end)
if jimie then
room:setCardMark(Fk:getCardById(jimie), MarkEnum.DestructOutMyEquip, 1) --打上花火,离开武器区直接报废
U.moveCardIntoEquip(room, player, jimie, self.name, true, player)
end
room:setPlayerMark(player, "@qiyana_MaxHPandHP", { 3, 3 }) --这里设置一下琪亚娜的血量,看似很难的技能,其实就这么简单,因为琪亚娜只能是3血,这就是我为什么不做主公单独适配+1血量的问题,很麻烦,不想作
room:handleAddLoseSkills(player, "-sw_biyi") --删掉技能,防止死灰复燃,狠狠dis一下管宁,SB
else
local x = player.hp - 3
player:drawCards(x, self.name)
if player.hp > 3 then
room:changeHp(player, -x)
end
if player.maxHp > 3 then
room:changeMaxHp(player, -(player.maxHp - 3))
end
local chaoyue = table.find(U.prepareDeriveCards(room, cymy, "qyn_cymy"), function(id)
return room:getCardArea(id) == Card.Void
end)
if chaoyue then
room:setCardMark(Fk:getCardById(chaoyue), MarkEnum.DestructOutMyEquip, 1)
U.moveCardIntoEquip(room, player, chaoyue, self.name, true, player)
end
room:setPlayerMark(player, "@yayi_MaxHPandHP", { 4, 4 })
room:handleAddLoseSkills(player, "-sw_biyi")
end
room:changeHero(player, heixin, false, false, true, false) ---执行完技能再变身,防止猝死
end,
}
yyqyn:addSkill(sw_biyi)
Fk:loadTranslationTable {
["sw_biyi"] = "比翼",
[":sw_biyi"] = "锁定技,准备阶段,选择〖琪亚娜〗或〖芽衣〗替换你的武将牌,将专属武器置入武器栏并摸多余体力的牌;〖琪亚娜〗和〖芽衣〗的体力独立计算;" ..
"专属武器离开装备栏销毁,切换角色时自动装备",
["@qiyana_MaxHPandHP"] = "琪亚娜",
["@yayi_MaxHPandHP"] = "芽衣",
}
local qiyana = General(extension, "bh2__qiyana", "benghuai", 3, 3, General.Female)
qiyana.hidden = true --隐身,防止被选到
Fk:loadTranslationTable {
["bh2__qiyana"] = "琪亚娜",
}
local sw_xingdan = fk.CreateTriggerSkill {
name = "sw_xingdan",
anim_type = "control",
frequency = Skill.Compulsory,
events = { fk.TargetSpecifying },
can_trigger = function(self, event, target, player, data)
if target == player then
if player:getMark("xingdan_yichu") == 0 then
return player:hasSkill(self) and not player.dead and data.card and data.card.is_damage_card and
data.card.type ~= Card.TypeEquip and
data.card.sub_type ~= Card.SubtypeDelayedTrick and
table.find(TargetGroup:getRealTargets(data.tos),
function(id)
return id ~= player.id and not player.room:getPlayerById(id).dead and
player.room:getPlayerById(id):getMark("@ydjm_mieque") ~= 0
end) --又臭又长,但是少些一个就是报错
else
return player:hasSkill(self) and not player.dead and data.card and data.card.is_damage_card and
data.card.type ~= Card.TypeEquip and
data.card.sub_type ~= Card.SubtypeDelayedTrick --限定技发动后,移除了很多条件限制了
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if player:getMark("xingdan_yichu") == 0 then
local targets = TargetGroup:getRealTargets(data.tos) --给targets定义一下所有目标
for _, id in ipairs(targets) do
target = room:getPlayerById(id)
if target:getMark("@ydjm_mieque") > 0 then --目标里有这个标记的不能响应
room:removePlayerMark(target, "@ydjm_mieque", 1)
data.disresponsive = true
end
end
else
data.disresponsive = true --觉醒后跳过一下条件
end
end,
}
local sw_xingdan_tar = fk.CreateTriggerSkill {
name = "#sw_xingdan_tar",
frequency = Skill.Compulsory,
events = { fk.EventPhaseStart },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Start and
player:getMark("xingdan_yichu") == 0 --这里这个yichu是限定技的效果,也就是没有发动才有的这个效果
end,
on_use = function(self, event, target, player, data)
local room = player.room
if table.find(player:getEquipments(Card.SubtypeWeapon), function(id)
return Fk:getCardById(id).name ==
"qyn_cymy" --让我看看武器栏有没有手枪
end) then
local cards1 = {}
for _, id in ipairs(room.draw_pile) do
if Fk:getCardById(id).is_damage_card then
table.insertIfNeed(cards1, id) --好 有 拿拿牌
end
end
if #cards1 > 0 then
local card = table.random(cards1)
room:moveCards({
ids = { card },
to = player.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonJustMove,
proposer = player.id,
skillName = self.name,
})
end
else
local chaoyue = table.find(U.prepareDeriveCards(room, cymy, "qyn_cymy"), function(id)
return room:getCardArea(id) == Card.Void --好,没有,拿枪
end)
if chaoyue then
room:setCardMark(Fk:getCardById(chaoyue), MarkEnum.DestructOutMyEquip, 1)
U.moveCardIntoEquip(room, player, chaoyue, self.name, true, player)
end
end
end,
}
sw_xingdan:addRelatedSkill(sw_xingdan_tar)
qiyana:addSkill(sw_xingdan)
Fk:loadTranslationTable {
["sw_xingdan"] = "星弹",
["#sw_xingdan_tar"] = "星弹",
[":sw_xingdan"] = "锁定技,当你使用伤害类牌指定目标时,若其有『灭却』,你移去其一层『灭却』,令其无法响应此牌;准备阶段,将【超越·命运】置入你的装备区,若已有则改为获得一张伤害牌",
}
local sw_lianjiqyn = fk.CreateActiveSkill {
name = "sw_lianjiqyn",
prompt = "#sw_lianjiqyn-active",
card_num = 0,
target_num = 1,
can_use = function(self, player)
return player:getMark("@yayi_MaxHPandHP") ~= 0 --判定芽衣还在不在了
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected, selected_cards)
return #selected == 0 and to_select ~= Self.id and
Fk:currentRoom():getPlayerById(to_select):getMark("@cymy_suming") > 0 --这个技能很有意思
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
if target:getMark("@!lianji_yy") ~= 0 then --这里是角标,需要单独给贴图素材,如果有标记就锤他一下
room:damage {
from = player,
to = target,
damage = 1,
damageType = fk.ThunderDamage,
skillName = self.name,
}
room:setPlayerMark(target, "@!lianji_yy", 0)
end
if target:getMark("@ydjm_mieque") > 0 then --这里是移除灭灭却标记,摸牌的
local n = target:getMark("@ydjm_mieque")
room:setPlayerMark(target, "@ydjm_mieque", 0)
player:drawCards(n, self.name)
end
room:setPlayerMark(player, "@qiyana_MaxHPandHP", { player.hp, player.maxHp }) --这里开始变身前的准备,先把琪亚娜当前的血和上限记录在mark内
local mark = player:getTableMark("@yayi_MaxHPandHP")
local hp = mark[1]
local maxhp = mark[2]
if player.maxHp ~= maxhp then --看似是变身的,血条一起变,实际上就是扭,通过标记记录的血量来增减
if player.maxHp > maxhp then
room:changeMaxHp(player, -(player.maxHp - maxhp))
elseif player.maxHp < maxhp then
room:changeMaxHp(player, maxhp - player.maxHp) --这里是变上限的,三窟:你最好有事
end
end
if player.hp ~= hp then
if player.hp > hp then
room:changeHp(player, -(player.hp - hp)) --这里是直接改变血量,不会触发回血类技能,正如我想
elseif player.hp < hp then
room:changeHp(player, hp - player.hp)
end
end
room:setPlayerMark(player, "@yayi_MaxHPandHP", 0) --然后先清除一下芽衣的标记,变身了,要换琪亚娜了
room:changeHero(player, "bh2__yayi", false, false, true, false)
local jimie = table.find(U.prepareDeriveCards(room, ydjm, "yy_ydjm"), function(id)
return room:getCardArea(id) == Card.Void --把老子的刀提来!
end)
if jimie then
room:setCardMark(Fk:getCardById(jimie), MarkEnum.DestructOutMyEquip, 1) --给刀打上火花
U.moveCardIntoEquip(room, player, jimie, self.name, true, player)
end
end,
}
qiyana:addSkill(sw_lianjiqyn)
Fk:loadTranslationTable {
["sw_lianjiqyn"] = "联击",
[":sw_lianjiqyn"] = "出牌阶段,你可以选择一名有『宿命』的角色,然后移去其所有『灭却』并摸等量的牌,若其被〖芽衣〗标记,则额外对其造成一点雷电伤害并清除标记,然后切换至〖芽衣〗",
["#sw_lianjiqyn-active"] = "联击:选择一名有『宿命』的角色,若其被〖芽衣〗标记,对其造成一点雷电伤害,然后切换至〖芽衣〗",
}
local sw_tonggan = fk.CreateTriggerSkill {
name = "sw_tonggan",
anim_type = "defensive",
frequency = Skill.Limited,
events = { fk.DamageInflicted },
can_trigger = function(self, event, target, player, data)
local mark = player:getTableMark("@yayi_MaxHPandHP")
local hp = mark[1]
return target == player and player:hasSkill(self) and player:getMark("@yayi_MaxHPandHP") ~= 0 and data.from and
hp > 0 and data.damage >= player.hp and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#sw_tonggan-ask:" .. data.from.id) --Tips:这里要填入.id,血的教训
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "@yayi_MaxHPandHP", 0) --芽衣学姐!!!!!不!!!
room:changeHero(player, "bh2__yayi", false, false, true, false) --哦,原来死的是琪亚娜啊。。。
room:handleAddLoseSkills(player, "-sw_gongku") --删除这个技能,防止诈尸
room:useVirtualCard("fire__slash", nil, player, data.from, self.name, true) --视为一张牌,常用函数
room:setPlayerMark(player, "kongzhen_yichu", 1) --增强技能效果实际上用的是标记!没想到吧!
local chaoyue = table.find(U.prepareDeriveCards(room, cymy, "qyn_cymy"), function(id)
return room:getCardArea(id) == Card.Void --芽衣...哦不对,琪亚娜死了,那枪归我了
end)
if chaoyue then
room:setCardMark(Fk:getCardById(chaoyue), MarkEnum.DestructOutMyEquip, 1)
U.moveCardIntoEquip(room, player, chaoyue, self.name, true, player)
end
return true
end,
}
qiyana:addSkill(sw_tonggan)
Fk:loadTranslationTable {
["sw_tonggan"] = "同甘",
[":sw_tonggan"] = "限定技,当你受到其他角色造成的致命伤害时,若〖芽衣〗的体力不为0,防止此伤害,将【超越·命运】置入武器栏,交换【妖刀·寂灭】和【超越·命运】的被动技能,切换至〖芽衣〗并视为对伤害来源使用一张火【杀】,然后失去〖联击〗并移除〖星弹〗的条件限制",
["#sw_tonggan-ask"] = "共苦:是否切换为〖芽衣〗,并视为对 %src 使用一张火【杀】",
}
local yayi = General(extension, "bh2__yayi", "benghuai", 4, 4, General.Female)
yayi.hidden = true
Fk:loadTranslationTable {
["bh2__yayi"] = "芽衣", --芽衣的技能不做注释,跟琪亚娜大体一样,框架都差不多
}
local sw_kongzhen = fk.CreateTriggerSkill {
name = "sw_kongzhen",
anim_type = "control",
frequency = Skill.Compulsory,
events = { fk.TargetSpecifying },
can_trigger = function(self, event, target, player, data)
if target == player then
if player:getMark("kongzhen_yichu") == 0 then
return player:hasSkill(self) and not player.dead and data.card and not data.card.is_damage_card and
data.card.type ~= Card.TypeEquip and table.find(TargetGroup:getRealTargets(data.tos),
function(id)
return id ~= player.id and not player.room:getPlayerById(id).dead and
player.room:getPlayerById(id):getMark("@cymy_suming") ~= 0
end)
else
return player:hasSkill(self) and not player.dead and data.card and not data.card.is_damage_card and
data.card.type ~= Card.TypeEquip
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local targets = TargetGroup:getRealTargets(data.tos)
if player:getMark("kongzhen_yichu") == 0 then
for _, id in ipairs(targets) do
target = room:getPlayerById(id)
if target:getMark("@cymy_suming") > 0 then
room:removePlayerMark(target, "@cymy_suming", 1)
data.disresponsive = true
end
end
else
data.disresponsive = true
end
end,
}
local sw_kongzhen_tar = fk.CreateTriggerSkill {
name = "#sw_kongzhen_tar",
frequency = Skill.Compulsory,
events = { fk.EventPhaseStart },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Start and
player:getMark("kongzhen_yichu") == 0
end,
on_use = function(self, event, target, player, data)
local room = player.room
if table.find(player:getEquipments(Card.SubtypeWeapon), function(id)
return Fk:getCardById(id).name ==
"yy_ydjm"
end) then
local cards1 = {}
for _, id in ipairs(room.draw_pile) do
if not Fk:getCardById(id).is_damage_card and Fk:getCardById(id).type == Card.TypeTrick then
table.insertIfNeed(cards1, id)
end
end
if #cards1 > 0 then
local card = table.random(cards1)
room:moveCards({
ids = { card },
to = player.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonJustMove,
proposer = player.id,
skillName = self.name,
})
end
else
local jimie = table.find(U.prepareDeriveCards(room, cymy, "yy_ydjm"), function(id)
return room:getCardArea(id) == Card.Void
end)
if jimie then
room:setCardMark(Fk:getCardById(jimie), MarkEnum.DestructOutMyEquip, 1)
U.moveCardIntoEquip(room, player, jimie, self.name, true, player)
end
end
end,
}
sw_kongzhen:addRelatedSkill(sw_kongzhen_tar)
yayi:addSkill(sw_kongzhen)
Fk:loadTranslationTable {
["sw_kongzhen"] = "空震",
["#sw_kongzhen_tar"] = "空震",
[":sw_kongzhen"] = "锁定技,当你使用非伤害类牌指定目标时,若其有『宿命』,你移去其一层『宿命』,令其无法响应此牌;准备阶段,将【妖刀·寂灭】置入你的装备区,若已有则改为获得一张非伤害锦囊牌",
}
local sw_lianjiyy = fk.CreateActiveSkill {
name = "sw_lianjiyy",
prompt = "#sw_lianjiyy-active",
card_num = 0,
target_num = 1,
can_use = function(self, player)
return player:getMark("@qiyana_MaxHPandHP") ~= 0
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected, selected_cards)
return #selected == 0 and to_select ~= Self.id and
Fk:currentRoom():getPlayerById(to_select):getMark("@ydjm_mieque") > 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
room:setPlayerMark(target, "@!lianji_yy", 1)
if target:getMark("@cymy_suming") > 0 then
local n = target:getMark("@cymy_suming")
room:setPlayerMark(target, "@cymy_suming", 0)
player:drawCards(n, self.name)
end
room:setPlayerMark(player, "@yayi_MaxHPandHP", { player.hp, player.maxHp })
local mark = player:getTableMark("@qiyana_MaxHPandHP")
local hp = mark[1]
local maxhp = mark[2]
if player.maxHp ~= maxhp then
if player.maxHp > maxhp then
room:changeMaxHp(player, -(player.maxHp - maxhp))
elseif player.maxHp < maxhp then
room:changeMaxHp(player, maxhp - player.maxHp)
end
end
if player.hp ~= hp then
if player.hp > hp then
room:changeHp(player, -(player.hp - hp))
elseif player.hp < hp then
room:changeHp(player, hp - player.hp)
end
end
room:setPlayerMark(player, "@qiyana_MaxHPandHP", 0)
room:changeHero(player, "bh2__qiyana", false, false, true, false)
local chaoyue = table.find(U.prepareDeriveCards(room, cymy, "qyn_cymy"), function(id)
return room:getCardArea(id) == Card.Void
end)
if chaoyue then
room:setCardMark(Fk:getCardById(chaoyue), MarkEnum.DestructOutMyEquip, 1)
U.moveCardIntoEquip(room, player, chaoyue, self.name, true, player)
end
end,
}
yayi:addSkill(sw_lianjiyy)
Fk:loadTranslationTable {
["sw_lianjiyy"] = "联击",
[":sw_lianjiyy"] = "出牌阶段,你可以标记一名有『灭却』的角色,移去其所有『宿命』并摸等量的牌,然后切换至〖琪亚娜〗",
["#sw_lianjiyy-active"] = "联击:标记一名有『灭却』的角色,切换为琪亚娜",
}
local sw_gongku = fk.CreateTriggerSkill {
name = "sw_gongku",
anim_type = "defensive",
frequency = Skill.Limited,
events = { fk.DamageInflicted },
can_trigger = function(self, event, target, player, data)
local mark = player:getTableMark("@qiyana_MaxHPandHP")
local hp = mark[1]
return target == player and player:hasSkill(self) and player:getMark("@qiyana_MaxHPandHP") ~= 0 and data.from and
hp > 0 and data.damage >= player.hp and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#sw_gongku-ask:" .. data.from.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "@qiyana_MaxHPandHP", 0)
room:changeHero(player, "bh2__qiyana", false, false, true, false)
room:handleAddLoseSkills(player, "-sw_tonggan")
room:useVirtualCard("thunder__slash", nil, player, data.from, self.name, true)
room:setPlayerMark(player, "xingdan_yichu", 1)
local jimie = table.find(U.prepareDeriveCards(room, cymy, "yy_ydjm"), function(id)
return room:getCardArea(id) == Card.Void
end)
if jimie then
room:setCardMark(Fk:getCardById(jimie), MarkEnum.DestructOutMyEquip, 1)
U.moveCardIntoEquip(room, player, jimie, self.name, true, player)
end
return true
end,
}
yayi:addSkill(sw_gongku)
Fk:loadTranslationTable {
["sw_gongku"] = "共苦",
[":sw_gongku"] = "限定技,当你受到其他角色造成的致命伤害时,若〖琪亚娜〗的体力不为0,防止此伤害,将【妖刀·寂灭】置入武器栏,交换【妖刀·寂灭】和【超越·命运】的被动技能,切换至〖琪亚娜〗并视为对伤害来源使用一张雷【杀】,然后失去〖联击〗并移除〖空震〗的条件限制",
["#sw_gongku-ask"] = "共苦:是否切换为〖琪亚娜〗,并视为对 %src 使用一张雷【杀】",
}
local huahuo = General(extension, "sw__huahuo", "benghuai", 3, 3, General.Female)
Fk:loadTranslationTable {
["sw__huahuo"] = "花火",
["designer:sw__huahuo"] = "怂为真理",
["~sw__huahuo"] = "玩大了……",
}
local sw_yexiang = fk.CreateTriggerSkill {
name = "sw_yexiang",
events = { fk.EventPhaseStart, fk.AfterSkillEffect, fk.TurnStart },
mute = true,
frequency = Skill.Compulsory,
anim_type = "offensive",
can_trigger = function(self, event, target, player, data)
if event == fk.TurnStart then
return player:hasSkill(self) --不需要判定技能的发动条件
elseif event == fk.EventPhaseStart then
--这里为了判定一下技能数量,是否能和标记记录的技能数对等,没有其他作用
local skills = {}
for _, skill in ipairs(target.player_skills) do
local str = Fk:translate(":" .. skill.name)
--排除一部分既定无法发动的技能
if not string.find(str, "游戏开始时") and skill.name ~= "m_feiyang" and skill.name ~= "m_bahu" and not (skill.name:endsWith("&") or skill.name:startsWith("#") or
skill:isEquipmentSkill(target) or skill.frequency == Skill.Compulsory) then
table.insert(skills, skill.name)
end
end
--mark1是记录的玩家技能数量,可发动的那种
local mark = type(target:getMark("sw_yexiang-turn")) == "table" and target:getMark("sw_yexiang-turn") or {}
--mark2是玩家换武将后,武将牌上的技能,用于判断是否能再次变身
local mark2 = type(target:getMark("@sw_yexiang_fj")) == "table" and target:getMark("@sw_yexiang_fj") or {}
if #skills > 0 then
--如果mark1为0或者为技能数,则触发变身
return player:hasSkill(self) and (#mark == #skills or #mark == 0) and target.phase == Player.Finish
else
--这里不记录mark2为技能数的原因是因为变身后只存在一种情况才能变回来,那就是技能用完或者没技能用,这种情况下会吧标记置0
if #skills == 0 then
return player:hasSkill(self) and target.phase == Player.Finish and #mark2 == 0
end
end
else
--这里用于判断发动技能后,将记录角色未变身前使用的技能从标记中移去,以方便确认是否可以变身
return target == player and player:getMark("sw_yexiang-turn") ~= 0 and
data.frequency ~= Skill.Compulsory and data.frequency ~= Skill.Wake and
not (data.cardSkill or data.global) and
data:isPlayerSkill(target)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnStart then --将目标的武将名称信息记录进标记内,方便后续更换
if target:getMark("huahuo_bianshen") == 0 then
room:setPlayerMark(target, "huahuo_bianshen", target.general)
end
local skills = {}
for _, skill in ipairs(target.player_skills) do --记录一下武将牌上的技能,用于判定其本回合是否发动了这些被记录的技能
local str = Fk:translate(":" .. skill.name)
if not string.find(str, "游戏开始时") and skill.name ~= "m_feiyang" and skill.name ~= "m_bahu" and not (skill.name:endsWith("&") or skill.name:startsWith("#") or
skill:isEquipmentSkill(target) or skill.frequency == Skill.Compulsory) then
table.insert(skills, skill.name)
end
end
if #skills > 0 then
room:setPlayerMark(target, "sw_yexiang-turn", skills) --把技能记录进标记
end
elseif event == fk.EventPhaseStart then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "offensive")
if not target.dead then
-- if room:askForSkillInvoke(player, self.name, nil, "#sw_yexiang-askforchos:" .. target.id) then --询问玩家是否发动技能,存在疑问,如果不变,对面白板就白一辈子了,没法玩
--这里用于判断待删除的技能,因为要再次换武将了,要提前移除上次变更武将记录的技能
local delmark = target:getTableMark("sw_yexiang_del")
local delsks = {}
for _, skill in ipairs(target.player_skills) do
if table.contains(delmark, skill.name) then
table.insert(delsks, skill.name)
end
end
if #delsks > 0 then
room:handleAddLoseSkills(target, "-" .. table.concat(delsks, "|-"), nil)
room:setPlayerMark(target, "sw_yexiang_del", 0)
end
--记得设置夜想标记为0,防止出现错误删除技能和错误获取技能
if target:getMark("sw_yexiang-turn") ~= 0 then
room:setPlayerMark(target, "sw_yexiang-turn", 0)
end
--白名单,防止出现不可控因素的武将
local whitelist = { "jsrg", "mobile", "mougong", "ol", "overseas", "sp", "tenyear", "offline", "MahjongSoul",
"moepack", "2hu" }
room:delay(500)
target.general = target:getMark("huahuo_bianshen")
room:broadcastProperty(target, "general")
-- 黑名单,防止被变白板影响游戏体验
local biackgenerallist = { "sw__efeiliusi", "sw__beiyuanlili", "mu__daqiao", "mu__xiaoqiao", "tystar__yuanshu",
"sw__qianzhi", "godzhugeliang", "sw__black", "sw__yiliya", "sw__weigong", "sw__meiyou",
"sw__xy", "sw__moegodemo", "bh2__jiuxiao", "bh2__yyqyn", "sw__lingyan", "godjiangwei", "godxuchu",
"ty__godhuatuo", "xuelingyun", "zhouxuan", "godzhangfei", "sw__godzhangjiao" }
--筛选完成后没让玩家抽出3个,选择一个变
local generals = room:findGenerals(function(g)
return table.contains(whitelist, Fk.generals[g].package.extensionName) and
not table.contains(biackgenerallist, Fk.generals[g].name)
end, 3)
local name = room:askForGeneral(target, generals, 1, false)
local general = Fk.generals[name]
--初次筛选可以获得的技能,然后赋予玩家
local sks = {}
for _, skill_name in ipairs(general:getSkillNameList()) do
local s = Fk.skills[skill_name]
local str = Fk:translate(":" .. skill_name)
if not string.find(str, "游戏开始时") and not (s.frequency == Skill.Quest or s.frequency == Skill.Wake) then
table.insert(sks, s.name)
end
end
if #sks > 0 then
room:handleAddLoseSkills(target, sks, nil)
end
--只记录变身后这个武将的技能,因此变身后额外获得的技能会被永久保留
local skills = {}
for _, skill_name in ipairs(general:getSkillNameList()) do
local s = Fk.skills[skill_name]
local str = Fk:translate(":" .. skill_name)
if not string.find(str, "游戏开始时") and not (s.frequency == Skill.Compulsory or s.frequency == Skill.Wake or s.frequency == Skill.Quest and s.lordSkill) then
table.insert(skills, s.name)
end
end
--这里像“技”标记内添加这些可以被记录的技能,方便删除
--fix什么傻逼标记,真恶心,显示让别人看技能,不显示自己又看不见,只能通过@@显示总技能,呕
if #skills > 0 then
room:setPlayerMark(target, "@sw_yexiang_fj", skills)
end
local delskills = {}
for _, skill_name in ipairs(general:getSkillNameList()) do
local s = Fk.skills[skill_name]
table.insert(delskills, s.name)
end
--赋予技能后,将获得的技能记录进del标记,方便后续删除
if #delskills > 0 then
room:setPlayerMark(target, "sw_yexiang_del", delskills)
end
-- target.general = general.name
-- room:broadcastProperty(target, "general")
-- local general = room:askForGeneral(player, generals, 1, true)
-- if general == nil then
-- general = table.random(generals)
-- end
-- table.removeOne(generals, general)
-- room:changeHero(target, general, false, true, true, false)
-- local blackskills = {}
-- for _, blackskill in ipairs(Fk.generals[target.deputyGeneral]:getSkillNameList()) do
-- if Fk.skills[blackskill].frequency == Skill.Wake or Fk.skills[blackskill].frequency == Skill.Quest then
-- table.insert(blackskills, blackskill)
-- end
-- end
-- if #blackskills > 0 then
-- -- room:setPlayerMark(target, "@sw_yexiang_", blackskills)
-- room:handleAddLoseSkills(target, "-" .. table.concat(blackskills, "|-"), nil)
-- end
-- local skills = {} --记录副将的技能,加入标记内
-- for _, skill in ipairs(Fk.generals[target.deputyGeneral]:getSkillNameList()) do
-- if not (Fk.skills[skill].frequency == Skill.Compulsory or Fk.skills[skill].frequency == Skill.Wake or Fk.skills[skill].frequency == Skill.Quest and Fk.skills[skill].lordSkill) then
-- table.insert(skills, skill)
-- end
-- end
-- if #skills > 0 then
-- room:setPlayerMark(target, "@sw_yexiang_fj", skills)
-- end
if target ~= player then
local zjskills = {} --记录主将的技能,然后计入标记内,失去这些技能
for _, zjskill in ipairs(Fk.generals[target.general]:getSkillNameList()) do
table.insert(zjskills, zjskill)
end
if #zjskills > 0 then
room:setPlayerMark(target, "sw_yexiang_zj", zjskills)
room:handleAddLoseSkills(target, "-" .. table.concat(zjskills, "|-"), nil)
end
end
target.general = general.name
room:broadcastProperty(target, "general")
end
else
local mark = player:getMark("sw_yexiang-turn")
table.removeOne(mark, data.name)
room:setPlayerMark(target, "sw_yexiang-turn", mark)
if #mark == 0 then
room:setPlayerMark(target, "sw_yexiang-turn", 0)
end
end
end,
--发动技能后清除掉标记内记录的这个技能,然后判定是否可以换武将
refresh_events = { fk.AfterSkillEffect },
can_refresh = function(self, event, target, player, data)
return target == player and player:getMark("@sw_yexiang_fj") ~= 0 and
data.frequency ~= Skill.Compulsory and data.frequency ~= Skill.Wake and
not (data.cardSkill or data.global) and data:isPlayerSkill(target)
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
--这个refresh仅用于记录发动技能并让武将变回去
local mark = player:getMark("@sw_yexiang_fj")
table.removeOne(mark, data.name)
room:setPlayerMark(target, "@sw_yexiang_fj", mark)
local delmark = player:getTableMark("sw_yexiang_del")
--如果变武将后的技能全部发动了,那么标记会被置0
if #mark == 0 then
--先清除夜想的标记,因为可能导致多重判定,所以先把夜想的标记清理掉
room:setPlayerMark(target, "sw_yexiang-turn", 0)
--遍历出玩家的所有技能,如果这些技能在待删除技能的标记内,也就是del,删除
local skills = {}
for _, skill in ipairs(target.player_skills) do
if table.contains(delmark, skill.name) then
table.insert(skills, skill.name)
end
end
if #skills > 0 then
room:handleAddLoseSkills(target, "-" .. table.concat(skills, "|-"), nil)
--然后将del设置为0
room:setPlayerMark(target, "sw_yexiang_del", 0)
end
--把变武将记录技能的标记设置为0
room:setPlayerMark(target, "@sw_yexiang_fj", 0)
--废弃
-- if player.deputyGeneral ~= "" then
-- local skills = {}
-- local originalSkills = Fk.generals[player.deputyGeneral]:getSkillNameList()
-- for _, skill in ipairs(originalSkills) do
-- table.insert(skills, skill)
-- end
-- if #skills > 0 then
-- room:handleAddLoseSkills(target, "-" .. table.concat(skills, "|-"), nil, true, false)
-- end
-- room:setPlayerProperty(player, "deputyGeneral", "")
-- end
--最后让玩家获得此前记录未变更武将前的技能,此做法可能会导致觉醒技重置,限定技重置等等,但是目前没发现类似情况
local skillmark = player:getMark("sw_yexiang_zj")
if skillmark ~= 0 then
room:handleAddLoseSkills(target, skillmark, nil)
room:setPlayerMark(target, "sw_yexiang_zj", 0)
end
--此前记录的玩家肖像和名字,现在变回去
target.general = target:getMark("huahuo_bianshen")
room:broadcastProperty(target, "general")
end
end,
}
huahuo:addSkill(sw_yexiang)
Fk:loadTranslationTable {
["sw_yexiang"] = "夜想", --非锁定技会导致出bug,问题未知
[":sw_yexiang"] = "每名角色的回合结束时,若其于本回合发动了全部或未发动过任何武将牌上的技能,其可以观看三张未加入游戏的武将牌,选择一张令替换武将牌和技能,直到其发动该武将牌上的所有技能。",
["@sw_yexiang_fj"] = "技",
["#sw_yexiang-askforchos"] = "夜想:你可以将暂时变更其武将牌,当前角色:%src",
["$sw_yexiang1"] = "今天真是个好日子~",
["$sw_yexiang2"] = "规则,就是用来打破的哟~",
["$sw_yexiang3"] = "听我的,投降算啦~",
["$sw_yexiang4"] = "我来演坏人吧~",
["$sw_yexiang5"] = "好~戏~开~场~",
}
local sw_xichen = fk.CreateTriggerSkill {
name = "sw_xichen",
anim_type = "special",
mute = true,
frequency = Skill.Compulsory,
refresh_events = { fk.TurnEnd, fk.EventPhaseChanging, fk.AfterSkillEffect },
can_refresh = function(self, event, target, player, data)
if event == fk.TurnEnd then
return player:hasSkill(self, false)
elseif event == fk.EventPhaseChanging then
return player:hasSkill(self) and data.to == Player.Start and target ~= player
else
return player:hasSkill(self)
and player:getMark("sw_xichen") ~= 0
end
end,
on_refresh = function(self, event, target, player, data)
if event == fk.TurnEnd then
local mark = player:getTableMark("sw_xichen")
for _, tab in pairs(mark) do
for _, sname in pairs(tab[3]) do
player:loseFakeSkill(Fk.skills[sname])
end
end
player.room:setPlayerMark(player, "sw_xichen", {})
elseif event == fk.EventPhaseChanging then
local mark = player:getTableMark("sw_xichen")
local in_ret
for _, tab in pairs(mark) do
if tab[1] == target.id then
in_ret = true
tab[2] = tab[2] + 1
break
end
end
if not in_ret then
local skills = table.filter(target.player_skills, function(s)
return not (s:isEquipmentSkill(target) or s.name[#s.name] == "&" or s.name:startsWith("#")) and
not (table.contains({ Skill.Limited, Skill.Wake, Skill.Quest }, s.frequency) or s.lordSkill)
end)
local getName = function(s)
return s.name
end
table.insert(mark, { target.id, 1, table.map(skills, getName) })
for _, s in pairs(skills) do
player:addFakeSkill(s)
player:prelightSkill(s.name, true)
end
end
player.room:setPlayerMark(player, "sw_xichen", mark)
else
local mark = player:getTableMark("sw_xichen")
for _, tab in pairs(mark) do
for _, sname in pairs(tab[3]) do
if sname == data.name then
table.removeOne(mark, sname)
player:loseFakeSkill(Fk.skills[sname])
player.room:setPlayerMark(player, "sw_xichen", mark)
end
end
end
end
end,
}
huahuo:addSkill(sw_xichen)
Fk:loadTranslationTable {
["sw_xichen"] = "戏尘",
[":sw_xichen"] = "其他角色的每个技能每回合限一次,每当你满足当前回合角色未发动过技能的发动条件时,你可以发动此技能。<br>" ..
"<font color='red'>〖戏尘〗和〖夜想〗的技能范围不包含觉醒技,使命技,主公技、附加技和无发动效果的技能,请勿反馈该技能的任何问题,必定存在bug,只是我还没找到!!!<br>" ..
"<font color='red'><strong>若更换武将后没有可发动的技能,其下个结束阶段进行更换武将!!!</strong>"
}
local qingque = General(extension, "sw__qingque", "benghuai", 3, 3, General.Female)
Fk:loadTranslationTable {
["sw__qingque"] = "青雀",
["designer:sw__qingque"] = "怂为真理",
["~sw__qingque"] = "不想..回去..工作..",
}
--- 询问争番
---@param player ServerPlayer @ 要做选择的玩家
local doZhengfan = function(player)
local room = player.room
local skillName = "sw_zhengfan"
local n = player:getMark("sw_zhengfan-turn")
room:askForDiscard(player, n, n, true, skillName, true, nil, "#zhengfan-askdiscards:::" .. n)
if player:getHandcardNum() > 4 then
room:askForDiscard(player, player:getHandcardNum() - 4, player:getHandcardNum() - 4, false, skillName, false, nil,
"争番:请将手牌弃至 4 张")
elseif player:getHandcardNum() < 4 then
player:drawCards(4 - player:getHandcardNum(), skillName)
end
end
local sw_zhengfan = fk.CreateTriggerSkill {
name = "sw_zhengfan",
events = { fk.BeforeDrawCard },
anim_type = "negative",
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player:getMark("@@zhengfan_cunzhi-turn") == 0 and
player:getMark("sw_zhengfan-turn") <= player:getHandcardNum() and data.skillName ~= "sw_zhengfan"
end,
on_cost = function(self, event, target, player, data)
local n = player:getMark("sw_zhengfan-turn")
return player.room:askForSkillInvoke(player, self.name, nil,
"争番:是否发动〖争番〗,弃置" .. n .. "张牌,然后将手牌调整至 4 张")
end,
on_use = function(self, event, target, player, data)
local room = player.room
data.num = 0
local go1
local go2
local n = player:getMark("sw_zhengfan-turn")
room:askForDiscard(player, n, n, true, self.name, true, nil, "#zhengfan-askdiscards:::" .. n)
if player:getHandcardNum() > 4 then
local cards = room:askForDiscard(player, player:getHandcardNum() - 4, player:getHandcardNum() - 4, false, self
.name,
false, nil, "争番:请将手牌弃至 4 张")
if #cards > 0 then
go1 = true
end
elseif player:getHandcardNum() < 4 then
local cards = player:drawCards(4 - player:getHandcardNum(), self.name)
if #cards > 0 then
go2 = true
end
end
room:addPlayerMark(player, "sw_zhengfan-turn", 1)
local suits = {}
for _, id in ipairs(player:getCardIds(Player.Hand)) do
local suit = Fk:getCardById(id).suit
if not table.contains(suits, suit) then
table.insert(suits, suit)
end
end
if (go1 == true or go2 == true) and #suits ~= player:getHandcardNum() and player:getHandcardNum() - #suits ~= player:getHandcardNum() - 1 then
while true do
if player.room:askForSkillInvoke(player, self.name, nil, "争番:是否发继续发动〖争番〗?") then
doZhengfan(player)
room:addPlayerMark(player, "sw_zhengfan-turn", 1)
local suits2 = {}
for _, id in ipairs(player:getCardIds(Player.Hand)) do
local suit = Fk:getCardById(id).suit
if not table.contains(suits2, suit) then
table.insert(suits2, suit)
end
end
if player:getMark("sw_zhengfan-turn") > player:getHandcardNum() then
room:setPlayerMark(player, "@@zhengfan_cunzhi-turn", 1)
break
end
if #suits2 == player:getHandcardNum() then
room:setPlayerMark(player, "@@zhengfan_cunzhi-turn", 1)
break
end
if player:getHandcardNum() - #suits2 == player:getHandcardNum() - 1 then
room:setPlayerMark(player, "@@zhengfan_cunzhi-turn", 1)
break
end
else
room:setPlayerMark(player, "@@zhengfan_cunzhi-turn", 1)
break
end
end
end
end,
}
qingque:addSkill(sw_zhengfan)
Fk:loadTranslationTable {
["sw_zhengfan"] = "争番",
[":sw_zhengfan"] = "当你从牌堆获得牌时,若你发动该技能的次数不大于手牌数,你可以取消之,弃置X张牌并将手牌调整至四张,若你手牌中的牌花色均相同或均不同," ..
"此技能本回合失效,否则你可以继续发动此效果(X为此技能本回合的发动次数-1)",
["@@zhengfan_cunzhi-turn"] = "争番失效",
["#zhengfan-askdiscards"] = "争番:请选择弃置 %arg 张牌",
["$sw_zhengfan1"] = "手握顺风局,闷声发大财~",
["$sw_zhengfan2"] = "撞上逆风局,少输就是赢~",
["$sw_zhengfan3"] = "算了也白算,等等牌就来~",
["$sw_zhengfan4"] = "牌势无定势,越急越没戏~",
["$sw_zhengfan5"] = "战局如牌局,见机就行事~",
}
local sw_qianggang = fk.CreateTriggerSkill {
name = "sw_qianggang",
anim_type = "defensive",
frequency = Skill.Compulsory,
events = { fk.CardUsing },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.card.type ~= Card.TypeEquip and
(data.card.trueName ~= "jink" or data.card.trueName ~= "nullification") and
data.card.sub_type ~= Card.SubtypeDelayedTrick and
table.every(player:getCardIds(Player.Hand),
function(id)
return Fk:getCardById(id).suit == Fk:getCardById(player:getCardIds(Player.Hand)[1])
.suit
end)
end,
on_use = function(self, event, target, player, data)
data.additionalEffect = 1
end,
}
local sw_qianggang_targetmod = fk.CreateTargetModSkill {
name = "#sw_qianggang_targetmod",
frequency = Skill.Compulsory,
bypass_times = function(self, player, skill, scope, card, to)
local suits = {}
for _, id in ipairs(player:getCardIds(Player.Hand)) do
local suit = Fk:getCardById(id).suit
if table.contains(suits, suit) then
return
else
table.insert(suits, suit)
end
end
return #suits == player:getHandcardNum()
end,
bypass_distances = function(self, player, skill, card)
local suits = {}
for _, id in ipairs(player:getCardIds(Player.Hand)) do
local suit = Fk:getCardById(id).suit
if table.contains(suits, suit) then
return
else
table.insert(suits, suit)
end
end
return #suits == player:getHandcardNum()
end,
}
local sw_qianggang_Audio = fk.CreateTriggerSkill {
name = "#sw_qianggang_Audio",
refresh_events = { fk.CardUsing },
can_refresh = function(self, event, target, player, data)
local suits = {}
for _, id in ipairs(player:getCardIds(Player.Hand)) do
local suit = Fk:getCardById(id).suit
if table.contains(suits, suit) then
return
else
table.insert(suits, suit)
end
end
return target == player and player:hasSkill(sw_qianggang.name) and #suits == player:getHandcardNum() and
(data.card.trueName ~= "jink" or data.card.trueName ~= "nullification") and
data.card.sub_type ~= Card.SubtypeDelayedTrick
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(sw_qianggang.name)
room:notifySkillInvoked(player, sw_qianggang.name, "offensive")
end,
}
sw_qianggang:addRelatedSkill(sw_qianggang_Audio)
sw_qianggang:addRelatedSkill(sw_qianggang_targetmod)
qingque:addSkill(sw_qianggang)
Fk:loadTranslationTable {
["sw_qianggang"] = "抢杠",
["#sw_qianggang_Audio"] = "抢杠",
[":sw_qianggang"] = "锁定技,若你的手牌花色均相同,你使用牌额外结算一次;若均不同,你使用牌无次数和距离限制。",
["$sw_qianggang1"] = "有了~",
["$sw_qianggang2"] = "不慌~",
["$sw_qianggang3"] = "来吧~",
["$sw_qianggang4"] = "嚯哟~",
["$sw_qianggang5"] = "哇哦~",
}
return extension
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。