module("extensions.yu", package.seeall)
extension=sgs.Package("yu")
yulvbu=sgs.General(extension, "yulvbu", "qun", 4)
yuwushuang = sgs.CreateFilterSkill{
name = "yuwushuang",
view_filter = function(self,to_select)
return (to_select:isKindOf("TrickCard")) or (to_select:isKindOf("EquipCard"))
end,
view_as = function(self, card)
local slash = sgs.Sanguosha:cloneCard("Slash", card:getSuit(), card:getNumber())
slash:setSkillName(self:objectName())
local _card = sgs.Sanguosha:getWrappedCard(card:getId())
_card:takeOver(slash)
return _card
end
}
yuwushuang2 = sgs.CreateFilterSkill{
name = "#yuwushuang2" ,
view_filter = function(self, card)
return card:objectName() == "analeptic" or card:objectName() == "peach"
end ,
view_as = function(self, card)
local slash = sgs.Sanguosha:cloneCard("slash", card:getSuit(), card:getNumber())
slash:setSkillName(self:objectName())
local wrap = sgs.Sanguosha:getWrappedCard(card:getId())
wrap:takeOver(slash)
return wrap
end
}
Table2IntList = function(theTable)
local result = sgs.IntList()
for i = 1, #theTable, 1 do
result:append(theTable[i])
end
return result
end
yuwushuang1 = sgs.CreateTriggerSkill{
name = "#yuwushuang1" ,
frequency = sgs.Skill_Compulsory ,
events = {sgs.TargetConfirmed,sgs.CardEffected } ,
on_trigger = function(self, event, player, data)
local room = player:getRoom()
if event == sgs.TargetConfirmed then
local use = data:toCardUse()
local can_invoke = false
if use.card:isKindOf("Slash") and (player and player:isAlive() and player:hasSkill(self:objectName())) and (use.from:objectName() == player:objectName()) then
can_invoke = true
local jink_table = sgs.QList2Table(player:getTag("Jink_" .. use.card:toString()):toIntList())
for i = 0, use.to:length() - 1, 1 do
if jink_table[i + 1] == 1 then
jink_table[i + 1] = 2
end
end
local jink_data = sgs.QVariant()
jink_data:setValue(Table2IntList(jink_table))
player:setTag("Jink_" .. use.card:toString(), jink_data)
end
elseif event == sgs.CardEffected then
local effect = data:toCardEffect()
if effect.card:isKindOf("Duel") then
if effect.from and effect.from:isAlive() and effect.from:hasSkill(self:objectName()) then
can_invoke = true
end
if effect.to and effect.to:isAlive() and effect.to:hasSkill(self:objectName()) then
can_invoke = true
end
end
if not can_invoke then return false end
if effect.card:isKindOf("Duel") then
if room:isCanceled(effect) then
effect.to:setFlags("Global_NonSkillNullify")
return true;
end
if effect.to:isAlive() then
local second = effect.from
local first = effect.to
room:setEmotion(first, "duel");
room:setEmotion(second, "duel")
while true do
if not first:isAlive() then
break
end
local slash
if second:hasSkill(self:objectName()) then
slash = room:askForCard(first,"slash","@Luawushuang-slash-1:" .. second:objectName(),data,sgs.Card_MethodResponse, second);
if slash == nil then
break
end
slash = room:askForCard(first, "slash", "@Luawushuang-slash-2:" .. second:objectName(),data,sgs.Card_MethodResponse,second);
if slash == nil then
break
end
else
slash = room:askForCard(first,"slash","duel-slash:" .. second:objectName(),data,sgs.Card_MethodResponse,second)
if slash == nil then
break
end
end
local temp = first
first = second
second = temp
end
local daamgeSource = function() if second:isAlive() then return secoud else return nil end end
local damage = sgs.DamageStruct(effect.card, daamgeSource() , first)
if second:objectName() ~= effect.from:objectName() then
damage.by_user = false;
end
room:damage(damage)
end
room:setTag("SkipGameRule",sgs.QVariant(true))
end
end
return false
end ,
can_trigger = function(self, target)
return target
end,
priority = 1,
}
yushenzhuang = sgs.CreateDistanceSkill{
name = "yushenzhuang",
correct_func = function(self, from, to)
if from:hasSkill("yushenzhuang") then
return -1
end
end,
}
yushenzhuang1 = sgs.CreateTargetModSkill{
name = "#yushenzhuang1" ,
extra_target_func = function(self, from)
if from:hasSkill(self:objectName()) and from:getWeapon() == nil then
return 2
else
return 0
end
end
}
yulvbu:addSkill(yuwushuang)
yulvbu:addSkill(yuwushuang1)
yulvbu:addSkill(yushenzhuang)
yulvbu:addSkill(yushenzhuang1)
yulvbu:addSkill(yuwushuang2)
sgs.LoadTranslationTable{
["yu"]="御",
["yulvbu"]="吕布",
["&yulvbu"]="吕布",
["#yulvbu"]="渣沈的自制",
["designer:yulvbu"]="沈涵浚",
["cv:yulvbu"]="暂无",
["illustrator:yulvbu"]="",
["yuwushuang"]="无双",
[":yuwushuang"]="锁定技,除了你的【闪】以外所有类的牌均视为【杀】。当你使用【杀】指定一名目标角色后,该角色需连续使用两张【闪】才能抵消;与你进行【决斗】的角色,每次需连续打出两张【杀】。",
["yushenzhuang"]="神装",
[":yushenzhuang"]="锁定技,当你计算与其他角色的距离时,始终-1。若你的装备区没有武器牌,则视为你拥有【方天画戟】的武器特效 ",
}
这个就是LUA 很简单的就是各种技能的拼凑