Inheritance: Codebreak.Service.World.Network.MessageDispatcher, IMovementHandler, IDisposable
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="activeType"></param>
        /// <param name="fight"></param>
        /// <param name="caster"></param>
        /// <param name="castInfos"></param>
        /// <param name="cell"></param>
        /// <param name="duration"></param>
        /// <param name="actionId"></param>
        /// <param name="canGoThrough"></param>
        /// <param name="canStack"></param>
        /// <param name="hide"></param>
        protected AbstractActivableObject(FightObstacleTypeEnum type, ActiveType activeType, AbstractFight fight, AbstractFighter caster, CastInfos castInfos, int cell, int duration, int actionId, bool canGoThrough, bool canStack, bool hide = false)
        {
            m_fight = fight;
            m_caster = caster;
            m_spellId = castInfos.SpellId;
            m_actionSpell = SpellManager.Instance.GetTemplate(castInfos.Value1);
            m_actionEffect = m_actionSpell.GetLevel(castInfos.Value2);

            Cell = fight.GetCell(cell);
            ObstacleType = type;
            ActivationType = activeType;
            CanGoThrough = canGoThrough;
            CanStack = canStack;
            Color = castInfos.Value3;
            Targets = new List<AbstractFighter>();
            Length = Pathfinding.GetDirection(castInfos.RangeType[1]);
            AffectedCells = new List<FightCell>();
            Duration = duration;
            ActionId = actionId;
            Hide = hide;

            foreach(var effect in m_actionEffect.Effects)
            {
                if(CastInfos.IsDamageEffect(effect.TypeEnum))
                {
                    Priority--;
                }
            }

            // On ajout l'objet a toutes les cells qu'il affecte
            foreach (var cellId in CellZone.GetCircleCells(fight.Map, cell, Length))
            {
                var fightCell = m_fight.GetCell(cellId);
                if (fightCell != null)
                {
                    fightCell.AddObject(this);
                    AffectedCells.Add(fightCell);
                }
            }

            if (Hide)
                Appear(caster.Team);
            else
                AppearForAll();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="leaderId"></param>
        /// <param name="alignment"></param>
        /// <param name="flagCell"></param>
        /// <param name="fight"></param>
        /// <param name="places"></param>
        public FightTeam(int id, long leaderId, int alignment, int flagCell, AbstractFight fight, List<FightCell> places)
        {
            Id = id;
            Fight = fight;
            LeaderId = leaderId;
            AlignmentId = alignment;
            FlagCellId = flagCell;

            m_challenges = new List<AbstractChallenge>();
            m_fighters = new List<AbstractFighter>();
            m_places = places;
            m_blockedOption = new Dictionary<FightOptionTypeEnum, bool>()
            {
                { FightOptionTypeEnum.TYPE_NEW_PLAYER_BIS, false },
                { FightOptionTypeEnum.TYPE_HELP, false },
                { FightOptionTypeEnum.TYPE_PARTY, false },
                { FightOptionTypeEnum.TYPE_SPECTATOR, false },
            };
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fight"></param>
        public virtual void JoinSpectator(AbstractFight fight)
        {
            Fight = fight;
            IsSpectating = true;

            Fight.SpectatorTeam.AddSpectator(this);
            Fight.SpectatorTeam.AddUpdatable(this);
            Fight.SpectatorTeam.AddHandler(Dispatch);

            SetChatChannel(ChatChannelEnum.CHANNEL_TEAM, () => Fight.SpectatorTeam.Dispatch);
            SetChatChannel(ChatChannelEnum.CHANNEL_GENERAL, () => null);

            StartAction(GameActionTypeEnum.FIGHT);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fight"></param>
        /// <param name="team"></param>
        public override void JoinFight(AbstractFight fight, FightTeam team)
        {
            LifeBeforeFight = Life;

            Dispatch(WorldMessage.INTERACTIVE_DATA_FRAME_FIGHT(Map.InteractiveObjects));

            base.JoinFight(fight, team);
        }
Ejemplo n.º 5
0
 public override void JoinFight(AbstractFight fight, FightTeam team)
 {
     Life = MaxLife;
     base.JoinFight(fight, team);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="fight"></param>
 /// <param name="caster"></param>
 /// <param name="effect"></param>
 /// <param name="cell"></param>
 /// <param name="duration"></param>
 public FightGlyph(AbstractFight fight, AbstractFighter caster, CastInfos effect, int cell, int duration)
     : base(FightObstacleTypeEnum.TYPE_GLYPH, ActiveType.ACTIVE_BEGINTURN, fight, caster, effect, cell, duration, 307, true, true)
 {
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 
        /// </summary>
        public override void Dispose()
        {
            m_fight = null;
            m_spectators.Clear();
            m_spectators = null;

            base.Dispose();
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="fight"></param>
 public SpectatorTeam(AbstractFight fight)
 {
     m_fight = fight;
     m_spectators = new List<CharacterEntity>();
 }
Ejemplo n.º 9
0
        /// <summary>
        /// 
        /// </summary>
        public virtual void JoinFight(AbstractFight fight, FightTeam team)
        {
            BuffManager = new BuffEffectManager(this);
            StateManager = new FighterStateManager(this);
            SpellManager = new SpellCastManager();

            DeclaredDead = false;
            Orientation = 1;
            Skin = SkinBase;
            SkinSize = SkinSizeBase;
            UsedAP = 0;
            UsedMP = 0;

            Fight = fight;

            Team = team;
            TurnReady = false;
            TurnPass = false;

            Team.AddFighter(this);
            Team.AddUpdatable(this);
            Team.AddHandler(Dispatch);

            if (Life < 1)
                Life = 1;

            if(Fight.State == FightStateEnum.STATE_PLACEMENT)
                SetCell(Team.FreePlace);

            SetChatChannel(ChatChannelEnum.CHANNEL_TEAM, () => Team.Dispatch);
            StartAction(GameActionTypeEnum.FIGHT);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="fight"></param>
 /// <param name="caster"></param>
 /// <param name="effect"></param>
 /// <param name="cell"></param>
 public FightTrap(AbstractFight fight, AbstractFighter caster, CastInfos effect, int cell)
     : base(FightObstacleTypeEnum.TYPE_TRAP, ActiveType.ACTIVE_ENDMOVE, fight, caster, effect, cell, 0, 306, true, false, true)
 {
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="fight"></param>
 public void Remove(AbstractFight fight)
 {
     FightCount--;
     m_fightList.Remove(fight.Id);
     m_map.Dispatch(WorldMessage.FIGHT_COUNT(FightCount));
     RemoveHandler(fight.Dispatch);
     RemoveUpdatable(fight);
     fight.Dispose();
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="fight"></param>
 private void Add(AbstractFight fight)
 {
     fight.Start();
     FightCount++;
     m_fightList.Add(fight.Id, fight);
     m_map.Dispatch(WorldMessage.FIGHT_COUNT(FightCount));
     AddHandler(fight.Dispatch);
     AddUpdatable(fight);
 }