当前位置: 首页>>代码示例>>C#>>正文


C# Stats类代码示例

本文整理汇总了C#中Stats的典型用法代码示例。如果您正苦于以下问题:C# Stats类的具体用法?C# Stats怎么用?C# Stats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Stats类属于命名空间,在下文中一共展示了Stats类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: skillLogic

 public override void skillLogic(Entity mob, Stats stats)
 {
     Vector2 targetLocation = mob.headTransform.up * maxDistance + mob.headTransform.position;
     Vector2 startLocation = mob.headTransform.position + mob.headTransform.up;
     foreach (RaycastHit2D linecast in Physics2D.LinecastAll(startLocation, targetLocation)) {
         if (linecast.collider.CompareTag("Wall")) {
             targetLocation = linecast.point;
             break;
         }
     }
     GameObject powershot = new GameObject();
     SpriteRenderer spriteRenderer = powershot.AddComponent<SpriteRenderer>();
     spriteRenderer.sprite = Resources.Load<Sprite>("Skills/Powershot/PowershotLaser");
     spriteRenderer.sortingOrder = 4;
     powershot.transform.position = new Vector2(startLocation.x + (targetLocation.x - startLocation.x)/2, startLocation.y + (targetLocation.y - startLocation.y)/2);
     powershot.transform.rotation = mob.headTransform.rotation;
     powershot.transform.localScale = new Vector3(1f * properties["areaOfEffect"], Vector2.Distance(startLocation, targetLocation), 1f);
     BoxCollider2D collider = powershot.AddComponent<BoxCollider2D>();
     collider.isTrigger = true;
     collider.size = new Vector2(0.5f, 1f);
     PowershotEffect p = powershot.AddComponent<PowershotEffect>();
     p.mob = mob.gameObject.GetComponent<Mob>();
     AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Skills/Powershot/sniperShot"), mob.headTransform.position);
     for (int i = 0; i < Vector3.Distance(startLocation, targetLocation); i++) {
         GameObject arrowGlow = MonoBehaviour.Instantiate(Resources.Load("ShotGlow")) as GameObject;
         arrowGlow.GetComponent<Light>().intensity = 3;
         arrowGlow.transform.SetParent(powershot.transform);
         Vector3 position = startLocation + ((targetLocation - startLocation).normalized * i);
         arrowGlow.transform.position = new Vector3(position.x, position.y, -2);
     }
 }
开发者ID:rwbysafire,项目名称:DemonHeart,代码行数:31,代码来源:SkillPowershot.cs

示例2: Defenses

 public Defenses(Stats stats)
 {
     if (stats == null) {
         throw new ArgumentNullException("stats");
     }
     this.stats = stats;
 }
开发者ID:JazzFisch,项目名称:DnD4eCM,代码行数:7,代码来源:Defenses.cs

示例3: RogueRotationCalculatorCombat

        public RogueRotationCalculatorCombat(Character character, Stats stats, BossOptions bossOpts, CalculationOptionsRogue calcOpts, float hasteBonus, float mainHandSpeed, float offHandSpeed, float mainHandSpeedNorm,
            float offHandSpeedNorm, float avoidedWhiteMHAttacks, float avoidedWhiteOHAttacks, float avoidedMHAttacks, float avoidedOHAttacks, float avoidedFinisherAttacks,
            float avoidedPoisonAttacks, float chanceExtraCPPerHit, RogueAbilityStats mainHandStats, RogueAbilityStats offHandStats, RogueAbilityStats mainGaucheStats,
            RogueAbilityStats sStrikeStats, RogueAbilityStats rStrikeStats, RogueAbilityStats ruptStats, RogueAbilityStats evisStats, RogueAbilityStats snDStats, RogueAbilityStats exposeStats,
            RogueAbilityStats iPStats, RogueAbilityStats dPStats, RogueAbilityStats wPStats) : base(character, stats, bossOpts, calcOpts, hasteBonus, mainHandSpeed, offHandSpeed, mainHandSpeedNorm,
            offHandSpeedNorm, avoidedWhiteMHAttacks, avoidedWhiteOHAttacks, avoidedMHAttacks, avoidedOHAttacks, avoidedFinisherAttacks, avoidedPoisonAttacks, chanceExtraCPPerHit, mainHandStats,
            offHandStats, ruptStats, snDStats, exposeStats, iPStats, dPStats, wPStats)
        {
            SStrikeStats = sStrikeStats;
            RStrikeStats = rStrikeStats;
            EvisStats = evisStats;
            MainGaucheStats = mainGaucheStats;

            ChanceOnMGAttackOnMHAttack = RV.Mastery.MainGauche + RV.Mastery.MainGauchePerMast * StatConversion.GetMasteryFromRating(stats.MasteryRating);
            EnergyRegenMultiplier = (1f + RV.Mastery.VitalityRegenMult) * (1f + (RV.AR.Duration + (Talents.GlyphOfAdrenalineRush ? RV.Glyph.ARDurationBonus : 0f)) / RV.AR.CD * Talents.AdrenalineRush) * (1f + HasteBonus) - 1f;

            #region Probability tables
            float c = ChanceExtraCPPerHit, h = (1f - c), f = CPOnFinisher, nf = (1f - f);
            _averageNormalCP[1] = 1 * (f + nf * h) + 2 * (nf * c);
            _averageNormalCP[2] = 2 * (f * h + nf * c + nf * h * h) + 3 * (f * c);
            _averageNormalCP[3] = 3 * (f * c + f * h * h + 2 * nf * c * h + nf * h * h * h) + 4 * (f * h * c + nf * c * c + nf * h * h * c);
            _averageNormalCP[4] = 4 * (2 * f * c * h + f * h * h * h + nf * c * c + 3 * nf * c * h * h + nf * h * h * h * h) + 5 * (f * c * c + f * h * h * c + 2 * nf * c * h * c + nf * h * h * h * c);
            _averageNormalCP[5] = 5 * (f * c * c + 3 * f * c * h * h + f * h * h * h * h + 3 * nf * c * c * h + 4 * nf * c * h * h * h + nf * h * h * h * h * h) + 6 * (2 * f * c * h * c + f * h * h * h * c + nf * c * c * c + 3 * nf * c * h * h * c + nf * h * h * h * h * c);

            c = ChanceExtraCPPerHit + ChanceOnCPOnSSCrit * SStrikeStats.CritChance; h = (1f - c);
            _averageSStrikeCP[1] = 1 * (f + nf * h) + 2 * (nf * c);
            _averageSStrikeCP[2] = 2 * (f * h + nf * c + nf * h * h) + 3 * (f * c + nf * h * c);
            _averageSStrikeCP[3] = 3 * (f * c + f * h * h + 2 * nf * c * h + nf * h * h * h) + 4 * (f * h * c + nf * c * c + nf * h * h * c);
            _averageSStrikeCP[4] = 4 * (2 * f * c * h + f * h * h * h + nf * c * c + 3 * nf * c * h * h + nf * h * h * h * h) + 5 * (f * c * c + f * h * h * c + 2 * nf * c * h * c + nf * h * h * h * c);
            _averageSStrikeCP[5] = 5 * (f * c * c + 3 * f * c * h * h + f * h * h * h * h + 3 * nf * c * c * h + 4 * nf * c * h * h * h + nf * h * h * h * h * h) + 6 * (2 * f * c * h * c + f * h * h * h * c + nf * c * c * c + 3 * nf * c * h * h * c + nf * h * h * h * h * c);
            #endregion
        }
开发者ID:LucasPeacecraft,项目名称:rawr,代码行数:32,代码来源:RogueRotationCalculatorCombat.cs

示例4: TreeStats

        public TreeStats(Character character, Stats stats, KeyValuePair<double, SpecialEffect>[] hasteProcs, double treeOfLifeUptime)
        {
            CalculationOptionsTree opts = character.CalculationOptions as CalculationOptionsTree;

            bool Restoration = (opts != null) ? opts.Restoration : true;

            Haste = new HasteStats(stats, hasteProcs);

            SpellCrit = StatConversion.GetSpellCritFromIntellect(stats.Intellect) + StatConversion.GetSpellCritFromRating(stats.CritRating) + stats.SpellCrit;

            SpellPower = (float)(stats.SpellPower + Math.Max(0f, stats.Intellect - 10));
            // TODO: does nurturing instinct actually work like this?
            SpellPower += character.DruidTalents.NurturingInstinct * 0.5 * stats.Agility;
            SpellPower *= (1 + stats.BonusSpellPowerMultiplier);

            TreeOfLifeUptime = treeOfLifeUptime;
            double mastery = 8.0f + StatConversion.GetMasteryFromRating(stats.MasteryRating);
            if(Restoration)
                Harmony = mastery * 0.0125f;

            SpellsManaCostReduction = stats.SpellsManaCostReduction + stats.NatureSpellsManaCostReduction;
            BonusCritHealMultiplier = stats.BonusCritHealMultiplier;

            PassiveDirectHealBonus = (Restoration ? 1.25f : 1.0f) + Harmony;
            PassivePeriodicHealBonus = (Restoration ? 1.25f : 1.0f) + opts.HarmonyPeriodicRate * Harmony + 0.02f * character.DruidTalents.Genesis;
            DirectHealMultiplier = (1 + stats.BonusHealingDoneMultiplier) * (1.0f + character.DruidTalents.MasterShapeshifter * 0.04f) * (1 + TreeOfLifeUptime * 0.15f);
            PeriodicHealMultiplier = DirectHealMultiplier * (1 + stats.BonusPeriodicHealingMultiplier);
            SpellsManaCostMultiplier = 1 - stats.ManaCostReductionMultiplier;

            Healed = stats.Healed + stats.HealedPerSP * SpellPower;
        }
开发者ID:LucasPeacecraft,项目名称:rawr,代码行数:31,代码来源:CharacterCalculationsTree.cs

示例5: AbilityScores

 public AbilityScores(Stats stats)
 {
     if (stats == null) {
         throw new ArgumentNullException("stats");
     }
     this.stats = stats;
 }
开发者ID:JazzFisch,项目名称:DnD4eCM,代码行数:7,代码来源:AbilityScores.cs

示例6: Client

        public Client(ClientIdentifier id)
        {
            Id = id;

            var stats = new Stats { Atk = 10, Def = 10, HP = 30, SpAtk = 10, SpDef = 10, Speed = 10 };
            var data = new PokemonData { Id = 0, Type1 = PokemonType.Normal, BaseStats = stats };

            var moveData = new MoveData
            {
                Name = "Move",
                Accuracy = 100,
                Damage = 120,
                DamageType = DamageCategory.Physical,
                PokemonType = PokemonType.Normal,
                PP = 20
            };

            for (int i = 0; i < 6; i++)
            {
                var pkmn = new Pokemon(data, stats) { Name = Id.Name + "_Pkmn" + i, Level = i + 20};
                for (int j = 0; j < 2; j++)
                    pkmn.SetMove(j, new Move(moveData));
                pkmn.Stats.HP = 30;
                pkmn.HP = 30;

                pokemons.Add(pkmn);
            }
        }
开发者ID:Nexus87,项目名称:PokeClone,代码行数:28,代码来源:Client.cs

示例7: Start

	// Use this for initialization
	void Start () {
        //stat = new Stats(100f,1f,1f,1f,1f,1f,1f);
        stat = new Stats();

        currentDivinity = stat.playerDivinity;
	
	}
开发者ID:EOTD,项目名称:Err-of-the-Divine,代码行数:8,代码来源:Player.cs

示例8: CharacterCalculationsWarlock

        /// <param name="stats">
        /// This should already have buffStats factored in.
        /// </param>
        public CharacterCalculationsWarlock(Character character, Stats stats, Stats petBuffs)
        {
            Character = character;
            CalcOpts = character.CalculationOptions as CalculationOptionsWarlock;
            BossOpts = character.BossOptions;
            Talents = character.WarlockTalents;
            Stats = stats;
            PreProcStats = Stats.Clone();
            PetBuffs = petBuffs;
            BaseMana = BaseStats.GetBaseStats(character).Mana;
            BaseIntellect = BaseStats.GetBaseStats(character).Intellect;
            Spells = new Dictionary<string, Spell>();
            CastSpells = new Dictionary<string, Spell>();
            HitChance = Math.Min(1f, CalcOpts.GetBaseHitRate() / 100f + CalcSpellHit());

            int temp;
            if (character.SetBonusCount.TryGetValue("Shadowflame Regalia", out temp))
            {
                Warlock_T11_2P = (temp >= 2);
                Warlock_T11_4P = (temp >= 4);
            }

            if (!CalcOpts.Pet.Equals("None") && (Demonology || !CalcOpts.Pet.Equals("Felguard")))
            {
                Type type = Type.GetType("Rawr.Warlock." + CalcOpts.Pet);
                Pet = (Pet)Activator.CreateInstance(type, new object[] { this });
            }

            float personalDps = CalcPersonalDps();
            float petDps = CalcPetDps();
            SubPoints = new float[] { personalDps, petDps };
            OverallPoints = personalDps + petDps;
        }
开发者ID:LucasPeacecraft,项目名称:rawr,代码行数:36,代码来源:CharacterCalculationsWarlock.cs

示例9: OnEnable

 void OnEnable()
 {
     myStats = GetComponentInParent<Stats> ();
     if (myStats)
         this.AddObserver (OnCounterWillChange, Stats.WillChangeNotification (StatTypes.CTR), myStats);
     this.AddObserver (OnAutomaticHitCheck, HitRate.AutomaticHitCheckNotification);
 }
开发者ID:arthurwoo,项目名称:TaticsHero,代码行数:7,代码来源:StopStatusEffect.cs

示例10: OnTriggerEnter

    public void OnTriggerEnter(Collider col)
    {
        if(col.gameObject.GetComponent(typeof(Movement_Controller)) as Movement_Controller != null)
        {
            playerItemPickUp = col.transform.FindChild("ItemPickUp").transform;
            control = col.gameObject.GetComponent(typeof(Movement_Controller)) as Movement_Controller;

            if(type == ItemType.Gun)
                control.usingGun = true;

            if(type == ItemType.Useable)
            {
                //The useable item script should be attached to this Object.
                this.gameObject.transform.parent = control.transform;
                control.SpacebarItem = GetComponent(typeof(UseableItem)) as UseableItem;
                control.SpacebarItem.controller = control;
            }
            playerStats = col.gameObject.GetComponent(typeof(Stats)) as Stats;

            if(playerStats.GetHealth() == playerStats.Health && type == ItemType.HealthPotion)
            {
                direction = control.preMovement;
                rigidbody.AddForce(direction * 1000f);
                return;
            }
            player = control.player;	//Bone animation reference
            pItem = col.gameObject.GetComponent(typeof(PlayerItems)) as PlayerItems;
            iEvent.ItemEvent(playerStats);
            myItem.SetActiveRecursively(false);
            StartCoroutine(GrabItem() );
        }
    }
开发者ID:imcanida,项目名称:grimloc_MainRepo,代码行数:32,代码来源:ItemPickUpTrigger.cs

示例11: CombatFactors

        public CombatFactors(Character character, Stats stats) {
            _stats = stats;
			_mainHand = character.MainHand == null ? new Knuckles() : character.MainHand.Item;
			_offHand = character.OffHand == null ? new Knuckles() : character.OffHand.Item;
            _calcOpts = character.CalculationOptions as CalculationOptionsRogue;
            _character = character;
        }
开发者ID:LucasPeacecraft,项目名称:rawr,代码行数:7,代码来源:CombatFactors.cs

示例12: InitializeUI

 void InitializeUI(Stats stats)
 {
     name.text = stats.characterName;
     maxHP.text = '/' + stats.maxHP.ToString();
     maxSP.text = '/' + stats.maxSP.ToString();
     UpdateLifebar(stats);
 }
开发者ID:jrand35,项目名称:Ed-Edd-n-Eddy-RPG,代码行数:7,代码来源:BattleUI.cs

示例13: Start

 void Start()
 {
     characterArgs = null;
     foreach (Character character in Characters)
     {
         character.Parent = CharacterObject;
     }
     //TODO: Do Characters and Enemies need to be used as IList<Battler>?
     battleBox.AllCharacters = Characters;
     battleBox.AllEnemies = Enemies;
     foreach (Enemy enemy in Enemies)
     {
         enemy.Parent = EnemyObject;
     }
     if (Characters.Count == 0)
     {
         Debug.Log("Error: No ememies");
     }
     foreach (IBattler c in Characters)
     {
         playerStats = c.Stats;
     }
     battleEnd = false;
     wait = false;
     if (InitializeUI != null)
     {
         InitializeUI(playerStats);
     }
     StartCoroutine(Run());
 }
开发者ID:jrand35,项目名称:Ed-Edd-n-Eddy-RPG,代码行数:30,代码来源:BattleController.cs

示例14: OnEnable

 public void OnEnable()
 {
     stat_templates.Add("Default", new Stats("Default"));
     Stats defr = new Stats("DefaultR");
     defr.can_range = true;
     stat_templates.Add("DefaultR", defr);
 }
开发者ID:StoneLionStudios,项目名称:TurnOfWar,代码行数:7,代码来源:Stats_Library.cs

示例15: UpdateStats

    public void UpdateStats(Stats NewStats)
    {
        CharacterStats = NewStats;

        Health = MaxHealth = CalculateMaxHeatlh(CharacterStats.Strength, CharacterStats.Dexterity);
        Mana = MaxMana = CalculateMaxMana(CharacterStats.Wisdom);
    }
开发者ID:DevChagrins,项目名称:SixMonthRPG,代码行数:7,代码来源:Character.cs


注:本文中的Stats类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。