Commit 0ee8ca03 authored by songtongtong's avatar songtongtong

bug fix

parent f003b6cc
...@@ -109,6 +109,7 @@ function cm.cfilter(c,e,tp) ...@@ -109,6 +109,7 @@ function cm.cfilter(c,e,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0xccb) and c:IsType(TYPE_MONSTER) and c~=e:GetHandler() return c:IsSummonPlayer(tp) and c:IsSetCard(0xccb) and c:IsType(TYPE_MONSTER) and c~=e:GetHandler()
end end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp) function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
return eg:IsExists(cm.cfilter,1,nil,e,tp) and g:GetCount()>0 and c:GetFlagEffect(m*10)==0 return eg:IsExists(cm.cfilter,1,nil,e,tp) and g:GetCount()>0 and c:GetFlagEffect(m*10)==0
end end
......
--『怪盗Hello Happy』 濑田薰 --『怪盗Hello Happy』 濑田薰
function c64837008.initial_effect(c) function c64837008.initial_effect(c)
--synchro summon --synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit() c:EnableReviveLimit()
--spsummon bgm --spsummon bgm
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS) e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(c64837008.sumcon) e0:SetCondition(c64837008.sumcon)
e0:SetOperation(c64837008.sumsuc) e0:SetOperation(c64837008.sumsuc)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--equip --equip
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(64837008,0)) e1:SetDescription(aux.Stringid(64837008,0))
e1:SetCategory(CATEGORY_EQUIP) e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1,64837008)
e1:SetCondition(c64837008.eqcon) e1:SetCondition(c64837008.eqcon)
e1:SetCost(c64837008.eqcost) e1:SetCost(c64837008.eqcost)
e1:SetTarget(c64837008.eqtg) e1:SetTarget(c64837008.eqtg)
e1:SetOperation(c64837008.eqop) e1:SetOperation(c64837008.eqop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroy replace --destroy replace
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c64837008.desreptg) e2:SetTarget(c64837008.desreptg)
e2:SetValue(c64837008.desrepval) e2:SetValue(c64837008.desrepval)
e2:SetOperation(c64837008.desrepop) e2:SetOperation(c64837008.desrepop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c64837008.sumcon(e,tp,eg,ep,ev,re,r,rp) function c64837008.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_EXTRA) return e:GetHandler():IsPreviousLocation(LOCATION_EXTRA)
end end
function c64837008.sumsuc(e,tp,eg,ep,ev,re,r,rp) function c64837008.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(64837008,0)) Duel.Hint(HINT_MUSIC,0,aux.Stringid(64837008,0))
end end
function c64837008.repfilter(c,tp) function c64837008.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end end
function c64837008.desrepfil(c) function c64837008.desrepfil(c)
return c:GetEquipTarget()~=nil and c:IsAbleToGrave() return c:GetEquipTarget()~=nil and c:IsAbleToGrave()
end end
function c64837008.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) function c64837008.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return eg:IsExists(c64837008.repfilter,1,nil,tp) if chk==0 then return eg:IsExists(c64837008.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c64837008.desrepfil,tp,LOCATION_SZONE,0,1,nil) end and Duel.IsExistingMatchingCard(c64837008.desrepfil,tp,LOCATION_SZONE,0,1,nil) end
return Duel.SelectEffectYesNo(tp,c,96) return Duel.SelectEffectYesNo(tp,c,96)
end end
function c64837008.desrepval(e,c) function c64837008.desrepval(e,c)
return c64837008.repfilter(c,e:GetHandlerPlayer()) return c64837008.repfilter(c,e:GetHandlerPlayer())
end end
function c64837008.desrepop(e,tp,eg,ep,ev,re,r,rp) function c64837008.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,64837008) Duel.Hint(HINT_CARD,0,64837008)
local g=Duel.SelectMatchingCard(tp,c64837008.desrepfil,tp,LOCATION_SZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c64837008.desrepfil,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REPLACE) Duel.SendtoGrave(g,REASON_EFFECT+REASON_REPLACE)
end end
function c64837008.eqcon(e,tp,eg,ep,ev,re,r,rp) function c64837008.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c64837008.can_equip_monster(c) return c64837008.can_equip_monster(c)
end end
function c64837008.eqfilter(c) function c64837008.eqfilter(c)
return c:GetFlagEffect(64837008)~=0 return c:GetFlagEffect(64837008)~=0
end end
function c64837008.can_equip_monster(c) function c64837008.can_equip_monster(c)
local g=c:GetEquipGroup():Filter(c64837008.eqfilter,nil) local g=c:GetEquipGroup():Filter(c64837008.eqfilter,nil)
return g:GetCount()==0 return g:GetCount()==0
end end
function c64837008.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) function c64837008.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000) Duel.PayLPCost(tp,2000)
end end
function c64837008.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) function c64837008.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)>=2 end and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)>=3 end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
function c64837008.eqlimit(e,c) function c64837008.eqlimit(e,c)
return e:GetOwner()==c return e:GetOwner()==c
end end
function c64837008.equip_monster(c,tp,tc) function c64837008.equip_monster(c,tp,tc)
Duel.ConfirmCards(tp,tc) Duel.ConfirmCards(tp,tc)
if not Duel.Equip(tp,tc,c,true) then return end if not Duel.Equip(tp,tc,c,true) then return end
local code=tc:GetCode() local code=tc:GetCode()
--Add Equip limit --Add Equip limit
tc:RegisterFlagEffect(64837008,RESET_EVENT+RESETS_STANDARD,0,0) tc:RegisterFlagEffect(64837008,RESET_EVENT+RESETS_STANDARD,0,0)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_OWNER_RELATE) e0:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e0:SetCode(EFFECT_EQUIP_LIMIT) e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetReset(RESET_EVENT+RESETS_STANDARD) e0:SetReset(RESET_EVENT+RESETS_STANDARD)
e0:SetValue(c64837008.eqlimit) e0:SetValue(c64837008.eqlimit)
tc:RegisterEffect(e0) tc:RegisterEffect(e0)
--copy --copy
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code) e1:SetValue(code)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1) c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
end end
function c64837008.eqop(e,tp,eg,ep,ev,re,r,rp) function c64837008.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ag=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil) if not c:IsRelateToEffect(e) then return end
if ag:GetCount()<2 then return end local ag=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)
local g=ag:RandomSelect(1-tp,2) if ag:GetCount()<3 then return end
Duel.ConfirmCards(1-tp,g) local g=ag:RandomSelect(1-tp,3)
if g:IsExists(Card.IsAbleToChangeControler,1,nil) then Duel.ConfirmCards(tp,g)
local sg=g:Filter(Card.IsAbleToChangeControler,1,nil) if g:IsExists(Card.IsAbleToChangeControler,1,nil) then
local tc=sg:Select(1-tp,1,1,nil):GetFirst() local sg=g:Filter(Card.IsAbleToChangeControler,1,nil)
c64837008.equip_monster(c,tp,tc) local tc=sg:Select(tp,1,1,nil):GetFirst()
end c64837008.equip_monster(c,tp,tc)
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