Commit 01fd2bb0 authored by Huangnan's avatar Huangnan

fix

parent 0015e0bd
Pipeline #24242 passed with stages
in 27 minutes and 29 seconds
......@@ -27,16 +27,16 @@ function cm.initial_effect(c)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
end
function cm.filter(c,tp)
return (c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) or not c:IsControler(tp)) and c:IsCanOverlay()
function cm.filter(c)
return c:IsCanOverlay()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local loc=LOCATION_GRAVE+LOCATION_REMOVED
if e:GetHandler():GetOverlayCount()>=10 then loc=LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_ONFIELD end
if chkc then return chkc:IsLocation(loc) and cm.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,loc,loc,1,nil,tp) and e:GetHandler():IsType(TYPE_XYZ) end
if chkc then return (chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsControler(tp) and c:IsCanOverlay()) or (chkc:IsLocation(loc) and c:IsControler(1-tp) and c:IsCanOverlay()) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,loc,1,nil) and e:GetHandler():IsType(TYPE_XYZ) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,cm.filter,tp,loc,loc,1,1,nil,tp)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,loc,1,1,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -77,10 +77,10 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetOverlayCount()>=10 and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
if g1:GetFirst():GetAttribute()==ATTRIBUTE_WATER and Duel.IsPlayerCanDraw(tp,1) then
if g1 and g1:GetFirst():GetAttribute()==ATTRIBUTE_WATER and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>=3 and Duel.IsPlayerCanDraw(tp,1) then
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==3 and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......
......@@ -23,7 +23,7 @@ function s.initial_effect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
......@@ -32,7 +32,7 @@ function s.initial_effect(c)
e6:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e6:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e6:SetTarget(s.sptg)
e6:SetOperation(s.spop)
c:RegisterEffect(e6)
......
......@@ -23,7 +23,7 @@ function s.initial_effect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
......@@ -32,7 +32,7 @@ function s.initial_effect(c)
e41:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e41:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e41:SetCode(EVENT_SUMMON_SUCCESS)
e41:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e41:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e41:SetTarget(s.sptg)
e41:SetOperation(s.spop)
c:RegisterEffect(e41)
......
......@@ -96,7 +96,7 @@ end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,TYPE_MONSTER)
return g:GetClassCount(Card.GetAttribute)>=6 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
return g:GetClassCount(Card.GetAttribute)>=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
......
--魔王剑-残酷
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16101100") end
local m=33400345
local cm=_G["c"..m]
function cm.initial_effect(c)
......
......@@ -6,7 +6,6 @@ function c98650000.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c98650000.cost)
e1:SetTarget(c98650000.target)
......@@ -14,29 +13,15 @@ function c98650000.initial_effect(c)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98650000,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c98650000.spcon)
e2:SetTarget(c98650000.sptg)
e2:SetOperation(c98650000.spop)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c98650000.thtg)
e2:SetOperation(c98650000.thop)
c:RegisterEffect(e2)
if not c98650000.global_check then
c98650000.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetLabel(98650000)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetLabel(98650000)
Duel.RegisterEffect(ge2,0)
end
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c98650000.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -66,22 +51,18 @@ function c98650000.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c98650000.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(98650000)>0
end
function c98650000.spfilter(c,e,tp)
return c:GetAttack()==1850 and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c98650000.filter2(c)
return c:GetAttack()==1850 and c:IsAbleToHand() and c:IsRace(RACE_SPELLCASTER)
end
function c98650000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c98650000.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
function c98650000.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98650000.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c98650000.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98650000.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
function c98650000.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c98650000.filter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
\ No newline at end of file
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