Commit 9f7096a3 authored by fallenstardust's avatar fallenstardust

fix PHNI-JP045 script

parent c8cc5600
--急袭猛禽-崛起叛逆猎鹰 --RR-ライジング・リベリオン・ファルコン
--lua by zengsxing
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Xyz Summon --Xyz Summon
...@@ -41,18 +40,26 @@ end ...@@ -41,18 +40,26 @@ end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end end
function s.damval1(c)
if c:GetLocation()~=LOCATION_MZONE then return end
return math.max(0,c:GetTextAttack())
end
function s.damval2(c)
if c:GetPreviousLocation()~=LOCATION_MZONE then return end
return math.max(0,c:GetTextAttack())
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
local atk=g:Filter(Card.IsType,nil,TYPE_MONSTER):GetSum(Card.GetBaseAttack) local atk=g:GetSum(s.damval1)
if atk>0 then Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end if atk>0 then Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if Duel.Destroy(g,REASON_EFFECT)>0 and e:GetHandler():GetOverlayGroup():Filter(Card.IsType,nil,TYPE_XYZ):GetClassCount(Card.GetCode)>=3 then if Duel.Destroy(g,REASON_EFFECT)>0 and e:GetHandler():GetOverlayGroup():Filter(Card.IsType,nil,TYPE_XYZ):GetClassCount(Card.GetCode)>=3 then
local dg=Duel.GetOperatedGroup():Filter(Card.IsType,nil,TYPE_MONSTER) local dg=Duel.GetOperatedGroup()
local atk=dg:GetSum(Card.GetBaseAttack) local atk=dg:GetSum(s.damval2)
if atk>0 then if atk>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Damage(1-tp,atk,REASON_EFFECT) Duel.Damage(1-tp,atk,REASON_EFFECT)
...@@ -63,8 +70,10 @@ function s.filter(c) ...@@ -63,8 +70,10 @@ function s.filter(c)
return c:IsSetCard(0xba) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_XYZ) and not c:IsForbidden() return c:IsSetCard(0xba) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_XYZ) and not c:IsForbidden()
end end
function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk) function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end local c=e:GetHandler()
e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST) if chk==0 then return c:GetFlagEffect(id)==0 and c:CheckRemoveOverlayCard(tp,3,REASON_COST) end
c:RemoveOverlayCard(tp,3,3,REASON_COST)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk) function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) 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