Commit c4537df5 authored by Nemo Ma's avatar Nemo Ma

fix

parent 3b31cdfc
......@@ -120,7 +120,9 @@ function cm.otcon(e,c,minc)
if ct==0 then return false end
local tp=c:GetControler()
local mi,ma=c:GetTributeRequirement()
return minc<=ma and ((math.max(mi,minc)<=ct and Duel.GetMZoneCount(tp)>0) or Duel.CheckTribute(c,math.max(1,math.max(mi,minc)-ct)))
Debug.Message(mi)
Debug.Message(ma)
return ma>0 and minc<=ma and ((math.max(mi,minc)<=ct and Duel.GetMZoneCount(tp)>0) or Duel.CheckTribute(c,math.max(1,math.max(mi,minc)-ct)))
end
function cm.fselect(g)
return Duel.GetMZoneCount(tp,g)>0
......
......@@ -25,7 +25,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
fdzone=fdzone|exzone
local g=Duel.GetMatchingGroup(function(c)return c:GetSequence()>4 end,tp,0,LOCATION_MZONE,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
if #g>0 and (Duel.GetMatchingGroupCount(function(c)return c:GetSequence()<5 end,tp,LOCATION_MZONE,LOCATION_MZONE,nil)==0 or Duel.SelectYesNo(tp,aux.Stringid(m,1))) then
local b1,b2=0,0
for tc in aux.Next(g) do
if tc:GetSequence()==5 then b2=1 end
......
--宇宙勇机 敌阵突破
local m=40009386
local cm=_G["c"..m]
cm.named_with_CosmosHero=1
function cm.CosmosHero(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CosmosHero
end
function cm.initial_effect(c)
function c40009386.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetDescription(aux.Stringid(40009386,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_TOHAND+TIMINGS_CHECK_MONSTER)
--e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
--e1:SetCost(c40009386.cost)
e1:SetTarget(c40009386.target)
e1:SetOperation(c40009386.activate)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetDescription(aux.Stringid(40009386,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
......@@ -28,34 +21,34 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.atktg)
e2:SetOperation(cm.atkop)
e2:SetTarget(c40009386.atktg)
e2:SetOperation(c40009386.atkop)
c:RegisterEffect(e2)
end
function cm.costfilter(c,matk)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttackAbove(matk) and c:IsFaceup() and cm.CosmosHero(c)
function c40009386.costfilter(c,matk)
return c:IsAttackAbove(matk) and c:IsFaceup() and c:IsSetCard(0x1f1b)
end
--function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
--function c40009386.cost(e,tp,eg,ep,ev,re,r,rp,chk)
--e:SetLabel(100)
--return true
--end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c40009386.target(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND+LOCATION_ONFIELD)
local matk=math.min(2000,dc*2000)
if chk==0 then
--if e:GetLabel()~=100 then return false end
-- e:SetLabel(0)
return matk>0 and Duel.IsExistingTarget(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,matk) --Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,matk)
return matk>0 and Duel.IsExistingTarget(c40009386.costfilter,tp,LOCATION_MZONE,0,1,nil,matk) --Duel.CheckReleaseGroup(tp,c40009386.costfilter,1,nil,matk)
end
-- local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,matk)
local g=Duel.SelectTarget(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,matk)
-- local g=Duel.SelectReleaseGroup(tp,c40009386.costfilter,1,1,nil,matk)
local g=Duel.SelectTarget(tp,c40009386.costfilter,tp,LOCATION_MZONE,0,1,1,nil,matk)
local atk=g:GetFirst():GetAttack()
--e:SetLabel(atk)
--Duel.Release(g,REASON_COST)
local ct=math.floor(atk/2000)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,ct,1-tp,LOCATION_ONFIELD+LOCATION_HAND)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
function c40009386.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local atk=tc:GetAttack()
......@@ -68,16 +61,16 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.filter(c)
return c:IsFaceup() and cm.CosmosHero(c)
function c40009386.filter(c)
return c:IsFaceup() and c:IsSetCard(0x1f1b)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
function c40009386.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c40009386.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c40009386.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c40009386.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
function c40009386.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -14,7 +14,7 @@ function c72410280.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(72410280,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,72410281)
e2:SetCondition(c72410280.retcon)
......@@ -56,7 +56,7 @@ end
function c72410280.retcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return rc:IsType(TYPE_SPELL) and rc:IsType(TYPE_CONTINUOUS)
return (rc:IsType(TYPE_SPELL) and rc:IsType(TYPE_CONTINUOUS)) or rc==e:GetHandler()
end
function c72410280.filter(c)
local thchk=Duel.IsEnvironment(56433456)
......
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