Commit 14a0871f authored by wind2009's avatar wind2009

Fix

parent 8c698e48
Pipeline #28190 passed with stages
in 53 seconds
No preview for this file type
......@@ -66,7 +66,7 @@ function s.tdfilter(c)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc,tp) end
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
and c:IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
......@@ -7,7 +7,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+o)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......
......@@ -35,12 +35,12 @@ function s.initial_effect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetOperation(s.tgop)
e4:SetCondition(s.regcon)
e4:SetOperation(s.regop)
c:RegisterEffect(e4)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,2))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetRange(LOCATION_GRAVE)
......@@ -50,13 +50,13 @@ function s.initial_effect(c)
e5:SetOperation(s.setop)
c:RegisterEffect(e5)
end
function s.cfilter(c,tp)
function s.cfilter1(c,tp)
return c:IsType(TYPE_MONSTER)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,s.cfilter,1,REASON_COST,true,nil,tp) end
if chk==0 then return Duel.CheckReleaseGroupEx(tp,s.cfilter1,1,REASON_COST,true,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroupEx(tp,s.cfilter,1,1,REASON_COST,true,nil,tp)
local g=Duel.SelectReleaseGroupEx(tp,s.cfilter1,1,1,REASON_COST,true,nil,tp)
Duel.Release(g,REASON_COST)
end
function s.thfilter(c)
......@@ -74,15 +74,14 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function s.cfilter(c,tp)
function s.cfilter2(c,tp)
return c:IsControler(tp) and c:IsType(TYPE_MONSTER)
end
function s.lpcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.AND(Card.IsSetCard,Card.IsFaceup),tp,LOCATION_MZONE,0,1,nil,0x2bd)
and eg:IsExists(s.cfilter,1,nil,1-tp)
return eg:IsExists(s.cfilter2,1,nil,1-tp)
end
function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsSetCard,Card.IsFaceup),tp,LOCATION_MZONE,0,1,nil,0x2bd) end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
......@@ -90,11 +89,11 @@ function s.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,lp-1500)
if Duel.GetLP(1-tp)<lp then Duel.Recover(tp,1500,REASON_EFFECT) end
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_RETURN+REASON_ADJUST)~=0 then return end
if e:GetHandler():IsPreviousLocation(LOCATION_SZONE) then
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
......
......@@ -3,6 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -25,19 +26,18 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,e,tp) end
local g=Duel.SelectReleaseGroup(tp,s.costfilter,1,1,nil,e,tp)
if chk==0 then return Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,s.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function s.costfilter(c,e,tp)
function s.costfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0xac) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
......@@ -69,7 +69,7 @@ function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
if chk==0 then return xg:GetCount()>0 and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) end
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.SendtoGrave(xg,nil,REASON_COST)
local at=Duel.SendtoGrave(xg,REASON_COST)
for tc in aux.Next(cg) do
Duel.RaiseSingleEvent(tc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
end
......
......@@ -56,6 +56,8 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=math.floor(tc:GetLevel()/4)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=mg:SelectSubGroup(tp,s.gcheck,false,ct,ct,tp,tc)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
if Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)~=0 then
Duel.BreakEffect()
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) then
......@@ -63,9 +65,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
end
function s.setfilter(c)
return c:GetType()==TYPE_TRAP and c:IsSSetable()
return c:IsSetCard(0x19e) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.setfilter(chkc) end
......
......@@ -73,12 +73,12 @@ function s.atkop(e,tp,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=a:GetBattleTarget()
if a:IsControler(1-tp) then a,d=d,a end
if e:GetHandler():IsRelateToEffect(e)
and d:IsFaceup() and d:IsRelateToBattle() then
if d:IsFaceup() and d:IsRelateToBattle() then
local atk=d:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
d:RegisterEffect(e1)
end
......
......@@ -28,12 +28,13 @@ function s.initial_effect(c)
e3:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.rmfilter1(c)
function s.rmfilter1(c,tp)
local loc=c:GetLocation()
return c:IsFaceupEx() and c:IsSetCard(0xac) and c:IsAbleToRemove()
and Duel.IsExistingTarget(s.rmfilter2,tp,0,loc,1,nil)
......@@ -43,22 +44,28 @@ function s.rmfilter2(c)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,s.rmfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
local g1=Duel.SelectTarget(tp,s.rmfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
local loc=g1:GetFirst():GetLocation()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,s.rmfilter2,tp,0,loc,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,g1:GetCount(),0,0)
end
function s.rmopfilter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsRelateToEffect(e)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
local tg=g:Filter(s.rmopfilter,nil,e)
if tg:GetCount()==2 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
......
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