Advertisement
fggkyle

Untitled

Apr 12th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1. #include "z_bg_kin2_bombwall.h"
  2.  
  3. #define FLAGS 0x10000010
  4.  
  5. #define THIS ((BgKin2Bombwall*)thisx)
  6.  
  7. void BgKin2Bombwall_Init(Actor* thisx, GlobalContext* globalCtx);
  8. void BgKin2Bombwall_Destroy(Actor* thisx, GlobalContext* globalCtx);
  9. void BgKin2Bombwall_Update(Actor* thisx, GlobalContext* globalCtx);
  10. void BgKin2Bombwall_Draw(Actor* thisx, GlobalContext* globalCtx);
  11.  
  12. void func_80B6E4B8(BgKin2Bombwall* this);
  13. void func_80B6E4CC(BgKin2Bombwall* this, GlobalContext* globalCtx);
  14. void func_80B6E544(BgKin2Bombwall* this);
  15. void func_80B6E558(BgKin2Bombwall* this, GlobalContext* globalCtx);
  16. void func_80B6E5F8(BgKin2Bombwall* this);
  17. void func_80B6E614(BgKin2Bombwall* this, GlobalContext* globalCtx);
  18. /*
  19. const ActorInit Bg_Kin2_Bombwall_InitVars = {
  20. ACTOR_BG_KIN2_BOMBWALL,
  21. ACTORCAT_BG,
  22. FLAGS,
  23. OBJECT_KIN2_OBJ,
  24. sizeof(BgKin2Bombwall),
  25. (ActorFunc)BgKin2Bombwall_Init,
  26. (ActorFunc)BgKin2Bombwall_Destroy,
  27. (ActorFunc)BgKin2Bombwall_Update,
  28. (ActorFunc)BgKin2Bombwall_Draw
  29. };
  30. */
  31.  
  32. extern InitChainEntry D_80B6E748;
  33. extern BgMeshHeader D_06000490;
  34. extern ColliderCylinderInit D_80B6E6F0;
  35.  
  36. extern Gfx D_060002C0[];
  37. extern Gfx D_06000360[];
  38.  
  39. s32 func_80B6E020(BgKin2Bombwall* this, GlobalContext* globalCtx) {
  40. Actor* other;
  41.  
  42. if (this->collider.base.acFlags & 2) {
  43. other = this->collider.base.ac;
  44. if (other != NULL && Math3D_DistanceSquared(&this->dyna.actor.world.pos, &other->world.pos) < SQ(80.0f)) {
  45. return 1;
  46. }
  47. }
  48. return 0;
  49. }
  50.  
  51. #pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall_0x80B6E020/func_80B6E090.asm")
  52. /*void func_80B6E090(BgKin2Bombwall* this, GlobalContext* globalCtx) {
  53. Vec3f spF0;
  54. ? spE4;
  55. Vec3f spD8;
  56. Vec3f spCC;
  57. s32 i;
  58. f32* temp_s5;
  59. f32 temp_f30;
  60. s32 temp_a0;
  61. s32 temp_s2;
  62. s32 temp_s3;
  63. void* temp_s4;
  64. s32 phi_v0;
  65. void* phi_s4;
  66. s32 phi_s3;
  67. s32 phi_s0;
  68. s32 phi_s1;
  69. s32 phi_s0_2;
  70.  
  71. Matrix_RotateY(this->dyna.actor.shape.rot.y, 0);
  72. temp_f30 = D_80B6E760;
  73. temp_s5 = &spF0;
  74.  
  75. for (i = 0; i < 6; i++) {
  76. phi_s4 = &D_80B6E730;
  77. for (j = 0; j < D_80B6E735; j++) {
  78. temp_s3 = (phi_s3 + 1) & 7;
  79. spD8.x = ((Rand_Next() >> 0x1C) + *phi_s4);
  80. spD8.y = ((Rand_ZeroOne() - 0.5f) * 15.0f) + (i * 15.0f);
  81. spD8.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
  82. spCC.x = (2.0f * (Rand_ZeroOne() - 0.5f)) + (spD8.x * temp_f30);
  83. spCC.y = (Rand_ZeroOne() * 7.0f) + 4.0f;
  84. spCC.z = spD8.z * D_80B6E764;
  85. SysMatrix_MultiplyVector3fByState(&spD8, temp_s5);
  86. SysMatrix_MultiplyVector3fByState(&spCC, &spE4);
  87. spF0.x += this->dyna.actor.world.pos.x;
  88. spF0.y += this->dyna.actor.world.pos.y;
  89. spF0.z += this->dyna.actor.world.pos.z;
  90. if ((Rand_Next() & 3) == 0) {
  91. phi_s0_2 = 0x20;
  92. } else {
  93. phi_s0_2 = 0x40;
  94. }
  95. if ((temp_s3 < 2) || (phi_s0 = phi_s0_2, phi_s1 = 0, (Rand_Next() > 0))) {
  96. temp_s2 = Rand_Next();
  97. func_800B0E48(globalCtx, temp_s5, &D_801D15B0, &D_80B6E724, &D_80B6E71C, &D_80B6E720,
  98. (temp_s2 >> 0x1B) + 0x46, (Rand_Next() >> 0x1A) + 0x3C);
  99. phi_s0 = phi_s0_2 | 1;
  100. phi_s1 = 1;
  101. }
  102. EffectSsKakera_Spawn(globalCtx, temp_s5, &spE4, temp_s5, -0x226, phi_s0, 0x1E, 0, 0, (?32) *(&D_80B6E738 + (temp_s3 * 2)), phi_s1, 0, 0x32, -1, 0x1F5, 0x6000128);
  103. }
  104. }
  105. }*/
  106.  
  107. void BgKin2Bombwall_Init(Actor* thisx, GlobalContext* globalCtx) {
  108. BgKin2Bombwall* this = ((BgKin2Bombwall*)thisx);
  109. s32 pad;
  110.  
  111. Actor_ProcessInitChain(&this->dyna.actor, &D_80B6E748);
  112. BcCheck3_BgActorInit(&this->dyna, 0);
  113.  
  114. Collider_InitCylinder(globalCtx, &this->collider);
  115. if (Actor_GetSwitchFlag(globalCtx, this->dyna.actor.params & 0x7F)) {
  116. Actor_MarkForDeath(&this->dyna.actor);
  117. return;
  118. }
  119. BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000490);
  120. Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &D_80B6E6F0);
  121. Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
  122. Actor_SetHeight(&this->dyna.actor, 60.0f);
  123. func_80B6E4B8(this);
  124. }
  125.  
  126. void BgKin2Bombwall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
  127. BgKin2Bombwall* this = ((BgKin2Bombwall*)thisx);
  128.  
  129. BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
  130. Collider_DestroyCylinder(globalCtx, &this->collider);
  131. }
  132.  
  133. void func_80B6E4B8(BgKin2Bombwall* this) {
  134. this->actionFunc = func_80B6E4CC;
  135. }
  136.  
  137. void func_80B6E4CC(BgKin2Bombwall* this, GlobalContext* globalCtx) {
  138. if (func_80B6E020(this, globalCtx)) {
  139. this->collider.base.acFlags &= 0xFFFD;
  140. ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
  141. func_80B6E544(this);
  142. return;
  143. }
  144. CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider);
  145. }
  146.  
  147. void func_80B6E544(BgKin2Bombwall* this) {
  148. this->actionFunc = func_80B6E558;
  149. }
  150.  
  151. void func_80B6E558(BgKin2Bombwall* this, GlobalContext* globalCtx) {
  152. if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
  153. ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
  154. Actor_SetSwitchFlag(globalCtx, this->dyna.actor.params & 0x7F);
  155. func_800F0568(globalCtx, &this->dyna.actor.world.pos, 60, 0x2810);
  156. func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
  157. this->dyna.actor.draw = NULL;
  158. func_80B6E090(this, globalCtx);
  159. func_80B6E5F8(this);
  160. return;
  161. }
  162. ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
  163. }
  164.  
  165. void func_80B6E5F8(BgKin2Bombwall* this) {
  166. this->unk1AC = 0x28;
  167. this->actionFunc = func_80B6E614;
  168. }
  169.  
  170. void func_80B6E614(BgKin2Bombwall* this, GlobalContext* globalCtx) {
  171. this->unk1AC -= 1;
  172. if (this->unk1AC <= 0) {
  173. ActorCutscene_Stop(this->dyna.actor.cutscene);
  174. Actor_MarkForDeath(&this->dyna.actor);
  175. }
  176. }
  177.  
  178. void BgKin2Bombwall_Update(Actor* thisx, GlobalContext* globalCtx) {
  179. BgKin2Bombwall* this = ((BgKin2Bombwall*)thisx);
  180.  
  181. this->actionFunc(this, globalCtx);
  182. }
  183.  
  184. void BgKin2Bombwall_Draw(Actor* thisx, GlobalContext* globalCtx) {
  185. func_800BDFC0(globalCtx, D_06000360);
  186. func_800BE03C(globalCtx, D_060002C0);
  187. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement