Commit a4b355d9 authored by VanillaSalt's avatar VanillaSalt

fix

parent fdafde2c
...@@ -2316,7 +2316,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2316,7 +2316,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf); unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1 - i); pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1 - i);
if(!mainGame->dField.deck_reversed || code) if(!mainGame->dField.deck_reversed || code)
pcard->SetCode(code); pcard->SetCode(code & 0x7fffffff);
} }
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) { if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
......
...@@ -414,7 +414,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -414,7 +414,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
selectable_cards.clear(); selectable_cards.clear();
switch(command_location) { switch(command_location) {
case LOCATION_DECK: { case LOCATION_DECK: {
for(size_t i = deck[hovered_controler].size() - 1; i >= 0 ; --i) for(int32 i = (int32)deck[hovered_controler].size() - 1; i >= 0 ; --i)
selectable_cards.push_back(deck[command_controler][i]); selectable_cards.push_back(deck[command_controler][i]);
myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1000), deck[command_controler].size()); myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1000), deck[command_controler].size());
mainGame->wCardSelect->setText(formatBuffer); mainGame->wCardSelect->setText(formatBuffer);
...@@ -429,21 +429,21 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -429,21 +429,21 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case LOCATION_GRAVE: { case LOCATION_GRAVE: {
for(size_t i = grave[command_controler].size() - 1; i >= 0 ; --i) for(int32 i = (int32)grave[command_controler].size() - 1; i >= 0 ; --i)
selectable_cards.push_back(grave[command_controler][i]); selectable_cards.push_back(grave[command_controler][i]);
myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1004), grave[command_controler].size()); myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1004), grave[command_controler].size());
mainGame->wCardSelect->setText(formatBuffer); mainGame->wCardSelect->setText(formatBuffer);
break; break;
} }
case LOCATION_REMOVED: { case LOCATION_REMOVED: {
for(size_t i = remove[command_controler].size() - 1; i >= 0 ; --i) for(int32 i = (int32)remove[command_controler].size() - 1; i >= 0 ; --i)
selectable_cards.push_back(remove[command_controler][i]); selectable_cards.push_back(remove[command_controler][i]);
myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1005), remove[command_controler].size()); myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1005), remove[command_controler].size());
mainGame->wCardSelect->setText(formatBuffer); mainGame->wCardSelect->setText(formatBuffer);
break; break;
} }
case LOCATION_EXTRA: { case LOCATION_EXTRA: {
for(size_t i = extra[command_controler].size() - 1; i >= 0 ; --i) for(int32 i = (int32)extra[command_controler].size() - 1; i >= 0 ; --i)
selectable_cards.push_back(extra[command_controler][i]); selectable_cards.push_back(extra[command_controler][i]);
myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1006), extra[command_controler].size()); myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(1006), extra[command_controler].size());
mainGame->wCardSelect->setText(formatBuffer); mainGame->wCardSelect->setText(formatBuffer);
...@@ -981,7 +981,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -981,7 +981,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
for(size_t i = 0; i < extra[hovered_controler].size(); ++i) for(size_t i = 0; i < extra[hovered_controler].size(); ++i)
command_flag |= extra[hovered_controler][i]->cmdFlag; command_flag |= extra[hovered_controler][i]->cmdFlag;
if(hovered_controler == 0) if(hovered_controler == 0 || mainGame->dInfo.isSingleMode)
command_flag |= COMMAND_LIST; command_flag |= COMMAND_LIST;
list_command = 1; list_command = 1;
ShowMenu(command_flag, x, y); ShowMenu(command_flag, x, y);
......
...@@ -392,45 +392,45 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -392,45 +392,45 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
last_replay.Flush(); last_replay.Flush();
// //
last_replay.WriteInt32(pdeck[0].main.size(), false); last_replay.WriteInt32(pdeck[0].main.size(), false);
for(size_t i = pdeck[0].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[0].main.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, 0); new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, 0);
last_replay.WriteInt32(pdeck[0].main[i]->first, false); last_replay.WriteInt32(pdeck[0].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[0].extra.size(), false); last_replay.WriteInt32(pdeck[0].extra.size(), false);
for(size_t i = pdeck[0].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, 0); new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, 0);
last_replay.WriteInt32(pdeck[0].extra[i]->first, false); last_replay.WriteInt32(pdeck[0].extra[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[1].main.size(), false); last_replay.WriteInt32(pdeck[1].main.size(), false);
for(size_t i = pdeck[1].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[1].main[i]->first, 0, LOCATION_DECK); new_tag_card(pduel, pdeck[1].main[i]->first, 0, LOCATION_DECK);
last_replay.WriteInt32(pdeck[1].main[i]->first, false); last_replay.WriteInt32(pdeck[1].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[1].extra.size(), false); last_replay.WriteInt32(pdeck[1].extra.size(), false);
for(size_t i = pdeck[1].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[1].extra[i]->first, 0, LOCATION_EXTRA); new_tag_card(pduel, pdeck[1].extra[i]->first, 0, LOCATION_EXTRA);
last_replay.WriteInt32(pdeck[1].extra[i]->first, false); last_replay.WriteInt32(pdeck[1].extra[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[3].main.size(), false); last_replay.WriteInt32(pdeck[3].main.size(), false);
for(size_t i = pdeck[3].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[3].main.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[3].main[i]->first, 1, 1, LOCATION_DECK, 0, 0); new_card(pduel, pdeck[3].main[i]->first, 1, 1, LOCATION_DECK, 0, 0);
last_replay.WriteInt32(pdeck[3].main[i]->first, false); last_replay.WriteInt32(pdeck[3].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[3].extra.size(), false); last_replay.WriteInt32(pdeck[3].extra.size(), false);
for(size_t i = pdeck[3].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[3].extra.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[3].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, 0); new_card(pduel, pdeck[3].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, 0);
last_replay.WriteInt32(pdeck[3].extra[i]->first, false); last_replay.WriteInt32(pdeck[3].extra[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[2].main.size(), false); last_replay.WriteInt32(pdeck[2].main.size(), false);
for(size_t i = pdeck[2].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[2].main.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[2].main[i]->first, 1, LOCATION_DECK); new_tag_card(pduel, pdeck[2].main[i]->first, 1, LOCATION_DECK);
last_replay.WriteInt32(pdeck[2].main[i]->first, false); last_replay.WriteInt32(pdeck[2].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[2].extra.size(), false); last_replay.WriteInt32(pdeck[2].extra.size(), false);
for(size_t i = pdeck[2].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[2].extra.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[2].extra[i]->first, 1, LOCATION_EXTRA); new_tag_card(pduel, pdeck[2].extra[i]->first, 1, LOCATION_EXTRA);
last_replay.WriteInt32(pdeck[2].extra[i]->first, false); last_replay.WriteInt32(pdeck[2].extra[i]->first, false);
} }
......
...@@ -4626,6 +4626,7 @@ int32 field::adjust_step(uint16 step) { ...@@ -4626,6 +4626,7 @@ int32 field::adjust_step(uint16 step) {
} }
adjust_disable_check_list(); adjust_disable_check_list();
add_process(PROCESSOR_REFRESH_LOC, 0, 0, 0, 0, 0); add_process(PROCESSOR_REFRESH_LOC, 0, 0, 0, 0, 0);
return FALSE;
} }
case 3: { case 3: {
//trap monster //trap monster
......
...@@ -18,11 +18,11 @@ function c32339440.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -18,11 +18,11 @@ function c32339440.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c32339440.filter(c) function c32339440.filter(c)
return c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER) and sc:IsAbleToHand() return c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c32339440.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c32339440.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32339440.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c32339440.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,0,1,0,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c32339440.thop(e,tp,eg,ep,ev,re,r,rp) function c32339440.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
...@@ -32,7 +32,7 @@ function c4068622.spfilter1(c) ...@@ -32,7 +32,7 @@ function c4068622.spfilter1(c)
return c:IsFaceup() and c:IsSetCard(0x33) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove() return c:IsFaceup() and c:IsSetCard(0x33) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
end end
function c4068622.spfilter2(c) function c4068622.spfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x33) and not c:IsType(TYPE_TUNER) and c:IsAbleToRemove() return c:IsFaceup() and not c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
end end
function c4068622.spcon(e,c) function c4068622.spcon(e,c)
if c==nil then return true end if c==nil then return true end
......
...@@ -103,7 +103,7 @@ function c53804307.desfilter(c) ...@@ -103,7 +103,7 @@ function c53804307.desfilter(c)
return c:IsDestructable() return c:IsDestructable()
end end
function c53804307.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c53804307.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsOnField() and c53804307.desfilter(chkc) end if chkc then return chkc:IsOnField() and c53804307.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c53804307.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(c53804307.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c53804307.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c53804307.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
......
...@@ -13,8 +13,9 @@ function c68601507.initial_effect(c) ...@@ -13,8 +13,9 @@ function c68601507.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c68601507.atkcon(e,tp,eg,ep,ev,re,r,rp) function c68601507.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttacker() local c=Duel.GetAttackTarget()
if c:IsControler(1-tp) then c=Duel.GetAttackTarget() end if not c then return false end
if c:IsControler(1-tp) then c=Duel.GetAttacker() end
e:SetLabelObject(c) e:SetLabelObject(c)
return c and c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsRelateToBattle() return c and c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsRelateToBattle()
end end
......
--限界竜シュヴァルツシルト --限界竜シュヴァルツシルト
function c6930764.initial_effect(c) function c6930746.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(c6930764.spcon) e1:SetCondition(c6930746.spcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c6930764.filter(c) function c6930746.filter(c)
return c:IsFaceup() and c:IsAttackAbove(2000) return c:IsFaceup() and c:IsAttackAbove(2000)
end end
function c6930764.spcon(e,c) function c6930746.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c6930764.filter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(c6930746.filter,tp,0,LOCATION_MZONE,1,nil)
end end
...@@ -14,7 +14,7 @@ function c71060915.filter(c) ...@@ -14,7 +14,7 @@ function c71060915.filter(c)
return c:IsFaceup() and c:IsCode(21844576) return c:IsFaceup() and c:IsCode(21844576)
end end
function c71060915.condition(e,tp,eg,ep,ev,re,r,rp) function c71060915.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c71060915.filter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c71060915.filter,tp,LOCATION_ONFIELD,0,1,nil)
and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end end
function c71060915.target(e,tp,eg,ep,ev,re,r,rp,chk) function c71060915.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -19,7 +19,8 @@ function c72710085.initial_effect(c) ...@@ -19,7 +19,8 @@ function c72710085.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c72710085.tgcon(e,tp,eg,ep,ev,re,r,rp) function c72710085.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():IsPreviousLocation(LOCATION_GRAVE) and eg:GetFirst():IsControler(tp) local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:IsPreviousLocation(LOCATION_GRAVE) and tc:IsControler(tp) and tc:IsType(TYPE_MONSTER)
end end
function c72710085.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c72710085.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,72710085)==0 end if chk==0 then return Duel.GetFlagEffect(tp,72710085)==0 end
......
...@@ -12,6 +12,5 @@ function c8594079.filter(c) ...@@ -12,6 +12,5 @@ function c8594079.filter(c)
return c:IsFaceup() and c:IsSetCard(0x22) return c:IsFaceup() and c:IsSetCard(0x22)
end end
function c8594079.indcon(e) function c8594079.indcon(e)
local c=e:GetHandler() return Duel.IsExistingMatchingCard(c8594079.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
return Duel.IsExistingMatchingCard(c8594079.filter,c:GetControler(),LOCATION_MZONE,0,1,c)
end end
...@@ -31,8 +31,8 @@ function c9365703.daop(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,8 +31,8 @@ function c9365703.daop(e,tp,eg,ep,ev,re,r,rp)
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(c:GetBaseAttack()*2) e1:SetValue(c:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
...@@ -25,7 +25,7 @@ function c94973028.initial_effect(c) ...@@ -25,7 +25,7 @@ function c94973028.initial_effect(c)
e4:SetDescription(aux.Stringid(94973028,0)) e4:SetDescription(aux.Stringid(94973028,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(c94973028.spcon) e4:SetCondition(c94973028.spcon)
e4:SetTarget(c94973028.sptg) e4:SetTarget(c94973028.sptg)
e4:SetOperation(c94973028.spop) e4:SetOperation(c94973028.spop)
......
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