|
| 1 | +--トリックスター・ハルシネイション |
1 | 2 | --Trickstar Vision |
2 | | ---fixed by MLD |
3 | 3 | local s,id=GetID() |
4 | 4 | function s.initial_effect(c) |
5 | 5 | --Activate |
6 | 6 | local e1=Effect.CreateEffect(c) |
7 | | - e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW) |
| 7 | + e1:SetDescription(aux.Stringid(id,0)) |
| 8 | + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW+CATEGORY_ATKCHANGE+CATEGORY_DISABLE) |
8 | 9 | e1:SetType(EFFECT_TYPE_ACTIVATE) |
9 | 10 | e1:SetCode(EVENT_FREE_CHAIN) |
10 | | - e1:SetCountLimit(1,51109609,EFFECT_COUNT_CODE_OATH) |
| 11 | + e1:SetCountLimit(1,id) |
11 | 12 | e1:SetTarget(s.target) |
12 | 13 | e1:SetOperation(s.activate) |
13 | 14 | c:RegisterEffect(e1) |
14 | 15 | end |
15 | | -function s.filter(c,e,tp) |
16 | | - return c:IsSetCard(0xfb) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) |
| 16 | +s.listed_series={SET_TRICKSTAR} |
| 17 | +function s.spfilter(c,e,tp) |
| 18 | + return c:IsSetCard(SET_TRICKSTAR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) |
17 | 19 | end |
18 | 20 | function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
19 | 21 | if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 |
20 | | - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) |
| 22 | + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) |
21 | 23 | and Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end |
22 | 24 | Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) |
23 | 25 | Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1) |
24 | 26 | end |
25 | 27 | function s.activate(e,tp,eg,ep,ev,re,r,rp) |
26 | 28 | if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end |
27 | 29 | Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) |
28 | | - local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() |
29 | | - if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then |
30 | | - local atk=tc:GetAttack() |
31 | | - local e1=Effect.CreateEffect(e:GetHandler()) |
| 30 | + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() |
| 31 | + if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then |
| 32 | + local c=e:GetHandler() |
| 33 | + --Its ATK becomes halved |
| 34 | + local e1=Effect.CreateEffect(c) |
32 | 35 | e1:SetType(EFFECT_TYPE_SINGLE) |
33 | | - e1:SetCode(EFFECT_DISABLE) |
34 | | - e1:SetReset(RESET_EVENT+RESETS_STANDARD) |
35 | | - tc:RegisterEffect(e1,true) |
36 | | - local e2=Effect.CreateEffect(e:GetHandler()) |
37 | | - e2:SetType(EFFECT_TYPE_SINGLE) |
38 | | - e2:SetCode(EFFECT_DISABLE_EFFECT) |
39 | | - e2:SetReset(RESET_EVENT+RESETS_STANDARD) |
40 | | - tc:RegisterEffect(e2,true) |
41 | | - local e3=Effect.CreateEffect(e:GetHandler()) |
42 | | - e3:SetType(EFFECT_TYPE_SINGLE) |
43 | | - e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) |
44 | | - e3:SetCode(EFFECT_SET_ATTACK) |
45 | | - e3:SetValue(atk/2) |
46 | | - e3:SetReset(RESET_EVENT+RESETS_STANDARD) |
47 | | - tc:RegisterEffect(e3,true) |
48 | | - Duel.SpecialSummonComplete() |
49 | | - if atk>1 then |
| 36 | + e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) |
| 37 | + e1:SetCode(EFFECT_SET_ATTACK) |
| 38 | + e1:SetValue(sc:GetAttack()/2) |
| 39 | + e1:SetReset(RESET_EVENT|RESETS_STANDARD) |
| 40 | + sc:RegisterEffect(e1) |
| 41 | + --Its effects are negated |
| 42 | + sc:NegateEffects(c) |
| 43 | + if Duel.SpecialSummonComplete()>0 then |
| 44 | + local turn_p=Duel.GetTurnPlayer() |
50 | 45 | Duel.BreakEffect() |
51 | | - Duel.Draw(tp,1,REASON_EFFECT) |
52 | | - Duel.Draw(1-tp,1,REASON_EFFECT) |
| 46 | + Duel.Draw(turn_p,1,REASON_EFFECT) |
| 47 | + Duel.Draw(1-turn_p,1,REASON_EFFECT) |
53 | 48 | end |
54 | 49 | end |
55 | 50 | end |
0 commit comments