Commit 1eb362bc authored by VanillaSalt's avatar VanillaSalt

Merge pull request #726 from sidschingis/patch-3

Add Race Phantom Dragons 幻竜
parents 4f764d10 005ee21b
......@@ -215,7 +215,7 @@ const wchar_t* DataManager::FormatAttribute(int attribute) {
const wchar_t* DataManager::FormatRace(int race) {
wchar_t* p = racBuffer;
int filter = 1, i = 1020;
for(; filter != 0x800000; filter <<= 1, ++i) {
for(; filter != 0x1000000; filter <<= 1, ++i) {
if(race & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
*p = L'|';
......
......@@ -2771,7 +2771,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
mainGame->dField.announce_count = BufferIO::ReadInt8(pbuf);
int available = BufferIO::ReadInt32(pbuf);
for(int i = 0, filter = 0x1; i < 23; ++i, filter <<= 1) {
for(int i = 0, filter = 0x1; i < 24; ++i, filter <<= 1) {
mainGame->chkRace[i]->setChecked(false);
if(filter & available)
mainGame->chkRace[i]->setVisible(true);
......
......@@ -671,7 +671,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case CHECK_RACE: {
int rac = 0, filter = 0x1, count = 0;
for(int i = 0; i < 23; ++i, filter <<= 1) {
for(int i = 0; i < 24; ++i, filter <<= 1) {
if(mainGame->chkRace[i]->isChecked()) {
rac |= filter;
count++;
......
......@@ -331,7 +331,7 @@ bool Game::Initialize() {
wANRace = env->addWindow(rect<s32>(480, 200, 850, 385), false, dataManager.GetSysString(563));
wANRace->getCloseButton()->setVisible(false);
wANRace->setVisible(false);
for(int filter = 0x1, i = 0; i < 23; filter <<= 1, ++i)
for(int filter = 0x1, i = 0; i < 24; filter <<= 1, ++i)
chkRace[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 90, 25 + (i / 4) * 25, 100 + (i % 4) * 90, 50 + (i / 4) * 25),
wANRace, CHECK_RACE, dataManager.FormatRace(filter));
//selection hint
......
......@@ -287,7 +287,7 @@ public:
irr::gui::IGUICheckBox* chkAttribute[7];
//announce race
irr::gui::IGUIWindow* wANRace;
irr::gui::IGUICheckBox* chkRace[23];
irr::gui::IGUICheckBox* chkRace[24];
//cmd menu
irr::gui::IGUIWindow* wCmdMenu;
irr::gui::IGUIButton* btnActivate;
......
......@@ -326,6 +326,7 @@ public:
#define RACE_PSYCHO 0x100000 //
#define RACE_DEVINE 0x200000 //
#define RACE_CREATORGOD 0x400000 //
#define RACE_PHANTOMDRAGON 0x800000 //
//Reason
#define REASON_DESTROY 0x1 //
#define REASON_RELEASE 0x2 //
......
......@@ -645,7 +645,7 @@ int32 field::sort_card(int16 step, uint8 playerid, uint8 is_chain) {
int32 field::announce_race(int16 step, uint8 playerid, int32 count, int32 available) {
if(step == 0) {
int32 scount = 0;
for(int32 ft = 0x1; ft != 0x800000; ft <<= 1) {
for(int32 ft = 0x1; ft != 0x1000000; ft <<= 1) {
if(ft & available)
scount++;
}
......@@ -661,7 +661,7 @@ int32 field::announce_race(int16 step, uint8 playerid, int32 count, int32 availa
} else {
int32 rc = returns.ivalue[0];
int32 sel = 0;
for(int32 ft = 0x1; ft != 0x800000; ft <<= 1) {
for(int32 ft = 0x1; ft != 0x1000000; ft <<= 1) {
if(!(ft & rc)) continue;
if(!(ft & available)) {
pduel->write_buffer8(MSG_RETRY);
......
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