当前位置: 首页>>代码示例>>C#>>正文


C# SpellType类代码示例

本文整理汇总了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;
        }
开发者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


注:本文中的SpellType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。