本文整理汇总了C#中SpellType类的典型用法代码示例。如果您正苦于以下问题:C# SpellType类的具体用法?C# SpellType怎么用?C# SpellType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellType类属于命名空间,在下文中一共展示了SpellType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static Spell Create(SpellType spellType)
{
Spell newSpell;
switch (spellType)
{
case SpellType.Lightning:
newSpell = new Lightning(_content, _graphics);
break;
case SpellType.DragonBreath:
newSpell = new DragonBreath(_content, _graphics);
break;
case SpellType.Gate:
newSpell = new Gate(_content, _graphics);
break;
case SpellType.Apocalypse:
newSpell = new Apocalypse(_content, _graphics);
break;
default:
throw new InvalidSpellException(spellType);
}
newSpell.Load();
return newSpell;
}
示例2: Cast
public void Cast (SpellType spell, Transform player, Transform enemy)
{
switch (spell)
{
case SpellType.clean:
CleanWave(player.transform.position);
audio.PlayAudio("Clean");
break;
case SpellType.buff:
BuffTeam(player.gameObject.layer);
audio.PlayAudio("Buff");
break;
case SpellType.slow:
SlowEnemies(enemy.gameObject.layer);
audio.PlayAudio("Slow");
break;
case SpellType.heal:
HealTeam(player.gameObject.layer);
audio.PlayAudio("Heal");
break;
case SpellType.knockback:
KnockEnemies(enemy.gameObject.layer);
audio.PlayAudio("Knock");
break;
}
}
示例3: castSpell
public void castSpell(SpellType type, Vector3 targetLocation)
{
ISpell spell = null;
switch (type) {
case SpellType.FIRE:
if(fireBallSpellPrefab != null)
spell = Instantiate (fireBallSpellPrefab) as ISpell;
break;
case SpellType.RAIN:
if(rainSpellPrefab != null)
spell = Instantiate (rainSpellPrefab) as ISpell;
break;
case SpellType.WIND:
if (windSpellPrefab != null)
spell = Instantiate(windSpellPrefab) as ISpell;
break;
default:
Debug.LogError ("Invalid Spell Type");
return;
}
if (spell != null) {
if (successCastSound != null)
AudioSource.PlayClipAtPoint (successCastSound, Camera.main.transform.position);
spell.Activate (_spellList, targetLocation, this.gameObject);
}
}
示例4: Spell
protected Spell(Entity owner, Texture2D icon, SpellType type, int cost)
{
Owner = owner;
powerCost = cost;
Icon = icon;
Type = type;
}
示例5: SetCurseById
// Set the curse/spell by id.
public void SetCurseById(int id)
{
spellType = SpellType.unknown;
if (id == 0 && points.mana >= 40)
{
print (HasSheep ());
if (HasSheep ())
{
points.mana -= 40;
spellType = SpellType.crazy_sheeps;
}
}
else if (id == 1 && points.mana >= 30)
{
points.mana -= 30;
spellType = SpellType.freeze;
}
else if (id == 2 && points.mana >= 10)
{
points.mana -= 10;
spellType = SpellType.spawn;
}
else if (id == 3 && points.mana >= 30)
{
points.mana -= 30;
spellType = SpellType.wall_block;
}
print ("Mana is: " + points.mana);
}
示例6: Player
public Player(ContentManager content, GraphicsDeviceManager graphics)
{
_content = content;
_graphics = graphics;
_health = Settings.PlayerMaxHealth;
Strength = Settings.PlayerMaxStrength;
Shield = Settings.PlayerMaxShield;
_magic = Settings.PlayerMaxMagic;
Score = 0;
Kills = 0;
activeSpell = SpellType.DragonBreath;
activeWeapon = WeaponType.Sword;
maceAvailable = false;
axeAvailable = false;
dying = false;
Dead = false;
dyingTick = 0.0f;
loaded = false;
Position = Vector3.Zero;
Direction = 0.0f;
healthTick = 0.0f;
shieldTick = 0.0f;
WeaponPosition = 0.0f;
model = null;
rotation = Matrix.Identity;
}
示例7: DescriptionWithIncreasedDamage
public static colorstring DescriptionWithIncreasedDamage(SpellType spell)
{
switch(spell){
case SpellType.FORCE_PALM:
return new colorstring(" 2d6",Color.Yellow," damage, range 1, knockback ",Color.Gray);
case SpellType.SCORCH:
return new colorstring(" 3d6",Color.Yellow," fire damage, ranged ",Color.Gray);
case SpellType.LIGHTNING_BOLT:
return new colorstring(" 3d6",Color.Yellow," electric, leaps between foes",Color.Gray);
case SpellType.VOLTAIC_SURGE:
return new colorstring(" 4d6",Color.Yellow," electric, radius 2 burst ",Color.Gray);
case SpellType.MAGIC_HAMMER:
return new colorstring(" 5d6",Color.Yellow," damage, range 1, stun ",Color.Gray);
case SpellType.GLACIAL_BLAST:
return new colorstring(" 4d6",Color.Yellow," cold damage, ranged ",Color.Gray);
case SpellType.FLASHFIRE:
return new colorstring(" 4d6",Color.Yellow," fire damage, ranged radius 2",Color.Gray);
case SpellType.SONIC_BOOM:
return new colorstring(" 4d6",Color.Yellow," magic damage, can stun foes ",Color.Gray);
case SpellType.COLLAPSE:
return new colorstring(" 5d6",Color.Yellow,", breaks walls, leaves rubble",Color.Gray);
case SpellType.FORCE_BEAM:
return new colorstring(" Three ",Color.Gray,"2d6",Color.Yellow," beams knock foes back ",Color.Gray);
case SpellType.BLIZZARD:
return new colorstring(" 6d6",Color.Yellow," radius 5 burst, freezes foes",Color.Gray);
default:
return Description(spell);
}
}
示例8: CastSpell
public void CastSpell(ElementType element, SpellType spellType) {
input.FreezeInput();
if (spellType == SpellType.Attack) {
var go = Instantiate(GameManager.Instance.attackEffcts[(int)element]);
go.name = "Spell";
go.transform.position = transform.position;
var spell = go.AddComponent<FlyingSpell>();
spell.type = spellType;
spell.element = element;
spell.ResetTo(this, target);
} else {
var go = Instantiate(GameManager.Instance.defendEffcts[(int)element]);
go.name = "Defense";
go.transform.position = transform.position;
var ds = go.AddComponent<DefenseSpell>();
ds.type = spellType;
ds.element = element;
//only one block at a time
foreach (var defense in defenses) {
Destructor.DoCleanup(defense.gameObject);
}
defenses.Clear();
defenses.Add(ds);
}
}
示例9: RunescapeSpell
public RunescapeSpell(int id, string name, int level, int air, int water, int earth, int fire, int mind,
int body, int cosmic, int chaos, int astral, int nature, int death, int law, int blood, int soul, double exp,
SpellCategory category, SpellType spellGroup, string description, params Type[] ingredients)
: this(id, name, level, air, water, earth, fire, mind, body, cosmic, chaos, astral, nature, death, law, blood,
soul, exp, category, spellGroup, description, null, ingredients)
{
}
示例10: TakeSpell
public void TakeSpell(SpellType spellType)
{
if(spellType == SpellType.FIRE)
{
transform.GetChild(0).GetComponent<ParticleSystem>().Play();
Invoke("BurnDown", 2f);
}
}
示例11: CastSpell
public Spell CastSpell(SpellType spellType, Vector2 direction){
DirectionalSpell spell = SpawnSpell(spellType) as DirectionalSpell;
//spell.transform.position += new Vector3(direction.x, direction.y, 0);
spell.direction = direction;
spell.Activate();
OnSpellCast(spell);
return spell;
}
示例12: Spell
public Spell(SpellType type, SpellElement element, SpellEffect[] effects, String name, String description)
{
this.type = type;
this.element = element;
this.effects = effects;
this.name = name;
this.description = description;
}
示例13: ISSpell
public ISSpell()
{
_spellLevel = 1;
_manaCost = 1;
_cooldown = 1;
_spellRange = 1;
spellType = SpellType.None;
}
示例14: SpawnSpell
// Just instantiates the spell and sets the spellType and server variables
private Spell SpawnSpell(SpellType spellType){
Spell spell = Instantiate(spellType.prefab, transform.position, Quaternion.identity) as Spell;
spell.spellType = spellType;
spell.sender = this;
Physics2D.IgnoreCollision(GetComponent<Collider2D>(), spell.GetComponent<Collider2D>(), true);
return spell;
}
示例15: Spell
public Spell(string name, SpellType type, int damage, int armor, int manaCost, int chance)
{
this.Name = name;
this.Type = type;
this.Damage = damage;
this.Armor = armor;
this.ManaCost = manaCost;
this.ChanceToCauseAffliction = chance;
}