Commit 74c705eb authored by POLYMER's avatar POLYMER

fix

parent 364f44cc
No preview for this file type
--方舟骑士-推进之王·摧城
local m=29047151
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,29065500)
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,cm.mfilter,aux.TRUE,2,2)
--Effect 1
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(1,m)
e0:SetCost(cm.cost)
e0:SetTarget(cm.tg)
e0:SetOperation(cm.op)
c:RegisterEffect(e0)
end
function cm.mfilter(c,xyzc)
local b1=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
local b2=c:IsXyzLevel(xyzc,5)
local b3=c:IsXyzLevel(xyzc,6)
return b1 and (b2 or b3)
end
--Effect 1
function cm.f(c)
local b1=aux.IsCodeListed(c,29065500) and c:IsType(TYPE_MONSTER)
return b1 and c:IsAbleToHand()
end
function cm.f1(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function cm.f2(c,tp)
return c:IsCode(29065554) and c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.f3,tp,LOCATION_DECK,0,1,c)
end
function cm.f3(c)
local b1=c:IsRace(RACE_BEASTWARRIOR) and c:IsAttribute(ATTRIBUTE_EARTH)
local b2=c:IsType(TYPE_RITUAL)
return b1 and b2 and c:IsAbleToHand()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.f,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.f1,tp,LOCATION_DECK,0,nil)
local g3=Duel.GetMatchingGroup(cm.f2,tp,LOCATION_DECK,0,nil,tp)
local b1=Duel.IsCanRemoveCounter(tp,1,0,0x10ae,1,REASON_COST) and #g1>0
local b2=Duel.IsCanRemoveCounter(tp,1,0,0x10ae,2,REASON_COST) and #g2>0
local b3=Duel.IsCanRemoveCounter(tp,1,0,0x10ae,3,REASON_COST) and #g3>0
if chk==0 then return b1 end
local ct=0
if b1 then
ct=ct+1
end
if b1 and b2 then
ct=ct+1
end
if b1 and b2 and b3 then
ct=ct+1
end
if ct==0 then return end
local tbl={}
for i=1,ct do
table.insert(tbl,i)
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local num=Duel.AnnounceNumber(tp,table.unpack(tbl))
Duel.RemoveCounter(tp,1,0,0x10ae,num,REASON_COST)
e:SetLabel(num)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if ct==3 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,4,tp,LOCATION_DECK)
elseif ct==2 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
else
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local g1=Duel.GetMatchingGroup(cm.f,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.f1,tp,LOCATION_DECK,0,nil)
local g3=Duel.GetMatchingGroup(cm.f2,tp,LOCATION_DECK,0,nil,tp)
if ct==0 then return end
if ct==3 then
if #g1==0 or #g2==0 or #g3==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg2=g2:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg3=g3:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg4=Duel.SelectMatchingCard(tp,cm.f3,tp,LOCATION_DECK,0,1,1,tc3)
if #tg1==0 or #tg2==0 or #tg3==0 or #tg4==0 then return end
local mg=Group.CreateGroup()
mg:Merge(tg1)
mg:Merge(tg2)
mg:Merge(tg3)
mg:Merge(tg4)
if #mg<3 then return end
Duel.SendtoHand(mg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,mg)
elseif ct==2 then
if #g1==0 or #g2==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg2=g2:Select(tp,1,1,nil)
if #tg1==0 or #tg2==0 then return end
local mg=Group.CreateGroup()
mg:Merge(tg1)
mg:Merge(tg2)
if #mg<1 then return end
Duel.SendtoHand(mg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,mg)
else
if #g1==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local mg=g1:Select(tp,1,1,nil)
if #mg==0 then return end
Duel.SendtoHand(mg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,mg)
end
end
\ No newline at end of file
--方舟骑士-暴行
c29071651.named_with_Arknight=1
function c29071651.initial_effect(c)
aux.AddCodeList(c,29065500,29065502)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29071651,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCountLimit(1,29071651+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29071651.spcon)
e1:SetOperation(c29071651.spop)
c:RegisterEffect(e1)
--attack all
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetValue(1)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(29071651,ACTIVITY_SUMMON,c29071651.counterfilter)
Duel.AddCustomActivityCounter(29071651,ACTIVITY_SPSUMMON,c29071651.counterfilter)
end
function c29071651.counterfilter(c)
return not (c:IsCode(29065502) or c:IsCode(29065500))
end
function c29071651.spcon(e,c)
if c==nil then return true end
return (Duel.GetCustomActivityCount(29071651,tp,ACTIVITY_SUMMON)~=0
or Duel.GetCustomActivityCount(29071651,tp,ACTIVITY_SPSUMMON)~=0)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and (Duel.IsCanRemoveCounter(c:GetControler(),1,0,0x10ae,2,REASON_COST)
or (Duel.GetFlagEffect(tp,29096814)==1 and Duel.IsCanRemoveCounter(c:GetControler(),1,0,0x10ae,1,REASON_COST)))
end
function c29071651.spop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.GetFlagEffect(tp,29096814)==1 then
Duel.ResetFlagEffect(tp,29096814)
Duel.RemoveCounter(tp,1,0,0x10ae,1,REASON_RULE)
else
Duel.RemoveCounter(tp,1,0,0x10ae,2,REASON_RULE)
end
end
\ No newline at end of file
--方舟骑士-白铁
local m=29093139
local cm=_G["c"..m]
cm.named_with_Arknight=1
function cm.initial_effect(c)
aux.AddCodeList(c,29065500,29065502)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+m)
e2:SetCost(cm.tkcost)
e2:SetTarget(cm.tktg)
e2:SetOperation(cm.tkop)
c:RegisterEffect(e2)
end
--Effect 1
function cm.con(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_ONFIELD,0,nil,29065500,29065502)
return #g>0
end
function cm.f(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsAbleToHand()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local loc=e:GetActivateLocation()
local g=Duel.GetMatchingGroup(cm.f,tp,LOCATION_GRAVE,0,nil)
local b1=loc==LOCATION_HAND and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=loc==LOCATION_MZONE and #g>0
if chk==0 then return b1 or b2 end
if loc==LOCATION_HAND then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(cm.op1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e:SetOperation(cm.op2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.f),tp,LOCATION_GRAVE,0,nil)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if #sg==0 then return end
Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
--Effect 2
function cm.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x10ae,1,REASON_COST)end
Duel.RemoveCounter(tp,1,0,0x10ae,1,REASON_COST)
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,1500,1500,6,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,1500,1500,6,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP,1-tp) then
local token=Duel.CreateToken(tp,m+1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e2,true)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
......@@ -55,7 +55,7 @@ function c9910028.desop(e,tp,eg,ep,ev,re,r,rp)
if not tc:IsRelateToEffect(e) or Duel.Destroy(tc,REASON_EFFECT)==0 then return end
local lab=Duel.GetFlagEffectLabel(tp,9910048)
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(nil,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local g2=Duel.GetMatchingGroup(nil,tp,LOCATION_REMOVED,0,nil)
local g3=Duel.GetMatchingGroup(c9910028.thfilter1,tp,0x70,0x70,nil,tp,Duel.GetTurnCount())
local off=1
local ops={}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment