ResultTrainingTask.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using System;
  2. using BackupParamAccessor;
  3. using PlayerStatus;
  4. using UnityEngine;
  5. namespace Schedule
  6. {
  7. public class ResultTrainingTask : ResultBaseTask
  8. {
  9. public ResultTrainingTask(WorkResultSlot slot, int workId, ResultWorkMgr.ResultType resultType)
  10. {
  11. base.Init(slot, workId, resultType);
  12. this.CalcParam();
  13. this.UpdateIcon();
  14. }
  15. public int lv
  16. {
  17. get
  18. {
  19. return ScheduleAPI.NoonWorkPlayToLv(ScheduleAPI.NoonWorkPlayCount(base.maid, base.id));
  20. }
  21. }
  22. public int revision
  23. {
  24. get
  25. {
  26. return ScheduleAPI.NoonWorkLvToRevision(this.lv);
  27. }
  28. }
  29. public bool communicationBonus
  30. {
  31. get
  32. {
  33. bool result = false;
  34. if (this.resultType == ResultWorkMgr.ResultType.Daytime)
  35. {
  36. result = GameMain.Instance.CharacterMgr.status.scheduleSlot[base.slot.slotId].noon_communication;
  37. }
  38. else if (this.resultType == ResultWorkMgr.ResultType.Night)
  39. {
  40. result = GameMain.Instance.CharacterMgr.status.scheduleSlot[base.slot.slotId].night_communication;
  41. }
  42. return result;
  43. }
  44. }
  45. public ScheduleData.WorkSuccessLv successLv
  46. {
  47. get
  48. {
  49. ScheduleData.WorkSuccessLv result = ScheduleData.WorkSuccessLv.Miss;
  50. if (this.resultType == ResultWorkMgr.ResultType.Daytime)
  51. {
  52. result = GameMain.Instance.CharacterMgr.status.scheduleSlot[base.slot.slotId].noon_success_level;
  53. }
  54. else if (this.resultType == ResultWorkMgr.ResultType.Night)
  55. {
  56. result = GameMain.Instance.CharacterMgr.status.scheduleSlot[base.slot.slotId].night_success_level;
  57. }
  58. return result;
  59. }
  60. }
  61. protected void CalcParam()
  62. {
  63. if (base.slot.textureBank != null)
  64. {
  65. this._icon = base.slot.textureBank.GetTexture(ScheduleCSVData.AllData[base.id].icon);
  66. }
  67. if (base.maid.status.GetFlag("_communication") > 0)
  68. {
  69. this.uppedParams.likability = 5;
  70. this.uppedParamsWithoutCommunicationBonus.likability = 5;
  71. }
  72. if (base.maid != null && base.maid.status.selectedJobClass != null && base.maid.status.selectedJobClass.level == base.maid.status.selectedJobClass.expSystem.GetMaxLevel())
  73. {
  74. this.maidLvMax = true;
  75. if (this.uppedParams.maidClassLv > 0)
  76. {
  77. this.maidLvCompletion = true;
  78. }
  79. }
  80. }
  81. protected override void CalcParam(SCENE_ID baseId)
  82. {
  83. Params backupParams = BackupParamAccessor.GetBackupParams(base.slot.slotId, baseId - 1);
  84. Params backupParams2 = BackupParamAccessor.GetBackupParams(base.slot.slotId, baseId);
  85. Params backupParams3 = BackupParamAccessor.GetBackupParams(base.slot.slotId, baseId + 1);
  86. this.uppedParamsWithoutCommunicationBonus = backupParams2 - backupParams;
  87. this.uppedParams = backupParams3 - backupParams;
  88. }
  89. protected void UpdateIcon()
  90. {
  91. this.successLv_icon = null;
  92. this.bonus_icon = null;
  93. if (base.maid != null && base.slot.textureBank != null)
  94. {
  95. switch (this.successLv)
  96. {
  97. case ScheduleData.WorkSuccessLv.Miss:
  98. case ScheduleData.WorkSuccessLv.Unexecuted:
  99. this.successLvName = "CM3D2_work_result_mark_sippai";
  100. this.bonus_icon = base.slot.textureBank.GetTexture("CM3D2_work_result_mark_sippai2");
  101. break;
  102. case ScheduleData.WorkSuccessLv.Success:
  103. this.successLvName = "CM3D2_work_result_mark_seikou";
  104. this.bonus_icon = base.slot.textureBank.GetTexture("CM3D2_work_result_mark_seikou2");
  105. break;
  106. case ScheduleData.WorkSuccessLv.Perfect:
  107. this.successLvName = "CM3D2_work_result_mark_daiseikou";
  108. this.bonus_icon = base.slot.textureBank.GetTexture("CM3D2_work_result_mark_daiseikou2");
  109. break;
  110. }
  111. if (this.communicationBonus)
  112. {
  113. this.bonus_icon = base.slot.textureBank.GetTexture("CM3D2_work_result_mark_commubonus");
  114. }
  115. this.successLv_icon = base.slot.textureBank.GetTexture(this.successLvName);
  116. this.commonSuccessLv = this.successLv;
  117. }
  118. }
  119. public Params uppedParamsWithoutCommunicationBonus;
  120. [Obsolete("Sry. This prm is obsolete. Plz use 'uppedParamsWithoutCommunicationBonus' and 'uppedParams' instead. frm F.", false)]
  121. public ScheduleAPI.TrainingResultSimulateParam simulateParams;
  122. public Texture2D bonus_icon;
  123. public bool maidLvCompletion;
  124. public bool maidLvMax;
  125. }
  126. }