Commit a4b355d9 authored by VanillaSalt's avatar VanillaSalt

fix

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