コード例 #1
0
        /// <summary>
        /// What happens to the entities when the Spell is used on them
        /// </summary>
        /// <param name="User">The BattleEntity that used this Spell</param>
        /// <param name="Entities">The BattleEntities affected by the Spell</param>
        public void OnUse(BattleEntity User, params BattleEntity[] Entities)
        {
            if (Entityeffect == null)
            {
                Debug.LogError($"Spell {Name}'s EntityEffect is null!");
                return;
            }

            Entityeffect.UseEffect(new Globals.AffectableInfo(User, this), Entities);
        }
コード例 #2
0
        /// <summary>
        /// Uses the item, inflicting the EntityEffect on the designated entities
        /// </summary>
        /// <param name="User">The BattleEntity that used the Item</param>
        /// <param name="Entities">The BattleEntities affected by the Item</param>
        public void OnUse(BattleEntity User, params BattleEntity[] Entities)
        {
            //Call use event
            ItemUseEvent?.Invoke(this, User);

            if (Entityeffect == null)
            {
                Debug.LogError($"Item {Name}'s EntityEffect is null!");
                return;
            }

            Entityeffect.UseEffect(new Globals.AffectableInfo(User, this), Entities);
        }
コード例 #3
0
 /// <summary>
 /// Returns a new instance of this Spell with the same properties
 /// </summary>
 /// <returns>A deep copy of the Spell</returns>
 public Spell Copy()
 {
     return(new Spell(Name, MPCost, MultiTarget, CastTurns, Alignment, FilterState, Entityeffect?.Copy()));
 }
コード例 #4
0
 /// <summary>
 /// Returns a new copy of the Item instance
 /// </summary>
 /// <returns>A deep copy of this Item</returns>
 public Item Copy()
 {
     return(new Item(Name, MultiTarget, Alignment, FilterState, Entityeffect?.Copy()));
 }