Commit a05b2870 authored by mercury233's avatar mercury233

fix

parent 26bc3e08
......@@ -37,22 +37,21 @@ function c101011018.bdcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101011018.bdop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c101011018.damcon)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c101011018.damcon)
e1:SetOperation(c101011018.damop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101011018.damcon(e,c)
local tp=e:GetHandlerPlayer()
if Duel.GetFlagEffect(tp,101011018)==0 and Duel.GetAttacker():IsControler(1-tp) then
Duel.RegisterFlagEffect(tp,101011018,RESET_PHASE+PHASE_END,0,1)
return true
else
return false
end
function c101011018.damcon(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
return ep==tp and ac and ac:IsControler(1-tp) and Duel.GetFlagEffect(tp,101011018)==0
end
function c101011018.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,0,false)
Duel.ChangeBattleDamage(1-ep,ev,false)
Duel.RegisterFlagEffect(tp,101011018,RESET_PHASE+PHASE_END,0,1)
end
function c101011018.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsReason(REASON_EFFECT) and bit.band(c:GetPreviousTypeOnField(),TYPE_XYZ)~=0 and c:IsPreviousLocation(LOCATION_MZONE)
......
......@@ -24,7 +24,7 @@ end
function c101011051.condition(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return a and d and a:IsFaceup() and d:IsFaceup() and a:GetAttack()~=d:GetAttack()
return a and d and a:IsFaceup() and d:IsFaceup()
end
function c101011051.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -16,6 +16,9 @@ end
function c101011075.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x126) and c:IsType(TYPE_XYZ)
end
function c101011075.cfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x126) and c:IsType(TYPE_XYZ) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c101011075.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101011075.cfilter,tp,LOCATION_MZONE,0,1,nil)
and re:IsHasType(EFFECT_TYPE_ACTIVATE)
......@@ -29,7 +32,7 @@ function c101011075.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c101011075.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c101011075.cfilter2,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 and not g:GetFirst():IsImmuneToEffect(e) then
rc:CancelToGrave()
Duel.Overlay(g:GetFirst(),Group.FromCards(rc))
......
......@@ -29,6 +29,7 @@ function c101011078.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c101011078.acttg(e,re,tp)
local tc=re:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsPublic,tp,LOCATION_HAND,LOCATION_HAND,nil)
return g:IsExists(Card.IsCode,2,nil,tc:GetCode())
local g1=Duel.GetMatchingGroup(Card.IsPublic,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsPublic,tp,0,LOCATION_HAND,nil)
return g1:IsExists(Card.IsCode,1,nil,tc:GetCode()) and g2:IsExists(Card.IsCode,1,nil,tc:GetCode())
end
......@@ -32,16 +32,21 @@ function c101011080.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE and Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL
end
function c101011080.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainNegatable(ev) and re:GetHandler():IsControlerCanBeChanged()
return Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainNegatable(ev)
end
function c101011080.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local p=re:GetHandlerPlayer()
if chk==0 then return e:GetHandler():IsAbleToGrave()
and ((Duel.GetLocationCount(1-p,LOCATION_MZONE)>0 and re:GetHandler():IsControler(p))
or re:GetHandler():IsControler(1-p)
or not re:GetHandler():IsRelateToEffect(re)) end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,p,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_CONTROL,eg,1,0,0)
end
end
function c101011080.negop(e,tp,eg,ep,ev,re,r,rp)
local p=re:GetHandlerPlayer()
......
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