本文整理汇总了C#中SpellEffect类的典型用法代码示例。如果您正苦于以下问题:C# SpellEffect类的具体用法?C# SpellEffect怎么用?C# SpellEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellEffect类属于命名空间,在下文中一共展示了SpellEffect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SummonEffectHandler
public SummonEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
// MiscValueB:
// 41 -> NonCombat Companion
//
}
示例2: NotImplementedEffect
public NotImplementedEffect(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
if (cast.Caster is Character)
{
(cast.Caster as Character).SendSystemMessage(
"Spell {0} ({1}) has not implemented Effect {2}. Please report this to the developers",
cast.Spell.Name, cast.Spell.Id, effect.EffectType);
}
}
示例3: Equals
//Use this to check whether an effect is already on someone, then just refresh the duration if it is
public bool Equals(SpellEffect otherEffect)
{
if (instantDamage == otherEffect.instantDamage && instantKnockback == otherEffect.instantKnockback && maxHealthMod == otherEffect.maxHealthMod
&& healthRegenMod == otherEffect.healthRegenMod && damageReductionMod == otherEffect.damageReductionMod && maxManaMod == otherEffect.maxManaMod
&& manaRegenMod == otherEffect.manaRegenMod && damageMod == otherEffect.damageMod && attackTimeMod == otherEffect.attackTimeMod
&& knockbackMod == otherEffect.knockbackMod && speedMod == otherEffect.speedMod && jumpSpeedMod == otherEffect.jumpSpeedMod)
{
//All the effects are equal
return true;
} else {
//One or more effects is not equal
return false;
}
}
示例4: EquipEvent
public override bool EquipEvent(int slotNo)
{
if ((slotNo ==9) || (slotNo ==10))
{
if (objInt().isEnchanted==true)
{
//cast enchantment.
SpellEffectApplied = GameWorldController.instance.playerUW.PlayerMagic.CastEnchantment(GameWorldController.instance.playerUW.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf);
if (SpellEffectApplied!=null)
{
SpellEffectApplied.SetPermanent(true);
}
}
}
return true;
}
示例5: SetSpellEffect
public void SetSpellEffect(Spell newSpell)
{
effect = new SpellEffect (newSpell.effect);
targetsEnemies = newSpell.targetsEnemies;
AoE = newSpell.AoE;
rb.useGravity = newSpell.affectedByGravity;
radius = newSpell.radius;
deathTimer = newSpell.lifetime;
GetComponent<SphereCollider> ().radius = newSpell.size;
if (transform.Find ("Trail") && transform.Find ("Explosion")) {
transform.Find ("Trail").GetComponent<ParticleSystem> ().startSize *= newSpell.size;
transform.Find ("Trail").GetComponent<ParticleSystem> ().startColor = newSpell.col;
transform.Find ("Explosion").GetComponent<ParticleSystem> ().startColor = newSpell.col;
}
}
示例6: SpellEffect
//For creating spells from templates -- necessary because when I tried
//setting ProjectileSpell's effect field equal to the template effect,
//it was a reference instead of a variable
public SpellEffect(SpellEffect templateEffect)
{
instantDamage = templateEffect.instantDamage;
instantKnockback = templateEffect.instantKnockback;
maxHealthMod = templateEffect.maxHealthMod;
healthRegenMod = templateEffect.healthRegenMod;
damageReductionMod = templateEffect.damageReductionMod;
maxManaMod = templateEffect.maxManaMod;
damageMod = templateEffect.damageMod;
attackTimeMod = templateEffect.attackTimeMod;
knockbackMod = templateEffect.knockbackMod;
speedMod = templateEffect.speedMod;
jumpSpeedMod = templateEffect.jumpSpeedMod;
duration = templateEffect.duration;
}
示例7: EquipEvent
public override bool EquipEvent(int slotNo)
{
if (((slotNo ==7) && (GameWorldController.instance.playerUW.isLefty==true)) || ((slotNo ==8) && (GameWorldController.instance.playerUW.isLefty==false)))//Only on off hand
{
UpdateQuality();
if (objInt().isEnchanted==true)
{
int EffectId=GetActualSpellIndex ();
switch (EffectId)
{
case SpellEffect.UW1_Spell_Effect_MinorProtection:
case SpellEffect.UW1_Spell_Effect_Protection:
case SpellEffect.UW1_Spell_Effect_AdditionalProtection:
case SpellEffect.UW1_Spell_Effect_MajorProtection:
case SpellEffect.UW1_Spell_Effect_GreatProtection:
case SpellEffect.UW1_Spell_Effect_VeryGreatProtection:
case SpellEffect.UW1_Spell_Effect_TremendousProtection:
case SpellEffect.UW1_Spell_Effect_UnsurpassedProtection:
ProtectionBonus=EffectId-463;
break;
case SpellEffect.UW1_Spell_Effect_MinorToughness:
case SpellEffect.UW1_Spell_Effect_Toughness:
case SpellEffect.UW1_Spell_Effect_AdditionalToughness:
case SpellEffect.UW1_Spell_Effect_MajorToughness:
case SpellEffect.UW1_Spell_Effect_GreatToughness:
case SpellEffect.UW1_Spell_Effect_VeryGreatToughness:
case SpellEffect.UW1_Spell_Effect_TremendousToughness:
case SpellEffect.UW1_Spell_Effect_UnsurpassedToughness:
ToughnessBonus=EffectId-471;
break;
default:
//cast enchantment.
SpellEffectApplied = GameWorldController.instance.playerUW.PlayerMagic.CastEnchantment(GameWorldController.instance.playerUW.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf);
if (SpellEffectApplied!=null)
{
SpellEffectApplied.SetPermanent(true);
}
break;
}
}
}
return true;
}
示例8: AddEffect
public void AddEffect(SpellEffect newEffect)
{
//If you already have the effect, just refresh the timer
bool hasEffect = false;
for (int i = 0; i < effects.Count; i++) {
if (effects [i].Equals (newEffect)) {
hasEffect = true;
effects [i].SetDuration (newEffect.duration);
}
}
//If not, add the effect
if (!hasEffect) {
effects.Add (newEffect);
}
//Do damage regardless
healthmana.ModHealth (-1 * newEffect.instantDamage);
//Knockback is applied within the "projectile spell" code
}
示例9: DisenchantEffectHandler
public DisenchantEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例10: AddExtraAttacksEffectHandler
public AddExtraAttacksEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例11: MillingEffectHandler
public MillingEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例12: SummonObjectEffectHandler
public SummonObjectEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例13: ForgetSpecializationEffectHandler
public ForgetSpecializationEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例14: CannibalizeEffectHandler
public CannibalizeEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例15: OnEquip
public override bool OnEquip(Mobile from)
{
if ( base.OnEquip(from) )
{
if ( SpellEffectOnEquip && from.Alive && !from.Deleted && m_Effect != SpellEffect.None && SpellCharges > 0 )
{
if ( SpellCastEffect.InvokeEffect( m_Effect, from, from ) )
{
SpellCharges--;
if ( SpellCharges <= 0 )
{
if ( m_Timer != null )
{
m_Timer.Stop();
m_Timer = null;
}
m_Effect = SpellEffect.None;
from.SendAsciiMessage( "This magic item is out of charges." );
}
}
if ( SpellCharges > 0 && SpellCastEffect.IsRepeatingEffect( m_Effect ) )
{
if ( m_Timer == null )
m_Timer = new CheckTimer( this );
if ( !m_Timer.Running )
m_Timer.Start();
}
}
return true;
}
else
{
return false;
}
}