本文整理汇总了C#中Actor.ApplyDamage方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.ApplyDamage方法的具体用法?C# Actor.ApplyDamage怎么用?C# Actor.ApplyDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.ApplyDamage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActorEnterFloorAction
// actor enter into floor
public void ActorEnterFloorAction(Actor a)
{
if( m_fgData.fixedDamage > 0 ) {
int damage = Mathf.Clamp ( (int)m_fgData.fixedDamage, 0, (int)a.hp - 1 );
if( damage > 0 ) {
GUIManager.GetManager().Message(a.charName + " は " + damage + " の ダメージをうけた!" );
a.ApplyDamage(damage);
}
}
//TODO
if( m_fgData.graphic == "PoisonFloor" ) {
a.SpawnEffect("PoisonWell");
a.AttachStatus(StatusModifier.Kind.Poison);
}
if( m_fgData.graphic == "ParalizeFloor" ) {
a.SpawnEffect("Paralize");
a.AttachStatus(StatusModifier.Kind.Paralized);
}
Debug.Log ("[FloorGimic] Enter action ("+m_fgData.onFloorAction+") to:" + a.charName );
}
示例2: AttackBy
/*
* ItemEntry instance may be overrided by a few unique items
*
* if item is equiped by attacker and hit target.
*/
public static bool AttackBy(ItemEntity item, Actor target, Actor attacker, float jumpCoeff)
{
if( item != null ) {
return item.AttackBy(target, attacker, jumpCoeff);
} else {
int dmg = attacker.CalcurateAttackDamage(item, target, ElementType.ET_Physical, jumpCoeff);
if( dmg > 0 ) {
GUIManager.GetManager().Message(target.charName + " に " + dmg + " の ダメージあたえた!" );
return target.ApplyDamage(dmg);
} else {
GUIManager.GetManager().Message(target.charName + " に ダメージをあたえられない!" );
return true;
}
}
}
示例3: HitBy
/*
* ItemEntry instance may be overrided by a few unique items
*
* if item is thrown by attacker and hit target.
*/
public virtual bool HitBy(Actor target, Actor thrower)
{
_TestStatusApply(target);
int dmg = thrower.CalcurateThrowDamageOfItem(this, target, ElementType.ET_Physical);
if( dmg > 0 ) {
GUIManager.GetManager().Message(target.charName + " に " + dmg + " の ダメージあたえた!" );
return target.ApplyDamage(dmg);
} else {
GUIManager.GetManager().Message(target.charName + " に ダメージをあたえられない!" );
return true;
}
}