diff --git a/C++ProjectTemplate b/C++ProjectTemplate index a010ced..b7d95b8 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/assets/rollingcounter.png b/assets/rollingcounter.png index 3f6f1d3..b2606f0 100644 Binary files a/assets/rollingcounter.png and b/assets/rollingcounter.png differ diff --git a/ideas b/ideas index 7598bd3..0f48f5d 100644 --- a/ideas +++ b/ideas @@ -138,4 +138,14 @@ healing move and is dying, it will attempt to use that. There is also a dumb flag. The dumb flag will make the enemy try to use PP draining moves even if they don't have enough PP for that move. This will mean they will waste turns after -they run out of PP. \ No newline at end of file +they run out of PP. + +==================== + +Rolling Hit point counter + +If you take damage, you will lose health at a tick rate of 2 per frame. (It takes 13 frames per number, so you are losing 9.23HP/sec). 60/13 = 4.62 HPsec + +If your health falls below zero, you start bleeding health at a rate of +1 for every 20 health missing from your current health. + +If your health falls below your negative max health, you start bleeding health at a rate of +1 for every 10 health missing from your current health. \ No newline at end of file diff --git a/main.cpp b/main.cpp index 50edb72..3bcb2d8 100644 --- a/main.cpp +++ b/main.cpp @@ -20,7 +20,7 @@ #define TILEMAP_EDITOR_TILESIZE (32*TILEMAP_EDITOR_DRAW_MULT) #define PARTY_TRAIL_LENGTH 48 #define CAMERA_WAIT_TIME 60 -#define HEALTH_ROLLING_SPEED 1 +#define HEALTH_ROLLING_SPEED 2 #define ㅎ #define ㅍ @@ -280,9 +280,8 @@ class Entity{ Object* obj; std::vector moveSet; //Used for initializing players. - Entity(int HP,int maxHP,int PP,int maxPP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) { - Entity(nullptr,HP,maxHP,PP,maxPP,baseAtk,resistances,speed,moveSet,damageReduction,smart,dumb); - } + Entity(int HP,int maxHP,int PP,int maxPP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) + :Entity(nullptr,HP,maxHP,PP,maxPP,baseAtk,resistances,speed,moveSet,damageReduction,smart,dumb){} //Use this for initializing enemies as it lets you specify an object. Entity(Object*obj,int HP,int maxHP,int PP,int maxPP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) :obj(obj),HP(HP),maxHP(maxHP),PP(PP),maxPP(maxPP),baseAtk(baseAtk),speed(speed),moveSet(moveSet),damageReduction(damageReduction),smart(smart),dumb(dumb){ @@ -393,6 +392,7 @@ public: int player_rollpp_counter[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; int player_rollhp_display[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; int player_rollpp_display[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; + int SELECTED_TEST_TARGET=0; bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things. @@ -599,34 +599,51 @@ goes on a very long time, I hope you can understand this is only for testing pur } } else if (member->HPtargetHP) { - if (player_rollhp_counter[i][0]>=13) { + if (player_rollhp_counter[i][0]>=0) { player_rollhp_display[i][0]++; - player_rollhp_counter[i][0]=0; + player_rollhp_counter[i][0]=-13; member->HP++; if (player_rollhp_display[i][0]>9) { player_rollhp_display[i][0]=0; - player_rollhp_counter[i][0]=0; + player_rollhp_counter[i][0]=-13; player_rollhp_display[i][1]++; - player_rollhp_counter[i][1]=0; + player_rollhp_counter[i][1]=-13; if (player_rollhp_display[i][1]>9) { player_rollhp_display[i][1]=0; - player_rollhp_counter[i][1]=0; + player_rollhp_counter[i][1]=-13; player_rollhp_display[i][2]++; - player_rollhp_counter[i][2]=0; + player_rollhp_counter[i][2]=-13; } } } - if (player_rollhp_counter[i][0]<13) { + if (player_rollhp_counter[i][0]<0) { player_rollhp_counter[i][0]+=HEALTH_ROLLING_SPEED; } - if (player_rollhp_counter[i][1]<13) { + if (player_rollhp_counter[i][1]<0) { player_rollhp_counter[i][1]++; } - if (player_rollhp_counter[i][2]<13) { + if (player_rollhp_counter[i][2]<0) { player_rollhp_counter[i][2]++; } } else { - player_rollhp_counter[i][0]=player_rollhp_counter[i][1]=player_rollhp_counter[i][2]=0; + if (player_rollhp_counter[i][0]<0) { + player_rollhp_counter[i][0]++; + } + if (player_rollhp_counter[i][1]<0) { + player_rollhp_counter[i][1]++; + } + if (player_rollhp_counter[i][2]<0) { + player_rollhp_counter[i][2]++; + } + if (player_rollhp_counter[i][0]>0) { + player_rollhp_counter[i][0]--; + } + if (player_rollhp_counter[i][1]>0) { + player_rollhp_counter[i][1]--; + } + if (player_rollhp_counter[i][2]>0) { + player_rollhp_counter[i][2]--; + } } } }break; @@ -984,6 +1001,19 @@ goes on a very long time, I hope you can understand this is only for testing pur ConsoleShow(F1,false); } + if (BATTLE_ENCOUNTER!=nullptr) { + if (GetMouseWheel()>0) { + SELECTED_TEST_TARGET=(SELECTED_TEST_TARGET+1)%4; + printf("Selected Test Target:%d\n",SELECTED_TEST_TARGET); + } + if (GetKey(PGUP).bPressed) { + PARTY_MEMBER_STATS[PARTY_MEMBER_ID[SELECTED_TEST_TARGET]]->targetHP=std::clamp(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[SELECTED_TEST_TARGET]]->targetHP+10,0,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[SELECTED_TEST_TARGET]]->maxHP); + } + if (GetKey(PGDN).bPressed) { + PARTY_MEMBER_STATS[PARTY_MEMBER_ID[SELECTED_TEST_TARGET]]->targetHP=std::clamp(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[SELECTED_TEST_TARGET]]->targetHP-10,0,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[SELECTED_TEST_TARGET]]->maxHP); + } + } + switch (GAME_STATE) { case GameState::TILE_SELECT:{ if (UpPressed()) { @@ -1569,6 +1599,7 @@ goes on a very long time, I hope you can understand this is only for testing pur void SetupPartyMemberStats() { for (int i=0;i<7;i++) { PARTY_MEMBER_STATS[i]=new Entity(120,120,30,30,8,{0,0,0,0},4,{MOVELIST[BattleMoveName::TESTMOVE1]}); + printf("HP:%d Max HP:%d",PARTY_MEMBER_STATS[i]->HP,PARTY_MEMBER_STATS[i]->maxHP); } } @@ -2107,9 +2138,9 @@ goes on a very long time, I hope you can understand this is only for testing pur FillRectDecal({(float)(pos.x+21),(float)(pos.y-2)},{28,11},olc::GREY); DrawLineDecal({(float)(pos.x+30),(float)(pos.y-3)},{(float)(pos.x+30),(float)(pos.y+10)},olc::DARK_GREY); DrawLineDecal({(float)(pos.x+40),(float)(pos.y-3)},{(float)(pos.x+40),(float)(pos.y+10)},olc::DARK_GREY); - DrawPartialDecal({(float)(pos.x+22),(float)(pos.y-1)},{7,9},SPRITES["rollingcounter.png"],{0,(float)(rollcounter[2]*13+rolloffset[2])},{7,9}); - DrawPartialDecal({(float)(pos.x+31),(float)(pos.y-1)},{7,9},SPRITES["rollingcounter.png"],{0,(float)(rollcounter[1]*13+rolloffset[1])},{7,9}); - DrawPartialDecal({(float)(pos.x+41),(float)(pos.y-1)},{7,9},SPRITES["rollingcounter.png"],{0,(float)(rollcounter[0]*13+rolloffset[0])},{7,9}); + DrawPartialDecal({(float)(pos.x+22),(float)(pos.y-1)},{7,9},SPRITES["rollingcounter.png"],{0,(float)(rollcounter[2]*13+rolloffset[2]+13)},{7,9}); + DrawPartialDecal({(float)(pos.x+31),(float)(pos.y-1)},{7,9},SPRITES["rollingcounter.png"],{0,(float)(rollcounter[1]*13+rolloffset[1]+13)},{7,9}); + DrawPartialDecal({(float)(pos.x+41),(float)(pos.y-1)},{7,9},SPRITES["rollingcounter.png"],{0,(float)(rollcounter[0]*13+rolloffset[0]+13)},{7,9}); } void ResetBattleState() {