您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

58 行
1.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using SUISS.Core;
  4. using SUISSEngine;
  5. public class LevelUpItem : IPackEffect
  6. {
  7. public LevelUpItem(Dictionary<string, object> props)
  8. {
  9. this._levels = (int)((double)props["Levels"]);
  10. }
  11. public LevelUpItem(int levels)
  12. {
  13. this._levels = levels;
  14. }
  15. public int Levels
  16. {
  17. get
  18. {
  19. return this._levels;
  20. }
  21. }
  22. public void ApplyEffect()
  23. {
  24. if (this._levels > 0)
  25. {
  26. CIGGameState instance = SingletonMonobehaviour<CIGGameState>.Instance;
  27. decimal xpForLevelsUp = instance.GetXpForLevelsUp(this._levels);
  28. instance.EarnCurrencies(new Currencies("XP", xpForLevelsUp), null);
  29. }
  30. }
  31. public static LevelUpItem FromStorage(Dictionary<string, object> dict)
  32. {
  33. return new LevelUpItem((int)dict["Levels"]);
  34. }
  35. public Dictionary<string, object> ToStorage()
  36. {
  37. return new Dictionary<string, object>
  38. {
  39. {
  40. "Levels",
  41. this.Levels
  42. }
  43. };
  44. }
  45. public const decimal GoldCompensationPerLevel = 50m;
  46. public const string LevelsKey = "Levels";
  47. private int _levels;
  48. }