예제 #1
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;
    }
예제 #2
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);
    }
예제 #3
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)));
 }
예제 #4
0
    private void CreateBulletByAngle(float angle)
    {
        float x = MathDxx.Sin(angle);
        float z = MathDxx.Cos(angle);

        base.CreateBulletOverride(new Vector3(x, 0f, z), angle);
    }
예제 #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);
 }
예제 #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;
 }
예제 #7
0
    private void UpdateDirection()
    {
        float x    = this.target.position.x - base.m_Entity.position.x;
        float y    = this.target.position.z - base.m_Entity.position.z;
        float num3 = Utils.getAngle(x, y);

        if (this.state == 0)
        {
            this.offsetangle += this.peradd;
            if (MathDxx.Abs(this.offsetangle) >= this.maxadd)
            {
                this.state = 1;
            }
        }
        else
        {
            this.offsetangle -= this.peradd;
            if (MathDxx.Abs(this.offsetangle) >= this.maxadd)
            {
                this.state = 0;
            }
        }
        this.m_MoveData.angle     = num3 + this.offsetangle;
        this.m_MoveData.direction = new Vector3(MathDxx.Sin(this.m_MoveData.angle), 0f, MathDxx.Cos(this.m_MoveData.angle));
        base.m_Entity.m_AttackCtrl.RotateHero(this.m_MoveData.angle);
    }
예제 #8
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));
    }
예제 #9
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()));
    }
예제 #10
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;
    }
예제 #11
0
    public void UpdateLine(bool throughinsidewall, float width)
    {
        Vector3 vector = (new Vector3(MathDxx.Sin(base.transform.eulerAngles.y + 90f), 0f, MathDxx.Cos(base.transform.eulerAngles.y + 90f)) * width) / 2f;

        RayCastManager.CastMinDistance(base.transform.position + vector, base.transform.eulerAngles.y, throughinsidewall, out float num);
        RayCastManager.CastMinDistance(base.transform.position - vector, base.transform.eulerAngles.y, throughinsidewall, out float num2);
        float length = (num >= num2) ? num2 : num;

        this.SetLine(true, length);
    }
예제 #12
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();
     }
 }
예제 #13
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;
    }
예제 #14
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;
    }
예제 #15
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);
        }
    }
예제 #16
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);
        }
    }
예제 #17
0
    private void OnAttack()
    {
        EntityBase base2 = GameLogic.Release.Entity.FindCanAttackRandom(base.m_Entity);

        if (base2 != null)
        {
            float   rota = Utils.getAngle(base2.position - base.m_Entity.position) + GameLogic.Random((float)-10f, (float)10f);
            float   num2 = Vector3.Distance(base2.position, base.m_Entity.position) - 1f;
            Vector3 pos  = base2.position + (new Vector3(MathDxx.Sin(rota + 180f), 0f, MathDxx.Cos(rota + 180f)) * num2);
            pos.y = 1f;
            GameLogic.Release.Bullet.CreateBullet(base.m_Entity, this.bulletid, pos, rota).mBulletTransmit.SetAttack((long)MathDxx.CeilToInt(this.hitratio * base.m_Entity.m_EntityData.GetAttackBase()));
        }
    }
예제 #18
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);
        }
    }
예제 #19
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);
        }
    }
예제 #20
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;
     }
 }
예제 #21
0
    protected override void OnInstall()
    {
        base.AttackEffect = "WeaponHand1066Effect";
        this.redline      = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>("Game/Bullet/Bullet1066_RedLine"));
        this.redline.SetParentNormal(base.m_Entity.m_Body.transform);
        this.ctrl = this.redline.GetComponent <BulletRedLineCtrl>();
        this.ctrl.SetLine(true, 0f);
        this.time = 0f;
        Vector3 vector = new Vector3(MathDxx.Sin(base.m_Entity.eulerAngles.y + 90f), 0f, MathDxx.Cos(base.m_Entity.eulerAngles.y + 90f)) * 0.5f;

        RayCastManager.CastMinDistance(base.m_Entity.m_Body.transform.position + vector, base.m_Entity.eulerAngles.y, false, out float num);
        RayCastManager.CastMinDistance(base.m_Entity.m_Body.transform.position - vector, base.m_Entity.eulerAngles.y, false, out float num2);
        this.mindis = (num >= num2) ? num2 : num;
        Updater.AddUpdate("Weapon1066", new Action <float>(this.OnUpdate), false);
        base.OnInstall();
    }
예제 #22
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);
    }
예제 #23
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++;
        }
    }
예제 #24
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);
         }
     }
 }
예제 #25
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);
    }
예제 #26
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);
 }
예제 #27
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);
         }
     }
 }
예제 #28
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++;
         }
     }
 }
예제 #29
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);
    }
예제 #30
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);
     }
 }