Commit 140e0fb5 authored by wyykak's avatar wyykak

add missing file

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent bdffb321
--妬✿水桥帕露西
function c86379872.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(0x13)
e1:SetCondition(c86379872.spcon)
e1:SetOperation(c86379872.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86379872,0))
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,86379872)
e2:SetCondition(c86379872.shcon)
e2:SetTarget(c86379872.shtg)
e2:SetOperation(c86379872.shop)
c:RegisterEffect(e2)
end
--
function c86379872.spfilter(c)
return c:IsSetCard(0x412) and not c:IsCode(86379872)
end
function c86379872.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c86379872.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c86379872.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c86379872.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,nil,REASON_COST)
end
--
function c86379872.shcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and Duel.GetTurnPlayer()~=tp
end
function c86379872.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 and (Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)-Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,nil))>0 end
local ct1=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,nil)*2
local ct2=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local ct3=ct2-ct1
if ct3>0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function c86379872.shfilter(c)
return c:IsSetCard(0x836) and c:IsAbleToHand()
end
function c86379872.shop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct1=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,nil)
local ct2=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local ct3=ct2-ct1
local ct4=ct2-(ct1*2)
if Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 then
local t={86379873,86379874,86379875,86379876}
local mytable={}
local mygroup=Group.CreateGroup()
local allCardGroup=Duel.GetFieldGroup(0,0xff,0xff)
local seedCard=allCardGroup:GetFirst()
local count=1
while count<=4 and seedCard do
local seedCode=seedCard:GetOriginalCode()
if not mytable[seedCode] then
mytable[seedCode]=count
mygroup:AddCard(seedCard)
count=count+1
end
seedCard=allCardGroup:GetNext()
end
local rg=mygroup:RandomSelect(tp,1):GetFirst():GetOriginalCode()
local d=mytable[rg]
local tsz=Duel.CreateToken(tp,t[d])
Duel.MoveToField(tsz,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
local fid=e:GetHandler():GetFieldID()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1fe0000+EVENT_PHASE+PHASE_END,2)
e1:SetOperation(c86379872.desop)
e1:SetLabel(0)
tsz:RegisterEffect(e1,true)
if Duel.IsExistingMatchingCard(c86379872.shfilter,tp,LOCATION_DECK,0,1,nil) and ct4>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c86379872.shfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
function c86379872.desop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
e:GetHandler():SetTurnCounter(ct+1)
if ct==1 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
else e:SetLabel(1) 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