Commit 083ef523 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #18 from Sonic714/master

23.6.18 yume upd&fix
parents f064b2fd 32fc8ebb
No preview for this file type
......@@ -56,15 +56,6 @@ function c71401001.op1(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(0xff,0xfe)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c71401001.rmtg)
Duel.RegisterEffect(e1,tp)
end
function c71401001.rmtg(e,c)
return c:GetOwner()==e:GetHandlerPlayer()
......@@ -97,6 +88,15 @@ function c71401001.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(0xff,0xfe)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c71401001.rmtg)
Duel.RegisterEffect(e1,tp)
end
end
function yume.ButterflyCounter()
......@@ -118,6 +118,14 @@ end
function yume.ButterflyAcLimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function yume.AddThisCardBanishedAlreadyCheck(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e1)
return e1
end
function yume.AddButterflySpell(c,id)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71401001,2))
......
......@@ -39,7 +39,7 @@ function c71401002.op2(e,tp,eg,ep,ev,re,r,rp)
if tc then
local b1=tc:IsAbleToHand()
local b2=not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
if b1 and (not b2 or Duel.SelectOption(tp,1150,aux.Stringid(71401002,1))==0) then
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(71401002,1))==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
......
......@@ -49,7 +49,7 @@ function c71401003.op2(e,tp,eg,ep,ev,re,r,rp)
local b1=tc:IsAbleToHand()
local b2=not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
local flag=0
if b1 and (not b2 or Duel.SelectOption(tp,1152,aux.Stringid(71401003,1))==0) then
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(71401003,1))==0) then
flag=Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
......
--蝶现-「像」
xpcall(function() require("expansions/script/c71401001") end,function() require("script/c71401001") end)
function c71401004.initial_effect(c)
--same effect send this card to grave and spsummon another card check
--same effect sends this card to grave or banishes it, and spsummon another card check
local e0=aux.AddThisCardInGraveAlreadyCheck(c)
local e0a=yume.AddThisCardBanishedAlreadyCheck(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71401004,0))
......@@ -12,15 +13,21 @@ function c71401004.initial_effect(c)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetCountLimit(1,71401004)
e1:SetLabelObject(e0)
e1:SetCost(c71401004.cost1)
e1:SetCondition(c71401004.con1)
e1:SetTarget(c71401004.tg1)
e1:SetOperation(c71401004.op1)
c:RegisterEffect(e1)
local e1a=e1:Clone()
e1a:SetCode(EVENT_SPSUMMON_SUCCESS)
e1a:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1a:SetCondition(c71401004.con1)
e1a:SetLabelObject(e0)
c:RegisterEffect(e1a)
local e1b=e1a:Clone()
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
e1b:SetRange(LOCATION_REMOVED)
e1b:SetLabelObject(e0a)
c:RegisterEffect(e1b)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401004,1))
......@@ -44,13 +51,13 @@ function c71401004.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c71401004.filtercon1,1,nil,tp,se)
end
function c71401004.filterc1(c,tp)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGraveAsCost()
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToRemoveAsCost()
and Duel.GetMZoneCount(tp,c)>0
end
function c71401004.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401004.filterc1,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c71401004.filterc1,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c71401004.filterc1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
yume.RegButterflyCostLimit(e,tp)
end
......
......@@ -21,7 +21,7 @@ function c71401006.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function c71401006.filterc2(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToDeckOrExtraAsCost()
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToDeckAsCost()
end
function c71401006.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401006.filterc2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,nil) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
......
......@@ -33,7 +33,7 @@ function c71401007.con1(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c71401007.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
......@@ -70,11 +70,13 @@ function c71401007.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(c71401007.filter2,tp,LOCATION_HAND,0,nil,e,tp)
if Duel.Draw(tp,g:GetCount(),REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71401007,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
if Duel.Draw(tp,g:GetCount(),REASON_EFFECT)>0 then
local sg=Duel.GetMatchingGroup(c71401007.filter2,tp,LOCATION_HAND,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71401007,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
......@@ -50,7 +50,7 @@ end
function c71401008.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401008.filterc2,tp,LOCATION_ONFIELD,0,1,nil,tp) and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c71401008.filterc2,tp,LOCATION_ONFIELD,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c71401008.filterc2,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
yume.RegButterflyCostLimit(e,tp)
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