Exemplo n.º 1
0
 private void HandleSpecialWeaponAttack()
 {
     if (m_handItemType == 109)
     {
         Object.Instantiate(m_digEffectPrefab, base.transform.position + base.transform.forward * 0.3f, Quaternion.identity);
     }
     else if (m_handItemType == 110)
     {
         Vector3 vector = base.transform.position + base.transform.forward * 3.5f;
         if (0.8f > Util.GetTerrainHeight(vector))
         {
             Object.Instantiate(m_waterEffectPrefab, vector, Quaternion.identity);
             return;
         }
         GameObject gameObject = (GameObject)Object.Instantiate(m_textEffectPrefab, base.transform.position + Vector3.up * 3f, Quaternion.identity);
         TextLNG    component  = gameObject.GetComponent <TextLNG>();
         component.m_lngKey = "EVENT_NOWATER";
     }
 }
Exemplo n.º 2
0
    public void OnSpecialEvent(eSpecialEvent a_event)
    {
        string  text     = string.Empty;
        Vector3 position = Vector3.zero;

        switch (a_event)
        {
        case eSpecialEvent.itemBroke:
            UnityEngine.Object.Instantiate(this.m_weaponBreakEffect, base.transform.position + Vector3.up * 1.5f + base.transform.forward, Quaternion.identity);
            break;

        case eSpecialEvent.empty:
        case eSpecialEvent.forbidden:
        case eSpecialEvent.fishingfail:
        case eSpecialEvent.tooManyMissions:
        case eSpecialEvent.alreadyGotMission:
        case eSpecialEvent.noAmmo:
        case eSpecialEvent.carExitsBlocked:
        case eSpecialEvent.cantHurtSaints:
        case eSpecialEvent.buildingRepaired:
            position = base.transform.position + Vector3.up * 3f;
            text     = "EVENT_" + (int)a_event;
            break;

        case eSpecialEvent.missionComplete:
            UnityEngine.Object.Instantiate(this.m_missionCompleteEffect, base.transform.position + Vector3.up * 4f, Quaternion.identity);
            if (this.m_isOwnPlayer && Global.isSteamActive)
            {
                this.m_waitForResult = SteamInventory.TriggerItemDrop(out this.m_itemDropHandle, (SteamItemDef_t)100);
            }
            break;
        }
        if (string.Empty != text)
        {
            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(this.m_textEffect, position, Quaternion.identity);
            TextLNG    component  = gameObject.GetComponent <TextLNG>();
            component.m_lngKey = text;
        }
    }