Commit 9d60d885 authored by wind2009's avatar wind2009

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

parents c774bc59 4fc2113d
...@@ -24,7 +24,7 @@ function s.initial_effect(c) ...@@ -24,7 +24,7 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(s.dacon) e3:SetCondition(s.dacon)
e3:SetTarget(s.datg) e3:SetTarget(s.datg)
e3:SetOperation(s.daop) e3:SetOperation(s.daop)
...@@ -66,7 +66,7 @@ function s.filter(c) ...@@ -66,7 +66,7 @@ function s.filter(c)
end end
function s.datg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.datg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return s.filter(chkc) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end if chkc then return s.filter(chkc) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return aux.bpcon(e,tp,eg,ep,ev,re,r,rp) and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end end
function s.daop(e,tp,eg,ep,ev,re,r,rp) function s.daop(e,tp,eg,ep,ev,re,r,rp)
...@@ -101,14 +101,12 @@ function s.daop(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,14 +101,12 @@ function s.daop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.checkop(e,tp,eg,ep,ev,re,r,rp) function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)~=0 then return end
local fid=eg:GetFirst():GetFieldID() local fid=eg:GetFirst():GetFieldID()
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
e:GetLabelObject():SetLabel(fid) e:GetLabelObject():SetLabel(fid)
end end
function s.atkcon(e) function s.atkcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 return e:GetLabel()~=0
end end
function s.atktg(e,c) function s.atktg(e,c)
return c:GetFieldID()~=e:GetLabel() return c:GetFieldID()~=e:GetLabel()
end end
\ No newline at end of file
...@@ -3,12 +3,13 @@ local s,id,o=GetID() ...@@ -3,12 +3,13 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon) e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--pos change --pos change
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -34,20 +35,26 @@ end ...@@ -34,20 +35,26 @@ end
function s.spfilter(c) function s.spfilter(c)
return c:IsFaceup() and c:IsLevelBelow(6) return c:IsFaceup() and c:IsLevelBelow(6)
end end
function s.spcon(e,c) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
if c==nil then return true end return Duel.IsExistingMatchingCard(s.spfilter,tp,0,LOCATION_MZONE,1,nil)
return Duel.IsExistingMatchingCard(s.spfilter,c:GetControler(),0,LOCATION_MZONE,1,nil)
end end
function s.filter(c) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsFaceup() and c:IsCanChangePosition() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end end
function s.poscon(e,tp,eg,ep,ev,re,r,rp) function s.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
end end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end local sg=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,sg,sg:GetCount(),0,0)
end end
function s.cfilter(c) function s.cfilter(c)
...@@ -55,23 +62,25 @@ function s.cfilter(c) ...@@ -55,23 +62,25 @@ function s.cfilter(c)
end end
function s.posop(e,tp,eg,ep,ev,re,r,rp) function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local sg=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,0,POS_FACEUP_ATTACK,0) Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,0,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
for tc in aux.Next(g) do if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c) for tc in aux.Next(g) do
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetValue(c:GetAttribute()) e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(c:GetAttribute())
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
if tc:GetLevel()>0 then tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) if tc:GetLevel()>0 then
e2:SetType(EFFECT_TYPE_SINGLE) local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_CHANGE_LEVEL) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetValue(c:GetLevel()) e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetValue(c:GetLevel())
tc:RegisterEffect(e2) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end end
end end
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -100,4 +109,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -100,4 +109,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
\ No newline at end of file
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