Commit 1177553d authored by VanillaSalt's avatar VanillaSalt

fix

parent 708fa0c3
......@@ -17,15 +17,16 @@ function c14883228.initial_effect(c)
e2:SetCondition(c14883228.handcon)
c:RegisterEffect(e2)
end
function c14883228.filter(c)
function c14883228.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c14883228.handcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c14883228.filter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c14883228.filter,tp,0,LOCATION_ONFIELD,2,nil)
function c14883228.handcon(e)
local tp=e:GetHandlerPlayer()
return not Duel.IsExistingMatchingCard(c14883228.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c14883228.cfilter,tp,0,LOCATION_ONFIELD,2,nil)
end
function c14883228.filter(c)
return c:IsFaceup() and c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c14883228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c14883228.filter(chkc) end
......
......@@ -15,7 +15,7 @@ function c19814508.initial_effect(c)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c19814508.target)
e2:SetOperation(c19814508.operation)
c:RegisterEffect(e2)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19814508,1))
......@@ -25,8 +25,8 @@ function c19814508.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c19814508.condition)
e3:SetOperation(c19814508.operation)
e3:SetCondition(c19814508.atkcon)
e3:SetOperation(c19814508.atkop)
c:RegisterEffect(e3)
end
function c19814508.filter(c)
......@@ -34,16 +34,14 @@ function c19814508.filter(c)
end
function c19814508.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return tc:IsSetCard(0xb2) and tc:GetControler()==tp
and Duel.IsExistingMatchingCard(c19814508.filter,tp,LOCATION_DECK,0,1,nil,tc:GetAttack()) end
tc:CreateEffectRelation(e)
if chk==0 then return tc:IsSetCard(0xb2) and tc:IsControler(tp)
and Duel.IsExistingMatchingCard(c19814508.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c19814508.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c19814508.filter,tp,LOCATION_DECK,0,1,1,nil,tc:GetAttack())
local g=Duel.SelectMatchingCard(tp,c19814508.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......@@ -52,10 +50,10 @@ end
function c19814508.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xb2) and c:IsControler(tp)
end
function c19814508.condition(e,tp,eg,ep,ev,re,r,rp)
function c19814508.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c19814508.cfilter,1,nil,tp)
end
function c19814508.operation(e,tp,eg,ep,ev,re,r,rp)
function c19814508.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
......@@ -69,4 +67,4 @@ function c19814508.operation(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e3)
tc=g:GetNext()
end
end
\ No newline at end of file
end
......@@ -2,17 +2,17 @@
function c20036055.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,20036055+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c20036055.sptg)
e1:SetOperation(c20036055.spop)
c:RegisterEffect(e1)
end
function c20036055.filter(c,e,tp,id)
return c:IsSetCard(0xb1) and c:GetTurnID()==id and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsReason(REASON_RETURN)
return c:IsSetCard(0xb1) and c:GetTurnID()==id and not c:IsReason(REASON_RETURN) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20036055.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
......@@ -25,11 +25,12 @@ function c20036055.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c20036055.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil)
end
local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
......@@ -7,29 +7,29 @@ function c20758643.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c20758643.sdcon)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20758643,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,20758643)
e2:SetCondition(c20758643.sscon)
e2:SetTarget(c20758643.sstg)
e2:SetOperation(c20758643.ssop)
c:RegisterEffect(e2)
--
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(20758643,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,20758643)
e3:SetCondition(c20758643.thcon)
e3:SetTarget(c20758643.thtg)
e3:SetOperation(c20758643.thop)
e3:SetCondition(c20758643.spcon)
e3:SetTarget(c20758643.sptg)
e3:SetOperation(c20758643.spop)
c:RegisterEffect(e3)
end
function c20758643.sdfilter(c)
......@@ -42,7 +42,7 @@ function c20758643.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c20758643.sscon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and not Duel.IsExistingMatchingCard(c20758643.filter,tp,LOCATION_ONFIELD,0,1,nil)
return not Duel.IsExistingMatchingCard(c20758643.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c20758643.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -50,26 +50,27 @@ function c20758643.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20758643.ssop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and not Duel.IsExistingMatchingCard(c20758643.filter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK)
if Duel.IsExistingMatchingCard(c20758643.filter,tp,LOCATION_ONFIELD,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c20758643.thcon(e,tp,eg,ep,ev,re,r,rp)
function c20758643.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c20758643.spfilter(c,e,tp)
return c:IsSetCard(0xb1) and c:GetCode()~=20758643 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0xb1) and not c:IsCode(20758643) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20758643.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c20758643.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c23899727.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c20758643.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c20758643.thop(e,tp,eg,ep,ev,re,r,rp)
function c20758643.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c23899727.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c20758643.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
end
......@@ -16,7 +16,7 @@ function c25005816.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c25005816.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsControler(tp) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
......
--Master Craftsman Gamil
--TCG Version
function c25727454.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetDescription(aux.Stringid(25727454,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c25727454.condition)
e1:SetCost(c25727454.cost)
e1:SetOperation(c25727454.operation)
......@@ -20,17 +19,16 @@ function c25727454.condition(e,tp,eg,ep,ev,re,r,rp)
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a:GetControler()==tp and a:IsRelateToBattle())
or (d and d:GetControler()==tp and d:IsRelateToBattle())
return (a:IsControler(tp) and a:IsRelateToBattle()) or (d and d:IsControler(tp) and d:IsRelateToBattle())
end
function c25727454.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c25727454.operation(e,tp,eg,ep,ev,re,r,rp,chk)
function c25727454.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
if Duel.GetTurnPlayer()~=tp then a=Duel.GetAttackTarget() end
if not a:IsRelateToBattle() then return end
if not a:IsRelateToBattle() or a:IsFacedown() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -8,51 +8,49 @@ function c50277973.initial_effect(c)
e1:SetTarget(c50277973.target)
e1:SetOperation(c50277973.activate)
c:RegisterEffect(e1)
--dummy effect
local e2=Effect.CreateEffect(c)
c:RegisterEffect(e2)
e1:SetLabelObject(e2)
end
function c50277973.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,50277973,0,0x11,1800,1000,4,nil,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0)
local att = 0x1
local aat = 0x0
while att<0x80 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,50277973,0,0x11,1800,1000,4,nil,att) then
aat=bit.bor(aat,att)
if chk==0 then
local rac=0
local crac=1
for irac=0,23 do
local catt=1
for iatt=0,7 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,5189,0,0x11,0,2200,4,crac,catt) then
rac=rac+crac
break
end
catt=catt*2
end
crac=crac*2
end
att=bit.lshift(att, 1)
e:SetLabel(rac)
return rac~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
aat=Duel.AnnounceAttribute(tp,1,aat)
e:SetLabel(aat)
local rcc= 0x1
local rc = 0x0
while rcc<0x1000000 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,50277973,0,0x11,1800,1000,4,rcc,nil) then
rc=bit.bor(rc,rcc)
Duel.Hint(HINT_SELECTMSG,tp,563)
local crac=Duel.AnnounceRace(tp,1,e:GetLabel())
local att=0
local catt=1
for iatt=0,7 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,50277973,0,0x11,1800,1000,4,crac,catt) then
att=att+catt
end
rcc=bit.lshift(rcc, 1)
catt=catt*2
end
Duel.Hint(HINT_SELECTMSG,tp,563)
rc=Duel.AnnounceRace(tp,1,rc)
e:GetLabelObject():SetLabel(rc)
Duel.Hint(HINT_SELECTMSG,tp,562)
catt=Duel.AnnounceAttribute(tp,1,att)
e:SetLabel(crac)
Duel.SetTargetParam(catt)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c50277973.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local att=e:GetLabel()
local race=e:GetLabelObject():GetLabel()
local rac=e:GetLabel()
local att=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,50277973,0,0x11,1800,1000,4,race,att) then return end
c:AddTrapMonsterAttribute(TYPE_NORMAL,att,race,4,1800,1000)
Duel.SpecialSummon(c,1,tp,tp,true,false,POS_FACEUP)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,50277973,0,0x11,1800,1000,4,rac,att) then return end
c:AddTrapMonsterAttribute(TYPE_NORMAL,att,rac,4,1800,1000)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
end
\ No newline at end of file
end
......@@ -24,14 +24,14 @@ function c51099515.tfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c51099515.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c51099515.tfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51099515.tfilter,tp,0,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c51099515.tfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51099515.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c51099515.tfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SelectTarget(tp,c51099515.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c51099515.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......@@ -39,4 +39,4 @@ function c51099515.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
end
......@@ -22,7 +22,7 @@ function c56421754.initial_effect(c)
c:RegisterEffect(e2)
end
function c56421754.spfilter(c)
return c:IsSetCard(0xb2) and c:GetCode()~=56421754 and c:IsAbleToHandAsCost()
return c:IsFaceup() and c:IsSetCard(0xb2) and not c:IsCode(56421754) and c:IsAbleToHandAsCost()
end
function c56421754.spcon(e,c)
if c==nil then return true end
......@@ -32,7 +32,6 @@ end
function c56421754.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c56421754.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
if not g:GetFirst():IsFaceup then Duel.ConfirmCards(1-tp,g) end
Duel.SendtoHand(g,nil,REASON_COST)
end
function c56421754.aclimit(e,re,tp)
......
......@@ -7,29 +7,29 @@ function c57143342.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c57143342.sdcon)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(57143342,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,57143342)
e2:SetCondition(c57143342.sscon)
e2:SetTarget(c57143342.sstg)
e2:SetOperation(c57143342.ssop)
c:RegisterEffect(e2)
--
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetDescription(aux.Stringid(57143342,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,57143342)
e3:SetCondition(c57143342.thcon)
e3:SetTarget(c57143342.thtg)
e3:SetOperation(c57143342.thop)
e3:SetCondition(c57143342.spcon)
e3:SetTarget(c57143342.sptg)
e3:SetOperation(c57143342.spop)
c:RegisterEffect(e3)
end
function c57143342.sdfilter(c)
......@@ -42,7 +42,7 @@ function c57143342.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c57143342.sscon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and not Duel.IsExistingMatchingCard(c57143342.filter,tp,LOCATION_ONFIELD,0,1,nil)
return not Duel.IsExistingMatchingCard(c57143342.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c57143342.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -50,27 +50,28 @@ function c57143342.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c57143342.ssop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and not Duel.IsExistingMatchingCard(c57143342.filter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK)
if Duel.IsExistingMatchingCard(c57143342.filter,tp,LOCATION_ONFIELD,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c57143342.thcon(e,tp,eg,ep,ev,re,r,rp)
function c57143342.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c57143342.thfilter(c)
return c:IsSetCard(0xb1) and not c:IsCode(57143342) and c:IsAbleToHand()
function c57143342.spfilter(c,e,tp)
return c:IsSetCard(0xb1) and not c:IsCode(57143342) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c57143342.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c57143342.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c57143342.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c57143342.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
function c57143342.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c57143342.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c57143342.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c57143342.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c57143342.thop(e,tp,eg,ep,ev,re,r,rp)
function c57143342.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
end
--Doomstar Magician
function c58369990.initial_effect(c)
--tohand
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58369990,1))
e1:SetDescription(aux.Stringid(58369990,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCost(c58369990.cost)
e1:SetTarget(c58369990.tg)
e1:SetOperation(c58369990.op)
e1:SetTarget(c58369990.target)
e1:SetOperation(c58369990.operation)
c:RegisterEffect(e1)
end
function c58369990.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -20,18 +20,16 @@ end
function c58369990.filter(c)
return (c:GetSequence()==6 or c:GetSequence()==7) and c:IsDestructable()
end
function c58369990.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c58369990.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c58369990.filter(chkc) end
if chk==0 then return
Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c58369990.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil)
end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c58369990.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c58369990.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c58369990.thop1(e,tp,eg,ep,ev,re,r,rp)
function c58369990.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
......
......@@ -26,7 +26,7 @@ function c82419869.initial_effect(c)
c:RegisterEffect(e2)
end
function c82419869.spfilter(c)
return c:IsSetCard(0xb2) and c:IsAbleToHandAsCost()
return c:IsFaceup() and c:IsSetCard(0xb2) and not c:IsCode(82419869) and c:IsAbleToHandAsCost()
end
function c82419869.spcon(e,c)
if c==nil then return true end
......@@ -36,7 +36,6 @@ end
function c82419869.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c82419869.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
if not g:GetFirst():IsFaceup then Duel.ConfirmCards(1-tp,g) end
Duel.SendtoHand(g,nil,REASON_COST)
end
function c82419869.discon(e,tp,eg,ep,ev,re,r,rp)
......@@ -45,10 +44,8 @@ function c82419869.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and Duel.GetTurnPlayer()~=tp
end
function c82419869.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c82419869.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -62,4 +59,4 @@ function c82419869.disop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
\ No newline at end of file
end
......@@ -11,7 +11,7 @@ function c83531441.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c83531441.atkcost)
e1:SetOperation(c83531441.operation)
e1:SetOperation(c83531441.atkop)
c:RegisterEffect(e1)
--to defence
local e2=Effect.CreateEffect(c)
......@@ -22,8 +22,8 @@ function c83531441.initial_effect(c)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetDescription(aux.Stringid(83531441,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
......@@ -78,7 +78,7 @@ end
function c83531441.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c83531441.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c83531441.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c83531441.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
......
......@@ -7,7 +7,7 @@ function c84764038.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c84764038.sdcon)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84764038,0))
......@@ -36,7 +36,7 @@ function c84764038.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c84764038.sscon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and not Duel.IsExistingMatchingCard(c84764038.filter,tp,LOCATION_ONFIELD,0,1,nil)
return not Duel.IsExistingMatchingCard(c84764038.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c84764038.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -44,8 +44,9 @@ function c84764038.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c84764038.ssop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and not Duel.IsExistingMatchingCard(c84764038.filter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK)
if Duel.IsExistingMatchingCard(c84764038.filter,tp,LOCATION_ONFIELD,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c84764038.regop(e,tp,eg,ep,ev,re,r,rp)
......@@ -65,7 +66,8 @@ function c84764038.regop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c84764038.thfilter(c)
return c:GetLevel()== 3 and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND) and not c:IsCode(84764038) and c:IsAbleToHand()
return c:GetLevel()==3 and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND)
and not c:IsCode(84764038) and c:IsAbleToHand()
end
function c84764038.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84764038.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -8,51 +8,49 @@ function c87772572.initial_effect(c)
e1:SetTarget(c87772572.target)
e1:SetOperation(c87772572.activate)
c:RegisterEffect(e1)
--dummy effect
local e2=Effect.CreateEffect(c)
c:RegisterEffect(e2)
e1:SetLabelObject(e2)
end
function c87772572.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,nil,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0)
local att = 0x1
local aat = 0x0
while att<0x80 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,nil,att) then
aat=bit.bor(aat,att)
if chk==0 then
local rac=0
local crac=1
for irac=0,23 do
local catt=1
for iatt=0,7 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,crac,catt) then
rac=rac+crac
break
end
catt=catt*2
end
crac=crac*2
end
att=bit.lshift(att, 1)
e:SetLabel(rac)
return rac~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
aat=Duel.AnnounceAttribute(tp,1,aat)
e:SetLabel(aat)
local rcc= 0x1
local rc = 0x0
while rcc<0x1000000 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,rcc,nil) then
rc=bit.bor(rc,rcc)
Duel.Hint(HINT_SELECTMSG,tp,563)
local crac=Duel.AnnounceRace(tp,1,e:GetLabel())
local att=0
local catt=1
for iatt=0,7 do
if Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,crac,catt) then
att=att+catt
end
rcc=bit.lshift(rcc, 1)
catt=catt*2
end
Duel.Hint(HINT_SELECTMSG,tp,563)
rc=Duel.AnnounceRace(tp,1,rc)
e:GetLabelObject():SetLabel(rc)
Duel.Hint(HINT_SELECTMSG,tp,562)
catt=Duel.AnnounceAttribute(tp,1,att)
e:SetLabel(crac)
Duel.SetTargetParam(catt)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c87772572.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local att=e:GetLabel()
local race=e:GetLabelObject():GetLabel()
local rac=e:GetLabel()
local att=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,race,att) then return end
c:AddTrapMonsterAttribute(TYPE_NORMAL,att,race,4,0,2200)
Duel.SpecialSummon(c,1,tp,tp,true,false,POS_FACEUP)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,87772572,0,0x11,0,2200,4,rac,att) then return end
c:AddTrapMonsterAttribute(TYPE_NORMAL,att,rac,4,0,2200)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
end
\ No newline at end of file
end
......@@ -13,13 +13,13 @@ function c88494120.initial_effect(c)
c:RegisterEffect(e1)
end
function c88494120.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0,nil)==1
and Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0,nil)>0
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
end
function c88494120.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
......@@ -27,22 +27,13 @@ function c88494120.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local atk=0
local tg=g:GetMinGroup(Card.GetAttack)
if tg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
atk=sg:GetFirst():GetAttack()
else atk=tg:GetFirst():GetAttack() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(atk)
tc:RegisterEffect(e1)
end
if g:GetCount()==0 then return end
local mg,atk=g:GetMinGroup(Card.GetAttack)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(atk)
tc:RegisterEffect(e1)
end
end
......@@ -9,25 +9,25 @@ function c88610708.initial_effect(c)
e1:SetTarget(c88610708.target)
e1:SetOperation(c88610708.operation)
c:RegisterEffect(e1)
--no dam
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetCondition(c88610708.damcon)
e2:SetValue(1)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c88610708.eqlimit)
c:RegisterEffect(e2)
--Equip limit
--Atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c88610708.eqlimit)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(1000)
c:RegisterEffect(e3)
--Atk up
--no damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetValue(1000)
e4:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e4:SetCondition(c88610708.damcon)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function c88610708.eqlimit(e,c)
......@@ -37,7 +37,7 @@ function c88610708.filter(c)
return c:IsFaceup() and bit.band(c:GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
end
function c88610708.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and c88610708.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c88610708.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88610708.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c88610708.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -8,25 +8,25 @@ function c99733359.initial_effect(c)
e1:SetRange(LOCATION_GRAVE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCountLimit(1,99733359)
e1:SetCondition(c99733359.con)
e1:SetCondition(c99733359.condition)
e1:SetCost(c99733359.cost)
e1:SetTarget(c99733359.tg)
e1:SetOperation(c99733359.op)
e1:SetTarget(c99733359.target)
e1:SetOperation(c99733359.operation)
c:RegisterEffect(e1)
end
function c99733359.con(e,tp,eg,ep,ev,re,r,rp)
function c99733359.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c99733359.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c99733359.tg(e,tp,eg,ep,ev,re,r,rp,chk)
function c99733359.target(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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c99733359.op(e,tp,eg,ep,ev,re,r,rp)
function c99733359.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
......
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