From f1fca420bd4b8fa11c67857bb696f91f0a92b302 Mon Sep 17 00:00:00 2001 From: "argon.sun" Date: Sat, 23 Mar 2013 16:39:43 +0800 Subject: [PATCH] fix --- script/c15458892.lua | 50 ++++++++++++++++++++++++++++++++++++++++++++ script/c19337371.lua | 6 +++--- script/c22653490.lua | 2 +- script/c42752141.lua | 2 +- script/c51852507.lua | 40 +++++++++++++++++++++++++++++++++++ script/c55727845.lua | 2 +- script/c98045062.lua | 2 +- 7 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 script/c15458892.lua create mode 100644 script/c51852507.lua diff --git a/script/c15458892.lua b/script/c15458892.lua new file mode 100644 index 0000000000..e824d29ec3 --- /dev/null +++ b/script/c15458892.lua @@ -0,0 +1,50 @@ +--スターシップ・スパイ・プレーン +function c15458892.initial_effect(c) + --special summon + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_SPSUMMON_PROC) + e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e1:SetRange(LOCATION_HAND) + e1:SetCondition(c15458892.spcon) + c:RegisterEffect(e1) + --return to hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(15458892,0)) + e2:SetCategory(CATEGORY_TOHAND) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetCondition(c15458892.thcon) + e2:SetTarget(c15458892.thtg) + e2:SetOperation(c15458892.thop) + c:RegisterEffect(e2) +end +function c15458892.cfilter(c) + return c:IsFaceup() and c:IsType(TYPE_XYZ) +end +function c15458892.spcon(e,c) + if c==nil then return true end + local tp=c:GetControler() + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(c15458892.cfilter,tp,0,LOCATION_MZONE,1,nil) +end +function c15458892.thcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsPreviousLocation(LOCATION_HAND) +end +function c15458892.thfilter(c) + return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() +end +function c15458892.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c15458892.thfilter(chkc) end + if chk==0 then return true end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOHAND) + local g=Duel.SelectTarget(tp,c15458892.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) +end +function c15458892.thop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc and tc:IsRelateToEffect(e) then + Duel.SendtoHand(tc,nil,REASON_EFFECT) + end +end diff --git a/script/c19337371.lua b/script/c19337371.lua index 65bee32ffc..154d4596d7 100644 --- a/script/c19337371.lua +++ b/script/c19337371.lua @@ -18,7 +18,7 @@ function c19337371.initial_effect(c) end function c19337371.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFlagEffect(tp,19337371)==0 end - Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,0,1) + Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) end function c19337371.filter(c) return c:IsCode(90219263) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY) @@ -37,7 +37,7 @@ function c19337371.activate(e,tp,eg,ep,ev,re,r,rp) end end function c19337371.regcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and Duel.GetFlagEffect(tp,19337371)==0 + return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) end function c19337371.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) @@ -57,7 +57,7 @@ function c19337371.thfilter(c) end function c19337371.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFlagEffect(tp,19337371)==0 end - Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,0,1) + Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c19337371.thop(e,tp,eg,ep,ev,re,r,rp) diff --git a/script/c22653490.lua b/script/c22653490.lua index 6ee9deb7a9..38bae11745 100644 --- a/script/c22653490.lua +++ b/script/c22653490.lua @@ -41,7 +41,7 @@ function c22653490.tdtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function c22653490.tdop1(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsFacedown() and tc:IsRelateToEffect(e) then + if tc and tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,1,REASON_EFFECT) end end diff --git a/script/c42752141.lua b/script/c42752141.lua index b6ff2ebeba..7abfbe38ec 100644 --- a/script/c42752141.lua +++ b/script/c42752141.lua @@ -18,7 +18,7 @@ function c42752141.initial_effect(c) c:RegisterEffect(e1) end function c42752141.condition(e,tp,eg,ep,ev,re,r,rp,chk) - return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) + return re~=e and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) end function c42752141.cost(e,tp,eg,ep,ev,re,r,rp,chk) diff --git a/script/c51852507.lua b/script/c51852507.lua new file mode 100644 index 0000000000..8774c62c48 --- /dev/null +++ b/script/c51852507.lua @@ -0,0 +1,40 @@ +--薔薇の聖弓手 +function c51852507.initial_effect(c) + --Negate + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(51852507,0)) + e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_CHAINING) + e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) + e1:SetRange(LOCATION_HAND) + e1:SetCondition(c51852507.discon) + e1:SetCost(c51852507.discost) + e1:SetTarget(c51852507.distg) + e1:SetOperation(c51852507.disop) + c:RegisterEffect(e1) +end +function c51852507.cfilter(c) + return c:IsFaceup() and c:IsRace(RACE_PLANT) +end +function c51852507.discon(e,tp,eg,ep,ev,re,r,rp) + return ep~=tp and re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) + and Duel.IsExistingMatchingCard(c51852507.cfilter,tp,LOCATION_MZONE,0,1,nil) +end +function c51852507.discost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end + Duel.SendtoGrave(e:GetHandler(),REASON_COST) +end +function c51852507.distg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) + if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then + Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) + end +end +function c51852507.disop(e,tp,eg,ep,ev,re,r,rp) + Duel.NegateActivation(ev) + if re:GetHandler():IsRelateToEffect(re) then + Duel.Destroy(eg,REASON_EFFECT) + end +end diff --git a/script/c55727845.lua b/script/c55727845.lua index 627f220557..38c6a5f053 100644 --- a/script/c55727845.lua +++ b/script/c55727845.lua @@ -41,7 +41,7 @@ function c55727845.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(atk) - e2:SetReset(RESET_EVENT+0x1ff0000) + e2:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e2) end end diff --git a/script/c98045062.lua b/script/c98045062.lua index e392f0697d..29c9ac6d04 100644 --- a/script/c98045062.lua +++ b/script/c98045062.lua @@ -6,7 +6,7 @@ function c98045062.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(TIMING_BATTLE_PHASE+TIMING_STANDBY_PHASE) + e1:SetHintTiming(TIMING_BATTLE_PHASE+TIMING_STANDBY_PHASE,TIMING_BATTLE_PHASE) e1:SetCost(c98045062.cost) e1:SetTarget(c98045062.target) e1:SetOperation(c98045062.activate)