コード例 #1
0
ファイル: Animal.cs プロジェクト: kauhiant/Unity_3DMaze
        public void Straight()
        {
            ep.Add(-20);
            if (ep.IsZero)
            {
                return;
            }

            Point3D targetPosition = this.position.Copy();

            SkillManager.showSkill(Skill.straight, this);

            for (int i = 0; i < 3; ++i)
            {
                targetPosition.MoveFor(this.vector, 1);
                Grid targetGrid = World.GetAt(targetPosition);

                if (targetGrid == null)
                {
                    return;
                }
                if (targetGrid.Obj == null)
                {
                    continue;
                }

                if (targetGrid.Obj is Attackable)
                {
                    Attackable target = (Attackable)targetGrid.Obj;
                    target.BeAttack(this);
                }
            }
        }
コード例 #2
0
ファイル: Animal.cs プロジェクト: kauhiant/Unity_3DMaze
        public void Attack()
        {
            // 攻擊不耗魔.

            Point3D targetPosition = this.position.Copy();

            SkillManager.showSkill(Skill.attack, this);

            targetPosition.MoveFor(this.vector, 1);
            Grid targetGrid = World.GetAt(targetPosition);

            if (targetGrid == null)
            {
                return;
            }
            if (targetGrid.Obj == null)
            {
                return;
            }

            if (targetGrid.Obj is Attackable)
            {
                Attackable enemy = (Attackable)(targetGrid.Obj);
                enemy.BeAttack(this);
            }
        }
コード例 #3
0
ファイル: Animal.cs プロジェクト: kauhiant/Unity_3DMaze
        public void Horizon()
        {
            ep.Add(-20);
            if (ep.IsZero)
            {
                return;
            }

            Point2D  targetPosition = this.posit.Copy();
            Vector2D targetVector   = this.Vect;

            if (GlobalAsset.player != null && this.Plain.Dimention == GlobalAsset.player.Plain.Dimention)
            {
                SkillManager.showSkill(Skill.horizon, this);
            }
            else
            {
                SkillManager.showSkill(Skill.attack, this);
            }

            targetPosition.MoveFor(targetVector, 1);
            targetVector = VectorConvert.Rotate(targetVector);
            targetPosition.MoveFor(targetVector, 2);
            targetVector = VectorConvert.Invert(targetVector);

            for (int i = 0; i < 3; ++i)
            {
                targetPosition.MoveFor(targetVector, 1);
                Grid targetGrid = World.GetAt(targetPosition.Binded);

                if (targetGrid == null)
                {
                    continue;
                }
                if (targetGrid.Obj == null)
                {
                    continue;
                }

                if (targetGrid.Obj is Attackable)
                {
                    Attackable target = (Attackable)targetGrid.Obj;
                    target.BeAttack(this);
                }
            }
        }