Commit 7c3a2ae6 authored by mercury233's avatar mercury233

update scripts

parent 40c082da
--古生代化石騎士 スカルキング
--
--Script by mercury233
function c100266006.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_ROCK),c100266006.matfilter,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(c100266006.splimit)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
--double attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(1)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100266006,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,100266006)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetCondition(c100266006.spcon)
e4:SetTarget(c100266006.sptg)
e4:SetOperation(c100266006.spop)
c:RegisterEffect(e4)
end
function c100266006.matfilter(c)
return c:IsLevelAbove(7) and c:IsFusionType(TYPE_MONSTER)
end
function c100266006.splimit(e,se,sp,st)
return st==SUMMON_TYPE_FUSION+0x20 or not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c100266006.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c100266006.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100266006.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c100266006.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100266006.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100266006.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c100266006.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.DiscardHand(tp,nil,1,1,REASON_DISCARD+REASON_EFFECT,nil)>0 and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--化石融合-フォッシル・フュージョン
--
--Script by mercury233
function c100266011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100266011,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100266011.target)
e1:SetOperation(c100266011.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266011,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+100266011)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100266011)
e2:SetCondition(c100266011.thcon)
e2:SetTarget(c100266011.thtg)
e2:SetOperation(c100266011.thop)
c:RegisterEffect(e2)
if not c100266011.global_check then
c100266011.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(c100266011.regcon)
ge1:SetOperation(c100266011.regop)
Duel.RegisterEffect(ge1,0)
end
end
function c100266011.cfilter(c,tp)
return c:IsSetCard(0x248) and c:IsType(TYPE_FUSION)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c100266011.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(c100266011.cfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c100266011.cfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c100266011.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+100266011,re,r,rp,ep,e:GetLabel())
end
function c100266011.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c100266011.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x248) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION+0x20,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100266011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c100266011.filter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local res=Duel.IsExistingMatchingCard(c100266011.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(c100266011.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c100266011.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(c100266011.filter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local sg1=Duel.GetMatchingGroup(c100266011.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(c100266011.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)
local res=mat1:IsExists(Card.IsControler,1,nil,tp) and mat1:IsExists(Card.IsControler,1,nil,1-tp)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION+0x20,tp,tp,false,false,POS_FACEUP)
if res then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(100266011,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c100266011.efilter)
tc:RegisterEffect(e1,true)
end
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c100266011.efilter(e,re,rp)
return re:IsActiveType(TYPE_MONSTER)
end
function c100266011.thcon(e,tp,eg,ep,ev,re,r,rp)
return ev==tp or ev==PLAYER_ALL
end
function c100266011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c100266011.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--サンダー・ハンド
--Scripted by mallu11
function c101101031.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101101031,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,101101031)
e1:SetCondition(c101101031.spcon)
e1:SetTarget(c101101031.sptg)
e1:SetOperation(c101101031.spop)
c:RegisterEffect(e1)
end
function c101101031.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and (c:GetBaseAttack()==1600 or c:GetBaseDefense()==1600)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:GetReasonPlayer()==1-tp)
end
function c101101031.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(c101101031.cfilter,1,nil,tp) and (c:IsLocation(LOCATION_HAND) or not eg:IsContains(c))
end
function c101101031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101101031.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
...@@ -45,7 +45,8 @@ function c101101063.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,8 @@ function c101101063.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(LOCATION_HAND) e2:SetValue(LOCATION_HAND)
e2:SetCondition(c101101063.recon) e2:SetCondition(c101101063.recon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2,true)
end end
end end
function c101101063.discon(e,tp,eg,ep,ev,re,r,rp) function c101101063.discon(e,tp,eg,ep,ev,re,r,rp)
......
--禁じられた一滴
--Scripted by mallu11
function c101101065.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END+TIMING_DAMAGE)
e1:SetCountLimit(1,101101065+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(aux.dscon)
e1:SetCost(c101101065.cost)
e1:SetTarget(c101101065.target)
e1:SetOperation(c101101065.activate)
c:RegisterEffect(e1)
end
function c101101065.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
end
function c101101065.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101101065.target(e,tp,eg,ep,ev,re,r,rp,chk)
local dg=Duel.GetMatchingGroup(c101101065.filter,tp,0,LOCATION_MZONE,nil)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and dg:GetCount()>0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local cg=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,dg:GetCount(),e:GetHandler())
local tc=cg:GetFirst()
local ctype=0
while tc do
for i,type in ipairs({TYPE_MONSTER,TYPE_SPELL,TYPE_TRAP}) do
if tc:GetOriginalType()&type~=0 then
ctype=ctype|type
end
end
tc=cg:GetNext()
end
e:SetLabel(0,cg:GetCount())
Duel.SendtoGrave(cg,REASON_COST)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c101101065.chlimit(ctype))
end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,dg,cg:GetCount(),0,0)
end
function c101101065.chlimit(ctype)
return function(e,ep,tp)
return tp==ep or e:GetHandler():GetOriginalType()&ctype==0
end
end
function c101101065.activate(e,tp,eg,ep,ev,re,r,rp)
local label,count=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c101101065.filter,tp,0,LOCATION_MZONE,count,count,nil)
if g:GetCount()==count then
Duel.HintSelection(g)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e1)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
tc=g:GetNext()
end
end
end
--リターナブル瓶
--Scripted by mallu11
function c101101078.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101101078)
e1:SetCost(c101101078.cost)
e1:SetTarget(c101101078.target)
e1:SetOperation(c101101078.activate)
c:RegisterEffect(e1)
end
function c101101078.filter(c,tp)
return c:IsType(TYPE_TRAP) and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c101101078.thfilter,tp,LOCATION_GRAVE,0,1,c,c:GetOriginalCodeRule())
end
function c101101078.thfilter(c,code)
return c:IsType(TYPE_TRAP) and not c:IsOriginalCodeRule(code) and c:IsAbleToHand()
end
function c101101078.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101101078.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c101101078.filter,tp,LOCATION_GRAVE,0,1,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101101078.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
e:SetLabel(0,g:GetFirst():GetCode())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c101101078.activate(e,tp,eg,ep,ev,re,r,rp)
local label,code=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101101078.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,code)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
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