Commit f3475968 authored by 八宫一月's avatar 八宫一月

fix bug

parent 1b90f797
...@@ -51,28 +51,31 @@ end ...@@ -51,28 +51,31 @@ end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:IsPreviousControler(tp) return c:IsReason(REASON_EFFECT) and rp==1-tp and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) and re:IsActivated()
end end
function s.filter(c) function s.filter(c)
return c:IsSetCard(0x1a2) and c:IsFaceupEx() and c:IsType(TYPE_MONSTER) and not c:IsForbidden() return c:IsSetCard(0x1a2) and c:IsFaceupEx() and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,2,nil) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end if chk==0 then return g:GetClassCount(Card.GetCode)>=2
and Duel.GetLocationCount(tp,LOCATION_SZONE)>1 end
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE) local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ct<2 then return end if ct<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,nil) if g:GetClassCount(Card.GetCode)<2 then return end
for tc in aux.Next(g) do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) local tg1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
local e1=Effect.CreateEffect(e:GetHandler()) for tc in aux.Next(tg1) do
e1:SetCode(EFFECT_CHANGE_TYPE) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
end e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
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