summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-07-16 15:18:58 -0500
committerColin Noga <Tempus@chronometry.ca>2012-07-16 15:18:58 -0500
commit5ad897fb987c7e80ac948cf080122a0081a255de (patch)
treede31190d6498860abc90dd56e374f66dcfe9f03e
parent85ffcf8e57ab7a90318b8e24f62257b5393f7330 (diff)
downloadkamek-5ad897fb987c7e80ac948cf080122a0081a255de.tar.gz
kamek-5ad897fb987c7e80ac948cf080122a0081a255de.zip
Samurai Shy is in beta, added Song Block as a sprite, a few minor boss fixes.
-rw-r--r--kamek_pal.x2
-rw-r--r--singAlong.yaml14
-rw-r--r--src/bonusRoom.cpp31
-rw-r--r--src/boss.cpp12
-rw-r--r--src/bossFuzzyBear.cpp4
-rw-r--r--src/bossMegaGoomba.cpp10
-rw-r--r--src/bossSamurshai.cpp376
7 files changed, 289 insertions, 160 deletions
diff --git a/kamek_pal.x b/kamek_pal.x
index b8d992d..21eef94 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -13,7 +13,9 @@ SECTIONS {
sAllocatorFunc__FrmHeap = 0x8042E5B0;
GetActivePlayerCount = 0x8005FFB0;
+ GetCountofActivePlayers = 0x8005FFB0;
GetActiveLivingPlayerCount = 0x8005FEF0;
+
getEffectiveScreenLeft__19ClassWithCameraInfoFv = 0x80082240;
instance__19ClassWithCameraInfo = 0x8042A0E0;
diff --git a/singAlong.yaml b/singAlong.yaml
index 0641aa4..bfaee23 100644
--- a/singAlong.yaml
+++ b/singAlong.yaml
@@ -39,6 +39,20 @@ hooks:
src_addr_pal: 0x809834F0
target_func: 'dSongBlock::build(void)'
+ - name: UpdateSingAlongSpriteInfo
+ type: patch
+ addr_pal: 0x8030A5E8
+ data: '0275 0000 00000010 00000010 00000000 00000000 00000040 00000040 0000 0000 0040 0040 0000 0000'
+ # 0x8030A340 + sprite num * 0x28 == offset
+
+ - name: SingAlongSpriteFileInfo
+ type: add_func_pointer
+ src_addr_pal: 0x8031AB90
+ target_func: 'SAarcNameList'
+
+ # 0x8031AB4C + sprite num * 0x4 == offset
+ # That offset stores a pointer to a table of pointers to strings, followed by four bytes of padding
+ # Each string is an arcname to load
################################################
# HOOKS FOR Song Prize
diff --git a/src/bonusRoom.cpp b/src/bonusRoom.cpp
index 8242d43..2b0144d 100644
--- a/src/bonusRoom.cpp
+++ b/src/bonusRoom.cpp
@@ -432,6 +432,8 @@ public:
int isGlowing;
int glowTimer;
int isDead;
+ int standAlone;
+ int item;
void calledWhenUpMoveExecutes();
void calledWhenDownMoveExecutes();
@@ -917,7 +919,9 @@ dSongBlock *dSongBlock::build() {
int dSongBlock::onCreate() {
// Settings
- this->note = this->settings;
+ this->note = this->settings & 0xF;
+ this->standAlone = (this->settings >> 4) & 0xF;
+ this->item = (this->settings >> 16) & 0xFF;
// Model creation
allocator.link(-1, GameHeaps[0], 0, 0x20);
@@ -1067,7 +1071,30 @@ void dSongBlock::blockWasHit(bool isDown) {
SpawnEffect("Wm_en_vshit_ring", 0, &(Vec){pos.x, pos.y+8.0, pos.z-100.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
SpawnEffect("Wm_ob_keyget02_lighit", 0, &(Vec){pos.x, pos.y+8.0, pos.z-100.0}, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
- dSingAlong::instance->RegisterNote(this->note);
+ if (item > 0) {
+ create(EN_ITEM, item, &(Vec){pos.x, pos.y, pos.z}, &rot, 0);
+ }
+
+ if (standAlone) {
+
+ int play;
+ // C, C#, D, D#, E, F, F#, G, G#, A, A#, B
+
+ if (note == 0) { play = 12; }
+ else if (note == 1) { play = 12; }
+ else if (note == 2) { play = 14; }
+ else if (note == 3) { play = 16; }
+ else if (note == 4) { play = 17; }
+ else if (note == 5) { play = 19; }
+ else if (note == 6) { play = 21; }
+ else if (note == 7) { play = 23; }
+ else if (note == 8) { play = 0; }
+
+ PlaySoundAsync(this, Notes[play]);
+ }
+ else {
+ dSingAlong::instance->RegisterNote(this->note);
+ }
physics.setup(this, &physicsInfo, 3, currentLayerID);
physics.addToList();
diff --git a/src/boss.cpp b/src/boss.cpp
index a8a1a48..057d98b 100644
--- a/src/boss.cpp
+++ b/src/boss.cpp
@@ -46,14 +46,14 @@ void SetupKameck(daBoss *actor, daKameckDemo *Kameck) {
void CleanupKameck(daBoss *actor, daKameckDemo *Kameck) {
- // Clean up the flags and Kameck
- dStage32C_c::instance->freezeMarioBossFlag = 0;
- WLClass::instance->_8 = 1;
+ // Clean up the flags and Kameck
+ dStage32C_c::instance->freezeMarioBossFlag = 0;
+ WLClass::instance->_8 = 1;
- MakeMarioExitDemoMode();
- StartBGMMusic();
+ MakeMarioExitDemoMode();
+ StartBGMMusic();
- actor->Kameck->Delete(1);
+ actor->Kameck->Delete(1);
}
diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp
index af7699d..b9312a8 100644
--- a/src/bossFuzzyBear.cpp
+++ b/src/bossFuzzyBear.cpp
@@ -328,8 +328,8 @@ void daFuzzyBear_c::endState_Grow() {
void daFuzzyBear_c::beginState_Bounce() {
- if (this->direction = 0) { this->speed.x = 1.5; }
- else { this->speed.x = -1.5 ; }
+ if (this->direction = 0) { this->speed.x = 1.0; }
+ else { this->speed.x = -1.0; }
if (this->storeSpeed != 0) { this->speed.x = this->storeSpeed; }
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp
index 0029f10..d06df68 100644
--- a/src/bossMegaGoomba.cpp
+++ b/src/bossMegaGoomba.cpp
@@ -116,15 +116,15 @@ class daMegaGoomba_c : public dEn_c {
void _vf108(ActivePhysics *apThis, ActivePhysics *apOther);
USING_STATES(daMegaGoomba_c);
- DECLARE_STATE(Grow);
+ // DECLARE_STATE(Grow);
DECLARE_STATE(Shrink);
DECLARE_STATE(Walk);
DECLARE_STATE(Turn);
DECLARE_STATE(Jump);
DECLARE_STATE(Launch);
- DECLARE_STATE(Kameck);
- DECLARE_STATE(Outro);
+ // DECLARE_STATE(Kameck);
+ // DECLARE_STATE(Outro);
};
u8 struct_1[] = { 0, 0, 0, 1, 0xff, 0xff, 0x40, 0, 0, 0, 0xc0, 0, 0, 0, 0, 0 };
@@ -143,13 +143,13 @@ extern "C" void DoStuffAndMarkDead(dStageActor_c *actor, Vec vector, float unk);
extern "C" int SmoothRotation(short* rot, u16 amt, int unk2);
-CREATE_STATE(daMegaGoomba_c, Grow);
+// CREATE_STATE(daMegaGoomba_c, Grow);
CREATE_STATE(daMegaGoomba_c, Shrink);
CREATE_STATE(daMegaGoomba_c, Walk);
CREATE_STATE(daMegaGoomba_c, Turn);
CREATE_STATE(daMegaGoomba_c, Jump);
CREATE_STATE(daMegaGoomba_c, Launch);
-CREATE_STATE(daMegaGoomba_c, Outro);
+// CREATE_STATE(daMegaGoomba_c, Outro);
//TODO better fix for possible bug with sign (ex. life=120; count=-9;)
diff --git a/src/bossSamurshai.cpp b/src/bossSamurshai.cpp
index fb906c2..6bcabb5 100644
--- a/src/bossSamurshai.cpp
+++ b/src/bossSamurshai.cpp
@@ -9,7 +9,7 @@ const char* SSarcNameList [] = {
NULL
};
-void ChucklesAndKnuckles(ActivePhysics *apThis, ActivePhysics *apOther);
+void ChucksAndKnucks(ActivePhysics *apThis, ActivePhysics *apOther);
class daSamurshai : public daBoss {
int onCreate();
@@ -25,9 +25,7 @@ class daSamurshai : public daBoss {
mEf::es2 effect;
int isBigBoss;
- int timer;
int jumpCounter;
- char damage;
char isDown;
Vec initialPos;
float XSpeed;
@@ -46,7 +44,6 @@ class daSamurshai : public daBoss {
void updateModelMatrices();
bool calculateTileCollisions();
- // void spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther);
@@ -61,8 +58,7 @@ class daSamurshai : public daBoss {
void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther);
- void _vf148();
- void _vf14C();
+ void addScoreWhenHit(void *other);
int randomPlayer();
USING_STATES(daSamurshai);
@@ -103,7 +99,7 @@ daSamurshai *daSamurshai::build() {
// Collision Functions
////////////////////////
- void ChucklesAndKnuckles(ActivePhysics *apThis, ActivePhysics *apOther) {
+ void ChucksAndKnucks(ActivePhysics *apThis, ActivePhysics *apOther) {
((dEn_c*)apThis->owner)->_vf220(apOther->owner);
}
@@ -192,6 +188,9 @@ daSamurshai *daSamurshai::build() {
if (damage > 15) { doStateChange(&StateID_Outro); }
}
+
+ void daSamurshai::addScoreWhenHit(void *other) { }
+
bool daSamurshai::calculateTileCollisions() {
// Returns true if sprite should turn, false if not.
@@ -208,32 +207,14 @@ daSamurshai *daSamurshai::build() {
isBouncing = false;
}
- float xDelta = pos.x - last_pos.x;
- if (xDelta >= 0.0f)
- direction = 0;
- else
- direction = 1;
-
if (collMgr.CollidedWithTile()) {
// Walking into a tile branch
if (cmgr_returnValue == 0)
isBouncing = true;
- if (speed.x != 0.0f) {
- //playWmEnIronEffect();
- }
-
speed.y = 0.0f;
-
- // u32 blah = collMgr.s_80070760();
- // u8 one = (blah & 0xFF);
- // static const float incs[5] = {0.00390625f, 0.0078125f, 0.015625f, 0.0234375f, 0.03125f};
- // x_speed_inc = incs[one];
- max_speed.x = (direction == 1) ? -1.0f : 1.0f;
- } else {
- x_speed_inc = 0.0f;
- }
+ }
// Bouncing checks
if (_34A & 4) {
@@ -277,7 +258,7 @@ int daSamurshai::onCreate() {
allocator.link(-1, GameHeaps[0], 0, 0x20);
this->resFile.data = getResource("Shynja", "g3d/Shynja.brres");
- nw4r::g3d::ResMdl mdl = this->resFile.GetResMdl("Model");
+ nw4r::g3d::ResMdl mdl = this->resFile.GetResMdl("Shynja");
bodyModel.setup(mdl, &allocator, 0x224, 1, 0);
// Animations start here
@@ -288,29 +269,29 @@ int daSamurshai::onCreate() {
// Character Setup
- scale = (Vec){20.0, 20.0, 20.0};
+ scale = (Vec){25.0, 25.0, 25.0};
- pos.y = pos.y + 40.0;
- rot.x = 0; // X is vertical axis
- rot.y = 0xD800; // Y is horizontal axis
- rot.z = 0; // Z is ... an axis >.>
- direction = 1; // Heading left.
-
- speed.x = 0.0;
- speed.y = 0.0;
- XSpeed = 2.0;
- x_speed_inc = 0.2;
- initialPos = pos;
- topHurts = false;
+ pos.y = pos.y - 16.0 * 3.0;
+ rot.x = 0; // X is vertical axis
+ rot.y = 0xD800; // Y is horizontal axis
+ rot.z = 0; // Z is ... an axis >.>
+ direction = 1; // Heading left.
+
+ speed.x = 0.0;
+ speed.y = 0.0;
+ XSpeed = 2.0;
+ max_speed.x = 50.0;
+ initialPos = pos;
+ topHurts = false;
// Physics
ActivePhysics::Info HitMeBaby;
HitMeBaby.xDistToCenter = 0.0;
- HitMeBaby.yDistToCenter = 12.0;
+ HitMeBaby.yDistToCenter = 15.0;
- HitMeBaby.xDistToEdge = 14.0;
- HitMeBaby.yDistToEdge = 12.0;
+ HitMeBaby.xDistToEdge = 18.0;
+ HitMeBaby.yDistToEdge = 15.0;
HitMeBaby.category1 = 0x3;
HitMeBaby.category2 = 0x0;
@@ -325,10 +306,10 @@ int daSamurshai::onCreate() {
// Tile collider
// These fucking rects do something for the tile rect
- spriteSomeRectX = 28.0f;
- spriteSomeRectY = 32.0f;
+ spriteSomeRectX = 48.0f;
+ spriteSomeRectY = 36.0f;
_320 = 0.0f;
- _324 = 16.0f;
+ _324 = 18.0f;
// These structs tell stupid collider what to collide with - these are from koopa troopa
static const u8 one[16] = {0,0,0,1, 0,0,0xC0,0, 0,0,0x40,0, 0,0,0,0};
@@ -351,21 +332,20 @@ int daSamurshai::onCreate() {
ActivePhysics::Info iKnuckles;
iChuckles.xDistToCenter = -27.0;
- iChuckles.yDistToCenter = 12.0;
+ iChuckles.yDistToCenter = 8.0;
iChuckles.xDistToEdge = 27.0;
- iChuckles.yDistToEdge = 10.0;
+ iChuckles.yDistToEdge = 6.0;
iKnuckles.xDistToCenter = 27.0;
- iKnuckles.yDistToCenter = 12.0;
+ iKnuckles.yDistToCenter = 8.0;
iKnuckles.xDistToEdge = 27.0;
- iKnuckles.yDistToEdge = 10.0;
+ iKnuckles.yDistToEdge = 6.0;
- iKnuckles.category1 = iChuckles.category1 = 0x3;
- iKnuckles.category2 = iChuckles.category2 = 0x0;
+ iKnuckles.category1 = iChuckles.category1 = 0x3; iKnuckles.category2 = iChuckles.category2 = 0x0;
iKnuckles.bitfield1 = iChuckles.bitfield1 = 0x4F;
iKnuckles.bitfield2 = iChuckles.bitfield2 = 0x6;
iKnuckles.unkShort1C = iChuckles.unkShort1C = 0x0;
- iKnuckles.callback = iChuckles.callback = ChucklesAndKnuckles;
+ iKnuckles.callback = iChuckles.callback = ChucksAndKnucks;
Chuckles.initWithStruct(this, &iChuckles);
Knuckles.initWithStruct(this, &iKnuckles);
@@ -393,7 +373,7 @@ int daSamurshai::onDraw() {
}
void daSamurshai::updateModelMatrices() {
// This won't work with wrap because I'm lazy.
- matrix.translation(pos.x, pos.y - 2.0, pos.z);
+ matrix.translation(pos.x, pos.y + 0.0, pos.z);
matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
bodyModel.setDrawMatrix(matrix);
@@ -408,22 +388,80 @@ void daSamurshai::updateModelMatrices() {
void daSamurshai::beginState_Intro() {
this->timer = 0;
- SetupKameck(this, Kameck);
+ // Stop the BGM Music
+ StopBGMMusic();
+
+ // Set the necessary Flags and make Mario enter Demo Mode
+ dStage32C_c::instance->freezeMarioBossFlag = 1;
+ WLClass::instance->_4 = 4;
+ WLClass::instance->_8 = 0;
+
+ MakeMarioEnterDemoMode();
+
+ // Make sure to use the correct position
+ Vec KamekPos = (Vec){pos.x - 124.0, pos.y + 104.0, 3564.0};
+ S16Vec KamekRot = (S16Vec){0, 0, 0};
+
+ rot.y = 0x2800; // Y is horizontal axis
+ speed.x = 0.0;
+ speed.y = 0.0;
+
+ pos.x = pos.x - 224.0;
+ pos.y = pos.y + 320.0;
+
+ // Create And use Kameck
+ Kameck = (daKameckDemo*)createChild(KAMECK_FOR_CASTLE_DEMO, (dStageActor_c*)this, 0, &KamekPos, &KamekRot, 0);
+ Kameck->doStateChange(&daKameckDemo::StateID_DemoSt);
+ Kameck->pos.x = Kameck->pos.x - 32.0;
}
void daSamurshai::executeState_Intro() {
this->timer += 1;
-
- bool ret;
- ret = GrowBoss(this, Kameck, 1.0, 5.0, 0, this->timer);
- if (ret) {
- PlaySound(this, SE_EMY_KURI_CHANGE_BIG);
+ OSReport("Timer: %d", timer);
+ if (timer == 130) { bindAnimChr_and_setUpdateRate("c18_H_CUT_R", 1, 0.0, 1.0); }
+
+ if ((timer > 120) && (timer < 140)) {
+ pos.x += (224.0 / 20.0);
+ pos.y -= (320.0 / 20.0);
+ }
+
+ if (timer == 130) {
+ SpawnEffect("Wm_en_hanapetal", 0, &pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5});
+ SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){8.0, 0.1, 1.5});
+ PlaySound(this, SE_EMY_SR_KILLER_SHOT);
+ this->Kameck->doStateChange(&daKameckDemo::StateID_DieFall);
+ }
+
+ if ((timer > 130) && (timer < 190)) {
+ Kameck->pos.x += (200.0 / 60.0);
+ Kameck->pos.y -= (260.0 / 60.0);
+ }
+
+ int done = 0;
+ if ((timer > 260) && (done == 0)) {
+ u16 amt = (this->direction == 0) ? 0x2800 : 0xD800;
+ done = SmoothRotation(&this->rot.y, amt, 0x2000);
+ }
+
+ if (timer == 340) { bindAnimChr_and_setUpdateRate("c18_IDLE_R", 1, 0.0, 1.0); }
+
+
+ // if (timer == 130) { actor->Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); }
+ // if (timer == 400) { actor->Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); }
+
+ if (timer == 430) {
+ // PlaySound(this, SE_EMY_KURI_CHANGE_BIG);
doStateChange(&StateID_Walk);
}
}
void daSamurshai::endState_Intro() {
CleanupKameck(this, Kameck);
+
+ rot.y = 0xD800; // Y is horizontal axis
+ direction = 1; // Heading left.
+ XSpeed = 2.0;
+ max_speed.x = 50.0;
}
///////////////
@@ -443,24 +481,23 @@ void daSamurshai::updateModelMatrices() {
}
void daSamurshai::beginState_Walk() {
- bindAnimChr_and_setUpdateRate("c18_IDLE_R2", 1, 0.0, 2.0);
-
+ bindAnimChr_and_setUpdateRate("c18_RUNNING", 1, 0.0, 0.5);
chosenOne = GetSpecificPlayerActor(this->randomPlayer());
- this->max_speed.x = (this->direction) ? -this->XSpeed : this->XSpeed;
- this->speed.x = (direction) ? -0.6f : 0.6f;
- x_speed_inc = 0.2;
+ speed.x = (this->direction) ? -this->XSpeed : this->XSpeed;
this->max_speed.y = -4.0;
this->speed.y = -4.0;
this->y_speed_inc = -0.1875;
+
+ OSReport("Speed: %f / %f", speed.x, max_speed.x);
}
void daSamurshai::executeState_Walk() {
float xDistance = pos.x - chosenOne->pos.x;
float yDistance = pos.y - chosenOne->pos.y;
- OSReport("Distance: %f, %f", xDistance, yDistance);
+ // OSReport("Distance: %f, %f", xDistance, yDistance);
if ((xDistance > 64.0) && (direction == 0)) { doStateChange(&StateID_Turn); }
if ((xDistance < -64.0) && (direction == 1)) { doStateChange(&StateID_Turn); }
@@ -473,21 +510,21 @@ void daSamurshai::updateModelMatrices() {
if (isBigBoss) {
if ((xDistance < 96.0) && (xDistance > 64.0)) {
int charge = MakeRandomNumber(100);
- if (charge > 90) { doStateChange(&StateID_ChargeSlash); }
+ if (charge > 95) { doStateChange(&StateID_ChargeSlash); }
}
}
// Aerial Attacks!
- if (yDistance > 24.0) {
+ if (yDistance < -24.0) {
// Condition For Spin Attack
- if (xDistance < 32.0) { doStateChange(&StateID_SpinAttack); }
+ // if (xDistance < 32.0) { doStateChange(&StateID_SpinAttack); }
// Condition for Uppercut
- if ((xDistance < 48.0) && (xDistance > 64.0)) { doStateChange(&StateID_Uppercut); }
+ if ((xDistance > 48.0) && (xDistance < 64.0)) { doStateChange(&StateID_Uppercut); }
}
- bool ret = calculateTileCollisions();
+ bool ret = calculateTileCollisions();
if (ret) {
doStateChange(&StateID_Turn);
}
@@ -502,7 +539,8 @@ void daSamurshai::updateModelMatrices() {
// Turn State
///////////////
void daSamurshai::beginState_Turn() {
- this->speed.x = (direction) ? -0.5f : 0.5f;
+ bindAnimChr_and_setUpdateRate("c18_RUNNING", 1, 0.0, 0.5);
+ this->speed.x = (direction) ? 0.5f : -0.5f;
this->direction ^= 1;
x_speed_inc = 0.0;
}
@@ -526,35 +564,42 @@ void daSamurshai::updateModelMatrices() {
///////////////
void daSamurshai::beginState_Chop() {
bindAnimChr_and_setUpdateRate("c18_H_CUT_R", 1, 0.0, 1.0);
+ chrAnimation.setCurrentFrame(0.0);
+ timer = 0;
+
}
void daSamurshai::executeState_Chop() {
PlaySoundAsync(this, SE_EMY_CRASHER_PUNCH);
+ speed.x = speed.x / 1.5;
- if (this->direction == 1) {
- SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x - 18.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 0.5, 1.5});
- Chuckles.addToList();
+ if (chrAnimation.getCurrentFrame() == 15.0) {
+ if (this->direction == 1) {
+ SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x - 18.0, pos.y + 16.0, pos.z-200.0}, &(S16Vec){0,0,0}, &(Vec){2.5, 0.5, 1.5});
+ Chuckles.addToList();
+ }
+ else {
+ SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x + 18.0, pos.y + 16.0, pos.z-200.0}, &(S16Vec){0,0,0}, &(Vec){2.5, 0.5, 1.5});
+ Knuckles.addToList();
+ }
+ timer += 1;
}
- else {
- SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x + 18.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 0.5, 1.5});
- Knuckles.addToList();
- }
-
- if(this->chrAnimation.isAnimationDone()) {
+ if (chrAnimation.getCurrentFrame() == 20.0) {
if (this->direction == 1) {
- SpawnEffect("Wm_ob_flagget_light", 0, &(Vec){pos.x - 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ SpawnEffect("Wm_en_hit", 0, &(Vec){pos.x - 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
SpawnEffect("Wm_en_hanapetal", 0, &(Vec){pos.x - 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0});
Chuckles.removeFromList();
}
else {
- SpawnEffect("Wm_ob_flagget_light", 0, &(Vec){pos.x + 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ SpawnEffect("Wm_en_hit", 0, &(Vec){pos.x + 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
SpawnEffect("Wm_en_hanapetal", 0, &(Vec){pos.x + 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0});
Knuckles.removeFromList();
}
+ }
+ if(this->chrAnimation.isAnimationDone()) {
PlaySoundAsync(this, SE_EMY_BIG_PAKKUN_DAMAGE_1);
-
doStateChange(&StateID_Walk);
}
}
@@ -564,65 +609,78 @@ void daSamurshai::updateModelMatrices() {
// ChargeSlash State
///////////////
void daSamurshai::beginState_ChargeSlash() {
- this->timer = 0;
-
- this->speed.x = 0.0;
- this->max_speed.x = (this->direction) ? -8.0 : 8.0;
+ timer = 0;
+ slowDown = false;
+ topHurts = false;
+ speed.x = 0.0;
}
void daSamurshai::executeState_ChargeSlash() {
- if (this->timer == 0) { bindAnimChr_and_setUpdateRate("c18_OB_IDLE_R", 1, 0.0, 1.0);
- if (this->direction == 1)
+ // End if the animation is finally over
+ if ((chrAnimation.isAnimationDone()) && (slowDown) ) { doStateChange(&StateID_Walk); return; }
+
+ // What to do if he hits a wall
+ bool ret = calculateTileCollisions();
+ if (ret) {
+ OSReport("Hit the wall");
+ bindAnimChr_and_setUpdateRate("c18_R_BLOCK_BREAK_R", 1, 0.0, 1.0);
+ speed.x = (direction) ? 0.5f : -0.5f;
+ topHurts = false;
+ slowDown = true;
+ timer = 500;
+ }
+
+ if (timer == 500) { speed.x = speed.x / 1.05; return; }
+
+ // Begin the charge effect
+ if (timer == 0) { bindAnimChr_and_setUpdateRate("c18_OB_IDLE_R", 1, 0.0, 0.5);
+ if (direction == 1)
SpawnEffect("Wm_ob_keyget02_lighit", 0, &(Vec){pos.x + 7.0, pos.y + 14.0, pos.z - 5500.0}, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8});
else
SpawnEffect("Wm_ob_keyget02_lighit", 0, &(Vec){pos.x - 7.0, pos.y + 14.0, pos.z + 5500.0}, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8});
}
- if (this->timer == 40) {
- speed.x = (direction) ? -8.0f : 8.0f;
- topHurts = true;
- }
+ // Start to cut
+ if (timer == 60) { bindAnimChr_and_setUpdateRate("c18_H_CUT_R", 1, 0.0, 1.0); }
- if (this->timer > 41) {
- if (slowDown == false) {
- float xDistance = pos.x - chosenOne->pos.x;
+ // After enough charging, speed on!
+ if (timer == 70) { speed.x = (direction) ? -16.0f : 16.0f; chrAnimation.setUpdateRate(0.0); }
- if (xDistance < 8.0) {
- bindAnimChr_and_setUpdateRate("c18_H_CUT_R", 1, 0.0, 2.0);
- SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){2.0, 0.2, 1.5});
- slowDown == true;
- }
- }
- else {
- speed.x = speed.x / 1.5;
- }
+ // He should not be able to be hurt for a while
+ if (timer == 72) { topHurts = true; }
- if (speed.x == 0.0) {
- topHurts = false;
- timer = 500;
- }
- else {
- effect.spawn("Wm_mr_p_iceslip", 0, &(Vec){pos.x, pos.y, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5});
- SpawnEffect("Wm_en_hanapetal", 0, &pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5});
- }
- }
+ OSReport("Speed: %f @ %d", speed.x, timer);
+ float absSpeed;
+ if (speed.x < 0.0) { absSpeed = -speed.x; }
+ else { absSpeed = speed.x; }
- if (this->timer == 550) {
- doStateChange(&StateID_Walk);
- }
+ // Can be bopped again when he gets slow enough
+ if (absSpeed < 1.0) { topHurts = false; chrAnimation.setUpdateRate(1.0); }
- bool ret = calculateTileCollisions();
- if (ret) {
- if (slowDown = false) {
- bindAnimChr_and_setUpdateRate("c18_H_CUT_R", 1, 0.0, 2.0);
- SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){2.0, 0.2, 1.5});
- slowDown == true;
- }
- speed.x = 0.0;
+ // During the dash
+ if (absSpeed > 0.0) {
+ // Slow that horsey down, tiger
+ if (slowDown) { speed.x = speed.x / 1.5; return; }
+
+ effect.spawn("Wm_mr_p_iceslip", 0, &(Vec){pos.x, pos.y+8.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5});
+ SpawnEffect("Wm_en_hanapetal", 0, &pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5});
+ SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){4.0, 0.1, 1.5});
+
+ if (timer == 75) { slowDown = true; }
+ // Positive if Mario is left of Samurai, negative if he is to the right
+ // float xDistance = pos.x - chosenOne->pos.x;
+
+ // // direction 1 is going left, direction 0 is going right
+ // if ((xDistance > 0) && (direction == 0)) {
+ // SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){4.0, 0.1, 1.5});
+ // slowDown = true; }
+
+ // if ((xDistance < 0) && (direction == 1)) {
+ // SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){4.0, 0.1, 1.5});
+ // slowDown = true; }
}
this->timer += 1;
-
}
void daSamurshai::endState_ChargeSlash() {
slowDown = false;
@@ -645,32 +703,32 @@ void daSamurshai::updateModelMatrices() {
return;
}
- if ((int)this->chrAnimation.getCurrentFrame() == 34) {
+ if (this->chrAnimation.getCurrentFrame() == 34.0) {
topHurts = true;
PlaySoundAsync(this, SE_EMY_CRASHER_PUNCH);
- speed.y = 2.0;
+ speed.y = 4.0;
y_speed_inc = -0.1875;
if (this->direction == 1) {
- SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x - 18.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){0.5, 1.5, 1.5});
+ effect.spawn("Wm_ob_itemget_ring", 0, &(Vec){pos.x - 48.0, pos.y + 32.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){0.5, 1.5, 1.5});
Chuckles.addToList();
}
else {
- SpawnEffect("Wm_ob_itemget_ring", 0, &(Vec){pos.x + 18.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){0.5, 1.5, 1.5});
+ effect.spawn("Wm_ob_itemget_ring", 0, &(Vec){pos.x + 48.0, pos.y + 32.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){0.5, 1.5, 1.5});
Knuckles.addToList();
}
}
- if ((this->chrAnimation.isAnimationDone()) && (speed.y != 0)) {
+ if (this->chrAnimation.getCurrentFrame() == 64.0) {
if (topHurts) {
if (this->direction == 1) {
- SpawnEffect("Wm_ob_flagget_light", 0, &(Vec){pos.x - 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ SpawnEffect("Wm_en_hit", 0, &(Vec){pos.x - 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
SpawnEffect("Wm_en_hanapetal", 0, &(Vec){pos.x - 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0});
Chuckles.removeFromList();
}
else {
- SpawnEffect("Wm_ob_flagget_light", 0, &(Vec){pos.x + 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ SpawnEffect("Wm_en_hit", 0, &(Vec){pos.x + 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
SpawnEffect("Wm_en_hanapetal", 0, &(Vec){pos.x + 38.0, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0});
Knuckles.removeFromList();
}
@@ -680,13 +738,16 @@ void daSamurshai::updateModelMatrices() {
}
}
+ if ((this->chrAnimation.getCurrentFrame() > 34.0) && (speed.y == 0)) {
+ speed.x = 0.0f;
+ }
+
if ((this->chrAnimation.isAnimationDone()) && (speed.y == 0.0)) {
bindAnimChr_and_setUpdateRate("c18_DIVING_STEAL_R", 1, 0.0, 1.0);
slowDown = true;
}
bool ret = calculateTileCollisions();
-
}
void daSamurshai::endState_Uppercut() { slowDown = false; }
@@ -739,7 +800,7 @@ void daSamurshai::updateModelMatrices() {
// Damage State
///////////////
void daSamurshai::beginState_Damage() {
- bindAnimChr_and_setUpdateRate("c18_L_DMG_F_1_R", 1, 0.0, 2.0);
+ bindAnimChr_and_setUpdateRate("c18_L_DMG_F_1_R", 1, 0.0, 1.0);
this->max_speed.x = 0;
this->speed.x = 0;
@@ -751,14 +812,20 @@ void daSamurshai::updateModelMatrices() {
this->timer = 0;
this->isDown = 1;
+
+ Chuckles.removeFromList();
+ Knuckles.removeFromList();
+
+ SpawnEffect("Wm_ob_switch", 0, &(Vec){pos.x, pos.y + 16.0, pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+
}
void daSamurshai::executeState_Damage() {
calculateTileCollisions();
- // effect.spawn("Wm_en_spindamage", 0, &(Vec){pos.x, pos.y + 24.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ effect.spawn("Wm_en_spindamage", 0, &(Vec){pos.x, pos.y + 24.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- if (this->chrAnimation.isAnimationDone() && (collMgr.SomethingSemiImportant(collMgr.bitfield_for_checks))) {
- if (timer == 0) { bindAnimChr_and_setUpdateRate("c18_L_DMG_F_3_R", 1, 0.0, 2.0); timer = 1; }
+ 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); }
}
@@ -773,8 +840,23 @@ void daSamurshai::updateModelMatrices() {
///////////////
void daSamurshai::beginState_Outro() {
+ bindAnimChr_and_setUpdateRate("c18_SP_BLOCK_R", 1, 0.0, 1.0);
OutroSetup(this);
- this->aPhysics.removeFromList();
+ aPhysics.removeFromList();
+
+ this->max_speed.x = 0;
+ this->speed.x = 0;
+ this->x_speed_inc = 0;
+
+ this->max_speed.y = -2.0;
+ this->speed.y = -2.0;
+ this->y_speed_inc = -0.1875;
+
+ this->timer = 0;
+ this->isDown = 1;
+
+ Chuckles.removeFromList();
+ Knuckles.removeFromList();
}
void daSamurshai::executeState_Outro() {
@@ -787,15 +869,19 @@ void daSamurshai::updateModelMatrices() {
return;
}
- bool ret;
- ret = ShrinkBoss(this, &pos, 1.0, this->timer);
+ if ((chrAnimation.getCurrentFrame() == 41.0) || (chrAnimation.getCurrentFrame() == 62.0)) {
+ PlaySoundAsync(this, SE_EMY_CRASHER_PUNCH);
+ SpawnEffect("Wm_en_landsmoke_s", 0, &(Vec){pos.x, pos.y - 8.0, pos.z + 500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ }
+
+ if (chrAnimation.isAnimationDone()) {
+ PlaySoundAsync(this, SE_EMY_CRASHER_PUNCH);
+ SpawnEffect("Wm_ob_cmnshotstar", 0, &(Vec){pos.x + 8.0, pos.y - 8.0, pos.z + 500.0}, &(S16Vec){0,0,0}, &(Vec){1.75, 1.75, 1.75});
+ SpawnEffect("Wm_mr_wirehit_hit", 0, &(Vec){pos.x + 8.0, pos.y, pos.z + 500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- if (ret == true) {
- BossExplode(this, &pos);
this->dying = 1;
this->timer = 0;
}
- else { PlaySound(this, SE_EMY_BIG_KURIBO_DOWN); }
this->timer += 1;
}