public VChar Build(PChar proxy) { var view = CharBridge.Instance.GetRandomizedCharacterSprites(proxy.GetParams()); view.Name = proxy.GetParams().Name; view.Type = proxy.GetParams().Type; view.Race = proxy.GetParams().Race; if (proxy.GetArmor() != null) { view.Armor = EquipmentBridge.Instance.GetRandomArmorSprite(proxy.GetArmor().Params); } if (proxy.GetHelm() != null) { view.Helm = EquipmentBridge.Instance.GetRandomArmorSprite(proxy.GetHelm().Params); } if (proxy.GetLWeapon() != null) { view.LWeapon = EquipmentBridge.Instance.GetRandomWeaponSprite(proxy.GetLWeapon().Params); } if (proxy.GetMount() != null) { view.Mount = MountBridge.Instance.GetMountSprites(proxy.GetMount().Params); } if (proxy.GetRWeapon() != null) { view.RWeapon = EquipmentBridge.Instance.GetRandomWeaponSprite(proxy.GetRWeapon().Params); } return(view); }
private double GetArmorNegation(MHit hit, PChar src, PChar tgt, double baseNegation, bool helm) { double negation = baseNegation; if (helm && tgt.GetHelm() != null) { negation += tgt.GetHelm().GetStat(EArmorStat.Flat_Damage_Ignore); negation *= tgt.GetHelm().GetDurabilityPercentage(); } else if (!helm && tgt.GetArmor() != null) { negation += tgt.GetArmor().GetStat(EArmorStat.Flat_Damage_Ignore); negation *= tgt.GetArmor().GetDurabilityPercentage(); } if (hit.Data.IsWeapon) { double modifier = 1; if (hit.Data.IsLWeapon) { modifier *= (src.GetLWeapon().GetStat(EWeaponStat.Armor_Pierce) / src.GetLWeapon().GetDurabilityPercentage()); } else { modifier *= (src.GetRWeapon().GetStat(EWeaponStat.Armor_Pierce) / src.GetRWeapon().GetDurabilityPercentage()); } negation *= modifier; } negation /= hit.Data.Ability.Data.ArmorPierceMod; negation *= hit.Data.ModData.SrcArmorPierceMod; return(negation); }
private double GetDmgReduction(MHit hit, PChar src, PChar tgt, double baseReduce, bool helm) { double reduction = baseReduce; if (helm && tgt.GetHelm() != null) { reduction *= tgt.GetHelm().GetStat(EArmorStat.Damage_Mod) / tgt.GetHelm().GetDurabilityPercentage(); } else if (!helm && tgt.GetArmor() != null) { reduction *= tgt.GetArmor().GetStat(EArmorStat.Damage_Mod) / tgt.GetArmor().GetDurabilityPercentage(); } if (hit.Data.IsWeapon) { double modifier = 1; if (hit.Data.IsLWeapon) { modifier *= (src.GetLWeapon().GetStat(EWeaponStat.Armor_Ignore) / src.GetLWeapon().GetDurabilityPercentage()); } else { modifier *= (src.GetRWeapon().GetStat(EWeaponStat.Armor_Ignore) / src.GetRWeapon().GetDurabilityPercentage()); } reduction /= modifier; } reduction *= hit.Data.Ability.Data.ArmorIgnoreMod; reduction *= hit.Data.ModData.SrcArmorIgnoreMod; return(reduction); }
public void SetModalStatValues(PChar c) { if (c.GetArmor() != null) { this._armorSlider.maxValue = (float)c.GetArmor().GetStat(EArmorStat.Durability); this._armorSlider.value = (float)c.GetArmor().GetStat(EArmorStat.Durability); } else { this._armorSlider.maxValue = 0; } if (c.GetHelm() != null) { this._helmSlider.maxValue = (float)c.GetHelm().GetStat(EArmorStat.Durability); this._helmSlider.value = (float)c.GetHelm().GetStat(EArmorStat.Durability); } else { this._helmSlider.maxValue = 0; } if (c.GetLWeapon() != null) { this._lWeaponSlider.maxValue = (float)c.GetLWeapon().GetStat(EWeaponStat.Max_Durability); this._lWeaponSlider.value = (float)c.GetLWeapon().GetStat(EWeaponStat.Max_Durability); } else { this._lWeaponSlider.maxValue = 0; } if (c.GetRWeapon() != null) { this._rWeaponSlider.maxValue = (float)c.GetRWeapon().GetStat(EWeaponStat.Max_Durability); this._rWeaponSlider.value = (float)c.GetRWeapon().GetStat(EWeaponStat.Max_Durability); } else { this._rWeaponSlider.maxValue = 0; } this._hpSlider.maxValue = (int)c.GetStat(ESecondaryStat.HP); this._hpSlider.value = (int)c.GetPoints(ESecondaryStat.HP); this._moraleSlider.maxValue = (int)c.GetStat(ESecondaryStat.Morale); this._moraleSlider.value = (int)c.GetPoints(ESecondaryStat.Morale); this._stamSlider.maxValue = (int)c.GetStat(ESecondaryStat.Stamina); this._stamSlider.value = (int)c.GetPoints(ESecondaryStat.Stamina); }