#include "EffectCondensation001.h"

#include "jp/ggaf/dx/actor/supporter/VecDriver.h"
#include "jp/ggaf/dx/actor/supporter/Scaler.h"
#include "jp/ggaf/dx/actor/supporter/UvFlipper.h"
#include "jp/gecchi/VioletVreath/util/MyStgUtil.h"



using namespace GgafLib;
using namespace VioletVreath;

EffectCondensation001::EffectCondensation001(const char* prm_name) :
        DefaultSpriteSetActor(prm_name, "8,Lockon001") {
    _class_name = "EffectCondensation001";
    inactivate();
    effectBlendOne(); //壛嶼崌惉
    defineRotMvWorldMatrix_Billboard(); //價儖儃乕僪Rz夞揮
    setHitAble(false); //摉偨傝敾掕柍偟
}

void EffectCondensation001::initialize() {
    GgafDx::UvFlipper* pUvFlipper = getUvFlipper();
    pUvFlipper->setFlipPtnRange(0, 3);   //傾僯儊斖埻傪侽乣侾俆
    pUvFlipper->exec(FLIP_ORDER_LOOP, 5); //傾僯儊弴彉
}

void EffectCondensation001::onActive() {
    getUvFlipper()->setActivePtnToTop();
    setAlpha(0.01);
    getScaler()->setRange(30000, 1000); //僗働乕儕儞僌丒斖埻
    setScale(30000);
    getScaler()->transitionLinearUntil(1000, 30);//僗働乕儕儞僌丒60F旓傗偟偰1000偵弅彫
    getVecDriver()->setFaceAngVelo(AXIS_Z, 1000);        //夞揮
}

void EffectCondensation001::processBehavior() {
    GgafDx::Scaler* const pScaler = getScaler();

    if (getAlpha() < 1.0) {
        addAlpha(0.05);
    }

    if (!pScaler->isTransitioning()) {
        //弅彫姰椆屻丄Beat
        pScaler->setRange(1000, 2000);
        pScaler->beat(30, 2, 0, 26, -1); //柍尷儖乕僾
    }
    getUvFlipper()->behave();
    getVecDriver()->behave();
    pScaler->behave();
}

void EffectCondensation001::processJudgement() {
}

void EffectCondensation001::onInactive() {
}

EffectCondensation001::~EffectCondensation001() {
}

