Commit b0b3d61f authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro-scripts

parents 059d714f cb7eadf0
...@@ -8,13 +8,11 @@ function c22991179.initial_effect(c) ...@@ -8,13 +8,11 @@ function c22991179.initial_effect(c)
--negate attack --negate attack
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22991179,0)) e2:SetDescription(aux.Stringid(22991179,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c22991179.condition) e2:SetCondition(c22991179.condition)
e2:SetCost(c22991179.cost) e2:SetCost(c22991179.cost)
e2:SetTarget(c22991179.target)
e2:SetOperation(c22991179.activate) e2:SetOperation(c22991179.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -30,12 +28,6 @@ function c22991179.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,12 +28,6 @@ function c22991179.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c22991179.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c22991179.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c22991179.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
end
function c22991179.activate(e,tp,eg,ep,ev,re,r,rp) function c22991179.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack() Duel.NegateAttack()
end end
...@@ -4,26 +4,28 @@ function c63323539.initial_effect(c) ...@@ -4,26 +4,28 @@ function c63323539.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(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_CARD_TARGET)
e1:SetCode(EVENT_CONTROL_CHANGED) e1:SetCode(EVENT_CONTROL_CHANGED)
e1:SetTarget(c63323539.target) e1:SetTarget(c63323539.target)
e1:SetOperation(c63323539.operation) e1:SetOperation(c63323539.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c63323539.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return r==REASON_EFFECT and rp==1-tp
and eg:IsExists(Card.IsControler,1,nil,1-tp) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c63323539.filter(c,e,tp) function c63323539.filter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsControler(1-tp) return c:IsControler(1-tp) and c:IsCanBeEffectTarget(e)
end end
function c63323539.operation(e,tp,eg,ep,ev,re,r,rp) function c63323539.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c63323539.filter(chkc,e,tp) end
if chk==0 then return r==REASON_EFFECT and rp==1-tp
and eg:IsExists(c63323539.tgfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=eg:FilterSelect(tp,c63323539.filter,1,1,nil,e,tp) local g=eg:FilterSelect(tp,c63323539.filter,1,1,nil,e,tp)
local tc=g:GetFirst() Duel.SetTargetCard(g)
if not tc then return end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack())
end
function c63323539.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local atk=tc:GetAttack() local atk=tc:GetAttack()
if atk<0 or tc:IsFacedown() then atk=0 end if atk<0 or tc:IsFacedown() then atk=0 end
if Duel.Destroy(tc,REASON_EFFECT)~=0 then if Duel.Destroy(tc,REASON_EFFECT)~=0 then
......
...@@ -19,19 +19,18 @@ function c76532077.initial_effect(c) ...@@ -19,19 +19,18 @@ function c76532077.initial_effect(c)
e2:SetOperation(c76532077.desop) e2:SetOperation(c76532077.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c76532077.descon2) e3:SetCondition(c76532077.descon2)
e3:SetOperation(c76532077.desop2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c76532077.descon(e,tp,eg,ep,ev,re,r,rp) function c76532077.descon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c76532077.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c76532077.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
local tg=g:GetMaxGroup(Card.GetAttack) local tg=g:GetMaxGroup(Card.GetAttack)
...@@ -47,8 +46,5 @@ function c76532077.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,8 +46,5 @@ function c76532077.desop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c76532077.descon2(e,tp,eg,ep,ev,re,r,rp) function c76532077.descon2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<=4 return tp==Duel.GetTurnPlayer() and Duel.GetCurrentPhase()==PHASE_STANDBY and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<=4
end
function c76532077.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
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