示例#1
0
    internal override void OnInitialize(params object[] parameters)
    {
        int             monsterID = (int)parameters[0];
        MonsterProperty property  = MonsterTable.GetProperty(monsterID);

        SetInfo(property);
    }
示例#2
0
        public EnemyAttributeFormat(int slotID, MonsterTable dbData, int?currentHP = null)
        {
            this.EnemeyType = ENEMY_TYPE.MONSTER;
            this.SlotID     = slotID;

            this.DBEnemyID = dbData.ID;
            this.DBNameID  = dbData.MonsterNameID;

            this.EXPOutput                      = dbData.EXPOutput;
            this.AuraOutput                     = dbData.AuraOutput;
            this.DimensionChipOutput            = dbData.DimensionChipOutput;
            this.DimensionChipOutputProbability = dbData.DimensionChipOutputProbability;

            this.Level = dbData.Level;
            this.HPMax = dbData.HPMax;
            if (currentHP != null)
            {
                this.HP = currentHP.Value;
            }
            else
            {
                this.HP = this.HPMax;
            }
            this.RES = dbData.RES;
            this.ATK = dbData.ATK;
            this.MAG = dbData.MAG;
            this.DEF = dbData.DEF;
            this.AC  = dbData.AC;
            this.CRI = dbData.CRI;
            this.PEN = dbData.PEN;
            this.HIT = dbData.HIT;
            this.AVD = dbData.AVD;
        }
        public override int ApplyEffect(EffectCast CastInfos)
        {
            // Possibilité de spawn une creature sur la case ?
            if (CastInfos.Caster.Fight.IsCellWalkable(CastInfos.CellId))
            {
                var InvocationId    = CastInfos.Value1;
                var InvocationLevel = CastInfos.Value2;
                var Monster         = MonsterTable.GetMonster(InvocationId);

                // Template de monstre existante
                if (Monster != null)
                {
                    Monster.Initialize();
                    var MonsterLevel = Monster.GetLevelOrNear(InvocationLevel);

                    // Level de monstre existant
                    if (MonsterLevel != null)
                    {
                        var MonsteFighter = new StaticMonster(CastInfos.Caster.Fight, MonsterLevel, CastInfos.Caster.Fight.NextActorInvocationId(CastInfos.Caster), Invocator: CastInfos.Caster);
                        MonsteFighter.JoinFight();
                        MonsteFighter.Fight.JoinFightTeam(MonsteFighter, CastInfos.Caster.Team, false, CastInfos.CellId);
                        MonsteFighter.Fight.RemakeTurns();
                        MonsteFighter.Fight.SendToFight(new GameInformationCoordinateMessage(MonsteFighter.Fight.Fighters));
                        MonsteFighter.Fight.SendToFight(new GameTurnListMessage(MonsteFighter.Fight.getWorkerFighters()));
                        MonsteFighter.Fight.GetCell(CastInfos.CellId).GetObjects <FightGroundLayer>().ForEach(x => x.onWalkOnLayer(MonsteFighter, MonsteFighter.Fight.GetCell(CastInfos.CellId)));
                    }
                }
            }

            return(-1);
        }
示例#4
0
    public static MonsterTable Load(string[] parts)
    {
        int          i = 0;
        MonsterTable p = new MonsterTable();

        p._Index        = int.Parse(parts[i++]);
        p._Name         = parts[i++];
        p._krName       = parts[i++];
        p._Damage       = float.Parse(parts[i++]);
        p._Hp           = float.Parse(parts[i++]);
        p._Speed        = float.Parse(parts[i++]);
        p._Armor        = float.Parse(parts[i++]);
        p._EffectOffset = float.Parse(parts[i++]);
        p._HUDOffset    = float.Parse(parts[i++]);
        p._Lore         = parts[i++];
        p._Abilities[0] = (CharacterAbilityType)System.Enum.Parse(typeof(CharacterAbilityType), parts[i++]);
        p._Abilities[1] = (CharacterAbilityType)System.Enum.Parse(typeof(CharacterAbilityType), parts[i++]);
        p._Abilities[2] = (CharacterAbilityType)System.Enum.Parse(typeof(CharacterAbilityType), parts[i++]);
        p._Abilities[3] = (CharacterAbilityType)System.Enum.Parse(typeof(CharacterAbilityType), parts[i++]);
        p._Abilities[4] = (CharacterAbilityType)System.Enum.Parse(typeof(CharacterAbilityType), parts[i++]);
        p._Abilities[5] = (CharacterAbilityType)System.Enum.Parse(typeof(CharacterAbilityType), parts[i++]);
        p._Parameter[0] = float.Parse(parts[i++]);
        p._Parameter[1] = float.Parse(parts[i++]);
        p._Parameter[2] = float.Parse(parts[i++]);
        p._Parameter[3] = float.Parse(parts[i++]);

        return(p);
    }
        void ReleaseDesignerOutlets()
        {
            if (EndEncounterButton != null)
            {
                EndEncounterButton.Dispose();
                EndEncounterButton = null;
            }

            if (InitiativeTable != null)
            {
                InitiativeTable.Dispose();
                InitiativeTable = null;
            }

            if (MonsterTable != null)
            {
                MonsterTable.Dispose();
                MonsterTable = null;
            }

            if (PartyTable != null)
            {
                PartyTable.Dispose();
                PartyTable = null;
            }

            if (StartEncounterButton != null)
            {
                StartEncounterButton.Dispose();
                StartEncounterButton = null;
            }
        }
示例#6
0
        protected override double ScoreInvocationStatic(AIProcessor AI, EffectInfos Effect, List <Fighter> Targets, bool Reverse = false, bool InvokPreview = false)
        {
            if (Reverse)//On evite la boucle infinie
            {
                return(0);
            }
            var BaseScore = 11;
            var Score     = BaseScore;

            var InvocationId    = Effect.Value1;
            var InvocationLevel = Effect.Value2;

            if (InvokPreview)
            {
                return(BaseScore * InvocationLevel);
            }
            if (!AI.myNeuron.myScoreInvocations.ContainsKey(InvocationId))
            {
                var Monster = MonsterTable.GetMonster(InvocationId);
                // Template de monstre existante
                if (Monster != null)
                {
                    Monster.Initialize();
                    var MonsterLevel = Monster.GetLevelOrNear(InvocationLevel);
                    // Level de monstre existant
                    if (MonsterLevel != null)
                    {
                        List <Fighter> possibleTargets = AI.myFight.GetAllyTeam(AI.myFighter.Team).GetFighters().FindAll(x => !x.Dead && !x.Left);
                        foreach (var Spell in MonsterLevel.Spells.GetSpells())
                        {
                            foreach (var spellEffect in Spell.Effects)
                            {
                                int currScore = (int)this.GetEffectScore(AI, -1, -1, spellEffect, possibleTargets, InvokPreview: true);
                                if (currScore > 0)
                                {
                                    Score += currScore;
                                }
                            }
                        }
                        foreach (var State in MonsterLevel.Stats.GetEffects().Values)
                        {
                            var total = State.Total;
                            if (total > 0)
                            {
                                Score += total;
                            }
                        }
                        Score *= MonsterLevel.Level;
                        AI.myNeuron.myScoreInvocations.Add(InvocationId, Score);
                        return(Score);
                    }
                }
            }
            else
            {
                return(AI.myNeuron.myScoreInvocations[InvocationId]);
            }
            return(0);
        }
示例#7
0
 partial void OnRemoveMonsterButtonClicked(NSObject sender)
 {
     if (MonsterTable.SelectedRow != -1)
     {
         monsterDataSource.MonsterEntries.RemoveAt((int)MonsterTable.SelectedRow);
         MonsterTable.ReloadData();
     }
 }
示例#8
0
 public MemoryDatabase(
     MonsterTable MonsterTable,
     PersonTable PersonTable
     )
 {
     this.MonsterTable = MonsterTable;
     this.PersonTable  = PersonTable;
 }
示例#9
0
 public EnemyAnimationFormat(MonsterTable dbData)
 {
     base.TexturePath = dbData.TexturePath;
     base.IconID      = dbData.TextureIconID;
     base.IdleID      = dbData.TextureIdleID;
     base.AttackID    = dbData.TextureAttackID;
     base.GetDamageID = dbData.TextureGetDamageID;
     base.DeadID      = dbData.TextureDeadID;
 }
示例#10
0
 public WorldZone(string name_, WorldZoneType type_, string lookText_)
 {
     Name           = name_;
     ZoneType       = type_;
     LookText       = lookText_;
     ConnectedZones = new List <string>();
     MonsterTable   = new MonsterTable();
     EventTable     = new WorldEventTable();
 }
示例#11
0
        public void ReplaceAll(System.Collections.Generic.IList <Monster> data)
        {
            var newData = CloneAndSortBy(data, x => x.MonsterId, System.Collections.Generic.Comparer <int> .Default);
            var table   = new MonsterTable(newData);

            memory = new MemoryDatabase(
                table,
                memory.PersonTable

                );
        }
示例#12
0
 public WorldZone(WorldZone other)
 {
     Name                = other.Name;
     ZoneType            = other.ZoneType;
     LookText            = other.LookText;
     ConnectedZones      = new List <string>(other.ConnectedZones);
     MonsterTable        = new MonsterTable(other.MonsterTable);
     EventTable          = new WorldEventTable(other.EventTable);
     BackgroundTrackName = other.BackgroundTrackName;
     AmbientTrackName    = other.AmbientTrackName;
 }
示例#13
0
        public static void Initialize()
        {
            nextPlayerGuid = CharacterTable.getNextGuid();
            nextPlayerGuid++;
            nextItemGuid = InventoryItemTable.getNextGuid();
            nextItemGuid++;
            nextGuildId = GuildTable.getNextGuid();
            nextGuildId++;
            nextMountId = MountTable.getNextGuid();
            nextMountId++;
            nextSpeakingId = SpeakingTable.getNextGuid();
            nextSpeakingId++;
            SpellTable.Load();
            ExpFloorTable.Load();
            MonsterTable.Load();
            ItemTemplateTable.Load();
            ItemTemplateTable.LoadItemActions();
            ItemSetTable.Load();
            DropTable.Load();
            TitleTable.Load();
            IObjectTemplateTable.Load();
            AreaTable.Load();
            AreaSubTable.Load();
            MapTable.Load();
            MapTable.LoadActions();
            CellActionTable.Load();
            MobGroupFixTable.Load();
            BreedTable.Load();
            NpcTemplateTable.Load();
            NpcTemplateTable.LoadPlaces();
            NpcQuestionTable.Load();
            NpcReplyTable.Load();
            ShopNpcTable.Initialize();
            GuildTable.Load();
            CharactersGuildTable.Load();
            TaxCollectorTable.Load();
            PrismeTable.Load();
            BidHouseTable.Load();
            BidHouseTable.LoadItems();
            MountParkTable.Load();
            StaticMountTable.Load();
            MountTable.Load();//TODO Dynamic load of Character mount
            ZaapTable.Load();
            ZaapiTable.Load();

            var Timer = new System.Timers.Timer(1000 * 60 * 25);

            Timer.Elapsed += delegate(object sender, ElapsedEventArgs e)
            {
                Save();
            };
            Timer.Start();
        }
示例#14
0
        public void Diff(Monster[] addOrReplaceData)
        {
            var data    = DiffCore(memory.MonsterTable.GetRawDataUnsafe(), addOrReplaceData, x => x.MonsterId, System.Collections.Generic.Comparer <int> .Default);
            var newData = CloneAndSortBy(data, x => x.MonsterId, System.Collections.Generic.Comparer <int> .Default);
            var table   = new MonsterTable(newData);

            memory = new MemoryDatabase(
                table,
                memory.PersonTable

                );
        }
示例#15
0
        public void RemoveMonster(int[] keys)
        {
            var data    = RemoveCore(memory.MonsterTable.GetRawDataUnsafe(), keys, x => x.MonsterId, System.Collections.Generic.Comparer <int> .Default);
            var newData = CloneAndSortBy(data, x => x.MonsterId, System.Collections.Generic.Comparer <int> .Default);
            var table   = new MonsterTable(newData);

            memory = new MemoryDatabase(
                table,
                memory.PersonTable

                );
        }
示例#16
0
    public void InitStatus(MonsterTable table)
    {
        Damage        = table._Damage;
        CurrentDamage = Damage;

        Armor        = table._Armor;
        CurrentArmor = Armor;

        Hp        = table._Hp;
        CurrentHp = Hp;

        Speed        = table._Speed;
        CurrentSpeed = Speed;
    }
示例#17
0
        private void addMonstersToEncounter(Monster monster, bool reloadFlag)
        {
            int currentMonsterTypeCount = monsterDataSource.MonsterEntries.Count(m => m.Type.Equals(monster.Type));

            // Only rename generic monsters
            if (monster.Name.Equals(monster.Type))
            {
                monster.Name = $"{monster.Type} {currentMonsterTypeCount + 1}";
            }
            monsterDataSource.MonsterEntries.Add(monster);
            if (reloadFlag)
            {
                MonsterTable.ReloadData();
            }
        }
示例#18
0
        public MonsterGroup(long GroupId, String groupData)
        {
            this.ItemLoot   = new List <ItemLoot>();
            this.ActorId    = GroupId;
            this.Alignement = -1;
            this.IsFix      = true;

            this.Monsters = new Dictionary <int, MonsterLevel>();

            var MaxLevel    = 0;
            var MonsterGUID = -1;

            foreach (String data in groupData.Split(';'))
            {
                String[] infos = data.Trim().Split(',');
                try{
                    int     id  = int.Parse(infos[0]);
                    int     min = int.Parse(infos[1]);
                    int     max = int.Parse(infos[2]);
                    Monster m   = MonsterTable.GetMonster(id);
                    m.Initialize();
                    var mgs = new List <MonsterLevel>();
                    foreach (var MG in m.GetMobs())
                    {
                        if (MG.Level >= min && MG.Level <= max)
                        {
                            if (MG.Level > MaxLevel)
                            {
                                MaxLevel = MG.Level;
                            }

                            mgs.Add(MG);
                        }
                    }
                    if (mgs.Count < 1)
                    {
                        continue;
                    }
                    this.Monsters.Add(MonsterGUID--, mgs[Algo.getRandomValue(0, mgs.Count() - 1)]);
                }
                catch (Exception e)
                {
                    continue;
                };
            }
            this.Aggrodistance = Pathfinder.GetAggroDistanceByLevel(MaxLevel);
            this.Orientation   = Pathfinder.ForViewOrientation(RANDOM.Next(0, 7));
        }
示例#19
0
 public MemoryDatabase(
     QuestTable QuestTable,
     ItemTable ItemTable,
     MonsterTable MonsterTable,
     PersonTable PersonTable,
     Test1Table Test1Table,
     Test2Table Test2Table
     )
 {
     this.QuestTable   = QuestTable;
     this.ItemTable    = ItemTable;
     this.MonsterTable = MonsterTable;
     this.PersonTable  = PersonTable;
     this.Test1Table   = Test1Table;
     this.Test2Table   = Test2Table;
 }
示例#20
0
    public void Start()
    {
        for (int i = 0; i < m_monsterIDs.Count; ++i)
        {
            MonsterProperty property = MonsterTable.GetProperty(m_monsterIDs[i]);

            if (null == property)
            {
                return;
            }

            CharacterBase result    = AssetManager.Instance.Character.Retrieve(property.prefabName, m_monsterIDs[i]);
            float         randomPos = Random.Range(-2.0f, 2.0f);
            Vector3       initPos   = this.transform.position;
            initPos.x += randomPos;
            initPos.z += randomPos;

            result.transform.position = initPos;

            IngameManager.Instance.EnemyRegister(result as Enemy);
        }
    }
示例#21
0
        public EnemyDataFormat(int slotID, MonsterTable dbData, EnemySaveDataFormat enemySaveData = null)
        {
            this.Attributes = new EnemyAttributeFormat(slotID, dbData);

            if (enemySaveData != null)
            {
                this.AttributesAggregateBuff = enemySaveData.AttributesAggregateBuff.CloneEx();
            }

            this.AnimationInfo = new EnemyAnimationFormat(dbData);

            var _skillDataList = MonsterSkillTableReader.Instance.FindDefaultByMonsterID(dbData.ID);

            if (_skillDataList != null)
            {
                this.SkillList = new List <EnemySkillFormat> ();
                _skillDataList.ForEach(_skillData => {
                    this.SkillList.Add(new EnemySkillFormat(_skillData));
                });
            }

            this.EquipmentList = new List <EnemyEquipmentFormat> ();
        }
示例#22
0
 public bool GetMonsterTable(int id, out MonsterTable table)
 {
     return(_mapMonsterTable.TryGetValue(id, out table));
 }
示例#23
0
 partial void OnClearMonstersButtonClicked(NSObject sender)
 {
     monsterDataSource.MonsterEntries.Clear();
     MonsterTable.ReloadData();
 }