public override void apply() { PhysicalDamage physicalDamage = creator.getStats().getPhysicalDamage(); affectedEntities.ForEach(entity => physicalDamage.applyDamage(entity)); }
public void loadFromXML(String fileName) { XmlDocument doc = new XmlDocument(); doc.Load(fileName); name = doc.SelectSingleNode("//character").Attributes["name"].Value; foreach (XmlNode statNode in doc.SelectNodes("//stat")) { switch (statNode.Attributes["key"].Value) { case "level": level = Int32.Parse(statNode.Attributes["value"].Value); break; case "ATK": ATK = Int32.Parse(statNode.Attributes["value"].Value); break; case "DEF": DEF = Int32.Parse(statNode.Attributes["value"].Value); break; case "VIT": VIT = Int32.Parse(statNode.Attributes["value"].Value); break; case "SKL": SKL = Int32.Parse(statNode.Attributes["value"].Value); break; case "MATK": MATK = Int32.Parse(statNode.Attributes["value"].Value); break; case "MDEF": MDEF = Int32.Parse(statNode.Attributes["value"].Value); break; case "AGI": AGI = Int32.Parse(statNode.Attributes["value"].Value); break; case "LCK": LCK = Int32.Parse(statNode.Attributes["value"].Value); break; } } abilities.Clear(); foreach (XmlNode abilityNode in doc.SelectNodes("//ability")) { Ability a = new Ability(); int _pow, _acc, _crit; a.Name = abilityNode.Attributes["name"].Value; a.SpCost = Int32.Parse(abilityNode.Attributes["sp"].Value); foreach (XmlNode effectNode in doc.SelectNodes("//ability[@name='" + a.Name + "']/effect")) { Effect e = null; String _type = effectNode.Attributes["type"].Value; try { _pow = Int32.Parse(effectNode.Attributes["pow"].Value); } catch (NullReferenceException) { _pow = 0; } try { _acc = Int32.Parse(effectNode.Attributes["acc"].Value); } catch (NullReferenceException) { _acc = 0; } try { _crit = Int32.Parse(effectNode.Attributes["crit"].Value); } catch (NullReferenceException) { _crit = 0; } switch (_type) { case "pdmg": e = new PhysicalDamage(_pow, _acc, _crit); break; case "mdmg": e = new MagicalDamage(_pow, _acc, _crit); break; case "heal": e = new Heal(_pow, _acc, _crit); break; case "spd": e = new SPDrain(_pow, _acc, _crit); break; case "spr": e = new SPRecovery(_pow, _acc, _crit); break; case "psn": e = new PoisonEnemy(_acc); break; case "psnself": e = new PoisonSelf(_acc); break; case "par": e = new ParalyzeEnemy(_acc); break; case "parself": e = new ParalyzeSelf(_acc); break; case "bli": e = new BlindEnemy(_acc); break; case "bliself": e = new BlindSelf(_acc); break; case "cleanse": e = new Cleanse(); break; } a.Effects.Add(e); } abilities.Add(a); } reset(); selectedAbility = abilities[0]; }
public Attack(float multiplier) { Multiplier = multiplier; Damage = new PhysicalDamage(Multiplier); Effect = new Damage(Damage); }
public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); if (m_Exceptional) { list.Add(1060636); // exceptional } if (m_Crafter != null) { list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~ } int ammoamount = (Ammo != null ? Ammo.Amount : 0); list.Add((Ammo is Bolt ? 1075266 : 1075265), "{0}\t{1}", ammoamount.ToString(), MaxAmmo.ToString()); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows/bolts if (DamageModifier != 0) { list.Add(1074762, DamageModifier.ToString()); // Damage Modifier: ~1_PERCENT~% } list.Add(1075085); // Requirement: Mondain's Legacy int prop; if ((prop = Attributes.WeaponDamage) != 0) { list.Add(1060401, prop.ToString()); // damage increase ~1_val~% } if ((prop = Attributes.DefendChance) != 0) { list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% } if ((prop = Attributes.BonusDex) != 0) { list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ } if ((prop = Attributes.EnhancePotions) != 0) { list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% } if ((prop = Attributes.CastRecovery) != 0) { list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ } if ((prop = Attributes.CastSpeed) != 0) { list.Add(1060413, prop.ToString()); // faster casting ~1_val~ } if ((prop = Attributes.AttackChance) != 0) { list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% } if ((prop = Attributes.BonusHits) != 0) { list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ } if ((prop = Attributes.BonusInt) != 0) { list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ } if ((prop = Attributes.LowerManaCost) != 0) { list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% } if ((prop = Attributes.LowerRegCost) != 0) { list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% } if ((prop = Attributes.LowerAmmoCost) != 0) { list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~% } if ((prop = Attributes.Luck) != 0) { list.Add(1060436, prop.ToString()); // luck ~1_val~ } if ((prop = Attributes.BonusMana) != 0) { list.Add(1060439, prop.ToString()); // mana increase ~1_val~ } if ((prop = Attributes.RegenMana) != 0) { list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ } if ((prop = Attributes.NightSight) != 0) { list.Add(1060441); // night sight } if ((prop = Attributes.ReflectPhysical) != 0) { list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% } if ((prop = Attributes.RegenStam) != 0) { list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ } if ((prop = Attributes.RegenHits) != 0) { list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ } if ((prop = Attributes.SpellChanneling) != 0) { list.Add(1060482); // spell channeling } if ((prop = Attributes.SpellDamage) != 0) { list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% } if ((prop = Attributes.BonusStam) != 0) { list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ } if ((prop = Attributes.BonusStr) != 0) { list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ } if ((prop = Attributes.WeaponSpeed) != 0) { list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% } if (DirectDamage != 0) { list.Add(1079978, DirectDamage.ToString()); // Direct Damage: ~1_PERCENT~% } if (PhysicalDamage != 0) { list.Add(1060403, PhysicalDamage.ToString()); // physical damage ~1_val~% } if (FireDamage != 0) { list.Add(1060405, FireDamage.ToString()); // fire damage ~1_val~% } if (ColdDamage != 0) { list.Add(1060404, ColdDamage.ToString()); // cold damage ~1_val~% } if (PoisonDamage != 0) { list.Add(1060406, PoisonDamage.ToString()); // poison damage ~1_val~% } if (EnergyDamage != 0) { list.Add(1060407, EnergyDamage.ToString()); // energy damage ~1_val~% } if (ChaosDamage != 0) { list.Add(1072846, ChaosDamage.ToString()); // chaos damage ~1_val~% } GetSetArmorPropertiesFirst(list); this.AddContentProperty(list); if (WeightReduction != 0) { list.Add(1072210, WeightReduction.ToString()); // Weight reduction: ~1_PERCENTAGE~% } GetSetArmorPropertiesSecond(list); }
private void ApplyProperties(PhysicalDamage damage) { damage.AddMaterial(PhysicalDamageMaterial.ColdIron); }