本文整理汇总了C#中DamageType类的典型用法代码示例。如果您正苦于以下问题:C# DamageType类的具体用法?C# DamageType怎么用?C# DamageType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DamageType类属于命名空间,在下文中一共展示了DamageType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Call
public virtual float Call(Character caster, Character other,
DamageType damageType, float value)
{
if(caster == null)
return value;
return effect(caster, other, damageType, value);
}
示例2: Weapon
public Weapon(int mDmg, float dmgV, float mRange, DamageType dt)
{
_maxDamage = mDmg;
_dmgVar = dmgV;
_maxRange = mRange;
_dmgType = dt;
}
示例3: Weapon
public Weapon(int maxDmg, float dmgVar, float maxRange, DamageType dmgType)
{
_maxDamage = maxDmg;
_damageVariance = dmgVar;
_maxRange = maxRange;
_dmgType = dmgType;
}
示例4: SetArmorValue
public void SetArmorValue(DamageType damType, int value)
{
if (armorStats.ContainsKey(damType))
armorStats[damType] = value;
else
armorStats.Add(damType, value);
}
示例5: GetMinionTarget
public static Obj_AI_Minion GetMinionTarget(float range, DamageType damagetype, bool isSkillShot = false, bool isAlly = false, bool isMonster = false, float ksdamage = -1)
{
var teamtype = EntityManager.UnitTeam.Enemy;
if (isAlly)
teamtype = EntityManager.UnitTeam.Ally;
var miniontype = EntityManager.MinionsAndMonsters.GetLaneMinions(teamtype, Champion.ServerPosition, range).ToArray();
if (isMonster)
miniontype = EntityManager.MinionsAndMonsters.GetJungleMonsters(Champion.ServerPosition, range).ToArray();
// Check list objects
if (miniontype.Length == 0) return null;
var target = miniontype
.OrderByDescending(a => a.HealthPercent)
.FirstOrDefault(a => a.IsValidTarget(range) && ((isAlly && a.IsAlly) || (!isAlly && a.IsEnemy))
&& ((isMonster && a.IsMonster) || (!isMonster && !a.IsMonster))
&& !a.IsDead && !a.IsZombie
&& TargetStatus(a)
&& (!isSkillShot || WillQHitEnemy(a))
&& ((ksdamage > -1 && a.Health <= Champion.CalculateDamageOnUnit(a, damagetype, ksdamage)) || ksdamage == -1)
&& !Champion.IsRecalling()
&& a.Distance(Champion) <= range);
return target;
}
示例6: Weapon
public Weapon()
{
this.id = -1;
this.name = "Empty Handed";
this.Equippable = false;
this.weight = 0;
this.value = 0;
this.speed = 0;
this.speedbonus = 0;
this.strengthbonus = 0;
this.hpbonus = 0;
this.damage = 0;
this.type = ItemType.Weapon;
this.damageType = DamageType.Crushing;
protection = new Dictionary<DamageType, int>();
foreach (DamageType type in Enum.GetValues(typeof(DamageType)))
{
protection[type] = 0;
}
bonus = new Dictionary<Stat, int>();
foreach (Stat stat in Enum.GetValues(typeof(Stat)))
{
bonus[stat] = 0;
}
}
示例7: vp_DamageInfo
/// <summary>
///
/// </summary>
public vp_DamageInfo(float damage, Transform source, Transform originalSource, DamageType type = DamageType.Unknown)
{
Damage = damage;
Source = source;
OriginalSource = originalSource;
Type = type;
}
示例8: Weapon
public Weapon()
{
_maxDamage = 0;
_dmgVar = 0;
_maxRange = 0;
_dmgType = DamageType.Heavy;
}
示例9: DamageInfo
/// <summary>
/// Initializes a new instance of the <see cref="PlatformerPro.DamageInfo"/> class.
/// </summary>
/// <param name="amount">Amount.</param>
/// <param name="damageType">Damage type.</param>
/// <param name="direction">Direction.</param>
public DamageInfo(int amount, DamageType damageType, Vector2 direction, IMob damageCauser)
{
Amount = amount;
DamageType = damageType;
Direction = direction;
DamageCauser = damageCauser;
}
示例10: DamageHistoryItem
public DamageHistoryItem(Entity damager, int amount, DamageType damType)
{
Damager = damager;
Amount = amount;
DamType = damType;
When = DateTime.Now;
}
示例11: GetCalculatedDamage
private static float GetCalculatedDamage(Obj_AI_Base target, DamageType type, float rawdamage)
{
var damage = 0f;
damage += target.CalculateDamageOnUnit(target, type, rawdamage);
return damage;
}
示例12: RangedAttackSkill
public RangedAttackSkill(int entityId, int level, DamageType damageType, string textureResourceId = "ranged_attack_skill_icon")
: base(SkillType.RangedAttack, entityId, level, true, false)
{
_range = 8f;
_damageType = damageType;
_textureResourceId = textureResourceId;
}
示例13: Damage
public Damage(DamageType type, int value, int armorPenetration, int shieldPenetration)
{
this.type = type;
this.value = value;
this.armorPenetration = armorPenetration;
this.shieldPenetration = shieldPenetration;
}
示例14: OnDamage
public override void OnDamage(float damage, DamageType type)
{
Debug.DrawText(string.Format("Took {0} points of {1} damage", damage, type), 3, Color.White, 3);
if(OnDamaged != null)
OnDamaged(damage, type);
}
示例15: Call
public override float Call(Character caster, Character other,
DamageType damageType, float value)
{
var ae = generateEffect(caster, other, damageType, value, duration,
repeats, startEffect, endEffect);
return ae.EffectStart();
}