private void CheckMyself(Vector3 boomPos, float DamageRadius)
    {
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            LocalController component = gameObject.GetComponent <LocalController>();
            if (null == component)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
            else
            {
                Vector3 position = gameObject.transform.position;
                if (Vector3.Distance(position, boomPos) < DamageRadius)
                {
                    component.GetHit(MyInfoManager.Instance.Seq, poisonDamage, 1f, -4, -1, autoHealPossible: true, checkZombie: false);
                }
            }
        }
    }
 private void SelfRespawn()
 {
     verifyLocalController();
     if (localCtrl != null)
     {
         localCtrl.DropWeaponSkipSetting();
         localCtrl.GetHit(MyInfoManager.Instance.Seq, 1000, 1f, -10, -1, autoHealPossible: true, checkZombie: false);
         localCtrl.SelfRespawnReuseTime = Time.time;
     }
 }
Beispiel #3
0
    private void CheckMyself(Vector3 boomPos, float DamageRadius)
    {
        int        layerMask  = (1 << LayerMask.NameToLayer("Chunk")) | (1 << LayerMask.NameToLayer("Brick")) | (1 << LayerMask.NameToLayer("BoxMan")) | (1 << LayerMask.NameToLayer("InvincibleArmor")) | (1 << LayerMask.NameToLayer("Bomb")) | (1 << LayerMask.NameToLayer("InstalledBomb"));
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            LocalController component = gameObject.GetComponent <LocalController>();
            if (null == component)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
            else
            {
                Vector3 position = gameObject.transform.position;
                if (Vector3.Distance(position, boomPos) < DamageRadius)
                {
                    int num = 0;
                    for (int i = 0; i < 3; i++)
                    {
                        position.y += 0.3f;
                        if (!Physics.Linecast(base.transform.position, position, out RaycastHit _, layerMask))
                        {
                            int num2 = Mathf.FloorToInt(0.3f * (float)(i + 1) * CalcPowFrom(boomPos, position));
                            if (num2 > 0)
                            {
                                num += num2;
                            }
                        }
                    }
                    if (num > 0)
                    {
                        component.GetHit(MyInfoManager.Instance.Seq, num, 1f, (int)weaponBy, -1, autoHealPossible: true, checkZombie: false);
                        realExplosion = true;
                    }
                }
            }
        }
    }
Beispiel #4
0
 private void Update()
 {
     deltaTime += Time.deltaTime;
     if (deltaTime > lifeTime)
     {
         Object.Destroy(base.transform.gameObject);
     }
     else if (deltaTime > smokeeTime)
     {
         ParticleEmitter[] componentsInChildren = GetComponentsInChildren <ParticleEmitter>();
         for (int i = 0; i < componentsInChildren.Length; i++)
         {
             componentsInChildren[i].maxEmission = 0f;
             componentsInChildren[i].minEmission = 0f;
         }
     }
     if (bOwn && ApplyDotDamage)
     {
         deltaTimeDot += Time.deltaTime;
         if (deltaTimeDot >= 1f)
         {
             deltaTimeDot = 0f;
             float             num = -9999f;
             ParticleEmitter[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <ParticleEmitter>();
             for (int j = 0; j < componentsInChildren2.Length; j++)
             {
                 if (num < componentsInChildren2[j].maxSize)
                 {
                     num = componentsInChildren2[j].maxSize;
                 }
             }
             float num2 = 9999f;
             componentsInChildren2 = base.gameObject.GetComponentsInChildren <ParticleEmitter>();
             for (int k = 0; k < componentsInChildren2.Length; k++)
             {
                 if (num2 > componentsInChildren2[k].minSize)
                 {
                     num2 = componentsInChildren2[k].minSize;
                 }
             }
             if (num > 0f)
             {
                 float      num3       = (num + num2) * 0.25f;
                 GameObject gameObject = GameObject.Find("Me");
                 if (null != gameObject)
                 {
                     float num4 = Vector3.Distance(base.transform.position, gameObject.transform.position);
                     if (num4 < num3)
                     {
                         LocalController component = gameObject.GetComponent <LocalController>();
                         if (component != null)
                         {
                             component.GetHit(MyInfoManager.Instance.Seq, dotDamage, 0f, (int)weaponBy, -1, autoHealPossible: true, checkZombie: false);
                         }
                     }
                 }
                 GameObject[] array = BrickManManager.Instance.ToGameObjectArray();
                 for (int l = 0; l < array.Length; l++)
                 {
                     PlayerProperty component2 = array[l].GetComponent <PlayerProperty>();
                     if (component2 != null && component2.IsHostile())
                     {
                         float num5 = Vector3.Distance(base.transform.position, array[l].transform.position);
                         if (num5 < num3)
                         {
                             P2PManager.Instance.SendPEER_BOMBED(MyInfoManager.Instance.Seq, component2.Desc.Seq, dotDamage, 0f, (int)weaponBy);
                         }
                     }
                 }
             }
         }
     }
 }