added luocha

This commit is contained in:
baisebaoma 2024-04-15 01:56:03 +08:00
parent 7d28f09508
commit df1381ca26
4 changed files with 151 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -2299,7 +2299,8 @@ local function master_can_trigger(is_fun, property)
end end
end end
if is_exist then return false end if is_exist then return false end
-- 确认自己有没有哪个武将牌有这个技能 -- 确认自己有没有哪个武将牌有这个技能。
-- TODO感觉这个可以写一个函数别的技能也用得上
local generals local generals
if player.deputyGeneral == "" then if player.deputyGeneral == "" then
generals = { player.general } generals = { player.general }

View File

@ -2386,4 +2386,153 @@ Fk:loadTranslationTable {
["$jy_zixing2"] = [[果……果然还是算了吧……会被认为是奇怪的人……]], ["$jy_zixing2"] = [[果……果然还是算了吧……会被认为是奇怪的人……]],
} }
local suzhan = fk.CreateActiveSkill {
name = "jy_suzhan",
mute = true,
prompt = "#jy_suzhan-prompt",
-- 注意can_use因为是在本地判定所以用的是ClientPlayer没有ServerPlayer那些函数
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and
#table.filter(Fk:currentRoom().alive_players, function(p) return #p:getCardIds("h") == 0 end) > 0
end,
target_num = 1,
target_filter = function(self, to_select, selected, selected_cards, card, extra_data)
if #selected == 1 then return false end
return Fk:currentRoom():getPlayerById(to_select):isKongcheng()
end,
card_num = 0,
card_filter = Util.FalseFunc,
interaction = function(self)
return UI.ComboBox { choices = { "1", "2" }, default = "2" }
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
player:broadcastSkillInvoke(self.name, math.random(3))
room:notifySkillInvoked(player, self.name, "support")
local n
if self.interaction.data == "1" then
n = 1
else
n = 2
end
local to = room:getPlayerById(effect.tos[1])
to:drawCards(n, self.name, "bottom")
room:setPlayerMark(to, "@jy_suzhan-round", n)
end,
}
local suzhan_trigger = fk.CreateTriggerSkill {
name = "#jy_suzhan_trigger",
mute = true,
frequency = Skill.Compulsory,
events = { fk.AfterCardsMove },
can_trigger = function(self, event, target, player, data)
local room = player.room
if not player:hasSkill(self) then return false end
for _, move in ipairs(data) do
local from = room:getPlayerById(move.from)
if from and from:getMark("@jy_suzhan-round") ~= 0 then
self.cost_data = from
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand then
return not from.dead and from:isKongcheng()
end
end
end
end
end,
on_use = function(self, event, target, player, data)
local from = self.cost_data
player:broadcastSkillInvoke("jy_suzhan", math.random(4, 5))
player.room:notifySkillInvoked(player, "jy_suzhan", "drawcard")
player:drawCards(2 * from:getMark("@jy_suzhan-round"), self.name)
player.room:setPlayerMark(from, "@jy_suzhan-round", 0)
end,
}
suzhan:addRelatedSkill(suzhan_trigger)
local zhuojing = fk.CreateViewAsSkill {
name = "jy_zhuojing",
anim_type = "defensive",
pattern = "peach",
prompt = "#jy_zhuojing-prompt",
view_as = function(self)
local card = Fk:cloneCard("peach")
card.skillName = self.name
card:addSubcards(Self:getCardIds("h"))
return card
end,
after_use = function(self, player, use)
if use.card.color == Card.NoColor then
local room = player.room
-- 所有我武将牌上的技能有哪些
local generals
local general_skills = {}
if player.deputyGeneral == "" then
generals = { player.general }
else
generals = { player.general, player.deputyGeneral }
end
for _, g in ipairs(generals) do
general_skills = table.connect(general_skills, Fk.generals[g].skills)
end
if not table.contains(general_skills, self) then return end
-- 选择一名角色
local result = room:askForChoosePlayers(player,
table.map(table.filter(room:getOtherPlayers(player), function(p) return #p:getCardIds("he") > 0 end),
Util.IdMapper),
1, 1,
"#jy_zhuojing-choose:::" .. #use.card.subcards)
if #result == 0 then return end
local target = room:getPlayerById(result[1])
room:askForDiscard(target, #use.card.subcards, #use.card.subcards, true, self.name, false, nil,
"#jy_zhuojing-discard:" .. player.id .. "::" .. #use.card.subcards)
-- local skill_name = room:askForChoice(target, { "jy_suzhan", "jy_zhuojing" }, self.name,
-- "#jy_zhuojing-skill:" .. player.id) -- TODO感觉可以用更好的UI
room:askForUseActiveSkill(player, "jy_suzhan",
"#jy_zhuojing-use::" .. target.id .. ":" .. Fk:translate("jy_suzhan"))
-- 这个函数会直接执行这个技能。问题是如果有的技能是有多个时机的,怎么办?如果有的是被动的,怎么办?所以我建议限定成只能用这两个技能。
-- 我觉得这里肯定有问题,因为没写时机。目前暂时仅可触发素绽
end
end,
enabled_at_play = function(self, player)
return not player:isKongcheng() and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0
end,
enabled_at_response = function(self, player, response)
return not player:isKongcheng() and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0
end
}
Fk:loadTranslationTable {
["jy__luocha"] = [[罗刹]],
["#jy__luocha"] = [[化外羁旅]],
["designer:jy__luocha"] = [[三秋]],
["cv:jy__luocha"] = [[赵路]],
["illustrator:jy__luocha"] = [[米哈游]],
["~jy__luocha"] = [[没能……实现啊……]],
["jy_suzhan"] = [[素绽]],
[":jy_suzhan"] = [[出牌阶段限一次你可以令一名没有手牌的角色从牌堆底摸X张牌X由你选择且至多为2。若如此做本轮其下次失去最后的手牌后你摸2X张牌。]],
["#jy_suzhan-prompt"] = [[素绽:选择一名没有手牌的角色摸一或两张牌]],
["@jy_suzhan-round"] = [[<font color="yellow">素绽</font>]],
["$jy_suzhan1"] = [[白花盛放。]],
["$jy_suzhan2"] = [[领受天赐。]],
["$jy_suzhan3"] = [[喜欢便拿去吧。]],
["$jy_suzhan4"] = [[你看,这不就回来了么。]],
["$jy_suzhan5"] = [[清算的时刻到了。]],
["jy_zhuojing"] = [[濯荆]],
[":jy_zhuojing"] = [[每回合限一次,你可以将所有手牌当【桃】使用。若此【桃】无颜色且你武将牌上有该技能,你可以令一名其他角色弃置等量的牌,且你可以视为发动〖素绽〗。]],
["#jy_zhuojing-prompt"] = [[濯荆:你可以将所有手牌当【桃】使用]],
["#jy_zhuojing-choose"] = [[濯荆:你可以令一名目标弃置%arg张牌]],
["#jy_zhuojing-discard"] = [[濯荆:弃置%arg张牌]],
-- ["#jy_zhuojing-skill"] = [[濯荆:选择令 %src 发动〖素绽〗]],
["#jy_zhuojing-use"] = [[濯荆:%dest 令你发动 %arg请指定目标]],
["$jy_zhuojing1"] = [[永眠非终焉……]],
["$jy_zhuojing2"] = [[逝者将再临!]],
}
local luocha = General(extension, "jy__luocha", "qun", 2, 3)
luocha:addSkill(suzhan)
luocha:addSkill(zhuojing)
return extension return extension