Commit 88571dcc authored by salix5's avatar salix5

Merge remote-tracking branch 'origin/master' into patch

parents fea7e298 145062d8
......@@ -37,6 +37,8 @@ ClientCard::ClientCard() {
atkstring[0] = 0;
defstring[0] = 0;
lvstring[0] = 0;
rscstring[0] = 0;
lscstring[0] = 0;
overlayTarget = 0;
equipTarget = 0;
}
......
......@@ -3,6 +3,7 @@
#include "data_manager.h"
#include "image_manager.h"
#include "game.h"
#include "materials.h"
#include "../ocgcore/field.h"
namespace ygo {
......@@ -655,9 +656,9 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
switch (location) {
case LOCATION_DECK: {
if (controler == 0) {
t->X = 7.3f;
t->Y = 3.0f;
t->Z = 0.01f + 0.01f * sequence;
t->X = matManager.vFields[0].Pos.X - (matManager.vFields[0].Pos.X - matManager.vFields[1].Pos.X)/2;
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;
if(deck_reversed == pcard->is_reversed) {
r->X = 0.0f;
r->Y = 3.1415926f;
......@@ -668,8 +669,8 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r->Z = 0.0f;
}
} else {
t->X = 0.6f;
t->Y = -3.0f;
t->X = matManager.vFields[68].Pos.X - (matManager.vFields[68].Pos.X - matManager.vFields[69].Pos.X)/2;//0.6f;
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;
if(deck_reversed == pcard->is_reversed) {
r->X = 0.0f;
......@@ -733,9 +734,9 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
case LOCATION_MZONE: {
if (controler == 0) {
t->X = 1.75f + 1.1f * sequence;
t->Y = 1.1f;
t->Z = 0.01f;
t->X = (matManager.vFields[16].Pos.X - (matManager.vFields[16].Pos.X - matManager.vFields[17].Pos.X)/2) + 1.1f * sequence;
t->Y = matManager.vFields[16].Pos.Y - (matManager.vFields[16].Pos.Y - matManager.vFields[18].Pos.Y)/2;
t->Z = 0.01f;
if (pcard->position & POS_DEFENCE) {
r->X = 0.0f;
r->Z = -3.1415926f / 2.0f;
......@@ -750,9 +751,9 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
else r->Y = 0.0f;
}
} else {
t->X = 6.15f - 1.1f * sequence;
t->Y = -1.1f;
t->Z = 0.01f;
t->X = (matManager.vFields[84].Pos.X - (matManager.vFields[84].Pos.X - matManager.vFields[85].Pos.X)/2) - 1.1f * sequence;
t->Y = matManager.vFields[84].Pos.Y - (matManager.vFields[84].Pos.Y - matManager.vFields[86].Pos.Y)/2;
t->Z = 0.01f;
if (pcard->position & POS_DEFENCE) {
r->X = 0.0f;
r->Z = 3.1415926f / 2.0f;
......@@ -772,21 +773,21 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
case LOCATION_SZONE: {
if (controler == 0) {
if (sequence <= 4) {
t->X = 1.75f + 1.1f * sequence;
t->Y = 2.3f;
t->Z = 0.01f;
t->X = (matManager.vFields[36].Pos.X - (matManager.vFields[36].Pos.X - matManager.vFields[37].Pos.X)/2) + 1.1f * sequence;
t->Y = matManager.vFields[36].Pos.Y - (matManager.vFields[36].Pos.Y - matManager.vFields[38].Pos.Y)/2;
t->Z = 0.01f;
} else if (sequence == 5) {
t->X = 0.6f;
t->Y = 1.7f;
t->Z = 0.01f;
t->X = matManager.vFields[56].Pos.X - (matManager.vFields[56].Pos.X - matManager.vFields[57].Pos.X)/2;
t->Y = matManager.vFields[56].Pos.Y - (matManager.vFields[56].Pos.Y - matManager.vFields[58].Pos.Y)/2;
t->Z = 0.01f;
} else if (sequence == 6) {
t->X = -0.4f;
t->Y = 1.7f;
t->Z = 0.01f;
t->X = matManager.vFields[60].Pos.X - (matManager.vFields[60].Pos.X - matManager.vFields[61].Pos.X)/2;
t->Y = matManager.vFields[60].Pos.Y - (matManager.vFields[60].Pos.Y - matManager.vFields[62].Pos.Y)/2;
t->Z = 0.01f;
} else {
t->X = 8.3f;
t->Y = 1.7f;
t->Z = 0.01f;
t->X = matManager.vFields[65].Pos.X - (matManager.vFields[65].Pos.X - matManager.vFields[66].Pos.X)/2;
t->Y = matManager.vFields[65].Pos.Y - (matManager.vFields[65].Pos.Y - matManager.vFields[67].Pos.Y)/2;
t->Z = 0.01f;
}
r->X = 0.0f;
r->Z = 0.0f;
......@@ -795,21 +796,21 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
else r->Y = 0.0f;
} else {
if (sequence <= 4) {
t->X = 6.15f - 1.1f * sequence;
t->Y = -2.3f;
t->Z = 0.01f;
t->X = (matManager.vFields[104].Pos.X - (matManager.vFields[104].Pos.X - matManager.vFields[105].Pos.X)/2) - 1.1f * sequence;
t->Y = matManager.vFields[104].Pos.Y - (matManager.vFields[104].Pos.Y - matManager.vFields[106].Pos.Y)/2;
t->Z = 0.01f;
} else if (sequence == 5) {
t->X = 7.3f;
t->Y = -1.7f;
t->Z = 0.01f;
t->X = matManager.vFields[124].Pos.X - (matManager.vFields[124].Pos.X - matManager.vFields[125].Pos.X)/2;
t->Y = matManager.vFields[124].Pos.Y - (matManager.vFields[124].Pos.Y - matManager.vFields[126].Pos.Y)/2;
t->Z = 0.01f;
} else if (sequence == 6) {
t->X = 8.3f;
t->Y = -1.7f;
t->Z = 0.01f;
t->X = matManager.vFields[128].Pos.X - (matManager.vFields[128].Pos.X - matManager.vFields[129].Pos.X)/2;
t->Y = matManager.vFields[128].Pos.Y - (matManager.vFields[128].Pos.Y - matManager.vFields[130].Pos.Y)/2;
t->Z = 0.01f;
} else {
t->X = -0.4f;
t->Y = -1.7f;
t->Z = 0.01f;
t->X = matManager.vFields[132].Pos.X - (matManager.vFields[132].Pos.X - matManager.vFields[133].Pos.X)/2;//-0.4f;
t->Y = matManager.vFields[132].Pos.Y - (matManager.vFields[132].Pos.Y - matManager.vFields[134].Pos.Y)/2;//-1.7f;
t->Z = 0.01f;
}
r->X = 0.0f;
r->Z = 3.1415926f;
......@@ -821,16 +822,16 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
case LOCATION_GRAVE: {
if (controler == 0) {
t->X = 7.3f;
t->Y = 1.7f;
t->Z = 0.01f + 0.01f * sequence;
t->X = matManager.vFields[4].Pos.X - (matManager.vFields[4].Pos.X - matManager.vFields[5].Pos.X)/2;
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;
r->X = 0.0f;
r->Y = 0.0f;
r->Z = 0.0f;
} else {
t->X = 0.6f;
t->Y = -1.7f;
t->Z = 0.01f + 0.01f * sequence;
t->X = matManager.vFields[72].Pos.X - (matManager.vFields[72].Pos.X - matManager.vFields[73].Pos.X)/2;
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;
r->X = 0.0f;
r->Y = 0.0f;
r->Z = 3.1415926f;
......@@ -839,9 +840,9 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
case LOCATION_REMOVED: {
if (controler == 0) {
t->X = 7.3f;
t->Y = 0.4f;
t->Z = 0.01f + 0.01f * sequence;
t->X = matManager.vFields[12].Pos.X - (matManager.vFields[12].Pos.X - matManager.vFields[13].Pos.X)/2;
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;
if(pcard->position & POS_FACEUP) {
r->X = 0.0f;
r->Y = 0.0f;
......@@ -852,9 +853,9 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r->Z = 0.0f;
}
} else {
t->X = 0.6f;
t->Y = -0.4f;
t->Z = 0.01f + 0.01f * sequence;
t->X = matManager.vFields[80].Pos.X - (matManager.vFields[80].Pos.X - matManager.vFields[81].Pos.X)/2;
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;
if(pcard->position & POS_FACEUP) {
r->X = 0.0f;
r->Y = 0.0f;
......@@ -869,18 +870,18 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
case LOCATION_EXTRA: {
if (controler == 0) {
t->X = 0.6f;
t->Y = 3.0f;
t->Z = 0.01f + 0.01f * sequence;
t->X = matManager.vFields[8].Pos.X - (matManager.vFields[8].Pos.X - matManager.vFields[9].Pos.X)/2;
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;
r->X = 0.0f;
if(pcard->position & POS_FACEUP)
r->Y = 0.0f;
else r->Y = 3.1415926f;
r->Z = 0.0f;
} else {
t->X = 7.3f;
t->Y = -3.0f;
t->Z = 0.01f * sequence;
t->X = matManager.vFields[76].Pos.X - (matManager.vFields[76].Pos.X - matManager.vFields[77].Pos.X)/2;
t->Y = matManager.vFields[76].Pos.Y - (matManager.vFields[76].Pos.Y - matManager.vFields[78].Pos.Y)/2;
t->Z = 0.01f * sequence;
r->X = 0.0f;
if(pcard->position & POS_FACEUP)
r->Y = 0.0f;
......@@ -895,16 +896,16 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
int oseq = pcard->overlayTarget->sequence;
if (pcard->overlayTarget->controler == 0) {
t->X = 1.75f + 1.1f * oseq - 0.12f + 0.06f * sequence;
t->Y = 1.15f;
t->Z = 0.005f + pcard->sequence * 0.0001f;
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 = 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;
r->X = 0.0f;
r->Y = 0.0f;
r->Z = 0.0f;
} else {
t->X = 6.15f - 1.1f * oseq + 0.12f - 0.06f * sequence;
t->Y = -1.15f;
t->Z = 0.005f + pcard->sequence * 0.0001f;
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 = 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;
r->X = 0.0f;
r->Y = 0.0f;
r->Z = 3.1415926f;
......
This diff is collapsed.
......@@ -7,6 +7,7 @@
#include "image_manager.h"
#include "replay_mode.h"
#include "single_mode.h"
#include "materials.h"
#include "../ocgcore/field.h"
namespace ygo {
......@@ -1488,15 +1489,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
return false;
}
void ClientField::GetHoverField(int x, int y) {
irr::core::recti sfRect(416, 504, 900, 600);
irr::core::recti ofRect(516, 135, 805, 191);
irr::core::recti sfRect(393, 504, 875, 600);
irr::core::recti ofRect(501, 135, 790, 191);
irr::core::position2di pos(x, y);
if(sfRect.isPointInside(pos)) {
int hc = hand[0].size();
if(hc == 0)
hovered_location = 0;
else if(hc < 7) {
int left = 416 + 82 * (6 - hc) / 2;
int left = 393 + 82 * (6 - hc) / 2;
if(x < left)
hovered_location = 0;
else {
......@@ -1511,17 +1512,17 @@ void ClientField::GetHoverField(int x, int y) {
} else {
hovered_controler = 0;
hovered_location = LOCATION_HAND;
if(x >= 829)
if(x >= 804)
hovered_sequence = hc - 1;
else
hovered_sequence = (x - 416) * (hc - 1) / 413;
hovered_sequence = (x - 393) * (hc - 1) / 411;
}
} else if(ofRect.isPointInside(pos)) {
int hc = hand[1].size();
if(hc == 0)
hovered_location = 0;
else if(hc < 7) {
int left = 516 + 49 * (6 - hc) / 2;
int left = 501 + 49 * (6 - hc) / 2;
if(x < left)
hovered_location = 0;
else {
......@@ -1536,95 +1537,95 @@ void ClientField::GetHoverField(int x, int y) {
} else {
hovered_controler = 1;
hovered_location = LOCATION_HAND;
if(x >= 756)
if(x >= 748)
hovered_sequence = 0;
else
hovered_sequence = hc - 1 - (x - 516) * (hc - 1) / 247;
hovered_sequence = hc - 1 - (x - 501) * (hc - 1) / 247;
}
} else {
double screenx = x / 1024.0 * 1.25 - 0.81;
double screeny = y / 640.0 * 0.84 - 0.42;
double angle = 0.798056 - atan(screeny); //0.798056 = arctan(8.0/7.8)
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);
hovered_location = 0;
if(boardx >= 0.2 && boardx <= 1.0) {
if(boardy >= 2.4 && boardy <= 3.6) {
if(boardx >= matManager.vFields[8].Pos.X && boardx <= matManager.vFields[9].Pos.X) {
if(boardy >= matManager.vFields[8].Pos.Y && boardy <= matManager.vFields[10].Pos.Y) {
hovered_controler = 0;
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_location = LOCATION_SZONE;
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_location = LOCATION_REMOVED;
} else if(boardy >= -2.3 && boardy <= -1.1) {
hovered_location = LOCATION_SZONE;
hovered_sequence = 7;
} else if(boardy >= matManager.vFields[74].Pos.Y && boardy <= matManager.vFields[72].Pos.Y) {
hovered_controler = 1;
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_location = LOCATION_DECK;
}
} else if(boardx >= -0.7 && boardx <= 0.1) {
if(boardy >= -2.3 && boardy <= -1.1) {
} else if(boardx >= matManager.vFields[81].Pos.X && boardx <= matManager.vFields[80].Pos.X) {
if(boardy >= matManager.vFields[82].Pos.Y && boardy <= matManager.vFields[80].Pos.Y) {
hovered_controler = 1;
hovered_location = LOCATION_SZONE;
hovered_sequence = 7;
} else if(boardy >= 1.1 && boardy <= 2.3) {
hovered_controler = 0;
hovered_location = LOCATION_SZONE;
hovered_sequence = 6;
hovered_location = LOCATION_REMOVED;
}
} else if(boardx >= 6.9 && boardx <= 7.7) {
if(boardy >= 2.4 && boardy <= 3.6) {
} else if(boardx >= matManager.vFields[0].Pos.X && boardx <= matManager.vFields[1].Pos.X) {
if(boardy >= matManager.vFields[0].Pos.Y && boardy <= matManager.vFields[2].Pos.Y) {
hovered_controler = 0;
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_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_location = LOCATION_REMOVED;
} else if(boardy >= -2.3 && boardy <= -1.1) {
hovered_location = LOCATION_SZONE;
hovered_sequence = 7;
} else if(boardy >= matManager.vFields[126].Pos.Y && boardy <= matManager.vFields[124].Pos.Y) {
hovered_controler = 1;
hovered_location = LOCATION_SZONE;
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_location = LOCATION_EXTRA;
}
} else if(boardx >= 7.8 && boardx <= 8.6) {
if(boardy >= -2.3 && boardy <= -1.1) {
hovered_controler = 1;
hovered_location = LOCATION_SZONE;
hovered_sequence = 6;
} else if(boardy >= 1.1 && boardy <= 2.3) {
} else if(boardx >= matManager.vFields[12].Pos.X && boardx <= matManager.vFields[13].Pos.X) {
if(boardy >= matManager.vFields[12].Pos.Y && boardy <= matManager.vFields[14].Pos.Y) {
hovered_controler = 0;
hovered_location = LOCATION_SZONE;
hovered_sequence = 7;
hovered_location = LOCATION_REMOVED;
}
} else if(boardx >= 1.2 && boardx <= 6.7) {
if(boardy > 1.7 && boardy <= 2.9) {
} else if(boardx >= matManager.vFields[36].Pos.X && boardx <= matManager.vFields[55].Pos.X) {
if(boardy > matManager.vFields[36].Pos.Y && boardy <= matManager.vFields[38].Pos.Y) {
hovered_controler = 0;
hovered_location = LOCATION_SZONE;
hovered_sequence = (boardx - 1.2) / 1.1;
if(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_location = LOCATION_MZONE;
hovered_sequence = (boardx - 1.2) / 1.1;
if(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_location = LOCATION_MZONE;
hovered_sequence = 4 - (int)((boardx - 1.2) / 1.1);
if(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_location = LOCATION_SZONE;
hovered_sequence = 4 - (int)((boardx - 1.2) / 1.1);
......@@ -1632,7 +1633,7 @@ void ClientField::GetHoverField(int x, int y) {
hovered_sequence = 0;
}
}
}
}
}
void ClientField::ShowMenu(int flag, int x, int y) {
if(!flag) {
......
......@@ -176,7 +176,7 @@ bool Game::Initialize() {
imgCard = env->addImage(rect<s32>(9, 9, 187, 262), wCardImg);
imgCard->setUseAlphaChannel(true);
//phase
wPhase = env->addStaticText(L"", rect<s32>(475, 310, 850, 330));
wPhase = env->addStaticText(L"", rect<s32>(455, 310, 830, 330));
wPhase->setVisible(false);
btnDP = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, -1, L"\xff24\xff30");
btnDP->setEnabled(false);
......@@ -500,7 +500,7 @@ void Game::MainLoop() {
BuildProjectionMatrix(mProjection, -0.81f, 0.44f, -0.42f, 0.42f, 1.0f, 100.0f);
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);
smgr->setAmbientLight(SColorf(1.0f, 1.0f, 1.0f));
float atkframe = 0.1f;
......
This diff is collapsed.
......@@ -273,7 +273,7 @@ uint32 card::get_type() {
return assume_value;
if(!(current.location & 0x1e))
return data.type;
if((current.location == LOCATION_SZONE) && (current.position >= 6))
if((current.location == LOCATION_SZONE) && (current.sequence >= 6))
return TYPE_PENDULUM + TYPE_SPELL;
if (temp.type != 0xffffffff)
return temp.type;
......@@ -767,14 +767,14 @@ void card::xyz_overlay(card_set* materials) {
xyz_add(pcard, &des);
} else {
field::card_vector cv;
for(auto cit : *materials)
cv.push_back(cit);
for(auto cit = materials->begin(); cit != materials->end(); ++cit)
cv.push_back(*cit);
std::sort(cv.begin(), cv.end(), card::card_operation_sort);
for(auto pcard : cv) {
pcard->reset(RESET_LEAVE + RESET_OVERLAY, RESET_EVENT);
if(pcard->unique_code)
pduel->game_field->remove_unique_card(pcard);
xyz_add(pcard, &des);
for(auto cvit = cv.begin(); cvit != cv.end(); ++cvit) {
(*cvit)->reset(RESET_LEAVE + RESET_OVERLAY, RESET_EVENT);
if((*cvit)->unique_code)
pduel->game_field->remove_unique_card(*cvit);
xyz_add(*cvit, &des);
}
}
if(des.size())
......
......@@ -105,8 +105,9 @@ void duel::release_script_group() {
sgroups.clear();
}
void duel::restore_assumes() {
for(auto pcard : assumes)
pcard->assume_type = 0;
std::set<card*>::iterator sit;
for(sit = assumes.begin(); sit != assumes.end(); ++sit)
(*sit)->assume_type = 0;
assumes.clear();
}
void duel::write_buffer32(uint32 value) {
......
......@@ -3325,7 +3325,10 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
target->overlay_target->xyz_remove(target);
move_card(playerid, target, location, target->temp.sequence);
target->current.position = returns.ivalue[0];
target->set_status(STATUS_LEAVE_CONFIRMED | STATUS_ACTIVATED, FALSE);
if((target->previous.location & LOCATION_ONFIELD) && (location & LOCATION_ONFIELD))
target->set_status(STATUS_LEAVE_CONFIRMED, FALSE);
else
target->set_status(STATUS_LEAVE_CONFIRMED | STATUS_ACTIVATED, FALSE);
pduel->write_buffer32(target->get_info_location());
pduel->write_buffer32(target->current.reason);
if((target->current.location != LOCATION_MZONE)) {
......
--ラインモンスター スピア・ホイール
function c32476434.initial_effect(c)
--lv
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32476434,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetTarget(c32476434.target)
e1:SetOperation(c32476434.operation)
c:RegisterEffect(e1)
end
function c32476434.filter(c)
return c:IsFaceup() and c:GetLevel()==3 and c:IsRace(RACE_BEASTWARRIOR)
end
function c32476434.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c32476434.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c32476434.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c32476434.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
end
function c32476434.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local lv=c:GetLevel()+tc:GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
tc:RegisterEffect(e2)
end
end
......@@ -11,7 +11,7 @@ function c50323155.initial_effect(c)
c:RegisterEffect(e1)
end
function c50323155.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
return tp~=ep and eg:GetCount()==1 and Duel.GetCurrentChain()==0
end
function c50323155.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
--天輪の葬送士
function c69865139.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(69865139,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c69865139.target)
e1:SetOperation(c69865139.operation)
c:RegisterEffect(e1)
end
function c69865139.filter(c,e,tp)
return c:GetLevel()==1 and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c69865139.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c69865139.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c69865139.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c69865139.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c69865139.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -21,7 +21,7 @@ function c71564252.initial_effect(c)
c:RegisterEffect(e2)
end
function c71564252.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
return tp~=ep and eg:GetCount()==1 and Duel.GetCurrentChain()==0
end
function c71564252.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
......@@ -34,11 +34,11 @@ function c91078716.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c91078716.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c91078716.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c91078716.condition2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -27,10 +27,10 @@ function c98069388.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c98069388.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c98069388.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
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