Fight and other docu
This commit is contained in:
@@ -3,10 +3,7 @@
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
|
||||
extern ActorMarker *chfinalboss_findCollidingJinjo(Actor*, f32);
|
||||
void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]);
|
||||
|
||||
typedef struct {
|
||||
typedef struct chspellbarrier_s {
|
||||
s32 unk0;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
@@ -21,57 +18,49 @@ typedef struct {
|
||||
u8 unkE;
|
||||
u8 unkF;
|
||||
u8 sfxsourceIdx;
|
||||
} ActorLocal_fight_8390;
|
||||
} ActorLocal_SpellBarrier;
|
||||
|
||||
void chspellbarrier_update(Actor *this);
|
||||
ActorInfo chSpellBarrier = { MARKER_284_GRUNTY_SPELL_BARRIER, ACTOR_3AB_GRUNTY_SPELL_BARRIER, ASSET_546_MODEL_GRUNTY_SPELL_BARRIER, 1, NULL, chspellbarrier_update, actor_update_func_80326224, actor_draw, 0, 0, 0.0f, 0 };
|
||||
|
||||
/* .data */
|
||||
ActorInfo chSpellBarrier = {
|
||||
MARKER_284_GRUNTY_SPELL_BARRIER, ACTOR_3AB_GRUNTY_SPELL_BARRIER, ASSET_546_MODEL_GRUNTY_SPELL_BARRIER,
|
||||
0x1, NULL,
|
||||
chspellbarrier_update, func_80326224, actor_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
void chspellbarrier_collisionPassive(ActorMarker *this, ActorMarker *other) {
|
||||
Actor *actor_spellbarrier = marker_getActor(this);
|
||||
ActorLocal_SpellBarrier *local = (ActorLocal_SpellBarrier *) &actor_spellbarrier->local;
|
||||
|
||||
/* .code */
|
||||
void func_8038E780(ActorMarker *arg0, ActorMarker *arg1) {
|
||||
Actor *sp1C;
|
||||
ActorLocal_fight_8390 *sp18;
|
||||
local->unk0 = 0xFF;
|
||||
local->unk4 = 0;
|
||||
|
||||
sp1C = marker_getActor(arg0);
|
||||
sp18 = (ActorLocal_fight_8390 *) &sp1C->local;
|
||||
sp18->unk0 = 0xFF;
|
||||
sp18->unk4 = 0;
|
||||
if (func_8030E3FC(sp18->sfxsourceIdx) == 0) {
|
||||
func_8030E2C4(sp18->sfxsourceIdx);
|
||||
if (func_8030E3FC(local->sfxsourceIdx) == 0) {
|
||||
func_8030E2C4(local->sfxsourceIdx);
|
||||
}
|
||||
if (func_8030E3FC(sp1C->unk44_31) == 0) {
|
||||
func_8030E2C4(sp1C->unk44_31);
|
||||
|
||||
if (func_8030E3FC(actor_spellbarrier->unk44_31) == 0) {
|
||||
func_8030E2C4(actor_spellbarrier->unk44_31);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038E7EC(Actor *arg0) {
|
||||
ActorLocal_fight_8390 *local = (ActorLocal_fight_8390 *)&arg0->local;
|
||||
void chspellbarrier_free(Actor *this) {
|
||||
ActorLocal_SpellBarrier *local = (ActorLocal_SpellBarrier *) &this->local;
|
||||
|
||||
if ((u8)arg0->unk44_31) {
|
||||
func_8030DA44(arg0->unk44_31);
|
||||
arg0->unk44_31 = 0;
|
||||
if ((u8) this->unk44_31) {
|
||||
func_8030DA44(this->unk44_31);
|
||||
this->unk44_31 = 0;
|
||||
}
|
||||
|
||||
if (local->sfxsourceIdx != 0) {
|
||||
func_8030DA44(local->sfxsourceIdx);
|
||||
local->sfxsourceIdx = (u8)0;
|
||||
local->sfxsourceIdx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void chspellbarrier_update(Actor *this){
|
||||
ActorLocal_fight_8390 *local = (ActorLocal_fight_8390 *)&this->local;
|
||||
f32 sp38 = time_getDelta();
|
||||
void chspellbarrier_update(Actor *this) {
|
||||
ActorLocal_SpellBarrier *local = (ActorLocal_SpellBarrier *) &this->local;
|
||||
f32 delta_time = time_getDelta();
|
||||
ActorMarker *jinjo_marker;
|
||||
|
||||
if(!this->volatile_initialized){
|
||||
if (!this->volatile_initialized){
|
||||
this->volatile_initialized = TRUE;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_8038E780, NULL);
|
||||
marker_setFreeMethod(this->marker, func_8038E7EC);
|
||||
marker_setCollisionScripts(this->marker, NULL, chspellbarrier_collisionPassive, NULL);
|
||||
marker_setFreeMethod(this->marker, chspellbarrier_free);
|
||||
this->marker->propPtr->unk8_3 = 0;
|
||||
actor_collisionOn(this);
|
||||
local->unk0 = 0;
|
||||
@@ -85,51 +74,54 @@ void chspellbarrier_update(Actor *this){
|
||||
func_8030DB04(local->sfxsourceIdx, 32000, this->position, 4000.0f, 12000.0f);
|
||||
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 1.0f);
|
||||
FUNC_8030E8B4(SFX_416, 0.8f, 32000, this->position, 10000, 25000);
|
||||
}//L8038E97C
|
||||
}
|
||||
|
||||
jinjo_marker = chfinalboss_findCollidingJinjo(this, 600.0f);
|
||||
if(jinjo_marker){
|
||||
if(jinjo_marker->id == MARKER_285_JINJONATOR){
|
||||
|
||||
if (jinjo_marker) {
|
||||
if (jinjo_marker->id == MARKER_285_JINJONATOR) {
|
||||
marker_despawn(this->marker);
|
||||
chfinalboss_spellBarrierInactive();
|
||||
return;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
local->unk0 = 0;
|
||||
local->unk4 = 1;
|
||||
actor_setOpacity(this, 0);
|
||||
this->unk58_0 = 0;
|
||||
this->lifetime_value = 2.0f;
|
||||
this->lifetime_value = 2.0f;
|
||||
}
|
||||
} //L8038E9F4
|
||||
if(this->state == 1){
|
||||
this->yaw += 30.0f*sp38;
|
||||
if(this->scale < 1.0){
|
||||
this->scale = MIN(1.0, this->scale + ((f64)sp38 + (f64)sp38));
|
||||
}//L8038EA68
|
||||
}
|
||||
|
||||
if(0.0 < this->lifetime_value){
|
||||
this->unk58_0 = 0;
|
||||
this->lifetime_value -= sp38;
|
||||
if (this->state == 1) {
|
||||
this->yaw += 30.0f * delta_time;
|
||||
if (this->scale < 1.0) {
|
||||
this->scale = MIN(1.0, this->scale + ((f64)delta_time + (f64)delta_time));
|
||||
}
|
||||
else{ //L8038EAA4
|
||||
|
||||
if (0.0 < this->lifetime_value) {
|
||||
this->unk58_0 = 0;
|
||||
this->lifetime_value -= delta_time;
|
||||
} else {
|
||||
this->unk58_0 = 1;
|
||||
if(local->unk4){
|
||||
local->unk0 = MIN(0x64, local->unk0 + (s32)(60.0f*sp38));
|
||||
|
||||
if (local->unk4) {
|
||||
local->unk0 = MIN(0x64, local->unk0 + (s32)(60.0f * delta_time));
|
||||
|
||||
if(local->unk0 >= 0x64){
|
||||
local->unk0 = 0x64;
|
||||
local->unk4 = 0;
|
||||
}
|
||||
}
|
||||
else{//L8038EB20
|
||||
local->unk0 = MAX(0, local->unk0 - (s32)(60.0f*sp38));
|
||||
if(local->unk0 <= 0){
|
||||
} else {
|
||||
local->unk0 = MAX(0, local->unk0 - (s32)(60.0f*delta_time));
|
||||
|
||||
if (local->unk0 <= 0) {
|
||||
local->unk0 = 0;
|
||||
local->unk4 = 1;
|
||||
this->lifetime_value = 0.25f;
|
||||
}
|
||||
}//L8038EB74
|
||||
}
|
||||
|
||||
actor_setOpacity(this, local->unk0);
|
||||
}
|
||||
}
|
||||
//L8038EB80
|
||||
}
|
||||
|
Reference in New Issue
Block a user