Ejemplo n.º 1
0
    public override void click(Vector2 grid_location)
    {
        map.clean_tiles();
        var target = map.get_actor_at(grid_location);
        var tile   = map.get_tile_at(grid_location);

        if (target != null)
        {
            var templar = target.GetComponent <Templar>();
            if (templar != null)
            {
                _selected_unit          = templar;
                _selected_grid_location = grid_location;
                highlight_move_locations();
            }
        }
        else
        {
            if (_selected_unit != null)
            {
                var script = tile.GetComponent <Tile>();
                if (script.type == " " && valid_move(_selected_grid_location, grid_location, _selected_unit.movement) && _selected_unit.moved < 1)
                {
                    _selected_unit.move(_selected_grid_location, grid_location);
                }
            }
        }
    }
Ejemplo n.º 2
0
    public override void click(Vector2 grid_location)
    {
        var target = map.get_actor_at(grid_location);

        if (target != null)
        {
            var templar = target.GetComponent <Templar>();
            if (templar != null)
            {
                _selected_unit   = templar;
                _selected_square = grid_location;
                map.clean_tiles();
                highlight_targets();
            }
            else
            {
                var alien = target.GetComponent <Alien>();
                if (alien != null && _selected_unit != null && _selected_unit.can_shoot() && _selected_unit.within_arc(_selected_square, grid_location))
                {
                    shoot(grid_location, _selected_unit, alien);
                }
                else
                {
                    Debug.Log("Invalid target");
                    Debug.Log("Direction: " + _selected_unit.direction);
                }
            }
        }
    }
Ejemplo n.º 3
0
    private void shoot(Vector2 grid_location, Templar shooter, Alien target)
    {
        shooter.shoot();

        var damage = new Damage(shooter.damage, target.armour, shooter.accuracy).calculate();

        target.hurt(damage);
    }
 public TemplarFinal(Entity user) : base(user)
 {
     name          = "Final";
     damage        = TemplarAttacks.dmg + 4f;
     knockBack     = 10f;
     animationName = "Ultimate";
     stops         = true;
     type          = "Side";
     cUser         = (Character)user;
     temp          = (Templar)cUser.speciality;
 }
 public TemplarSpecialDown(Entity user, GameObject eff) : base(user)
 {
     name          = "SpecialDown";
     damage        = TemplarAttacks.dmg;
     knockBack     = 7f;
     animationName = "SpecialDown";
     type          = "Up";
     stops         = false;
     effect        = eff;
     stunTime      = 25f;
     tmp           = (Templar)((Character)user).speciality;
     initialDamage = damage;
 }
    public override void doAttack()
    {
        GameObject go  = GameObject.Instantiate(effect, user.transform, false);
        Templar    tmp = (Templar)((Character)user).speciality;

        if (GameManager.Instance.currentFight is TeamFight)
        {
            ((TeamFight)GameManager.Instance.currentFight).ignoreTeammate(((Character)user).player, go.GetComponent <Collider2D>());
        }
        user.attackEffect       = go;
        user.RigidBody.velocity = new Vector2(0, user.RigidBody.velocity.y);
        tmp.chargesCheck(this);

        base.doAttack();
    }
Ejemplo n.º 7
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            PlayerControllerEzEz scriptPlayer = other.GetComponent <PlayerControllerEzEz>();

            scriptPlayer.playerSpeed += 1;
        }

        if (other.CompareTag("Templar"))
        {
            Templar scriptEnemy = other.GetComponent <Templar>();

            scriptEnemy.templarSpeed -= 1;
        }
    }
Ejemplo n.º 8
0
    public void DamageToThePlayer(Templar templarScript)
    {
        playerCaracteristics.playerHealth -= templarScript.templarDamage;

        if (playerCaracteristics.playerHealth > 0)
        {
            animator.SetTrigger("playerIsHit");

            Debug.Log("Damage to the playeeer FUsckjklj !!!!");
            Debug.Log(playerCaracteristics.playerHealth);
            healthPlayerScript.TakeDamage();
        }

        else if (playerCaracteristics.playerHealth <= 0)
        {
            animator.SetTrigger("playerIsDead");
        }
    }
Ejemplo n.º 9
0
        public ActionResult Templar()
        {
            // Get data for existing Workouts
            using (ISession _S = MvcApplication.SF.GetCurrentSession())
            {
                // CTRL + Select Templar
                Templar tmp = null;

                var tmpList = _S.QueryOver(() => tmp)
                              .OrderBy(x => x.Segmentid).Asc
                              .List <Templar>();

                // Summon the Conclave
                Conclave clv = null;

                var typeList = _S.QueryOver(() => clv)
                               .SelectList(l => l
                                           .Select(x => x.Typepk).WithAlias(() => clv.Typepk)
                                           .Select(x => x.Name).WithAlias(() => clv.Name)
                                           )
                               .TransformUsing(Transformers.AliasToBean <Conclave>())
                               .List <Conclave>();

                // Morph Archons
                var archList = new List <Archon>();

                foreach (var r in typeList)
                {
                    archList.Add(new Archon
                    {
                        Key     = r.Typepk,
                        Display = r.Name.ToString()
                    });
                }

                foreach (var s in tmpList)
                {
                    s.DDLTypes = new SelectList(archList, "Key", "Display", s.Conclave.Typepk);
                }

                return(View(tmpList));
            }
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Rider knight = new Knight(10, 5);

            Rider elephant = new Elephant(20, 3);

            Soldier archer = new Archer(5, 4);

            Soldier templar = new Templar(9, 5);

            List <string>  L  = new List <string>();
            List <Soldier> L2 = new List <Soldier>();

            L.Add("knight");
            L.Add("elephant");
            L.Add("archer");
            L.Add("templar");

            L2.Add(knight);
            L2.Add(elephant);
            L2.Add(archer);
            L2.Add(templar);
            Console.WriteLine("soldier type            power            rating");
            for (int i = 0; i < 4; i++)
            {
                Console.WriteLine("{0,-25}{1,-20}{2}", L[i], L2[i].GetPower(), L2[i].GetRating());
            }



            List <Soldier> Army1 = new List <Soldier>();
            List <Soldier> Army2 = new List <Soldier>();

            List <int> Ar1 = new List <int>();
            List <int> Ar2 = new List <int>();



            Console.WriteLine("Enter the number of soldier-types in Army1: ");
            int type1 = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter soldier-types of Army1 and their number, respectively: knight, templar, archer, elephant");
            for (int i = 0; i < type1; i++)
            {
                string Fighter1    = Console.ReadLine();
                int    SoldierNum1 = int.Parse(Console.ReadLine());

                Ar1.Add(SoldierNum1);
                switch (Fighter1)
                {
                case "knight": Army1.Add(knight); break;

                case "archer": Army1.Add(archer); break;

                case "templar": Army1.Add(templar); break;

                case "elephant": Army1.Add(elephant); break;

                default:
                    break;
                }
            }
            Console.WriteLine("Enter the number of soldier-types in Army2: ");
            int type2 = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter soldier-types of Army2 and their number, respectively: knight, templar, archer, elephant");

            for (int i = 0; i < type2; i++)
            {
                String Fighter2    = Console.ReadLine();
                int    SoldierNum2 = int.Parse(Console.ReadLine());
                Ar2.Add(SoldierNum2);
                switch (Fighter2)
                {
                case "knight": Army2.Add(knight); break;

                case "archer": Army2.Add(archer); break;

                case "templar": Army2.Add(templar); break;

                case "elephant": Army2.Add(elephant); break;

                default:
                    break;
                }
            }



            Program p = new Program();

            p.Fight(Army1, Army2, Ar1, Ar2);



            Console.ReadKey();
        }
Ejemplo n.º 11
0
        public ActionResult WarpIn2Form(List <Warpgate> w)
        {
            if (ModelState.IsValid)
            {
                using (ISession _S = MvcApplication.SF.GetCurrentSession())
                {
                    // [0] Get Workout Name
                    string wkNm = _S.QueryOver <Gateway>()
                                  .Where(x => x.Workoutpk == w[1].Gateway.Workoutpk)
                                  .Select(x => x.Name)
                                  .SingleOrDefault <string>();

                    // [1] Summon Danimoth
                    Danimoth d = new Danimoth
                    {
                        DWorkoutName = wkNm,
                        Dts          = new List <Raszagal>()
                    };

                    // [2] Acquire Energy
                    foreach (Warpgate wg in w)
                    {
                        // [2.0] Get data for existing Wksegs
                        Warpgate         wks     = null;
                        IList <Warpgate> wksList = _S.QueryOver(() => wks)
                                                   .Where(x => x.Gateway.Workoutpk == wg.Gateway.Workoutpk)
                                                   .OrderBy(x => x.Sequence).Asc
                                                   .List <Warpgate>();

                        // [2.1] DT Rush
                        foreach (Warpgate z in wksList)
                        {
                            // [2.1.0] Get segment data
                            Templar rSeg = _S.QueryOver <Templar>()
                                           .Where(x => x.Segmentpk == z.Templar.Segmentpk)
                                           .SingleOrDefault <Templar>();

                            // [2.1.1] Get TypePK
                            Conclave rTyp = _S.QueryOver <Conclave>()
                                            .Where(x => x.Typepk == rSeg.Conclave.Typepk)
                                            .SingleOrDefault <Conclave>();

                            // [2.1.2] Get a random tip for that type
                            ICriteria criteria = _S
                                                 .CreateCriteria(typeof(Prophecy))
                                                 .Add(Restrictions.Eq("Conclave.Typepk", rTyp.Typepk))
                                                 .AddOrder(new RandomOrder())
                                                 .SetMaxResults(1);

                            Prophecy clv2 = criteria.UniqueResult <Prophecy>();

                            // [2.1.3] Warp in DTs
                            Raszagal rz = new Raszagal
                            {
                                RSegmentName      = rSeg.Name,
                                RSegmentIntensity = rSeg.Intensity,
                                RTip   = clv2,
                                RWkseg = new Warpgate
                                {
                                    Duration = z.Duration * 1000,
                                    Sequence = z.Sequence
                                }
                            };

                            // [2.1.4] Warp DTs to Danimoth
                            d.Dts.Add(rz);
                        }
                    }

                    return(View("Aiur", d));
                }
            }
            else
            {
                return(View("Index"));
            }
        }
Ejemplo n.º 12
0
        public ActionResult WarpIn1Form(Warpgate d)
        {
            if (ModelState.IsValid)
            {
                using (ISession _S = MvcApplication.SF.GetCurrentSession())
                {
                    // Get segment list
                    Templar sg = null;

                    IList <Templar> sgList = _S.QueryOver(() => sg)
                                             .SelectList(l => l
                                                         .Select(x => x.Segmentpk).WithAlias(() => sg.Segmentpk)
                                                         .Select(x => x.Name).WithAlias(() => sg.Name)
                                                         )
                                             .OrderBy(x => x.Name).Asc
                                             .TransformUsing(Transformers.AliasToBean <Templar>())
                                             .List <Templar>();

                    List <Archon> list2 = new List <Archon>();

                    foreach (Templar r in sgList)
                    {
                        list2.Add(new Archon
                        {
                            Key     = r.Segmentpk,
                            Display = r.Name.ToString()
                        });
                    }

                    // Get data for existing Wksegs
                    Warpgate wks = null;

                    IList <Warpgate> wksList = _S.QueryOver(() => wks)
                                               .Where(x => x.Gateway.Workoutpk == d.Gateway.Workoutpk)
                                               .OrderBy(x => x.Sequence).Asc
                                               .List <Warpgate>();

                    foreach (Warpgate z in wksList)
                    {
                        z.DDLSegments = new SelectList(list2, "Key", "Display", z.Templar.Segmentpk);
                    }

                    // Return data needed for controller if no result
                    if (wksList.Count == 0)
                    {
                        Gateway tmpG = new Gateway
                        {
                            Workoutpk = d.Gateway.Workoutpk
                        };

                        wksList.Add(new Warpgate
                        {
                            Gateway     = tmpG,
                            DDLSegments = new SelectList(list2, "Key", "Display")
                        });
                    }

                    return(View("Assimilation", wksList));
                }
            }

            else
            {
                return(View("Index"));
            }
        }
Ejemplo n.º 13
0
        public ActionResult TemplarForm(List <Templar> newList)
        {
            if (ModelState.IsValid)
            {
                using (ISession _S = MvcApplication.SF.GetCurrentSession())
                {
                    Templar tmp = null;

                    var oldList = _S.QueryOver(() => tmp)
                                  .SelectList(l => l
                                              .Select(x => x.Segmentpk).WithAlias(() => tmp.Segmentpk)
                                              )
                                  .TransformUsing(Transformers.AliasToBean <Templar>())
                                  .List <Templar>();

                    foreach (var q in newList)
                    {
                        //updates
                        if (oldList.Any(p => p.Segmentpk == q.Segmentpk))
                        {
                            Templar persistentType = _S.Load <Templar>(q.Segmentpk);

                            persistentType.Segmentid = q.Segmentid;
                            persistentType.Name      = q.Name;
                            persistentType.Conclave  = q.Conclave;
                            persistentType.Intensity = q.Intensity;
                            persistentType.Customflg = q.Customflg;

                            _S.Save(persistentType);
                            _S.Flush();
                            _S.Clear();
                        }

                        //inserts
                        else if (q.Segmentpk == -1)
                        {
                            Templar persistentType = new Templar
                            {
                                Segmentid = q.Segmentid,
                                Name      = q.Name,
                                Conclave  = q.Conclave,
                                Intensity = q.Intensity,
                                Customflg = q.Customflg
                            };

                            _S.Save(persistentType);
                            _S.Flush();
                            _S.Clear();
                        }
                    }

                    //deletions
                    foreach (var x in oldList)
                    {
                        if (!newList.Any(p => p.Segmentpk == x.Segmentpk))
                        {
                            var persistentType = _S.Load <Templar>(x.Segmentpk);

                            _S.Delete(persistentType);
                            _S.Flush();
                            _S.Clear();
                        }
                    }
                }

                ViewBag.onSuccess_Message = "Segments updated successfully.";

                return(View("Index"));
            }
            else
            {
                return(View("Index"));
            }
        }