本文整理汇总了C#中Gun.GetTowerType方法的典型用法代码示例。如果您正苦于以下问题:C# Gun.GetTowerType方法的具体用法?C# Gun.GetTowerType怎么用?C# Gun.GetTowerType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gun
的用法示例。
在下文中一共展示了Gun.GetTowerType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillController
//.........这里部分代码省略.........
//split - again pattern-based. 0 is no split, 1-3 are the normal through rare effects described in the Tower Pieces spreadsheet
float pTrapSplit = (float)(double)pdata["trapSplit"];
if (pTrapSplit > trapSplit)
trapSplit = (int)pTrapSplit;
if (pTrapSplit > 0)
splitCount++;
//homing - above 0.0 and it will home, the number describes the strength of the pull
float pTrapHome = (float)(double)pdata["trapHoming"];
if (pTrapHome > trapHoming)
trapHoming = pTrapHome;
if (pTrapHome > 0.0f)
homeCount++;
//arc - above 0.0 and it'll arc, the number describes the damage bonus
float pTrapArc = (float)(double)pdata["trapArc"];
if (pTrapArc > trapArc)
trapArc = pTrapArc;
if (pTrapArc > 0.0f)
arcCount++;
}
penetrationBonusCount = Math.Min(speedCount,peneCount);
splashBonusCount = Math.Min(splashCount,rangeCount);
regenBonusCount = Math.Min(shredCount,slowCount);
hijackRegenBonus = Math.Min (drainCount,peneCount) > 0;
chainStunBonus = Math.Min (stunCount,knockbackCount) > 0;
chainPoisonBonus = Math.Min (spreadCount,poisonCount) > 0;
lethargyPoisonBonus = Math.Min (slowCount,poisonCount) > 0;
recursiveSplitBonus = Math.Min (splitCount,spreadCount) > 0;
circleExplosionBonus = Math.Min (arcCount,splashCount) > 0;
//DONE GETTING RAW VALUES
//Set tower stats based on these values
if(gc.GetTowerType().Equals ("Bullet")){
//Debug.Log("speed is " + ((1f/speed) * SPEED_CONSTANT));
//Damage
gc.SetDmg (damage);
//Range
gc.SetRange (range);
//Speed
gc.SetSpeed ((1f/speed) * SPEED_CONSTANT);
//Cooldown
gc.SetCooldown (cooldown);
//Poison
gc.SetPoison (poison);
//Debug.Log (gc.buttonID + " poison value is set to " + poison);
gc.SetPoisonDur (3f);
gc.SetChainPoison(chainPoisonBonus);
gc.SetLeeches(hijackRegenBonus);
//Slowdown
gc.SetSlowdown (1f-slowdownMax); //for now. eventually add in that scaling system for slow/fast enemies?
//Debug.Log (slowdownMax + "is max slowdown");
gc.SetSlowDur (0.75f);
//Knockback
gc.SetKnockback(knockback);
//Lifedrain
gc.SetLifeDrain (lifeDrain);
//Splash
gc.SetSplash (splash);
gc.SetSplashRadiusBonus(splashBonusCount * PERCENT_AOE_RANGE_PER_PAIR);
//Stun
gc.SetStun (stun);
//Penetration
gc.SetPenetration (penetration);
gc.SetPiercing(penetrationBonusCount);
//Shieldshred