Commit 63e41dce authored by argon.sun's avatar argon.sun

fix

parent 5d17ce74
...@@ -1075,7 +1075,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -1075,7 +1075,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s);
mainGame->dField.selectable_cards.push_back(pcard); mainGame->dField.selectable_cards.push_back(pcard);
pcard->opParam = (t << 16) | t; pcard->opParam = (t << 16) | t;
pcard->select_seq = i;
pcard->is_selectable = true; pcard->is_selectable = true;
} }
myswprintf(textBuffer, dataManager.GetSysString(204), mainGame->dField.select_counter_count, dataManager.GetCounterName(mainGame->dField.select_counter_type)); myswprintf(textBuffer, dataManager.GetSysString(204), mainGame->dField.select_counter_count, dataManager.GetCounterName(mainGame->dField.select_counter_type));
...@@ -1370,6 +1369,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -1370,6 +1369,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
s = BufferIO::ReadInt8(pbuf); s = BufferIO::ReadInt8(pbuf);
BufferIO::ReadInt8(pbuf); BufferIO::ReadInt8(pbuf);
mc[i] = mainGame->dField.mzone[c][s]; mc[i] = mainGame->dField.mzone[c][s];
mc[i]->SetCode(0);
mc[i]->dPos = irr::core::vector3df((3.95f - mc[i]->curPos.X) / 10, 0, 0.05f); mc[i]->dPos = irr::core::vector3df((3.95f - mc[i]->curPos.X) / 10, 0, 0.05f);
mc[i]->dRot = irr::core::vector3df(0, 0, 0); mc[i]->dRot = irr::core::vector3df(0, 0, 0);
mc[i]->is_moving = true; mc[i]->is_moving = true;
......
...@@ -995,8 +995,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -995,8 +995,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if (select_counter_count == 0) { if (select_counter_count == 0) {
unsigned char respbuf[64]; unsigned char respbuf[64];
for(int i = 0; i < selectable_cards.size(); ++i) for(int i = 0; i < selectable_cards.size(); ++i)
respbuf[i] = (selectable_cards[i]->opParam >> 16) - (clicked_card->opParam & 0xffff); respbuf[i] = (selectable_cards[i]->opParam >> 16) - (selectable_cards[i]->opParam & 0xffff);
mainGame->stHintMsg->setVisible(false); mainGame->stHintMsg->setVisible(false);
ClearSelect();
DuelClient::SetResponseB(respbuf, selectable_cards.size()); DuelClient::SetResponseB(respbuf, selectable_cards.size());
mainGame->localAction.Set(); mainGame->localAction.Set();
} else { } else {
......
...@@ -204,6 +204,19 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -204,6 +204,19 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break; break;
} }
case LISTBOX_REPLAY_LIST: { case LISTBOX_REPLAY_LIST: {
int sel = mainGame->lstReplayList->getSelected();
if(sel == -1)
break;
if(!ReplayMode::cur_replay.OpenReplay(mainGame->lstReplayList->getListItem(sel)))
break;
wchar_t infobuf[256];
std::wstring repinfo;
tm* st = localtime((time_t*)(&ReplayMode::cur_replay.pheader.seed));
myswprintf(infobuf, L"%d/%d/%d %02d:%02d:%02d\n", st->tm_year + 1900, st->tm_mon + 1, st->tm_mday, st->tm_hour, st->tm_min, st->tm_sec);
repinfo.append(infobuf);
myswprintf(infobuf, L"%ls\n===VS===\n%ls\n", (wchar_t*)ReplayMode::cur_replay.replay_data, (wchar_t*)(&ReplayMode::cur_replay.replay_data[40]));
repinfo.append(infobuf);
mainGame->SetStaticText(mainGame->stReplayInfo, 180, mainGame->guiFont, (wchar_t*)repinfo.c_str());
break; break;
} }
} }
......
...@@ -333,8 +333,8 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -333,8 +333,8 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
last_replay.BeginRecord(); last_replay.BeginRecord();
last_replay.WriteHeader(rh); last_replay.WriteHeader(rh);
rnd.reset(seed); rnd.reset(seed);
last_replay.WriteData(players[0], 40, false); last_replay.WriteData(players[0]->name, 40, false);
last_replay.WriteData(players[1], 40, false); last_replay.WriteData(players[1]->name, 40, false);
if(!host_info.no_shuffle_deck) { if(!host_info.no_shuffle_deck) {
for(int i = 0; i < pdeck[0].main.size(); ++i) { for(int i = 0; i < pdeck[0].main.size(); ++i) {
int swap = rnd.real() * pdeck[0].main.size(); int swap = rnd.real() * pdeck[0].main.size();
......
...@@ -1823,22 +1823,22 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -1823,22 +1823,22 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
core.spe_effect[priority]++; core.spe_effect[priority]++;
} }
} }
} pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN);
pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN); for(; pr.first != pr.second; ++pr.first) {
for(; pr.first != pr.second; ++pr.first) { peffect = pr.first->second;
peffect = pr.first->second; if(peffect->is_chainable(priority) && peffect->is_activateable(priority, nil_event)) {
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, nil_event)) { newchain.flag = 0;
newchain.flag = 0; newchain.chain_id = infos.field_id++;
newchain.chain_id = infos.field_id++; newchain.evt = nil_event;
newchain.evt = nil_event; newchain.triggering_controler = peffect->handler->current.controler;
newchain.triggering_controler = peffect->handler->current.controler; newchain.triggering_effect = peffect;
newchain.triggering_effect = peffect; newchain.triggering_location = peffect->handler->current.location;
newchain.triggering_location = peffect->handler->current.location; newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_sequence = peffect->handler->current.sequence; newchain.triggering_player = priority;
newchain.triggering_player = priority; core.select_chains.push_back(newchain);
core.select_chains.push_back(newchain); if(check_hint_timing(peffect))
if(check_hint_timing(peffect)) core.spe_effect[priority]++;
core.spe_effect[priority]++; }
} }
} }
if(core.current_chain.size() || (core.hint_timing[0]&TIMING_ATTACK) || (core.hint_timing[1]&TIMING_ATTACK)) if(core.current_chain.size() || (core.hint_timing[0]&TIMING_ATTACK) || (core.hint_timing[1]&TIMING_ATTACK))
......
...@@ -5,68 +5,72 @@ function c10000030.initial_effect(c) ...@@ -5,68 +5,72 @@ function c10000030.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--effect --effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10000030,0)) e1:SetDescription(aux.Stringid(10000030,1))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c10000030.target) e1:SetCost(c10000030.cost)
e1:SetOperation(c10000030.operation) e1:SetTarget(c10000030.target1)
e1:SetOperation(c10000030.operation1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10000030,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c10000030.cost)
e2:SetTarget(c10000030.target2)
e2:SetOperation(c10000030.operation2)
c:RegisterEffect(e2)
end end
function c10000030.xyzfilter(c) function c10000030.xyzfilter(c)
return c:GetLevel()==6 and c:IsRace(RACE_SPELLCASTER) return c:GetLevel()==6 and c:IsRace(RACE_SPELLCASTER)
end end
function c10000030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(10000030)==0
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
e:GetHandler():RegisterFlagEffect(10000030,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
function c10000030.filter1(c) function c10000030.filter1(c)
return c:IsControlerCanBeChanged() return c:IsControlerCanBeChanged()
end end
function c10000030.filter2(c,e,tp) function c10000030.filter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c10000030.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c10000030.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c10000030.filter2(chkc,e,tp) end
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c10000030.filter1(chkc) if chk==0 then return Duel.IsExistingTarget(c10000030.filter1,tp,0,LOCATION_MZONE,1,nil) end
else return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c10000030.filter2(chkc,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
end local g=Duel.SelectTarget(tp,c10000030.filter1,tp,0,LOCATION_MZONE,1,1,nil)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
and (Duel.IsExistingTarget(c10000030.filter1,tp,0,LOCATION_MZONE,1,nil) function c10000030.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
or (Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingTarget(c10000030.filter2,tp,0,LOCATION_GRAVE,1,nil,e,tp))) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c10000030.filter1(chkc) end
local b1=Duel.IsExistingTarget(c10000030.filter1,tp,0,LOCATION_MZONE,1,nil) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingTarget(c10000030.filter2,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingTarget(c10000030.filter2,tp,0,LOCATION_GRAVE,1,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local op=0 local g=Duel.SelectTarget(tp,c10000030.filter2,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10000030,0)) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(10000030,1),aux.Stringid(10000030,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(10000030,1))
else op=Duel.SelectOption(tp,aux.Stringid(10000030,2))+1 end
e:SetLabel(op)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
if op==0 then
e:SetCategory(CATEGORY_CONTROL)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c10000030.filter1,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c10000030.filter2,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
end end
function c10000030.operation(e,tp,eg,ep,ev,re,r,rp) function c10000030.operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if e:GetLabel()==0 then if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then Duel.Destroy(tc,REASON_EFFECT)
Duel.Destroy(tc,REASON_EFFECT)
end
end
else
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
function c10000030.operation2(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
...@@ -81,6 +81,7 @@ function c21113684.con(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,6 +81,7 @@ function c21113684.con(e,tp,eg,ep,ev,re,r,rp)
end end
function c21113684.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c21113684.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,1,REASON_COST) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x3001,1,REASON_COST) Duel.RemoveCounter(tp,1,0,0x3001,1,REASON_COST)
end end
function c21113684.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c21113684.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -59,6 +59,7 @@ function c27970830.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,6 +59,7 @@ function c27970830.ctop(e,tp,eg,ep,ev,re,r,rp)
end end
function c27970830.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function c27970830.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3003,2,REASON_COST) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3003,2,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x3003,2,REASON_COST) Duel.RemoveCounter(tp,1,0,0x3003,2,REASON_COST)
end end
function c27970830.filter1(c) function c27970830.filter1(c)
...@@ -85,6 +86,7 @@ function c27970830.op1(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,6 +86,7 @@ function c27970830.op1(e,tp,eg,ep,ev,re,r,rp)
end end
function c27970830.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c27970830.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3003,4,REASON_COST) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3003,4,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x3003,4,REASON_COST) Duel.RemoveCounter(tp,1,0,0x3003,4,REASON_COST)
end end
function c27970830.filter2(c) function c27970830.filter2(c)
...@@ -105,6 +107,7 @@ function c27970830.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,6 +107,7 @@ function c27970830.op2(e,tp,eg,ep,ev,re,r,rp)
end end
function c27970830.cost3(e,tp,eg,ep,ev,re,r,rp,chk) function c27970830.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3003,6,REASON_COST) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3003,6,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x3003,6,REASON_COST) Duel.RemoveCounter(tp,1,0,0x3003,6,REASON_COST)
end end
function c27970830.filter3(c,e,tp) function c27970830.filter3(c,e,tp)
......
...@@ -3,52 +3,50 @@ function c34086406.initial_effect(c) ...@@ -3,52 +3,50 @@ function c34086406.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2) aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2)
c:EnableReviveLimit() c:EnableReviveLimit()
--sel effect --to grave
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34086406,0)) e1:SetDescription(aux.Stringid(34086406,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCost(c34086406.cost) e1:SetCost(c34086406.cost)
e1:SetTarget(c34086406.target) e1:SetTarget(c34086406.target1)
e1:SetOperation(c34086406.operation) e1:SetOperation(c34086406.operation1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to deck top
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(34086406,2))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c34086406.cost)
e2:SetTarget(c34086406.target2)
e2:SetOperation(c34086406.operation2)
c:RegisterEffect(e2)
end end
function c34086406.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c34086406.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():GetFlagEffect(34086406)==0
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RegisterFlagEffect(34086406,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c34086406.target(e,tp,eg,ep,ev,re,r,rp,chk) function c34086406.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) end
or Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_MONSTER) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,0,1,tp,LOCATION_DECK)
local op=0
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_MONSTER)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34086406,0))
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(34086406,1),aux.Stringid(34086406,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(34086406,1))
else op=Duel.SelectOption(tp,aux.Stringid(34086406,2))+1 end
if op==0 then
e:SetCategory(CATEGORY_TOGRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,0,1,tp,LOCATION_DECK)
else
e:SetCategory(0)
end
e:SetLabel(op)
end end
function c34086406.operation(e,tp,eg,ep,ev,re,r,rp) function c34086406.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()==0 then if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_MONSTER) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,1,nil) function c34086406.operation1(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
else local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34086406,2)) Duel.SendtoGrave(g,REASON_EFFECT)
local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_DECK,0,1,1,nil,TYPE_MONSTER) end
local tc=g:GetFirst() function c34086406.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34086406,3))
Duel.MoveSequence(tc,0) local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_DECK,0,1,1,nil,TYPE_MONSTER)
Duel.ConfirmDecktop(tp,1) local tc=g:GetFirst()
end Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end end
...@@ -10,6 +10,7 @@ function c3429238.initial_effect(c) ...@@ -10,6 +10,7 @@ function c3429238.initial_effect(c)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c3429238.datcon) e1:SetCondition(c3429238.datcon)
e1:SetTarget(c3429238.dattg)
e1:SetOperation(c3429238.datop) e1:SetOperation(c3429238.datop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove --remove
...@@ -41,22 +42,29 @@ end ...@@ -41,22 +42,29 @@ end
function c3429238.datcon(e,tp,eg,ep,ev,re,r,rp) function c3429238.datcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 return Duel.GetCurrentPhase()==PHASE_MAIN1
end end
function c3429238.dattg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c3429238.datop(e,tp,eg,ep,ev,re,r,rp) function c3429238.datop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) if c:IsRelateToEffect(e) and c:IsFaceup() then
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetValue(c:GetAttack()/2) e1:SetCode(EFFECT_SET_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(c:GetAttack()/2)
c:RegisterEffect(e1) e1:SetReset(RESET_EVENT+0x1fe0000)
local e2=Effect.CreateEffect(c) c:RegisterEffect(e1)
e2:SetType(EFFECT_TYPE_SINGLE) local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_DIRECT_ATTACK) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e2:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e2) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end end
function c3429238.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function c3429238.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and e:GetHandler():IsAbleToRemove() end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and e:GetHandler():IsAbleToRemove() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end end
function c3429238.rmop(e,tp,eg,ep,ev,re,r,rp) function c3429238.rmop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -49,6 +49,7 @@ function c3657444.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -49,6 +49,7 @@ function c3657444.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c3657444.filter2(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c3657444.filter2(chkc) end
if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.IsPlayerCanDraw(tp,2) if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.IsPlayerCanDraw(tp,2)
and Duel.IsExistingTarget(c3657444.filter2,tp,LOCATION_MZONE,0,1,e:GetHandler()) end and Duel.IsExistingTarget(c3657444.filter2,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c3657444.filter2,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,c3657444.filter2,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
local sg=g:Clone() local sg=g:Clone()
...@@ -69,6 +70,7 @@ end ...@@ -69,6 +70,7 @@ end
function c3657444.target3(e,tp,eg,ep,ev,re,r,rp,chk) function c3657444.target3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() if chk==0 then return e:GetHandler():IsAbleToRemove()
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_GRAVE)
end end
......
...@@ -7,10 +7,20 @@ function c48742406.initial_effect(c) ...@@ -7,10 +7,20 @@ function c48742406.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCost(c48742406.damcost)
e1:SetTarget(c48742406.damtg) e1:SetTarget(c48742406.damtg)
e1:SetOperation(c48742406.damop) e1:SetOperation(c48742406.damop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c48742406.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c48742406.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c48742406.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,48742406)==0 end if chk==0 then return Duel.GetFlagEffect(tp,48742406)==0 end
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
......
...@@ -3,16 +3,35 @@ function c581014.initial_effect(c) ...@@ -3,16 +3,35 @@ function c581014.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2) aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2)
c:EnableReviveLimit() c:EnableReviveLimit()
--sel effect --ret&draw
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(581014,0)) e1:SetDescription(aux.Stringid(581014,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c581014.target) e1:SetCost(c581014.cost)
e1:SetOperation(c581014.operation) e1:SetTarget(c581014.target1)
e1:SetOperation(c581014.operation1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(581014,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c581014.cost)
e2:SetTarget(c581014.target2)
e2:SetOperation(c581014.operation2)
c:RegisterEffect(e2)
end
function c581014.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(581014)==0
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RegisterFlagEffect(581014,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c581014.filter1(c) function c581014.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
...@@ -20,53 +39,35 @@ end ...@@ -20,53 +39,35 @@ end
function c581014.filter2(c,e,tp) function c581014.filter2(c,e,tp)
return not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c581014.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c581014.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter1(c) end
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter1(c) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil) end
else return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter2(c,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
end local g=Duel.SelectTarget(tp,c581014.filter1,tp,LOCATION_GRAVE,0,3,3,nil)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
and ((Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil)) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
or Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp)) end end
local op=0 function c581014.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter2(c,e,tp) end
local b2=Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) if chk==0 then return Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(581014,0)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if b1 and b2 then local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
op=Duel.SelectOption(tp,aux.Stringid(581014,1),aux.Stringid(581014,2)) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(581014,1))
else op=Duel.SelectOption(tp,aux.Stringid(581014,2))+1 end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c581014.filter1,tp,LOCATION_GRAVE,0,3,3,nil)
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
e:SetLabel(op)
end end
function c581014.tgfilter(c,e) function c581014.tgfilter(c,e)
return not c:IsRelateToEffect(e) return not c:IsRelateToEffect(e)
end end
function c581014.operation(e,tp,eg,ep,ev,re,r,rp) function c581014.operation1(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if tg:IsExists(c581014.tgfilter,1,nil,e) then return end
if tg:IsExists(c581014.tgfilter,1,nil,e) then return end Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(tp) Duel.BreakEffect()
Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT) end
else function c581014.operation2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
...@@ -8,17 +8,28 @@ function c62265044.initial_effect(c) ...@@ -8,17 +8,28 @@ function c62265044.initial_effect(c)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetDescription(aux.Stringid(62265044,0)) e2:SetDescription(aux.Stringid(62265044,1))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c62265044.cost) e2:SetCost(c62265044.cost)
e2:SetTarget(c62265044.target) e2:SetTarget(c62265044.target1)
e2:SetOperation(c62265044.operation) e2:SetOperation(c62265044.operation1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetDescription(aux.Stringid(62265044,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCost(c62265044.cost)
e3:SetTarget(c62265044.target2)
e3:SetOperation(c62265044.operation2)
c:RegisterEffect(e3)
end end
function c62265044.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c62265044.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return e:GetHandler():GetFlagEffect(62265044)==0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
e:GetHandler():RegisterFlagEffect(62265044,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function c62265044.filter1(c) function c62265044.filter1(c)
...@@ -27,40 +38,28 @@ end ...@@ -27,40 +38,28 @@ end
function c62265044.filter2(c) function c62265044.filter2(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGrave() return c:IsRace(RACE_DRAGON) and c:IsAbleToGrave()
end end
function c62265044.target(e,tp,eg,ep,ev,re,r,rp,chk) function c62265044.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62265044.filter1,tp,LOCATION_DECK,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(c62265044.filter1,tp,LOCATION_DECK,0,1,nil) end
or Duel.IsExistingMatchingCard(c62265044.filter2,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
local b1=Duel.IsExistingMatchingCard(c62265044.filter1,tp,LOCATION_DECK,0,1,nil) end
local b2=Duel.IsExistingMatchingCard(c62265044.filter2,tp,LOCATION_DECK,0,1,nil) function c62265044.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local op=0 if chk==0 then return Duel.IsExistingMatchingCard(c62265044.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(62265044,0)) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
if b1 and b2 then end
op=Duel.SelectOption(tp,aux.Stringid(62265044,1),aux.Stringid(62265044,2)) function c62265044.operation1(e,tp,eg,ep,ev,re,r,rp)
elseif b1 then Duel.SelectOption(tp,aux.Stringid(62265044,1)) op=0 if not e:GetHandler():IsRelateToEffect(e) then return end
else Duel.SelectOption(tp,aux.Stringid(62265044,2)) op=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
e:SetLabel(op) local g=Duel.SelectMatchingCard(tp,c62265044.filter1,tp,LOCATION_DECK,0,1,1,nil)
if op==0 then if g:GetCount()>0 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.ConfirmCards(1-tp,g)
else
e:SetCategory(CATEGORY_TOGRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
end end
function c62265044.operation(e,tp,eg,ep,ev,re,r,rp) function c62265044.operation2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c62265044.filter2,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c62265044.filter1,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then
if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c62265044.filter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end end
end end
...@@ -32,8 +32,8 @@ function c66957584.disfilter(c) ...@@ -32,8 +32,8 @@ function c66957584.disfilter(c)
return c:IsSetCard(0xb) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsSetCard(0xb) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
function c66957584.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c66957584.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c66957584.disfilter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c66957584.disfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0)
end end
function c66957584.disop(e,tp,eg,ep,ev,re,r,rp) function c66957584.disop(e,tp,eg,ep,ev,re,r,rp)
...@@ -45,6 +45,7 @@ function c66957584.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,6 +45,7 @@ function c66957584.spcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c66957584.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c66957584.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function c66957584.filter(c,e,tp) function c66957584.filter(c,e,tp)
......
...@@ -6,7 +6,7 @@ function c81210420.initial_effect(c) ...@@ -6,7 +6,7 @@ function c81210420.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START) e1:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e1:SetCondition(c81210420.condition) e1:SetCondition(c81210420.condition)
e1:SetTarget(c81210420.target) e1:SetTarget(c81210420.target)
e1:SetOperation(c81210420.activate) e1:SetOperation(c81210420.activate)
......
...@@ -17,23 +17,31 @@ function c90200789.initial_effect(c) ...@@ -17,23 +17,31 @@ function c90200789.initial_effect(c)
e2:SetOperation(c90200789.desop) e2:SetOperation(c90200789.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c90200789.filter1(c) function c90200789.filter1(c,tp,slv)
return c:IsFaceup() and c:IsSetCard(0x2b) and c:GetLevel()>0 local lv1=c:GetOriginalLevel()
return c:IsFaceup() and c:IsSetCard(0x2b) and lv1>0
and Duel.IsExistingTarget(c90200789.filter2,tp,0,LOCATION_MZONE,1,nil,lv1,slv)
end end
function c90200789.filter2(c) function c90200789.filter2(c,lv1,slv)
return c:IsFaceup() and c:GetLevel()>0 local lv2=c:GetOriginalLevel()
return c:IsFaceup() and lv2>0 and lv1+lv2>=slv
end end
function c90200789.spfilter(c,lv,e,tp) function c90200789.spfilter(c,e,tp,lv)
return c:IsLevelBelow(lv) and c:IsRace(RACE_DRAGON+RACE_DINOSAUR+RACE_SEASERPENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_DRAGON+RACE_DINOSAUR+RACE_SEASERPENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (not lv or c:IsLevelBelow(lv))
end end
function c90200789.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c90200789.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(c90200789.filter1,tp,LOCATION_MZONE,0,1,nil) local sg=Duel.GetMatchingGroup(c90200789.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
and Duel.IsExistingTarget(c90200789.filter2,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then
if sg:GetCount()==0 then return false end
local mlv=sg:GetMinGroup(Card.GetLevel):GetFirst():GetLevel()
return Duel.IsExistingTarget(c90200789.filter1,tp,LOCATION_MZONE,0,1,nil,tp,mlv)
end
local mlv=sg:GetMinGroup(Card.GetLevel):GetFirst():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectTarget(tp,c90200789.filter1,tp,LOCATION_MZONE,0,1,1,nil) local g1=Duel.SelectTarget(tp,c90200789.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp,mlv)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectTarget(tp,c90200789.filter2,tp,0,LOCATION_MZONE,1,1,nil) local g2=Duel.SelectTarget(tp,c90200789.filter2,tp,0,LOCATION_MZONE,1,1,nil,g1:GetFirst():GetOriginalLevel(),mlv)
g1:Merge(g2) g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0)
end end
...@@ -52,7 +60,7 @@ function c90200789.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +60,7 @@ function c90200789.operation(e,tp,eg,ep,ev,re,r,rp)
if tc and tc:IsLocation(LOCATION_GRAVE) then lv=lv+tc:GetLevel() end if tc and tc:IsLocation(LOCATION_GRAVE) then lv=lv+tc:GetLevel() end
if lv==0 then return end if lv==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c90200789.spfilter,tp,LOCATION_DECK,0,1,1,nil,lv,e,tp) local g=Duel.SelectMatchingCard(tp,c90200789.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -50,6 +50,7 @@ end ...@@ -50,6 +50,7 @@ end
function c9888196.destg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c9888196.destg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c9888196.filter1(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c9888196.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9888196.filter1,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(c9888196.filter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c9888196.filter1,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c9888196.filter1,tp,0,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(9888196,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(9888196,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
...@@ -63,6 +64,8 @@ function c9888196.desop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,6 +64,8 @@ function c9888196.desop1(e,tp,eg,ep,ev,re,r,rp)
end end
function c9888196.descost2(e,tp,eg,ep,ev,re,r,rp,chk) function c9888196.descost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
...@@ -81,6 +84,7 @@ function c9888196.desop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,6 +84,7 @@ function c9888196.desop2(e,tp,eg,ep,ev,re,r,rp)
end end
function c9888196.hdcost(e,tp,eg,ep,ev,re,r,rp,chk) function c9888196.hdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
antialias = 2 antialias = 2
nickname = Player nickname = Player
gamename = Game gamename = Game
lastdeck = tgagent lastdeck = sixsamurai
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
......
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