Esempio n. 1
0
        void ICreateBoardElement.OnCreateBoardElement(SeatType id, CreatureElement creatureElement, Vector3Int cell,
                                                      CardHand card)
        {
            var data = creatureElement.Data;

            CreateElement(creatureElement, data, cell);
        }
Esempio n. 2
0
        public void Run()
        {
            CreatureElement creature = new CreatureElement();

            double[][][] weights = new double[][][] {
                new double[][] {
                    new double[] { 1, 2, 3, 4 },
                    new double[] { -1, 2, -3, 4 },
                    new double[] { 4, 3, 2, 1 }
                },
            };

            creature.Brain = new NeuralNetwork(weights);

            Universe.Elements.Add(creature);

            while (true)
            {
                foreach (CreatureElement c in Universe.Elements)
                {
                    c.Run();
                }

                Universe.NotifyChanges();
            }
        }
Esempio n. 3
0
 public void OnCreateBoardElement(PlayerId id, CreatureElement creatureElement, Vector3Int position,
                                  CardHand card)
 {
     EventReceived = true;
     Assert.IsTrue(creatureElement.Data == _mockCardData);
     Assert.IsTrue(position == _v3IntPosition);
     Assert.IsTrue(_cardHand == card);
 }
Esempio n. 4
0
 public bool HasElement(CreatureElement Element)
 {
     if (newElement == CreatureElement.NULL)
     {
         return(ActiveCreature.HasElement(Element));
     }
     return(newElement == Element);
 }
Esempio n. 5
0
 public SceneAnimation GiveElementBuff(CreatureElement Element, bool IsPositiveBoost)
 {
     if (IsPositiveBoost)
     {
         ElementBuffs[(byte)Element] = true;
         return(new SceneAnimation(SceneAnimation.SceneAnimationType.ELEMENT_BOOST, new double[] { playerNumber, (double)Element, 1 }, "#ELEMENT BOOST ANIMATION#"));
     }
     ElementBuffs[(byte)Element] = false;
     return(new SceneAnimation(SceneAnimation.SceneAnimationType.ELEMENT_BOOST, new double[] { playerNumber, (double)Element, -1 }, "#ELEMENT BOOST ANIMATION#"));
 }
        void ICreateBoardElement.OnCreateBoardElement(SeatType id, CreatureElement creatureElement, Vector3Int position,
                                                      CardHand card)
        {
            if (!IsMyEvent(id))
            {
                return;
            }

            Registry.RemoveCard(card);
        }
Esempio n. 7
0
        void CreateElement(CreatureElement creatureElement, ICardData data, Vector3Int cell)
        {
            var element = ObjectPooler.Instance.Get(boardElementPrefab);

            _boardElements.Add(element);
            var elementTransform = element.transform;
            var boardElement     = element.GetComponent <UiBoardElement>();

            elementTransform.SetParent(transform);
            elementTransform.position = TileMap.CellToWorld(cell);
            boardElement.SetElement(creatureElement);
        }
Esempio n. 8
0
 public double GetElementBuffs(CreatureElement Element)
 {
     if (ElementBuffs[(byte)Element] == true)
     {
         return(1.5);
     }
     if (ElementDebuffs[(byte)Element] == true)
     {
         return(0.67);
     }
     return(1.0);
 }
Esempio n. 9
0
        public List <SceneAnimation> Damage(Player Target, CreatureElement Element, ActionCategory Catagory, byte BaseAmount, byte AmountOfAttacks, SceneAnimation AttackAnimation, bool TriggersAttackFlags)
        {
            List <SceneAnimation> Animations = new List <SceneAnimation>();

            if (TriggersAttackFlags)
            {
                Animations.AddRange(
                    RunTriggerTypeEffect(EffectTrigger.BEFORE_ATTACKED, Target, false)
                    );
            }

            for (int i = 0; i < AmountOfAttacks; i++)
            {
                Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.ATTACK, new double[] {
                    GetOpponent(Target).playerNumber,
                    (double)Catagory
                }, "#ATTACK ANIMATION#"));
                //Animations.Add(AttackAnimation); //TODO: DONT PASS AS ARGUMENT

                //Animations.AddRange(Target.GiveDamage(Element, Catagory, BaseAmount, GetOpponent(Target).GetTotalStat(CreatureStats.STRENGTH), GetOpponent(Target).GetTotalStat(CreatureStats.INTELLIGENCE), Target.GetTotalStat(CreatureStats.ENDURANCE), Target.GetTotalStat(CreatureStats.WISDOM), GetOpponent(Target).HasElement(Element) ? 1.5 : 1, Target.GetElementEffectiveness(Element)));
                Animations.AddRange(Target.GiveDamage(Element, Catagory, BaseAmount, GetOpponent(Target)));
                if (Target.IsNotInArena())
                {
                    AmountOfAttacks = (byte)(i + 1);
                    break;
                }
            }
            if (AmountOfAttacks > 1)
            {
                if (AmountOfAttacks == 2)
                {
                    Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.ADD_MESSAGE, null, "Damage landed twice!"));
                }
                else
                {
                    Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.ADD_MESSAGE, null, "Damage landed " + AmountOfAttacks + " times!"));
                }
            }
            if (Target.IsKilled())
            {
                Animations.AddRange(RemoveFromArena(Target, true));
            }
            else if (!Target.IsNotInArena())
            {
                if (TriggersAttackFlags)
                {
                    Animations.AddRange(
                        RunTriggerTypeEffect(EffectTrigger.AFTER_ATTACKED, Target, false)
                        );
                }
            }
            return(Animations);
        }
Esempio n. 10
0
        public void PlayCardAt(PlayerId playerId, CardHand card, Vector3Int position)
        {
            if (!Game.IsGameStarted)
            {
                return;
            }
            if (!Game.IsTurnInProgress)
            {
                return;
            }
            if (!Game.TurnLogic.IsMyTurn(playerId))
            {
                return;
            }

            var hand = GetPlayerHand(playerId);

            if (!hand.Has(card))
            {
                return;
            }
            var cost          = card.Cost;
            var inventory     = GetInventory(playerId);
            var hasEnoughGold = inventory.GetAmount(Inventory.GoldItem) >= cost;

            if (!hasEnoughGold)
            {
                return;
            }
            var actionPoints          = Parameters.Amounts.ActionPointsConsume;
            var hasEnoughActionPoints = inventory.GetAmount(Inventory.ActionPointItem) >= actionPoints;

            if (!hasEnoughActionPoints)
            {
                return;
            }

            var isPositionBusy = Game.Board.GetPosition(position).HasData;

            if (isPositionBusy)
            {
                return;
            }

            inventory.RemoveItem(Inventory.ActionPointItem, actionPoints);
            inventory.RemoveItem(Inventory.GoldItem, cost);
            hand.Remove(card);
            var creature = new CreatureElement(card.Data, playerId);

            Game.Board.AddDataAt(creature, position);
            OnCreateCreature(playerId, creature, position, card);
        }
Esempio n. 11
0
 public BattleEffect(BattleEffect Target, Player User)
 {
     Name            = Target.Name;
     Priority        = Target.Priority;
     Lifespan        = Target.Lifespan;
     CurrentLifespan = Target.Lifespan;
     Placement       = Target.Placement;
     Element         = Target.Element;
     BasePhysical    = Target.BasePhysical;
     BaseMystical    = Target.BaseMystical;
     Scripts         = new List <EffectScript>(Target.Scripts);
     this.User       = User;
 }
Esempio n. 12
0
 public InterpreterFrame(EffectHardExecute e, BattleEffect Effect, Player User, Player Opponent, Player Trigger, byte TriggerPosition)
 {
     this.e               = e;
     Animations           = new List <SceneAnimation>();
     this.User            = User;
     this.Opponent        = Opponent;
     this.Trigger         = Trigger;
     this.TriggerPosition = TriggerPosition;
     CurrentEffect        = Effect;
     Element              = Effect.Element;
     BasePhysical         = Effect.BasePhysical;
     BaseMystical         = Effect.BaseMystical;
 }
Esempio n. 13
0
        /// //////////////////


        public double GetElementEffectiveness(CreatureElement Element)
        {
            double ElementBonus = 1.0;

            for (int i = 0; i < 16; i++)
            {
                if (HasElement((CreatureElement)(i + 1)))
                {
                    ElementBonus *= (double)ElementEffectiveness[((int)Element) - 1][i] / 2;
                }
            }
            return(ElementBonus);
        }
Esempio n. 14
0
        public List <SceneAnimation> GiveDamage(CreatureElement Element, ActionCategory Category, byte BaseActionPower, int AttackerStrength, int AttackerIntelligence, int AttackedEndurance, int AttackedWisdom, double ElementProficiency, double ElementEffectiveness)
        {
            //TODO: REMOVE THIS
            List <SceneAnimation> Animations = new List <SceneAnimation>();

            int    Damage  = 0;
            double Bonuses = ElementEffectiveness * ElementProficiency * GetElementBuffs(Element);

            if (Bonuses > 0 && !(Element == CreatureElement.EARTH && NotEffectedByEarth.Evaluate()))
            {
                if (Category == ActionCategory.PHYSICAL)
                {
                    Damage = (int)Math.Floor((AttackerStrength * BaseActionPower * Bonuses / AttackedEndurance) * 2.1);
                }
                else if (Category == ActionCategory.MYSTICAL)
                {
                    Damage = (int)Math.Floor((AttackerIntelligence * BaseActionPower * Bonuses / AttackedWisdom) * 2.1);
                }

                int nh = ActiveCreature.Health - Damage;
                if (nh < 0)
                {
                    nh = 0;
                }

                Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.HEALTH_BAR, new double[] {
                    playerNumber,
                    ActiveCreature.GetTotalStat(CreatureStats.HEALTH),
                    nh,
                    -1 * Damage,
                    ElementEffectiveness,
                    ElementProficiency
                }, "#DAMAGE GIVEN#"));


                ActiveCreature.Health -= Damage;

                if (ActiveCreature.Health <= 0)
                {
                    ActiveCreature.Health = 0;
                    ActiveCreature.killed = true;
                }
            }
            else
            {
                Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.ADD_MESSAGE, null, ActiveCreature.Nickname + " was unaffected by the damage!"));
            }
            return(Animations);
        }
Esempio n. 15
0
        public List <SceneAnimation> GiveDamage(CreatureElement Element, ActionCategory Category, byte BaseActionPower, Player Attacker)
        {
            List <SceneAnimation> Animations = new List <SceneAnimation>();

            int    Damage  = 0;
            double Bonuses = GetElementEffectiveness(Element) * (Attacker.HasElement(Element) ? 1.5 : 1) * Attacker.GetElementBuffs(Element);

            if (Bonuses > 0 && !(Element == CreatureElement.EARTH && NotEffectedByEarth.Evaluate()))
            {
                if (Category == ActionCategory.PHYSICAL)
                {
                    Damage = (int)Math.Floor(((Attacker.GetTotalStat(CreatureStats.STRENGTH) * (double)BaseActionPower * Bonuses) / (GetElementBuffs(Element) * GetTotalStat(CreatureStats.ENDURANCE))) * 2.1);
                }
                else if (Category == ActionCategory.MYSTICAL)
                {
                    Damage = (int)Math.Floor(((Attacker.GetTotalStat(CreatureStats.INTELLIGENCE) * (double)BaseActionPower * Bonuses) / (GetElementBuffs(Element) * GetTotalStat(CreatureStats.WISDOM))) * 2.1);
                }

                int nh = ActiveCreature.Health - Damage;
                if (nh < 0)
                {
                    nh = 0;
                }

                Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.HEALTH_BAR, new double[] {
                    playerNumber,
                    ActiveCreature.GetTotalStat(CreatureStats.HEALTH),
                    nh,
                    -1 * Damage,
                    GetElementEffectiveness(Element),
                    Attacker.HasElement(Element) ? 1.5 : 1
                }, "#DAMAGE GIVEN#"));


                ActiveCreature.Health -= Damage;

                if (ActiveCreature.Health <= 0)
                {
                    ActiveCreature.Health = 0;
                    ActiveCreature.killed = true;
                }
            }
            else
            {
                Animations.Add(new SceneAnimation(SceneAnimation.SceneAnimationType.ADD_MESSAGE, null, ActiveCreature.Nickname + " was unaffected by the damage!"));
            }
            return(Animations);
        }
Esempio n. 16
0
        public List <SceneAnimation> RemoveEffectsOfElement(CreatureElement Element)
        {
            List <SceneAnimation> Animations = new List <SceneAnimation>();

            for (int i = 0; i < 8; i++)
            {
                foreach (BattleEffect Effect in AllEffects[i].effects)
                {
                    if (Effect != null && Effect.Element == Element)
                    {
                        Animations.AddRange(RemoveEffect(Effect, false));
                    }
                }
            }
            return(Animations);
        }
Esempio n. 17
0
        public List <SceneAnimation> RemoveAllEffectsExceptElement(CreatureElement Element)
        {
            List <SceneAnimation> Animations = new List <SceneAnimation>();

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (AllEffects[i].effects[j] != null && AllEffects[i].effects[j].Element != Element)
                    {
                        Animations.AddRange(RemoveEffect(AllEffects[i].effects[j], false));
                    }
                }
            }
            return(Animations);
        }
Esempio n. 18
0
        public BattleEffect ActionEffect; //+ effect priority
        //dictionary effect trigger+speed to effect script
        public CreatureAction(string Name, CreatureElement Element, ActionCategory Catagory, byte Speed, short Priority, byte Power, byte Usage, byte Mana, BattleEffect ActionEffect)
        {
            this.Name         = Name;
            this.Element      = Element;
            this.Catagory     = Catagory;
            this.Speed        = Speed;
            this.Priority     = (byte)(4 + Priority);
            this.Power        = Power;
            this.Usage        = Usage;
            this.Mana         = Mana;
            this.ActionEffect = ActionEffect;
            if (ActionEffect != null)
            {
                ActionEffect.Name = Name;
                ActionEffect.SetElement(Element);
            }

            Style = "attacked";
        }
Esempio n. 19
0
 public SceneAnimation SetNewElement(CreatureElement Element)
 {
     newElement = Element;
     return(new SceneAnimation(SceneAnimation.SceneAnimationType.ELEMENT_CHANGE, new double[] { playerNumber, (double)Element, 0, 0 }, "#SET NEW ELEMENT#"));
 }
Esempio n. 20
0
 public void SetElement(CreatureElement creatureElement)
 {
     SetData(creatureElement.Data);
     UpdateData();
 }
Esempio n. 21
0
 private CreatureTable()
 {
     m_mapElements    = new Dictionary <int, CreatureElement>();
     m_emptyItem      = new CreatureElement();
     m_vecAllElements = new List <CreatureElement>();
 }
Esempio n. 22
0
    public bool LoadCsv(string strContent)
    {
        if (strContent.Length == 0)
        {
            return(false);
        }
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int           contentOffset = 0;
        List <string> vecLine;

        vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
        if (vecLine.Count != 32)
        {
            Ex.Logger.Log("Creature.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "entry_id")
        {
            Ex.Logger.Log("Creature.csv中字段[entry_id]位置不对应"); return(false);
        }
        if (vecLine[1] != "combat_coe_id")
        {
            Ex.Logger.Log("Creature.csv中字段[combat_coe_id]位置不对应"); return(false);
        }
        if (vecLine[2] != "gd_comment")
        {
            Ex.Logger.Log("Creature.csv中字段[gd_comment]位置不对应"); return(false);
        }
        if (vecLine[3] != "name_id")
        {
            Ex.Logger.Log("Creature.csv中字段[name_id]位置不对应"); return(false);
        }
        if (vecLine[4] != "sub_name_id")
        {
            Ex.Logger.Log("Creature.csv中字段[sub_name_id]位置不对应"); return(false);
        }
        if (vecLine[5] != "model_id")
        {
            Ex.Logger.Log("Creature.csv中字段[model_id]位置不对应"); return(false);
        }
        if (vecLine[6] != "mapping_path")
        {
            Ex.Logger.Log("Creature.csv中字段[mapping_path]位置不对应"); return(false);
        }
        if (vecLine[7] != "scale")
        {
            Ex.Logger.Log("Creature.csv中字段[scale]位置不对应"); return(false);
        }
        if (vecLine[8] != "opacity")
        {
            Ex.Logger.Log("Creature.csv中字段[opacity]位置不对应"); return(false);
        }
        if (vecLine[9] != "icon")
        {
            Ex.Logger.Log("Creature.csv中字段[icon]位置不对应"); return(false);
        }
        if (vecLine[10] != "health_bar_display")
        {
            Ex.Logger.Log("Creature.csv中字段[health_bar_display]位置不对应"); return(false);
        }
        if (vecLine[11] != "name_bar_display")
        {
            Ex.Logger.Log("Creature.csv中字段[name_bar_display]位置不对应"); return(false);
        }
        if (vecLine[12] != "creature_level")
        {
            Ex.Logger.Log("Creature.csv中字段[creature_level]位置不对应"); return(false);
        }
        if (vecLine[13] != "creature_type")
        {
            Ex.Logger.Log("Creature.csv中字段[creature_type]位置不对应"); return(false);
        }
        if (vecLine[14] != "faction")
        {
            Ex.Logger.Log("Creature.csv中字段[faction]位置不对应"); return(false);
        }
        if (vecLine[15] != "race")
        {
            Ex.Logger.Log("Creature.csv中字段[race]位置不对应"); return(false);
        }
        if (vecLine[16] != "boundary_length")
        {
            Ex.Logger.Log("Creature.csv中字段[boundary_length]位置不对应"); return(false);
        }
        if (vecLine[17] != "boundary_width")
        {
            Ex.Logger.Log("Creature.csv中字段[boundary_width]位置不对应"); return(false);
        }
        if (vecLine[18] != "boundary_height")
        {
            Ex.Logger.Log("Creature.csv中字段[boundary_height]位置不对应"); return(false);
        }
        if (vecLine[19] != "walk_speed")
        {
            Ex.Logger.Log("Creature.csv中字段[walk_speed]位置不对应"); return(false);
        }
        if (vecLine[20] != "run_speed")
        {
            Ex.Logger.Log("Creature.csv中字段[run_speed]位置不对应"); return(false);
        }
        if (vecLine[21] != "script_location")
        {
            Ex.Logger.Log("Creature.csv中字段[script_location]位置不对应"); return(false);
        }
        if (vecLine[22] != "can_be_targeted")
        {
            Ex.Logger.Log("Creature.csv中字段[can_be_targeted]位置不对应"); return(false);
        }
        if (vecLine[23] != "can_attack")
        {
            Ex.Logger.Log("Creature.csv中字段[can_attack]位置不对应"); return(false);
        }
        if (vecLine[24] != "pool_skill_num")
        {
            Ex.Logger.Log("Creature.csv中字段[pool_skill_num]位置不对应"); return(false);
        }
        if (vecLine[25] != "selected_sound")
        {
            Ex.Logger.Log("Creature.csv中字段[selected_sound]位置不对应"); return(false);
        }
        if (vecLine[26] != "death_sound")
        {
            Ex.Logger.Log("Creature.csv中字段[death_sound]位置不对应"); return(false);
        }
        if (vecLine[27] != "skill_1")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_1]位置不对应"); return(false);
        }
        if (vecLine[28] != "skill_2")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_2]位置不对应"); return(false);
        }
        if (vecLine[29] != "skill_3")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_3]位置不对应"); return(false);
        }
        if (vecLine[30] != "skill_4")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_4]位置不对应"); return(false);
        }
        if (vecLine[31] != "skill_5")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_5]位置不对应"); return(false);
        }

        while (true)
        {
            vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
            if ((int)vecLine.Count == 0)
            {
                break;
            }
            if ((int)vecLine.Count != (int)32)
            {
                return(false);
            }
            CreatureElement member = new CreatureElement();
            member.entry_id           = Convert.ToInt32(vecLine[0]);
            member.combat_coe_id      = Convert.ToInt32(vecLine[1]);
            member.gd_comment         = vecLine[2];
            member.name_id            = Convert.ToInt32(vecLine[3]);
            member.sub_name_id        = Convert.ToInt32(vecLine[4]);
            member.model_id           = Convert.ToInt32(vecLine[5]);
            member.mapping_path       = vecLine[6];
            member.scale              = Convert.ToSingle(vecLine[7]);
            member.opacity            = Convert.ToSingle(vecLine[8]);
            member.icon               = vecLine[9];
            member.health_bar_display = Convert.ToInt32(vecLine[10]);
            member.name_bar_display   = Convert.ToInt32(vecLine[11]);
            member.creature_level     = Convert.ToInt32(vecLine[12]);
            member.creature_type      = Convert.ToInt32(vecLine[13]);
            member.faction            = Convert.ToInt32(vecLine[14]);
            member.race               = Convert.ToInt32(vecLine[15]);
            member.boundary_length    = Convert.ToSingle(vecLine[16]);
            member.boundary_width     = Convert.ToSingle(vecLine[17]);
            member.boundary_height    = Convert.ToSingle(vecLine[18]);
            member.walk_speed         = Convert.ToSingle(vecLine[19]);
            member.run_speed          = Convert.ToSingle(vecLine[20]);
            member.script_location    = vecLine[21];
            member.can_be_targeted    = Convert.ToInt32(vecLine[22]);
            member.can_attack         = Convert.ToInt32(vecLine[23]);
            member.pool_skill_num     = Convert.ToInt32(vecLine[24]);
            member.selected_sound     = vecLine[25];
            member.death_sound        = vecLine[26];
            member.skill_1            = Convert.ToInt32(vecLine[27]);
            member.skill_2            = Convert.ToInt32(vecLine[28]);
            member.skill_3            = Convert.ToInt32(vecLine[29]);
            member.skill_4            = Convert.ToInt32(vecLine[30]);
            member.skill_5            = Convert.ToInt32(vecLine[31]);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.entry_id] = member;
        }
        return(true);
    }
Esempio n. 23
0
 public bool HasElement(CreatureElement Element)
 {
     return(CreatureType.Elements[0] == Element || CreatureType.Elements[1] == Element || CreatureType.Elements[2] == Element);
 }
Esempio n. 24
0
 public void SetElement(CreatureElement Element)
 {
     this.Element = Element;
 }
Esempio n. 25
0
 public override void SetPrevElement(CreatureElement Element)
 {
     PrevElement = Element;
 }
Esempio n. 26
0
 void OnCreateCreature(PlayerId playerId, CreatureElement creatureElement, Vector3Int position, CardHand card) =>
 Dispatcher.Notify <ICreateBoardElement>(i =>
                                         i.OnCreateBoardElement(playerId, creatureElement, position, card));
Esempio n. 27
0
 public override void SetElement(CreatureElement Element)
 {
     this.Element = Element;
 }
Esempio n. 28
0
 public abstract void SetPrevElement(CreatureElement Element);
Esempio n. 29
0
    public bool LoadBin(byte[] binContent)
    {
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int nCol, nRow;
        int readPos = 0;

        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol);
        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow);
        List <string> vecLine     = new List <string>(nCol);
        List <int>    vecHeadType = new List <int>(nCol);
        string        tmpStr;
        int           tmpInt;

        for (int i = 0; i < nCol; i++)
        {
            readPos += GameAssist.ReadString(binContent, readPos, out tmpStr);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt);
            vecLine.Add(tmpStr);
            vecHeadType.Add(tmpInt);
        }
        if (vecLine.Count != 32)
        {
            Ex.Logger.Log("Creature.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "entry_id")
        {
            Ex.Logger.Log("Creature.csv中字段[entry_id]位置不对应"); return(false);
        }
        if (vecLine[1] != "combat_coe_id")
        {
            Ex.Logger.Log("Creature.csv中字段[combat_coe_id]位置不对应"); return(false);
        }
        if (vecLine[2] != "gd_comment")
        {
            Ex.Logger.Log("Creature.csv中字段[gd_comment]位置不对应"); return(false);
        }
        if (vecLine[3] != "name_id")
        {
            Ex.Logger.Log("Creature.csv中字段[name_id]位置不对应"); return(false);
        }
        if (vecLine[4] != "sub_name_id")
        {
            Ex.Logger.Log("Creature.csv中字段[sub_name_id]位置不对应"); return(false);
        }
        if (vecLine[5] != "model_id")
        {
            Ex.Logger.Log("Creature.csv中字段[model_id]位置不对应"); return(false);
        }
        if (vecLine[6] != "mapping_path")
        {
            Ex.Logger.Log("Creature.csv中字段[mapping_path]位置不对应"); return(false);
        }
        if (vecLine[7] != "scale")
        {
            Ex.Logger.Log("Creature.csv中字段[scale]位置不对应"); return(false);
        }
        if (vecLine[8] != "opacity")
        {
            Ex.Logger.Log("Creature.csv中字段[opacity]位置不对应"); return(false);
        }
        if (vecLine[9] != "icon")
        {
            Ex.Logger.Log("Creature.csv中字段[icon]位置不对应"); return(false);
        }
        if (vecLine[10] != "health_bar_display")
        {
            Ex.Logger.Log("Creature.csv中字段[health_bar_display]位置不对应"); return(false);
        }
        if (vecLine[11] != "name_bar_display")
        {
            Ex.Logger.Log("Creature.csv中字段[name_bar_display]位置不对应"); return(false);
        }
        if (vecLine[12] != "creature_level")
        {
            Ex.Logger.Log("Creature.csv中字段[creature_level]位置不对应"); return(false);
        }
        if (vecLine[13] != "creature_type")
        {
            Ex.Logger.Log("Creature.csv中字段[creature_type]位置不对应"); return(false);
        }
        if (vecLine[14] != "faction")
        {
            Ex.Logger.Log("Creature.csv中字段[faction]位置不对应"); return(false);
        }
        if (vecLine[15] != "race")
        {
            Ex.Logger.Log("Creature.csv中字段[race]位置不对应"); return(false);
        }
        if (vecLine[16] != "boundary_length")
        {
            Ex.Logger.Log("Creature.csv中字段[boundary_length]位置不对应"); return(false);
        }
        if (vecLine[17] != "boundary_width")
        {
            Ex.Logger.Log("Creature.csv中字段[boundary_width]位置不对应"); return(false);
        }
        if (vecLine[18] != "boundary_height")
        {
            Ex.Logger.Log("Creature.csv中字段[boundary_height]位置不对应"); return(false);
        }
        if (vecLine[19] != "walk_speed")
        {
            Ex.Logger.Log("Creature.csv中字段[walk_speed]位置不对应"); return(false);
        }
        if (vecLine[20] != "run_speed")
        {
            Ex.Logger.Log("Creature.csv中字段[run_speed]位置不对应"); return(false);
        }
        if (vecLine[21] != "script_location")
        {
            Ex.Logger.Log("Creature.csv中字段[script_location]位置不对应"); return(false);
        }
        if (vecLine[22] != "can_be_targeted")
        {
            Ex.Logger.Log("Creature.csv中字段[can_be_targeted]位置不对应"); return(false);
        }
        if (vecLine[23] != "can_attack")
        {
            Ex.Logger.Log("Creature.csv中字段[can_attack]位置不对应"); return(false);
        }
        if (vecLine[24] != "pool_skill_num")
        {
            Ex.Logger.Log("Creature.csv中字段[pool_skill_num]位置不对应"); return(false);
        }
        if (vecLine[25] != "selected_sound")
        {
            Ex.Logger.Log("Creature.csv中字段[selected_sound]位置不对应"); return(false);
        }
        if (vecLine[26] != "death_sound")
        {
            Ex.Logger.Log("Creature.csv中字段[death_sound]位置不对应"); return(false);
        }
        if (vecLine[27] != "skill_1")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_1]位置不对应"); return(false);
        }
        if (vecLine[28] != "skill_2")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_2]位置不对应"); return(false);
        }
        if (vecLine[29] != "skill_3")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_3]位置不对应"); return(false);
        }
        if (vecLine[30] != "skill_4")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_4]位置不对应"); return(false);
        }
        if (vecLine[31] != "skill_5")
        {
            Ex.Logger.Log("Creature.csv中字段[skill_5]位置不对应"); return(false);
        }

        for (int i = 0; i < nRow; i++)
        {
            CreatureElement member = new CreatureElement();
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.entry_id);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.combat_coe_id);
            readPos += GameAssist.ReadString(binContent, readPos, out member.gd_comment);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.name_id);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.sub_name_id);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.model_id);
            readPos += GameAssist.ReadString(binContent, readPos, out member.mapping_path);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.scale);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.opacity);
            readPos += GameAssist.ReadString(binContent, readPos, out member.icon);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.health_bar_display);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.name_bar_display);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.creature_level);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.creature_type);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.faction);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.boundary_length);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.boundary_width);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.boundary_height);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.walk_speed);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.run_speed);
            readPos += GameAssist.ReadString(binContent, readPos, out member.script_location);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.can_be_targeted);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.can_attack);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.pool_skill_num);
            readPos += GameAssist.ReadString(binContent, readPos, out member.selected_sound);
            readPos += GameAssist.ReadString(binContent, readPos, out member.death_sound);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.skill_1);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.skill_2);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.skill_3);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.skill_4);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.skill_5);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.entry_id] = member;
        }
        return(true);
    }
Esempio n. 30
0
 private void OnCreateCreature(SeatType seatType, CreatureElement creatureElement, Vector3Int position,
                               CardHand card)
 {
     Dispatcher.Notify <ICreateBoardElement>(i =>
                                             i.OnCreateBoardElement(seatType, creatureElement, position, card));
 }