Commit c06733ad authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into master

parents d90670c2 94f15d2f
......@@ -59,7 +59,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(38033121)
e1:SetReset(RESET_EVENT+0xff0000)
e1:SetReset(RESET_EVENT+0xfe0000)
c:RegisterEffect(e1)
end
function s.thfilter(c)
......
......@@ -13,24 +13,20 @@ function s.initial_effect(c)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.effcon)
e2:SetTarget(s.efftg)
e2:SetOperation(s.effop)
c:RegisterEffect(e2)
end
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsControler(tp) then e:SetLabelObject(a) else e:SetLabelObject(d) end
local g=a:GetColumnGroup():Filter(Card.IsLocation,nil,LOCATION_MZONE)
if d and g:IsContains(d) then e:SetLabel(1) else e:SetLabel(0) end
return true
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(e:GetLabelObject())
if e:GetLabel()~=1 then
local a,d=Duel.GetBattleMonster(tp)
if chk==0 then return a end
Duel.SetTargetCard(a)
local g=a:GetColumnGroup():Filter(Card.IsLocation,nil,LOCATION_MZONE)
if d and g:IsContains(d) then
e:SetLabel(1)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
else
e:SetLabel(0)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,6 +25,7 @@ function s.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
......@@ -56,6 +57,9 @@ function s.deop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function s.spfilter(c,e,tp)
return c:IsLevelBelow(5) and c:IsRace(RACE_MACHINE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
......
......@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
......@@ -35,20 +36,27 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b2=s2 and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked())
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
{b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2),2})
e:SetLabel(op)
if op==1 then
if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetOperation(s.spop1)
elseif op==2 then
if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
e:SetOperation(s.spop2)
end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.spop1(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.spop2(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
......
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