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

fix & new scripts

parent eda5e7d5
...@@ -512,18 +512,19 @@ void Game::DrawSpec() { ...@@ -512,18 +512,19 @@ void Game::DrawSpec() {
break; break;
} }
case 100: { case 100: {
if(showcardp < 60) {
driver->draw2DImage(imageManager.tHand[(showcardcode >> 16) & 0x3], position2di(615, showcarddif)); driver->draw2DImage(imageManager.tHand[(showcardcode >> 16) & 0x3], position2di(615, showcarddif));
driver->draw2DImage(imageManager.tHand[showcardcode & 0x3], position2di(615, 540 - showcarddif)); driver->draw2DImage(imageManager.tHand[showcardcode & 0x3], position2di(615, 540 - showcarddif));
float dy = -0.333333f * showcardp + 10; float dy = -0.333333f * showcardp + 10;
showcardp++; showcardp++;
if(showcardp < 30) if(showcardp < 30)
showcarddif += (int)dy; showcarddif += (int)dy;
if(showcardp > 60) } else
showcard = 0; showcard = 0;
break; break;
} }
case 101: { case 101: {
const wchar_t* lstr; const wchar_t* lstr = L"";
switch(showcardcode) { switch(showcardcode) {
case 1: case 1:
lstr = L"You Win!"; lstr = L"You Win!";
......
...@@ -172,31 +172,25 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -172,31 +172,25 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
if(pkt->code == 0) if(pkt->code == 0)
mainGame->wMessage->setText(dataManager.GetSysString(1403)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1403));
else if(pkt->code == 1) else if(pkt->code == 1)
mainGame->wMessage->setText(dataManager.GetSysString(1404)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1404));
else if(pkt->code == 2) else if(pkt->code == 2)
mainGame->wMessage->setText(dataManager.GetSysString(1405)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1405));
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->PopupElement(mainGame->wMessage);
mainGame->localAction.Reset();
mainGame->localAction.Wait();
event_base_loopbreak(client_base); event_base_loopbreak(client_base);
break; break;
} }
case ERRMSG_DECKERROR: { case ERRMSG_DECKERROR: {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
if(pkt->code == 1) if(pkt->code == 1)
mainGame->wMessage->setText(dataManager.GetSysString(1406)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1406));
else { else {
wchar_t msgbuf[64]; wchar_t msgbuf[64];
myswprintf(msgbuf, dataManager.GetSysString(1407), dataManager.GetName(pkt->code)); myswprintf(msgbuf, dataManager.GetSysString(1407), dataManager.GetName(pkt->code));
mainGame->wMessage->setText(msgbuf); mainGame->env->addMessageBox(L"", msgbuf);
} }
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->PopupElement(mainGame->wMessage);
mainGame->localAction.Reset();
mainGame->localAction.Wait();
break; break;
} }
} }
...@@ -1231,7 +1225,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -1231,7 +1225,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
std::sort(panel_confirm.begin(), panel_confirm.end(), ClientCard::client_card_sort); std::sort(panel_confirm.begin(), panel_confirm.end(), ClientCard::client_card_sort);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->dField.selectable_cards = panel_confirm; mainGame->dField.selectable_cards = panel_confirm;
mainGame->dField.ShowSelectCard(); mainGame->dField.ShowSelectCard(true);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->localAction.Reset(); mainGame->localAction.Reset();
mainGame->localAction.Wait(); mainGame->localAction.Wait();
......
...@@ -633,7 +633,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -633,7 +633,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
case irr::gui::EGET_LISTBOX_CHANGED: { case irr::gui::EGET_LISTBOX_CHANGED: {
switch(id) { switch(id) {
case LISTBOX_LOG: {
int sel = mainGame->lstLog->getSelected();
if(sel != -1 && mainGame->logParam.size() >= sel && mainGame->logParam[sel]) {
mainGame->ShowCardInfo(mainGame->logParam[sel]);
}
break;
}
} }
break; break;
} }
......
...@@ -759,6 +759,8 @@ void Game::CloseDuelWindow() { ...@@ -759,6 +759,8 @@ void Game::CloseDuelWindow() {
wQuery->setVisible(false); wQuery->setVisible(false);
wReplayControl->setVisible(false); wReplayControl->setVisible(false);
stHintMsg->setVisible(false); stHintMsg->setVisible(false);
lstLog->clear();
logParam.clear();
ClearTextures(); ClearTextures();
} }
int Game::LocalPlayer(int player) { int Game::LocalPlayer(int player) {
......
...@@ -1875,8 +1875,6 @@ int32 card::is_capable_attack_announce(uint8 playerid) { ...@@ -1875,8 +1875,6 @@ int32 card::is_capable_attack_announce(uint8 playerid) {
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_ATTACK_ANNOUNCE)) if(is_affected_by_effect(EFFECT_CANNOT_ATTACK_ANNOUNCE))
return FALSE; return FALSE;
if(pduel->game_field->is_player_affected_by_effect(playerid, EFFECT_CANNOT_ATTACK_ANNOUNCE))
return FALSE;
pduel->game_field->save_lp_cost(); pduel->game_field->save_lp_cost();
effect_set eset; effect_set eset;
pduel->game_field->filter_player_effect(playerid, EFFECT_ATTACK_COST, &eset); pduel->game_field->filter_player_effect(playerid, EFFECT_ATTACK_COST, &eset);
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "duel.h" #include "duel.h"
#include "group.h" #include "group.h"
#include "interpreter.h" #include "interpreter.h"
#include <iostream>
bool effect_sort_id(const effect* e1, const effect* e2) { bool effect_sort_id(const effect* e1, const effect* e2) {
return e1->id < e2->id; return e1->id < e2->id;
......
...@@ -550,6 +550,8 @@ int32 scriptlib::duel_set_chain_limit(lua_State *L) { ...@@ -550,6 +550,8 @@ int32 scriptlib::duel_set_chain_limit(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_FUNCTION, 1); check_param(L, PARAM_TYPE_FUNCTION, 1);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
if(pduel->game_field->core.chain_limit)
luaL_unref(L, LUA_REGISTRYINDEX, pduel->game_field->core.chain_limit);
int32 f = interpreter::get_function_handle(L, 1); int32 f = interpreter::get_function_handle(L, 1);
pduel->game_field->core.chain_limit = f; pduel->game_field->core.chain_limit = f;
pduel->game_field->core.chain_limp = pduel->game_field->core.reason_player; pduel->game_field->core.chain_limp = pduel->game_field->core.reason_player;
...@@ -559,6 +561,8 @@ int32 scriptlib::duel_set_chain_limit_p(lua_State *L) { ...@@ -559,6 +561,8 @@ int32 scriptlib::duel_set_chain_limit_p(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_FUNCTION, 1); check_param(L, PARAM_TYPE_FUNCTION, 1);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
if(pduel->game_field->core.chain_limit_p)
luaL_unref(L, LUA_REGISTRYINDEX, pduel->game_field->core.chain_limit_p);
int32 f = interpreter::get_function_handle(L, 1); int32 f = interpreter::get_function_handle(L, 1);
pduel->game_field->core.chain_limit_p = f; pduel->game_field->core.chain_limit_p = f;
pduel->game_field->core.chain_limp_p = pduel->game_field->core.reason_player; pduel->game_field->core.chain_limp_p = pduel->game_field->core.reason_player;
......
...@@ -1244,7 +1244,10 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1244,7 +1244,10 @@ int32 field::process_phase_event(int16 step, int32 phase) {
} }
case 2: { case 2: {
if(core.current_chain.size()) { if(core.current_chain.size()) {
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
}
chain_array::iterator cait; chain_array::iterator cait;
for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait)
cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE); cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE);
...@@ -1711,7 +1714,10 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) { ...@@ -1711,7 +1714,10 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return FALSE; return FALSE;
} }
case 9: { case 9: {
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
}
if(core.current_chain.size()) { if(core.current_chain.size()) {
chain_array::iterator cait; chain_array::iterator cait;
for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait)
...@@ -1719,7 +1725,10 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) { ...@@ -1719,7 +1725,10 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
add_process(PROCESSOR_SOLVE_CHAIN, 0, 0, 0, skip_new, 0); add_process(PROCESSOR_SOLVE_CHAIN, 0, 0, 0, skip_new, 0);
} else { } else {
core.used_event.splice(core.used_event.end(), core.point_event); core.used_event.splice(core.used_event.end(), core.point_event);
if(core.chain_limit_p) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit_p);
core.chain_limit_p = 0; core.chain_limit_p = 0;
}
reset_chain(); reset_chain();
} }
return TRUE; return TRUE;
...@@ -2228,7 +2237,10 @@ int32 field::process_idle_command(uint16 step) { ...@@ -2228,7 +2237,10 @@ int32 field::process_idle_command(uint16 step) {
return TRUE; return TRUE;
} }
case 2: { case 2: {
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
}
chain_array::iterator cait; chain_array::iterator cait;
for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait)
cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE); cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE);
...@@ -2279,10 +2291,12 @@ int32 field::process_idle_command(uint16 step) { ...@@ -2279,10 +2291,12 @@ int32 field::process_idle_command(uint16 step) {
} }
case 10: { case 10: {
//end announce //end announce
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
}
if(core.current_chain.size()) { if(core.current_chain.size()) {
chain_array::iterator cait; for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait)
for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait)
cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE); cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE);
add_process(PROCESSOR_SOLVE_CHAIN, 0, 0, 0, FALSE, 0); add_process(PROCESSOR_SOLVE_CHAIN, 0, 0, 0, FALSE, 0);
core.units.begin()->step = -1; core.units.begin()->step = -1;
...@@ -2346,6 +2360,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2346,6 +2360,7 @@ int32 field::process_battle_command(uint16 step) {
core.attackable_cards.clear(); core.attackable_cards.clear();
card_vector first_attack; card_vector first_attack;
card_vector must_attack; card_vector must_attack;
if(!is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_ATTACK_ANNOUNCE)) {
for(uint32 i = 0; i < 5; ++i) { for(uint32 i = 0; i < 5; ++i) {
pcard = player[infos.turn_player].list_mzone[i]; pcard = player[infos.turn_player].list_mzone[i];
if(!pcard) if(!pcard)
...@@ -2372,6 +2387,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2372,6 +2387,7 @@ int32 field::process_battle_command(uint16 step) {
if(pcard->is_affected_by_effect(EFFECT_MUST_ATTACK)) if(pcard->is_affected_by_effect(EFFECT_MUST_ATTACK))
must_attack.push_back(pcard); must_attack.push_back(pcard);
} }
}
core.to_m2 = TRUE; core.to_m2 = TRUE;
core.to_ep = TRUE; core.to_ep = TRUE;
if(must_attack.size() || is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_M2)) if(must_attack.size() || is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_M2))
...@@ -2440,9 +2456,11 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2440,9 +2456,11 @@ int32 field::process_battle_command(uint16 step) {
return TRUE; return TRUE;
} }
case 2: { case 2: {
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
chain_array::iterator cait; }
for(cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait)
cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE); cait->triggering_effect->handler->set_status(STATUS_CHAINING, FALSE);
add_process(PROCESSOR_SOLVE_CHAIN, 0, 0, 0, FALSE, 0); add_process(PROCESSOR_SOLVE_CHAIN, 0, 0, 0, FALSE, 0);
core.units.begin()->step = -1; core.units.begin()->step = -1;
...@@ -3536,7 +3554,10 @@ int32 field::add_chain(uint16 step) { ...@@ -3536,7 +3554,10 @@ int32 field::add_chain(uint16 step) {
pduel->write_buffer32(peffect->description); pduel->write_buffer32(peffect->description);
pduel->write_buffer8(core.current_chain.size() + 1); pduel->write_buffer8(core.current_chain.size() + 1);
break_effect(); break_effect();
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
}
if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && peffect->handler->is_affected_by_effect(EFFECT_DISABLE_EFFECT)) if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && peffect->handler->is_affected_by_effect(EFFECT_DISABLE_EFFECT))
clit->flag |= CHAIN_DISABLE_EFFECT; clit->flag |= CHAIN_DISABLE_EFFECT;
clit->chain_type = peffect->handler->get_type(); clit->chain_type = peffect->handler->get_type();
...@@ -3810,7 +3831,10 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) { ...@@ -3810,7 +3831,10 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
adjust_all(); adjust_all();
core.current_chain.pop_back(); core.current_chain.pop_back();
if(!core.current_chain.size()) { if(!core.current_chain.size()) {
if(core.chain_limit) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit);
core.chain_limit = 0; core.chain_limit = 0;
}
return FALSE; return FALSE;
} }
core.units.begin()->step = -1; core.units.begin()->step = -1;
...@@ -3830,7 +3854,10 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) { ...@@ -3830,7 +3854,10 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
case 12: { case 12: {
core.used_event.splice(core.used_event.end(), core.point_event); core.used_event.splice(core.used_event.end(), core.point_event);
pduel->write_buffer8(MSG_CHAIN_END); pduel->write_buffer8(MSG_CHAIN_END);
if(core.chain_limit_p) {
luaL_unref(pduel->lua->lua_state, LUA_REGISTRYINDEX, core.chain_limit_p);
core.chain_limit_p = 0; core.chain_limit_p = 0;
}
reset_chain(); reset_chain();
if(core.summoning_card || core.spsummoning_card) { if(core.summoning_card || core.spsummoning_card) {
core.subunits.push_back(core.reserved); core.subunits.push_back(core.reserved);
......
--ゴブリン穴埋め部隊
function c12755462.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c12755462.sumsuc)
c:RegisterEffect(e1)
--activate limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c12755462.cedop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(c12755462.cedcon)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_CHAIN_END)
e5:SetOperation(c12755462.cedop2)
c:RegisterEffect(e5)
end
function c12755462.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c12755462.chlimit1)
end
function c12755462.chlimit1(re,rp,tp)
return not re:GetHandler():IsType(TYPE_TRAP) or not re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c12755462.cedcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst()~=e:GetHandler()
end
function c12755462.cedop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c12755462.chlimit2)
end
function c12755462.cedop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS) then
Duel.SetChainLimitTillChainEnd(c12755462.chlimit2)
end
end
function c12755462.chlimit2(re,rp,tp)
return not re:GetHandler():IsType(TYPE_TRAP) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsSetCard(0x4c)
end
--ドングリス
function c13478040.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c13478040.ctop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13478040,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c13478040.descost)
e2:SetTarget(c13478040.destg)
e2:SetOperation(c13478040.desop)
c:RegisterEffect(e2)
end
function c13478040.cfilter(c,tp)
return c:GetSummonPlayer()==tp
end
function c13478040.ctop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c13478040.cfilter,1,nil,1-tp) then
e:GetHandler():AddCounter(0x17,1)
end
end
function c13478040.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x17,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x17,1,REASON_COST)
end
function c13478040.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c13478040.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
\ No newline at end of file
...@@ -23,17 +23,20 @@ function c14466224.initial_effect(c) ...@@ -23,17 +23,20 @@ function c14466224.initial_effect(c)
e2:SetOperation(c14466224.eqop) e2:SetOperation(c14466224.eqop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c14466224.gfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c14466224.spcon(e,c) function c14466224.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.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,2,nil) return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,2,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c14466224.gfilter,tp,LOCATION_GRAVE,0,1,nil)
end end
function c14466224.spop(e,tp,eg,ep,ev,re,r,rp,c) function c14466224.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,2,2,nil) local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,2,2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,1,nil) local g2=Duel.SelectMatchingCard(tp,c14466224.gfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2) g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST) Duel.Remove(g1,POS_FACEUP,REASON_COST)
end end
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
function c18318842.initial_effect(c) function c18318842.initial_effect(c)
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18318842,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1)
e1:SetDescription(aux.Stringid(18318842,0))
e1:SetCost(c18318842.cost) e1:SetCost(c18318842.cost)
e1:SetTarget(c18318842.target) e1:SetTarget(c18318842.target)
e1:SetOperation(c18318842.operation) e1:SetOperation(c18318842.operation)
......
--シャーク·サッカー
function c20838380.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20838380,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c20838380.spcon)
e1:SetTarget(c20838380.sptg)
e1:SetOperation(c20838380.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c20838380.cfilter(c,tp)
return c:IsControler(tp) and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
end
function c20838380.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c20838380.cfilter,1,nil,tp)
end
function c20838380.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20838380.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--コロボックリ
function c21051977.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21051977,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(c21051977.sptg)
e1:SetOperation(c21051977.spop)
c:RegisterEffect(e1)
end
function c21051977.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_HAND,0,1,nil,67445676)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c21051977.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_HAND,0,1,1,nil,67445676)
if g:GetCount()==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--ライライダー
function c31173519.initial_effect(c)
--atk limit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31173519,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_END)
e1:SetCondition(c31173519.condition)
e1:SetOperation(c31173519.operation)
c:RegisterEffect(e1)
end
function c31173519.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and not tc:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c31173519.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
...@@ -34,6 +34,7 @@ function c32491822.initial_effect(c) ...@@ -34,6 +34,7 @@ function c32491822.initial_effect(c)
e4:SetTargetRange(LOCATION_MZONE,0) e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e4:SetCondition(c32491822.atcon)
e4:SetTarget(c32491822.atlimit) e4:SetTarget(c32491822.atlimit)
e4:SetValue(1) e4:SetValue(1)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -79,6 +80,9 @@ function c32491822.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,6 +80,9 @@ function c32491822.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
function c32491822.atcon(e)
return e:GetHandler():IsDefence()
end
function c32491822.atlimit(e,c) function c32491822.atlimit(e,c)
return c~=e:GetHandler() return c~=e:GetHandler()
end end
--三連星のトリオン
function c34796454.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetOperation(c34796454.regop)
c:RegisterEffect(e1)
end
function c34796454.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsReason(REASON_SUMMON) and c:IsReason(REASON_MATERIAL) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34796454,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(c34796454.sptg)
e1:SetOperation(c34796454.spop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c34796454.filter(c)
return c:IsSetCard(0x100d) and c:IsAbleToHand()
end
function c34796454.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c34796454.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
--攻通規制
function c46083380.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,1)
e2:SetCondition(c46083380.atcon)
c:RegisterEffect(e2)
end
function c46083380.atcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),0,LOCATION_MZONE)>=3
end
--クロス·アタック
function c46961802.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(c46961802.target)
e1:SetOperation(c46961802.activate)
c:RegisterEffect(e1)
end
function c46961802.filter1(c,tp)
return c:IsFaceup() and Duel.IsExistingTarget(c46961802.filter2,tp,LOCATION_MZONE,0,1,c,c:GetAttack())
end
function c46961802.filter2(c,atk)
return c:IsFaceup() and c:GetAttack()==atk
end
function c46961802.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c46961802.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g1=Duel.SelectTarget(tp,c46961802.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g2=Duel.SelectTarget(tp,c46961802.filter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst():GetAttack())
end
function c46961802.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:IsFacedown() or tc2:IsFacedown() or not tc1:IsRelateToEffect(e) or not tc2:IsRelateToEffect(e)
or tc1:GetAttack()~=tc2:GetAttack() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc2:RegisterEffect(e2)
tc1:RegisterFlagEffect(46961802,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
tc2:RegisterFlagEffect(46961802,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetOperation(c46961802.atop)
e3:SetLabelObject(tc2)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetLabelObject(tc1)
tc2:RegisterEffect(e4)
end
function c46961802.atop(e,tp,eg,ep,ev,re,r,rp)
local oc=e:GetLabelObject()
if oc:GetFlagEffect(46961802)~=0 then
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
oc:RegisterEffect(e1,true)
end
end
--デス·ウサギ
function c49144107.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49144107,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c49144107.target)
e1:SetOperation(c49144107.operation)
c:RegisterEffect(e1)
end
function c49144107.filter(c)
local tpe=c:GetType()
return c:IsFaceup() and bit.band(tpe,TYPE_NORMAL)~=0 and bit.band(tpe,TYPE_TOKEN)==0
end
function c49144107.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
local dam=Duel.GetMatchingGroupCount(c49144107.filter,tp,LOCATION_MZONE,0,nil)*1000
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c49144107.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetMatchingGroupCount(c49144107.filter,tp,LOCATION_MZONE,0,nil)*1000
Duel.Damage(p,dam,REASON_EFFECT)
end
--テレポンD.D.
function c51701885.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51701885,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(c51701885.rmcon)
e1:SetTarget(c51701885.rmtg)
e1:SetOperation(c51701885.rmop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51701885,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCondition(c51701885.spcon)
e2:SetTarget(c51701885.sptg)
e2:SetOperation(c51701885.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c51701885.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c51701885.filter(c)
return c:IsAttackBelow(1500) and c:IsRace(RACE_PSYCHO) and c:IsAbleToRemove()
end
function c51701885.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c51701885.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c51701885.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c51701885.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
local c=e:GetHandler()
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(51701885,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,3)
tc:RegisterFlagEffect(51701885,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,3)
e:SetLabelObject(tc)
end
end
end
function c51701885.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetLabelObject()
local c=e:GetHandler()
return tc and Duel.GetTurnCount()~=tc:GetTurnID() and Duel.GetTurnPlayer()==tp
and c:GetFlagEffect(51701885)~=0 and tc:GetFlagEffect(51701885)~=0
end
function c51701885.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject():GetLabelObject()
if chk==0 then return tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
tc:CreateEffectRelation(e)
e:GetHandler():ResetFlagEffect(51701885)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
end
function c51701885.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetLabelObject()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ライト·サーペント
function c55501446.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55501446,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c55501446.spcon)
e1:SetTarget(c55501446.sptg)
e1:SetOperation(c55501446.spop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c55501446.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c55501446.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsRelateToEffect(e)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c55501446.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--ハリマンボウ
function c56223084.initial_effect(c)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(56223084,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c56223084.condition)
e1:SetTarget(c56223084.target)
e1:SetOperation(c56223084.operation)
c:RegisterEffect(e1)
end
function c56223084.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c56223084.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return true end
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c56223084.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
--フルエルフ
function c61807040.initial_effect(c)
--lvup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61807040,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c61807040.cost)
e1:SetOperation(c61807040.operation)
c:RegisterEffect(e1)
end
function c61807040.cfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c61807040.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61807040.cfilter,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c61807040.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetLabel(g:GetFirst():GetLevel())
end
function c61807040.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--マツボックル
function c67445676.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67445676,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c67445676.spcon)
e1:SetTarget(c67445676.sptg)
e1:SetOperation(c67445676.spop)
c:RegisterEffect(e1)
end
function c67445676.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsCode(21051977)
end
function c67445676.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c67445676.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--針剣士
function c68167124.initial_effect(c)
--return
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68167124,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetTarget(c68167124.target)
e1:SetOperation(c68167124.operation)
c:RegisterEffect(e1)
end
function c68167124.filter(c)
return c:IsFaceup() and c:GetSequence()~=5
end
function c68167124.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c68167124.filter,tp,0,LOCATION_SZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c68167124.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c68167124.filter,tp,0,LOCATION_SZONE,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
--虚栄巨影
function c73178098.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_ATTACK_ANNOUNCE)
e1:SetTarget(c73178098.target)
e1:SetOperation(c73178098.activate)
c:RegisterEffect(e1)
end
function c73178098.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_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c73178098.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
e1:SetValue(1000)
tc:RegisterEffect(e1)
end
end
--チュウボーン
function c7392745.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7392745,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c7392745.target)
e1:SetOperation(c7392745.operation)
c:RegisterEffect(e1)
end
function c7392745.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,0,0)
end
function c7392745.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<3 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,7392746,0,0x4011,100,300,1,RACE_ZOMBIE,ATTRIBUTE_EARTH,POS_FACEUP_DEFENCE,1-tp) then return end
for i=1,3 do
local token=Duel.CreateToken(tp,7392746)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE)
end
Duel.SpecialSummonComplete()
end
--スナップドラゴン
function c75673220.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75673220,0))
e1:SetCategory(CATEGORY_SPECIAL_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c75673220.condition)
e1:SetTarget(c75673220.target)
e1:SetOperation(c75673220.operation)
c:RegisterEffect(e1)
end
function c75673220.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c75673220.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,75673220)==0 end
Duel.RegisterFlagEffect(tp,75673220,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
end
function c75673220.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end
local rg=g:RandomSelect(tp,1)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1)
e1:SetOperation(c75673220.retop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
rg:GetFirst():RegisterEffect(e1)
end
function c75673220.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
...@@ -14,5 +14,5 @@ function c80032567.initial_effect(c) ...@@ -14,5 +14,5 @@ function c80032567.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c80032567.val(e,c) function c80032567.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0x22)*200 return Duel.GetMatchingGroupCount(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0x22)*200
end end
...@@ -33,7 +33,7 @@ function c82308875.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,7 +33,7 @@ function c82308875.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(d1*700) e1:SetValue(d1*700)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if d1+d2==7 then if d1+d2==7 then
local b1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>1 local b1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>1
......
--同族感電ウィルス
function c86361354.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86361354,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c86361354.cost)
e1:SetTarget(c86361354.target)
e1:SetOperation(c86361354.operation)
c:RegisterEffect(e1)
end
function c86361354.cfilter(c)
local rc=c:GetRace()
return rc~=0 and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c86361354.dfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,rc)
end
function c86361354.dfilter(c,rc)
return c:IsFaceup() and c:IsRace(rc) and c:IsDestructable()
end
function c86361354.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86361354.cfilter,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c86361354.cfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabel(g:GetFirst():GetRace())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c86361354.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c86361354.dfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil,e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c86361354.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c86361354.dfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil,e:GetLabel())
Duel.Destroy(g,REASON_EFFECT)
end
--プラズマ·ボール
function c92595545.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(92595545,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(c92595545.condition)
e2:SetTarget(c92595545.target)
e2:SetOperation(c92595545.operation)
c:RegisterEffect(e2)
end
function c92595545.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==nil
end
function c92595545.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c92595545.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
--キラー·ラブカ
function c93830681.initial_effect(c)
--disable attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93830681,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c93830681.condition)
e1:SetCost(c93830681.cost)
e1:SetTarget(c93830681.target)
e1:SetOperation(c93830681.operation)
c:RegisterEffect(e1)
end
function c93830681.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return at and at:IsControler(tp) and at:IsFaceup() and at:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
and Duel.GetFlagEffect(tp,93830681)==0
end
function c93830681.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c93830681.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
Duel.RegisterFlagEffect(tp,93830681,RESET_PHASE+PHASE_END,0,1)
end
function c93830681.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.DisableAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
end
end
--モンスター·スロット
function c9576193.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c9576193.target)
e1:SetOperation(c9576193.activate)
c:RegisterEffect(e1)
end
function c9576193.filter1(c,tp)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and Duel.IsExistingTarget(c9576193.filter2,tp,LOCATION_GRAVE,0,1,nil,lv)
end
function c9576193.filter2(c,lv)
return c:GetLevel()==lv and c:IsAbleToRemove()
end
function c9576193.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c9576193.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g1=Duel.SelectTarget(tp,c9576193.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,c9576193.filter2,tp,LOCATION_GRAVE,0,1,1,nil,g1:GetFirst():GetLevel())
e:SetLabelObject(g1:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g2,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c9576193.activate(e,tp,eg,ep,ev,re,r,rp)
local tc1=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc2==tc1 then tc2=g:GetNext() end
if tc1:IsFacedown() or not tc1:IsRelateToEffect(e) then return end
if not tc2:IsRelateToEffect(e) or tc2:GetLevel()~=tc1:GetLevel() or Duel.Remove(tc2,POS_FACEUP,REASON_EFFECT)==0 then return end
Duel.BreakEffect()
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local dr=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,dr)
if dr:GetLevel()==tc1:GetLevel() then
Duel.BreakEffect()
if Duel.SpecialSummon(dr,0,tp,tp,false,false,POS_FACEUP)==0 then
Duel.ShuffleHand(tp)
end
else Duel.ShuffleHand(tp) end
end
...@@ -38,6 +38,7 @@ function c98645731.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,6 +38,7 @@ function c98645731.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(p,3) Duel.ConfirmDecktop(p,3)
local g=Duel.GetDecktopGroup(p,3) local g=Duel.GetDecktopGroup(p,3)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil) local sg=g:Select(p,1,1,nil)
if sg:GetFirst():IsAbleToHand() then if sg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
......
...@@ -359,3 +359,4 @@ ...@@ -359,3 +359,4 @@
!counter 0x14 指示物(奇迹之侏罗纪蛋) !counter 0x14 指示物(奇迹之侏罗纪蛋)
!counter 0x15 冰指示物 !counter 0x15 冰指示物
!counter 0x16 魔石指示物 !counter 0x16 魔石指示物
!counter 0x17 橡子指示物
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