Example #1
0
        /// <summary>
        /// (déprécié)
        /// Obtient les spells possédés par le héros dont l'id est passé en paramètre.
        /// </summary>
        /// [Clank.ViewCreator.Access(controlerAccessStr, "Obtient les spells possédés par le héros dont l'id est passé en paramètre.")]
        public List <Views.SpellView> GetHeroSpells(int entityId)
        {
            if (GameServer.GetScene().Mode != SceneMode.Game)
            {
                return(new List <Views.SpellView>());
            }

            // Vérifie que l'entité existe.
            if (!GetMap().Entities.ContainsKey(entityId))
            {
                return(new List <Views.SpellView>());
            }

            Entities.EntityHero hero = GetMap().Entities[entityId] as Entities.EntityHero;

            // Vérifie que l'entité est bien un héros.
            if (hero == null)
            {
                return(new List <Views.SpellView>());
            }

            List <Views.SpellView> spells = new List <Views.SpellView>();

            foreach (var spell in hero.Spells)
            {
                spells.Add(spell.ToView());
            }

            return(spells);
        }
Example #2
0
 /// <summary>
 /// Creé une nouvelle instance de Weapon à partir du modèle donné.
 /// </summary>
 /// <param name="model"></param>
 public Weapon(Entities.EntityHero owner, WeaponModel model)
 {
     Model   = model;
     Level   = 0;
     Enchant = new WeaponEnchantModel();
     Owner   = owner;
 }
Example #3
0
 /// <summary>
 /// Initialise l'évènement.
 /// </summary>
 public override void Initialize()
 {
     m_destroyed    = true;
     m_team1Timer   = true;
     m_team2Timer   = true;
     m_teamOwner    = 0;
     m_lastKiller   = null;
     m_respawnTimer = 0; // GameServer.GetScene().Constants.Events.MonsterCamp.RespawnTimer;
 }
Example #4
0
 /// <summary>
 /// Initialise l'évènement.
 /// </summary>
 public override void Initialize()
 {
     m_destroyed       = true;
     m_team1Timer      = true;
     m_team2Timer      = true;
     m_teamOwner       = 0;
     m_monsters        = new List <Entities.EntityCampMonster>();
     m_lastKiller      = null;
     m_ViruspawnOffset = new Vector2(0, 2);
     m_respawnTimer    = 0; // GameServer.GetScene().Constants.Events.MonsterCamp.RespawnTimer;
 }
Example #5
0
        /// <summary>
        /// Demande une utilisation de l'arme.
        /// Retourne true si l'utilisation a réussi, false sinon.
        /// </summary>
        /// <param name="hero"></param>
        /// <returns></returns>
        public Spells.SpellUseResult Use(Entities.EntityHero hero, Entities.EntityBase entity)
        {
            // Vérifie que le cooldown de l'arme est à 0.
            if (m_cooldownSeconds > float.Epsilon)
            {
                return(Spells.SpellUseResult.OnCooldown);
            }
            if (hero.IsBlind)
            {
                return(Spells.SpellUseResult.Blind);
            }

            m_cooldownSeconds = 1.0f / Math.Max(hero.GetAttackSpeed(), 0.2f);

            Spells.SpellLevelDescription attackSpell = GetAttackSpell();
            Spells.WeaponAttackSpell     spell       = new Spells.WeaponAttackSpell(hero, attackSpell, Enchant);
            return(spell.Use(new Spells.SpellCastTargetInfo()
            {
                Type = Spells.TargettingType.Targetted, TargetId = entity.ID
            }, true));
        }
Example #6
0
 /// <summary>
 /// Se produit lorsqu'un des monstre du camp meurt.
 /// Mémorise le tueur du camp.
 /// </summary>
 void EventCamp_OnDie(Entities.EntityBase entity, Entities.EntityHero killer)
 {
     m_lastKiller = killer;
 }
Example #7
0
 public Amulet(Entities.EntityHero owner, PassiveEquipmentModel model) : base(owner, model)
 {
 }
Example #8
0
 /// <summary>
 /// Crée un nouveau contrôleur ayant le contrôle sur le héros donné.
 /// </summary>
 /// <param name="hero"></param>
 public ControlerBase(Entities.EntityHero hero)
 {
 }
 public PassiveEquipment(Entities.EntityHero owner, PassiveEquipmentModel model)
 {
     Owner = owner;
     Model = model;
 }