Commit df8198a8 authored by TanakaKotoha's avatar TanakaKotoha

dededededededededededede

parent 208a18aa
No preview for this file type
...@@ -75,11 +75,11 @@ function cm.spfilter1(c,e,tp,lv) ...@@ -75,11 +75,11 @@ function cm.spfilter1(c,e,tp,lv)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==6-lv return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==6-lv
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetLevel()) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(6) and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_GRAVE,0,1,c,e,tp,c:GetLevel())
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
...@@ -87,13 +87,11 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,13 +87,11 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,2,2,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) then return end
local tg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) local tg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if tg:GetCount()>0 then if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
Duel.ConfirmCards(tp,g)
local tc=tg:RandomSelect(tp,1) local tc=tg:RandomSelect(tp,1)
local sg=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_GRAVE,0,nil,e,tp,tc:GetFirst():GetLevel()) local sg=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_GRAVE,0,tc,e,tp,tc:GetFirst():GetLevel())
local sc=sg:RandomSelect(tp,1) local sc=sg:RandomSelect(tp,1)
tc:Merge(sc) tc:Merge(sc)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
...@@ -6,7 +6,18 @@ function cm.initial_effect(c) ...@@ -6,7 +6,18 @@ function cm.initial_effect(c)
local e2=rsef.FTO(c,EVENT_SUMMON_SUCCESS,{m,0},{1,m},"sp,atk,def","de",LOCATION_HAND,cm.spcon,nil,rsop.target2(cm.fun,rscf.spfilter2(),"sp"),cm.spop) local e2=rsef.FTO(c,EVENT_SUMMON_SUCCESS,{m,0},{1,m},"sp,atk,def","de",LOCATION_HAND,cm.spcon,nil,rsop.target2(cm.fun,rscf.spfilter2(),"sp"),cm.spop)
local e5=rsef.RegisterClone(c,e2,"code",EVENT_SPSUMMON_SUCCESS) local e5=rsef.RegisterClone(c,e2,"code",EVENT_SPSUMMON_SUCCESS)
local e3=rsef.SV_INDESTRUCTABLE(c,"battle") local e3=rsef.SV_INDESTRUCTABLE(c,"battle")
local e4=rsef.QO_NEGATE(c,"neg",{1,m+100},"des",LOCATION_MZONE,rscon.negcon(cm.filter)) --negate
local e7=Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_CHAINING)
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1,m+100)
e7:SetCondition(cm.diacon)
e7:SetTarget(cm.diatg)
e7:SetOperation(cm.diaop)
c:RegisterEffect(e7)
end end
function cm.spcon(e,tp,eg) function cm.spcon(e,tp,eg)
local tc=eg:GetFirst() local tc=eg:GetFirst()
...@@ -47,6 +58,24 @@ function cm.spop(e,tp,eg) ...@@ -47,6 +58,24 @@ function cm.spop(e,tp,eg)
local cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1) local cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
end end
end end
function cm.filter(e,tp,re,rp) function cm.diacon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():GetAttack()==e:GetHandler():GetAttack() and re:GetHandler():GetOriginalCode()~=65010561 local c=e:GetHandler()
local rc=re:GetHandler()
local atk=c:GetAttack()
local btk=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_ATTACK)
return re:IsActiveType(TYPE_MONSTER) and rc:GetOriginalCode()~=65010561 and atk==btk
and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.diatg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.diaop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
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