Commit e7071a1e authored by mercury233's avatar mercury233

add cards VB22

parent 57a603d6
--電脳堺獣-鷲々
function c35252119.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetCondition(c35252119.indcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(35252119,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,35252119)
e3:SetCost(c35252119.tgcost)
e3:SetTarget(c35252119.tgtg)
e3:SetOperation(c35252119.tgop)
c:RegisterEffect(e3)
end
function c35252119.indfilter(c,g)
return g:IsExists(c35252119.indfilter2,1,c,c)
end
function c35252119.indfilter2(c,tc)
return c:GetOriginalRace()&tc:GetOriginalRace()~=0
and c:GetOriginalAttribute()&tc:GetOriginalAttribute()~=0
and not c:IsCode(tc:GetCode())
end
function c35252119.indcon(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
return g:IsExists(c35252119.indfilter,1,nil,g)
end
function c35252119.fselect(g)
return g:GetClassCount(Card.GetOriginalRace)==1
and g:GetClassCount(Card.GetOriginalAttribute)==1
and g:GetClassCount(Card.GetCode)>1
end
function c35252119.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c35252119.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c35252119.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:CheckSubGroup(c35252119.fselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,c35252119.fselect,false,2,2)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c35252119.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c35252119.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
--電脳堺龍-龍々
function c61641818.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,c61641818.mfilter,c61641818.xyzcheck,2,99)
c:EnableReviveLimit()
--cannot be effect target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
e1:SetCondition(c61641818.etcon)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(61641818,0))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,61641818)
e2:SetCondition(c61641818.discon)
e2:SetCost(c61641818.discost)
e2:SetTarget(c61641818.distg)
e2:SetOperation(c61641818.disop)
c:RegisterEffect(e2)
end
function c61641818.mfilter(c,xyzc)
return c:IsXyzType(TYPE_MONSTER) and c:IsXyzLevel(xyzc,3)
end
function c61641818.xyzcheck(g)
return g:GetClassCount(Card.GetRace)==1 and g:GetClassCount(Card.GetAttribute)==1
end
function c61641818.etcon(e)
return e:GetHandler():GetOverlayCount()~=0
end
function c61641818.discon(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()==0 or not re:IsActiveType(TYPE_MONSTER) then return false end
local tc=g:GetFirst()
local attr=0
while tc do
attr=attr|tc:GetAttribute()
tc=g:GetNext()
end
local rattr=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_ATTRIBUTE)
return rattr&attr==0
end
function c61641818.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c61641818.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c61641818.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
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