Commit c8a73123 authored by Tachibana's avatar Tachibana

tnndx

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