Commit 0941ca0e authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into develop

parents 76ca9154 09162251
......@@ -3,7 +3,7 @@ function c11502550.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,54959865,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -28,7 +28,7 @@ function c11593137.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,2000)
end
function c11593137.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
local g=eg:Filter(c11593137.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
......
......@@ -100,7 +100,7 @@ function s.distg(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:IsActiveType(TYPE_MONSTER) then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -109,7 +109,7 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
elseif re:IsActiveType(TYPE_SPELL) then
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4))
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -117,7 +117,7 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
elseif re:IsActiveType(TYPE_TRAP) then
Duel.RegisterFlagEffect(tp,id+o*2,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.RegisterFlagEffect(tp,id+o*2,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,5))
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -52,17 +52,18 @@ function c13735899.rmfilter(c,tc)
return c:IsFaceup() and c:GetOriginalRace()==tc:GetOriginalRace() and c:IsAbleToRemove()
end
function c13735899.remtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c13735899.cfilter(chkc,e) end
if chk==0 then return true end
local tc=eg:GetFirst()
if #eg>1 then
local g=eg:Filter(c13735899.cfilter,nil,e):Filter(Card.IsLocation,nil,LOCATION_MZONE)
if chkc then return aux.IsInGroup(chkc,g) end
if chk==0 then return Duel.IsExistingTarget(aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,g) end
local tc=g:GetFirst()
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
tc=eg:FilterSelect(tp,c13735899.cfilter,1,1,nil,e):GetFirst()
tc=g:Select(tp,1,1,nil):GetFirst()
end
Duel.SetTargetCard(tc)
local g=Duel.GetMatchingGroup(c13735899.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tc)
g:AddCard(tc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
local tg=Duel.GetMatchingGroup(c13735899.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tc)
tg:AddCard(tc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,#tg,0,0)
end
function c13735899.remop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -3,7 +3,7 @@ function c17032740.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,89943723,43237273,17732278,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -65,6 +65,11 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if e:GetActivateLocation()==LOCATION_GRAVE then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -37,6 +37,7 @@ function c21521304.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
......
......@@ -22,15 +22,15 @@ function c2347477.initial_effect(c)
e3:SetOperation(c2347477.thop)
c:RegisterEffect(e3)
end
function c2347477.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
function c2347477.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function c2347477.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(2347477)
end
function c2347477.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c2347477.mfilter,1,nil) and not mg:IsExists(c2347477.exmfilter,1,nil)
return true,not mg or mg:IsExists(c2347477.mfilter,1,nil,tp) and not mg:IsExists(c2347477.exmfilter,1,nil)
end
function c2347477.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -71,7 +71,7 @@ end
function s.efilter(e,re)
if Duel.GetTurnPlayer()==e:GetHandlerPlayer() and e:GetHandlerPlayer()~=re:GetOwnerPlayer()
and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) then
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION) or 0
return LOCATION_ONFIELD&loc~=0
end
return false
......
......@@ -3,7 +3,7 @@ function c27346636.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,78868776,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),2,true,true)
aux.AddContactFusionProcedure(c,c27346636.cfilter,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,c27346636.cfilter,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -22,7 +22,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+o)
e2:SetCountLimit(1,id+o)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
......
......@@ -3,7 +3,7 @@ function c28677304.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,43237273,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -27,7 +27,7 @@ function c29223325.desfilter(c,tp,ft)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and Duel.GetSZoneCount(tp,c)>ft
end
function c29223325.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c29223325.desfilter(chkc) and chkc~=e:GetHandler() end
if chkc then return chkc:IsOnField() and c29223325.desfilter(chkc,tp,0) and chkc~=e:GetHandler() end
if chk==0 then
if not Duel.IsExistingMatchingCard(c29223325.filter,tp,LOCATION_DECK,0,1,nil) then return false end
local ft=0
......
......@@ -3,7 +3,7 @@ function c29357956.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),3,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -22,15 +22,15 @@ function c30114823.initial_effect(c)
e3:SetOperation(c30114823.tdop)
c:RegisterEffect(e3)
end
function c30114823.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
function c30114823.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function c30114823.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(30114823)
end
function c30114823.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c30114823.mfilter,1,nil) and not mg:IsExists(c30114823.exmfilter,1,nil)
return true,not mg or mg:IsExists(c30114823.mfilter,1,nil,tp) and not mg:IsExists(c30114823.exmfilter,1,nil)
end
function c30114823.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -2,7 +2,7 @@
function c30864377.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c30864377.matfilter,2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -20,7 +20,7 @@ function c30922149.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(p) then return end
local ct=Duel.GetFieldGroupCount(p,LOCATION_DECK,0)
local ac=0
if ct==0 then ac=1 end
if ct==1 then ac=1 end
if ct>1 then
Duel.Hint(HINT_SELECTMSG,p,aux.Stringid(30922149,0))
if ct==2 then ac=Duel.AnnounceNumber(p,1,2)
......
......@@ -67,18 +67,18 @@ end
function s.filter(c,e)
return c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function s.thfilters(c)
return c:IsFaceup() and c:IsAllTypes(TYPE_CONTINUOUS|TYPE_TRAP) and c:IsSetCard(0x1c1)
function s.thfilters(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsAllTypes(TYPE_CONTINUOUS|TYPE_TRAP) and c:IsSetCard(0x1c1)
end
function s.sgselect(g)
return g:IsExists(s.thfilters,1,nil)
function s.sgselect(g,tp)
return g:IsExists(s.thfilters,1,nil,tp)
end
function s.thtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(s.sgselect,2,2) end
if chk==0 then return g:CheckSubGroup(s.sgselect,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:SelectSubGroup(tp,s.sgselect,false,2,2)
local sg=g:SelectSubGroup(tp,s.sgselect,false,2,2,tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,#sg,0,0)
end
......
......@@ -3,7 +3,7 @@ function c33652635.initial_effect(c)
c:EnableReviveLimit()
--fusion
aux.AddFusionProcCodeFun(c,88996322,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),2,true,true)
aux.AddContactFusionProcedure(c,c33652635.cfilter,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,c33652635.cfilter,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -58,7 +58,7 @@ function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
......
......@@ -27,6 +27,7 @@ function c35618217.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_REMOVE)
e3:SetCondition(aux.bpcon)
e3:SetOperation(c35618217.actop)
c:RegisterEffect(e3)
end
......
......@@ -27,11 +27,12 @@ function s.initial_effect(c)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--destroy
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_SPSUMMON_SUCCESS)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCode(custom_code)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+2*o)
......@@ -39,7 +40,6 @@ function s.initial_effect(c)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
aux.RegisterMergedDelayedEvent(c,id,EVENT_SPSUMMON_SUCCESS)
end
function s.thfilter(c)
return c:IsSetCard(0x83) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
......
......@@ -22,15 +22,15 @@ function c37119142.initial_effect(c)
e2:SetOperation(c37119142.thop)
c:RegisterEffect(e2)
end
function c37119142.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
function c37119142.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function c37119142.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(37119142)
end
function c37119142.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c37119142.mfilter,1,nil) and not mg:IsExists(c37119142.exmfilter,1,nil)
return true,not mg or mg:IsExists(c37119142.mfilter,1,nil,tp) and not mg:IsExists(c37119142.exmfilter,1,nil)
end
function c37119142.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -2,7 +2,7 @@
function c3779662.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,7573135,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),2,true,true)
aux.AddContactFusionProcedure(c,c3779662.cfilter,LOCATION_ONFIELD,0,aux.tdcfop(c)):SetValue(SUMMON_VALUE_SELF)
aux.AddContactFusionProcedure(c,c3779662.cfilter,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c)):SetValue(SUMMON_VALUE_SELF)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -39,6 +39,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,7,0,LOCATION_EXTRA+LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp,chk)
if not Duel.IsPlayerCanRemove(1-tp) then return end
local dg=s.getrmdg(tp)
local edg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil,1-tp,POS_FACEDOWN,REASON_RULE)
local ct1=dg:GetCount()
......
......@@ -23,6 +23,7 @@ function c39913299.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c39913299.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
......
......@@ -3,7 +3,7 @@ function c40080312.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,89943723,80344569,43237273,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -16,7 +16,7 @@ function c40703393.spfilter(c,e,tp,ft,rg)
and rg:CheckWithSumEqual(Card.GetLevel,lv,ft,99)
end
function c40703393.rmfilter(c)
return c:GetLevel()>0 and c:IsAbleToRemove()
return c:GetLevel()>0 and c:IsAbleToRemove() and c:IsFaceup()
end
function c40703393.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......
......@@ -3,12 +3,12 @@ local s,id,o=GetID()
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--to extra
aux.RegisterMergedDelayedEvent(c,id,EVENT_DESTROYED)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_DESTROYED)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOEXTRA)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+id)
e1:SetCode(custom_code)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
......
......@@ -17,13 +17,14 @@ function c47710198.initial_effect(c)
e1:SetOperation(c47710198.drop)
c:RegisterEffect(e1)
--remove monster
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,47710198,EVENT_SPSUMMON_SUCCESS)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47710198,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCode(custom_code)
e2:SetCountLimit(1,47710199)
e2:SetTarget(c47710198.remtg1)
e2:SetOperation(c47710198.remop1)
......
......@@ -54,7 +54,7 @@ function c4810828.discost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function c4810828.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
......
......@@ -3,7 +3,7 @@ function c48156348.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,41470137,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),1,true,true)
aux.AddContactFusionProcedure(c,c48156348.cfilter,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,c48156348.cfilter,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -4,7 +4,7 @@ function s.initial_effect(c)
--fusion summon
aux.AddFusionProcFunRep(c,s.matfilter,5,true)
c:EnableReviveLimit()
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_MZONE+LOCATION_GRAVE,0,aux.tdcfop(c)):SetValue(SUMMON_VALUE_SELF)
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_MZONE+LOCATION_GRAVE,0,aux.ContactFusionSendToDeck(c)):SetValue(SUMMON_VALUE_SELF)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -3,7 +3,7 @@ function c48996569.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,80344569,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -3,7 +3,7 @@ function c49352945.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,89943723,17955766,54959865,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -3,7 +3,7 @@ function c5128859.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,78734254,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -31,15 +31,15 @@ function c53782828.initial_effect(c)
e3:SetCountLimit(1,53782830)
c:RegisterEffect(e3)
end
function c53782828.mfilter(c)
return c:IsLocation(LOCATION_MZONE)
function c53782828.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c53782828.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(53782828)
end
function c53782828.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0x156) then return false,nil end
return true,not mg or mg:IsExists(c53782828.mfilter,1,nil) and not mg:IsExists(c53782828.exmfilter,1,nil)
return true,not mg or mg:IsExists(c53782828.mfilter,1,nil,tp) and not mg:IsExists(c53782828.exmfilter,1,nil)
end
function c53782828.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
......
......@@ -3,7 +3,7 @@ function c55171412.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,17955766,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -53,6 +53,11 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if e:GetActivateLocation()==LOCATION_GRAVE then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
--星遺物-『星杯』
function c57288708.initial_effect(c)
--send to grave
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,57288708,EVENT_SPSUMMON_SUCCESS)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(57288708,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCode(custom_code)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c57288708.tgcon)
......
......@@ -23,15 +23,15 @@ function c59185998.initial_effect(c)
e2:SetOperation(c59185998.thop)
c:RegisterEffect(e2)
end
function c59185998.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x103)
function c59185998.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x103) and c:IsControler(tp)
end
function c59185998.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(59185998)
end
function c59185998.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0x103) then return false,nil end
return true,not mg or mg:IsExists(c59185998.mfilter,1,nil) and not mg:IsExists(c59185998.exmfilter,1,nil)
return true,not mg or mg:IsExists(c59185998.mfilter,1,nil,tp) and not mg:IsExists(c59185998.exmfilter,1,nil)
end
function c59185998.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x103) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
......
......@@ -22,7 +22,6 @@ function s.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(s.repcon)
e3:SetOperation(s.repop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
......
......@@ -26,10 +26,11 @@ function s.initial_effect(c)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
--
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_SPSUMMON_SUCCESS)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCode(custom_code)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE+LOCATION_HAND)
e3:SetCountLimit(1,id+o*2)
......@@ -38,7 +39,6 @@ function s.initial_effect(c)
e3:SetTarget(s.mattg)
e3:SetOperation(s.matop)
c:RegisterEffect(e3)
aux.RegisterMergedDelayedEvent(c,id,EVENT_SPSUMMON_SUCCESS)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
......
......@@ -3,7 +3,7 @@ function c73285669.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -2,12 +2,12 @@
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,45231177)
--
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
--Fusion Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
......@@ -18,7 +18,7 @@ function s.initial_effect(c)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--
--Chain Limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SUMMON_SUCCESS)
......@@ -26,14 +26,14 @@ function s.initial_effect(c)
e3:SetCondition(s.limcon)
e3:SetOperation(s.limop)
c:RegisterEffect(e3)
--
--Chain Limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_CHAIN_END)
e4:SetOperation(s.limop2)
c:RegisterEffect(e4)
--
--atk Change
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_ATKCHANGE)
......@@ -117,22 +117,25 @@ end
function s.chainlm(e,rp,tp)
return tp==rp
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsAttackAbove(1000)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_WARRIOR) end
if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsRace,Card.IsFaceup),tp,LOCATION_MZONE,0,1,nil,RACE_WARRIOR) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.AND(Card.IsRace,Card.IsFaceup),tp,LOCATION_MZONE,0,1,1,nil,RACE_WARRIOR)
Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(1000) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if not tc:IsHasEffect(EFFECT_REVERSE_UPDATE) then
if not tc:IsImmuneToEffect(e) and not tc:IsHasEffect(EFFECT_REVERSE_UPDATE) then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,tc)
local oc=g:GetFirst()
while oc do
......
......@@ -22,15 +22,15 @@ function c75130221.initial_effect(c)
e3:SetOperation(c75130221.disop)
c:RegisterEffect(e3)
end
function c75130221.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
function c75130221.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function c75130221.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(75130221)
end
function c75130221.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c75130221.mfilter,1,nil) and not mg:IsExists(c75130221.exmfilter,1,nil)
return true,not mg or mg:IsExists(c75130221.mfilter,1,nil,tp) and not mg:IsExists(c75130221.exmfilter,1,nil)
end
function c75130221.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -50,7 +50,7 @@ function c76075139.splimit(e,se,sp,st)
end
function c76075139.hspfilter(c,tp,sc)
local seq=c:GetSequence()
return (seq==1 or seq==3 or seq>4) and not c:IsFusionType(TYPE_FUSION) and c:IsLevelAbove(5) and c:IsSetCard(0x17d)
return (seq==1 or seq==3 or seq>4) and not c:IsFusionType(TYPE_FUSION) and c:IsLevelAbove(5) and c:IsFusionSetCard(0x17d)
and c:IsControler(tp) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function c76075139.hspcon(e,c)
......
......@@ -29,15 +29,15 @@ function s.initial_effect(c)
e3:SetValue(s.matval2)
c:RegisterEffect(e3)
end
function s.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
function s.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function s.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(id)
end
function s.matval1(e,lc,mg,c,tp)
if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(s.mfilter,1,nil) and not mg:IsExists(s.exmfilter,1,nil)
return true,not mg or mg:IsExists(s.mfilter,1,nil,tp) and not mg:IsExists(s.exmfilter,1,nil)
end
function s.exmatcheck(c,lc,tp)
if not c:IsLocation(LOCATION_HAND) then return false end
......
......@@ -3,7 +3,7 @@ function c78512663.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,89943723,89621922,80344569,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -33,7 +33,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
function s.mvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase() and e:GetHandler():GetFlagEffect(id)==0
return Duel.IsMainPhase() and Duel.GetTurnCount()~=e:GetHandler():GetFlagEffectLabel(id)
end
function s.mvfilter(c,tp)
local r=LOCATION_REASON_TOFIELD
......@@ -68,7 +68,7 @@ function s.mvop(e,tp,eg,ep,ev,re,r,rp)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2,Duel.GetTurnCount()+1)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -3,7 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunFun(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1a5),s.ffilter,1,true)
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,aux.ContactFusionSendToDeck(c))
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -33,7 +33,7 @@ function c81146288.spcon(e,c)
and g:CheckSubGroup(aux.gfcheck,2,2,Card.IsLocation,LOCATION_HAND,LOCATION_GRAVE)
end
function c81146288.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c81146288.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
local g=Duel.GetMatchingGroup(c81146288.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.gfcheck,true,2,2,Card.IsLocation,LOCATION_HAND,LOCATION_GRAVE)
if sg then
......
......@@ -3,7 +3,7 @@ function c81566151.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,89621922,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -28,11 +28,15 @@ function c83121692.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c83121692.tgfilter(c,ec)
return c:GetFlagEffect(83121692)==0 and not ec:IsHasCardTarget(c)
end
function c83121692.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) end
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c83121692.tgfilter(chkc,c) end
if chk==0 then return Duel.IsExistingTarget(c83121692.tgfilter,tp,LOCATION_MZONE,0,1,nil,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c83121692.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,c)
end
function c83121692.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -44,17 +48,14 @@ function c83121692.operation(e,tp,eg,ep,ev,re,r,rp)
else
c:SetCardTarget(tc)
end
if c:GetFlagEffect(83121693)==0 then
c:RegisterFlagEffect(83121693,RESET_EVENT+RESETS_STANDARD,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c83121692.indcon)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c83121692.indcon)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
function c83121692.indcon(e)
local c=e:GetHandler()
......
......@@ -3,7 +3,7 @@ function c85507811.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,17732278,false,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -59,7 +59,7 @@ function s.checkop1(e,tp,eg,ep,ev,re,r,rp)
end
function s.checkop2(e,tp,eg,ep,ev,re,r,rp)
if re and re:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER) then
local ct=Duel.GetFlagEffect(re:GetHandlerPlayer(),id)
local ct=Duel.GetFlagEffect(re:GetHandlerPlayer(),id) or 0
Duel.ResetFlagEffect(re:GetHandlerPlayer(),id)
if ct>1 then
local ra=0
......
......@@ -3,7 +3,7 @@ function c90050480.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,89943723,c90050480.ffilter,3,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -3,7 +3,7 @@ function c90957527.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,79580323,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1019),1,true,true)
aux.AddContactFusionProcedure(c,c90957527.cfilter,LOCATION_ONFIELD,0,aux.tdcfop(c))
aux.AddContactFusionProcedure(c,c90957527.cfilter,LOCATION_ONFIELD,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -10,7 +10,6 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--equip or draw
local e2=Effect.CreateEffect(c)
......@@ -25,9 +24,6 @@ function s.initial_effect(c)
e2:SetOperation(s.tsop)
c:RegisterEffect(e2)
end
function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function s.eqilter(c)
return c:GetOriginalType()&TYPE_MONSTER~=0
end
......
......@@ -1751,7 +1751,7 @@ function Auxiliary.ContactFusionOperation(mat_operation,operation_params)
end
end
--send to deck of contact fusion
function Auxiliary.tdcfop(c)
function Auxiliary.ContactFusionSendToDeck(c)
return function(g)
local cg=g:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
......@@ -1764,6 +1764,7 @@ function Auxiliary.tdcfop(c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
end
Auxiliary.tdcfop=Auxiliary.ContactFusionSendToDeck
--Ritual Summon
function Auxiliary.AddRitualProcUltimate(c,filter,level_function,greater_or_equal,summon_location,grave_filter,mat_filter,pause,extra_operation,extra_target)
......
......@@ -1631,6 +1631,7 @@ function Auxiliary.MergedDelayEventCheck2(e,tp,eg,ep,ev,re,r,rp)
end
end
--Once the card has been moved to the public area, it should be listened to again
Auxiliary.merge_single_effects={}
function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard(c,code,events)
local g=Group.CreateGroup()
g:KeepAlive()
......@@ -1660,9 +1661,20 @@ function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard(c,code,events)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EVENT_MOVE)
e3:SetLabel(event_code_single)
e3:SetLabelObject(g)
e3:SetOperation(Auxiliary.ThisCardMovedToPublicResetCheck_ToSingleCard)
c:RegisterEffect(e3)
table.insert(Auxiliary.merge_single_effects,e3)
--use global effect to raise event for face-down cards
if not Auxiliary.merge_single_global_check then
Auxiliary.merge_single_global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(Auxiliary.RegisterMergedDelayedEvent_ToSingleCard_RaiseEvent)
Duel.RegisterEffect(ge1,0)
end
return event_code_single
end
function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard_AddOperation(c,g,event,event_code_single)
......@@ -1671,7 +1683,7 @@ function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard_AddOperation(c,g,even
e1:SetCode(event)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(0xff)
e1:SetLabel(event_code_single)
e1:SetLabel(event_code_single,event)
e1:SetLabelObject(g)
e1:SetOperation(Auxiliary.MergedDelayEventCheck1_ToSingleCard)
c:RegisterEffect(e1)
......@@ -1689,17 +1701,16 @@ function Auxiliary.ThisCardMovedToPublicResetCheck_ToSingleCard(e,tp,eg,ep,ev,re
end
function Auxiliary.MergedDelayEventCheck1_ToSingleCard(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local c=e:GetOwner()
g:Merge(eg)
if Duel.CheckEvent(EVENT_MOVE) then
local _,meg=Duel.CheckEvent(EVENT_MOVE,true)
if meg:IsContains(c) and (c:IsFaceup() or c:IsPublic()) then
g:Clear()
end
local code,event=e:GetLabel()
local c=e:GetOwner()
local mr,meg=Duel.CheckEvent(event,true)
if mr and meg:IsContains(c) and (c:IsFaceup() or c:IsPublic()) then
g:Clear()
end
if Duel.GetCurrentChain()==0 and #g>0 and not Duel.CheckEvent(EVENT_CHAIN_END) then
local _eg=g:Clone()
Duel.RaiseEvent(_eg,e:GetLabel(),re,r,rp,ep,ev)
Duel.RaiseEvent(_eg,code,re,r,rp,ep,ev)
g:Clear()
end
end
......@@ -1708,7 +1719,7 @@ function Auxiliary.MergedDelayEventCheck2_ToSingleCard(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckEvent(EVENT_MOVE) then
local _,meg=Duel.CheckEvent(EVENT_MOVE,true)
local c=e:GetOwner()
if meg:IsContains(c) and (c:IsFaceup() or c:IsPublic()) then
if meg:IsContains(c) and (c:IsFaceup() or c:IsPublic()) then
g:Clear()
end
end
......@@ -1718,6 +1729,17 @@ function Auxiliary.MergedDelayEventCheck2_ToSingleCard(e,tp,eg,ep,ev,re,r,rp)
g:Clear()
end
end
function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard_RaiseEvent(e,tp,eg,ep,ev,re,r,rp)
for _,mse in ipairs(Auxiliary.merge_single_effects) do
local code=mse:GetLabel()
local g=mse:GetLabelObject()
if #g>0 then
local _eg=g:Clone()
Duel.RaiseEvent(_eg,code,re,r,rp,ep,ev)
g:Clear()
end
end
end
--B.E.S. remove counter
function Auxiliary.EnableBESRemove(c)
local e1=Effect.CreateEffect(c)
......@@ -1882,7 +1904,10 @@ end
---@param id integer
---@return boolean
function Auxiliary.IsSelfEquip(c,id)
return c:GetEquipGroup():IsExists(Card.GetFlagEffect,1,nil,id)
return c:GetEquipGroup():IsExists(Auxiliary.SelfEquipFilter,1,nil,id)
end
function Auxiliary.SelfEquipFilter(c,id)
return c:GetFlagEffect(id)>0
end
---Orcustrated Babel
---@param c Card
......
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