本文整理汇总了C#中Unit.Damage方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.Damage方法的具体用法?C# Unit.Damage怎么用?C# Unit.Damage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Unit
的用法示例。
在下文中一共展示了Unit.Damage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Combat
public void Combat(Unit attacker, Unit defender)
{
if(attacker.Buffs.Exists(b => b is DeathTouchBuff))
defender.Kill();
else
defender.Damage(attacker.Attack);
if(!attacker.IsRanged()) {
if(defender.Buffs.Exists(b => b is DeathTouchBuff))
attacker.Kill();
else
attacker.Damage(defender.Attack);
}
attacker.Move(attacker.MovementLeft());
}
示例2: OnRemove
void OnRemove(Unit unit)
{
unit.Damage(int.MaxValue);
}
示例3: Enflamed
public Enflamed( Unit buffee, int amount = 2 )
: base( "On Fire", buffee, "Drop And Roll" ) {
stackable = false;
TurnStartEvent += () => buffee.Damage( amount, DamageType.NORMAL, buffee );
}
示例4: Bleeding
public Bleeding( Unit buffee, int amount = 2 )
: base( "Bleeding", buffee, "Stitch Up" ) {
stackable = true;
TurnStartEvent += () => buffee.Damage( amount, DamageType.INTERNAL, buffee );
}
示例5: Poisoned
public Poisoned( Unit buffee, int amount = 2, int duration = -1 )
: base( "Poisoned" ) {
stackable = true;
if( duration > 0 ) {
this.duration = duration;
} else {
terminationCondition = BuffTerminationCondition.Eternal;
}
TurnStartEvent += () => buffee.Damage( amount, DamageType.INTERNAL, buffee );
}
示例6: ApplyEffects
public override void ApplyEffects( Unit unit ) {
unit.Damage( mBurnDmg, EUnitDamageType.Burn );
}
示例7: Fire
protected override void Fire( Unit target ) {
if( mFiringTimer >= mFiringRate ) {
if( mPlaySound )
mWorld.PlaySound( mFireSound, mCenter );
target.Damage( mDmg + mDmgBonus, EUnitDamageType.Energy );
mWorld.CreateAnimation( "beamHit", target.Center, 0.25f, 0, 10f );
mWorld.CreateAnimation( "lightCircle", target.Center, 0.25f, 0, 10f );
mFiringTimer = 0f;
mDmgBonus += mDmg;
}
}