Commit 1168edcd authored by a597449807's avatar a597449807 Committed by Chen Bill

Fix Asset Mountis (#2685)

parent a7430073
...@@ -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