Skip to content

Commit

Permalink
"Ritual Foregone" cannot special summon ritual monsters with spsummon…
Browse files Browse the repository at this point in the history
… condition
  • Loading branch information
Fluorohydride committed Mar 25, 2015
1 parent 3a7260b commit 16a07fe
Show file tree
Hide file tree
Showing 18 changed files with 1,054 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion ocgcore/card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ int32 card::is_can_be_special_summoned(effect * reason_effect, uint32 sumtype, u
if(current.location == LOCATION_REMOVED && (current.position & POS_FACEDOWN))
return FALSE;
if(is_status(STATUS_REVIVE_LIMIT) && !is_status(STATUS_PROC_COMPLETE)) {
if((!nolimit && (current.location & 0x38)) || (!nocheck && (current.location & 0x3)))
if((!nolimit && (current.location & 0x38)) || (!nocheck && !nolimit && (current.location & 0x3)))
return FALSE;
}
if(((sumpos & POS_FACEDOWN) == 0) && pduel->game_field->check_unique_onfield(this, toplayer))
Expand Down
4 changes: 2 additions & 2 deletions script/c14735698.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function c14735698.initial_effect(c)
end
function c14735698.filter(c,e,tp,m)
if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if c:IsCode(21105106) then return c:ritual_custom_condition(m) end
local mg=nil
if c.mat_filter then
Expand Down Expand Up @@ -68,7 +68,7 @@ function c14735698.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ReleaseRitualMaterial(mat)
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
Expand Down
4 changes: 4 additions & 0 deletions script/c21105106.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function c21105106.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c21105106.splimit)
c:RegisterEffect(e1)
--cannot spsummon
local e2=Effect.CreateEffect(c)
Expand All @@ -27,6 +28,9 @@ function c21105106.initial_effect(c)
e3:SetOperation(c21105106.rmop)
c:RegisterEffect(e3)
end
function c21105106.splimit(e,se,sp,st)
return e:GetHandler():IsLocation(LOCATION_HAND) and bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c21105106.mat_filter(c)
return false
end
Expand Down
150 changes: 77 additions & 73 deletions script/c25857246.lua
Original file line number Diff line number Diff line change
@@ -1,73 +1,77 @@
--ヴァルキュルスの影霊衣
function c25857246.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25857246,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,25857246)
e2:SetCondition(c25857246.atkcon)
e2:SetCost(c25857246.atkcost)
e2:SetOperation(c25857246.atkop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25857246,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,25857247)
e3:SetTarget(c25857246.target)
e3:SetOperation(c25857246.operation)
c:RegisterEffect(e3)
end
function c25857246.mat_filter(c)
return c:GetLevel()~=8
end
function c25857246.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c25857246.cfilter(c)
return c:IsSetCard(0xb4) and c:IsAbleToRemoveAsCost()
end
function c25857246.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c25857246.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c25857246.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c25857246.atkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
end
function c25857246.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function c25857246.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.CheckReleaseGroupEx(tp,c25857246.filter,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c25857246.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(tp) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then ct=1 end
if ct>2 then ct=2 end
local g=Duel.SelectReleaseGroupEx(tp,c25857246.filter,1,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local rct=Duel.Release(g,REASON_EFFECT)
Duel.Draw(tp,rct,REASON_EFFECT)
end
end
--ヴァルキュルスの影霊衣
function c25857246.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c25857246.splimit)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25857246,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,25857246)
e2:SetCondition(c25857246.atkcon)
e2:SetCost(c25857246.atkcost)
e2:SetOperation(c25857246.atkop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25857246,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,25857247)
e3:SetTarget(c25857246.target)
e3:SetOperation(c25857246.operation)
c:RegisterEffect(e3)
end
function c25857246.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c25857246.mat_filter(c)
return c:GetLevel()~=8
end
function c25857246.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c25857246.cfilter(c)
return c:IsSetCard(0xb4) and c:IsAbleToRemoveAsCost()
end
function c25857246.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c25857246.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c25857246.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c25857246.atkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
end
function c25857246.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function c25857246.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.CheckReleaseGroupEx(tp,c25857246.filter,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c25857246.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(tp) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then ct=1 end
if ct>2 then ct=2 end
local g=Duel.SelectReleaseGroupEx(tp,c25857246.filter,1,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local rct=Duel.Release(g,REASON_EFFECT)
Duel.Draw(tp,rct,REASON_EFFECT)
end
end
144 changes: 74 additions & 70 deletions script/c26674724.lua
Original file line number Diff line number Diff line change
@@ -1,70 +1,74 @@
--ブリューナクの影霊衣
function c26674724.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(26674724,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,26674724)
e2:SetCost(c26674724.thcost)
e2:SetTarget(c26674724.thtg)
e2:SetOperation(c26674724.thop)
c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26674724,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,26674725)
e3:SetTarget(c26674724.tdtg)
e3:SetOperation(c26674724.tdop)
c:RegisterEffect(e3)
end
function c26674724.mat_filter(c)
return not c:IsCode(26674724)
end
function c26674724.thcost(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 c26674724.thfilter(c)
return c:IsSetCard(0xb4) and not c:IsCode(26674724) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c26674724.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26674724.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c26674724.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c26674724.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c26674724.tdfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToDeck()
end
function c26674724.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c26674724.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26674724.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c26674724.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c26674724.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
--ブリューナクの影霊衣
function c26674724.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c26674724.splimit)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(26674724,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,26674724)
e2:SetCost(c26674724.thcost)
e2:SetTarget(c26674724.thtg)
e2:SetOperation(c26674724.thop)
c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26674724,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,26674725)
e3:SetTarget(c26674724.tdtg)
e3:SetOperation(c26674724.tdop)
c:RegisterEffect(e3)
end
function c26674724.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c26674724.mat_filter(c)
return not c:IsCode(26674724)
end
function c26674724.thcost(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 c26674724.thfilter(c)
return c:IsSetCard(0xb4) and not c:IsCode(26674724) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c26674724.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26674724.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c26674724.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c26674724.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c26674724.tdfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToDeck()
end
function c26674724.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c26674724.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26674724.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c26674724.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c26674724.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
Loading

0 comments on commit 16a07fe

Please sign in to comment.