Commit f7ee8e6a authored by Damien Lawford's avatar Damien Lawford

New Field Design

parent cf8c6d59
...@@ -37,6 +37,8 @@ ClientCard::ClientCard() { ...@@ -37,6 +37,8 @@ ClientCard::ClientCard() {
atkstring[0] = 0; atkstring[0] = 0;
defstring[0] = 0; defstring[0] = 0;
lvstring[0] = 0; lvstring[0] = 0;
rscstring[0] = 0;
lscstring[0] = 0;
overlayTarget = 0; overlayTarget = 0;
equipTarget = 0; equipTarget = 0;
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "data_manager.h" #include "data_manager.h"
#include "image_manager.h" #include "image_manager.h"
#include "game.h" #include "game.h"
#include "materials.h"
#include "../ocgcore/field.h" #include "../ocgcore/field.h"
namespace ygo { namespace ygo {
...@@ -655,8 +656,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -655,8 +656,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
switch (location) { switch (location) {
case LOCATION_DECK: { case LOCATION_DECK: {
if (controler == 0) { if (controler == 0) {
t->X = 7.3f; t->X = matManager.vFields[0].Pos.X - (matManager.vFields[0].Pos.X - matManager.vFields[1].Pos.X)/2;
t->Y = 3.0f; t->Y = matManager.vFields[0].Pos.Y - (matManager.vFields[0].Pos.Y - matManager.vFields[3].Pos.Y)/2;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
if(deck_reversed == pcard->is_reversed) { if(deck_reversed == pcard->is_reversed) {
r->X = 0.0f; r->X = 0.0f;
...@@ -668,8 +669,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -668,8 +669,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r->Z = 0.0f; r->Z = 0.0f;
} }
} else { } else {
t->X = 0.6f; t->X = matManager.vFields[68].Pos.X - (matManager.vFields[68].Pos.X - matManager.vFields[69].Pos.X)/2;//0.6f;
t->Y = -3.0f; t->Y = matManager.vFields[68].Pos.Y - (matManager.vFields[68].Pos.Y - matManager.vFields[70].Pos.Y)/2;//-3.0f;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
if(deck_reversed == pcard->is_reversed) { if(deck_reversed == pcard->is_reversed) {
r->X = 0.0f; r->X = 0.0f;
...@@ -733,8 +734,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -733,8 +734,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
} }
case LOCATION_MZONE: { case LOCATION_MZONE: {
if (controler == 0) { if (controler == 0) {
t->X = 1.75f + 1.1f * sequence; t->X = (matManager.vFields[16].Pos.X - (matManager.vFields[16].Pos.X - matManager.vFields[17].Pos.X)/2) + 1.1f * sequence;
t->Y = 1.1f; t->Y = matManager.vFields[16].Pos.Y - (matManager.vFields[16].Pos.Y - matManager.vFields[18].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
if (pcard->position & POS_DEFENCE) { if (pcard->position & POS_DEFENCE) {
r->X = 0.0f; r->X = 0.0f;
...@@ -750,8 +751,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -750,8 +751,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
else r->Y = 0.0f; else r->Y = 0.0f;
} }
} else { } else {
t->X = 6.15f - 1.1f * sequence; t->X = (matManager.vFields[84].Pos.X - (matManager.vFields[84].Pos.X - matManager.vFields[85].Pos.X)/2) - 1.1f * sequence;
t->Y = -1.1f; t->Y = matManager.vFields[84].Pos.Y - (matManager.vFields[84].Pos.Y - matManager.vFields[86].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
if (pcard->position & POS_DEFENCE) { if (pcard->position & POS_DEFENCE) {
r->X = 0.0f; r->X = 0.0f;
...@@ -772,20 +773,20 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -772,20 +773,20 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
case LOCATION_SZONE: { case LOCATION_SZONE: {
if (controler == 0) { if (controler == 0) {
if (sequence <= 4) { if (sequence <= 4) {
t->X = 1.75f + 1.1f * sequence; t->X = (matManager.vFields[36].Pos.X - (matManager.vFields[36].Pos.X - matManager.vFields[37].Pos.X)/2) + 1.1f * sequence;
t->Y = 2.3f; t->Y = matManager.vFields[36].Pos.Y - (matManager.vFields[36].Pos.Y - matManager.vFields[38].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} else if (sequence == 5) { } else if (sequence == 5) {
t->X = 0.6f; t->X = matManager.vFields[56].Pos.X - (matManager.vFields[56].Pos.X - matManager.vFields[57].Pos.X)/2;
t->Y = 1.7f; t->Y = matManager.vFields[56].Pos.Y - (matManager.vFields[56].Pos.Y - matManager.vFields[58].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} else if (sequence == 6) { } else if (sequence == 6) {
t->X = -0.4f; t->X = matManager.vFields[60].Pos.X - (matManager.vFields[60].Pos.X - matManager.vFields[61].Pos.X)/2;
t->Y = 1.7f; t->Y = matManager.vFields[60].Pos.Y - (matManager.vFields[60].Pos.Y - matManager.vFields[62].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} else { } else {
t->X = 8.3f; t->X = matManager.vFields[65].Pos.X - (matManager.vFields[65].Pos.X - matManager.vFields[66].Pos.X)/2;
t->Y = 1.7f; t->Y = matManager.vFields[65].Pos.Y - (matManager.vFields[65].Pos.Y - matManager.vFields[67].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} }
r->X = 0.0f; r->X = 0.0f;
...@@ -795,20 +796,20 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -795,20 +796,20 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
else r->Y = 0.0f; else r->Y = 0.0f;
} else { } else {
if (sequence <= 4) { if (sequence <= 4) {
t->X = 6.15f - 1.1f * sequence; t->X = (matManager.vFields[104].Pos.X - (matManager.vFields[104].Pos.X - matManager.vFields[105].Pos.X)/2) - 1.1f * sequence;
t->Y = -2.3f; t->Y = matManager.vFields[104].Pos.Y - (matManager.vFields[104].Pos.Y - matManager.vFields[106].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} else if (sequence == 5) { } else if (sequence == 5) {
t->X = 7.3f; t->X = matManager.vFields[124].Pos.X - (matManager.vFields[124].Pos.X - matManager.vFields[125].Pos.X)/2;
t->Y = -1.7f; t->Y = matManager.vFields[124].Pos.Y - (matManager.vFields[124].Pos.Y - matManager.vFields[126].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} else if (sequence == 6) { } else if (sequence == 6) {
t->X = 8.3f; t->X = matManager.vFields[128].Pos.X - (matManager.vFields[128].Pos.X - matManager.vFields[129].Pos.X)/2;
t->Y = -1.7f; t->Y = matManager.vFields[128].Pos.Y - (matManager.vFields[128].Pos.Y - matManager.vFields[130].Pos.Y)/2;
t->Z = 0.01f; t->Z = 0.01f;
} else { } else {
t->X = -0.4f; t->X = matManager.vFields[132].Pos.X - (matManager.vFields[132].Pos.X - matManager.vFields[133].Pos.X)/2;//-0.4f;
t->Y = -1.7f; t->Y = matManager.vFields[132].Pos.Y - (matManager.vFields[132].Pos.Y - matManager.vFields[134].Pos.Y)/2;//-1.7f;
t->Z = 0.01f; t->Z = 0.01f;
} }
r->X = 0.0f; r->X = 0.0f;
...@@ -821,15 +822,15 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -821,15 +822,15 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
} }
case LOCATION_GRAVE: { case LOCATION_GRAVE: {
if (controler == 0) { if (controler == 0) {
t->X = 7.3f; t->X = matManager.vFields[4].Pos.X - (matManager.vFields[4].Pos.X - matManager.vFields[5].Pos.X)/2;
t->Y = 1.7f; t->Y = matManager.vFields[4].Pos.Y - (matManager.vFields[4].Pos.Y - matManager.vFields[6].Pos.Y)/2;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
r->X = 0.0f; r->X = 0.0f;
r->Y = 0.0f; r->Y = 0.0f;
r->Z = 0.0f; r->Z = 0.0f;
} else { } else {
t->X = 0.6f; t->X = matManager.vFields[72].Pos.X - (matManager.vFields[72].Pos.X - matManager.vFields[73].Pos.X)/2;
t->Y = -1.7f; t->Y = matManager.vFields[72].Pos.Y - (matManager.vFields[72].Pos.Y - matManager.vFields[74].Pos.Y)/2;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
r->X = 0.0f; r->X = 0.0f;
r->Y = 0.0f; r->Y = 0.0f;
...@@ -839,8 +840,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -839,8 +840,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
} }
case LOCATION_REMOVED: { case LOCATION_REMOVED: {
if (controler == 0) { if (controler == 0) {
t->X = 7.3f; t->X = matManager.vFields[12].Pos.X - (matManager.vFields[12].Pos.X - matManager.vFields[13].Pos.X)/2;
t->Y = 0.4f; t->Y = matManager.vFields[12].Pos.Y - (matManager.vFields[12].Pos.Y - matManager.vFields[14].Pos.Y)/2;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
if(pcard->position & POS_FACEUP) { if(pcard->position & POS_FACEUP) {
r->X = 0.0f; r->X = 0.0f;
...@@ -852,8 +853,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -852,8 +853,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r->Z = 0.0f; r->Z = 0.0f;
} }
} else { } else {
t->X = 0.6f; t->X = matManager.vFields[80].Pos.X - (matManager.vFields[80].Pos.X - matManager.vFields[81].Pos.X)/2;
t->Y = -0.4f; t->Y = matManager.vFields[80].Pos.Y - (matManager.vFields[80].Pos.Y - matManager.vFields[82].Pos.Y)/2;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
if(pcard->position & POS_FACEUP) { if(pcard->position & POS_FACEUP) {
r->X = 0.0f; r->X = 0.0f;
...@@ -869,8 +870,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -869,8 +870,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
} }
case LOCATION_EXTRA: { case LOCATION_EXTRA: {
if (controler == 0) { if (controler == 0) {
t->X = 0.6f; t->X = matManager.vFields[8].Pos.X - (matManager.vFields[8].Pos.X - matManager.vFields[9].Pos.X)/2;
t->Y = 3.0f; t->Y = matManager.vFields[8].Pos.Y - (matManager.vFields[8].Pos.Y - matManager.vFields[10].Pos.Y)/2;
t->Z = 0.01f + 0.01f * sequence; t->Z = 0.01f + 0.01f * sequence;
r->X = 0.0f; r->X = 0.0f;
if(pcard->position & POS_FACEUP) if(pcard->position & POS_FACEUP)
...@@ -878,8 +879,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -878,8 +879,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
else r->Y = 3.1415926f; else r->Y = 3.1415926f;
r->Z = 0.0f; r->Z = 0.0f;
} else { } else {
t->X = 7.3f; t->X = matManager.vFields[76].Pos.X - (matManager.vFields[76].Pos.X - matManager.vFields[77].Pos.X)/2;
t->Y = -3.0f; t->Y = matManager.vFields[76].Pos.Y - (matManager.vFields[76].Pos.Y - matManager.vFields[78].Pos.Y)/2;
t->Z = 0.01f * sequence; t->Z = 0.01f * sequence;
r->X = 0.0f; r->X = 0.0f;
if(pcard->position & POS_FACEUP) if(pcard->position & POS_FACEUP)
...@@ -895,15 +896,15 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -895,15 +896,15 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
} }
int oseq = pcard->overlayTarget->sequence; int oseq = pcard->overlayTarget->sequence;
if (pcard->overlayTarget->controler == 0) { if (pcard->overlayTarget->controler == 0) {
t->X = 1.75f + 1.1f * oseq - 0.12f + 0.06f * sequence; t->X = (matManager.vFields[16].Pos.X - (matManager.vFields[16].Pos.X - matManager.vFields[17].Pos.X)/2) + 1.1f * oseq - 0.12f + 0.06f * sequence;//1.75f + 1.1f * oseq - 0.12f + 0.06f * sequence;
t->Y = 1.15f; t->Y = matManager.vFields[16].Pos.Y - (matManager.vFields[16].Pos.Y - matManager.vFields[18].Pos.Y)/2 + 0.05f;//1.15f;
t->Z = 0.005f + pcard->sequence * 0.0001f; t->Z = 0.005f + pcard->sequence * 0.0001f;
r->X = 0.0f; r->X = 0.0f;
r->Y = 0.0f; r->Y = 0.0f;
r->Z = 0.0f; r->Z = 0.0f;
} else { } else {
t->X = 6.15f - 1.1f * oseq + 0.12f - 0.06f * sequence; t->X = (matManager.vFields[84].Pos.X - (matManager.vFields[84].Pos.X - matManager.vFields[85].Pos.X)/2) - 1.1f * oseq + 0.12f - 0.06f * sequence; //6.15f - 1.1f * oseq + 0.12f - 0.06f * sequence;
t->Y = -1.15f; t->Y = matManager.vFields[84].Pos.Y - (matManager.vFields[84].Pos.Y - matManager.vFields[86].Pos.Y)/2 - 0.05f;//-1.15f;
t->Z = 0.005f + pcard->sequence * 0.0001f; t->Z = 0.005f + pcard->sequence * 0.0001f;
r->X = 0.0f; r->X = 0.0f;
r->Y = 0.0f; r->Y = 0.0f;
......
This diff is collapsed.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "image_manager.h" #include "image_manager.h"
#include "replay_mode.h" #include "replay_mode.h"
#include "single_mode.h" #include "single_mode.h"
#include "materials.h"
#include "../ocgcore/field.h" #include "../ocgcore/field.h"
namespace ygo { namespace ygo {
...@@ -1488,15 +1489,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1488,15 +1489,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
return false; return false;
} }
void ClientField::GetHoverField(int x, int y) { void ClientField::GetHoverField(int x, int y) {
irr::core::recti sfRect(416, 504, 900, 600); irr::core::recti sfRect(396, 504, 880, 600);
irr::core::recti ofRect(516, 135, 805, 191); irr::core::recti ofRect(506, 135, 795, 191);
irr::core::position2di pos(x, y); irr::core::position2di pos(x, y);
if(sfRect.isPointInside(pos)) { if(sfRect.isPointInside(pos)) {
int hc = hand[0].size(); int hc = hand[0].size();
if(hc == 0) if(hc == 0)
hovered_location = 0; hovered_location = 0;
else if(hc < 7) { else if(hc < 7) {
int left = 416 + 82 * (6 - hc) / 2; int left = 396 + 82 * (6 - hc) / 2;
if(x < left) if(x < left)
hovered_location = 0; hovered_location = 0;
else { else {
...@@ -1521,7 +1522,7 @@ void ClientField::GetHoverField(int x, int y) { ...@@ -1521,7 +1522,7 @@ void ClientField::GetHoverField(int x, int y) {
if(hc == 0) if(hc == 0)
hovered_location = 0; hovered_location = 0;
else if(hc < 7) { else if(hc < 7) {
int left = 516 + 49 * (6 - hc) / 2; int left = 506 + 49 * (6 - hc) / 2;
if(x < left) if(x < left)
hovered_location = 0; hovered_location = 0;
else { else {
...@@ -1546,85 +1547,85 @@ void ClientField::GetHoverField(int x, int y) { ...@@ -1546,85 +1547,85 @@ void ClientField::GetHoverField(int x, int y) {
double screeny = y / 640.0 * 0.84 - 0.42; double screeny = y / 640.0 * 0.84 - 0.42;
double angle = 0.798056 - atan(screeny); //0.798056 = arctan(8.0/7.8) double angle = 0.798056 - atan(screeny); //0.798056 = arctan(8.0/7.8)
double vlen = sqrt(1.0 + screeny * screeny); double vlen = sqrt(1.0 + screeny * screeny);
double boardx = 3.95 + 7.8 * screenx / vlen / cos(angle); double boardx = 4.2 + 7.8 * screenx / vlen / cos(angle);
double boardy = 8.0 - 7.8 * tan(angle); double boardy = 8.0 - 7.8 * tan(angle);
hovered_location = 0; hovered_location = 0;
if(boardx >= 0.2 && boardx <= 1.0) { if(boardx >= matManager.vFields[8].Pos.X && boardx <= matManager.vFields[9].Pos.X) {
if(boardy >= 2.4 && boardy <= 3.6) { if(boardy >= matManager.vFields[8].Pos.Y && boardy <= matManager.vFields[10].Pos.Y) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_EXTRA; hovered_location = LOCATION_EXTRA;
} else if(boardy >= 1.1 && boardy <= 2.3) { } else if(boardy >= matManager.vFields[56].Pos.Y && boardy <= matManager.vFields[58].Pos.Y) {//field
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_SZONE; hovered_location = LOCATION_SZONE;
hovered_sequence = 5; hovered_sequence = 5;
} else if(boardy >= -1.0 && boardy <= 0.2) { } else if(boardy >= matManager.vFields[60].Pos.Y && boardy <= matManager.vFields[62].Pos.Y) {
hovered_controler = 0;
hovered_location = LOCATION_SZONE;
hovered_sequence = 6;
} else if(boardy >= matManager.vFields[134].Pos.Y && boardy <= matManager.vFields[132].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_REMOVED; hovered_location = LOCATION_SZONE;
} else if(boardy >= -2.3 && boardy <= -1.1) { hovered_sequence = 7;
} else if(boardy >= matManager.vFields[74].Pos.Y && boardy <= matManager.vFields[72].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_GRAVE; hovered_location = LOCATION_GRAVE;
} else if(boardy >= -3.6 && boardy <= -2.4) { } else if(boardy >= matManager.vFields[70].Pos.Y && boardy <= matManager.vFields[68].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_DECK; hovered_location = LOCATION_DECK;
} }
} else if(boardx >= -0.7 && boardx <= 0.1) { } else if(boardx >= matManager.vFields[81].Pos.X && boardx <= matManager.vFields[80].Pos.X) {
if(boardy >= -2.3 && boardy <= -1.1) { if(boardy >= matManager.vFields[82].Pos.Y && boardy <= matManager.vFields[80].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_SZONE; hovered_location = LOCATION_REMOVED;
hovered_sequence = 7;
} else if(boardy >= 1.1 && boardy <= 2.3) {
hovered_controler = 0;
hovered_location = LOCATION_SZONE;
hovered_sequence = 6;
} }
} else if(boardx >= 6.9 && boardx <= 7.7) { } else if(boardx >= matManager.vFields[0].Pos.X && boardx <= matManager.vFields[1].Pos.X) {
if(boardy >= 2.4 && boardy <= 3.6) { if(boardy >= matManager.vFields[0].Pos.Y && boardy <= matManager.vFields[2].Pos.Y) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_DECK; hovered_location = LOCATION_DECK;
} else if(boardy >= 1.1 && boardy <= 2.3) { } else if(boardy >= matManager.vFields[4].Pos.Y && boardy <= matManager.vFields[6].Pos.Y) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_GRAVE; hovered_location = LOCATION_GRAVE;
} else if(boardy >= -0.2 && boardy <= 1.0) { } else if(boardy >= matManager.vFields[130].Pos.Y && boardy <= matManager.vFields[128].Pos.Y) {
hovered_controler = 1;
hovered_location = LOCATION_SZONE;
hovered_sequence = 6;
} else if(boardy >= matManager.vFields[64].Pos.Y && boardy <= matManager.vFields[66].Pos.Y) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_REMOVED; hovered_location = LOCATION_SZONE;
} else if(boardy >= -2.3 && boardy <= -1.1) { hovered_sequence = 7;
} else if(boardy >= matManager.vFields[126].Pos.Y && boardy <= matManager.vFields[124].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_SZONE; hovered_location = LOCATION_SZONE;
hovered_sequence = 5; hovered_sequence = 5;
} else if(boardy >= -3.6 && boardy <= -2.4) { } else if(boardy >= matManager.vFields[78].Pos.Y && boardy <= matManager.vFields[76].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_EXTRA; hovered_location = LOCATION_EXTRA;
} }
} else if(boardx >= 7.8 && boardx <= 8.6) { } else if(boardx >= matManager.vFields[12].Pos.X && boardx <= matManager.vFields[13].Pos.X) {
if(boardy >= -2.3 && boardy <= -1.1) { if(boardy >= matManager.vFields[12].Pos.Y && boardy <= matManager.vFields[14].Pos.Y) {
hovered_controler = 1;
hovered_location = LOCATION_SZONE;
hovered_sequence = 6;
} else if(boardy >= 1.1 && boardy <= 2.3) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_SZONE; hovered_location = LOCATION_REMOVED;
hovered_sequence = 7;
} }
} else if(boardx >= 1.2 && boardx <= 6.7) { } else if(boardx >= matManager.vFields[36].Pos.X && boardx <= matManager.vFields[55].Pos.X) {
if(boardy > 1.7 && boardy <= 2.9) { if(boardy > matManager.vFields[36].Pos.Y && boardy <= matManager.vFields[38].Pos.Y) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_SZONE; hovered_location = LOCATION_SZONE;
hovered_sequence = (boardx - 1.2) / 1.1; hovered_sequence = (boardx - 1.2) / 1.1;
if(hovered_sequence > 4) if(hovered_sequence > 4)
hovered_sequence = 4; hovered_sequence = 4;
} else if(boardy >= 0.5 && boardy <= 1.7) { } else if(boardy >= matManager.vFields[16].Pos.Y && boardy <= matManager.vFields[35].Pos.Y) {
hovered_controler = 0; hovered_controler = 0;
hovered_location = LOCATION_MZONE; hovered_location = LOCATION_MZONE;
hovered_sequence = (boardx - 1.2) / 1.1; hovered_sequence = (boardx - 1.2) / 1.1;
if(hovered_sequence > 4) if(hovered_sequence > 4)
hovered_sequence = 4; hovered_sequence = 4;
} else if(boardy >= -1.7 && boardy <= -0.5) { } else if(boardy >= matManager.vFields[103].Pos.Y && boardy <= matManager.vFields[84].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_MZONE; hovered_location = LOCATION_MZONE;
hovered_sequence = 4 - (int)((boardx - 1.2) / 1.1); hovered_sequence = 4 - (int)((boardx - 1.2) / 1.1);
if(hovered_sequence < 0) if(hovered_sequence < 0)
hovered_sequence = 0; hovered_sequence = 0;
} else if(boardy >= -2.9 && boardy < -1.7) { } else if(boardy >= matManager.vFields[123].Pos.Y && boardy < matManager.vFields[104].Pos.Y) {
hovered_controler = 1; hovered_controler = 1;
hovered_location = LOCATION_SZONE; hovered_location = LOCATION_SZONE;
hovered_sequence = 4 - (int)((boardx - 1.2) / 1.1); hovered_sequence = 4 - (int)((boardx - 1.2) / 1.1);
...@@ -1632,7 +1633,7 @@ void ClientField::GetHoverField(int x, int y) { ...@@ -1632,7 +1633,7 @@ void ClientField::GetHoverField(int x, int y) {
hovered_sequence = 0; hovered_sequence = 0;
} }
} }
} }
} }
void ClientField::ShowMenu(int flag, int x, int y) { void ClientField::ShowMenu(int flag, int x, int y) {
if(!flag) { if(!flag) {
......
...@@ -176,7 +176,7 @@ bool Game::Initialize() { ...@@ -176,7 +176,7 @@ bool Game::Initialize() {
imgCard = env->addImage(rect<s32>(9, 9, 187, 262), wCardImg); imgCard = env->addImage(rect<s32>(9, 9, 187, 262), wCardImg);
imgCard->setUseAlphaChannel(true); imgCard->setUseAlphaChannel(true);
//phase //phase
wPhase = env->addStaticText(L"", rect<s32>(475, 310, 850, 330)); wPhase = env->addStaticText(L"", rect<s32>(455, 310, 830, 330));
wPhase->setVisible(false); wPhase->setVisible(false);
btnDP = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, -1, L"\xff24\xff30"); btnDP = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, -1, L"\xff24\xff30");
btnDP->setEnabled(false); btnDP->setEnabled(false);
...@@ -500,7 +500,7 @@ void Game::MainLoop() { ...@@ -500,7 +500,7 @@ void Game::MainLoop() {
BuildProjectionMatrix(mProjection, -0.81f, 0.44f, -0.42f, 0.42f, 1.0f, 100.0f); BuildProjectionMatrix(mProjection, -0.81f, 0.44f, -0.42f, 0.42f, 1.0f, 100.0f);
camera->setProjectionMatrix(mProjection); camera->setProjectionMatrix(mProjection);
mProjection.buildCameraLookAtMatrixLH(vector3df(3.95f, 8.0f, 7.8f), vector3df(3.95f, 0, 0), vector3df(0, 0, 1)); mProjection.buildCameraLookAtMatrixLH(vector3df(4.2f, 8.0f, 7.8f), vector3df(4.2f, 0, 0), vector3df(0, 0, 1));
camera->setViewMatrixAffector(mProjection); camera->setViewMatrixAffector(mProjection);
smgr->setAmbientLight(SColorf(1.0f, 1.0f, 1.0f)); smgr->setAmbientLight(SColorf(1.0f, 1.0f, 1.0f));
float atkframe = 0.1f; float atkframe = 0.1f;
......
This diff is collapsed.
...@@ -767,14 +767,14 @@ void card::xyz_overlay(card_set* materials) { ...@@ -767,14 +767,14 @@ void card::xyz_overlay(card_set* materials) {
xyz_add(pcard, &des); xyz_add(pcard, &des);
} else { } else {
field::card_vector cv; field::card_vector cv;
for(auto cit : *materials) for(auto cit = materials->begin(); cit != materials->end(); ++cit)
cv.push_back(cit); cv.push_back(*cit);
std::sort(cv.begin(), cv.end(), card::card_operation_sort); std::sort(cv.begin(), cv.end(), card::card_operation_sort);
for(auto pcard : cv) { for(auto cvit = cv.begin(); cvit != cv.end(); ++cvit) {
pcard->reset(RESET_LEAVE + RESET_OVERLAY, RESET_EVENT); (*cvit)->reset(RESET_LEAVE + RESET_OVERLAY, RESET_EVENT);
if(pcard->unique_code) if((*cvit)->unique_code)
pduel->game_field->remove_unique_card(pcard); pduel->game_field->remove_unique_card(*cvit);
xyz_add(pcard, &des); xyz_add(*cvit, &des);
} }
} }
if(des.size()) if(des.size())
......
...@@ -105,8 +105,9 @@ void duel::release_script_group() { ...@@ -105,8 +105,9 @@ void duel::release_script_group() {
sgroups.clear(); sgroups.clear();
} }
void duel::restore_assumes() { void duel::restore_assumes() {
for(auto pcard : assumes) std::set<card*>::iterator sit;
pcard->assume_type = 0; for(sit = assumes.begin(); sit != assumes.end(); ++sit)
(*sit)->assume_type = 0;
assumes.clear(); assumes.clear();
} }
void duel::write_buffer32(uint32 value) { void duel::write_buffer32(uint32 value) {
......
textures/field2.png

1.86 KB | W: | H:

textures/field2.png

3.99 KB | W: | H:

textures/field2.png
textures/field2.png
textures/field2.png
textures/field2.png
  • 2-up
  • Swipe
  • Onion skin
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