Monster_1510003.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. 
  2. using CommonLang;
  3. using XmdsCommonServer.Plugin;
  4. using XmdsCommonServer.XLS.Data;
  5. namespace XmdsCommonSkill.Plugin.Skills.Monster
  6. {
  7. /// <summary>
  8. /// 死亡使者(瑞沙德) - 死亡祭台: 读条2秒后,对当前目标施放致命一击,伤害视目标血量而定,目标血量越低伤害越高(魔法).
  9. /// </summary>
  10. public class Monster_1510003 : XmdsSkillBase
  11. {
  12. public static int ID = 1510003;
  13. public static XmdsSkillValue DP_1;
  14. public override int SkillID { get { return ID; } }
  15. protected override void OnSkillDamagePerEvent(BattleParams param)
  16. {
  17. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  18. param.SkillDamagePer = calculator(param, ret);
  19. }
  20. // 目标血量越低伤害越高.
  21. private int calculator(BattleParams param, int ret)
  22. {
  23. float p = param.Hitter.MirrorProp.HP / param.Hitter.mUnit.MaxHP;
  24. if (p < 0.8)
  25. {
  26. ret = CUtils.CastInt((1 + 0.2) * ret);
  27. }
  28. else if (p < 0.5)
  29. {
  30. ret = CUtils.CastInt((1 + 0.5) * ret);
  31. }
  32. else if (p < 0.1)
  33. {
  34. ret = CUtils.CastInt((1 + 1) * ret);
  35. }
  36. return ret;
  37. }
  38. protected override void OnInitSkillParam()
  39. {
  40. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  41. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  42. }
  43. }
  44. }