1 Star 0 Fork 1

该账号已注销/xiaobai

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
xiaobai_parallel.lua 13.35 KB
一键复制 编辑 原始数据 按行查看 历史
该账号已注销 提交于 2024-10-28 23:31 . 10/2/88
local extension=Package("xiaobai_parallel")
extension.extensionName="xiaobai"
Fk:loadTranslationTable{
["xiaobai_parallel"]="平行宇宙",
}
local U = require "packages/utility/utility"
local RUtil = require "packages/xiaobai/utility/rfenghou_util"
local weizhuge= General(extension, "xiaobai_parallel__weizhugeliang", "wei", 3)--魏国诸葛亮
local wuzhuge= General(extension, "xiaobai_parallel__wuzhugeliang", "wu", 3)--吴国诸葛亮
wuzhuge.hidden=true
local kuitian = fk.CreateTriggerSkill{
name = "xiaobai__kuitian",
anim_type = "special",
frequency = Skill.Compulsory,
events ={fk.StartPindian,fk.EventPhaseChanging,fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return end
if event == fk.StartPindian then
return player == data.from or table.contains(data.tos, player) and player:getMark( "xiaobai__kuitian1")==0
elseif event==fk.EventPhaseChanging then
return target == player and player:getMark( "xiaobai__kuitian2")==0 and data.to > Player.Start and data.to < Player.Finish
elseif event==fk.TurnEnd then
return player:getMark( "xiaobai__kuitian_lost-turn")>0 and player:getMark( "xiaobai__kuitian3")==0
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
if event == fk.EventPhaseChanging then
self.cost_data=nil
local to = room:askForChoosePlayers(player, table.map(table.filter(room.alive_players, function(p)
return player:canPindian(p,nil,true) end), Util.IdMapper), 1, 1, "#xiaobai__kuitian-choose", self.name, true)
if #to > 0 then
self.cost_data = to[1]
end
return true
else
return true
end
end,
on_use = function(self, event, target, player, data)
local room=player.room
if event == fk.StartPindian then
if player ~= data.from then
data.fromCard = Fk:getCardById(room:getNCards(1)[1])
end
for _, to in ipairs(data.tos) do
if to ~= player then
data.results[to.id] = data.results[player.id] or {}
data.results[to.id].toCard = Fk:getCardById(room:getNCards(1)[1])
end
end
elseif event==fk.EventPhaseChanging then
player:skip(data.to)
if self.cost_data then
local to = room:getPlayerById(self.cost_data)
local pindian = player:pindian({to}, self.name)
local winner = nil
if pindian.results[to.id].winner == player then
winner = player
elseif pindian.results[to.id].winner == to then
winner = to
end
if winner then
local wincard = (winner==player and pindian.fromCard) or pindian.results[winner.id].toCard
local ids = {}
table.insert(ids, pindian.fromCard:getEffectiveId())
table.insert(ids, pindian.results[to.id].toCard:getEffectiveId())
local use = U.askForUseRealCard(room, winner, ids, ".", self.name, "#kuitian-use", {expand_pile = ids}, true)
if use ~= nil then
room:useCard(use)
end
end
end
return true
elseif event==fk.TurnEnd then
local pattern = ".|2~9|spade"
local judge = {
who = player,
reason = "lightning",
pattern = pattern,
}
room:judge(judge)
player.room:obtainCard(player, judge.card, true, fk.ReasonJustMove, player.id, "xiaobai__kuitian")
if judge.card:matchPattern(pattern) then
room:damage{
to = player,
damage = 3,
damageType = fk.ThunderDamage,
skillName = self.name,
}
end
end
end,
refresh_events = {fk.AfterCardsMove},
can_refresh = function (self, event, target, player, data)
if player:getMark("xiaobai__kuitian_lost-turn") == 0 and player:isKongcheng() and player:hasSkill(self) then
for _, move in ipairs(data) do
if move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand then
return true
end
end
end
end
end
end,
on_refresh = function (self, event, target, player, data)
player.room:setPlayerMark(player, "xiaobai__kuitian_lost-turn", 1)
end,
}
local shisu= fk.CreateTriggerSkill{
name = "xiaobai__shisu",
anim_type = "defensive",
prompt="xiaobai__shisu-pro",
events = {fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target == player
and player.hp>0 and player:getMark( "xiaobai__kuitian"..player.hp)==0
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "xiaobai__kuitian"..player.hp, 1)
local n=0
for i=1, 3 do
n=n+player:getMark("xiaobai__kuitian"..i)
end
if n>=3 and player:hasSkill("xiaobai__mengliao") then
room:notifySkillInvoked(player, "xiaobai__mengliao", "support")
for i=1, 3 do
room:setPlayerMark(player, "xiaobai__kuitian"..i, 0)
end
if #player:getCardIds("h")<4 then
room:drawCards(player, 4-#player:getCardIds("h"), self.name)
end
end
local choices = {"xiaobai__shisu1","xiaobai__shisu2","xiaobai__shisu3"}
local x = player.hp
local choice = room:askForChoice(player, choices, self.name,"#xiaobai__shisu-ask")
if choice == "xiaobai__shisu1" then
room:drawCards(player, x, self.name)
local cards = room:askForDiscard(player, x, x, true, self.name, false,".","#shisu-ch1",true)
if #cards > 0 then
room:moveCardTo(cards, Card.DrawPile, nil, fk.ReasonPut, self.name, nil, true)
end
elseif choice == "xiaobai__shisu2" then
local targets = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 0, x, "#kuitian-choose-targets", self.name, true)
if #targets > 0 then
for _, id in ipairs(targets) do
room:getPlayerById(id):setChainState(true)
end
end
local tos = room:askForChoosePlayers(player,table.map(room.alive_players, Util.IdMapper), 1, 1, "#xiaobai-shisu-choose2", self.name, false)
local to
if #tos > 0 then
to = room:getPlayerById(tos[1])
room:damage{
from = player,
to = to,
damage = 1,
damageType = fk.FireDamage,
skillName = self.name,
}
end
elseif choice == "xiaobai__shisu3" then
local targets = table.map(table.filter(room:getOtherPlayers(player), function(p)
return not p:isKongcheng() end), Util.IdMapper)
if #targets >= 0 then
local tid = room:askForChoosePlayers(player, targets, 1, 1, "#kuitian-choose-target3", self.name)[1]
local to= room:getPlayerById(tid)
if not to:isNude() then
room:doIndicate(player.id, to)
local cards = room:askForCardsChosen(player, to, 0, x, "he", self.name)
room:throwCard(cards, self.name, to, player)
local get=table.filter(cards, function(c)
return Fk:getCardById(c).color== Card.Black end)
if #get>0 then
room:obtainCard(player, get, true, fk.ReasonJustMove, player.id, self.name)
end
end
end
end
return true
end,
}
local mengliao = fk.CreateTriggerSkill{
name = "xiaobai__mengliao",
anim_type = "support",
frequency = Skill.Compulsory,
}
local ifhistory=fk.CreateTriggerSkill{
name = "#xiaobai__ifhistory",
anim_type = "support",
mute=true,
frequency = Skill.Compulsory,
events = {fk.GamePrepared},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local g=player.general
local list={"intro__"..g}
room:setPlayerMark(player, "@[if]if_history",list)
end,
}
local xiaobai__intro_weizhuge=fk.CreateTriggerSkill{
name = "xiaobai__intro_weizhuge",
}
local xiaobai__intro_wuzhuge=fk.CreateTriggerSkill{
name = "xiaobai__intro_wuzhuge",
}
weizhuge:addSkill(ifhistory)
weizhuge:addSkill(xiaobai__intro_weizhuge)
weizhuge:addSkill(kuitian)
weizhuge:addSkill(shisu)
weizhuge:addSkill(mengliao)
Fk:addQmlMark{
name = "if",
how_to_show = function(name, value)
return " "
end,
qml_path = "packages/utility/qml/DetailBox"
}
wuzhuge:addSkill(xiaobai__intro_wuzhuge)
Fk:loadTranslationTable{
["xiaobai_parallel__weizhugeliang"]="诸葛亮",
["#xiaobai_parallel__weizhugeliang"]="<a href=':intro__xiaobai_parallel__weizhugeliang'>武忠王</a>",
["illustrator:xiaobai_parallel__weizhugeliang"] = "WH",
["designer:xiaobai_parallel__weizhugeliang"] = "食马者",
["@[if]if_history"]="佚史",
["#xiaobai__ifhistory"]="佚史",
["xiaobai__intro_weizhuge"]="佚史",
[":xiaobai__ifhistory"]="这个武将有段神秘的故事......",
[":xiaobai__intro_weizhuge"]="这个武将有段神秘的故事......<a href=':intro__xiaobai_parallel__weizhugeliang'>武忠王</a>",
["intro__xiaobai_parallel__weizhugeliang"]="武忠王(第二平行宇宙)",
[":intro__xiaobai_parallel__weizhugeliang"]=[[太和二年,诸葛亮与王朗舌战数百回合,虽得胜而归,然深觉逐年征战有伤天和,逆天而行更损民生。是夜忽梦三日凌空,九州蒸血,天狼夺日,牝鸡司晨,众星皆陨。又忽闻昭烈谓之曰:“朕汉帝也,当施仁德于万民,社稷为次!”
次日,亮罢军还蜀,又数日,蜀主刘禅降魏。太和五年,亮随张郃伐吴,以火计破横江锁。正始十年,司马懿叛,亮奉章帝于许昌伐懿,三月克之、帝拜之为相。后废九品中正,兴科举,施均田制、两税法。
世人称曰:“魏之起于太祖,兴于孔明也”。嘉平三年薨,谥曰武忠王。]],
["xiaobai__kuitian"]="喟天",
[":xiaobai__kuitian"]=[[锁定技,1.你拼点时,对方改为用牌堆顶牌拼点;<br>
2.你的所有阶段改为与一名角色拼点,赢者可使用其拼点牌;<br>
3.你失去所有手牌的回合结束后,你进行一次【闪电】判定并获得生效牌。]],
["#xiaobai__kuitian-choose"]="喟天:你可以与一名角色拼点",
["#kuitian-use"]="喟天:你可以使用本次拼点牌",
["xiaobai__shisu"]="释夙",
["xiaobai__shisu-pro"]="释夙:你可以删去“喟天”中对应项并防止伤害",
[":xiaobai__shisu"]=[[你受到伤害时,你可以删去“喟天”中第X项并防止之,然后你选择一项:<br>
1.摸X张牌并将等量牌置于牌堆顶;<br>
2.横置X名角色并分配1点火焰伤害;<br>
3.弃置一名角色X张牌并获得其中所有黑色牌(X为你体力值)。]],
["#xiaobai__shisu-ask"]="释夙:选择一项",
["xiaobai__shisu1"]="摸你体力值张牌并将等量牌置于牌堆顶",
["xiaobai__shisu2"]="横置至多你体力值名角色并分配1点火焰伤害",
["xiaobai__shisu3"]="弃置一名角色你体力值张牌并获得其中所有黑色牌",
["#shisu-ch1"]="释夙:将体力值张牌置于牌堆顶",
["#xiaobai-shisu-choose2"]="释夙:你可以分配1点火焰伤害",
["#kuitian-choose-targets"]="释夙:你可以横置至多你体力值名角色",
["#kuitian-choose-target3"]="释夙:你可以弃置一名角色你体力值张牌并获得其中所有黑色牌",
["xiaobai__mengliao"]="梦燎",
[":xiaobai__mengliao"]="锁定技,当你删去“喟天”中所有选项后,你将手牌摸至4张,恢复所有被删去的选项。",
["xiaobai_parallel__wuzhugeliang"]="诸葛亮",
["#xiaobai_parallel__wuzhugeliang"]="神策佑江东",
["illustrator:xiaobai_parallel__wuzhugeliang"] = "dixueyun",
["designer:xiaobai_parallel__wuzhugeliang"] = "淼龙",
["intro__xiaobai_parallel__wuzhugeliang"]="神策佑江东(第四平行宇宙)",
["xiaobai__intro_wuzhuge"]="佚史",
[":xiaobai__intro_wuzhuge"]="这个武将有段神秘的故事......<a href=':intro__xiaobai_parallel__wuzhugeliang'>神策佑江东</a>",
[":intro__xiaobai_parallel__wuzhugeliang"]=[[建安五年,诸葛亮随兄出山辅佐东吴。值孙策卒,孙权姊婿见而异之,荐之于权。与鲁肃等并见宾待,亮之智更令周瑜叹曰:“不生瑜,何生亮!”
黄武四年,吴主任亮为丞相,诸葛瑾、庞统辅之。亮继任后,外连战克敌,内昭明法度,时人皆服。赤乌四年,太子孙登薨,朝廷动荡。诸葛亮与周瑜、陆逊、庞统屡议立储之事,然吴主久未决。亮乃仿商山四皓,邀周瑜等四人共扶孙和,吴主遂立孙和为太子。二宫之乱,至此终结。
赤乌十二年冬,诸葛亮病重,于塌前诫兄之子恪、子瞻、继子乔以谦俭之德。次年一月,薨,谥号平。乔、恪、瞻皆承父志,为东吴肱骨之臣。
太平六年,诸葛恪、陆抗、庞宏三路伐魏。太平十年,天下归吴。]],
}
--[[
喟天:锁定技,1.你拼点时,对方改为用牌堆顶牌拼点;2.你的所有阶段改为拼点,赢者可使用其拼点牌;3.你失去所有手牌的回合结束后,你进行一次【闪电】判定并获得生效牌。
释夙:你受到伤害时,你可以删去“喟天”中第X项并防止之,然后你选择一项:1.摸X张牌并将等量牌置于牌堆顶;2.横置X名角色并分配1点火焰伤害;3.弃置一名角色X张牌并获得其中所有黑色牌(X为你体力值)。
梦燎:锁定技,当你删去“喟天”中所有选项后,你将手牌摸至4张,恢复所有被删去的选项。
--]]
return extension
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ssrzzy/xiaobai.git
git@gitee.com:ssrzzy/xiaobai.git
ssrzzy
xiaobai
xiaobai
master

搜索帮助