Commit f0ee4725 authored by mercury233's avatar mercury233
parents c02ad0ff a23e3c96
## ygopro
A script engine for "yu-gi-oh!" and sample gui
[中文说明](https://github.com/Fluorohydride/ygopro/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E)
###Keys:
* ESC: Minimize the window.
* A: Holding down this button will let the system stop at every timing.
* S: Holding down this button will let the system skip every timing.
* R: Fix the font error.
* F1~F4: Show the cards in your grave, banished zone, extra deck, xyz materials.
* F5~F8: Show the cards in your opponent's grave, banished zone, extra deck, xyz materials.
###Color:
* Background:
* White = your card, Grey = your opponent's card
* Text:
* Black = default, Blue = the owner of the xyz material is different from its controller
###Sequence:
* Monster Zone: 1~5, starting from the left hand side.
* Spell & Trap Zone: 1~5, starting from the left hand side.
* Field Zone: 6
* Pendulum Zone: 7~8, starting from the left hand side.
* The others: 1~n, starting from the bottom.
###Deck edit page:
* All numeric textboxs: They support >, =, <, >=, <= signs.
* Card name: Search card names and texts by default, and $foo will only search foo in card names.
### Command-line options:
* -j: Join the host in system.conf file.
* -d: Enter the deck edit page.
* -r: Enter the replay mode page.
* -s: Enter the single mode page.
* -efoo: Load foo as the extra database.
### Directories:
* pics: .jpg card images(177*254).
* pics\thumbnail: .jpg thumbnail images(44*64).
* script: .lua script files.
* textures: Other image files.
* deck: .ydk deck files.
* replay: .yrp replay files.
* expansions: *.cdb will be loaded as extra databases.
This diff is collapsed.
......@@ -336,6 +336,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
dragx = event.MouseInput.X;
dragy = event.MouseInput.Y;
draging_pointer = dataManager.GetCodePointer(hovered_code);
if(draging_pointer == dataManager._datas.end())
break;
unsigned int limitcode = draging_pointer->second.alias ? draging_pointer->second.alias : draging_pointer->first;
if(hovered_pos == 4) {
int limit = 3;
......@@ -438,6 +440,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if(hovered_pos == 0 || hovered_seq == -1)
break;
draging_pointer = dataManager.GetCodePointer(hovered_code);
if(draging_pointer == dataManager._datas.end())
break;
if(hovered_pos == 1) {
if(deckManager.current_deck.side.size() < 20) {
deckManager.current_deck.main.erase(deckManager.current_deck.main.begin() + hovered_seq);
......@@ -464,8 +468,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break;
if(hovered_pos == 0 || hovered_seq == -1)
break;
if(!is_draging)
if(!is_draging) {
draging_pointer = dataManager.GetCodePointer(hovered_code);
if(draging_pointer == dataManager._datas.end())
break;
}
if(hovered_pos == 1) {
if(!is_draging)
deckManager.current_deck.main.erase(deckManager.current_deck.main.begin() + hovered_seq);
......@@ -621,12 +628,13 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EET_KEY_INPUT_EVENT: {
switch(event.KeyInput.Key) {
case irr::KEY_KEY_R: {
if(!event.KeyInput.PressedDown)
if(!event.KeyInput.PressedDown && !mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->textFont->setTransparency(true);
break;
}
case irr::KEY_ESCAPE: {
mainGame->device->minimizeWindow();
if(!mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->device->minimizeWindow();
break;
}
default: break;
......@@ -642,7 +650,7 @@ void DeckBuilder::FilterCards() {
const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = BufferIO::GetVal(pstr);
if(dataManager.GetData(trycode, 0)) {
auto ptr = dataManager.GetCodePointer(trycode);
auto ptr = dataManager.GetCodePointer(trycode); // verified by GetData()
results.push_back(ptr);
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
......
......@@ -128,7 +128,7 @@ void DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
if(cd.type & TYPE_TOKEN)
continue;
else if(cd.type & 0x802040 && deck.extra.size() < 15) {
deck.extra.push_back(dataManager.GetCodePointer(code));
deck.extra.push_back(dataManager.GetCodePointer(code)); //verified by GetData()
} else if(deck.main.size() < 60) {
deck.main.push_back(dataManager.GetCodePointer(code));
}
......@@ -140,7 +140,7 @@ void DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
if(cd.type & TYPE_TOKEN)
continue;
if(deck.side.size() < 15)
deck.side.push_back(dataManager.GetCodePointer(code));
deck.side.push_back(dataManager.GetCodePointer(code)); //verified by GetData()
}
}
bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) {
......
......@@ -916,7 +916,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
if (pcard->location == LOCATION_REMOVED)
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
}
mainGame->dField.attackable_cards.clear();
......@@ -974,13 +974,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->SetCode(code);
mainGame->dField.deck_act = true;
}
if (pcard->location == LOCATION_GRAVE)
else if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
if (pcard->location == LOCATION_REMOVED)
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
if (pcard->location == LOCATION_EXTRA)
else if (pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
if (pcard->location == LOCATION_SZONE && pcard->sequence == 6)
else if (pcard->location == LOCATION_SZONE && pcard->sequence == 6)
mainGame->dField.pzone_act[pcard->controler] = true;
}
mainGame->dField.reposable_cards.clear();
......@@ -1031,7 +1031,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
if (pcard->location == LOCATION_REMOVED)
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
}
if(BufferIO::ReadInt8(pbuf)) {
......@@ -1062,8 +1062,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (pcard->code != code)
pcard->SetCode(code);
BufferIO::ReadInt8(pbuf);
pcard->is_highlighting = true;
mainGame->dField.highlighting_card = pcard;
if(l != LOCATION_DECK) {
pcard->is_highlighting = true;
mainGame->dField.highlighting_card = pcard;
}
myswprintf(textBuffer, dataManager.GetSysString(200), dataManager.FormatLocation(l, s), dataManager.GetName(code));
mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, textBuffer);
......@@ -1190,11 +1192,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(l == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
if(l == LOCATION_REMOVED)
else if(l == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
if(l == LOCATION_EXTRA)
else if(l == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
if(l == LOCATION_OVERLAY)
else if(l == LOCATION_OVERLAY)
panelmode = true;
}
}
......@@ -2373,7 +2375,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
} else
mainGame->WaitFrameSignal(30);
myswprintf(textBuffer, dataManager.GetSysString(1610), dataManager.GetName(pcard->code), dataManager.FormatLocation(l, s), s);
myswprintf(textBuffer, dataManager.GetSysString(1610), dataManager.GetName(pcard->code), dataManager.FormatLocation(l, s), s + 1);
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(pcard->code);
pcard->is_highlighting = false;
......
This diff is collapsed.
......@@ -17,7 +17,7 @@
#include <unistd.h>
#endif
const unsigned short PRO_VERSION = 0x1336;
const unsigned short PRO_VERSION = 0x1337;
namespace ygo {
......@@ -381,7 +381,7 @@ bool Game::Initialize() {
wCardSelect->getCloseButton()->setVisible(false);
wCardSelect->setVisible(false);
for(int i = 0; i < 5; ++i) {
stCardPos[i] = env->addStaticText(L"", rect<s32>(40 + 125 * i, 30, 139 + 125 * i, 50), true, false, wCardSelect, -1, true);
stCardPos[i] = env->addStaticText(L"", rect<s32>(30 + 125 * i, 30, 150 + 125 * i, 50), true, false, wCardSelect, -1, true);
stCardPos[i]->setBackgroundColor(0xffffffff);
stCardPos[i]->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnCardSelect[i] = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(30 + 125 * i, 55, 150 + 125 * i, 225), wCardSelect, BUTTON_CARD_0 + i);
......@@ -394,7 +394,7 @@ bool Game::Initialize() {
wCardDisplay->getCloseButton()->setVisible(false);
wCardDisplay->setVisible(false);
for(int i = 0; i < 5; ++i) {
stDisplayPos[i] = env->addStaticText(L"", rect<s32>(40 + 125 * i, 30, 139 + 125 * i, 50), true, false, wCardDisplay, -1, true);
stDisplayPos[i] = env->addStaticText(L"", rect<s32>(30 + 125 * i, 30, 150 + 125 * i, 50), true, false, wCardDisplay, -1, true);
stDisplayPos[i]->setBackgroundColor(0xffffffff);
stDisplayPos[i]->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnCardDisplay[i] = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(30 + 125 * i, 55, 150 + 125 * i, 225), wCardDisplay, BUTTON_DISPLAY_0 + i);
......
......@@ -307,7 +307,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break;
}
BufferIO::CopyWStr(mainGame->cbDeckSelect->getItem(mainGame->cbDeckSelect->getSelected()),
mainGame->gameConf.lastdeck, 20);
mainGame->gameConf.lastdeck, 64);
char deckbuf[1024];
char* pdeck = deckbuf;
BufferIO::WriteInt32(pdeck, deckManager.current_deck.main.size() + deckManager.current_deck.extra.size());
......@@ -364,12 +364,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case irr::EET_KEY_INPUT_EVENT: {
switch(event.KeyInput.Key) {
case irr::KEY_KEY_R: {
if(!event.KeyInput.PressedDown)
if(!event.KeyInput.PressedDown && !mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->textFont->setTransparency(true);
break;
}
case irr::KEY_ESCAPE: {
mainGame->device->minimizeWindow();
if(!mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->device->minimizeWindow();
break;
}
default: break;
......
Subproject commit 909d844e4a36fda3699e79fc030c9216c0ba6d2b
Subproject commit 1a179cebde187c00b28e47394e4104ba6f0d103a
Subproject commit 8223ac0d56574d27c10bd6a128f0bef0417cdf32
Subproject commit 57598a0854fbea5cc0ad9aa631a3255df7e1e513
......@@ -75,13 +75,13 @@
!system 510 请选择要盖放的卡
!system 511 请选择融合召唤的素材
!system 512 请选择同调召唤的素材
!system 513 请选择超召唤的素材
!system 513 请选择超召唤的素材
!system 514 请选择表侧表示的卡
!system 515 请选择里侧表示的卡
!system 516 请选择攻击表示的怪兽
!system 517 请选择守备表示的怪兽
!system 518 请选择要装备的卡
!system 519 请选择要取除的超素材
!system 519 请选择要取除的超素材
!system 520 请选择要改变控制权的怪兽
!system 521 请选择要代替破坏的卡
!system 522 请选择表侧攻击表示的怪兽
......@@ -94,7 +94,7 @@
!system 529 请选择自己的卡
!system 530 请选择对方的卡
!system 531 请选择上级召唤用需要解放的怪兽:
!system 532 请选择要取除超素材的怪兽
!system 532 请选择要取除超素材的怪兽
!system 550 请选择要发动的效果
!system 551 请选择效果的对象
!system 552 请选择硬币的正反面
......@@ -173,7 +173,7 @@
!system 1070 反击
!system 1071 反转
!system 1072 卡通
!system 1073
!system 1073
!system 1074 灵摆
!system 1080 (N/A)
#GUI
......@@ -207,7 +207,7 @@
!system 1127 幸运
!system 1128 融合相关
!system 1129 同调相关
!system 1130相关
!system 1130相关
!system 1131 效果无效
#actions
!system 1150 发动
......
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