summaryrefslogtreecommitdiff
path: root/src/shyguy.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-07-11 02:34:29 -0500
committerColin Noga <Tempus@chronometry.ca>2012-07-11 02:34:29 -0500
commitc6461149389ec807371b9692b7484ab108e2a068 (patch)
tree5d2624e4d61ab5f4e8c1472fcb6733d612d4e071 /src/shyguy.cpp
parentab412589662152c99c1653be980136912bcde4f3 (diff)
downloadkamek-c6461149389ec807371b9692b7484ab108e2a068.tar.gz
kamek-c6461149389ec807371b9692b7484ab108e2a068.zip
Plenty of bugfixes, and bowser improvements
Diffstat (limited to '')
-rw-r--r--src/shyguy.cpp53
1 files changed, 34 insertions, 19 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index 8f311de..6ea3567 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -69,6 +69,7 @@ class daShyGuy : public dEn_c {
float balloonSize;
char backFire;
char spikeTurn;
+ int directionStore;
dStageActor_c *spikeA;
dStageActor_c *spikeB;
@@ -216,6 +217,12 @@ daShyGuy *daShyGuy::build() {
deathState = &StateID_Die;
}
+ // fix multiple player collisions via megazig
+ this->isDead = 0;
+ this->flags_4FC |= (1<<(31-7));
+ this->counter_504[apOther->owner->which_player] = 0;
+
+
char hitType;
if (this->isDown == 0) {
hitType = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2);
@@ -231,7 +238,9 @@ daShyGuy *daShyGuy::build() {
doStateChange(stateVar);
}
else { // Shy Guy is in throwy mode - kill it with fire
+ this->playEnemyDownSound1();
doStateChange(deathState);
+ this->isDead = 1;
}
}
else if(hitType == 3) { // spinning jump or whatever?
@@ -241,7 +250,9 @@ daShyGuy *daShyGuy::build() {
doStateChange(stateVar);
}
else { // Shy Guy is in throwy mode - kill it with fire
+ this->playEnemyDownSound1();
doStateChange(deathState);
+ this->isDead = 1;
}
}
else if(hitType == 0) {
@@ -251,10 +262,6 @@ daShyGuy *daShyGuy::build() {
// else if(hitType == 2) { \\ Minimario? }
- // fix multiple player collisions via megazig
- this->isDead = 0;
- this->flags_4FC |= (1<<(31-7));
- this->counter_504[apOther->owner->which_player] = 0;
}
void daShyGuy::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -278,6 +285,7 @@ daShyGuy *daShyGuy::build() {
}
void daShyGuy::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){
+ dEn_c::collisionCat3_StarPower(apThis, apOther);
doStateChange(&StateID_Die);
}
@@ -296,10 +304,16 @@ daShyGuy *daShyGuy::build() {
if (this->type < 6) { // Regular Shy Guys Except Jumper
- if (this->pos.x < apOther->owner->pos.x) { this->backFire = 0; } // Fire is to the right
- else { this->backFire = 1; } // Fire is to the left
+ if (this->pos.x < apOther->owner->pos.x) { this->backFire = 0; OSReport("Fire is to the right"); } // Fire is to the right
+ else { this->backFire = 1; OSReport("Fire is to the left"); } // Fire is to the left
- stateVar = &StateID_FireKnockBack;
+ if (this->isDown == 0) {
+ stateVar = &StateID_FireKnockBack;
+ }
+ else {
+ doStateChange(&StateID_DieSmoke);
+ this->_vf14C();
+ }
}
else if (this->type > 8) { // Giants
return;
@@ -530,7 +544,7 @@ int daShyGuy::onCreate() {
this->scale = (Vec){20.0, 20.0, 20.0};
- this->pos.y = this->pos.y + 30.0; // X is vertical axis
+ this->pos.y = this->pos.y + 40.0;
this->rot.x = 0; // X is vertical axis
this->rot.y = 0xD800; // Y is horizontal axis
this->rot.z = 0; // Z is ... an axis >.>
@@ -541,7 +555,7 @@ int daShyGuy::onCreate() {
this->max_speed.x = 0.8;
this->x_speed_inc = 0.2;
this->Baseline = this->pos.y;
- this->XSpeed = 0.8;
+ this->XSpeed = 0.6;
this->balloonSize = 1.5;
@@ -756,7 +770,7 @@ void daShyGuy::updateModelMatrices() {
}
void daShyGuy::executeState_Walk() {
- this->pos.x += (direction) ? -0.5 : 0.5;
+ this->pos.x += (direction) ? -0.4 : 0.4;
if (this->timer > (this->distance * 32)) {
doStateChange(&StateID_Turn);
@@ -1173,7 +1187,7 @@ void daShyGuy::updateModelMatrices() {
void daShyGuy::beginState_RealWalk() {
//inline this piece of code
this->max_speed.x = (this->direction) ? -this->XSpeed : this->XSpeed;
- this->speed.x = (direction) ? -0.8f : 0.8f;
+ this->speed.x = (direction) ? -0.6f : 0.6f;
this->max_speed.y = -4.0;
this->speed.y = -4.0;
@@ -1331,15 +1345,17 @@ void daShyGuy::updateModelMatrices() {
void daShyGuy::beginState_FireKnockBack() {
bindAnimChr_and_setUpdateRate("c18_C_BLOCK_BREAK_R", 1, 0.0, 1.0);
- // if (this->backFire == 0) { this->direction ^= 1; }
- // else { this->backFire = 0; }
-
- this->speed.x = (this->backFire) ? this->XSpeed / 6.0f : -this->XSpeed / 6.0f;
+ // Backfire 0 == Fireball to the right
+ // Backfire 1 == Fireball to the left
+
+ directionStore = this->direction;
+ this->speed.x = (this->backFire) ? this->XSpeed : -this->XSpeed;
}
void daShyGuy::executeState_FireKnockBack() {
calculateTileCollisions();
// move backwards here
+ this->speed.x = this->speed.x / 1.02f;
if(this->chrAnimation.isAnimationDone()) {
bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
@@ -1347,9 +1363,7 @@ void daShyGuy::updateModelMatrices() {
}
}
void daShyGuy::endState_FireKnockBack() {
- // this->direction ^= 1;
- speed.x = (direction) ? -1.0f : 1.0f;
- this->max_speed.x = (direction) ? -this->XSpeed : this->XSpeed;
+ this->direction = directionStore;
}
///////////////
@@ -1398,7 +1412,7 @@ void daShyGuy::updateModelMatrices() {
// Die State
///////////////
void daShyGuy::beginState_Die() {
- dEn_c::dieFall_Begin();
+ // dEn_c::dieFall_Begin();
bindAnimChr_and_setUpdateRate("c18_C_BLOCK_BREAK_R", 1, 0.0, 2.0);
this->timer = 0;
@@ -1426,6 +1440,7 @@ void daShyGuy::updateModelMatrices() {
this->dying += 0.5;
if (this->timer > 450) {
+ OSReport("Killing");
this->kill();
this->Delete(this->deleteForever);
}