From 37ac3d51d303c4728f8beb0406be364396a5e58c Mon Sep 17 00:00:00 2001 From: Shishu the Dragon <183069616+ShishuTheDragon@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:10:58 +1200 Subject: [PATCH] Ivan: Megaton Hammer rework (#6753) --- .../actors/ovl_En_Partner/z_en_partner.c | 50 ++++++++++++++++--- .../actors/ovl_En_Partner/z_en_partner.h | 1 + 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c index f991afb658..aeffb88b4a 100644 --- a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c +++ b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include @@ -59,6 +60,26 @@ static ColliderCylinderInit sCylinderInit = { { 12, 27, 0, { 0, 0, 0 } }, }; +static ColliderCylinderInit sWeaponCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000100, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 32, 67, 0, { 0, 0, 0 } }, +}; + static CollisionCheckInfoInit sCCInfoInit = { 0, 12, 60, MASS_HEAVY }; void EnPartner_Init(Actor* thisx, PlayState* play) { @@ -93,6 +114,9 @@ void EnPartner_Init(Actor* thisx, PlayState* play) { this->collider.info.toucher.damage = 1; GET_PLAYER(play)->ivanDamageMultiplier = 1; + Collider_InitCylinder(play, &this->weaponCollider); + Collider_SetCylinder(play, &this->weaponCollider, &this->actor, &sWeaponCylinderInit); + Actor_ProcessInitChain(thisx, sInitChain); SkelAnime_Init(play, &this->skelAnime, &gFairySkel, &gFairyAnim, this->jointTable, this->morphTable, 15); ActorShape_Init(&thisx->shape, 1000.0f, ActorShadow_DrawCircle, 15.0f); @@ -132,6 +156,7 @@ void EnPartner_Destroy(Actor* thisx, PlayState* play) { LightContext_RemoveLight(play, &play->lightCtx, this->lightNodeNoGlow); Collider_DestroyCylinder(play, &this->collider); + Collider_DestroyCylinder(play, &this->weaponCollider); ResourceMgr_UnregisterSkeleton(&this->skelAnime); } @@ -291,18 +316,27 @@ void UseHammer(Actor* thisx, PlayState* play, u8 started) { if (this->itemTimer <= 0) { if (started == 1) { - this->itemTimer = 10; - static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; - Vec3f shockwavePos = this->actor.world.pos; + // camera shake: + Player_RequestQuake(play, 32967, 2, 30); - Player_RequestQuake(play, 27767, 7, 20); + // sound effect: Player_PlaySfx(&this->actor, NA_SE_IT_HAMMER_HIT); - EffectSsBlast_SpawnWhiteShockwave(play, &shockwavePos, &zeroVec, &zeroVec); + // visual effect: + Vec3f effectPos = this->actor.world.pos; + effectPos.y += 7.0f; + CollisionCheck_SpawnShieldParticles(play, &effectPos); + EffectSsHitMark_SpawnCustomScale(play, EFFECT_HITMARK_METAL, 200, &effectPos); - if (this->actor.xzDistToPlayer < 100.0f && this->actor.yDistToPlayer < 35.0f) { - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); - } + // update collider: + this->weaponCollider.info.toucher.dmgFlags = DMG_HAMMER_SWING; + Collider_UpdateCylinder(&this->actor, &this->weaponCollider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->weaponCollider.base); + + // cooldown and lag: + this->itemTimer = 10; + this->canMove = 0; + this->usedItem = 0xFF; } } } diff --git a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.h b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.h index ce22d61947..eb97171a5c 100644 --- a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.h +++ b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.h @@ -19,6 +19,7 @@ typedef struct EnPartner { Vec3s morphTable[15]; ColliderCylinder collider; + ColliderCylinder weaponCollider; Color_RGBAf innerColor; Color_RGBAf outerColor;