Commit 88176637 authored by VanillaSalt's avatar VanillaSalt

fix (4/4)

parent 9d7bceea
......@@ -14,7 +14,7 @@ function c10194329.initial_effect(c)
c:RegisterEffect(e1)
end
function c10194329.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and (bit.band(r,REASON_BATTLE)~=0 or bit.band(r,REASON_EFFECT)~=0)
return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function c10194329.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -68,7 +68,7 @@ function c10971759.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c10971759.filter(c)
return c:GetLevel()==3 and c:IsRace(RACE_INSECT) and c:IsFaceup()
return c:IsFaceup() and c:GetLevel()==3 and c:IsRace(RACE_INSECT)
end
function c10971759.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10971759.filter,tp,LOCATION_MZONE,0,1,nil) end
......
--月光輪廻舞踊
function c11193246.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DELAYED_QUICKEFFECT)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,11193246)
e1:SetCountLimit(1,11193246+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c11193246.condition)
e1:SetTarget(c11193246.target)
e1:SetOperation(c11193246.operation)
......@@ -26,15 +27,10 @@ function c11193246.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11193246.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c11193246.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=g:Select(tp,1,1,nil)
if g:GetCount()>=2 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg2=g:Select(tp,1,1,sg1:GetFirst())
sg1:Merge(sg2)
local g=Duel.SelectMatchingCard(tp,c11193246.thfilter,tp,LOCATION_DECK,0,1,2,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg1)
end
......@@ -4,7 +4,6 @@ function c11317977.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11317977,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c11317977.cost)
......@@ -39,7 +38,7 @@ end
function c11317977.thfilter(c)
return c:IsSetCard(0xdf) and c:IsType(TYPE_MONSTER) and not c:IsCode(11317977) and c:IsAbleToHand()
end
function c11317977.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c11317977.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11317977.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
......@@ -52,7 +51,7 @@ function c11317977.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c11317977.scfilter(c)
return c:GetCode()==24094653 and c:IsAbleToHand()
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c11317977.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11317977.scfilter,tp,LOCATION_DECK,0,1,nil) end
......@@ -75,7 +74,7 @@ function c11317977.thfilter2(c)
end
function c11317977.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11317977.thfilter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end
function c11317977.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -18,19 +18,19 @@ function c11439455.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c11439455.spcon2)
e3:SetTarget(c11439455.sptg2)
e3:SetOperation(c11439455.spop2)
e3:SetCondition(c11439455.spcon)
e3:SetTarget(c11439455.sptg)
e3:SetOperation(c11439455.spop)
c:RegisterEffect(e3)
end
function c11439455.atkfil(c)
return c:IsFaceup() and c:IsSetCard(0xdf) and not c:IsCode(11439455) and c:IsAttackAbove(0)
function c11439455.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdf) and not c:IsCode(11439455)
end
function c11439455.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11439455.atkfil(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11439455.atkfil,tp,LOCATION_MZONE,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11439455.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11439455.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c11439455.atkfil,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,c11439455.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,0,0)
end
function c11439455.atkop(e,tp,eg,ep,ev,re,r,rp)
......@@ -39,26 +39,23 @@ function c11439455.atkop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(c11439455.value)
e2:SetValue(tc:GetBaseAttack()*2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c11439455.value(e,c)
return c:GetBaseAttack()*2
end
function c11439455.spcon2(e,tp,eg,ep,ev,re,r,rp)
function c11439455.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c11439455.spfilter(c,e,tp)
return c:IsSetCard(0xdf) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11439455.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c11439455.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11439455.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11439455.spop2(e,tp,eg,ep,ev,re,r,rp)
function c11439455.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,c11439455.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
......
......@@ -41,11 +41,11 @@ end
function c11493868.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_STANDBY,2)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetValue(800)
tc:RegisterEffect(e1)
end
......
......@@ -65,6 +65,7 @@ function c12215894.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c12215894.cfilter(c)
return c:IsSetCard(0xab) and c:IsAbleToRemoveAsCost() and not c:IsCode(12215894)
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function c12215894.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c12215894.cfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,nil)
......
......@@ -27,9 +27,9 @@ function c12255007.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c12255007.actcon(e)
local c=Duel.GetAttacker()
local p=e:GetHandler():GetControler()
return c and c:IsControler(p) and (c:IsSetCard(0x9f) or c:IsSetCard(0x99))
local tc=Duel.GetAttacker()
local tp=e:GetHandlerPlayer()
return tc and tc:IsControler(tp) and (tc:IsSetCard(0x9f) or tc:IsSetCard(0x99))
end
function c12255007.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
......
--電子光虫-スカラジエータ
function c12615446.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,c12615446.matfil,3,2,nil,nil,5)
aux.AddXyzProcedure(c,c12615446.matfilter,3,2,nil,nil,5)
--Position+Negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12615446,0))
......@@ -26,10 +26,9 @@ function c12615446.initial_effect(c)
e2:SetOperation(c12615446.xyzop)
c:RegisterEffect(e2)
end
function c12615446.matfil(c)
function c12615446.matfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c12615446.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
......
......@@ -11,7 +11,8 @@ function c13048472.initial_effect(c)
c:RegisterEffect(e1)
end
function c13048472.filter(c,tp)
return bit.band(c:GetType(),0x82)==0x82 and c:IsAbleToHand() and Duel.IsExistingMatchingCard(c13048472.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
return bit.band(c:GetType(),0x82)==0x82 and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c13048472.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
end
function c13048472.filter2(c,mc)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY) and c13048472.isfit(c,mc)
......
......@@ -24,6 +24,7 @@ function c23160024.initial_effect(c)
e4:SetRange(LOCATION_FZONE)
e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(2)
e4:SetCondition(c23160024.drcon)
e4:SetOperation(c23160024.drop)
c:RegisterEffect(e4)
......@@ -41,11 +42,10 @@ function c23160024.cfilter(c,tp)
return c:IsSetCard(0xe0) and c:IsReason(REASON_RELEASE) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c23160024.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(23160024)<2 and eg:IsExists(c23160024.cfilter,1,nil,tp)
return eg:IsExists(c23160024.cfilter,1,nil,tp)
end
function c23160024.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode())
e:GetHandler():RegisterFlagEffect(23160024,RESET_PHASE+PHASE_END,0,1)
Duel.Draw(tp,1,REASON_EFFECT)
end
function c23160024.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -75,11 +75,10 @@ function c23338098.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c23338098.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SelectTarget(tp,c23338098.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,1,1,0,0)
local g=Duel.SelectTarget(tp,c23338098.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c23338098.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -33,17 +33,18 @@ function c24382602.initial_effect(c)
c:RegisterEffect(e4)
end
function c24382602.extg(e,c)
return c:IsType(TYPE_TUNER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevelBelow(1)
return c:IsType(TYPE_TUNER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==1
end
function c24382602.tgfilter(c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c24382602.cfilter,c:GetControler(),LOCATION_DECK+LOCATION_HAND,0,1,nil,c)
return c:IsFaceup()
end
function c24382602.cfilter(c,tc)
function c24382602.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c24382602.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c24382602.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24382602.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c24382602.tgfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c24382602.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c24382602.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
......@@ -51,7 +52,7 @@ function c24382602.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c24382602.cfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tc)
local g=Duel.SelectMatchingCard(tp,c24382602.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
local gc=g:GetFirst()
local lv=gc:GetLevel()
......@@ -66,11 +67,14 @@ function c24382602.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
end
elseif Duel.IsPlayerCanDiscardDeck(tp,1) then
else
local cg=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,cg)
Duel.ConfirmCards(tp,cg)
Duel.ShuffleDeck(tp)
cg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp)
end
end
function c24382602.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -49,13 +49,8 @@ end
function c25494711.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local atk=0
local g=Duel.GetMatchingGroup(c25494711.atkfilter,tp,LOCATION_MZONE,0,nil)
local bc=g:GetFirst()
while bc do
atk=atk+bc:GetAttack()
bc=g:GetNext()
end
local atk=g:GetSum(Card.GetAttack)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -61,4 +61,4 @@ function c31733941.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
\ No newline at end of file
end
......@@ -35,6 +35,13 @@ function c45467446.initial_effect(c)
e5:SetTarget(c45467446.sptg)
e5:SetOperation(c45467446.spop)
c:RegisterEffect(e5)
--add setcode
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetCode(EFFECT_ADD_SETCODE)
e6:SetValue(0xdd)
c:RegisterEffect(e6)
end
function c45467446.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
......
......@@ -44,19 +44,19 @@ function c45644898.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function c45644898.gvfilter(c,e,tp)
function c45644898.gvfilter(c)
return c:IsType(TYPE_EFFECT) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(c45644898.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp)
end
function c45644898.spfilter(c,e,tp)
return c:IsSetCard(0xdd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c45644898.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c45644898.gvfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c45644898.gvfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c45644898.gvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c45644898.gvfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c45644898.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c45644898.gvfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,c45644898.gvfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
......
......@@ -29,4 +29,4 @@ function c46253216.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
end
......@@ -22,7 +22,7 @@ function c48427163.initial_effect(c)
c:RegisterEffect(e2)
end
function c48427163.filter(c)
return c:IsFaceup() and c:IsSetCard(0xdf) and c:IsType(TYPE_MONSTER)
return c:IsFaceup() and c:IsSetCard(0xdf)
end
function c48427163.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
......@@ -72,6 +72,7 @@ function c50371210.operation(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
end
......@@ -85,5 +86,6 @@ function c50371210.ftarget(e,c)
return e:GetHandler():GetEquipTarget()~=c
end
function c50371210.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0xdd)-1
local ct=Duel.GetMatchingGroupCount(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0xdd)
return math.max(0,ct-1)
end
......@@ -25,26 +25,33 @@ function c50554729.initial_effect(c)
e4:SetCode(EVENT_RELEASE)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,50554729)
e4:SetCondition(c50554729.thcon)
e4:SetCondition(c50554729.thcon1)
e4:SetTarget(c50554729.thtg)
e4:SetOperation(c50554729.thop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(c50554729.thcon2)
c:RegisterEffect(e5)
end
function c50554729.filter(c)
return c:IsSetCard(0xe0) and c:IsFaceup()
return c:IsFaceup() and c:IsSetCard(0xe0)
end
function c50554729.value(e,c)
return Duel.GetMatchingGroupCount(c50554729.filter,c:GetControler(),LOCATION_ONFIELD,LOCATION_ONFIELD,nil)*100
return Duel.GetMatchingGroupCount(c50554729.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)*100
end
function c50554729.confilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReason(REASON_BATTLE+REASON_EFFECT+REASON_RELEASE)
function c50554729.cfilter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(LOCATION_MZONE+LOCATION_HAND) and c:GetPreviousControler()==tp
end
function c50554729.thcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c50554729.cfilter1,1,nil,tp)
end
function c50554729.cfilter2(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_MZONE+LOCATION_HAND) and c:GetPreviousControler()==tp
end
function c50554729.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c50554729.confilter,1,nil,tp)
function c50554729.thcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c50554729.cfilter2,1,nil,tp)
end
function c50554729.thfilter(c)
return c:IsSetCard(0xe0) and c:IsAbleToHand()
......@@ -61,4 +68,4 @@ function c50554729.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
end
......@@ -32,7 +32,6 @@ function c50954680.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c50954680.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
......@@ -55,7 +54,7 @@ end
function c50954680.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsLevelAbove(5)
return bc and bc:IsLevelAbove(5) and bc:IsControler(1-tp)
end
function c50954680.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -16,7 +16,7 @@ function c59640711.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c59640711.spfilter(c,e,tp)
return c:IsSetCard(0x2016) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetCode()~=59640711
return c:IsSetCard(0x2016) and c:IsType(TYPE_TUNER) and not c:IsCode(59640711) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c59640711.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -30,4 +30,4 @@ function c59640711.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
end
......@@ -59,7 +59,7 @@ function c59762399.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function c59762399.atkfilter(c)
return c:IsSetCard(0x9f) and c:IsFaceup()
return c:IsFaceup() and c:IsSetCard(0x9f)
end
function c59762399.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c59762399.atkfilter(chkc) end
......
......@@ -10,6 +10,7 @@ function c62015408.initial_effect(c)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c62015408.condition)
e1:SetCost(c62015408.cost)
e1:SetTarget(c62015408.target)
e1:SetOperation(c62015408.operation)
c:RegisterEffect(e1)
end
......@@ -21,6 +22,12 @@ function c62015408.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c62015408.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,30459350)
and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)>0
and Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function c62015408.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_EXTRA,0,1,1,nil)
......@@ -29,7 +36,7 @@ function c62015408.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
local tg=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,sg:GetFirst():GetCode())
local tg=g:Filter(Card.IsCode,nil,sg:GetFirst():GetCode())
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
......
......@@ -63,7 +63,7 @@ end
function c6283472.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe0)
end
function c6283472.damcon(e,tp,eg,ep,ev,re,r,rp)
function c6283472.damcon(e)
return Duel.IsExistingMatchingCard(c6283472.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c6283472.damval(e,re,val,r,rp,rc)
......
......@@ -11,30 +11,31 @@ function c62893810.initial_effect(c)
c:RegisterEffect(e1)
end
function c62893810.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local g2=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
g1:Merge(g2)
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND)
if chk==0 then return g1:GetCount()~=0 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_HANDES,g1,1,0,0)
end
function c62893810.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local g2=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g1:GetCount()+g2:GetCount()==0 then return end
local d=Duel.TossDice(tp,1)
if d==1 then
Duel.ConfirmCards(tp,g1)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()==0 then return end
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg1=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(sg1,REASON_EFFECT+REASON_DISCARD)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(1-tp)
elseif d==6 then
Duel.SendtoGrave(g2,REASON_EFFECT+REASON_DISCARD)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
else
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg1=g2:Select(tp,1,1,nil)
Duel.SendtoGrave(sg1,REASON_EFFECT+REASON_DISCARD)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(tp)
end
end
--龍大神
function c63737050.initial_effect(c)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(63737050,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
......@@ -11,7 +12,6 @@ function c63737050.initial_effect(c)
e1:SetOperation(c63737050.operation)
c:RegisterEffect(e1)
end
function c63737050.cfilter(c,tp)
return c:GetSummonPlayer()~=tp
end
......@@ -19,8 +19,8 @@ function c63737050.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c63737050.cfilter,1,nil,tp)
end
function c63737050.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end
function c63737050.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,nil)
......
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