本文整理汇总了C#中SpellType类的典型用法代码示例。如果您正苦于以下问题:C# SpellType类的具体用法?C# SpellType怎么用?C# SpellType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellType类属于命名空间,在下文中一共展示了SpellType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:anxkha,项目名称:Mortuum,代码行数:25,代码来源:SpellFactory.cs
示例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;
}
}
开发者ID:D34THWINGS,项目名称:ggj-2016-ritual-chaos,代码行数:27,代码来源:SpellManager.cs
示例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);
}
}
开发者ID:Sushiy,项目名称:ShamanDance,代码行数:27,代码来源:Spellcaster.cs
示例4: Spell
protected Spell(Entity owner, Texture2D icon, SpellType type, int cost)
{
Owner = owner;
powerCost = cost;
Icon = icon;
Type = type;
}
开发者ID:wiilinkpds,项目名称:Wotrn,代码行数:7,代码来源:Spell.cs
示例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);
}
开发者ID:sandcoder,项目名称:GGJ2016,代码行数:30,代码来源:Player_Spell.cs
示例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;
}
开发者ID:anxkha,项目名称:Mortuum,代码行数:35,代码来源:Player.cs
示例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);
}
}
开发者ID:tommyettinger,项目名称:ForaysIntoSaltarelle,代码行数:29,代码来源:Spell.cs
示例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);
}
}
开发者ID:sirbrialliance,项目名称:2016-ggj,代码行数:31,代码来源:Wizard.cs
示例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)
{
}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:7,代码来源:SpellTable.cs
示例10: TakeSpell
public void TakeSpell(SpellType spellType)
{
if(spellType == SpellType.FIRE)
{
transform.GetChild(0).GetComponent<ParticleSystem>().Play();
Invoke("BurnDown", 2f);
}
}
开发者ID:Sushiy,项目名称:ShamanDance,代码行数:8,代码来源:DestructibleWall.cs
示例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;
}
开发者ID:zendar,项目名称:gamejam2016,代码行数:8,代码来源:Unit.cs
示例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;
}
开发者ID:mikecrawford9,项目名称:cs134rpg,代码行数:8,代码来源:Spell.cs
示例13: ISSpell
public ISSpell()
{
_spellLevel = 1;
_manaCost = 1;
_cooldown = 1;
_spellRange = 1;
spellType = SpellType.None;
}
开发者ID:darianwiccan,项目名称:UnityGame,代码行数:9,代码来源:ISSpell.cs
示例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;
}
开发者ID:zendar,项目名称:gamejam2016,代码行数:10,代码来源:Unit.cs
示例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;
}
开发者ID:fizzy9405,项目名称:Yer-a-wizzard,代码行数:9,代码来源:Spell.cs
示例16: CastContactSpell
public ContactSpell CastContactSpell(SpellType spellType, Unit other){
// Instantiates the spell and returns it
// OVerride to add different animations and whatnot
ContactSpell spell = SpawnSpell(spellType) as ContactSpell;
spell.target = other;
spell.Activate();
OnSpellCast(spell);
contactSpellCooldown = contactSpellDelay;
return spell;
}
开发者ID:zendar,项目名称:gamejam2016,代码行数:10,代码来源:Unit.cs
示例17: MItem
public MItem(String name, String menuName, String menuVariable, int id, ItemTypeId type, float range = 0, SpellSlot abilitySlot = SpellSlot.Unknown, SpellType spellType = SpellType.TargetAll)
{
this.name = name;
this.menuVariable = menuVariable;
this.menuName = menuName;
this.id = id;
this.range = range;
this.type = type;
this.abilitySlot = abilitySlot;
this.spellType = spellType;
}
开发者ID:Maskov,项目名称:LeagueSharp,代码行数:11,代码来源:MItem.cs
示例18: Description
public static colorstring Description(SpellType spell)
{
switch(spell){
case SpellType.SHINE:
return new colorstring(" Doubles your torch's radius ",Color.Gray);
case SpellType.IMMOLATE:
return new colorstring(" Throws flame to ignite an enemy ",Color.Gray);
case SpellType.FORCE_PALM:
return new colorstring(" 1d6 damage, range 1, knockback ",Color.Gray);
case SpellType.FREEZE:
return new colorstring(" Encases an enemy in ice ",Color.Gray);
case SpellType.BLINK:
return new colorstring(" Teleports you a short distance ",Color.Gray);
case SpellType.SCORCH:
return new colorstring(" 2d6 fire damage, ranged ",Color.Gray);
case SpellType.BLOODSCENT:
return new colorstring(" Tracks one nearby living enemy ",Color.Gray);
case SpellType.LIGHTNING_BOLT:
return new colorstring(" 2d6 electric, leaps between foes",Color.Gray);
case SpellType.SHADOWSIGHT:
return new colorstring(" Grants better vision in the dark",Color.Gray);
case SpellType.VOLTAIC_SURGE:
return new colorstring(" 3d6 electric, radius 2 burst ",Color.Gray);
case SpellType.MAGIC_HAMMER:
return new colorstring(" 4d6 damage, range 1, stun ",Color.Gray);
case SpellType.RETREAT:
return new colorstring(" Marks a spot, then returns to it",Color.Gray);
case SpellType.GLACIAL_BLAST:
return new colorstring(" 3d6 cold damage, ranged ",Color.Gray);
case SpellType.PASSAGE:
return new colorstring(" Move to the other side of a wall",Color.Gray);
case SpellType.FLASHFIRE:
return new colorstring(" 3d6 fire damage, ranged radius 2",Color.Gray);
case SpellType.SONIC_BOOM:
return new colorstring(" 3d6 magic damage, can stun foes ",Color.Gray);
case SpellType.COLLAPSE:
return new colorstring(" 4d6, breaks walls, leaves rubble",Color.Gray);
case SpellType.FORCE_BEAM:
return new colorstring(" Three 1d6 beams knock foes back ",Color.Gray);
case SpellType.AMNESIA:
return new colorstring(" An enemy forgets your presence ",Color.Gray);
case SpellType.BLIZZARD:
return new colorstring(" 5d6 radius 5 burst, freezes foes",Color.Gray);
case SpellType.BLESS:
return new colorstring(" Increases Combat skill briefly ",Color.Gray);
case SpellType.MINOR_HEAL:
return new colorstring(" Heals 4d6 damage ",Color.Gray);
case SpellType.HOLY_SHIELD:
return new colorstring(" Attackers take 2d6 magic damage ",Color.Gray);
default:
return new colorstring(" Unknown. ",Color.Gray);
}
}
开发者ID:tommyettinger,项目名称:ForaysIntoSaltarelle,代码行数:53,代码来源:Spell.cs
示例19: SpellClass
public SpellClass(int cost, int amount, float cooldown, float castTime, string name, string desc, Spell spell, SpellCategory category, SpellType type)
{
this.SpellCost = cost;
this.SpellAmount = amount;
this.SpellBaseAmount = amount;
this.SpellCooldown = cooldown;
this.SpellBaseCooldown = cooldown;
this.SpellCastTime = castTime;
this.SpellBaseCastTime = castTime;
this.SpellName = name;
this.SpellDescription = desc;
this.SpellEnum = spell;
this.Category = category;
this.Type = type;
}
开发者ID:Tonaplo,项目名称:HealingApp,代码行数:15,代码来源:SpellStats.cs
示例20: SpellData
public SpellData(
string charName,
string spellName,
string name,
int range,
int radius,
SpellDatabase.SpellDangerLevel dangerlevel,
SpellType spellType
)
{
CharName = charName;
SpellName = spellName;
Name = name;
Range = range;
Radius = radius;
Dangerlevel = dangerlevel;
SpellType = spellType;
}
开发者ID:hao1630,项目名称:KickAss,代码行数:18,代码来源:SpellData.cs
注:本文中的SpellType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论