Commit e4e40003 authored by argon.sun's avatar argon.sun

fix

parent e7e5c0bb
......@@ -2009,7 +2009,7 @@ int32 card::is_can_be_fusion_material() {
return FALSE;
return TRUE;
}
int32 card::is_can_be_synchro_material(card* scard) {
int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
if(data.type & TYPE_XYZ)
return FALSE;
if(!(get_type()&TYPE_MONSTER))
......@@ -2018,6 +2018,11 @@ int32 card::is_can_be_synchro_material(card* scard) {
return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
//special fix for scrap chimera, not perfect yet
if(tuner && (pduel->game_field->core.global_flag & GLOBALFLAG_SCRAP_CHIMERA)) {
if(is_affected_by_effect(EFFECT_SCRAP_CHIMERA, tuner))
return false;
}
effect_set eset;
filter_effect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL, &eset);
for(int32 i = 0; i < eset.count; ++i)
......
......@@ -227,7 +227,7 @@ public:
int32 is_capable_be_battle_target(card* pcard);
int32 is_capable_be_effect_target(effect* peffect, uint8 playerid);
int32 is_can_be_fusion_material();
int32 is_can_be_synchro_material(card* scard);
int32 is_can_be_synchro_material(card* scard, card* tuner = 0);
int32 is_can_be_xyz_material(card* scard);
};
......
......@@ -324,6 +324,7 @@ public:
#define EFFECT_EXTRA_RITUAL_MATERIAL 243
#define EFFECT_NONTUNER 244
#define EFFECT_OVERLAY_REMOVE_REPLACE 245
#define EFFECT_SCRAP_CHIMERA 246
#define EFFECT_SPSUM_EFFECT_ACTIVATED 250
#define EFFECT_MATERIAL_CHECK 251
#define EFFECT_DISABLE_FIELD 260
......
......@@ -1484,7 +1484,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
for(int32 i = 0; i < 5; ++i) {
pm = player[p].list_mzone[i];
if(pm && pm != tuner && pm->is_position(POS_FACEUP) && pduel->lua->check_matching(pm, findex2, 0)
&& pm->is_can_be_synchro_material(pcard)) {
&& pm->is_can_be_synchro_material(pcard, tuner)) {
nsyn.push_back(pm);
pm->operation_param = pm->get_synchro_level(pcard);
}
......
......@@ -527,6 +527,7 @@ public:
#define GLOBALFLAG_DECK_REVERSE_CHECK 0x1
#define GLOBALFLAG_BRAINWASHING_CHECK 0x2
#define GLOBALFLAG_SCRAP_CHIMERA 0x3
//
#define PROCESSOR_NONE 0
......
......@@ -1624,11 +1624,16 @@ int32 scriptlib::card_is_can_be_synchro_material(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
card* scard = 0;
if(!lua_isnil(L, 2)) {
card* tuner = 0;
if(lua_gettop(L) >= 2) {
check_param(L, PARAM_TYPE_CARD, 2);
scard = *(card**) lua_touserdata(L, 2);
}
lua_pushboolean(L, pcard->is_can_be_synchro_material(scard));
if(lua_gettop(L) >= 3) {
check_param(L, PARAM_TYPE_CARD, 3);
tuner = *(card**) lua_touserdata(L, 3);
}
lua_pushboolean(L, pcard->is_can_be_synchro_material(scard, tuner));
return 1;
}
int32 scriptlib::card_is_can_be_xyz_material(lua_State *L) {
......@@ -1636,7 +1641,7 @@ int32 scriptlib::card_is_can_be_xyz_material(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
card* scard = 0;
if(!lua_isnil(L, 2)) {
if(lua_gettop(L) >= 2) {
check_param(L, PARAM_TYPE_CARD, 2);
scard = *(card**) lua_touserdata(L, 2);
}
......
......@@ -3425,7 +3425,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
for(int32 j = 0; j < 5; ++j) {
pm = player[np].list_mzone[j];
if(pm && pm != tuner && pm->is_position(POS_FACEUP) && pduel->lua->check_matching(pm, -1, 0)
&& pm->is_can_be_synchro_material(pcard)) {
&& pm->is_can_be_synchro_material(pcard, tuner)) {
nsyn.push_back(pm);
pm->operation_param = pm->get_synchro_level(pcard);
}
......@@ -3472,7 +3472,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
for(int32 i = 0; i < 5; ++i) {
card* pm = player[np].list_mzone[i];
if(pm && pm != tuner && pm->is_position(POS_FACEUP) && pduel->lua->check_matching(pm, -1, 0)
&& pm->is_can_be_synchro_material(pcard)) {
&& pm->is_can_be_synchro_material(pcard, tuner)) {
core.select_cards.push_back(pm);
pm->operation_param = pm->get_synchro_level(pcard);
}
......
......@@ -33,19 +33,20 @@ end
function c14943837.tuner_filter(c)
return c:GetLevel()~=4
end
function c14943837.synfilter(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and c:GetLevel()~=4 and (f==nil or f(c))
function c14943837.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and c:GetLevel()~=4 and (f==nil or f(c))
end
function c14943837.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c14943837.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c14943837.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
end
function c14943837.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local g=Duel.GetMatchingGroup(c14943837.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c14943837.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
end
......
......@@ -19,19 +19,19 @@ function c16825874.initial_effect(c)
c:RegisterEffect(e2)
end
c16825874.tuner_filter=aux.FALSE
function c16825874.filter(c,syncard,f,lv)
return c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c)) and c:GetLevel()==lv
function c16825874.filter(c,syncard,tuner,f,lv)
return c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c)) and c:GetLevel()==lv
end
function c16825874.target(e,syncard,f,minc,maxc)
if minc>1 then return false end
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
if lv<=0 then return false end
return Duel.IsExistingMatchingCard(c16825874.filter,syncard:GetControler(),LOCATION_HAND,0,1,nil,syncard,f,lv)
return Duel.IsExistingMatchingCard(c16825874.filter,syncard:GetControler(),LOCATION_HAND,0,1,nil,syncard,e:GetHandler(),f,lv)
end
function c16825874.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local g=Duel.SelectMatchingCard(tp,c16825874.filter,tp,LOCATION_HAND,0,1,1,nil,syncard,f,lv)
local g=Duel.SelectMatchingCard(tp,c16825874.filter,tp,LOCATION_HAND,0,1,1,nil,syncard,e:GetHandler(),f,lv)
Duel.SetSynchroMaterial(g)
end
function c16825874.ccon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -79,7 +79,7 @@ end
function c25924653.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
if tc and tc:IsLocation(LOCATION_MZONE) and tc:GetFlagEffect(25924654)~=0 then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
......
......@@ -14,7 +14,7 @@ function c36318200.initial_effect(c)
end
function c36318200.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
return g:GetCount()>0 and not g:IsExists(Card.IsRace,1,nil,0xffffffff-RACE_BEAST)
return g:GetCount()>0 and not g:IsExists(Card.IsRace,1,nil,0xfffffff-RACE_BEAST)
end
function c36318200.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
......
......@@ -11,21 +11,21 @@ function c37953640.initial_effect(c)
c:RegisterEffect(e1)
end
c37953640.tuner_filter=aux.FilterBoolFunction(Card.IsRace,RACE_FISH)
function c37953640.synfilter(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and c:IsRace(RACE_FISH) and (f==nil or f(c))
function c37953640.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and c:IsRace(RACE_FISH) and (f==nil or f(c))
end
function c37953640.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c37953640.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c37953640.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
local res=g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
return res
end
function c37953640.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c37953640.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c37953640.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
......
......@@ -10,8 +10,11 @@ function c4440873.initial_effect(c)
e1:SetOperation(c4440873.activate)
c:RegisterEffect(e1)
end
function c4440873.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c4440873.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp)
return eg:IsExists(c4440873.cfilter,1,nil,1-tp)
end
function c4440873.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -19,7 +22,7 @@ function c4440873.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function c4440873.filter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsControler(tp)
return c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c4440873.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(c4440873.filter,nil,e,1-tp)
......
--スクラップ·キマイラ
function c56746202.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SCRAP_CHIMERA)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(56746202,0))
......@@ -17,13 +18,20 @@ function c56746202.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(c56746202.synlimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SCRAP_CHIMERA)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(c56746202.synlimit2)
c:RegisterEffect(e3)
end
function c56746202.filter(c,e,tp)
return c:IsSetCard(0x24) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c56746202.sumtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c56746202.filter(chkc,e,tp) 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(c56746202.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c56746202.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......@@ -39,3 +47,6 @@ function c56746202.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(0x24)
end
function c56746202.synlimit2(e,c)
return not c:IsSetCard(0x24)
end
......@@ -11,21 +11,21 @@ function c56897896.initial_effect(c)
c:RegisterEffect(e1)
end
c56897896.tuner_filter=aux.FALSE
function c56897896.synfilter(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard)
function c56897896.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner)
and c:IsLevelBelow(4) and c:IsRace(RACE_WARRIOR+RACE_MACHINE) and (f==nil or f(c))
end
function c56897896.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c56897896.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c56897896.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return lv>=minc and lv<=maxc and g:GetCount()>=lv
end
function c56897896.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c56897896.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c56897896.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:Select(tp,lv,lv,nil)
Duel.SetSynchroMaterial(sg)
......
......@@ -22,19 +22,20 @@ end
function c61777313.tuner_filter(c)
return c:IsSetCard(0x42)
end
function c61777313.synfilter(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and c:IsSetCard(0x42) and (f==nil or f(c))
function c61777313.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and c:IsSetCard(0x42) and (f==nil or f(c))
end
function c61777313.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c61777313.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c61777313.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
end
function c61777313.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local g=Duel.GetMatchingGroup(c61777313.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c61777313.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
......
......@@ -16,28 +16,29 @@ function c64910482.initial_effect(c)
e2:SetOperation(c64910482.regop)
c:RegisterEffect(e2)
end
function c64910482.synfilter1(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c))
function c64910482.synfilter1(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c))
end
function c64910482.synfilter2(c,syncard,f)
return c:IsSetCard(0x27) and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c))
function c64910482.synfilter2(c,syncard,tuner,f)
return c:IsSetCard(0x27) and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c))
end
function c64910482.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c64910482.synfilter1,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c64910482.synfilter1,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
if syncard:IsSetCard(0x27) then
local exg=Duel.GetMatchingGroup(c64910482.synfilter2,syncard:GetControler(),LOCATION_HAND,0,c,syncard,f)
local exg=Duel.GetMatchingGroup(c64910482.synfilter2,syncard:GetControler(),LOCATION_HAND,0,c,syncard,c,f)
g:Merge(exg)
end
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
end
function c64910482.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local g=Duel.GetMatchingGroup(c64910482.synfilter1,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c64910482.synfilter1,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
if syncard:IsSetCard(0x27) then
local exg=Duel.GetMatchingGroup(c64910482.synfilter2,syncard:GetControler(),LOCATION_HAND,0,c,syncard,f)
local exg=Duel.GetMatchingGroup(c64910482.synfilter2,syncard:GetControler(),LOCATION_HAND,0,c,syncard,c,f)
g:Merge(exg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
......
......@@ -52,20 +52,21 @@ end
function c67038874.tuner_filter(c)
return c:IsSetCard(0x24)
end
function c67038874.synfilter(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and c:IsSetCard(0x24) and (f==nil or f(c))
function c67038874.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and c:IsSetCard(0x24) and (f==nil or f(c))
end
function c67038874.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c67038874.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c67038874.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
local res=g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
return res
end
function c67038874.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local g=Duel.GetMatchingGroup(c67038874.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c67038874.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
......
......@@ -15,22 +15,15 @@ function c7093411.initial_effect(c)
e2:SetDescription(aux.Stringid(7093411,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetTarget(c7093411.target)
e2:SetOperation(c7093411.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(7093411,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c7093411.target)
e3:SetOperation(c7093411.operation)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(7093411,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
local e4=e2:Clone()
e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e4:SetTarget(c7093411.target)
e4:SetOperation(c7093411.operation)
c:RegisterEffect(e4)
end
function c7093411.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -11,19 +11,21 @@ function c73417207.initial_effect(c)
c:RegisterEffect(e1)
end
c73417207.tuner_filter=aux.FALSE
function c73417207.filter(c,syncard,f)
return c:IsSetCard(0x42) and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c))
function c73417207.filter(c,syncard,tuner,f)
return c:IsSetCard(0x42) and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c))
end
function c73417207.target(e,syncard,f,minc,maxc)
local c=e:GetHandler()
if minc>2 or maxc<2 then return false end
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,nil,syncard,f)
local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,c,syncard,c,f)
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,2,2,syncard)
end
function c73417207.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,c,syncard,f)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,2,2,syncard)
Duel.SetSynchroMaterial(sg)
......
......@@ -16,7 +16,8 @@ function c74064212.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c74064212.atkval)
e2:SetCondition(c74064212.atkcon)
e2:SetValue(1000)
c:RegisterEffect(e2)
--equip limit
local e3=Effect.CreateEffect(c)
......@@ -48,12 +49,9 @@ function c74064212.eqop(e,tp,eg,ep,ev,re,r,rp)
Duel.Equip(tp,c,tc)
end
end
function c74064212.atkval(e,c)
function c74064212.atkcon(e)
local ph=Duel.GetCurrentPhase()
if (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) then
return 1000
end
return 0
return ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL
end
function c74064212.eqlimit(e,c)
return c:GetControler()==e:GetHandler():GetControler()
......
......@@ -11,18 +11,20 @@ function c74509280.initial_effect(c)
c:RegisterEffect(e1)
end
c74509280.tuner_filter=aux.FALSE
function c74509280.filter(c,syncard,f,lv)
return c:IsSetCard(0x23) and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c)) and c:GetLevel()==lv
function c74509280.synfilter(c,syncard,tuner,f,lv)
return c:IsSetCard(0x23) and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c)) and c:GetLevel()==lv
end
function c74509280.target(e,syncard,f,minc)
local c=e:GetHandler()
if minc>1 then return false end
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
return Duel.IsExistingMatchingCard(c74509280.filter,syncard:GetControler(),LOCATION_HAND,0,1,nil,syncard,f,lv)
return Duel.IsExistingMatchingCard(c74509280.filter,syncard:GetControler(),LOCATION_HAND,0,1,nil,syncard,c,f,lv)
end
function c74509280.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local g=Duel.SelectMatchingCard(tp,c74509280.filter,tp,LOCATION_HAND,0,1,1,nil,syncard,f,lv)
local g=Duel.SelectMatchingCard(tp,c74509280.filter,tp,LOCATION_HAND,0,1,1,nil,syncard,c,f,lv)
Duel.SetSynchroMaterial(g)
end
......@@ -43,20 +43,20 @@ function c93369354.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
c93369354.tuner_filter=aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER)
function c93369354.synfilter(c,syncard,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and c:IsAttribute(ATTRIBUTE_WATER) and (f==nil or f(c))
function c93369354.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard,tuner) and c:IsAttribute(ATTRIBUTE_WATER) and (f==nil or f(c))
end
function c93369354.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c93369354.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c93369354.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
end
function c93369354.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c93369354.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,f)
local g=Duel.GetMatchingGroup(c93369354.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
......
......@@ -404,6 +404,7 @@ EFFECT_RITUAL_LEVEL =241
EFFECT_EXTRA_RITUAL_MATERIAL =243
EFFECT_NONTUNER =244
EFFECT_OVERLAY_REMOVE_REPLACE =245
EFFECT_SCRAP_CHIMERA =246
EFFECT_SPSUM_EFFECT_ACTIVATED =250
EFFECT_MATERIAL_CHECK =251
EFFECT_DISABLE_FIELD =260
......@@ -603,6 +604,7 @@ TIMING_EQUIP =0x2000000
--Global flag
GLOBALFLAG_DECK_REVERSE_CHECK =0x1
GLOBALFLAG_BRAINWASHING_CHECK =0x2
GLOBALFLAG_SCRAP_CHIMERA =0x3
--
DUEL_TEST_MODE =0x01
DUEL_ATTACK_FIRST_TURN =0x02
......
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