- It is now possible to have avatars associated to each Deck
- Added SFX
- Added Music files
- Possibility to choose your opponent
- Opponents' difficulty is measured according to their number of victories against a given deck
This commit is contained in:
wagic.the.homebrew
2008-11-24 09:24:47 +00:00
parent a9e70c0bdc
commit 3721247bee
69 changed files with 734 additions and 259 deletions
+41
View File
@@ -8,6 +8,7 @@
#include "../include/MTGCardInstance.h"
#include "../include/CardDescriptor.h"
#include "../include/Counters.h"
#include "../include/Subtypes.h"
MTGCardInstance::MTGCardInstance(): MTGCard(), Damageable(0){
LOG("==Creating MTGCardInstance==");
@@ -33,6 +34,7 @@ MTGCardInstance::~MTGCardInstance(){
LOG("==Deleting MTGCardInstance Succesfull==");
}
void MTGCardInstance::initMTGCI(){
sample = "";
model=NULL;
lifeOrig = 0;
doDamageTest = 0;
@@ -405,3 +407,42 @@ int MTGCardInstance::protectedAgainst(MTGCardInstance * card){
}
return 0;
}
/* Choose a sound sample to associate to that card */
JSample * MTGCardInstance::getSample(){
if (!sample.size()){
for (int i = nb_types-1; i>0; i--){
string type = Subtypes::subtypesList->find(types[i]);
type = "sound/sfx/" + type + ".wav";
#ifdef WIN32
OutputDebugString(type.c_str());
#endif
if (fileExists(type.c_str())){
sample = string(type);
break;
}
}
}
if (!sample.size()){
for (int i = 0; i < NB_BASIC_ABILITIES; i++){
if (!basicAbilities[i]) continue;
string type = MTGBasicAbilities[i];
type = "sound/sfx/" + type + ".wav";
if (fileExists(type.c_str())){
sample = type;
break;
}
}
}
if (!sample.size()){
string type = Subtypes::subtypesList->find(types[0]);
type = "sound/sfx/" + type + ".wav";
if (fileExists(type.c_str())){
sample = type;
}
}
if (sample.size()) return SampleCache::GetInstance()->getSample(sample);
return NULL;
}