Commit 53264aa8 authored by Huangnan's avatar Huangnan

fix

parent 8141520c
Pipeline #40404 failed with stages
in 2 minutes and 25 seconds
No preview for this file type
--腊梅·花信
function c16372001.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,16372001)
e1:SetCost(c16372001.costoath)
e1:SetCondition(c16372001.sumcon)
e1:SetTarget(c16372001.sumtg)
e1:SetOperation(c16372001.sumop)
c:RegisterEffect(e1)
local e11=e1:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372001+100)
e2:SetCondition(c16372001.setscon)
e2:SetCost(c16372001.costoath)
e2:SetTarget(c16372001.setstg)
e2:SetOperation(c16372001.setsop)
c:RegisterEffect(e2)
--indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c16372001.spellcon)
e3:SetTarget(c16372001.indtg)
e3:SetValue(c16372001.indct)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372001,ACTIVITY_SPSUMMON,c16372001.counterfilter)
end
function c16372001.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372001.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372001,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372001.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372001.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372001.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(aux.AND(Card.IsCode,Card.IsFaceup),tp,LOCATION_FZONE,0,1,nil,16372018)
end
function c16372001.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372001.acfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function c16372001.acfilter(c,tp)
return c:IsCode(16372018) and c:GetActivateEffect() and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c16372001.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c16372001.acfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function c16372001.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372001.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372001.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372001.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372001.indtg(e,c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c16372001.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return 1
else return 0 end
end
\ No newline at end of file
--檀杏·花信
function c16372002.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,16372002)
e1:SetCost(c16372002.costoath)
e1:SetTarget(c16372002.settg)
e1:SetOperation(c16372002.setop)
c:RegisterEffect(e1)
local e11=e1:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372002+100)
e2:SetCondition(c16372002.setscon)
e2:SetCost(c16372002.costoath)
e2:SetTarget(c16372002.setstg)
e2:SetOperation(c16372002.setsop)
c:RegisterEffect(e2)
--atk/def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_PLANT))
e3:SetCondition(c16372002.spellcon)
e3:SetValue(500)
c:RegisterEffect(e3)
local e31=e3:Clone()
e31:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e31)
local e32=e3:Clone()
e32:SetTarget(c16372002.atkfilter)
e32:SetValue(-500)
c:RegisterEffect(e32)
local e33=e32:Clone()
e33:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e33)
Duel.AddCustomActivityCounter(16372002,ACTIVITY_SPSUMMON,c16372002.counterfilter)
end
function c16372002.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372002.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372002,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372002.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372002.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372002.setfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372002.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c16372002.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c16372002.spfilter(c,e,sp)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsLevel(3)
and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c16372002.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16372002.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
local g=Duel.GetMatchingGroup(c16372002.spfilter,tp,LOCATION_SZONE,0,nil,e,tp)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(16372002,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c16372002.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372002.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372002.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372002.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372002.atkfilter(e,c)
return not c:IsRace(RACE_PLANT)
end
\ No newline at end of file
--夭桃·花信
function c16372003.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,16372003)
e1:SetCost(c16372003.costoath)
e1:SetTarget(c16372003.target)
e1:SetOperation(c16372003.operation)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372003+100)
e2:SetCost(c16372003.costoath)
e2:SetCondition(c16372003.setscon)
e2:SetTarget(c16372003.setstg)
e2:SetOperation(c16372003.setsop)
c:RegisterEffect(e2)
--extra summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16372003,0))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,LOCATION_HAND+LOCATION_MZONE)
e3:SetCondition(c16372003.spellcon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_PLANT))
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372003,ACTIVITY_SPSUMMON,c16372003.counterfilter)
end
function c16372003.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372003.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372003,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372003.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372003.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372003.spfilter(c,e,tp)
return c:IsSetCard(0xdc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16372003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16372003.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c16372003.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16372003.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c16372003.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372003.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372003.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372003.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
\ No newline at end of file
--蔷薇·花信
function c16372004.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_BRAINWASHING_CHECK)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,16372004)
e1:SetCost(c16372004.cost)
e1:SetTarget(c16372004.target)
e1:SetOperation(c16372004.activate)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372004+100)
e2:SetCost(c16372004.costoath)
e2:SetCondition(c16372004.setscon)
e2:SetTarget(c16372004.setstg)
e2:SetOperation(c16372004.setsop)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_REMOVE_BRAINWASHING)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(c16372004.spellcon)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372004,ACTIVITY_SPSUMMON,c16372004.counterfilter)
end
function c16372004.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372004.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372004,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372004.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372004.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372004.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0 and c:GetSequence()<5
and c:IsAbleToGraveAsCost()
end
function c16372004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372004.cfilter,tp,LOCATION_SZONE,0,2,nil)
and Duel.GetCustomActivityCount(16372004,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372004.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372004.cfilter,tp,LOCATION_SZONE,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c16372004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c16372004.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c16372004.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372004.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372004.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372004.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
\ No newline at end of file
--丹若·花信
function c16372005.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16372005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16372005)
e1:SetCost(c16372005.costoath)
e1:SetTarget(c16372005.sptg)
e1:SetOperation(c16372005.spop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372005+100)
e2:SetCondition(c16372005.setscon)
e2:SetCost(c16372005.costoath)
e2:SetTarget(c16372005.setstg)
e2:SetOperation(c16372005.setsop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c16372005.spellcon)
e3:SetTarget(c16372005.reptg)
e3:SetValue(c16372005.repval)
e3:SetOperation(c16372005.repop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372005,ACTIVITY_SPSUMMON,c16372005.counterfilter)
end
function c16372005.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372005.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372005,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372005.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372005.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372005.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16372005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16372005.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c16372005.setfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372005.spop(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 tc=Duel.SelectMatchingCard(tp,c16372005.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(c16372005.setfilter,tp,LOCATION_DECK,0,nil)
if tc:IsSetCard(0xdc1) and #g>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(16372005,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
end
end
end
end
function c16372005.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372005.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372005.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372005.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372005.filter(c,tp)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_PLANT) and not c:IsReason(REASON_REPLACE)
end
function c16372005.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c16372005.filter,1,nil,tp)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c16372005.repval(e,c)
return c16372005.filter(c,e:GetHandlerPlayer())
end
function c16372005.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
end
\ No newline at end of file
--清荷·花信
function c16372006.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,16372006)
e1:SetCost(c16372006.spcost)
e1:SetTarget(c16372006.sptg)
e1:SetOperation(c16372006.spop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372006+100)
e2:SetCost(c16372006.costoath)
e2:SetCondition(c16372006.setscon)
e2:SetTarget(c16372006.setstg)
e2:SetOperation(c16372006.setsop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c16372006.discon)
e3:SetCost(c16372006.costoath)
e3:SetTarget(c16372006.distg)
e3:SetOperation(c16372006.disop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372006,ACTIVITY_SPSUMMON,c16372006.counterfilter)
end
function c16372006.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372006.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372006,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372006.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372006.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372006.cfilter1(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0 and c:GetSequence()<5
and c:IsAbleToGraveAsCost()
end
function c16372006.cfilter2(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c16372006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c16372006.cfilter1,tp,LOCATION_SZONE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c16372006.cfilter2,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return (b1 or b2)
and Duel.GetCustomActivityCount(16372006,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372006.splimitoath)
Duel.RegisterEffect(e1,tp)
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(16372006,5),1},{b2,aux.Stringid(16372006,6),2})
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372006.cfilter1,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c16372006.cfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function c16372006.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 c16372006.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 c16372006.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372006.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372006.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372006.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_PLANT) and Duel.IsChainDisablable(ev)
and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372006.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 c16372006.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--凤仙·花信
function c16372007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,16372007)
e1:SetCondition(c16372007.spcon)
e1:SetCost(c16372007.costoath)
e1:SetTarget(c16372007.sptg)
e1:SetOperation(c16372007.spop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372007+100)
e2:SetCondition(c16372007.setscon)
e2:SetCost(c16372007.costoath)
e2:SetTarget(c16372007.setstg)
e2:SetOperation(c16372007.setsop)
c:RegisterEffect(e2)
--loses ATK
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1)
e3:SetCondition(c16372007.spellcon)
e3:SetCost(c16372007.costoath)
e3:SetTarget(c16372007.atktg)
e3:SetOperation(c16372007.atkop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372007,ACTIVITY_SPSUMMON,c16372007.counterfilter)
end
function c16372007.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372007.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372007,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372007.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372007.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372007.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c16372007.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return #g>0 and #g==Duel.GetMatchingGroupCount(c16372007.cfilter,tp,LOCATION_MZONE,0,nil)
end
function c16372007.thfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c16372007.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)
and Duel.IsExistingMatchingCard(c16372007.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c16372007.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c16372007.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if #g2>0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
end
function c16372007.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372007.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372007.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372007.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372007.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker()
if chk==0 then return not tc:IsRace(RACE_PLANT) and tc:GetAttack()>0 end
end
function c16372007.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--玉桂·花信
function c16372008.initial_effect(c)
--can not diseffect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,16372008)
e1:SetCondition(c16372008.con)
e1:SetCost(c16372008.cost)
e1:SetTarget(c16372008.tg)
e1:SetOperation(c16372008.op)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372008+100)
e2:SetCondition(c16372008.setscon)
e2:SetCost(c16372008.costoath)
e2:SetTarget(c16372008.setstg)
e2:SetOperation(c16372008.setsop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,16372008)
e3:SetCondition(c16372008.spcon)
e3:SetCost(c16372008.costoath)
e3:SetTarget(c16372008.sptg)
e3:SetOperation(c16372008.spop)
c:RegisterEffect(e3)
local e33=e3:Clone()
e33:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e33)
Duel.AddCustomActivityCounter(16372008,ACTIVITY_SPSUMMON,c16372008.counterfilter)
end
function c16372008.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372008.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372008,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372008.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372008.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372008.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c16372008.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.GetCustomActivityCount(16372008,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372008.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function c16372008.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,16372008)==0 end
end
function c16372008.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISEFFECT)
e1:SetValue(c16372008.effectfilter)
Duel.RegisterFlagEffect(tp,16372008,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentPhase()==PHASE_MAIN1 then
e1:SetReset(RESET_PHASE+PHASE_MAIN1)
Duel.RegisterFlagEffect(tp,16372008,RESET_PHASE+PHASE_MAIN1,0,1)
else
e1:SetReset(RESET_PHASE+PHASE_MAIN2)
Duel.RegisterFlagEffect(tp,16372008,RESET_PHASE+PHASE_MAIN2,0,1)
end
Duel.RegisterEffect(e1,tp)
end
function c16372008.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return tc:IsRace(RACE_PLANT) and Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE
end
function c16372008.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372008.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372008.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372008.filter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and e:GetHandler():GetColumnGroup():IsContains(c)and c:IsLevelAbove(1)
and Duel.IsExistingMatchingCard(c16372008.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,c:GetLevel())
end
function c16372008.spfilter(c,e,tp,lv)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevel(lv)
end
function c16372008.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c16372008.filter,1,nil,e,tp)
and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c16372008.filter,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c16372008.spop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c16372008.filter,nil,e,tp)
local sc=g:GetFirst()
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
sc=g:Select(tp,1,1,nil)
end
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16372008.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,sc:GetLevel()):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--山菊·花信
function c16372009.initial_effect(c)
--cost
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,16372009)
e1:SetCondition(c16372009.con)
e1:SetCost(c16372009.cost)
e1:SetOperation(c16372009.operation)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372009+100)
e2:SetCondition(c16372009.setscon)
e2:SetCost(c16372009.costoath)
e2:SetTarget(c16372009.setstg)
e2:SetOperation(c16372009.setsop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c16372009.discon)
e3:SetCost(c16372009.costoath)
e3:SetTarget(c16372009.distg)
e3:SetOperation(c16372009.disop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372009,ACTIVITY_SPSUMMON,c16372009.counterfilter)
end
function c16372009.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372009.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372009,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372009.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372009.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372009.spfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c16372009.con(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local ct2=Duel.GetMatchingGroupCount(c16372009.spfilter,tp,LOCATION_MZONE,0,nil)
local chk1=ct1==0
local chk2=ct2>0 and ct1-ct2==0
return chk1 or chk2
end
function c16372009.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable()
and Duel.GetCustomActivityCount(16372009,tp,ACTIVITY_SPSUMMON)==0 end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372009.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372009.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SUMMON_COST)
e1:SetTargetRange(LOCATION_EXTRA,LOCATION_EXTRA)
e1:SetTarget(c16372009.sumtg)
e1:SetCost(c16372009.ccost)
e1:SetOperation(c16372009.acop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SPSUMMON_COST)
Duel.RegisterEffect(e2,tp)
end
function c16372009.sumtg(e,c)
return c:GetRace()~=RACE_PLANT
end
function c16372009.ccost(e,c,tp)
return Duel.CheckLPCost(tp,500)
end
function c16372009.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500)
end
function c16372009.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372009.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372009.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372009.disfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372009.discon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c16372009.disfilter,1,nil) and Duel.IsChainDisablable(ev)
and re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_PLANT)
and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372009.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 c16372009.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--木莲·花信
function c16372010.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,16372010)
e1:SetCondition(c16372010.spcon)
e1:SetCost(c16372010.costoath)
e1:SetTarget(c16372010.sptg)
e1:SetOperation(c16372010.spop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372010+100)
e2:SetCondition(c16372010.setscon)
e2:SetCost(c16372010.costoath)
e2:SetTarget(c16372010.setstg)
e2:SetOperation(c16372010.setsop)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_SPSUMMON)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(c16372010.spellcon)
e3:SetCost(c16372010.costoath)
e3:SetTarget(c16372010.target)
e3:SetOperation(c16372010.activate)
c:RegisterEffect(e3)
local e33=e3:Clone()
e33:SetCode(EVENT_SUMMON)
c:RegisterEffect(e33)
Duel.AddCustomActivityCounter(16372010,ACTIVITY_SPSUMMON,c16372010.counterfilter)
end
function c16372010.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372010.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372010,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372010.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372010.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372010.filter1(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c16372010.filter2(c)
return (c:IsFaceup() and not c:IsRace(RACE_PLANT)) or c:IsFacedown()
end
function c16372010.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16372010.filter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(c16372010.filter2,tp,LOCATION_MZONE,0,1,nil)
end
function c16372010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c16372010.setfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372010.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c16372010.setfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if #g>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(16372010,0)) then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.BreakEffect()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
end
end
end
function c16372010.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372010.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372010.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372010.cfilter(c)
return not c:IsRace(RACE_PLANT)
end
function c16372010.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
and aux.NegateSummonCondition() and #eg==1 and eg:IsExists(c16372010.cfilter,1,nil)
end
function c16372010.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c16372010.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
\ No newline at end of file
--山茶·花信
function c16372011.initial_effect(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,16372011)
e1:SetCost(c16372011.costoath)
e1:SetTarget(c16372011.sptg)
e1:SetOperation(c16372011.spop)
c:RegisterEffect(e1)
local e11=e1:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372011+100)
e2:SetCondition(c16372011.setscon)
e2:SetCost(c16372011.costoath)
e2:SetTarget(c16372011.setstg)
e2:SetOperation(c16372011.setsop)
c:RegisterEffect(e2)
--can not be effect target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetCondition(c16372011.spellcon)
e3:SetTarget(c16372011.etlimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372011,ACTIVITY_SPSUMMON,c16372011.counterfilter)
end
function c16372011.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372011.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372011,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372011.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372011.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372011.filter(c,e,tp)
return c:IsSetCard(0xdc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c16372011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16372011.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c16372011.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16372011.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(16372011,0)) then
Duel.BreakEffect()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e1)
end
end
end
function c16372011.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372011.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372011.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372011.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372011.etlimit(e,c)
return c~=e:GetHandler() and c:IsFaceup() and c:IsSetCard(0xdc1)
end
\ No newline at end of file
--水仙·花信
function c16372012.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,16372012)
e1:SetCondition(c16372012.spcon)
e1:SetCost(c16372012.costoath)
e1:SetTarget(c16372012.sptg)
e1:SetOperation(c16372012.spop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372012+100)
e2:SetCondition(c16372012.setscon)
e2:SetCost(c16372012.costoath)
e2:SetTarget(c16372012.setstg)
e2:SetOperation(c16372012.setsop)
c:RegisterEffect(e2)
--position
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c16372012.spellcon)
e3:SetCost(c16372012.costoath)
e3:SetTarget(c16372012.postg)
e3:SetOperation(c16372012.posop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(16372012,ACTIVITY_SPSUMMON,c16372012.counterfilter)
end
function c16372012.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372012.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372012,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372012.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372012.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372012.filter1(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c16372012.filter2(c)
return (c:IsFaceup() and not c:IsRace(RACE_PLANT)) or c:IsFacedown()
end
function c16372012.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16372012.filter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(c16372012.filter2,tp,LOCATION_MZONE,0,1,nil)
end
function c16372012.thfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c16372012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c16372012.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c16372012.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16372012.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c16372012.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372012.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372012.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372012.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372012.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker()
if chk==0 then return not tc:IsRace(RACE_PLANT) and tc:IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
function c16372012.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--花信之主 启灵元神
function c16372013.initial_effect(c)
c:SetUniqueOnField(1,0,16372013)
c:EnableReviveLimit()
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c16372013.sprcon)
e0:SetTarget(c16372013.sprtg)
e0:SetOperation(c16372013.sprop)
c:RegisterEffect(e0)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c16372013.imcon)
e1:SetValue(c16372013.efilter)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(116372013)
e2:SetCondition(c16372013.copycon)
e2:SetCost(c16372013.copycost)
e2:SetTarget(c16372013.copytg)
e2:SetOperation(c16372013.copyop)
c:RegisterEffect(e2)
--setself
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,16372013+100)
e3:SetCondition(c16372013.setscon)
e3:SetTarget(c16372013.setstg)
e3:SetOperation(c16372013.setsop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c16372013.spellcon)
e4:SetTarget(c16372013.tg)
e4:SetOperation(c16372013.op)
c:RegisterEffect(e4)
end
function c16372013.IsOriginalType(c,type)
return c:GetOriginalType()&type>0
end
c16372013.spchecks=aux.CreateChecks(c16372013.IsOriginalType,{TYPE_EFFECT,TYPE_RITUAL,TYPE_FUSION,TYPE_SYNCHRO,TYPE_XYZ,TYPE_LINK})
function c16372013.sprfilter(c,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function c16372013.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c16372013.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroupEach(c16372013.spchecks,aux.mzctcheck,tp)
end
function c16372013.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c16372013.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c16372013.spchecks,true,aux.mzctcheck,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c16372013.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function c16372013.imfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and c:IsFaceupEx()
end
function c16372013.imcon(e)
local g=Duel.GetMatchingGroup(c16372013.imfilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
return g:GetClassCount(Card.GetCode)>=9
end
function c16372013.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c16372013.copycon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c16372013.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(16372013)==0 end
e:GetHandler():RegisterFlagEffect(16372013,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c16372013.copyfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&0x1>0
end
function c16372013.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c16372013.copyfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16372013.copyfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c16372013.copyfilter,tp,LOCATION_SZONE,0,1,1,nil)
end
function c16372013.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetOriginalCodeRule()
local cid=0
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16372013,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetLabelObject(e1)
e2:SetLabel(cid)
e2:SetOperation(c16372013.rstop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function c16372013.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c16372013.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372013.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372013.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372013.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372013.spfilter(c,e,tp)
return c:IsFaceupEx() and c:IsSetCard(0xdc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:GetOriginalType()&0x1>0
end
function c16372013.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c16372013.spfilter,tp,LOCATION_SZONE+LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dc=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c16372013.spfilter,tp,LOCATION_SZONE+LOCATION_GRAVE,0,1,1,dc,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,dc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
e:SetLabelObject(dc)
Duel.SetChainLimit(c16372013.chainlm)
end
function c16372013.chainlm(re,rp,tp)
return tp==rp or re:GetHandler():IsRace(RACE_PLANT)
end
function c16372013.op(e,tp,eg,ep,ev,re,r,rp)
local dc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:IsContains(dc) and dc:IsRelateToEffect(e) then
Duel.SendtoDeck(dc,nil,2,REASON_EFFECT)
end
local sg=g:Filter(Card.IsRelateToEffect,nil,e)-dc
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--启灵元神·踏春繁语
function c16372014.initial_effect(c)
aux.AddCodeList(c,16372001,16372002,16372003)
c:EnableReviveLimit()
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c16372014.sprcon)
e0:SetTarget(c16372014.sprtg)
e0:SetOperation(c16372014.sprop)
c:RegisterEffect(e0)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,16372014)
e1:SetTarget(c16372014.settg)
e1:SetOperation(c16372014.setop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372014+100)
e2:SetCondition(c16372014.setscon)
e2:SetTarget(c16372014.setstg)
e2:SetOperation(c16372014.setsop)
c:RegisterEffect(e2)
--set2
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c16372014.spellcon)
e3:SetTarget(c16372014.settg2)
e3:SetOperation(c16372014.setop2)
c:RegisterEffect(e3)
end
c16372014.spchecks=aux.CreateChecks(Card.IsCode,{16372001,16372002,16372003})
function c16372014.sprfilter(c,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function c16372014.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c16372014.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroupEach(c16372014.spchecks,aux.mzctcheck,tp)
end
function c16372014.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c16372014.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c16372014.spchecks,true,aux.mzctcheck,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c16372014.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function c16372014.setfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372014.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c16372014.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16372014.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
end
end
function c16372014.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372014.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c16372014.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372014.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372014.settg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c16372014.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function c16372014.thfilter(c,code)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(code)
end
function c16372014.setop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16372014.setfilter),tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
local g=Duel.GetMatchingGroup(c16372014.thfilter,tp,LOCATION_DECK,0,nil,tc:GetCode())
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(16372014,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sc=g:Select(tp,1,1,nil)
Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
end
end
end
\ No newline at end of file
--启灵元神·夏日风情
function c16372015.initial_effect(c)
aux.AddCodeList(c,16372004,16372005,16372006)
c:EnableReviveLimit()
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c16372015.sprcon)
e0:SetTarget(c16372015.sprtg)
e0:SetOperation(c16372015.sprop)
c:RegisterEffect(e0)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,16372015)
e1:SetTarget(c16372015.tgtg)
e1:SetOperation(c16372015.tgop)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372015+100)
e2:SetCondition(c16372015.setscon)
e2:SetTarget(c16372015.setstg)
e2:SetOperation(c16372015.setsop)
c:RegisterEffect(e2)
--revive
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c16372015.spellcon)
e3:SetCost(c16372015.spcost2)
e3:SetTarget(c16372015.sptg2)
e3:SetOperation(c16372015.spop2)
c:RegisterEffect(e3)
end
c16372015.spchecks=aux.CreateChecks(Card.IsCode,{16372004,16372005,16372006})
function c16372015.sprfilter(c,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function c16372015.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c16372015.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroupEach(c16372015.spchecks,aux.mzctcheck,tp)
end
function c16372015.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c16372015.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c16372015.spchecks,true,aux.mzctcheck,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c16372015.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function c16372015.tgfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372015.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c16372015.tgfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectTarget(tp,c16372015.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0)
end
function c16372015.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:GetOriginalType()&0x1>0 and c:IsSetCard(0xdc1) and c:IsLocation(LOCATION_GRAVE)
end
function c16372015.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 and Duel.SendtoGrave(tg,REASON_EFFECT)>0 then
if tg:IsExists(c16372015.cfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(16372015,0)) then
local tg2=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoGrave(tg2,REASON_EFFECT)
end
end
end
function c16372015.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372015.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c16372015.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372015.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372015.cfilter2(c)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0
end
function c16372015.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c16372015.cfilter2,tp,LOCATION_SZONE,0,3,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372015.cfilter2,tp,LOCATION_SZONE,0,3,3,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c16372015.sptg2(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 c16372015.spop2(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
\ No newline at end of file
--启灵元神·秋露星河
function c16372016.initial_effect(c)
aux.AddCodeList(c,16372007,16372008,16372009)
c:EnableReviveLimit()
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c16372016.sprcon)
e0:SetTarget(c16372016.sprtg)
e0:SetOperation(c16372016.sprop)
c:RegisterEffect(e0)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16372016)
e1:SetCost(c16372016.cost)
e1:SetTarget(c16372016.target)
e1:SetOperation(c16372016.operation)
c:RegisterEffect(e1)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372016+100)
e2:SetCondition(c16372016.setscon)
e2:SetTarget(c16372016.setstg)
e2:SetOperation(c16372016.setsop)
c:RegisterEffect(e2)
--revive
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c16372016.spellcon)
e3:SetTarget(c16372016.sptg2)
e3:SetOperation(c16372016.spop2)
c:RegisterEffect(e3)
end
c16372016.spchecks=aux.CreateChecks(Card.IsCode,{16372007,16372008,16372009})
function c16372016.sprfilter(c,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function c16372016.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c16372016.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroupEach(c16372016.spchecks,aux.mzctcheck,tp)
end
function c16372016.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c16372016.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c16372016.spchecks,true,aux.mzctcheck,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c16372016.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function c16372016.cfilter(c)
return c:GetOriginalType()&TYPE_MONSTER>0 and c:IsSetCard(0xdc1) and c:IsAbleToDeckAsCost() and c:IsFaceup()
end
function c16372016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372016.cfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c16372016.cfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,3,3,nil)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c16372016.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c16372016.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.Draw(tp,1,REASON_EFFECT)
if ct==0 then return end
local dc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,dc)
if dc:IsType(TYPE_MONSTER) and dc:IsSetCard(0xdc1)
and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(16372016,0)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
end
function c16372016.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372016.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c16372016.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372016.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372016.sptg2(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 c16372016.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) then
local fid=c:GetFieldID()
c:RegisterFlagEffect(16372016,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetCondition(c16372016.retcon)
e1:SetOperation(c16372016.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c16372016.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffectLabel(16372016)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c16372016.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--启灵元神·冬雪感召
function c16372017.initial_effect(c)
aux.AddCodeList(c,16372010,16372011,16372012)
c:EnableReviveLimit()
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c16372017.sprcon)
e0:SetTarget(c16372017.sprtg)
e0:SetOperation(c16372017.sprop)
c:RegisterEffect(e0)
--damage
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e11:SetCode(EVENT_CHAINING)
e11:SetRange(LOCATION_MZONE)
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e11:SetOperation(c16372017.op2)
c:RegisterEffect(e11)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e12:SetCode(EVENT_CHAIN_SOLVED)
e12:SetRange(LOCATION_MZONE)
e12:SetCondition(c16372017.con22)
e12:SetOperation(c16372017.op22)
c:RegisterEffect(e12)
--setself
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,16372017+100)
e2:SetCondition(c16372017.setscon)
e2:SetTarget(c16372017.setstg)
e2:SetOperation(c16372017.setsop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c16372017.spellcon)
e3:SetTarget(c16372017.target)
e3:SetOperation(c16372017.activate)
c:RegisterEffect(e3)
end
c16372017.spchecks=aux.CreateChecks(Card.IsCode,{16372010,16372011,16372012})
function c16372017.sprfilter(c,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function c16372017.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c16372017.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroupEach(c16372017.spchecks,aux.mzctcheck,tp)
end
function c16372017.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c16372017.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c16372017.spchecks,true,aux.mzctcheck,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c16372017.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function c16372017.op2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(16372017,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c16372017.con22(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and c:GetFlagEffect(16372017)~=0
and re:GetHandler():IsType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_PLANT)
end
function c16372017.op22(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,16372017)
Duel.SetLP(re:GetHandlerPlayer(),Duel.GetLP(re:GetHandlerPlayer())-500)
end
function c16372017.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372017.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c16372017.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372017.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372017.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil,tp,0)
end
function c16372017.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(16372017)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--花开有序 风不误信
function c16372018.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_FZONE)
e1:SetCondition(c16372018.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--recover
local e21=Effect.CreateEffect(c)
e21:SetDescription(aux.Stringid(16372018,1))
e21:SetCategory(CATEGORY_RECOVER)
e21:SetType(EFFECT_TYPE_IGNITION)
e21:SetProperty(EFFECT_FLAG_CARD_TARGET)
e21:SetRange(LOCATION_FZONE)
e21:SetCountLimit(1,16372018)
e21:SetCondition(c16372018.con)
e21:SetLabel(1)
e21:SetTarget(c16372018.rectg)
e21:SetOperation(c16372018.recop)
c:RegisterEffect(e21)
--search
local e22=Effect.CreateEffect(c)
e22:SetDescription(aux.Stringid(16372018,2))
e22:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e22:SetType(EFFECT_TYPE_IGNITION)
e22:SetRange(LOCATION_FZONE)
e22:SetCountLimit(1,16372018+100)
e22:SetCondition(c16372018.con)
e22:SetLabel(2)
e22:SetCost(c16372018.thcost)
e22:SetTarget(c16372018.thtg)
e22:SetOperation(c16372018.thop)
c:RegisterEffect(e22)
--negate
local e23=Effect.CreateEffect(c)
e23:SetDescription(aux.Stringid(16372018,3))
e23:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e23:SetType(EFFECT_TYPE_QUICK_O)
e23:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e23:SetCode(EVENT_CHAINING)
e23:SetRange(LOCATION_FZONE)
e23:SetCountLimit(1,16372018+200)
e23:SetCondition(c16372018.negcon)
e23:SetCost(c16372018.negcost)
e23:SetLabel(3)
e23:SetTarget(c16372018.negtg)
e23:SetOperation(c16372018.negop)
c:RegisterEffect(e23)
--set
local e24=Effect.CreateEffect(c)
e24:SetDescription(aux.Stringid(16372018,4))
e24:SetCategory(CATEGORY_DRAW)
e24:SetType(EFFECT_TYPE_IGNITION)
e24:SetRange(LOCATION_FZONE)
e24:SetCountLimit(1,16372018+300)
e24:SetCondition(c16372018.con)
e24:SetLabel(4)
e24:SetTarget(c16372018.settg)
e24:SetOperation(c16372018.setop)
c:RegisterEffect(e24)
--SpecialSummon
local e25=Effect.CreateEffect(c)
e25:SetDescription(aux.Stringid(16372018,5))
e25:SetCategory(CATEGORY_SPECIAL_SUMMON)
e25:SetType(EFFECT_TYPE_IGNITION)
e25:SetProperty(EFFECT_FLAG_CARD_TARGET)
e25:SetRange(LOCATION_FZONE)
e25:SetCountLimit(1,16372018+400)
e25:SetCondition(c16372018.con)
e25:SetLabel(5)
e25:SetTarget(c16372018.target)
e25:SetOperation(c16372018.activate)
c:RegisterEffect(e25)
end
function c16372018.indfilter(c)
return c:IsSetCard(0xdc1) and c:IsFaceup() and c:GetSequence()<5
end
function c16372018.indcon(e)
return Duel.IsExistingMatchingCard(c16372018.indfilter,e:GetHandlerPlayer(),LOCATION_SZONE,0,1,nil)
end
function c16372018.ckfilter(c,type)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&type>0 and c:GetSequence()<5
end
function c16372018.con(e,tp,eg,ep,ev,re,r,rp)
local ck=0
if Duel.IsExistingMatchingCard(c16372018.ckfilter,tp,LOCATION_SZONE,0,1,nil,TYPE_RITUAL) then ck=ck+1 end
if Duel.IsExistingMatchingCard(c16372018.ckfilter,tp,LOCATION_SZONE,0,1,nil,TYPE_FUSION) then ck=ck+1 end
if Duel.IsExistingMatchingCard(c16372018.ckfilter,tp,LOCATION_SZONE,0,1,nil,TYPE_SYNCHRO) then ck=ck+1 end
if Duel.IsExistingMatchingCard(c16372018.ckfilter,tp,LOCATION_SZONE,0,1,nil,TYPE_XYZ) then ck=ck+1 end
if Duel.IsExistingMatchingCard(c16372018.ckfilter,tp,LOCATION_SZONE,0,1,nil,TYPE_LINK) then ck=ck+1 end
return ck>=e:GetLabel()
end
function c16372018.recfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:IsLevel(3) and c:GetAttack()>0
end
function c16372018.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c16372018.recfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16372018.recfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c16372018.recfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
end
function c16372018.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
function c16372018.costfilter(c,tp)
return c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0 and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c16372018.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c16372018.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372018.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
local g=Duel.SelectMatchingCard(tp,c16372018.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
end
function c16372018.thfilter(c,code)
return c:IsSetCard(0xdc1) and not c:IsCode(code) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c16372018.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16372018.thop(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16372018.thfilter,tp,LOCATION_DECK,0,1,1,nil,code)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c16372018.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and c16372018.con(e)
end
function c16372018.negcostfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:IsAbleToGraveAsCost()
end
function c16372018.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372018.negcostfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372018.negcostfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c16372018.negtg(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)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c16372018.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c16372018.setfilter(c,eg)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372018.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(c16372018.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function c16372018.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c16372018.setfilter,tp,LOCATION_GRAVE,0,1,1,nil,eg):GetFirst()
if tc and Duel.MoveToField(tc,tp,p,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
Duel.BreakEffect()
Duel.Draw(tp,1,0x40)
end
end
function c16372018.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0xdc1)
end
function c16372018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c16372018.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c16372018.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c16372018.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c16372018.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--花信物语 春之契约
function c16372019.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16372019)
e1:SetCost(c16372019.costoath)
e1:SetTarget(c16372019.target)
e1:SetOperation(c16372019.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,16372019)
e2:SetCost(c16372019.bfgcost)
e2:SetTarget(c16372019.pltg)
e2:SetOperation(c16372019.plop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(16372019,ACTIVITY_SPSUMMON,c16372019.counterfilter)
end
function c16372019.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372019.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372019,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372019.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372019.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372019.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.GetCustomActivityCount(16372019,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372019.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c16372019.ffilter(c,e,tp)
return Duel.IsExistingMatchingCard(c16372019.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c,e,tp)
end
function c16372019.spfilter(c,fc,e,tp)
return aux.IsCodeListed(fc,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c16372019.setfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,fc,c:GetCode())
end
function c16372019.setfilter(c,fc,code)
return aux.IsCodeListed(fc,c:GetCode()) and not c:IsForbidden() and not c:IsCode(code)
end
function c16372019.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():IsLocation(LOCATION_HAND) and 1 or 0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>ft
and Duel.IsExistingMatchingCard(c16372019.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c16372019.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_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,c16372019.ffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c16372019.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tc,e,tp):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sc2=Duel.SelectMatchingCard(tp,c16372019.setfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tc,sc:GetCode()):GetFirst()
Duel.MoveToField(sc2,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
sc2:RegisterEffect(e1)
end
end
end
function c16372019.plfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372019.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372019.plfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function c16372019.plop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c16372019.plfilter,tp,LOCATION_GRAVE,0,ft,ft,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCondition(c16372019.descon)
e1:SetOperation(c16372019.desop)
Duel.RegisterEffect(e1,tp)
end
function c16372019.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1)
end
function c16372019.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16372019.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c16372019.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16372019.desfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
--花信物语 夏之契约
function c16372020.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16372020)
e1:SetCost(c16372020.costoath)
e1:SetTarget(c16372020.target)
e1:SetOperation(c16372020.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,16372020)
e2:SetCost(c16372020.bfgcost)
e2:SetTarget(c16372020.sptg)
e2:SetOperation(c16372020.spop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(16372020,ACTIVITY_SPSUMMON,c16372020.counterfilter)
end
function c16372020.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372020.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372020,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372020.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372020.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372020.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.GetCustomActivityCount(16372020,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372020.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c16372020.filter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372020.spfilter(c,e,tp,code1,code2)
return not c:IsCode(code1,code2) and c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16372020.gcheck(g,e,tp)
if #g~=2 then return false end
local a=g:GetFirst()
local d=g:GetNext()
return Duel.IsExistingMatchingCard(c16372020.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,a:GetCode(),d:GetCode())
end
function c16372020.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=Duel.GetMatchingGroup(c16372020.filter,tp,LOCATION_DECK,0,nil)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=ft-1 end
if chk==0 then return ft>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and g:CheckSubGroup(c16372020.gcheck,2,2,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c16372020.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=Duel.GetMatchingGroup(c16372020.filter,tp,LOCATION_DECK,0,nil)
if ft>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g:SelectSubGroup(tp,c16372020.gcheck,false,2,2,e,tp)
if not sg then return end
local ac=sg:GetFirst()
local bc=sg:GetNext()
if Duel.MoveToField(ac,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
and Duel.MoveToField(bc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
ac:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_CHANGE_TYPE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e2:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
bc:RegisterEffect(e2)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c16372020.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp,ac:GetCode(),bc:GetCode())
if #rg==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=rg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c16372020.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0 and c:GetSequence()<5
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16372020.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16372020.spfilter2,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function c16372020.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16372020.spfilter2,tp,LOCATION_SZONE,0,1,math.min(ft,2),nil,e,tp)
if #g==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local atk=Duel.GetOperatedGroup():GetSum(Card.GetBaseAttack)
Duel.Recover(tp,atk,REASON_EFFECT)
end
\ No newline at end of file
--花信物语 秋之契约
function c16372021.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16372021)
e1:SetCost(c16372021.cost)
e1:SetTarget(c16372021.target)
e1:SetOperation(c16372021.activate)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,16372021)
e2:SetCost(c16372021.bfgcost)
e2:SetTarget(c16372021.tgtg)
e2:SetOperation(c16372021.tgop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(16372021,ACTIVITY_SPSUMMON,c16372021.counterfilter)
end
function c16372021.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372021.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372021.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.GetCustomActivityCount(16372021,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372021.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c16372021.cfilter(c)
return c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0 and c:IsAbleToDeckAsCost() and c:IsFaceupEx()
end
function c16372021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372021.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil)
and Duel.GetCustomActivityCount(16372021,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372021.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c16372021.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,3,3,nil)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c16372021.filter(c)
return c:IsSetCard(0xdc1) and c:IsAbleToHand()
end
function c16372021.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372021.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16372021.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16372021.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 c16372021.tgfilter(c)
return c:IsSetCard(0xdc1) and c:IsFaceup() and c:GetSequence()<5 and c:IsAbleToGrave()
end
function c16372021.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c16372021.tgfilter,tp,LOCATION_SZONE,0,nil)
local og=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if chk==0 then return g:GetCount()>0 and og:GetCount()>0 end
g:Merge(og)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c16372021.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16372021.tgfilter,tp,LOCATION_SZONE,0,nil)
if g:GetCount()==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 then return end
local oc=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if oc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local og=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,oc,nil)
Duel.SendtoGrave(og,REASON_EFFECT)
end
\ No newline at end of file
--花信物语 冬之契约
function c16372022.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,16372022)
e1:SetCondition(c16372022.condition)
e1:SetCost(c16372022.cost)
e1:SetTarget(c16372022.target)
e1:SetOperation(c16372022.activate)
c:RegisterEffect(e1)
--act in hand
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(16372022,0))
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e11:SetCondition(c16372022.handcon)
c:RegisterEffect(e11)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,16372022)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(c16372022.condition2)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c16372022.target2)
e2:SetOperation(c16372022.activate2)
c:RegisterEffect(e2)
end
c16372022.fusion_effect=true
function c16372022.condition(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function c16372022.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:IsAbleToGraveAsCost() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
and c:GetOriginalType()&TYPE_MONSTER>0
end
function c16372022.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372022.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372022.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c16372022.target(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)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c16372022.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.NegateActivation(ev) then return end
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
local g=Duel.GetMatchingGroup(c16372022.hfilter,tp,LOCATION_SZONE,0,nil):Filter(Card.IsAbleToGrave,nil)
if c:IsRelateToEffect(e) and c:IsCanTurnSet() and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(16372022,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoGrave(sg,0x40)>0 and sg:GetFirst():IsLocation(LOCATION_GRAVE) then
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function c16372022.hfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&TYPE_MONSTER>0
end
function c16372022.handcon(e)
return Duel.IsExistingMatchingCard(c16372022.hfilter,e:GetHandlerPlayer(),LOCATION_SZONE,0,4,nil)
end
function c16372022.filter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetSequence()<5
end
function c16372022.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16372022.filter,tp,LOCATION_SZONE,0,3,nil)
end
function c16372022.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c16372022.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16372022.filter,tp,LOCATION_SZONE,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:Select(1-tp,2,2,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
if sg:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
--花信之友 红莲之誓·安卡
function c16372023.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c16372023.lfilter,2,99,c16372023.lcheck)
c:EnableReviveLimit()
--extra material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e0:SetRange(LOCATION_EXTRA)
e0:SetTargetRange(LOCATION_SZONE,0)
e0:SetValue(c16372023.matval)
c:RegisterEffect(e0)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c16372023.imcon)
e1:SetOperation(c16372023.imop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,16372023)
e2:SetCondition(c16372023.discon)
e2:SetCost(c16372023.discost)
e2:SetOperation(c16372023.disop)
c:RegisterEffect(e2)
--setself
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,16372023+100)
e3:SetCondition(c16372023.setscon)
e3:SetTarget(c16372023.setstg)
e3:SetOperation(c16372023.setsop)
c:RegisterEffect(e3)
--double
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c16372023.spellcon)
e4:SetTarget(c16372023.target)
e4:SetOperation(c16372023.activate)
c:RegisterEffect(e4)
end
function c16372023.lfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsRace(RACE_PLANT)
end
function c16372023.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xdc1)
end
function c16372023.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return c:IsSetCard(0xdc1) and c:IsLevel(3),true
end
function c16372023.imcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c16372023.imop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(c16372023.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c16372023.efilter(e,te)
return te:GetHandlerPlayer()~=e:GetHandlerPlayer()
end
function c16372023.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c16372023.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:IsAbleToGraveAsCost() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
and c:GetOriginalType()&TYPE_MONSTER>0
end
function c16372023.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372023.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372023.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c16372023.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c16372023.distg)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c16372023.distg(e,c)
return e:GetHandler():GetColumnGroup():IsContains(c) and (not c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT))
end
function c16372023.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372023.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372023.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372023.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372023.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetFlagEffect(16372023)==0
end
function c16372023.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c16372023.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16372023.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c16372023.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c16372023.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:GetFlagEffect(16372023)==0 then
tc:RegisterFlagEffect(16372023,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(c16372023.actcon)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4,true)
end
end
end
function c16372023.actcon(e)
local c=e:GetHandler()
return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) and c:GetBattleTarget()~=nil
and e:GetOwnerPlayer()==e:GetHandlerPlayer()
end
\ No newline at end of file
--花信之师 浩渺之源·努恩
function c16372024.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c16372024.lfilter,2,99,c16372024.lcheck)
c:EnableReviveLimit()
--extra material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e0:SetRange(LOCATION_EXTRA)
e0:SetTargetRange(LOCATION_SZONE,0)
e0:SetValue(c16372024.matval)
c:RegisterEffect(e0)
--double
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16372024,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,16372024)
e1:SetCondition(c16372024.condition)
e1:SetTarget(c16372024.target)
e1:SetOperation(c16372024.activate)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16372024,1))
e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_CONFIRM)
e2:SetCountLimit(1,16372024+200)
e2:SetCondition(c16372024.damcon)
e2:SetTarget(c16372024.damtg)
e2:SetOperation(c16372024.damop)
c:RegisterEffect(e2)
--setself
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,16372024+100)
e3:SetCondition(c16372024.setscon)
e3:SetTarget(c16372024.setstg)
e3:SetOperation(c16372024.setsop)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetOperation(c16372024.op2)
c:RegisterEffect(e4)
local e42=Effect.CreateEffect(c)
e42:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e42:SetCode(EVENT_CHAIN_SOLVED)
e42:SetRange(LOCATION_SZONE)
e42:SetCondition(c16372024.spellcon)
e42:SetOperation(c16372024.op22)
c:RegisterEffect(e42)
end
function c16372024.lfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsRace(RACE_PLANT)
end
function c16372024.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xdc1)
end
function c16372024.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return c:IsSetCard(0xdc1) and c:IsLevel(3),true
end
function c16372024.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2
end
function c16372024.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xdc1)
and Duel.IsExistingMatchingCard(c16372024.colfilter,tp,0,LOCATION_MZONE,1,nil,c)
end
function c16372024.colfilter(c,tc)
return c:IsFaceup() and c:GetAttack()>tc:GetAttack() and tc:GetColumnGroup():IsContains(c)
end
function c16372024.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372024.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
end
function c16372024.filter2(c,tp,e)
return c:IsFaceup() and c:IsSetCard(0xdc1) and not c:IsImmuneToEffect(e)
and Duel.IsExistingMatchingCard(c16372024.colfilter,tp,0,LOCATION_MZONE,1,nil,c)
end
function c16372024.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(c16372024.filter2,tp,LOCATION_MZONE,0,nil,tp,e)
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()*2)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
end
function c16372024.damcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c16372024.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetBattleTarget():GetAttack()>0 end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.ceil(e:GetHandler():GetBattleTarget():GetAttack()/2))
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,math.ceil(e:GetHandler():GetBattleTarget():GetAttack()/2))
end
function c16372024.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc and tc:IsFaceup() and tc:IsControler(1-tp) and tc:IsRelateToBattle() then
local atk=tc:GetAttack()
Duel.Damage(1-tp,math.ceil(atk/2),REASON_EFFECT)
Duel.Recover(tp,math.ceil(atk/2),REASON_EFFECT)
end
end
function c16372024.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372024.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372024.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372024.spellcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS and ep~=tp and c:GetFlagEffect(16372024)~=0
end
function c16372024.op2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(16372024,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c16372024.op22(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,16372024)
Duel.Recover(tp,300,REASON_EFFECT)
end
\ No newline at end of file
--花信之友 苍穹之望·艾希丝
function c16372025.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c16372025.lfilter,2,99,c16372025.lcheck)
c:EnableReviveLimit()
--extra material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e0:SetRange(LOCATION_EXTRA)
e0:SetTargetRange(LOCATION_SZONE,0)
e0:SetValue(c16372025.matval)
c:RegisterEffect(e0)
--atk
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,16372025)
e1:SetCondition(c16372025.atkcon)
e1:SetTarget(c16372025.atktg)
e1:SetOperation(c16372025.atkop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_CONFIRM)
e2:SetCountLimit(1,16372025+200)
e2:SetCondition(c16372025.damcon)
e2:SetTarget(c16372025.damtg)
e2:SetOperation(c16372025.damop)
c:RegisterEffect(e2)
--setself
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,16372025+100)
e3:SetCondition(c16372025.setscon)
e3:SetTarget(c16372025.setstg)
e3:SetOperation(c16372025.setsop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c16372025.discon)
e4:SetOperation(c16372025.disop)
c:RegisterEffect(e4)
end
function c16372025.lfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsRace(RACE_PLANT)
end
function c16372025.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xdc1)
end
function c16372025.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return c:IsSetCard(0xdc1) and c:IsLevel(3),true
end
function c16372025.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c16372025.atkfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c16372025.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372025.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c16372025.atkfilter,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-tc:GetDefense())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c16372025.damcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c16372025.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return math.abs(tc:GetAttack()-tc:GetBaseAttack())>0 end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.abs(tc:GetAttack()-tc:GetBaseAttack()))
end
function c16372025.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc and tc:IsFaceup() and tc:IsControler(1-tp) and tc:IsRelateToBattle() then
Duel.Damage(1-tp,math.abs(tc:GetAttack()-tc:GetBaseAttack()),REASON_EFFECT)
end
end
function c16372025.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372025.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372025.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372025.discon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_MZONE and not rc:IsSetCard(0xdc1)
and rc:GetAttack()~=rc:GetBaseAttack()
and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372025.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--花信之友 千华觅月·尤莉米特
function c16372026.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c16372026.lfilter,2,99,c16372026.lcheck)
c:EnableReviveLimit()
--extra material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e0:SetRange(LOCATION_EXTRA)
e0:SetTargetRange(LOCATION_SZONE,0)
e0:SetValue(c16372026.matval)
c:RegisterEffect(e0)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,16372026)
e1:SetCondition(c16372026.imcon)
e1:SetOperation(c16372026.imop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,16372026+200)
e2:SetCondition(c16372026.atkcon)
e2:SetTarget(c16372026.atktg)
e2:SetOperation(c16372026.atkop)
c:RegisterEffect(e2)
--setself
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,16372026+100)
e3:SetCondition(c16372026.setscon)
e3:SetTarget(c16372026.setstg)
e3:SetOperation(c16372026.setsop)
c:RegisterEffect(e3)
--SpecialSummon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BE_BATTLE_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c16372026.condition)
e4:SetTarget(c16372026.target)
e4:SetOperation(c16372026.activate)
c:RegisterEffect(e4)
end
function c16372026.lfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsRace(RACE_PLANT)
end
function c16372026.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xdc1)
end
function c16372026.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return c:IsSetCard(0xdc1) and c:IsLevel(3),true
end
function c16372026.imcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c16372026.imop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,16372026)
local c=e:GetHandler()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xdc1))
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(c16372026.efilter)
Duel.RegisterEffect(e1,tp)
end
function c16372026.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
and te:IsActiveType(TYPE_MONSTER) and not te:GetHandler():IsRace(RACE_PLANT)
end
function c16372026.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2
end
function c16372026.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c16372026.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SET_ATTACK_FINAL)
e0:SetValue(0)
e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(c16372026.fuslimit)
tc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e5)
local e6=e1:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e6)
end
end
function c16372026.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function c16372026.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetHandlerPlayer()~=e:GetHandlerPlayer()
and not te:GetHandler():IsRace(RACE_PLANT)
end
function c16372026.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372026.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372026.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372026.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsFaceup() and tc:IsRace(RACE_PLANT)
and e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372026.target(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 c16372026.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,c)
end
end
end
\ No newline at end of file
--启灵元神 朝霞晖映
function c16372030.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c16372030.splimit)
c:RegisterEffect(e0)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16372030,1))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c16372030.ctcon)
e1:SetTarget(c16372030.cttg)
e1:SetOperation(c16372030.ctop)
c:RegisterEffect(e1)
--negate activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16372030,2))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCountLimit(1)
e2:SetCondition(c16372030.condition)
e2:SetCost(c16372030.cost)
e2:SetTarget(c16372030.target)
e2:SetOperation(c16372030.operation)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16372030,3))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,16372030)
e3:SetCost(c16372030.damcost)
e3:SetTarget(c16372030.damtg)
e3:SetOperation(c16372030.damop)
c:RegisterEffect(e3)
--setself
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCountLimit(1,16372030+1)
e4:SetCondition(c16372030.setscon)
e4:SetTarget(c16372030.setstg)
e4:SetOperation(c16372030.setsop)
c:RegisterEffect(e4)
--ritual summon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1,16372030)
e5:SetCondition(c16372030.spellcon)
e5:SetTarget(c16372030.tg1)
e5:SetOperation(c16372030.op1)
c:RegisterEffect(e5)
end
function c16372030.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0xdc1)
end
function c16372030.ctcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and rp==1-tp
end
function c16372030.ctfilter(c)
return c:IsCanAddCounter(0x3dc1,1) and c:GetCounter(0x3dc1)<3
end
function c16372030.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372030.ctfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function c16372030.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,c16372030.ctfilter,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
if tc and tc:AddCounter(0x3dc1,1) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCondition(c16372030.con)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(c16372030.fuslimit)
tc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e5)
local e6=e1:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e6)
end
end
function c16372030.con(e)
return e:GetHandler():GetCounter(0x3dc1)>=3
end
function c16372030.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function c16372030.condition(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c16372030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x3dc1,1,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x3dc1,1,REASON_COST)
end
function c16372030.target(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 c16372030.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
function c16372030.damfilter(c)
return c:GetCounter(0x3dc1)>0
end
function c16372030.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCounter(tp,1,1,0x3dc1)>0 end
local g=Duel.GetMatchingGroup(c16372030.damfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
local sum=0
while tc do
local sct=tc:GetCounter(0x3dc1)
tc:RemoveCounter(tp,0x3dc1,sct,0)
sum=sum+sct
tc=g:GetNext()
end
e:SetLabel(sum)
end
function c16372030.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetLabel()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct*300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*300)
end
function c16372030.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c16372030.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372030.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372030.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372030.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c16372030.tgfilter(c)
return c:IsSetCard(0xdc1) and c:IsFaceupEx() and c:GetOriginalLevel()>0 and c:IsAbleToGrave()
end
function c16372030.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c16372030.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
if chk==0 then
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and mg:CheckWithSumEqual(Card.GetLevel,9,1,99,c)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c16372030.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local mg=Duel.GetMatchingGroup(c16372030.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
aux.GCheckAdditional=aux.RitualCheckAdditional(c,9,"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,9,tp,c,9,"Equal")
aux.GCheckAdditional=nil
c:SetMaterial(mat)
if Duel.SendtoGrave(mat,0x40)>0 then
Duel.BreakEffect()
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
c:CompleteProcedure()
end
end
\ No newline at end of file
--启灵元神 未来战姬
function c16372035.initial_effect(c)
aux.EnablePendulumAttribute(c)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c16372035.splimit)
c:RegisterEffect(e0)
--special summon
local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD)
e00:SetCode(EFFECT_SPSUMMON_PROC)
e00:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e00:SetRange(LOCATION_HAND)
e00:SetCondition(c16372035.sprcon)
e00:SetTarget(c16372035.sprtg)
e00:SetOperation(c16372035.sprop)
c:RegisterEffect(e00)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16372035.indtg)
e1:SetValue(c16372035.indct)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_ATTACK+TIMING_END_PHASE)
e2:SetCountLimit(1,16372035)
e2:SetCost(c16372035.scost)
e2:SetTarget(c16372035.stg)
e2:SetOperation(c16372035.sop)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16372035,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,16372035+1)
e3:SetCost(c16372035.spcost)
e3:SetTarget(c16372035.sptg)
e3:SetOperation(c16372035.spop)
c:RegisterEffect(e3)
--setself
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCountLimit(1,16372035+2)
e4:SetCondition(c16372035.setscon)
e4:SetTarget(c16372035.setstg)
e4:SetOperation(c16372035.setsop)
c:RegisterEffect(e4)
--extra attack
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(16372035,1))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1)
e5:SetCondition(c16372035.spellcon)
e5:SetTarget(c16372035.attg)
e5:SetOperation(c16372035.atop)
c:RegisterEffect(e5)
end
function c16372035.sprlimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c16372035.sprcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16372035.sfilter,c:GetControler(),LOCATION_SZONE,0,3,c)
end
function c16372035.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c16372035.sfilter,tp,LOCATION_SZONE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:CancelableSelect(tp,3,3,nil)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c16372035.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
end
function c16372035.indtg(e,c)
return c:IsFaceup() and c:IsSetCard(0xdc1)
end
function c16372035.indct(e,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
return 1
else return 0 end
end
function c16372035.sfilter(c)
return c:IsSetCard(0xdc1) and c:IsFaceup() and c:IsAbleToGraveAsCost() and c:GetOriginalType()&0x1>0
and c:GetSequence()<5
end
function c16372035.scost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c16372035.sfilter,tp,LOCATION_SZONE,0,3,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16372035.sfilter,tp,LOCATION_SZONE,0,3,3,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c16372035.stg(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,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c16372035.sop(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,true,true,POS_FACEUP)
c:CompleteProcedure()
end
function c16372035.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetBattledGroupCount()==0 and c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c16372035.spfilter(c,e,tp)
return c:IsFaceupEx() and c:IsSetCard(0xdc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsLevelAbove(1)
end
function c16372035.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c16372035.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if chk==0 then return g:CheckWithSumEqual(Card.GetLevel,9,1,9) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c16372035.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c16372035.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectWithSumEqual(tp,Card.GetLevel,9,1,ft)
if sg and sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c16372035.setscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c16372035.setstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c16372035.setsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function c16372035.spellcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL+TYPE_CONTINUOUS and aux.bpcon(e)
end
function c16372035.atfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1)
end
function c16372035.cspellfilter(c)
return c:GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS and c:IsFaceup()
end
function c16372035.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c16372035.cspellfilter,tp,LOCATION_SZONE,0,nil)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c16372035.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16372035.atfilter,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():IsAbleToHand() and #g>1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c16372035.atfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c16372035.atop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16372035.cspellfilter,tp,LOCATION_SZONE,0,nil)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(#g-1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,0x40)
end
end
end
\ No newline at end of file
--花信物语 四季的誓言
function c16372040.initial_effect(c)
c:SetUniqueOnField(1,0,16372040)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16372040,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,16372040)
e1:SetCondition(c16372040.condition)
e1:SetCost(c16372040.costoath)
e1:SetTarget(c16372040.target)
e1:SetOperation(c16372040.activate)
c:RegisterEffect(e1)
--to field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16372040,1))
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,16372040+1)
e2:SetCost(c16372040.costoath)
e2:SetTarget(c16372040.target2)
e2:SetOperation(c16372040.activate2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(16372040,ACTIVITY_SPSUMMON,c16372040.counterfilter)
end
function c16372040.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372040.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372040,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372040.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372040.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372040.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1) and c:GetOriginalType()&0x1>0 and c:GetSequence()<5
end
function c16372040.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16372040.cfilter,tp,LOCATION_SZONE,0,3,nil)
end
function c16372040.spfilter(c,e,tp)
return c:IsSetCard(0xdc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetSequence()<5
end
function c16372040.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16372040.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_SZONE)
end
function c16372040.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,c16372040.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c16372040.filter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372040.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c16372040.filter(chkc) end
if chk==0 then
if not Duel.IsExistingTarget(c16372040.filter,tp,LOCATION_GRAVE,0,1,nil) then return false end
if e:GetHandler():IsLocation(LOCATION_HAND) then
return Duel.GetLocationCount(tp,LOCATION_SZONE)>1
else return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft>2 then ft=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectTarget(tp,c16372040.filter,tp,LOCATION_GRAVE,0,1,ft,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,g:GetCount(),0,0)
end
function c16372040.activate2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
if sg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local rg=sg:Select(tp,ft,ft,nil)
sg=rg
end
local tc=sg:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
end
end
\ No newline at end of file
--花信物语 神启者
function c16372045.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16372045,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,16372045)
e1:SetCost(c16372045.costoath)
e1:SetTarget(c16372045.target)
e1:SetOperation(c16372045.activate)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16372045,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,16372045)
e2:SetHintTiming(TIMINGS_CHECK_MONSTER+TIMING_CHAIN_END+TIMING_END_PHASE)
e2:SetCost(c16372045.costoath)
e2:SetTarget(c16372045.target2)
e2:SetOperation(c16372045.operation2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(16372045,ACTIVITY_SPSUMMON,c16372045.counterfilter)
end
function c16372045.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372045.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372045,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372045.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372045.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372045.setfilter(c)
return c:IsSetCard(0xdc1) and not c:IsForbidden()
end
function c16372045.spfilter(c,e,tp)
return c:IsSetCard(0xdc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetSequence()<5
end
function c16372045.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c16372045.setfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c16372045.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g1=Duel.SelectTarget(tp,c16372045.setfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c16372045.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
end
function c16372045.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
local tc=g:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetFirst()
local sc=g:Filter(Card.IsLocation,nil,LOCATION_SZONE):GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
if sc and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c16372045.filter(c)
return c:IsType(0x6) and c:IsSetCard(0xdc1) and not c:IsCode(16372045)
and c:CheckActivateEffect(false,true,false)~=nil
end
function c16372045.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingTarget(c16372045.filter,tp,LOCATION_GRAVE,0,1,nil) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c16372045.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.ClearTargetCard()
g:GetFirst():CreateEffectRelation(e)
local tg=te:GetTarget()
e:SetProperty(te:GetProperty())
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c16372045.operation2(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
local tc=te:GetHandler()
if not tc:IsRelateToEffect(e) then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
\ No newline at end of file
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