b_1005.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Player;
  5. namespace GameLogic.Combat.Buff
  6. {
  7. /// <summary>
  8. /// 灼热:对敌人照成{0}火属性灼烧伤害,满层后敌人获得灼痛,有灼痛时不在获得,满层时敌人会受到痛苦,敌人使用功法时自身受到当前生命{1}%伤
  9. /// </summary>
  10. public class b_1005 : BuffBasic
  11. {
  12. private float _time;
  13. protected override void ProInit()
  14. {
  15. CombatEventManager.Instance.AddEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
  16. }
  17. private void AddUseGongFa(IEventData eventData)
  18. {
  19. AddUseGongFaEventData data = (AddUseGongFaEventData)eventData;
  20. if (data.SkillBasic.CombatHeroEntity == combatHeroEntity)
  21. {
  22. if (buffCount < buffInf.BuffConfig.overlayCount)
  23. {
  24. return;
  25. }
  26. float harmbl = buffInf.BuffConfig.effectValue[1];
  27. long harm = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  28. source.CurrCombatHeroInfo.hp.Value, harmbl);
  29. CombatCalculateTool.Instance.Harm(source, combatHeroEntity, harm, AttType.Buff, _triggerData,
  30. WuXingType.Fire,null,HarmType.Buff);
  31. }
  32. }
  33. protected override void ProUpdate(float t)
  34. {
  35. _time += t;
  36. if (_time >= 1)
  37. {
  38. _time -= 1;
  39. float harmbl = buffCount * buffInf.BuffConfig.effectValue[0];
  40. long harm = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  41. source.CurrCombatHeroInfo.attack.Value, harmbl);
  42. harm += CombatCalculateTool.Instance.GetVlaueRatioForLong(
  43. harm, source.CurrCombatHeroInfo.Fire_Proficient);
  44. CombatCalculateTool.Instance.Harm(source, combatHeroEntity, harm, AttType.Buff, _triggerData,
  45. WuXingType.Fire, null, HarmType.Buff);
  46. }
  47. }
  48. // protected override void ProUpdateEffect()
  49. // {
  50. // if (buffCount >= buffInf.BuffConfig.overlayCount) //最大叠加数量
  51. // {
  52. // b_1010 b1010 = combatHeroEntity.BuffControl.GetBuffBasicForType<b_1010>();
  53. // if (b1010 != null)
  54. // {
  55. // return;
  56. // }
  57. //
  58. // BuffInfo buffInfo = BuffInfo.GetBuffInfo(10101, 1,this);
  59. // combatHeroEntity.BuffControl.AddBuff(source, buffInfo);
  60. // // combatHeroEntity.BuffControl.RemoveBuff(this);
  61. // }
  62. // }
  63. protected override void ProDormancyObj()
  64. {
  65. CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
  66. }
  67. }
  68. }