From 477a05659953bcc49cbb3b208ace100f5cd34bdb Mon Sep 17 00:00:00 2001 From: MichaelLawrenceDee Date: Mon, 2 Jan 2017 19:45:41 +0800 Subject: [PATCH] Anime Card Fixes Starving Venom Fusion Dragon script update Illegal Dark Contract with the War God controller filter fix Speedroid Vidroskull fix Pendulum Halt check for exactly Pendulum, instead of simply face-up cards Ivy Bind Castle script update Seed Cannon Salvo script cleanup --- script/c511009025.lua | 286 ++++++++++++++++++++---------------------- script/c511009373.lua | 25 ++-- script/c511009385.lua | 71 +++++------ script/c511009386.lua | 5 +- script/c511009410.lua | 56 ++++----- script/c511009411.lua | 27 ++-- 6 files changed, 226 insertions(+), 244 deletions(-) diff --git a/script/c511009025.lua b/script/c511009025.lua index 551fe926..57cbdb02 100644 --- a/script/c511009025.lua +++ b/script/c511009025.lua @@ -1,150 +1,136 @@ ---Starve Venom Fusion Dragon (Anime) -function c511009025.initial_effect(c) - --fusion - c:EnableReviveLimit() - -- aux.AddFusionProcFunRep(c,c511009025.mat_filter,2,true) - if Card.IsFusionAttribute then - aux.AddFusionProcFunRep(c,c511009025.mat_filter1,2,true) - else - aux.AddFusionProcFunRep(c,c511009025.mat_filter2,2,true) - end - --material - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetDescription(aux.Stringid(511000674,0)) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1) - e1:SetCondition(c511009025.atkcon) - e1:SetTarget(c511009025.tg) - e1:SetOperation(c511009025.op) - c:RegisterEffect(e1) - -- - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(7338,1)) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetRange(LOCATION_MZONE) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetCountLimit(1) - e2:SetTarget(c511009025.nmtg) - e2:SetOperation(c511009025.nmop) - c:RegisterEffect(e2) - -- - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(7338,2)) - e3:SetCategory(CATEGORY_DESTROY) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_DESTROYED) - e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) - e3:SetCondition(c511009025.descon) - e3:SetTarget(c511009025.destg) - e3:SetOperation(c511009025.desop) - c:RegisterEffect(e3) - if not c511009025.global_check then - c511009025.global_check=true - local ge1=Effect.CreateEffect(c) - ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - ge1:SetCode(EVENT_SPSUMMON_SUCCESS) - ge1:SetLabel(511009025) - ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - ge1:SetOperation(aux.sumreg) - Duel.RegisterEffect(ge1,0) - end -end -function c511009025.mat_filter1(c) - return c:IsFusionAttribute(ATTRIBUTE_DARK) -end -function c511009025.mat_filter2(c) - return c:IsAttribute(ATTRIBUTE_DARK) -end -function c511009025.atkfil(c) - return not c:IsPreviousLocation(LOCATION_ONFIELD) -end -function c511009025.atkcon(e,tp,eg,ep,ev,re,r,rp) - local ph=Duel.GetCurrentPhase() - local c=e:GetHandler() - return c:GetFlagEffect(511009025)~=0 and bit.band(c:GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and c:GetMaterial() - and not c:GetMaterial():IsExists(c511009025.atkfil,1,nil) -end -function c511009025.filter(c) - return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL -end -function c511009025.tg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(c511009025.filter,tp,0,LOCATION_MZONE,1,nil) end -end -function c511009025.op(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local g=Duel.GetMatchingGroup(c511009025.filter,tp,0,LOCATION_MZONE,nil) - if g:GetCount()>0 then - local atk=0 - local tc=g:GetFirst() - while tc do - atk=atk+tc:GetAttack() - tc=g:GetNext() - end - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(atk) - e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) - c:RegisterEffect(e1) - end -end - -function c511009025.nmfil(c) - return c:IsFaceup() and c:IsLevelAbove(5) -end -function c511009025.nmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c511009025.nmfil(chkc) end - if chk==0 then return Duel.IsExistingTarget(c511009025.nmfil,tp,0,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - Duel.SelectTarget(tp,c511009025.nmfil,tp,0,LOCATION_MZONE,1,1,nil) -end -function c511009025.nmop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=Duel.GetFirstTarget() - if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then - local code=tc:GetCode() - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE) - e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) - tc:RegisterEffect(e2) - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_DISABLE_EFFECT) - e3:SetValue(RESET_TURN_SET) - e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) - tc:RegisterEffect(e3) - c:CopyEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,1) - end -end - -function c511009025.descon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c:IsPreviousLocation(LOCATION_MZONE) -end -function c511009025.desfil(c) - return c:IsSummonType(SUMMON_TYPE_SPECIAL) -end -function c511009025.destg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(c511009025.desfil,tp,0,LOCATION_MZONE,1,nil) end - local g=Duel.GetMatchingGroup(c511009025.desfil,tp,0,LOCATION_MZONE,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) -end -function c511009025.desop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(c511009025.desfil,tp,0,LOCATION_MZONE,nil) - if Duel.Destroy(g,REASON_EFFECT)>0 then - local dg=Duel.GetOperatedGroup() - local atk=0 - local tc=dg:GetFirst() - while tc do - if tc:IsPreviousPosition(POS_FACEUP) then - atk=atk+tc:GetPreviousAttackOnField() - end - tc=dg:GetNext() - end - Duel.Damage(1-tp,atk,REASON_EFFECT) - end -end +--Starve Venom Fusion Dragon (Anime) +--fixed by MLD +function c511009025.initial_effect(c) + --fusion + c:EnableReviveLimit() + aux.AddFusionProcFunRep(c,c511009025.mat_filter,2,true) + --material + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCondition(c511009025.effcon) + e1:SetOperation(c511009025.regop) + c:RegisterEffect(e1) + --atk + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetDescription(aux.Stringid(900787,0)) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1) + e2:SetCondition(c511009025.atkcon) + e2:SetTarget(c511009025.atktg) + e2:SetOperation(c511009025.atkop) + c:RegisterEffect(e2) + --effect + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(10032958,0)) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_MZONE) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetCountLimit(1) + e3:SetTarget(c511009025.distg) + e3:SetOperation(c511009025.disop) + c:RegisterEffect(e3) + --destroy + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(7338,2)) + e4:SetCategory(CATEGORY_DESTROY) + e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e4:SetCode(EVENT_DESTROYED) + e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) + e4:SetTarget(c511009025.destg) + e4:SetOperation(c511009025.desop) + c:RegisterEffect(e4) +end +function c511009025.mat_filter(c) + if Card.IsFusionAttribute then + return c:IsFusionAttribute(ATTRIBUTE_DARK) + else + return c:IsAttribute(ATTRIBUTE_DARK) + end +end +function c511009025.effcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local g=c:GetMaterial() + return c:GetSummonType()==SUMMON_TYPE_FUSION and g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_MZONE)==g:GetCount() +end +function c511009025.regop(e,tp,eg,ep,ev,re,r,rp) + e:GetHandler():RegisterFlagEffect(511009025,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) +end +function c511009025.atkcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():GetFlagEffect(511009025)~=0 +end +function c511009025.filter(c) + return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL +end +function c511009025.atktg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(c511009025.filter,tp,0,LOCATION_MZONE,1,nil) end +end +function c511009025.atkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local g=Duel.GetMatchingGroup(c511009025.filter,tp,0,LOCATION_MZONE,nil) + if g:GetCount()>0 then + local atk=0 + local tc=g:GetFirst() + while tc do + atk=atk+tc:GetAttack() + tc=g:GetNext() + end + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(atk) + e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END) + c:RegisterEffect(e1) + end +end +function c511009025.disfilter(c) + return c:IsFaceup() and c:IsLevelAbove(5) and aux.disfilter1(c) +end +function c511009025.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c511009025.disfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(c511009025.disfilter,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + Duel.SelectTarget(tp,c511009025.disfilter,tp,0,LOCATION_MZONE,1,1,nil) +end +function c511009025.disop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then + local code=tc:GetOriginalCode() + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_DISABLE) + e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) + tc:RegisterEffect(e2) + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_SINGLE) + e3:SetCode(EFFECT_DISABLE_EFFECT) + e3:SetValue(RESET_TURN_SET) + e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) + tc:RegisterEffect(e3) + c:ReplaceEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) + end +end +function c511009025.destg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSummonType,tp,0,LOCATION_MZONE,1,nil,SUMMON_TYPE_SPECIAL) end + local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) +end +function c511009025.desop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL) + if Duel.Destroy(g,REASON_EFFECT)>0 then + local dg=Duel.GetOperatedGroup() + local atk=0 + local tc=dg:GetFirst() + while tc do + if tc:IsPreviousPosition(POS_FACEUP) then + atk=atk+tc:GetPreviousAttackOnField() + end + tc=dg:GetNext() + end + Duel.Damage(1-tp,atk,REASON_EFFECT) + end +end diff --git a/script/c511009373.lua b/script/c511009373.lua index c9bc7a9e..7cce3a2a 100644 --- a/script/c511009373.lua +++ b/script/c511009373.lua @@ -1,4 +1,5 @@ --Illegal Dark Contract with the War God +--fixed by MLD function c511009373.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) @@ -14,13 +15,14 @@ function c511009373.initial_effect(c) e2:SetCountLimit(1) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetRange(LOCATION_SZONE) - e2:SetCondition(c511009373.condition) - e2:SetTarget(c511009373.target) - e2:SetOperation(c511009373.operation) + e2:SetCondition(c511009373.atkcon) + e2:SetTarget(c511009373.atktg) + e2:SetOperation(c511009373.atkop) c:RegisterEffect(e2) -- damage local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(45974017,3)) + e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCategory(CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetRange(LOCATION_SZONE) @@ -34,10 +36,10 @@ end function c511009373.filter(c) return c:IsFaceup() and c:IsSetCard(0xaf) end -function c511009373.condition(e,tp,eg,ep,ev,re,r,rp) +function c511009373.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end -function c511009373.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function c511009373.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c511009373.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end @@ -46,18 +48,23 @@ function c511009373.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end -function c511009373.operation(e,tp,eg,ep,ev,re,r,rp) -local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) +function c511009373.atkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc1=g:GetFirst() local tc2=g:GetNext() + if not tc1 or not tc2 or tc1==tc2 then return end + if tc1:IsControler(1-tp) then tc1,tc2=tc2,tc1 end + if tc1:IsControler(1-tp) or tc2:IsControler(tp) then return end if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(e:GetHandler()) + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE) tc1:RegisterEffect(e1) - local e2=Effect.CreateEffect(e:GetHandler()) + local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(-1000) diff --git a/script/c511009385.lua b/script/c511009385.lua index d7f529e8..060a0fc2 100644 --- a/script/c511009385.lua +++ b/script/c511009385.lua @@ -1,6 +1,7 @@ --Speedroid Vidroskull +--fixed by MLD function c511009385.initial_effect(c) ---spsummon + --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(21250202,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -12,66 +13,54 @@ function c511009385.initial_effect(c) e3:SetTarget(c511009385.sptg) e3:SetOperation(c511009385.spop) c:RegisterEffect(e3) - - -- damage + --reflect local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EVENT_PRE_BATTLE_DAMAGE) - e2:SetRange(LOCATION_MZONE) - e2:SetCondition(c511009385.damcon) - e2:SetOperation(c511009385.damop) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) + e2:SetValue(1) c:RegisterEffect(e2) if not c511009385.global_check then c511009385.global_check=true + c511009385[0]=true + c511009385[1]=true local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_SPSUMMON_SUCCESS) - ge1:SetOperation(c511009385.spcheckop) + ge1:SetOperation(c511009385.checkop) Duel.RegisterEffect(ge1,0) + local ge2=Effect.CreateEffect(c) + ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + ge2:SetCode(EVENT_ADJUST) + ge2:SetCountLimit(1) + ge2:SetOperation(c511009385.clear) + Duel.RegisterEffect(ge2,0) end end -function c511009385.spcheckop(e,tp,eg,ep,ev,re,r,rp) - local tc=eg:GetFirst() - local p1=false - local p2=false - while tc do - if tc:GetSummonPlayer()==0 then p1=true else p2=true end - tc=eg:GetNext() - end - if p1 then Duel.RegisterFlagEffect(0,511009385,RESET_PHASE+PHASE_END,0,1) end - if p2 then Duel.RegisterFlagEffect(1,511009385,RESET_PHASE+PHASE_END,0,1) end +function c511009385.cfilter(c,tp) + return c:GetSummonPlayer()==1-tp and c:GetSummonLocation()==LOCATION_EXTRA +end +function c511009385.checkop(e,tp,eg,ep,ev,re,r,rp) + if eg:IsExists(c511009385.cfilter,1,nil,tp) then c511009385[tp]=true end + if eg:IsExists(c511009385.cfilter,1,nil,1-tp) then c511009385[1-tp]=true end +end +function c511009385.clear(e,tp,eg,ep,ev,re,r,rp) + c511009385[0]=false + c511009385[1]=false end - function c511009385.spcon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return Duel.GetFlagEffect(1-tp,511009385)~=0 and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 + return c511009385[tp] and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end function c511009385.sptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true 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 c511009385.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end - if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) - local g=Duel.SelectMatchingCard(tp,c511009385.penfilter,tp,LOCATION_EXTRA,0,1,1,nil) - local tc=g:GetFirst() - if tc then - Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) - end - elseif Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 + if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 + and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then Duel.SendtoGrave(c,REASON_RULE) end end - - - -function c511009385.damcon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return ep==tp and c:IsRelateToBattle() and eg:GetFirst()==c:GetBattleTarget() -end -function c511009385.damop(e,tp,eg,ep,ev,re,r,rp) - Duel.ChangeBattleDamage(1-tp,ev,false) -end diff --git a/script/c511009386.lua b/script/c511009386.lua index b6d1afec..06303699 100644 --- a/script/c511009386.lua +++ b/script/c511009386.lua @@ -1,4 +1,5 @@ --Pendulum Holt +--fixed by MLD function c511009386.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) @@ -12,10 +13,10 @@ function c511009386.initial_effect(c) c:RegisterEffect(e1) end function c511009386.cfilter(c) - return c:IsFaceup() + return c:IsFaceup() and c:IsType(TYPE_PENDULUM) end function c511009386.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetMatchingGroupCount(c511009386.cfilter,c:GetControler(),LOCATION_EXTRA,0,nil)>=3 + return Duel.GetMatchingGroupCount(c511009386.cfilter,tp,LOCATION_EXTRA,0,nil)>=3 end function c511009386.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end diff --git a/script/c511009410.lua b/script/c511009410.lua index e2006343..3cf787c0 100644 --- a/script/c511009410.lua +++ b/script/c511009410.lua @@ -1,4 +1,5 @@ --Ivy Bind Castle +--fixed by MLD function c511009410.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) @@ -39,30 +40,26 @@ function c511009410.initial_effect(c) e5:SetTarget(c511009410.damtg) e5:SetOperation(c511009410.damop) c:RegisterEffect(e5) - - --maintain - local e6=Effect.CreateEffect(c) - e6:SetDescription(aux.Stringid(37195861,0)) - e6:SetCategory(CATEGORY_TOHAND) - e6:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) - e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CARD_TARGET) - e6:SetRange(LOCATION_SZONE) - e6:SetCode(EVENT_PHASE+PHASE_STANDBY) - e6:SetCountLimit(1) - e6:SetCondition(c511009410.con) - e6:SetTarget(c511009410.tg) - e6:SetOperation(c511009410.op) - c:RegisterEffect(e6) + --tribute + local e7=Effect.CreateEffect(c) + e7:SetDescription(aux.Stringid(33900648,1)) + e7:SetCategory(CATEGORY_RELEASE+CATEGORY_DESTROY) + e7:SetCode(EVENT_PHASE+PHASE_STANDBY) + e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e7:SetRange(LOCATION_SZONE) + e7:SetProperty(EFFECT_FLAG_CARD_TARGET) + e7:SetCountLimit(1) + e7:SetCondition(c511009410.descon) + e7:SetTarget(c511009410.destg) + e7:SetOperation(c511009410.desop) + c:RegisterEffect(e7) end - - function c511009410.disop(e,tp,eg,ep,ev,re,r,rp) local tl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) if rp~=tp and (tl==LOCATION_MZONE or tl==LOCATION_SZONE) then Duel.NegateEffect(ev) end end - function c511009410.damcon(e,tp,eg,ep,ev,re,r,rp) return tp~=Duel.GetTurnPlayer() end @@ -73,30 +70,31 @@ function c511009410.damtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*800) end function c511009410.damop(e,tp,eg,ep,ev,re,r,rp) + if not e:GetHandler():IsRelateToEffect(e) then return end local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) Duel.Damage(p,ct*800,REASON_EFFECT) end -function c511009410.effilter(c) - return c:IsFaceup() and c:IsReleasableByEffect() -end -function c511009410.con(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetTurnPlayer()==tp +function c511009410.descon(e,tp,eg,ep,ev,re,r,rp) + return tp==Duel.GetTurnPlayer() end function c511009410.filter(c) return c:IsSetCard(0x10f3) and c:IsReleasableByEffect() end -function c511009410.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function c511009410.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c511009410.filter(chkc) end if chk==0 then return true end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g=Duel.SelectTarget(tp,c511009410.filter,tp,LOCATION_MZONE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + if g:GetCount()==0 then + Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) + end end -function c511009410.op(e,tp,eg,ep,ev,re,r,rp) +function c511009410.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() + if c:IsFacedown() or not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - Duel.Release(tc,REASON_COST) - else Duel.Destroy(c,REASON_COST) + if not tc or not tc:IsRelateToEffect(e) or Duel.Release(tc,REASON_EFFECT)==0 then + Duel.Destroy(e:GetHandler(), REASON_EFFECT) end end diff --git a/script/c511009411.lua b/script/c511009411.lua index 32d216d5..a53f8ad3 100644 --- a/script/c511009411.lua +++ b/script/c511009411.lua @@ -1,4 +1,5 @@ --Seed Cannon Salvo +--fixed by MLD function c511009411.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) @@ -8,19 +9,20 @@ function c511009411.initial_effect(c) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(78748366,0)) - e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) - e2:SetCost(c511009411.thcost) - e2:SetTarget(c511009411.thtg) - e2:SetOperation(c511009411.thop) + e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e2:SetCost(c511009411.damcost) + e2:SetTarget(c511009411.damtg) + e2:SetOperation(c511009411.damop) c:RegisterEffect(e2) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(41517968,0)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCategory(CATEGORY_DESTROY) - e4:SetProperty(EFFECT_FLAG_CARD_TARGET) + e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetCode(EVENT_DESTROYED) e4:SetTarget(c511009411.destg) e4:SetOperation(c511009411.desop) @@ -29,19 +31,20 @@ end function c511009411.costfilter(c) return c:IsSetCard(0x10f3) and c:IsLevelBelow(4) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() end -function c511009411.thcost(e,tp,eg,ep,ev,re,r,rp,chk) +function c511009411.damcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c511009411.costfilter,tp,LOCATION_DECK,0,1,nil) end local g=Duel.SelectMatchingCard(tp,c511009411.costfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end -function c511009411.thtg(e,tp,eg,ep,ev,re,r,rp,chk) +function c511009411.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(300) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300) end -function c511009411.thop(e,tp,eg,ep,ev,re,r,rp) +function c511009411.damop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Damage(p,d,REASON_EFFECT)~=0 then local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) @@ -57,17 +60,15 @@ function c511009411.thop(e,tp,eg,ep,ev,re,r,rp) end end end ------------------------- function c511009411.filter(c) return c:IsFaceup() and c:IsSetCard(0x10f3) end function c511009411.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end - if chk==0 then return Duel.IsExistingMatchingCard(c511009411.filter,tp,LOCATION_MZONE,0,1,nil) - and Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end + if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end + if chk==0 then return true end local ct=Duel.GetMatchingGroupCount(c511009411.filter,tp,LOCATION_MZONE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,ct,nil) + local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) end function c511009411.desop(e,tp,eg,ep,ev,re,r,rp)