本文整理汇总了C#中DamageType类的典型用法代码示例。如果您正苦于以下问题:C# DamageType类的具体用法?C# DamageType怎么用?C# DamageType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DamageType类属于命名空间,在下文中一共展示了DamageType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Desocrit,项目名称:BoDCode,代码行数:7,代码来源:Effect.cs
示例2: Weapon
public Weapon(int mDmg, float dmgV, float mRange, DamageType dt)
{
_maxDamage = mDmg;
_dmgVar = dmgV;
_maxRange = mRange;
_dmgType = dt;
}
开发者ID:SeniorGameMaster,项目名称:sorcerest,代码行数:7,代码来源:Weapon.cs
示例3: Weapon
public Weapon(int maxDmg, float dmgVar, float maxRange, DamageType dmgType)
{
_maxDamage = maxDmg;
_damageVariance = dmgVar;
_maxRange = maxRange;
_dmgType = dmgType;
}
开发者ID:Nesh108,项目名称:MonoShoot,代码行数:7,代码来源:Weapon.cs
示例4: SetArmorValue
public void SetArmorValue(DamageType damType, int value)
{
if (armorStats.ContainsKey(damType))
armorStats[damType] = value;
else
armorStats.Add(damType, value);
}
开发者ID:millpond,项目名称:space-station-14,代码行数:7,代码来源:EntityStatsCompS.cs
示例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;
}
开发者ID:Sicryption,项目名称:EloBuddy-Addons,代码行数:25,代码来源:TargetManager.cs
示例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;
}
}
开发者ID:squimmy,项目名称:SimpleGame,代码行数:25,代码来源:Weapon.cs
示例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;
}
开发者ID:BHD7,项目名称:Ghost_Town_FPS_Zombies,代码行数:10,代码来源:vp_DamageInfo.cs
示例8: Weapon
public Weapon()
{
_maxDamage = 0;
_dmgVar = 0;
_maxRange = 0;
_dmgType = DamageType.Heavy;
}
开发者ID:lutfi99,项目名称:hacknslash,代码行数:7,代码来源:Weapon.cs
示例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;
}
开发者ID:Connorlc,项目名称:UnityProjects,代码行数:13,代码来源:DamageInfo.cs
示例10: DamageHistoryItem
public DamageHistoryItem(Entity damager, int amount, DamageType damType)
{
Damager = damager;
Amount = amount;
DamType = damType;
When = DateTime.Now;
}
开发者ID:MSylvia,项目名称:space-station-14,代码行数:7,代码来源:DamageableComponent.cs
示例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;
}
开发者ID:HeheheM,项目名称:EloBuddy-2,代码行数:7,代码来源:DamageLib.cs
示例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;
}
开发者ID:klutch,项目名称:Loderpit,代码行数:7,代码来源:RangedAttackSkill.cs
示例13: Damage
public Damage(DamageType type, int value, int armorPenetration, int shieldPenetration)
{
this.type = type;
this.value = value;
this.armorPenetration = armorPenetration;
this.shieldPenetration = shieldPenetration;
}
开发者ID:ReaLgressA,项目名称:SpaceImpactDemo,代码行数:7,代码来源:Weapon.cs
示例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);
}
开发者ID:vblanco20-1,项目名称:AngryBoids,代码行数:7,代码来源:TankDamage.cs
示例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();
}
开发者ID:Desocrit,项目名称:BoDCode,代码行数:7,代码来源:TimedEffect.cs
示例16: AddPassiveAttack
private static void AddPassiveAttack(
string championName,
Func<AIHeroClient, Obj_AI_Base, bool> condition,
DamageType damageType,
Func<AIHeroClient, Obj_AI_Base, double> func,
bool ignoreCalculation = false,
bool @override = false)
{
var passive = new PassiveDamage
{
Condition = condition,
Func = func,
DamageType = damageType,
Override = @override,
IgnoreCalculation = ignoreCalculation
};
if (PassiveDamages.ContainsKey(championName))
{
PassiveDamages[championName].Add(passive);
return;
}
PassiveDamages.Add(championName, new List<PassiveDamage> { passive });
}
开发者ID:CONANLXF,项目名称:Berb.Common,代码行数:25,代码来源:DamagePassives.cs
示例17: Check
public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
{
if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
{
return true;
}
foreach (var invulnerable in Items)
{
if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
{
if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
{
if (!ignoreShields && invulnerable.IsShield && target.HasBuff(invulnerable.BuffName))
{
return true;
}
if (invulnerable.CustomCheck != null && CustomCheck(invulnerable, target, damageType))
{
return true;
}
}
}
}
return false;
}
开发者ID:understoodz,项目名称:LeagueSharp-Dev,代码行数:25,代码来源:Invulnerable.cs
示例18: ApplyExplosionDamage
/// <summary>
/// Applies explosion damage to a list of found colliders, but makes sure to apply damage only once to the same gameobject.
/// </summary>
/// <param name="colliders"></param>
/// <param name="amount"></param>
/// <param name="damageType"></param>
/// <param name="inflictor"></param>
public static void ApplyExplosionDamage(Collider[] colliders, int amount, DamageType damageType = DamageType.Explosion, GameObject inflictor = null)
{
List<GameObject> seen = new List<GameObject>();
DamageData dm = new DamageData(amount, damageType, inflictor);
IDamagable[] damagables;
IDamagable[] rigidBodyDamagables;
foreach (Collider coll in colliders)
{
if (seen.Contains(coll.gameObject))
continue;
seen.Add(coll.gameObject); // avoid applying damage twice to the IDamagable components on the same game object
damagables = coll.GetComponents(typeof (IDamagable)).Cast<IDamagable>().ToArray();
Array.ForEach(damagables, damagable => damagable.TakeDamage(dm)); ;
// Also apply damage to rigidbody of this collider, but only if they're different gameobjects (otherwise we already did)
if (coll.attachedRigidbody != null && !seen.Contains(coll.attachedRigidbody.gameObject))
{
seen.Add(coll.attachedRigidbody.gameObject);
rigidBodyDamagables = coll.attachedRigidbody.GetComponents(typeof(IDamagable)).Cast<IDamagable>().ToArray();
Array.ForEach(rigidBodyDamagables, damagable => damagable.TakeDamage(dm));
}
}
}
开发者ID:Clavus,项目名称:Tank,代码行数:34,代码来源:Damage.cs
示例19: Item
public Item(
string itemName = "Default",
ItemType itemType = ItemType.None,
StatSystem itemStats = null,
DamageType damageType = DamageType.None,
AmmoType itemShoots = AmmoType.None,
ItemQuality itemQuality = ItemQuality.None,
double value = 0.0,
int x = 0,
int y = 0,
int quantity = 1)
{
if (itemStats != null)
{
Stats = itemStats;
}
else
{
Stats = new StatSystem();
}
Name = itemName;
type = itemType;
ammo = itemShoots;
Count = quantity;
Quality = itemQuality;
damage = damageType;
Value = value;
MapX = x;
MapY = y;
}
开发者ID:insylogo,项目名称:SpriteStrife,代码行数:30,代码来源:Item.cs
示例20: Check
public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
{
try
{
if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
{
return true;
}
foreach (var invulnerable in Items)
{
if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
{
if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
{
if (!ignoreShields && invulnerable.IsShield && target.HasBuff(invulnerable.BuffName))
{
return true;
}
if (invulnerable.CustomCheck != null)
{
return CustomCheck(invulnerable, target, damageType);
}
}
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return false;
}
开发者ID:julianrolandi,项目名称:LeagueSharp-Dev,代码行数:32,代码来源:Invulnerable.cs
注:本文中的DamageType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论