public override string GetInspectString()
        {
            var stringBuilder = new StringBuilder();

            if (LifeStage == PlantLifeStage.Growing)
            {
                stringBuilder.AppendLine("PercentGrowth".Translate(new object[]
                {
                    GrowthPercentString
                }));
                stringBuilder.AppendLine("GrowthRate".Translate() + ": " + GrowthRate.ToStringPercent());
                if (Resting)
                {
                    stringBuilder.AppendLine("PlantResting".Translate());
                }
                if (!HasEnoughLightToGrow)
                {
                    stringBuilder.AppendLine("PlantNeedsLightLevel".Translate() + ": " + growMinGlow.ToStringPercent());
                }
            }
            else if (LifeStage == PlantLifeStage.Mature)
            {
                stringBuilder.AppendLine("Mature".Translate());
            }
            return(stringBuilder.ToString().TrimEndNewlines());
        }
Beispiel #2
0
    /// <summary>
    /// Returns the dice that represents the given growth rate
    /// The dice is created each time so that the random seed is changed each time
    /// </summary>
    /// <param name="rate"></param>
    /// <returns></returns>
    static public Dice GetDiceForRate(GrowthRate rate)
    {
        // Defaults to always return 1
        string notation = "1d1";

        switch (rate)
        {
        case GrowthRate.SLOW:
            notation = "1d3";
            break;

        case GrowthRate.MEDIUM:
            notation = "2d3";
            break;

        case GrowthRate.FAST:
            notation = "3d2";
            break;

        case GrowthRate.FASTEST:
            notation = "4d3";
            break;
        }

        Dice dice = new Dice(notation);

        return(dice);
    }
Beispiel #3
0
    public static int GetLevelXP(GrowthRate growthRate, int currentLevel)
    {
        int exp = 0;

        if (currentLevel > 100)
        {
            currentLevel = 100;
        }
        if (growthRate == GrowthRate.ERRATIC)
        {
            exp = ExpTableErratic[currentLevel - 1]; //Because the array starts at 0, not 1.
        }
        else if (growthRate == GrowthRate.FAST)
        {
            exp = ExpTableFast[currentLevel - 1];
        }
        else if (growthRate == GrowthRate.MEDIUM)
        {
            exp = XPTableMedium[currentLevel - 1];
        }
        else if (growthRate == GrowthRate.PARABOLIC)
        {
            exp = XPTableParabolic[currentLevel - 1];
        }
        else if (growthRate == GrowthRate.SLOW)
        {
            exp = ExpTableSlow[currentLevel - 1];
        }
        else if (growthRate == GrowthRate.FLUCTUATING)
        {
            exp = ExpTableFluctuating[currentLevel - 1];
        }

        return(exp);
    }
Beispiel #4
0
 public GscSpecies(Gsc game, ReadStream data, ReadStream name)   // Names are padded to 10 length using terminator characters.
 {
     Game               = game;
     Name               = game.Charmap.Decode(name.Read(10));
     Id                 = data.u8();
     BaseHP             = data.u8();
     BaseAttack         = data.u8();
     BaseDefense        = data.u8();
     BaseSpeed          = data.u8();
     BaseSpecialAttack  = data.u8();
     BaseSpecialDefense = data.u8();
     Type1              = (GscType)data.u8();
     Type2              = (GscType)data.u8();
     CatchRate          = data.u8();
     BaseExp            = data.u8();
     Item1              = data.u8();
     Item2              = data.u8();
     GenderRatio        = data.u8();
     Unknown1           = data.u8();
     HatchCycles        = data.u8();
     Unknown2           = data.u8();
     FrontSpriteWidth   = data.Nybble();
     FrontSpriteHeight  = data.Nybble();
     data.Seek(4); // 4 unused bytes
     GrowthRate = (GrowthRate)data.u8();
     EggGroup1  = (GscEggGroup)data.Nybble();
     EggGroup2  = (GscEggGroup)data.Nybble();
     data.Seek(8); // TODO: HMs/TMs
 }
Beispiel #5
0
 public Growth(float baseValue, float coefficient, long rounding)
 {
     this.value       = baseValue;
     this.coefficient = coefficient;
     this.rounding    = rounding;
     growthRate       = GrowthRate.Exponential;
 }
Beispiel #6
0
 public Growth(float baseValue, float coefficient, long rounding, GrowthRate growthRate)
 {
     this.value       = baseValue;
     this.coefficient = coefficient;
     this.rounding    = rounding;
     this.growthRate  = growthRate;
 }
Beispiel #7
0
        public override string GetInspectString()
        {
            var sb = new StringBuilder();

            if (LifeStage == PlantLifeStage.Growing)
            {
                sb.AppendLine("PercentGrowth".Translate(GrowthPercentString));
                sb.AppendLine("GrowthRate".Translate() + ": " + GrowthRate.ToStringPercent());

                if (!Blighted)
                {
                    if (Resting)
                    {
                        sb.AppendLine("PlantResting".Translate());
                    }

                    if (!HasEnoughLightToGrow)
                    {
                        sb.AppendLine("PlantNeedsLightLevel".Translate() + ": " + def.plant.growMinGlow.ToStringPercent());
                    }

                    float tempFactor = GrowthRateFactor_Temperature;
                    if (tempFactor < 0.99f)
                    {
                        if (tempFactor < 0.01f)
                        {
                            sb.AppendLine("OutOfIdealTemperatureRangeNotGrowing".Translate());
                        }
                        else
                        {
                            sb.AppendLine("OutOfIdealTemperatureRange".Translate(Mathf.RoundToInt(tempFactor * 100f).ToString()));
                        }
                    }
                }
            }
            else if (LifeStage == PlantLifeStage.Mature)
            {
                if (HarvestableNow)
                {
                    sb.AppendLine("ReadyToHarvest".Translate());
                }
                else
                {
                    sb.AppendLine("Mature".Translate());
                }
            }

            if (DyingBecauseExposedToLight)
            {
                sb.AppendLine("DyingBecauseExposedToLight".Translate());
            }

            if (Blighted)
            {
                sb.AppendLine("Blighted".Translate() + " (" + Blight.Severity.ToStringPercent() + ")");
            }

            return(sb.ToString().TrimEndNewlines());
        }
Beispiel #8
0
        /* ToLevel() returns the amount of XP needed to reach a certain level from zero experience, based on a GrowthRate. */
        public static int ToLevel(GrowthRate growthRate, byte bLevel)
        {
            /* The byte passed in is converted to an integer for accuracy purposes. */
            int level = bLevel;

            /* The function applies different formulae to the desired level, depending on the GrowthRate and sometimes the level itself.
             * The formulae are mostly cubic in nature, and zero is returned if there is no valid GrowthRate. */
            switch (growthRate)
            {
            case GrowthRate.erratic:
                if (level <= 50)
                {
                    return((int)(((Math.Pow(level, 3)) * (100 - level)) / 50));
                }
                else if (level > 50 && level <= 68)
                {
                    return((int)(((Math.Pow(level, 3)) * (150 - level)) / 100));
                }
                else if (level > 68 && level <= 98)
                {
                    return((int)((Math.Pow(level, 3)) * ((1911 - (10 * level)) / 3)));
                }
                else
                {
                    return((int)(((Math.Pow(level, 3)) * (160 - level)) / 100));
                }

            case GrowthRate.fast:
                return((int)((4 * (Math.Pow(level, 3))) / 5));

            case GrowthRate.mediumfast:
                return((int)(Math.Pow(level, 3)));

            case GrowthRate.mediumslow:
                return((int)(((6 * (Math.Pow(level, 3))) / 5) - (15 * (Math.Pow(level, 2))) + (100 * level) - 140));

            case GrowthRate.slow:
                return((int)((5 * (Math.Pow(level, 3))) / 4));

            case GrowthRate.fluctuating:
                if (level <= 15)
                {
                    return((int)((Math.Pow(level, 3)) * ((((level + 1) / 3) + 24) / 50)));
                }
                else if (level > 15 && level <= 36)
                {
                    return((int)((Math.Pow(level, 3)) * ((level + 14) / 50)));
                }
                else
                {
                    return((int)((Math.Pow(level, 3)) * (((level / 2) + 32) / 50)));
                }

            default:
                return(0);
            }
        }
Beispiel #9
0
        public async Task GetGrowthRateResourceAsyncIntegrationTest()
        {
            // assemble
            PokeApiClient client = new PokeApiClient();

            // act
            GrowthRate growthRate = await client.GetResourceAsync <GrowthRate>(1);

            // assert
            Assert.True(growthRate.Id != default(int));
        }
 public PokemonInfo(int baseHP, int baseATK, int baseDEF, int baseSPCATK, int baseSPCDEF, int baseSPD, string name, int iD, string growthRate)
 {
     BaseHP     = baseHP;
     BaseATK    = baseATK;
     BaseDEF    = baseDEF;
     BaseSPCATK = baseSPCATK;
     BaseSPCDEF = baseSPCDEF;
     BaseSPD    = baseSPD;
     Name       = name;
     ID         = iD;
     GrowthRate = (GrowthRate)Enum.Parse(typeof(GrowthRate), growthRate);
 }
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (LifeStage == PlantLifeStage.Growing)
            {
                stringBuilder.AppendLine("PercentGrowth".Translate(new object[]
                {
                    GrowthPercentString
                }));
                stringBuilder.AppendLine("GrowthRate".Translate() + ": " + GrowthRate.ToStringPercent());
                if (Resting)
                {
                    stringBuilder.AppendLine("PlantResting".Translate());
                }
                if (!HasEnoughLightToGrow)
                {
                    stringBuilder.AppendLine("PlantNeedsLightLevel".Translate() + ": " + this.def.plant.growMinGlow.ToStringPercent());
                }
                float growthRateFactor_Temperature = HardyGrowthRateFactor_Temperature;
                if (growthRateFactor_Temperature < 0.99f)
                {
                    if (growthRateFactor_Temperature < 0.01f)
                    {
                        stringBuilder.AppendLine("OutOfIdealTemperatureRangeNotGrowing".Translate());
                    }
                    else
                    {
                        stringBuilder.AppendLine("OutOfIdealTemperatureRange".Translate(new object[]
                        {
                            Mathf.RoundToInt(growthRateFactor_Temperature * 100f).ToString()
                        }));
                    }
                }
            }
            else if (LifeStage == PlantLifeStage.Mature)
            {
                if (def.plant.Harvestable)
                {
                    stringBuilder.AppendLine("ReadyToHarvest".Translate());
                }
                else
                {
                    stringBuilder.AppendLine("Mature".Translate());
                }
            }
            return(stringBuilder.ToString().TrimEndNewlines());
        }
Beispiel #12
0
        public BaseStats(ushort i, string n, byte h, byte atk, byte def, byte satk, byte sdef, byte spd, Types t, byte ctch, byte exp, ushort ev, GenderRatio gender, GrowthRate growth, EggGroups eg, Ability[] ab, LearnableMove[] ls, PokedexEntry pe, IEvolution[] evo = null)
        {
            id   = i;
            name = n;

            baseHP             = h;
            baseAttack         = atk;
            baseDefense        = def;
            baseSpeed          = sdef;
            baseSpecialAttack  = satk;
            baseSpecialDefense = spd;
            types       = t;
            catchRate   = ctch;
            expYield    = exp;
            evYield     = ev;
            genderRatio = gender;

            /* 0	Arceus, Buneary, Darkrai, Deoxys, Deoxys (Attack), Deoxys (Defense), Deoxys (Speed), Dialga, Genosekuto, Giratina (Altered), Giratina (Origin), Groudon, Ho-oh, Kyogre, Kyuremu, Lugia, Mewtwo, Palkia, Rayquaza, Regigigas, Reshiram, Zekrom
             * 35	Absol, Aggron, Aron, Articuno, Axew, Bagon, Banette, Baruchai, Barujiina, Beldum, Birijion, Cacnea, Cacturne, Carvanha, Chatot, Dragonair, Dragonite, Dratini, Dusclops, Dusknoir, Duskull, Entei, Fraxure, Gallade, Gardevoir, Glaceon, Haxorus, Honchkrow, Houndoom, Houndour, Jiheddo, Kerudio, Kirikizan, Kirlia, Kobaruon, Komatana, Lairon, Larvitar, Leafeon, Metagross, Metang, Misdreavus, Mismagius, Moltres, Monozu, Murkrow, Pupitar, Raikou, Ralts, Regice, Regirock, Registeel, Sableye, Salamence, Sazandora, Sharpedo, Shelgon, Shuppet, Sneasel, Suicune, Terakion, Tyranitar, Umbreon, Weavile, Zapdos, Zuruggu
             * 70	All other Pokemon
             * 90	Borutorosu, Latias, Latios, Randorosu, Torunerosu
             * 100	Ambipom, Celebi, Cresselia, Croagunk, Heatran, Jirachi, Luxio, Meroetta, Meroetta, Mew, Pachirisu, Shaymin, Shaymin (Sky), Victini
             * 140	Azelf, Blissey, Chansey, Clefable, Clefairy, Cleffa, Happiny, Lopunny, Mesprit, Uxie
             */
            if (i == 150)
            {
                baseHappiness = 0;
            }
            else if (i >= 144 && i <= 149)
            {
                baseHappiness = 35;
            }
            else if (i == 151)
            {
                baseHappiness = 100;
            }
            else
            {
                baseHappiness = 70;
            }
            growthRate = growth;
            eggGroups  = eg;
            abilities  = ab;
            learnset   = ls;
            entry      = pe;
            evolutions = evo;
        }
Beispiel #13
0
    /// <summary>
    /// StageDatabaseで呼んで、ステージごとのユニット設定を行う
    /// </summary>
    /// <param name="Lv"></param>
    /// <param name="coordinate">ステージで初期配置されている座標</param>
    /// <param name="weapon">装備武器</param>
    /// <param name="carryItem">持ち物</param>
    /// <param name="enemyAIPattern">行動パターン</param>
    public void StageInit(int lv, Coordinate coordinate, List <Item> carryItem,
                          EnemyAIPattern enemyAIPattern)
    {
        this.lv             = lv;
        this.coordinate     = coordinate;
        this.carryItem      = carryItem;
        this.enemyAIPattern = enemyAIPattern;

        //装備フラグがtrueの武器、アクセサリを装備
        foreach (Item item in carryItem)
        {
            if (item.ItemType == ItemType.WEAPON && item.isEquip == true)
            {
                this.equipWeapon = item.weapon;
            }
            else if (item.ItemType == ItemType.ACCESSORY && item.isEquip == true)
            {
                this.equipAccessory = item.accessory;
            }
        }

        //敵キャラはレベルを渡すとレベルアップ分のステータスを反映してくれる
        GrowthDatabase growthDatabase = Resources.Load <GrowthDatabase>("growthDatabase");

        //成長率取得
        GrowthRate growthRate = growthDatabase.FindByName(name);
        int        lvUp       = lv - 1;

        //小数点以下切り捨て 成長率は整数で入っているので10で割ってやる
        this.maxhp += Mathf.FloorToInt(lvUp * growthRate.hpRate / 100);
        this.hp     = maxhp;

        this.latk += Mathf.FloorToInt(lvUp * growthRate.latkRate / 100);

        this.catk += Mathf.FloorToInt(lvUp * growthRate.catkRate / 100);

        this.dex += Mathf.FloorToInt(lvUp * growthRate.dexRate / 100);

        this.agi += Mathf.FloorToInt(lvUp * growthRate.agiRate / 100);

        this.luk += Mathf.FloorToInt(lvUp * growthRate.lukRate / 100);

        this.ldef += Mathf.FloorToInt(lvUp * growthRate.ldefRate / 100);

        this.cdef += Mathf.FloorToInt(lvUp * growthRate.cdefRate / 100);
    }
Beispiel #14
0
    public static int CalcExpNeeded(this GrowthRate growthRate, int n)
    {
        switch (growthRate)
        {
        case GrowthRate.MediumFast: return(n * n * n);

        case GrowthRate.SlightlyFast: return(3 / 4 * n * n * n + 10 * n * n - 30);

        case GrowthRate.SlightlySlow: return(3 / 4 * n * n * n + 20 * n * n - 70);

        case GrowthRate.MediumSlow: return(6 / 5 * n * n * n + -15 * n * n + 100 * n - 140);

        case GrowthRate.Fast: return(4 / 5 * n * n * n);

        case GrowthRate.Slow: return(5 / 4 * n * n * n);

        default: return(0);
        }
    }
Beispiel #15
0
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (DebugSettings.godMode)
            {
                stringBuilder.AppendLine("Size: " + size.ToStringPercent());
                stringBuilder.AppendLine("Growth rate: " + GrowthRate.ToStringPercent());
                float propSubmerged = 1 - submersibleFactor();
                if (propSubmerged > 0)
                {
                    stringBuilder.AppendLine("Submerged: " + propSubmerged.ToStringPercent());
                }
                foreach (growthRateModifier mod in attributes.allRateModifiers)
                {
                    stringBuilder.AppendLine(mod.GetType().Name + ": " + attributes.growthRateFactor(mod, getModValue(mod)));
                }
            }
            return(stringBuilder.ToString().TrimEndNewlines());
        }
Beispiel #16
0
        /* The public constructor for a PokemonData takes a lot of parameters. */
        public PokemonData(string pokemonName, byte baseHP, byte baseAttack, byte baseDefence, byte baseSpecialAttack, byte baseSpecialDefence, byte baseSpeed, ushort id, PkmnType type, PkmnType?secondType, bool canHaveGender, string species, double weightKg, double heightM, EggGroup eggGroup, EggGroup?secondEggGroup, ushort baseExp, byte captureRate, byte baseHappiness, GrowthRate growthRate, byte eggCycles, byte maleRatio, byte femaleRatio, EvYield evYield)
        {
            /* The majority of the fields are set directly using the parameters passed in. */
            PokemonName        = pokemonName;
            BaseHP             = baseHP;
            BaseAttack         = baseAttack;
            BaseDefence        = baseDefence;
            BaseSpecialAttack  = baseSpecialAttack;
            BaseSpecialDefence = baseSpecialDefence;
            BaseSpeed          = baseSpeed;
            ID            = id;
            CanHaveGender = canHaveGender;
            Species       = species;
            WeightKg      = weightKg;
            HeightM       = heightM;
            BaseExp       = baseExp;
            CaptureRate   = captureRate;
            BaseHappiness = baseHappiness;
            GrowthRate    = growthRate;
            EggCycles     = eggCycles;
            GenderRatio   = new GenderRatio(maleRatio, femaleRatio);
            EvYield       = evYield;

            /* For the Type and EggGroups properties, which can contain one or two values each,
             * the second parameter can be passed as null.
             * If the second parameter is null, the lists will only contain one item.
             * If the second parameter has a value, the lists will contain two items. */
            Type = new List <PkmnType>();
            Type.Add(type);
            if (secondType.HasValue)
            {
                Type.Add(secondType.Value);
            }
            EggGroups = new List <EggGroup>();
            EggGroups.Add(eggGroup);
            if (secondEggGroup.HasValue)
            {
                EggGroups.Add(secondEggGroup.Value);
            }
        }
Beispiel #17
0
 public RbySpecies(Rby game, byte indexNumber, ReadStream data) : this(game, indexNumber)
 {
     Game               = game;
     PokedexNumber      = data.u8();
     BaseHP             = data.u8();
     BaseAttack         = data.u8();
     BaseDefense        = data.u8();
     BaseSpeed          = data.u8();
     BaseSpecial        = data.u8();
     Type1              = (RbyType)data.u8();
     Type2              = (RbyType)data.u8();
     CatchRate          = data.u8();
     BaseExp            = data.u8();
     FrontSpriteWidth   = data.Nybble();
     FrontSpriteHeight  = data.Nybble();
     FrontSpritePointer = data.u16le();
     BackSpritePointer  = data.u16le();
     BaseMoves          = new RbyMove[] { Game.Moves[data.u8()],
                                          Game.Moves[data.u8()],
                                          Game.Moves[data.u8()],
                                          Game.Moves[data.u8()] };
     GrowthRate = (GrowthRate)data.u8();
     data.Seek(8); // TODO: HMs/TMs
 }
Beispiel #18
0
    //レベルアップするメソッド 直接Static型のUnitController.unitListを変更
    public List <StatusType> lvup(string lvUpUnitName, int resultExp)
    {
        //上がった要素をstring型リストに詰めて返す
        var lvUpList = new List <StatusType>();

        List <Unit> unitList    = UnitController.unitList;
        List <Unit> newUnitList = new List <Unit>();

        foreach (var unit in unitList)
        {
            //リストの中でレベルアップしたユニットが居れば
            if (unit.name == lvUpUnitName)
            {
                //データベースを名前で検索して成長率を取得
                GrowthRate growthRate = growthDatabase.FindByName(lvUpUnitName);

                //職業成長率
                GrowthRateDto growthRateDto = unit.job.growthRateDto;

                //ユニット成長率と職業成長率を合算
                int hpRate   = growthRate.hpRate + growthRateDto.jobHpRate;
                int latkRate = growthRate.latkRate + growthRateDto.jobLatkRate;
                int catkRate = growthRate.catkRate + growthRateDto.jobCatkRate;
                int agiRate  = growthRate.agiRate + growthRateDto.jobAgiRate;
                int dexRate  = growthRate.dexRate + growthRateDto.jobDexRate;
                int lukRate  = growthRate.lukRate + growthRateDto.jobLukRate;
                int ldefRate = growthRate.ldefRate + growthRateDto.jobLdefRate;
                int cdefRate = growthRate.cdefRate + growthRateDto.jobCdefRate;

                //200719 同じステが2回上がるのを防止
                bool hpUpped   = false;
                bool latkUpped = false;
                bool catkUpped = false;
                bool agiUpped  = false;
                bool dexUpped  = false;
                bool lukUpped  = false;
                bool ldefUpped = false;
                bool cdefUpped = false;

                //Lv
                unit.lv++;
                unit.exp = resultExp;

                //210225 LVのピンピン処理に追加
                lvUpList.Add(StatusType.LV);

                //2ピン補正したか否か
                //2ピン補正:上がったステが2個以下ならHPからループしなおし
                bool isRetry = false;

                //レベルアップループ 2つ以上パラメータが成長した時点でbreak
                while (true)
                {
                    //各成長判定 成長率以下の乱数なら+1
                    //HP
                    //1~100の値を作成
                    float ran = Random.Range(1.0f, 100.0f);

                    if (ran <= hpRate && !hpUpped)
                    {
                        unit.maxhp += 1;
                        lvUpList.Add(StatusType.HP);

                        hpUpped = true;
                        //2ピン補正時の時は2つパラメータが成長した時点でループ終了
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //遠距離攻撃
                    if (ran <= latkRate && !latkUpped)
                    {
                        unit.latk += 1;
                        lvUpList.Add(StatusType.LATK);
                        latkUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //近距離攻撃
                    if (ran <= catkRate && !catkUpped)
                    {
                        unit.catk += 1;
                        lvUpList.Add(StatusType.CATK);
                        catkUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //速さ
                    if (ran <= agiRate && !agiUpped)
                    {
                        unit.agi += 1;
                        lvUpList.Add(StatusType.AGI);
                        agiUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //技
                    if (ran <= dexRate && !dexUpped)
                    {
                        unit.dex += 1;
                        lvUpList.Add(StatusType.DEX);
                        dexUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //運
                    if (ran <= lukRate && !lukUpped)
                    {
                        unit.luk += 1;
                        lvUpList.Add(StatusType.LUK);
                        lukUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //遠距離防御
                    if (ran <= ldefRate && !ldefUpped)
                    {
                        unit.ldef += 1;
                        lvUpList.Add(StatusType.LDEF);
                        ldefUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    ran = Random.Range(1.0f, 100.0f);

                    //近距離防御
                    if (ran <= cdefRate && !cdefUpped)
                    {
                        unit.cdef += 1;
                        lvUpList.Add(StatusType.CDEF);
                        cdefUpped = true;
                        if (lvUpList.Count > 2 && isRetry)
                        {
                            break;
                        }
                    }

                    //2つ以上パラメータが成長していたらループ終了
                    if (lvUpList.Count > 2)
                    {
                        break;
                    }

                    //下まで来たら2ピン補正に入る
                    isRetry = true;
                }
                newUnitList.Add(unit);
            }
            else
            {
                //レベルアップしたユニット以外はそのまま
                newUnitList.Add(unit);
            }
        }

        return(lvUpList);
    }
Beispiel #19
0
    public void EvaluateTraits(CreatureManager hManager, string speciesName)
    {
        List <Gene> genes = new List <Gene>();

        if (!GlobalGEPSettings.RANDOMIZED_TRAITS || traitIndices.Count == 0)
        {
            traitIndices = GlobalGEPSettings.speciesTraitLayouts[speciesName];
        }

        foreach (KeyValuePair <string, int[][]> thisTrait in traitIndices)
        {
            string key = thisTrait.Key;
            //For every chromosome a trait is linked to...
            //i = chromosome index (when a trait is on multiple chromosomes)
            for (int i = 0; i < thisTrait.Value.Length; i++)
            {
                //Index [i][0] will ALWAYS be the chromosome index
                int chromosomeIndex = thisTrait.Value[i][0];
                //For every gene this trait is linked to (on this chromosome)...
                //j = gene index for this chromosome
                for (int j = 1; j < thisTrait.Value[i].Length; j++)
                {
                    //Get the gene index
                    int geneIndex = thisTrait.Value[i][j];
                    //Add the gene at the chromosomeIndex and geneIndex to a list to be evaluated
                    //Accesses the genome rather than making a copy ensuring the genes accessed later on match exactly the current genome
                    genes.Add(genome[chromosomeIndex].genes[geneIndex]);
                }
            }

            List <Trait> thisTraitList = AccessTraits(genes);

            //For each trait (keyValuePair) evaluate the genes
            //Could put the results into a dictionary - this way would be more polymorphic as would search for (or add) a row for each trait and search by name
            //  instead of individual variables, or an array which requires the developer to remember which index is which
            switch (key.ToLower())
            {
            case "eye left colour":
                eyeColours[0] = new GeneColour(thisTraitList);
                if (eyeColours[1] == null && eyeStyle != null)
                {
                    if (eyeStyle.eyeMatching)
                    {
                        eyeColours[1] = eyeColours[0];
                        UnityEngine.Debug.Log("Eye Matching, Assigned 1 = 0");
                    }
                }
                break;

            case "eye right colour":
                eyeColours[1] = new GeneColour(thisTraitList);
                if (eyeColours[0] == null && eyeStyle != null)
                {
                    if (eyeStyle.eyeMatching)
                    {
                        eyeColours[0] = eyeColours[1];
                        UnityEngine.Debug.Log("Eye Matching, Assigned 0 = 1");
                    }
                }
                break;

            case "eye style":
                eyeStyle = new EyeStyle(thisTraitList);
                if (eyeStyle.eyeMatching)
                {
                    if (eyeColours[0] != null)
                    {
                        eyeColours[1] = eyeColours[0];
                    }
                    else if (eyeColours[1] != null)
                    {
                        eyeColours[0] = eyeColours[1];
                    }
                    else
                    {
                        UnityEngine.Debug.Log("Error: Both eye colours are currently NULL");
                    }
                }
                break;

            case "hair colour":
                hairColour = new GeneColour(thisTraitList);
                break;

            case "skin colour":
                skinColour = new GeneColour(thisTraitList);
                break;

            case "growth rate":
                growthRate = new GrowthRate(thisTraitList);
                break;

            case "life expectancy":
                lifeExpectancy = new LifeExpectancy(thisTraitList);
                break;

            case "reproductive age":
                reproductiveAge = new ReproductiveAge(thisTraitList);
                break;

            case "gestation period":
                gestationPeriod = new GestationPeriod(thisTraitList);
                break;

            case "energy level":
                energyLevel = new EnergyLevel(thisTraitList);
                break;

            case "energy consumption":
                energyConsumption = new EnergyConsumption(thisTraitList);
                break;

            case "food level":
                foodLevel = new FoodLevel(thisTraitList);
                break;

            case "food consumption":
                foodConsumption = new FoodConsumption(thisTraitList);
                break;

            case "water level":
                waterLevel = new WaterLevel(thisTraitList);
                break;

            case "water consumption":
                waterConsumption = new WaterConsumption(thisTraitList);
                break;

            case "strength":
            case "intellect":
            case "constitution":
            case "wisdom":
            case "charisma":
            case "vanity":
                attributesList.Add(new AttributeTrait(thisTraitList));
                break;
            }

            genes.Clear();
        }
    }
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (LifeStage == PlantLifeStage.Growing)
            {
                stringBuilder.AppendLine("PercentGrowth".Translate(new object[]
                {
                    GrowthPercentString
                }));

                // Append secondary growth info
                if (Sec_HarvestableNow)
                {
                    stringBuilder.AppendLine(thingLabel + " " + "ReadyToHarvest".Translate().ToLower());
                }
                else
                {
                    if (GrowsThisSeason)
                    {
                        stringBuilder.AppendLine(thingLabel + " " + "PercentGrowth".Translate(new object[]
                        {
                            Sec_GrowthPercentString
                        }));
                    }
                    else
                    {
                        stringBuilder.AppendLine(thingLabel + " " + Static.ReportBadSeason);
                    }
                }

                stringBuilder.AppendLine("GrowthRate".Translate() + ": " + GrowthRate.ToStringPercent());
                if (Resting)
                {
                    stringBuilder.AppendLine("PlantResting".Translate());
                }
                if (!HasEnoughLightToGrow)
                {
                    stringBuilder.AppendLine("PlantNeedsLightLevel".Translate() + ": " + def.plant.growMinGlow.ToStringPercent());
                }
                float growthRateFactor_Temperature = GrowthRateFactor_Temperature;
                if (growthRateFactor_Temperature < 0.99f)
                {
                    if (growthRateFactor_Temperature < 0.01f)
                    {
                        stringBuilder.AppendLine("OutOfIdealTemperatureRangeNotGrowing".Translate());
                    }
                    else
                    {
                        stringBuilder.AppendLine("OutOfIdealTemperatureRange".Translate(new object[]
                        {
                            Mathf.RoundToInt(growthRateFactor_Temperature * 100f).ToString()
                        }));
                    }
                }
            }
            else if (LifeStage == PlantLifeStage.Mature)
            {
                if (def.plant.Harvestable)
                {
                    stringBuilder.AppendLine("ReadyToHarvest".Translate());
                }
                else
                {
                    stringBuilder.AppendLine("Mature".Translate());
                }

                // Append secondary growth info
                if (Sec_HarvestableNow)
                {
                    stringBuilder.AppendLine(thingLabel + " " + "ReadyToHarvest".Translate().ToLower());
                }
                else
                {
                    if (GrowsThisSeason)
                    {
                        stringBuilder.AppendLine(thingLabel + " " + "PercentGrowth".Translate(new object[]
                        {
                            Sec_GrowthPercentString
                        }));
                    }
                    else
                    {
                        stringBuilder.AppendLine(thingLabel + " " + Static.ReportBadSeason);
                    }
                }
            }
            return(stringBuilder.ToString().TrimEndNewlines());
        }
Beispiel #21
0
 /* NextLevel() returns the amount of XP needed to get from the level passed in, to the next level.
  * It takes a GrowthRate from the Pokemon it's finding out the amount of XP for.
  * It calls ToLevel() twice, passing in the level and the level plus one.
  * Subtracting them from each other gives the final value to be returned. */
 public static int NextLevel(GrowthRate growthRate, byte bLevel)
 {
     return((ToLevel(growthRate, (byte)(bLevel + 1))) - (ToLevel(growthRate, (bLevel))));
 }
Beispiel #22
0
        public BaseStats(ushort i, string n, byte h, byte atk, byte def, byte satk, byte sdef, byte spd, Types t, byte ctch, byte exp, ushort ev, GenderRatio gender, GrowthRate growth, EggGroups eg, Ability[] ab, LearnableMove[] ls, PokedexEntry pe, IEvolution[] evo = null)
        {
            id = i;
            name = n;

            baseHP = h;
            baseAttack = atk;
            baseDefense = def;
            baseSpeed = sdef;
            baseSpecialAttack = satk;
            baseSpecialDefense = spd;
            types = t;
            catchRate = ctch;
            expYield = exp;
            evYield = ev;
            genderRatio = gender;
            /* 0	Arceus, Buneary, Darkrai, Deoxys, Deoxys (Attack), Deoxys (Defense), Deoxys (Speed), Dialga, Genosekuto, Giratina (Altered), Giratina (Origin), Groudon, Ho-oh, Kyogre, Kyuremu, Lugia, Mewtwo, Palkia, Rayquaza, Regigigas, Reshiram, Zekrom
             * 35	Absol, Aggron, Aron, Articuno, Axew, Bagon, Banette, Baruchai, Barujiina, Beldum, Birijion, Cacnea, Cacturne, Carvanha, Chatot, Dragonair, Dragonite, Dratini, Dusclops, Dusknoir, Duskull, Entei, Fraxure, Gallade, Gardevoir, Glaceon, Haxorus, Honchkrow, Houndoom, Houndour, Jiheddo, Kerudio, Kirikizan, Kirlia, Kobaruon, Komatana, Lairon, Larvitar, Leafeon, Metagross, Metang, Misdreavus, Mismagius, Moltres, Monozu, Murkrow, Pupitar, Raikou, Ralts, Regice, Regirock, Registeel, Sableye, Salamence, Sazandora, Sharpedo, Shelgon, Shuppet, Sneasel, Suicune, Terakion, Tyranitar, Umbreon, Weavile, Zapdos, Zuruggu
             * 70	All other Pokemon
             * 90	Borutorosu, Latias, Latios, Randorosu, Torunerosu
             * 100	Ambipom, Celebi, Cresselia, Croagunk, Heatran, Jirachi, Luxio, Meroetta, Meroetta, Mew, Pachirisu, Shaymin, Shaymin (Sky), Victini
             * 140	Azelf, Blissey, Chansey, Clefable, Clefairy, Cleffa, Happiny, Lopunny, Mesprit, Uxie
             */
            if (i == 150) baseHappiness = 0;
            else if (i >= 144 && i <= 149) baseHappiness = 35;
            else if (i == 151) baseHappiness = 100;
            else baseHappiness = 70;
            growthRate = growth;
            eggGroups = eg;
            abilities = ab;
            learnset = ls;
            entry = pe;
            evolutions = evo;
        }
        public PokeStat(string statLocation)
        {
            fileLocation = statLocation;

            TextInfo myTI = new CultureInfo("en-US", false).TextInfo;

            name = myTI.ToTitleCase(System.IO.Path.GetFileNameWithoutExtension(statLocation));

            bool readingTMHM = false;

            string[] lines = File.ReadAllLines(statLocation);

            for (int i = 0; i < lines.Length; i++)
            {
                lines[i] = lines[i].Replace("	", "");
            }

            for (int j = 0; j < lines.Length; j++)
            {
                string s = lines[j];

                if (s.StartsWith("db "))
                {
                    s = s.Replace("db ", "");
                    switch (dbID)
                    {
                    //pokedex id
                    case 0:
                        pokedexID = s.Replace(" ; pokedex id", "");
                        break;

                    //hp, atk, def, spd, spc
                    case 1:
                        s = s.Replace(" ", "");

                        string[] intData = s.Split(',');

                        for (int i = 0; i < intData.Length; i++)
                        {
                            intData[i] = intData[i];
                        }

                        hp  = int.Parse(intData[0]);
                        atk = int.Parse(intData[1]);
                        def = int.Parse(intData[2]);
                        spd = int.Parse(intData[3]);
                        spc = int.Parse(intData[4]);
                        break;

                    //type
                    case 2:
                        s = s.Replace(" ; type", "").Replace(" ", "");

                        string[] typeData = s.Split(',');

                        type1 = (PokeType)Enum.Parse(typeof(PokeType), typeData[0]);
                        type2 = (PokeType)Enum.Parse(typeof(PokeType), typeData[1]);

                        break;

                    //catch rate
                    case 3:
                        s = s.Replace(" ; catch rate", "").Replace(" ", "");

                        catch_rate = int.Parse(s);
                        break;

                    //base exp
                    case 4:
                        s = s.Replace(" ; base exp", "").Replace(" ", "");

                        baseExp = int.Parse(s);
                        break;

                    //level 1 moveset
                    case 5:
                        s = s.Replace(" ; level 1 learnset", "").Replace(" ", "");

                        string[] moves = s.Split(',');

                        foreach (string str in moves)
                        {
                            baseMoves.Add((Move)Enum.Parse(typeof(Move), str));
                        }

                        break;

                    //growth rate
                    case 6:
                        s = s.Replace(" ; growth rate", "").Replace(" ", "");

                        growthRate = (GrowthRate)Enum.Parse(typeof(GrowthRate), s);
                        break;

                    //end of file padding
                    case 7:
                        break;
                    }
                    dbID++;
                }
                else if (s.StartsWith("INCBIN "))
                {
                    s = s.Replace("INCBIN ", "").Replace("; sprite dimensions", "").Replace(" ", "");

                    string[] split = s.Split(',');

                    picLocation      = split[0].Replace("\"", "");
                    spriteDimensionX = int.Parse(split[1]);
                    spriteDimensionY = int.Parse(split[2]);
                }
                else if (s.StartsWith("dw "))
                {
                    s = s.Replace("dw ", "").Replace(" ", "");

                    string[] split = s.Split(',');
                    spriteFrontName = split[0];
                    spriteBackName  = split[1];
                }
                else if (s.StartsWith("tmhm "))
                {
                    readingTMHM = true;
                }

                if (readingTMHM)
                {
                    if (s.StartsWith("; end"))
                    {
                        readingTMHM = false;
                        continue;
                    }

                    s = s.Replace("tmhm ", "").Replace(" ", "");

                    string[] split = s.Split(',');

                    foreach (string str in split)
                    {
                        if (str == "\\")
                        {
                            continue;
                        }

                        tmhms.Add(new TMHMClass((TMHM)Enum.Parse(typeof(TMHM), str)));
                    }
                }
            }
        }
Beispiel #24
0
    public void UpdateText(Unit unit)
    {
        this.name.text = unit.name;
        this.race.text = unit.race.GetStringValue();

        this.image.sprite = Resources.Load <Sprite>("Image/Charactors/" + unit.pathName + "/status");

        //アセットから成長率を取得
        GrowthDatabase growthDatabase = Resources.Load <GrowthDatabase>("growthDatabase");
        GrowthRate     growthRate     = growthDatabase.FindByName(unit.name);

        //HP
        hp.text          = growthRate.hpRate.ToString();
        hpGauge.maxValue = StatusConst.GROWTH_MAX;
        hpGauge.value    = growthRate.hpRate;

        //遠距離攻撃
        latk.text          = growthRate.latkRate.ToString();
        latkGauge.maxValue = StatusConst.GROWTH_MAX;
        latkGauge.value    = growthRate.latkRate;

        //近距離攻撃
        catk.text          = growthRate.catkRate.ToString();
        catkGauge.maxValue = StatusConst.GROWTH_MAX;
        catkGauge.value    = growthRate.catkRate;

        //速さ
        agi.text          = growthRate.agiRate.ToString();
        agiGauge.maxValue = StatusConst.GROWTH_MAX;
        agiGauge.value    = growthRate.agiRate;

        //技
        dex.text          = growthRate.dexRate.ToString();
        dexGauge.maxValue = StatusConst.GROWTH_MAX;
        dexGauge.value    = growthRate.dexRate;

        //幸運
        luk.text          = growthRate.lukRate.ToString();
        lukGauge.maxValue = StatusConst.GROWTH_MAX;
        lukGauge.value    = growthRate.lukRate;

        //遠距離防御
        ldef.text          = growthRate.ldefRate.ToString();
        ldefGauge.maxValue = StatusConst.GROWTH_MAX;
        ldefGauge.value    = growthRate.ldefRate;

        //近距離防御
        cdef.text          = growthRate.cdefRate.ToString();
        cdefGauge.maxValue = StatusConst.GROWTH_MAX;
        cdefGauge.value    = growthRate.cdefRate;


        if (unit.name == "霊夢")
        {
            this.detailText.text = "博麗神社の巫女さん。\n\n" +
                                   "2種類の武器と遠距離近距離攻撃、仲間の回復が出来、\n" +
                                   "多くの状況で有利に戦う事が出来ます。\n\n" +

                                   "また、武器や癒符の熟練度が上がりやすくなる\n" +
                                   "スキルを持っているので、\n" +
                                   "序盤から強力な符を装備する事が出来ます。\n\n" +

                                   "中級職で敵の防御スキルを無効化するスキルを習得します。\n\n" +

                                   "上級職では遠距離攻撃特化型と、近距離攻撃が得意で移動力が高い\n" +
                                   "バランス型を選ぶ事が出来ます。";
        }
        else if (unit.name == "魔理沙")
        {
            this.detailText.text = "弾幕はパワー。\n\n" +

                                   "遠距離攻撃と素早さが上がりやすく、\n" +
                                   "経験値を多く獲得するスキルで成長も早いので、\n" +
                                   "攻撃の要となります。\n" +
                                   "また、鍵無しで宝箱を開ける事が出来ます。\n" +
                                   "防御力は高くないので、孤立させ過ぎないように注意しましょう。\n\n" +

                                   "中級職では武器の使用回数消費を抑えるスキルを習得します。\n\n" +

                                   "上級職では攻撃特化型と、回避率が高くアイテムの使用後に\n" +
                                   "行動が出来る防御型を選ぶ事が出来ます。";
        }
        else if (unit.name == "ルーミア")
        {
            this.detailText.text = "遠距離、近距離防御力共に高く、ダメージを受けにくいです。\n" +
                                   "反面、素早さは低いので、攻撃力の高い敵から\n" +
                                   "追撃を受けないように注意が必要です。\n" +

                                   "上級職にクラスチェンジすると・・・";
        }
        else if (unit.name == "大妖精")
        {
            this.detailText.text = "仲間の回復とステータスを上げる事が出来ます。\n" +
                                   "戦闘能力は低いので、攻撃を受けないように注意しましょう。\n\n" +

                                   "中級職になると、ターン開始時に\n" +
                                   "周囲の仲間の体力を少し回復する事が出来ます。\n\n" +

                                   "上級職になると仲間を再行動させる事が出来るようになり、\n" +
                                   "更に仲間のステータスを上げる事が出来るようになります。\n";
        }

        else if (unit.name == "チルノ")
        {
            this.detailText.text = "戦闘能力は突出した所が無いですが、\n" +
                                   "貴重な遠距離と近距離の両方に\n" +
                                   "攻撃出来る武器を使用する事が出来ます。\n\n" +

                                   "中級職で隣接する敵の回避率を下げるスキルを習得します。\n\n" +

                                   "上級職では仲間のステータスを上げるスキルを習得する職か、\n" +
                                   "敵を移動出来なくするスキルを習得する職を選ぶ事が出来るので、\n" +
                                   "上手に使う事で戦局を有利に進める事が出来ます。";
        }

        else if (unit.name == "文")
        {
            this.detailText.text = "序盤から加入して性能が高いですが、レベルが高い為、\n" +
                                   "文ばかり戦わせると他のキャラが成長しません。\n" +
                                   "序盤は戦闘させ過ぎないように注意が必要です。\n\n" +

                                   "鍵無しで宝箱を開ける事が出来るので宝箱の回収係や、\n" +
                                   "武器を外して壁として活躍させるのがお勧めです。\n\n" +

                                   "素早さが非常に高いですが、取材が目的で異変の解決には\n" +
                                   "関与する気が無い為、攻撃力は低いです。\n\n" +

                                   "所謂お助けキャラですが、成長率は高いので、\n" +
                                   "最後まで活躍する事が出来ます。\n" +

                                   "上級職では攻撃特化型と、回避率の高い\n" +
                                   "防御型を選ぶ事が出来ます。";
        }

        else if (unit.name == "美鈴")
        {
            this.detailText.text = "近距離攻撃と防御に特化した性能で、\n" +
                                   "HPが高く壁として活躍する事が出来ます。\n\n" +

                                   "近距離攻撃の手段を持たない敵に対しては\n" +
                                   "一方的に高いダメージを与える事が出来ます。\n\n" +

                                   "反面、遠距離攻撃への防御力は低く、\n" +
                                   "運も低い為必殺を受けやすいので、\n" +
                                   "過信していると想像以上にダメージを受ける事が有ります。\n\n" +

                                   "中級職から仲間の体力を回復させる事が出来ます。\n\n" +

                                   "上級職では高い必殺率を持つ職業と、\n" +
                                   "仲間の防御力を上げる事が出来る職業を選ぶ事が出来ます。\n";
        }
        else if (unit.name == "小悪魔")
        {
            this.detailText.text = "仲間の回復とステータスを上げる事が出来ます。\n" +
                                   "攻撃力もそこそこの性能で、敵にダメージを与えやすいです。\n" +
                                   "また、仲間を回復すると自分のHPも回復する事が出来ます。\n\n" +

                                   "運が低く、防御力も高くない為、\n" +
                                   "攻撃を受けないように注意しましょう。\n\n" +

                                   "中級職になると、周囲の仲間の攻撃力を上げる事が出来ます。\n" +

                                   "上級職になると仲間を再行動させる事が出来るようになり、\n" +
                                   "更に仲間のステータスを上げる事が出来るようになります。";
        }
        else if (unit.name == "鈴仙")
        {
            this.detailText.text = "攻撃の命中率が高く、射程距離の長い武器で\n" +
                                   "敵を狙撃する事が出来ます。\n\n" +

                                   "運が非常に低く必殺を受けやすいので、\n" +
                                   "攻撃を受けないように注意が必要です。\n\n" +

                                   "上級職では薬で仲間の体力を回復させる事が出来るバランス型と、\n" +
                                   "攻撃特化型の傾向が大きく異なる2種類の職業を選ぶ事が出来ます。\n\n" +

                                   "趣味で登場させたけど、運用に難が有って可愛い。";
        }
        else if (unit.name == "パチュリー")
        {
            this.detailText.text = "遠距離攻撃防御力、技が非常に高く、\n" +
                                   "最大8マス先の敵に遠距離攻撃出来る武器を使用する事が出来る為、\n" +
                                   "遠距離攻撃では圧倒的な性能を持っています。\n\n" +

                                   "反面、HP、近距離防御力は非常に低く、素早さも低めなので、\n" +
                                   "近距離攻撃を受けると一撃で倒されてしまう事も有ります。\n\n" +

                                   "専用武器は修理出来ますが非常に修理費が高額な為、\n" +
                                   "ここぞという時に使用しましょう。\n\n" +

                                   "中級職ではより攻撃力が上がり、\n" +
                                   "上級職では攻守共に強力なスキルを習得します。\n\n" +

                                   "装備出来る符の種類が多く、ショット、レーザーに加えて\n" +
                                   "上級職では物理、癒符のどちらかを装備する事が出来ます。\n";
        }
        else if (unit.name == "咲夜")
        {
            this.detailText.text = "技、速さ、幸運が上がりやすく、\n" +
                                   "また、遠近両方に対して攻撃出来る専用武器を持っている為、\n" +
                                   "隙の無い活躍が出来ます。\n\n" +

                                   "バランス型の成長をするキャラのお約束で\n" +
                                   "運が悪いと器用貧乏になる事も有りますが、\n" +
                                   "その場合も仲間のサポートと鍵開けによる宝箱の回収で\n" +
                                   "いぶし銀の活躍が出来る、まさにパーフェクトメイド。\n\n" +

                                   "中級職では行動せずに待機すると\n" +
                                   "回避率が上がるスキルを習得します。\n\n" +

                                   "上級職では攻撃特化型の職業と、\n" +
                                   "仲間のサポートが出来る職業を選ぶ事が出来ます。\n";
        }

        else if (unit.name == "レミリア")
        {
            this.detailText.text = "序盤から加入して性能が高いですが、レベルが高い為、\n" +
                                   "レミリアばかり戦わせると他のキャラが成長しません。\n" +
                                   "序盤は戦闘させ過ぎないように注意が必要です。\n\n" +

                                   "専用武器のグングニルは遠近両用で非常に高性能ですが、\n" +
                                   "修理費が高額な為、多用すると紅魔館の財政を圧迫してしまいます。\n\n" +

                                   "運命を操る程度の能力の為、非常に幸運の成長率が高く、\n" +
                                   "全体的なステータスの成長率も高い為、\n" +
                                   "終盤も活躍する事が出来ます。\n\n" +

                                   "上級職では戦闘後に敵の能力を下げるスキルを習得する職業と、\n" +
                                   "敵から受けるダメージを確率で半減させるスキルを習得する\n" +
                                   "職業を選ぶ事が出来ます。\n";
        }
        else if (unit.name == "フランドール")
        {
            this.detailText.text = "非常に攻撃寄りのステータスにクリティカル率が高い専用武器、\n" +
                                   "必殺率を上げる専用スキルを持っており、\n" +
                                   "攻撃が命中すれば多くの敵を一撃で倒す事が出来ます。\n\n" +

                                   "反面、技が低い為攻撃の命中が安定しないので、\n" +
                                   "運用に運の要素が強いです。\n\n" +
                                   "また防御力は低いので、シリーズ恒例の\n" +
                                   "「やっつけ負け」に注意する必要が有ります。\n\n" +

                                   "ゲーム終盤に上級職で加入する為、\n" +
                                   "クラスチェンジ可能な職業は有りません。";
        }
    }
Beispiel #25
0
    private static void Create()
    {
        GrowthDatabase growthDatabase = ScriptableObject.CreateInstance <GrowthDatabase>();

        //霊夢
        int[]      growthRate  = new int[] { 45, 45, 35, 45, 45, 50, 35, 30 };
        GrowthRate reimuGrowth = new GrowthRate("霊夢", growthRate);

        growthDatabase.growthList.Add(reimuGrowth);

        //魔理沙
        growthRate = new int[] { 40, 50, 35, 40, 50, 40, 30, 20 };
        GrowthRate marisaGrowth = new GrowthRate("魔理沙", growthRate);

        growthDatabase.growthList.Add(marisaGrowth);

        //ルーミア
        growthRate = new int[] { 50, 45, 35, 30, 25, 20, 50, 40 };
        GrowthRate rumiaGrowth = new GrowthRate("ルーミア", growthRate);

        growthDatabase.growthList.Add(rumiaGrowth);

        //大妖精
        growthRate = new int[] { 30, 40, 30, 40, 40, 30, 30, 20 };
        GrowthRate daiyouseiGrowth = new GrowthRate("大妖精", growthRate);

        growthDatabase.growthList.Add(daiyouseiGrowth);

        //ツィルノ
        growthRate = new int[] { 50, 40, 45, 30, 45, 40, 30, 30 };
        GrowthRate chirnoGrowth = new GrowthRate("チルノ", growthRate);

        growthDatabase.growthList.Add(chirnoGrowth);

        //文
        growthRate = new int[] { 40, 35, 35, 40, 65, 45, 30, 30 };
        GrowthRate ayaGrowth = new GrowthRate("文", growthRate);

        growthDatabase.growthList.Add(ayaGrowth);

        //うどんげ氏
        growthRate = new int[] { 40, 50, 30, 55, 45, 15, 35, 20 };
        GrowthRate udongeGrowth = new GrowthRate("鈴仙", growthRate);

        growthDatabase.growthList.Add(udongeGrowth);

        //美鈴
        growthRate = new int[] { 65, 20, 50, 40, 45, 20, 25, 40 };
        GrowthRate meirinGrowth = new GrowthRate("美鈴", growthRate);

        growthDatabase.growthList.Add(meirinGrowth);

        //小悪魔
        growthRate = new int[] { 40, 45, 30, 40, 45, 20, 20, 30 };
        GrowthRate koakumaGrowth = new GrowthRate("小悪魔", growthRate);

        growthDatabase.growthList.Add(koakumaGrowth);

        //パチュリー
        growthRate = new int[] { 25, 65, 15, 65, 35, 30, 40, 10 };
        GrowthRate patuGrowth = new GrowthRate("パチュリー", growthRate);

        growthDatabase.growthList.Add(patuGrowth);

        //咲夜
        growthRate = new int[] { 40, 45, 30, 50, 50, 40, 30, 35 };
        GrowthRate sakuyaGrowth = new GrowthRate("咲夜", growthRate);

        growthDatabase.growthList.Add(sakuyaGrowth);

        //レミリア
        growthRate = new int[] { 55, 40, 50, 40, 45, 65, 25, 30 };
        GrowthRate remilliaGrowth = new GrowthRate("レミリア", growthRate);

        growthDatabase.growthList.Add(remilliaGrowth);

        //フラン
        growthRate = new int[] { 50, 50, 65, 25, 50, 25, 20, 25 };
        GrowthRate frandreGrowth = new GrowthRate("フランドール", growthRate);

        growthDatabase.growthList.Add(frandreGrowth);

        //以下、敵の成長率 咲夜とかが敵で出た場合も、成長率は味方と同じものを参照
        //妖精
        growthRate = new int[] { 50, 40, 40, 30, 35, 25, 25, 20 };
        GrowthRate growth = new GrowthRate("妖精", growthRate);

        growthDatabase.growthList.Add(growth);

        //メイド妖精
        growthRate = new int[] { 60, 45, 45, 40, 45, 30, 30, 25 };
        growth     = new GrowthRate("メイド妖精", growthRate);
        growthDatabase.growthList.Add(growth);

        //毛玉
        growthRate = new int[] { 40, 20, 35, 25, 45, 20, 10, 30 };
        growth     = new GrowthRate("毛玉", growthRate);
        growthDatabase.growthList.Add(growth);

        //妖獣
        growthRate = new int[] { 50, 30, 40, 30, 50, 20, 20, 35 };
        growth     = new GrowthRate("妖獣", growthRate);
        growthDatabase.growthList.Add(growth);

        //魔導書
        growthRate = new int[] { 40, 55, 10, 50, 30, 10, 35, 20 };
        growth     = new GrowthRate("魔導書", growthRate);
        growthDatabase.growthList.Add(growth);

        //グリモワール
        growthRate = new int[] { 45, 60, 20, 60, 35, 20, 40, 25 };
        growth     = new GrowthRate("グリモワール", growthRate);
        growthDatabase.growthList.Add(growth);

        //使い魔
        growthRate = new int[] { 45, 50, 40, 40, 40, 30, 25, 20 };
        growth     = new GrowthRate("使い魔", growthRate);
        growthDatabase.growthList.Add(growth);

        //ひまわり妖精
        growthRate = new int[] { 60, 45, 45, 25, 20, 15, 40, 20 };
        growth     = new GrowthRate("ひまわり妖精", growthRate);
        growthDatabase.growthList.Add(growth);

        //ハイフェアリー
        growthRate = new int[] { 70, 50, 50, 30, 25, 20, 45, 25 };
        growth     = new GrowthRate("ハイフェアリー", growthRate);
        growthDatabase.growthList.Add(growth);

        //ホブゴブリン
        growthRate = new int[] { 50, 30, 50, 40, 50, 20, 20, 35 };
        growth     = new GrowthRate("ホブゴブリン", growthRate);
        growthDatabase.growthList.Add(growth);

        //幽霊
        growthRate = new int[] { 50, 50, 20, 30, 45, 10, 30, 30 };
        growth     = new GrowthRate("幽霊", growthRate);
        growthDatabase.growthList.Add(growth);

        //怨霊
        growthRate = new int[] { 55, 55, 25, 40, 50, 15, 35, 35 };
        growth     = new GrowthRate("怨霊", growthRate);
        growthDatabase.growthList.Add(growth);

        //吸血コウモリ
        growthRate = new int[] { 40, 40, 30, 35, 55, 35, 20, 20 };
        growth     = new GrowthRate("吸血コウモリ", growthRate);
        growthDatabase.growthList.Add(growth);

        //ツパイ
        growthRate = new int[] { 45, 50, 40, 40, 60, 40, 25, 25 };
        growth     = new GrowthRate("ツパイ", growthRate);
        growthDatabase.growthList.Add(growth);


        //ファイル書き出し Resources配下に作る
        AssetDatabase.CreateAsset(growthDatabase, "Assets/Resources/growthDatabase.asset");
    }
        /* This function allows a user to add a new Pokemon species manually. */
        public static void AddPokemon()
        {
            Border("PkmnEngine Editor - Add New Pokemon");

            /* First, the user enters the ID for the Pokemon they're adding. */
            Console.WriteLine("Enter the ID of the Pokemon you wish to add.");
            ushort id = ushort.Parse(Console.ReadLine());

            /* If a PokemonData with that ID already exists, the user is prompted asking if they want to overwrite it. */
            if (PokemonDataManager.PokemonData.ContainsKey(id))
            {
                Console.WriteLine("Pokemon with ID {0} already exists [{1}]. Overwrite? (y/n)", id, PokemonDataManager.PokemonData[id].PokemonName);
                string choice = Console.ReadLine();

                /* If they don't want to overwrite, the function returns. */
                if (choice[0] != 'y' && choice[0] != 'Y')
                {
                    return;
                }
                Console.WriteLine("Pokemon will be overwritten.");
            }

            /* If the user chooses to overwrite the PokemonData, they will then enter all the new information about the PokemonData. */
            Console.WriteLine("Enter name of Pokemon.");
            string name = Console.ReadLine();

            Console.WriteLine("Enter Base HP of Pokemon.");
            byte baseHP = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter Base Attack of Pokemon.");
            byte baseAttack = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter Base Defence of Pokemon.");
            byte baseDefence = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter Base Special Attack of Pokemon.");
            byte baseSpecialAttack = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter Base Special Defence of Pokemon.");
            byte baseSpecialDefence = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter Base Speed of Pokemon.");
            byte baseSpeed = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter whether Pokemon can have genders (True/False).");
            bool canHaveGender = bool.Parse(Console.ReadLine());

            Console.WriteLine("Enter type of Pokemon.");
            PkmnType type = ParseEnum <PkmnType>(Console.ReadLine());

            Console.WriteLine("Enter second type of Pokemon (null for single types).");
            string secondType = Console.ReadLine();

            Console.WriteLine("Enter species description, e.g. Gyarados is \"Atrocious\".");
            string species = Console.ReadLine();

            species = species + " Pokemon"; // Converts "Atrocious" into "Atrocious Pokemon", for example
            Console.WriteLine("Enter the weight of the Pokemon in KG.");
            double weightKg = double.Parse(Console.ReadLine());

            Console.WriteLine("Enter the height of the Pokemon in M.");
            double heightM = double.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Egg Group of the Pokemon.");
            EggGroup eggGroup = ParseEnum <EggGroup>(Console.ReadLine());

            Console.WriteLine("Enter the second Egg Group of the Pokemon (can be null).");
            string secondEggGroup = Console.ReadLine();

            Console.WriteLine("Enter the Base Experience of the Pokemon.");
            ushort baseExp = ushort.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Capture Rate of the Pokemon.");
            byte captureRate = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Base Happiness of the Pokemon.");
            byte baseHappiness = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Growth Rate of the Pokemon.");
            GrowthRate growthRate = ParseEnum <GrowthRate>(Console.ReadLine());

            Console.WriteLine("Enter the Male Gender Ratio of the Pokemon out of 100 (0 for genderless).");
            byte maleRatio = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Female Gender Ratio of the Pokemon out of 100 (0 for genderless).");
            byte femaleRatio = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Egg Cycle count of the Pokemon.");
            byte eggCycles = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the HP EV Yield of the Pokemon.");
            byte hpEvYield = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Attack EV Yield of the Pokemon.");
            byte atkEvYield = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Defence EV Yield of the Pokemon.");
            byte defEvYield = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Special Attack EV Yield of the Pokemon.");
            byte spAtkEvYield = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Special Defence EV Yield of the Pokemon.");
            byte spDefEvYield = byte.Parse(Console.ReadLine());

            Console.WriteLine("Enter the Speed EV Yield of the Pokemon.");
            byte    spdEvYield = byte.Parse(Console.ReadLine());
            EvYield evYield    = new EvYield(hpEvYield, atkEvYield, defEvYield, spAtkEvYield, spDefEvYield, spdEvYield);

            /* Once everything has been calculated, the base stat total is calculated and displayed. */
            int stattotal = (baseHP + baseAttack + baseDefence + baseSpecialAttack + baseSpecialDefence + baseSpeed);

            Console.WriteLine("Stat total is {0}. Adding Pokemon...", stattotal);

            /* One of four possible constructor calls is made, depending on whether the secondType and secondEggGroup are null or not. */
            if (secondType == "null" || secondType == "Null")
            {
                if (secondEggGroup == "null" || secondEggGroup == "Null")
                {
                    PokemonDataManager.PokemonData.Add(id, new PokemonData(name, baseHP, baseAttack, baseDefence, baseSpecialAttack, baseSpecialDefence, baseSpeed, id, type, null, canHaveGender, species, weightKg, heightM, eggGroup, null, baseExp, captureRate, baseHappiness, growthRate, eggCycles, maleRatio, femaleRatio, evYield));
                }
                else
                {
                    EggGroup otherEggGroup = ParseEnum <EggGroup>(secondEggGroup);
                    PokemonDataManager.PokemonData.Add(id, new PokemonData(name, baseHP, baseAttack, baseDefence, baseSpecialAttack, baseSpecialDefence, baseSpeed, id, type, null, canHaveGender, species, weightKg, heightM, eggGroup, otherEggGroup, baseExp, captureRate, baseHappiness, growthRate, eggCycles, maleRatio, femaleRatio, evYield));
                }
            }
            else // secondType != "null" || secondType != "Null"
            {
                PkmnType otherType = ParseEnum <PkmnType>(secondType);
                if (secondEggGroup == "null" || secondEggGroup == "Null")
                {
                    PokemonDataManager.PokemonData.Add(id, new PokemonData(name, baseHP, baseAttack, baseDefence, baseSpecialAttack, baseSpecialDefence, baseSpeed, id, type, otherType, canHaveGender, species, weightKg, heightM, eggGroup, null, baseExp, captureRate, baseHappiness, growthRate, eggCycles, maleRatio, femaleRatio, evYield));
                }
                else
                {
                    EggGroup otherEggGroup = ParseEnum <EggGroup>(secondEggGroup);
                    PokemonDataManager.PokemonData.Add(id, new PokemonData(name, baseHP, baseAttack, baseDefence, baseSpecialAttack, baseSpecialDefence, baseSpeed, id, type, otherType, canHaveGender, species, weightKg, heightM, eggGroup, otherEggGroup, baseExp, captureRate, baseHappiness, growthRate, eggCycles, maleRatio, femaleRatio, evYield));
                }
            }
            Console.WriteLine("{0} has been added successfully!", name);
            System.Threading.Thread.Sleep(2000);
        }