Commit 83009f2b authored by mercury233's avatar mercury233

fix

parent ceed19e0
--鉄獣の咆哮
--Script by 奥克斯
--Script by 奥克斯 & mercury233
function c101112053.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -8,66 +8,44 @@ function c101112053.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e1:SetCountLimit(1,101112053+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101112053.cost)
e1:SetCondition(c101112053.condition)
e1:SetTarget(c101112053.target)
e1:SetOperation(c101112053.activate)
c:RegisterEffect(e1)
end
function c101112053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
function c101112053.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101112053.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
function c101112053.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101112053.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101112053.tagfilter(c,type)
function c101112053.costfilter(c,tp)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x14d)
and Duel.IsExistingTarget(c101112053.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetType())
end
function c101112053.tgfilter(c,type)
if type==nil then return false end
local chk
if not (c:IsFaceup() and c:IsType(TYPE_EFFECT)) then return false end
if type&TYPE_MONSTER~=0 then
chk=c:GetAttack()>0
return c:GetAttack()>0
elseif type&TYPE_SPELL~=0 then
chk=aux.NegateMonsterFilter(c) and Duel.GetCurrentPhase()~=PHASE_DAMAGE
return aux.NegateMonsterFilter(c) and Duel.GetCurrentPhase()~=PHASE_DAMAGE
elseif type&TYPE_TRAP~=0 then
chk=c:IsAbleToHand() and Duel.GetCurrentPhase()~=PHASE_DAMAGE
end
if chk==nil then return false end
return c101112053.filter(c) and chk
end
function c101112053.atkfilter(c)
return c101112053.filter(c) and c:GetAttack()>0
end
function c101112053.disfilter(c)
return c101112053.filter(c) and aux.NegateMonsterFilter(c)
end
function c101112053.tfilter(c)
return c101112053.filter(c) and c:IsAbleToHand()
end
function c101112053.tgfilter(c,tp)
local chk
if c:IsType(TYPE_MONSTER) then
chk=Duel.IsExistingTarget(c101112053.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
elseif c:IsType(TYPE_SPELL) then
chk=Duel.IsExistingTarget(c101112053.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.GetCurrentPhase()~=PHASE_DAMAGE
elseif c:IsType(TYPE_TRAP) then
chk=Duel.IsExistingTarget(c101112053.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.GetCurrentPhase()~=PHASE_DAMAGE
return c:IsAbleToHand() and Duel.GetCurrentPhase()~=PHASE_DAMAGE
end
if chk==nil then return false end
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x14d) and chk
return false
end
function c101112053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101112053.tagfilter(chkc,e:GetLabel()) end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c101112053.tgfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,nil,tp)
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101112053.tgfilter(chkc,e:GetLabel()) end
if chk==0 then return e:IsCostChecked()
and Duel.IsExistingMatchingCard(c101112053.costfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101112053.tgfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,c101112053.costfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
local type=g:GetFirst():GetType()
e:SetLabel(type)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tag=Duel.SelectTarget(tp,c101112053.tagfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,type)
local tag=Duel.SelectTarget(tp,c101112053.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,type)
if type&TYPE_MONSTER~=0 then
e:SetCategory(CATEGORY_ATKCHANGE)
elseif type&TYPE_SPELL~=0 then
......@@ -79,47 +57,34 @@ function c101112053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
end
function c101112053.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local type=e:GetLabel()
if type==nil then return end
local chk
local b1=false
local b2=false
local b3=false
if type&TYPE_MONSTER~=0 then
chk=tc:GetAttack()>0
b1=true
elseif type&TYPE_SPELL~=0 then
chk=tc:IsFaceup() and tc:IsCanBeDisabledByEffect(e)
b2=true
elseif type&TYPE_TRAP~=0 then
chk=true
b3=true
end
if tc:IsRelateToEffect(e) and chk then
if b1 then
local e1=Effect.CreateEffect(e:GetHandler())
if tc:IsRelateToEffect(e) then
if type&TYPE_MONSTER~=0 and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
if b2 then
if type&TYPE_SPELL~=0 and tc:IsFaceup() and tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
if b3 then
if type&TYPE_TRAP~=0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
......
......@@ -19,11 +19,12 @@ function s.initial_effect(c)
e2:SetTarget(s.target)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
function s.cfilter(c,sp)
return c:IsFaceup() and c:IsSummonPlayer(sp)
and c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
return eg:IsExists(s.cfilter,1,nil,1-tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local l=Duel.GetFlagEffectLabel(tp,id)
......
......@@ -78,5 +78,5 @@ function c101112067.nsumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c101112067.efun)
end
function c101112067.efun(e,ep,tp)
return ep==tp and not e:GetHandler():IsType(TYPE_MONSTER)
return ep==tp or not e:GetHandler():IsType(TYPE_MONSTER)
end
\ No newline at end of file
......@@ -44,6 +44,10 @@ function c21915012.valcheck(e,c)
local g=c:GetMaterial()
local mg=g:Filter(Card.IsType,nil,TYPE_TUNER)
local tc=mg:GetFirst()
if not tc then
e:GetLabelObject():SetLabel(0)
return
end
if #mg>1 then
local tg=g-(g:Filter(Card.IsNotTuner,nil,c))
if #tg>0 then
......@@ -68,6 +72,7 @@ function c21915012.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local ct=e:GetLabel()
if ct==0 then return end
local sel=nil
if c:IsLevel(1) then
sel=Duel.SelectOption(tp,aux.Stringid(21915012,1))
......
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