Commit 04fc15c0 authored by Nemo Ma's avatar Nemo Ma

fix

parent 98e7eeed
......@@ -18,6 +18,10 @@ function cm.lvsum(c,e,tp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
return g:GetSum(Card.GetLevel)
end
function cm.lvsum2(c,e,tp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
return g:GetSum(Card.GetLevel)
end
function cm.adcon(e,c)
return cm.lvsum(c,e,tp)~=0
end
......@@ -29,12 +33,15 @@ end
function cm.filter(c,e,tp)
return c:IsRace(RACE_PSYCHO) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and (cm.lvsum(c,e,tp)%c:GetLevel()==0)
end
function cm.filter2(c,e,tp)
return c:IsRace(RACE_PSYCHO) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and (cm.lvsum2(c,e,tp)%c:GetLevel()==0)
end
function cm.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil,e,tp)
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()==0 then return end
local ct=math.min(2,g:GetClassCount(Card.GetLevel))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -75,8 +75,8 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rp==tp and ((re:IsActiveType(TYPE_MONSTER) and c:GetEquipTarget()==rc) or (re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsSetCard(0x129) and rc~=c))
end
function cm.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0x129)
function cm.matfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x129) and (c:IsControler(tp) or not c:IsImmuneToEffect(e))
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
--local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
......@@ -86,7 +86,7 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local tc=g:GetFirst()
......
......@@ -21,7 +21,7 @@ function cm.initial_effect(c)
end
function cm.check(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsPreviousLocation(LOCATION_REMOVED) and tc:IsPreviousPosition(POS_FACEDOWN) then
if tc:IsPreviousLocation(LOCATION_REMOVED) and tc:IsPreviousPosition(POS_FACEDOWN) and tc:IsLocation(LOCATION_DECK) then
Duel.RegisterFlagEffect(0,m,RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -126,7 +126,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
Duel.Remove(g,POS_FACEUP,r)
local rg=g:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
......
......@@ -67,20 +67,20 @@ function c25000031.xxop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c25000031.stfil,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
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