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


C# Tower.GetSections方法代码示例

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


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

示例1: DoDamage

    public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSection)
    {
        if(t.GetSections().Count >= 1) {
            //t.DamageSection(center, damage);
            Section s = t.GetSection (center);
            if (!modifiedSecs.ContainsKey(s)) //if not modified before...
            {
                ModifyWeight(s, t, damage, self);
                modifiedSecs.Add(s, 1);

            }
            else if (modifiedSecs[s] >= numTimesModifiable)
            {
                ModifyWeight(s, t, damage, self);
                modifiedSecs[s]++;
            }
            else
            {
                //TODO: Make this a warning and let them go back to their turn
                CombatLog.addLine("This section has already altered the weight " + modifiedSecs[s] + "times.");
            }
        }
        else if(center < 0) {
            CombatLog.addLine("Attack was too low");
            CombatLog.addLine("Fill the aim bar more.");
        } else if(center >= t.GetSections().Count) {
            CombatLog.addLine("Attack was too high");
            CombatLog.addLine("Lower the aim bar.");
        }
    }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:30,代码来源:AlterWeight.cs

示例2: GetDamagedSections

 public override List<Section> GetDamagedSections(Tower t, int center)
 {
     List<Section> list = new List<Section>();
     if(center >= 0 && center < t.GetSections().Count) {
         list.Add(t.GetSections()[center]);
     }
     return list;
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:8,代码来源:DefaultWeaponEffect.cs

示例3: DoDamage

 public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSec)
 {
     if(center >= 0 && center < t.GetSections().Count) {
         int impact = (int)(damage * initialDamage[upgradeLevel]);
         int dot = (int)(damage * dotDamage[upgradeLevel]);
         CombatLog.addLine("Hit section " + (center+1) + " for " + impact + " damage.");
         CombatLog.addLine("Gave section " + (center+1) + " a " + dot + " damage burn.");
         t.DamageSection(center, impact);
         t.ApplyDot(center, dot);
     } else if(center < 0) {
         CombatLog.addLine("Attack was too low");
         CombatLog.addLine("Fill the aim bar more.");
     } else if(center >= t.GetSections().Count) {
         CombatLog.addLine("Attack was too high");
         CombatLog.addLine("Lower the aim bar.");
     }
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:17,代码来源:DamageOverTime.cs

示例4: GetDamagedSections

 public override List<Section> GetDamagedSections(Tower t, int center)
 {
     int down = numTargets[upgradeLevel]/2;
     int up = down;
     down = numTargets[upgradeLevel]%2 == 0 ? down-1 : down;
     int start = center - down;
     if(start < 0) {
         start = 0;
     }
     int end = center + up;
     if(end >= t.GetSections().Count) {
         end = t.GetSections().Count - 1;
     }
     Debug.Log("Start: " + start + " End: " + end);
     List<Section> list = new List<Section>();
     if(end >= 0) {
         for(int i=start; i <= end; i++) {
             list.Add(t.GetSection(i));
         }
     }
     return list;
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:22,代码来源:AreaOfEffect.cs

示例5: DoDamage

 public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSection)
 {
     if(t.GetSections().Count >= 1) {
         //t.DamageSection(center, damage);
         Section s = t.GetSection (center);
         SectionEffect eff = s.attributes.material.GetSectionEffect();
         eff.ApplyDamage(s, damage);
         if (s.attributes.HasWeapon())
         {
             if (s.attributes.weapon.GetEffect().GetEffectType() != "Blinded")
             {
                 s.attributes.weapon.GetEffect().Destruct();
                 s.attributes.weapon.SetWeaponEffect(new Blinded(missChance, s.attributes.weapon, s));
             }
         }
     }
     else if(center < 0) {
         CombatLog.addLine("Attack was too low");
     } else if(center >= t.GetSections().Count) {
         CombatLog.addLine("Attack was too high");
     }
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:22,代码来源:Blind.cs

示例6: DoDamage

    public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSection)
    {
        if(t.GetSections().Count >= 1) {
            //t.DamageSection(center, damage);
            Section s = t.GetSection (center);
            SectionEffect eff = s.attributes.material.GetSectionEffect();
            eff.ApplyDamage(s, damage);
            if (eff.GetEffectType() != "Tagged")
            {
                s.attributes.material.GetSectionEffect().Destruct();
                s.attributes.material.SetSectionEffect(new Tagged(critStrikeDamageModifier, s));
            }

        }
        else if(center < 0) {
            CombatLog.addLine("Attack was too low");
            CombatLog.addLine("Fill the aim bar more.");
        } else if(center >= t.GetSections().Count) {
            CombatLog.addLine("Attack was too high");
            CombatLog.addLine("Lower the aim bar.");
        }
    }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:22,代码来源:AimCritStrike.cs

示例7: DoDamage

 public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSection)
 {
     List<Section> sections = GetDamagedSections(t, center);
     if(sections.Count >= 1) {
         CombatLog.addLine("Hit section " + (center+1) + " for " + damage + " damage.");
     t.GetSection(center).attributes.material.GetSectionEffect().ApplyDamage(t.GetSection(center), damage);
     }else if(center < 0){
         CombatLog.addLine("Attack was too low");
         CombatLog.addLine("Fill the aim bar more.");
     } else if(center >= t.GetSections().Count) {
         CombatLog.addLine("Attack was too high");
         CombatLog.addLine("Lower the aim bar.");
     }
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:14,代码来源:DefaultWeaponEffect.cs

示例8: DoDamage

 public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSec)
 {
     List<Section> selfSections = GetDamagedSections(self, firingSec);
     foreach(Section sec in selfSections) {
         int height = sec.attributes.height;
         int d = (int)(damage*poisonedDamageModifier/100);
         CombatLog.addLine("Hit own section " + height + " for " + d + " damage.");
         self.DamageSection(height-1, d);
     }
     t.DamageSection(center, damage);
     if(center < 0) {
         CombatLog.addLine("Attack was too low");
         CombatLog.addLine("Fill the aim bar more.");
     } else if(center >= t.GetSections().Count) {
         CombatLog.addLine("Attack was too high");
         CombatLog.addLine("Lower the aim bar.");
     }
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:18,代码来源:PoisonedSplash.cs

示例9: DoDamage

 public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSec)
 {
     List<Section> damagedSections = GetDamagedSections(t, center);
     foreach(Section g in damagedSections) {
         int height = g.attributes.height;
         int d = (int)(percentDamage[upgradeLevel] * damage);
         CombatLog.addLine("Hit section " + height + " for " + d + " damage.");
         g.attributes.material.GetSectionEffect().ApplyDamage(g, d);
         //t.DamageSection(height-1, (int)(percentDamage[upgradeLevel] * damage));
     }
     if(damagedSections.Count <= 0) {
         if(center < 0) {
             CombatLog.addLine("Attack was too low");
             CombatLog.addLine("Fill the aim bar more.");
         } else if(center >= t.GetSections().Count) {
             CombatLog.addLine("Attack was too high");
             CombatLog.addLine("Lower the aim bar.");
         }
     }
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:20,代码来源:AreaOfEffect.cs

示例10: DoDamage

 public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSec)
 {
     List<Section> sections = GetDamagedSections(t, center);
     if(sections.Count >= 1) {
         Section section = sections[0];
         CombatLog.addLine("Hit section " + (section.attributes.height + 1) + " for " + damage + " damage.");
         //t.DamageSection(center, damage);
         section.attributes.material.GetSectionEffect().ApplyDamage(section, damage);
     } else if(center < 0) {
         CombatLog.addLine("Attack was too low");
     } else if(center >= t.GetSections().Count) {
         CombatLog.addLine("Attack was too high");
     }
     numAttacks--;
     if (numAttacks <= 0)
     {
         self.GetSection(firingSec).attributes.weapon.SetWeaponEffect(new DefaultWeaponEffect(self.GetSection(firingSec).attributes.weapon));
         Destruct();
     }
 }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:20,代码来源:Blinded.cs

示例11: DoDamage

    public override void DoDamage(Tower t, int center, int damage, Tower self, int firingSec)
    {
        List<Section> sections = GetDamagedSections(self, firingSec);
        if(sections.Count >= 1) {
            CombatLog.addLine("Hit section " + (center+1) + " for " + damage + " damage.");
            //t.DamageSection(center, damage);
            t.GetSection (center).attributes.material.GetSectionEffect().ApplyDamage(t.GetSection(center), damage);

            if (t.GetSection(center).attributes.HasWeapon()){
                CombatLog.addLine("Section is confused");
                t.GetSection(center).attributes.material.GetSectionEffect().Destruct();
                t.GetSection(center).attributes.material.SetSectionEffect(new Poisoned(t.GetSection(center)));
            }
        }
        else if(center < 0) {
            CombatLog.addLine("Attack was too low");
            CombatLog.addLine("Fill the aim bar more.");
        } else if(center >= t.GetSections().Count) {
            CombatLog.addLine("Attack was too high");
            CombatLog.addLine("Lower the aim bar.");
        }
    }
开发者ID:austinblakeslee,项目名称:verthex,代码行数:22,代码来源:PoisonSplash.cs


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