AVALANCHE: Missing file from previous commit
This commit is contained in:
parent
c158abc313
commit
fcd32da865
1 changed files with 23 additions and 23 deletions
|
@ -126,7 +126,7 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
|
||||||
if (spritenum == 1)
|
if (spritenum == 1)
|
||||||
_tr->newspeed(); // Just for the lights.
|
_tr->newspeed(); // Just for the lights.
|
||||||
|
|
||||||
homing = false;
|
_homing = false;
|
||||||
ix = 0;
|
ix = 0;
|
||||||
iy = 0;
|
iy = 0;
|
||||||
step = 0;
|
step = 0;
|
||||||
|
@ -205,7 +205,7 @@ void AnimationType::walk() {
|
||||||
if (!_tr->_vm->_gyro->_doingSpriteRun) {
|
if (!_tr->_vm->_gyro->_doingSpriteRun) {
|
||||||
_oldX[_tr->_vm->_gyro->_cp] = _x;
|
_oldX[_tr->_vm->_gyro->_cp] = _x;
|
||||||
_oldY[_tr->_vm->_gyro->_cp] = _y;
|
_oldY[_tr->_vm->_gyro->_cp] = _y;
|
||||||
if (homing)
|
if (_homing)
|
||||||
homestep();
|
homestep();
|
||||||
_x = _x + ix;
|
_x = _x + ix;
|
||||||
_y = _y + iy;
|
_y = _y + iy;
|
||||||
|
@ -284,27 +284,27 @@ int8 AnimationType::sgn(int16 val) {
|
||||||
void AnimationType::walkto(byte pednum) {
|
void AnimationType::walkto(byte pednum) {
|
||||||
pednum--; // Pascal -> C conversion: different array indexes.
|
pednum--; // Pascal -> C conversion: different array indexes.
|
||||||
speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - _y));
|
speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - _y));
|
||||||
hx = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
|
_homingX = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
|
||||||
hy = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
|
_homingY = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
|
||||||
homing = true;
|
_homing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationType::stophoming() {
|
void AnimationType::stophoming() {
|
||||||
homing = false;
|
_homing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationType::homestep() {
|
void AnimationType::homestep() {
|
||||||
int16 temp;
|
int16 temp;
|
||||||
|
|
||||||
if ((hx == _x) && (hy == _y)) {
|
if ((_homingX == _x) && (_homingY == _y)) {
|
||||||
// touching the target
|
// touching the target
|
||||||
stopwalk();
|
stopwalk();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ix = 0;
|
ix = 0;
|
||||||
iy = 0;
|
iy = 0;
|
||||||
if (hy != _y) {
|
if (_homingY != _y) {
|
||||||
temp = hy - _y;
|
temp = _homingY - _y;
|
||||||
if (temp > 4)
|
if (temp > 4)
|
||||||
iy = 4;
|
iy = 4;
|
||||||
else if (temp < -4)
|
else if (temp < -4)
|
||||||
|
@ -312,8 +312,8 @@ void AnimationType::homestep() {
|
||||||
else
|
else
|
||||||
iy = temp;
|
iy = temp;
|
||||||
}
|
}
|
||||||
if (hx != _x) {
|
if (_homingX != _x) {
|
||||||
temp = hx - _x;
|
temp = _homingX - _x;
|
||||||
if (temp > 4)
|
if (temp > 4)
|
||||||
ix = 4;
|
ix = 4;
|
||||||
else if (temp < -4)
|
else if (temp < -4)
|
||||||
|
@ -345,7 +345,7 @@ void AnimationType::speed(int8 xx, int8 yy) {
|
||||||
void AnimationType::stopwalk() {
|
void AnimationType::stopwalk() {
|
||||||
ix = 0;
|
ix = 0;
|
||||||
iy = 0;
|
iy = 0;
|
||||||
homing = false;
|
_homing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationType::chatter() {
|
void AnimationType::chatter() {
|
||||||
|
@ -364,15 +364,15 @@ void AnimationType::set_up_saver(trip_saver_type &v) {
|
||||||
v.ix = ix;
|
v.ix = ix;
|
||||||
v.iy = iy;
|
v.iy = iy;
|
||||||
v.visible = _visible;
|
v.visible = _visible;
|
||||||
v.homing = homing;
|
v.homing = _homing;
|
||||||
v.check_me = check_me;
|
v.check_me = check_me;
|
||||||
v.count = count;
|
v.count = count;
|
||||||
v.xw = _info._xWidth;
|
v.xw = _info._xWidth;
|
||||||
v.xs = xs;
|
v.xs = xs;
|
||||||
v.ys = ys;
|
v.ys = ys;
|
||||||
v.totalnum = totalnum;
|
v.totalnum = totalnum;
|
||||||
v.hx = hx;
|
v.hx = _homingX;
|
||||||
v.hy = hy;
|
v.hy = _homingY;
|
||||||
v.call_eachstep = call_eachstep;
|
v.call_eachstep = call_eachstep;
|
||||||
v.eachstep = eachstep;
|
v.eachstep = eachstep;
|
||||||
v.vanishifstill = vanishifstill;
|
v.vanishifstill = vanishifstill;
|
||||||
|
@ -387,15 +387,15 @@ void AnimationType::unload_saver(trip_saver_type v) {
|
||||||
ix = v.ix;
|
ix = v.ix;
|
||||||
iy = v.iy;
|
iy = v.iy;
|
||||||
_visible = v.visible;
|
_visible = v.visible;
|
||||||
homing = v.homing;
|
_homing = v.homing;
|
||||||
check_me = v.check_me;
|
check_me = v.check_me;
|
||||||
count = v.count;
|
count = v.count;
|
||||||
_info._xWidth = v.xw;
|
_info._xWidth = v.xw;
|
||||||
xs = v.xs;
|
xs = v.xs;
|
||||||
ys = v.ys;
|
ys = v.ys;
|
||||||
totalnum = v.totalnum;
|
totalnum = v.totalnum;
|
||||||
hx = v.hx;
|
_homingX = v.hx;
|
||||||
hy = v.hy;
|
_homingY = v.hy;
|
||||||
call_eachstep = v.call_eachstep;
|
call_eachstep = v.call_eachstep;
|
||||||
eachstep = v.eachstep;
|
eachstep = v.eachstep;
|
||||||
vanishifstill = v.vanishifstill;
|
vanishifstill = v.vanishifstill;
|
||||||
|
@ -1163,8 +1163,8 @@ void Animation::getback() {
|
||||||
void Animation::follow_avvy_y(byte tripnum) {
|
void Animation::follow_avvy_y(byte tripnum) {
|
||||||
if (tr[0].face == kDirLeft)
|
if (tr[0].face == kDirLeft)
|
||||||
return;
|
return;
|
||||||
if (tr[tripnum].homing)
|
if (tr[tripnum]._homing)
|
||||||
tr[tripnum].hy = tr[1]._y;
|
tr[tripnum]._homingY = tr[1]._y;
|
||||||
else {
|
else {
|
||||||
if (tr[tripnum]._y < tr[1]._y)
|
if (tr[tripnum]._y < tr[1]._y)
|
||||||
tr[tripnum]._y += 1;
|
tr[tripnum]._y += 1;
|
||||||
|
@ -1182,7 +1182,7 @@ void Animation::follow_avvy_y(byte tripnum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Animation::back_and_forth(byte tripnum) {
|
void Animation::back_and_forth(byte tripnum) {
|
||||||
if (!tr[tripnum].homing) {
|
if (!tr[tripnum]._homing) {
|
||||||
if (tr[tripnum].face == kDirRight)
|
if (tr[tripnum].face == kDirRight)
|
||||||
tr[tripnum].walkto(4);
|
tr[tripnum].walkto(4);
|
||||||
else
|
else
|
||||||
|
@ -1191,7 +1191,7 @@ void Animation::back_and_forth(byte tripnum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Animation::face_avvy(byte tripnum) {
|
void Animation::face_avvy(byte tripnum) {
|
||||||
if (!tr[tripnum].homing) {
|
if (!tr[tripnum]._homing) {
|
||||||
if (tr[0]._x >= tr[tripnum]._x)
|
if (tr[0]._x >= tr[tripnum]._x)
|
||||||
tr[tripnum].face = kDirRight;
|
tr[tripnum].face = kDirRight;
|
||||||
else
|
else
|
||||||
|
@ -1200,7 +1200,7 @@ void Animation::face_avvy(byte tripnum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Animation::arrow_procs(byte tripnum) {
|
void Animation::arrow_procs(byte tripnum) {
|
||||||
if (tr[tripnum].homing) {
|
if (tr[tripnum]._homing) {
|
||||||
// Arrow is still in flight.
|
// Arrow is still in flight.
|
||||||
// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
|
// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
|
||||||
// This is so if: a) the bottom of the arrow is below Avvy's head,
|
// This is so if: a) the bottom of the arrow is below Avvy's head,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue