Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Mirror Force
- --COPYRIGHT by YAMI AN
- function c999999994.initial_effect(c)
- --Activate
- local e1=Effect.CreateEffect(c)
- e1:SetCategory(CATEGORY_DESTROY)
- e1:SetType(EFFECT_TYPE_ACTIVATE)
- e1:SetCode(EVENT_ATTACK_ANNOUNCE)
- e1:SetCondition(c999999994.condition)
- e1:SetTarget(c999999994.target)
- e1:SetOperation(c999999994.activate)
- c:RegisterEffect(e1)
- end
- function c999999994.condition(e,tp,eg,ep,ev,re,r,rp)
- return tp~=Duel.GetTurnPlayer()
- end
- function c999999994.filter(c)
- return c:IsAttackPos() and c:IsDestructable()
- end
- function c999999994.target(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then
- return Duel.IsExistingMatchingCard(c999999994.filter,tp,0,LOCATION_MZONE,1,nil)
- end
- local g=Duel.GetMatchingGroup(c999999994.filter,tp,0,LOCATION_MZONE,nil)
- Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
- end
- function c999999994.activate(e,tp,eg,ep,ev,re,r,rp)
- local bc=Duel.GetAttacker()
- for i=0,4 do
- local tc=Duel.GetFieldCard(1-tp,LOCATION_MZONE,i)
- if tc and tc:IsAttackPos() and tc:IsFaceup() then
- local atk=tc:GetAttack()
- if atk<bc:GetAttack() then
- Duel.Damage(1-tp,bc:GetAttack()-atk,REASON_BATTLE)
- end
- if atk>bc:GetAttack() then
- Duel.Damage(1-tp,atk-bc:GetAttack(),REASON_BATTLE)
- end
- end
- end
- local g=Duel.GetMatchingGroup(c999999994.filter,tp,0,LOCATION_MZONE,nil)
- if g:GetCount()>0 then
- Duel.Destroy(g,REASON_EFFECT)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement