Commit dac9363e authored by wind2009's avatar wind2009

Fix

parent 3e1216be
Pipeline #37816 passed with stages
in 3 minutes and 55 seconds
......@@ -10,41 +10,41 @@ function s.initial_effect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(aux.ritlimit)
c:RegisterEffect(e0)
--immune
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.ritcon)
e1:SetValue(s.efilter)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.pztg)
e1:SetOperation(s.pzop)
c:RegisterEffect(e1)
--ritual level
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_RITUAL_LEVEL)
e2:SetValue(s.rlevel)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e2:SetCondition(s.ritcon)
e2:SetValue(s.efilter)
c:RegisterEffect(e2)
--search
--ritual level
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_RELEASE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_RITUAL_LEVEL)
e3:SetValue(s.rlevel)
c:RegisterEffect(e3)
--spsummon
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_PZONE)
e4:SetCountLimit(1)
e4:SetTarget(s.pztg)
e4:SetOperation(s.pzop)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,id)
e4:SetCondition(s.thcon)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
end
......@@ -53,10 +53,12 @@ function s.ritcon(e)
return c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function s.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActivated()
end
function s.rlevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
local ec=e:GetHandler()
local lv=aux.GetCappedLevel(ec)
if not ec:IsLocation(LOCATION_MZONE) then return lv end
local clv=c:GetLevel()
return (lv<<16)+clv
end
......@@ -97,7 +99,7 @@ function s.pzop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,1,"Greater")
mat=mg:SelectSubGroup(tp,Auxiliary.RitualCheck,true,1,1,tp,c,1,"Greater")
local mat=mg:SelectSubGroup(tp,Auxiliary.RitualCheck,true,1,1,tp,c,1,"Greater")
Auxiliary.GCheckAdditional=nil
if mat:GetCount()>0 then
c:SetMaterial(mat)
......
......@@ -46,13 +46,14 @@ end
function s.thfilter(c,race,att)
return c:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER) and c:IsAbleToHand() and c:GetRace()~=race and c:GetAttribute()~=att
end
function s.costfilter(c)
return c:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetRace(),c:GetAttribute())
function s.costfilter(c,tp)
return c:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER) and not c:IsPublic()
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetRace(),c:GetAttribute())
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil,tp):GetFirst()
e:SetLabel(tc:GetRace(),tc:GetAttribute())
Duel.ConfirmCards(1-tp,tc)
end
......@@ -69,11 +70,11 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function s.cthfilter(c)
function s.cthfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function s.cthcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cthfilter,1,nil) and not Duel.IsDamageCalculated()
return eg:IsExists(s.cthfilter,1,nil,tp)
end
function s.cthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
......@@ -84,7 +85,7 @@ function s.cthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.cthop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsRelateToChain() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--READ YING OF RITE
--Readying of Rites
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
......@@ -39,8 +39,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if tc:IsType(TYPE_PENDULUM) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,101301186,0,TYPES_TOKEN_MONSTER,300,300,4,RACE_FIEND,ATTRIBUTE_DARK) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local token=Duel.CreateToken(tp,101301186)
if tc:IsType(TYPE_PENDULUM) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0,TYPES_TOKEN_MONSTER,300,300,1,RACE_FIEND,ATTRIBUTE_DARK)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local token=Duel.CreateToken(tp,id+o)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -49,7 +51,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CONTROL)
token:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
......@@ -60,7 +62,7 @@ function s.splimit(e,c)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
return ep~=tp and ec:GetControler()==tp and ec:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER)
return ep~=tp and ec:IsControler(tp) and ec:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
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