private void OnMechCardInfoSync(MechCardInfoSyncRequest r) { ClientPlayer cp = GetPlayerByClientId(r.clientId); ModuleMech mech = cp.BattlePlayer.BattleGroundManager.GetMech(r.instanceId); mech.CardInfo = r.cardInfo.Clone(); }
private void AddRandomAttrToMech(ModuleMech mech) { Random rd = new Random(); int random = rd.Next(0, 4); switch (random) { case 0: { mech.CardInfo.BattleInfo.BasicAttack += 1; mech.M_MechAttack += 1; break; } case 1: { mech.CardInfo.BattleInfo.BasicArmor += 5; mech.M_MechArmor += 5; break; } case 2: { mech.CardInfo.BattleInfo.BasicShield += 2; mech.M_MechShield += 2; break; } case 3: { mech.CardInfo.LifeInfo.TotalLife += 3; mech.CardInfo.LifeInfo.Life += 3; mech.AddLife(3); break; } } MechCardInfoSyncRequest request = new MechCardInfoSyncRequest(mech.BattlePlayer.ClientId, mech.M_MechID, mech.CardInfo.Clone()); mech.BattlePlayer.GameManager.Broadcast_AddRequestToOperationResponse(request); }