Commit 6906a6c8 authored by Tachibana's avatar Tachibana

ybb

parent 63e3db29
No preview for this file type
......@@ -26,7 +26,7 @@ end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -97,7 +97,7 @@ function cm.top(e,tp)
local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if num<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,#sg,nil)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,#sg,nil)
if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
end
......
......@@ -39,7 +39,7 @@ function s.initial_effect(c)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
if eg:IsExists(Card.IsControler,1,nil,p) then
if eg:IsExists(Card.IsControler,1,nil,p) and Duel.GetTurnCount(p)+Duel.GetTurnCount(1-p)>0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -55,7 +55,7 @@ function cm.filter(c)
return c:IsSetCard(0xb71) and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -68,8 +68,8 @@ function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cg=rc:GetColumnGroup()
cg:AddCard(rc)
if chkc then return cm.filter(chkc,cg) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,0,1,nil,cg) and Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,0,1,nil,cg) and e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,0,1,1,nil,cg)
Duel.SetTargetParam(500)
......@@ -81,15 +81,25 @@ end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local tc=Duel.GetFirstTarget()
if Duel.Recover(tp,d,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
local b1=((tc:IsLocation(LOCATION_MZONE) and ((bit.band(tc:GetOriginalType(),TYPE_SPELL+TYPE_TRAP)~=0 and (not tc:IsType(TYPE_SPELL+TYPE_TRAP) and tc:IsCanTurnSet()) or (tc:IsType(TYPE_SPELL+TYPE_TRAP) and tc:IsSSetable() and tc:IsCanTurnSet())) or (bit.band(tc:GetOriginalType(),TYPE_SPELL+TYPE_TRAP)==0 and tc:IsCanTurnSet()))) or (tc:IsLocation(LOCATION_SZONE) and tc:IsSSetable(true))) and not (tc:IsType(TYPE_PENDULUM) and tc:IsLocation(LOCATION_PZONE))
local b2=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_GRAVE,0,1,nil)
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,2))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,3))+1
else return end
if op==0 then
local b1=((tc:IsLocation(LOCATION_MZONE) and ((bit.band(tc:GetOriginalType(),TYPE_SPELL+TYPE_TRAP)~=0 and (not tc:IsType(TYPE_SPELL+TYPE_TRAP) and tc:IsCanTurnSet()) or (tc:IsType(TYPE_SPELL+TYPE_TRAP) and tc:IsSSetable() and tc:IsCanTurnSet())) or (bit.band(tc:GetOriginalType(),TYPE_SPELL+TYPE_TRAP)==0 and tc:IsCanTurnSet()))) or (tc:IsLocation(LOCATION_SZONE) and tc:IsSSetable(true))) and not (tc:IsType(TYPE_PENDULUM) and tc:IsLocation(LOCATION_PZONE))
local b2=tc:IsReleasableByEffect() and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_GRAVE,0,1,nil)
if Duel.Recover(tp,d,REASON_EFFECT)~=0 and (b1 or b2) and tc:IsRelateToEffect(e) then
local off=1
local ops,opval={},{}
if b1 then
ops[off]=aux.Stringid(m,2)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(m,3)
opval[off]=1
off=off+1
end
ops[off]=aux.Stringid(53718007,2)
opval[off]=2
local op=Duel.SelectOption(tp,table.unpack(ops))+1
if opval[op]==0 then
tc:CancelToGrave()
Duel.ChangePosition(tc,POS_FACEDOWN)
local loc=0
......@@ -97,7 +107,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
elseif tc:IsType(TYPE_SPELL+TYPE_TRAP) then loc=LOCATION_SZONE end
if tc:GetOriginalType()&TYPE_MONSTER==0 and tc:IsLocation(LOCATION_MZONE) then Duel.MoveToField(tc,tp,tp,loc,POS_FACEDOWN,false) end
if tc:IsType(TYPE_SPELL+TYPE_TRAP) then Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0) end
else
elseif opval[op]==1 then
if Duel.Release(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter2),tp,LOCATION_GRAVE,0,1,1,nil)
......
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