2 Star 1 Fork 0

Young_Vanshang/est_test

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
modified_king.lua 20.98 KB
一键复制 编辑 原始数据 按行查看 历史
Young_Vanshang 提交于 2024-11-08 01:27 . 新增王战
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
local extension = Package:new("modified_king")
extension.extensionName = "est_test"
local U = require "packages/utility/utility"
Fk:loadTranslationTable{
["modified_king"] = "王者之战",
["mod_k"] = "王者之战",
["mod_k_ex"] = "王者之战",
}
local xiahouyuan = General(extension, "mod_k__xiahouyuan", "wei", 4)
xiahouyuan:addSkill("ol_ex__shensu")
Fk:loadTranslationTable{
["mod_k__xiahouyuan"] = "夏侯渊",
["#mod_k__xiahouyuan"] = "疾行的猎豹",
["illustrator:mod_k__xiahouyuan"] = "KayaK(精修)",
["designer:mod_k__xiahouyuan"] = "韩旭",
["~mod_k__xiahouyuan"] = "我的速度,还是不够……",
}
local maliang = General(extension, "mod_k__maliang", "shu", 3)
local zishu = fk.CreateTriggerSkill{
name = "mod__zishu",
mute = true,
frequency = Skill.Compulsory,
events = {fk.EventPhaseStart, fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.EventPhaseStart then
if target.phase == Player.Finish then
return target ~= player and table.find(player.player_cards[Player.Hand], function (id)
return Fk:getCardById(id):getMark("@@zishu-inhand") > 0
end)
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.EventPhaseStart 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("@@zishu-inhand") > 0 then
table.insert(cards, id)
end
end
if #cards > 0 then
room:moveCards({
from = player.id,
ids = cards,
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
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("@@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), "@@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), "@@zishu-inhand", 0)
end
end
end,
}
local yingyuan = fk.CreateTriggerSkill{
name = "mod__yingyuan",
anim_type = "support",
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Play then
local mark = player:getMark("yingyuan-turn")
if type(mark) ~= "table" or not table.contains(mark, data.card.type) and (data.card.type == Card.TypeBasic or data.card:isCommonTrick()) 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
end,
on_cost = function(self, event, target, player, data)
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
end,
on_use = function(self, event, target, player, data)
local room = player.room
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("yingyuan-turn")
table.insert(mark, data.card.type)
room:setPlayerMark(player, "yingyuan-turn", mark)
end,
}
maliang:addSkill(zishu)
maliang:addSkill(yingyuan)
Fk:loadTranslationTable{
["mod_k__maliang"] = "马良",
["#mod_k__maliang"] = "白眉智士",
["cv:mod_k__maliang"] = "马洋",
["illustrator:mod_k__maliang"] = "LiuHeng",
["mod__zishu"] = "自书",
[":mod__zishu"] = "锁定技,你的回合外,其他角色结束阶段,将你手牌中所有本回合获得的牌置入弃牌堆;你的回合内,当你不因此技能获得牌时,摸一张牌。",
["mod__yingyuan"] = "应援",
[":mod__yingyuan"] = "当你于回合内使用的基本牌或普通锦囊牌结算完毕置入弃牌堆时,你可以将之交给一名其他角色(每回合每种类型限一次)。",
["#mod__zishu-discard"] = "自书",
["#mod__yingyuan-card"] = "应援:你可以将 %arg 交给一名其他角色",
["@@zishu-inhand"] = "自书",
["$mod__zishu1"] = "慢着,让我来!",
["$mod__zishu2"] = "身外之物,不要也罢!",
["$mod__yingyuan1"] = "接好嘞!",
["$mod__yingyuan2"] = "好牌只用一次怎么够?",
["~mod_k__maliang"] = "我的使命完成了吗……",
}
local mizhu = General(extension, "mod_k__mizhu", "shu", 3)
local ziyuan = fk.CreateActiveSkill{
name = "mod__ziyuan",
anim_type = "support",
min_card_num = 1,
target_num = 1,
prompt = "#ziyuan",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
end,
card_filter = function(self, to_select, selected)
if Fk:currentRoom():getCardArea(to_select) == Player.Equip then return end
local num = 0
for _, id in ipairs(selected) do
num = num + Fk:getCardById(id).number
end
return num + Fk:getCardById(to_select).number <= 13
end,
target_filter = function(self, to_select, selected, selected_cards)
local num = 0
for _, id in ipairs(selected_cards) do
num = num + Fk:getCardById(id).number
end
return num == 13 and #selected == 0 and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
player:showCards(effect.cards)
room:moveCardTo(effect.cards, Card.PlayerHand, target, fk.ReasonGive, self.name, nil, false, player.id)
if not target.dead and target:isWounded() then
room:recover({
who = target,
num = 1,
recoverBy = player,
skillName = self.name
})
end
end,
}
mizhu:addSkill(ziyuan)
mizhu:addSkill("jugu")
Fk:loadTranslationTable{
["mod_k__mizhu"] = "糜竺",
["#mod_k__mizhu"] = "挥金追义",
["designer:mod_k__mizhu"] = "千幻",
["illustrator:mod_k__mizhu"] = "瞎子Ghe",
["mod__ziyuan"] = "资援",
[":mod__ziyuan"] = "出牌阶段限一次,你可以展示任意张点数之和为13的手牌并交给一名其他角色,然后该角色回复1点体力。",
["$mod__ziyuan1"] = "区区薄礼,万望使君笑纳。",
["$mod__ziyuan2"] = "雪中送炭,以解君愁。",
["~mod_k__mizhu"] = "劣弟背主,我之罪也。",
}
local weiyan = General(extension, "mod_k__weiyan", "shu", 4)
local qimou_targetmod = fk.CreateTargetModSkill{
name = "#mod__qimou_targetmod",
residue_func = function(self, player, skill, scope)
if skill.trueName == "slash_skill" and scope == Player.HistoryPhase then
return player:getMark("@qimou-turn") or 0
end
end,
}
local qimou_distance = fk.CreateDistanceSkill{
name = "#mod__qimou_distance",
correct_func = function(self, from, to)
return -from:getMark("@qimou-turn")
end,
}
local qimou = fk.CreateActiveSkill{
name = "mod__qimou",
anim_type = "offensive",
card_num = 0,
target_num = 0,
frequency = Skill.Limited,
interaction = function()
return UI.Spin {
from = 1,
to = Self.hp,
}
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and player.hp > 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local tolose = self.interaction.data
room:loseHp(player, tolose, self.name)
if player.dead then return end
room:setPlayerMark(player, "@qimou-turn", tolose)
end,
}
qimou:addRelatedSkill(qimou_targetmod)
qimou:addRelatedSkill(qimou_distance)
weiyan:addSkill("hs__kuanggu")
weiyan:addSkill(qimou)
Fk:loadTranslationTable{
["mod_k__weiyan"] = "魏延",
["#mod_k__weiyan"] = "嗜血的独狼",
["illustrator:mod_k__weiyan"] = "瞌瞌一休",
["mod__qimou"] = "奇谋",
[":mod__qimou"] = "限定技,出牌阶段,你可以失去X点体力,然后本回合内与其他角色计算距离-X且可以多使用X张杀。",
["$mod__qimou1"] = "成王败寇,怎可有勇无谋。",
["$mod__qimou2"] = "且不要因为暂时的得失而胆怯。",
["~mod_k__weiyan"] = "奸贼……害我……",
}
local zhurong = General(extension, "mod_k__zhurong", "shu", 4, 4, General.Female)
zhurong:addSkill("juxiang")
zhurong:addSkill("os_ex__lieren")
Fk:loadTranslationTable{
["mod_k__zhurong"] = "界祝融",
["#mod_k__zhurong"] = "野性的女王",
["$juxiang_mod_k__zhurong1"] = "今日,就让这群汉人长长见识。",
["$juxiang_mod_k__zhurong2"] = "我的大象,终于有了用武之地。",
["~mod_k__zhurong"] = "这群汉人使诈……",
}
local pangdegong = General(extension, "mod_k__pangdegong", "qun", 3)
local pingcai = fk.CreateActiveSkill{
name = "mod__pingcai",
mute = true,
card_num = 1,
target_num = 0,
prompt = "#mod__pingcai",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected)
return table.contains(Self:getCardIds("h"), to_select) and #selected == 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:notifySkillInvoked(player, self.name, "control")
player:broadcastSkillInvoke(self.name, 1)
player:showCards(effect.cards)
if #effect.cards == 1 then
local ccc = Fk:getCardById(effect.cards[1])
if ccc.suit == Card.Diamond then
local n = table.find(room.alive_players, function(p)
return string.find(p.general, "wolong") or string.find(p.deputyGeneral, "wolong")
end) and 2 or 1
local targets = table.map(room.alive_players, Util.IdMapper)
local tos = room:askForChoosePlayers(player, targets, 1, n, "#pingcai_wolong:::"..n, self.name, false)
if #tos > 0 then
player:broadcastSkillInvoke(self.name, 2)
for _, id in ipairs(tos) do
local p = room:getPlayerById(id)
if not p.dead then
room:damage{
from = player,
to = p,
damage = 1,
damageType = fk.FireDamage,
skillName = self.name,
}
end
end
end
elseif ccc.suit == Card.Club then
local n = table.find(room.alive_players, function(p)
return p.general:endsWith("pangtong") or p.deputyGeneral:endsWith("pangtong") or
p.general == "wolongfengchu" or p.deputyGeneral == "wolongfengchu"
end) and 4 or 3
local targets = table.map(table.filter(room.alive_players, function(p) return not p.chained end), Util.IdMapper)
if #targets == 0 then return end
local tos = room:askForChoosePlayers(player, targets, 1, n, "#pingcai_pangtong:::"..n, self.name, false)
if #tos > 0 then
player:broadcastSkillInvoke(self.name, 3)
for _, id in ipairs(tos) do
local p = room:getPlayerById(id)
if not p.dead then
p:setChainState(true)
end
end
end
elseif ccc.suit == Card.Spade then
local pattern = "armor"
if table.find(room.alive_players, function(p)
return p.general:endsWith("simahui") or p.deputyGeneral:endsWith("simahui")
end) then
pattern = "equip"
end
local excludeIds = {}
if pattern == "armor" then
for _, p in ipairs(room.alive_players) do
for _, id in ipairs(p:getCardIds("e")) do
if Fk:getCardById(id).sub_type ~= Card.SubtypeArmor then
table.insert(excludeIds, id)
end
end
end
end
local targets = room:askForChooseToMoveCardInBoard(player, "#pingcai_simahui:::"..pattern, self.name, true, "e", false, excludeIds)
if #targets == 0 then return end
player:broadcastSkillInvoke(self.name, 4)
room:askForMoveCardInBoard(player, room:getPlayerById(targets[1]), room:getPlayerById(targets[2]), self.name)
elseif ccc.suit == Card.Heart then
local targets = table.map(room.alive_players, Util.IdMapper)
local to = room:askForChoosePlayers(player, targets, 1, 1, "#pingcai_xushu", self.name, false)
if #to > 0 then
player:broadcastSkillInvoke(self.name, 5)
to = room:getPlayerById(to[1])
to:drawCards(1, self.name)
if not to.dead and to:isWounded() then
room:recover({
who = to,
num = 1,
recoverBy = player,
skillName = self.name
})
end
if not player.dead and
table.find(room.alive_players, function(p)
return p.general:endsWith("xushu") or p.deputyGeneral:endsWith("xushu")
end) then
player:drawCards(1, self.name)
end
end
end
end
end,
}
local yinship = fk.CreateTriggerSkill{
name = "mod__yinship",
anim_type = "defensive",
frequency = Skill.Compulsory,
events = {fk.EventPhaseChanging},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.to == Player.Judge
end,
on_use = function(self, event, target, player, data)
return true
end,
}
pangdegong:addSkill(yinship)
pangdegong:addSkill(pingcai)
Fk:loadTranslationTable{
["mod_k__pangdegong"] = "庞德公",
["#mod_k__pangdegong"] = "德懿举世",
["illustrator:mod_k__pangdegong"] = "Town",
["mod__pingcai"] = "评才",
[":mod__pingcai"] = "出牌阶段限一次,你可以展示一张手牌,若此牌花色为:方块,你对一名角色造成1点火焰伤害;梅花,你令至多三名角色横置;黑桃,你移动场上的一张装备牌;红桃,你令"..
"一名角色摸一张牌并回复1点体力。",
["#mod__pingcai"] = "评才:你可以展示一张手牌并执行对应效果",
["mod__yinship"] = "隐世",
[":mod__yinship"] = "锁定技,你跳过判定阶段。",
["#pingcai_wolong"] = "卧龙:对至多%arg名角色造成1点火焰伤害",
["#pingcai_pangtong"] = "凤雏:横置至多%arg名角色的武将牌",
["#pingcai_simahui"] = "水镜:移动场上的一张%arg",
["#pingcai_xushu"] = "玄剑:令一名角色摸一张牌并回复1点体力",
["$mod__pingcai1"] = "吾有众好友,分为卧龙、凤雏、水镜、元直。",
["$mod__pingcai2"] = "孔明能借天火之势。",
["$mod__pingcai3"] = "士元虑事环环相扣。",
["$mod__pingcai4"] = "德操深谙处世之道。",
["$mod__pingcai5"] = "元直侠客惩恶扬善。",
["~mod_k__pangdegong"] = "吾知人而不自知,何等荒唐。",
}
local zuoci = General(extension, "mod_k__zuoci", "qun", 3)
local function DoHuashen(player)
local room = player.room
local huashens = U.getPrivateMark(player, "&huanshen")
if huashens == 0 or #huashens == 0 then return end
local name = room:askForGeneral(player, huashens, 1)
local general = Fk.generals[name]
local kingdom = general.kingdom
if general.kingdom == "god" or general.subkingdom then
local allKingdoms = {}
if general.kingdom == "god" then
allKingdoms = {"wei", "shu", "wu", "qun", "jin"}
elseif general.subkingdom then
allKingdoms = { general.kingdom, general.subkingdom }
end
kingdom = room:askForChoice(player, allKingdoms, "AskForKingdom", "#ChooseInitialKingdom")
end
player.kingdom = kingdom
room:broadcastProperty(player, "kingdom")
player.gender = general.gender
room:broadcastProperty(player, "gender")
local original_general = player.general
player.general = general.name
room:broadcastProperty(player, "general")
local skills = {}
for _, skill_name in ipairs(general:getSkillNameList()) do
local s = Fk.skills[skill_name]
if not (s.lordSkill or s.switchSkillName or s.frequency > 3) then
if #s.attachedKingdom == 0 or table.contains(s.attachedKingdom, player.kingdom) then
table.insert(skills, s.name)
end
end
end
if #skills > 0 then
local skill = room:askForChoice(player, skills, "huashen", "#huashen", true)
local huanshen_skill = skill
if player:getMark("@huanshen_skill") ~= 0 then huanshen_skill = "-"..player:getMark("@huanshen_skill").."|"..skill end
room:setPlayerMark(player, "@huanshen_skill", skill)
room:handleAddLoseSkills(player, huanshen_skill, nil, true, false)
end
player.general = original_general
room:broadcastProperty(player, "general")
end
local huashen = fk.CreateTriggerSkill{
name = "mod__huashen",
anim_type = "special",
events = {fk.GamePrepared, fk.TurnStart, fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.GamePrepared then
return true
else
return target == player and #U.getPrivateMark(player, "&huanshen") > 0
end
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.GamePrepared then
return true
else
return player.room:askForSkillInvoke(player, self.name)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.GamePrepared then
local suc
for k, v in ipairs(room.general_pile) do
if v == "ol__zhugedan" then
suc = k
end
end
if suc then
table.remove(room.general_pile, suc)
end
local generals = room:getNGenerals(2)
U.setPrivateMark(player, "&huanshen", generals)
end
DoHuashen(player)
end,
}
local xinsheng = fk.CreateTriggerSkill{
name = "mod__xinsheng",
anim_type = "masochism",
events = {fk.Damaged},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and #player.room.general_pile > 0
end,
on_trigger = function(self, event, target, player, data)
self.cancel_cost = false
for i = 1, data.damage do
if self.cancel_cost or #player.room.general_pile == 0 then break end
self:doCost(event, target, player, data)
end
end,
on_cost = function(self, event, target, player, data)
if player.room:askForSkillInvoke(player, self.name, data) then
return true
end
self.cancel_cost = true
end,
on_use = function(self, event, target, player, data)
local room = player.room
local generals = U.getPrivateMark(player, "&huanshen")
table.insert(generals, room:getNGenerals(1)[1])
U.setPrivateMark(player, "&huanshen", generals)
end,
}
zuoci:addSkill(huashen)
zuoci:addSkill(xinsheng)
Fk:loadTranslationTable{
["mod_k__zuoci"] = "左慈",
["#mod_k__zuoci"] = "迷之仙人",
["illustrator:mod_k__zuoci"] = "废柴男",
["mod__huashen"] = "化身",
[":mod__huashen"] = "游戏开始前,你获得两张未加入游戏的武将牌,称为“化身”,然后选择一张“化身”的一个技能(主公技、限定技、觉醒技除外)。"..
"回合开始时和回合结束后,你可以重新选择一张“化身”的一个技能。你获得你以此法选择的技能且性别与势力改为与此“化身”相同。",
["mod__xinsheng"] = "新生",
[":mod__xinsheng"] = "当你受到1点伤害后,你可以获得一张“化身”。",
["$mod__huashen1"] = "哼,肉眼凡胎,岂能窥视仙人变幻?",
["$mod__huashen2"] = "万物苍生,幻化由心。",
["$mod__xinsheng1"] = "幻幻无穷,生生不息。",
["$mod__xinsheng2"] = "吐故纳新,师法天地。",
["~mod_k__zuoci"] = "腾云跨风,飞升太虚……",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Young_Vanshang/est_test.git
[email protected]:Young_Vanshang/est_test.git
Young_Vanshang
est_test
est_test
master

搜索帮助