void On_ShieldChanged(ModuleShield newShield) //更换防具时机体基础护甲护盾恢复 { if (m_Shield != null) { if (!M_Shield.CardInfo.BaseInfo.IsTemp) { BattlePlayer.CardDeckManager.CardDeck.RecycleCardInstanceID(m_Shield.OriginCardInstanceId); } m_Shield.UnRegisterSideEffect(); } m_Shield = newShield; BattlePlayer.GameManager.EventManager.Invoke(SideEffectExecute.TriggerTime.OnEquipEquiped, new ExecutorInfo(clientId: BattlePlayer.ClientId, mechId: M_MechID, equipId: m_Shield.M_EquipID)); EquipShieldServerRequest request = new EquipShieldServerRequest(BattlePlayer.ClientId, (CardInfo_Equip)newShield.GetCurrentCardInfo(), M_MechID, m_Shield.M_EquipID); BattlePlayer.MyClientProxy.BattleGameManager.Broadcast_AddRequestToOperationResponse(request); int shield_before = m_MechShield; int armor_before = m_MechArmor; m_MechShield = CardInfo.BattleInfo.BasicShield + newShield.CardInfo.ShieldInfo.Shield; m_MechArmor = CardInfo.BattleInfo.BasicArmor + newShield.CardInfo.ShieldInfo.Armor; MechAttributesChangeRequest request2 = new MechAttributesChangeRequest(BattlePlayer.ClientId, M_MechID, addShield: m_MechShield - shield_before, addArmor: m_MechArmor - armor_before); BattlePlayer.MyClientProxy.BattleGameManager.Broadcast_AddRequestToOperationResponse(request2); }
void On_ShieldDown() { if (m_Shield != null) { if (!M_Shield.CardInfo.BaseInfo.IsTemp) { BattlePlayer.CardDeckManager.CardDeck.RecycleCardInstanceID(m_Shield.OriginCardInstanceId); } BattlePlayer.GameManager.EventManager.Invoke(SideEffectExecute.TriggerTime.OnEquipDie, new ExecutorInfo(clientId: BattlePlayer.ClientId, mechId: M_MechID, equipId: m_Shield.M_EquipID)); m_Shield.UnRegisterSideEffect(); EquipShieldServerRequest request = new EquipShieldServerRequest(BattlePlayer.ClientId, null, M_MechID, m_Shield.M_EquipID); BattlePlayer.MyClientProxy.BattleGameManager.Broadcast_AddRequestToOperationResponse(request); m_Shield = null; int addShield = 0; if (m_MechShield >= CardInfo.BattleInfo.BasicShield) { addShield = CardInfo.BattleInfo.BasicShield - m_MechShield; } int addArmor = 0; if (m_MechArmor >= CardInfo.BattleInfo.BasicArmor) { addArmor = CardInfo.BattleInfo.BasicArmor - m_MechArmor; } MechAttributesChangeRequest request2 = new MechAttributesChangeRequest(BattlePlayer.ClientId, M_MechID, addShield: addShield, addArmor: addArmor); BattlePlayer.MyClientProxy.BattleGameManager.Broadcast_AddRequestToOperationResponse(request2); } }
public void EquipShield(CardInfo_Equip cardInfo, int equipId) { ModuleShield newShield = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.ModuleShield].AllocateGameObject <ModuleShield>(transform); newShield.M_ModuleMech = Mech; newShield.Initiate(cardInfo, Mech.ClientPlayer); newShield.M_EquipID = equipId; newShield.transform.position = EquipPivots[1].position; M_Shield = newShield; }
public void EquipShield(EquipShieldRequest r, CardInfo_Base cardInfo) { ModuleShield shield = new ModuleShield(); CardInfo_Equip cardInfo_Shield = (CardInfo_Equip)cardInfo; ModuleMech mech = GetMech(r.mechID); shield.M_ModuleMech = mech; shield.M_EquipID = BattlePlayer.GameManager.GenerateNewEquipId(); shield.Initiate(cardInfo_Shield, BattlePlayer); shield.OriginCardInstanceId = r.handCardInstanceId; mech.M_Shield = shield; BattlePlayer.CardDeckManager.CardDeck.AddCardInstanceId(cardInfo.CardID, r.handCardInstanceId); }
void On_ShieldEquiped(ModuleShield newShield) { m_Shield = newShield; BattlePlayer.GameManager.EventManager.Invoke(SideEffectExecute.TriggerTime.OnEquipEquiped, new ExecutorInfo(clientId: BattlePlayer.ClientId, mechId: M_MechID, equipId: m_Shield.M_EquipID)); EquipShieldServerRequest request = new EquipShieldServerRequest(BattlePlayer.ClientId, (CardInfo_Equip)newShield.GetCurrentCardInfo(), M_MechID, m_Shield.M_EquipID); BattlePlayer.MyClientProxy.BattleGameManager.Broadcast_AddRequestToOperationResponse(request); int shield_before = m_MechShield; int armor_before = m_MechArmor; m_MechArmor += newShield.CardInfo.ShieldInfo.Armor; m_MechShield += newShield.CardInfo.ShieldInfo.Shield; MechAttributesChangeRequest request2 = new MechAttributesChangeRequest(BattlePlayer.ClientId, M_MechID, addShield: m_MechShield - shield_before, addArmor: m_MechArmor - armor_before); BattlePlayer.MyClientProxy.BattleGameManager.Broadcast_AddRequestToOperationResponse(request2); }