Skip to content
This repository was archived by the owner on Jun 22, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 136 additions & 150 deletions script/c511009025.lua
Original file line number Diff line number Diff line change
@@ -1,150 +1,136 @@
--Starve Venom Fusion Dragon (Anime)
function c511009025.initial_effect(c)
--fusion
c:EnableReviveLimit()
-- aux.AddFusionProcFunRep(c,c511009025.mat_filter,2,true)
if Card.IsFusionAttribute then
aux.AddFusionProcFunRep(c,c511009025.mat_filter1,2,true)
else
aux.AddFusionProcFunRep(c,c511009025.mat_filter2,2,true)
end
--material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(511000674,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c511009025.atkcon)
e1:SetTarget(c511009025.tg)
e1:SetOperation(c511009025.op)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7338,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(c511009025.nmtg)
e2:SetOperation(c511009025.nmop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(7338,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(c511009025.descon)
e3:SetTarget(c511009025.destg)
e3:SetOperation(c511009025.desop)
c:RegisterEffect(e3)
if not c511009025.global_check then
c511009025.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetLabel(511009025)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
end
end
function c511009025.mat_filter1(c)
return c:IsFusionAttribute(ATTRIBUTE_DARK)
end
function c511009025.mat_filter2(c)
return c:IsAttribute(ATTRIBUTE_DARK)
end
function c511009025.atkfil(c)
return not c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c511009025.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
local c=e:GetHandler()
return c:GetFlagEffect(511009025)~=0 and bit.band(c:GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and c:GetMaterial()
and not c:GetMaterial():IsExists(c511009025.atkfil,1,nil)
end
function c511009025.filter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c511009025.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c511009025.filter,tp,0,LOCATION_MZONE,1,nil) end
end
function c511009025.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c511009025.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local atk=0
local tc=g:GetFirst()
while tc do
atk=atk+tc:GetAttack()
tc=g:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end

function c511009025.nmfil(c)
return c:IsFaceup() and c:IsLevelAbove(5)
end
function c511009025.nmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c511009025.nmfil(chkc) end
if chk==0 then return Duel.IsExistingTarget(c511009025.nmfil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c511009025.nmfil,tp,0,LOCATION_MZONE,1,1,nil)
end
function c511009025.nmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetCode()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
c:CopyEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,1)
end
end

function c511009025.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
end
function c511009025.desfil(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c511009025.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c511009025.desfil,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c511009025.desfil,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c511009025.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c511009025.desfil,tp,0,LOCATION_MZONE,nil)
if Duel.Destroy(g,REASON_EFFECT)>0 then
local dg=Duel.GetOperatedGroup()
local atk=0
local tc=dg:GetFirst()
while tc do
if tc:IsPreviousPosition(POS_FACEUP) then
atk=atk+tc:GetPreviousAttackOnField()
end
tc=dg:GetNext()
end
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
--Starve Venom Fusion Dragon (Anime)
--fixed by MLD
function c511009025.initial_effect(c)
--fusion
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c511009025.mat_filter,2,true)
--material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c511009025.effcon)
e1:SetOperation(c511009025.regop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetDescription(aux.Stringid(900787,0))
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c511009025.atkcon)
e2:SetTarget(c511009025.atktg)
e2:SetOperation(c511009025.atkop)
c:RegisterEffect(e2)
--effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10032958,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c511009025.distg)
e3:SetOperation(c511009025.disop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(7338,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetTarget(c511009025.destg)
e4:SetOperation(c511009025.desop)
c:RegisterEffect(e4)
end
function c511009025.mat_filter(c)
if Card.IsFusionAttribute then
return c:IsFusionAttribute(ATTRIBUTE_DARK)
else
return c:IsAttribute(ATTRIBUTE_DARK)
end
end
function c511009025.effcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_FUSION and g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_MZONE)==g:GetCount()
end
function c511009025.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(511009025,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c511009025.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(511009025)~=0
end
function c511009025.filter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c511009025.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c511009025.filter,tp,0,LOCATION_MZONE,1,nil) end
end
function c511009025.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c511009025.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local atk=0
local tc=g:GetFirst()
while tc do
atk=atk+tc:GetAttack()
tc=g:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c511009025.disfilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and aux.disfilter1(c)
end
function c511009025.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c511009025.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c511009025.disfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c511009025.disfilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c511009025.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetOriginalCode()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
c:ReplaceEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
end
end
function c511009025.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSummonType,tp,0,LOCATION_MZONE,1,nil,SUMMON_TYPE_SPECIAL) end
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c511009025.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
if Duel.Destroy(g,REASON_EFFECT)>0 then
local dg=Duel.GetOperatedGroup()
local atk=0
local tc=dg:GetFirst()
while tc do
if tc:IsPreviousPosition(POS_FACEUP) then
atk=atk+tc:GetPreviousAttackOnField()
end
tc=dg:GetNext()
end
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
25 changes: 16 additions & 9 deletions script/c511009373.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--Illegal Dark Contract with the War God
--fixed by MLD
function c511009373.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
Expand All @@ -14,13 +15,14 @@ function c511009373.initial_effect(c)
e2:SetCountLimit(1)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c511009373.condition)
e2:SetTarget(c511009373.target)
e2:SetOperation(c511009373.operation)
e2:SetCondition(c511009373.atkcon)
e2:SetTarget(c511009373.atktg)
e2:SetOperation(c511009373.atkop)
c:RegisterEffect(e2)
-- damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(45974017,3))
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_SZONE)
Expand All @@ -34,10 +36,10 @@ end
function c511009373.filter(c)
return c:IsFaceup() and c:IsSetCard(0xaf)
end
function c511009373.condition(e,tp,eg,ep,ev,re,r,rp)
function c511009373.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c511009373.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c511009373.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c511009373.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Expand All @@ -46,18 +48,23 @@ function c511009373.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c511009373.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
function c511009373.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=g:GetFirst()
local tc2=g:GetNext()
if not tc1 or not tc2 or tc1==tc2 then return end
if tc1:IsControler(1-tp) then tc1,tc2=tc2,tc1 end
if tc1:IsControler(1-tp) or tc2:IsControler(tp) then return end
if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc1:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(-1000)
Expand Down
Loading