Commit 3d12c312 authored by argon.sun's avatar argon.sun

new

parent 44f163ae
...@@ -113,7 +113,7 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -113,7 +113,7 @@ void ClientCard::UpdateInfo(char* buf) {
ecard->equipped.insert(this); ecard->equipped.insert(this);
} }
if(flag & QUERY_TARGET_CARD) { if(flag & QUERY_TARGET_CARD) {
int count = BufferIO::ReadInt8(buf); int count = BufferIO::ReadInt32(buf);
for(int i = 0; i < count; ++i) { for(int i = 0; i < count; ++i) {
int c = BufferIO::ReadInt8(buf); int c = BufferIO::ReadInt8(buf);
int l = BufferIO::ReadInt8(buf); int l = BufferIO::ReadInt8(buf);
...@@ -125,13 +125,13 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -125,13 +125,13 @@ void ClientCard::UpdateInfo(char* buf) {
} }
} }
if(flag & QUERY_OVERLAY_CARD) { if(flag & QUERY_OVERLAY_CARD) {
int count = BufferIO::ReadInt8(buf); int count = BufferIO::ReadInt32(buf);
for(int i = 0; i < count; ++i) { for(int i = 0; i < count; ++i) {
overlayed[i]->SetCode(BufferIO::ReadInt32(buf)); overlayed[i]->SetCode(BufferIO::ReadInt32(buf));
} }
} }
if(flag & QUERY_COUNTERS) { if(flag & QUERY_COUNTERS) {
int count = BufferIO::ReadInt8(buf); int count = BufferIO::ReadInt32(buf);
for(int i = 0; i < count; ++i) { for(int i = 0; i < count; ++i) {
int ctype = BufferIO::ReadInt16(buf); int ctype = BufferIO::ReadInt16(buf);
int ccount = BufferIO::ReadInt16(buf); int ccount = BufferIO::ReadInt16(buf);
......
...@@ -117,7 +117,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -117,7 +117,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
} }
case MSG_HINT: { case MSG_HINT: {
pbuf += 6; pbuf += 6;
DuelClient::ClientAnalyze(offset, pbuf - offset); //DuelClient::ClientAnalyze(offset, pbuf - offset);
break; break;
} }
case MSG_WIN: { case MSG_WIN: {
......
...@@ -549,19 +549,20 @@ int32 card::is_status(uint32 status) { ...@@ -549,19 +549,20 @@ int32 card::is_status(uint32 status) {
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
void card::equip(card *target) { void card::equip(card *target, uint32 send_msg) {
if (equiping_target) if (equiping_target)
return; return;
target->equiping_cards.insert(this); target->equiping_cards.insert(this);
equiping_target = target; equiping_target = target;
effect_container::iterator it; for (auto it = equip_effect.begin(); it != equip_effect.end(); ++it) {
for (it = equip_effect.begin(); it != equip_effect.end(); ++it) {
if (it->second->is_disable_related()) if (it->second->is_disable_related())
pduel->game_field->add_to_disable_check_list(equiping_target); pduel->game_field->add_to_disable_check_list(equiping_target);
} }
pduel->write_buffer8(MSG_EQUIP); if(send_msg) {
pduel->write_buffer32(get_info_location()); pduel->write_buffer8(MSG_EQUIP);
pduel->write_buffer32(target->get_info_location()); pduel->write_buffer32(get_info_location());
pduel->write_buffer32(target->get_info_location());
}
return; return;
} }
void card::unequip() { void card::unequip() {
...@@ -571,8 +572,6 @@ void card::unequip() { ...@@ -571,8 +572,6 @@ void card::unequip() {
if (it->second->is_disable_related()) if (it->second->is_disable_related())
pduel->game_field->add_to_disable_check_list(equiping_target); pduel->game_field->add_to_disable_check_list(equiping_target);
} }
// pduel->write_buffer8(MSG_UNEQUIP);
// pduel->write_buffer32(get_info_location());
equiping_target->equiping_cards.erase(this); equiping_target->equiping_cards.erase(this);
pre_equip_target = equiping_target; pre_equip_target = equiping_target;
equiping_target = 0; equiping_target = 0;
......
...@@ -141,7 +141,7 @@ public: ...@@ -141,7 +141,7 @@ public:
int32 get_status(uint32 status); int32 get_status(uint32 status);
int32 is_status(uint32 status); int32 is_status(uint32 status);
void equip(card *target); void equip(card *target, uint32 send_msg = TRUE);
void unequip(); void unequip();
int32 get_union_count(); int32 get_union_count();
void xyz_overlay(card_set* materials); void xyz_overlay(card_set* materials);
......
...@@ -462,6 +462,8 @@ static const struct luaL_Reg debuglib[] = { ...@@ -462,6 +462,8 @@ static const struct luaL_Reg debuglib[] = {
{ "Message", scriptlib::debug_message }, { "Message", scriptlib::debug_message },
{ "AddCard", scriptlib::debug_add_card }, { "AddCard", scriptlib::debug_add_card },
{ "SetPlayerInfo", scriptlib::debug_set_player_info }, { "SetPlayerInfo", scriptlib::debug_set_player_info },
{ "PreEquip", scriptlib::debug_pre_equip },
{ "PreSetTarget", scriptlib::debug_pre_set_target },
{ "ReloadFieldBegin", scriptlib::debug_reload_field_begin }, { "ReloadFieldBegin", scriptlib::debug_reload_field_begin },
{ "ReloadFieldEnd", scriptlib::debug_reload_field_end }, { "ReloadFieldEnd", scriptlib::debug_reload_field_end },
{ "SetAIName", scriptlib::debug_set_ai_name }, { "SetAIName", scriptlib::debug_set_ai_name },
......
...@@ -57,6 +57,8 @@ int32 scriptlib::debug_add_card(lua_State *L) { ...@@ -57,6 +57,8 @@ int32 scriptlib::debug_add_card(lua_State *L) {
pcard->current.controler = PLAYER_NONE; pcard->current.controler = PLAYER_NONE;
pcard->current.location = LOCATION_OVERLAY; pcard->current.location = LOCATION_OVERLAY;
pcard->current.sequence = fcard->xyz_materials.size() - 1; pcard->current.sequence = fcard->xyz_materials.size() - 1;
interpreter::card2value(L, pcard);
return 1;
} }
return 0; return 0;
} }
...@@ -74,6 +76,33 @@ int32 scriptlib::debug_set_player_info(lua_State *L) { ...@@ -74,6 +76,33 @@ int32 scriptlib::debug_set_player_info(lua_State *L) {
pduel->game_field->player[playerid].draw_count = drawcount; pduel->game_field->player[playerid].draw_count = drawcount;
return 0; return 0;
} }
int32 scriptlib::debug_pre_equip(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
check_param(L, PARAM_TYPE_CARD, 2);
card* equip_card = *(card**) lua_touserdata(L, 1);
card* target = *(card**) lua_touserdata(L, 2);
if((equip_card->current.location != LOCATION_SZONE)
|| (target->current.location != LOCATION_MZONE)
|| (target->current.position & POS_FACEDOWN))
lua_pushboolean(L, 0);
else {
equip_card->equip(target, FALSE);
equip_card->effect_target_cards.insert(target);
target->effect_target_owner.insert(equip_card);
lua_pushboolean(L, 1);
}
return 1;
}
int32 scriptlib::debug_pre_set_target(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
check_param(L, PARAM_TYPE_CARD, 2);
card* t_card = *(card**) lua_touserdata(L, 1);
card* target = *(card**) lua_touserdata(L, 2);
t_card->add_card_target(target);
return 0;
}
int32 scriptlib::debug_reload_field_begin(lua_State *L) { int32 scriptlib::debug_reload_field_begin(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
......
...@@ -461,6 +461,8 @@ public: ...@@ -461,6 +461,8 @@ public:
static int32 debug_message(lua_State *L); static int32 debug_message(lua_State *L);
static int32 debug_add_card(lua_State *L); static int32 debug_add_card(lua_State *L);
static int32 debug_set_player_info(lua_State *L); static int32 debug_set_player_info(lua_State *L);
static int32 debug_pre_equip(lua_State *L);
static int32 debug_pre_set_target(lua_State *L);
static int32 debug_reload_field_begin(lua_State *L); static int32 debug_reload_field_begin(lua_State *L);
static int32 debug_reload_field_end(lua_State *L); static int32 debug_reload_field_end(lua_State *L);
static int32 debug_set_ai_name(lua_State *L); static int32 debug_set_ai_name(lua_State *L);
......
...@@ -11,20 +11,24 @@ function c11954712.initial_effect(c) ...@@ -11,20 +11,24 @@ function c11954712.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE) e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11954712,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetCountLimit(1)
e3:SetCondition(c11954712.rmcon)
e3:SetTarget(c11954712.rmtg)
e3:SetOperation(c11954712.rmop)
c:RegisterEffect(e3)
end end
function c11954712.regop(e,tp,eg,ep,ev,re,r,rp) function c11954712.regop(e,tp,eg,ep,ev,re,r,rp)
--remove e:GetHandler():RegisterFlagEffect(11954712,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE,0,1)
local e1=Effect.CreateEffect(e:GetHandler()) end
e1:SetDescription(aux.Stringid(11954712,0)) function c11954712.rmcon(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_REMOVE) return e:GetHandler():GetFlagEffect(11954712)~=0
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c11954712.rmtg)
e1:SetOperation(c11954712.rmop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
e:GetHandler():RegisterEffect(e1)
end end
function c11954712.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function c11954712.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -5,7 +5,6 @@ function c17720747.initial_effect(c) ...@@ -5,7 +5,6 @@ function c17720747.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Draw --Draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -19,7 +18,7 @@ function c17720747.initial_effect(c) ...@@ -19,7 +18,7 @@ function c17720747.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c17720747.condition(e,tp,eg,ep,ev,re,r,rp) function c17720747.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=1 return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)<=1
end end
function c17720747.target(e,tp,eg,ep,ev,re,r,rp,chk) function c17720747.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--リボーン·ゾンビ
function c23421244.initial_effect(c)
--cannot destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c23421244.condition)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function c23421244.condition(e)
return e:GetHandler():IsAttackPos() and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0
end
--堕落
function c32919136.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c32919136.target)
e1:SetOperation(c32919136.operation)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32919136,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c32919136.damcon)
e2:SetTarget(c32919136.damtg)
e2:SetOperation(c32919136.damop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c32919136.descon)
c:RegisterEffect(e3)
end
function c32919136.filter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged()
end
function c32919136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c32919136.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c32919136.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c32919136.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c32919136.eqlimit(e,c)
return e:GetOwner()==c
end
function c32919136.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c32919136.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_SET_CONTROL)
e2:SetValue(tp)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
end
function c32919136.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c32919136.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,800)
end
function c32919136.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c32919136.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x45)
end
function c32919136.descon(e)
return not Duel.IsExistingMatchingCard(c32919136.desfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
--フォース
function c34016756.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c34016756.target)
e1:SetOperation(c34016756.activate)
c:RegisterEffect(e1)
end
function c34016756.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,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34016756,0))
local g1=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34016756,1))
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g1:GetFirst())
end
function c34016756.activate(e,tp,eg,ep,ev,re,r,rp)
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
if hc:IsFaceup() and hc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local atk=hc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(atk/2)
if hc:RegisterEffect(e1) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e2:SetValue(atk/2)
tc:RegisterEffect(e2)
end
end
end
...@@ -31,6 +31,9 @@ function c35984222.initial_effect(c) ...@@ -31,6 +31,9 @@ function c35984222.initial_effect(c)
local e5=e3:Clone() local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_SUMMON) e5:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e5)
--only 1 can exists --only 1 can exists
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetType(EFFECT_TYPE_SINGLE)
......
--海皇の重装兵
function c37104630.initial_effect(c)
--extra summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(c37104630.extg)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37104630,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c37104630.descon)
e2:SetTarget(c37104630.destg)
e2:SetOperation(c37104630.desop)
c:RegisterEffect(e2)
end
function c37104630.extg(e,c)
return c:IsLevelBelow(4) and c:IsRace(RACE_SEASERPENT)
end
function c37104630.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
end
function c37104630.desfilter(c)
return c:IsFaceup() and c:IsDestructable()
end
function c37104630.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c37104630.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c37104630.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c37104630.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--サイバー·レイダー
function c39978267.initial_effect(c)
--effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39978267,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c39978267.target)
e1:SetOperation(c39978267.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c39978267.desfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsDestructable()
end
function c39978267.eqfilter(c,ec)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec)
end
function c39978267.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==1 then return chkc:IsLocation(LOCATION_SZONE) and c39978267.desfilter(chkc)
else return chkc:IsLocation(LOCATION_SZONE) and c39978267.eqfilter(chkc) end
end
if chk==0 then return true end
local sel=0
if Duel.IsExistingMatchingCard(c39978267.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) then sel=sel+1 end
if Duel.IsExistingMatchingCard(c39978267.eqfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e:GetHandler()) then sel=sel+2 end
if sel==3 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(39978267,0))
sel=Duel.SelectOption(tp,aux.Stringid(39978267,1),aux.Stringid(39978267,2))+1
end
e:SetLabel(sel)
if sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c39978267.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
elseif sel==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c39978267.eqfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e:GetHandler())
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0)
end
end
end
function c39978267.operation(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel()
if sel==0 then return end
local tc=Duel.GetFirstTarget()
if sel==1 then
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(c,REASON_EFFECT)
end
else
local c=e:GetHandler()
if tc and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Equip(tp,tc,e:GetHandler())
end
end
end
\ No newline at end of file
--老化の呪い
function c41398771.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c41398771.condition)
e1:SetCost(c41398771.cost)
e1:SetTarget(c41398771.target)
e1:SetOperation(c41398771.activate)
c:RegisterEffect(e1)
end
function c41398771.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c41398771.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 c41398771.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c41398771.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(-500)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
end
\ No newline at end of file
--天よりの宝札
function c42664989.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c42664989.cost)
e1:SetTarget(c42664989.target)
e1:SetOperation(c42664989.operation)
c:RegisterEffect(e1)
end
function c42664989.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD,0,1,e:GetHandler())end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c42664989.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) end
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2-ht)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2-ht)
end
function c42664989.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if(ht<2) then
Duel.Draw(p,2-ht,REASON_EFFECT)
end
end
\ No newline at end of file
...@@ -11,22 +11,26 @@ function c47349310.initial_effect(c) ...@@ -11,22 +11,26 @@ function c47349310.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK) e2:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(47349310,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetCountLimit(1)
e3:SetCondition(c47349310.rmcon)
e3:SetTarget(c47349310.rmtg)
e3:SetOperation(c47349310.rmop)
c:RegisterEffect(e3)
end end
function c47349310.regop(e,tp,eg,ep,ev,re,r,rp) function c47349310.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetAttackTarget() then return end if Duel.GetAttackTarget() then return end
--remove c:RegisterFlagEffect(47349310,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE,0,1)
local e1=Effect.CreateEffect(e:GetHandler()) end
e1:SetDescription(aux.Stringid(47349310,0)) function c47349310.rmcon(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_REMOVE) return e:GetHandler():GetFlagEffect(47349310)~=0
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c47349310.rmtg)
e1:SetOperation(c47349310.rmop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
e:GetHandler():RegisterEffect(e1)
end end
function c47349310.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function c47349310.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--海皇龍 ポセイドラ
function c47826112.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47826112,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c47826112.spcost)
e1:SetTarget(c47826112.sptg)
e1:SetOperation(c47826112.spop)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47826112,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c47826112.thcon)
e2:SetTarget(c47826112.thtg)
e2:SetOperation(c47826112.thop)
c:RegisterEffect(e2)
end
function c47826112.cfilter(c)
return c:IsLevelBelow(3) and c:IsAttribute(ATTRIBUTE_WATER)
end
function c47826112.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c47826112.cfilter,3,nil) end
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,e:GetHandler())
end
local g=Duel.SelectReleaseGroup(tp,c47826112.cfilter,3,3,nil)
Duel.Release(g,REASON_COST)
end
function c47826112.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c47826112.spop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
end
end
function c47826112.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c47826112.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c47826112.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c47826112.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c47826112.thop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c47826112.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
if ct>=3 then
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=mg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-ct*300)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=mg:GetNext()
end
end
end
--痛み分け
function c56830749.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c56830749.cost)
e1:SetTarget(c56830749.target)
e1:SetOperation(c56830749.activate)
c:RegisterEffect(e1)
end
function c56830749.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c56830749.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(1-tp,nil,1,nil) end
end
function c56830749.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectReleaseGroup(1-tp,nil,1,1,nil)
Duel.Release(g,REASON_RULE)
end
--海皇の狙撃兵
function c706925.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(706925,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCondition(c706925.spcon)
e1:SetTarget(c706925.sptg)
e1:SetOperation(c706925.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(706925,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c706925.descon)
e2:SetTarget(c706925.destg)
e2:SetOperation(c706925.desop)
c:RegisterEffect(e2)
end
function c706925.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c706925.spfilter(c,e,tp)
return not c:IsCode(706925) and c:IsLevelBelow(4) and c:IsSetCard(0x77) and c:IsRace(RACE_SEASERPENT)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c706925.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c706925.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c706925.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_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c706925.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 c706925.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
end
function c706925.desfilter(c)
return c:IsFacedown() and c:IsDestructable()
end
function c706925.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c706925.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c706925.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c706925.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
...@@ -33,7 +33,7 @@ function c7165085.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,7 +33,7 @@ function c7165085.activate(e,tp,eg,ep,ev,re,r,rp)
local cost=te:GetCost() local cost=te:GetCost()
local target=te:GetTarget() local target=te:GetTarget()
local operation=te:GetOperation() local operation=te:GetOperation()
if te:GetCode()==EVENT_FREE_CHAIN if te:GetCode()==EVENT_FREE_CHAIN and not tc:IsStatus(STATUS_SET_TURN)
and (not condition or condition(te,tep,eg,ep,ev,re,r,rp)) and (not condition or condition(te,tep,eg,ep,ev,re,r,rp))
and (not cost or cost(te,tep,eg,ep,ev,re,r,rp,0)) and (not cost or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (not target or target(te,tep,eg,ep,ev,re,r,rp,0)) then and (not target or target(te,tep,eg,ep,ev,re,r,rp,0)) then
......
--海皇の咆哮
function c73199638.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c73199638.cost)
e1:SetTarget(c73199638.target)
e1:SetOperation(c73199638.activate)
c:RegisterEffect(e1)
end
function c73199638.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.CheckSpecialSummonActivity(tp) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(c73199638.sumlimit)
Duel.RegisterEffect(e1,tp)
end
function c73199638.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return e:GetLabelObject()~=se
end
function c73199638.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsRace(RACE_SEASERPENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c73199638.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c73199638.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>2
and Duel.IsExistingTarget(c73199638.filter,tp,LOCATION_GRAVE,0,3,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c73199638.filter,tp,LOCATION_GRAVE,0,3,3,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,3,0,0)
end
function c73199638.rfilter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c73199638.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local sg=g:Filter(c73199638.rfilter,nil,e,tp)
if sg:GetCount()==0 then return end
if sg:GetCount()>ft then sg=sg:Select(tp,ft,ft,nil) end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--海皇の竜騎隊
function c74311226.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c74311226.datg)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74311226,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c74311226.thcon)
e2:SetTarget(c74311226.thtg)
e2:SetOperation(c74311226.thop)
c:RegisterEffect(e2)
end
function c74311226.datg(e,c)
return c:IsLevelBelow(3) and c:IsRace(RACE_SEASERPENT)
end
function c74311226.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
end
function c74311226.thfilter(c)
return not c:IsCode(74311226) and c:IsRace(RACE_SEASERPENT) and c:IsAbleToHand()
end
function c74311226.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74311226.thop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74311226.thfilter,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 c75285069.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75285069,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c75285069.ttcon)
e1:SetOperation(c75285069.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE+1)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75285069,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCondition(c75285069.descon)
e2:SetTarget(c75285069.destg)
e2:SetOperation(c75285069.desop)
c:RegisterEffect(e2)
end
function c75285069.ttcon(e,c)
if c==nil then return true end
return Duel.GetTributeCount(c)>=3
end
function c75285069.ttop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g, REASON_SUMMON+REASON_MATERIAL)
end
function c75285069.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE+1
end
function c75285069.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c75285069.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c75285069.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0,nil)
end
function c75285069.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c75285069.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--死の演算盤
function c77910045.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c77910045.operation)
c:RegisterEffect(e2)
end
function c77910045.filter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetControler()==tp and c:IsType(TYPE_MONSTER)
end
function c77910045.operation(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c77910045.filter,1,nil,tp) then
Duel.Damage(tp,500,REASON_EFFECT)
end
if eg:IsExists(c77910045.filter,1,nil,1-tp) then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end
--拡散する波動
function c87880531.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:SetCost(c87880531.cost)
e1:SetTarget(c87880531.target)
e1:SetOperation(c87880531.activate)
c:RegisterEffect(e1)
end
function c87880531.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c87880531.filter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsLevelAbove(7)
end
function c87880531.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c87880531.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c87880531.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c87880531.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c87880531.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsControler(tp) and tc:IsRelateToEffect(e) then
local ae=Effect.CreateEffect(e:GetHandler())
ae:SetType(EFFECT_TYPE_FIELD)
ae:SetCode(EFFECT_CANNOT_ATTACK)
ae:SetTargetRange(LOCATION_MZONE,0)
ae:SetTarget(c87880531.ftarget)
ae:SetLabel(tc:GetFieldID())
ae:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(ae,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MUST_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_EP)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCondition(c87880531.becon)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ATTACK_ALL)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_END)
e4:SetOperation(c87880531.disop)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
end
function c87880531.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c87880531.becon(e)
return e:GetHandler():IsAttackable()
end
function c87880531.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if not bc or not bc:IsStatus(STATUS_BATTLE_DESTROYED) then return end
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e1)
end
...@@ -11,6 +11,9 @@ function c98437424.initial_effect(c) ...@@ -11,6 +11,9 @@ function c98437424.initial_effect(c)
e1:SetTarget(c98437424.sptg) e1:SetTarget(c98437424.sptg)
e1:SetOperation(c98437424.spop) e1:SetOperation(c98437424.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_MSET)
c:RegisterEffect(e2)
end end
function c98437424.spcon(e,tp,eg,ep,ev,re,r,rp) function c98437424.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp return rp~=tp
......
--受け継がれる力
function c98792570.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:SetLabel(0)
e1:SetCost(c98792570.cost)
e1:SetTarget(c98792570.target)
e1:SetOperation(c98792570.activate)
c:RegisterEffect(e1)
end
function c98792570.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c98792570.cfilter(c,e,tp)
return c:GetTextAttack()>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c)
end
function c98792570.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c98792570.filter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c98792570.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SendtoGrave(g,REASON_COST)
Duel.SetTargetParam(g:GetFirst():GetTextAttack())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c98792570.activate(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(Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM))
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
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