YotogiPlay.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. public static class YotogiPlay
  5. {
  6. public static Yotogi.ExcitementStatus GetExcitementStatus(int excite)
  7. {
  8. if (excite < 0)
  9. {
  10. return Yotogi.ExcitementStatus.Minus;
  11. }
  12. if (excite < 100)
  13. {
  14. return Yotogi.ExcitementStatus.Small;
  15. }
  16. if (excite < 200)
  17. {
  18. return Yotogi.ExcitementStatus.Medium;
  19. }
  20. return Yotogi.ExcitementStatus.Large;
  21. }
  22. public static Yotogi.RCType GetRCType(int before_excite, int current_excite)
  23. {
  24. if (before_excite <= 199 && 200 <= current_excite)
  25. {
  26. return Yotogi.RCType.RC2;
  27. }
  28. if (before_excite <= 99 && 100 <= current_excite)
  29. {
  30. return Yotogi.RCType.RC1;
  31. }
  32. if (before_excite <= -1 && 0 <= current_excite)
  33. {
  34. return Yotogi.RCType.RC0;
  35. }
  36. return Yotogi.RCType.RCNull;
  37. }
  38. public static Yotogi.RRCType GetRRCType(int before_excite, int current_excite)
  39. {
  40. if (before_excite == current_excite && current_excite == 300)
  41. {
  42. return Yotogi.RRCType.RRC9;
  43. }
  44. Func<int, bool> func = delegate(int thresholdNum)
  45. {
  46. if (thresholdNum < 0)
  47. {
  48. return (before_excite <= thresholdNum && thresholdNum < current_excite) || (before_excite > thresholdNum && thresholdNum >= current_excite);
  49. }
  50. return before_excite < thresholdNum && thresholdNum <= current_excite;
  51. };
  52. foreach (KeyValuePair<int, Yotogi.RRCType> keyValuePair in new List<KeyValuePair<int, Yotogi.RRCType>>
  53. {
  54. new KeyValuePair<int, Yotogi.RRCType>(-50, Yotogi.RRCType.RRC_2),
  55. new KeyValuePair<int, Yotogi.RRCType>(-25, Yotogi.RRCType.RRC_1),
  56. new KeyValuePair<int, Yotogi.RRCType>(25, Yotogi.RRCType.RRC1),
  57. new KeyValuePair<int, Yotogi.RRCType>(50, Yotogi.RRCType.RRC2),
  58. new KeyValuePair<int, Yotogi.RRCType>(75, Yotogi.RRCType.RRC3),
  59. new KeyValuePair<int, Yotogi.RRCType>(125, Yotogi.RRCType.RRC4),
  60. new KeyValuePair<int, Yotogi.RRCType>(150, Yotogi.RRCType.RRC5),
  61. new KeyValuePair<int, Yotogi.RRCType>(175, Yotogi.RRCType.RRC6),
  62. new KeyValuePair<int, Yotogi.RRCType>(225, Yotogi.RRCType.RRC7),
  63. new KeyValuePair<int, Yotogi.RRCType>(250, Yotogi.RRCType.RRC8),
  64. new KeyValuePair<int, Yotogi.RRCType>(275, Yotogi.RRCType.RRC9),
  65. new KeyValuePair<int, Yotogi.RRCType>(300, Yotogi.RRCType.RRC9)
  66. })
  67. {
  68. if (func(keyValuePair.Key))
  69. {
  70. return keyValuePair.Value;
  71. }
  72. }
  73. return Yotogi.RRCType.RRCNull;
  74. }
  75. public static Yotogi.RRType GetRRType(int current_excite)
  76. {
  77. int num = Math.Abs(current_excite) / 50;
  78. if (current_excite < 0)
  79. {
  80. num++;
  81. if (2 < num)
  82. {
  83. num = 2;
  84. }
  85. num *= -1;
  86. }
  87. else if (5 < num)
  88. {
  89. num = 5;
  90. }
  91. return Yotogi.RRType.RR1 + num;
  92. }
  93. public enum PlayerState
  94. {
  95. Normal,
  96. Insert
  97. }
  98. public struct Param
  99. {
  100. public static YotogiPlay.Param Create(Maid maid)
  101. {
  102. Status status = maid.status;
  103. return new YotogiPlay.Param
  104. {
  105. currentExcite = status.currentExcite,
  106. currentMind = status.currentMind,
  107. cur_sensory = status.currentSensual,
  108. inyoku = status.inyoku,
  109. m_value = status.mvalue,
  110. hentai = status.hentai,
  111. housi = status.housi,
  112. lovely = status.lovely,
  113. elegance = status.elegance,
  114. charm = status.charm,
  115. reception = status.reception,
  116. teach_rate = status.teachRate,
  117. yotogi_type_level = status.selectedJobClass.level,
  118. yotogi_type_total_exp = status.selectedJobClass.expSystem.GetTotalExp()
  119. };
  120. }
  121. public static YotogiPlay.Param operator +(YotogiPlay.Param a, YotogiPlay.Param b)
  122. {
  123. return new YotogiPlay.Param
  124. {
  125. currentExcite = a.currentExcite + b.currentExcite,
  126. currentMind = a.currentMind + b.currentMind,
  127. cur_sensory = a.cur_sensory + b.cur_sensory,
  128. inyoku = a.inyoku + b.inyoku,
  129. m_value = a.m_value + b.m_value,
  130. hentai = a.hentai + b.hentai,
  131. housi = a.housi + b.housi,
  132. lovely = a.lovely + b.lovely,
  133. elegance = a.elegance + b.elegance,
  134. charm = a.charm + b.charm,
  135. reception = a.reception + b.reception,
  136. teach_rate = a.teach_rate + b.teach_rate,
  137. yotogi_type_level = a.yotogi_type_level + b.yotogi_type_level,
  138. yotogi_type_total_exp = a.yotogi_type_total_exp + b.yotogi_type_total_exp
  139. };
  140. }
  141. public static YotogiPlay.Param operator -(YotogiPlay.Param a, YotogiPlay.Param b)
  142. {
  143. return new YotogiPlay.Param
  144. {
  145. currentExcite = a.currentExcite - b.currentExcite,
  146. currentMind = a.currentMind - b.currentMind,
  147. cur_sensory = a.cur_sensory - b.cur_sensory,
  148. inyoku = a.inyoku - b.inyoku,
  149. m_value = a.m_value - b.m_value,
  150. hentai = a.hentai - b.hentai,
  151. housi = a.housi - b.housi,
  152. lovely = a.lovely - b.lovely,
  153. elegance = a.elegance - b.elegance,
  154. charm = a.charm - b.charm,
  155. reception = a.reception - b.reception,
  156. teach_rate = a.teach_rate - b.teach_rate,
  157. yotogi_type_level = a.yotogi_type_level - b.yotogi_type_level,
  158. yotogi_type_total_exp = a.yotogi_type_total_exp - b.yotogi_type_total_exp
  159. };
  160. }
  161. public int currentExcite;
  162. public int currentMind;
  163. public int cur_sensory;
  164. public int inyoku;
  165. public int m_value;
  166. public int hentai;
  167. public int housi;
  168. public int lovely;
  169. public int elegance;
  170. public int charm;
  171. public int reception;
  172. public int teach_rate;
  173. public int yotogi_type_level;
  174. public int yotogi_type_total_exp;
  175. }
  176. }