Advertisement
_PoY

<<GSC>> Flail Ranges

Dec 8th, 2020 (edited)
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.13 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int getFlailDmg(int,int);
  5. void displayFlailHPRanges(int,int);
  6.  
  7. int main(){
  8.     int LOW_MAXHP = 70, HIGH_MAXHP = 95;
  9.    
  10.     displayFlailHPRanges(LOW_MAXHP, HIGH_MAXHP);
  11. }
  12.  
  13. void displayFlailHPRanges(int LOW_MAXHP, int HIGH_MAXHP)
  14. {
  15.    
  16.     int oldDmg = 200;
  17.     printf("[BP] [200]  [150]  [100]   [80]   [40]   [20]");
  18.     for(int maxHP = LOW_MAXHP; maxHP <= HIGH_MAXHP; maxHP++){
  19.         printf("\n%3d : %d", maxHP, 1);
  20.        
  21.         for(int currHP = 1; currHP <= maxHP; currHP++){
  22.             int dmg = getFlailDmg(currHP, maxHP);
  23.            
  24.             if(dmg != oldDmg){
  25.                 oldDmg = dmg;
  26.                 printf("-%2d, %2d", currHP -1, currHP);
  27.             }
  28.         }
  29.         printf("-%2d", maxHP);
  30.         oldDmg = 200;
  31.     }
  32. }
  33.  
  34. int getFlailDmg(int currHP, int maxHP){
  35.     int px = currHP * 48 / maxHP;
  36.     if (px < 1) px = 1;
  37.    
  38.     int dmg;
  39.     if(px <= 1) dmg = 200;
  40.     else if (px <= 4) dmg = 150;
  41.     else if (px <= 9) dmg = 100;
  42.     else if (px <=16) dmg =  80;
  43.     else if (px <=32) dmg =  40;
  44.     else dmg = 20;
  45.    
  46.     return dmg;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement