Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is a sample code for an EDOPro card script that meets your requirements:
- ```lua
- local s,id,o=GetID()
- function s.initial_effect(c)
- local e1=Effect.CreateEffect(c)
- e1:SetType(EFFECT_TYPE_ACTIVATE)
- e1:SetCode(EVENT_FREE_CHAIN)
- e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
- e1:SetCondition(s.condition)
- e1:SetTarget(s.target)
- e1:SetOperation(s.activate)
- c:RegisterEffect(e1)
- end
- function s.condition(e,tp,eg,ep,ev,re,r,rp)
- return not Duel.IsExistingMatchingCard(aux.FilterFaceupFunction(Card.IsSetCard,0xTITAN),tp,0,LOCATION_MZONE,1,nil)
- end
- function s.filter(c,e,tp,eg,ep,ev,re,r,rp)
- return c:IsSetCard(0xLIGHTNING) and c:IsAbleToHand()
- end
- function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
- Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
- end
- function s.activate(e,tp,eg,ep,ev,re,r,rp)
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
- local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
- if #g>0 then
- Duel.SendtoHand(g,nil,REASON_EFFECT)
- Duel.ConfirmCards(1-tp,g)
- if g:GetFirst():IsCode(CARD_LIGHTNING_MARIA) then
- local g2=Duel.SelectMatchingCard(tp,s.banishfilter,tp,0,LOCATION_ONFIELD,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
- if g2 then
- Duel.Banish(g2,pos=POS_FACEDOWN)
- end
- end
- end
- end
- function s.banishfilter(c,e,tp,eg,ep,ev,re,r,rp)
- return c:IsFacedown() and c:IsAbleToRemove()
- end
- ```
- This script creates an effect for a spell card that can only be activated if your opponent controls no "titan" monsters. When activated it allows you to add 1 "lightning" card from your deck to your hand. If you added "lightning-Maria" with this effect it also allows you to banish one facedown card your opponent controls. The effect of this card can only be activated once per turn.
- I hope this helps! Let me know if you have any questions or need further assistance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement