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


C# AttackType.ToString方法代码示例

本文整理汇总了C#中AttackType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AttackType.ToString方法的具体用法?C# AttackType.ToString怎么用?C# AttackType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AttackType的用法示例。


在下文中一共展示了AttackType.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getHit

 public override void getHit(double damage, AttackType attackType)
 {
     enemyIsHit = true;
     if(attackType == AttackType.Fire){
         damage = damage - (int)((damage * .75f));
     }
     health = health - (int)damage;
     Debug.Log (attackType.ToString());
     if (health < 0) {
         health = 0;
     }
 }
开发者ID:jordanepickett,项目名称:RPG,代码行数:12,代码来源:BasicEnemy.cs

示例2: GetAttackEffect

		public static ParticleSystem GetAttackEffect(TowerType towerType, AttackType attackType)
		{
			try
			{
				var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() + 
					EffectType.Attack);
				return new ParticleSystem(effectData);
			}
			catch //ncrunch: no coverage start, MockContentLoader will have the above lines always pass
			{
				return FallbackEffects.AttackEffect();
			} //ncrunch: no coverage end
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:13,代码来源:EffectLoader.cs

示例3: GetProjectileEffect

		public static ParticleSystem GetProjectileEffect(TowerType towerType, AttackType attackType)
		{
			try
			{
				var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() +
						EffectType.Projectile);
				var effect = new ParticleSystem(effectData);
				foreach (var emitter in effect.AttachedEmitters)
					emitter.EmitterData.DoParticlesTrackEmitter = true;
				return effect;
			}
			catch //ncrunch: no coverage start
			{
				return FallbackEffects.ProjectileEffect();
			} //ncrunch: no coverage end
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:16,代码来源:EffectLoader.cs

示例4: species

    public static string species(float size, float weirdChance = 0, float dietChance = 0, 
	                             AttackType attType = AttackType.Null, DefenceType defType = DefenceType.Null,
	                             MovementType movType = MovementType.Null, Targets targets = Targets.Null, float speed = 1, int complexity = 0)
    {
        //TODO: Come up with a name-generating system.
        string result = "";
        DietType Diet;
        if(weirdChance == 0){
            weirdChance = Random.value;
        }
        if(dietChance == 0){
            dietChance = Random.value;
        }
        result += "Fish ";

        if(dietChance >= .85){
            result += DietType.Omnivore.ToString();
            Diet = DietType.Omnivore;
        }
        else if(dietChance >= .65){
            result += DietType.Carnivore.ToString();
            Diet = DietType.Carnivore;
        }
        else{
            result += DietType.Herbivore.ToString();
            Diet = DietType.Herbivore;
        }
        result += " ";

        if(weirdChance >= 0.9f){
            if(Random.value >= 0.5){
                //Debug.Log("Flounder");
                result += (Random.Range(1f, 1.7f)*size + " ");
                result += (Random.Range(0.3f, 0.6f)*size + " ");
                result += (Random.Range(1f, 1.7f)*size + " ");
            }
            else{
                //Debug.Log ("Sunfish");
                result += (Random.Range(0.3f, 0.6f)*size + " ");
                result += (Random.Range(1.6f, 4.5f)*size + " ");
                result += (Random.Range(0.8f, 1.7f)*size + " ");
            }
        }
        else{
            result += (Random.Range(0.8f, 1.2f)*size + " ");
            result += (Random.Range(0.8f, 1.2f)*size + " ");
            result += (Random.Range(0.8f, 1.2f)*size + " ");
        }

        if(attType==AttackType.Null){
            attType = determineAttack(Diet);
        }
        result += attType.ToString() + " ";

        if(defType==DefenceType.Null){
            defType = determineDefence(Diet);
        }
        result += defType.ToString() + " ";

        if(movType==MovementType.Null){
            movType = determineMovement();
        }
        result += movType.ToString() + " ";

        if(targets==Targets.Null){
            targets = determineTargets(size, Diet, attType);
        }
        result += targets.ToString() + " ";

        //TODO:Generate Speed
        result += (speed);
        result += addMods(complexity);
        return result;
    }
开发者ID:Krosantos,项目名称:Ocean,代码行数:74,代码来源:GenUtil.cs


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