Exemplo n.º 1
0
        /// <summary>
        /// Constructor to add one player to the party.
        /// </summary>
        /// <param name="player">Player to have with created class</param>
        public PartyClass(CombatCharacter player)
        {
            party.Add(player);

            // Gives the first player the ID and map the event
            party[0].ID = 0;
            party[0].Ready += ReadyHandler;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor to add three separate players to the party
        /// </summary>
        /// <param name="first">First player to have with created class</param>
        /// <param name="second">Second player to have with created class</param>
        /// <param name="third">Third player to have with created class</param>
        public PartyClass(CombatCharacter first, CombatCharacter second, CombatCharacter third)
        {
            party.Add(first);
            party.Add(second);
            party.Add(third);

            // Gives IDs to all the players and map them to the event handler
            for (int i = 0; i < party.Count; i++)
            {
                party[i].ID = i;
                party[i].Ready += ReadyHandler;
            }
        }
Exemplo n.º 3
0
        public void CreateAttack(CombatCharacter attacker, CombatCharacter defender)
        {
            // DEBUG:  Create a basic attack script
            // TODO:  Make a less hard coded method
            // TODO:  Center the battle text on the enemy
            Console.WriteLine("[BattleDirector CreateAttack]: 1 << attackID({0}) is {1}",
                attacker.ID, 1 << attacker.ID);

            ActorResetInfo actorInfo = new ActorResetInfo();
            actorInfo.bitID = 1 << attacker.ID;
            actorInfo.isEnemy = false;
            actorResetQueue.Enqueue(actorInfo);

            int damage = attacker.ATK;
            Vector2 defenderPos = defender.Position;

            battleTextList[0].Position = defenderPos;
            battleTextList[0].Text = damage.ToString();
            AddAction(actionLibrary.createActionScript("Attack",
                                                       attacker,
                                                       defender,
                                                       damage,
                                                       battleTextList[0]));
        }