Commit 90e39293 authored by nekrozar's avatar nekrozar

fix Crystal Beast

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=4&cid=7391

■『①:このカードが魔法&罠ゾーンに存在する限り、「宝玉獣」モンスターが魔法&罠ゾーンに置かれる度に、このカードにジェムカウンターを1つ置く』効果はチェーンブロックの作られない効果です。(ダメージステップでも適用されます。)
parent 2d9dba96
......@@ -56,7 +56,7 @@ function c10004783.tfcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetPreviousLocation(),LOCATION_ONFIELD)~=0
end
function c10004783.tffilter(c)
return c:IsSetCard(0x1034) and not c:IsForbidden()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c10004783.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
......@@ -76,6 +76,5 @@ function c10004783.tfop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
......@@ -18,7 +18,7 @@ function c11136371.plcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST)
end
function c11136371.plfilter(c)
return c:IsSetCard(0x1034) and not c:IsForbidden()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c11136371.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11136371.plfilter,tp,LOCATION_GRAVE,0,1,nil) end
......@@ -42,7 +42,6 @@ function c11136371.plop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
Duel.RaiseEvent(g,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -33,7 +33,6 @@ function c21698716.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c21698716.filter(c)
return c:IsSetCard(0x1034) and c:IsAbleToDeck() and c:IsFaceup()
......
......@@ -32,10 +32,9 @@ function c32710364.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c32710364.filter(c,e,sp)
return c:IsFaceup() and c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,sp,true,false)
return c:IsFaceup() and c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c32710364.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32710364.filter,tp,LOCATION_SZONE,0,1,nil,e,tp)
......@@ -57,10 +56,10 @@ function c32710364.operation(e,tp,eg,ep,ev,re,r,rp)
local gc=g:GetCount()
if gc==0 then return end
if gc<=ct then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,ct,ct,nil)
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -35,7 +35,6 @@ function c32933942.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c32933942.rdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -123,7 +123,7 @@ function c34487429.spop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c34487429.filter1,tp,LOCATION_SZONE,0,5,nil) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c34487429.rdcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -11,7 +11,7 @@ function c35486099.initial_effect(c)
c:RegisterEffect(e1)
end
function c35486099.filter(c)
return c:IsSetCard(0x1034) and not c:IsForbidden()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c35486099.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c35486099.filter(chkc) end
......@@ -50,6 +50,5 @@ function c35486099.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
Duel.RaiseEvent(sg,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
......@@ -96,6 +96,5 @@ function c36328300.plop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
Duel.RaiseEvent(g,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
......@@ -16,7 +16,7 @@ function c47121070.tfcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47121070.filter,1,nil,tp)
end
function c47121070.tffilter(c)
return c:IsSetCard(0x1034) and not c:IsForbidden()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c47121070.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
......@@ -45,6 +45,5 @@ function c47121070.tfop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
......@@ -8,22 +8,26 @@ function c47408488.initial_effect(c)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetDescription(aux.Stringid(47408488,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_MOVE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CUSTOM+47408488)
e2:SetOperation(c47408488.ctop)
e2:SetCondition(c47408488.ctcon1)
e2:SetOperation(c47408488.ctop1)
c:RegisterEffect(e2)
--equip
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetCode(EVENT_MOVE)
e0:SetRange(LOCATION_SZONE)
e0:SetCondition(c47408488.regcon)
e0:SetOperation(c47408488.regop)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_COUNTER)
e3:SetDescription(aux.Stringid(47408488,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_EQUIP)
e3:SetCondition(c47408488.eqcon)
e3:SetOperation(c47408488.ctop)
e3:SetCondition(c47408488.ctcon2)
e3:SetOperation(c47408488.ctop2)
c:RegisterEffect(e3)
--place
local e4=Effect.CreateEffect(c)
......@@ -34,12 +38,50 @@ function c47408488.initial_effect(c)
e4:SetTarget(c47408488.pltg)
e4:SetOperation(c47408488.plop)
c:RegisterEffect(e4)
if not c47408488.global_check then
c47408488.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetOperation(c47408488.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetOperation(c47408488.reset)
Duel.RegisterEffect(ge2,0)
end
end
function c47408488.checkop(e,tp,eg,ep,ev,re,r,rp)
c47408488.chain_solving=true
end
function c47408488.reset(e,tp,eg,ep,ev,re,r,rp)
c47408488.chain_solving=false
end
function c47408488.cfilter(c)
local type=c:GetOriginalType()
if c:IsPreviousLocation(LOCATION_ONFIELD) then type=c:GetPreviousTypeOnField() end
return c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 and c:IsSetCard(0x1034) and bit.band(type,TYPE_MONSTER)~=0
end
function c47408488.ctcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47408488.cfilter,1,nil) and not c47408488.chain_solving
end
function c47408488.ctop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,47408488)
e:GetHandler():AddCounter(0x6,1)
end
function c47408488.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47408488.cfilter,1,nil) and c47408488.chain_solving
end
function c47408488.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(47408488,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
end
function c47408488.eqcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsFaceup() and tc:IsSetCard(0x1034)
function c47408488.ctcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(47408488)>0
end
function c47408488.ctop(e,tp,eg,ep,ev,re,r,rp)
function c47408488.ctop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,47408488)
e:GetHandler():ResetFlagEffect(47408488)
e:GetHandler():AddCounter(0x6,1)
end
function c47408488.plcost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -51,14 +93,15 @@ function c47408488.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=e:GetHandler():GetCounter(0x6)
return ct>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=-1+ct
and Duel.IsExistingMatchingCard(c47408488.plfilter,tp,LOCATION_DECK,0,ct,nil)
end
end
function c47408488.plfilter(c)
return c:IsSetCard(0x1034) and not c:IsForbidden()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c47408488.plop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
if ft<e:GetLabel() then return end
if ft>e:GetLabel() then ft=e:GetLabel() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c47408488.plfilter,tp,LOCATION_DECK,0,ft,ft,nil)
......@@ -75,6 +118,5 @@ function c47408488.plop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
Duel.RaiseEvent(g,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
......@@ -33,7 +33,6 @@ function c68215963.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c68215963.filter(c)
return c:IsAttackPos() and c:GetAttackedCount()>0 and c:IsCanChangePosition()
......
......@@ -32,7 +32,6 @@ function c69937550.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c69937550.cbcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -37,10 +37,9 @@ function c7093411.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c7093411.filter(c)
return c:IsSetCard(0x1034) and not c:IsForbidden()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c7093411.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c7093411.filter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,1,nil)
......@@ -60,6 +59,5 @@ function c7093411.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
......@@ -89,7 +89,7 @@ function c79856792.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(79856792)==0
end
function c79856792.cfilter(c)
return c:IsSetCard(0x1034) and c:IsAbleToRemoveAsCost()
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c79856792.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79856792.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
......
......@@ -11,7 +11,7 @@ function c8275702.initial_effect(c)
c:RegisterEffect(e1)
end
function c8275702.filter(c,e,sp)
return c:IsFaceup() and c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,sp,true,false)
return c:IsFaceup() and c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c8275702.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c8275702.filter(chkc,e,tp) end
......@@ -24,6 +24,6 @@ end
function c8275702.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -43,7 +43,6 @@ function c9334391.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
end
......@@ -17,7 +17,7 @@ function c95326659.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c95326659.cfilter,tp,LOCATION_SZONE,0,2,nil)
end
function c95326659.filter(c,e,tp)
return c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
return c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c95326659.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -30,6 +30,6 @@ function c95326659.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c95326659.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -31,7 +31,6 @@ function c95600067.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
function c95600067.condition(e)
local phase=Duel.GetCurrentPhase()
......
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