代码拉取完成,页面将自动刷新
local extension = Package:new("modified_m")
extension.extensionName = "est_test"
local U = require "packages/utility/utility"
Fk:loadTranslationTable{
["modified_m"] = "移动版武将修改",
["mod_m"] = "移动版改",
["mod_m_ex"] = "移动版改",
}
--[[local maliang = General(extension, "mod_m__maliang", "shu", 3)
local zishu = fk.CreateTriggerSkill{
name = "mod__zishu",
mute = true,
frequency = Skill.Compulsory,
events = {fk.TurnEnd, fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.TurnEnd then
return target ~= player and table.find(player.player_cards[Player.Hand], function (id)
return Fk:getCardById(id):getMark("@@mod__zishu-inhand") > 0
end)
elseif player.phase ~= Player.NotActive then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.skillName ~= self.name then
return true
end
end
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnEnd then
player:broadcastSkillInvoke(self.name, 2)
room:notifySkillInvoked(player, self.name, "negative")
local cards = {}
for _, id in ipairs(player:getCardIds(Player.Hand)) do
if Fk:getCardById(id):getMark("@@mod__zishu-inhand") > 0 and not player:prohibitDiscard(id) then
table.insert(cards, id)
end
end
if #cards > 0 then
room:moveCards({
from = player.id,
ids = cards,
toArea = Card.DiscardPile,
moveReason = fk.ReasonDiscard,
skillName = self.name,
proposer = player.id,
})
end
else
player:broadcastSkillInvoke(self.name, 1)
room:notifySkillInvoked(player, self.name, "drawcard")
player:drawCards(1, self.name)
end
end,
refresh_events = {fk.AfterCardsMove, fk.AfterTurnEnd},
can_refresh = function(self, event, target, player, data)
if event == fk.AfterCardsMove then
return player:hasSkill(self, true) and player.phase == Player.NotActive
else
table.find(player.player_cards[Player.Hand], function (id)
return Fk:getCardById(id):getMark("@@mod__zishu-inhand") > 0
end)
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand then
for _, info in ipairs(move.moveInfo) do
local id = info.cardId
if room:getCardArea(id) == Card.PlayerHand and room:getCardOwner(id) == player then
room:setCardMark(Fk:getCardById(id), "@@mod__zishu-inhand", 1)
end
end
end
end
elseif event == fk.AfterTurnEnd then
for _, id in ipairs(player:getCardIds(Player.Hand)) do
room:setCardMark(Fk:getCardById(id), "@@mod__zishu-inhand", 0)
end
end
end,
}
local yingyuan = fk.CreateTriggerSkill{
name = "mod__yingyuan",
anim_type = "support",
events = {fk.CardUseFinished, fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.CardUseFinished then
if target == player and player:hasSkill(self) then
local mark = player:getMark("mod__yingyuan-turn")
if type(mark) ~= "table" or not table.contains(mark, data.card.trueName) then
local cardlist = data.card:isVirtual() and data.card.subcards or {data.card.id}
local room = player.room
return #cardlist > 0 and table.every(cardlist, function (id)
return room:getCardArea(id) == Card.Processing
end)
end
end
else
local room = player.room
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.from == player.id and move.moveReason == fk.ReasonDiscard and move.proposer == player.id then
local cards = {}
for _, info in ipairs(move.moveInfo) do
if not table.contains(player:getTableMark("mod__yingyuan-turn"), Fk:getCardById(info.cardId).trueName) and room:getCardArea(info.cardId) == Card.DiscardPile then
table.insert(cards, info.cardId)
end
end
self.cost_data = cards
return #cards > 0
end
end
end
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.CardUseFinished then
local to = player.room:askForChoosePlayers(player, table.map(player.room:getOtherPlayers(player), Util.IdMapper), 1, 1,
"#mod__yingyuan-card:::"..data.card:toLogString(), self.name, true)
if #to > 0 then
self.cost_data = to[1]
return true
end
else
local cids = self.cost_data
local room = player.room
room:setPlayerMark(player, "mod__yingyuan_record", cids)
local ret, dat = room:askForUseActiveSkill(player, "#mod__yingyuan_active", nil, true)
room:setPlayerMark(player, "mod__yingyuan_record", {})
if ret then
self.cost_data = {dat.cards, dat.targets}
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.CardUseFinished then
local cards = room:getSubcardsByRule(data.card, { Card.Processing })
local to = room:getPlayerById(self.cost_data)
room:moveCardTo(cards, Card.PlayerHand, to, fk.ReasonGive, self.name, nil, true, player.id)
if player.dead then return end
local mark = player:getTableMark("mod__yingyuan-turn")
table.insert(mark, data.card.trueName)
room:setPlayerMark(player, "mod__yingyuan-turn", mark)
else
local cards = self.cost_data[1]
local to = room:getPlayerById(self.cost_data[2][1])
room:moveCardTo(cards, Card.PlayerHand, to, fk.ReasonGive, self.name, nil, true, player.id)
if player.dead then return end
local mark = player:getTableMark("mod__yingyuan-turn")
for _, id in ipairs(cards) do
table.insertIfNeed(mark, Fk:getCardById(id).trueName)
end
room:setPlayerMark(player, "mod__yingyuan-turn", mark)
end
end,
}
local yingyuan_active = fk.CreateActiveSkill{
name = "#mod__yingyuan_active",
mute = true,
target_num = 1,
min_card_num = 1,
prompt = "#mod_yingyuan_active-invoke",
target_filter = Util.FalseFunc,
expand_pile = function()
return Self:getMark("mod__yingyuan_record")
end,
card_filter = function(self, to_select, selected)
return table.contains(Self:getMark("mod__yingyuan_record"), to_select) and table.every(selected, function(id)
return Fk:getCardById(id).trueName ~= Fk:getCardById(to_select).trueName
end)
end,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select ~= Self.id
end,
on_use = Util.TrueFunc,
}
Fk:addSkill(yingyuan_active)
maliang:addSkill(zishu)
maliang:addSkill(yingyuan)
Fk:loadTranslationTable{
["mod_m__maliang"] = "马良",
["#mod_m__maliang"] = "白眉智士",
["cv:mod_m__maliang"] = "马洋",
["illustrator:mod_m__maliang"] = "LiuHeng",
["mod__zishu"] = "自书",
[":mod__zishu"] = "锁定技,你的回合外,当前回合结束时,弃置你手牌中所有本回合获得的牌;你的回合内,当你不因此技能获得牌时,摸一张牌。",
["mod__yingyuan"] = "应援",
["#mod__yingyuan_active"] = "应援",
["#mod_yingyuan_active-invoke"] = "应援:选择任意张本回合未以此法给出过的牌名与一名其他角色",
[":mod__yingyuan"] = "每回合每种牌名限一次,当你使用牌进入弃牌堆时或弃置牌进入弃牌堆后,你可以将之交给一名其他角色。",
["#mod__yingyuan-card"] = "应援:你可以将 %arg 交给一名其他角色",
["@@mod__zishu-inhand"] = "自书",
["$mod__zishu1"] = "慢着,让我来!",
["$mod__zishu2"] = "身外之物,不要也罢!",
["$mod__yingyuan1"] = "接好嘞!",
["$mod__yingyuan2"] = "好牌只用一次怎么够?",
["~mod_m__maliang"] = "我的使命完成了吗……",
}]]
return extension
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。