mirror of
https://github.com/SMGCommunity/Petari.git
synced 2024-11-25 06:30:06 +00:00
GroundChecker 100% & Halo 91%
This commit is contained in:
parent
b36c662abe
commit
43148b4c82
50
csv/Map.csv
50
csv/Map.csv
@ -592,37 +592,37 @@ GXPosition3f32,Flag.o,Map.a,false
|
||||
__ct__27GravityDustParticleCallBackFPC9LiveActor,GravityDust.o,Map.a,false
|
||||
execute__27GravityDustParticleCallBackFP14JPABaseEmitterP15JPABaseParticle,GravityDust.o,Map.a,false
|
||||
__dt__27GravityDustParticleCallBackFv,GravityDust.o,Map.a,false
|
||||
__ct__13GroundCheckerFPCcff,GroundChecker.o,Map.a,false
|
||||
bringFriction__13GroundCheckerFff,GroundChecker.o,Map.a,false
|
||||
__dt__13GroundCheckerFv,GroundChecker.o,Map.a,false
|
||||
__ct__13GroundCheckerFPCcff,GroundChecker.o,Map.a,true
|
||||
bringFriction__13GroundCheckerFff,GroundChecker.o,Map.a,true
|
||||
__dt__13GroundCheckerFv,GroundChecker.o,Map.a,true
|
||||
__ct__18GroupSwitchWatcherFPCc,GroupSwitchWatcher.o,Map.a,false
|
||||
init__18GroupSwitchWatcherFRC12JMapInfoIter,GroupSwitchWatcher.o,Map.a,false
|
||||
control__18GroupSwitchWatcherFv,GroupSwitchWatcher.o,Map.a,false
|
||||
__dt__18GroupSwitchWatcherFv,GroupSwitchWatcher.o,Map.a,false
|
||||
__ct__4HaloFPCc,Halo.o,Map.a,false
|
||||
__dt__11MapObjActorFv,Halo.o,Map.a,false
|
||||
__ct__4HaloFPCc,Halo.o,Map.a,true
|
||||
__dt__11MapObjActorFv,Halo.o,Map.a,true
|
||||
init__4HaloFRC12JMapInfoIter,Halo.o,Map.a,false
|
||||
appear__4HaloFv,Halo.o,Map.a,false
|
||||
getDistance__4HaloCFv,Halo.o,Map.a,false
|
||||
connectToScene__4HaloFRC19MapObjActorInitInfo,Halo.o,Map.a,false
|
||||
isDistanceAppear__4HaloCFv,Halo.o,Map.a,false
|
||||
appear__4HaloFv,Halo.o,Map.a,true
|
||||
getDistance__4HaloCFv,Halo.o,Map.a,true
|
||||
connectToScene__4HaloFRC19MapObjActorInitInfo,Halo.o,Map.a,true
|
||||
isDistanceAppear__4HaloCFv,Halo.o,Map.a,true
|
||||
isDistanceDisappear__4HaloCFv,Halo.o,Map.a,false
|
||||
exeDisappear__4HaloFv,Halo.o,Map.a,false
|
||||
__ct__13PowerStarHaloFPCc,Halo.o,Map.a,false
|
||||
__dt__4HaloFv,Halo.o,Map.a,false
|
||||
init__13PowerStarHaloFRC12JMapInfoIter,Halo.o,Map.a,false
|
||||
appear__13PowerStarHaloFv,Halo.o,Map.a,false
|
||||
getDistance__13PowerStarHaloCFv,Halo.o,Map.a,false
|
||||
exeWaitScenarioOpeningEnd__13PowerStarHaloFv,Halo.o,Map.a,false
|
||||
__dt__13PowerStarHaloFv,Halo.o,Map.a,false
|
||||
__sinit_\Halo_cpp,Halo.o,Map.a,false
|
||||
__ct__Q27NrvHalo14HostTypeAppearFv,Halo.o,Map.a,false
|
||||
__ct__Q27NrvHalo17HostTypeDisappearFv,Halo.o,Map.a,false
|
||||
__ct__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndFv,Halo.o,Map.a,false
|
||||
execute__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndCFP5Spine,Halo.o,Map.a,false
|
||||
execute__Q27NrvHalo17HostTypeDisappearCFP5Spine,Halo.o,Map.a,false
|
||||
execute__Q27NrvHalo14HostTypeAppearCFP5Spine,Halo.o,Map.a,false
|
||||
makeSubModels__11MapObjActorFRC12JMapInfoIterRC19MapObjActorInitInfo,Halo.o,Map.a,false
|
||||
exeDisappear__4HaloFv,Halo.o,Map.a,true
|
||||
__ct__13PowerStarHaloFPCc,Halo.o,Map.a,true
|
||||
__dt__4HaloFv,Halo.o,Map.a,true
|
||||
init__13PowerStarHaloFRC12JMapInfoIter,Halo.o,Map.a,true
|
||||
appear__13PowerStarHaloFv,Halo.o,Map.a,true
|
||||
getDistance__13PowerStarHaloCFv,Halo.o,Map.a,true
|
||||
exeWaitScenarioOpeningEnd__13PowerStarHaloFv,Halo.o,Map.a,true
|
||||
__dt__13PowerStarHaloFv,Halo.o,Map.a,true
|
||||
__sinit_\Halo_cpp,Halo.o,Map.a,true
|
||||
__ct__Q27NrvHalo14HostTypeAppearFv,Halo.o,Map.a,true
|
||||
__ct__Q27NrvHalo17HostTypeDisappearFv,Halo.o,Map.a,true
|
||||
__ct__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndFv,Halo.o,Map.a,true
|
||||
execute__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndCFP5Spine,Halo.o,Map.a,true
|
||||
execute__Q27NrvHalo17HostTypeDisappearCFP5Spine,Halo.o,Map.a,true
|
||||
execute__Q27NrvHalo14HostTypeAppearCFP5Spine,Halo.o,Map.a,true
|
||||
makeSubModels__11MapObjActorFRC12JMapInfoIterRC19MapObjActorInitInfo,Halo.o,Map.a,true
|
||||
__ct__8TriangleFv,HitInfo.o,Map.a,true
|
||||
fillData__8TriangleFP14CollisionPartsUlP9HitSensor,HitInfo.o,Map.a,true
|
||||
getHostName__8TriangleCFv,HitInfo.o,Map.a,true
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Map",
|
||||
"message": "11.75793%",
|
||||
"message": "12.73095%",
|
||||
"color": "silver"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "decompiled",
|
||||
"message": "7.814273257893445%",
|
||||
"message": "7.8649274118240715%",
|
||||
"color": "blue"
|
||||
}
|
@ -11,7 +11,7 @@
|
||||
| [GameAudio](https://github.com/shibbo/Petari/blob/master/docs/lib/GameAudio.md) | 0.0% |
|
||||
| [Gravity](https://github.com/shibbo/Petari/blob/master/docs/lib/Gravity.md) | 56.286937028734464% |
|
||||
| [LiveActor](https://github.com/shibbo/Petari/blob/master/docs/lib/LiveActor.md) | 36.855693868142005% |
|
||||
| [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 11.757933634152229% |
|
||||
| [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 12.730952778860974% |
|
||||
| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 15.326212441107032% |
|
||||
| [NameObj](https://github.com/shibbo/Petari/blob/master/docs/lib/NameObj.md) | 26.039161800068705% |
|
||||
| [NPC](https://github.com/shibbo/Petari/blob/master/docs/lib/NPC.md) | 0.7591369440774989% |
|
||||
|
@ -27,9 +27,9 @@
|
||||
| FishGroup.o | 0.0% | 0 / 23 | 0.0% | :x:
|
||||
| Flag.o | 0.0% | 0 / 13 | 0.0% | :x:
|
||||
| GravityDust.o | 0.0% | 0 / 3 | 0.0% | :x:
|
||||
| GroundChecker.o | 0.0% | 0 / 3 | 0.0% | :x:
|
||||
| GroundChecker.o | 100.0% | 3 / 3 | 100.0% | :white_check_mark:
|
||||
| GroupSwitchWatcher.o | 0.0% | 0 / 4 | 0.0% | :x:
|
||||
| Halo.o | 0.0% | 0 / 24 | 0.0% | :x:
|
||||
| Halo.o | 82.6325411334552% | 22 / 24 | 91.66666666666666% | :eight_pointed_black_star:
|
||||
| HitInfo.o | 100.0% | 22 / 22 | 100.0% | :white_check_mark:
|
||||
| KCollision.o | 13.093525179856117% | 18 / 31 | 58.06451612903226% | :eight_pointed_black_star:
|
||||
| KCollisionPlus.o | 83.19327731092437% | 2 / 3 | 66.66666666666666% | :eight_pointed_black_star:
|
||||
@ -783,9 +783,9 @@
|
||||
# GroundChecker.o
|
||||
| Symbol | Decompiled? |
|
||||
| ------------- | ------------- |
|
||||
| __ct__13GroundCheckerFPCcff | :x: |
|
||||
| bringFriction__13GroundCheckerFff | :x: |
|
||||
| __dt__13GroundCheckerFv | :x: |
|
||||
| __ct__13GroundCheckerFPCcff | :white_check_mark: |
|
||||
| bringFriction__13GroundCheckerFff | :white_check_mark: |
|
||||
| __dt__13GroundCheckerFv | :white_check_mark: |
|
||||
|
||||
|
||||
# GroupSwitchWatcher.o
|
||||
@ -800,30 +800,30 @@
|
||||
# Halo.o
|
||||
| Symbol | Decompiled? |
|
||||
| ------------- | ------------- |
|
||||
| __ct__4HaloFPCc | :x: |
|
||||
| __dt__11MapObjActorFv | :x: |
|
||||
| __ct__4HaloFPCc | :white_check_mark: |
|
||||
| __dt__11MapObjActorFv | :white_check_mark: |
|
||||
| init__4HaloFRC12JMapInfoIter | :x: |
|
||||
| appear__4HaloFv | :x: |
|
||||
| getDistance__4HaloCFv | :x: |
|
||||
| connectToScene__4HaloFRC19MapObjActorInitInfo | :x: |
|
||||
| isDistanceAppear__4HaloCFv | :x: |
|
||||
| appear__4HaloFv | :white_check_mark: |
|
||||
| getDistance__4HaloCFv | :white_check_mark: |
|
||||
| connectToScene__4HaloFRC19MapObjActorInitInfo | :white_check_mark: |
|
||||
| isDistanceAppear__4HaloCFv | :white_check_mark: |
|
||||
| isDistanceDisappear__4HaloCFv | :x: |
|
||||
| exeDisappear__4HaloFv | :x: |
|
||||
| __ct__13PowerStarHaloFPCc | :x: |
|
||||
| __dt__4HaloFv | :x: |
|
||||
| init__13PowerStarHaloFRC12JMapInfoIter | :x: |
|
||||
| appear__13PowerStarHaloFv | :x: |
|
||||
| getDistance__13PowerStarHaloCFv | :x: |
|
||||
| exeWaitScenarioOpeningEnd__13PowerStarHaloFv | :x: |
|
||||
| __dt__13PowerStarHaloFv | :x: |
|
||||
| __sinit_\Halo_cpp | :x: |
|
||||
| __ct__Q27NrvHalo14HostTypeAppearFv | :x: |
|
||||
| __ct__Q27NrvHalo17HostTypeDisappearFv | :x: |
|
||||
| __ct__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndFv | :x: |
|
||||
| execute__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndCFP5Spine | :x: |
|
||||
| execute__Q27NrvHalo17HostTypeDisappearCFP5Spine | :x: |
|
||||
| execute__Q27NrvHalo14HostTypeAppearCFP5Spine | :x: |
|
||||
| makeSubModels__11MapObjActorFRC12JMapInfoIterRC19MapObjActorInitInfo | :x: |
|
||||
| exeDisappear__4HaloFv | :white_check_mark: |
|
||||
| __ct__13PowerStarHaloFPCc | :white_check_mark: |
|
||||
| __dt__4HaloFv | :white_check_mark: |
|
||||
| init__13PowerStarHaloFRC12JMapInfoIter | :white_check_mark: |
|
||||
| appear__13PowerStarHaloFv | :white_check_mark: |
|
||||
| getDistance__13PowerStarHaloCFv | :white_check_mark: |
|
||||
| exeWaitScenarioOpeningEnd__13PowerStarHaloFv | :white_check_mark: |
|
||||
| __dt__13PowerStarHaloFv | :white_check_mark: |
|
||||
| __sinit_\Halo_cpp | :white_check_mark: |
|
||||
| __ct__Q27NrvHalo14HostTypeAppearFv | :white_check_mark: |
|
||||
| __ct__Q27NrvHalo17HostTypeDisappearFv | :white_check_mark: |
|
||||
| __ct__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndFv | :white_check_mark: |
|
||||
| execute__Q216NrvPowerStarHalo30HostTypeWaitScenarioOpeningEndCFP5Spine | :white_check_mark: |
|
||||
| execute__Q27NrvHalo17HostTypeDisappearCFP5Spine | :white_check_mark: |
|
||||
| execute__Q27NrvHalo14HostTypeAppearCFP5Spine | :white_check_mark: |
|
||||
| makeSubModels__11MapObjActorFRC12JMapInfoIterRC19MapObjActorInitInfo | :white_check_mark: |
|
||||
|
||||
|
||||
# HitInfo.o
|
||||
|
15
include/Game/Map/GroundChecker.h
Normal file
15
include/Game/Map/GroundChecker.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/LiveActor/LiveActor.h"
|
||||
|
||||
class GroundChecker : public LiveActor {
|
||||
public:
|
||||
GroundChecker(const char *, f32, f32);
|
||||
|
||||
virtual ~GroundChecker();
|
||||
|
||||
void bringFriction(f32, f32);
|
||||
|
||||
f32 _8C;
|
||||
f32 _90;
|
||||
};
|
72
include/Game/Map/Halo.h
Normal file
72
include/Game/Map/Halo.h
Normal file
@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/MapObj/MapObjActor.h"
|
||||
|
||||
struct HaloParam {
|
||||
const char* haloName; // _0
|
||||
f32 _4;
|
||||
f32 _8;
|
||||
f32 clippingRadius; // _C
|
||||
};
|
||||
|
||||
namespace {
|
||||
HaloParam sParams[2] = {
|
||||
{ "ZoneHalo", 70.0f, 20.0f, 4.0f },
|
||||
{ "PowerStarHalo", 80.0f, 20.0f, 30.0f }
|
||||
};
|
||||
};
|
||||
|
||||
class Halo : public MapObjActor {
|
||||
public:
|
||||
Halo(const char *);
|
||||
|
||||
virtual ~Halo();
|
||||
virtual void init(const JMapInfoIter &);
|
||||
virtual void appear();
|
||||
virtual void connectToScene(const MapObjActorInitInfo &);
|
||||
virtual f32 getDistance() const;
|
||||
|
||||
bool isDistanceAppear() const;
|
||||
bool isDistanceDisappear() const;
|
||||
void exeDisappear();
|
||||
|
||||
inline HaloParam* getParam() const {
|
||||
const char* objName = mObjectName;
|
||||
for (u32 i = 0; i < 2; i++) {
|
||||
HaloParam* curParam = &sParams[i];
|
||||
if (MR::isEqualString(objName, curParam->haloName)) {
|
||||
return curParam;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
f32 mDistance; // _C4
|
||||
};
|
||||
|
||||
class PowerStarHalo : public Halo {
|
||||
public:
|
||||
PowerStarHalo(const char *);
|
||||
|
||||
virtual ~PowerStarHalo();
|
||||
virtual void init(const JMapInfoIter &);
|
||||
virtual void appear();
|
||||
virtual f32 getDistance() const;
|
||||
|
||||
void exeWaitScenarioOpeningEnd();
|
||||
|
||||
s32 _C8;
|
||||
};
|
||||
|
||||
namespace NrvHalo {
|
||||
NERVE(HostTypeAppear);
|
||||
NERVE(HostTypeDisappear);
|
||||
INIT_NERVE(HostTypeAppear);
|
||||
INIT_NERVE(HostTypeDisappear);
|
||||
};
|
||||
|
||||
namespace NrvPowerStarHalo {
|
||||
NERVE(HostTypeWaitScenarioOpeningEnd);
|
||||
INIT_NERVE(HostTypeWaitScenarioOpeningEnd);
|
||||
};
|
@ -35,7 +35,10 @@ public:
|
||||
MapObjActor(const char *);
|
||||
MapObjActor(const char *, const char *);
|
||||
|
||||
virtual ~MapObjActor();
|
||||
virtual ~MapObjActor() {
|
||||
|
||||
}
|
||||
|
||||
virtual void init(const JMapInfoIter &);
|
||||
virtual void initAfterPlacement();
|
||||
virtual void appear();
|
||||
|
8
include/Game/MapObj/PunchingKinoko.h
Normal file
8
include/Game/MapObj/PunchingKinoko.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/LiveActor/LiveActor.h"
|
||||
|
||||
class PunchingKinoko : public LiveActor {
|
||||
public:
|
||||
PunchingKinoko(const char *);
|
||||
};
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "JSystem/JGeometry/TVec.h"
|
||||
#include "Game/Animation/AnmPlayer.h"
|
||||
#include <revolution.h>
|
||||
|
||||
class CollisionParts;
|
||||
@ -16,6 +17,7 @@ class PartsModel;
|
||||
class LodCtrl;
|
||||
class CollisionParts;
|
||||
class HitSensor;
|
||||
class BtkCtrl;
|
||||
|
||||
namespace MR {
|
||||
enum CollisionScaleType {
|
||||
@ -170,7 +172,10 @@ namespace MR {
|
||||
void startBva(const LiveActor *, const char *);
|
||||
void setBvaFrameAndStop(const LiveActor *, f32);
|
||||
|
||||
BrkCtrl* getBrkCtrl(const LiveActor *);
|
||||
J3DFrameCtrl* getBrkCtrl(const LiveActor *);
|
||||
J3DFrameCtrl* getBtkCtrl(const LiveActor *);
|
||||
J3DFrameCtrl* getBpkCtrl(const LiveActor *);
|
||||
J3DFrameCtrl* getBtpCtrl(const LiveActor *);
|
||||
|
||||
void startBrkAndSetFrameAndStop(const LiveActor *, const char *, f32);
|
||||
bool tryStartBck(const LiveActor *, const char *, const char *);
|
||||
@ -188,11 +193,18 @@ namespace MR {
|
||||
|
||||
bool isExistBck(const LiveActor *, const char *);
|
||||
bool isExistBva(const LiveActor *, const char *);
|
||||
bool isExistBtk(const LiveActor *, const char *);
|
||||
bool isExistBpk(const LiveActor *, const char *);
|
||||
bool isExistBtp(const LiveActor *, const char *);
|
||||
bool isExistBrk(const LiveActor *, const char *);
|
||||
|
||||
bool isBckPlaying(const LiveActor *, const char *);
|
||||
|
||||
bool isBckStopped(const LiveActor *);
|
||||
bool isBrkStopped(const LiveActor *);
|
||||
bool isBtkStopped(const LiveActor *);
|
||||
bool isBtpStopped(const LiveActor *);
|
||||
bool isBpkStopped(const LiveActor *);
|
||||
|
||||
bool isBckOneTimeAndStopped(const LiveActor *);
|
||||
|
||||
@ -205,9 +217,11 @@ namespace MR {
|
||||
|
||||
void setBaseTRMtx(LiveActor *, const TPos3f &);
|
||||
|
||||
void setBpkFrame(const LiveActor *, f32);
|
||||
void stopBck(const LiveActor *);
|
||||
|
||||
void startBtp(const LiveActor *, const char *);
|
||||
void setBtpFrame(const LiveActor *, f32);
|
||||
void setBtpFrameAndStop(const LiveActor *, f32);
|
||||
|
||||
void startBpk(const LiveActor *, const char *);
|
||||
|
@ -24,6 +24,8 @@ namespace MR {
|
||||
void startSound(const LiveActor *, const char *, s32, s32);
|
||||
|
||||
void startSystemSE(const char *, s32, s32);
|
||||
void startSpinHitSound(const LiveActor *);
|
||||
void startBlowHitSound(const LiveActor *);
|
||||
void startSystemME(const char *);
|
||||
void startSound(const LiveActor *, const char *, s32, s32);
|
||||
void startSoundObject(AudSoundObject *, const char *);
|
||||
|
17
source/Game/Map/GroundChecker.cpp
Normal file
17
source/Game/Map/GroundChecker.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "Game/Map/GroundChecker.h"
|
||||
|
||||
GroundChecker::GroundChecker(const char *pName, f32 a2, f32 a3) : LiveActor(pName) {
|
||||
_8C = 1.0f;
|
||||
_90 = 0.0f;
|
||||
MR::invalidateClipping(this);
|
||||
initBinder(a2, a3, 0);
|
||||
makeActorAppeared();
|
||||
}
|
||||
|
||||
void GroundChecker::bringFriction(f32 a1, f32 a2) {
|
||||
_8C = (_8C * (1.0f - a2)) + (a1 * a2);
|
||||
}
|
||||
|
||||
GroundChecker::~GroundChecker() {
|
||||
|
||||
}
|
187
source/Game/Map/Halo.cpp
Normal file
187
source/Game/Map/Halo.cpp
Normal file
@ -0,0 +1,187 @@
|
||||
#include "Game/Map/Halo.h"
|
||||
|
||||
Halo::Halo(const char *pName) : MapObjActor(pName) {
|
||||
mDistance = 70.0f;
|
||||
}
|
||||
|
||||
/*
|
||||
void Halo::init(const JMapInfoIter &rIter) {
|
||||
MapObjActor::init(rIter);
|
||||
MapObjActorInitInfo info;
|
||||
info.setupHioNode("環境");
|
||||
info.setupDefaultPos();
|
||||
info.setupConnectToScene();
|
||||
info.setupNerve(&NrvHalo::HostTypeAppear::sInstance);
|
||||
info.setupClippingRadius(100.0f * getParam()->clippingRadius);
|
||||
info.setupFarClipping(-1.0f);
|
||||
info.setupAffectedScale();
|
||||
initialize(rIter, info);
|
||||
MR::getJMapInfoArg0NoInit(rIter, &mDistance);
|
||||
}
|
||||
*/
|
||||
|
||||
void Halo::appear() {
|
||||
MapObjActor::appear();
|
||||
|
||||
if (isDistanceDisappear()) {
|
||||
const char* anim = "Disappear";
|
||||
MR::tryStartAllAnim(this, anim);
|
||||
if (MR::isExistBtk(this, anim)) {
|
||||
J3DFrameCtrl* ctrl = MR::getBtkCtrl(this);
|
||||
MR::setBtkFrame(this, ctrl->mEndFrame);
|
||||
}
|
||||
|
||||
if (MR::isExistBpk(this, anim)) {
|
||||
J3DFrameCtrl* ctrl = MR::getBpkCtrl(this);
|
||||
MR::setBpkFrame(this, ctrl->mEndFrame);
|
||||
|
||||
}
|
||||
if (MR::isExistBtp(this, anim)) {
|
||||
J3DFrameCtrl* ctrl = MR::getBtpCtrl(this);
|
||||
MR::setBpkFrame(this, ctrl->mEndFrame);
|
||||
}
|
||||
|
||||
if (MR::isExistBrk(this, anim)) {
|
||||
J3DFrameCtrl* ctrl = MR::getBrkCtrl(this);
|
||||
MR::setBrkFrame(this, ctrl->mEndFrame);
|
||||
}
|
||||
|
||||
MR::hideModel(this);
|
||||
setNerve(&NrvHalo::HostTypeDisappear::sInstance);
|
||||
}
|
||||
else {
|
||||
MR::startAllAnim(this, "Appear");
|
||||
setNerve(&NrvHalo::HostTypeAppear::sInstance);
|
||||
}
|
||||
}
|
||||
|
||||
f32 Halo::getDistance() const {
|
||||
return MR::calcDistanceToPlayer(this);
|
||||
}
|
||||
|
||||
void Halo::connectToScene(const MapObjActorInitInfo &rIter) {
|
||||
MR::connectToSceneAir(this);
|
||||
}
|
||||
|
||||
bool Halo::isDistanceAppear() const {
|
||||
f32 v1 = (mDistance + 20.0f) * 100.0f;
|
||||
|
||||
f32 d = mDistance * 100.0f;
|
||||
if (d < v1) {
|
||||
return v1 < getDistance();
|
||||
}
|
||||
else {
|
||||
return getDistance() < v1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
bool Halo::isDistanceDisappear() const {
|
||||
f32 v1 = (mDistance + 20.0f) * 100.0f;
|
||||
|
||||
f32 d = mDistance * 100.0f;
|
||||
if (v1 < d) {
|
||||
return getDistance() < v1;
|
||||
}
|
||||
else {
|
||||
return v1 < getDistance();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void Halo::exeDisappear() {
|
||||
if (!MR::isHiddenModel(this)) {
|
||||
bool flag;
|
||||
const char* anim = "Disappear";
|
||||
|
||||
if (MR::isExistBtk(this, anim) && MR::isBtkStopped(this)) {
|
||||
flag = true;
|
||||
}
|
||||
else if (MR::isExistBpk(this, anim) && MR::isBpkStopped(this)) {
|
||||
flag = true;
|
||||
}
|
||||
else if (MR::isExistBtp(this, anim) && MR::isBtpStopped(this)) {
|
||||
flag = true;
|
||||
}
|
||||
else if (MR::isExistBrk(this, anim) && MR::isBrkStopped(this)) {
|
||||
flag = true;
|
||||
}
|
||||
else {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
MR::hideModel(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (isDistanceAppear()) {
|
||||
MR::showModel(this);
|
||||
MR::startAllAnim(this, "Appear");
|
||||
setNerve(&NrvHalo::HostTypeAppear::sInstance);
|
||||
}
|
||||
}
|
||||
|
||||
PowerStarHalo::PowerStarHalo(const char *pName) : Halo(pName) {
|
||||
_C8 = -1;
|
||||
}
|
||||
|
||||
Halo::~Halo() {
|
||||
|
||||
}
|
||||
|
||||
void PowerStarHalo::init(const JMapInfoIter &rIter) {
|
||||
Halo::init(rIter);
|
||||
MR::getJMapInfoArg1NoInit(rIter, &_C8);
|
||||
if (_C8 == -1) {
|
||||
setNerve(&NrvPowerStarHalo::HostTypeWaitScenarioOpeningEnd::sInstance);
|
||||
}
|
||||
}
|
||||
|
||||
void PowerStarHalo::appear() {
|
||||
if (isNerve(&NrvPowerStarHalo::HostTypeWaitScenarioOpeningEnd::sInstance)) {
|
||||
makeActorAppeared();
|
||||
}
|
||||
else {
|
||||
Halo::appear();
|
||||
}
|
||||
}
|
||||
|
||||
f32 PowerStarHalo::getDistance() const {
|
||||
TVec3f pos = MR::getCamPos();
|
||||
return PSVECDistance(mPosition.toCVec(), pos.toCVec());
|
||||
}
|
||||
|
||||
void PowerStarHalo::exeWaitScenarioOpeningEnd() {
|
||||
if (MR::isFirstStep(this)) {
|
||||
MR::hideModel(this);
|
||||
}
|
||||
|
||||
if (!MR::isStageStateScenarioOpeningCamera()) {
|
||||
MR::showModel(this);
|
||||
Halo::appear();
|
||||
}
|
||||
}
|
||||
|
||||
PowerStarHalo::~PowerStarHalo() {
|
||||
|
||||
}
|
||||
|
||||
/* todo -- ordering of these functions is wrong */
|
||||
void NrvPowerStarHalo::HostTypeWaitScenarioOpeningEnd::execute(Spine *pSpine) const {
|
||||
PowerStarHalo* halo = reinterpret_cast<PowerStarHalo*>(pSpine->mExecutor);
|
||||
halo->exeWaitScenarioOpeningEnd();
|
||||
}
|
||||
|
||||
void NrvHalo::HostTypeDisappear::execute(Spine *pSpine) const {
|
||||
Halo* halo = reinterpret_cast<Halo*>(pSpine->mExecutor);
|
||||
halo->exeDisappear();
|
||||
}
|
||||
|
||||
void NrvHalo::HostTypeAppear::execute(Spine *pSpine) const {
|
||||
Halo* halo = reinterpret_cast<Halo*>(pSpine->mExecutor);
|
||||
if (halo->isDistanceDisappear()) {
|
||||
MR::startAllAnim(halo, "Disappear");
|
||||
halo->setNerve(&NrvHalo::HostTypeDisappear::sInstance);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user