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

C# eProperty类代码示例

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

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



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

示例1: CalcValue

        public override int CalcValue(GameLiving living, eProperty property)
        {
            int percent = 100
                +living.BaseBuffBonusCategory[(int)property];

            return percent;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:7,代码来源:Battlemaster.cs


示例2: CalcValue

		public override int CalcValue(GameLiving living, eProperty property) 
		{
			if (living is GamePlayer) 
			{
				GamePlayer player = living as GamePlayer;
				if (player.CharacterClass.ManaStat == eStat.UNDEFINED) 
                    return 1000000;

				int concBase = (int)((player.Level * 4) * 2.2);
				int stat = player.GetModified((eProperty)player.CharacterClass.ManaStat);
				int factor = (stat > 50) ? (stat - 50) / 2 : (stat - 50);
				int conc = (concBase + concBase * factor / 100) / 2;
				conc = (int)(player.Effectiveness * (double)conc);

				if (conc < 0)
				{
					if (log.IsWarnEnabled)
						log.WarnFormat(living.Name+": concentration is less than zerro (conc:{0} eff:{1:R} concBase:{2} stat:{3} factor:{4})", conc, player.Effectiveness, concBase, stat, factor);
					conc = 0;
				}

                if (player.GetSpellLine("Perfecter") != null
				   && player.MLLevel >= 4)
                    conc += (20 * conc / 100);

				return conc;
			} 
			else 
			{
				return 1000000;	// default
			}
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:32,代码来源:MaxConcentrationCalculator.cs


示例3: CalcValue

        public override int CalcValue(GameLiving living, eProperty property)
        {
            int propertyIndex = (int)property;

            // Base stats/abilities/debuffs/death.

            int baseStat = living.GetBaseStat((eStat)property);
            int abilityBonus = living.AbilityBonus[propertyIndex];
            int debuff = living.DebuffCategory[propertyIndex];
			int deathConDebuff = 0;

            int itemBonus = CalcValueFromItems(living, property);
            int buffBonus = CalcValueFromBuffs(living, property);

			// Special cases:
			// 1) ManaStat (base stat + acuity, players only).
			// 2) As of patch 1.64: - Acuity - This bonus will increase your casting stat, 
			//    whatever your casting stat happens to be. If you're a druid, you should get an increase to empathy, 
			//    while a bard should get an increase to charisma.  http://support.darkageofcamelot.com/kb/article.php?id=540
			// 3) Constitution lost at death, only affects players.

			if (living is GamePlayer)
			{
				GamePlayer player = living as GamePlayer;
				if (property == (eProperty)(player.CharacterClass.ManaStat))
				{
					if (player.CharacterClass.ID != (int)eCharacterClass.Scout && player.CharacterClass.ID != (int)eCharacterClass.Hunter && player.CharacterClass.ID != (int)eCharacterClass.Ranger)
					{
						abilityBonus += player.AbilityBonus[(int)eProperty.Acuity];
					}
				}

				deathConDebuff = player.TotalConstitutionLostAtDeath;
			}

			// Apply debuffs, 100% effectiveness for player buffs, 50% effectiveness
			// for item and base stats

			int unbuffedBonus = baseStat + itemBonus;
			buffBonus -= Math.Abs(debuff);

			if (buffBonus < 0)
			{
				unbuffedBonus += buffBonus / 2;
				buffBonus = 0;
				if (unbuffedBonus < 0)
					unbuffedBonus = 0;
			}

			// Add up and apply any multiplicators.

			int stat = unbuffedBonus + buffBonus + abilityBonus;
			stat = (int)(stat * living.BuffBonusMultCategory1.Get((int)property));

			// Possibly apply constitution loss at death.

			stat -= (property == eProperty.Constitution)? deathConDebuff : 0;

			return Math.Max(1, stat);
        }
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:60,代码来源:StatCalculator.cs


示例4: CalcValue

		public override int CalcValue(GameLiving living, eProperty property) 
		{
//			DOLConsole.WriteSystem("calc skill prop "+property+":");
			if (living is GamePlayer) 
			{
				GamePlayer player = (GamePlayer)living;

				int itemCap = player.Level/5+1;

				int itemBonus = player.ItemBonus[(int)property];

				if (SkillBase.CheckPropertyType(property, ePropertyType.SkillMeleeWeapon))
					itemBonus += player.ItemBonus[(int)eProperty.AllMeleeWeaponSkills];
				if (SkillBase.CheckPropertyType(property, ePropertyType.SkillMagical))
					itemBonus += player.ItemBonus[(int)eProperty.AllMagicSkills];
				if (SkillBase.CheckPropertyType(property, ePropertyType.SkillDualWield))
					itemBonus += player.ItemBonus[(int)eProperty.AllDualWieldingSkills];
				if (SkillBase.CheckPropertyType(property, ePropertyType.SkillArchery))
					itemBonus += player.ItemBonus[(int)eProperty.AllArcherySkills];

				itemBonus += player.ItemBonus[(int)eProperty.AllSkills];

				if (itemBonus > itemCap)
					itemBonus = itemCap;
				int buffs = player.BaseBuffBonusCategory[(int)property]; // one buff category just in case..

//				DOLConsole.WriteLine("item bonus="+itemBonus+"; buffs="+buffs+"; realm="+player.RealmLevel/10);
				return itemBonus + buffs + player.RealmLevel/10;
			} 
			else 
			{
				// TODO other living types
			}
			return 0;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:35,代码来源:SkillLevelCalculator.cs


示例5: CalcValue

        /// <summary>
        /// Calculate the actual resist amount for the given living and the given
        /// resist type, applying all possible caps and cap increases.
        /// </summary>
        /// <param name="living">The living the resist amount is to be determined for.</param>
        /// <param name="property">The resist type.</param>
        /// <returns>The actual resist amount.</returns>
        public override int CalcValue(GameLiving living, eProperty property)
        {
            int propertyIndex = (int)property;

            // Abilities/racials/debuffs.

            int debuff = living.DebuffCategory[propertyIndex];
			int abilityBonus = living.AbilityBonus[propertyIndex];
			int racialBonus = SkillBase.GetRaceResist( living.Race, (eResist)property );

            // Items and buffs.

            int itemBonus = CalcValueFromItems(living, property);
            int buffBonus = CalcValueFromBuffs(living, property);

            // Apply debuffs. 100% Effectiveness for player buffs, but only 50%
            // effectiveness for item bonuses.

            buffBonus -= Math.Abs(debuff);

            if (buffBonus < 0)
            {
                itemBonus += buffBonus / 2;
                buffBonus = 0;
                if (itemBonus < 0)
                    itemBonus = 0;
            }

            // Add up and apply hardcap.

            return Math.Min(itemBonus + buffBonus + abilityBonus + racialBonus, HardCap);
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:39,代码来源:ResistCalculator.cs


示例6: CalcValue

		public override int CalcValue(GameLiving living, eProperty property) 
		{
			/* PATCH 1.87 COMBAT AND REGENERATION
			  - While in combat, health and power regeneration ticks will happen twice as often.
    		  - Each tick of health and power is now twice as effective.
              - All health and power regeneration aids are now twice as effective.
             */

			double regen = 5 + (living.Level / 2.75);

			if (living is GameNPC && living.InCombat)
				regen /= 2.0;

			// tolakram - there is no difference per tic between combat and non combat

			if (regen != 0 && ServerProperties.Properties.MANA_REGEN_RATE != 1)
				regen *= ServerProperties.Properties.MANA_REGEN_RATE;

			double decimals = regen - (int)regen;
			if (Util.ChanceDouble(decimals)) 
			{
				regen += 1;	// compensate int rounding error
			}

			int debuff = living.SpecBuffBonusCategory[(int)property];
			if (debuff < 0)
				debuff = -debuff;

			regen += living.BaseBuffBonusCategory[(int)property] + living.AbilityBonus[(int)property] + living.ItemBonus[(int)property] - debuff;

			if (regen < 1)
				regen = 1;

			return (int)regen;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:35,代码来源:PowerRegenerationRateCalculator.cs


示例7: CalcValue

		public override int CalcValue(GameLiving living, eProperty property)
		{
			return Math.Max(1, 100
				- living.BaseBuffBonusCategory[(int)property] // less is faster = buff
				+ living.DebuffCategory[(int)property] // more is slower = debuff
				- Math.Min(10, living.ItemBonus[(int)property])); // ?
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:7,代码来源:FatigueConsumptionPercentCalculator.cs


示例8: CalcValue

 public override int CalcValue(GameLiving living, eProperty property)
 {
     if (living is GamePlayer)
     {
         return living.ItemBonus[(int)property];
     }
     return 0;
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:8,代码来源:MythicalSafeFallCalculator.cs


示例9: CalcValue

 public override int CalcValue(GameLiving living, eProperty property)
 {
     return (int)(
         +living.BaseBuffBonusCategory[(int)property]
         + living.SpecBuffBonusCategory[(int)property]
         - living.DebuffCategory[(int)property]
         + living.BuffBonusCategory4[(int)property]);
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:8,代码来源:WaterSpeedCalculator.cs


示例10: PropertyCalculatorAttribute

 /// <summary>
 /// Constructs a new calculator attribute for range of properties
 /// </summary>
 /// <param name="min">The lowest property in range</param>
 /// <param name="max">The highest property in range</param>
 public PropertyCalculatorAttribute(eProperty min, eProperty max)
 {
     if (min > max)
         throw new ArgumentException("min property is higher than max (min=" + (int)min + " max=" + (int)max + ")");
     if (min < 0 || max > eProperty.MaxProperty)
         throw new ArgumentOutOfRangeException("max", (int)max, "property must be in 0 .. eProperty.MaxProperty range");
     m_min = min;
     m_max = max;
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:14,代码来源:PropertyCalculatorAttribute.cs


示例11: CalcValue

		public override int CalcValue(GameLiving living, eProperty property)
		{
			// Hardcap 10%
			int percent = Math.Min(10, living.BaseBuffBonusCategory[(int)property]
				-living.DebuffCategory[(int)property]
				+living.ItemBonus[(int)property]);

			return percent;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:9,代码来源:RangedDamagePercentCalculator.cs


示例12: CalcValue

        public override int CalcValue(GameLiving living, eProperty property)
        {
            GamePlayer player = living as GamePlayer;
            if(player == null)
            {
                return 0;
            }

            return Math.Min(living.ItemBonus[(int) property], 25);
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:10,代码来源:ArcaneSyphonCalculator.cs


示例13: CalcValue

		public override int CalcValue(GameLiving living, eProperty property)
		{
			double percent = 100
			+ living.BaseBuffBonusCategory[(int)property] // enchance the weaponskill
			+ living.SpecBuffBonusCategory[(int)property] // enchance the weaponskill
				//hotfix for poisons where both debuff components have same value
			- (int)(living.DebuffCategory[(int)property] / 5.4) // reduce
		   + living.ItemBonus[(int)property];
			return (int)Math.Max(1, percent);
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:10,代码来源:WeaponSkillCalculator.cs


示例14: CalcValue

		public override int CalcValue(GameLiving living, eProperty property)
		{
			return (int)(
				+living.BaseBuffBonusCategory[(int)property]
				+ living.SpecBuffBonusCategory[(int)property]
				- living.DebuffCategory[(int)property]
				+ living.BuffBonusCategory4[(int)property]
				+ living.AbilityBonus[(int)property]
				+ Math.Min(10, living.ItemBonus[(int)property]));
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:10,代码来源:SpellLevelCalculator.cs


示例15: CalcValue

		/// <summary>
		/// calculates the final property value
		/// </summary>
		/// <param name="living"></param>
		/// <param name="property"></param>
		/// <returns></returns>
		public override int CalcValue(GameLiving living, eProperty property)
		{
			if (living.IsDiseased)
				return 0; // no HP regen if diseased
			if (living is GameKeepDoor)
				return (int)(living.MaxHealth * 0.05); //5% each time for keep door

			double regen = 1;

			/* PATCH 1.87 COMBAT AND REGENERATION
			  - While in combat, health and power regeneration ticks will happen twice as often.
    		  - Each tick of health and power is now twice as effective.
              - All health and power regeneration aids are now twice as effective.
             */

			if (living.Level < 26)
			{
				regen = 10 + (living.Level * 0.2);
			}
			else
			{
				regen = living.Level * 0.6;
			}

			// assumes NPC regen is now half as effective as GamePlayer (as noted above) - tolakram
			// http://www.dolserver.net/viewtopic.php?f=16&t=13197

			if (living is GameNPC)
			{
				if (living.InCombat)
					regen /= 2.0;
			}
            
			if (regen != 0 && ServerProperties.Properties.HEALTH_REGEN_RATE != 1)
				regen *= ServerProperties.Properties.HEALTH_REGEN_RATE;

			double decimals = regen - (int)regen;
			if (Util.ChanceDouble(decimals)) 
			{
				regen += 1;	// compensate int rounding error
			}

			regen += living.ItemBonus[(int)property];

			int debuff = living.SpecBuffBonusCategory[(int)property];
			if (debuff < 0)
				debuff = -debuff;

			regen += living.BaseBuffBonusCategory[(int)property] - debuff;

			if (regen < 1)
				regen = 1;

			return (int)regen;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:61,代码来源:HealthRegenerationRateCalculator.cs


示例16: CalcValue

 public override int CalcValue(GameLiving living, eProperty property)
 {
     int chance = 0;
     if (living is GamePlayer)
     {
         if ((living as GamePlayer).CharacterClass.ClassType == eClassType.ListCaster)
             chance += 10;
     }
     chance += living.AbilityBonus[(int)property];
     return Math.Min(chance, 50);
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:CriticalSpellHitChanceCalculator.cs


示例17:

		public int this[eProperty index]
		{
			get
			{
				return this[(int)index];
			}
			set
			{
				this[(int)index] = value;
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:11,代码来源:PropertyIndexer.cs


示例18: CalcValue

		public override int CalcValue(GameLiving living, eProperty property) 
		{
			int debuff = living.DebuffCategory[(int)property];
			if(debuff > 0)
			{
				GameSpellEffect nsreduction = SpellHandler.FindEffectOnTarget(living, "NearsightReduction");
				if(nsreduction!=null) debuff *= (int)(1.00 - nsreduction.Spell.Value * 0.01);
			}
			int buff = CalcValueFromBuffs(living, property);
		    int item = CalcValueFromItems(living, property);
		    return Math.Max(0, 100 + (buff + item) - debuff);
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:12,代码来源:SpellRangePercentCalculator.cs


示例19: CalcValue

        public override int CalcValue(GameLiving living, eProperty property)
        {
            //hardcap at 10%
            int itemPercent = Math.Min(10, living.ItemBonus[(int)property]);
            int debuffPercent = Math.Min(10, living.DebuffCategory[(int)property]);
            int percent = living.BaseBuffBonusCategory[(int)property] + living.SpecBuffBonusCategory[(int)property] + itemPercent - debuffPercent;

            // Apply RA bonus
            percent += living.AbilityBonus[(int)property];

            return percent;
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:MeleeDamagePercentCalculator.cs


示例20: CalcValue

		public override int CalcValue(GameLiving living, eProperty property)
		{
			if (living is GamePlayer)
			{
				GamePlayer player = living as GamePlayer;

				int endurance = player.DBMaxEndurance;
				endurance += (int)(endurance * (Math.Min(15, living.ItemBonus[(int)property]) * .01));
				return endurance;
			}

			return 100;
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:13,代码来源:FatigueCalculator.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# eRealm类代码示例发布时间:2022-05-24
下一篇:
C# eInventorySlot类代码示例发布时间: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