Commit 051176c4 authored by mercury233's avatar mercury233

fix

parent ed430f44
......@@ -33,8 +33,8 @@ end
function s.filter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,_,exc)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,exc) end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
......@@ -44,8 +44,10 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if e:GetHandler():IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
local c=e:GetHandler()
if c:IsRelateToChain() and c:IsPosition(POS_FACEUP_ATTACK) then
Duel.BreakEffect()
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -31,6 +31,20 @@ function s.initial_effect(c)
e3:SetOperation(s.lvop)
c:RegisterEffect(e3)
end
function Auxiliary.SelectFromOptions(tp,...)
local options={...}
local ops={}
local opvals={}
for i=1,#options do
if options[i][1] then
table.insert(ops,options[i][2])
table.insert(opvals,options[i][3] or i)
end
end
if #ops==0 then return nil end
local select=Duel.SelectOption(tp,table.unpack(ops))
return opvals[select+1]
end
function s.costfilter(c)
return c:IsSetCard(0x119) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
......
......@@ -29,20 +29,20 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
function s.filter1(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceupEx() and c:IsAbleToDeck()
end
function s.filter2(c,e,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,2,c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceupEx() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,c)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(s.filter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g1=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_GRAVE,0,2,2,g1:GetFirst())
local g2=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,g1:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g2,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
end
......
......@@ -16,12 +16,11 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
--ATK Gain
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetLabel(0)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1,id+o)
e2:SetCost(aux.bfgcost)
......@@ -46,8 +45,8 @@ function s.sop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.atkfilter1(c,e)
return c:IsSetCard(0x119) and c:IsFaceup() and c:IsCanBeEffectTarget(e)
function s.atkfilter1(c,e,tp)
return c:IsSetCard(0x119) and c:IsFaceup() and c:GetBaseAttack()>0
and Duel.IsExistingTarget(s.atkfilter2,tp,LOCATION_GRAVE,0,1,c,c:GetCode())
end
function s.atkfilter2(c,code)
......@@ -55,20 +54,21 @@ function s.atkfilter2(c,code)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.atkfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end
if chk==0 then return Duel.IsExistingTarget(s.atkfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.atkfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e)
local g=Duel.SelectTarget(tp,s.atkfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SelectTarget(tp,s.atkfilter2,tp,LOCATION_GRAVE,0,1,1,g:GetFirst(),g:GetFirst():GetCode())
local g2=Duel.SelectTarget(tp,s.atkfilter2,tp,LOCATION_GRAVE,0,1,1,g:GetFirst(),g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g2,1,0,0)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sc=g:GetFirst()
if sc==tc then sc=g:GetNext() end
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) and
sc:IsRelateToEffect(e) and Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) and sc:IsRelateToEffect(e)
and Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -60,8 +60,9 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.rfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Remove(g+c,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked() end
......
......@@ -48,7 +48,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
local xc=Duel.GetMatchingGroupCount(Card.IsSummonLocation,tp,0,LOCATION_MZONE,nil,LOCATION_EXTRA)
if xc>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,xc,nil)
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,xc,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
end
end
......@@ -61,7 +61,7 @@ end
function s.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 s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
......@@ -7,7 +7,7 @@ function s.initial_effect(c)
--material
aux.AddXyzProcedure(c,nil,8,2)
--add counter
c:EnableCounterPermit(c,0x1)
c:EnableCounterPermit(0x1)
c:SetCounterLimit(0x1,9)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -27,15 +27,15 @@ function s.initial_effect(c)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,e,r,rp)
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)+Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>9
end
function s.sptg(e,tp,eg,ep,ev,e,r,rp,chk)
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,3000,3000,10,RACE_CYBERSE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,e,r,rp)
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,3000,3000,10,RACE_CYBERSE,ATTRIBUTE_DARK)) then return 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