Commit baceb2b2 authored by VanillaSalt's avatar VanillaSalt

fix

parent 1f54d259
...@@ -348,7 +348,8 @@ void ClientField::ShowSelectCard(bool buttonok) { ...@@ -348,7 +348,8 @@ void ClientField::ShowSelectCard(bool buttonok) {
mainGame->btnCardSelect[i]->setPressed(false); mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true); mainGame->btnCardSelect[i]->setVisible(true);
if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) { if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) {
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location), selectable_cards[i]->sequence + 1); myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence),
selectable_cards[i]->sequence + 1);
mainGame->stCardPos[i]->setText(formatBuffer); mainGame->stCardPos[i]->setText(formatBuffer);
mainGame->stCardPos[i]->setVisible(true);; mainGame->stCardPos[i]->setVisible(true);;
if(selectable_cards[i]->controler) if(selectable_cards[i]->controler)
...@@ -379,7 +380,8 @@ void ClientField::ShowSelectCard(bool buttonok) { ...@@ -379,7 +380,8 @@ void ClientField::ShowSelectCard(bool buttonok) {
mainGame->btnCardSelect[i]->setPressed(false); mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true); mainGame->btnCardSelect[i]->setVisible(true);
if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) { if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) {
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location), selectable_cards[i]->sequence + 1); myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence),
selectable_cards[i]->sequence + 1);
mainGame->stCardPos[i]->setText(formatBuffer); mainGame->stCardPos[i]->setText(formatBuffer);
mainGame->stCardPos[i]->setVisible(true); mainGame->stCardPos[i]->setVisible(true);
if(selectable_cards[i]->controler) if(selectable_cards[i]->controler)
......
...@@ -185,7 +185,15 @@ const wchar_t* DataManager::GetCounterName(int code) { ...@@ -185,7 +185,15 @@ const wchar_t* DataManager::GetCounterName(int code) {
const wchar_t* DataManager::GetNumString(int num) { const wchar_t* DataManager::GetNumString(int num) {
return numStrings[num]; return numStrings[num];
} }
const wchar_t* DataManager::FormatLocation(int location) { const wchar_t* DataManager::FormatLocation(int location, int sequence) {
if(location == 0x8) {
if(sequence < 5)
return GetSysString(1003);
else if(sequence == 5)
return GetSysString(1008);
else
return GetSysString(1009);
}
int filter = 1, i = 1000; int filter = 1, i = 1000;
while(filter != location) { while(filter != location) {
filter <<= 1; filter <<= 1;
......
...@@ -24,7 +24,7 @@ public: ...@@ -24,7 +24,7 @@ public:
const wchar_t* GetVictoryString(int code); const wchar_t* GetVictoryString(int code);
const wchar_t* GetCounterName(int code); const wchar_t* GetCounterName(int code);
const wchar_t* GetNumString(int num); const wchar_t* GetNumString(int num);
const wchar_t* FormatLocation(int location); const wchar_t* FormatLocation(int location, int sequence);
const wchar_t* FormatAttribute(int attribute); const wchar_t* FormatAttribute(int attribute);
const wchar_t* FormatRace(int race); const wchar_t* FormatRace(int race);
const wchar_t* FormatType(int type); const wchar_t* FormatType(int type);
......
...@@ -1054,7 +1054,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1054,7 +1054,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO::ReadInt8(pbuf); BufferIO::ReadInt8(pbuf);
pcard->is_highlighting = true; pcard->is_highlighting = true;
mainGame->dField.highlighting_card = pcard; mainGame->dField.highlighting_card = pcard;
myswprintf(textBuffer, dataManager.GetSysString(200), dataManager.FormatLocation(l), dataManager.GetName(code)); myswprintf(textBuffer, dataManager.GetSysString(200), dataManager.FormatLocation(l, s), dataManager.GetName(code));
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery); mainGame->PopupElement(mainGame->wQuery);
...@@ -2329,7 +2329,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2329,7 +2329,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
} else } else
mainGame->WaitFrameSignal(30); mainGame->WaitFrameSignal(30);
myswprintf(textBuffer, dataManager.GetSysString(1610), dataManager.GetName(pcard->code), dataManager.FormatLocation(l), s); myswprintf(textBuffer, dataManager.GetSysString(1610), dataManager.GetName(pcard->code), dataManager.FormatLocation(l, s), s);
mainGame->lstLog->addItem(textBuffer); mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(pcard->code); mainGame->logParam.push_back(pcard->code);
pcard->is_highlighting = false; pcard->is_highlighting = false;
......
...@@ -728,8 +728,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -728,8 +728,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L""); myswprintf(formatBuffer, L"");
} }
else{ else{
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i + pos]->location), myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i + pos]->location,
selectable_cards[i + pos]->sequence + 1); selectable_cards[i + pos]->sequence), selectable_cards[i + pos]->sequence + 1);
} }
mainGame->stCardPos[i]->setText(formatBuffer); mainGame->stCardPos[i]->setText(formatBuffer);
if(selectable_cards[i + pos]->is_selected) if(selectable_cards[i + pos]->is_selected)
......
...@@ -19,6 +19,8 @@ function c27062594.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,6 +19,8 @@ function c27062594.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c27062594.activate(e,tp,eg,ep,ev,re,r,rp) function c27062594.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack()==0 then return end
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) if not c:IsRelateToEffect(e)
......
...@@ -99,7 +99,7 @@ function c27279764.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,7 +99,7 @@ function c27279764.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(sg,REASON_RULE) Duel.SendtoGrave(sg,REASON_RULE)
else else
local hg=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0) local hg=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,hg) Duel.ConfirmCards(tp,hg)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
end end
end end
...@@ -65,7 +65,7 @@ function c3064425.cfilter(c) ...@@ -65,7 +65,7 @@ function c3064425.cfilter(c)
end end
function c3064425.negcon(e,tp,eg,ep,ev,re,r,rp) function c3064425.negcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return ep~=tp and Duel.IsChainNegatable(ev)and ph>PHASE_MAIN1 and ph<PHASE_MAIN2 return ep~=tp and Duel.IsChainNegatable(ev) and ph>PHASE_MAIN1 and ph<PHASE_MAIN2
and Duel.IsExistingMatchingCard(c3064425.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c3064425.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function c3064425.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function c3064425.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -15,7 +15,7 @@ function c59368956.initial_effect(c) ...@@ -15,7 +15,7 @@ function c59368956.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c59368956.atktg) e2:SetTarget(c59368956.atktg)
e2:SetValue(500) e2:SetValue(500)
c:RegisterEffect(e2) c:RegisterEffect(e2)
......
...@@ -23,11 +23,14 @@ function c73136204.initial_effect(c) ...@@ -23,11 +23,14 @@ function c73136204.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c73136204.target(e,tp,eg,ep,ev,re,r,rp,chk) function c73136204.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) end if chk==0 then
local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
return ac>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=ac
end
end end
function c73136204.operation(e,tp,eg,ep,ev,re,r,rp) function c73136204.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ac then return end if ac==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ac then return end
Duel.ConfirmDecktop(tp,ac) Duel.ConfirmDecktop(tp,ac)
local g=Duel.GetDecktopGroup(tp,ac) local g=Duel.GetDecktopGroup(tp,ac)
local sg=g:Filter(Card.IsRace,nil,RACE_PLANT) local sg=g:Filter(Card.IsRace,nil,RACE_PLANT)
......
...@@ -112,6 +112,8 @@ ...@@ -112,6 +112,8 @@
!system 1005 除外 !system 1005 除外
!system 1006 额外 !system 1006 额外
!system 1007 叠放 !system 1007 叠放
!system 1008 场地魔法区
!system 1009 摇摆区
!system 1010 !system 1010
!system 1011 !system 1011
!system 1012 !system 1012
......
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