Commit 652b6d75 authored by argon.sun's avatar argon.sun

fix & new scripts

parent 10d91ca5
......@@ -63,6 +63,7 @@ public:
bool remove_act;
bool deck_act;
bool extra_act;
bool chain_forced;
ChainInfo current_chain;
bool last_chain;
bool deck_reversed;
......
......@@ -963,10 +963,12 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
int selecting_player = BufferIO::ReadInt8(pbuf);
int count = BufferIO::ReadInt8(pbuf);
int specount = BufferIO::ReadInt8(pbuf);
int forced = BufferIO::ReadInt8(pbuf);
int hint0 = BufferIO::ReadInt32(pbuf);
int hint1 = BufferIO::ReadInt32(pbuf);
int c, l, s, code, desc;
ClientCard* pcard;
mainGame->dField.chain_forced = (forced != 0);
mainGame->dField.activatable_cards.clear();
mainGame->dField.activatable_descs.clear();
for (int i = 0; i < count; ++i) {
......@@ -995,13 +997,23 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
DuelClient::SendResponse();
return true;
}
if(mainGame->chkAutoChain->isChecked() && forced) {
SetResponseI(0);
mainGame->dField.ClearChainSelect();
DuelClient::SendResponse();
return true;
}
mainGame->gMutex.Lock();
if(count == 0)
myswprintf(textBuffer, L"%ls\n%ls", dataManager.GetSysString(201), dataManager.GetSysString(202));
else
myswprintf(textBuffer, L"%ls\n%ls", event_string, dataManager.GetSysString(203));
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, (wchar_t*)textBuffer);
mainGame->PopupElement(mainGame->wQuery);
mainGame->stHintMsg->setText(dataManager.GetSysString(550));
mainGame->stHintMsg->setVisible(true);
if(!forced) {
if(count == 0)
myswprintf(textBuffer, L"%ls\n%ls", dataManager.GetSysString(201), dataManager.GetSysString(202));
else
myswprintf(textBuffer, L"%ls\n%ls", event_string, dataManager.GetSysString(203));
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, (wchar_t*)textBuffer);
mainGame->PopupElement(mainGame->wQuery);
}
mainGame->gMutex.Unlock();
return true;
}
......
......@@ -1154,6 +1154,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break;
}
case MSG_SELECT_CHAIN: {
if(chain_forced)
break;
if(mainGame->wCardSelect->isVisible()) {
mainGame->HideElement(mainGame->wCardSelect);
break;
......
......@@ -13,7 +13,7 @@
#include <dirent.h>
#endif
const unsigned short PRO_VERSION = 0x1023;
const unsigned short PRO_VERSION = 0x1024;
namespace ygo {
......
......@@ -184,7 +184,7 @@ bool Replay::CheckReplay(const wchar_t* name) {
ReplayHeader rheader;
fread(&rheader, sizeof(ReplayHeader), 1, rfp);
fclose(rfp);
return rheader.id == 0x31707279 && rheader.version >= 0x1020;
return rheader.id == 0x31707279 && rheader.version >= 0x1024;
}
bool Replay::ReadNextResponse(unsigned char resp[64]) {
if(pdata - replay_data >= replay_size)
......
......@@ -201,7 +201,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
case MSG_SELECT_CHAIN: {
player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf);
pbuf += 9 + count * 11;
pbuf += 10 + count * 11;
return ReadReplayResponse();
}
case MSG_SELECT_PLACE:
......
......@@ -663,7 +663,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_SELECT_CHAIN: {
player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf);
pbuf += 9 + count * 11;
pbuf += 10 + count * 11;
WaitforResponse(player);
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1;
......
......@@ -325,6 +325,8 @@ public:
#define EFFECT_DISABLE_FIELD 260
#define EFFECT_USE_EXTRA_MZONE 261
#define EFFECT_USE_EXTRA_SZONE 262
#define EFFECT_MAX_MZONE 263
#define EFFECT_MAX_SZONE 264
#define EFFECT_HAND_LIMIT 270
#define EFFECT_DRAW_COUNT 271
#define EFFECT_SPIRIT_DONOT_RETURN 280
......
......@@ -16,7 +16,7 @@
int32 field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5};
bool chain::chain_operation_sort(chain c1, chain c2) {
return c1.triggering_effect->id < c2.triggering_effect->id;
return c1.triggering_effect->id > c2.triggering_effect->id;
}
field::field(duel* pduel) {
this->pduel = pduel;
......@@ -392,13 +392,21 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint32* list) {
if (location != LOCATION_MZONE && location != LOCATION_SZONE)
return 0;
uint32 flag = player[playerid].disabled_location | player[playerid].used_location;
if (location == LOCATION_MZONE)
effect_set eset;
if (location == LOCATION_MZONE) {
flag = (flag & 0x1f);
else
filter_player_effect(playerid, EFFECT_MAX_MZONE, &eset);
} else {
flag = (flag & 0x1f00) >> 8;
filter_player_effect(playerid, EFFECT_MAX_SZONE, &eset);
}
if(list)
*list = flag;
return 5 - field_used_count[flag];
int32 max = 5;
if(eset.count)
max = eset.get_last()->get_value();
int32 ret = max - field_used_count[flag];
return ret > 0 ? ret : 0;
}
void field::shuffle(uint8 playerid, uint8 location) {
if(!(location & (LOCATION_HAND + LOCATION_DECK)))
......
......@@ -451,7 +451,7 @@ public:
int32 select_yes_no(uint16 step, uint8 playerid, uint32 description);
int32 select_option(uint16 step, uint8 playerid);
int32 select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 min, uint8 max);
int32 select_chain(uint16 step, uint8 playerid, uint8 spe_count);
int32 select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 forced);
int32 select_place(uint16 step, uint8 playerid, uint32 flag, uint8 count);
int32 select_position(uint16 step, uint8 playerid, uint32 code, uint8 positions);
int32 select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8 min, uint8 max);
......
......@@ -265,13 +265,14 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
return TRUE;
}
}
int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count) {
int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 forced) {
if(step == 0) {
returns.ivalue[0] = -1;
pduel->write_buffer8(MSG_SELECT_CHAIN);
pduel->write_buffer8(playerid);
pduel->write_buffer8(core.select_chains.size());
pduel->write_buffer8(spe_count);
pduel->write_buffer8(forced);
pduel->write_buffer32(pduel->game_field->core.hint_timing[playerid]);
pduel->write_buffer32(pduel->game_field->core.hint_timing[1 - playerid]);
std::sort(core.select_chains.begin(), core.select_chains.end(), chain::chain_operation_sort);
......@@ -286,7 +287,7 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count) {
}
return FALSE;
} else {
if(returns.ivalue[0] > 0 && returns.ivalue[0] >= (int32)core.select_chains.size()) {
if((returns.ivalue[0] < 0 && forced) || returns.ivalue[0] >= (int32)core.select_chains.size()) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
}
......
This diff is collapsed.
--パワー·インベーダー
function c18842395.initial_effect(c)
--summon & set with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18842395,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c18842395.ntcon)
c:RegisterEffect(e1)
end
function c18842395.ntcon(e,c)
if c==nil then return true end
return c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)~=0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>=2
end
......@@ -73,6 +73,7 @@ function c23205979.desop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_DAMAGE and not Duel.IsDamageCalculated() then
e:GetLabelObject():SetLabel(1)
else
Debug.Message(c:IsDisabled())
if not c:IsDisabled() then Duel.Destroy(c,REASON_EFFECT) end
end
end
......
--儀式の檻
function c25796442.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_RITUAL))
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(c25796442.efilter)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(c25796442.efilter)
c:RegisterEffect(e4)
end
function c25796442.efilter(e,re)
return re:IsActiveType(TYPE_EFFECT)
end
......@@ -75,7 +75,7 @@ function c27383110.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c27383110.thop(e,tp,eg,ep,ev,re,r,rp,chk)
function c27383110.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
--オイルメン
function c31768112.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31768112,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c31768112.eqtg)
e1:SetOperation(c31768112.eqop)
c:RegisterEffect(e1)
--unequip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31768112,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c31768112.uncon)
e2:SetTarget(c31768112.sptg)
e2:SetOperation(c31768112.spop)
c:RegisterEffect(e2)
--destroy sub
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c31768112.uncon)
e3:SetValue(1)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(31768112,2))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c31768112.drcon)
e4:SetTarget(c31768112.drtg)
e4:SetOperation(c31768112.drop)
c:RegisterEffect(e4)
--eqlimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EQUIP_LIMIT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(c31768112.eqlimit)
c:RegisterEffect(e5)
end
function c31768112.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
function c31768112.eqlimit(e,c)
return c:IsRace(RACE_MACHINE)
end
function c31768112.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:GetUnionCount()==0
end
function c31768112.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c31768112.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(31768112)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c31768112.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c31768112.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
e:GetHandler():RegisterFlagEffect(31768112,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c31768112.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 c31768112.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 c31768112.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(31768112)==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(31768112,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c31768112.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)
end
end
function c31768112.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
end
function c31768112.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c31768112.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--カイザーコロシアム
function c35059553.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_MAX_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetValue(c35059553.value)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CANNOT_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCondition(c35059553.condition)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e5)
end
function c35059553.value(e)
local limit=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)
return limit>0 and limit or 5
end
function c35059553.condition(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
end
--シュレツダー
function c3603242.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3603242,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c3603242.descost)
e1:SetTarget(c3603242.destg)
e1:SetOperation(c3603242.desop)
c:RegisterEffect(e1)
end
function c3603242.cfilter(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost()
and Duel.IsExistingTarget(c3603242.dfilter,tp,0,LOCATION_MZONE,1,nil,c:GetLevel())
end
function c3603242.dfilter(c,lv)
return c:IsFaceup() and c:IsLevelBelow(lv) and c:IsDestructable()
end
function c3603242.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c3603242.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c3603242.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp)
local lv=g:GetFirst():GetLevel()
e:SetLabel(lv)
Duel.SendtoGrave(g,REASON_COST)
end
function c3603242.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c3603242.dfilter(chkc,e:GetLabel()) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c3603242.dfilter,tp,0,LOCATION_MZONE,1,1,nil,e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c3603242.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsControler(1-tp) and tc:IsRelateToEffect(e) and tc:IsLevelBelow(e:GetLabel()) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--儀式魔人プレコグスター
function c4141820.initial_effect(c)
--ritual material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
c:RegisterEffect(e1)
--become material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c4141820.condition)
e2:SetOperation(c4141820.operation)
c:RegisterEffect(e2)
end
function c4141820.condition(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RITUAL
end
function c4141820.operation(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
if rc:GetFlagEffect(4141820)==0 then
--draw
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetOperation(c4141820.hdop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterFlagEffect(4141820,RESET_EVENT+0x1fe0000,0,1)
end
end
function c4141820.hdop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
--インフォーマー·スパイダー
function c4941482.initial_effect(c)
--control
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_CONTROL)
e2:SetDescription(aux.Stringid(4941482,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c4941482.condition)
e2:SetTarget(c4941482.target)
e2:SetOperation(c4941482.operation)
c:RegisterEffect(e2)
end
function c4941482.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT)
end
function c4941482.filter(c)
return c:IsPosition(POS_DEFENCE) and c:IsControlerCanBeChanged()
end
function c4941482.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 c4941482.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c4941482.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
function c4941482.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsPosition(POS_DEFENCE) and tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--パワー·サプライヤー
function c55063681.initial_effect(c)
--set target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55063681,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c55063681.target)
e1:SetOperation(c55063681.operation)
c:RegisterEffect(e1)
end
function c55063681.filter(c,ec)
return c:IsFaceup() and ((ec==c and c:GetFlagEffect(55063681)==0) or (ec~=c and not ec:IsHasCardTarget(c)))
end
function c55063681.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c55063681.filter(chkc,e:GetHandler()) end
if chk==0 then return Duel.IsExistingTarget(c55063681.filter,tp,LOCATION_MZONE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c55063681.filter,tp,LOCATION_MZONE,0,1,1,nil,e:GetHandler())
end
function c55063681.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
if tc~=c then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(400)
e1:SetCondition(c55063681.atkcon)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(400)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(55063681,RESET_EVENT+0x1fe0000,0,1)
end
end
end
function c55063681.atkcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
......@@ -26,5 +26,5 @@ function c58601383.ffilter(c)
return c:IsType(TYPE_SYNCHRO) and not c:IsType(TYPE_EFFECT)
end
function c58601383.efilter(e,re)
return re:GetOwner():IsType(TYPE_EFFECT)
return re:IsActiveType(TYPE_EFFECT)
end
......@@ -24,7 +24,7 @@ end
function c61757117.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c61757117.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c61757117.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() end
if chk==0 then return true end
local c=e:GetHandler()
......@@ -36,6 +36,7 @@ function c61757117.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
while tc do
if tc:IsFaceup() and tc:IsRelateToEffect(e) then c:SetCardTarget(tc) end
tc=g:GetNext()
......
--ブラックポータン
function c76218643.initial_effect(c)
--lp damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c76218643.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--lp recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76218643,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(c76218643.reccon)
e2:SetTarget(c76218643.rectg)
e2:SetOperation(c76218643.recop)
c:RegisterEffect(e2)
end
function c76218643.indfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TUNER)
end
function c76218643.indcon(e)
return Duel.IsExistingMatchingCard(c76218643.indfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c76218643.filter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsType(TYPE_TUNER)
end
function c76218643.reccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c76218643.filter,1,nil,tp)
end
function c76218643.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,800)
end
function c76218643.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 c77153811.initial_effect(c)
--ritual material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
c:RegisterEffect(e1)
--become material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c77153811.condition)
e2:SetOperation(c77153811.operation)
c:RegisterEffect(e2)
end
function c77153811.condition(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RITUAL
end
function c77153811.operation(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
if rc:GetFlagEffect(77153811)==0 then
--cannot special summon
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c77153811.distg)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c77153811.disop)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2)
rc:RegisterFlagEffect(77153811,RESET_EVENT+0x1fe0000,0,1)
end
end
function c77153811.distg(e,c)
return c:IsType(TYPE_SYNCHRO)
end
function c77153811.disop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SYNCHRO) then
Duel.NegateEffect(ev)
end
end
--バッド·エンド·クイーン·ドラゴン
function c80513550.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c80513550.hspcon)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80513550,0))
e2:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetTarget(c80513550.hdtg)
e2:SetOperation(c80513550.hdop)
c:RegisterEffect(e2)
--Special Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(80513550,1))
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c80513550.spcon)
e3:SetCost(c80513550.spcost)
e3:SetTarget(c80513550.sptg)
e3:SetOperation(c80513550.spop)
c:RegisterEffect(e3)
end
function c80513550.hspfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c80513550.hspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c80513550.hspfilter,c:GetControler(),LOCATION_SZONE,0,3,nil)
end
function c80513550.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c80513550.hdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c80513550.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c80513550.cfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToGraveAsCost()
end
function c80513550.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80513550.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c80513550.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c80513550.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c80513550.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--ソード·マスター
function c81336148.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81336148,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(c81336148.spcon)
e1:SetTarget(c81336148.sptg)
e1:SetOperation(c81336148.spop)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
end
function c81336148.spcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and Duel.GetTurnPlayer()==tp and (d:IsRelateToBattle() or not d:IsReason(REASON_BATTLE))
end
function c81336148.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c81336148.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--マジック·ホール·ゴーレム
function c82458280.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82458280,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c82458280.condition)
e1:SetTarget(c82458280.target)
e1:SetOperation(c82458280.operation)
c:RegisterEffect(e1)
end
function c82458280.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c82458280.filter(c)
return c:IsFaceup()
end
function c82458280.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c82458280.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c82458280.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c82458280.filter,tp,LOCATION_MZONE,0,1,1,nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c82458280.ftarget)
e1:SetLabel(g:GetFirst():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c82458280.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c82458280.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()/2)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--血涙のオーガ
function c82670878.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82670878,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c82670878.condition)
e1:SetTarget(c82670878.target)
e1:SetOperation(c82670878.operation)
c:RegisterEffect(e1)
if not c82670878.global_check then
c82670878.global_check=true
c82670878[0]=0
c82670878[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetCondition(c82670878.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_ATTACK_DISABLED)
ge2:SetCondition(c82670878.check2)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(c82670878.clear)
Duel.RegisterEffect(ge3,0)
end
end
function c82670878.check(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if Duel.GetAttackTarget()==nil then
c82670878[1-tc:GetControler()]=c82670878[1-tc:GetControler()]+1
if c82670878[1-tc:GetControler()]==1 then
c82670878[2]=Duel.GetAttacker()
c82670878[3]=Duel.GetAttacker():GetAttack()
c82670878[4]=Duel.GetAttacker():GetDefence()
Duel.GetAttacker():RegisterFlagEffect(82670878,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
end
function c82670878.check2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(82670878)~=0 and Duel.GetAttackTarget()~=nil then
c82670878[1-tc:GetControler()]=c82670878[1-tc:GetControler()]-1
end
end
function c82670878.clear(e,tp,eg,ep,ev,re,r,rp)
c82670878[0]=0
c82670878[1]=0
end
function c82670878.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttackTarget()==nil and c82670878[tp]==2
end
function c82670878.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c82670878.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
if c82670878[2] and c82670878[2]:GetFlagEffect(82670878) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(c82670878[3])
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE)
e2:SetValue(c82670878[4])
c:RegisterEffect(e2)
--at limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetTarget(c82670878.atlimit)
e3:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
end
function c82670878.atlimit(e,c)
return c~=e:GetHandler()
end
--昇華する魂
function c88301833.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88301833,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c88301833.thcon)
e2:SetTarget(c88301833.thtg)
e2:SetOperation(c88301833.thop)
c:RegisterEffect(e2)
end
function c88301833.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c88301833.thfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand()
end
function c88301833.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=eg:GetFirst()
local mat=tc:GetMaterial()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and mat:IsContains(chkc) end
if chk==0 then return mat:IsExists(c88301833.thfilter,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=mat:FilterSelect(tp,c88301833.thfilter,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c88301833.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
......@@ -19,13 +19,16 @@ function c8903700.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c8903700.operation(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
--cannot special summon
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetAbsoluteRange(rp,0,1)
rc:RegisterEffect(e1)
if rc:GetFlagEffect(8903700)==0 then
--cannot special summon
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetAbsoluteRange(rp,0,1)
rc:RegisterEffect(e1)
rc:RegisterFlagEffect(8903700,RESET_EVENT+0x1fe0000,0,1)
end
end
......@@ -403,6 +403,8 @@ EFFECT_MATERIAL_CHECK =251
EFFECT_DISABLE_FIELD =260
EFFECT_USE_EXTRA_MZONE =261
EFFECT_USE_EXTRA_SZONE =262
EFFECT_MAX_MZONE =263
EFFECT_MAX_SZONE =264
EFFECT_HAND_LIMIT =270
EFFECT_DRAW_COUNT =271
EFFECT_SPIRIT_DONOT_RETURN =280
......
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