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

new scripts

parent 9cd08a80
...@@ -292,6 +292,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -292,6 +292,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->deckBuilder.filterList = deckManager._lfList[0].content; mainGame->deckBuilder.filterList = deckManager._lfList[0].content;
mainGame->stHostSingleDuelist[0]->setText(L""); mainGame->stHostSingleDuelist[0]->setText(L"");
mainGame->stHostSingleDuelist[1]->setText(L""); mainGame->stHostSingleDuelist[1]->setText(L"");
mainGame->stHostSingleOB->setText(L"");
mainGame->SetStaticText(mainGame->stHostSingleRule, 180, mainGame->guiFont, (wchar_t*)str.c_str()); mainGame->SetStaticText(mainGame->stHostSingleRule, 180, mainGame->guiFont, (wchar_t*)str.c_str());
mainGame->RefreshDeck(mainGame->cbDeckSelect); mainGame->RefreshDeck(mainGame->cbDeckSelect);
mainGame->cbDeckSelect->setEnabled(true); mainGame->cbDeckSelect->setEnabled(true);
...@@ -368,14 +369,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -368,14 +369,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->localAction.Wait(); mainGame->localAction.Wait();
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->CloseDuelWindow(); mainGame->CloseDuelWindow();
mainGame->gMutex.Unlock();
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->dInfo.isStarted = false; mainGame->dInfo.isStarted = false;
mainGame->btnCreateHost->setEnabled(true); mainGame->btnCreateHost->setEnabled(true);
mainGame->btnJoinHost->setEnabled(true); mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->ShowElement(mainGame->wLanWindow); mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock();
event_base_loopbreak(client_base); event_base_loopbreak(client_base);
break; break;
} }
......
...@@ -514,7 +514,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -514,7 +514,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
type = BufferIO::ReadInt8(pbuf); type = BufferIO::ReadInt8(pbuf);
NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset);
NetServer::SendBufferToPlayer(players[1], STOC_GAME_MSG, offset, pbuf - offset); NetServer::ReSendToPlayer(players[1]);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
if(player > 1) { if(player > 1) {
match_result[duel_count++] = 2; match_result[duel_count++] = 2;
tp_player = 1 - tp_player; tp_player = 1 - tp_player;
...@@ -794,7 +796,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -794,7 +796,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
int cp = pbuf[8]; int cp = pbuf[8];
pbuf += 9; pbuf += 9;
NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset);
NetServer::SendBufferToPlayer(players[1], STOC_GAME_MSG, offset, pbuf - offset); NetServer::ReSendToPlayer(players[1]);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
if((pp & POS_FACEDOWN) && (cp & POS_FACEUP)) if((pp & POS_FACEDOWN) && (cp & POS_FACEUP))
RefreshSingle(cc, cl, cs); RefreshSingle(cc, cl, cs);
break; break;
......
--五稜星の呪縛
function c12863633.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetTarget(c12863633.target)
e1:SetOperation(c12863633.operation)
c:RegisterEffect(e1)
end
function c12863633.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
end
function c12863633.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASEABLE_SUM)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASEABLE_NONSUM)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(1)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetValue(1)
tc:RegisterEffect(e3)
end
end
--同姓同名同盟条約
function c13685271.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,0x11e0)
e1:SetCondition(c13685271.condition)
e1:SetTarget(c13685271.target)
e1:SetOperation(c13685271.activate)
c:RegisterEffect(e1)
end
function c13685271.cfilter(c)
return c:IsFaceup() and not c:IsType(TYPE_TOKEN)
end
function c13685271.get_count(g)
if g:GetCount()==0 then return 0 end
local ret=0
repeat
local tc=g:GetFirst()
g:RemoveCard(tc)
local ct1=g:GetCount()
g:Remove(Card.IsCode,nil,tc:GetCode())
local ct2=g:GetCount()
local c=ct1-ct2+1
if c>ret then ret=c end
until g:GetCount()==0 or g:GetCount()<=ret
return ret
end
function c13685271.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c13685271.cfilter,tp,LOCATION_MZONE,0,nil)
local ct=c13685271.get_count(g)
e:SetLabel(ct)
return ct==2 or ct==3
end
function c13685271.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c13685271.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13685271.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c13685271.filter,tp,0,LOCATION_ONFIELD,nil)
if e:GetLabel()==2 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) end
end
function c13685271.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c13685271.cfilter,tp,LOCATION_MZONE,0,nil)
local ct=c13685271.get_count(g)
if ct==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c13685271.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
elseif ct==3 then
local g=Duel.GetMatchingGroup(c13685271.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
--サンダー·ショート
function c20264508.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTarget(c20264508.target)
e1:SetOperation(c20264508.operation)
c:RegisterEffect(e1)
end
function c20264508.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)~=0 end
Duel.SetTargetPlayer(1-tp)
local dam=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)*400
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c20264508.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetFieldGroupCount(p,LOCATION_MZONE,0)*400
Duel.Damage(p,dam,REASON_EFFECT)
end
...@@ -87,7 +87,9 @@ function c24696097.dacon(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,7 +87,9 @@ function c24696097.dacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp return Duel.GetAttacker():GetControler()~=tp
end end
function c24696097.datg(e,tp,eg,ep,ev,re,r,rp,chk) function c24696097.datg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() end if chk==0 then return e:GetHandler():IsAbleToRemove() and e:GetHandler():IsCanBeEffectTarget(e)
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end end
function c24696097.daop(e,tp,eg,ep,ev,re,r,rp,chk) function c24696097.daop(e,tp,eg,ep,ev,re,r,rp,chk)
......
--ブライト·フューチャー
function c24707869.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c24707869.target)
e1:SetOperation(c24707869.activate)
c:RegisterEffect(e1)
end
function c24707869.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsAbleToGrave()
end
function c24707869.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c24707869.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c24707869.filter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c24707869.filter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c24707869.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()~=2 then return end
Duel.SendtoGrave(tg,REASON_EFFECT+REASON_RETURN)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
--ポセイドン·ウェーブ
function c25642998.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c25642998.condition)
e1:SetTarget(c25642998.target)
e1:SetOperation(c25642998.activate)
c:RegisterEffect(e1)
end
function c25642998.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c25642998.dfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
end
function c25642998.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
local dam=Duel.GetMatchingGroupCount(c25642998.dfilter,tp,LOCATION_MZONE,0,nil)*800
if dam>0 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
end
function c25642998.activate(e,tp,eg,ep,ev,re,r,rp)
local tg,d=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS,CHAININFO_TARGET_PARAM)
local tc=tg:GetFirst()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackable() then
if Duel.DisableAttack(tc) then
local dam=Duel.GetMatchingGroupCount(c25642998.dfilter,tp,LOCATION_MZONE,0,nil)*800
if dam>0 then
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
end
end
--共振装置
function c26864586.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:SetTarget(c26864586.target)
e1:SetOperation(c26864586.activate)
c:RegisterEffect(e1)
end
function c26864586.filter1(c,tp)
local lv1=c:GetLevel()
return lv1>0 and c:IsFaceup() and Duel.IsExistingTarget(c26864586.filter2,tp,LOCATION_MZONE,0,1,c,c:GetRace(),c:GetAttribute(),lv1)
end
function c26864586.filter2(c,rc,at,lv1)
local lv2=c:GetLevel()
return lv2>0 and lv2~=lv1 and c:IsFaceup() and c:IsRace(rc) and c:IsAttribute(at)
end
function c26864586.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c26864586.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g1=Duel.SelectTarget(tp,c26864586.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc1=g1:GetFirst()
e:SetLabelObject(tc1)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(26864586,0))
local g2=Duel.SelectTarget(tp,c26864586.filter2,tp,LOCATION_MZONE,0,1,1,tc1,tc1:GetRace(),tc1:GetAttribute(),tc1:GetLevel())
end
function c26864586.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=e:GetLabelObject()
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
local lv1=tc1:GetLevel()
local lv2=tc2:GetLevel()
if lv1==lv2 then return end
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc2:RegisterEffect(e1)
end
end
--ガルドスの羽根ペン
function c27980138.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c27980138.target)
e1:SetOperation(c27980138.activate)
c:RegisterEffect(e1)
end
function c27980138.filter1(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c27980138.filter2(c)
return c:IsAbleToHand()
end
function c27980138.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c27980138.filter1,tp,LOCATION_GRAVE,0,2,nil)
and Duel.IsExistingTarget(c27980138.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectTarget(tp,c27980138.filter1,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOHAND)
local g2=Duel.SelectTarget(tp,c27980138.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g2,1,0,0)
end
function c27980138.activate(e,tp,eg,ep,ev,re,r,rp)
local ex,g1=Duel.GetOperationInfo(0,CATEGORY_TODECK)
local ex,g2=Duel.GetOperationInfo(0,CATEGORY_TOHAND)
if g1:GetFirst():IsRelateToEffect(e) and g1:GetNext():IsRelateToEffect(e) then
Duel.SendtoDeck(g1,nil,2,REASON_EFFECT)
if g2:GetFirst():IsRelateToEffect(e) then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
end
end
end
--フィッシュアンドキックス
function c32703716.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c32703716.condition)
e1:SetTarget(c32703716.target)
e1:SetOperation(c32703716.activate)
c:RegisterEffect(e1)
end
function c32703716.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
end
function c32703716.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c32703716.cfilter,tp,LOCATION_REMOVED,0,3,nil)
end
function c32703716.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c32703716.activate(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 c32835363.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(c32835363.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(32835363,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(32835363)
e3:SetTarget(c32835363.damtg)
e3:SetOperation(c32835363.damop)
c:RegisterEffect(e3)
end
function c32835363.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(32835363)~=0 then return end
local d1=false
local d2=false
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsType(TYPE_MONSTER) and bit.band(tc:GetReason(),0x41)==0x41 then
if tc:GetOwner()==tp then d1=true
else d2=true end
end
tc=eg:GetNext()
end
local evt_p=PLAYER_NONE
if d1 and d2 then evt_p=PLAYER_ALL
elseif d1 then evt_p=tp
elseif d2 then evt_p=1-tp
else return end
Duel.RaiseSingleEvent(e:GetHandler(),32835363,e,0,0,evt_p,0)
e:GetHandler():RegisterFlagEffect(32835363,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c32835363.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetPlayer(ep)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,ep,800)
end
function c32835363.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if ep==PLAYER_ALL then
Duel.Damage(tp,d,REASON_EFFECT)
Duel.Damage(1-tp,d,REASON_EFFECT)
else
Duel.Damage(ep,d,REASON_EFFECT)
end
end
end
...@@ -96,6 +96,7 @@ function c3429238.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,6 +96,7 @@ function c3429238.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end end
end end
end end
...@@ -22,7 +22,7 @@ function c36261276.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -22,7 +22,7 @@ function c36261276.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c36261276.operation(e,tp,eg,ep,ev,re,r,rp) function c36261276.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Remove(tc,tc:GetPosition(),REASON_EFFECT+REASON_TEMPORARY)~=0 then if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
......
--パスト·イメージ
function c50292967.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetCondition(c50292967.condition)
e1:SetTarget(c50292967.target)
e1:SetOperation(c50292967.operation)
c:RegisterEffect(e1)
end
function c50292967.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end
function c50292967.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50292967.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c50292967.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c50292967.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetOperation(c50292967.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c50292967.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
--魔製産卵床
function c51324455.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(c51324455.condition)
e1:SetTarget(c51324455.target)
e1:SetOperation(c51324455.activate)
c:RegisterEffect(e1)
end
function c51324455.cfilter(c,tp)
return c:IsFaceup() and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
and c:GetPreviousControler()==tp and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
end
function c51324455.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c51324455.cfilter,1,nil,tp)
end
function c51324455.filter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToHand()
end
function c51324455.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c51324455.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c51324455.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c51324455.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 c52140003.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c52140003.condition)
e1:SetTarget(c52140003.target)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(52140003,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_REPEAT)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCondition(c52140003.damcon)
e2:SetTarget(c52140003.damtg)
e2:SetOperation(c52140003.damop)
c:RegisterEffect(e2)
end
function c52140003.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp~=tp
end
function c52140003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c52140003.tgop)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
c:SetTurnCounter(0)
end
function c52140003.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP)
end
function c52140003.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(c52140003.cfilter,tp,0,LOCATION_ONFIELD,1,nil)
end
function c52140003.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c52140003.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.IsExistingMatchingCard(c52140003.cfilter,tp,0,LOCATION_ONFIELD,1,nil) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c52140003.tgop(e,tp,eg,ep,ev,re,r,rp)
if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler()
local ct=c:GetTurnCounter()
c:SetTurnCounter(ct+1)
if ct+1>=3 then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
--盗み見ゴブリン
function c52263685.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c52263685.target)
e1:SetOperation(c52263685.activate)
c:RegisterEffect(e1)
end
function c52263685.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=3 end
Duel.SetTargetPlayer(tp)
end
function c52263685.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if Duel.GetFieldGroupCount(p,0,LOCATION_DECK)==0 then return end
Duel.ConfirmDecktop(1-p,3)
local g=Duel.GetDecktopGroup(1-p,3)
local ct=g:GetCount()
if ct>0 then
Duel.Hint(HINT_SELECTMSG,p,aux.Stringid(52263685,0))
local sg=g:Select(p,1,1,nil)
Duel.MoveSequence(sg:GetFirst(),1)
Duel.ConfirmCards(1-p,sg)
Duel.SortDecktop(p,1-p,ct-1)
Duel.ConfirmDecktop(1-p,ct-1)
end
end
--皇の波動
function c59070329.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c59070329.cost)
e1:SetTarget(c59070329.target)
e1:SetOperation(c59070329.activate)
c:RegisterEffect(e1)
end
function c59070329.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_COST)
end
function c59070329.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c59070329.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c59070329.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c59070329.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c59070329.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
...@@ -27,6 +27,8 @@ function c62279055.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,6 +27,8 @@ function c62279055.activate(e,tp,eg,ep,ev,re,r,rp)
local tg,d=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS,CHAININFO_TARGET_PARAM) local tg,d=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS,CHAININFO_TARGET_PARAM)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackable() then if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackable() then
if Duel.DisableAttack(tc) then Duel.Damage(1-tp,d,REASON_EFFECT) end if Duel.DisableAttack(tc) then
Duel.Damage(1-tp,d,REASON_EFFECT)
end
end end
end end
--スター·チェンジャー
function c63485233.initial_effect(c)
--lv change
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c63485233.target)
e1:SetOperation(c63485233.operation)
c:RegisterEffect(e1)
end
function c63485233.filter(c)
return c:IsFaceup() and c:IsLevelAbove(1)
end
function c63485233.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c63485233.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c63485233.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c63485233.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
local op=0
if tc:GetLevel()==1 then op=Duel.SelectOption(tp,aux.Stringid(63485233,0))
else op=Duel.SelectOption(tp,aux.Stringid(63485233,0),aux.Stringid(63485233,1)) end
e:SetLabel(op)
end
function c63485233.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1fe0000)
if e:GetLabel()==0 then
e1:SetValue(1)
else e1:SetValue(-1) end
tc:RegisterEffect(e1)
end
end
--ウィルスメール
function c6430659.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--direct attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(6430659,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c6430659.atcon)
e2:SetTarget(c6430659.attg)
e2:SetOperation(c6430659.atop)
c:RegisterEffect(e2)
end
function c6430659.atcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=1 and Duel.GetCurrentPhase()~=0
end
function c6430659.filter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and not c:IsHasEffect(EFFECT_CANNOT_ATTACK)
end
function c6430659.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c6430659.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c6430659.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c6430659.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c6430659.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetOperation(c6430659.tgop)
tc:RegisterEffect(e2)
end
end
function c6430659.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
...@@ -17,7 +17,7 @@ function c68073522.initial_effect(c) ...@@ -17,7 +17,7 @@ function c68073522.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c68073522.target(e,tp,eg,ep,ev,re,r,rp,chk) function c68073522.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(eg:GetCount()*500) Duel.SetTargetParam(eg:GetCount()*500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,eg:GetCount()*500) Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,eg:GetCount()*500)
......
--大皇帝ペンギン
function c6836211.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6836211,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c6836211.spcost)
e1:SetTarget(c6836211.sptg)
e1:SetOperation(c6836211.spop)
c:RegisterEffect(e1)
end
function c6836211.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c6836211.filter(c,e,tp)
return c:IsSetCard(0x5a) and not c:IsCode(6836211) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c6836211.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6836211.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c6836211.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c6836211.filter,tp,LOCATION_DECK,0,1,2,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--バグ·ロード
function c69042950.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:SetTarget(c69042950.target)
e1:SetOperation(c69042950.activate)
c:RegisterEffect(e1)
end
function c69042950.mfilter(c,clv)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and (not clv or lv==clv)
end
function c69042950.spfilter(c,e,tp)
local lv=c:GetLevel()
return lv<=4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c69042950.mfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c69042950.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c69042950.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c69042950.mfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c69042950.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c69042950.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummonStep(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)~=0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,c69042950.spfilter,1-tp,LOCATION_HAND,0,1,1,nil,e,1-tp)
if g:GetCount()~=0 then
Duel.SpecialSummonStep(g:GetFirst(),0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
...@@ -25,7 +25,7 @@ function c70231910.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -25,7 +25,7 @@ function c70231910.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c70231910.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c70231910.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c70231910.activate(e) function c70231910.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
......
--アクア·ジェット
function c7653207.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(c7653207.target)
e1:SetOperation(c7653207.activate)
c:RegisterEffect(e1)
end
function c7653207.filter(c)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
end
function c7653207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c7653207.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c7653207.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c7653207.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c7653207.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1000)
tc:RegisterEffect(e1)
end
end
...@@ -19,11 +19,11 @@ end ...@@ -19,11 +19,11 @@ end
function c83544697.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c83544697.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c83544697.filter1,tp,LOCATION_GRAVE,0,2,nil) if chk==0 then return Duel.IsExistingTarget(c83544697.filter1,tp,LOCATION_GRAVE,0,2,nil)
and Duel.IsExistingTarget(c83544697.filter2,tp,0,LOCATION_ONFIELD,1,nil) end and Duel.IsExistingTarget(c83544697.filter2,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectTarget(tp,c83544697.filter1,tp,LOCATION_GRAVE,0,2,2,nil) local g1=Duel.SelectTarget(tp,c83544697.filter1,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,c83544697.filter2,tp,0,LOCATION_ONFIELD,1,1,nil) local g2=Duel.SelectTarget(tp,c83544697.filter2,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g2,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g2,1,0,0)
end end
......
--共同戦線
function c86474024.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(c86474024.condition)
e1:SetTarget(c86474024.target)
e1:SetOperation(c86474024.activate)
c:RegisterEffect(e1)
end
function c86474024.filter1(c,tp)
local lv1=c:GetLevel()
return lv1>0 and c:IsFaceup() and Duel.IsExistingMatchingCard(c86474024.filter2,tp,LOCATION_MZONE,0,1,c,lv1)
end
function c86474024.filter2(c,lv1)
return c:IsFaceup() and c:GetLevel()==lv1
end
function c86474024.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainInactivatable(ev)
and Duel.IsExistingMatchingCard(c86474024.filter1,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c86474024.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 c86474024.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ギョッ!
function c87313164.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(c87313164.condition)
e1:SetCost(c87313164.cost)
e1:SetTarget(c87313164.target)
e1:SetOperation(c87313164.activate)
c:RegisterEffect(e1)
end
function c87313164.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainInactivatable(ev)
end
function c87313164.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToDeck()
end
function c87313164.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87313164.cfilter,tp,LOCATION_REMOVED,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c87313164.cfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c87313164.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 c87313164.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--鬼神の連撃
function c90470931.initial_effect(c)
--multi attack
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c90470931.cost)
e1:SetTarget(c90470931.target)
e1:SetOperation(c90470931.operation)
c:RegisterEffect(e1)
end
function c90470931.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c90470931.filter(c,cst)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) and (not cst or c:GetOverlayCount()~=0)
end
function c90470931.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local chkcost=e:GetLabel()==1 and true or false
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c90470931.filter(chkc,chkcost) end
if chk==0 then
e:SetLabel(0)
return Duel.IsExistingTarget(c90470931.filter,tp,LOCATION_MZONE,0,1,nil,chkcost)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectTarget(tp,c90470931.filter,tp,LOCATION_MZONE,0,1,1,nil,chkcost):GetFirst()
if chkcost then
tc:RemoveOverlayCard(tp,tc:GetOverlayCount(),tc:GetOverlayCount(),REASON_COST)
end
end
function c90470931.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
--ダブル·アップ·チャンス
function c94770493.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_DISABLED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c94770493.target)
e1:SetOperation(c94770493.operation)
c:RegisterEffect(e1)
end
function c94770493.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc==eg:GetFirst() end
if chk==0 then return eg:GetFirst():IsFaceup() and eg:GetFirst():IsCanBeEffectTarget(e) end
Duel.SetTargetCard(eg:GetFirst())
end
function c94770493.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCountLimit(1)
e2:SetOperation(c94770493.atkop)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c94770493.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(e:GetHandler():GetAttack()*2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
e:GetHandler():RegisterEffect(e1)
end
...@@ -136,7 +136,9 @@ function c97489701.nacon(e,tp,eg,ep,ev,re,r,rp) ...@@ -136,7 +136,9 @@ function c97489701.nacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp return Duel.GetAttacker():GetControler()~=tp
end end
function c97489701.natg(e,tp,eg,ep,ev,re,r,rp,chk) function c97489701.natg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and not e:GetHandler():IsStatus(STATUS_CHAINING) end if chk==0 then return e:GetHandler():IsAbleToRemove() and e:GetHandler():IsCanBeEffectTarget(e)
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end end
function c97489701.naop(e,tp,eg,ep,ev,re,r,rp,chk) function c97489701.naop(e,tp,eg,ep,ev,re,r,rp,chk)
......
--ダメージ·ワクチンΩMAX
function c98535702.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_DAMAGE)
e1:SetTarget(c98535702.rectg)
e1:SetOperation(c98535702.recop)
c:RegisterEffect(e1)
end
function c98535702.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return ep==tp end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function c98535702.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
...@@ -38,7 +38,7 @@ function c98645731.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,7 +38,7 @@ function c98645731.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(p,3) Duel.ConfirmDecktop(p,3)
local g=Duel.GetDecktopGroup(p,3) local g=Duel.GetDecktopGroup(p,3)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil) local sg=g:Select(p,1,1,nil)
if sg:GetFirst():IsAbleToHand() then if sg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
......
--油断大敵
function c99657399.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_RECOVER)
e1:SetCondition(c99657399.condition)
e1:SetTarget(c99657399.target)
e1:SetOperation(c99657399.activate)
c:RegisterEffect(e1)
end
function c99657399.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c99657399.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 chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c99657399.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
...@@ -7,5 +7,5 @@ lastdeck = test ...@@ -7,5 +7,5 @@ lastdeck = test
textfont = c:/windows/fonts/simsun.ttc textfont = c:/windows/fonts/simsun.ttc
numfont = c:/windows/fonts/arialbd.ttf numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911 serverport = 7911
lastip = 192.168.2.100 lastip = 192.168.3.235
lastport = 7911 lastport = 7911
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment