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

new scripts

parent 9ae9bb4a
...@@ -95,9 +95,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -95,9 +95,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case BUTTON_HP_KICK: { case BUTTON_HP_KICK: {
int id = caller - static_cast<IGUIElement*>(mainGame->btnHostPrepKick[0]); int id = caller - static_cast<IGUIElement*>(mainGame->btnHostPrepKick[0]);
CTOS_Kick csk; CTOS_Kick csk;
if(id == 0) csk.pos = id;
csk.pos = 0;
else csk.pos = 1;
DuelClient::SendPacketToServer(CTOS_HS_KICK, csk); DuelClient::SendPacketToServer(CTOS_HS_KICK, csk);
break; break;
} }
......
...@@ -130,8 +130,6 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int ...@@ -130,8 +130,6 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int
if((code < 1134 || code > 1136) && pduel->game_field->infos.phase == PHASE_DAMAGE_CAL && !(flag & EFFECT_FLAG_DAMAGE_CAL)) if((code < 1134 || code > 1136) && pduel->game_field->infos.phase == PHASE_DAMAGE_CAL && !(flag & EFFECT_FLAG_DAMAGE_CAL))
return FALSE; return FALSE;
} }
if(handler->current.location != LOCATION_SZONE && handler->current.location != LOCATION_HAND)
return FALSE;
if(handler->current.location == LOCATION_HAND) { if(handler->current.location == LOCATION_HAND) {
if((handler->data.type & TYPE_TRAP) && !handler->is_affected_by_effect(EFFECT_TRAP_ACT_IN_HAND)) if((handler->data.type & TYPE_TRAP) && !handler->is_affected_by_effect(EFFECT_TRAP_ACT_IN_HAND))
return FALSE; return FALSE;
...@@ -139,7 +137,7 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int ...@@ -139,7 +137,7 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int
return FALSE; return FALSE;
if(!(handler->data.type & TYPE_FIELD) && pduel->game_field->get_useable_count(handler->current.controler, LOCATION_SZONE, handler->current.controler, LOCATION_REASON_TOFIELD) <= 0) if(!(handler->data.type & TYPE_FIELD) && pduel->game_field->get_useable_count(handler->current.controler, LOCATION_SZONE, handler->current.controler, LOCATION_REASON_TOFIELD) <= 0)
return FALSE; return FALSE;
} else { } else if(handler->current.location == LOCATION_SZONE) {
if(handler->is_position(POS_FACEUP)) if(handler->is_position(POS_FACEUP))
return FALSE; return FALSE;
if(handler->get_status(STATUS_SET_TURN)) { if(handler->get_status(STATUS_SET_TURN)) {
......
...@@ -230,6 +230,7 @@ static const struct luaL_Reg effectlib[] = { ...@@ -230,6 +230,7 @@ static const struct luaL_Reg effectlib[] = {
{ "IsHasProperty", scriptlib::effect_is_has_property }, { "IsHasProperty", scriptlib::effect_is_has_property },
{ "IsHasCategory", scriptlib::effect_is_has_category }, { "IsHasCategory", scriptlib::effect_is_has_category },
{ "IsHasType", scriptlib::effect_is_has_type }, { "IsHasType", scriptlib::effect_is_has_type },
{ "IsActivatable", scriptlib::effect_is_activatable },
{ NULL, NULL } { NULL, NULL }
}; };
......
...@@ -1450,15 +1450,31 @@ int32 scriptlib::card_remove_counter(lua_State *L) { ...@@ -1450,15 +1450,31 @@ int32 scriptlib::card_remove_counter(lua_State *L) {
uint32 countertype = lua_tointeger(L, 3); uint32 countertype = lua_tointeger(L, 3);
uint32 count = lua_tointeger(L, 4); uint32 count = lua_tointeger(L, 4);
uint32 reason = lua_tointeger(L, 5); uint32 reason = lua_tointeger(L, 5);
pcard->pduel->game_field->remove_counter(reason, pcard, rplayer, 0, 0, countertype, count); if(countertype == 0) {
return lua_yield(L, 0); for(auto cmit = pcard->counters.begin(); cmit != pcard->counters.end(); ++cmit) {
pcard->pduel->write_buffer8(MSG_REMOVE_COUNTER);
pcard->pduel->write_buffer16(cmit->first);
pcard->pduel->write_buffer8(pcard->current.controler);
pcard->pduel->write_buffer8(pcard->current.location);
pcard->pduel->write_buffer8(pcard->current.sequence);
pcard->pduel->write_buffer8(cmit->second);
}
pcard->counters.clear();
return 0;
} else {
pcard->pduel->game_field->remove_counter(reason, pcard, rplayer, 0, 0, countertype, count);
return lua_yield(L, 0);
}
} }
int32 scriptlib::card_get_counter(lua_State *L) { int32 scriptlib::card_get_counter(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);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
uint32 countertype = lua_tointeger(L, 2); uint32 countertype = lua_tointeger(L, 2);
lua_pushinteger(L, pcard->get_counter(countertype)); if(countertype == 0)
lua_pushinteger(L, pcard->counters.size());
else
lua_pushinteger(L, pcard->get_counter(countertype));
return 1; return 1;
} }
int32 scriptlib::card_enable_counter_permit(lua_State *L) { int32 scriptlib::card_enable_counter_permit(lua_State *L) {
......
...@@ -1157,7 +1157,7 @@ int32 scriptlib::duel_get_location_count(lua_State *L) { ...@@ -1157,7 +1157,7 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
if(lua_gettop(L) > 2) if(lua_gettop(L) > 2)
uplayer = lua_tointeger(L, 3); uplayer = lua_tointeger(L, 3);
if(lua_gettop(L) > 3) if(lua_gettop(L) > 3)
uplayer = lua_tointeger(L, 4); reason = lua_tointeger(L, 4);
lua_pushinteger(L, pduel->game_field->get_useable_count(playerid, location, uplayer, reason)); lua_pushinteger(L, pduel->game_field->get_useable_count(playerid, location, uplayer, reason));
return 1; return 1;
} }
......
...@@ -60,6 +60,8 @@ int32 scriptlib::effect_reset(lua_State *L) { ...@@ -60,6 +60,8 @@ int32 scriptlib::effect_reset(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
if(peffect->owner == 0)
return 0;
if(peffect->flag & EFFECT_FLAG_FIELD_ONLY) if(peffect->flag & EFFECT_FLAG_FIELD_ONLY)
peffect->pduel->game_field->remove_effect(peffect); peffect->pduel->game_field->remove_effect(peffect);
else else
...@@ -478,3 +480,11 @@ int32 scriptlib::effect_is_has_type(lua_State *L) { ...@@ -478,3 +480,11 @@ int32 scriptlib::effect_is_has_type(lua_State *L) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
return 1; return 1;
} }
int32 scriptlib::effect_is_activatable(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_EFFECT, 1);
uint32 playerid = lua_tointeger(L, 2);
effect* peffect = *(effect**) lua_touserdata(L, 1);
lua_pushboolean(L, peffect->is_activateable(playerid, peffect->pduel->game_field->nil_event));
return 1;
}
...@@ -788,9 +788,9 @@ int32 field::get_control(uint16 step, effect * reason_effect, uint8 reason_playe ...@@ -788,9 +788,9 @@ int32 field::get_control(uint16 step, effect * reason_effect, uint8 reason_playe
return FALSE; return FALSE;
} }
case 2: { case 2: {
raise_single_event(pcard, 0, EVENT_CONTROL_CHANGED, reason_effect, 0, reason_player, playerid, 0); raise_single_event(pcard, 0, EVENT_CONTROL_CHANGED, reason_effect, REASON_EFFECT, reason_player, playerid, 0);
process_single_event(); process_single_event();
raise_event(pcard, EVENT_CONTROL_CHANGED, reason_effect, 0, reason_player, playerid, 0); raise_event(pcard, EVENT_CONTROL_CHANGED, reason_effect, REASON_EFFECT, reason_player, playerid, 0);
process_instant_event(); process_instant_event();
return FALSE; return FALSE;
} }
...@@ -845,13 +845,13 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play ...@@ -845,13 +845,13 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play
pduel->write_buffer8(pcard1->current.location); pduel->write_buffer8(pcard1->current.location);
pduel->write_buffer8(pcard1->current.sequence); pduel->write_buffer8(pcard1->current.sequence);
pduel->write_buffer8(pcard1->current.position); pduel->write_buffer8(pcard1->current.position);
raise_single_event(pcard1, 0, EVENT_CONTROL_CHANGED, reason_effect, 0, reason_player, pcard1->current.controler, 0); raise_single_event(pcard1, 0, EVENT_CONTROL_CHANGED, reason_effect, REASON_EFFECT, reason_player, pcard1->current.controler, 0);
raise_single_event(pcard2, 0, EVENT_CONTROL_CHANGED, reason_effect, 0, reason_player, pcard2->current.controler, 0); raise_single_event(pcard2, 0, EVENT_CONTROL_CHANGED, reason_effect, REASON_EFFECT, reason_player, pcard2->current.controler, 0);
process_single_event(); process_single_event();
card_set cset; card_set cset;
cset.insert(pcard1); cset.insert(pcard1);
cset.insert(pcard2); cset.insert(pcard2);
raise_event(&cset, EVENT_CONTROL_CHANGED, reason_effect, 0, reason_player, 0, 0); raise_event(&cset, EVENT_CONTROL_CHANGED, reason_effect, REASON_EFFECT, reason_player, 0, 0);
process_instant_event(); process_instant_event();
return FALSE; return FALSE;
} }
......
...@@ -1548,9 +1548,14 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1548,9 +1548,14 @@ int32 field::process_phase_event(int16 step, int32 phase) {
return FALSE; return FALSE;
} }
case 16: { case 16: {
core.new_fchain.clear(); if(core.new_fchain.size() || core.new_ochain.size()) {
core.new_ochain.clear(); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
core.units.begin()->step = 0;
return FALSE;
}
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.instant_event.clear();
core.point_event.clear();
return TRUE; return TRUE;
} }
} }
......
...@@ -229,6 +229,7 @@ public: ...@@ -229,6 +229,7 @@ public:
static int32 effect_is_has_property(lua_State *L); static int32 effect_is_has_property(lua_State *L);
static int32 effect_is_has_category(lua_State *L); static int32 effect_is_has_category(lua_State *L);
static int32 effect_is_has_type(lua_State *L); static int32 effect_is_has_type(lua_State *L);
static int32 effect_is_activatable(lua_State *L);
//Group functions //Group functions
static int32 group_new(lua_State *L); static int32 group_new(lua_State *L);
......
--プレートクラッシャー
function c114932.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(114932,0))
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(2)
e1:SetCost(c114932.descost)
e1:SetTarget(c114932.destg)
e1:SetOperation(c114932.desop)
c:RegisterEffect(e1)
end
function c114932.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost()
end
function c114932.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c114932.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c114932.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c114932.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c114932.desop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--シャインスピリッツ
function c12624008.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12624008,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c12624008.condition)
e1:SetTarget(c12624008.target)
e1:SetOperation(c12624008.operation)
c:RegisterEffect(e1)
end
function c12624008.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c12624008.filter(c,e,tp)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_LIGHT)) and c:IsDestructable()
end
function c12624008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c12624008.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c12624008.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c12624008.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--ヘルプロミネンス
function c13846680.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13846680,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c13846680.condition)
e1:SetTarget(c13846680.target)
e1:SetOperation(c13846680.operation)
c:RegisterEffect(e1)
end
function c13846680.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c13846680.filter(c,e,tp)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_FIRE)) and c:IsDestructable()
end
function c13846680.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c13846680.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c13846680.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c13846680.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--閃光のバリア-シャイニング·フォース-
function c21481146.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c21481146.condition)
e1:SetTarget(c21481146.target)
e1:SetOperation(c21481146.activate)
c:RegisterEffect(e1)
end
function c21481146.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(Card.IsPosition,tp,0,LOCATION_MZONE,3,nil,POS_FACEUP_ATTACK)
end
function c21481146.filter(c)
return c:IsAttackPos() and c:IsDestructable()
end
function c21481146.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21481146.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c21481146.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c21481146.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c21481146.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--チェーン·ヒーリング
function c25050038.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c25050038.rectg)
e1:SetOperation(c25050038.recop)
c:RegisterEffect(e1)
end
function c25050038.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500)
end
function c25050038.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=Duel.GetCurrentChain()
if ct>3 then
c:CancelToGrave()
Duel.SendtoHand(c,nil,REASON_EFFECT)
elseif ct>1 then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
--ストレートフラッシュ
function c25173686.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c25173686.condition)
e1:SetTarget(c25173686.target)
e1:SetOperation(c25173686.activate)
c:RegisterEffect(e1)
end
function c25173686.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE)==5 and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)==nil
end
function c25173686.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c25173686.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25173686.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(c25173686.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c25173686.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c25173686.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
--静寂の聖者
function c26669055.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26669055,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetOperation(c26669055.operation)
c:RegisterEffect(e1)
end
function c26669055.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetCondition(c26669055.accon)
e1:SetValue(c26669055.aclimit)
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c26669055.accon(e)
return e:GetLabel()~=Duel.GetTurnCount()
end
function c26669055.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL)
end
...@@ -10,7 +10,7 @@ function c28596933.initial_effect(c) ...@@ -10,7 +10,7 @@ function c28596933.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c28596933.filter(c) function c28596933.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:GetLevel()>=5 and c:IsAbleToHand() return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsLevelAbove(5) and c:IsAbleToHand()
end end
function c28596933.dfilter(c) function c28596933.dfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
...@@ -26,8 +26,7 @@ function c28596933.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,8 +26,7 @@ function c28596933.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c28596933.activate(e,tp,eg,ep,ev,re,r,rp) function c28596933.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local sg=Duel.GetMatchingGroup(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local sg=Duel.GetMatchingGroup(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
end end
......
--幸運の鉄斧
function c34664411.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(c34664411.target)
e1:SetOperation(c34664411.operation)
c:RegisterEffect(e1)
--Atk,def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetValue(1)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(34664411,0))
e4:SetCategory(CATEGORY_DRAW)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c34664411.drcon)
e4:SetTarget(c34664411.drtg)
e4:SetOperation(c34664411.drop)
c:RegisterEffect(e4)
end
function c34664411.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(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c34664411.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 c34664411.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,0x41)==0x41 and rp~=tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c34664411.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c34664411.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--バイロード·サクリファイス
function c36935434.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c36935434.condition)
e1:SetTarget(c36935434.target)
e1:SetOperation(c36935434.operation)
c:RegisterEffect(e1)
end
function c36935434.cfilter(c,tp)
return c:GetPreviousControler()==tp
end
function c36935434.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c36935434.cfilter,1,nil,tp)
end
function c36935434.filter(c,e,tp)
return c:IsCode(64268668) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c36935434.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c36935434.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c36935434.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c36935434.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--カウンタークリーナー
function c38834303.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c38834303.target)
e1:SetOperation(c38834303.activate)
c:RegisterEffect(e1)
end
function c38834303.filter(c)
return c:GetCounter(0)~=0
end
function c38834303.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c38834303.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function c38834303.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c38834303.filter,tp,LOCATION_MZONE,0,nil)
local tc=sg:GetFirst()
while tc do
tc:RemoveCounter(tp,0,0,0)
tc=sg:GetNext()
end
end
--ストーム·シューター
function c39188539.initial_effect(c)
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39188539,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c39188539.seqcon)
e1:SetTarget(c39188539.seqtg)
e1:SetOperation(c39188539.seqop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39188539,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c39188539.thtg)
e2:SetOperation(c39188539.thop)
c:RegisterEffect(e2)
end
function c39188539.seqcon(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
return (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))
end
function c39188539.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(39188539)==0 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RegisterFlagEffect(39188539,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c39188539.seqop(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.bor(flag,bit.lshift(0x1,seq-1)) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.bor(flag,bit.lshift(0x1,seq+1)) end
flag=bit.bxor(flag,0xff)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(e:GetHandler(),nseq)
end
end
function c39188539.filter(c,seq)
return c:GetSequence()==seq and c:IsAbleToHand()
end
function c39188539.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c39188539.filter(chkc,4-e:GetHandler():GetSequence()) end
if chk==0 then return e:GetHandler():GetFlagEffect(39188539)==0
and Duel.IsExistingTarget(c39188539.filter,tp,0,LOCATION_ONFIELD,1,nil,4-e:GetHandler():GetSequence()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c39188539.filter,tp,0,LOCATION_ONFIELD,1,1,nil,4-e:GetHandler():GetSequence())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
e:GetHandler():RegisterFlagEffect(39188539,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c39188539.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--龍脈に棲む者
function c46508640.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c46508640.atkval)
c:RegisterEffect(e1)
end
function c46508640.cfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToGraveAsCost()
end
function c46508640.atkval(e,c)
return Duel.GetMatchingGroupCount(c46508640.cfilter,c:GetControler(),LOCATION_SZONE,0,nil)*300
end
--結界術師 メイコウ
function c47731128.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47731128,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c47731128.cost)
e1:SetTarget(c47731128.target)
e1:SetOperation(c47731128.operation)
c:RegisterEffect(e1)
end
function c47731128.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c47731128.filter(c)
local tpe=c:GetType()
return c:IsFaceup() and (tpe==0x20002 or tpe==0x20004) and c:IsDestructable()
end
function c47731128.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c47731128.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c47731128.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c47731128.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c47731128.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ジェネラルデーモン
function c48675364.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48675364,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c48675364.cost)
e1:SetTarget(c48675364.target)
e1:SetOperation(c48675364.operation)
c:RegisterEffect(e1)
--self destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetCondition(c48675364.descon)
c:RegisterEffect(e2)
end
function c48675364.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c48675364.filter(c)
return c:GetCode()==94585852 and c:IsAbleToHand()
end
function c48675364.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c48675364.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c48675364.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetFirstMatchingCard(c48675364.filter,tp,LOCATION_DECK,0,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function c48675364.descon(e)
local ev,ep=Duel.GetEnvironment()
return Duel.GetEnvironment()~=94585852
end
--終焉の地
function c48934760.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c48934760.condition)
e1:SetTarget(c48934760.target)
e1:SetOperation(c48934760.activate)
c:RegisterEffect(e1)
end
function c48934760.cfilter(c,tp)
return c:GetSummonPlayer()==1-tp
end
function c48934760.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c48934760.cfilter,1,nil,tp)
end
function c48934760.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp)
end
function c48934760.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48934760.filter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function c48934760.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48934760,0))
local tc=Duel.SelectMatchingCard(tp,c48934760.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
local op=tc:GetActivateEffect():GetOperation()
if Duel.GetFieldCard(tp,LOCATION_SZONE,5)~=nil then
Duel.Destroy(Duel.GetFieldCard(tp,LOCATION_SZONE,5),REASON_RULE)
Duel.BreakEffect()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
elseif Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)~=nil
and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5):IsFaceup() then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.Destroy(Duel.GetFieldCard(1-tp,LOCATION_SZONE,5),REASON_RULE)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
end
--レイジアース
function c50957346.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50957346,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c50957346.condition)
e1:SetTarget(c50957346.target)
e1:SetOperation(c50957346.operation)
c:RegisterEffect(e1)
end
function c50957346.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c50957346.filter(c,e,tp)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_EARTH)) and c:IsDestructable()
end
function c50957346.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c50957346.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c50957346.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c50957346.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--チェーン·ブラスト
function c51449743.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c51449743.damtg)
e1:SetOperation(c51449743.damop)
c:RegisterEffect(e1)
end
function c51449743.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c51449743.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=Duel.GetCurrentChain()
if ct>3 then
c:CancelToGrave()
Duel.SendtoHand(c,nil,REASON_EFFECT)
elseif ct>1 then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
...@@ -9,16 +9,15 @@ function c58921041.initial_effect(c) ...@@ -9,16 +9,15 @@ function c58921041.initial_effect(c)
--cannot activate --cannot activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_TRIGGER) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_SZONE, LOCATION_HAND+LOCATION_SZONE) e2:SetTargetRange(0,1)
e2:SetTarget(c58921041.targets) e2:SetValue(c58921041.aclimit)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c58921041.targets(e,c) function c58921041.aclimit(e,re,tp)
if not c:IsType(TYPE_SPELL) then return false end if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_SPELL) then return false end
if c:IsLocation(LOCATION_HAND) then return true end local c=re:GetHandler()
if c:IsFaceup() then return false end return not c:IsLocation(LOCATION_SZONE) or Duel.GetTurnCount()-c:GetTurnID()<2
return Duel.GetTurnCount()-c:GetTurnID()<2
end end
--デスサイクロン
function c59235795.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59235795,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c59235795.condition)
e1:SetTarget(c59235795.target)
e1:SetOperation(c59235795.operation)
c:RegisterEffect(e1)
end
function c59235795.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c59235795.filter(c,e,tp)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_WIND)) and c:IsDestructable()
end
function c59235795.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c59235795.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c59235795.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c59235795.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--平穏の賢者
function c62054060.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62054060,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetOperation(c62054060.operation)
c:RegisterEffect(e1)
end
function c62054060.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetCondition(c62054060.accon)
e1:SetValue(c62054060.aclimit)
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c62054060.accon(e)
return e:GetLabel()~=Duel.GetTurnCount()
end
function c62054060.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
--トロイボム
function c63323539.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CONTROL_CHANGED)
e1:SetTarget(c63323539.target)
e1:SetOperation(c63323539.operation)
c:RegisterEffect(e1)
end
function c63323539.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return r==REASON_EFFECT and rp==1-tp
and eg:IsExists(Card.IsControler,1,nil,1-tp) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c63323539.filter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsControler(1-tp)
end
function c63323539.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=eg:FilterSelect(tp,c63323539.filter,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,tc:GetAttack(),REASON_EFFECT)
end
end
--ポジションチェンジ
function c63394872.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(63394872,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(c63394872.seqtg)
e2:SetOperation(c63394872.seqop)
c:RegisterEffect(e2)
end
function c63394872.filter(c)
local seq=c:GetSequence()
return (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))
end
function c63394872.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c63394872.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c63394872.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(63394872,1))
Duel.SelectTarget(tp,c63394872.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c63394872.seqop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end
local seq=tc:GetSequence()
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.bor(flag,bit.lshift(0x1,seq-1)) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.bor(flag,bit.lshift(0x1,seq+1)) end
flag=bit.bxor(flag,0xff)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(tc,nseq)
end
end
--リニアキャノン
function c64238008.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c64238008.cost)
e1:SetTarget(c64238008.target)
e1:SetOperation(c64238008.activate)
c:RegisterEffect(e1)
if not c64238008.global_check then
c64238008.global_check=true
c64238008[0]=true
c64238008[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c64238008.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c64238008.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c64238008.checkop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
c64238008[rp]=false
end
end
function c64238008.clear(e,tp,eg,ep,ev,re,r,rp)
c64238008[0]=true
c64238008[1]=true
end
function c64238008.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return c64238008[tp] and Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
local atk=g:GetFirst():GetTextAttack()/2
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.Release(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(c64238008.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
end
function c64238008.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL)
end
function c64238008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local res=e:GetLabel()~=0
e:SetLabel(0)
return res
end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetLabel())
e:SetLabel(0)
end
function c64238008.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--クレイジー·ファイヤー
function c68815401.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetCost(c68815401.cost)
e1:SetTarget(c68815401.target)
e1:SetOperation(c68815401.activate)
c:RegisterEffect(e1)
end
function c68815401.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) and not Duel.CheckAttackActivity(tp) end
Duel.PayLPCost(tp,500)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c68815401.filter1(c)
local code=c:GetCode()
return c:IsFaceup() and (code==69537999 or code==21420702) and c:IsDestructable()
end
function c68815401.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c68815401.filter1,tp,LOCATION_SZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsPlayerCanSpecialSummonMonster(tp,68815402,0,0x4011,1000,1000,3,RACE_PYRO,ATTRIBUTE_FIRE) end
local dg1=Duel.GetMatchingGroup(c68815401.filter1,tp,LOCATION_SZONE,0,nil)
local dg2=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
dg1:Merge(dg2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg1,dg1:GetCount(),0,0)
end
function c68815401.activate(e,tp,eg,ep,ev,re,r,rp)
local dg1=Duel.GetMatchingGroup(c68815401.filter1,tp,LOCATION_SZONE,0,nil)
if Duel.Destroy(dg1,REASON_EFFECT)>0 then
local dg2=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if Duel.Destroy(dg2,REASON_EFFECT)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,68815402,0,0x4011,1000,1000,3,RACE_PYRO,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,68815402)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--押し売りゴブリン
function c68875140.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(68875140,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(c68875140.condition)
e2:SetTarget(c68875140.target)
e2:SetOperation(c68875140.operation)
c:RegisterEffect(e2)
end
function c68875140.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():GetControler()==tp
end
function c68875140.filter(c)
return c:GetSequence()~=5 and c:IsAbleToHand()
end
function c68875140.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocatoin(LOCATION_SZONE) and chkc:IsControler(1-tp) and c68875140.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c68875140.filter,tp,0,LOCATION_SZONE,1,1,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
end
function c68875140.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--義賊の入門書
function c69091732.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(0,TIMING_TOHAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c69091732.condition)
e1:SetTarget(c69091732.target)
e1:SetOperation(c69091732.activate)
c:RegisterEffect(e1)
end
function c69091732.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>4
end
function c69091732.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
end
function c69091732.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
local dg=g:RandomSelect(tp,1)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
end
--融合体駆除装置
function c72150572.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c72150572.target)
e1:SetOperation(c72150572.activate)
c:RegisterEffect(e1)
end
function c72150572.filter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsDestructable()
end
function c72150572.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c72150572.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c72150572.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c72150572.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c72150572.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--マグナ·スラッシュドラゴン
function c72903645.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(72903645,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c72903645.descost)
e1:SetTarget(c72903645.destg)
e1:SetOperation(c72903645.desop)
c:RegisterEffect(e1)
end
function c72903645.cfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToGraveAsCost()
end
function c72903645.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72903645.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c72903645.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c72903645.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c72903645.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsContreoler(1-tp) and c72903645.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c72903645.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c72903645.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c72903645.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--お家おとりつぶし
function c73872164.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCost(c73872164.cost)
e1:SetTarget(c73872164.target)
e1:SetOperation(c73872164.activate)
c:RegisterEffect(e1)
end
function c73872164.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function c73872164.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73872164.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c73872164.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c73872164.filter(c)
return c:IsFaceup() and c:IsDestructable()
end
function c73872164.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 c73872164.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c73872164.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c73872164.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c73872164.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local code=tc:GetCode()
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,code)
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,hg)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
Duel.ShuffleHand(1-tp)
end
end
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
function c75732622.spcon(e,c) function c75732622.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,75732623,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) and Duel.IsPlayerCanSpecialSummonMonster(tp,75732623,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK)
end end
function c75732622.spop(e,tp,eg,ep,ev,re,r,rp,c) function c75732622.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
--夜霧のスナイパー
function c8323633.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c8323633.target)
c:RegisterEffect(e1)
end
function c8323633.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,564)
local ac=Duel.AnnounceCard(tp)
--remove
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8323633,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c8323633.rmcon)
e1:SetTarget(c8323633.rmtg)
e1:SetOperation(c8323633.rmop)
e1:SetLabel(ac)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP)
c:RegisterEffect(e3)
end
function c8323633.filter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c8323633.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c8323633.filter,1,nil,e:GetLabel())
end
function c8323633.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetCard(eg)
local g=eg:Filter(c8323633.filter,nil,e:GetLabel())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c8323633.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=eg:Filter(c8323633.filter,nil,e:GetLabel()):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--ダークネスソウル
function c86229493.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86229493,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c86229493.condition)
e1:SetTarget(c86229493.target)
e1:SetOperation(c86229493.operation)
c:RegisterEffect(e1)
end
function c86229493.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c86229493.filter(c,e,tp)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_DARK)) and c:IsDestructable()
end
function c86229493.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c86229493.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c86229493.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c86229493.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--サイレントアビス
function c86442081.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86442081,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c86442081.condition)
e1:SetTarget(c86442081.target)
e1:SetOperation(c86442081.operation)
c:RegisterEffect(e1)
end
function c86442081.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c86442081.filter(c,e,tp)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_WATER)) and c:IsDestructable()
end
function c86442081.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c86442081.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c86442081.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c86442081.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
...@@ -11,14 +11,14 @@ function c88279736.initial_effect(c) ...@@ -11,14 +11,14 @@ function c88279736.initial_effect(c)
e2:SetCategory(CATEGORY_HANDES) e2:SetCategory(CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_DAMAGE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(c88279736.condition) e2:SetCondition(c88279736.condition)
e2:SetTarget(c88279736.target) e2:SetTarget(c88279736.target)
e2:SetOperation(c88279736.operation) e2:SetOperation(c88279736.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c88279736.condition(e,tp,eg,ep,ev,re,r,rp) function c88279736.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst():GetControler()==tp return ep~=tp and eg:GetFirst():GetControler()==tp
end end
function c88279736.target(e,tp,eg,ep,ev,re,r,rp,chk) function c88279736.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--サイバー·シャドー·ガードナー
function c90440725.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c90440725.condition)
e1:SetTarget(c90440725.target)
e1:SetOperation(c90440725.activate)
c:RegisterEffect(e1)
end
function c90440725.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c90440725.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,90440725,0,0x21,-2,-2,4,RACE_MACHINE,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c90440725.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,90440725,0,0x21,-2,-2,4,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
c:AddTrapMonsterAttribute(true,ATTRIBUTE_EARTH,RACE_MACHINE,4,-2,-2)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
--cannot attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetOperation(c90440725.atkop)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--turn set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(90440725,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCondition(c90440725.setcon)
e2:SetTarget(c90440725.settg)
e2:SetOperation(c90440725.setop)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
function c90440725.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(Duel.GetAttacker():GetAttack())
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENCE)
e1:SetValue(Duel.GetAttacker():GetDefence())
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c90440725.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c90440725.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c90440725.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE) then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENCE)
end
end
--儀式降臨封印の書
function c9145181.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c9145181.target)
e1:SetOperation(c9145181.activate)
c:RegisterEffect(e1)
end
function c9145181.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsDestructable()
end
function c9145181.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c9145181.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9145181.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c9145181.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c9145181.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--閃光弾
function c9267769.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c9267769.condition)
e1:SetOperation(c9267769.activate)
c:RegisterEffect(e1)
end
function c9267769.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c9267769.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
end
--グラビ·クラッシュドラゴン
function c9391354.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9391354,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c9391354.descost)
e1:SetTarget(c9391354.destg)
e1:SetOperation(c9391354.desop)
c:RegisterEffect(e1)
end
function c9391354.cfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToGraveAsCost()
end
function c9391354.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9391354.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9391354.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c9391354.filter(c)
return c:IsDestructable()
end
function c9391354.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsContreoler(1-tp) and c9391354.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9391354.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c9391354.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c9391354.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--押し売りゾンビ
function c94374859.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(94374859,0))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(c94374859.condition)
e2:SetTarget(c94374859.target)
e2:SetOperation(c94374859.operation)
c:RegisterEffect(e2)
end
function c94374859.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():GetControler()==tp
end
function c94374859.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocatoin(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToGrave() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
end
function c94374859.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,1,REASON_EFFECT)
end
end
--ファイヤー·ウォール
function c94804055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c94804055.target1)
e1:SetOperation(c94804055.operation)
c:RegisterEffect(e1)
--quick
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(94804055,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetLabel(1)
e2:SetCondition(c94804055.condition)
e2:SetCost(c94804055.cost)
e2:SetTarget(c94804055.target2)
e2:SetOperation(c94804055.operation)
c:RegisterEffect(e2)
--maintain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetOperation(c94804055.mtop)
c:RegisterEffect(e3)
end
function c94804055.cfilter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToRemoveAsCost()
end
function c94804055.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) then
local a=Duel.GetAttacker()
if a:IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.IsExistingMatchingCard(c94804055.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and a:IsOnField() and a:IsCanBeEffectTarget(e) and Duel.SelectYesNo(tp,aux.Stringid(94804055,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c94804055.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SetTargetCard(a)
end
else
e:SetProperty(0)
e:SetLabel(0)
end
end
function c94804055.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==1 then
Duel.NegateAttack()
end
end
function c94804055.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil and not e:GetHandler():IsStatus(STATUS_CHAINING)
end
function c94804055.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c94804055.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c94804055.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c94804055.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return false end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
end
function c94804055.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.GetLP(tp)>500 and Duel.SelectYesNo(tp,aux.Stringid(94804055,2)) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
--ファイヤー·ソウル
function c95026693.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c95026693.cost)
e1:SetTarget(c95026693.target)
e1:SetOperation(c95026693.activate)
c:RegisterEffect(e1)
end
function c95026693.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.CheckAttackActivity(tp) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95026693.filter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToRemove()
end
function c95026693.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1)
and Duel.IsExistingMatchingCard(c95026693.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c95026693.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c95026693.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local dam=g:GetFirst():GetAttack()/2
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
--義賊の極意書
function c95096437.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c95096437.target)
e1:SetOperation(c95096437.activate)
c:RegisterEffect(e1)
end
function c95096437.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function c95096437.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c95096437.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c95096437.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c95096437.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c95096437.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(95096437,0))
e1:SetCategory(CATEGORY_HANDES)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetLabel(tc:GetFieldID())
e1:SetCondition(c95096437.hdcon)
e1:SetTarget(c95096437.hdtg)
e1:SetOperation(c95096437.hdop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c95096437.hdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():GetFieldID()==e:GetLabel()
end
function c95096437.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND)
end
function c95096437.hdop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
local dg=g:RandomSelect(tp,2)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
end
--誘発召喚
function c96148285.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c96148285.condition)
e1:SetOperation(c96148285.activate)
c:RegisterEffect(e1)
end
function c96148285.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c96148285.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96148285.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c96148285.filter,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96148285,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,1-tp)>0 then
local g=Duel.GetMatchingGroup(c96148285.filter,1-tp,LOCATION_HAND,0,nil,e,1-tp)
if g:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(96148285,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
--ラスト·リゾート
function c97970833.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c97970833.condition)
e1:SetTarget(c97970833.target)
e1:SetOperation(c97970833.activate)
c:RegisterEffect(e1)
end
function c97970833.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c97970833.filter(c,tp)
return c:IsCode(34487429) and c:GetActivateEffect():IsActivatable(tp)
end
function c97970833.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c97970833.filter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function c97970833.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstMatchingCard(c97970833.filter,tp,LOCATION_DECK,0,nil)
if tc then
if Duel.GetFieldCard(tp,LOCATION_SZONE,5)~=nil then
Duel.Destroy(Duel.GetFieldCard(tp,LOCATION_SZONE,5),REASON_RULE)
Duel.BreakEffect()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
elseif Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)~=nil
and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5):IsFaceup() then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Destroy(Duel.GetFieldCard(1-tp,LOCATION_SZONE,5),REASON_RULE)
if Duel.IsPlayerCanDraw(1-tp,1) and Duel.SelectYesNo(tp,aux.Stringid(97970833,0)) then
Duel.Draw(1-tp,1,REASON_EFFECT)
end
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
end
--フュージョニストキラー
function c98336111.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetCondition(c98336111.condtion)
e1:SetTarget(c98336111.target)
e1:SetValue(0)
c:RegisterEffect(e1)
end
function c98336111.condtion(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and Duel.GetAttackTarget()~=nil
and (Duel.GetAttacker()==e:GetHandler()) or (Duel.GetAttackTarget()==e:GetHandler())
end
function c98336111.target(e,c)
return c==e:GetHandler():GetBattleTarget() and c:IsType(TYPE_FUSION)
end
--リバースディメンション
function c98666339.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c98666339.target)
e1:SetOperation(c98666339.operation)
c:RegisterEffect(e1)
end
function c98666339.filter(c,e,tp)
return c:GetControler()==tp and c:IsFaceup() and c:GetReasonPlayer()==1-tp
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c98666339.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and eg:IsContains(chkc) and c98666339.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(c98666339.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,c98666339.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c98666339.operation(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
...@@ -5,9 +5,9 @@ antialias = 2 ...@@ -5,9 +5,9 @@ antialias = 2
errorlog = 1 errorlog = 1
nickname = Player nickname = Player
gamename = Game gamename = Game
lastdeck = sample lastdeck = test
textfont = c:/windows/fonts/simsun.ttc 14 textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911 serverport = 7911
lastip = 192.168.2.100 lastip = 192.168.3.235
lastport = 7911 lastport = 7911
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