Skip to content

Instantly share code, notes, and snippets.

@SenpaiRar
Last active May 2, 2019 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SenpaiRar/8aa165f6f9c0108f983c1e40990e6aa7 to your computer and use it in GitHub Desktop.
Save SenpaiRar/8aa165f6f9c0108f983c1e40990e6aa7 to your computer and use it in GitHub Desktop.
1. This was the old implementation of the modifier system
public void CheckStatsForDebuffs() //
{
Sluggishness();
ShortSightedness();
}
//Debuffs and Buffs
private void Sluggishness() //Every modifier was a function in the Player_Manager Script
{
if (current_Hunger_Level < 90) //Inside every function they had their threshold check, in this case checking if
{ //if hunger is below 90
current_Speed = Max_Speed*.5f;
}
else
{
current_Speed = Max_Speed;
}
}
private void ShortSightedness() //This is another modifier
{
if (current_Water_Level < 90)
{
Player_Camera.orthographicSize = 2.5f;
}
else
{
Player_Camera.orthographicSize = 5;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment