Commit ec113588 authored by Fluorohydride's avatar Fluorohydride

Merge branch 'master' of github.com:Fluorohydride/ygopro

parents c7713661 d6c38ebf
...@@ -1641,8 +1641,16 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1641,8 +1641,16 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.grave[player].swap(mainGame->dField.deck[player]); mainGame->dField.grave[player].swap(mainGame->dField.deck[player]);
for (auto cit = mainGame->dField.grave[player].begin(); cit != mainGame->dField.grave[player].end(); ++cit) for (auto cit = mainGame->dField.grave[player].begin(); cit != mainGame->dField.grave[player].end(); ++cit)
(*cit)->location = LOCATION_GRAVE; (*cit)->location = LOCATION_GRAVE;
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ) {
(*cit)->location = LOCATION_DECK; if ((*cit)->type & 0x802040) {
(*cit)->location = LOCATION_EXTRA;
mainGame->dField.extra[player].push_back(*cit);
cit = mainGame->dField.deck[player].erase(cit);
} else {
(*cit)->location = LOCATION_DECK;
++cit;
}
}
} else { } else {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->dField.grave[player].swap(mainGame->dField.deck[player]); mainGame->dField.grave[player].swap(mainGame->dField.deck[player]);
...@@ -1650,9 +1658,17 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1650,9 +1658,17 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
(*cit)->location = LOCATION_GRAVE; (*cit)->location = LOCATION_GRAVE;
mainGame->dField.MoveCard(*cit, 10); mainGame->dField.MoveCard(*cit, 10);
} }
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) { for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ) {
(*cit)->location = LOCATION_DECK; ClientCard* pcard = *cit;
mainGame->dField.MoveCard(*cit, 10); if (pcard->type & 0x802040) {
pcard->location = LOCATION_EXTRA;
mainGame->dField.extra[player].push_back(pcard);
cit = mainGame->dField.deck[player].erase(cit);
} else {
pcard->location = LOCATION_DECK;
++cit;
}
mainGame->dField.MoveCard(pcard, 10);
} }
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->WaitFrameSignal(11); mainGame->WaitFrameSignal(11);
......
...@@ -102,6 +102,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -102,6 +102,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
DuelClient::StopClient(); DuelClient::StopClient();
mainGame->dInfo.isStarted = false; mainGame->dInfo.isStarted = false;
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->wCardImg->setVisible(false);
mainGame->wInfos->setVisible(false);
mainGame->wPhase->setVisible(false);
mainGame->btnLeaveGame->setVisible(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);
......
...@@ -663,6 +663,7 @@ void Game::RefreshDeck(irr::gui::IGUIComboBox* cbDeck) { ...@@ -663,6 +663,7 @@ void Game::RefreshDeck(irr::gui::IGUIComboBox* cbDeck) {
BufferIO::DecodeUTF8(dirp->d_name, wname); BufferIO::DecodeUTF8(dirp->d_name, wname);
cbDeck->addItem(wname); cbDeck->addItem(wname);
} }
closedir(dir);
#endif #endif
for(size_t i = 0; i < cbDeck->getItemCount(); ++i) { for(size_t i = 0; i < cbDeck->getItemCount(); ++i) {
if(!wcscmp(cbDeck->getItem(i), gameConf.lastdeck)) { if(!wcscmp(cbDeck->getItem(i), gameConf.lastdeck)) {
...@@ -698,6 +699,7 @@ void Game::RefreshReplay() { ...@@ -698,6 +699,7 @@ void Game::RefreshReplay() {
if(Replay::CheckReplay(wname)) if(Replay::CheckReplay(wname))
lstReplayList->addItem(wname); lstReplayList->addItem(wname);
} }
closedir(dir);
#endif #endif
} }
void Game::RefreshSingleplay() { void Game::RefreshSingleplay() {
...@@ -725,6 +727,7 @@ void Game::RefreshSingleplay() { ...@@ -725,6 +727,7 @@ void Game::RefreshSingleplay() {
BufferIO::DecodeUTF8(dirp->d_name, wname); BufferIO::DecodeUTF8(dirp->d_name, wname);
lstSinglePlayList->addItem(wname); lstSinglePlayList->addItem(wname);
} }
closedir(dir);
#endif #endif
} }
void Game::LoadConfig() { void Game::LoadConfig() {
......
...@@ -568,9 +568,15 @@ void field::swap_deck_and_grave(uint8 playerid) { ...@@ -568,9 +568,15 @@ void field::swap_deck_and_grave(uint8 playerid) {
(*clit)->enable_field_effect(false); (*clit)->enable_field_effect(false);
(*clit)->cancel_field_effect(); (*clit)->cancel_field_effect();
} }
card_vector cl = player[playerid].list_grave; player[playerid].list_grave.swap(player[playerid].list_main);
player[playerid].list_grave = player[playerid].list_main; card_vector ex;
player[playerid].list_main = cl; for(clit = player[playerid].list_main.begin(); clit != player[playerid].list_main.end(); ) {
if((*clit)->data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ)) {
ex.push_back(*clit);
clit = player[playerid].list_main.erase(clit);
} else
++clit;
}
for(clit = player[playerid].list_grave.begin(); clit != player[playerid].list_grave.end(); ++clit) { for(clit = player[playerid].list_grave.begin(); clit != player[playerid].list_grave.end(); ++clit) {
(*clit)->current.location = LOCATION_GRAVE; (*clit)->current.location = LOCATION_GRAVE;
(*clit)->current.reason = REASON_EFFECT; (*clit)->current.reason = REASON_EFFECT;
...@@ -587,7 +593,17 @@ void field::swap_deck_and_grave(uint8 playerid) { ...@@ -587,7 +593,17 @@ void field::swap_deck_and_grave(uint8 playerid) {
(*clit)->apply_field_effect(); (*clit)->apply_field_effect();
(*clit)->enable_field_effect(true); (*clit)->enable_field_effect(true);
} }
for(clit = ex.begin(); clit != ex.end(); ++clit) {
(*clit)->current.location = LOCATION_EXTRA;
(*clit)->current.reason = REASON_EFFECT;
(*clit)->current.reason_effect = core.reason_effect;
(*clit)->current.reason_player = core.reason_player;
(*clit)->apply_field_effect();
(*clit)->enable_field_effect(true);
}
player[playerid].list_extra.insert(player[playerid].list_extra.end(), ex.begin(), ex.end());
reset_sequence(playerid, LOCATION_GRAVE); reset_sequence(playerid, LOCATION_GRAVE);
reset_sequence(playerid, LOCATION_EXTRA);
pduel->write_buffer8(MSG_SWAP_GRAVE_DECK); pduel->write_buffer8(MSG_SWAP_GRAVE_DECK);
pduel->write_buffer8(playerid); pduel->write_buffer8(playerid);
shuffle(playerid, LOCATION_DECK); shuffle(playerid, LOCATION_DECK);
......
...@@ -4,7 +4,7 @@ function c23893227.initial_effect(c) ...@@ -4,7 +4,7 @@ function c23893227.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23893227,0)) e1:SetDescription(aux.Stringid(23893227,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c23893227.cost) e1:SetCost(c23893227.cost)
e1:SetTarget(c23893227.target) e1:SetTarget(c23893227.target)
...@@ -38,7 +38,7 @@ function c23893227.filter(c) ...@@ -38,7 +38,7 @@ function c23893227.filter(c)
return (c:IsSetCard(0x93) or c:IsSetCard(0x94)) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return (c:IsSetCard(0x93) or c:IsSetCard(0x94)) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function c23893227.target(e,tp,eg,ep,ev,re,r,rp,chk) function c23893227.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23893227.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c23893227.operation(e,tp,eg,ep,ev,re,r,rp) function c23893227.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -53,7 +53,7 @@ function c38273745.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -53,7 +53,7 @@ function c38273745.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(38273746,RESET_EVENT+0x1fe0000,0,1) e:GetHandler():RegisterFlagEffect(38273746,RESET_EVENT+0x1fe0000,EFFECT_FLAG_COPY_INHERIT,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end end
function c38273745.op1(e,tp,eg,ep,ev,re,r,rp) function c38273745.op1(e,tp,eg,ep,ev,re,r,rp)
...@@ -69,7 +69,7 @@ function c38273745.tg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -69,7 +69,7 @@ function c38273745.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)~=0 end if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)~=0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND)
e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(38273747,RESET_EVENT+0x1fe0000,0,1) e:GetHandler():RegisterFlagEffect(38273747,RESET_EVENT+0x1fe0000,EFFECT_FLAG_COPY_INHERIT,1)
end end
function c38273745.op2(e,tp,eg,ep,ev,re,r,rp) function c38273745.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0) local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
...@@ -86,7 +86,7 @@ function c38273745.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -86,7 +86,7 @@ function c38273745.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(38273748,RESET_EVENT+0x1fe0000,0,1) e:GetHandler():RegisterFlagEffect(38273748,RESET_EVENT+0x1fe0000,EFFECT_FLAG_COPY_INHERIT,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end end
function c38273745.op3(e,tp,eg,ep,ev,re,r,rp) function c38273745.op3(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -24,6 +24,7 @@ function c39765958.descost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,6 +24,7 @@ function c39765958.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c39765958.ftarget) e1:SetTarget(c39765958.ftarget)
e1:SetLabel(e:GetHandler():GetFieldID()) e1:SetLabel(e:GetHandler():GetFieldID())
......
...@@ -32,14 +32,6 @@ function c46772449.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,14 +32,6 @@ function c46772449.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(46772449)==0 end if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(46772449)==0 end
c:RemoveOverlayCard(tp,1,1,REASON_COST) c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(46772449,RESET_CHAIN,0,1) c:RegisterFlagEffect(46772449,RESET_CHAIN,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end end
function c46772449.target(e,tp,eg,ep,ev,re,r,rp,chk) function c46772449.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
...@@ -47,6 +39,14 @@ function c46772449.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -47,6 +39,14 @@ function c46772449.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c46772449.operation(e,tp,eg,ep,ev,re,r,rp) function c46772449.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
\ No newline at end of file
--CNo.88 ギミック・パペット-ディザスター・レオ --CNo.88 ギミック・パペット-ディザスター・レオ
function c6165656.initial_effect(c) function c6165656.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,9),4)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -18,6 +18,7 @@ function c68836428.initial_effect(c) ...@@ -18,6 +18,7 @@ function c68836428.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(c68836428.condition) e2:SetCondition(c68836428.condition)
......
...@@ -75,6 +75,7 @@ function c69058960.filter(c) ...@@ -75,6 +75,7 @@ function c69058960.filter(c)
end end
function c69058960.indcon(e) function c69058960.indcon(e)
return Duel.IsExistingMatchingCard(c69058960.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c69058960.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
and e:GetHandler():GetOverlayCount()~=0
end end
function c69058960.refcon(e) function c69058960.refcon(e)
return Duel.IsExistingMatchingCard(c69058960.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c69058960.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
......
...@@ -75,6 +75,7 @@ function c95442074.filter(c) ...@@ -75,6 +75,7 @@ function c95442074.filter(c)
end end
function c95442074.indcon(e) function c95442074.indcon(e)
return Duel.IsExistingMatchingCard(c95442074.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c95442074.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
and e:GetHandler():GetOverlayCount()~=0
end end
function c95442074.refcon(e) function c95442074.refcon(e)
return Duel.IsExistingMatchingCard(c95442074.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c95442074.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
......
...@@ -34,6 +34,7 @@ function c99070951.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,6 +34,7 @@ function c99070951.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc or not tc:IsAbleToRemove() then return end if not tc or not tc:IsAbleToRemove() then return end
Duel.ConfirmCards(tp,tc)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
tc:RegisterFlagEffect(99070951,RESET_EVENT+0x1fe0000,0,1) tc:RegisterFlagEffect(99070951,RESET_EVENT+0x1fe0000,0,1)
......
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