Erwan
- fixed sfx issues on the psp - removed a few debug strings
This commit is contained in:
@@ -480,6 +480,7 @@ other solutions need to be provided for abilities that add mana (ex: mana flare)
|
||||
|
||||
class AManaProducer: public MTGAbility{
|
||||
protected:
|
||||
static int currentlyTapping;
|
||||
ManaCost * cost;
|
||||
ManaCost * output;
|
||||
string menutext;
|
||||
@@ -533,9 +534,10 @@ class AManaProducer: public MTGAbility{
|
||||
if (mParticleSys && animation == 1.f) mParticleSys->Fire();
|
||||
animation -= 4 *dt;
|
||||
if (animation < 0){
|
||||
animation = 0;
|
||||
controller->getManaPool()->add(output);
|
||||
if (mParticleSys) mParticleSys->Stop();
|
||||
animation = 0;
|
||||
currentlyTapping--;
|
||||
controller->getManaPool()->add(output);
|
||||
if (mParticleSys) mParticleSys->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,6 +565,7 @@ class AManaProducer: public MTGAbility{
|
||||
int reactToClick(MTGCardInstance * _card){
|
||||
if (!isReactingToClick( _card)) return 0;
|
||||
source->tapped = 1;
|
||||
currentlyTapping++;
|
||||
if (cost) GameObserver::GetInstance()->currentlyActing()->getManaPool()->pay(cost);
|
||||
animation = 1.f;
|
||||
CardGui * cardg = game->mLayers->playLayer()->getByCard(source);
|
||||
@@ -572,7 +575,7 @@ class AManaProducer: public MTGAbility{
|
||||
}
|
||||
controller = source->controller();
|
||||
|
||||
if (GameOptions::GetInstance()->values[OPTIONS_SFXVOLUME] > 0){
|
||||
if (GameOptions::GetInstance()->values[OPTIONS_SFXVOLUME] > 0 && currentlyTapping < 3){
|
||||
JSample * sample = SampleCache::GetInstance()->getSample("sound/sfx/mana.wav");
|
||||
if (sample) JSoundSystem::GetInstance()->PlaySample(sample);
|
||||
}
|
||||
@@ -630,7 +633,7 @@ class AManaProducer: public MTGAbility{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int AManaProducer::currentlyTapping = 0;
|
||||
|
||||
/* Lifelink Ability */
|
||||
class ALifeLink:public MTGAbility{
|
||||
|
||||
@@ -58,14 +58,25 @@ class TexturesCache{
|
||||
};
|
||||
|
||||
|
||||
class SampleCached{
|
||||
public:
|
||||
int lastTime;
|
||||
JSample * sample;
|
||||
SampleCached(int _lastTime, JSample * _sample):lastTime(_lastTime),sample(_sample){};
|
||||
~SampleCached(){delete sample;};
|
||||
};
|
||||
|
||||
class SampleCache{
|
||||
protected:
|
||||
map<string, JSample *> cache;
|
||||
int lastTime;
|
||||
map<string, SampleCached *> cache;
|
||||
static SampleCache * mInstance;
|
||||
void cleanCache();
|
||||
void cleanOldest();
|
||||
~SampleCache();
|
||||
public:
|
||||
static SampleCache * GetInstance();
|
||||
SampleCache(){lastTime = 0;};
|
||||
JSample * getSample(string filename);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user