Enhancement.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. using System;
  2. using System.Collections.Generic;
  3. using GameWorld;
  4. namespace SaveDataModel
  5. {
  6. public class Enhancement
  7. {
  8. static Dictionary<string, int> _003C_003Ef__switch_0024map19;
  9. public Enhancement()
  10. {
  11. this.SetToDefault();
  12. }
  13. public int this[string name]
  14. {
  15. get
  16. {
  17. switch (name)
  18. {
  19. case "attack":
  20. return this.Attack;
  21. case "knockout":
  22. return this.Knockout;
  23. case "avatarAttack":
  24. return this.AvatarAttack;
  25. case "airAttack":
  26. return this.AirAttack;
  27. case "airCombo2":
  28. return this.AirCombo2;
  29. case "airAvatarAttack":
  30. return this.AirAvatarAttack;
  31. case "airCombo1":
  32. return this.AirCombo1;
  33. case "tripleAttack":
  34. return this.TripleAttack;
  35. case "combo2":
  36. return this.Combo2;
  37. case "upperChop":
  38. return this.UpperChop;
  39. case "combo1":
  40. return this.Combo1;
  41. case "bladeStorm":
  42. return this.BladeStorm;
  43. case "shadeAttack":
  44. return this.ShadeAttack;
  45. case "charging":
  46. return this.Charging;
  47. case "chase":
  48. return this.Chase;
  49. case "hitGround":
  50. return this.HitGround;
  51. case "maxHP":
  52. return this.MaxHp;
  53. case "maxEnergy":
  54. return this.MaxEnergy;
  55. case "flashAttack":
  56. return this.FlashAttack;
  57. case "recover":
  58. return this.Recover;
  59. }
  60. throw new ArgumentOutOfRangeException("name", name, "This skill is not exist.");
  61. }
  62. set
  63. {
  64. if (name != null)
  65. {
  66. if (Enhancement._003C_003Ef__switch_0024map19 == null)
  67. {
  68. Enhancement._003C_003Ef__switch_0024map19 = new Dictionary<string, int>(20)
  69. {
  70. {
  71. "attack",
  72. 0
  73. },
  74. {
  75. "knockout",
  76. 1
  77. },
  78. {
  79. "avatarAttack",
  80. 2
  81. },
  82. {
  83. "airAttack",
  84. 3
  85. },
  86. {
  87. "airCombo2",
  88. 4
  89. },
  90. {
  91. "airAvatarAttack",
  92. 5
  93. },
  94. {
  95. "airCombo1",
  96. 6
  97. },
  98. {
  99. "tripleAttack",
  100. 7
  101. },
  102. {
  103. "combo2",
  104. 8
  105. },
  106. {
  107. "upperChop",
  108. 9
  109. },
  110. {
  111. "combo1",
  112. 10
  113. },
  114. {
  115. "bladeStorm",
  116. 11
  117. },
  118. {
  119. "shadeAttack",
  120. 12
  121. },
  122. {
  123. "charging",
  124. 13
  125. },
  126. {
  127. "chase",
  128. 14
  129. },
  130. {
  131. "hitGround",
  132. 15
  133. },
  134. {
  135. "maxHP",
  136. 16
  137. },
  138. {
  139. "maxEnergy",
  140. 17
  141. },
  142. {
  143. "flashAttack",
  144. 18
  145. },
  146. {
  147. "recover",
  148. 19
  149. }
  150. };
  151. }
  152. int num;
  153. if (Enhancement._003C_003Ef__switch_0024map19.TryGetValue(name, out num))
  154. {
  155. switch (num)
  156. {
  157. case 0:
  158. this.Attack = value;
  159. break;
  160. case 1:
  161. this.Knockout = value;
  162. break;
  163. case 2:
  164. this.AvatarAttack = value;
  165. break;
  166. case 3:
  167. this.AirAttack = value;
  168. break;
  169. case 4:
  170. this.AirCombo2 = value;
  171. break;
  172. case 5:
  173. this.AirAvatarAttack = value;
  174. break;
  175. case 6:
  176. this.AirCombo1 = value;
  177. break;
  178. case 7:
  179. this.TripleAttack = value;
  180. break;
  181. case 8:
  182. this.Combo2 = value;
  183. break;
  184. case 9:
  185. this.UpperChop = value;
  186. break;
  187. case 10:
  188. this.Combo1 = value;
  189. break;
  190. case 11:
  191. this.BladeStorm = value;
  192. break;
  193. case 12:
  194. this.ShadeAttack = value;
  195. break;
  196. case 13:
  197. this.Charging = value;
  198. break;
  199. case 14:
  200. this.Chase = value;
  201. break;
  202. case 15:
  203. this.HitGround = value;
  204. break;
  205. case 16:
  206. this.MaxHp = value;
  207. break;
  208. case 17:
  209. this.MaxEnergy = value;
  210. break;
  211. case 18:
  212. this.FlashAttack = value;
  213. break;
  214. case 19:
  215. this.Recover = value;
  216. break;
  217. case 20:
  218. goto IL_27A;
  219. default:
  220. goto IL_27A;
  221. }
  222. return;
  223. }
  224. }
  225. IL_27A:
  226. throw new KeyNotFoundException();
  227. }
  228. }
  229. public void SetAllTo(int value)
  230. {
  231. this.Attack = value;
  232. this.Knockout = value;
  233. this.AvatarAttack = value;
  234. this.AirAttack = value;
  235. this.AirCombo2 = value;
  236. this.AirAvatarAttack = value;
  237. this.AirCombo1 = value;
  238. this.TripleAttack = value;
  239. this.Combo2 = value;
  240. this.UpperChop = value;
  241. this.Combo1 = value;
  242. this.BladeStorm = value;
  243. this.ShadeAttack = value;
  244. this.Charging = value;
  245. this.Chase = value;
  246. this.HitGround = value;
  247. this.MaxHp = value;
  248. this.Post("maxHP", value);
  249. this.MaxEnergy = value;
  250. this.FlashAttack = value;
  251. this.Recover = value;
  252. R.Player.Attribute.flashLevel = value;
  253. }
  254. public void SetToDefault()
  255. {
  256. this.Attack = 1;
  257. this.Knockout = 0;
  258. this.AvatarAttack = 0;
  259. this.AirAttack = 1;
  260. this.AirCombo2 = 0;
  261. this.AirCombo1 = 0;
  262. this.AirAvatarAttack = 0;
  263. this.AirCombo1 = 1;
  264. this.TripleAttack = 1;
  265. this.Combo2 = 0;
  266. this.UpperChop = 1;
  267. this.Combo1 = 1;
  268. this.BladeStorm = 0;
  269. this.ShadeAttack = 0;
  270. this.Charging = 1;
  271. this.Chase = 0;
  272. this.HitGround = 1;
  273. this.MaxHp = 1;
  274. this.MaxEnergy = 1;
  275. this.FlashAttack = 1;
  276. this.Recover = 1;
  277. }
  278. public void Post(string name, int upToLevel)
  279. {
  280. EventManager.PostEvent<Enhancement, EnhanceArgs>("EnhanceLevelup", this, new EnhanceArgs(name, upToLevel));
  281. }
  282. public int AirAttack;
  283. public int AirAvatarAttack;
  284. public int AirCombo1;
  285. public int AirCombo2;
  286. public int Attack;
  287. public int AvatarAttack;
  288. public int BladeStorm;
  289. public int Charging;
  290. public int Chase;
  291. public int Combo1;
  292. public int Combo2;
  293. public int FlashAttack;
  294. public int HitGround;
  295. public int Knockout;
  296. public int MaxEnergy;
  297. public int MaxHp;
  298. public int ShadeAttack;
  299. public int TripleAttack;
  300. public int UpperChop;
  301. public int Recover;
  302. }
  303. }