S501501.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Player;
  5. namespace GameLogic.Combat.Skill
  6. {
  7. /// <summary>
  8. /// 前方功法照成伤害时有5%概率施加一层对应属性的伤势
  9. /// </summary>
  10. public class S501501 : SkillBasic
  11. {
  12. protected override void ProUseSkill()
  13. {
  14. }
  15. protected override void ProDispose()
  16. {
  17. CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured);
  18. }
  19. protected override void ProActiveSkill()
  20. {
  21. CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured);
  22. }
  23. private void HeroInjured(IEventData iEventData)
  24. {
  25. HeroInjuredEventData heroInjuredEventData = iEventData as HeroInjuredEventData;
  26. if (heroInjuredEventData.HarmReturnInfo.source == CombatHeroEntity)
  27. {
  28. SkillBasic skillBasic = heroInjuredEventData.HarmReturnInfo.triggerData.Source as SkillBasic;
  29. if (skillBasic != null && skillBasic.SelfSkillConfig.SkillType == 1 && skillBasic.index + 1 == index)
  30. {
  31. int odds = CombatCalculateTool.Instance.GetOdd(0, 100);
  32. if (odds < 5)
  33. {
  34. switch (skillBasic.wuXingType)
  35. {
  36. case WuXingType.Fire:
  37. heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity.CurrCombatHeroInfo
  38. .Fire_Injury += 1;
  39. break;
  40. case WuXingType.Wood:
  41. heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity.CurrCombatHeroInfo
  42. .Wood_Injury += 1;
  43. break;
  44. case WuXingType.Water:
  45. heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity.CurrCombatHeroInfo
  46. .Water_Injury += 1;
  47. break;
  48. case WuXingType.Earth:
  49. heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity.CurrCombatHeroInfo
  50. .Earth_Injury += 1;
  51. break;
  52. case WuXingType.Gold:
  53. heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity.CurrCombatHeroInfo
  54. .Metal_Injury += 1;
  55. break;
  56. }
  57. }
  58. }
  59. }
  60. }
  61. }
  62. }