Exemplo n.º 1
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.º 2
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.º 3
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.º 4
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.º 5
0
 public PlayedFighter(PlayedCharacter character, Fight fight)
     : base(fight)
 {
     Character = character;
     Map = character.Map;
     Cell = character.Cell;
     Direction = character.Direction;
 }
Exemplo n.º 6
0
        public Inventory(PlayedCharacter owner, InventoryContentMessage inventory)
            : this(owner)
        {
            if (inventory == null) throw new ArgumentNullException("inventory");
            Kamas = inventory.kamas;

            Update(inventory);
        }
Exemplo n.º 7
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.º 8
0
        public PlayedFighter(PlayedCharacter character, Fight fight)
            : base(fight)
        {
            Character = character;
            Fight = fight;

            if (character.Position != null)
                Position = character.Position.Clone();
        }
Exemplo n.º 9
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.º 10
0
        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.º 11
0
 public void Init(PlayedCharacter character)
 {
   FavoredAttackSpells = new List<int>();
   FavoredBoostSpells = new List<int>();
   FavoredCurseSpells = new List<int>();
   FavoredHealSpells = new List<int>();
   FavoredInvocSpells = new List<int>();
   IsInvoker = false;
   IsHealer = false;
   // You can set here default preference for each breed   
   MaxPower = 1.0;
   switch ((BreedEnum)character.Breed.Id)
   {
     case BreedEnum.Cra:
       break;
     case BreedEnum.Ecaflip:
       break;
     case BreedEnum.Eniripsa:
       IsHealer = true;
       MaxPower = 0.8;
       FavoredBoostSpells = new List<int>() { 126 }; // Mot stimulant                   
       break;
     case BreedEnum.Enutrof:
       break;
     case BreedEnum.Feca:
       break;
     case BreedEnum.Iop:
       MaxPower = 1.5;
       break;
     case BreedEnum.Osamodas:
       FavoredBoostSpells = new List<int>() { 26 }; // Bénédiction animale
       IsInvoker = true;
       break;
     case BreedEnum.Pandawa:
       break;
     case BreedEnum.Roublard:
       break;
     case BreedEnum.Sacrieur:
       break;
     case BreedEnum.Sadida:
       break;
     case BreedEnum.Sram:
       break;
     case BreedEnum.Steamer:
       break;
     case BreedEnum.Xelor:
       break;
     case BreedEnum.Zobal:
       break;
     default:
       break;
   }
 }
Exemplo n.º 12
0
        public void Start(PlayedCharacter character)
        {
            if (IsPaused)
            {
                Resume();
                return;
            }

            if (IsRunning)
                return;

            IsRunning = true;
            Character = character;

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

            if (IsRunning)
                return;

            IsRunning = true;
            Character = character;

            CurrentAction.Finished += OnCurrentActionFinished;

            OnStart();
        }
Exemplo n.º 14
0
 public GeneralShortcut(PlayedCharacter character, int slot)
     : base(character, slot)
 {
     
 }
Exemplo n.º 15
0
 public SpellsBook(PlayedCharacter owner, SpellListMessage list)
     : this(owner)
 {
     if (list == null) throw new ArgumentNullException("list");
     Update(list);
 }
Exemplo n.º 16
0
 private void OnFightLeft(PlayedCharacter character, Fight fight)
 {
     m_character = null;
     character.Fighter.TurnStarted -= OnTurnStarted;
     fight.StateChanged -= OnStateChanged;
 }
Exemplo n.º 17
0
 public SpellShortcut(PlayedCharacter character, ShortcutSpell shortcut)
     : base(shortcut.slot)
 {
     Character = character;
     SpellId = shortcut.spellId;
 }
Exemplo n.º 18
0
 public SpellsBook(PlayedCharacter owner)
 {
     if (owner == null) throw new ArgumentNullException("owner");
     Character = owner;
     Spells = new ObservableCollection<Spell>();
 }
Exemplo n.º 19
0
 public PlayerStats(PlayedCharacter owner, CharacterCharacteristicsInformations stats)
     : this()
 {
     if (stats == null) throw new ArgumentNullException("stats");
     Update(stats);
 }
Exemplo n.º 20
0
 public PlayerStats(PlayedCharacter owner)
     : this()
 {
     if (owner == null) throw new ArgumentNullException("owner");
     Owner = owner;
 }
Exemplo n.º 21
0
 private void OnMapJoined(PlayedCharacter character, Map map)
 {
     m_checkTimer = character.Bot.CallPeriodically(4 * 1000, CheckMonsters);
 }
Exemplo n.º 22
0
 public Job(PlayedCharacter owner, JobDescription job)
 {
     Owner = owner;
     SetJob(job);
 }
Exemplo n.º 23
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;
            OnCharactersSelected(character);
        }
Exemplo n.º 24
0
 public bool CheckCriteria(PlayedCharacter pc)
 {
     if (string.IsNullOrEmpty(this.Template.criteria)) return true;
     return pc.CheckCriteria(this.Template.criteria);
 }
Exemplo n.º 25
0
 public abstract bool CanActivate(SchemaElement element, PlayedCharacter character);
Exemplo n.º 26
0
 protected void OnCharactersSelected(PlayedCharacter character)
 {
     CharacterSelectedHandler handler = CharactersSelected;
     if (handler != null) handler(this, character);
 }
Exemplo n.º 27
0
 public abstract bool CanRun(PlayedCharacter character);
Exemplo n.º 28
0
 public Inventory(PlayedCharacter owner)
 {
     if (owner == null) throw new ArgumentNullException("owner");
     Owner = owner;
     Items = new ObservableCollection<Item>();
 }
Exemplo n.º 29
0
 public override bool CanRun(PlayedCharacter character)
 {
     // + conditions
     return character.CanMove();
 }
Exemplo n.º 30
0
        public bool BeginTransition(PlayedCharacter character)
        {
            if (IsEnded())
                return true;

            CurrentTransition.TransitionEnded += CurrentTransitionOnTransitionEnded;
            return CurrentTransition.BeginTransition(character.SubMap, SubMaps[Index + 1], character);
        }