Beispiel #1
0
    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.");
        }
    }
 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;
 }
 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.");
     }
 }
 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;
 }
Beispiel #5
0
 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");
     }
 }
    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.");
        }
    }
 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.");
     }
 }
 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.");
     }
 }
 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.");
         }
     }
 }
Beispiel #10
0
 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();
     }
 }
Beispiel #11
0
    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.");
        }
    }