Exemplo n.º 1
0
 protected void OnCharacterSelected(PlayedCharacter character)
 {
     if (CharacterSelected != null)
     {
         CharacterSelected(this, character);
     }
 }
Exemplo n.º 2
0
 public bool CheckCriteria(PlayedCharacter pc)
 {
     if (string.IsNullOrEmpty(this.Template.criteria))
     {
         return(true);
     }
     return(pc.CheckCriteria(this.Template.criteria));
 }
Exemplo n.º 3
0
 public Inventory(PlayedCharacter owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     Owner = owner;
     Items = new ObservableCollection <Item>();
 }
Exemplo n.º 4
0
 public SpellsBook(PlayedCharacter owner, SpellListMessage list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     Owner = owner;
     Update(list);
 }
Exemplo n.º 5
0
 public PlayerStats(PlayedCharacter owner)
     : this()
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     Owner = owner;
 }
Exemplo n.º 6
0
 public PlayerStats(PlayedCharacter owner, CharacterCharacteristicsInformations stats)
     : this(owner)
 {
     if (stats == null)
     {
         throw new ArgumentNullException("stats");
     }
     Update(stats);
 }
Exemplo n.º 7
0
        protected void OnCharactersSelected(PlayedCharacter character)
        {
            CharacterSelectedHandler handler = CharactersSelected;

            if (handler != null)
            {
                handler(this, character);
            }
        }
Exemplo n.º 8
0
        public bool BeginTransition(PlayedCharacter character)
        {
            if (IsEnded())
            {
                return(true);
            }

            CurrentTransition.TransitionEnded += CurrentTransitionOnTransitionEnded;
            return(CurrentTransition.BeginTransition(character.SubMap, SubMaps[Index + 1], character));
        }
Exemplo n.º 9
0
 public PlayerStats(PlayedCharacter owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     Fields = new Dictionary <PlayerField, StatsRow>();
     SpellsModifications = new ObservableCollection <SpellModification>();
     Owner = owner;
 }
Exemplo n.º 10
0
 public PlayerStats(PlayedCharacter owner, CharacterCharacteristicsInformations stats)
 {
     if (stats == null)
     {
         throw new ArgumentNullException("stats");
     }
     Fields = new Dictionary <PlayerField, StatsRow>();
     SpellsModifications = new ObservableCollection <SpellModification>();
     Update(stats);
 }
Exemplo n.º 11
0
        public override bool CanStart(PlayedCharacter character)
        {
            if (Path.Length == 0)
            {
                return(false);
            }

            return((StartFromFirst && Path[0].MapId == character.Map.Id && Path[0].SubMapId == character.SubMap.SubMapId) ||
                   Path.Any(x => character.Map.Id == x.MapId && character.SubMap.SubMapId == x.SubMapId));
        }
Exemplo n.º 12
0
 public PlayedFighter(PlayedCharacter character, Fight fight)
     : base(fight)
 {
     Character     = character;
     Map           = character.Map;
     Cell          = character.Cell;
     Direction     = character.Direction;
     CanFight      = true;
     CanCastSpells = true;
 }
Exemplo n.º 13
0
 public SpellsBook(PlayedCharacter owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     Character        = owner;
     m_spells         = new ObservableCollectionMT <Spell>();
     m_readOnlySpells = new ReadOnlyObservableCollectionMT <Spell>(m_spells);
 }
Exemplo n.º 14
0
 public ShortcutBar(PlayedCharacter character)
 {
     if (character == null)
     {
         throw new ArgumentNullException("character");
     }
     Character           = character;
     m_shortcuts         = new ObservableCollectionMT <T>();
     m_readOnlyShortcuts = new ReadOnlyObservableCollectionMT <T>(m_shortcuts);
 }
Exemplo n.º 15
0
        public Inventory(PlayedCharacter owner, InventoryContentMessage inventory)
            : this(owner)
        {
            if (inventory == null)
            {
                throw new ArgumentNullException("inventory");
            }
            Kamas = inventory.kamas;

            Update(inventory);
        }
Exemplo n.º 16
0
 public Inventory(PlayedCharacter owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     Owner           = owner;
     m_items         = new ObservableCollectionMT <Item>();
     m_readOnlyItems = new ReadOnlyObservableCollectionMT <Item>(m_items);
     AutomaticallyDestroyItemsOnOverload = false;
 }
Exemplo n.º 17
0
        public PlayedFighter(PlayedCharacter character, Fight fight)
            : base(fight)
        {
            Character = character;
            Fight     = fight;

            if (character.Position != null)
            {
                Position = character.Position.Clone();
            }
        }
Exemplo n.º 18
0
        private void OnFightJoined(PlayedCharacter character, Fight fight)
        {
            if (m_checkTimer != null)
            {
                m_checkTimer.Dispose();
            }

            m_character = character.Fighter;
            character.Fighter.TurnStarted += OnTurnStarted;
            fight.StateChanged            += OnStateChanged;
        }
        public override bool BeginTransition(SubMap @from, SubMapBinder to, PlayedCharacter character)
        {
            if (!character.ChangeMap(MapNeighbour, cell => Cells == null || Cells.Length == 0 || Array.IndexOf(Cells, cell.CellId) != -1))
            {
                logger.Error("Cannot proceed transition : cannot reach {0} map from {1} (submap:{2} to {3})",
                             MapNeighbour, character.Map.Id, @from.GlobalId, to.GlobalId);

                return(false);
            }

            return(true);
        }
Exemplo n.º 20
0
        public void Start(PlayedCharacter character)
        {
            if (IsPaused)
            {
                Resume();
                return;
            }

            if (IsRunning)
            {
                return;
            }

            IsRunning = true;
            Character = character;

            OnStart();
        }
Exemplo n.º 21
0
        public void SetPlayedCharacter(PlayedCharacter character)
        {
            if (m_disposed)
            {
                throw new Exception("Bot instance is disposed");
            }

            if (character == null)
            {
                throw new ArgumentNullException("character");
            }
            if (Character != null)
            {
                throw new Exception("Character already selected");
            }

            Character = character;
            OnCharacterSelected(character);
        }
Exemplo n.º 22
0
        public void Start(PlayedCharacter character)
        {
            if (IsPaused)
            {
                Resume();
                return;
            }

            if (IsRunning)
            {
                return;
            }

            IsRunning = true;
            Character = character;

            CurrentAction.Finished += OnCurrentActionFinished;

            OnStart();
        }
Exemplo n.º 23
0
 public ItemShortcut(PlayedCharacter character, ShortcutObjectItem shortcut)
     : base(character, shortcut.slot)
 {
     Item     = character.Inventory.GetItem(shortcut.itemUID);
     Template = ObjectDataManager.Instance.Get <Item>(shortcut.itemGID);
 }
Exemplo n.º 24
0
 public SpellsBook(PlayedCharacter owner)
 {
     Owner  = owner;
     Spells = new ObservableCollection <Spell>();
 }
Exemplo n.º 25
0
 public EmoteShortcut(PlayedCharacter character, ShortcutEmote shortcut)
     : base(character, shortcut.slot)
 {
     Emote = ObjectDataManager.Instance.Get <Emoticon>(shortcut.emoteId);
 }
Exemplo n.º 26
0
 private void OnMapJoined(PlayedCharacter character, Map map)
 {
     m_checkTimer = character.Bot.CallPeriodically(4 * 1000, CheckMonsters);
 }
Exemplo n.º 27
0
 private void OnFightLeft(PlayedCharacter character, Fight fight)
 {
     m_character = null;
     character.Fighter.TurnStarted -= OnTurnStarted;
     fight.StateChanged            -= OnStateChanged;
 }
Exemplo n.º 28
0
 public abstract bool CanStart(PlayedCharacter character);
Exemplo n.º 29
0
 private void OnCharacterSelected(Behaviors.Bot bot, PlayedCharacter character)
 {
 }
Exemplo n.º 30
0
 public override bool CanStart(PlayedCharacter character)
 {
     return(IsInZone(character));
 }