Commit 0dce7ac0 authored by VanillaSalt's avatar VanillaSalt

fix

parent ce44ebc4
...@@ -2460,7 +2460,7 @@ int32 card::is_can_be_fusion_material(uint8 ignore_mon) { ...@@ -2460,7 +2460,7 @@ int32 card::is_can_be_fusion_material(uint8 ignore_mon) {
int32 card::is_can_be_synchro_material(card* scard, card* tuner) { int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
if(data.type & TYPE_XYZ) if(data.type & TYPE_XYZ)
return FALSE; return FALSE;
if(!(get_type()&TYPE_MONSTER)) if(!(get_type() & TYPE_MONSTER))
return FALSE; return FALSE;
if(scard && current.controler != scard->current.controler && !is_affected_by_effect(EFFECT_SYNCHRO_MATERIAL)) if(scard && current.controler != scard->current.controler && !is_affected_by_effect(EFFECT_SYNCHRO_MATERIAL))
return FALSE; return FALSE;
...@@ -2478,10 +2478,25 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) { ...@@ -2478,10 +2478,25 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
int32 card::is_can_be_ritual_material(card* scard) {
if(data.type & TYPE_TOKEN)
return FALSE;
if(!(get_type() & TYPE_MONSTER))
return FALSE;
if(current.location == LOCATION_GRAVE) {
effect_set eset;
filter_effect(EFFECT_EXTRA_RITUAL_MATERIAL, &eset);
for(int32 i = 0; i < eset.size(); ++i)
if(eset[i]->get_value(scard))
return TRUE;
return FALSE;
}
return TRUE;
}
int32 card::is_can_be_xyz_material(card* scard) { int32 card::is_can_be_xyz_material(card* scard) {
if(data.type & TYPE_TOKEN) if(data.type & TYPE_TOKEN)
return FALSE; return FALSE;
if(!(get_type()&TYPE_MONSTER)) if(!(get_type() & TYPE_MONSTER))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN)) if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE; return FALSE;
......
...@@ -253,6 +253,7 @@ public: ...@@ -253,6 +253,7 @@ public:
int32 is_capable_be_effect_target(effect* peffect, uint8 playerid); int32 is_capable_be_effect_target(effect* peffect, uint8 playerid);
int32 is_can_be_fusion_material(uint8 ignore_mon = FALSE); int32 is_can_be_fusion_material(uint8 ignore_mon = FALSE);
int32 is_can_be_synchro_material(card* scard, card* tuner = 0); int32 is_can_be_synchro_material(card* scard, card* tuner = 0);
int32 is_can_be_ritual_material(card* scard);
int32 is_can_be_xyz_material(card* scard); int32 is_can_be_xyz_material(card* scard);
}; };
......
...@@ -193,6 +193,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -193,6 +193,7 @@ static const struct luaL_Reg cardlib[] = {
{ "IsCanRemoveCounter", scriptlib::card_is_can_remove_counter }, { "IsCanRemoveCounter", scriptlib::card_is_can_remove_counter },
{ "IsCanBeFusionMaterial", scriptlib::card_is_can_be_fusion_material }, { "IsCanBeFusionMaterial", scriptlib::card_is_can_be_fusion_material },
{ "IsCanBeSynchroMaterial", scriptlib::card_is_can_be_synchro_material }, { "IsCanBeSynchroMaterial", scriptlib::card_is_can_be_synchro_material },
{ "IsCanBeRitualMaterial", scriptlib::card_is_can_be_ritual_material },
{ "IsCanBeXyzMaterial", scriptlib::card_is_can_be_xyz_material }, { "IsCanBeXyzMaterial", scriptlib::card_is_can_be_xyz_material },
{ "CheckFusionMaterial", scriptlib::card_check_fusion_material }, { "CheckFusionMaterial", scriptlib::card_check_fusion_material },
{ "IsImmuneToEffect", scriptlib::card_is_immune_to_effect }, { "IsImmuneToEffect", scriptlib::card_is_immune_to_effect },
......
...@@ -1820,6 +1820,18 @@ int32 scriptlib::card_is_can_be_synchro_material(lua_State *L) { ...@@ -1820,6 +1820,18 @@ int32 scriptlib::card_is_can_be_synchro_material(lua_State *L) {
lua_pushboolean(L, pcard->is_can_be_synchro_material(scard, tuner)); lua_pushboolean(L, pcard->is_can_be_synchro_material(scard, tuner));
return 1; return 1;
} }
int32 scriptlib::card_is_can_be_ritual_material(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
card* scard = 0;
if(lua_gettop(L) >= 2 && !lua_isnil(L, 2)) {
check_param(L, PARAM_TYPE_CARD, 2);
scard = *(card**) lua_touserdata(L, 2);
}
lua_pushboolean(L, pcard->is_can_be_ritual_material(scard));
return 1;
}
int32 scriptlib::card_is_can_be_xyz_material(lua_State *L) { int32 scriptlib::card_is_can_be_xyz_material(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -195,6 +195,7 @@ public: ...@@ -195,6 +195,7 @@ public:
static int32 card_is_can_remove_counter(lua_State *L); static int32 card_is_can_remove_counter(lua_State *L);
static int32 card_is_can_be_fusion_material(lua_State *L); static int32 card_is_can_be_fusion_material(lua_State *L);
static int32 card_is_can_be_synchro_material(lua_State *L); static int32 card_is_can_be_synchro_material(lua_State *L);
static int32 card_is_can_be_ritual_material(lua_State *L);
static int32 card_is_can_be_xyz_material(lua_State *L); static int32 card_is_can_be_xyz_material(lua_State *L);
static int32 card_check_fusion_material(lua_State *L); static int32 card_check_fusion_material(lua_State *L);
static int32 card_is_immune_to_effect(lua_State *L); static int32 card_is_immune_to_effect(lua_State *L);
......
...@@ -20,16 +20,14 @@ function c14735698.initial_effect(c) ...@@ -20,16 +20,14 @@ function c14735698.initial_effect(c)
e2:SetOperation(c14735698.thop) e2:SetOperation(c14735698.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c14735698.filter(c,e,tp,m) function c14735698.filter(c,e,tp,m1,m2)
if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81 if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) 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=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
local mg=nil mg:Merge(m2)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg) end
if c.mat_filter then if c.mat_filter then
mg=m:Filter(c.mat_filter,c) mg=mg:Filter(c.mat_filter,nil)
else
mg=m:Clone()
mg:RemoveCard(c)
end end
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end end
...@@ -40,30 +38,29 @@ function c14735698.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,30 +38,29 @@ function c14735698.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c14735698.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c14735698.mfilter,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2) return Duel.IsExistingMatchingCard(c14735698.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2)
return Duel.IsExistingMatchingCard(c14735698.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c14735698.activate(e,tp,eg,ep,ev,re,r,rp) function c14735698.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c14735698.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c14735698.mfilter,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c14735698.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1) local tg=Duel.SelectMatchingCard(tp,c14735698.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2)
if tc:IsCode(21105106) then if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg1) tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
else else
mg1:RemoveCard(tc)
if tc.mat_filter then if tc.mat_filter then
mg1=mg1:Filter(tc.mat_filter,nil) mg=mg:Filter(tc.mat_filter,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg1:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
......
...@@ -22,16 +22,9 @@ function c27383110.initial_effect(c) ...@@ -22,16 +22,9 @@ function c27383110.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c27383110.filter(c,e,tp,m) function c27383110.filter(c,e,tp,m)
local cd=c:GetCode() if not c:IsCode(44665365) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if cd~=44665365 or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if m:IsContains(c) then return mg:CheckWithSumEqual(Card.GetRitualLevel,6,1,99,c)
m:RemoveCard(c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,6,1,99,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,6,1,99,c)
end
return result
end end
function c27383110.target(e,tp,eg,ep,ev,re,r,rp,chk) function c27383110.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -44,9 +37,9 @@ function c27383110.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,9 +37,9 @@ function c27383110.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c27383110.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,c27383110.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg:RemoveCard(tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,6,1,99,tc) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,6,1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
......
...@@ -20,46 +20,37 @@ function c28429121.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -20,46 +20,37 @@ function c28429121.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c28429121.mfilter1(c,e) function c28429121.mfilter(c,e)
return c:IsFaceup() and c:GetLevel()>0 and not c:IsImmuneToEffect(e) and c:IsReleasable() return c:IsFaceup() and c:GetLevel()>0 and not c:IsImmuneToEffect(e) and c:IsReleasable()
end end
function c28429121.mfilter2(c)
return c:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL) and c:IsAbleToRemove()
end
function c28429121.get_material(e,tp)
local g1=Duel.GetMatchingGroup(c28429121.mfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
local g2=Duel.GetMatchingGroup(c28429121.mfilter2,tp,LOCATION_GRAVE,0,nil)
g1:Merge(g2)
return g1
end
function c28429121.filter(c,e,tp,m) function c28429121.filter(c,e,tp,m)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsSetCard(0x3a) if bit.band(c:GetType(),0x81)~=0x81 or not c:IsSetCard(0x3a)
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 m:IsContains(c) then local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
m:RemoveCard(c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end
return result
end end
function c28429121.target(e,tp,eg,ep,ev,re,r,rp,chk) function c28429121.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local mg=c28429121.get_material(e,tp) local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(c28429121.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg) mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
local mg2=Duel.GetMatchingGroup(c28429121.mfilter,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
return Duel.IsExistingMatchingCard(c28429121.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c28429121.activate(e,tp,eg,ep,ev,re,r,rp) function c28429121.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=c28429121.get_material(e,tp) local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
local mg2=Duel.GetMatchingGroup(c28429121.mfilter,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c28429121.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,c28429121.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg:RemoveCard(tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
...@@ -71,7 +62,7 @@ function c28429121.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,7 +62,7 @@ function c28429121.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(tc:GetAttack()/2) e1:SetValue(tc:GetAttack()/2)
e1:SetReset(RESET_EVENT+0xfe0000) e1:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
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() tc:CompleteProcedure()
end end
end end
...@@ -23,12 +23,8 @@ function c29904964.initial_effect(c) ...@@ -23,12 +23,8 @@ function c29904964.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e3:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e3:SetValue(c29904964.mtval)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_RITUAL_LEVEL)
e4:SetValue(c29904964.rlevel)
c:RegisterEffect(e4)
end end
function c29904964.ntcon(e,c,minc) function c29904964.ntcon(e,c,minc)
if c==nil then return true end if c==nil then return true end
...@@ -51,9 +47,6 @@ function c29904964.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,9 +47,6 @@ function c29904964.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c29904964.rlevel(e,rc) function c29904964.mtval(e,c)
local c=e:GetHandler() return c:IsSetCard(0xcf)
if c:IsLocation(LOCATION_GRAVE) and not rc:IsSetCard(0xcf) then
return -1
else return c:GetLevel() end
end end
...@@ -4,6 +4,7 @@ function c30492798.initial_effect(c) ...@@ -4,6 +4,7 @@ function c30492798.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--become material --become material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -4,6 +4,7 @@ function c33145233.initial_effect(c) ...@@ -4,6 +4,7 @@ function c33145233.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--become material --become material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -14,6 +14,7 @@ function c33245030.initial_effect(c) ...@@ -14,6 +14,7 @@ function c33245030.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e2:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c33245030.condition(e,tp,eg,ep,ev,re,r,rp) function c33245030.condition(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -4,6 +4,7 @@ function c34358408.initial_effect(c) ...@@ -4,6 +4,7 @@ function c34358408.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--become material --become material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -4,6 +4,7 @@ function c4141820.initial_effect(c) ...@@ -4,6 +4,7 @@ function c4141820.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--become material --become material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -9,16 +9,11 @@ function c45410988.initial_effect(c) ...@@ -9,16 +9,11 @@ function c45410988.initial_effect(c)
e1:SetOperation(c45410988.activate) e1:SetOperation(c45410988.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c45410988.filter(c,e,tp,m) function c45410988.filter(c,e,tp,m1,m2)
if not c:IsCode(19025379) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if not c:IsCode(19025379) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if m:IsContains(c) then local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
m:RemoveCard(c) mg:Merge(m2)
result=m:CheckWithSumGreater(Card.GetRitualLevel,8,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,8,1,99,c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,8,c)
end
return result
end end
function c45410988.mfilter(c) function c45410988.mfilter(c)
return c:IsSetCard(0x3b) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() return c:IsSetCard(0x3b) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
...@@ -27,22 +22,21 @@ function c45410988.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -27,22 +22,21 @@ function c45410988.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c45410988.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c45410988.mfilter,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2) return Duel.IsExistingMatchingCard(c45410988.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2)
return Duel.IsExistingMatchingCard(c45410988.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c45410988.activate(e,tp,eg,ep,ev,re,r,rp) function c45410988.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c45410988.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c45410988.mfilter,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c45410988.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1) local g=Duel.SelectMatchingCard(tp,c45410988.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
mg1:RemoveCard(tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg1:SelectWithSumGreater(tp,Card.GetRitualLevel,8,tc) local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,8,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -23,6 +23,7 @@ end ...@@ -23,6 +23,7 @@ end
function c51124303.spfilter(c,e,tp,mc) function c51124303.spfilter(c,e,tp,mc)
return c:IsSetCard(0xb4) and bit.band(c:GetType(),0x81)==0x81 and (not c.mat_filter or c.mat_filter(mc)) return c:IsSetCard(0xb4) and bit.band(c:GetType(),0x81)==0x81 and (not c.mat_filter or c.mat_filter(mc))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and mc:IsCanBeRitualMaterial(c)
end end
function c51124303.rfilter(c,mc) function c51124303.rfilter(c,mc)
local mlv=mc:GetRitualLevel(c) local mlv=mc:GetRitualLevel(c)
...@@ -39,6 +40,9 @@ end ...@@ -39,6 +40,9 @@ end
function c51124303.mfilter(c) function c51124303.mfilter(c)
return c:GetLevel()>0 and c:IsAbleToGrave() return c:GetLevel()>0 and c:IsAbleToGrave()
end end
function c51124303.mzfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c51124303.target(e,tp,eg,ep,ev,re,r,rp,chk) function c51124303.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
...@@ -48,7 +52,7 @@ function c51124303.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -48,7 +52,7 @@ function c51124303.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg2=Duel.GetMatchingGroup(c51124303.mfilter,tp,LOCATION_EXTRA,0,nil) local mg2=Duel.GetMatchingGroup(c51124303.mfilter,tp,LOCATION_EXTRA,0,nil)
mg:Merge(mg2) mg:Merge(mg2)
else else
mg=mg:Filter(Card.IsLocation,nil,LOCATION_MZONE) mg=mg:Filter(c51124303.mzfilter,nil,tp)
end end
return mg:IsExists(c51124303.filter,1,nil,e,tp) return mg:IsExists(c51124303.filter,1,nil,e,tp)
end end
......
...@@ -4,6 +4,7 @@ function c77153811.initial_effect(c) ...@@ -4,6 +4,7 @@ function c77153811.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--become material --become material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -10,16 +10,9 @@ function c79306385.initial_effect(c) ...@@ -10,16 +10,9 @@ function c79306385.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c79306385.filter(c,e,tp,m) function c79306385.filter(c,e,tp,m)
local cd=c:GetCode() if not c:IsCode(48546368) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if cd~=48546368 or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if m:IsContains(c) then return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
m:RemoveCard(c)
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
return result
end end
function c79306385.target(e,tp,eg,ep,ev,re,r,rp,chk) function c79306385.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -36,15 +29,15 @@ function c79306385.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,15 +29,15 @@ function c79306385.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c79306385.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,c79306385.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg:RemoveCard(tc) mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc) local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() 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() tc:CompleteProcedure()
end end
end end
...@@ -39,14 +39,11 @@ function c84388461.splimcon(e) ...@@ -39,14 +39,11 @@ function c84388461.splimcon(e)
end end
function c84388461.filter(c,e,tp,m) function c84388461.filter(c,e,tp,m)
if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81 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=m:Filter(Card.IsCanBeRitualMaterial,c,c)
local mg=nil if c:IsCode(21105106) then return c:ritual_custom_condition(mg) end
if c.mat_filter then if c.mat_filter then
mg=m:Filter(c.mat_filter,c) mg=mg:Filter(c.mat_filter,nil)
else
mg=m:Clone()
mg:RemoveCard(c)
end end
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end end
...@@ -66,14 +63,14 @@ function c84388461.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,14 +63,14 @@ function c84388461.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c84388461.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,c84388461.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc:IsCode(21105106) then if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg) tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
else else
mg:RemoveCard(tc)
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,nil) mg=mg:Filter(tc.mat_filter,nil)
end end
...@@ -83,7 +80,7 @@ function c84388461.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +80,7 @@ function c84388461.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
Duel.BreakEffect() 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() tc:CompleteProcedure()
end end
end end
...@@ -4,6 +4,7 @@ function c8903700.initial_effect(c) ...@@ -4,6 +4,7 @@ function c8903700.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--become material --become material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -23,40 +23,37 @@ end ...@@ -23,40 +23,37 @@ end
function c97211663.filter(c,e,tp,m) function c97211663.filter(c,e,tp,m)
if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81 if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) or c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) or c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
if c:IsCode(21105106) then return c:ritual_custom_condition(m) end local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
local mg=nil if c:IsCode(21105106) then return c:ritual_custom_condition(mg) end
if c.mat_filter then if c.mat_filter then
mg=m:Filter(c.mat_filter,c) mg=m:Filter(c.mat_filter,c)
else
mg=m:Clone()
mg:RemoveCard(c)
end end
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end end
function c97211663.target(e,tp,eg,ep,ev,re,r,rp,chk) function c97211663.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(c97211663.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg1) return Duel.IsExistingMatchingCard(c97211663.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c97211663.activate(e,tp,eg,ep,ev,re,r,rp) function c97211663.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c97211663.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg1) local tg=Duel.SelectMatchingCard(tp,c97211663.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc:IsCode(21105106) then if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg1) tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
else else
mg1:RemoveCard(tc)
if tc.mat_filter then if tc.mat_filter then
mg1=mg1:Filter(tc.mat_filter,nil) mg=mg:Filter(tc.mat_filter,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg1:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
......
...@@ -112,7 +112,7 @@ function Auxiliary.NonTuner(f,a,b,c) ...@@ -112,7 +112,7 @@ function Auxiliary.NonTuner(f,a,b,c)
return target:IsNotTuner() and (not f or f(target,a,b,c)) return target:IsNotTuner() and (not f or f(target,a,b,c))
end end
end end
--Synchron monster, 1 tuner + n or more monsters --Synchro monster, 1 tuner + n or more monsters
function Auxiliary.AddSynchroProcedure(c,f1,f2,ct) function Auxiliary.AddSynchroProcedure(c,f1,f2,ct)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -154,7 +154,7 @@ function Auxiliary.SynOperation(f1,f2,minct,maxc) ...@@ -154,7 +154,7 @@ function Auxiliary.SynOperation(f1,f2,minct,maxc)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
end end
end end
--Synchron monster, 1 tuner + 1 monster --Synchro monster, 1 tuner + 1 monster
function Auxiliary.AddSynchroProcedure2(c,f1,f2) function Auxiliary.AddSynchroProcedure2(c,f1,f2)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -917,15 +917,8 @@ function Auxiliary.AddRitualProcGreater(c,filter) ...@@ -917,15 +917,8 @@ function Auxiliary.AddRitualProcGreater(c,filter)
end end
function Auxiliary.RPGFilter(c,filter,e,tp,m) function Auxiliary.RPGFilter(c,filter,e,tp,m)
if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local result=false local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if m:IsContains(c) then return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetOriginalLevel(),c)
m:RemoveCard(c)
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetOriginalLevel(),c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetOriginalLevel(),c)
end
return result
end end
function Auxiliary.RPGTarget(filter) function Auxiliary.RPGTarget(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -941,9 +934,9 @@ function Auxiliary.RPGOperation(filter) ...@@ -941,9 +934,9 @@ function Auxiliary.RPGOperation(filter)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPGFilter,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPGFilter,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg:RemoveCard(tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),tc) local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
...@@ -966,15 +959,8 @@ function Auxiliary.AddRitualProcEqual(c,filter) ...@@ -966,15 +959,8 @@ function Auxiliary.AddRitualProcEqual(c,filter)
end end
function Auxiliary.RPEFilter(c,filter,e,tp,m) function Auxiliary.RPEFilter(c,filter,e,tp,m)
if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local result=false local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if m:IsContains(c) then return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetOriginalLevel(),1,99,c)
m:RemoveCard(c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetOriginalLevel(),1,99,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetOriginalLevel(),1,99,c)
end
return result
end end
function Auxiliary.RPETarget(filter) function Auxiliary.RPETarget(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -990,9 +976,9 @@ function Auxiliary.RPEOperation(filter) ...@@ -990,9 +976,9 @@ function Auxiliary.RPEOperation(filter)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPEFilter,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPEFilter,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg:RemoveCard(tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),1,99,tc) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
...@@ -1015,15 +1001,8 @@ function Auxiliary.AddRitualProcEqual2(c,filter) ...@@ -1015,15 +1001,8 @@ function Auxiliary.AddRitualProcEqual2(c,filter)
end end
function Auxiliary.RPEFilter2(c,filter,e,tp,m) function Auxiliary.RPEFilter2(c,filter,e,tp,m)
if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local result=false local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if m:IsContains(c) then return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
m:RemoveCard(c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end
return result
end end
function Auxiliary.RPETarget2(filter) function Auxiliary.RPETarget2(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -1039,9 +1018,9 @@ function Auxiliary.RPEOperation2(filter) ...@@ -1039,9 +1018,9 @@ function Auxiliary.RPEOperation2(filter)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPEFilter2,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPEFilter2,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg)
if tg:GetCount()>0 then local tc=tg:GetFirst()
local tc=tg:GetFirst() if tc then
mg:RemoveCard(tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
......
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