Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is a possible code for your request:
- ```lua
- -- edopro card script for a spell card with an effect
- local s,id,o=GetID()
- function s.initial_effect(c)
- -- activate only if opponent controls no "titan" monsters
- local e1=Effect.CreateEffect(c)
- e1:SetType(EFFECT_TYPE_ACTIVATE)
- e1:SetCode(EVENT_FREE_CHAIN)
- e1:SetCondition(s.condition)
- e1:SetTarget(s.target)
- e1:SetOperation(s.activate)
- c:RegisterEffect(e1)
- end
- s.listed_names={o}
- s.listed_series={0x123} -- change this to the setcode of "lightning" cards
- function s.condition(e,tp,eg,ep,ev,re,r,rp)
- return not Duel.IsExistingMatchingCard(aux.FilterFaceupFunction(Card.IsSetCard,0x456),tp,0,LOCATION_MZONE,1,nil) -- change this to the setcode of "titan" monsters
- end
- function s.filter(c)
- return c:IsSetCard(0x123) and c:IsAbleToHand() -- change this to the setcode of "lightning" cards
- end
- function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
- 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)
- -- add 1 "lightning" card from deck to hand
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
- local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
- if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
- Duel.ConfirmCards(1-tp,g)
- -- banish 1 facedown card your opponent controls if you added "lightning-Maria"
- local tc=g:GetFirst()
- if tc:IsCode(o) and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then -- change this to the text for asking to banish a facedown card
- Duel.BreakEffect()
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
- local sg=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
- Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
- end
- end
- end
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement