Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void AddXP(uint exp)
- {
- while (exp > 0)
- {
- uint deltaExp = Math.Min(exp, _model.NextLevelExp / 5);
- _model.PlayerExp += deltaExp;
- uint ccpsIndex = _model.PlayerExp / (_model.NextLevelExp / 5);
- if (!_additionalCCPs[ccpsIndex]) //We haven't added bonus point yet
- {
- _additionalCCPs[ccpsIndex] = true;
- _model.CPPs += 1;
- }
- if (_model.PlayerExp >= _model.NextLevelExp && _model.CharacterLevel < 100)
- {
- LevelUp();
- }
- else if (_model.CharacterLevel == 100)
- {
- _model.PlayerExp = _model.NextLevelExp;
- }
- exp -= deltaExp;
- SavePlayerStats();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement