Commit 7269cf87 authored by 聖園ミカ's avatar 聖園ミカ 🐟

54188

parent 83e6009a
Pipeline #30798 passed with stages
in 28 minutes and 31 seconds
No preview for this file type
--魔女 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.chk)
Duel.RegisterEffect(ge1,0)
end
s.specialsum(c)
s.fusioneff(c)
end
function s.chk(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
local p=tc:GetSummonPlayer()
if tc:IsSummonType(SUMMON_TYPE_FUSION) and Duel.GetFlagEffect(p,id)==0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,0)
end
end
end
function s.fusioneff(c)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(1169)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCountLimit(1,id+114)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.cost)
e3:SetTarget(s.target)
......@@ -37,92 +20,55 @@ function s.fusioneff(c)
c:RegisterEffect(e3)
end
function s.costfilter(c)
local b1=c:IsType(TYPE_SPELL) and c:IsDiscardable() and c:IsLocation(LOCATION_HAND)
local b2=c:IsCode(31300047) and c:IsAbleToGraveAsCost() and c:IsLocation(LOCATION_DECK)
return b1 or b2
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,2,e:GetHandler())
local b2=Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,e:GetHandler())
local b1=Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,e:GetHandler())
if chk==0 then return b1 or b2 end
if b1 and (not b2 or Duel.SelectOption(tp,1000,1001)==1) then
Duel.DiscardHand(tp,s.costfilter,1,1,REASON_COST+REASON_DISCARD)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
function s.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:CheckFusionMaterial()
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
end
function s.specialsum(c)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.chk)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
......@@ -131,33 +77,46 @@ function s.specialsum(c)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.chk(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
local p=tc:GetSummonPlayer()
if tc:IsRace(RACE_ROCK) and Duel.GetFlagEffect(p,id)==0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,0)
end
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.GetFlagEffect(tp,id)==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(s.tgop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(s.tgop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetValue(4)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.rmfilter(c)
return c:IsAbleToRemove() and c:IsFacedown()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_EXTRA,0,nil)
local ct=math.min(#g,4)
if ct>0 then
local sg=g:RandomSelect(tp,ct)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
if Duel.GetFlagEffect(tp,id)==0 then
Duel.Hint(HINT_CARD,0,id)
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_EXTRA,0,nil)
local ct=math.min(#g,4)
if ct>0 then
local sg=g:RandomSelect(tp,ct)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
e:Reset()
end
\ No newline at end of file
......@@ -128,7 +128,7 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true)
end
end
if tc:IsCode(31300048) then
if tc:IsCode(31300056) then
local op=aux.SelectFromOptions(tp,{Duel.GetLocationCount(tp,LOCATION_SZONE)>0,102},{Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0,103})
if op==2 then
p=1-tp
......
......@@ -66,7 +66,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
--spsummon
function cm.drfilter(c,tp)
return c:IsFaceup() and c:GetBaseAttack()==0 and c:GetSummonPlayer()==1-tp
return c:IsFaceup() and c:GetBaseAttack()==0 and c:GetSummonPlayer()==tp
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.drfilter,1,nil,1-tp)
......
......@@ -62,7 +62,13 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,81900001,0,TYPES_TOKEN_MONSTER,0,0,8,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP) end
local c=e:GetHandler()
local rac=c:GetRace()
local att=c:GetAttribute()
local atk=c:GetAttack()
local def=c:GetDefense()
local lv=c:GetRank()
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,81900001,0,TYPES_TOKEN_MONSTER,atk,def,lv,rac,att,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......
......@@ -151,7 +151,8 @@ function cm.lpcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.lpop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
local tg=eg:Filter(Card.IsControler,nil,tp)
local tc=tg:GetFirst()
while tc do
tc:RegisterFlagEffect(m+200,RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
local e2=Effect.CreateEffect(c)
......@@ -163,7 +164,7 @@ function cm.lpop1(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(cm.lpop2)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_EVENT+RESET_TOFIELD)
tc:RegisterEffect(e2)
tc=eg:GetNext()
tc=tg:GetNext()
end
end
function cm.lpop2(e,tp,eg,ep,ev,re,r,rp)
......
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