Commit f57981ff authored by nanahira's avatar nanahira

fix bgm

parent dd54baa3
......@@ -2,6 +2,8 @@ local m=77729300
local cm=_G["c"..m]
Duel.LoadScript("c37564765.lua")
function cm.initial_effect(c)
Senya.AddSummonMusic(m,m*16)
cm.AddAttackBGM(c,m*16+1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
......@@ -11,7 +13,7 @@ function cm.initial_effect(c)
e2:SetCost(Senya.SelfDiscardCost)
e2:SetCountLimit(1,m)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,m*16+2)
Duel.Hint(HINT_MUSIC,0,m*16+3)
local turn=Duel.GetTurnCount()
local c=e:GetHandler()
local ex=Effect.CreateEffect(c)
......@@ -41,7 +43,7 @@ function cm.initial_effect(c)
if chk==0 then
return tc and tc:IsAbleToHand()
end
Duel.Hint(HINT_MUSIC,0,m*16+1)
Duel.Hint(HINT_MUSIC,0,m*16+2)
Duel.ConfirmCards(tp,tg)
Duel.SetTargetCard(tg)
if tc:IsType(TYPE_SPELL+TYPE_TRAP) then
......@@ -74,22 +76,23 @@ function cm.initial_effect(c)
end))
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.filter(e:GetHandler())
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp)
end
Duel.Hint(HINT_MUSIC,0,m*16+1)
Duel.Hint(HINT_MUSIC,0,m*16+2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local ct=math.min(4,Duel.GetLocationCount(tp,LOCATION_MZONE))
if ft<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()<2 then return end
if g:GetCount()<1 then return end
local tc=e:GetHandler()
if not tc or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
local sg=g:Select(tp,1,ft,nil)
if tc:IsFaceup() then
if tc:IsHasEffect(EFFECT_DEVINE_LIGHT) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
else
......@@ -168,3 +171,20 @@ end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),nil,0x11,0,0,0,0,0,POS_FACEDOWN)
end
function cm.AddAttackBGM(c,desc)
if not cm.AttackSEList then
cm.AttackSEList={}
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(function()
return cm.AttackSEList[Duel.GetAttacker()]
end)
e1:SetOperation(function()
Duel.Hint(HINT_MUSIC,0,cm.AttackSEList[Duel.GetAttacker()])
end)
Duel.RegisterEffect(e1,0)
end
cm.AttackSEList[c]=desc
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