Commit 1c3659e9 authored by argon.sun's avatar argon.sun

new scripts

parent 997c67d0
...@@ -1875,7 +1875,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -1875,7 +1875,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame->dField.chains.clear(); mainGame->dField.chains.clear();
return true; return true;
} }
case MSG_CHAIN_INACTIVATED: case MSG_CHAIN_NEGATED:
case MSG_CHAIN_DISABLED: { case MSG_CHAIN_DISABLED: {
int ct = BufferIO::ReadInt8(pbuf); int ct = BufferIO::ReadInt8(pbuf);
mainGame->showcardcode = mainGame->dField.chains[ct - 1].code; mainGame->showcardcode = mainGame->dField.chains[ct - 1].code;
......
...@@ -392,7 +392,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -392,7 +392,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
pauseable = false; pauseable = false;
break; break;
} }
case MSG_CHAIN_INACTIVATED: { case MSG_CHAIN_NEGATED: {
pbuf++; pbuf++;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
break; break;
......
...@@ -983,7 +983,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -983,7 +983,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
RefreshSzone(1); RefreshSzone(1);
break; break;
} }
case MSG_CHAIN_INACTIVATED: { case MSG_CHAIN_NEGATED: {
pbuf++; pbuf++;
NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset);
NetServer::ReSendToPlayer(players[1]); NetServer::ReSendToPlayer(players[1]);
......
...@@ -882,7 +882,7 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -882,7 +882,7 @@ void card::reset(uint32 id, uint32 reset_type) {
pr = field_effect.equal_range(EFFECT_DISABLE_FIELD); pr = field_effect.equal_range(EFFECT_DISABLE_FIELD);
for(; pr.first != pr.second; ++pr.first) for(; pr.first != pr.second; ++pr.first)
pr.first->second->value = 0; pr.first->second->value = 0;
set_status(STATUS_UNION + STATUS_BATTLE_DESTROYED, FALSE); set_status(STATUS_UNION, FALSE);
} }
if(id & 0x57e0000) { if(id & 0x57e0000) {
counters.clear(); counters.clear();
......
...@@ -670,7 +670,7 @@ public: ...@@ -670,7 +670,7 @@ public:
#define MSG_CHAIN_SOLVING 72 #define MSG_CHAIN_SOLVING 72
#define MSG_CHAIN_SOLVED 73 #define MSG_CHAIN_SOLVED 73
#define MSG_CHAIN_END 74 #define MSG_CHAIN_END 74
#define MSG_CHAIN_INACTIVATED 75 #define MSG_CHAIN_NEGATED 75
#define MSG_CHAIN_DISABLED 76 #define MSG_CHAIN_DISABLED 76
#define MSG_CARD_SELECTED 80 #define MSG_CARD_SELECTED 80
#define MSG_RANDOM_SELECTED 81 #define MSG_RANDOM_SELECTED 81
......
...@@ -27,7 +27,7 @@ int32 field::negate_chain(uint8 chaincount) { ...@@ -27,7 +27,7 @@ int32 field::negate_chain(uint8 chaincount) {
pchain.triggering_effect->handler->set_status(STATUS_LEAVE_CONFIRMED, TRUE); pchain.triggering_effect->handler->set_status(STATUS_LEAVE_CONFIRMED, TRUE);
pchain.triggering_effect->handler->set_status(STATUS_ACTIVATE_DISABLED, TRUE); pchain.triggering_effect->handler->set_status(STATUS_ACTIVATE_DISABLED, TRUE);
} }
pduel->write_buffer8(MSG_CHAIN_INACTIVATED); pduel->write_buffer8(MSG_CHAIN_NEGATED);
pduel->write_buffer8(chaincount); pduel->write_buffer8(chaincount);
return TRUE; return TRUE;
} }
...@@ -1823,7 +1823,6 @@ int32 field::destroy(uint16 step, group * targets, card * target, uint8 battle) ...@@ -1823,7 +1823,6 @@ int32 field::destroy(uint16 step, group * targets, card * target, uint8 battle)
} }
if(targets->container.find(target) == targets->container.end()) if(targets->container.find(target) == targets->container.end())
return TRUE; return TRUE;
if(!(target->current.reason & REASON_RULE)) {
returns.ivalue[0] = FALSE; returns.ivalue[0] = FALSE;
effect_set eset; effect_set eset;
target->filter_single_continuous_effect(EFFECT_DESTROY_REPLACE, &eset); target->filter_single_continuous_effect(EFFECT_DESTROY_REPLACE, &eset);
...@@ -1833,7 +1832,6 @@ int32 field::destroy(uint16 step, group * targets, card * target, uint8 battle) ...@@ -1833,7 +1832,6 @@ int32 field::destroy(uint16 step, group * targets, card * target, uint8 battle)
else else
for (int32 i = 0; i < eset.count; ++i) for (int32 i = 0; i < eset.count; ++i)
add_process(PROCESSOR_OPERATION_REPLACE, 10, eset[i], targets, (ptr)target, 1); add_process(PROCESSOR_OPERATION_REPLACE, 10, eset[i], targets, (ptr)target, 1);
}
return TRUE; return TRUE;
} }
int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint32 reason, uint8 reason_player) { int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint32 reason, uint8 reason_player) {
...@@ -1852,7 +1850,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -1852,7 +1850,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
(*rm)->current.reason_player = (*rm)->temp.reason_player; (*rm)->current.reason_player = (*rm)->temp.reason_player;
(*rm)->set_status(STATUS_DESTROY_CONFIRMED, FALSE); (*rm)->set_status(STATUS_DESTROY_CONFIRMED, FALSE);
targets->container.erase(*rm); targets->container.erase(*rm);
continue;
} }
} }
(*rm)->filter_effect(EFFECT_DESTROY_SUBSTITUTE, &eset); (*rm)->filter_effect(EFFECT_DESTROY_SUBSTITUTE, &eset);
...@@ -1890,8 +1887,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -1890,8 +1887,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
targets->container.insert(rep); targets->container.insert(rep);
} }
} }
if(reason & REASON_RULE)
return FALSE;
auto pr = effects.continuous_effect.equal_range(EFFECT_DESTROY_REPLACE); auto pr = effects.continuous_effect.equal_range(EFFECT_DESTROY_REPLACE);
for (; pr.first != pr.second; ++pr.first) for (; pr.first != pr.second; ++pr.first)
add_process(PROCESSOR_OPERATION_REPLACE, 5, pr.first->second, targets, 0, 1); add_process(PROCESSOR_OPERATION_REPLACE, 5, pr.first->second, targets, 0, 1);
...@@ -1986,7 +1981,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -1986,7 +1981,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
(*rm)->current.reason_player = (*rm)->temp.reason_player; (*rm)->current.reason_player = (*rm)->temp.reason_player;
(*rm)->set_status(STATUS_DESTROY_CONFIRMED, FALSE); (*rm)->set_status(STATUS_DESTROY_CONFIRMED, FALSE);
targets->container.erase(*rm); targets->container.erase(*rm);
continue;
} }
} }
(*rm)->filter_effect(EFFECT_DESTROY_SUBSTITUTE, &eset); (*rm)->filter_effect(EFFECT_DESTROY_SUBSTITUTE, &eset);
...@@ -2229,7 +2223,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2229,7 +2223,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
(*cit)->operation_param = ((*cit)->operation_param & 0xffff0000) + (redirect << 8) + (redirect >> 16); (*cit)->operation_param = ((*cit)->operation_param & 0xffff0000) + (redirect << 8) + (redirect >> 16);
dest = redirect; dest = redirect;
} }
if((*cit)->is_status(STATUS_BATTLE_DESTROYED) && !((*cit)->current.reason & REASON_DESTROY)) if(((*cit)->current.location == LOCATION_MZONE) && (*cit)->is_status(STATUS_BATTLE_DESTROYED) && !((*cit)->current.reason & REASON_DESTROY))
(*cit)->current.reason |= REASON_DESTROY | REASON_BATTLE; (*cit)->current.reason |= REASON_DESTROY | REASON_BATTLE;
if(((*cit)->current.location & LOCATION_ONFIELD) && !(*cit)->is_status(STATUS_SUMMON_DISABLED)) { if(((*cit)->current.location & LOCATION_ONFIELD) && !(*cit)->is_status(STATUS_SUMMON_DISABLED)) {
raise_single_event(*cit, EVENT_LEAVE_FIELD_P, (*cit)->current.reason_effect, (*cit)->current.reason, (*cit)->current.reason_player, 0, 0); raise_single_event(*cit, EVENT_LEAVE_FIELD_P, (*cit)->current.reason_effect, (*cit)->current.reason, (*cit)->current.reason_player, 0, 0);
...@@ -2833,7 +2827,7 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar ...@@ -2833,7 +2827,7 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar
uint32 is_destroy = arg2; uint32 is_destroy = arg2;
for (cit = targets->container.begin(); cit != targets->container.end();) { for (cit = targets->container.begin(); cit != targets->container.end();) {
rm = cit++; rm = cit++;
if (!((*rm)->current.reason & REASON_RULE) && replace_effect->get_value(*rm)) { if (replace_effect->get_value(*rm)) {
(*rm)->current.reason = (*rm)->temp.reason; (*rm)->current.reason = (*rm)->temp.reason;
(*rm)->current.reason_effect = (*rm)->temp.reason_effect; (*rm)->current.reason_effect = (*rm)->temp.reason_effect;
(*rm)->current.reason_player = (*rm)->temp.reason_player; (*rm)->current.reason_player = (*rm)->temp.reason_player;
...@@ -2949,7 +2943,7 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar ...@@ -2949,7 +2943,7 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar
uint32 is_destroy = arg2; uint32 is_destroy = arg2;
for (cit = targets->container.begin(); cit != targets->container.end();) { for (cit = targets->container.begin(); cit != targets->container.end();) {
rm = cit++; rm = cit++;
if (!((*rm)->current.reason & REASON_RULE) && replace_effect->get_value(*rm)) { if (replace_effect->get_value(*rm)) {
(*rm)->current.reason = (*rm)->temp.reason; (*rm)->current.reason = (*rm)->temp.reason;
(*rm)->current.reason_effect = (*rm)->temp.reason_effect; (*rm)->current.reason_effect = (*rm)->temp.reason_effect;
(*rm)->current.reason_player = (*rm)->temp.reason_player; (*rm)->current.reason_player = (*rm)->temp.reason_player;
......
--コアキメイル·ルークロード
function c10060427.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c10060427.ccost)
c:RegisterEffect(e1)
--summon with 1 tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10060427,3))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(c10060427.otcon)
e2:SetOperation(c10060427.otop)
e2:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e2)
--summon success
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10060427,4))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCost(c10060427.descost)
e3:SetTarget(c10060427.destg)
e3:SetOperation(c10060427.desop)
c:RegisterEffect(e3)
end
function c10060427.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c10060427.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_WARRIOR) and not c:IsPublic()
end
function c10060427.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c10060427.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c10060427.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(10060427,0),aux.Stringid(10060427,1),aux.Stringid(10060427,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(10060427,0),aux.Stringid(10060427,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(10060427,1),aux.Stringid(10060427,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c10060427.otcon(e,c)
if c==nil then return true end
local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and g:IsExists(Card.IsSetCard,1,nil,0x1d)
end
function c10060427.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0x1d)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c10060427.dfilter(c)
return c:IsSetCard(0x1d) and c:IsAbleToRemoveAsCost()
end
function c10060427.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10060427.dfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c10060427.dfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c10060427.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10060427.desop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--レクリスパワー
function c11596936.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:SetCost(c11596936.cost)
e1:SetTarget(c11596936.target)
e1:SetOperation(c11596936.activate)
c:RegisterEffect(e1)
end
function c11596936.cfilter(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c11596936.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11596936.cfilter,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c11596936.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c11596936.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c11596936.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11596936.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(c11596936.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c11596936.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c11596936.filter,tp,0,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(sg,REASON_EFFECT)
end
--コアキメイルの障壁
function c12216615.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(c12216615.condition)
e1:SetTarget(c12216615.target)
e1:SetOperation(c12216615.activate)
c:RegisterEffect(e1)
end
function c12216615.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,2,nil,36623431)
end
function c12216615.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsDestructable()
end
function c12216615.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12216615.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c12216615.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c12216615.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c12216615.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
...@@ -49,7 +49,7 @@ function c12435193.ccost(e,tp) ...@@ -49,7 +49,7 @@ function c12435193.ccost(e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
else else
Duel.Destroy(e:GetHandler(),REASON_COST) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c12435193.disspsum(e,c) function c12435193.disspsum(e,c)
......
--コア濃度圧縮
function c13997673.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c13997673.cost)
e1:SetTarget(c13997673.target)
e1:SetOperation(c13997673.activate)
c:RegisterEffect(e1)
end
function c13997673.cfilter1(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c13997673.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1d) and c:IsDiscardable()
end
function c13997673.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13997673.cfilter1,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c13997673.cfilter2,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,c13997673.cfilter1,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g2=Duel.SelectMatchingCard(tp,c13997673.cfilter2,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g2,REASON_COST+REASON_DISCARD)
Duel.ShuffleHand(tp)
end
function c13997673.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c13997673.activate(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 c176392.initial_effect(c)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c176392.descon)
e1:SetTarget(c176392.destg)
e1:SetValue(c176392.repval)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(176392,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DESTROY)
e2:SetCondition(c176392.spcon)
e2:SetTarget(c176392.sptg)
e2:SetOperation(c176392.spop)
c:RegisterEffect(e2)
end
function c176392.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END
end
function c176392.rfilter(c,rc)
return c~=rc and c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x1d)
end
function c176392.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c176392.rfilter,1,nil,e:GetHandler()) end
if Duel.SelectYesNo(tp,aux.Stringid(176392,0)) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
return true
else return false end
end
function c176392.repval(e,c)
return c:IsFaceup() and c:IsSetCard(0x1d) and c~=e:GetHandler()
end
function c176392.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and eg:IsExists(c176392.rfilter,1,nil)
end
function c176392.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,176393,0x1d,0x4011,1800,1800,4,RACE_ROCK,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c176392.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,176393,0x1d,0x4011,1800,1800,4,RACE_ROCK,ATTRIBUTE_EARTH) then return end
local token=Duel.CreateToken(tp,176393)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
--コア·ブラスト
function c18517177.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--maintain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18517177,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c18517177.descon)
e2:SetTarget(c18517177.destg)
e2:SetOperation(c18517177.desop)
c:RegisterEffect(e2)
end
function c18517177.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c18517177.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
and Duel.IsExistingMatchingCard(c18517177.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c18517177.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)-Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,ct,0,0)
end
function c18517177.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
local ct=g:GetCount()-Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,ct,ct,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
--コアキメイル·パワーハンド
function c19642889.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c19642889.ccost)
c:RegisterEffect(e1)
--negate
e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetOperation(c19642889.negop1)
c:RegisterEffect(e2)
e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetOperation(c19642889.negop2)
c:RegisterEffect(e3)
end
function c19642889.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c19642889.cfilter2(c)
return c:GetType()==TYPE_TRAP and not c:IsPublic()
end
function c19642889.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c19642889.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c19642889.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(19642889,0),aux.Stringid(19642889,1),aux.Stringid(19642889,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(19642889,0),aux.Stringid(19642889,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(19642889,1),aux.Stringid(19642889,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c19642889.negop1(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d and d:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
d:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
d:RegisterEffect(e2)
end
end
function c19642889.negop2(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
if a and a:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
a:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
a:RegisterEffect(e2)
end
end
--鋼核収納
function c20457551.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(c20457551.target)
e1:SetOperation(c20457551.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c20457551.eqlimit)
c:RegisterEffect(e2)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c20457551.atkdown)
c:RegisterEffect(e3)
--destroy sub
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(c20457551.desreptg)
c:RegisterEffect(e4)
end
function c20457551.eqlimit(e,c)
return c:IsSetCard(0x1d)
end
function c20457551.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c20457551.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c20457551.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20457551.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c20457551.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c20457551.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c20457551.atkdown(e,tp,eg,ep,ev,re,r,rp)
local eqc=e:GetHandler():GetEquipTarget()
if Duel.GetAttacker()~=eqc and Duel.GetAttackTarget()~=eqc then return end
local tc=eqc:GetBattleTarget()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
e1:SetValue(-eqc:GetLevel()*100)
tc:RegisterEffect(e1)
end
function c20457551.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentPhase()==PHASE_END end
if Duel.SelectYesNo(tp,aux.Stringid(20457551,0)) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
return true
else return false end
end
--コア転送ユニット
function c30770156.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30770156,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c30770156.cost)
e2:SetTarget(c30770156.target)
e2:SetOperation(c30770156.operation)
c:RegisterEffect(e2)
end
function c30770156.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c30770156.filter(c)
return c:IsCode(36623431) and c:IsAbleToHand()
end
function c30770156.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30770156.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c30770156.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c30770156.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--コアキメイル·ウルナイト
function c30936186.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c30936186.ccost)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30936186,3))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c30936186.spcost)
e2:SetTarget(c30936186.sptg)
e2:SetOperation(c30936186.spop)
c:RegisterEffect(e2)
end
function c30936186.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c30936186.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEASTWARRIOR) and not c:IsPublic()
end
function c30936186.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c30936186.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c30936186.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(30936186,0),aux.Stringid(30936186,1),aux.Stringid(30936186,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(30936186,0),aux.Stringid(30936186,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(30936186,1),aux.Stringid(30936186,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c30936186.cfilter(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c30936186.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30936186.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c30936186.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c30936186.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x1d) and c:GetCode()~=30936186 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c30936186.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c30936186.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c30936186.spop(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,c30936186.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--コアキメイル·フルバリア
function c31692182.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31692182,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c31692182.cost)
e1:SetOperation(c31692182.operation)
c:RegisterEffect(e1)
end
function c31692182.cfilter(c)
return c:IsCode(36623431) and c:IsAbleToDeckAsCost()
end
function c31692182.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31692182.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c31692182.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,0,REASON_COST)
end
function c31692182.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsSetCard(0x1d)
end
function c31692182.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c31692182.tgfilter)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
function c31692182.tgfilter(e,c)
return not c:IsSetCard(0x1d)
end
--コアキメイル·クルセイダー
function c32314730.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c32314730.ccost)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32314730,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetTarget(c32314730.thtg)
e2:SetOperation(c32314730.thop)
c:RegisterEffect(e2)
end
function c32314730.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c32314730.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEASTWARRIOR) and not c:IsPublic()
end
function c32314730.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c32314730.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c32314730.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(32314730,0),aux.Stringid(32314730,1),aux.Stringid(32314730,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(32314730,0),aux.Stringid(32314730,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(32314730,1),aux.Stringid(32314730,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c32314730.filter(c)
return c:IsSetCard(0x1d) and c:IsAbleToHand()
end
function c32314730.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c32314730.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c32314730.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c32314730.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c32314730.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--鋼核の輝き
function c34545235.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c34545235.condition)
e1:SetCost(c34545235.cost)
e1:SetTarget(c34545235.target)
e1:SetOperation(c34545235.activate)
c:RegisterEffect(e1)
end
function c34545235.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainInactivatable(ev)
end
function c34545235.cfilter(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c34545235.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34545235.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c34545235.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c34545235.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c34545235.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--オーバー·コアリミット
function c36560997.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x1d))
e2:SetValue(500)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(36560997,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCost(c36560997.atcost)
e3:SetTarget(c36560997.attg)
e3:SetOperation(c36560997.atop)
c:RegisterEffect(e3)
end
function c36560997.cfilter(c)
return c:IsCode(36623431) and c:IsDiscardable()
end
function c36560997.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36560997.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c36560997.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c36560997.filter(c)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c36560997.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36560997.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c36560997.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c36560997.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--コアキメイル·ビートル
function c39037517.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c39037517.ccost)
c:RegisterEffect(e1)
--poschange
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39037517,3))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c39037517.target)
e2:SetOperation(c39037517.operation)
c:RegisterEffect(e2)
end
function c39037517.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c39037517.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_INSECT) and not c:IsPublic()
end
function c39037517.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c39037517.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c39037517.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(39037517,0),aux.Stringid(39037517,1),aux.Stringid(39037517,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(39037517,0),aux.Stringid(39037517,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(39037517,1),aux.Stringid(39037517,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c39037517.filter(c,e)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
and (not e or c:IsRelateToEffect(e))
end
function c39037517.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c39037517.filter,1,nil) end
Duel.SetTargetCard(eg)
end
function c39037517.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c39037517.filter,nil,e)
Duel.ChangePosition(g,POS_FACEUP_DEFENCE)
end
--コアキメイル·グラヴィローズ
function c41201555.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c41201555.ccost)
c:RegisterEffect(e1)
--send to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(41201555,3))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCondition(c41201555.condition)
e2:SetTarget(c41201555.target)
e2:SetOperation(c41201555.operation)
c:RegisterEffect(e2)
end
function c41201555.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c41201555.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_PLANT) and not c:IsPublic()
end
function c41201555.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c41201555.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c41201555.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(41201555,0),aux.Stringid(41201555,1),aux.Stringid(41201555,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(41201555,0),aux.Stringid(41201555,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(41201555,1),aux.Stringid(41201555,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c41201555.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c41201555.tgfilter(c)
return c:IsLevelBelow(3) and c:IsAbleToGrave()
end
function c41201555.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41201555.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c41201555.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c41201555.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
...@@ -54,7 +54,7 @@ function c45041488.ccost(e,tp) ...@@ -54,7 +54,7 @@ function c45041488.ccost(e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
else else
Duel.Destroy(e:GetHandler(),REASON_COST) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c45041488.condition(e,tp,eg,ep,ev,re,r,rp) function c45041488.condition(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -54,7 +54,7 @@ function c49680980.ccost(e,tp) ...@@ -54,7 +54,7 @@ function c49680980.ccost(e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
else else
Duel.Destroy(e:GetHandler(),REASON_COST) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c49680980.condition(e,tp,eg,ep,ev,re,r,rp) function c49680980.condition(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -52,7 +52,7 @@ function c5183693.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function c5183693.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Equip(tp,e:GetHandler(),tc) Duel.Equip(tp,e:GetHandler(),tc)
end end
end end
function c5183693.atkup(e,tp,eg,ep,ev,re,r,rp,chk) function c5183693.atkup(e,tp,eg,ep,ev,re,r,rp)
local eqc=e:GetHandler():GetEquipTarget() local eqc=e:GetHandler():GetEquipTarget()
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
...@@ -72,7 +72,6 @@ function c5183693.atkup(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -72,7 +72,6 @@ function c5183693.atkup(e,tp,eg,ep,ev,re,r,rp,chk)
d:RegisterEffect(e1) d:RegisterEffect(e1)
end end
end end
function c5183693.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c5183693.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
......
--鋼核合成獣研究所
function c53039326.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--maintain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetOperation(c53039326.mtop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_DESTROY)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c53039326.check)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetDescription(aux.Stringid(53039326,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER)
e4:SetCode(53039326)
e4:SetTarget(c53039326.target)
e4:SetOperation(c53039326.operation)
c:RegisterEffect(e4)
end
function c53039326.cfilter(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c53039326.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
local g=Duel.GetMatchingGroup(c53039326.cfilter,tp,LOCATION_HAND,0,nil)
local sel=1
if g:GetCount()~=0 then
sel=Duel.SelectOption(tp,aux.Stringid(53039326,0),aux.Stringid(53039326,1))
else
sel=Duel.SelectOption(tp,aux.Stringid(53039326,1))+1
end
if sel==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c53039326.check(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCurrentPhase()~=PHASE_END then return end
local tc=eg:GetFirst()
local turnp=Duel.GetTurnPlayer()
local b1=false
local b2=false
while tc do
if tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and tc:IsSetCard(0x1d) then
if tc:GetOwner()==turnp then b1=true else b2=true end
end
tc=eg:GetNext()
end
if b1 then Duel.RaiseSingleEvent(c,53039326,e,r,rp,turnp,0) end
if b2 then Duel.RaiseSingleEvent(c,53039326,e,r,rp,1-turnp,0) end
end
function c53039326.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1d) and c:IsAbleToHand()
end
function c53039326.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c53039326.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c53039326.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53039326.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--コアキメイル·アイス
function c54520292.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c54520292.ccost)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(54520292,3))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c54520292.descost)
e2:SetTarget(c54520292.destg)
e2:SetOperation(c54520292.desop)
c:RegisterEffect(e2)
end
function c54520292.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c54520292.cfilter2(c)
return c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and not c:IsPublic()
end
function c54520292.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c54520292.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c54520292.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(54520292,0),aux.Stringid(54520292,1),aux.Stringid(54520292,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(54520292,0),aux.Stringid(54520292,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(54520292,1),aux.Stringid(54520292,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c54520292.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c54520292.filter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and c:IsDestructable()
end
function c54520292.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c54520292.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c54520292.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c54520292.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c54520292.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 c55117418.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c55117418.condition)
e1:SetTarget(c55117418.target)
e1:SetOperation(c55117418.activate)
c:RegisterEffect(e1)
end
function c55117418.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c55117418.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainInactivatable(ev)
and Duel.IsExistingMatchingCard(c55117418.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,36623431)
end
function c55117418.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c55117418.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--コアキメイル·グールズスレイブ
function c5817857.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c5817857.ccost)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c5817857.destg)
e2:SetValue(1)
e2:SetOperation(c5817857.desop)
c:RegisterEffect(e2)
end
function c5817857.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c5817857.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_ZOMBIE) and not c:IsPublic()
end
function c5817857.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c5817857.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c5817857.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(5817857,0),aux.Stringid(5817857,1),aux.Stringid(5817857,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(5817857,0),aux.Stringid(5817857,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(5817857,1),aux.Stringid(5817857,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c5817857.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1d) and c:IsAbleToRemove()
end
function c5817857.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if eg:GetCount()~=1 then return false end
local tc=eg:GetFirst()
return tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and tc:IsSetCard(0x1d) and tc:IsReason(REASON_BATTLE+REASON_EFFECT)
and Duel.IsExistingMatchingCard(c5817857.rfilter,tp,LOCATION_GRAVE,0,1,nil)
end
return Duel.SelectYesNo(tp,aux.Stringid(5817857,3))
end
function c5817857.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c5817857.rfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
--オートマチック·レーザー
function c58990631.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c58990631.cost)
e1:SetTarget(c58990631.target)
e1:SetOperation(c58990631.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCost(c58990631.cost)
e2:SetTarget(c58990631.target2)
e2:SetOperation(c58990631.activate2)
c:RegisterEffect(e2)
end
function c58990631.cfilter(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c58990631.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58990631.cfilter,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c58990631.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c58990631.filter(c,tp,ep)
return c:IsFaceup() and c:IsAttackAbove(1000)
and ep~=tp and c:IsDestructable()
end
function c58990631.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return c58990631.filter(tc,tp,ep) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
function c58990631.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(1000) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c58990631.filter2(c,tp)
return c:IsFaceup() and c:IsAttackAbove(1000) and c:GetSummonPlayer()~=tp
and c:IsDestructable()
end
function c58990631.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c58990631.filter2,1,nil,tp) end
local g=eg:Filter(c58990631.filter2,nil,tp)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c58990631.filter3(c,e,tp)
return c:IsFaceup() and c:IsAttackAbove(1000) and c:GetSummonPlayer()~=tp
and c:IsRelateToEffect(e) and c:IsDestructable()
end
function c58990631.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c58990631.filter3,nil,e,tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--コアバスター
function c59385322.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(c59385322.target)
e1:SetOperation(c59385322.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c59385322.eqlimit)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(59385322,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_BATTLE_START)
e3:SetCondition(c59385322.descon)
e3:SetTarget(c59385322.destg)
e3:SetOperation(c59385322.desop)
c:RegisterEffect(e3)
--salvage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(59385322,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c59385322.thcon)
e4:SetTarget(c59385322.thtg)
e4:SetOperation(c59385322.thop)
c:RegisterEffect(e4)
end
function c59385322.eqlimit(e,c)
return c:IsSetCard(0x1d)
end
function c59385322.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c59385322.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c59385322.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c59385322.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c59385322.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c59385322.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c59385322.descon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if ec~=Duel.GetAttacker() and ec~=Duel.GetAttackTarget() then return false end
local tc=ec:GetBattleTarget()
e:SetLabelObject(tc)
return tc and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c59385322.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetLabelObject(),1,0,0)
end
function c59385322.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsRelateToBattle() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c59385322.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_LOST_TARGET)
and not e:GetHandler():GetPreviousEquipTarget():IsLocation(LOCATION_MZONE)
end
function c59385322.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c59385322.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
--緊急鋼核処分
function c63018036.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c63018036.target)
e1:SetOperation(c63018036.activate)
c:RegisterEffect(e1)
end
function c63018036.tgfilter(c)
return c:IsCode(36623431) and c:IsAbleToGrave()
end
function c63018036.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c63018036.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c63018036.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c63018036.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--コアキメイル·ロック
function c6320631.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6320631,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c6320631.condition)
e1:SetTarget(c6320631.target)
e1:SetOperation(c6320631.operation)
c:RegisterEffect(e1)
end
function c6320631.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c6320631.filter(c)
return (c:IsCode(36623431) or (c:IsLevelBelow(4) and c:IsSetCard(0x1d))) and c:IsAbleToHand()
end
function c6320631.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6320631.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c6320631.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c6320631.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--コアキメイル·マキシマム
function c65026212.initial_effect(c)
c:EnableReviveLimit()
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c65026212.ccost)
c:RegisterEffect(e1)
--spsummon proc
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c65026212.spcon)
e2:SetOperation(c65026212.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(65026212,3))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c65026212.destg)
e3:SetOperation(c65026212.desop)
c:RegisterEffect(e3)
end
function c65026212.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c65026212.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1d) and c:IsAbleToGraveAsCost()
end
function c65026212.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c65026212.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c65026212.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(65026212,0),aux.Stringid(65026212,1),aux.Stringid(65026212,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(65026212,0),aux.Stringid(65026212,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(65026212,1),aux.Stringid(65026212,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g2:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c65026212.spfilter(c)
return c:IsCode(36623431) and c:IsAbleToRemoveAsCost()
end
function c65026212.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c65026212.spfilter,tp,LOCATION_HAND,0,1,nil)
end
function c65026212.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c65026212.spfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c65026212.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c65026212.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
...@@ -54,7 +54,7 @@ function c66816282.ccost(e,tp) ...@@ -54,7 +54,7 @@ function c66816282.ccost(e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
else else
Duel.Destroy(e:GetHandler(),REASON_COST) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c66816282.condition(e,tp,eg,ep,ev,re,r,rp) function c66816282.condition(e,tp,eg,ep,ev,re,r,rp)
......
--コアキメイル·スピード
function c68809475.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c68809475.ccost)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(68809475,3))
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DRAW)
e2:SetCondition(c68809475.drcon)
e2:SetCost(c68809475.drcost)
e2:SetTarget(c68809475.drtg)
e2:SetOperation(c68809475.drop)
c:RegisterEffect(e2)
end
function c68809475.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c68809475.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_MACHINE) and not c:IsPublic()
end
function c68809475.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c68809475.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c68809475.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(68809475,0),aux.Stringid(68809475,1),aux.Stringid(68809475,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(68809475,0),aux.Stringid(68809475,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(68809475,1),aux.Stringid(68809475,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c68809475.filter(c)
return c:IsCode(36623431) and not c:IsPublic()
end
function c68809475.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_DRAW
end
function c68809475.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c68809475.filter,1,nil) end
local g=eg:Filter(c68809475.filter,nil)
if g:GetCount()==1 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
end
function c68809475.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c68809475.drop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFacedown() or not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--コアキメイル·ヴァラファール
function c72258771.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c72258771.ccost)
c:RegisterEffect(e1)
--summon with 1 tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(72258771,2))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(c72258771.otcon)
e2:SetOperation(c72258771.otop)
e2:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c72258771.efilter)
c:RegisterEffect(e4)
end
function c72258771.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c72258771.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c72258771.cfilter1,tp,LOCATION_HAND,0,nil)
local select=1
if g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(72258771,0),aux.Stringid(72258771,1))
else
select=Duel.SelectOption(tp,aux.Stringid(72258771,1))+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
function c72258771.otcon(e,c)
if c==nil then return true end
local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and g:IsExists(Card.IsSetCard,1,nil,0x1d)
end
function c72258771.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0x1d)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c72258771.efilter(e,re,rp)
return re:IsActiveType(TYPE_TRAP)
end
--コアキメイル·シーパンサー
function c74576482.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c74576482.ccost)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74576482,3))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c74576482.tdcost)
e2:SetTarget(c74576482.tdtg)
e2:SetOperation(c74576482.tdop)
c:RegisterEffect(e2)
end
function c74576482.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c74576482.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsPublic()
end
function c74576482.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c74576482.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c74576482.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(74576482,0),aux.Stringid(74576482,1),aux.Stringid(74576482,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(74576482,0),aux.Stringid(74576482,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(74576482,1),aux.Stringid(74576482,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c74576482.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74576482.cfilter1,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_GRAVE)
local g=Duel.SelectMatchingCard(tp,c74576482.cfilter1,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c74576482.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c74576482.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74576482.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74576482.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c74576482.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c74576482.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
...@@ -51,7 +51,7 @@ function c80367387.ccost(e,tp) ...@@ -51,7 +51,7 @@ function c80367387.ccost(e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
else else
Duel.Destroy(e:GetHandler(),REASON_COST) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c80367387.atcon(e,tp,eg,ep,ev,re,r,rp) function c80367387.atcon(e,tp,eg,ep,ev,re,r,rp)
......
--コアの再練成
function c8057630.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_END_PHASE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c8057630.target)
e1:SetOperation(c8057630.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c8057630.desop)
c:RegisterEffect(e2)
--Destroy2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c8057630.descon2)
e3:SetOperation(c8057630.desop2)
e2:SetLabelObject(e3)
c:RegisterEffect(e3)
end
function c8057630.filter(c,e,tp)
return c:IsSetCard(0x1d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c8057630.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp
and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c8057630.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c8057630.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c8057630.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)==0 then return end
c:SetCardTarget(tc)
end
end
function c8057630.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if not tc then return end
if tc:IsLocation(LOCATION_MZONE) and Duel.Destroy(tc,REASON_EFFECT)==0 then return end
if re~=e:GetLabelObject() and Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END then
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
Duel.Damage(tp,atk,REASON_EFFECT)
end
end
function c8057630.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsReason(REASON_DESTROY)
end
function c8057630.desop2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END then
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
Duel.Damage(tp,atk,REASON_EFFECT)
end
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
...@@ -48,7 +48,7 @@ function c80925836.ccost(e,tp) ...@@ -48,7 +48,7 @@ function c80925836.ccost(e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
else else
Duel.Destroy(e:GetHandler(),REASON_COST) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c80925836.disop(e,tp,eg,ep,ev,re,r,rp) function c80925836.disop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -29,13 +29,13 @@ function c87148330.drcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,13 +29,13 @@ function c87148330.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function c87148330.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function c87148330.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c87148330.drop(e,tp,eg,ep,ev,re,r,rp) function c87148330.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if e:GetHandler():IsFacedown() or not e:GetHandler():IsRelateToEffect(e) then return end
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.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
--鋼核初期化
function c91985515.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c91985515.cost)
e1:SetTarget(c91985515.target)
e1:SetOperation(c91985515.activate)
c:RegisterEffect(e1)
end
function c91985515.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x1d) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x1d)
Duel.Release(g,REASON_COST)
end
function c91985515.filter(c)
return c:IsCode(36623431) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c91985515.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c91985515.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c91985515.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c91985515.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--コアキメイル·ウォーアームズ
function c95090813.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c95090813.ccost)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95090813,3))
e2:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c95090813.eqtg)
e2:SetOperation(c95090813.eqop)
c:RegisterEffect(e2)
end
function c95090813.cfilter1(c)
return c:IsCode(36623431) and c:IsAbleToGraveAsCost()
end
function c95090813.cfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_WARRIOR) and not c:IsPublic()
end
function c95090813.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
local g1=Duel.GetMatchingGroup(c95090813.cfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(c95090813.cfilter2,tp,LOCATION_HAND,0,nil)
local select=2
if g1:GetCount()>0 and g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(95090813,0),aux.Stringid(95090813,1),aux.Stringid(95090813,2))
elseif g1:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(95090813,0),aux.Stringid(95090813,2))
if select==1 then select=2 end
elseif g2:GetCount()>0 then
select=Duel.SelectOption(tp,aux.Stringid(95090813,1),aux.Stringid(95090813,2))
select=select+1
end
if select==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
elseif select==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=g2:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c95090813.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_WARRIOR)
end
function c95090813.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c95090813.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c95090813.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c95090813.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c95090813.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c95090813.eqlimit)
tc:RegisterEffect(e1)
local atk=tc:GetAttack()
if atk<0 then atk=0 end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(atk/2)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetValue(c95090813.subval)
tc:RegisterEffect(e3)
end
end
function c95090813.eqlimit(e,c)
return e:GetOwner()==c
end
function c95090813.subval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
--コアキメイル·トルネード
function c95204084.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95204084,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c95204084.cost)
e1:SetTarget(c95204084.target)
e1:SetOperation(c95204084.operation)
c:RegisterEffect(e1)
end
function c95204084.cfilter(c)
return c:IsCode(36623431) and c:IsAbleToDeckAsCost()
end
function c95204084.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95204084.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c95204084.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,0,REASON_COST)
end
function c95204084.filter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and c:IsDestructable()
end
function c95204084.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95204084.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c95204084.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c95204084.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c95204084.filter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--緊急合成
function c99002135.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:SetCost(c99002135.cost)
e1:SetTarget(c99002135.target)
e1:SetOperation(c99002135.activate)
c:RegisterEffect(e1)
end
function c99002135.cfilter(c)
return c:IsCode(36623431) and c:IsAbleToDeckAsCost()
end
function c99002135.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c99002135.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c99002135.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c99002135.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x1d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c99002135.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c99002135.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c99002135.activate(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,c99002135.spfilter,tp,LOCATION_GRAVE+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
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