Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions official/c13438207.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions official/c21558682.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
12 changes: 6 additions & 6 deletions official/c23701465.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion official/c34124316.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions official/c3657444.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion official/c41382147.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions official/c49328340.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
--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)
e2:SetRange(LOCATION_SZONE)
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)
Expand All @@ -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
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions official/c52675689.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
9 changes: 4 additions & 5 deletions official/c54704216.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions official/c63391643.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
5 changes: 3 additions & 2 deletions official/c7672244.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
17 changes: 9 additions & 8 deletions official/c84055227.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion official/c86871614.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down