Star Protector's Protection
- Card ID:
120253065 - Format: Rush Duel
- Script:
Rush/Scripts/c120253065.lua
Stats
| Field | Value |
|---|---|
| Type | 0x4 |
| ATK | 0 |
| DEF | 0 |
| Level/Rank/Link | 0x0 |
| Race | 0x0 |
| Attribute | 0x0 |
| Category | 0x11000 |
Card Text
text
[REQUIREMENT]
When your opponent draws a card during their turn, or when your opponent Normal or Special Summons a monster during their turn, send 1 monster from your field to the Graveyard.
[EFFECT]
This turn, your opponent can only declare an attack once. Also, you can take control of 1 face-up Level 9 or higher Magical Knight Type Fusion Monster with 3000 original ATK on your opponent's field.Detected API Calls
Auxiliary.StringidCard.GetBaseAttackCard.GetSummonPlayerCard.IsAbleToGraveAsCostCard.IsControlerCanBeChangedCard.IsFaceupCard.IsLevelAboveCard.IsRaceCard.IsTypeCard.RegisterEffectDuel.GetControlDuel.GetFlagEffectDuel.GetTurnPlayerDuel.RegisterEffectDuel.RegisterFlagEffectEffect.CloneEffect.CreateEffectEffect.GetHandlerEffect.SetCategoryEffect.SetCodeEffect.SetConditionEffect.SetCostEffect.SetOperationEffect.SetPropertyEffect.SetResetEffect.SetTargetEffect.SetTargetRangeEffect.SetTypeGroup.CloneGroup.IsExistsRushDuel.CanSelectAndDoActionRushDuel.CostSendMZoneToGraveRushDuel.CreateHintEffect
Script
lua
local cm,m=GetID()
cm.name="救惺望御"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DRAW)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCondition(cm.condition2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--Condition
e1:SetCondition(cm.condition1)
end
--Activate
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.ntrfilter(c)
return c:IsFaceup() and c:GetBaseAttack()==3000 and c:IsType(TYPE_FUSION)
and c:IsLevelAbove(9) and c:IsRace(RACE_MAGICALKNIGHT) and c:IsControlerCanBeChanged()
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and ep~=tp
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and eg:IsExists(cm.confilter,1,nil,1-tp)
end
cm.cost=RD.CostSendMZoneToGrave(Card.IsAbleToGraveAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,0,1,RESET_PHASE+PHASE_END)
--Attack Once
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ATTACK_COST)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCost(cm.atkcost)
e1:SetOperation(cm.atkop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
RD.CanSelectAndDoAction(aux.Stringid(m,2),HINTMSG_CONTROL,cm.ntrfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.GetControl(g,tp)
end)
end
function cm.atkcost(e,c,tp)
return Duel.GetFlagEffect(tp,20253065)==0
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,20253065,RESET_PHASE+PHASE_END,0,1)
end