1. %% Script for graphing the Chi generation of different Monk talents
  2.  
  3. EPS_reg=12.5; % regular energy per second unbuffed, including haste, excluding Ascension
  4.  
  5. maxLength=12*60;
  6. minLength=1*60;
  7. fightLength=(minLength:maxLength)';
  8. % PS and CB proc times
  9. timePS = [0 11:20:maxLength]; %up at fight start, then on avg. 10 sec after
  10. timeCB = 1:90:maxLength;
  11.  
  12. %Calculate Ascendance Chi generation
  13. timeEPS=1:maxLength+1;
  14. energyPerSecond=EPS_reg*ones(1,40)*1.3; %BL taken into account
  15. if(maxLength>40)
  16.     energyPerSecond=[energyPerSecond EPS_reg*ones(1,maxLength+1-40)];
  17. end
  18.  
  19. AscEPSGain=0.15*energyPerSecond;
  20. AscEnergyGain=zeros(1, numel(AscEPSGain));
  21. for k=1:numel(AscEnergyGain)
  22.     AscEnergyGain(k)=sum(AscEPSGain(1:k));
  23. end
  24. AscJabGain=floor(AscEnergyGain/40);
  25.  
  26. %Compute gained Chi
  27. chiGained=zeros(numel(fightLength),3);
  28. for i=1:numel(fightLength)
  29.     chiGained(i,1) = numel(find(timePS<fightLength(i)-2)); %2 sec to make use of PS
  30.     chiGained(i,2) = 4*numel(find(timeCB<fightLength(i)-5)); %5 sec to make use of CB
  31.     chiGained(i,3) = AscJabGain(find(timeEPS<fightLength(i),1,'last'));
  32. end
  33.  
  34. chiPerSecond=chiGained./repmat(fightLength, [1 3]);
  35.  
  36. %Uncomment for filtered lines (looks nicer)
  37. % B=fir1(30,0.01);
  38. % chiPerSecond=filtfilt(B,1,chiPerSecond);
  39. plot(fightLength/60, 60*chiPerSecond);
  40. legend('Power Strikes', 'Chi Brew', ['Ascendance (' num2str(EPS_reg) ' energy per second)']);
  41. xlabel('Fight length [min]')
  42. ylabel('Avg Chi per min')
  43. title('Chi generation talent comparison')
  44. axis([min(fightLength)/60 max(fightLength)/60 2 4]);