Exemplo n.º 1
0
 private void JumpAction()
 {
     base.AddAction(base.GetActionWait(string.Empty, 200));
     base.AddAction(base.GetActionDelegate(delegate {
         base.m_Entity.m_AniCtrl.SetString("Skill", "Jump");
         base.m_Entity.mAniCtrlBase.UpdateAnimationSpeed("Skill", 1f);
         base.m_Entity.m_AniCtrl.SendEvent("Skill", false);
     }));
     base.AddAction(base.GetActionWait(string.Empty, 400));
     base.AddAction(base.GetActionDelegate(delegate {
         Vector3 position = base.m_Entity.position;
         for (int i = 0; i < 4; i++)
         {
             float num = i * 90f;
             for (int j = 0; j < 3; j++)
             {
                 float angle = num + GameLogic.Random((float)0f, (float)90f);
                 float x     = MathDxx.Sin(angle);
                 float z     = MathDxx.Cos(angle);
                 GameLogic.Release.Bullet.CreateBullet(base.m_Entity, 0x13aa, position + new Vector3(x, 0.5f, z), angle);
             }
         }
     }));
     base.AddAction(base.GetActionDelegate(() => base.m_Entity.mAniCtrlBase.UpdateAnimationSpeed("Skill", -1f)));
 }
Exemplo n.º 2
0
    private void CreateBulletByAngle(float angle)
    {
        float x = MathDxx.Sin(angle);
        float z = MathDxx.Cos(angle);

        base.CreateBulletOverride(new Vector3(x, 0f, z), angle);
    }
Exemplo n.º 3
0
    public void CheckBulletLength()
    {
        float   x         = MathDxx.Sin(base.bulletAngle);
        float   z         = MathDxx.Cos(base.bulletAngle);
        Vector3 direction = new Vector3(x, 0f, z);

        RaycastHit[] hitArray = Physics.RaycastAll(base.mTransform.position, direction, 100f, this.layerMask);
        float        distance = 100f;
        int          index    = 0;
        int          length   = hitArray.Length;

        while (index < length)
        {
            RaycastHit hit = hitArray[index];
            if ((((hit.collider.gameObject.layer == LayerManager.Stone) && !base.m_Data.bThroughWall) || (hit.collider.gameObject.layer == LayerManager.MapOutWall)) && (distance > hit.distance))
            {
                distance = hit.distance;
            }
            index++;
        }
        float num6 = distance / 13f;

        if (this.effect != null)
        {
            this.effect.localScale = new Vector3(num6, 1f, 1f);
        }
        this.effectctrl.SetScale(num6);
        base.boxList[0].center = new Vector3(0f, 0f, distance / 2f);
        base.boxList[0].size   = new Vector3(base.boxList[0].size.x, base.boxList[0].size.y, distance);
        this.effect.gameObject.SetActive(true);
    }
Exemplo n.º 4
0
    protected override void OnInitBase()
    {
        base.m_Entity.SetSuperArmor(true);
        this.isStart = false;
        if (base.m_Entity.m_HatredTarget == null)
        {
            base.m_Entity.m_HatredTarget = GameLogic.Self;
        }
        Vector2 vector2    = new Vector2(base.m_Entity.m_HatredTarget.position.x - base.m_Entity.position.x, base.m_Entity.m_HatredTarget.position.z - base.m_Entity.position.z);
        Vector2 normalized = vector2.normalized;

        if (GameLogic.Random((float)0f, (float)1f) > this.move2playertatio)
        {
            float angle = GameLogic.Random((float)0f, (float)360f);
            normalized.x = MathDxx.Sin(angle);
            normalized.y = MathDxx.Cos(angle);
        }
        this.Move_NextX = normalized.x;
        this.Move_NextY = normalized.y;
        if (normalized == Vector2.zero)
        {
            Vector2 vector8 = new Vector2(GameLogic.Random((float)-1f, (float)1f), GameLogic.Random((float)-1f, (float)1f));
            Vector2 vector7 = vector8.normalized;
            this.Move_NextX = vector7.x;
            this.Move_NextY = vector7.y;
        }
        this.Move_NextTime = Updater.AliveTime;
    }
Exemplo n.º 5
0
 private void OnAttack()
 {
     this.angle     = base.m_Entity.eulerAngles.y + 90f;
     this.offsetpos = new Vector3(MathDxx.Sin(this.angle), 0f, MathDxx.Cos(this.angle));
     this.CreateBullet(-1f);
     this.CreateBullet(1f);
 }
Exemplo n.º 6
0
 protected override void OnInit()
 {
     this.movex      = MathDxx.Sin(base.transform.eulerAngles.y);
     this.movey      = MathDxx.Cos(base.transform.eulerAngles.y);
     this.move       = new Vector3(this.movex, 0f, this.movey);
     this.currentdis = 0f;
 }
Exemplo n.º 7
0
    protected virtual void OnGotoNextRoom(RoomGenerateBase.Room room)
    {
        float angle = GameLogic.Random((float)-80f, (float)80f);
        float x     = MathDxx.Sin(angle);
        float z     = MathDxx.Cos(angle);

        base.transform.position = base.m_Parent.position + (new Vector3(x, 0f, z) * GameLogic.Random((float)0f, (float)1f));
    }
Exemplo n.º 8
0
    private void OnAttack()
    {
        Vector3 position = base.m_Entity.position;
        float   angle    = GameLogic.Random((float)0f, (float)360f);
        Vector3 vector2  = new Vector3(MathDxx.Sin(angle), 1f, MathDxx.Cos(angle)) * 2f;
        float   rota     = GameLogic.Random((float)0f, (float)360f);

        GameLogic.Release.Bullet.CreateBullet(base.m_Entity, 0xbc4, position + vector2, rota).mBulletTransmit.SetAttack((long)MathDxx.CeilToInt(this.hitratio * base.m_Entity.m_EntityData.GetAttackBase()));
    }
Exemplo n.º 9
0
    public void RotateHero(float angle)
    {
        float   x      = MathDxx.Sin(angle);
        float   z      = MathDxx.Cos(angle);
        Vector3 vector = new Vector3(x, 0f, z);

        this.Direction   = vector.normalized;
        this.RotateAngle = angle;
        this.RotateAngle = this.RotateAngle % 360f;
    }
Exemplo n.º 10
0
 private void CollisionEnter(Collision o)
 {
     if ((!base.m_Entity.GetFlying() || ((o.gameObject.layer != LayerManager.Stone) && (o.gameObject.layer != LayerManager.Waters))) && (this.lastwall != o.gameObject))
     {
         this.lastwall = o.gameObject;
         float angle = Utils.ExcuteReboundWallSkill(base.m_Entity.eulerAngles.y, base.m_Entity.position, base.m_Entity.GetComponent <SphereCollider>(), o.collider);
         this.Move_NextX = MathDxx.Sin(angle);
         this.Move_NextY = MathDxx.Cos(angle);
         this.UpdateMoveData();
     }
 }
Exemplo n.º 11
0
    protected override void OnInitBase()
    {
        this.m_MoveData.angle = Utils.getAngle(GameLogic.Self.position - base.m_Entity.position);
        float x = MathDxx.Sin(this.m_MoveData.angle);
        float z = MathDxx.Cos(this.m_MoveData.angle);

        this.m_MoveData.direction = new Vector3(x, 0f, z);
        base.m_Entity.m_AttackCtrl.RotateHero(this.m_MoveData.angle);
        base.m_Entity.m_MoveCtrl.AIMoveStart(base.m_MoveData);
        this.startx = base.m_Entity.transform.localPosition.x;
    }
Exemplo n.º 12
0
    protected override void OnAttack(object[] args)
    {
        int count = 4;

        for (int i = 0; i < count; i++)
        {
            float angle = Utils.GetBulletAngle(i, count, 120f);
            float x     = MathDxx.Sin(angle);
            float z     = MathDxx.Cos(angle);
            base.CreateBulletOverride(new Vector3(x, 0f, z) * 2f, angle);
        }
    }
Exemplo n.º 13
0
    private void OnAttackStartStart()
    {
        this.bStart        = true;
        this.percentbefore = 0f;
        this.starttime     = Updater.AliveTime + this.delaytime;
        this.x             = MathDxx.Sin(base.m_Entity.eulerAngles.y);
        this.y             = MathDxx.Cos(base.m_Entity.eulerAngles.y);
        this.startpos      = base.m_Entity.position;
        Vector3 vector3 = new Vector3(this.x, 0f, this.y);

        this.endpos = (vector3.normalized * this.distance) + base.m_Entity.position;
    }
Exemplo n.º 14
0
    protected override void OnAttack(object[] args)
    {
        int num = 4;

        for (int i = 0; i < num; i++)
        {
            float angle = i * 90f;
            float x     = MathDxx.Sin(angle);
            float z     = MathDxx.Cos(angle);
            GameLogic.Release.Bullet.CreateBullet(base.m_Entity, 0x44c, base.m_Entity.position + (new Vector3(x, 1f, z) * 0.5f), angle);
        }
    }
Exemplo n.º 15
0
    private void CreateBulletsByStartAngle(float angle)
    {
        int count = 3;

        for (int i = 0; i < count; i++)
        {
            float   num3   = Utils.GetBulletAngle(i, count, 60f) + angle;
            float   x      = MathDxx.Sin(num3);
            float   z      = MathDxx.Cos(num3);
            Vector3 vector = new Vector3(x, 0f, z) * 1f;
            GameLogic.Release.Bullet.CreateBullet(base.m_Entity, this.bulletid, base.m_Entity.m_Body.LeftBullet.transform.position + vector, num3);
        }
    }
Exemplo n.º 16
0
    public void SetRotate(float angle)
    {
        float x = MathDxx.Sin(angle);
        float z = MathDxx.Cos(angle);

        this.Direction    = new Vector3(x, 0f, z);
        this.RotateAngle  = angle;
        this.updateangley = angle;
        if (this.m_EntityHero.Child != null)
        {
            this.m_EntityHero.Child.transform.localRotation = Quaternion.Euler(0f, this.updateangley, 0f);
        }
    }
Exemplo n.º 17
0
 private void UpdateLinesData()
 {
     if (this.m_Entity.m_HatredTarget != null)
     {
         float x = this.m_Entity.m_HatredTarget.position.x - this.m_Entity.position.x;
         float y = this.m_Entity.m_HatredTarget.position.z - this.m_Entity.position.z;
         this.resultangle = Utils.getAngle(x, y) + this.offsetangle;
         this.resultpos   = this.m_Entity.m_Body.LeftBullet.transform.position;
         float   num3       = MathDxx.Sin(this.resultangle);
         float   z          = MathDxx.Cos(this.resultangle);
         Vector3 vector6    = new Vector3(num3, 0f, z);
         Vector3 normalized = vector6.normalized;
         this.nextpos   = this.m_Entity.position + (normalized * 40f);
         this.lastangle = this.resultangle;
     }
 }
Exemplo n.º 18
0
    private void UpdateLineLength(int index)
    {
        this.RedLineList[index].transform.position = new Vector3(this.resultpos.x, this.m_Entity.m_Body.LeftBullet.transform.position.y, this.resultpos.z);
        this.RedLineList[index].transform.rotation = Quaternion.Euler(0f, this.resultangle, 0f);
        Vector3 vector2 = this.nextpos - this.resultpos;

        RayCastManager.CastMinDistance(this.RedLineList[index].transform.position, vector2.normalized, this.bThroughWall, out float num, out this.resultpos, out Collider collider);
        this.lineCtrlList[index].SetLine(index == (this.RedLineList.Count - 1), num);
        if (collider != null)
        {
            this.resultangle = Utils.ExcuteReboundWallRedLine(this.RedLineList[index].transform, collider);
        }
        float x = MathDxx.Sin(this.resultangle);
        float z = MathDxx.Cos(this.resultangle);

        this.nextpos = this.resultpos + (new Vector3(x, 0f, z) * 40f);
    }
Exemplo n.º 19
0
    private void UpdateHeadTop()
    {
        float num   = 120f;
        float num2  = (this.mHeadIDs.Count - 1) * num;
        float num3  = num2 / 2f;
        int   num7  = 0;
        int   count = this.mHeadIDs.Count;

        while (num7 < count)
        {
            GameObject obj2  = this.mHeadTopList[this.mHeadIDs[num7]];
            float      angle = (num7 * num) - num3;
            float      x     = MathDxx.Sin(angle);
            float      z     = MathDxx.Cos(angle);
            obj2.transform.localPosition = new Vector3(x, 0f, z) * 1.5f;
            num7++;
        }
    }
Exemplo n.º 20
0
 public void Init(EntityBase entity, int count, float[] angles)
 {
     this.Deinit();
     this.time = 0f;
     for (int i = 0; i < count; i++)
     {
         GameObject child = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>("Game/Bullet/Bullet1066_RedLine"));
         child.SetParentNormal(entity.m_Body.transform);
         child.transform.localRotation = Quaternion.Euler(0f, angles[i], 0f);
         BulletRedLineCtrl component = child.GetComponent <BulletRedLineCtrl>();
         component.SetLine(true, 0f);
         Vector3 vector = new Vector3(MathDxx.Sin(angles[i] + 90f), 0f, MathDxx.Cos(angles[i] + 90f)) * 0.5f;
         RayCastManager.CastMinDistance(entity.m_Body.transform.position + vector, entity.eulerAngles.y, false, out float num2);
         RayCastManager.CastMinDistance(entity.m_Body.transform.position - vector, entity.eulerAngles.y, false, out float num3);
         this.mindiss.Add((num2 >= num3) ? num3 : num2);
         this.list.Add(component);
     }
     Updater.AddUpdate("Weapon1066", new Action <float>(this.OnUpdate), false);
 }
Exemplo n.º 21
0
 protected override void OnAttack(object[] args)
 {
     if (base.m_Entity.m_HatredTarget != null)
     {
         int   count = 7;
         float num2  = 0f;
         if (base.m_Entity.m_HatredTarget != null)
         {
             num2 = Utils.getAngle(base.m_Entity.m_HatredTarget.position - base.m_Entity.position);
         }
         for (int i = 0; i < count; i++)
         {
             float angle = num2 + Utils.GetBulletAngle(i, count, 180f);
             float x     = MathDxx.Sin(angle);
             float z     = MathDxx.Cos(angle);
             GameLogic.Release.Bullet.CreateBullet(base.m_Entity, 0x13dd, base.m_Entity.position + (new Vector3(x, 0f, z) * 2f), angle);
         }
     }
 }
Exemplo n.º 22
0
    public void CheckBulletLength()
    {
        float   x         = MathDxx.Sin(base.bulletAngle);
        float   z         = MathDxx.Cos(base.bulletAngle);
        Vector3 direction = new Vector3(x, 0f, z);

        RaycastHit[] hitArray = Physics.RaycastAll(base.mTransform.position, direction, 100f, this.layerMask);
        float        distance = 100f;
        int          index    = 0;
        int          length   = hitArray.Length;

        while (index < length)
        {
            RaycastHit hit = hitArray[index];
            if ((((hit.collider.gameObject.layer == LayerManager.Stone) && !base.m_Data.bThroughWall) || (hit.collider.gameObject.layer == LayerManager.MapOutWall)) && (distance > hit.distance))
            {
                distance = hit.distance;
            }
            index++;
        }
        if (this.mStart != null)
        {
            this.mStart.position = base.mTransform.position;
        }
        Vector3 position = base.mTransform.position + (direction * distance);

        if (this.mEnd != null)
        {
            this.mEnd.position = position;
        }
        if (this.line != null)
        {
            this.line.positionCount = 2;
            this.line.SetPosition(0, base.mTransform.position);
            this.line.SetPosition(1, position);
            float num6 = Vector3.Distance(base.mTransform.position, position);
            this.line.material.mainTextureScale = new Vector2(num6 / 3f, 1f);
            Material material = this.line.material;
            material.mainTextureOffset -= new Vector2(Time.deltaTime * 8f, 0f);
        }
        base.boxList[0].center = new Vector3(0f, 0f, distance / 2f);
        base.boxList[0].size   = new Vector3(base.boxList[0].size.x, base.boxList[0].size.y, distance);
    }
Exemplo n.º 23
0
 protected virtual void RandomNextMove()
 {
     if ((this.mParent != null) && (Vector3.Distance(base.m_Entity.position, this.mParent.position) > this.fardis))
     {
         this.Move_NextTime         = Updater.AliveTime;
         this.Move_NextDurationTime = this.Move_NextDurationTimeMax;
         float angle = Utils.getAngle(this.mParent.position - base.m_Entity.position) + GameLogic.Random((float)-15f, (float)15f);
         this.Move_NextX = MathDxx.Sin(angle);
         this.Move_NextY = MathDxx.Cos(angle);
     }
     else
     {
         int num2 = 0;
         this.RandomNextMoveOnce();
         while (!this.IsRandomValid() && (num2 < 100))
         {
             this.RandomNextMoveOnce();
             num2++;
         }
     }
 }
Exemplo n.º 24
0
 protected virtual void OnMoveSpeedUpdate()
 {
     if (this.bTouchMove && (this.m_Entity.State == EntityState.Normal))
     {
         if (this.m_Entity.IsSelf)
         {
             this.MoveDirection = this.m_JoyData.MoveDirection * this.m_Entity.m_EntityData.GetSpeed();
         }
         else if (this.m_JoyData._moveDirection == Vector3.zero)
         {
             this.Moving_angle  = this.m_Entity.m_AttackCtrl.GetCurrentAngle();
             this.Moving_dir.x  = MathDxx.Sin(this.Moving_angle);
             this.Moving_dir.z  = MathDxx.Cos(this.Moving_angle);
             this.MoveDirection = (Vector3)((this.m_Entity.m_EntityData.GetSpeed() * this.Moving_dir) * this.m_JoyData.MoveDirection.magnitude);
         }
         else
         {
             this.MoveDirection = (Vector3)(this.m_Entity.m_EntityData.GetSpeed() * this.m_JoyData.MoveDirection);
         }
     }
 }
Exemplo n.º 25
0
 private void AttackStart()
 {
     if (base.bRotate)
     {
         base.UpdateAttackAngle();
     }
     else
     {
         this.m_AttackData.angle = base.m_Entity.eulerAngles.y;
         float x = MathDxx.Sin(this.m_AttackData.angle);
         float z = MathDxx.Cos(this.m_AttackData.angle);
         this.m_AttackData.direction = new Vector3(x, 0f, z);
     }
     if (base.m_Entity.m_AttackCtrl != null)
     {
         base.m_Entity.m_AttackCtrl.OnMoveStart(base.m_AttackData);
     }
     if (base.m_Entity.m_Weapon != null)
     {
         base.m_Entity.m_Weapon.SetTarget(base.m_Entity.m_HatredTarget);
     }
 }
Exemplo n.º 26
0
    public void CheckBulletLength()
    {
        float   x      = MathDxx.Sin(base.bulletAngle);
        float   z      = MathDxx.Cos(base.bulletAngle);
        Vector3 vector = new Vector3(x, 0f, z);

        this.mStartObj.transform.position = base.mTransform.position;
        Vector3 position = base.mTransform.position + (vector * this.range);

        this.mEndObj.transform.position = position;
        this.line.positionCount         = 2;
        this.line.SetPosition(0, base.mTransform.position);
        this.line.SetPosition(1, position);
        float num3 = Vector3.Distance(base.mTransform.position, position);

        this.line.material.mainTextureScale = new Vector2(num3 / 3f, 1f);
        Material material = this.line.material;

        material.mainTextureOffset -= new Vector2(Time.deltaTime * 8f, 0f);
        base.boxList[0].center      = new Vector3(0f, 0f, this.range / 2f);
        base.boxList[0].size        = new Vector3(base.boxList[0].size.x, base.boxList[0].size.y, this.range);
    }
Exemplo n.º 27
0
 protected override void OnUpdate()
 {
     if (!this.bRotateOver)
     {
         if (base.m_Entity.m_AttackCtrl.RotateOver())
         {
             this.bRotateOver = true;
             this.Move_NextX  = MathDxx.Sin(base.m_Entity.eulerAngles.y);
             this.Move_NextY  = MathDxx.Cos(base.m_Entity.eulerAngles.y);
             this.AIMoveStart();
             base.m_Entity.m_AniCtrl.SetString("Skill", "Hitted");
             base.m_Entity.m_AniCtrl.SendEvent("Skill", false);
         }
     }
     else
     {
         this.AIMoving();
     }
     if ((this.reboundcount == 3) && (Updater.AliveTime > this.mEndStartTime))
     {
         base.End();
     }
 }
Exemplo n.º 28
0
 private void CollisionEnter(Collision o)
 {
     if (((o.gameObject.layer == LayerManager.MapOutWall) || (o.gameObject.layer == LayerManager.Stone)) && (this.lastwall != o.gameObject))
     {
         this.lastwall = o.gameObject;
         if (this.reboundcount < 3)
         {
             this.reboundcount++;
             float angle = Utils.ExcuteReboundWallSkill(base.m_Entity.eulerAngles.y, o.contacts[0].point, base.m_Entity.GetComponent <SphereCollider>(), o.collider);
             this.Move_NextX = MathDxx.Sin(angle);
             this.Move_NextY = MathDxx.Cos(angle);
             this.UpdateMoveData();
             if (this.reboundcount == 3)
             {
                 this.mEndStartTime = Updater.AliveTime + this.mEndTime;
             }
         }
         else
         {
             base.End();
         }
     }
 }
Exemplo n.º 29
0
    private void RandomNextMoveLoop()
    {
        float   angle  = GameLogic.Random((float)0f, (float)360f);
        float   x      = MathDxx.Sin(angle);
        float   z      = MathDxx.Cos(angle);
        Vector3 vector = new Vector3(x, 0f, z);

        this.m_MoveData.direction = vector.normalized;
        float num4 = GameLogic.Random((float)5f, (float)7f);
        float num5 = 0.1f;

        this.alldis = num4;
        if (Physics.SphereCast(base.m_Entity.position - (this.m_MoveData.direction * num5), base.m_Entity.GetCollidersSize(), this.m_MoveData.direction, out RaycastHit hit, this.alldis + num5, LayerManager.MapAllInt))
        {
            this.alldis = hit.distance - num5;
            if ((this.alldis < 2f) && (this.randomcount > 0))
            {
                this.randomcount--;
                this.RandomNextMoveLoop();
                return;
            }
        }
        base.m_Entity.m_AttackCtrl.RotateHero(Utils.getAngle(this.m_MoveData.direction));
    }
Exemplo n.º 30
0
 protected override void OnOverDistance()
 {
     if (this.DivideID == 0)
     {
         object[] args = new object[] { base.mTransform.name };
         SdkManager.Bugly_Report("BulletDivideBase", Utils.FormatString("{0} OnOverDistance DivideID == 0", args));
     }
     else if (this.DivideCount == 0)
     {
         object[] args = new object[] { base.mTransform.name };
         SdkManager.Bugly_Report("BulletDivideBase", Utils.FormatString("{0} OnOverDistance DivideCount == 0", args));
     }
     else
     {
         float num = 360f / ((float)this.DivideCount);
         for (int i = 0; i < this.DivideCount; i++)
         {
             float angle = (i * num) + this.AngelOffset;
             float num4  = MathDxx.Sin(angle) * this.ForwardLength;
             float num5  = MathDxx.Cos(angle) * this.ForwardLength;
             GameLogic.Release.Bullet.CreateBullet(base.m_Entity, this.DivideID, new Vector3(base.mTransform.position.x + num4, this.Height, base.mTransform.position.z + num5), angle);
         }
     }
 }