Commit c8a73123 authored by Tachibana's avatar Tachibana

tnndx

parent c5a5f379
No preview for this file type
--天狗道曼陀罗 --天狗道曼陀罗
function c12301600.initial_effect(c) function c12301600.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
...@@ -8,19 +9,19 @@ function c12301600.initial_effect(c) ...@@ -8,19 +9,19 @@ function c12301600.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c12301600.acop) e1:SetOperation(c12301600.acop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot release or tohand --cannot release or todeck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM) e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
e2:SetValue(1) e2:SetValue(c12301600.fu)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_SUM) e3:SetCode(EFFECT_UNRELEASABLE_SUM)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e8=e2:Clone() local e8=e2:Clone()
e8:SetCode(EFFECT_CANNOT_TO_HAND) e8:SetCode(EFFECT_CANNOT_TO_DECK)
c:RegisterEffect(e8) c:RegisterEffect(e8)
--cannot disable spsummon and summon --cannot disable spsummon and summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -36,23 +37,21 @@ function c12301600.initial_effect(c) ...@@ -36,23 +37,21 @@ function c12301600.initial_effect(c)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--add effect --add effect
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e6:SetDescription(aux.Stringid(12301600,1))
e6:SetRange(LOCATION_SZONE) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetTargetRange(LOCATION_MZONE,0) e6:SetCode(EVENT_CHAINING)
e6:SetTarget(c12301600.aetg) e6:SetProperty(EFFECT_CANNOT_DISABLE)
e6:SetLabelObject(e7) e6:SetRange(LOCATION_MZONE)
c:RegisterEffect(e6) e6:SetCondition(c12301600.cdcd)
e6:SetOperation(c12301600.cdop)
e6:SetCountLimit(1)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(12301600,1)) e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e7:SetType(EFFECT_TYPE_QUICK_O) e7:SetRange(LOCATION_FZONE)
e7:SetCode(EVENT_CHAINING) e7:SetTargetRange(LOCATION_MZONE,0)
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_CANNOT_DISABLE) e7:SetTarget(c12301600.aetg)
e7:SetRange(LOCATION_ONFIELD) e7:SetLabelObject(e6)
e7:SetCondition(c12301600.cdcd)
e7:SetOperation(c12301600.cdop)
e7:SetCountLimit(1)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function c12301600.filfd(c) function c12301600.filfd(c)
return c:IsFacedown() and c:IsSetCard(0x2d6) return c:IsFacedown() and c:IsSetCard(0x2d6)
...@@ -60,26 +59,30 @@ end ...@@ -60,26 +59,30 @@ end
function c12301600.acop(e,tp,eg,ep,ev,re,r,rp) function c12301600.acop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c12301600.filfd,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c12301600.filfd,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then if g:GetCount()>0 and Duel.GetFlagEffect(tp,12301600)==0 then
if Duel.SelectYesNo(tp,aux.Stringid(12301600,2)) then if Duel.SelectYesNo(tp,aux.Stringid(12301600,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst() local tc=g:Select(tp,1,1,nil):GetFirst()
tc:ReverseInDeck() tc:ReverseInDeck()
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.RegisterFlagEffect(tp,12301600,RESET_PHASE+PHASE_END,0,1)
end end
end end
end end
function c12301600.fu(e)
return e:GetHandler():IsFaceup()
end
function c12301600.cdv(e) function c12301600.cdv(e)
local p=e:GetHandlerPlayer() local p=e:GetHandlerPlayer()
return Duel.GetMatchingGroupCount(Card.IsType,p,LOCATION_ONFIELD,0,nil,TYPE_MONSTER)==0 return Duel.GetMatchingGroupCount(Card.IsType,p,LOCATION_ONFIELD,0,nil,TYPE_MONSTER)==0
end end
function c12301600.aetg(e,c) function c12301600.aetg(e,c)
return c:IsSetCard(0x2d6) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x2d6) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end end
function c12301600.cdcd(e,tp,eg,ep,ev,re,r,rp) function c12301600.cdcd(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsType(TYPE_MONSTER) and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,0,1,c,TYPE_MONSTER) return Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,1,nil)==1
end end
function c12301600.cdop(e,tp,eg,ep,ev,re,r,rp) function c12301600.cdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -11,7 +11,7 @@ function c12301666.initial_effect(c) ...@@ -11,7 +11,7 @@ function c12301666.initial_effect(c)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--sp --sp
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_QUICK_F)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_DRAW) e1:SetCode(EVENT_DRAW)
...@@ -22,7 +22,7 @@ function c12301666.initial_effect(c) ...@@ -22,7 +22,7 @@ function c12301666.initial_effect(c)
e1:SetOperation(c12301666.spop) e1:SetOperation(c12301666.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_F)
e2:SetRange(LOCATION_DECK) e2:SetRange(LOCATION_DECK)
e2:SetCode(EVENT_CHAIN_END) e2:SetCode(EVENT_CHAIN_END)
e2:SetCondition(c12301666.spcon2) e2:SetCondition(c12301666.spcon2)
...@@ -84,9 +84,9 @@ end ...@@ -84,9 +84,9 @@ end
--td --td
function c12301666.tdcs(e,tp,eg,ep,ev,re,r,rp,chk) function c12301666.tdcs(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end local gtd=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
local ghf=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_ONFIELD,0) if chk==0 then return not c:IsPublic() and gtd:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,ghf,ghf:GetCount(),tp,LOCATION_HAND+LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_TODECK,gtd,gtd:GetCount(),tp,LOCATION_HAND+LOCATION_ONFIELD)
end end
function c12301666.filthh(c) function c12301666.filthh(c)
return c:IsLocation(LOCATION_HAND) or c:IsAbleToHand() return c:IsLocation(LOCATION_HAND) or c:IsAbleToHand()
...@@ -95,47 +95,41 @@ function c12301666.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -95,47 +95,41 @@ function c12301666.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local che=nil local che=nil
--adjust local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK) and Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK):GetHandlerPlayer()==tp then Duel.SendtoDeck(tg,nil,1,REASON_EFFECT)
che=1 end local dg=tg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local gof=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,0,nil) if dg:GetCount()~=tg:GetCount() then return end
if gof then
local ghfc=Duel.GetMatchingGroupCount(c12301666.filthh,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
Duel.SendtoHand(gof,nil,REASON_EFFECT)
che=(che or Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=ghfc)
end
Duel.ShuffleHand(tp)
if che then return end
Duel.BreakEffect() Duel.BreakEffect()
local gh=Duel.GetFieldGroup(tp,LOCATION_HAND,0) Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(12301666,1))
while #gh>0 do local tc=dg:RandomSelect(1-tp,1):GetFirst()
local tc=gh:RandomSelect(1-tp,1):GetFirst() Duel.ShuffleDeck(tp)
if #gh==1 then Duel.ConfirmCards(tp,tc) Duel.MoveSequence(tc,1)
Duel.SendtoDeck(tc,nil,1,REASON_EFFECT) Duel.ConfirmCards(tp,tc)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
tc:ReverseInDeck() tc:ReverseInDeck()
local fid=c:GetFieldID()
tc:RegisterFlagEffect(12301666,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12301666,1)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_DECK)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(c12301666.destg) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c12301666.descon)
e1:SetOperation(c12301666.desop) e1:SetOperation(c12301666.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp)
tc:RegisterEffect(e1)
else Duel.SendtoDeck(tc,nil,1,REASON_EFFECT) end
gh:RemoveCard(tc)
end
end end
function c12301666.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c12301666.descon(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return e:GetHandler():IsFaceup() end local tc=e:GetLabelObject()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) if tc:GetFlagEffectLabel(12301666)~=e:GetLabel() then
e:Reset()
return false
else return true end
end end
function c12301666.desop(e,tp,eg,ep,ev,re,r,rp) function c12301666.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.ShuffleDeck(tp)
end
end end
function c12301666.efilter(e,te) function c12301666.efilter(e,te)
return te:GetOwner()~=e:GetOwner() return te:GetOwner()~=e:GetOwner()
......
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