Skip to content

Commit

Permalink
Fighter: Fixed more ledge recovery problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Vercillo committed Jan 17, 2010
1 parent 6012206 commit cf64468
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions SSBDS/source/fighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,18 @@ void Fighter::act() {
fall();
}
else if(Pad.Newpress.Right && direction == RIGHT) {
y = y+hangy-bottomside;
myledge = -1;
x = x + 64 - hangx - leftside;
x = x + 80 - hangx - leftside;
vector<Floor> floors = stage->getFloors();
for (uint8 n = 0; n < floors.size(); n++) {
Floor currfloor = floors[n];
double centerx = x + rightside/2.0;
double slope = currfloor.rise*1.0/currfloor.length;
double rise = (centerx-currfloor.x)*slope;
if(centerx > currfloor.x && centerx < currfloor.x + currfloor.length) {
y = currfloor.y - bottomside - rise;
}
}
idle();
}
else if(Pad.Newpress.Right && direction == LEFT) {
Expand Down Expand Up @@ -1142,23 +1151,45 @@ void Fighter::tech() {
void Fighter::rollUp() {
if (action == HANG) {
myledge = -1;
y = y + hangy - bottomside;
if (direction == LEFT) {
x = x + hangx - rightside;
}
else {
x = x + 80 - hangx - leftside;
}
vector<Floor> floors = stage->getFloors();
for (uint8 n = 0; n < floors.size(); n++) {
Floor currfloor = floors[n];
double centerx = x + rightside/2.0;
double slope = currfloor.rise*1.0/currfloor.length;
double rise = (centerx-currfloor.x)*slope;
if(centerx > currfloor.x && centerx < currfloor.x + currfloor.length) {
y = currfloor.y - bottomside - rise;
}
}
if(direction == LEFT) {
roll(LEFT);
}
else {
x = x + 64 - hangx - leftside;
roll(RIGHT);
}
}
}
void Fighter::attackUp() {
if (action == HANG) {
myledge = -1;
y = y + hangy - bottomside;
if (direction == LEFT) x = x + hangx - rightside;
else x = x + 64 - hangx - leftside;
else x = x + 80 - hangx - leftside;
vector<Floor> floors = stage->getFloors();
for (uint8 n = 0; n < floors.size(); n++) {
Floor currfloor = floors[n];
double centerx = x + rightside/2.0;
double slope = currfloor.rise*1.0/currfloor.length;
double rise = (centerx-currfloor.x)*slope;
if(centerx > currfloor.x && centerx < currfloor.x + currfloor.length) {
y = currfloor.y - bottomside - rise;
}
}
ftilt();
}
}
Expand Down

0 comments on commit cf64468

Please sign in to comment.