Commit 9c14e83b authored by mercury233's avatar mercury233

fix

parent 95676242
......@@ -27,6 +27,7 @@ function c101012002.initial_effect(c)
e3:SetDescription(aux.Stringid(101012002,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c101012002.srcon)
e3:SetTarget(c101012002.srtg)
......@@ -34,10 +35,14 @@ function c101012002.initial_effect(c)
c:RegisterEffect(e3)
end
function c101012002.atktg(e,c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and not c:IsSetCard(0x23c) and c:GetLinkedGroup():IsContains(e:GetHandler())
local lg1=c:GetLinkedGroup()
local lg2=e:GetHandler():GetLinkedGroup()
return c:IsFaceup() and c:IsType(TYPE_LINK) and not c:IsSetCard(0x23c)
and (lg1 and lg1:IsContains(e:GetHandler()) or lg2 and lg2:IsContains(c))
end
function c101012002.desfilter(c)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousTypeOnField()&TYPE_LINK~=0 and c:IsPreviousSetCard(0x23c) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousTypeOnField()&TYPE_LINK~=0 and c:IsPreviousSetCard(0x23c)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c101012002.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101012002.desfilter,1,nil)
......
......@@ -46,12 +46,14 @@ function c101012003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and g:CheckSubGroup(c101012003.fselect,2,2,tp,e:GetHandler()) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and g:CheckSubGroup(c101012003.fselect,2,2,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end
function c101012003.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101012003.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or g:GetCount()==0 then return end
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c101012003.fselect,false,2,2,tp,e:GetHandler())
if sg and sg:GetCount()==2 then
......
......@@ -36,7 +36,8 @@ function c101012004.atkcon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if not a:IsControler(tp) then a,d=d,a end
e:SetLabelObject(a)
return a and a:IsFaceup() and a:IsControler(tp) and a:IsSetCard(0xfc) and a:IsRelateToBattle() and d and d:IsControler(1-tp)
return a and a:IsFaceup() and a:IsControler(tp) and a:IsSetCard(0xfc) and a:IsRelateToBattle()
and d and d:IsControler(1-tp)
end
function c101012004.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
......@@ -34,7 +34,8 @@ function c101012006.initial_effect(c)
c:RegisterEffect(e3)
end
function c101012006.costfilter(c,tp)
return c:IsSetCard(0x12b) and c:IsType(TYPE_TRAP) and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c101012006.srfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
return c:IsSetCard(0x12b) and c:IsType(TYPE_TRAP) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c101012006.srfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c101012006.srfilter(c,code)
return c:IsSetCard(0x12b) and c:IsType(TYPE_TRAP) and not c:IsCode(code) and c:IsAbleToHand()
......
......@@ -46,7 +46,8 @@ function c101012007.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101012007.spfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c101012007.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
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 c101012007.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -64,7 +64,6 @@ function c101012008.desfilter(c,attr)
end
function c101012008.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
local attr=0
......@@ -72,6 +71,7 @@ function c101012008.destg(e,tp,eg,ep,ev,re,r,rp,chk)
attr=attr|tc:GetAttribute()
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local at=Duel.AnnounceAttribute(tp,1,attr)
e:SetLabel(at)
local dg=Duel.GetMatchingGroup(c101012008.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,at)
......
......@@ -64,7 +64,6 @@ function c101012009.desfilter(c,race)
end
function c101012009.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
local race=0
......@@ -72,6 +71,7 @@ function c101012009.destg(e,tp,eg,ep,ev,re,r,rp,chk)
race=race|tc:GetRace()
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
local rc=Duel.AnnounceRace(tp,1,race)
e:SetLabel(rc)
local dg=Duel.GetMatchingGroup(c101012009.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,rc)
......
......@@ -29,7 +29,9 @@ function c101012010.tdfilter(c)
end
function c101012010.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101012010.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101012010.tdfilter,tp,LOCATION_REMOVED,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101012010.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101012010.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
......
......@@ -30,7 +30,9 @@ function c101012011.tdfilter(c)
end
function c101012011.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101012011.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101012011.tdfilter,tp,LOCATION_REMOVED,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101012011.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101012011.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
......
......@@ -30,7 +30,9 @@ function c101012012.tdfilter(c)
end
function c101012012.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101012012.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101012012.tdfilter,tp,LOCATION_REMOVED,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101012012.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101012012.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
......
......@@ -46,7 +46,8 @@ function c101012013.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardDeck(tp,1,REASON_COST)
end
function c101012013.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(101012013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(101012013)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012013.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101012013.spfilter(chkc,e,tp) end
......
......@@ -28,7 +28,7 @@ function c101012016.initial_effect(c)
c:RegisterEffect(e2)
end
function c101012016.costfilter(c,tp)
return c:IsRace(RACE_FIEND) and Duel.GetMZoneCount(tp,c)>0
return c:IsRace(RACE_FIEND) and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c101012016.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO)
......@@ -54,21 +54,19 @@ function c101012016.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
function c101012016.lvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO) and c:IsLevelAbove(1)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO)
and c:IsLevelAbove(1)
end
function c101012016.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101012016.lvfilter(chkc) end
......
......@@ -29,7 +29,8 @@ function c101012017.initial_effect(c)
Duel.AddCustomActivityCounter(101012017,ACTIVITY_SPSUMMON,c101012017.counterfilter)
end
function c101012017.counterfilter(c)
return (c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO)) or c:GetSummonLocation()~=LOCATION_EXTRA
return c:GetSummonLocation()~=LOCATION_EXTRA
or (c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO))
end
function c101012017.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
......@@ -46,7 +47,8 @@ function c101012017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp)
end
function c101012017.splimit(e,c)
return not (c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO)) and c:IsLocation(LOCATION_EXTRA)
return c:IsLocation(LOCATION_EXTRA)
and not (c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO))
end
function c101012017.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -64,7 +66,8 @@ function c101012017.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO)
end
function c101012017.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101012017.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) and Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_MZONE,0,e:GetHandler())==1
return Duel.IsExistingMatchingCard(c101012017.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_MZONE,0,e:GetHandler())==1
end
function c101012017.spfilter(c,e,tp)
return c:IsSetCard(0x57) and not c:IsCode(101012017) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -26,10 +26,12 @@ function c101012018.initial_effect(c)
c:RegisterEffect(e3)
end
function c101012018.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(3) and c:IsLevelBelow(5) and not c:IsCode(101012018) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(3) and c:IsLevelBelow(5) and not c:IsCode(101012018)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101012018.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101012018.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101012018.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101012018.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,10 +23,12 @@ function c101012019.initial_effect(c)
c:RegisterEffect(e2)
end
function c101012019.tgfilter(c,e,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(1) and Duel.IsExistingMatchingCard(c101012019.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel(),c:GetCode())
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(1)
and Duel.IsExistingMatchingCard(c101012019.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel(),c:GetCode())
end
function c101012019.spfilter(c,e,tp,lv,code)
return c:IsRace(RACE_FISH) and c:IsLevel(lv) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
return c:IsRace(RACE_FISH) and c:IsLevel(lv) and not c:IsCode(code)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101012019.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101012019.tgfilter(chkc,e,tp) end
......
......@@ -45,6 +45,7 @@ function c101012024.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......@@ -52,9 +53,6 @@ function c101012024.tgop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c101012024.tgfilter(c)
return c:IsSetCard(0x11b,0xfe) and c:IsAbleToGrave()
end
function c101012024.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_MZONE,0,e:GetHandler())==0
end
......
......@@ -56,6 +56,7 @@ function c101012025.spcon(e,c)
and Duel.IsExistingMatchingCard(c101012025.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c,tp)
end
function c101012025.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101012025.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,c,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
......@@ -80,7 +81,7 @@ function c101012025.ettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101012025.etfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101012025.etop(e,tp,eg,ep,ev,re,r,rp,chk)
function c101012025.etop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -39,7 +39,7 @@ function c101012027.tgcon(e,tp,eg,ep,ev,re,r,rp)
end
function c101012027.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE+LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_MZONE+LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_MZONE+LOCATION_HAND)
end
function c101012027.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER)
......@@ -54,7 +54,7 @@ function c101012027.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c101012027.costfilter(c)
return c:IsSetCard(0x134) or c:IsRace(RACE_SPELLCASTER)
return c:IsSetCard(0x134) or c:IsRace(RACE_SPELLCASTER) and (c:IsControler(tp) or c:IsFaceup())
end
function c101012027.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101012027.costfilter,2,nil) end
......
......@@ -28,7 +28,8 @@ end
function c101012029.setfilter(c,e,tp)
if not c:IsSetCard(0x130) or c:IsCode(101012029) then return false end
if c:IsType(TYPE_MONSTER) then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
else return c:IsSSetable() end
end
function c101012029.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......@@ -69,13 +70,15 @@ function c101012029.setop(e,tp,eg,ep,ev,re,r,rp)
end
function c101012029.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(101012029))) and c:IsPreviousLocation(LOCATION_ONFIELD)
return c:IsPreviousLocation(LOCATION_ONFIELD)
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(101012029)))
end
function c101012029.spfilter(c,e,tp)
return c:IsSetCard(0x130) and not c:IsCode(101012029) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012029.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101012029.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101012029.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101012029.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -60,7 +60,8 @@ function c101012030.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101012030.cfilter(c)
return c:IsSetCard(0x23d) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost()
return c:IsSetCard(0x23d) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
and c:IsAbleToRemoveAsCost()
end
function c101012030.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012030.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
......@@ -71,6 +72,7 @@ end
function c101012030.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(aux.TURE,tp,0,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TURE,tp,0,LOCATION_ONFIELD,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
......
......@@ -5,7 +5,7 @@ function c101012033.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101012033,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
......@@ -28,7 +28,7 @@ function c101012033.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)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,0)
end
function c101012033.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -94,7 +94,8 @@ function c101012034.recost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c101012034.refilter(c,tc,tp)
return aux.CheckUnionEquip(c,tc) and c:CheckEquipTarget(tc) and c:IsType(TYPE_UNION) and c:IsLevelBelow(4) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
return aux.CheckUnionEquip(c,tc) and c:CheckEquipTarget(tc) and c:IsType(TYPE_UNION)
and c:IsLevelBelow(4) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function c101012034.retg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -19,7 +19,6 @@ end
function c101012035.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,aux.TRUE,2,nil) end
local g=Duel.SelectReleaseGroup(tp,aux.TRUE,2,2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.Release(g,REASON_COST)
end
function c101012035.stfilter(c)
......
......@@ -18,10 +18,12 @@ function c101012037.initial_effect(c)
c:RegisterEffect(e2)
end
function c101012037.desfilter(c,tp)
return c:IsRace(RACE_DINOSAUR) and not c:IsCode(101012037) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and Duel.IsExistingMatchingCard(c101012037.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetOriginalLevel())
return c:IsRace(RACE_DINOSAUR) and not c:IsCode(101012037) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
and Duel.IsExistingMatchingCard(c101012037.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetOriginalLevel())
end
function c101012037.thfilter(c,lv)
return ((c:GetOriginalLevel()==lv and c:IsRace(RACE_REPTILE+RACE_SEASERPENT+RACE_WINDBEAST)) or (c:IsSetCard(0x10e) and c:IsType(TYPE_SPELL))) and c:IsAbleToHand()
return ((c:GetOriginalLevel()==lv and c:IsRace(RACE_REPTILE+RACE_SEASERPENT+RACE_WINDBEAST))
or (c:IsSetCard(0x10e) and c:IsType(TYPE_SPELL))) and c:IsAbleToHand()
end
function c101012037.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012037.desfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) end
......
......@@ -19,7 +19,9 @@ function c101012039.cfilter(c)
end
function c101012039.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c101012039.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101012039.cfilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101012039.cfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101012039.cfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
......@@ -28,7 +30,8 @@ end
function c101012039.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -36,7 +36,8 @@ function c101012042.initial_effect(c)
c:RegisterEffect(e3)
end
function c101012042.thfilter(c,e,tp,ft)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(4) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(4)
and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c101012042.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......
......@@ -68,9 +68,7 @@ function c101012043.adval(e,c)
end
function c101012043.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
function c101012043.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
......
......@@ -68,8 +68,7 @@ function c101012044.tpcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101012044.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c101012044.tptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_SPELL)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_SPELL) end
end
function c101012044.tpop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101012044,2))
......
......@@ -70,8 +70,9 @@ function c101012045.spop1(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101012045.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()))
and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REDIRECT) and c:GetReasonPlayer()==tp and c:GetPreviousControler()==1-tp
return c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()))
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==tp and c:GetPreviousControler()==1-tp
end
function c101012045.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101012045.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
......@@ -81,7 +82,8 @@ function c101012045.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c101012045.spfilter2(c,e,tp,g)
return g:IsContains(c) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return g:IsContains(c) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012045.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c101012045.spfilter2(chkc,e,tp,eg) end
......
......@@ -38,7 +38,8 @@ function c101012051.spfilter(c,e,tp)
local ok=false
for p=0,1 do
local zone=Duel.GetLinkedZone(p)&0xff
ok=ok or (Duel.GetLocationCount(p,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,p,zone))
ok=ok or (Duel.GetLocationCount(p,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,p,zone))
end
return ok
end
......
......@@ -44,7 +44,8 @@ function c101012052.spfilter(c,e,tp)
local ok=false
for p=0,1 do
local zone=Duel.GetLinkedZone(p)&0xff
ok=ok or (Duel.GetLocationCount(p,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,p,zone))
ok=ok or (Duel.GetLocationCount(p,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,p,zone))
end
return ok
end
......@@ -90,7 +91,7 @@ function c101012052.spop1(e,tp,eg,ep,ev,re,r,rp)
end
function c101012052.regcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and rp==1-tp
return c:IsReason(REASON_DESTROY) and rp==1-tp and c:GetPreviousControler()==tp
end
function c101012052.regop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -87,7 +87,8 @@ function c101012054.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x12b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012054.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101012054.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101012054.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c101012054.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -45,6 +45,7 @@ function c101012055.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101012055.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if tc:IsRelateToEffect(e) and zone~=0 then
......@@ -53,7 +54,8 @@ function c101012055.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c101012055.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_LINK)
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp and c:GetPreviousControler()==tp))
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_LINK)
end
function c101012055.thfilter(c)
return c:IsDefenseBelow(1500) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
......
......@@ -18,7 +18,9 @@ function c101012058.filter(c)
end
function c101012058.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101012058.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
if chk==0 then return Duel.IsExistingTarget(c101012058.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,c101012058.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
......
--メールの階段
--not fully implemented
--Scripted by mallu11
function c101012059.initial_effect(c)
--activate
......@@ -18,13 +18,15 @@ function c101012059.initial_effect(c)
c:RegisterEffect(e2)
end
function c101012059.filter(c)
return c:IsSetCard(0x10b) and c:IsDiscardable(REASON_EFFECT)
return c:IsSetCard(0x10b) and c:IsDiscardable(REASON_EFFECT) and not c:IsHasEffect(101012059)
end
function c101012059.posfilter(c)
return (c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsCanChangePosition()) or (c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanTurnSet())
return (c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsCanChangePosition())
or (c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanTurnSet())
end
function c101012059.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012059.filter,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(c101012059.posfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c101012059.filter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101012059.posfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,tp,LOCATION_HAND)
end
function c101012059.posop(e,tp,eg,ep,ev,re,r,rp)
......@@ -32,6 +34,7 @@ function c101012059.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c101012059.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local pg=Duel.SelectMatchingCard(tp,c101012059.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
if pg:GetCount()>0 then
Duel.HintSelection(pg)
......@@ -47,15 +50,14 @@ function c101012059.posop(e,tp,eg,ep,ev,re,r,rp)
local code=tc:GetCode()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISCARD_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(101012059)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetLabel(code)
e1:SetTarget(c101012059.dhlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c101012059.dhlimit(e,c,tp,r,re)
return re and re:IsActiveType(TYPE_SPELL) and re:GetHandler():IsCode(101012059) and r==REASON_EFFECT+REASON_DISCARD and c:IsCode(e:GetLabel())
function c101012059.dhlimit(e,c)
return c:IsCode(e:GetLabel())
end
......@@ -19,9 +19,7 @@ function c101012062.costfilter(c)
end
function c101012062.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012062.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c101012062.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.DiscardHand(tp,c101012062.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c101012062.filter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_FIEND) and c:IsAbleToHand()
......
......@@ -63,7 +63,8 @@ function c101012063.drfilter(c)
end
function c101012063.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101012063.drfilter,tp,LOCATION_GRAVE,0,1,c) and c:IsAbleToRemoveAsCost() end
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c101012063.drfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101012063.drfilter,tp,LOCATION_GRAVE,0,1,1,c)
g:AddCard(c)
......
......@@ -68,7 +68,9 @@ function c101012065.tgop2(e,tp,eg,ep,ev,re,r,rp)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.GetMatchingGroup(c101012065.filter2,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,ct)
aux.GCheckAdditional=nil
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
......
......@@ -42,7 +42,8 @@ end
function c101012066.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsExistingTarget(c101012066.pfilter1,tp,LOCATION_MZONE,0,1,nil)
local b2=Duel.IsExistingTarget(c101012066.pfilter2,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanOverlay()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and (c101012066.pfilter1(chkc) or c101012066.pfilter2(chkc) and e:GetHandler():IsCanOverlay()) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp)
and (c101012066.pfilter1(chkc) or c101012066.pfilter2(chkc) and e:GetHandler():IsCanOverlay()) end
if chk==0 then return b1 or b2 end
local opt=0
local g=nil
......
......@@ -30,7 +30,8 @@ function c101012067.filter(c,e,tp)
return c:IsSetCard(0x128) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012067.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc,exc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101012067.filter,tp,LOCATION_HAND,0,1,exc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101012067.filter,tp,LOCATION_HAND,0,1,exc,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101012067.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -26,7 +26,8 @@ function c101012068.filter(c)
return c:IsFaceup() and c:IsCode(44133040)
end
function c101012068.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,101012168,0x129,0x4011,400,400,1,RACE_FIEND,ATTRIBUTE_DARK) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101012168,0x129,0x4011,400,400,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
......@@ -34,7 +35,9 @@ function c101012068.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local flag=false
if ft>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,101012168,0x129,0x4011,400,400,1,RACE_FIEND,ATTRIBUTE_DARK) then
if ft>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.IsExistingMatchingCard(c101012068.filter,tp,LOCATION_SZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(101012068,2)) then
if ft>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(c101012068.filter,tp,LOCATION_SZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(101012068,2)) then
flag=true
end
local token=Duel.CreateToken(tp,101012168)
......
......@@ -6,7 +6,7 @@ function c101012070.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMINGS_CHECK_MONSTER+TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e1:SetTarget(c101012070.target)
e1:SetOperation(c101012070.activate)
c:RegisterEffect(e1)
......
......@@ -12,9 +12,7 @@ function c101012072.initial_effect(c)
e1:SetOperation(c101012072.activate)
c:RegisterEffect(e1)
end
function c101012072.filter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_SEASERPENT) and c:IsAbleToHand()
end
function c101012072.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,101012072)
local g=Duel.GetDecktopGroup(tp,ct+3)
......
......@@ -30,13 +30,6 @@ function c101012073.initial_effect(c)
e4:SetCondition(c101012073.regcon2)
e4:SetOperation(c101012073.regop2)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(101012073)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(1,1)
c:RegisterEffect(e5)
end
function c101012073.regfilter(c,tp)
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetSummonPlayer()==tp
......
......@@ -40,8 +40,7 @@ function c101012074.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101012074.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return false end
local tg=g:GetMaxGroup(Card.GetLevel)
local mg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
mg:Sub(tg)
local mg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,tg)
local rg=mg:Filter(Card.IsAbleToRemove,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c101012074.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and rg:GetCount()>0 end
......@@ -51,8 +50,7 @@ function c101012074.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101012074.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return end
local tg=g:GetMaxGroup(Card.GetLevel)
local mg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
mg:Sub(tg)
local mg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,tg)
local rg=mg:Filter(Card.IsAbleToRemove,nil)
if rg:GetCount()>0 then
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
......
......@@ -9,7 +9,7 @@ function c101012075.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_ATTACK+TIMING_END_PHASE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101012075)
e1:SetTarget(c101012075.target)
e1:SetOperation(c101012075.activate)
......@@ -22,7 +22,7 @@ function c101012075.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_ATTACK+TIMING_END_PHASE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,101012075)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101012075.rktg)
......@@ -49,7 +49,7 @@ function c101012075.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(ATTRIBUTE_WATER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterEffect(e1,true)
end
end
function c101012075.rkfilter(c,e,tp)
......
......@@ -34,7 +34,8 @@ end
function c101012076.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then
return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingTarget(c101012076.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(c101012076.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
......@@ -94,7 +95,7 @@ function c101012076.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c101012076.matfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101012076.matfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
......
......@@ -6,7 +6,7 @@ function c101012077.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
......@@ -16,7 +16,7 @@ function c101012077.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,101012077)
e2:SetTarget(c101012077.srtg)
e2:SetOperation(c101012077.srop)
......@@ -29,7 +29,7 @@ function c101012077.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1,101012177)
e3:SetCondition(aux.exccon)
e3:SetCost(aux.bfgcost)
......@@ -45,7 +45,8 @@ function c101012077.srfilter(c)
end
function c101012077.srtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c101012077.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101012077.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsExistingMatchingCard(c101012077.srfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c101012077.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(c101012077.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101012077.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
......
......@@ -23,9 +23,9 @@ function c101012080.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)
if g1:GetCount()<=0 or g2:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc1=g1:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SELECT)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM)
local tc2=g2:Select(1-tp,1,1,nil):GetFirst()
local tg=Group.FromCards(tc1,tc2)
Duel.ConfirmCards(tp,tg)
......
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