Advertisement
Tkap1

Untitled

Oct 17th, 2022
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1.  
  2. when_projectile_hits()
  3. {
  4.     float damage = calculate_stat(projectile.damageStat);
  5.    
  6.     if(how_many_times_chained > 0)
  7.     {
  8.         float falloff = calculate_stat_ignore_base(projectile.falloffStat) * (1 / BASE_FALLOFF);
  9.         falloff = 1 / falloff;
  10.         falloff = min(1, falloff);
  11.         falloff = max(0, falloff);
  12.         float nerf_based_on_chains = powf(falloff, how_many_times_chained);
  13.         damage *= nerf_based_on_chains;
  14.     }
  15. }
  16.  
  17. calculate_stat_ignore_base(Stat stat)
  18. {
  19.     stat.base = 1;
  20.     return calculate_stat(stat);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement