Commit 5f158dec authored by POLYMER's avatar POLYMER

fix

parent a920d6cd
......@@ -103,7 +103,7 @@ function cm.con6(e,tp,eg,ep,ev,re,r,rp)
local tg=tc:GetColumnGroup()
tg:AddCard(tc)
local tp=tc:GetControler()
return #tg>0 and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN,REASON_EFFECT)>0 and c:IsAbleToGrave() and Duel.GetFlagEffect(tp,m)==0
return #tg>0 and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN,REASON_EFFECT)>0 and re:GetHandler()==tc and c:IsAbleToGrave() and Duel.GetFlagEffect(tp,m)==0
end
function cm.op6(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -67,9 +67,14 @@ function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,id,RESET_PHASE+PHASE_END,0,1)
end
function cm.indescon(e,tp,eg,ep,ev,re,r,rp)
local a,d=Duel.GetBattleMonster(tp)
e:SetLabelObject(a)
return a and d and a:IsFaceup() and a:IsSetCard(0x3a70)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsControler(tp) then a,d=d,a end
if a and a:IsControler(tp) and a:IsFaceup() and a:IsSetCard(0x3a70) then
e:SetLabelObject(a)
return true
end
return false
end
function cm.indescost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -54,20 +54,21 @@ function c28362718.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)<=3000 or Duel.CheckLPCost(tp,2000) end
if Duel.GetLP(tp)>3000 then Duel.PayLPCost(tp,2000) end
end
function c28362718.cfilter(c,code)
return c:IsCode(code) and c:IsFaceup()
function c28362718.cfilter(c,code1,code2)
return c:IsCode(code1,code2) and c:IsFaceup()
end
function c28362718.thfilter(c,tp)
function c28362718.thfilter(c,tp,code)
return c:IsSetCard(0x285) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
and not Duel.IsExistingMatchingCard(c28362718.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
and not Duel.IsExistingMatchingCard(c28362718.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode(),code)
end
function c28362718.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c28362718.thfilter,tp,LOCATION_DECK,0,1,nil,tp) and (Duel.GetLP(tp)>3000 or Duel.IsPlayerCanDraw(tp,1)) end
local code=e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():GetCode() or 0
if chk==0 then return Duel.IsExistingMatchingCard(c28362718.thfilter,tp,LOCATION_DECK,0,1,nil,tp,code) and (Duel.GetLP(tp)>3000 or Duel.IsPlayerCanDraw(tp,1)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c28362718.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c28362718.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
local tc=Duel.SelectMatchingCard(tp,c28362718.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp,0):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
......@@ -83,7 +84,7 @@ function c28362718.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c28362718.fscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) and not eg:IsContains(e:GetHandler())
end
function c28362718.filter1(c,e)
return c:IsFusionAttribute(ATTRIBUTE_DARK) and c:IsDestructable(e) and not c:IsImmuneToEffect(e)
......@@ -93,7 +94,7 @@ function c28362718.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c28362718.fcheck(tp,sg,fc)
return sg:GetSum(Card.GetAttack)>=Duel.GetLP(tp)
return true--sg:GetSum(Card.GetAttack)>=Duel.GetLP(tp)
end
function c28362718.fstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
......
......@@ -10,9 +10,10 @@ function c28368431.initial_effect(c)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(1190)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c28368431.thcon)
......@@ -21,10 +22,22 @@ function c28368431.initial_effect(c)
e2:SetOperation(c28368431.thop)
c:RegisterEffect(e2)
--
Duel.AddCustomActivityCounter(28368431,ACTIVITY_SPSUMMON,c28368431.counterfilter)
if not c28368431.global_check then
c28368431.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(c28368431.checkcon)
ge1:SetOperation(c28368431.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c28368431.ctfilter(c,p)
return c:IsSetCard(0x285) and c:IsSummonPlayer(p) and c:IsFaceup()
end
function c28368431.counterfilter(c)
return not c:IsSetCard(0x285)
function c28368431.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c28368431.ctfilter,1,nil,0) then Duel.RegisterFlagEffect(0,28368431,RESET_PHASE+PHASE_END,0,1) end
if eg:IsExists(c28368431.ctfilter,1,nil,1) then Duel.RegisterFlagEffect(1,28368431,RESET_PHASE+PHASE_END,0,1) end
end
function c28368431.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)<=3000 or Duel.CheckLPCost(tp,2000) end
......@@ -37,7 +50,6 @@ function c28368431.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetCondition(c28368431.regcon)
e1:SetOperation(c28368431.regop)
Duel.RegisterEffect(e1,tp)
end
......@@ -50,7 +62,7 @@ function c28368431.gcheck(g,tp)
return g:FilterCount(Card.IsType,nil,TYPE_MONSTER)<=mt and g:FilterCount(Card.IsType,nil,TYPE_FIELD)<=1 and g:FilterCount(Card.IsType,nil,TYPE_SPELL+TYPE_TRAP)-g:FilterCount(Card.IsType,nil,TYPE_FIELD)<=st
end
function c28368431.regop(e,tp,eg,ep,ev,re,r,rp)
local val=Duel.Recover(tp,Duel.GetCustomActivityCount(28368431,tp,ACTIVITY_SPSUMMON)*500,REASON_EFFECT)
local val=Duel.Recover(tp,Duel.GetFlagEffect(tp,28368431)*500,REASON_EFFECT)
local ct=math.floor(val/1500)
local g=Duel.GetMatchingGroup(c28368431.setfilter,tp,LOCATION_DECK,0,nil,e,tp)
if ct>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(28368431,1)) then
......
......@@ -25,7 +25,7 @@ function c28372877.activate(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.GetMatchingGroup(c28372877.thfilter,tp,LOCATION_DECK,0,nil)
if #g1>0 and #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(28372877,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g1:Select(tp,#g1,#g1,nil)
local dg=g1:Select(tp,1,#g1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -39,7 +39,7 @@ function c28372877.tdfilter(c,ct)
end
function c28372877.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c28372877.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,0)
if chk==0 then return aux.gfcheck(g,c28372877.tdfilter,1,2) end
if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,c28372877.tdfilter,1,2) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c28372877.gcheck(g)
......
......@@ -92,6 +92,7 @@ function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -99,6 +99,7 @@ function s.chcon(e,tp,eg,ep,ev,re,r,rp)
end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.FromCards(re:GetHandler())
......
......@@ -48,7 +48,8 @@ function s.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2500,500,6,RACE_WARRIOR,ATTRIBUTE_LIGHT) end --Assuming Token ID is id+1
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2500,500,6,RACE_WARRIOR,ATTRIBUTE_LIGHT) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
......
......@@ -122,7 +122,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=dg:Select(tp,1,1,nil)
sg:AddCard(c)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)==2 then
local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
......
......@@ -122,7 +122,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=dg:Select(tp,1,1,nil)
sg:AddCard(c)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)==2 then
local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
......
......@@ -143,7 +143,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=dg:Select(tp,1,1,nil)
sg:AddCard(c)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)==2 then
local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
......
......@@ -46,7 +46,7 @@ end
function s.addop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
if Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(p,d,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
Duel.RegisterFlagEffect(tp,id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
......@@ -145,7 +145,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=dg:Select(tp,1,1,nil)
sg:AddCard(c)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)==2 then
local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
......
......@@ -71,7 +71,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.setfilter(c)
return c:IsSetCard(0xcd1) and c:IsAllTypes(TYPE_CONTINUOUS+TYPE_TRAP) and c:IsFaceup() and not c:IsSSetable()
return c:IsSetCard(0xcd1) and c:IsAllTypes(TYPE_CONTINUOUS+TYPE_TRAP) and c:IsFaceup() and c:IsSSetable()
end
function s.settg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
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