1#include "Game/LiveActor/FlashingCtrl.hpp"
2#include "Game/Util.hpp"
4FlashingCtrl::FlashingCtrl(
LiveActor *pActor,
bool toggleDraw) :
NameObj(
"点滅") {
6 mToggleDraw = toggleDraw;
11 MR::connectToScene(
this, 0x22, -1, -1, -1);
14void FlashingCtrl::movement() {
16 s32 curTimer = mTimer;
18 if (curTimer - 1 <= 0 || MR::isClipped(mActor) || MR::isDead(mActor)) {
21 else if (MR::isDemoActive()) {
22 if (mToggleDraw && MR::isNoEntryDrawBuffer(mActor)) {
23 MR::onEntryDrawBuffer(mActor);
26 else if (isNowFlashing()) {
32void FlashingCtrl::start(
int timer) {
35 mFlashStartTime = 180;
36 mOverrideInterval = 0;
39void FlashingCtrl::end() {
43 if (mToggleDraw && !MR::isDead(mActor) && !MR::isClipped(mActor) && MR::isNoEntryDrawBuffer(mActor)) {
44 MR::onEntryDrawBuffer(mActor);
48s32 FlashingCtrl::getCurrentInterval()
const {
49 if (mOverrideInterval) {
52 s32 curTimer = mTimer;
61bool FlashingCtrl::isNowFlashing()
const {
62 return mTimer <= mFlashStartTime;
65bool FlashingCtrl::isNowOn()
const {
66 return !((mTimer / getCurrentInterval()) & 1);
69void FlashingCtrl::updateFlashing() {
72 MR::offEntryDrawBuffer(mActor);
75 MR::onEntryDrawBuffer(mActor);
80FlashingCtrl::~FlashingCtrl() {
The basis of a drawable actor that can contain states (see: Nerve)
The most basic form of an object.