Commit 554bfbdc authored by Nemo Ma's avatar Nemo Ma

fix

parent b78a362f
......@@ -31,7 +31,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetTargetRange(0,1)
e1:SetValue(cm.damval)
Duel.RegisterEffect(e1,tp)
else op==2 then
elseif op==2 then
Duel.Draw(tp,3,REASON_EFFECT)
end
end
......
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
e2:SetOperation(cm.condition)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetTarget(cm.reptg)
......
--玄武的化身 芽殃
function c60159904.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,60159904)
e1:SetTarget(c60159904.target)
e1:SetOperation(c60159904.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60159901,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetTarget(c60159904.target2)
e2:SetOperation(c60159904.operation2)
c:RegisterEffect(e2)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c60159904.atkcost)
e3:SetTarget(c60159904.ctarget)
e3:SetOperation(c60159904.cactivate)
c:RegisterEffect(e3)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,60159904)
e1:SetTarget(c60159904.target)
e1:SetOperation(c60159904.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60159901,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetTarget(c60159904.target2)
e2:SetOperation(c60159904.operation2)
c:RegisterEffect(e2)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c60159904.atkcost)
e3:SetTarget(c60159904.ctarget)
e3:SetOperation(c60159904.cactivate)
c:RegisterEffect(e3)
end
function c60159904.sfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c60159904.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummon(tp)
and Duel.IsExistingMatchingCard(c60159904.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummon(tp)
and Duel.IsExistingMatchingCard(c60159904.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function c60159904.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if (tc:IsAttribute(ATTRIBUTE_WIND) or tc:IsAttribute(ATTRIBUTE_FIRE) or tc:IsAttribute(ATTRIBUTE_WATER))
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
if Duel.SelectYesNo(tp,aux.Stringid(60159901,1)) then
Duel.DisableShuffleCheck()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
else
Duel.ShuffleDeck(tp)
end
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if (tc:IsAttribute(ATTRIBUTE_WIND) or tc:IsAttribute(ATTRIBUTE_FIRE) or tc:IsAttribute(ATTRIBUTE_WATER))
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
if Duel.SelectYesNo(tp,aux.Stringid(60159901,1)) then
Duel.DisableShuffleCheck()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
else
Duel.ShuffleDeck(tp)
end
end
function c60159904.filter(c)
return ((c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_DRAGON))
or (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_WINDBEAST))
or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_BEAST))) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return ((c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_DRAGON))
or (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_WINDBEAST))
or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_BEAST))) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c60159904.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60159904.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if chk==0 then return Duel.IsExistingMatchingCard(c60159904.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c60159904.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60159904.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60159904.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c60159904.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_DRAGON) and c:IsAbleToRemoveAsCost()
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_AQUA) and c:IsAbleToRemoveAsCost()
end
function c60159904.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60159904.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c60159904.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
if chk==0 then return Duel.IsExistingMatchingCard(c60159904.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c60159904.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c60159904.ctarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c60159904.cactivate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_EFFECT)
end
end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_EFFECT)
end
end
end
\ No newline at end of file
......@@ -248,7 +248,7 @@ function cm.xcon(e)
end
end
function cm.imfilter(c,e)
return not c:IsImmuneToEffect(e)
return not c:IsImmuneToEffect(e) and not c:IsType(TYPE_TOKEN)
end
function cm.filter(c,tp)
return aux.GetColumn(c,tp)==1
......@@ -325,7 +325,7 @@ function cm.xop(e)
end
sg:RemoveCard(c)
for tc in aux.Next(sg) do
if tc:IsCanOverlay() and not tc:IsImmuneToEffect(e) then
if tc:IsCanOverlay() and not tc:IsImmuneToEffect(e) and not c:IsType(TYPE_TOKEN) then
local sg=tc:GetOverlayGroup()
if sg then
Duel.SendtoGrave(sg,REASON_RULE)
......
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