示例#1
0
        public override void OnPlayerLeave(ObjPlayer player)
        {
            base.OnPlayerLeave(player);

            //恢复满血满蓝
            if (player.IsDead())
            {
                player.Relive();
            }
            else
            {
                player.Attr.SetDataValue(eAttributeType.HpNow, player.Attr.GetDataValue(eAttributeType.HpMax));
                player.Attr.SetDataValue(eAttributeType.MpNow, player.Attr.GetDataValue(eAttributeType.MpMax));
            }

            var campId = player.GetCamp();

            if (campId == -1)
            {
                player.SetCamp(0);
                return;
            }
            var camp = Camps[campId];

            camp.Players.Remove(player);
            player.SetCamp(0);

            CoroutineFactory.NewCoroutine(PlayerLeave, player).MoveNext();
        }
示例#2
0
 private void ResetPlayer(ObjPlayer player)
 {
     player.SetCamp(0);
     if (player.IsDead())
     {
         player.Relive();
     }
     else
     {
         player.Attr.SetDataValue(eAttributeType.HpNow, player.Attr.GetDataValue(eAttributeType.HpMax));
         player.Attr.SetDataValue(eAttributeType.MpNow, player.Attr.GetDataValue(eAttributeType.MpMax));
     }
 }