conveyor: only push people/object on a conveyor + use the real flag: flag1
This commit is contained in:
@@ -892,7 +892,7 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon
|
|||||||
////
|
////
|
||||||
which_m = &univ.town.monst[which_monst];
|
which_m = &univ.town.monst[which_monst];
|
||||||
ter_abil = univ.scenario.ter_types[ter].special;
|
ter_abil = univ.scenario.ter_types[ter].special;
|
||||||
ter_dir = univ.scenario.ter_types[ter].flag3;
|
ter_dir = univ.scenario.ter_types[ter].flag1;
|
||||||
|
|
||||||
if(mode > 0 && ter_abil == eTerSpec::CONVEYOR) {
|
if(mode > 0 && ter_abil == eTerSpec::CONVEYOR) {
|
||||||
if(
|
if(
|
||||||
|
@@ -183,10 +183,10 @@ bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,
|
|||||||
// TODO: Why not support conveyors outdoors, too?
|
// TODO: Why not support conveyors outdoors, too?
|
||||||
if(mode != eSpecCtx::OUT_MOVE && ter_special == eTerSpec::CONVEYOR) {
|
if(mode != eSpecCtx::OUT_MOVE && ter_special == eTerSpec::CONVEYOR) {
|
||||||
if(
|
if(
|
||||||
((ter_flag3 == DIR_N) && (where_check.y > from_loc.y)) ||
|
((ter_flag1 == DIR_N) && (where_check.y > from_loc.y)) ||
|
||||||
((ter_flag3 == DIR_E) && (where_check.x < from_loc.x)) ||
|
((ter_flag1 == DIR_E) && (where_check.x < from_loc.x)) ||
|
||||||
((ter_flag3 == DIR_S) && (where_check.y < from_loc.y)) ||
|
((ter_flag1 == DIR_S) && (where_check.y < from_loc.y)) ||
|
||||||
((ter_flag3 == DIR_W) && (where_check.x > from_loc.x)) ) {
|
((ter_flag1 == DIR_W) && (where_check.x > from_loc.x)) ) {
|
||||||
ASB("The moving floor prevents you.");
|
ASB("The moving floor prevents you.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1670,11 +1670,13 @@ void push_things() {
|
|||||||
if(univ.town.monst[i].active > 0) {
|
if(univ.town.monst[i].active > 0) {
|
||||||
l = univ.town.monst[i].cur_loc;
|
l = univ.town.monst[i].cur_loc;
|
||||||
ter = univ.town->terrain(l.x,l.y);
|
ter = univ.town->terrain(l.x,l.y);
|
||||||
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
if (univ.scenario.ter_types[ter].special==eTerSpec::CONVEYOR) {
|
||||||
case DIR_N: l.y--; break;
|
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
||||||
case DIR_E: l.x++; break;
|
case DIR_N: l.y--; break;
|
||||||
case DIR_S: l.y++; break;
|
case DIR_E: l.x++; break;
|
||||||
case DIR_W: l.x--; break;
|
case DIR_S: l.y++; break;
|
||||||
|
case DIR_W: l.x--; break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(l != univ.town.monst[i].cur_loc) {
|
if(l != univ.town.monst[i].cur_loc) {
|
||||||
univ.town.monst[i].cur_loc = l;
|
univ.town.monst[i].cur_loc = l;
|
||||||
@@ -1687,11 +1689,13 @@ void push_things() {
|
|||||||
if(univ.town.items[i].variety != eItemType::NO_ITEM) {
|
if(univ.town.items[i].variety != eItemType::NO_ITEM) {
|
||||||
l = univ.town.items[i].item_loc;
|
l = univ.town.items[i].item_loc;
|
||||||
ter = univ.town->terrain(l.x,l.y);
|
ter = univ.town->terrain(l.x,l.y);
|
||||||
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
if (univ.scenario.ter_types[ter].special==eTerSpec::CONVEYOR) {
|
||||||
case DIR_N: l.y--; break;
|
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
||||||
case DIR_E: l.x++; break;
|
case DIR_N: l.y--; break;
|
||||||
case DIR_S: l.y++; break;
|
case DIR_E: l.x++; break;
|
||||||
case DIR_W: l.x--; break;
|
case DIR_S: l.y++; break;
|
||||||
|
case DIR_W: l.x--; break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(l != univ.town.items[i].item_loc) {
|
if(l != univ.town.items[i].item_loc) {
|
||||||
univ.town.items[i].item_loc = l;
|
univ.town.items[i].item_loc = l;
|
||||||
@@ -1704,11 +1708,13 @@ void push_things() {
|
|||||||
if(is_town()) {
|
if(is_town()) {
|
||||||
ter = univ.town->terrain(univ.party.town_loc.x,univ.party.town_loc.y);
|
ter = univ.town->terrain(univ.party.town_loc.x,univ.party.town_loc.y);
|
||||||
l = univ.party.town_loc;
|
l = univ.party.town_loc;
|
||||||
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
if (univ.scenario.ter_types[ter].special==eTerSpec::CONVEYOR) {
|
||||||
case DIR_N: l.y--; break;
|
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
||||||
case DIR_E: l.x++; break;
|
case DIR_N: l.y--; break;
|
||||||
case DIR_S: l.y++; break;
|
case DIR_E: l.x++; break;
|
||||||
case DIR_W: l.x--; break;
|
case DIR_S: l.y++; break;
|
||||||
|
case DIR_W: l.x--; break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(l != univ.party.town_loc) {
|
if(l != univ.party.town_loc) {
|
||||||
// TODO: Will this push you into a placed forcecage or barrier? Should it?
|
// TODO: Will this push you into a placed forcecage or barrier? Should it?
|
||||||
@@ -1744,11 +1750,13 @@ void push_things() {
|
|||||||
if(univ.party[i].main_status == eMainStatus::ALIVE) {
|
if(univ.party[i].main_status == eMainStatus::ALIVE) {
|
||||||
ter = univ.town->terrain(univ.party[i].combat_pos.x,univ.party[i].combat_pos.y);
|
ter = univ.town->terrain(univ.party[i].combat_pos.x,univ.party[i].combat_pos.y);
|
||||||
l = univ.party[i].combat_pos;
|
l = univ.party[i].combat_pos;
|
||||||
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
if (univ.scenario.ter_types[ter].special==eTerSpec::CONVEYOR) {
|
||||||
case DIR_N: l.y--; break;
|
switch(univ.scenario.ter_types[ter].flag1) { // TODO: Implement the other 4 possible directions
|
||||||
case DIR_E: l.x++; break;
|
case DIR_N: l.y--; break;
|
||||||
case DIR_S: l.y++; break;
|
case DIR_E: l.x++; break;
|
||||||
case DIR_W: l.x--; break;
|
case DIR_S: l.y++; break;
|
||||||
|
case DIR_W: l.x--; break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(l != univ.party[i].combat_pos) {
|
if(l != univ.party[i].combat_pos) {
|
||||||
ASB("Someone gets pushed.");
|
ASB("Someone gets pushed.");
|
||||||
|
Reference in New Issue
Block a user