summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-02-14 23:37:47 +0100
committerTreeki <treeki@gmail.com>2013-02-14 23:37:47 +0100
commit206c1bb86f31ce4fba4fece7d20a08a675383d48 (patch)
tree339eb81bb7996761eb05028b6005b92d1bc3ce32 /src
parentfb3bc8d61d026ee6f7c3ec8640f022d31614987a (diff)
downloadkamek-206c1bb86f31ce4fba4fece7d20a08a675383d48.tar.gz
kamek-206c1bb86f31ce4fba4fece7d20a08a675383d48.zip
lotsa behaviour and animation changes to samurshai
Diffstat (limited to '')
-rw-r--r--src/bossSamurshai.cpp60
1 files changed, 48 insertions, 12 deletions
diff --git a/src/bossSamurshai.cpp b/src/bossSamurshai.cpp
index d765293..3a1ecc4 100644
--- a/src/bossSamurshai.cpp
+++ b/src/bossSamurshai.cpp
@@ -37,7 +37,9 @@ class daSamurshai : public daBoss {
dStageActor_c *chosenOne;
bool topHurts;
bool slowDown;
- bool isBouncing;
+ bool isBouncing;
+ bool walkStateIsCharging;
+ float amountCharged;
ActivePhysics Chuckles;
ActivePhysics Knuckles;
@@ -111,7 +113,16 @@ daSamurshai *daSamurshai::build() {
void daSamurshai::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
- char hitType = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2);
+ char hitType = 0;
+ // this is shit code
+ dStateBase_c *whatState = acState.getCurrentState();
+ if (whatState == &StateID_Damage) {
+ // nothing
+ } else if (whatState == &StateID_Walk && walkStateIsCharging) {
+ // also nothing
+ } else {
+ hitType = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2);
+ }
if (hitType == 2) {
// Mini jump
@@ -432,7 +443,7 @@ void daSamurshai::updateModelMatrices() {
this->timer += 1;
OSReport("Timer: %d", timer);
- if (timer == 230) { bindAnimChr_and_setUpdateRate("c18_H_CUT_R", 1, 0.0, 1.0); }
+ if (timer == 230) { bindAnimChr_and_setUpdateRate("c18_INTRO", 1, 0.0, 1.0); }
if ((timer > 220) && (timer < 240)) {
pos.x += (224.0 / 20.0);
@@ -462,6 +473,7 @@ void daSamurshai::updateModelMatrices() {
if (timer == 500) {
MapSoundPlayer(SoundRelatedClass, SE_BOSS_WENDY_RING_BOUND, 1);
+ walkStateIsCharging = false;
doStateChange(&StateID_Walk);
}
}
@@ -494,10 +506,12 @@ void daSamurshai::updateModelMatrices() {
Chuckles.removeFromList();
Knuckles.removeFromList();
- bindAnimChr_and_setUpdateRate("c18_RUNNING", 1, 0.0, 0.5);
+ bindAnimChr_and_setUpdateRate(walkStateIsCharging ? "c18_CHARGE" : "c18_RUNNING", 1, 0.0, 0.5);
chosenOne = GetSpecificPlayerActor(this->randomPlayer());
speed.x = (this->direction) ? -this->XSpeed : this->XSpeed;
+ if (walkStateIsCharging)
+ speed.x *= 1.7f;
this->max_speed.y = -4.0;
this->speed.y = -4.0;
@@ -512,16 +526,25 @@ void daSamurshai::updateModelMatrices() {
float yDistance = pos.y - chosenOne->pos.y;
// OSReport("Distance: %f, %f", xDistance, yDistance);
- if ((xDistance > 64.0) && (direction == 0)) { doStateChange(&StateID_Turn); }
- if ((xDistance < -64.0) && (direction == 1)) { doStateChange(&StateID_Turn); }
+ if (!walkStateIsCharging && (xDistance > 64.0) && (direction == 0)) { doStateChange(&StateID_Turn); }
+ if (!walkStateIsCharging && (xDistance < -64.0) && (direction == 1)) { doStateChange(&StateID_Turn); }
if (xDistance < 0.0) { xDistance = -xDistance; }
+ if (walkStateIsCharging) {
+ amountCharged += abs(speed.x);
+
+ // should we stop charging?
+ if (amountCharged > 480.0f) {
+ doStateChange(&StateID_ChargeSlash);
+ }
+ }
+
// Condition for Chop
- if (xDistance < 32.0) { doStateChange(&StateID_Chop); }
+ if (!walkStateIsCharging && xDistance < 32.0) { doStateChange(&StateID_Chop); }
// Condition For Charge Slash
- if (isBigBoss) {
+ if (!walkStateIsCharging && isBigBoss) {
if ((xDistance < 96.0) && (xDistance > 64.0)) {
int charge = MakeRandomNumber(100);
if (charge > 95) { doStateChange(&StateID_ChargeSlash); }
@@ -529,7 +552,7 @@ void daSamurshai::updateModelMatrices() {
}
// Aerial Attacks!
- if (yDistance < -24.0) {
+ if (!walkStateIsCharging && yDistance < -24.0) {
// Condition For Spin Attack
// if (xDistance < 32.0) { doStateChange(&StateID_SpinAttack); }
@@ -615,6 +638,7 @@ void daSamurshai::updateModelMatrices() {
if(this->chrAnimation.isAnimationDone()) {
timer += 1;
if (timer > 45) {
+ walkStateIsCharging = false;
doStateChange(&StateID_Walk);
}
}
@@ -633,7 +657,11 @@ void daSamurshai::updateModelMatrices() {
void daSamurshai::executeState_ChargeSlash() {
// End if the animation is finally over
- if ((chrAnimation.isAnimationDone()) && (slowDown) ) { doStateChange(&StateID_Walk); return; }
+ if ((chrAnimation.isAnimationDone()) && (slowDown) ) {
+ walkStateIsCharging = false;
+ doStateChange(&StateID_Walk);
+ return;
+ }
// What to do if he hits a wall
bool ret = calculateTileCollisions();
@@ -715,6 +743,7 @@ void daSamurshai::updateModelMatrices() {
if ((slowDown) && (this->chrAnimation.isAnimationDone())) {
timer++;
if (timer > 45) {
+ walkStateIsCharging = false;
doStateChange(&StateID_Walk);
}
}
@@ -809,7 +838,10 @@ void daSamurshai::updateModelMatrices() {
else { Knuckles.removeFromList(); }
}
- if ((this->chrAnimation.isAnimationDone()) && (speed.y == 0.0)) { doStateChange(&StateID_Walk); }
+ if ((this->chrAnimation.isAnimationDone()) && (speed.y == 0.0)) {
+ walkStateIsCharging = false;
+ doStateChange(&StateID_Walk);
+ }
bool ret = calculateTileCollisions();
@@ -848,7 +880,11 @@ void daSamurshai::updateModelMatrices() {
if (this->chrAnimation.isAnimationDone()) {
if (timer == 0) { bindAnimChr_and_setUpdateRate("c18_L_DMG_F_3_R", 1, 0.0, 1.0); timer = 1; }
else if (timer == 1) { bindAnimChr_and_setUpdateRate("c18_L_DMG_F_4_R", 1, 0.0, 1.0); timer = 2; }
- else if (timer == 2) { doStateChange(&StateID_Walk); }
+ else if (timer == 2) {
+ walkStateIsCharging = true;
+ amountCharged = 0.0f;
+ doStateChange(&StateID_Walk);
+ }
}
}
void daSamurshai::endState_Damage() {