Commit 9b2de765 authored by wind2009's avatar wind2009

Fix 青い涙の乙女

parent d7dbf96f
Pipeline #25893 passed with stages
in 1 minute and 5 seconds
...@@ -71,7 +71,7 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -71,7 +71,7 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.atkop(e,tp,eg,ep,ev,re,r,rp) function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(0) and not tc:IsImmuneToEffect(e) then if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
...@@ -6,12 +6,13 @@ function s.initial_effect(c) ...@@ -6,12 +6,13 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_CUSTOM+id)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.descon) e1:SetCondition(s.descon)
e1:SetTarget(s.destg) e1:SetTarget(s.destg)
e1:SetOperation(s.desop) e1:SetOperation(s.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
aux.RegisterMergedDelayedEvent(c,id,EVENT_SPSUMMON_SUCCESS)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
...@@ -26,7 +27,7 @@ function s.initial_effect(c) ...@@ -26,7 +27,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return c:IsPreviousControler(1-tp) return c:IsSummonPlayer(1-tp)
end end
function s.cfilter2(c) function s.cfilter2(c)
return c:IsType(TYPE_LINK) and c:IsFaceup() return c:IsType(TYPE_LINK) and c:IsFaceup()
...@@ -40,7 +41,7 @@ end ...@@ -40,7 +41,7 @@ end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return eg:IsContains(chkc) and s.filter(chkc,e) end if chkc then return eg:IsContains(chkc) and s.filter(chkc,e) end
if chk==0 then return eg:IsExists(s.filter,1,nil,e) end if chk==0 then return eg:IsExists(s.filter,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=eg:FilterSelect(tp,s.filter,1,1,nil,e) local g=eg:FilterSelect(tp,s.filter,1,1,nil,e)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -52,7 +53,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,7 +53,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and Duel.Destroy(tc,REASON_EFFECT)~=0 then if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsType(TYPE_MONSTER) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local atk=math.floor(tc:GetTextAttack()/2) local atk=math.floor(tc:GetTextAttack()/2)
if atk>0 then if atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT) Duel.Damage(1-tp,atk,REASON_EFFECT)
...@@ -66,10 +67,13 @@ function s.setfilter(c) ...@@ -66,10 +67,13 @@ function s.setfilter(c)
return c:IsFaceupEx() and c:GetType()==TYPE_SPELL and c:IsSSetable() return c:IsFaceupEx() and c:GetType()==TYPE_SPELL and c:IsSSetable()
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and s.thfilter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and s.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,g:GetCount(),0,0)
end
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment