• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Stats类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Start

 protected void Start()
 {
     if (mutationName != "" && this.gameObject.GetComponent<Mutations>() != null) { //If you levae a mutationName empty it will not account for it, so use this if you want non-tranferable mutations
         if (!this.gameObject.GetComponent<Mutations>().mutations.Contains(mutationName)) {
             this.gameObject.GetComponent<Mutations>().mutations.Add(mutationName); //adds mutation to this bacteria's current list of mutations
         }
         List<string> wedge;
     }
     stats = this.gameObject.GetComponent<Stats> ();
     MutationInstance = null;
     if (MutationObject != null) {
         MutationInstance =(GameObject)Instantiate (MutationObject);
         Vector3 ang = transform.eulerAngles; //holds current rotation for simple no-math solution
         Vector3 scale = transform.localScale;
         transform.localScale = Vector3.one;
         transform.eulerAngles = Vector3.zero;
         MutationInstance.transform.position = new Vector3(transform.position.x + MutationInstance.transform.position.x,transform.position.y + MutationInstance.transform.position.y,transform.position.z + MutationInstance.transform.position.z);
         MutationInstance.transform.SetParent(this.gameObject.transform); //attaches the new mutation to its owner
         transform.eulerAngles = ang;
         transform.localScale = scale;
     }
     //all set changes for mutations from public input are made onto the cell's stats
     stats.maxHealth += maxHealth;
     stats.metabolism += metabolism;
     stats.maturation += maturation;
     stats.reproductionEfficiency += reproductionEfficiency;
     stats.aggression += aggression;
     stats.herbivorism += herbivorism;
     stats.carnivoreism += carnivoreism;
     stats.sightRadius += sightRadius;
     stats.damage += damage;
     stats.speed += speed;
     stats.healing += healing;
     stats.notifyInitialized(this);
 }
开发者ID:ab9x3jhx6a,项目名称:Game4,代码行数:35,代码来源:Mutation.cs


示例17: OnStatsHPChange

 void OnStatsHPChange(Stats stat, float delta) {
     if(mEnt.gameObject.activeInHierarchy) {
         if(stat.curHP > 0.0f && delta < 0.0f) {
             mEnt.Blink(blinkDelay);
         }
     }
 }
开发者ID:PushoN,项目名称:game-off-2013,代码行数:7,代码来源:EntityDamageBlinkerSprite.cs


示例18: DKDPS

        public DKDPS()
        {
            // TODO: Add constructor logic here

            weap = new Stats();
            weap.Strength = 10;
            weap.CritRating = 500;
            weapon = new Item("test", ItemQuality.Common, ItemType.OneHandSword, 10101, "icon.bmp", ItemSlot.OneHand, "", false,
                weap, weap, ItemSlot.None, ItemSlot.None, ItemSlot.None, 100, 200, ItemDamageType.Physical, 3.8f, "Death Knight");

            m_char = new Character();
            string szXML = System.IO.File.ReadAllText("..\\..\\..\\..\\Rawr\\Rawr.UnitTests\\testdata\\~Test_Rawr4_Unholy2h.xml");
//            string szXML = System.IO.File.ReadAllText("..\\..\\..\\..\\Rawr\\Rawr.UnitTests\\testdata\\~Test_Rawr4_Frost2h.xml");
            m_char = Character.LoadFromXml(szXML);
            if (m_char.Class == CharacterClass.Druid)
            {
                // This means it didn't load properly.
                m_char.Class = CharacterClass.DeathKnight;
                // So a weapon, so we have values in weapon specific abilities.
                m_char.MainHand = new ItemInstance(weapon, 0, null, null, null, new Enchant(), new Reforging(), new Tinkering());
                // Unholy DK
                m_char.DeathKnightTalents = new DeathKnightTalents("203200000000000000002000000000000000000003310321231031021231.010000001010100000010010000111");
            }
            m_char.CurrentModel = "DPSDK";

        }
开发者ID:LucasPeacecraft,项目名称:rawr,代码行数:26,代码来源:DKDPS.cs


示例19: Main

    public static void Main(string[] args)
    {
        int simCount = 5000;
        if (args.Length == 1)
            simCount = int.Parse(args[0]);

        Deck d = new Deck();
        PokerHand hand = new PokerHand(d);

        Stats stats = new Stats();
        stats.simCount = simCount;
        for (int i=0;i<simCount;i++)
        {
            // worry counter
            if ((i%1000)==0)
                Console.Write("*");
            d.shuffle();
            hand.pullCards();
            hand.Sort();
            POKERSCORE ps = PokerLogic.score(hand);
            stats.Append(ps);
        }
        Console.WriteLine();
        stats.Report();
    }
开发者ID:ramonliu,项目名称:poker-miranda,代码行数:25,代码来源:PokerLogic.cs


示例20: GetStats

 public Stats GetStats()
 {
     if (stats == null){
         stats = gameObject.GetComponentInParent<Stats>();
     }
     return stats;
 }
开发者ID:MylesBell,项目名称:Unity,代码行数:7,代码来源:AllPlay.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# StatsObserver类代码示例发布时间:2022-05-24
下一篇:
C# Statistics类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap