本文整理汇总了C#中Effect.RunEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Effect.RunEffect方法的具体用法?C# Effect.RunEffect怎么用?C# Effect.RunEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Effect
的用法示例。
在下文中一共展示了Effect.RunEffect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyEffect
// applies the specified effect, or stacks and refreshes it if it is already on
public bool ApplyEffect(Effect eff)
{
//first check if the unit is immune
if (eff.description.Contains ("Stunned") && immune.Stun) {
ShowCombatText("Immune", statusCombatText);
return false;
} else if (eff.description.Contains ("Snare") && immune.Snare) {
ShowCombatText("Immune", statusCombatText);
return false;
} else if (eff.description.Contains ("Sleep") && immune.Sleep) {
ShowCombatText("Immune", statusCombatText);
return false;
}
//need to reaply all the buffs
//set each stat to its base then apply effects
maxHP = baseHP;
maxMana = baseMana;
movespeed = baseMove;
armourDamageReduction = baseArmour;
init = baseInit;
maxAP = baseAP;
damageDealtMod = 1;
damageRecievedMod = 1;
healingRecievedMod = 1;
healingDealtMod = 1;
cooldownSpeed = 1;
bool alreadyHad = false;
shield = 0;
dodgeChance = baseDodge;
blockChance = baseBlock;
sight = baseSight;
immune = baseImmune;
//loop through all the current effects
foreach (Effect currentEffect in myEffects) {
// if the new effect already exists add a stack
if (currentEffect.name.Contains(eff.name)) {
currentEffect.AddStack();
alreadyHad = true;
}
currentEffect.RunEffect(this, true);
}
//if the unit didnt already have the effect add it
if (!alreadyHad) {
//if its a shield of damage recieved effect they need to be added at the start
if (eff.description.Contains("Damage Shield") || eff.description.Contains("Damage Recieved Mod")) {
myEffects.Insert(0, eff);
} else {
myEffects.Add(eff);
}
eff.RunEffect(this, true);
}
//stop the unit gaining hp
if (damageDealtMod < 0) {
damageDealtMod = 0;
}
//stop the unit gaining hp
if (damageRecievedMod < 0) {
damageRecievedMod = 0;
}
//guard points
blockChance += 4 * guardPoints;
ShowDebuffs ();
return true;
}