本文整理汇总了C#中SpellCast类的典型用法代码示例。如果您正苦于以下问题:C# SpellCast类的具体用法?C# SpellCast怎么用?C# SpellCast使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellCast类属于命名空间,在下文中一共展示了SpellCast类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SummonEffectHandler
public SummonEffectHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
// MiscValueB:
// 41 -> NonCombat Companion
//
}
开发者ID:NVN,项目名称:WCell,代码行数:7,代码来源:Summon.cs
示例2: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (!(target is Character))
{
failReason = SpellFailedReason.TargetNotPlayer;
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:7,代码来源:TrackCreatures.cs
示例3: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (target.MaxPower == 0 || target.PowerType != (PowerType)m_spellEffect.MiscValue)
{
failReason = SpellFailedReason.BadTargets;
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:PeriodicManaLeech.cs
示例4: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
{
var caster = creatingCast.CasterReference.Object as Unit;
if (caster == null)
{
failReason = SpellFailedReason.BadTargets;
}
else
{
if (caster.Charm != null)
{
failReason = SpellFailedReason.AlreadyHaveCharm;
}
else if (target.HasMaster)
{
failReason = SpellFailedReason.CantDoThatRightNow;
}
else if (caster.HasMaster)
{
failReason = SpellFailedReason.Possessed;
}
else if (caster is Character)
{
if (((Character)caster).ActivePet != null)
{
failReason = SpellFailedReason.AlreadyHaveSummon;
}
}
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:30,代码来源:ModPossessAuraHandler.cs
示例5: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
{
if (!(target is NPC))
{
failReason = SpellFailedReason.BadTargets;
}
if (casterRef != null && casterRef.Object is Unit)
{
var caster = (Unit)casterRef.Object;
//if (target.Target == caster)
//{
// failReason = SpellFailedReason.NoValidTargets;
//}
//else
{
var spell = m_aura.Spell;
var hasSingleFriendTarget = spell.HasBeneficialEffects && !spell.IsAreaSpell && spell.HasTargets;
if (hasSingleFriendTarget && caster.Target != null && caster.IsFriendlyWith(caster.Target))
{
// taunting a friend, means we want to taunt his attackers
// needed for Righteous defense, amongst others
if (target.Target != caster.Target)
{
failReason = SpellFailedReason.NoValidTargets;
}
}
}
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:30,代码来源:ModTaunt.cs
示例6: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
Caster = casterReference.Object as Unit;
if (Caster == null || Caster is Vehicle)
{
log.Warn("Invalid SpellCaster \"{0}\" for Spell: {1}", Caster, SpellEffect.Spell);
failReason = SpellFailedReason.Error;
return;
}
Vehicle = target as Vehicle;
if (Vehicle == null)
{
failReason = SpellFailedReason.BadTargets;
}
else
{
Seat = Vehicle.GetSeatFor(Caster);
if (Seat == null)
{
// must never happen since Vehicle is unclickable when full
failReason = SpellFailedReason.BadTargets;
}
}
}
开发者ID:remixod,项目名称:netServer,代码行数:25,代码来源:VehicleAuraHandler.cs
示例7: Start
// Use this for initialization
void Start()
{
longc = GameObject.Find ("LongCast");
spellcast1 = longc.GetComponent<SpellCast> ();
_sih = GameObject.Find ("Sihir");
mc = _sih.GetComponent<Encolhimento> ();
}
开发者ID:Pedroizt,项目名称:pucsp-hands-of-fate-2014,代码行数:9,代码来源:MassChange.cs
示例8: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (m_spellEffect.TriggerSpell == null)
{
failReason = SpellFailedReason.Error;
log.Warn("Tried to cast Spell \"{0}\" which has invalid TriggerSpellId {1}", m_spellEffect.Spell, m_spellEffect.TriggerSpellId);
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:TriggerDelayedEffectHandler.cs
示例9: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (target.Class != ClassId.Hunter)
{
failReason = SpellFailedReason.BadTargets;
return;
}
}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:CallStabledPetHandler.cs
示例10: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (!(target is Character)) return;
var chr = (Character)target;
if (chr.Class != ClassId.Hunter)
{
failReason = SpellFailedReason.BadTargets;
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:9,代码来源:ModPetTalentPoints.cs
示例11: 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);
}
}
开发者ID:ray2006,项目名称:WCell,代码行数:10,代码来源:NotImplementedEffect.cs
示例12: Start
// Use this for initialization
void Start()
{
//Os gameobjects a seguir sao inicializados para conseguir componentes de outros scripts utilizando
//as variaveis ja declaradas.
longc = GameObject.Find ("SpellCast");
spellcast1 = longc.GetComponent<SpellCast> ();
GameObject u = GameObject.Find ("UnObj");
un = u.GetComponent<Unlockeds> ();
}
开发者ID:Pedroizt,项目名称:pucsp-hands-of-fate-2014,代码行数:11,代码来源:Encolhimento.cs
示例13: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (target is Character)
{
var chr = (Character)target;
if (!chr.CanFly)
{
failReason = SpellFailedReason.NotHere;
}
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:11,代码来源:Fly.cs
示例14: Cast
public SpellCast Cast(double crit_chance, double haste, int spell_power, double hit_chance = 0.99, double mana_cost_modifier = 1, double casting_time_modifier = 0)
{
SpellCast result = new SpellCast();
result.IsResisted = r.NextDouble() < hit_chance ? false : true;
result.IsCrit = can_crit && !result.IsResisted && r.NextDouble() < crit_chance ? true : false;
int min = (int)Math.Floor((min_base_dmg + spell_power * spell_power_coeff) * (1 + (result.IsCrit ? crit_bonus_dmg : 0)) * dmg_multiplier);
int max = (int)Math.Ceiling((max_base_dmg + spell_power * spell_power_coeff) * (1 + (result.IsCrit ? crit_bonus_dmg : 0)) * dmg_multiplier);
result.Damage = r.Next(min, max + 1);
result.ManaUsed = result.IsResisted ? 0 : (int)Math.Round(mana_cost * mana_cost_modifier);
result.CastTime = (casting_time - casting_time_modifier) / (1 + haste);
return result;
}
开发者ID:corcaroli,项目名称:shaman_stuff,代码行数:12,代码来源:Spell.cs
示例15: Start
void Start()
{
//Os gameobjects a seguir sao inicializados para conseguir componentes de outros scripts utilizando
//as variaveis ja declaradas.
GameObject s = GameObject.Find ("SpellCast");
castspell = s.GetComponent<SpellCast> ();
DesoxField = GameObject.Find ("desoxfield");
GameObject h = GameObject.Find ("Sihir");
hp = h.GetComponent<Hpsih> ();
trsihir = GameObject.Find ("Sihir");
GameObject a = GameObject.Find ("Sihir");
SihirSounds = a.GetComponent <SihirSounds> ();
}
开发者ID:Pedroizt,项目名称:pucsp-hands-of-fate-2014,代码行数:14,代码来源:Desoxigen.cs
示例16: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
form = (ShapeshiftForm)SpellEffect.MiscValue;
if (target.ShapeshiftForm == form)
{
// stances can't be undone:
if (form != ShapeshiftForm.BattleStance &&
form != ShapeshiftForm.BerserkerStance &&
form != ShapeshiftForm.DefensiveStance)
{
target.Auras.RemoveWhere(aura => aura.Spell.Id == m_aura.Spell.Id);
failReason = SpellFailedReason.DontReport;
}
}
}
开发者ID:NVN,项目名称:WCell,代码行数:15,代码来源:ShapeshiftHandler.cs
示例17: Start
// Use this for initialization
void Start()
{
//Os gameobjects a seguir sao inicializados para conseguir componentes de outros scripts utilizando
//as variaveis ja declaradas.
GameObject s = GameObject.Find ("SpellCast");
castspell = s.GetComponent<SpellCast> ();
esferar = GameObject.Find ("boladear2");
GameObject t = GameObject.Find ("Sihir");
tr = t.GetComponent<TrueSihir> ();
GameObject h = GameObject.Find ("Sihir");
hp = h.GetComponent<Hpsih> ();
trsih = GameObject.Find ("Sihir");
GameObject a = GameObject.Find ("Sihir");
SihirSounds = a.GetComponent <SihirSounds> ();
}
开发者ID:Pedroizt,项目名称:pucsp-hands-of-fate-2014,代码行数:21,代码来源:Esferadear.cs
示例18: Update
void Update()
{
float a;//teste
bool ativo = false;//controle, o objeto esta inativo.
/*Caso a variavel da classe SpellCast chamada selo receba esses parametros, ele ira criar o objeto
*e adicionara uma força para que o mesmo va para frente. Ao ser instanciado, o mesmo solta um som. Ele
*reseta a variavel da classe SpellCast, reduz 1/8 da vida maxima da personagem, e manda a mensagem
*para a classe TrueSihir, executando o metodo "Attack" que aciona a animaçao dos dados, bursts e etc.
*Depois de tres segundos o gameobject desse script e destruido*/
if (castspell.selo == "01" || castspell.selo == "D R ") {
GameObject s = GameObject.Find ("SpellCast");
castspell = s.GetComponent<SpellCast> ();
target = GameObject.Find ("Sihir/SpellCast").transform;
GameObject obj = Instantiate (DesoxField, target.position, target.rotation) as GameObject;
obj.rigidbody.AddForce(target.forward * 50);
#region Atack Sound Switch
if (AtackSound)
{
SihirSounds.PlaySound (0);
AtackSound = false;
}
else
{
SihirSounds.PlaySound (1);
AtackSound = true;
}
#endregion
castspell.selo = "";
hp.curHealth -= hp.maxHealth/8;
trsihir.SendMessage("Attack", SendMessageOptions.DontRequireReceiver);
Destroy(obj, 3);
}
}
开发者ID:Pedroizt,项目名称:pucsp-hands-of-fate-2014,代码行数:39,代码来源:Desoxigen.cs
示例19: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
{
var caster = creatingCast.CasterReference.Object as Unit;
if (caster == null)
{
failReason = SpellFailedReason.BadTargets;
}
else
{
if (!(target is NPC))
{
LogManager.GetCurrentClassLogger().Warn("{0} tried to Charm {1} which is not an NPC, but Player charming is not yet supported.", caster, target);
failReason = SpellFailedReason.BadTargets;
}
if (caster.Charm != null)
{
failReason = SpellFailedReason.AlreadyHaveCharm;
}
else if (target.HasMaster)
{
failReason = SpellFailedReason.CantBeCharmed;
}
//else if (caster.Level < EffectValue)
//{
// failReason = SpellFailedReason.Highlevel;
//}
else if (caster.HasMaster)
{
failReason = SpellFailedReason.Charmed;
}
else if (caster is Character)
{
if (((Character)caster).ActivePet != null)
{
failReason = SpellFailedReason.AlreadyHaveSummon;
}
}
}
}
开发者ID:Jeroz,项目名称:WCell,代码行数:39,代码来源:CharmAuraHandler.cs
示例20: Apply
protected internal override void Apply()
{
if (spell == null)
{
var channel = m_aura.Controller as SpellChannel;
if (channel != null)
{
origCast = channel.Cast;
}
else
{
origCast = m_aura.Auras.Owner.SpellCast;
}
if (origCast == null)
{
return;
//throw new Exception("Cannot apply a Periodic Trigger Spell Aura on anyone but the Caster");
}
spell = m_spellEffect.TriggerSpell;
if (spell == null)
{
LogManager.GetCurrentClassLogger().Warn("Found invalid periodic TriggerSpell in Spell {0} ({1}) ",
m_spellEffect.Spell,
(uint)m_spellEffect.TriggerSpellId);
return;
}
}
cast = SpellCast.ObtainPooledCast(origCast.Caster);
cast.TargetLoc = origCast.TargetLoc;
cast.Selected = origCast.Selected;
//cast.Start(spell, m_spellEffect, true);
cast.Start(spell, true);
}
开发者ID:pallmall,项目名称:WCell,代码行数:36,代码来源:PeriodicTriggerSpell.cs
注:本文中的SpellCast类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论