@ -30,6 +30,7 @@ extern std::array<Object*,4> PARTY_MEMBER_OBJ;
extern std : : map < int , Object * > OBJ_INFO ;
extern std : : map < int , Object * > OBJ_INFO ;
extern std : : map < BattleMoveName , Battle : : Move * > MOVELIST ;
extern std : : map < BattleMoveName , Battle : : Move * > MOVELIST ;
extern std : : vector < Encounter * > ENCOUNTER_LIST ;
extern std : : vector < Encounter * > ENCOUNTER_LIST ;
extern std : : map < Property , BattleProperty * > BATTLE_PROPERTIES ;
int testCount = 0 ;
int testCount = 0 ;
@ -135,13 +136,13 @@ bool SeasonI::OnUserCreate(){
testEncounter - > playerPos = = std : : array < vd2d , 4 > { vd2d { grid ( 1 , 2 ) } , { grid ( 2 , 2 ) } , { grid ( 3 , 2 ) } , { grid ( 4 , 2 ) } } ) ;
testEncounter - > playerPos = = std : : array < vd2d , 4 > { vd2d { grid ( 1 , 2 ) } , { grid ( 2 , 2 ) } , { grid ( 3 , 2 ) } , { grid ( 4 , 2 ) } } ) ;
Test ( " Test encounter grid positions are correct " ,
Test ( " Test encounter grid positions are correct " ,
testEncounter - > playerPos = = std : : array < vd2d , 4 > { vd2d { grid ( 1 , 2 ) } , { grid ( 2 , 2 ) } , { grid ( 3 , 2 ) } , { grid ( 4 , 2 ) } } ) ;
testEncounter - > playerPos = = std : : array < vd2d , 4 > { vd2d { grid ( 1 , 2 ) } , { grid ( 2 , 2 ) } , { grid ( 3 , 2 ) } , { grid ( 4 , 2 ) } } ) ;
Test ( " Enemy 1 has 3 battle moves. " ,
Test ( " Enemy 1 has 3 battle moves " ,
testEncounter - > objs [ 0 ] - > moveSet = = std : : vector < Battle : : Move * > {
testEncounter - > objs [ 0 ] - > moveSet = = std : : vector < Battle : : Move * > {
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE2 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE2 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE3 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE3 ] ,
} ) ;
} ) ;
Test ( " Enemy 1 has a cookie as a drop. " ,
Test ( " Enemy 1 has a cookie as a drop " ,
testEncounter - > objs [ 0 ] - > inventory = = std : : vector < Item * > { ITEMLIST [ ItemName : : COOKIE ] } ) ;
testEncounter - > objs [ 0 ] - > inventory = = std : : vector < Item * > { ITEMLIST [ ItemName : : COOKIE ] } ) ;
Test ( " Enemy 1 gives 20 money. " ,
Test ( " Enemy 1 gives 20 money. " ,
testEncounter - > objs [ 0 ] - > money = = 20 ) ;
testEncounter - > objs [ 0 ] - > money = = 20 ) ;
@ -150,7 +151,7 @@ bool SeasonI::OnUserCreate(){
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE2 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE2 ] ,
} ) ;
} ) ;
Test ( " Enemy 2 has a pizza as a drop. " ,
Test ( " Enemy 2 has a pizza as a drop " ,
testEncounter - > objs [ 1 ] - > inventory = = std : : vector < Item * > { ITEMLIST [ ItemName : : PIZZA ] } ) ;
testEncounter - > objs [ 1 ] - > inventory = = std : : vector < Item * > { ITEMLIST [ ItemName : : PIZZA ] } ) ;
Test ( " Enemy 2 gives 0 money. " ,
Test ( " Enemy 2 gives 0 money. " ,
testEncounter - > objs [ 1 ] - > money = = 0 ) ;
testEncounter - > objs [ 1 ] - > money = = 0 ) ;
@ -158,10 +159,50 @@ bool SeasonI::OnUserCreate(){
testEncounter - > objs [ 2 ] - > moveSet = = std : : vector < Battle : : Move * > {
testEncounter - > objs [ 2 ] - > moveSet = = std : : vector < Battle : : Move * > {
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ,
} ) ;
} ) ;
Test ( " Enemy 3 has no items to drop. " ,
Test ( " Enemy 3 has no items to drop " ,
testEncounter - > objs [ 2 ] - > inventory = = std : : vector < Item * > { } ) ;
testEncounter - > objs [ 2 ] - > inventory = = std : : vector < Item * > { } ) ;
Test ( " Enemy 3 gives 0 money. " ,
Test ( " Enemy 3 gives 0 money. " ,
testEncounter - > objs [ 2 ] - > money = = 0 ) ;
testEncounter - > objs [ 2 ] - > money = = 0 ) ;
Test ( " There are no battle properties " ,
BATTLE_PROPERTIES . size ( ) = = 0 ) ;
SetupBattleProperties ( ) ;
Test ( " Battle Properties populated " ,
BATTLE_PROPERTIES . size ( ) > 0 ) ;
Test ( " Test Move 1 exists in the map. " ,
MOVELIST . count ( BattleMoveName : : TESTMOVE1 ) ) ;
Test ( " Test Move 1 is undefined " ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] = = nullptr ) ;
MOVELIST [ BattleMoveName : : TESTMOVE1 ] = new Battle : : Move { " Test Move 1 " , " An attack " , baseDmg : 30 , randomDmg : 5 , range : 6 , channelTime : 27 , friendly : false } ;
Test ( " Verify Test Move 1's now set properly " ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] ! = nullptr ) ;
Test ( " Verify Test Move 1's Power Name shows up correctly " ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] - > GetPowerName ( ) = = " Test Move 1 " ) ;
MOVELIST [ BattleMoveName : : TESTMOVE1 ] - > grade = GAMMA ;
Test ( " Verify Test Move 1's Power Name shows up correctly with a grade " ,
MOVELIST [ BattleMoveName : : TESTMOVE1 ] - > GetPowerName ( ) = = " Test Move 1 " + std : : string ( 1 , ( char ) GAMMA ) ) ;
Test ( " Cookie is undefined " ,
ITEMLIST [ ItemName : : COOKIE ] = = nullptr ) ;
SetupItemList ( ) ;
Test ( " Cookie is defined " ,
ITEMLIST [ ItemName : : COOKIE ] ! = nullptr ) ;
delete ITEMLIST [ ItemName : : COOKIE ] ;
ITEMLIST . erase ( ItemName : : COOKIE ) ;
ITEMLIST [ ItemName : : COOKIE ] = new Item ( " Cookie " , " A delightful little treat. Restores 40 HP. " , 2 , { hpRecovery : 40 , consumable : Consumable : : FRIENDLY , sellPrice : 2 } ) ;
Test ( " Cookie name is set properly " ,
ITEMLIST [ ItemName : : COOKIE ] - > name = = " Cookie " ) ;
Test ( " Cookie description is set properly " ,
ITEMLIST [ ItemName : : COOKIE ] - > description = = " A delightful little treat. Restores 40 HP. " ) ;
Test ( " Cookie drop chance is set properly " ,
ITEMLIST [ ItemName : : COOKIE ] - > dropChance = = 2 ) ;
delete ITEMLIST [ ItemName : : FREEZE_PACKET ] ;
ITEMLIST . erase ( ItemName : : FREEZE_PACKET ) ;
ITEMLIST [ ItemName : : FREEZE_PACKET ] = new Item ( " Freeze Packet " , " Lets out some blistering cold weather. " , 256 , { consumable : Consumable : : ENEMY , sellPrice : 36 } , MOVELIST [ BattleMoveName : : FREEZE_PACKET ] ) ;
Test ( " Freeze Packet name is set properly " ,
ITEMLIST [ ItemName : : FREEZE_PACKET ] - > name = = " Freeze Packet " ) ;
Test ( " Freeze Packet description is set properly " ,
ITEMLIST [ ItemName : : FREEZE_PACKET ] - > description = = " Lets out some blistering cold weather. " ) ;
Test ( " Freeze Packet drop chance is set properly " ,
ITEMLIST [ ItemName : : FREEZE_PACKET ] - > dropChance = = 2 ) ;
return true ;
return true ;
}
}