diff --git a/official/c13438207.lua b/official/c13438207.lua index 697c912fb7..b7ce5d8db6 100644 --- a/official/c13438207.lua +++ b/official/c13438207.lua @@ -2,8 +2,9 @@ --Blossom Bombardment local s,id=GetID() function s.initial_effect(c) - --Activate + --Inflict damage to your opponent equal to the destroyed monster's ATK in the Graveyard local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) @@ -17,13 +18,12 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() local bc=tc:GetBattleTarget() return tc:IsRelateToBattle() and tc:IsStatus(STATUS_OPPO_BATTLE) and tc:IsControler(tp) and tc:IsRace(RACE_PLANT) - and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE) + and bc:IsLocation(LOCATION_GRAVE) and bc:IsMonster() and bc:IsReason(REASON_BATTLE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end + local atk=eg:GetFirst():GetBattleTarget():GetBaseAttack() + if chk==0 then return atk>0 end Duel.SetTargetPlayer(1-tp) - local atk=eg:GetFirst():GetBattleTarget():GetAttack() - if atk<0 then atk=0 end Duel.SetTargetParam(atk) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end diff --git a/official/c21558682.lua b/official/c21558682.lua index c7c6b58bf3..1a9182b5df 100644 --- a/official/c21558682.lua +++ b/official/c21558682.lua @@ -2,13 +2,13 @@ --Jam Defender local s,id=GetID() function s.initial_effect(c) - --activate + --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_BATTLE_START) c:RegisterEffect(e1) - --change target + --Switch the attack target to 1 "Revival Jam" you control local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) @@ -22,7 +22,7 @@ function s.initial_effect(c) end s.listed_names={31709826} function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(1-tp) and Duel.GetAttackTarget()~=nil + return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()~=nil end function s.filter(c,atg) return c:IsFaceup() and c:IsCode(31709826) and atg:IsContains(c) @@ -36,9 +36,8 @@ function s.atktg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,at,atg) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() - if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not Duel.GetAttacker():IsImmuneToEffect(e) then + if tc:IsFaceup() and tc:IsCode(31709826) and tc:IsRelateToEffect(e) and not Duel.GetAttacker():IsImmuneToEffect(e) then Duel.ChangeAttackTarget(tc) end end \ No newline at end of file diff --git a/official/c23701465.lua b/official/c23701465.lua index e4490db398..d2c88bc521 100644 --- a/official/c23701465.lua +++ b/official/c23701465.lua @@ -2,8 +2,9 @@ --Primal Seed local s,id=GetID() function s.initial_effect(c) - --Activate + --Add 2 of your banished cards to your hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) @@ -13,6 +14,7 @@ function s.initial_effect(c) e1:SetOperation(s.activate) c:RegisterEffect(e1) end +s.listed_names={72989439,82301904} function s.cfilter(c) return c:IsFaceup() and c:IsCode(72989439,82301904) end @@ -27,10 +29,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) - local sg=g:Filter(Card.IsRelateToEffect,nil,e) - if #sg>0 then - Duel.SendtoHand(sg,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,sg) + local tg=Duel.GetTargetCards(e) + if #tg==2 then + Duel.SendtoHand(tg,nil,REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c34124316.lua b/official/c34124316.lua index 78c482cd74..54d0113d73 100644 --- a/official/c34124316.lua +++ b/official/c34124316.lua @@ -5,6 +5,7 @@ local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) e1:SetTarget(s.target) @@ -38,7 +39,7 @@ local function summon(g,e,p,tograve,ft) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) - Duel.Destroy(g,REASON_EFFECT) + if not Duel.Destroy(g,REASON_EFFECT)>0 then return end Duel.BreakEffect() local p=Duel.GetTurnPlayer() local summonable1,nonsummonable1=Duel.GetDecktopGroup(p,5):Split(s.spchk,nil,e,p) diff --git a/official/c3657444.lua b/official/c3657444.lua index 834f956a79..fe656c41d2 100644 --- a/official/c3657444.lua +++ b/official/c3657444.lua @@ -38,8 +38,10 @@ function s.drawtg1(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drawop1(e,tp,eg,ep,ev,re,r,rp) - Duel.Draw(tp,1,REASON_EFFECT) - Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1) + if Duel.Draw(tp,1,REASON_EFFECT)>0 then + Duel.BreakEffect() + Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1) + end end function s.drawtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() diff --git a/official/c41382147.lua b/official/c41382147.lua index 8c1cd80a76..e13178889a 100644 --- a/official/c41382147.lua +++ b/official/c41382147.lua @@ -2,6 +2,7 @@ --Rallis the Star Bird local s,id=GetID() function s.initial_effect(c) + --Gains ATK equal to the Level of the monster that it battles x 200 during the Damage Step only local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) @@ -10,7 +11,7 @@ function s.initial_effect(c) e1:SetCondition(s.atkcon) e1:SetValue(s.atkval) c:RegisterEffect(e1) - --remove + --Remove from play this card at the end of the Damage Step and return it to your side of the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) @@ -25,6 +26,7 @@ function s.atkcon(e) local ph=Duel.GetCurrentPhase() return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and (Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()) and Duel.GetAttackTarget()~=nil + and Duel.GetAttackTarget():IsFaceup() end function s.atkval(e,c) return e:GetHandler():GetBattleTarget():GetLevel()*200 diff --git a/official/c49328340.lua b/official/c49328340.lua index 4a5cc0d547..6d0c24dd01 100644 --- a/official/c49328340.lua +++ b/official/c49328340.lua @@ -2,11 +2,12 @@ --Spiral Spear Strike local s,id=GetID() function s.initial_effect(c) + --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --pierce + --Piercing battle damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_PIERCE) @@ -14,7 +15,7 @@ function s.initial_effect(c) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(s.pietg) c:RegisterEffect(e2) - --shuffle + --Draw 2 cards, then discard 1 card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES) @@ -26,7 +27,7 @@ function s.initial_effect(c) e3:SetOperation(s.operation) c:RegisterEffect(e3) end -s.listed_names={CARD_GAIA_CHAMPION} +s.listed_names={6368038,16589042,CARD_GAIA_CHAMPION} function s.pietg(e,c) return c:IsCode(6368038,16589042,CARD_GAIA_CHAMPION) end @@ -41,7 +42,6 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if Duel.Draw(tp,2,REASON_EFFECT)==2 then Duel.ShuffleHand(tp) Duel.BreakEffect() diff --git a/official/c52675689.lua b/official/c52675689.lua index 41e3ccfeb0..d07263a477 100644 --- a/official/c52675689.lua +++ b/official/c52675689.lua @@ -2,7 +2,7 @@ --Invitation to a Dark Sleep local s,id=GetID() function s.initial_effect(c) - --atklimit + --While this card is in the Monster Zone, 1 monster your opponent controls cannot attack local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) @@ -17,14 +17,14 @@ function s.initial_effect(c) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end - if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end + if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil) end function s.operation(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 not tc:IsImmuneToEffect(e) then + if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then c:SetCardTarget(tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) diff --git a/official/c54704216.lua b/official/c54704216.lua index 1a5781a4e7..b76cc96289 100644 --- a/official/c54704216.lua +++ b/official/c54704216.lua @@ -2,8 +2,8 @@ --Nightmare Wheel local s,id=GetID() function s.initial_effect(c) - aux.AddPersistentProcedure(c,1,nil,CATEGORY_DISABLE,nil,TIMING_STANDBY_PHASE,TIMINGS_CHECK_MONSTER,nil,nil,nil,nil,true) - --eff + aux.AddPersistentProcedure(c,1,nil,CATEGORY_POSITION,nil,TIMING_STANDBY_PHASE,TIMINGS_CHECK_MONSTER,nil,nil,nil,nil,true) + --It cannot attack or change its battle position local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK) @@ -15,7 +15,7 @@ function s.initial_effect(c) e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) c:RegisterEffect(e2) - --damage + --Inflict 500 damage to your opponent local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) @@ -27,7 +27,7 @@ function s.initial_effect(c) e3:SetTarget(s.damtg) e3:SetOperation(s.damop) c:RegisterEffect(e3) - --Destroy + --When it leaves the field, destroy this card local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e4:SetRange(LOCATION_SZONE) @@ -55,7 +55,6 @@ function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end \ No newline at end of file diff --git a/official/c63391643.lua b/official/c63391643.lua index fad2f3ec49..e851514ee3 100644 --- a/official/c63391643.lua +++ b/official/c63391643.lua @@ -2,8 +2,9 @@ --Thousand Knives local s,id=GetID() function s.initial_effect(c) - --Activate + --Destroy 1 monster your opponent controls local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) @@ -29,7 +30,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.activate(e) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then Duel.Destroy(tc,REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c7672244.lua b/official/c7672244.lua index 2062208cfd..6eff93f652 100644 --- a/official/c7672244.lua +++ b/official/c7672244.lua @@ -2,8 +2,9 @@ --Shien's Spy local s,id=GetID() function s.initial_effect(c) - --Activate + --Give control of it to your opponent until the End Phase of this turn local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) @@ -24,7 +25,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then + if tc:IsRelateToEffect(e) then Duel.GetControl(tc,1-tp,PHASE_END,1) end end \ No newline at end of file diff --git a/official/c84055227.lua b/official/c84055227.lua index 988c96a281..f688aa6317 100644 --- a/official/c84055227.lua +++ b/official/c84055227.lua @@ -3,15 +3,17 @@ local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(COUNTER_SPELL) - --add counter + --Place 1 Spell Counter on it local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DESTROYING) - e1:SetCondition(s.condition) + e1:SetCondition(aux.bdocon) + e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COUNTER,e:GetHandler(),1,tp,COUNTER_SPELL) end) e1:SetOperation(s.operation) c:RegisterEffect(e1) - --attackup + --Gains 200 ATK for each Spell Counter on it local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) @@ -21,12 +23,11 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.counter_list={COUNTER_SPELL} -function s.condition(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c:IsRelateToBattle() and c:GetBattleTarget():IsMonster() -end function s.operation(e,tp,eg,ep,ev,re,r,rp) - e:GetHandler():AddCounter(COUNTER_SPELL,1) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + c:AddCounter(COUNTER_SPELL,1) + end end function s.attackup(e,c) return c:GetCounter(COUNTER_SPELL)*200 diff --git a/official/c86871614.lua b/official/c86871614.lua index 20d4b34897..38c9cedf42 100644 --- a/official/c86871614.lua +++ b/official/c86871614.lua @@ -2,8 +2,9 @@ --Cloning local s,id=GetID() function s.initial_effect(c) - --Activate + --Special Summon 1 "Clone Token" local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) @@ -22,6 +23,7 @@ end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local ec=eg:GetFirst() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and ec:IsFaceup() and ec:IsLocation(LOCATION_MZONE) and ec:GetOriginalLevel()>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,ec:GetBaseAttack(),ec:GetBaseDefense(), ec:GetOriginalLevel(),ec:GetOriginalRace(),ec:GetOriginalAttribute()) end