Esempio n. 1
0
 public void DeclareAttack(string type)
 {
     PlayerAttack(type);
     Debug.Log(playerAttackType.ToString() + " " + playerStatStrength.ToString());
     EnemyAI();
     Result();
 }
Esempio n. 2
0
 public void setStatNames()
 {
     for (int i = 0; i < statDisplays.Length; i++)
     {
         StatType type = (StatType)i;
         statDisplays[i].name          = type.ToString();
         statDisplays[i].NameText.text = type.ToString();
     }
 }
Esempio n. 3
0
        static void createVersatilePerformanceAndExpandedVersality()
        {
            var bard_class = library.Get <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");

            var skill_foci = library.Get <BlueprintFeatureSelection>("c9629ef9eebb88b479b2fbc5e836656a").AllFeatures;
            var skills     = new StatType[] { StatType.SkillMobility, StatType.SkillStealth, StatType.SkillPersuasion, StatType.SkillPerception, StatType.SkillUseMagicDevice };

            for (int i = 0; i < skill_foci.Length; i++)
            {
                StatType stat = skill_foci[i].GetComponent <AddContextStatBonus>().Stat;
                if (!skills.Contains(stat))
                {
                    continue;
                }

                string name = LocalizedTexts.Instance.Stats.GetText(stat);

                var feature = Helpers.CreateFeature(stat.ToString() + "VersatilePerformanceFeature",
                                                    "Versatile Performance: " + name,
                                                    "At 2nd level a bard or skald selects one of the following skills: Mobility, Stealth, Perception, Persuation or Use Magic Device. She receives a number of ranks in this skill equal to half her bard or skald level. In addition she uses charisma modifier in place of the ability modifier the skill would normally use. The bard or skald can immediately retrain all of her ranks in excess in the selected skill at no additional cost in money or time.",
                                                    "",
                                                    skill_foci[i].Icon,
                                                    FeatureGroup.None,
                                                    Helpers.Create <SkillMechanics.SetSkillRankToValue>(ss => { ss.skill = stat; ss.value = Helpers.CreateContextValue(AbilityRankType.Default); }),
                                                    Helpers.Create <StatReplacementMechanics.ReplaceBaseStatForStatTypeLogic>(r => { r.only_if_greater = false; r.NewBaseStatType = StatType.Charisma; r.StatTypeToReplaceBastStatFor = stat; }),
                                                    Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, progression: ContextRankProgression.OnePlusDiv2,
                                                                                    classes: new BlueprintCharacterClass[] { bard_class, Skald.skald_class }
                                                                                    )
                                                    );

                var feature2 = Helpers.CreateFeature(stat.ToString() + "ExpandedVersalityFeature",
                                                     "Expanded Versality: " + name,
                                                     "A bard or skald can select a skill for which she already selected versatile performance and instead gain a number of ranks in this skill equal to her bard or skald level. The bard or skald can immediately retrain all of her ranks in excess in the selected skill at no additional cost in money or time.",
                                                     "",
                                                     skill_foci[i].Icon,
                                                     FeatureGroup.None,
                                                     Helpers.Create <SkillMechanics.SetSkillRankToValue>(ss => { ss.skill = stat; ss.value = Helpers.CreateContextValue(AbilityRankType.Default); ss.increase_by1_on_apply = true; }),
                                                     Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, progression: ContextRankProgression.Div2,
                                                                                     classes: new BlueprintCharacterClass[] { bard_class, Skald.skald_class }
                                                                                     ),
                                                     Helpers.PrerequisiteFeature(feature)
                                                     );
                versatile_performances.Add(feature);
                versatile_performances.Add(feature2);
                if (stat == StatType.SkillPersuasion)
                {
                    Skald.great_orator.AllFeatures = new BlueprintFeature[] { feature };
                }
            }
        }
Esempio n. 4
0
    private void SetStatAnimating(StatType statType, bool isAnimating)
    {
        switch (statType)
        {
        case StatType.Xp:
            isXpAnimating = isAnimating;
            break;

        case StatType.Health:
            isHealthAnimating = isAnimating;
            break;

        case StatType.Hunger:
            isHungerAnimating = isAnimating;
            break;

        case StatType.Coin:
            isCoinAnimating = isAnimating;
            break;

        default:
            Debug.LogError("Invalid stat type for set stat animating " + statType.ToString());
            return;
        }
    }
Esempio n. 5
0
    public static string StatToString(StatType t)
    {
        switch (t)
        {
        case StatType.move_range:
            return("Move Range");

        case StatType.move_time_delay:
            return("Move Time Cost");

        case StatType.adrenaline:
            return("Adrenaline");

        case StatType.oxygen:
            return("Oxygen");

        case StatType.attack_extra_damage_max:
        case StatType.attack_extra_damage_min:
            return("+ATK DMG");

        case StatType.adrenaline_conversion_max:
        case StatType.adrenaline_conversion_min:
            return("Adr. Conversion");

        case StatType.current_turn_time:
            return("Turn Delay");

        case StatType.attack_normal_delay:
            return("Attack Time Cost");

        default:
            return(t.ToString());
        }
    }
Esempio n. 6
0
        static void createExtraClassSkill()
        {
            var skill_foci = library.Get <BlueprintFeatureSelection>("c9629ef9eebb88b479b2fbc5e836656a").AllFeatures;

            BlueprintFeature[] skills = new BlueprintFeature[skill_foci.Length];
            for (int i = 0; i < skill_foci.Length; i++)
            {
                StatType stat = skill_foci[i].GetComponent <AddContextStatBonus>().Stat;
                string   name = LocalizedTexts.Instance.Stats.GetText(stat);

                skills[i] = Helpers.CreateFeature(stat.ToString() + "ExtraEidolonSkillFeature",
                                                  "Extra Class Skill: " + name,
                                                  "The Eidolon can choose 2 additional skills as its class skills.",
                                                  "",
                                                  skill_foci[i].Icon,
                                                  FeatureGroup.None,
                                                  Helpers.Create <AddClassSkill>(a => a.Skill = stat),
                                                  Helpers.Create <NewMechanics.PrerequisiteNoClassSkill>(p => p.skill = stat)
                                                  );
            }


            extra_class_skills = Helpers.CreateFeatureSelection("EidolonExtraClassSkill",
                                                                "Extra Class Skill",
                                                                skills[0].Description,
                                                                "",
                                                                null,
                                                                FeatureGroup.None);
            extra_class_skills.AllFeatures = skills;
        }
Esempio n. 7
0
    /// <summary>
    /// Pretty print the Stats (HP, Mana, Damage) and Bonuses in the Scene.
    /// </summary>
    /// <returns>Formated stat string.</returns>
    /// <param name="type">Stat Type.</param>
    public string FormatStat(StatType type)
    {
        string formattedStat;

        switch (type)
        {
        case StatType.HP:
        {
            formattedStat = string.Format("HP: {0}{1}", HP, FormatBonus(type));
            break;
        }

        case StatType.Mana:
        {
            formattedStat = string.Format("Mana: {0}{1}", Mana, FormatBonus(type));
            break;
        }

        case StatType.Damage:
        {
            formattedStat = string.Format("Damage: {0}{1}", Damage, FormatBonus(type));
            break;
        }

        default:
        {
            formattedStat = "Format for " + type.ToString() + " not defined!";
            break;
        }
        }

        return(formattedStat);
    }
Esempio n. 8
0
    /// <summary> Modifier 추가 </summary>
    public void AddStatModifier(StatType type, StatModifier mod, bool update = true)
    {
        if (!ContainParam(type))
        {
            CreateStat <ModifiableStat>(type);
        }

        if (ContainParam(type))
        {
            var stat = GetParam(type) as IStatModifiable;
            if (stat != null)
            {
                stat.AddModifier(mod);
                if (update)
                {
                    stat.UpdateModifiers();
                }
            }
            else
            {
                Debug.Log("[RPGStats] Trying to add Stat Modifier to non modifiable stat \"" + type.ToString() + "\"");
            }
        }
        else
        {
            Debug.Log("[RPGStats] Trying to add Stat Modifier to \"" + type.ToString() + "\", but RPGStats does not contain that stat");
        }
    }
Esempio n. 9
0
 public virtual void Show(StatType statType, int value)
 {
     Show(statType.ToString(),
          statType == StatType.SPD
             ? (value / 100f).ToString(CultureInfo.InvariantCulture)
             : value.ToString());
 }
Esempio n. 10
0
 void ShowBoostUI(StatType statType, int amount)
 {
     uiOpenTime     = Time.time;
     titleText.text = statType.ToString() + " BOOSTED";
     deltaText.text = "Increased by " + amount;
     base.Open();
 }
Esempio n. 11
0
    public void PlayTickAnimation(StatType statType)
    {
        switch (statType)
        {
        case StatType.Xp:
            anim.SetTrigger("LevelTick");
            return;

        case StatType.Health:
            anim.SetTrigger("HealthTick");
            return;

        case StatType.Hunger:
            anim.SetTrigger("HungerTick");
            return;

        case StatType.Coin:
            anim.SetTrigger("CoinTick");
            return;

        default:
            Debug.LogError("Invalid stat type for anim " + statType.ToString());
            return;
        }
    }
        public void MessageDisplayed_OnStatIncrease([Values] StatType raisedStat, [Range(1, 5)] int boostAmount)
        {
            //arrange
            _humanPlayer1.SetMove(_doNothingMove);
            _humanPlayer2.SetMove(_doNothingMove);

            _humanTeam.SetDeathsOnRoundEndEvent();

            _enemyPlayer1.SetMove(_doNothingMove);
            _enemyPlayer2.SetMove(_doNothingMove);

            StatRaisedEventArgs e = new StatRaisedEventArgs(raisedStat, boostAmount);

            _humanPlayer1.TurnEnded += delegate { _humanPlayer1.OnStatRaised(e); };

            //Act
            _battleManager.Battle(_humanTeam, _enemyTeam);

            //Assert
            MockOutputMessage[] outputs = _output.GetOutputs();

            string statTypeString = raisedStat == StatType.Evade ? "evasion" : raisedStat.ToString().ToLower();

            string            expectedMessage = $"{_humanPlayer1.DisplayName}'s {statTypeString} was raised by {boostAmount}!\n";
            MockOutputMessage output          = outputs.FirstOrDefault(o => o.Message == expectedMessage);

            Assert.NotNull(output);
        }
Esempio n. 13
0
        /// <summary>
        /// Gets the database field name for a given <see cref="StatType"/>.
        /// </summary>
        /// <param name="statType"><see cref="StatType"/> to get the database field name for.</param>
        /// <param name="statCollectionType">The <see cref="StatCollectionType"/> of the <see cref="StatType"/> to get
        /// the field for.</param>
        /// <returns>The database field name for the <paramref name="statType"/>.</returns>
        /// <exception cref="ArgumentException">StatCollectionType.Modified is not allowed in the database.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="statCollectionType"/> is not a valid
        /// <see cref="StatCollectionType"/> enum value.</exception>
        public static string GetDatabaseField(this StatType statType, StatCollectionType statCollectionType)
        {
            switch (statCollectionType)
            {
            case StatCollectionType.Base:
                return("stat_" + statType.ToString().ToLowerInvariant());

            case StatCollectionType.Requirement:
                return("stat_req_" + statType.ToString().ToLowerInvariant());

            case StatCollectionType.Modified:
                throw new ArgumentException("StatCollectionType.Modified is not allowed in the database.", "statCollectionType");

            default:
                throw new ArgumentOutOfRangeException("statCollectionType");
            }
        }
Esempio n. 14
0
 /// <summary>Improves the character stat.</summary>
 /// <param name="statType">Type of the stat.</param>
 /// <param name="skillAmount">The skill amount.</param>
 /// <param name="plugin">The HzPlugin.</param>
 /// <returns></returns>
 public static async Task <string> ImproveCharacterStatAsync(this HzPluginBase plugin, StatType statType, int skillAmount = 1)
 {
     return(await plugin.Account.DefaultRequestContent("improveCharacterStat")
            .AddKeyValue("skill_value", skillAmount)
            .AddKeyValue("stat_type", (int)statType)
            .AddKeyValue("rct", "2")
            .AddLog($"[Skill] Start Skill:{statType.ToString()}")
            .PostToHzAsync());
 }
        protected void PrintStatusAddedMessage(IFighter fighter, StatMultiplierStatus status)
        {
            StatType stat = status.StatType;
            string   increaseOrDecrease = (status.Multiplier > 1.0) ? "raised" : "lowered";

            string output = $"{fighter.DisplayName} had their {stat.ToString().ToLower()} {increaseOrDecrease} for {GetDurationString(status)}!";

            _output.WriteLine(output);
        }
Esempio n. 16
0
 /// <summary>Starts the training asynchronous.</summary>
 /// <param name="statType">Type of the stat.</param>
 /// <param name="iterations">The iterations.</param>
 /// <param name="plugin">The HzPlugin.</param>
 /// <returns></returns>
 public static async Task <string> StartTrainingAsync(this HzPluginBase plugin, StatType statType, int iterations = 1)
 {
     return(await plugin.Account.DefaultRequestContent("startTraining")
            .AddKeyValue("iterations", iterations)
            .AddKeyValue("stat_type", (int)statType)
            .AddKeyValue("rct", "2")
            .AddLog($"[Train] Start Training:{statType.ToString()}")
            .PostToHzAsync());
 }
    private EquipmentStatModifier AdditiveModifier(int powerLevel, StatType stat)
    {
        var rawAmount = AdditiveStatsChartPerPoint[stat] * powerLevel;

        return(new EquipmentStatModifier
        {
            StatType = stat.ToString(),
            ModifierType = StatMathOperator.Additive,
            Amount = Mathf.Max(rawAmount.FlooredInt(), 1)
        });
    }
Esempio n. 18
0
 public StatPotion(PotionStrength potionStrength, StatType statType)
 {
     Weight         = 1;
     PotionStrength = potionStrength;
     StatPotionType = statType;
     Name           = GetPotionName();
     StatAmount     = GetStatPotionAmount();
     ItemValue      = StatAmount * 10 / 2;
     Desc           = $"A {Name} that increases {StatPotionType.ToString().ToLower()} by {StatAmount}.";
     _statEffectDurationInSeconds = 600;
 }
Esempio n. 19
0
        /// <summary>
        /// Sets the grid data
        /// </summary>
        private void SetGrid()
        {
            colName.DataPropertyName  = "CustomName";
            colValue.DataPropertyName = _stat.ToString();
            colValue.HeaderText       = EnumMethods.GetDescription(typeof(StatType), _stat);
            BindingSource source = new BindingSource {
                DataSource = _list
            };

            grdMain.DataSource = source;
        }
Esempio n. 20
0
        public string Parse(byte[] packet, int length, PacketDirection direction)
        {
            if (direction != PacketDirection.Outgoing || packet[0] != 0xBF || packet[4] != 0x1A)
            {
                return(null);
            }

            StatType   stat       = (StatType)packet[5];
            LockStatus lockStatus = (LockStatus)packet[6];

            return($"SetStatus(\"{stat.ToString().ToLower()}\", \"{lockStatus.ToString().ToLower()}\")\r\n");
        }
Esempio n. 21
0
        public override string ToString()
        {
            string res = "dfsFileType = " + dfsFileType.ToString() + "\r\n" +
                         "Compressed = " + compressed.ToString() + "\r\n" +
                         "DataType = " + DataType.ToString() + "\r\n" +
                         "delVal = " + delVal.ToString() + "\r\n" +
                         "FileTitle = " + FileTitle + "\r\n" +
                         "statType = " + statType.ToString() + "\r\n" +
                         "Projection_type = " + Projection_type.ToString() + "\r\n" +
                         "Projection = " + Projection + "\r\n" +
                         "Orientation = " + Orientation.ToString() + "\r\n" +
                         "Longitude = " + Longitude.ToString() + "\r\n" +
                         "Latitude = " + Latitude.ToString() + "\r\n" +
                         "CustomBlockName= " + CustomBlockName + "\r\n";

            if (CustomBlockName == "MIKE_FM")
            {
                res += "\tNoNodesTot = " + dfsuCustBlock.NoNodesTot.ToString() + "\r\n" +
                       "\tNoElemTot = " + dfsuCustBlock.NoElemTot.ToString() + "\r\n" +
                       "\tDim = " + dfsuCustBlock.Dim.ToString() + "\r\n" +
                       "\tNoLayers = " + dfsuCustBlock.NoLayers.ToString() + "\r\n";
            }
            else if (CustomBlockName == "M21_Misc")
            {
                res += "\tori = " + m21CustBlock.ori + "\r\n" +
                       "\tf1 = " + m21CustBlock.f1 + "\r\n" +
                       "\tf2 = " + m21CustBlock.f2 + "\r\n" +
                       "\tf3 = " + m21CustBlock.f3 + "\r\n" +
                       "\tf4 = " + m21CustBlock.f4 + "\r\n" +
                       "\tf5 = " + m21CustBlock.f5 + "\r\n" +
                       "\tf6 = " + m21CustBlock.f6 + "\r\n";
            }
            res += "tAxisType = " + tAxisType.ToString() + "\r\n" +
                   "tAxis_StartDateStr = " + tAxis_StartDateStr + "\r\n" +
                   "tAxis_StartTimeStr = " + tAxis_StartTimeStr + "\r\n" +
                   "tAxis_dTStep = " + tAxis_dTStep.ToString() + "\r\n" +
                   "tAxis_nTSteps = " + tAxis_nTSteps.ToString() + "\r\n" +
                   "tAxis_EUMUnit = " + tAxis_EUMUnit.ToString() + "\r\n" +
                   "tAxis_EUMUnitStr = " + tAxis_EUMUnitStr + "\r\n" +
                   "tAxis_dTStart = " + tAxis_dTStart.ToString() + "\r\n" +
                   "tAxis_indexTStart = " + tAxis_indexTStart.ToString() + "\r\n";
            for (int i = 0; i < staticItems.Length; i++)
            {
                res += "\r\nStatic item no " + (i + 1).ToString() + "\r\n" + staticItems[i].ToString();
            }

            for (int i = 0; i < Items.Length; i++)
            {
                res += "\r\nItem no " + (i + 1).ToString() + "\r\n" + Items[i].ToString();
            }
            return(res);
        }
Esempio n. 22
0
    public string GetTooltip()
    {
        string tooltip = "";

        if (bonusValue >= 0)
        {
            tooltip += "+";
        }

        switch (modType)
        {
        case StatModType.Add:
            tooltip += bonusValue + " " + type.ToString();
            break;

        case StatModType.Mult:
            tooltip += bonusValue * 100 + "% " + type.ToString();
            break;
        }

        return(tooltip);
    }
        public void CorrectlyPrintsMessage_StatBonusAdded([Values] StatType statType, [Values(1, 3)] int bonusAmount)
        {
            StatBonusAppliedEventArgs e = new StatBonusAppliedEventArgs(statType, bonusAmount, false);

            _fighter.OnStatBonusApplied(e);

            MockOutputMessage[] outputs = _output.GetOutputs();

            Assert.AreEqual(1, outputs.Length);

            MockOutputMessage output = outputs[0];

            Assert.AreEqual($"{_fighter.DisplayName} gained +{bonusAmount} {statType.ToString().ToLower()}\n", output.Message);
        }
        protected void PrintStatRaisedMessage(object sender, StatRaisedEventArgs e)
        {
            IFighter senderAsFighter = sender as IFighter;

            if (senderAsFighter == null)
            {
                throw new ArgumentException("BattleManagerScreenOutputs.PrintStatRaisedMessage should subscribe to IFighters and nothing else");
            }

            StatType raisedStat = e.RaisedStat;

            string statTypeString = raisedStat == StatType.Evade ? "evasion" : raisedStat.ToString().ToLower();

            string expectedMessage = $"{senderAsFighter.DisplayName}'s {statTypeString} was raised by {e.BoostAmount}!";

            _output.WriteLine(expectedMessage);
        }
Esempio n. 25
0
    /// <summary> 스탯 추가 </summary>
    public T CreateStat <T>(StatType statType) where T : Stat
    {
        T stat = System.Activator.CreateInstance <T>();

        string statID = statType.ToString();

        if (GameDataManager.statBaseDataDic.ContainsKey(statID))
        {
            stat.baseData = GameDataManager.statBaseDataDic[statID];
        }
        else
        {
            Debug.LogWarning(statID + " is not defiend in stat base data");
        }

        paramDic.Add(statType, stat);
        return(stat);
    }
 /// <summary>
 /// Updates the target stat's modifier value
 /// </summary>
 public void UpdateStatModifer(StatType target)
 {
     if (ContainsStat(target))
     {
         var modStat = this[target] as IStatModifiable;
         if (modStat != null)
         {
             modStat.UpdateModifiers();
         }
         else
         {
             Debug.Log("[Stats] Trying to Update Stat Modifiers for a non modifiable stat \"" + target.ToString() + "\"");
         }
     }
     else
     {
         Debug.Log("[Stats] Trying to Update Stat Modifiers for \"" + target.ToString() + "\", but StatCollection does not contain that stat");
     }
 }
 /// <summary>
 /// Scales the target stat in the collection to the target level
 /// </summary>
 public void ScaleStat(StatType target, int level)
 {
     if (ContainsStat(target))
     {
         var stat = this[target] as IStatScalable;
         if (stat != null)
         {
             stat.ScaleStat(level);
         }
         else
         {
             Debug.Log("[RPGStats] Trying to Scale Stat with a non scalable stat \"" + target.ToString() + "\"");
         }
     }
     else
     {
         Debug.Log("[RPGStats] Trying to Scale Stat for \"" + target.ToString() + "\", but RPGStatCollection does not contain that stat");
     }
 }
Esempio n. 28
0
    private int GetStepModifier(StatType statType)
    {
        switch (statType)
        {
        case StatType.Xp:
            return(3);

        case StatType.Health:
            return(1);

        case StatType.Hunger:
            return(1);

        case StatType.Coin:
            return(2);

        default:
            Debug.LogError("Invalid stat type for step modifier " + statType.ToString());
            return(0);
        }
    }
Esempio n. 29
0
    private bool GetStatAnimating(StatType statType)
    {
        switch (statType)
        {
        case StatType.Xp:
            return(isXpAnimating);

        case StatType.Health:
            return(isHealthAnimating);

        case StatType.Hunger:
            return(isHungerAnimating);

        case StatType.Coin:
            return(isCoinAnimating);

        default:
            Debug.LogError("Invalid stat type for get stat animating " + statType.ToString());
            return(false);
        }
    }
Esempio n. 30
0
    public static Sprite GetHudTweenIcon(StatType statType)
    {
        switch (statType)
        {
        case StatType.Xp:
            return(Resources.Load <Sprite>("IconStarBlank"));

        case StatType.Health:
            return(Resources.Load <Sprite>("IconHealthBlank"));

        case StatType.Hunger:
            return(Resources.Load <Sprite>("IconHungerBlank"));

        case StatType.Coin:
            return(Resources.Load <Sprite>("IconCoinBlank"));

        default:
            Debug.LogError("No icons for " + statType.ToString());
            return(null);
        }
    }
Esempio n. 31
0
    //
    // Pretty print the Stats (HP, Mana, Damage) and Bonuses in the Scene
    //
    public string FormatStat(StatType type)
    {
        string formattedStat;

        switch(type)
        {
            case StatType.HP:
            {
                formattedStat = string.Format("HP: {0}{1}", HP, FormatBonus(type));
                break;
            }

            case StatType.Mana:
            {
                formattedStat = string.Format("Mana: {0}{1}", Mana, FormatBonus(type));
                break;
            }

            case StatType.Damage:
            {
                formattedStat = string.Format("Damage: {0}{1}", Damage, FormatBonus(type));
                break;
            }

            default:
            {
                formattedStat = "Format for "+type.ToString()+" not defined!";
                break;
            }
        }

        return formattedStat;
    }
Esempio n. 32
0
 // Use this for initialization
 void Init(StatType type)
 {
     statType = type;
     labelText.text = statType.ToString() +":";
 }