Example #1
0
        private PlayerDamageInfo GetDamageInfo(IEventArgs args)
        {
            SimpleParable sp = (SimpleParable)args.GetUnit("damage");

            if (sp != null)
            {
                return
                    ((PlayerDamageInfo)((ObjectFields)((SimpleParaList)sp.GetParameters()).GetFieldList()[0]).GetObj());
            }
            else
            {
                return(new PlayerDamageInfo());
            }
        }
Example #2
0
 private void HandleArmor(IEventArgs args)
 {
     if ("ReduceDamage" == code)
     {
         FreeData fd = (FreeData)args.GetUnit("target");
         if (fd != null)
         {
             SimpleParable sp = (SimpleParable)args.GetUnit("damage");
             if (sp != null)
             {
                 PlayerDamageInfo info = (PlayerDamageInfo)((ObjectFields)((SimpleParaList)sp.GetParameters()).GetFieldList()[0]).GetObj();
                 float            da   = ReduceDamageUtil.HandleDamage(args, fd, info);
                 FloatPara        d    = (FloatPara)args.GetDefault().GetParameters().Get("damage");
                 if (d != null)
                 {
                     d.SetValue(da);
                 }
             }
         }
     }
 }