Difference indicators when equipping items.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent dc68810868
commit e2d23045a7
  1. BIN
      C++ProjectTemplate
  2. 35
      main.cpp

Binary file not shown.

@ -1704,6 +1704,41 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
if (BATTLE_ENCOUNTER!=nullptr&&BATTLE_STATE==BattleState::ITEM_SELECT||GAME_STATE==GameState::OVERWORLD_ITEMS_MENU&&!messageBoxVisible) { if (BATTLE_ENCOUNTER!=nullptr&&BATTLE_STATE==BattleState::ITEM_SELECT||GAME_STATE==GameState::OVERWORLD_ITEMS_MENU&&!messageBoxVisible) {
DrawDialogBox({4,4},{(int)(WIDTH-8),(int)(HEIGHT/2)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220)); DrawDialogBox({4,4},{(int)(WIDTH-8),(int)(HEIGHT/2)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
DrawDialogBox({(int)(WIDTH*(3.0F/8)),HEIGHT/2+4},{(int)(WIDTH*(5.0F/8)-4),(int)(HEIGHT/4)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220)); DrawDialogBox({(int)(WIDTH*(3.0F/8)),HEIGHT/2+4},{(int)(WIDTH*(5.0F/8)-4),(int)(HEIGHT/4)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
if (PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->stats.equip!=EquipSlot::NONE) {
DrawDialogBox({(int)4,HEIGHT/2+4},{(int)(WIDTH*(3.0F/8)-4),(int)(HEIGHT/4)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
DrawStringPropDecal({(float)4+WIDTH*(1.0F/8),(float)(HEIGHT/2+8)},"ATK",WHITE,{1,1});
DrawStringPropDecal({(float)4+WIDTH*(1.0F/4),(float)(HEIGHT/2+8)},"DEF",WHITE,{1,1});
for (int i=0;i<PARTY_MEMBER_COUNT;i++) {
DrawStringPropDecal({(float)4+4,(float)(HEIGHT/2+4+12+i*10)},PARTY_MEMBER_OBJ[i]->name,WHITE,{0.5,1});
int equipAttack=0;
int equipDefense=0;
int newAttack=0;
int newDefense=0;
EquipSlot::Equip slot = PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->stats.equip;
for (int j=0;j<PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment.size();j++) {
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment[j]!=nullptr) {
equipAttack+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment[j]->stats.attack;
equipDefense+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment[j]->stats.defense;
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment[j]->stats.equip==slot) {
newAttack+=PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->stats.attack;
newDefense+=PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->stats.defense;
} else {
newAttack+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment[j]->stats.attack;
newDefense+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->equipment[j]->stats.defense;
}
} else {
if (j==slot) {
newAttack+=PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->stats.attack;
newDefense+=PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->stats.defense;
}
}
}
DrawStringPropDecal({(float)4+WIDTH*(1.0F/8),(float)(HEIGHT/2+4+12+i*10)},std::to_string(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->baseAtk+newAttack),(newAttack>equipAttack)?GREEN:(newAttack<equipAttack)?RED:WHITE,{0.5,1});
DrawStringPropDecal({(float)4+WIDTH*(1.0F/4),(float)(HEIGHT/2+4+12+i*10)},std::to_string(newDefense),(newDefense>equipDefense)?GREEN:(newDefense<equipDefense)?RED:WHITE,{0.5,1});
if (newAttack!=equipAttack) {DrawRotatedDecal({(float)4+WIDTH*(1.0F/4)-14,(float)(HEIGHT/2+4+12+i*10+2+((newAttack<equipAttack)?4:0))},SPRITES["cursor.png"],newAttack>equipAttack?-M_PI_2:M_PI_2,{4,4},{0.5,0.5},newAttack>equipAttack?GREEN:RED);}
if (newDefense!=equipDefense) {DrawRotatedDecal({(float)4+WIDTH*(3.0F/8)-14,(float)(HEIGHT/2+4+12+i*10+2+((newDefense<equipDefense)?4:0))},SPRITES["cursor.png"],newDefense>equipDefense?-M_PI_2:M_PI_2,{4,4},{0.5,0.5},newDefense>equipDefense?GREEN:RED);}
}
}
DrawDecal({static_cast<float>(8+(ITEM_SELECTION_CURSOR)%2*(WIDTH-8)/2),static_cast<float>(12*((ITEM_SELECTION_CURSOR-ITEM_SELECTION_OFFSET)/2)+8)},SPRITES["cursor.png"]); DrawDecal({static_cast<float>(8+(ITEM_SELECTION_CURSOR)%2*(WIDTH-8)/2),static_cast<float>(12*((ITEM_SELECTION_CURSOR-ITEM_SELECTION_OFFSET)/2)+8)},SPRITES["cursor.png"]);
DrawStringPropDecal({(int)(WIDTH*(3.0F/8))+4,HEIGHT/2+8},Wrap(PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->description,(int)(WIDTH*(5.0F/8))-4,true,{1,1})); DrawStringPropDecal({(int)(WIDTH*(3.0F/8))+4,HEIGHT/2+8},Wrap(PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->description,(int)(WIDTH*(5.0F/8))-4,true,{1,1}));
for (int i=0;i<18;i++) { for (int i=0;i<18;i++) {

Loading…
Cancel
Save