Commit 009cd92e authored by nanahira's avatar nanahira

prescript

parent 62acf6c1
--Dark Magician the Dragon Knight
--Scripted by Eerie COde
function c100240001.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,46986414,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),1,false,false)
--change name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(46986414)
c:RegisterEffect(e1)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_SPELL+TYPE_TRAP))
e3:SetValue(c100240001.indval)
c:RegisterEffect(e3)
--indes
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
c:RegisterEffect(e4)
end
function c100240001.indval(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
--Chimeratech Megafleet Dragon
--Scripted by Eerie Code
function c100240002.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1093),c100240002.matfilter,1,63,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c100240002.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c100240002.sprcon)
e2:SetOperation(c100240002.sprop)
c:RegisterEffect(e2)
--cannot be fusion material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c100240002.matfilter(c)
return c:GetSequence()>4
end
function c100240002.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c100240002.cfilter(c,tp)
return (c:IsFusionSetCard(0x1093) or c:GetSequence()>4) and c:IsType(TYPE_MONSTER)
and c:IsCanBeFusionMaterial() and c:IsAbleToGraveAsCost() and (c:IsControler(tp) or c:IsFaceup())
end
function c100240002.fcheck(c,sg)
return c:IsFusionSetCard(0x1093) and c:IsType(TYPE_MONSTER) and sg:FilterCount(c100240002.fcheck2,c)+1==sg:GetCount()
end
function c100240002.fcheck2(c)
return c:GetSequence()>4
end
function c100240002.fgoal(c,tp,sg)
return sg:GetCount()>1 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(c100240002.fcheck,1,nil,sg)
end
function c100240002.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=c100240002.fgoal(c,tp,sg) or mg:IsExists(c100240002.fselect,1,sg,tp,mg,sg)
sg:RemoveCard(c)
return res
end
function c100240002.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c100240002.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
local sg=Group.CreateGroup()
return mg:IsExists(c100240002.fselect,1,nil,tp,mg,sg)
end
function c100240002.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c100240002.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
local sg=Group.CreateGroup()
while true do
local cg=mg:Filter(c100240002.fselect,sg,tp,mg,sg)
if cg:GetCount()==0
or (c100240002.fgoal(c,tp,sg) and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=cg:Select(tp,1,1,nil)
sg:Merge(g)
end
Duel.SendtoGrave(sg,REASON_COST)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+0xff0000)
e1:SetValue(sg:GetCount()*1200)
c:RegisterEffect(e1)
end
......@@ -33,8 +33,8 @@ function c100305000.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c100305000.thop(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(c100305000.filter,tp,LOCATION_DECK,0,nil)
local ct=math.min(Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM),dg:GetClassCount(Card.GetCode))
if ct==0 then return end
local ct=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if dg:GetClassCount(Card.GetCode)==0 or dg:GetClassCount(Card.GetCode)<ct then return end
local g=Group.CreateGroup()
for i=1,ct do
local tc=dg:Select(tp,1,1,nil):GetFirst()
......
......@@ -71,10 +71,8 @@ end
function c16428514.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Group.CreateGroup()
if c:IsFaceup() and c:IsRelateToEffect(e) then g:AddCard(c) end
if tc:IsFaceup() and tc:IsRelateToEffect(e) then g:AddCard(tc) end
if g:GetCount()>0 then
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
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