Пример #1
0
    private void SetDamage(List <List <uint> > entities)
    {
        if (entities.Count != 4)
        {
            return;
        }

        List <uint> dummyList  = entities[0];
        List <uint> playerList = entities[2];

        if (canAttackDummy)
        {
            foreach (uint id in dummyList)
            {
                EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.GetEntity(id) as EntityParent));
            }
        }

        foreach (uint id in playerList)
        {
            if (id == MogoWorld.thePlayer.ID)
            {
                EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.thePlayer as EntityParent));
                break;
            }
        }
    }
Пример #2
0
    protected void MoveEnd(MonoBehaviour script)
    {
        if (triggleEnable && script is MogoSimpleMotor)
        {
            if ((script as MogoSimpleMotor) == motor)
            {
                triggleEnable = false;
                HitGround();
                base.SetGearEventStateOne(ID);

                List <List <uint> > entities = MogoUtils.GetEntitiesInRange(transform, radius);

                if (entities.Count != 4)
                {
                    return;
                }

                List <uint> dummyList  = entities[0];
                List <uint> playerList = entities[0];

                if (canAttackDummy)
                {
                    foreach (uint id in dummyList)
                    {
                        EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.GetEntity(id) as EntityParent));
                    }
                }

                foreach (uint id in playerList)
                {
                    if (id == MogoWorld.thePlayer.ID)
                    {
                        EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.thePlayer as EntityParent));
                        break;
                    }
                }
            }
        }
    }
Пример #3
0
    void OnTriggerEnter(Collider other)
    {
        if (triggleEnable)
        {
            if (other.gameObject.layer == 9)//Terrain
            {
                MogoMainCamera.Instance.Shake(5, 0.1f);
                sfxHandler.HandleFx(500102);
                sfxHandler.RemoveFXs(6011);
                List <List <uint> > entities = MogoUtils.GetEntitiesInRange(transform, radius);
                if (entities.Count != 4)
                {
                    return;
                }

                List <uint> dummyList  = entities[0];
                List <uint> playerList = entities[2];

                if (canAttackDummy)
                {
                    foreach (uint id in dummyList)
                    {
                        EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.GetEntity(id) as EntityParent));
                    }
                }

                foreach (uint id in playerList)
                {
                    if (id == MogoWorld.thePlayer.ID)
                    {
                        EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.thePlayer as EntityParent));
                        break;
                    }
                }

                if (timerID == uint.MaxValue)
                {
                    timerID = TimerHeap.AddTimer(5000, 0, BombDestroy);
                }
                vx            = 0;
                vy            = 0;
                triggleEnable = false;
            }
        }
    }
Пример #4
0
    void OnTriggerEnter(Collider other)
    {
        if (triggleEnable)
        {
            try
            {
                if (other.gameObject.layer == 9)
                {
                    triggleEnable = false;
                    HitGround();
                    base.SetGearEventStateOne(ID);

                    List <List <uint> > entities = MogoUtils.GetEntitiesInRange(transform, radius);

                    if (entities.Count != 4)
                    {
                        return;
                    }

                    List <uint> dummyList  = entities[0];
                    List <uint> playerList = entities[2];

                    if (canAttackDummy)
                    {
                        foreach (uint id in dummyList)
                        {
                            EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.GetEntity(id) as EntityParent));
                        }
                    }

                    foreach (uint id in playerList)
                    {
                        if (id == MogoWorld.thePlayer.ID)
                        {
                            EventDispatcher.TriggerEvent(Events.GearEvent.Damage, id, 9003, (int)2, CalcDamage(MogoWorld.thePlayer as EntityParent));
                            break;
                        }
                    }
                }
            }
            catch
            {
                Debug.LogError("Undefined tag gameobject name: " + other.gameObject.name);
            }
        }
    }