Commit adcd473d authored by mercury233's avatar mercury233

fix

parent 4599bfae
......@@ -12,7 +12,7 @@ function c100416011.initial_effect(c)
e2:SetDescription(aux.Stringid(100416011,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,100416011)
......@@ -26,8 +26,7 @@ function c100416011.initial_effect(c)
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,100416011+100)
e3:SetCondition(c100416011.tgcon2)
e3:SetTarget(c100416011.tgtg2)
......@@ -36,7 +35,7 @@ function c100416011.initial_effect(c)
end
function c100416011.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousTypeOnField(),TYPE_MONSTER)~=0
and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousRaceOnField()&RACE_REPTILE~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100416011.tgcon1(e,tp,eg,ep,ev,re,r,rp)
......@@ -57,7 +56,7 @@ function c100416011.tgop1(e,tp,eg,ep,ev,re,r,rp)
end
function c100416011.tgcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and rp==1-tp and c:IsReason(REASON_EFFECT)
return rp==1-tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_FZONE) and c:GetPreviousControler()==tp
end
function c100416011.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -45,6 +45,7 @@ function c100416012.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100416012.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100416012.rfilter,1,1,nil,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c100416012.spfilter(c,e,tp)
......@@ -59,13 +60,34 @@ function c100416012.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c100416012.spop(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)
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(100416012,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c100416012.tgcon1)
e1:SetOperation(c100416012.tgop1)
Duel.RegisterEffect(e1,tp)
end
end
function c100416012.tgcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(100416012)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c100416012.tgop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetLabelObject(),REASON_EFFECT)
end
function c100416012.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEUP)
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEUP) and c:GetSequence()<5
end
function c100416012.cfilter(c)
return not c:IsRace(RACE_REPTILE) and c:IsFaceup() and c:IsAbleToGrave()
......
......@@ -35,7 +35,7 @@ function c100416013.operation(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(c100416013.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100416013.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local res1=Duel.IsPlayerCanSpecialSummonMonster(tp,100416113,0,0x4011,0,0,2,RACE_REPTILE,ATTRIBUTE_DARK)
local res2=cg:GetClassCount(Card.GetCode)>=2 and tg:GetClassCount(Card.GetCode)>=2
local res2=cg:GetClassCount(Card.GetCode)>=8 and tg:GetClassCount(Card.GetCode)>=2
if res2 and (not res1 or Duel.SelectYesNo(tp,aux.Stringid(100416013,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=tg:SelectSubGroup(tp,aux.dncheck,false,2,2)
......
......@@ -77,7 +77,8 @@ function c100416019.chlimit(e,ep,tp)
return ep==tp or e:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100416019.cfilter(c,e,tp)
return (c:IsControler(tp) or c:IsFaceup()) and Duel.IsExistingMatchingCard(c100416019.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLeftScale())
return (c:IsControler(tp) or c:IsFaceup()) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM)
and Duel.IsExistingMatchingCard(c100416019.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLeftScale())
end
function c100416019.spfilter(c,e,tp,sc)
return c:IsSetCard(0x265) and c:IsType(TYPE_MONSTER) and not c:IsCode(100416019)
......
......@@ -9,6 +9,7 @@ function c100416023.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100416023+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100416023.target)
e1:SetOperation(c100416023.operation)
c:RegisterEffect(e1)
end
function c100416023.cfilter(c)
......@@ -37,18 +38,16 @@ function c100416023.operation(e,tp,eg,ep,ev,re,r,rp)
local b1=ct>=3 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>0
local b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b3=ct>=7 and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)>0
if b1 and Duel.SelectYesNo(tp,aux.Stringid(100416023,0)) then
c100416023.place(e,tp,eg,ep,ev,re,r,rp)
end
b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if b2 and Duel.SelectYesNo(tp,aux.Stringid(100416023,1)) then
Duel.BreakEffect()
c100416023.specialsummon(e,tp,eg,ep,ev,re,r,rp)
end
local b3=ct>=7 and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)>0
if b3 and Duel.SelectYesNo(tp,aux.Stringid(100416023,2)) then
Duel.BreakEffect()
c100416023.destroy(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -117,6 +117,7 @@ function c100416033.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
else
aux.UseExtraReleaseCount(Group.FromCards(tc),tp)
Duel.Release(tc,REASON_COST)
end
end
......
......@@ -112,6 +112,7 @@ function c100416035.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
aux.UseExtraReleaseCount(Group.FromCards(tc),tp)
Duel.Release(tc,REASON_COST)
end
end
......
......@@ -5,8 +5,10 @@ function c101105205.initial_effect(c)
aux.AddCodeList(c,44508094)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101105205.target)
e1:SetOperation(c101105205.activate)
c:RegisterEffect(e1)
--cannot to deck
......@@ -20,9 +22,10 @@ function c101105205.initial_effect(c)
c:RegisterEffect(e2)
--apply
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c101105205.opcon)
e3:SetTarget(c101105205.optg)
......@@ -30,12 +33,14 @@ function c101105205.initial_effect(c)
c:RegisterEffect(e3)
end
function c101105205.tdfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and c:IsAbleToDeck()
return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and (c:IsAbleToDeck() or c:IsLocation(LOCATION_DECK))
end
function c101105205.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105205.tdfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
end
function c101105205.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetMatchingGroup(c101105205.tdfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
local g=Duel.GetMatchingGroup(c101105205.tdfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=g:Select(tp,1,1,nil):GetFirst()
......@@ -44,34 +49,32 @@ function c101105205.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
else
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
end
function c101105205.tdlimit(e,c)
return (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.AddCodeList(c,44508094))
return (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.IsCodeListed(c,44508094)) and c:IsOnField()
end
function c101105205.cfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsControler(tp)
function c101105205.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function c101105205.opcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105205.cfilter,1,nil,tp)
return eg:IsExists(c101105205.cfilter,1,nil)
end
function c101105205.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101105205.optg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.GetFlagEffect(tp,101105205)==0
local b2=Duel.IsExistingMatchingCard(c101105205.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105205+100)==0
if chk==0 then
return c:RegisterFlagEffect(101105205,RESET_CHAIN,0,1) and (b1 or b2)
end
c:RegisterFlagEffect(101105205,RESET_CHAIN,0,1)
end
function c101105205.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101105205.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105205+100)==0
if chk==0 then return b1 or b2 end
end
function c101105205.opop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.GetFlagEffect(tp,101105205)==0
local b2=Duel.IsExistingMatchingCard(c101105205.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105205+100)==0
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101105205.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105205+100)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(101105205,1),aux.Stringid(101105205,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(101105205,1)) --Draw 1 Card
......@@ -81,10 +84,8 @@ function c101105205.opop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,101105205,RESET_PHASE+PHASE_END,0,1)
else
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105205.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(tp,101105205+100,RESET_PHASE+PHASE_END,0,1)
end
......
......@@ -32,7 +32,7 @@ function c101105206.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101105206.cfilter(c)
return c:IsFaceup() and (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.AddCodeList(c,44508094))
return c:IsFaceup() and (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.IsCodeListed(c,44508094))
end
function c101105206.activate(e,tp,eg,ep,ev,re,r,rp)
local chk=Duel.IsExistingMatchingCard(c101105206.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -10,7 +10,7 @@ function c101105208.initial_effect(c)
c:RegisterEffect(e1)
--apply
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_SZONE)
......@@ -20,28 +20,38 @@ function c101105208.initial_effect(c)
e2:SetOperation(c101105208.activate)
c:RegisterEffect(e2)
end
function c101105208.cfilter(c,tp,re,rp)
function c101105208.cfilter(c,tp,rp)
return c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
and (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.IsCodeListed(c,44508094))
and (c:IsReason(REASON_COST) and re:GetHandler():IsControler(tp) or c:IsReason(REASON_EFFECT) and rp==tp)
and (c:IsCode(44508094) or c:GetPreviousTypeOnField()&TYPE_SYNCHRO~=0 and aux.IsCodeListed(c,44508094))
and c:IsReason(REASON_COST+REASON_EFFECT) and rp==tp
end
function c101105208.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105208.cfilter,1,nil,tp,re,rp)
return eg:IsExists(c101105208.cfilter,1,nil,tp,rp)
end
function c101105208.spfilter(c,e,tp)
if not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return false end
if c:IsFaceup() and c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
if c:IsLocation(LOCATION_GRAVE) or c:IsFaceup() and c:IsLocation(LOCATION_REMOVED) then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
return false
end
function c101105208.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c101105208.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:Filter(c101105208.cfilter,nil,tp,re,rp):IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,false,false) and Duel.GetFlagEffect(tp,101105208)==0
local b1=eg:Filter(c101105208.cfilter,nil,tp,rp):IsExists(c101105208.spfilter,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105208)==0
local b2=Duel.IsExistingMatchingCard(c101105208.rfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and Duel.GetFlagEffect(tp,101105208+100)==0
local b3=Duel.GetFlagEffect(tp,101105208+200)==0
return b1 or b2 or b3
end
end
function c101105208.activate(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:Filter(c101105208.cfilter,nil,tp,re,rp):IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,false,false) and Duel.GetFlagEffect(tp,101105208)==0
local b2=Duel.IsExistingMatchingCard(c101105208.rfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and Duel.GetFlagEffect(tp,101105208+100)==0
local b1=eg:Filter(c101105208.cfilter,nil,tp,rp):IsExists(c101105208.spfilter,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105208)==0
local b2=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c101105208.rfilter),tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and Duel.GetFlagEffect(tp,101105208+100)==0
local b3=Duel.GetFlagEffect(tp,101105208+200)==0
local off=1
local ops={}
......@@ -64,17 +74,17 @@ function c101105208.activate(e,tp,eg,ep,ev,re,r,rp)
if off==1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,table.unpack(ops))
if op==0 then
local sg=eg:Filter(c101105208.cfilter,nil,tp,re,rp)
if opval[op]==1 then
local sg=eg:Filter(c101105208.cfilter,nil,tp,rp):Filter(c101105208.spfilter,nil,e,tp)
if #sg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=eg:Filter(c101105208.cfilter,nil,tp,re,rp):FilterSelect(tp,Card.IsCanBeSpecialSummoned,1,1,nil,e,0,tp,false,false)
sg=sg:Select(tp,1,1,nil)
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(tp,101105208,RESET_PHASE+PHASE_END,0,1)
elseif op==1 then
elseif opval[op]==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c101105208.rfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
local rg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101105208.rfilter),tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.HintSelection(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,101105208+100,RESET_PHASE+PHASE_END,0,1)
......
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