Commit a6d2403e authored by POLYMER's avatar POLYMER

fix

parent ae3f7158
......@@ -76,9 +76,19 @@ end
function cm.lcheck(g)
return g:GetClassCount(Card.GetLinkRace)==1 and g:GetClassCount(Card.GetCode)==g:GetCount()
end
function cm.exmatcheck(c,lc,tp)
if not c:IsLocation(LOCATION_PZONE) then return false end
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
for _,te in pairs(le) do
local f=te:GetValue()
local related,valid=f(te,lc,nil,c,tp)
if related and not te:GetHandler():IsCode(m) then return false end
end
return true
end
function cm.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,not mg or not mg:IsExists(Card.IsLocation,1,nil,LOCATION_PZONE)
return true,not mg or not mg:IsExists(cm.exmatcheck,1,nil,lc,tp)
end
function cm.LinkCondition(f,minc,maxc,gf)
return function(e,c,og,lmat,min,max)
......
......@@ -57,6 +57,10 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
Duel.RegisterEffect(e0,tp)
local e4=e0:Clone()
e4:SetType(EFFECT_TYPE_QUICK_F)
e4:SetCondition(cm.spcon3)
Duel.RegisterEffect(e4,tp)
end
function cm.valcheck(e,c)
local g=c:GetMaterial()
......@@ -75,6 +79,10 @@ end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.GetFlagEffect(tp,m)>0
end
function cm.spcon3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ((c:IsLocation(LOCATION_ONFIELD+LOCATION_REMOVED) and c:IsFacedown()) or c:GetOverlayTarget() or eg:IsContains(c)) and cm.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.filter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x172) and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
......
......@@ -97,27 +97,28 @@ end
function c50218138.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c50218138.atkfilter(c)
return c:IsFaceup() and (not c:IsAttack(0) or not c:IsDefense(0))
end
function c50218138.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c50218138.atkfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function c50218138.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tg=Duel.GetMatchingGroup(c50218138.atkfilter,tp,0,LOCATION_MZONE,nil)
local tc=tg:GetFirst()
while tc do
local atk=tc:GetAttack()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc=tg:GetNext()
end
......
......@@ -34,6 +34,7 @@ function c50222100.initial_effect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(c50222100.efcon)
e4:SetTarget(c50222100.eftg)
e4:SetOperation(c50222100.efop)
c:RegisterEffect(e4)
--tohand
......@@ -94,13 +95,24 @@ end
function c50222100.efcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c50222100.effilter(c)
return c:IsFaceup() and c:GetType()&TYPE_EFFECT~=0
end
function c50222100.eftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50222100.effilter,tp,0,LOCATION_MZONE,1,nil) end
end
function c50222100.efop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(c50222100.effilter,tp,0,LOCATION_MZONE,nil)
local tc=tg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=tg:GetNext()
end
end
function c50222100.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
......
......@@ -2,7 +2,7 @@
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER),aux.NonTuner(Card.IsAttribute,ATTRIBUTE_WATER),1)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER),aux.NonTuner(Card.IsLevel,7),1)
c:EnableReviveLimit()
--indes
local e0=Effect.CreateEffect(c)
......@@ -29,7 +29,7 @@ function s.initial_effect(c)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCountLimit(1,id)
e2:SetCondition(s.discon)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
......@@ -39,7 +39,7 @@ function s.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetValue(1000)
e3:SetValue(800)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.actcon)
c:RegisterEffect(e3)
......@@ -107,6 +107,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.actcon(e)
local tp=e:GetHandler():GetControler()
return Duel.GetFlagEffect(tp,id)>0
end
function s.efilter(e,te)
......
......@@ -2,7 +2,7 @@
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
aux.AddSynchroProcedure(c,nil,nil,1)
c:EnableReviveLimit()
--atk
local e2=Effect.CreateEffect(c)
......@@ -15,7 +15,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86154370,1))
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
......@@ -33,6 +33,27 @@ function s.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(s.attop)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetCondition(s.checkcon)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.checkfilter(c)
return c:IsCode(53582587) and c:IsFaceup()
end
function s.checkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.checkfilter,0,LOCATION_ONFIELD,0,1,nil) and Duel.GetFlagEffect(0,id)==0 or Duel.IsExistingMatchingCard(s.checkfilter,1,LOCATION_ONFIELD,0,1,nil) and Duel.GetFlagEffect(1,id)==0
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.checkfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(g) do
Duel.RegisterFlagEffect(tc:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
end
end
function s.atkfilter(e,c)
return c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_WATER)
......
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