|
1 | 1 | --緊急テレポート |
| 2 | +--Emergency Teleport |
2 | 3 | local s,id=GetID() |
3 | 4 | function s.initial_effect(c) |
4 | 5 | --Activate |
5 | 6 | local e1=Effect.CreateEffect(c) |
6 | | - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) |
| 7 | + e1:SetDescription(aux.Stringid(id,0)) |
| 8 | + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) |
7 | 9 | e1:SetType(EFFECT_TYPE_ACTIVATE) |
8 | 10 | e1:SetCode(EVENT_FREE_CHAIN) |
| 11 | + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) |
9 | 12 | e1:SetTarget(s.target) |
10 | 13 | e1:SetOperation(s.activate) |
11 | 14 | c:RegisterEffect(e1) |
12 | 15 | end |
13 | | -function s.filter(c,e,tp) |
| 16 | +function s.spfilter(c,e,tp) |
14 | 17 | return c:IsLevelBelow(3) and c:IsRace(RACE_PSYCHIC) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) |
15 | 18 | end |
16 | 19 | function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
17 | 20 | if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 |
18 | | - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end |
19 | | - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND) |
| 21 | + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end |
| 22 | + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) |
| 23 | + Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE) |
20 | 24 | end |
21 | 25 | function s.activate(e,tp,eg,ep,ev,re,r,rp) |
22 | 26 | if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end |
23 | | - local c=e:GetHandler() |
24 | | - local fid=c:GetFieldID() |
25 | 27 | Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) |
26 | | - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp) |
27 | | - local tc=g:GetFirst() |
28 | | - if tc then |
29 | | - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) |
30 | | - tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid) |
31 | | - local e1=Effect.CreateEffect(c) |
32 | | - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
33 | | - e1:SetCode(EVENT_PHASE+PHASE_END) |
34 | | - e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) |
35 | | - e1:SetCountLimit(1) |
36 | | - e1:SetLabel(fid) |
37 | | - e1:SetLabelObject(tc) |
38 | | - e1:SetCondition(s.rmcon) |
39 | | - e1:SetOperation(s.rmop) |
40 | | - e1:SetReset(RESET_PHASE+PHASE_END) |
41 | | - Duel.RegisterEffect(e1,tp) |
| 28 | + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() |
| 29 | + if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then |
| 30 | + --Banish it during the End Phase of this turn |
| 31 | + aux.DelayedOperation(sc,PHASE_END,id,e,tp,function(ag) Duel.Remove(ag,POS_FACEUP,REASON_EFFECT) end,nil,nil,nil,aux.Stringid(id,1)) |
42 | 32 | end |
43 | 33 | end |
44 | | -function s.rmcon(e,tp,eg,ep,ev,re,r,rp) |
45 | | - local tc=e:GetLabelObject() |
46 | | - return tc:GetFlagEffectLabel(id)==e:GetLabel() |
47 | | -end |
48 | | -function s.rmop(e,tp,eg,ep,ev,re,r,rp) |
49 | | - local tc=e:GetLabelObject() |
50 | | - Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) |
51 | | -end |
0 commit comments