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

ABYR

parent cb4262e4
...@@ -124,6 +124,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -124,6 +124,7 @@ static const struct luaL_Reg cardlib[] = {
{ "IsSummonableCard", scriptlib::card_is_summonable }, { "IsSummonableCard", scriptlib::card_is_summonable },
{ "IsSpecialSummonable", scriptlib::card_is_special_summonable }, { "IsSpecialSummonable", scriptlib::card_is_special_summonable },
{ "IsSynchroSummonable", scriptlib::card_is_synchro_summonable }, { "IsSynchroSummonable", scriptlib::card_is_synchro_summonable },
{ "IsXyzSummonable", scriptlib::card_is_xyz_summonable },
{ "IsSummonable", scriptlib::card_is_can_be_summoned }, { "IsSummonable", scriptlib::card_is_can_be_summoned },
{ "IsMSetable", scriptlib::card_is_msetable }, { "IsMSetable", scriptlib::card_is_msetable },
{ "IsSSetable", scriptlib::card_is_ssetable }, { "IsSSetable", scriptlib::card_is_ssetable },
...@@ -295,6 +296,7 @@ static const struct luaL_Reg duellib[] = { ...@@ -295,6 +296,7 @@ static const struct luaL_Reg duellib[] = {
{ "Summon", scriptlib::duel_summon }, { "Summon", scriptlib::duel_summon },
{ "SpecialSummonRule", scriptlib::duel_special_summon_rule }, { "SpecialSummonRule", scriptlib::duel_special_summon_rule },
{ "SynchroSummon", scriptlib::duel_synchro_summon }, { "SynchroSummon", scriptlib::duel_synchro_summon },
{ "XyzSummon", scriptlib::duel_xyz_summon },
{ "MSet", scriptlib::duel_setm }, { "MSet", scriptlib::duel_setm },
{ "SSet", scriptlib::duel_sets }, { "SSet", scriptlib::duel_sets },
{ "CreateToken", scriptlib::duel_create_token }, { "CreateToken", scriptlib::duel_create_token },
......
...@@ -1049,6 +1049,22 @@ int32 scriptlib::card_is_synchro_summonable(lua_State *L) { ...@@ -1049,6 +1049,22 @@ int32 scriptlib::card_is_synchro_summonable(lua_State *L) {
lua_pushboolean(L, pcard->is_special_summonable(p)); lua_pushboolean(L, pcard->is_special_summonable(p));
return 1; return 1;
} }
int32 scriptlib::card_is_xyz_summonable(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(!(pcard->data.type & TYPE_XYZ))
return 0;
group* materials = 0;
if(!lua_isnil(L, 2)) {
check_param(L, PARAM_TYPE_GROUP, 2);
materials = *(group**) lua_touserdata(L, 2);
}
uint32 p = pcard->pduel->game_field->core.reason_player;
pcard->pduel->game_field->core.limit_xyz = materials;
lua_pushboolean(L, pcard->is_special_summonable(p));
return 1;
}
int32 scriptlib::card_is_can_be_summoned(lua_State *L) { int32 scriptlib::card_is_can_be_summoned(lua_State *L) {
check_param_count(L, 3); check_param_count(L, 3);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -241,6 +241,24 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) { ...@@ -241,6 +241,24 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
pduel->game_field->special_summon_rule(playerid, pcard); pduel->game_field->special_summon_rule(playerid, pcard);
return lua_yield(L, 0); return lua_yield(L, 0);
} }
int32 scriptlib::duel_xyz_summon(lua_State *L) {
check_action_permission(L);
check_param_count(L, 3);
check_param(L, PARAM_TYPE_CARD, 2);
uint32 playerid = lua_tointeger(L, 1);
if(playerid != 0 && playerid != 1)
return 0;
card* pcard = *(card**)lua_touserdata(L, 2);
group* materials = 0;
if(!lua_isnil(L, 3)) {
check_param(L, PARAM_TYPE_GROUP, 3);
materials = *(group**)lua_touserdata(L, 3);
}
duel * pduel = pcard->pduel;
pduel->game_field->core.limit_xyz = materials;
pduel->game_field->special_summon_rule(playerid, pcard);
return lua_yield(L, 0);
}
int32 scriptlib::duel_setm(lua_State *L) { int32 scriptlib::duel_setm(lua_State *L) {
check_action_permission(L); check_action_permission(L);
check_param_count(L, 4); check_param_count(L, 4);
...@@ -2389,7 +2407,7 @@ int32 scriptlib::duel_select_position(lua_State * L) { ...@@ -2389,7 +2407,7 @@ int32 scriptlib::duel_select_position(lua_State * L) {
card* pcard = *(card**) lua_touserdata(L, 2); card* pcard = *(card**) lua_touserdata(L, 2);
uint32 positions = lua_tointeger(L, 3); uint32 positions = lua_tointeger(L, 3);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->add_process(PROCESSOR_SELECT_OPTION_S, 0, 0, 0, playerid + (positions << 16), (ptr)pcard); pduel->game_field->add_process(PROCESSOR_SELECT_POSITION_S, 0, 0, 0, playerid + (positions << 16), (ptr)pcard);
return lua_yield(L, 0); return lua_yield(L, 0);
} }
int32 scriptlib::duel_select_disable_field(lua_State * L) { int32 scriptlib::duel_select_disable_field(lua_State * L) {
......
...@@ -1743,8 +1743,10 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -1743,8 +1743,10 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
effect_set eset; effect_set eset;
target->material_cards.clear(); target->material_cards.clear();
card* tuner = core.limit_tuner; card* tuner = core.limit_tuner;
group* materials = core.limit_xyz;
target->filter_spsummon_procedure(sumplayer, &eset); target->filter_spsummon_procedure(sumplayer, &eset);
core.limit_tuner = tuner; core.limit_tuner = tuner;
core.limit_xyz = materials;
if(!eset.count) if(!eset.count)
return TRUE; return TRUE;
core.select_effects.clear(); core.select_effects.clear();
...@@ -1769,6 +1771,10 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -1769,6 +1771,10 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pduel->lua->add_param(core.limit_tuner, PARAM_TYPE_CARD); pduel->lua->add_param(core.limit_tuner, PARAM_TYPE_CARD);
core.limit_tuner = 0; core.limit_tuner = 0;
} }
if(core.limit_xyz) {
pduel->lua->add_param(core.limit_xyz, PARAM_TYPE_GROUP);
core.limit_xyz = 0;
}
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, peffect, 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, peffect, 0, sumplayer, 0);
} }
......
...@@ -128,6 +128,7 @@ public: ...@@ -128,6 +128,7 @@ public:
static int32 card_is_ssetable(lua_State *L); static int32 card_is_ssetable(lua_State *L);
static int32 card_is_special_summonable(lua_State *L); static int32 card_is_special_summonable(lua_State *L);
static int32 card_is_synchro_summonable(lua_State *L); static int32 card_is_synchro_summonable(lua_State *L);
static int32 card_is_xyz_summonable(lua_State *L);
static int32 card_is_can_be_summoned(lua_State *L); static int32 card_is_can_be_summoned(lua_State *L);
static int32 card_is_can_be_special_summoned(lua_State *L); static int32 card_is_can_be_special_summoned(lua_State *L);
static int32 card_is_able_to_hand(lua_State *L); static int32 card_is_able_to_hand(lua_State *L);
...@@ -287,6 +288,7 @@ public: ...@@ -287,6 +288,7 @@ public:
static int32 duel_summon(lua_State *L); static int32 duel_summon(lua_State *L);
static int32 duel_special_summon_rule(lua_State *L); static int32 duel_special_summon_rule(lua_State *L);
static int32 duel_synchro_summon(lua_State *L); static int32 duel_synchro_summon(lua_State *L);
static int32 duel_xyz_summon(lua_State *L);
static int32 duel_setm(lua_State *L); static int32 duel_setm(lua_State *L);
static int32 duel_sets(lua_State *L); static int32 duel_sets(lua_State *L);
static int32 duel_create_token(lua_State *L); static int32 duel_create_token(lua_State *L);
......
--バトル・ブレイク
function c22047978.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c22047978.condition)
e1:SetTarget(c22047978.target)
e1:SetOperation(c22047978.activate)
c:RegisterEffect(e1)
end
function c22047978.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c22047978.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg:IsOnField() and tg:IsDestructable() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
end
function c22047978.cfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c22047978.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
local g=Duel.GetMatchingGroup(c22047978.cfilter,1-tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(22047978,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM)
local cg=g:Select(1-tp,1,1,nil)
Duel.ConfirmCards(tp,g)
Duel.ShuffleHand(1-tp)
return
end
if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
end
end
--最期の同調
function c23269426.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c23269426.target)
e1:SetOperation(c23269426.activate)
c:RegisterEffect(e1)
end
function c23269426.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c23269426.filter(c,e,tp)
return c:IsFaceup() and c:GetLevel()==3
and Duel.IsExistingMatchingCard(c23269426.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,c:GetCode())
end
function c23269426.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c23269426.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c23269426.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c23269426.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c23269426.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c23269426.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,tc:GetCode())
if sg:GetCount()>0 and Duel.SpecialSummonStep(sg:GetFirst(),0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
sg:GetFirst():RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
sg:GetFirst():RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetOperation(c23269426.desop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
tc:RegisterEffect(e1)
end
function c23269426.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
--ダーク·カタパルター --ダーク·カタパルター
function c33875961.initial_effect(c) function c33875961.initial_effect(c)
c:EnableCounterPermit(0x3027) c:EnableCounterPermit(0x3028)
--counter --counter
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33875961,0)) e1:SetDescription(aux.Stringid(33875961,0))
...@@ -30,15 +30,15 @@ function c33875961.addccon(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,15 +30,15 @@ function c33875961.addccon(e,tp,eg,ep,ev,re,r,rp)
end end
function c33875961.addct(e,tp,eg,ep,ev,re,r,rp,chk) function c33875961.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x3027) Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x3028)
end end
function c33875961.addc(e,tp,eg,ep,ev,re,r,rp) function c33875961.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x3027,1) e:GetHandler():AddCounter(0x3028,1)
end end
end end
function c33875961.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c33875961.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x3027) local ct=e:GetHandler():GetCounter(0x3028)
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,ct,nil) end if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,ct,ct,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,ct,ct,nil)
...@@ -49,7 +49,7 @@ function c33875961.filter(c) ...@@ -49,7 +49,7 @@ function c33875961.filter(c)
end end
function c33875961.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33875961.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c33875961.filter(chkc) end if chkc then return chkc:IsOnField() and c33875961.filter(chkc) end
local ct=e:GetHandler():GetCounter(0x3027) local ct=e:GetHandler():GetCounter(0x3028)
if chk==0 then return Duel.IsExistingTarget(c33875961.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,nil) end if chk==0 then return Duel.IsExistingTarget(c33875961.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c33875961.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,nil) local g=Duel.SelectTarget(tp,c33875961.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,nil)
...@@ -60,6 +60,6 @@ function c33875961.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,6 +60,6 @@ function c33875961.desop(e,tp,eg,ep,ev,re,r,rp)
if g:FilterCount(Card.IsRelateToEffect,nil,e)==g:GetCount() then if g:FilterCount(Card.IsRelateToEffect,nil,e)==g:GetCount() then
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
local ct=e:GetHandler():GetCounter(0x3027) local ct=e:GetHandler():GetCounter(0x3028)
e:GetHandler():RemoveCounter(tp,0x3027,ct,REASON_EFFECT) e:GetHandler():RemoveCounter(tp,0x3028,ct,REASON_EFFECT)
end end
--魔導書院ラメイソン
function c33981008.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33981008,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetCondition(c33981008.drcon)
e2:SetTarget(c33981008.drtg)
e2:SetOperation(c33981008.drop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33981008,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c33981008.spcon)
e3:SetTarget(c33981008.sptg)
e3:SetOperation(c33981008.spop)
c:RegisterEffect(e3)
end
function c33981008.cfilter(c)
return c:IsRace(RACE_SPELLCASTER) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function c33981008.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.IsExistingMatchingCard(c33981008.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
function c33981008.filter(c)
return c:IsSetCard(0x106e) and c:GetCode()~=33981008 and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c33981008.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c33981008.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33981008.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c33981008.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33981008.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,1,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c33981008.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and rp==1-tp
end
function c33981008.ctfilter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL)
end
function c33981008.spfilter(c,e,tp,lv)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33981008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local ct=Duel.GetMatchingGroupCount(c33981008.ctfilter,tp,LOCATION_GRAVE,0,nil)
return Duel.IsExistingMatchingCard(c33981008.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,ct)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c33981008.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local ct=Duel.GetMatchingGroupCount(c33981008.ctfilter,tp,LOCATION_GRAVE,0,nil)
local g=Duel.SelectMatchingCard(tp,c33981008.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp,ct)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--忘却の都 レミューリア
function c34103656.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c34103656.lvtg)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(200)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e3)
--lv
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(34103656,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetOperation(c34103656.lvop)
c:RegisterEffect(e3)
end
function c34103656.lvtg(e,c)
return c:IsAttribute(ATTRIBUTE_WATER)
end
function c34103656.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c34103656.lvtg)
e1:SetValue(c35220244.lvval)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c35220244.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c35220244.lvval(e,c)
return Duel.GetMatchingGroupCount(c35220244.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
end
--重力砲
function c35220244.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c35220244.target)
e1:SetOperation(c35220244.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c35220244.eqlimit)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(35220244,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetOperation(c35220244.atkop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_BATTLE_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c35220244.discon)
e4:SetOperation(c35220244.disop)
c:RegisterEffect(e4)
end
function c35220244.eqlimit(e,c)
return c:IsRace(RACE_MACHINE)
end
function c35220244.eqfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function c35220244.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c35220244.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c35220244.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c35220244.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c35220244.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c35220244.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(400)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c35220244.discon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and (ec==Duel.GetAttacker() or ec==Duel.GetAttackTarget()) and ec:GetBattleTarget():IsFaceup()
end
function c35220244.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget():GetBattleTarget()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2)
end
--ワンショット・ワンド
function c36042825.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c36042825.target)
e1:SetOperation(c36042825.operation)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(800)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c36042825.eqlimit)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(36042825,0))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c36042825.drcon)
e4:SetTarget(c36042825.drtg)
e4:SetOperation(c36042825.drop)
c:RegisterEffect(e4)
end
function c36042825.eqlimit(e,c)
return c:IsRace(RACE_SPELLCASTER)
end
function c36042825.filter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c36042825.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c36042825.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c36042825.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c36042825.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c36042825.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c36042825.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget():IsRelateToBattle()
end
function c36042825.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c36042825.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
...@@ -29,16 +29,16 @@ function c39892082.addccon(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,16 +29,16 @@ function c39892082.addccon(e,tp,eg,ep,ev,re,r,rp)
end end
function c39892082.addct(e,tp,eg,ep,ev,re,r,rp,chk) function c39892082.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x28) Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x29)
end end
function c39892082.addc(e,tp,eg,ep,ev,re,r,rp) function c39892082.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x28,1) e:GetHandler():AddCounter(0x29,1)
end end
end end
function c39892082.damcon(e,tp,eg,ep,ev,re,r,rp) function c39892082.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ct=c:GetCounter(0x28) local ct=c:GetCounter(0x29)
e:SetLabel(ct) e:SetLabel(ct)
return ct>0 and c:IsReason(REASON_DESTROY) return ct>0 and c:IsReason(REASON_DESTROY)
end end
......
--バブル・ブリンガー
function c58531587.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot direct attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c58531587.atktarget)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(58531587,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c58531587.spcon)
e3:SetCost(c58531587.spcost)
e3:SetTarget(c58531587.sptg)
e3:SetOperation(c58531587.spop)
c:RegisterEffect(e3)
end
function c58531587.atktarget(e,c)
return c:GetLevel()>=4
end
function c58531587.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c58531587.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c58531587.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsAttribute(ATTRIBUTE_WATER)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58531587.filter2(c,g)
return g:IsExists(Card.IsCode,1,c,c:GetCode())
end
function c58531587.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return end
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return false end
local g=Duel.GetMatchingGroup(c58531587.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
return g:IsExists(c58531587.filter2,1,nil,g)
end
local g=Duel.GetMatchingGroup(c58531587.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
local dg=g:Filter(c58531587.filter2,nil,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=dg:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=dg:FilterSelect(tp,Card.IsCode,1,1,sg1:GetFirst(),sg1:GetFirst():GetCode())
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
end
function c58531587.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end
--マドルチェ・チケット
function c60470713.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60470713,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_TO_DECK)
e2:SetTarget(c60470713.target)
e2:SetOperation(c60470713.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_HAND)
c:RegisterEffect(e3)
end
function c60470713.cfilter(c,tp)
return c:IsControler(tp) and c:GetPreviousControler()==tp
and (c:IsPreviousLocation(LOCATION_GRAVE) or (c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)))
and c:IsSetCard(0x71)
end
function c60470713.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and eg:IsExists(c60470713.cfilter,1,nil,tp)
end
function c60470713.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,60470713)==0 and e:GetHandler():IsRelateToEffect(e) end
Duel.RegisterFlagEffect(tp,60470713,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c60470713.mfilter(c)
return c:IsFaceup() and c:IsSetCard(0x71) and c:IsRace(RACE_FAIRY)
end
function c60470713.filter1(c)
return c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c60470713.filter2(c,e,tp)
return c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER)
and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK))
end
function c60470713.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local b=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c60470713.mfilter,tp,LOCATION_MZONE,0,1,nil)
if not b then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60470713.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60470713.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
if not tc:IsAbleToHand() or (tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
and Duel.SelectYesNo(tp,aux.Stringid(60470713,1))) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
end
--高等紋章術
function c61314842.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c61314842.target)
e1:SetOperation(c61314842.activate)
c:RegisterEffect(e1)
end
function c61314842.filter(c,e,tp)
return c:IsSetCard(0x76) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c61314842.xyzfilter(c,mg)
return c:IsXyzSummonable(mg)
end
function c61314842.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c61314842.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and mg:GetCount()>1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:Select(tp,2,2,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c61314842.filter2(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c61314842.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c61314842.filter2,nil,e,tp)
if g:GetCount()<2 then return end
local xyzg=Duel.GetMatchingGroup(c61314842.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,g)
end
end
--アルマの魔導書
function c61592395.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c61592395.cost)
e1:SetTarget(c61592395.target)
e1:SetOperation(c61592395.activate)
c:RegisterEffect(e1)
end
function c61592395.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,61592395)==0 end
Duel.RegisterFlagEffect(tp,61592395,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c61592395.filter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:GetCode()~=61592395 and c:IsAbleToHand()
end
function c61592395.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c61592395.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c61592395.filter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c61592395.filter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c61592395.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--異次元海溝
function c62437430.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c62437430.target)
e1:SetOperation(c62437430.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62437430,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c62437430.spcon)
e2:SetTarget(c62437430.sptg)
e2:SetOperation(c62437430.spop)
c:RegisterEffect(e2)
e1:SetLabelObject(e2)
end
function c62437430.filter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToRemove() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c62437430.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62437430.filter,tp,0x13,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,0x13)
end
function c62437430.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,c62437430.filter,tp,0x13,0,1,1,nil):GetFirst()
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
tc:RegisterFlagEffect(62437430,RESET_EVENT+0x1fe0000,0,0)
e:GetLabelObject():SetLabelObject(tc)
end
end
function c62437430.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
return tc and c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
end
function c62437430.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():GetFlagEffect(62437430)~=0
and e:GetLabelObject():GetReasonEffect():GetHandler()==e:GetHandler() end
Duel.SetTargetCard(e:GetLabelObject())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetLabelObject(),1,0,0)
end
function c62437430.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--精神汚染
function c69257165.initial_effect(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c69257165.cost)
e1:SetTarget(c69257165.target)
e1:SetOperation(c69257165.operation)
c:RegisterEffect(e1)
end
function c69257165.ctffilter(c,lv)
return c:IsFaceup() and c:IsControlerCanBeChanged() and c:GetLevel()==lv
end
function c69257165.ctfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
and Duel.IsExistingMatchingCard(c69257165.ctffilter,tp,0,LOCATION_MZONE,1,nil,c:GetLevel())
end
function c69257165.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c69257165.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c69257165.ctffilter(e,e:GetLabel()) end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c69257165.ctfilter,tp,LOCATION_HAND,0,1,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=Duel.SelectMatchingCard(tp,c69257165.ctfilter,tp,LOCATION_HAND,0,1,1,nil,tp)
local lv=sg:GetFirst():GetLevel()
e:SetLabel(lv)
Duel.SendtoGrave(sg,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c69257165.ctffilter,tp,0,LOCATION_MZONE,1,1,nil,lv)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c69257165.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and not Duel.GetControl(tc,tp,PHASE_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
...@@ -19,7 +19,7 @@ function c70278545.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -19,7 +19,7 @@ function c70278545.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()>=2 then if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,2,2,nil) local sg=g:Select(p,2,2,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end end
......
...@@ -12,7 +12,7 @@ function c73964868.initial_effect(c) ...@@ -12,7 +12,7 @@ function c73964868.initial_effect(c)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0) e1:SetHintTiming(0,0x1e0)
e1:SetCost(c73964868.thcost) e1:SetCost(c73964868.thcost)
e1:SetTarget(c73964868.thtg) e1:SetTarget(c73964868.thtg)
e1:SetOperation(c73964868.thop) e1:SetOperation(c73964868.thop)
......
--アビスケイル-クラーケン
function c8719957.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c8719957.target)
e1:SetOperation(c8719957.operation)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(400)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c8719957.eqlimit)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(8719957,0))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c8719957.negcon)
e4:SetTarget(c8719957.negtg)
e4:SetOperation(c8719957.negop)
c:RegisterEffect(e4)
end
function c8719957.eqlimit(e,c)
return c:IsSetCard(0x74)
end
function c8719957.filter(c)
return c:IsFaceup() and c:IsSetCard(0x74)
end
function c8719957.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c8719957.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c8719957.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c8719957.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c8719957.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c8719957.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c8719957.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c8719957.negop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateEffect(ev)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
--謙虚な番兵
function c95642274.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c95642274.target)
e1:SetOperation(c95642274.activate)
c:RegisterEffect(e1)
end
function c95642274.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c95642274.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local cg=Duel.GetFieldGroup(p,LOCATION_HAND,0)
Duel.ConfirmCards(1-p,cg)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()>=1 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
Duel.ShuffleHand(p)
end
--ゲーテの魔導書
function c97997309.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97997309,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c97997309.condition)
e1:SetCost(c97997309.cost)
e1:SetTarget(c97997309.target1)
e1:SetOperation(c97997309.activate1)
e1:SetLabel(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97997309,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,0x1c0+TIMING_BATTLE_PHASE)
e2:SetCondition(c97997309.condition)
e2:SetCost(c97997309.cost)
e2:SetTarget(c97997309.target2)
e2:SetOperation(c97997309.activate2)
e2:SetLabel(2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(97997309,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,0x1e0)
e3:SetCondition(c97997309.condition)
e3:SetCost(c97997309.cost)
e3:SetTarget(c97997309.target3)
e3:SetOperation(c97997309.activate3)
e3:SetLabel(3)
c:RegisterEffect(e3)
end
function c97997309.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c97997309.rfilter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function c97997309.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c97997309.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c97997309.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
if chk==0 then return Duel.GetFlagEffect(tp,97997309)==0
and Duel.IsExistingMatchingCard(c97997309.rfilter,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c97997309.rfilter,tp,LOCATION_GRAVE,0,ct,ct,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,97997309,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c97997309.filter1(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function c97997309.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c97997309.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97997309.filter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c97997309.filter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c97997309.activate1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c97997309.filter2(c)
return not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet()
end
function c97997309.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c97997309.filter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97997309.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSITION)
local g=Duel.SelectTarget(tp,c97997309.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c97997309.activate2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENCE)
else
local pos=Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENCE)
Duel.ChangePosition(tc,pos)
end
end
end
function c97997309.filter3(c)
return c:IsAbleToRemove()
end
function c97997309.target3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkcLIsControler(1-tp) and c97997309.filter3(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97997309.filter3,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c97997309.filter3,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c97997309.activate3(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--タンホイザーゲート
function c9831539.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c9831539.target)
e1:SetOperation(c9831539.activate)
c:RegisterEffect(e1)
end
function c9831539.filter1(c,tp)
return c:IsLevelAbove(1) and c:IsAttackBelow(1000)
and Duel.IsExistingTarget(c9831539.filter2,tp,LOCATION_MZONE,0,1,c,c:GetRace())
end
function c9831539.filter2(c,rac)
return c:IsLevelAbove(1) and c:IsAttackBelow(1000) and c:IsRace(rac)
end
function c9831539.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(c9831539.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g1=Duel.SelectTarget(tp,c9831539.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c9831539.filter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst():GetRace())
end
function c9831539.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=g:GetFirst()
local tc2=g:GetNext()
if tc1:IsRelateToEffect(e) and tc1:IsFaceup() and tc2:IsRelateToEffect(e) and tc2:IsFaceup() then
local lv=tc1:GetLevel()+tc2:GetLevel()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc2:RegisterEffect(e2)
end
end
...@@ -174,56 +174,75 @@ function Auxiliary.AddXyzProcedure(c,f,ct,alterf,desc) ...@@ -174,56 +174,75 @@ function Auxiliary.AddXyzProcedure(c,f,ct,alterf,desc)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function Auxiliary.XyzCondition(f,minc) function Auxiliary.XyzCondition(f,minc)
return function(e,c) --og: use special material
return function(e,c,og)
if c==nil then return true end if c==nil then return true end
local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE) local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)
local ct=-ft local ct=-ft
if minc<=ct then return false end if minc<=ct then return false end
local g=Duel.GetXyzMaterial(c) if og then
return g:IsExists(f,minc,nil) return og:IsExists(f,minc,nil)
else
local g=Duel.GetXyzMaterial(c)
return g:IsExists(f,minc,nil)
end
end end
end end
function Auxiliary.XyzOperation(f,minc) function Auxiliary.XyzOperation(f,minc)
return function(e,tp,eg,ep,ev,re,r,rp,c) return function(e,tp,eg,ep,ev,re,r,rp,c,og)
local g=Duel.GetXyzMaterial(c) if og then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) c:SetMaterial(og)
local mg=g:FilterSelect(tp,f,minc,minc,nil) Duel.Overlay(c,og)
c:SetMaterial(mg) else
Duel.Overlay(c,mg) local g=Duel.GetXyzMaterial(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=g:FilterSelect(tp,f,minc,minc,nil)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
end end
end end
function Auxiliary.XyzCondition2(f,minc,alterf,desc) function Auxiliary.XyzCondition2(f,minc,alterf,desc)
return function(e,c) return function(e,c,og)
if c==nil then return true end if c==nil then return true end
local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE) local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)
local ct=-ft local ct=-ft
if minc<=ct then return false end if minc<=ct then return false end
if ct<1 and Duel.IsExistingMatchingCard(alterf,c:GetControler(),LOCATION_MZONE,0,1,nil) then return true end if og then
local g=Duel.GetXyzMaterial(c) return og:IsExists(f,minc,nil)
return g:IsExists(f,minc,nil) else
if ct<1 and Duel.IsExistingMatchingCard(alterf,c:GetControler(),LOCATION_MZONE,0,1,nil) then return true end
local g=Duel.GetXyzMaterial(c)
return g:IsExists(f,minc,nil)
end
end end
end end
function Auxiliary.XyzOperation2(f,minc,alterf,desc) function Auxiliary.XyzOperation2(f,minc,alterf,desc)
return function(e,tp,eg,ep,ev,re,r,rp,c) return function(e,tp,eg,ep,ev,re,r,rp,c,og)
local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE) if og then
local ct=-ft c:SetMaterial(og)
local g=Duel.GetXyzMaterial(c) Duel.Overlay(c,og)
local b1=g:IsExists(f,minc,nil)
local b2=ct<1 and Duel.IsExistingMatchingCard(alterf,tp,LOCATION_MZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
if (b1 and b2 and Duel.SelectYesNo(tp,desc)) or ((not b1) and b2) then
local mg=Duel.SelectMatchingCard(tp,alterf,tp,LOCATION_MZONE,0,1,1,nil)
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
Duel.Overlay(c,mg)
mg:Merge(mg2)
c:SetMaterial(mg)
else else
local mg=g:FilterSelect(tp,f,minc,minc,nil) local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)
c:SetMaterial(mg) local ct=-ft
Duel.Overlay(c,mg) local g=Duel.GetXyzMaterial(c)
local b1=g:IsExists(f,minc,nil)
local b2=ct<1 and Duel.IsExistingMatchingCard(alterf,tp,LOCATION_MZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
if (b1 and b2 and Duel.SelectYesNo(tp,desc)) or ((not b1) and b2) then
local mg=Duel.SelectMatchingCard(tp,alterf,tp,LOCATION_MZONE,0,1,1,nil)
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
Duel.Overlay(c,mg)
mg:Merge(mg2)
c:SetMaterial(mg)
else
local mg=g:FilterSelect(tp,f,minc,minc,nil)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
end end
end end
end end
......
...@@ -407,5 +407,5 @@ ...@@ -407,5 +407,5 @@
!counter 0x25 年代记指示物 !counter 0x25 年代记指示物
!counter 0x26 指示物(金属射手) !counter 0x26 指示物(金属射手)
!counter 0x27 指示物(死亡蚊) !counter 0x27 指示物(死亡蚊)
!counter 0x3027 指示物(暗黑投射手) !counter 0x3028 指示物(暗黑投射手)
!counter 0x28 指示物(气球蜥蜴) !counter 0x29 指示物(气球蜥蜴)
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