public void ParseInfo(Hashtable info) { mRaw = info; this.id = info.GetValue <string>((int)SPC.Id, string.Empty); this.template = info.GetValue <string>((int)SPC.Template, string.Empty); this.level = info.GetValue <int>((int)SPC.Level, 0); //this.damage = info.Value<float>((int)SPC.Damage); this.optimalDistance = info.GetValue <float>((int)SPC.OptimalDistance, 0f); this.color = (ObjectColor)(byte)info.GetValue <int>((int)SPC.Color, (int)(byte)ObjectColor.white); this.damageType = (WeaponDamageType)(byte)info.GetValue <int>((int)SPC.DamageType, 0); this.baseCritChance = info.GetValue <float>((int)SPC.CritChance, 0f); this.mWorkshop = info.GetValue <int>((int)SPC.Workshop, (int)(byte)Workshop.DarthTribe); binded = info.GetValue <bool>((int)SPC.Binded, false); isNew = info.GetValue <bool>((int)SPC.IsNew, false); m_Damage.SetRocketDamage(info.GetValue <float>((int)SPC.RocketDamage, 0f)); m_Damage.SetLaserDamage(info.GetValue <float>((int)SPC.LaserDamage, 0f)); m_Damage.SetAcidDamage(info.GetValue <float>((int)SPC.AcidDamage, 0f)); int iBaseType = info.GetValue <int>((int)SPC.WeaponBaseType, (int)WeaponBaseType.None); WeaponBaseType wbt = (WeaponBaseType)iBaseType; if (wbt == WeaponBaseType.None) { wbt = WeaponBaseType.Laser; } m_Damage.SetBaseType(wbt); }
public SpaceDamage(HexCoordinates target, HexDirection direction, WeaponDamageType damageType) { ImpactedTile = target; ImpactDirection = direction; DirectionalMod = direction; WeaponDamageType = damageType; }
private void RevealWeakness(WeaponDamageType damageType) { var found = false; KeyValuePair <WeaponDamageType, bool> eStruct; foreach (var type in enemy._damageTypeWeaknesses. Where(t => t.Key == damageType)) { if (type.Value) { continue; } found = true; eStruct = type; var enemies = EnemyManager.Enemies; foreach (var t in enemies.Where(t => t.characterName == enemy.characterName)) { t._damageTypeWeaknesses[type.Key] = true; break; } } if (found) { enemy._damageTypeWeaknesses[eStruct.Key] = true; } }
public WeaponObject( string id, string template, int level, //float damage, WeaponDamage damage, float optimalDistance, ObjectColor color, WeaponDamageType damageType, float inBaseCritChance, int workshop) { this.id = id; this.template = template; this.level = level; //this.damage = damage; m_Damage.SetFromDamage(damage); this.optimalDistance = optimalDistance; this.color = color; this.damageType = damageType; this.baseCritChance = inBaseCritChance; this.mWorkshop = workshop; isNew = true; mRaw = GetInfo(); }
public WeaponDropParams(IRes resource, int level, Workshop workshop, WeaponDamageType damageType, Difficulty difficulty) { this.resource = resource; this.level = level; this.workshop = workshop; this.damageType = damageType; this.difficulty = difficulty; }
public SpecialEffect(HexCoordinates target, HexDirection direction, WeaponDamageType damageType) : base(target, direction, damageType) { ImpactedTile = target; ImpactDirection = direction; DirectionalMod = direction; WeaponDamageType = damageType; _IsSpecial = true; }
public int GetResistAmount(WeaponDamageType type) { if ((ResistDamageType & type) != 0) { return(ArmorHardnessValue * 5); } else { return(0); } }
/// <summary> /// Get the damage amount for an attack made with damageType. /// </summary> /// <param name="damageType">damageType of damaging weapon</param> /// <param name="damageAmount">raw damage dealth via attack</param> /// <param name="armorAmount">target's armor</param> /// <param name="flanking">is the target being flanked?</param> /// <param name="cavbonus">is the attacker a horsie?</param> /// <returns>tuple HealthDam,ArmorDam</returns> public static Tuple <float, float> HealthDamage(this WeaponDamageType damageType, float damageAmount, float armorAmount, bool flanking, bool cavbonus) { float HealthDam = 0; float ArmorDam = 0; float FlankingBonus = flanking? (cavbonus ? 1.33f : 1.5f): 1; switch (damageType) { case WeaponDamageType.Blunt: ArmorDam = damageAmount * FlankingBonus; if (ArmorDam > armorAmount) { HealthDam = ArmorDam - armorAmount; ArmorDam = armorAmount; } HealthDam += ArmorDam * .33f; return(new Tuple <float, float>(HealthDam, ArmorDam)); case WeaponDamageType.Edged: if (!flanking) { if (armorAmount > 0) { return(new Tuple <float, float>(0, 0)); } return(new Tuple <float, float>(damageAmount * FlankingBonus, 0)); } ArmorDam = damageAmount * FlankingBonus - damageAmount; if (ArmorDam > armorAmount) { HealthDam = ArmorDam - armorAmount; ArmorDam = armorAmount; } return(new Tuple <float, float>(HealthDam, ArmorDam)); case WeaponDamageType.Magic: return(new Tuple <float, float>(damageAmount, 0)); case WeaponDamageType.Pierce: ArmorDam = damageAmount * FlankingBonus; if (ArmorDam > armorAmount) { HealthDam = ArmorDam - armorAmount; ArmorDam = armorAmount; } HealthDam += ArmorDam * .5f; return(new Tuple <float, float>(HealthDam, ArmorDam)); case WeaponDamageType.UNASSIGNED: return(new Tuple <float, float>(0, 0)); } throw new Exception("Unrecongized damage type!"); }
public PetInfo() { m_Id = Guid.NewGuid().ToString(); m_Exp = 0; m_Color = PetColor.gray; m_Type = string.Empty; m_PassiveSkill = -1; m_ActiveSkills = new List <PetActiveSkill>(); m_Active = false; m_DamageType = WeaponDamageType.damage; m_KilledTime = 0; m_Mastery = 0; }
private void EvaluateState(WeaponDamageType damageType) { if (currentState == UnitStates.Checkmate) { return; } var tryGetType = unitBase._damageTypeWeaknesses.ContainsKey(damageType); if (tryGetType) { EvaluateShield(); } }
public void ParseInfo(System.Collections.Hashtable info) { rawHash = info; this.id = info.GetValue <string>((int)SPC.Id, string.Empty); this.template = info.GetValue <string>((int)SPC.Template, string.Empty); this.level = info.GetValue <int>((int)SPC.Level, 0); this.damage = info.Value <float>((int)SPC.Damage); this.optimalDistance = info.GetValue <float>((int)SPC.OptimalDistance, 0f); this.color = (ObjectColor)(byte)info.GetValue <int>((int)SPC.Color, (int)(byte)ObjectColor.white); this.damageType = (WeaponDamageType)(byte)info.Value <byte>((int)SPC.DamageType); this.baseCritChance = (float)info.GetValue <float>((int)SPC.CritChance, 0f); workshop = (Workshop)(byte)(int)info.GetValue <int>((int)SPC.Workshop, (int)Workshop.DarthTribe); binded = info.GetValue <bool>((int)SPC.Binded, binded); }
private void RevealWeakness(WeaponDamageType damageType) { var list = weaknessesBox.transform.GetComponentsInChildren <Image>(); foreach (var image in list) { if (image.name != damageType.icon.name) { continue; } if (image.GetComponent <Image>().sprite == damageType.Icon) { return; } image.GetComponent <Image>().sprite = damageType.Icon; } }
public WeaponObject(WeaponGenList gen) { this.id = gen.id; this.template = gen.template; this.level = gen.level; this.optimalDistance = gen.optimalDistance; this.color = gen.color; this.damageType = WeaponDamageType.damage; this.baseCritChance = gen.critChance; this.mWorkshop = (byte)gen.workshop; this.binded = false; this.isNew = false; m_Damage.SetRocketDamage(gen.rocketDamage); m_Damage.SetLaserDamage(gen.laserDamage); m_Damage.SetAcidDamage(gen.acidDamage); m_Damage.SetBaseType(gen.baseType); mRaw = GetInfo(); }
private void RevealWeakness(WeaponDamageType damageType) { var found = false; KeyValuePair <WeaponDamageType, bool> eStruct; foreach (var type in enemy._damageTypeWeaknesses. Where(t => t.Key == damageType)) { if (type.Value) { continue; } found = true; eStruct = type; EnemyManager.Enemies.ForEach(e => { if (e.characterName == enemy.characterName) { e._damageTypeWeaknesses[type.Key] = true; } }); var enemies = new List <Enemy>(Battle.Engine.enemiesForThisBattle); foreach (var t in enemies.Where(t => t.characterName == enemy.characterName)) { if (t == enemy) { continue; } t._damageTypeWeaknesses[type.Key] = true; t.Unit.profileBoxManagerUI.UpdateProfileBox(); } } if (found) { enemy._damageTypeWeaknesses[eStruct.Key] = true; } }
public void ParseInfo(Hashtable info) { rawHash = info; this.id = info.GetValueString((int)SPC.Id); this.template = info.GetValueString((int)SPC.Template); this.level = info.GetValueInt((int)SPC.Level); this.damage = info.GetValueFloat((int)SPC.Damage); this.optimalDistance = info.GetValueFloat((int)SPC.OptimalDistance); this.color = (ObjectColor)(byte)info.GetValueInt((int)SPC.Color, (int)(byte)ObjectColor.white); this.damageType = (WeaponDamageType)(byte)info.GetValueByte((int)SPC.DamageType); this.baseCritChance = (float)info.GetValueFloat((int)SPC.CritChance); workshop = (Workshop)(byte)(int)info.GetValueInt((int)SPC.Workshop, (int)Workshop.DarthTribe); binded = info.GetValueBool((int)SPC.Binded, binded); isNew = info.GetValueBool((int)SPC.IsNew); rocketDamage = info.GetValueFloat((int)SPC.RocketDamage); laserDamage = info.GetValueFloat((int)SPC.LaserDamage); acidDamage = info.GetValueFloat((int)SPC.AcidDamage); baseType = (WeaponBaseType)info.GetValueInt((int)SPC.WeaponBaseType, (int)WeaponBaseType.Rocket); }
public DamageResistance(WeaponDamageType damageType, int value) { DamageType = damageType; Value = value; }
public void SetDamageType(WeaponDamageType dt) { damageType = dt; }
public void SetDamageType(WeaponDamageType damageType) { m_DamageType = damageType; }
public WeaponBuilder SetDamageType(WeaponDamageType weaponDamageType) { this.weaponDamageTypes = new WeaponDamageType[] { weaponDamageType }; return(this); }
public DamageResistance(WeaponDamageType damageType, int value, Object source) { DamageType = damageType; Value = value; Source = source; }
public void SetDamageType(WeaponDamageType damageType) { overwrite.SetDamageType(damageType); }