本文整理匯總了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;
}
}