Revenge MAX
- Card ID:
120228065 - Format: Rush Duel
- Script:
Rush/Scripts/c120228065.lua
Stats
| Field | Value |
|---|---|
| Type | 0x4 |
| ATK | 0 |
| DEF | 0 |
| Level/Rank/Link | 0x0 |
| Race | 0x0 |
| Attribute | 0x0 |
| Category | 0x3 |
Card Text
text
[REQUIREMENT]
When your opponent Normal or Special Summons a monster face-up.
[EFFECT]
Destroy 1 Spell/Trap Card on your field. Then, if you destroyed an Equip Spell Card by this effect, you can destroy 1 of those Normal or Special Summoned Level 8 or lower monsters.Detected API Calls
Auxiliary.ExceptThisCardAuxiliary.StringidCard.GetSummonPlayerCard.IsFaceupCard.IsLevelBelowCard.IsLocationCard.IsTypeCard.RegisterEffectDuel.DestroyDuel.GetMatchingGroupDuel.HintDuel.HintSelectionDuel.IsExistingMatchingCardDuel.SelectYesNoDuel.SetOperationInfoEffect.CloneEffect.CreateEffectEffect.GetHandlerEffect.SetCategoryEffect.SetCodeEffect.SetConditionEffect.SetOperationEffect.SetPropertyEffect.SetTargetEffect.SetTypeGroup.CloneGroup.FilterGroup.GetCountGroup.GetFirstGroup.IsExistsGroup.SelectRushDuel.IsPreviousTypeRushDuel.SelectAndDoAction
Script
lua
local cm,m=GetID()
cm.name="复仇极斧"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--Activate
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup()
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.desfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsLevelBelow(8)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,LOCATION_ONFIELD,0,1,1,aux.ExceptThisCard(e),function(g)
local tc=g:GetFirst()
if Duel.Destroy(tc,REASON_EFFECT)~=0 and RD.IsPreviousType(tc,TYPE_EQUIP) then
local sg=eg:Filter(cm.desfilter,nil)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=sg:Select(tp,1,1,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
end)
end