Commit 2f9acb9d authored by DailyShana's avatar DailyShana

fix and update

require Fluorohydride/ygopro-core@13e0a39
parent 0d84f647
...@@ -10,31 +10,42 @@ function c1801154.initial_effect(c) ...@@ -10,31 +10,42 @@ function c1801154.initial_effect(c)
e2:SetDescription(aux.Stringid(1801154,0)) e2:SetDescription(aux.Stringid(1801154,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_EVENT_PLAYER)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_CUSTOM+1801154)
e2:SetTarget(c1801154.sptg) e2:SetTarget(c1801154.sptg)
e2:SetOperation(c1801154.spop) e2:SetOperation(c1801154.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c1801154.check)
c:RegisterEffect(e3)
end end
function c1801154.filter1(c,e,tp,eg) function c1801154.check(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1801154.filter2,1,nil,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) for tc in aux.Next(eg) do
if tc:IsType(TYPE_FUSION) and tc:IsReason(REASON_DESTROY) and tc:IsReason(REASON_EFFECT) then
Duel.RaiseEvent(tc,EVENT_CUSTOM+1801154,re,r,rp,tc:GetControler(),ev)
end
end
end end
function c1801154.filter2(c,code) function c1801154.spfilter(c,e,tp,fc)
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT) and aux.IsMaterialListCode(c,code) return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c1801154.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c1801154.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c1801154.filter1(chkc,e,tp,eg) end local fc=eg:GetFirst()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c1801154.spfilter(chkc,e,tp,fc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1801154.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp,eg) end and Duel.IsExistingTarget(c1801154.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,fc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1801154.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,eg) local g=Duel.SelectTarget(tp,c1801154.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,fc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c1801154.spop(e,tp,eg,ep,ev,re,r,rp) function c1801154.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -26,7 +26,8 @@ function c53039326.initial_effect(c) ...@@ -26,7 +26,8 @@ function c53039326.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetDescription(aux.Stringid(53039326,2)) e4:SetDescription(aux.Stringid(53039326,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER)
e4:SetCode(EVENT_CUSTOM+53039326) e4:SetCode(EVENT_CUSTOM+53039326)
e4:SetTarget(c53039326.target) e4:SetTarget(c53039326.target)
...@@ -63,27 +64,25 @@ function c53039326.check(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,27 +64,25 @@ function c53039326.check(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()~=PHASE_END then return end if Duel.GetCurrentPhase()~=PHASE_END then return end
local tc=eg:GetFirst() local tc=eg:GetFirst()
local turnp=Duel.GetTurnPlayer() local turnp=Duel.GetTurnPlayer()
local b1=false local g1=Group.CreateGroup()
local b2=false local g2=Group.CreateGroup()
while tc do while tc do
if tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and tc:IsSetCard(0x1d) then if tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and tc:IsSetCard(0x1d) then
if tc:GetOwner()==turnp then b1=true else b2=true end if tc:GetOwner()==turnp then g1:AddCard(tc) else g2:AddCard(tc) end
end end
tc=eg:GetNext() tc=eg:GetNext()
end end
if b1 then Duel.RaiseSingleEvent(c,EVENT_CUSTOM+53039326,e,r,rp,turnp,0) end if g1:GetCount()>0 then Duel.RaiseEvent(g1,EVENT_CUSTOM+53039326,re,r,rp,turnp,0) end
if b2 then Duel.RaiseSingleEvent(c,EVENT_CUSTOM+53039326,e,r,rp,1-turnp,0) end if g2:GetCount()>0 then Duel.RaiseEvent(g2,EVENT_CUSTOM+53039326,re,r,rp,1-turnp,0) end
end end
function c53039326.filter(c) function c53039326.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1d) and c:IsAbleToHand() return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1d) and c:IsAbleToHand()
end end
function c53039326.target(e,tp,eg,ep,ev,re,r,rp,chk) function c53039326.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) if chk==0 then return Duel.IsExistingMatchingCard(c53039326.filter,tp,LOCATION_DECK,0,1,nil) end
and Duel.IsExistingMatchingCard(c53039326.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c53039326.operation(e,tp,eg,ep,ev,re,r,rp) function c53039326.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53039326.filter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c53039326.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -19,7 +19,8 @@ function c75782277.initial_effect(c) ...@@ -19,7 +19,8 @@ function c75782277.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY) e4:SetCategory(CATEGORY_DESTROY)
e4:SetDescription(aux.Stringid(75782277,0)) e4:SetDescription(aux.Stringid(75782277,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_EVENT_PLAYER) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_EVENT_PLAYER)
e4:SetCode(EVENT_CUSTOM+75782277) e4:SetCode(EVENT_CUSTOM+75782277)
e4:SetTarget(c75782277.target) e4:SetTarget(c75782277.target)
...@@ -41,28 +42,28 @@ end ...@@ -41,28 +42,28 @@ end
function c75782277.check(e,tp,eg,ep,ev,re,r,rp) function c75782277.check(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=eg:GetFirst() local tc=eg:GetFirst()
local tp1=false local tp2=false local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
while tc do while tc do
if tc:IsFaceup() and tc:IsCode(76812113,12206212) then if tc:IsFaceup() and tc:IsCode(76812113,12206212) then
if tc:IsControler(tp) then tp1=true else tp2=true end if tc:IsControler(tp) then g1:AddCard(tc) else g2:AddCard(tc) end
end end
tc=eg:GetNext() tc=eg:GetNext()
end end
if tp1 then Duel.RaiseSingleEvent(c,EVENT_CUSTOM+75782277,e,r,rp,tp,0) end if g1:GetCount()>0 then Duel.RaiseEvent(g1,EVENT_CUSTOM+75782277,re,r,rp,tp,0) end
if tp2 then Duel.RaiseSingleEvent(c,EVENT_CUSTOM+75782277,e,r,rp,1-tp,0) end if g2:GetCount()>0 then Duel.RaiseEvent(g2,EVENT_CUSTOM+75782277,re,r,rp,1-tp,0) end
end end
function c75782277.filter(c) function c75782277.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function c75782277.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c75782277.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c75782277.filter(chkc) end if chkc then return chkc:IsOnField() and c75782277.filter(chkc) end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c75782277.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c75782277.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c75782277.operation(e,tp,eg,ep,ev,re,r,rp) function c75782277.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
......
...@@ -16,7 +16,8 @@ function c80402389.initial_effect(c) ...@@ -16,7 +16,8 @@ function c80402389.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetDescription(aux.Stringid(80402389,0)) e3:SetDescription(aux.Stringid(80402389,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER)
e3:SetCode(EVENT_CUSTOM+80402389) e3:SetCode(EVENT_CUSTOM+80402389)
e3:SetTarget(c80402389.target) e3:SetTarget(c80402389.target)
...@@ -29,7 +30,7 @@ function c80402389.check(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,7 +30,7 @@ function c80402389.check(e,tp,eg,ep,ev,re,r,rp)
while tc do while tc do
if tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsReason(REASON_DESTROY) if tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsReason(REASON_DESTROY)
and tc:IsRace(RACE_INSECT) and tc:IsLevelAbove(1) and tc:IsPreviousPosition(POS_FACEUP) then and tc:IsRace(RACE_INSECT) and tc:IsLevelAbove(1) and tc:IsPreviousPosition(POS_FACEUP) then
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+80402389,e,r,rp,tc:GetControler(),tc:GetLevel()) Duel.RaiseEvent(tc,EVENT_CUSTOM+80402389,re,r,rp,tc:GetControler(),tc:GetLevel())
end end
tc=eg:GetNext() tc=eg:GetNext()
end end
...@@ -38,12 +39,10 @@ function c80402389.filter(c,lv) ...@@ -38,12 +39,10 @@ function c80402389.filter(c,lv)
return c:IsRace(RACE_INSECT) and c:IsLevel(lv) and c:IsAbleToHand() return c:IsRace(RACE_INSECT) and c:IsLevel(lv) and c:IsAbleToHand()
end end
function c80402389.target(e,tp,eg,ep,ev,re,r,rp,chk) function c80402389.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) if chk==0 then return Duel.IsExistingMatchingCard(c80402389.filter,tp,LOCATION_DECK,0,1,nil,ev) end
and Duel.IsExistingMatchingCard(c80402389.filter,tp,LOCATION_DECK,0,1,nil,ev) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c80402389.operation(e,tp,eg,ep,ev,re,r,rp) function c80402389.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c80402389.filter,tp,LOCATION_DECK,0,1,1,nil,ev) local g=Duel.SelectMatchingCard(tp,c80402389.filter,tp,LOCATION_DECK,0,1,1,nil,ev)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -19,12 +19,14 @@ function c94585852.initial_effect(c) ...@@ -19,12 +19,14 @@ function c94585852.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_FZONE) e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c94585852.regop) e3:SetOperation(c94585852.regop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(94585852,0)) e4:SetDescription(aux.Stringid(94585852,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_DAMAGE_STEP) e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CUSTOM+94585852) e4:SetCode(EVENT_CUSTOM+94585852)
e4:SetTarget(c94585852.target) e4:SetTarget(c94585852.target)
...@@ -41,31 +43,32 @@ end ...@@ -41,31 +43,32 @@ end
function c94585852.regop(e,tp,eg,ep,ev,re,r,rp) function c94585852.regop(e,tp,eg,ep,ev,re,r,rp)
local lv1=0 local lv1=0
local lv2=0 local lv2=0
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local tc=eg:GetFirst() local tc=eg:GetFirst()
while tc do while tc do
if tc:IsReason(REASON_DESTROY) and not tc:IsReason(REASON_BATTLE) and tc:IsSetCard(0x45) then if tc:IsReason(REASON_DESTROY) and not tc:IsReason(REASON_BATTLE) and tc:IsSetCard(0x45) and tc:GetLevel()>0 then
local tlv=tc:GetLevel() if tc:IsControler(tp) then
if tc:IsControler(0) then
if tlv>lv1 then lv1=tlv end if tlv>lv1 then lv1=tlv end
g1:AddCard(tc)
else else
if tlv>lv2 then lv2=tlv end if tlv>lv2 then lv2=tlv end
g2:AddCard(tc)
end end
end end
tc=eg:GetNext() tc=eg:GetNext()
end end
if lv1>0 then Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+94585852,e,0,0,0,lv1) end if g1:GetCount()>0 then Duel.RaiseEvent(g1,EVENT_CUSTOM+94585852,re,r,rp,tp,lv1) end
if lv2>0 then Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+94585852,e,0,1,1,lv2) end if g2:GetCount()>0 then Duel.RaiseEvent(g2,EVENT_CUSTOM+94585852,re,r,rp,1-tp,lv2) end
end end
function c94585852.filter(c,lv) function c94585852.filter(c,lv)
return c:GetLevel()<lv and c:IsSetCard(0x45) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:GetLevel()<lv and c:IsSetCard(0x45) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c94585852.target(e,tp,eg,ep,ev,re,r,rp,chk) function c94585852.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) if chk==0 then return Duel.IsExistingMatchingCard(c94585852.filter,tp,LOCATION_DECK,0,1,nil,ev) end
and Duel.IsExistingMatchingCard(c94585852.filter,tp,LOCATION_DECK,0,1,nil,ev) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c94585852.operation(e,tp,eg,ep,ev,re,r,rp) function c94585852.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c94585852.filter,tp,LOCATION_DECK,0,1,1,nil,ev) local g=Duel.SelectMatchingCard(tp,c94585852.filter,tp,LOCATION_DECK,0,1,1,nil,ev)
if g:GetCount()>0 then if g:GetCount()>0 then
......
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