2 Star 1 Fork 0

Young_Vanshang/est_test

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
modified_ty.lua 19.47 KB
一键复制 编辑 原始数据 按行查看 历史
Young_Vanshang 提交于 2024-10-29 13:49 . 修改部分代码
local extension = Package:new("modified_ty")
extension.extensionName = "est_test"
local U = require "packages/utility/utility"
Fk:loadTranslationTable{
["modified_ty"] = "十周年武将修改",
["mod_ty"] = "十周年改",
["mod_r_ty"] = "正常",
["mod_ty_ex"] = "十周年改",
}
--单奋音留赞
local liuzan = General(extension, "mod_ty__liuzan", "wu", 4)
liuzan:addSkill("ty__fenyin")
Fk:loadTranslationTable{
["mod_ty__liuzan"] = "留赞",
["#mod_ty__liuzan"] = "啸天亢声",
["illustrator:mod_ty__liuzan"] = "酸包",
["~mod_ty__liuzan"] = "若因病困此,命矣。",
}
--改吕玲绮
local lvlingqi = General(extension, "mod__lvlingqi", "qun", 4, 4, General.Female)
lvlingqi:addSkill("ty_heg__guowu")
lvlingqi:addSkill("zhuangrong")
lvlingqi:addRelatedSkill("shenwei")
lvlingqi:addRelatedSkill("wushuang")
Fk:loadTranslationTable{
["mod__lvlingqi"] = "吕玲绮",
["#mod__lvlingqi"] = "无双虓姬",
["illustrator:mod__lvlingqi"] = "Francis Tneh",
["cv:lvlingqi"] = "闲踏梧桐",
["$shenwei_mod__lvlingqi1"] = "继父神威,无坚不摧!",
["$shenwei_mod__lvlingqi2"] = "我乃温侯吕奉先之女!",
["$wushuang_mod__lvlingqi1"] = "猛将策良骥,长戟破敌营。",
["$wushuang_mod__lvlingqi2"] = "杀气腾剑戟,严风卷戎装。",
["~mod__lvlingqi"] = "父亲,女儿好累……",
}
--3血许劭
local xushao = General(extension, "mod_ty__xushao", "qun", 3)
xushao:addSkill("ty__pingjian")
Fk:loadTranslationTable{
["mod_ty__xushao"] = "许劭",
["#mod_ty__xushao"] = "识人读心",
["designer:mod_ty__xushao"] = "韩旭",
["illustrator:mod_ty__xushao"] = "Thinking",
["~mod_ty__xushao"] = "守节好耻,不可逡巡……",
}
--正常将池版许劭
local xushao = General(extension, "mod_r_ty__xushao", "qun", 4)
---@param player ServerPlayer
local addTYPingjianSkill = function(player, skill_name)
local room = player.room
local skill = Fk.skills[skill_name]
if skill == nil or player:hasSkill(skill_name, true) then return false end
room:handleAddLoseSkills(player, skill_name, nil)
local pingjian_skills = player:getTableMark("mod_ty__pingjian_skills")
table.insertIfNeed(pingjian_skills, skill_name)
room:setPlayerMark(player, "mod_ty__pingjian_skills", pingjian_skills)
local pingjian_skill_times = player:getTableMark("mod_ty__pingjian_skill_times")
table.insert(pingjian_skill_times, {skill_name, player:usedSkillTimes(skill_name)})
for _, s in ipairs(skill.related_skills) do
table.insert(pingjian_skill_times, {s.name, player:usedSkillTimes(s.name)})
end
room:setPlayerMark(player, "mod_ty__pingjian_skill_times", pingjian_skill_times)
end
---@param player ServerPlayer
local removeTYPingjianSkill = function(player, skill_name)
local room = player.room
local skill = Fk.skills[skill_name]
if skill == nil then return false end
room:handleAddLoseSkills(player, "-" .. skill_name, nil)
local pingjian_skills = player:getTableMark("mod_ty__pingjian_skills")
table.removeOne(pingjian_skills, skill_name)
room:setPlayerMark(player, "mod_ty__pingjian_skills", pingjian_skills)
local invoked = false
local pingjian_skill_times = player:getTableMark("mod_ty__pingjian_skill_times")
local record_copy = {}
for _, pingjian_record in ipairs(pingjian_skill_times) do
if #pingjian_record == 2 then
local record_name = pingjian_record[1]
if record_name == skill_name or not table.every(skill.related_skills, function (s)
return s.name ~= record_name end) then
if player:usedSkillTimes(record_name) > pingjian_record[2] then
invoked = true
end
else
table.insert(record_copy, pingjian_record)
end
end
end
room:setPlayerMark(player, "mod_ty__pingjian_skill_times", record_copy)
end
local function getPingjianSkills(player, event)
local list = {
["play"] = {
"qiangwu", "qiangxi", "luanji", "ty_ex__sanyao", "ol__xuehen", "ty__fenyue", "ex__yijue", "daoshu", "m_ex__xianzhen",
"tianyi", "zhanjue", "mansi", "ty__lianji", "ty_ex__wurong", "lianhuan", "jiuchi", "ty_ex__zenhui", "duwu", "xuezhao", "kurou", "jianyan", "ty_ex__mieji",
"ex__zhiheng", "ex__guose", "ty_ex__shenxing", "songci", "guolun", "duliang", "gongxin", "lueming", "jijie", "busuan", "minsi", "ty__lianzhu",
"ex__fanjian", "tanbei", "ty__qingcheng", "jinhui", "chengshang", "weimeng", "ty__songshu", "poxi", "ty_ex__ganlu", "qixi", "ty__kuangfu", "qice",
"ty_ex__gongqi", "ty_ex__huaiyi", "dingpan", "shanxi", "cuijian", "tiaoxin", "qingnang", "quji", "ty_ex__anguo", "limu", "ex__jieyin",
"ty_ex__anxu", "ty_ex__mingce", "ziyuan", "lijian", "mingjian", "ex__rende", "mizhao", "yanjiao", "dimeng",
"zhijian", "quhu", "tunan", "nuchen", "kanji", "duanliang", "huoji", "feijun", "ty_ex__pindi", "chaofeng", "yingshui", "qiongying", "zigu", "weiwu", "chiying",
},
[fk.Damaged] = {
"ty_ex__yaoming", "danxin", "guixin", "ty__benyu", "fankui", "ex__ganglie", "ex__yiji", "ex__jianxiong", "ty_ex__enyuan", "jijing", "chouce", "jieming",
"fangzhu", "jiushi", "ty_ex__chengxiang", "huituo", "ty__wangxi", "yuce", "zhichi", "ty_ex__zhiyu", "yachai", "wanggui", "qianlong", "peiqi",
},
[fk.EventPhaseStart] = {
"junbing", "ty_ex__zhiyan", "tunjiang", "ex__biyue", "ty_ex__jingce", "zhenxing", "moshi", "zuilun", "fujian", "kunfen", "ol_ex__jushou", "zhengu", "os_ex__bingyi", "miji",
"juece", "huimin","sp__youdi", "kuanshi", "ty__jieying", "suizheng", "ty_ex__zhenjun", "jujian", "daiyan", "nuanhui", "ty__qinqing"
},
}
local used_skills = player:getTableMark("mod_ty__pingjian_used_skills")
return table.filter(list[event] or {}, function (skill_name)
return Fk.skills[skill_name] and not table.contains(used_skills, skill_name) and not player:hasSkill(skill_name, true)
end)
end
local ty__pingjian = fk.CreateActiveSkill{
name = "mod_ty__pingjian",
prompt = "#mod_ty__pingjian-active",
card_num = 0,
target_num = 0,
can_use = function(self, player)
return player:getMark("mod_ty__pingjian_used-phase") == 0
end,
card_filter = Util.FalseFunc,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:setPlayerMark(player, "mod_ty__pingjian_used-phase", 1)
local skills = getPingjianSkills(player, "play")
if #skills == 0 then return false end
local choices = table.random(skills, 3)
local skill_name = room:askForChoice(player, choices, self.name, "#mod_ty__pingjian-choice", true)
local used_skills = player:getTableMark("mod_ty__pingjian_used_skills")
table.insert(used_skills, skill_name)
room:setPlayerMark(player, "mod_ty__pingjian_used_skills", used_skills)
local phase_event = room.logic:getCurrentEvent():findParent(GameEvent.Phase)
if phase_event ~= nil then
addTYPingjianSkill(player, skill_name)
phase_event:addCleaner(function()
removeTYPingjianSkill(player, skill_name)
end)
end
end,
}
local ty__pingjian_trigger = fk.CreateTriggerSkill{
name = "#mod_ty__pingjian_trigger",
events = {fk.Damaged, fk.EventPhaseStart},
main_skill = ty__pingjian,
mute = true,
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(ty__pingjian) or player ~= target then return false end
if event == fk.Damaged then
return true
elseif event == fk.EventPhaseStart then
return player.phase == Player.Finish
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player, ty__pingjian.name)
player:broadcastSkillInvoke(ty__pingjian.name)
local skills = getPingjianSkills(player, event)
if #skills == 0 then return false end
local choices = table.random(skills, 3)
local skill_name = room:askForChoice(player, choices, ty__pingjian.name, "#mod_ty__pingjian-choice", true)
local used_skills = player:getTableMark("mod_ty__pingjian_used_skills")
table.insert(used_skills, skill_name)
room:setPlayerMark(player, "mod_ty__pingjian_used_skills", used_skills)
local skill = Fk.skills[skill_name]
if skill == nil then return false end
addTYPingjianSkill(player, skill_name)
if skill:triggerable(event, target, player, data) then
skill:trigger(event, target, player, data)
end
removeTYPingjianSkill(player, skill_name)
end,
}
local ty__pingjian_invalidity = fk.CreateInvaliditySkill {
name = "#mod_ty__pingjian_invalidity",
invalidity_func = function(self, player, skill)
local pingjian_skill_times = player:getTableMark("mod_ty__pingjian_skill_times")
return table.find(pingjian_skill_times, function (pingjian_record)
if #pingjian_record == 2 then
local skill_name = pingjian_record[1]
if skill.name == skill_name or not table.every(skill.related_skills, function (s)
return s.name ~= skill_name end) then
return player:usedSkillTimes(skill_name) > pingjian_record[2]
end
end
end)
end
}
ty__pingjian:addRelatedSkill(ty__pingjian_trigger)
ty__pingjian:addRelatedSkill(ty__pingjian_invalidity)
xushao:addSkill(ty__pingjian)
Fk:loadTranslationTable{
["mod_r_ty__xushao"] = "许劭",
["#mod_r_ty__xushao"] = "识人读心",
["designer:mod_r_ty__xushao"] = "韩旭",
["illustrator:mod_r_ty__xushao"] = "Thinking",
["mod_ty__pingjian"] = "评荐",
["#mod_ty__pingjian_trigger"] = "评荐",
[":mod_ty__pingjian"] = "出牌阶段,或结束阶段,或当你受到伤害后,你可以从对应时机的技能池中随机抽取三个技能,"..
"然后你选择并视为拥有其中一个技能直到时机结束(每个技能限发动一次)。",
["#mod_ty__pingjian-active"] = "发动 评荐,从三个出牌阶段的技能中选择一个学习",
["#mod_ty__pingjian-choice"] = "评荐:选择要学习的技能",
["$mod_ty__pingjian1"] = "识人读心,评荐推达。",
["$mod_ty__pingjian2"] = "月旦雅评,试论天下。",
["~mod_r_ty__xushao"] = "守节好耻,不可逡巡……",
}
--单救陷陈泰
local chentai = General(extension, "mod_ty__chentai", "wei", 4)
chentai:addSkill("jiuxianc")
Fk:loadTranslationTable{
["mod_ty__chentai"] = "陈泰",
["#mod_ty__chentai"] = "岳峙渊渟",
["illustrator:mod_ty__chentai"] = "画画的闻玉",
["~mod_ty__chentai"] = "公非旦,我非勃……",
}
--樊玉凤修改
local fanyufeng = General(extension, "mod__fanyufeng", "qun", 3, 3, General.Female)
local bazhan = fk.CreateActiveSkill{
name = "mod__bazhan",
anim_type = "switch",
switch_skill_name = "mod__bazhan",
prompt = function ()
return Self:getSwitchSkillState("mod__bazhan", false) == fk.SwitchYang and "#mod__bazhan-Yang" or "#mod__bazhan-Yin"
end,
target_num = 1,
max_card_num = function ()
return (Self:getSwitchSkillState("mod__bazhan", false) == fk.SwitchYang) and 2 or 0
end,
min_card_num = function ()
return (Self:getSwitchSkillState("mod__bazhan", false) == fk.SwitchYang) and 1 or 0
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) < 1
end,
card_filter = function(self, to_select, selected)
return #selected < self:getMaxCardNum() and Fk:currentRoom():getCardArea(to_select) ~= Player.Equip
end,
target_filter = function(self, to_select, selected, selected_cards)
return #selected_cards >= self:getMinCardNum() 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])
local isYang = player:getSwitchSkillState(self.name, true) == fk.SwitchYang
local to_check = {}
if isYang and #effect.cards > 0 then
table.insertTable(to_check, effect.cards)
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(to_check)
room:obtainCard(target.id, dummy, false, fk.ReasonGive, player.id)
elseif not isYang and not target:isKongcheng() then
to_check = room:askForCardsChosen(player, target, 1, 1, "h", self.name)
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(to_check)
room:obtainCard(player, dummy, false, fk.ReasonPrey)
target = player
end
if not player.dead and not target.dead and table.find(to_check, function (id)
return Fk:getCardById(id).name == "analeptic" or Fk:getCardById(id).suit == Card.Heart end) then
local choices = {"cancel"}
if not target.faceup or target.chained then
table.insert(choices, 1, "mod__bazhan_reset")
end
if target:isWounded() then
table.insert(choices, 1, "recover")
end
if #choices > 1 then
local choice = room:askForChoice(player, choices, self.name, "#mod__bazhan-support::" .. target.id)
if choice == "recover" then
room:recover{ who = target, num = 1, recoverBy = player, skillName = self.name }
elseif choice == "mod__bazhan_reset" then
if not target.faceup then
target:turnOver()
end
if target.chained then
target:setChainState(false)
end
end
end
end
end,
}
local jiaoying = fk.CreateTriggerSkill{
name = "mod__jiaoying",
events = {fk.AfterCardsMove},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
for _, move in ipairs(data) do
if move.from == player.id and move.to and move.to ~= player.id and move.toArea == Card.PlayerHand then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand then
return true
end
end
end
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local mod__jiaoying_targets = type(player:getMark("mod__jiaoying_targets-turn")) == "table" and player:getMark("mod__jiaoying_targets-turn") or {}
for _, move in ipairs(data) do
if move.from == player.id and move.to and move.to ~= player.id and move.toArea == Card.PlayerHand then
local to = room:getPlayerById(move.to)
local mod__jiaoying_colors = type(to:getMark("mod__jiaoying_colors-turn")) == "table" and to:getMark("mod__jiaoying_colors-turn") or {}
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand then
local color = Fk:getCardById(info.cardId).color
if color ~= Card.NoColor then
table.insertIfNeed(mod__jiaoying_colors, color)
table.insertIfNeed(mod__jiaoying_targets, to.id)
if to:getMark("@mod__jiaoying-turn") == 0 then
room:setPlayerMark(to, "@mod__jiaoying-turn", {})
end
end
end
end
room:setPlayerMark(to, "mod__jiaoying_colors-turn", mod__jiaoying_colors)
end
end
room:setPlayerMark(player, "mod__jiaoying_targets-turn", mod__jiaoying_targets)
end,
refresh_events = {fk.PreCardUse},
can_refresh = function(self, event, target, player, data)
local mod__jiaoying_targets = type(player:getMark("mod__jiaoying_targets-turn")) == "table" and player:getMark("mod__jiaoying_targets-turn") or {}
local mod__jiaoying_ignores = type(player:getMark("mod__jiaoying_ignores-turn")) == "table" and player:getMark("mod__jiaoying_ignores-turn") or {}
return table.contains(mod__jiaoying_targets, target.id) and not table.contains(mod__jiaoying_ignores, target.id)
end,
on_refresh = function(self, event, target, player, data)
local mod__jiaoying_ignores = type(player:getMark("mod__jiaoying_ignores-turn")) == "table" and player:getMark("mod__jiaoying_ignores-turn") or {}
table.insert(mod__jiaoying_ignores, target.id)
player.room:setPlayerMark(player, "mod__jiaoying_ignores-turn", mod__jiaoying_ignores)
player.room:setPlayerMark(target, "@mod__jiaoying-turn", {"mod__jiaoying_usedcard"})
end,
}
local jiaoying_delay = fk.CreateTriggerSkill{
name = "#mod__jiaoying_delay",
events = {fk.EventPhaseStart},
frequency = Skill.Compulsory,
mute = true,
can_trigger = function(self, event, target, player, data)
if target.phase == Player.Finish then
local mod__jiaoying_targets = type(player:getMark("mod__jiaoying_targets-turn")) == "table" and player:getMark("mod__jiaoying_targets-turn") or {}
local mod__jiaoying_ignores = type(player:getMark("mod__jiaoying_ignores-turn")) == "table" and player:getMark("mod__jiaoying_ignores-turn") or {}
self.cost_data = #mod__jiaoying_targets - #mod__jiaoying_ignores
if self.cost_data > 0 then
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local x = self.cost_data
local targets = player.room:askForChoosePlayers(player, table.map(table.filter(room.alive_players, function (p)
return p:getHandcardNum() < 5 end), Util.IdMapper), 1, x, "#mod__jiaoying-choose:::" .. x, self.name, true)
if #targets > 0 then
room:sortPlayersByAction(targets)
for _, pid in ipairs(targets) do
local to = room:getPlayerById(pid)
if not to.dead and to:getHandcardNum() < to.maxHp then
if to.maxHp-to:getHandcardNum() > 5 then
to:drawCards(5, self.name)
else
to:drawCards(to.maxHp-to:getHandcardNum(), self.name)
end
end
end
end
end,
}
local jiaoying_prohibit = fk.CreateProhibitSkill{
name = "#mod__jiaoying_prohibit",
prohibit_use = function(self, player, card)
local mod__jiaoying_colors = player:getMark("mod__jiaoying_colors-turn")
return type(mod__jiaoying_colors) == "table" and table.contains(mod__jiaoying_colors, card.color)
end,
prohibit_response = function(self, player, card)
local mod__jiaoying_colors = player:getMark("mod__jiaoying_colors-turn")
return type(mod__jiaoying_colors) == "table" and table.contains(mod__jiaoying_colors, card.color)
end,
}
jiaoying:addRelatedSkill(jiaoying_delay)
jiaoying:addRelatedSkill(jiaoying_prohibit)
fanyufeng:addSkill(bazhan)
fanyufeng:addSkill(jiaoying)
Fk:loadTranslationTable{
["mod__fanyufeng"] = "樊玉凤",
["#mod__fanyufeng"] = "红鸾寡宿",
["cv:mod__fanyufeng"] = "杨子怡",
["illustrator:mod__fanyufeng"] = "杨杨和夏季",
["mod__bazhan"] = "把盏",
[":mod__bazhan"] = "转换技,出牌阶段限一次,阳:你可以交给一名其他角色至多两张手牌;阴:你可以获得一名其他角色一张手牌。"..
"然后若这些牌里包括【酒】或<font color='red'>♥</font>牌,你可令获得此牌的角色回复1点体力或复原武将牌。",
["mod__jiaoying"] = "醮影",
["#mod__jiaoying_delay"] = "醮影",
[":mod__jiaoying"] = "锁定技,其他角色获得你的手牌后,该角色本回合不能使用或打出与此牌颜色相同的牌。然后此回合结束阶段,"..
"若其本回合没有再使用牌,你令一名角色将手牌摸至体力上限(至多摸五张)。",
["#mod__bazhan-Yang"] = "把盏(阳):选择一至两张手牌,交给一名其他角色",
["#mod__bazhan-Yin"] = "把盏(阴):选择一名有手牌的其他角色,获得其一张手牌",
["#mod__bazhan-support"] = "把盏:可以选择令 %dest 回复1点体力或复原武将牌",
["#mod__jiaoying-choose"] = "醮影:可选择至多%arg名角色将手牌补至体力上限(至多摸五张)",
["@mod__jiaoying-turn"] = "醮影",
["mod__jiaoying_usedcard"] = "使用过牌",
["$mod__bazhan1"] = "此酒,当配将军。",
["$mod__bazhan2"] = "这杯酒,敬于将军。",
["$mod__jiaoying1"] = "独酌清醮,霓裳自舞。",
["$mod__jiaoying2"] = "醮影倩丽,何人爱怜。",
["~mod__fanyufeng"] = "醮妇再遇良人难……",
}
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

搜索帮助