Commit 76274ed4 authored by mercury233's avatar mercury233

update scripts

parent 1aa68408
--Traptrix Genlisea
--Scripted by: XGlitchy30
function c100265054.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c100265054.efilter)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetDescription(aux.Stringid(100265054,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100265054)
e2:SetCost(c100265054.setcost)
e2:SetTarget(c100265054.settg)
e2:SetOperation(c100265054.setop)
c:RegisterEffect(e2)
end
function c100265054.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c100265054.setfilter(c,tp,code)
return c:IsSetCard(0x4c,0x89) and c:GetType()==TYPE_TRAP and c:IsSSetable() and (code==nil or c:GetCode()~=code)
and (c:IsLocation(LOCATION_GRAVE) or Duel.IsExistingMatchingCard(c100265054.setfilter,tp,LOCATION_GRAVE,0,1,c,c:GetCode()))
end
function c100265054.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100265054.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>=2 and Duel.IsExistingMatchingCard(c100265054.setfilter,tp,LOCATION_DECK,0,1,nil,tp,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function c100265054.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g1=Duel.SelectMatchingCard(tp,c100265054.setfilter,tp,LOCATION_DECK,0,1,1,nil,tp,nil)
if #g1<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100265054.setfilter),tp,LOCATION_GRAVE,0,1,1,g1:GetFirst(),tp,g1:GetFirst():GetCode())
g1:Merge(g2)
if #g1==2 then
if Duel.SSet(tp,g1)==0 then return end
local tc=g1:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
tc=g1:GetNext()
end
end
end
--Hollow Giants
--Scripted by: XGlitchy30
function c100265055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100265055.actcon)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c100265055.distg)
c:RegisterEffect(e2)
--send to GY
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c100265055.tgcon)
e3:SetTarget(c100265055.tgtg)
e3:SetOperation(c100265055.tgop)
c:RegisterEffect(e3)
end
function c100265055.cfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c100265055.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100265055.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100265055.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c100265055.distg(e,c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c100265055.egfilter(c)
local d=c:GetBattleTarget()
return c:GetSummonLocation()==LOCATION_EXTRA and d:GetSummonLocation()==LOCATION_EXTRA
end
function c100265055.pcheck(c,tp)
return c:GetPreviousControler()==tp
end
function c100265055.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100265055.egfilter,1,nil)
end
function c100265055.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
local tg,pct,player=eg:Filter(c100265055.egfilter,nil),0,0
for p=0,1 do
if tg:IsExists(c100265055.pcheck,1,nil,p) then
pct=pct+1
player=p
end
end
if pct==2 then player=PLAYER_ALL end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,player,1000)
end
function c100265055.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
local tg=eg:Filter(c100265055.egfilter,nil)
for p=0,1 do
if tg:IsExists(c100265055.pcheck,1,nil,p) then
Duel.Damage(p,1000,REASON_EFFECT,true)
end
end
Duel.RDComplete()
end
end
--Mayakashi Mayhem
--Scripted by: XGlitchy30
function c100265056.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--choose effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,100265056)
e2:SetCondition(c100265056.effcon)
e2:SetTarget(c100265056.efftg)
e2:SetOperation(c100265056.effop)
c:RegisterEffect(e2)
end
function c100265056.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsRace(RACE_ZOMBIE) and c:GetSummonLocation()~=LOCATION_EXTRA
end
function c100265056.setfilter(c)
return c:IsSetCard(0x121) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and not c:IsCode(100265056)
end
function c100265056.tgfilter(c)
return c:IsFaceup() and c:IsAbleToGrave()
end
function c100265056.effcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100265056.cfilter,1,nil)
end
function c100265056.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsPlayerCanDraw(tp,1) and (Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x1)==0)
local b2=Duel.IsExistingMatchingCard(c100265056.setfilter,tp,LOCATION_DECK,0,1,nil) and (Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x2)==0)
local b3=Duel.IsExistingMatchingCard(c100265056.tgfilter,tp,0,LOCATION_MZONE,1,nil) and (Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x4)==0)
local b4=(Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x8)==0)
if chk==0 then return b1 or b2 or b3 or b4 end
end
function c100265056.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local off=1
local ops={}
local opval={}
local b1=Duel.IsPlayerCanDraw(tp,1) and (Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x1)==0)
local b2=Duel.IsExistingMatchingCard(c100265056.setfilter,tp,LOCATION_DECK,0,1,nil) and (Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x2)==0)
local b3=Duel.IsExistingMatchingCard(c100265056.tgfilter,tp,0,LOCATION_MZONE,1,nil) and (Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x4)==0)
local b4=(Duel.GetFlagEffect(tp,100265056)<=0 or bit.band(Duel.GetFlagEffectLabel(tp,100265056),0x8)==0)
if b1 then
ops[off]=aux.Stringid(100265056,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(100265056,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(100265056,2)
opval[off-1]=3
off=off+1
end
if b4 then
ops[off]=aux.Stringid(100265056,3)
opval[off-1]=4
off=off+1
end
local sel=Duel.SelectOption(tp,table.unpack(ops))+1
if sel==1 then
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.GetFlagEffect(tp,100265056)<=0 then
Duel.RegisterFlagEffect(tp,100265056,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetFlagEffectLabel(tp,100265056,Duel.GetFlagEffectLabel(tp,100265056)|0x1)
elseif sel==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c100265056.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SSet(tp,g)
end
if Duel.GetFlagEffect(tp,100265056)<=0 then
Duel.RegisterFlagEffect(tp,100265056,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetFlagEffectLabel(tp,100265056,Duel.GetFlagEffectLabel(tp,100265056)|0x2)
elseif sel==3 then
local g=Duel.GetMatchingGroup(c100265056.tgfilter,tp,0,LOCATION_MZONE,nil)
if #g>0 then
local tg=g:GetMinGroup(Card.GetAttack)
if #tg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_EFFECT)
else
Duel.SendtoGrave(tg,REASON_EFFECT)
end
end
if Duel.GetFlagEffect(tp,100265056)<=0 then
Duel.RegisterFlagEffect(tp,100265056,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetFlagEffectLabel(tp,100265056,Duel.GetFlagEffectLabel(tp,100265056)|0x4)
else
Duel.Damage(1-tp,800,REASON_EFFECT)
if Duel.GetFlagEffect(tp,100265056)<=0 then
Duel.RegisterFlagEffect(tp,100265056,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetFlagEffectLabel(tp,100265056,Duel.GetFlagEffectLabel(tp,100265056)|0x8)
end
end
......@@ -49,9 +49,9 @@ end
function c100338034.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if d and d:IsControler(tp) then a,d=d,a end
if not a:IsControler(tp) then a,d=d,a end
e:SetLabelObject(a)
return a:IsCode(6007213) and a:IsFaceup() and a:IsControler(tp)
return a and a:IsCode(6007213) and a:IsFaceup() and a:IsControler(tp)
end
function c100338034.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100338034.cfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) end
......
......@@ -8,7 +8,7 @@ function c100414007.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414007,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100414007)
......
--六花のひとひら
--Scripted by mallu11
function c100414014.initial_effect(c)
--to hand or grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414014,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100414014)
e1:SetTarget(c100414014.target)
e1:SetOperation(c100414014.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414014,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100414114)
e2:SetCondition(c100414014.spcon)
e2:SetTarget(c100414014.sptg)
e2:SetOperation(c100414014.spop)
c:RegisterEffect(e2)
end
function c100414014.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x245) and not c:IsCode(100414014) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function c100414014.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100414014.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100414014.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100414014,2))
local g=Duel.SelectMatchingCard(tp,c100414014.cfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100414014.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100414014.splimit(e,c)
return not c:IsRace(RACE_PLANT)
end
function c100414014.spfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c100414014.spcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=1-tp then return false end
local ct1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local ct2=Duel.GetMatchingGroupCount(c100414014.spfilter,tp,LOCATION_MZONE,0,nil)
local chk1=ct1==0
local chk2=ct2>0 and ct1-ct2==0
return chk1 or chk2
end
function c100414014.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100414014.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--六花精プリム
--Scripted by mallu11
function c100414015.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414015,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100414015)
e1:SetCondition(c100414015.spcon)
e1:SetTarget(c100414015.sptg)
e1:SetOperation(c100414015.spop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414015,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100414115)
e2:SetTarget(c100414015.lvtg)
e2:SetOperation(c100414015.lvop)
c:RegisterEffect(e2)
end
function c100414015.spfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
end
function c100414015.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100414015.spfilter,1,nil,tp)
end
function c100414015.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100414015.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c100414015.lvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsLevelAbove(1)
end
function c100414015.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100414015.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100414015.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100414015.lvfilter,tp,LOCATION_MZONE,0,1,2,nil)
end
function c100414015.cfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function c100414015.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c100414015.cfilter,nil,e)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--六花精シクラン
--Scripted by mallu11
function c100414016.initial_effect(c)
--level
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414016,0))
e1:SetCategory(CATEGORY_LVCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCountLimit(1,100414016)
e1:SetCost(c100414016.lvcost)
e1:SetTarget(c100414016.lvtg)
e1:SetOperation(c100414016.lvop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c100414016.regcon)
e2:SetOperation(c100414016.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100414016,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100414116)
e3:SetCondition(c100414016.spcon)
e3:SetTarget(c100414016.sptg)
e3:SetOperation(c100414016.spop)
c:RegisterEffect(e3)
end
function c100414016.lvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsLevelAbove(3)
end
function c100414016.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100414016.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100414016.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100414016.lvfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100414016.lvfilter,tp,LOCATION_MZONE,0,1,2,nil)
end
function c100414016.cfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function c100414016.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c100414016.cfilter,nil,e)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c100414016.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_RELEASE)
end
function c100414016.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(100414016,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c100414016.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100414016)>0
end
function c100414016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c100414016.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
end
--六花精ボタン
--Scripted by mallu11
function c100414017.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414017,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100414017)
e1:SetCost(c100414017.spcost)
e1:SetTarget(c100414017.sptg)
e1:SetOperation(c100414017.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414017,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,100414117)
e2:SetTarget(c100414017.thtg)
e2:SetOperation(c100414017.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c100414017.thcon)
c:RegisterEffect(e3)
end
function c100414017.rfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsRace(RACE_PLANT)
end
function c100414017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100414017.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100414017.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100414017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100414017.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100414017.thfilter(c)
return c:IsSetCard(0x245) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100414017.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100414017.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100414017.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100414017.thfilter,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 c100414017.thcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:IsActiveType(TYPE_MONSTER) and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_RACE)&RACE_PLANT~=0
end
--六花精エリカ
--Scripted by mallu11
function c100414018.initial_effect(c)
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414018,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCountLimit(1,100414018)
e1:SetCondition(c100414018.atkcon)
e1:SetCost(c100414018.atkcost)
e1:SetOperation(c100414018.atkop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414018,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_RELEASE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100414118)
e2:SetCondition(c100414018.spcon)
e2:SetTarget(c100414018.sptg)
e2:SetOperation(c100414018.spop)
c:RegisterEffect(e2)
end
function c100414018.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,bc=bc,ac end
e:SetLabelObject(ac)
return ac and ac:IsControler(tp) and ac:IsFaceup() and ac:IsRace(RACE_PLANT) and ac~=c
end
function c100414018.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100414018.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
function c100414018.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousRaceOnField()&RACE_PLANT~=0
end
function c100414018.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100414018.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c100414018.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100414018.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
end
--六花精スノードロップ
--Scripted by mallu11
function c100414019.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414019,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100414019)
e1:SetCost(c100414019.spcost)
e1:SetTarget(c100414019.sptg)
e1:SetOperation(c100414019.spop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414019,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100414119)
e2:SetTarget(c100414019.lvtg)
e2:SetOperation(c100414019.lvop)
c:RegisterEffect(e2)
end
function c100414019.rfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>1 and c:IsRace(RACE_PLANT)
end
function c100414019.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100414019.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100414019.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100414019.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100414019.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c100414019.spfilter,tp,LOCATION_HAND,0,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function c100414019.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100414019.spfilter,tp,LOCATION_HAND,0,1,1,c,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100414019.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100414019.splimit(e,c)
return not c:IsRace(RACE_PLANT)
end
function c100414019.lvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsLevelAbove(1)
end
function c100414019.lvfilter1(c,tp)
return c100414019.lvfilter(c) and Duel.IsExistingMatchingCard(c100414019.lvfilter2,tp,LOCATION_MZONE,0,1,c,c:GetLevel())
end
function c100414019.lvfilter2(c,lv)
return c100414019.lvfilter(c) and not c:IsLevel(lv)
end
function c100414019.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100414019.lvfilter1(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c100414019.lvfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100414019.lvfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c100414019.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local lv=tc:GetLevel()
local g=Duel.GetMatchingGroup(c100414019.lvfilter,tp,LOCATION_MZONE,0,nil)
local lc=g:GetFirst()
while lc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
lc:RegisterEffect(e1)
lc=g:GetNext()
end
end
--六花精ヘレボラス
--Scripted by mallu11
function c100414020.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414020,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCountLimit(1,100414020)
e1:SetCondition(c100414020.discon)
e1:SetCost(c100414020.discost)
e1:SetTarget(c100414020.distg)
e1:SetOperation(c100414020.disop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414020,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100414120)
e2:SetCost(c100414020.spcost)
e2:SetTarget(c100414020.sptg)
e2:SetOperation(c100414020.spop)
c:RegisterEffect(e2)
end
function c100414020.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x245)
end
function c100414020.tfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c100414020.discon(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not re:IsActiveType(TYPE_MONSTER) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not Duel.IsExistingMatchingCard(c100414020.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
return tg and tg:IsExists(c100414020.tfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function c100414020.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100414020.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c100414020.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c100414020.spfilter(c,tp)
return c:IsRace(RACE_PLANT) and Duel.GetMZoneCount(tp,c)>0
end
function c100414020.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100414020.spfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100414020.spfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100414020.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100414020.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
end
--六花聖カンザシ
--Scripted by mallu11
function c100414021.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414021,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100414021)
e1:SetCondition(c100414021.spcon)
e1:SetCost(c100414021.spcost)
e1:SetTarget(c100414021.sptg)
e1:SetOperation(c100414021.spop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100414121)
e2:SetTarget(c100414021.reptg)
e2:SetValue(c100414021.repval)
e2:SetOperation(c100414021.repop)
c:RegisterEffect(e2)
end
function c100414021.cfilter(c)
return c:IsType(TYPE_MONSTER) or c:IsPreviousLocation(LOCATION_MZONE)
end
function c100414021.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100414021.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c100414021.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100414021.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100414021.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c100414021.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c100414021.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100414021.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100414021.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_RACE)
e3:SetValue(RACE_PLANT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
function c100414021.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_PLANT) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c100414021.rfilter(c)
return c:IsReleasableByEffect() and c:IsRace(RACE_PLANT) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function c100414021.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c100414021.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c100414021.rfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c100414021.repval(e,c)
return c100414021.repfilter(c,e:GetHandlerPlayer())
end
function c100414021.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c100414021.rfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_EFFECT+REASON_REPLACE)
Duel.Hint(HINT_CARD,0,100414021)
end
--六花絢爛
--Scripted by mallu11
function c100414023.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414023,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100414023+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100414023.cost)
e1:SetTarget(c100414023.target)
e1:SetOperation(c100414023.activate)
c:RegisterEffect(e1)
--cost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414023,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,100414023+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c100414023.cost)
e2:SetTarget(c100414023.target2)
e2:SetOperation(c100414023.activate2)
c:RegisterEffect(e2)
end
function c100414023.thfilter(c,tp,check)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x245) and c:IsAbleToHand()
and (check or Duel.IsExistingMatchingCard(c100414023.thfilter2,tp,LOCATION_DECK,0,1,c,c:GetCode(),c:GetOriginalLevel()))
end
function c100414023.thfilter2(c,code,lv)
return c:IsRace(RACE_PLANT) and not c:IsCode(code) and c:GetOriginalLevel()==lv and c:IsAbleToHand()
end
function c100414023.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100414023.thfilter,tp,LOCATION_DECK,0,1,nil,tp,true) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100414023.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100414023.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp,true)
local tc=g:GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c100414023.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_PLANT) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_PLANT)
Duel.Release(g,REASON_COST)
end
function c100414023.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingMatchingCard(c100414023.thfilter,tp,LOCATION_DECK,0,1,nil,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c100414023.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100414023.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp,true)
local tc=g:GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,tc)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and tc:IsLocation(LOCATION_HAND)
and Duel.IsExistingMatchingCard(c100414023.thfilter2,tp,LOCATION_DECK,0,1,nil,tc:GetCode(),tc:GetOriginalLevel()) then
Duel.BreakEffect()
local tg=Duel.SelectMatchingCard(tp,c100414023.thfilter2,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode(),tc:GetOriginalLevel())
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
--六花の風花
--Scripted by mallu11
function c100414024.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--release
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414024,0))
e1:SetCategory(CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,100414024)
e1:SetCondition(c100414024.rlcon)
e1:SetTarget(c100414024.rltg)
e1:SetOperation(c100414024.rlop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414024,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100414024.descon)
e2:SetTarget(c100414024.destg)
e2:SetOperation(c100414024.desop)
c:RegisterEffect(e2)
end
function c100414024.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousSetCard(0x245)
end
function c100414024.rlcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100414024.cfilter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end
function c100414024.rltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsReleasable,1-tp,LOCATION_MZONE,0,1,nil,REASON_RULE) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,1-tp,LOCATION_MZONE)
end
function c100414024.rlop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsReleasable,1-tp,LOCATION_MZONE,0,nil,REASON_RULE)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_RELEASE)
local sg=g:Select(1-tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Release(sg,REASON_RULE)
end
end
function c100414024.desfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_PLANT)
end
function c100414024.descon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return Duel.GetTurnPlayer()==1-tp and g:IsExists(c100414024.desfilter,1,nil)
end
function c100414024.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c100414024.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Destroy(c,REASON_EFFECT)
end
end
--六花深々
--Scripted by mallu11
function c100414025.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414025,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100414025+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100414025.cost)
e1:SetTarget(c100414025.target)
e1:SetOperation(c100414025.activate)
c:RegisterEffect(e1)
--cost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414025,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,100414025+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c100414025.cost)
e2:SetTarget(c100414025.target2)
e2:SetOperation(c100414025.activate2)
c:RegisterEffect(e2)
end
function c100414025.spfilter(c,e,tp,check)
return c:IsSetCard(0x245) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and (check or Duel.IsExistingMatchingCard(c100414025.spfilter2,tp,LOCATION_GRAVE,0,1,c,e,tp))
end
function c100414025.spfilter2(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100414025.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100414025.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,true)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c100414025.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100414025.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,true)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c100414025.rfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>1 and c:IsRace(RACE_PLANT)
end
function c100414025.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100414025.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100414025.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100414025.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>1
if chk==0 then
e:SetLabel(0)
return res and e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingMatchingCard(c100414025.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonCount(tp,2)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end
function c100414025.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100414025.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,true)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
if e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c100414025.spfilter2),tp,LOCATION_GRAVE,0,1,nil,e,tp) then
Duel.BreakEffect()
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100414025.spfilter2),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
--六花の薄氷
--Scripted by mallu11
function c100414026.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100414026,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100414026+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100414026.cost)
e1:SetTarget(c100414026.target)
e1:SetOperation(c100414026.activate)
c:RegisterEffect(e1)
--cost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100414026,1))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,100414026+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c100414026.cost)
e2:SetTarget(c100414026.target2)
e2:SetOperation(c100414026.activate2)
c:RegisterEffect(e2)
end
function c100414026.filter(c,check)
return c:IsFaceup() and (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT)
and (check or c:IsAbleToChangeControler())
end
function c100414026.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c100414026.filter,1-tp,LOCATION_MZONE,0,1,nil,true) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100414026.filter,1-tp,LOCATION_MZONE,0,1,1,nil,true)
end
function c100414026.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c100414026.rfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsRace(RACE_PLANT)
end
function c100414026.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100414026.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100414026.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100414026.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingTarget(c100414026.filter,1-tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c100414026.filter,1-tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c100414026.activate2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and tc:IsAbleToChangeControler() then
Duel.BreakEffect()
if Duel.GetControl(tc,tp,PHASE_END,1)~=0 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(RACE_PLANT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
end
end
......@@ -47,7 +47,7 @@ function c101101059.lvfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(1)
end
function c101101059.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100310040.lvfilter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101101059.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101101059.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101101059.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
......
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