Commit c203bc0c authored by Tachibana's avatar Tachibana

得得得得得

parent aefaef90
Pipeline #12554 passed with stages
in 22 minutes and 35 seconds
--Tama & Amarillo
local m=13255411
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.cost)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e4:SetCondition(cm.damcon)
e4:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e5)
elements={{"tama_elements",{{TAMA_ELEMENT_WIND,1},{TAMA_ELEMENT_ENERGY,1},{TAMA_ELEMENT_LIFE,1}}}}
cm[c]=elements
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,ct)
e:SetLabel(ct)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
c:CompleteProcedure()
end
end
function cm.rfilter(c)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
end
function cm.rfilter1(c,code)
return code==0 or c:IsCode(code)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
local code=0
local g1=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_MZONE,0,e:GetHandler())
local g2=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
local g3=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_DECK,0,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g1:IsExists(cm.rfilter1,1,nil,code) and ((g2:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(m,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:FilterSelect(tp,cm.rfilter1,1,1,nil,code)
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
if g2:GetCount()>0 and g2:IsExists(cm.rfilter1,1,nil,code) and ((sg:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(m,3))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg2=g2:FilterSelect(tp,cm.rfilter1,1,1,nil,code)
Duel.HintSelection(sg2)
sg:Merge(sg2)
end
if g3:GetCount()>0 and g3:IsExists(cm.rfilter1,1,nil,code) and (sg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(m,4))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g2:FilterSelect(tp,cm.rfilter1,1,1,nil,code)
Duel.HintSelection(sg3)
sg:Merge(sg3)
end
local ct=Duel.SendtoGrave(sg,REASON_COST)
local atk=0
local def=0
if ct>0 then
atk=sg:GetFirst():GetTextAttack()
def=sg:GetFirst():GetTextDefense()
end
e:SetLabel(ct,atk,def)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local ct,atk,def=e:GetLabel()
if g:GetCount()==0 then return end
local sc=g:GetFirst()
while sc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-atk)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(-def)
sc:RegisterEffect(e2)
sc=g:GetNext()
end
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function cm.damcon(e)
return e:GetHandler():GetBattleTarget()~=nil
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