Commit 3586b849 authored by Nemo Ma's avatar Nemo Ma

fix

parent c5c0fcad
......@@ -7,7 +7,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......@@ -28,6 +28,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
......@@ -76,4 +77,4 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
end
......@@ -48,7 +48,10 @@ end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_ONFIELD)
Duel.SetChainLimit(aux.FALSE)
Duel.SetChainLimit(cm.chlimit)
end
function cm.chlimit(e,ep,tp)
return tp==ep
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......@@ -82,4 +85,4 @@ end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
end
local m=53711003
local cm=_G["c"..m]
cm.name="魔理沙役 AKN"
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
SNNM.MRSYakuSP(c,3,TYPE_SPELL+TYPE_TRAP)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
......@@ -27,113 +20,11 @@ function cm.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.con)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_CUSTOM+53711005)
e5:SetRange(LOCATION_HAND)
e5:SetCost(cm.spcost)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
function cm.spfilter1(c,e,tp)
if c:IsLocation(LOCATION_HAND) then
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDiscardable()
else
return e:GetHandler():IsOriginalSetCard(0x3538) and e:GetHandler():IsLevel(4) and c:IsAbleToRemove() and c:IsHasEffect(53711009,tp)
end
end
function cm.spfilter2(c,e,tp)
return c:IsSetCard(0x3538) and c:IsType(TYPE_SPELL)
end
function cm.timefilter(c,tp)
return c:IsHasEffect(53711065,tp) and c:GetFlagEffect(53711015)<2
end
function cm.fselect(g,ct)
local g2=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
return aux.dncheck(g2) and #g2<=ct
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ltime=0
local timeg=Duel.GetMatchingGroup(cm.timefilter,tp,LOCATION_MZONE,0,c,tp)
if #timeg>0 then
local ttct=0
for timec in aux.Next(timeg) do
local timect=timec:GetFlagEffect(53711015)
ttct=ttct+timect
end
ltime=2*#timeg-ttct
end
local g=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,c,e,tp)
local gdg=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_DECK,0,c,e,tp)
local ct=gdg:GetClassCount(Card.GetCode)
if ct>ltime then ct=ltime end
if chk==0 then return #g+ct>2 end
g:Merge(gdg)
if ltime>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
local sg=g:SelectSubGroup(tp,cm.fselect,false,3,3,ct)
local dg=sg:Filter(Card.IsLocation,nil,LOCATION_DECK)
if #dg>0 then
if #timeg>1 then
for i=1,#dg do
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
local usedg=timeg:FilterSelect(tp,cm.timefilter,1,1,nil)
Duel.HintSelection(usedg)
local usedc=usedg:GetFirst()
local trg=usedc:GetFlagEffect(53711015)
usedc:RegisterFlagEffect(53711015,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(53711015,trg+3))
end
else
for i=1,#dg do
local trg=timeg:GetFirst():GetFlagEffect(53711015)
timeg:GetFirst():RegisterFlagEffect(53711015,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(53711015,trg+3))
end
end
end
local tc=sg:GetFirst()
while tc do
local te=tc:IsHasEffect(53711009,tp)
if te then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
tc=sg:GetNext()
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,3,3,c,e,tp)
local tc=sg:GetFirst()
while tc do
local te=tc:IsHasEffect(53711009,tp)
if te then
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
tc=sg:GetNext()
end
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end
end
function cm.scon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
......
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