Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }