|
| 1 | +--バトル・バーナー |
| 2 | +--Battle Burner |
| 3 | +local s,id=GetID() |
| 4 | +function s.initial_effect(c) |
| 5 | + --Activate |
| 6 | + local e1=Effect.CreateEffect(c) |
| 7 | + e1:SetDescription(aux.Stringid(id,0)) |
| 8 | + e1:SetCategory(CATEGORY_ATKCHANGE) |
| 9 | + e1:SetType(EFFECT_TYPE_ACTIVATE) |
| 10 | + e1:SetCode(EVENT_ATTACK_DISABLED) |
| 11 | + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) |
| 12 | + e1:SetTarget(s.target) |
| 13 | + e1:SetOperation(s.operation) |
| 14 | + c:RegisterEffect(e1) |
| 15 | +end |
| 16 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) |
| 17 | + if chkc then return chkc==eg:GetFirst() end |
| 18 | + if chk==0 then return eg:GetFirst():IsFaceup() and eg:GetFirst():IsCanBeEffectTarget(e) end |
| 19 | + Duel.SetTargetCard(eg:GetFirst()) |
| 20 | +end |
| 21 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 22 | + local c=e:GetHandler() |
| 23 | + local tc=Duel.GetFirstTarget() |
| 24 | + if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:GetFlagEffect(id)==0 then |
| 25 | + tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) |
| 26 | + local e1=Effect.CreateEffect(c) |
| 27 | + e1:SetType(EFFECT_TYPE_SINGLE) |
| 28 | + e1:SetCode(EFFECT_EXTRA_ATTACK) |
| 29 | + e1:SetValue(1) |
| 30 | + e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) |
| 31 | + tc:RegisterEffect(e1) |
| 32 | + local e2=Effect.CreateEffect(c) |
| 33 | + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) |
| 34 | + e2:SetCode(EVENT_BATTLE_START) |
| 35 | + e2:SetCountLimit(1) |
| 36 | + e2:SetOperation(s.atkop) |
| 37 | + e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) |
| 38 | + tc:RegisterEffect(e2) |
| 39 | + local e3=Effect.CreateEffect(c) |
| 40 | + e3:SetDescription(aux.Stringid(id,1)) |
| 41 | + e3:SetProperty(EFFECT_FLAG_CLIENT_HINT) |
| 42 | + e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) |
| 43 | + tc:RegisterEffect(e3) |
| 44 | + end |
| 45 | +end |
| 46 | +function s.atkop(e,tp,eg,ep,ev,re,r,rp) |
| 47 | + local e1=Effect.CreateEffect(e:GetOwner()) |
| 48 | + e1:SetDescription(aux.Stringid(id,2)) |
| 49 | + e1:SetCategory(CATEGORY_DESTROY) |
| 50 | + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) |
| 51 | + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) |
| 52 | + e1:SetCode(EVENT_BATTLE_DESTROYING) |
| 53 | + e1:SetCondition(aux.bdgcon) |
| 54 | + e1:SetTarget(s.destg) |
| 55 | + e1:SetOperation(s.desop) |
| 56 | + e:GetHandler():RegisterEffect(e1) |
| 57 | +end |
| 58 | +function s.filter(c) |
| 59 | + return c:IsAttackPos() and c:IsDestructable() |
| 60 | +end |
| 61 | +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) |
| 62 | +if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end |
| 63 | + local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) |
| 64 | + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) |
| 65 | +end |
| 66 | +function s.desop(e,tp,eg,ep,ev,re,r,rp) |
| 67 | + local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) |
| 68 | + if #g>0 then |
| 69 | + Duel.Destroy(g,REASON_EFFECT) |
| 70 | + end |
| 71 | +end |
0 commit comments