Commit 58e6b9a2 authored by salix5's avatar salix5

card::is_can_be_xyz_material

Now xyz monster can be xyz material by default.
parent 4238ca55
......@@ -2404,11 +2404,9 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
return FALSE;
return TRUE;
}
int32 card::is_can_be_xyz_material(card* scard, uint8 ignore_xyz) {
int32 card::is_can_be_xyz_material(card* scard) {
if(data.type & TYPE_TOKEN)
return FALSE;
if(!ignore_xyz && (data.type & TYPE_XYZ))
return FALSE;
if(!(get_type()&TYPE_MONSTER))
return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
......
......@@ -250,7 +250,7 @@ public:
int32 is_capable_be_effect_target(effect* peffect, uint8 playerid);
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_xyz_material(card* scard, uint8 ignore_xyz = FALSE);
int32 is_can_be_xyz_material(card* scard);
};
//Locations
......
......@@ -1799,10 +1799,7 @@ int32 scriptlib::card_is_can_be_xyz_material(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 2);
scard = *(card**) lua_touserdata(L, 2);
}
uint32 ign = FALSE;
if(lua_gettop(L) >= 3)
ign = lua_toboolean(L, 3);
lua_pushboolean(L, pcard->is_can_be_xyz_material(scard, ign));
lua_pushboolean(L, pcard->is_can_be_xyz_material(scard));
return 1;
}
int32 scriptlib::card_check_fusion_material(lua_State *L) {
......
......@@ -40,7 +40,7 @@ function c18326736.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterFlagEffect(18326736,RESET_CHAIN,0,1)
end
function c18326736.filter(c,e,tp,rk)
return c:GetRank()==rk+1 and not c:IsSetCard(0x48) and e:GetHandler():IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk+1 and not c:IsSetCard(0x48) and e:GetHandler():IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c18326736.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -15,7 +15,7 @@ function c33252803.filter1(c,e,tp)
and Duel.IsExistingMatchingCard(c33252803.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1,c.xyz_number)
end
function c33252803.filter2(c,e,tp,mc,rk,no)
return c:GetRank()==rk and c:IsSetCard(0x1048) and c.xyz_number==no and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and c:IsSetCard(0x1048) and c.xyz_number==no and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c33252803.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -21,7 +21,7 @@ function c43476205.filter2(c,e,tp)
and Duel.IsExistingMatchingCard(c43476205.filter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1)
end
function c43476205.filter3(c,e,tp,mc,rk)
return c:GetRank()==rk and c:IsSetCard(0xba) and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and c:IsSetCard(0xba) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c43476205.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -33,7 +33,7 @@ function c45950291.filter1(c,e,tp)
end
function c45950291.filter2(c,e,tp,mc,rk,rc,att,code)
if c:GetOriginalCode()==6165656 and code~=48995978 then return false end
return c:GetRank()==rk and c:IsRace(rc) and c:IsAttribute(att) and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and c:IsRace(rc) and c:IsAttribute(att) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c45950291.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -17,7 +17,7 @@ function c47660516.filter1(c,e,tp)
end
function c47660516.filter2(c,e,tp,mc,rk,rc,code)
if c:GetOriginalCode()==6165656 and code~=48995978 then return false end
return c:GetRank()==rk and c:IsRace(rc) and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073)) and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and c:IsRace(rc) and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073)) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c47660516.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -17,7 +17,7 @@ function c48333324.filter1(c,e,tp)
end
function c48333324.filter2(c,e,tp,mc,rk,rc,code)
if c:GetOriginalCode()==6165656 and code~=48995978 then return false end
return c:GetRank()==rk and c:IsRace(rc) and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and c:IsRace(rc) and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c48333324.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -36,7 +36,7 @@ end
c57707471.xyz_number=21
c57707471.xyz_count=2
function c57707471.ovfilter(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetRank()==5 and c:IsCanBeXyzMaterial(xyzc,true)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetRank()==5 and c:IsCanBeXyzMaterial(xyzc)
and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
function c57707471.xyzcon(e,c,og)
......
......@@ -42,7 +42,7 @@ function c57734012.filter1(c,e,tp)
and Duel.IsExistingMatchingCard(c57734012.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,no)
end
function c57734012.filter2(c,e,tp,mc,no)
return c.xyz_number==no and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c,true)
return c.xyz_number==no and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c57734012.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -17,7 +17,7 @@ function c92365601.filter1(c,e,tp)
end
function c92365601.filter2(c,e,tp,mc,rk)
if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end
return c:GetRank()==rk and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c92365601.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -29,7 +29,7 @@ function c94220427.filter1(c,e,tp)
end
function c94220427.filter2(c,e,tp,mc,rk,code)
if c:GetOriginalCode()==6165656 and code~=48995978 then return false end
return c:GetRank()==rk and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073)) and mc:IsCanBeXyzMaterial(c,true)
return c:GetRank()==rk and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073)) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c94220427.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -162,7 +162,7 @@ function Auxiliary.AddSynchroProcedure2(c,f1,f2)
c:RegisterEffect(e1)
end
function Auxiliary.XyzAlterFilter(c,alterf,xyzc)
return alterf(c) and c:IsCanBeXyzMaterial(xyzc,true)
return alterf(c) and c:IsCanBeXyzMaterial(xyzc)
end
function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,desc,maxct,op)
if c.xyz_filter==nil 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