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

fix & new

parent 472118ad
...@@ -560,8 +560,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -560,8 +560,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case 2: case 2:
case 3: case 3:
case 4: case 4:
case 5: case 5: {
case 10: {
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset);
break; break;
} }
...@@ -574,6 +573,13 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -574,6 +573,13 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::ReSendToPlayer(*oit); NetServer::ReSendToPlayer(*oit);
break; break;
} }
case 10: {
NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset);
NetServer::SendBufferToPlayer(players[1], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
break;
}
} }
break; break;
} }
......
...@@ -400,6 +400,7 @@ public: ...@@ -400,6 +400,7 @@ public:
#define EVENT_TOSS_COIN_NEGATE 1152 #define EVENT_TOSS_COIN_NEGATE 1152
#define EVENT_TOSS_DICE_NEGATE 1153 #define EVENT_TOSS_DICE_NEGATE 1153
#define EVENT_LEVEL_UP 1200 #define EVENT_LEVEL_UP 1200
#define EVENT_PAY_LPCOST 1201
#define EVENT_TURN_END 1210 #define EVENT_TURN_END 1210
#define EVENT_PHASE 0x1000 #define EVENT_PHASE 0x1000
#define EVENT_PHASE_START 0x2000 #define EVENT_PHASE_START 0x2000
......
...@@ -662,8 +662,26 @@ int32 scriptlib::duel_check_event(lua_State *L) { ...@@ -662,8 +662,26 @@ int32 scriptlib::duel_check_event(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);
int32 ev = lua_tointeger(L, 1); int32 ev = lua_tointeger(L, 1);
lua_pushboolean(L, pduel->game_field->check_event(ev)); int32 get_info = lua_toboolean(L, 2);
return 1; if(!get_info) {
lua_pushboolean(L, pduel->game_field->check_event(ev));
return 1;
} else {
tevent pe;
if(pduel->game_field->check_event(ev, &pe)) {
lua_pushboolean(L, 1);
interpreter::group2value(L, pe.event_cards);
lua_pushinteger(L, pe.event_player);
lua_pushinteger(L, pe.event_value);
interpreter::effect2value(L, pe.reason_effect);
lua_pushinteger(L, pe.reason);
lua_pushinteger(L, pe.reason_player);
return 7;
} else {
lua_pushboolean(L, 0);
return 1;
}
}
} }
int32 scriptlib::duel_raise_event(lua_State *L) { int32 scriptlib::duel_raise_event(lua_State *L) {
check_action_permission(L); check_action_permission(L);
......
...@@ -567,6 +567,8 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) { ...@@ -567,6 +567,8 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) {
pduel->write_buffer8(MSG_PAY_LPCOST); pduel->write_buffer8(MSG_PAY_LPCOST);
pduel->write_buffer8(playerid); pduel->write_buffer8(playerid);
pduel->write_buffer32(cost); pduel->write_buffer32(cost);
raise_event((card*)0, EVENT_PAY_LPCOST, core.reason_effect, 0, playerid, playerid, cost);
process_instant_event();
return TRUE; return TRUE;
} }
tevent e; tevent e;
...@@ -1357,8 +1359,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1357,8 +1359,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
if(target->material_cards.size()) { if(target->material_cards.size()) {
for(auto mit = target->material_cards.begin(); mit != target->material_cards.end(); ++mit) for(auto mit = target->material_cards.begin(); mit != target->material_cards.end(); ++mit)
raise_single_event(*mit, 0, EVENT_BE_MATERIAL, proc, REASON_SUMMON, sumplayer, sumplayer, 0); raise_single_event(*mit, 0, EVENT_BE_MATERIAL, proc, REASON_SUMMON, sumplayer, sumplayer, 0);
raise_event(&target->material_cards, EVENT_BE_MATERIAL, proc, REASON_SUMMON, sumplayer, sumplayer, 0);
} }
raise_event(&target->material_cards, EVENT_BE_MATERIAL, proc, REASON_SUMMON, sumplayer, sumplayer, 0);
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
return false; return false;
...@@ -2706,9 +2708,9 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2706,9 +2708,9 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
if(equipings.size()) if(equipings.size())
destroy(&equipings, 0, REASON_LOST_TARGET, PLAYER_NONE); destroy(&equipings, 0, REASON_RULE + REASON_LOST_TARGET, PLAYER_NONE);
if(overlays.size()) if(overlays.size())
send_to(&overlays, 0, REASON_LOST_TARGET, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP); send_to(&overlays, 0, REASON_RULE + REASON_LOST_TARGET, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
adjust_instant(); adjust_instant();
return FALSE; return FALSE;
} }
......
--ガーディアン·シール
function c10755153.initial_effect(c)
--sum limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c10755153.sumlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10755153,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCost(c10755153.descost)
e4:SetTarget(c10755153.destg)
e4:SetOperation(c10755153.desop)
c:RegisterEffect(e4)
end
function c10755153.cfilter(c)
return c:IsFaceup() and c:IsCode(95638658)
end
function c10755153.sumlimit(e)
return not Duel.IsExistingMatchingCard(c10755153.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c10755153.costfilter(c,ec)
return c:IsFaceup() and c:GetEquipTarget()==ec and c:IsAbleToGraveAsCost()
end
function c10755153.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10755153.costfilter,tp,LOCATION_SZONE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10755153.costfilter,tp,LOCATION_SZONE,0,1,1,nil,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c10755153.desfilter(c)
return c:IsDestructable()
end
function c10755153.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c10755153.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c10755153.desfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c10755153.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c10755153.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--言語道断侍
function c11760174.initial_effect(c)
--act limit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11760174,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_REPEAT)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c11760174.cost)
e1:SetOperation(c11760174.operation)
c:RegisterEffect(e1)
end
function c11760174.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c11760174.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(c11760174.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c11760174.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
--グラナドラ
function c13944422.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13944422,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c13944422.rectg)
e1:SetOperation(c13944422.recop)
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)
--damage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(13944422,1))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c13944422.damcon)
e4:SetTarget(c13944422.damtg)
e4:SetOperation(c13944422.damop)
c:RegisterEffect(e4)
end
function c13944422.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c13944422.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c13944422.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c13944422.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function c13944422.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
...@@ -14,11 +14,12 @@ function c1498130.tgcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -14,11 +14,12 @@ function c1498130.tgcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end if not g or g:GetCount()~=1 then return false end
local tg=g:GetFirst() local tc=g:GetFirst()
local c=e:GetHandler() local c=e:GetHandler()
if tg==c or tg:GetControler()~=tp or tg:IsFacedown() or not tg:IsLocation(LOCATION_MZONE) or not tg:IsSetCard(0x3d) then return false end if tc==c or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsLocation(LOCATION_MZONE) or not tc:IsSetCard(0x3d) then return false end
local tf=re:GetTarget() local tf=re:GetTarget()
return tf(re,rp,nil,nil,nil,nil,nil,nil,0,c) local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true)
return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end end
function c1498130.tgop(e,tp,eg,ep,ev,re,r,rp) function c1498130.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
--アギド
function c16135253.initial_effect(c)
--dice
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16135253,0))
e1:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c16135253.condition)
e1:SetTarget(c16135253.target)
e1:SetOperation(c16135253.operation)
c:RegisterEffect(e1)
end
function c16135253.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c16135253.filter(c,e,tp,lv)
if (lv<6 and c:GetLevel()~=lv) or (lv==6 and c:GetLevel()<6) then return false end
return c:IsRace(RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c16135253.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c16135253.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local dc=Duel.TossDice(tp,1)
local g=Duel.GetMatchingGroup(c16135253.filter,tp,LOCATION_GRAVE,0,nil,e,tp,dc)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(16135253,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end
--ゾルガ
function c16268841.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16268841,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_RELEASE)
e1:SetCondition(c16268841.reccon)
e1:SetTarget(c16268841.rectg)
e1:SetOperation(c16268841.recop)
c:RegisterEffect(e1)
end
function c16268841.reccon(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(e:GetHandler():GetPreviousControler())
return e:GetHandler():IsReason(REASON_SUMMON)
end
function c16268841.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckEvent(EVENT_SUMMON_SUCCESS) or Duel.CheckEvent(EVENT_MSET) end
Duel.SetTargetPlayer(e:GetLabel())
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,e:GetLabel(),2000)
end
function c16268841.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--天使の手鏡
function c17653779.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c17653779.tgcon)
e1:SetTarget(c17653779.tgtg)
e1:SetOperation(c17653779.tgop)
c:RegisterEffect(e1)
end
function c17653779.tgcon(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_SPELL)
or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end
local tc=g:GetFirst()
e:SetLabelObject(tc)
return tc:IsLocation(LOCATION_MZONE)
end
function c17653779.filter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp)
return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end
function c17653779.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tf=re:GetTarget()
local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true)
if chkc then return chkc~=e:GetLabelObject() and chkc:IsLocation(LOCATION_MZONE) and tf(re,rp,ceg,cep,cev,cre,cr,crp,0,chkc) end
if chk==0 then return Duel.IsExistingTarget(c17653779.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c17653779.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp)
end
function c17653779.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:GetFirst():IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,g)
end
end
--泉の精霊
function c20188127.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c20188127.target)
e1:SetOperation(c20188127.activate)
c:RegisterEffect(e1)
end
function c20188127.tgfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function c20188127.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c20188127.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20188127.tgfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c20188127.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end
function c20188127.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,0,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0xfe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--武装解除
function c20727787.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_EQUIP)
e1:SetTarget(c20727787.target)
e1:SetOperation(c20727787.activate)
c:RegisterEffect(e1)
end
function c20727787.filter(c)
return c:IsType(TYPE_EQUIP) and c:IsDestructable()
end
function c20727787.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c20727787.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) end
local g=Duel.GetMatchingGroup(c20727787.filter,tp,LOCATION_SZONE,LOCATION_SZONE,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c20727787.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c20727787.filter,tp,LOCATION_SZONE,LOCATION_SZONE,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
--隠された魔導書
function c21840375.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c21840375.condition)
e1:SetTarget(c21840375.target)
e1:SetOperation(c21840375.activate)
c:RegisterEffect(e1)
end
function c21840375.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c21840375.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c21840375.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c21840375.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c21840375.filter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c21840375.filter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c21840375.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
...@@ -30,15 +30,12 @@ function c21900719.initial_effect(c) ...@@ -30,15 +30,12 @@ function c21900719.initial_effect(c)
e4:SetValue(1) e4:SetValue(1)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c21900719.costfilter(c)
return c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c21900719.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c21900719.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21900719.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c21900719.costfilter,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end end
function c21900719.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c21900719.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
--超進化薬
function c22431243.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(c22431243.cost)
e1:SetTarget(c22431243.target)
e1:SetOperation(c22431243.activate)
c:RegisterEffect(e1)
end
function c22431243.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_REPTILE) end
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_REPTILE)
Duel.Release(g,REASON_COST)
end
function c22431243.filter(c,e,tp)
return c:IsRace(RACE_DINOSAUR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22431243.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c22431243.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c22431243.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,c22431243.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--アリの増殖
function c22493811.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(c22493811.cost)
e1:SetTarget(c22493811.target)
e1:SetOperation(c22493811.activate)
c:RegisterEffect(e1)
end
function c22493811.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_INSECT) end
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_INSECT)
Duel.Release(g,REASON_COST)
end
function c22493811.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,22493812,0,0x4011,500,1200,4,RACE_INSECT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c22493811.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,22493812,0,0x4011,500,1200,4,RACE_INSECT,ATTRIBUTE_EARTH) then
for i=1,2 do
local token=Duel.CreateToken(tp,22493812)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
end
end
--コストダウン
function c23265313.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c23265313.cost)
e1:SetOperation(c23265313.activate)
c:RegisterEffect(e1)
end
function c23265313.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 c23265313.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(-2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
...@@ -3,7 +3,6 @@ function c26509612.initial_effect(c) ...@@ -3,7 +3,6 @@ function c26509612.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START) e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetCondition(c26509612.condition) e1:SetCondition(c26509612.condition)
......
--呪術抹消
function c29735721.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(c29735721.condition)
e1:SetCost(c29735721.cost)
e1:SetTarget(c29735721.target)
e1:SetOperation(c29735721.activate)
c:RegisterEffect(e1)
end
function c29735721.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c29735721.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
function c29735721.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 c29735721.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND+LOCATION_DECK)
Duel.ConfirmCards(tp,g)
local sg=g:Filter(Card.IsCode,nil,re:GetHandler():GetCode())
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.ShuffleHand(1-tp)
Duel.ShuffleDeck(1-tp)
end
--重力の斧-グラール
function c32022366.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(c32022366.target)
e1:SetOperation(c32022366.operation)
c:RegisterEffect(e1)
--Atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--pos limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e4)
end
function c32022366.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c32022366.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 c32240937.initial_effect(c)
--atk limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetCondition(c32240937.atkcon)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_END)
e2:SetOperation(c32240937.negop)
c:RegisterEffect(e2)
end
function c32240937.atkcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)>1 or Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0
end
function c32240937.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsType(TYPE_EFFECT) and bc:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e2)
end
end
--壺盗み
function c33784505.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c33784505.condition)
e1:SetTarget(c33784505.target)
e1:SetOperation(c33784505.activate)
c:RegisterEffect(e1)
end
function c33784505.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(55144522) and Duel.IsChainNegatable(ev)
end
function c33784505.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33784505.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
Duel.Draw(tp,1,REASON_EFFECT)
end
--ピクシーナイト
function c35429292.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35429292,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c35429292.condition)
e1:SetTarget(c35429292.target)
e1:SetOperation(c35429292.operation)
c:RegisterEffect(e1)
end
function c35429292.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c35429292.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c35429292.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c35429292.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(1-tp,c35429292.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c35429292.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
...@@ -20,8 +20,7 @@ end ...@@ -20,8 +20,7 @@ end
function c36562627.coinop(e,tp,eg,ep,ev,re,r,rp) function c36562627.coinop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,36562627)~=0 then return end if Duel.GetFlagEffect(tp,36562627)~=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(36562627,0)) then if Duel.SelectYesNo(tp,aux.Stringid(36562627,0)) then
Duel.Hint(HINT_CARD,tp,36562627) Duel.Hint(HINT_CARD,0,36562627)
Duel.Hint(HINT_CARD,1-tp,36562627)
Duel.RegisterFlagEffect(tp,36562627,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,36562627,RESET_PHASE+PHASE_END,0,1)
Duel.TossCoin(tp,ev) Duel.TossCoin(tp,ev)
end end
......
--インセクト·プリンセス
function c37957847.initial_effect(c)
--Pos Change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_POSITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c37957847.target)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_END)
e2:SetOperation(c37957847.atkop)
c:RegisterEffect(e2)
end
function c37957847.target(e,c)
return c:IsRace(RACE_INSECT)
end
function c37957847.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and bc:IsRace(RACE_INSECT) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--怒れる類人猿
function c39168895.initial_effect(c)
--must attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MUST_ATTACK)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
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(c39168895.becon)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetCondition(c39168895.descon)
c:RegisterEffect(e3)
end
function c39168895.becon(e)
return e:GetHandler():IsAttackable()
end
function c39168895.descon(e)
return e:GetHandler():IsDefencePos()
end
--バルーン·リザード
function c39892082.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39892082,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c39892082.addccon)
e1:SetTarget(c39892082.addct)
e1:SetOperation(c39892082.addc)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39892082,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(c39892082.damcon)
e2:SetTarget(c39892082.damtg)
e2:SetOperation(c39892082.damop)
c:RegisterEffect(e2)
end
function c39892082.addccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c39892082.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x28)
end
function c39892082.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x28,1)
end
end
function c39892082.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x28)
e:SetLabel(ct)
return ct>0 and c:IsReason(REASON_DESTROY)
end
function c39892082.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(rp)
Duel.SetTargetParam(e:GetLabel()*400)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,rp,e:GetLabel()*400)
end
function c39892082.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--鬼ゴブリン
function c42541548.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42541548,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c42541548.drcon)
e1:SetCost(c42541548.drcost)
e1:SetTarget(c42541548.drtg)
e1:SetOperation(c42541548.drop)
c:RegisterEffect(e1)
end
function c42541548.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c42541548.cfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToDeckAsCost()
end
function c42541548.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c42541548.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c42541548.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function c42541548.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 c42541548.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--強欲ゴブリン
function c425934.initial_effect(c)
--discard limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetCode(EFFECT_CANNOT_DISCARD_HAND)
e1:SetValue(1)
c:RegisterEffect(e1)
end
--ガーディアン·トライス
function c46037213.initial_effect(c)
--sum limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c46037213.sumlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(46037213,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c46037213.spcon)
e4:SetTarget(c46037213.sptg)
e4:SetOperation(c46037213.spop)
c:RegisterEffect(e4)
end
function c46037213.cfilter(c)
return c:IsFaceup() and c:IsCode(21900719)
end
function c46037213.sumlimit(e)
return not Duel.IsExistingMatchingCard(c46037213.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c46037213.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c46037213.spfilter(c,e,tp,rc)
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_SUMMON) and c:GetReasonCard()==rc and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c46037213.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
local g=e:GetHandler():GetMaterial():Filter(c46037213.spfilter,nil,e,tp,e:GetHandler())
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c46037213.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=g:GetCount() then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ガーディアン·グラール
function c47150851.initial_effect(c)
--sum limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c47150851.sumlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetRange(LOCATION_HAND)
e4:SetCondition(c47150851.spcon)
c:RegisterEffect(e4)
end
function c47150851.cfilter(c)
return c:IsFaceup() and c:IsCode(32022366)
end
function c47150851.sumlimit(e)
return not Duel.IsExistingMatchingCard(c47150851.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c47150851.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(rp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==1
and Duel.IsExistingMatchingCard(c47150851.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
...@@ -23,7 +23,7 @@ function c48934760.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,7 +23,7 @@ function c48934760.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c48934760.activate(e,tp,eg,ep,ev,re,r,rp) function c48934760.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48934760,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48934760,0))
local tc=Duel.SelectMatchingCard(tp,c48934760.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c48934760.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then if tc then
local op=tc:GetActivateEffect():GetOperation() local op=tc:GetActivateEffect():GetOperation()
if Duel.GetFieldCard(tp,LOCATION_SZONE,5)~=nil then if Duel.GetFieldCard(tp,LOCATION_SZONE,5)~=nil then
......
--強欲な壺の精霊
function c4896788.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c4896788.drcon)
e1:SetOperation(c4896788.drop)
c:RegisterEffect(e1)
end
function c4896788.drcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(55144522)
end
function c4896788.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeTargetParam(ev,3)
end
--異次元竜 トワイライトゾーンドラゴン
function c50939127.initial_effect(c)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(c50939127.ind1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(c50939127.ind2)
c:RegisterEffect(e2)
end
function c50939127.ind1(e,re,rp,c)
return not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c50939127.ind2(e,c)
return c:IsAttackBelow(1900)
end
--武器庫荒らし
function c55348096.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(c55348096.target)
e1:SetOperation(c55348096.activate)
c:RegisterEffect(e1)
end
function c55348096.tgfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToGrave()
end
function c55348096.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_DECK)
end
function c55348096.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(1-tp,c55348096.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
else
local cg=Duel.GetFieldGroup(1-tp,LOCATION_DECK,0)
Duel.ConfirmCards(tp,cg)
Duel.ShuffleDeck(1-tp)
end
end
--デーモンの雄叫び
function c56246017.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:SetCost(c56246017.cost)
e1:SetTarget(c56246017.target)
e1:SetOperation(c56246017.activate)
c:RegisterEffect(e1)
end
function c56246017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c56246017.filter(c,e,tp)
return c:IsSetCard(0x45) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c56246017.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c56246017.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c56246017.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c56246017.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c56246017.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetOperation(c56246017.desop)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e3:SetCountLimit(1)
tc:RegisterEffect(e3,true)
end
end
function c56246017.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
--トークン収穫祭
function c57182235.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c57182235.target)
e1:SetOperation(c57182235.activate)
c:RegisterEffect(e1)
end
function c57182235.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,TYPE_TOKEN) end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,TYPE_TOKEN)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*800)
end
function c57182235.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,TYPE_TOKEN)
local ct=Duel.Destroy(g,REASON_EFFECT)
Duel.Recover(tp,ct*800,REASON_EFFECT)
end
--悪魔の手鏡
function c58607704.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c58607704.tgcon)
e1:SetTarget(c58607704.tgtg)
e1:SetOperation(c58607704.tgop)
c:RegisterEffect(e1)
end
function c58607704.tgcon(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_SPELL)
or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end
local tc=g:GetFirst()
e:SetLabelObject(tc)
return tc:IsOnField() and tc:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c58607704.filter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end
function c58607704.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tf=re:GetTarget()
local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true)
if chkc then return chkc~=e:GetLabelObject() and chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) and tf(re,rp,ceg,cep,cev,cre,cr,crp,0,chkc) end
if chk==0 then return Duel.IsExistingTarget(c58607704.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c58607704.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp)
end
function c58607704.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:GetFirst():IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,g)
end
end
--レクンガ
function c62543393.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62543393,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c62543393.cost)
e1:SetTarget(c62543393.target)
e1:SetOperation(c62543393.operation)
c:RegisterEffect(e1)
end
function c62543393.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToRemoveAsCost()
end
function c62543393.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62543393.cfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c62543393.cfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c62543393.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,62543394,0,0x4011,700,700,2,RACE_PLANT,ATTRIBUTE_WATER) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c62543393.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,62543394,0,0x4011,700,700,2,RACE_PLANT,ATTRIBUTE_WATER) then
local token=Duel.CreateToken(tp,62543394)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end
--カウンターマシンガンパンチ
function c68057622.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c68057622.descon)
e2:SetOperation(c68057622.desop)
c:RegisterEffect(e2)
end
function c68057622.filter(c)
return c:IsCode(68057622) and c:IsAbleToHand()
end
function c68057622.descon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
return at and a:IsControler(1-tp) and at:IsRelateToBattle() and a:IsRelateToBattle() and a:GetAttack()<at:GetDefence()
end
function c68057622.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(Duel.GetAttacker(),REASON_EFFECT)
end
--破邪の大剣-バオウ
function c68427465.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:SetCost(c68427465.cost)
e1:SetTarget(c68427465.target)
e1:SetOperation(c68427465.operation)
c:RegisterEffect(e1)
--Atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(c68427465.negop)
c:RegisterEffect(e4)
end
function c68427465.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function c68427465.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c68427465.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c68427465.negop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if not ec:IsRelateToBattle() then return end
local bc=ec:GetBattleTarget()
if bc and bc:IsType(TYPE_EFFECT) and bc:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e2)
end
end
...@@ -20,7 +20,7 @@ function c69243953.initial_effect(c) ...@@ -20,7 +20,7 @@ function c69243953.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT) e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(aux.TRUE) e3:SetValue(1)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand --tohand
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
......
--ディスカバード·アタック
function c69313735.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(c69313735.cost)
e1:SetTarget(c69313735.target)
e1:SetOperation(c69313735.activate)
c:RegisterEffect(e1)
end
function c69313735.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c69313735.rfilter(c,tp)
return c:IsSetCard(0x45) and Duel.IsExistingTarget(c69313735.filter,tp,LOCATION_MZONE,0,1,c)
end
function c69313735.filter(c)
return c:IsFaceup() and c:IsCode(35975813)
end
function c69313735.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c69313735.filter(chkc) end
if chk==0 then
if e:GetLabel()==0 then return Duel.IsExistingTarget(c69313735.filter,tp,LOCATION_MZONE,0,1,nil) end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c69313735.rfilter,1,nil,tp)
end
if e:GetLabel()~=0 then
e:SetLabel(0)
local rg=Duel.SelectReleaseGroup(tp,c69313735.rfilter,1,1,c,tp)
Duel.Release(rg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c69313735.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c69313735.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--光と闇の洗礼
function c69542930.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(c69542930.cost)
e1:SetTarget(c69542930.target)
e1:SetOperation(c69542930.activate)
c:RegisterEffect(e1)
end
function c69542930.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,46986414) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,46986414)
Duel.Release(g,REASON_COST)
end
function c69542930.filter(c,e,tp)
return c:IsCode(40737112) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c69542930.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c69542930.filter,tp,0x13,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13)
end
function c69542930.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,c69542930.filter,tp,0x13,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -40,7 +40,6 @@ function c7165085.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,7 +40,6 @@ function c7165085.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ClearTargetCard() Duel.ClearTargetCard()
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode()) Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
Duel.Hint(HINT_CARD,1,tc:GetOriginalCode())
Duel.ChangePosition(tc,POS_FACEUP) Duel.ChangePosition(tc,POS_FACEUP)
tc:CancelToGrave(false) tc:CancelToGrave(false)
tc:CreateEffectRelation(te) tc:CreateEffectRelation(te)
......
--ガーディアン·バオウ
function c73544866.initial_effect(c)
--sum limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c73544866.sumlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_END)
e4:SetOperation(c73544866.negop)
c:RegisterEffect(e4)
--atkup
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(73544866,0))
e5:SetCategory(CATEGORY_ATKCHANGE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetCondition(c73544866.atkcon)
e5:SetOperation(c73544866.atkop)
c:RegisterEffect(e5)
end
function c73544866.cfilter(c)
return c:IsFaceup() and c:IsCode(68427465)
end
function c73544866.sumlimit(e)
return not Duel.IsExistingMatchingCard(c73544866.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c73544866.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsType(TYPE_EFFECT) and bc:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x17a0000)
bc:RegisterEffect(e2)
end
end
function c73544866.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE) and bc:IsType(TYPE_MONSTER)
end
function c73544866.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--メタル化寄生生物-ルナタイト
function c7369217.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7369217,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c7369217.eqtg)
e1:SetOperation(c7369217.eqop)
c:RegisterEffect(e1)
--unequip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7369217,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c7369217.uncon)
e2:SetTarget(c7369217.sptg)
e2:SetOperation(c7369217.spop)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetCondition(c7369217.uncon)
e3:SetValue(c7369217.efilter)
c:RegisterEffect(e3)
--destroy sub
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c7369217.uncon)
e5:SetValue(c7369217.repval)
c:RegisterEffect(e5)
--eqlimit
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_EQUIP_LIMIT)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c7369217.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
function c7369217.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c7369217.filter(c)
return c:IsFaceup() and c:GetUnionCount()==0
end
function c7369217.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c7369217.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(7369217)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c7369217.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c7369217.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
e:GetHandler():RegisterFlagEffect(7369217,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c7369217.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or not c7369217.filter(tc) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
end
function c7369217.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(7369217)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
e:GetHandler():RegisterFlagEffect(7369217,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c7369217.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
end
end
function c7369217.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActiveType(TYPE_SPELL)
end
...@@ -39,8 +39,7 @@ function c73915051.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) ...@@ -39,8 +39,7 @@ function c73915051.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
end end
function c73915051.target(e,tp,eg,ep,ev,re,r,rp,chk) function c73915051.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>3 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>3
and Duel.IsPlayerCanSpecialSummonMonster(tp,73915052,0,0x4011,0,0,1,RACE_BEAST,ATTRIBUTE_EARTH) and Duel.IsPlayerCanSpecialSummonMonster(tp,73915052,0,0x4011,0,0,1,RACE_BEAST,ATTRIBUTE_EARTH) end
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,4,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,4,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,4,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,4,0,0)
end end
......
--ガーディアン·エルマ
function c74367458.initial_effect(c)
--sum limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c74367458.sumlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(74367458,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetTarget(c74367458.eqtg)
e4:SetOperation(c74367458.eqop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function c74367458.cfilter(c)
return c:IsFaceup() and c:IsCode(69243953)
end
function c74367458.sumlimit(e)
return not Duel.IsExistingMatchingCard(c74367458.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c74367458.filter(c,ec)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec)
end
function c74367458.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74367458.filter(chkc,e:GetHandler()) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c74367458.filter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c74367458.filter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
end
function c74367458.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,e:GetHandler())
end
end
--精神統一
function c7512044.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(c7512044.cost)
e1:SetTarget(c7512044.target)
e1:SetOperation(c7512044.activate)
c:RegisterEffect(e1)
end
function c7512044.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,7512044)==0 end
Duel.RegisterFlagEffect(tp,7512044,RESET_PHASE+PHASE_END,0,1)
end
function c7512044.filter(c)
return c:IsCode(7512044) and c:IsAbleToHand()
end
function c7512044.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c7512044.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c7512044.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c7512044.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 c75946257.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75946257,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c75946257.target)
e1:SetOperation(c75946257.operation)
c:RegisterEffect(e1)
end
function c75946257.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c75946257.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c75946257.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c75946257.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c75946257.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--ケルドウ
function c80441106.initial_effect(c)
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80441106,0))
e1:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c80441106.condition)
e1:SetTarget(c80441106.target)
e1:SetOperation(c80441106.operation)
c:RegisterEffect(e1)
end
function c80441106.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c80441106.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,2,2,nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,2,0,0)
end
end
function c80441106.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not g then return end
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
--デスグレムリン
function c81985784.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81985784,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c81985784.target)
e1:SetOperation(c81985784.operation)
c:RegisterEffect(e1)
end
function c81985784.filter(c)
return c:IsAbleToDeck()
end
function c81985784.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c81985784.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c81985784.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c81985784.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
--希望の光
function c82529174.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c82529174.target)
e1:SetOperation(c82529174.activate)
c:RegisterEffect(e1)
end
function c82529174.filter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function c82529174.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c82529174.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c82529174.filter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c82529174.filter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c82529174.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
--リバースダイス
function c83241722.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c83241722.regop)
c:RegisterEffect(e1)
end
function c83241722.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TOSS_DICE_NEGATE)
e1:SetCondition(c83241722.coincon)
e1:SetOperation(c83241722.coinop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c83241722.coincon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,83241722)==0
end
function c83241722.coinop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,83241722)~=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(83241722,0)) then
Duel.Hint(HINT_CARD,0,83241722)
Duel.RegisterFlagEffect(tp,83241722,RESET_PHASE+PHASE_END,0,1)
Duel.TossDice(ep,ev)
end
end
--ウェポンサモナー
function c85489096.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85489096,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c85489096.target)
e1:SetOperation(c85489096.operation)
c:RegisterEffect(e1)
end
function c85489096.target(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 c85489096.filter(c)
return c:IsSetCard(0x52) and c:IsAbleToHand()
end
function c85489096.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c85489096.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 c8634636.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8634636,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c8634636.target)
e1:SetOperation(c8634636.operation)
c:RegisterEffect(e1)
end
function c8634636.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,2,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,2,2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,g1:GetCount(),0,0)
end
end
function c8634636.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g then
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
--合成魔獣 ガーゼット
function c8794435.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c8794435.atop)
c:RegisterEffect(e1)
--tribute check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c8794435.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c8794435.valcheck(e,c)
local g=c:GetMaterial()
local tc=g:GetFirst()
local atk=0
while tc do
local catk=tc:GetTextAttack()
atk=atk+(catk>=0 and catk or 0)
tc=g:GetNext()
end
e:GetLabelObject():SetLabel(atk)
end
function c8794435.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
--生贄の抱く爆弾
function c89041555.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c89041555.condition)
e1:SetTarget(c89041555.target)
e1:SetOperation(c89041555.activate)
c:RegisterEffect(e1)
end
function c89041555.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and bit.band(eg:GetFirst():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end
function c89041555.filter(c)
return c:IsAttackPos() and c:IsDestructable()
end
function c89041555.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89041555.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c89041555.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c89041555.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c89041555.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)>0 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
--リトル·ウィンガード
function c90790253.initial_effect(c)
--pos change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(90790253,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c90790253.poscon)
e1:SetTarget(c90790253.postg)
e1:SetOperation(c90790253.posop)
c:RegisterEffect(e1)
end
function c90790253.poscon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c90790253.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c90790253.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
--立ちはだかる強敵
function c92854392.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c92854392.condition)
e1:SetTarget(c92854392.target)
e1:SetOperation(c92854392.activate)
c:RegisterEffect(e1)
end
function c92854392.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c92854392.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local at=Duel.GetAttackTarget()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=at end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,at) end
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,at)
end
function c92854392.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_MUST_ATTACK)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c92854392.attg)
e3:SetValue(1)
e3:SetLabel(tc:GetRealFieldID())
e3:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e3,tp)
end
end
function c92854392.attg(e,c)
return c:GetRealFieldID()~=e:GetLabel()
end
--士気高揚
function c93671934.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_EQUIP)
e2:SetOperation(c93671934.recop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c93671934.damcon)
e3:SetOperation(c93671934.damop)
c:RegisterEffect(e3)
end
function c93671934.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,1000,REASON_EFFECT)
end
function c93671934.filter(c)
return c:GetEquipTarget()~=nil or c:IsReason(REASON_LOST_TARGET)
end
function c93671934.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c93671934.filter,1,nil)
end
function c93671934.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT)
end
--血の刻印
function c94463200.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_STANDBY_PHASE,0)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c94463200.target)
e1:SetOperation(c94463200.operation)
c:RegisterEffect(e1)
--lpcost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PAY_LPCOST)
e2:SetCondition(c94463200.lpcon)
e2:SetOperation(c94463200.lpop)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c94463200.descon)
e3:SetOperation(c94463200.desop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetOperation(c94463200.desop2)
c:RegisterEffect(e4)
end
function c94463200.filter(c)
return c:IsFaceup() and c:IsSetCard(0x45)
end
function c94463200.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c94463200.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c94463200.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c94463200.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c94463200.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
c:SetCardTarget(tc)
end
end
function c94463200.lpcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_STANDBY and ep==tp
and re:GetHandler()==e:GetHandler():GetFirstCardTarget()
end
function c94463200.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(1-ep,ev)
end
function c94463200.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
local tc=c:GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsReason(REASON_DESTROY)
end
function c94463200.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(), REASON_EFFECT)
end
function c94463200.desop2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--心眼の鉾
function c94793422.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(c94793422.target)
e1:SetOperation(c94793422.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(1)
c:RegisterEffect(e2)
--damage change
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetCondition(c94793422.damcon)
e3:SetOperation(c94793422.damop)
c:RegisterEffect(e3)
end
function c94793422.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c94793422.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c94793422.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst()==e:GetHandler():GetEquipTarget() and ep~=tp
end
function c94793422.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,1000)
end
--次元の歪み
function c95194279.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:SetCondition(c95194279.condition)
e1:SetTarget(c95194279.target)
e1:SetOperation(c95194279.activate)
c:RegisterEffect(e1)
end
function c95194279.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0
end
function c95194279.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c95194279.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsCOntroler(tp) and c95194279.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c95194279.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c95194279.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c95194279.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--翡翠の蟲笛
function c95214051.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c95214051.target)
e1:SetOperation(c95214051.activate)
c:RegisterEffect(e1)
end
function c95214051.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
end
function c95214051.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(95214051,0))
local g=Duel.SelectMatchingCard(1-tp,Card.IsRace,1-tp,LOCATION_DECK,0,1,1,nil,RACE_INSECT)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(1-tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(1-tp,1)
else
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,g)
Duel.ShuffleDeck(1-tp)
end
end
--ネコ耳族
function c95841282.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(c95841282.atktg)
e1:SetCondition(c95841282.atkcon)
e1:SetValue(200)
c:RegisterEffect(e1)
end
function c95841282.atkcon(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
and Duel.GetAttackTarget()==e:GetHandler()
end
function c95841282.atktg(e,c)
return c==e:GetHandler():GetBattleTarget()
end
...@@ -43,7 +43,6 @@ function c96012004.drcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,6 @@ function c96012004.drcon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject() and res==e:GetLabel() return re==e:GetLabelObject() and res==e:GetLabel()
end end
function c96012004.drop(e,tp,eg,ep,ev,re,r,rp) function c96012004.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,96012004) Duel.Hint(HINT_CARD,0,96012004)
Duel.Hint(HINT_CARD,1-tp,96012004)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
--ガーディアン·ケースト
function c9633505.initial_effect(c)
--sum limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c9633505.sumlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--immune spell
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c9633505.efilter)
c:RegisterEffect(e4)
--atk
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function c9633505.cfilter(c)
return c:IsFaceup() and c:IsCode(95515060)
end
function c9633505.sumlimit(e)
return not Duel.IsExistingMatchingCard(c9633505.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c9633505.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
--カオス·グリード
function c97439308.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:SetCondition(c97439308.condition)
e1:SetTarget(c97439308.target)
e1:SetOperation(c97439308.activate)
c:RegisterEffect(e1)
end
function c97439308.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_REMOVED,0)>=4
and Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0
end
function c97439308.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 c97439308.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 c99517131.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
e1:SetTarget(c99517131.target)
e1:SetOperation(c99517131.activate)
c:RegisterEffect(e1)
end
function c99517131.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c99517131.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local rec=Duel.GetMatchingGroupCount(c99517131.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)*400
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec)
if rec>0 then Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,rec) end
end
function c99517131.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.ChangePosition(g,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENCE,POS_FACEUP_DEFENCE,true)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local rec=Duel.GetMatchingGroupCount(c99517131.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)*400
Duel.Recover(p,rec,REASON_EFFECT)
end
...@@ -466,7 +466,7 @@ EVENT_BE_BATTLE_TARGET =1131 ...@@ -466,7 +466,7 @@ EVENT_BE_BATTLE_TARGET =1131
EVENT_BATTLE_START =1132 EVENT_BATTLE_START =1132
EVENT_BATTLE_CONFIRM =1133 EVENT_BATTLE_CONFIRM =1133
EVENT_PRE_DAMAGE_CALCULATE =1134 EVENT_PRE_DAMAGE_CALCULATE =1134
EVENT_DAMAGE_CALCULATING =1135 EVENT_DAMAGE_CALCULATING =1135
EVENT_PRE_BATTLE_DAMAGE =1136 EVENT_PRE_BATTLE_DAMAGE =1136
EVENT_BATTLE_END =1137 EVENT_BATTLE_END =1137
EVENT_BATTLED =1138 EVENT_BATTLED =1138
...@@ -480,6 +480,7 @@ EVENT_TOSS_COIN =1151 ...@@ -480,6 +480,7 @@ EVENT_TOSS_COIN =1151
EVENT_TOSS_COIN_NEGATE =1152 EVENT_TOSS_COIN_NEGATE =1152
EVENT_TOSS_DICE_NEGATE =1153 EVENT_TOSS_DICE_NEGATE =1153
EVENT_LEVEL_UP =1200 EVENT_LEVEL_UP =1200
EVENT_PAY_LPCOST =1201
EVENT_TURN_END =1210 EVENT_TURN_END =1210
EVENT_PHASE =0x1000 EVENT_PHASE =0x1000
EVENT_PHASE_START =0x2000 EVENT_PHASE_START =0x2000
......
...@@ -408,3 +408,4 @@ ...@@ -408,3 +408,4 @@
!counter 0x26 指示物(金属射手) !counter 0x26 指示物(金属射手)
!counter 0x26 指示物(死亡蚊) !counter 0x26 指示物(死亡蚊)
!counter 0x3027 指示物(暗黑投射手) !counter 0x3027 指示物(暗黑投射手)
!counter 0x28 指示物(气球蜥蜴)
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