Esempio n. 1
0
 /// <summary>
 /// Add a new enemy type to the factory.</summary>
 /// <param name="type">The Enemy type.</param>
 /// <param name="stats">The Enemy Stats.</param>
 /// <param name="items">The Items in the Enemies Inventory.</param>
 public static void AddEnemyType(string type,
                                 EnemyStats stats,
                                 BaseInventory inventory)
 {
     Stats[type]       = stats;
     Inventories[type] = inventory;
 }
Esempio n. 2
0
 /// <summary>
 /// Transfer all the Items from the given Inventory.</summary>
 public void AddInventory(BaseInventory inventory)
 {
     for (int i = 0; i < inventory.ItemCount; i++)
     {
         AddItem(inventory.Items.ElementAt(i), inventory.Quantities.ElementAt(i));
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Initialize the Stats, Inventory, State and connect basic signals.</summary>
        /// <param name="stats">The Stats</param>
        /// <param name="inventory">The Inventory</param>
        public BaseCharacter(BaseStats stats, BaseInventory inventory)
        {
            Stats        = stats;
            Inventory    = inventory;
            CurrentState = IdleState;

            // Connect internal signals
            Stats.Life.OnMinReached += new MinReachedHandler(OnDefeated);

            // Learn the default CombatSkill
            LearnCombatSkill(SkillDatabase.GetCombatSkillByName("__Default__").Id);
        }