예제 #1
0
void Building::setAttributes(int type) 
{

  BuildingBaseStatus* baseStatus = field->getBaseStatus()->getBuildingBaseStatus(type);
  setBaseValue(baseStatus->getBaseValue());
  setAttackRate(baseStatus->getAttackRate());
  setAttack(baseStatus->getAttack());
  setRangeOfEffect(baseStatus->getRangeOfEffect());
}  
예제 #2
0
파일: adsr.cpp 프로젝트: eriser/fml
ADSR::ADSR() {
  reset();
  setAttackRate(0);
  setDecayRate(0);
  setReleaseRate(0);
  setSustainLevel(1.0);
  setTargetRatioA(0.3);
  setTargetRatioDR(0.0001);
}
예제 #3
0
Archer::Archer()
{
    setAttack(15); //level 1 arher is 10 * setAttack = 150
    setHealth(20); //level 1 arher is 10 * setHealth = 200
    setSpawnRate(0.1);
    setAttackRate(0.2);
    setSpeed(3);

}
예제 #4
0
bool AirPlane::init()
{
    if (!GoodNPC::init() || !initWithSpriteFrameName("pet2_0.png"))
    {
        return false;
    }
    setRotation(90);
    setWalkSpeed(1);
    setRunSpeed(2);
    setAttackRate(2);
    setHalfBodyWidth(getContentSize().width / 2);
    setHP(50.0f);
    setAP(5.0f);
    setAttackRect(Rect(0, 0, 150, getContentSize().height));
    
    initAnimation();
    
    return true;
}
예제 #5
0
void ADSREnv::setParameter( UINT16 paramId, FLOAT value, FLOAT modulation, INT16 voice )
{
    voice = min( numVoices_-1, voice );

    switch( paramId )
    {
    case PARAM_GATE:
        if( voice > -1 )
        {
		    FLOAT velo = value * modulation + ( 1 - modulation );
            value > 0.0f ? keyOn( velo, voice ) : keyOff( voice );
            break;
	    }
	case PARAM_ATTACK:  setAttackRate( value, voice ); break;
	case PARAM_DECAY:   setDecayRate( value, voice ); break;
	case PARAM_SUSTAIN: setSustainLevel( value, voice ); break;
	case PARAM_RELEASE: setReleaseRate( value, voice ); break;
    }
}