|
1 | | ---Cyber Larva (Anime) |
| 1 | +--サイバー・ラーバァ (Manga) |
| 2 | +--Cyber Larva (Manga) |
2 | 3 | --Scripted by GameMaster() |
3 | 4 | --cleaned up by MLD |
4 | 5 | local s,id=GetID() |
5 | 6 | function s.initial_effect(c) |
6 | | - --avoid battle damage |
| 7 | + --Controller takes no battle damage for the rest of this turn |
7 | 8 | local e1=Effect.CreateEffect(c) |
8 | 9 | e1:SetDescription(aux.Stringid(id,0)) |
9 | 10 | e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) |
10 | 11 | e1:SetCode(EVENT_DESTROYED) |
11 | | - e1:SetCondition(s.con) |
12 | | - e1:SetOperation(s.op1) |
| 12 | + e1:SetCondition(function(e) return e:GetHandler():IsReason(REASON_BATTLE|REASON_EFFECT) end) |
| 13 | + e1:SetOperation(s.nodamop) |
13 | 14 | c:RegisterEffect(e1) |
14 | | - --special summon |
| 15 | + --Special Summon 1 card with the same name as this card from your Deck |
15 | 16 | local e2=Effect.CreateEffect(c) |
16 | 17 | e2:SetDescription(aux.Stringid(id,1)) |
17 | 18 | e2:SetCategory(CATEGORY_SPECIAL_SUMMON) |
18 | 19 | e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) |
19 | 20 | e2:SetCode(EVENT_DESTROYED) |
20 | | - e2:SetCondition(s.con) |
21 | | - e2:SetTarget(s.target) |
22 | | - e2:SetOperation(s.operation) |
| 21 | + e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_BATTLE|REASON_EFFECT) end) |
| 22 | + e2:SetTarget(s.sptg) |
| 23 | + e2:SetOperation(s.spop) |
23 | 24 | c:RegisterEffect(e2) |
24 | 25 | end |
25 | | -s.listed_names={35050257} |
26 | | -function s.con(e,c) |
27 | | - return e:GetHandler():IsReason(REASON_BATTLE+REASON_EFFECT) |
28 | | -end |
29 | | -function s.op1(e,tp,eg,ep,ev,re,r,rp) |
| 26 | +function s.nodamop(e,tp,eg,ep,ev,re,r,rp) |
30 | 27 | local e1=Effect.CreateEffect(e:GetHandler()) |
31 | 28 | e1:SetType(EFFECT_TYPE_FIELD) |
32 | | - e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) |
| 29 | + e1:SetCode(EFFECT_CHANGE_DAMAGE) |
33 | 30 | e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) |
34 | 31 | e1:SetTargetRange(1,0) |
35 | | - e1:SetValue(1) |
36 | | - e1:SetReset(RESET_PHASE+PHASE_END) |
| 32 | + e1:SetValue(s.damval) |
| 33 | + e1:SetReset(RESET_PHASE|PHASE_END,1) |
37 | 34 | Duel.RegisterEffect(e1,tp) |
38 | 35 | end |
39 | | -function s.filter(c,e,tp) |
40 | | - return c:IsCode(35050257) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) |
| 36 | +function s.damval(e,re,dam,r,rp,rc) |
| 37 | + if r&(REASON_BATTLE|REASON_EFFECT)~=0 then |
| 38 | + return 0 |
| 39 | + else return dam end |
| 40 | +end |
| 41 | +function s.spfilter(c,e,tp,cid) |
| 42 | + return c:IsCode(cid) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) |
41 | 43 | end |
42 | | -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 44 | +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) |
43 | 45 | if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 |
44 | | - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end |
| 46 | + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,e:GetHandler():GetCode()) end |
45 | 47 | Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) |
46 | 48 | end |
47 | | -function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 49 | +function s.spop(e,tp,eg,ep,ev,re,r,rp) |
48 | 50 | if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end |
49 | | - local tc=Duel.GetFirstMatchingCard(s.filter,tp,LOCATION_DECK,0,nil,e,tp) |
| 51 | + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetHandler():GetCode()):GetFirst() |
50 | 52 | if tc then |
51 | 53 | Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) |
52 | 54 | end |
|
0 commit comments