Advertisement
Tkap1

Untitled

Jan 20th, 2023
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1.  
  2.  
  3. float chill_effect = 0.2;
  4. Stat stat = {.base = chill_effect};
  5. // ...
  6.  
  7. // This will totally stop the enemy if final_effect is >= 1
  8. float final_effect = calculate_stat(stat);
  9. enemy_speed *= 1 - min(1, final_effect);
  10.  
  11. // This makes increasing chill weaker and weaker. Will never completely stop the enemy
  12. float final_effect = 1 / (1 + calculate_stat(stat));
  13. enemy_speed *= final_effect;
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement