Skip to content

Instantly share code, notes, and snippets.

@s2kw
Created March 17, 2015 11:59
Show Gist options
  • Save s2kw/4fa0d2debae7017faaec to your computer and use it in GitHub Desktop.
Save s2kw/4fa0d2debae7017faaec to your computer and use it in GitHub Desktop.
memo for angry ability fact
float GetFact( float ownersHp ){
var skillFactValue = 3f; // 適当
var ownersMaxHp = 1000f; // 適当
ownersHp = ownersMaxHp < ownersHp ? ownersMaxHp : ownersHp;
float currentDamage = ownersMaxHp - ownersHp;
var rate = currentDamage / ( ownersMaxHp - ( ownersMaxHp * 0.1f ) );
rate = rate > 1f ? 1f : rate;
return Mathf.Lerp(1f, skillFactValue, rate );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment