Commit e2eda631 authored by mercury233's avatar mercury233

update souten effect monster material check

parent 90b593df
......@@ -3,6 +3,12 @@ function c33026283.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,85360035,aux.FilterBoolFunction(Card.IsFusionSetCard,0x14f),2,true,false)
--effect monster material check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(c33026283.matcheck)
c:RegisterEffect(e0)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -38,6 +44,12 @@ function c33026283.initial_effect(c)
e3:SetOperation(c33026283.disop)
c:RegisterEffect(e3)
end
function c33026283.matcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsType,1,nil,TYPE_EFFECT) then
c:RegisterFlagEffect(85360035,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
end
end
function c33026283.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
......
......@@ -3,6 +3,12 @@ function c60237530.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x14f),2,true)
--effect monster material check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(c60237530.matcheck)
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60237530,0))
......@@ -28,6 +34,12 @@ function c60237530.initial_effect(c)
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function c60237530.matcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsType,1,nil,TYPE_EFFECT) then
c:RegisterFlagEffect(85360035,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
end
end
function c60237530.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAttackPos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAttackPos,tp,0,LOCATION_MZONE,1,nil) end
......@@ -51,8 +63,7 @@ function c60237530.ffilter(e,c)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f)
end
function c60237530.fmfilter(c)
local mg=c:GetMaterial()
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and c:IsFaceup() and mg and mg:IsExists(Card.IsType,1,nil,TYPE_EFFECT)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and c:IsFaceup() and c:GetFlagEffect(85360035)~=0
end
function c60237530.adcon(e)
local tp=e:GetHandlerPlayer()
......
......@@ -3,6 +3,12 @@ function c7631534.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x14f),2,true)
--effect monster material check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(c7631534.matcheck)
c:RegisterEffect(e0)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -27,6 +33,12 @@ function c7631534.initial_effect(c)
e2:SetOperation(c7631534.disop)
c:RegisterEffect(e2)
end
function c7631534.matcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsType,1,nil,TYPE_EFFECT) then
c:RegisterFlagEffect(85360035,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
end
end
function c7631534.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x14f) and c:IsType(TYPE_FUSION) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
......@@ -57,8 +69,7 @@ function c7631534.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE)
end
function c7631534.fmfilter(c)
local mg=c:GetMaterial()
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and c:IsFaceup() and mg and mg:IsExists(Card.IsType,1,nil,TYPE_EFFECT)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and c:IsFaceup() and c:GetFlagEffect(85360035)~=0
end
function c7631534.discon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
......
......@@ -17,13 +17,37 @@ function c85360035.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCode(EVENT_CUSTOM+85360035)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,85360036)
e2:SetCondition(c85360035.thcon)
e2:SetTarget(c85360035.thtg)
e2:SetOperation(c85360035.thop)
c:RegisterEffect(e2)
if not c85360035.global_check then
c85360035.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetCondition(c85360035.regcon)
ge1:SetOperation(c85360035.regop)
Duel.RegisterEffect(ge1,0)
end
end
function c85360035.cfilter(c,tp)
return c:GetFlagEffect(85360035)~=0 and c:IsReason(REASON_DESTROY)
and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0x14f) and c:IsType(TYPE_FUSION)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c85360035.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(c85360035.cfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c85360035.cfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c85360035.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+85360035,re,r,rp,ep,e:GetLabel())
end
function c85360035.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x14f)
......@@ -51,15 +75,6 @@ function c85360035.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c85360035.thfilter1(c,tp)
local mg=c:GetMaterial()
return mg and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and c:GetPreviousTypeOnField()&TYPE_FUSION~=0 and mg:IsExists(Card.IsType,1,nil,TYPE_EFFECT)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c85360035.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c85360035.thfilter1,1,nil,tp)
end
function c85360035.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
......
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