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 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 override MParty Build(PartyBuildParams arg) { var characterFactory = new CharacterFactory(); if (PartyTable.Instance.Table[arg.Culture].ContainsKey(arg.Name)) { var party = new MParty(); var subParties = PartyTable.Instance.Table[arg.Culture][arg.Name]; foreach (var subParty in subParties) { var subPartyParams = new SubPartyBuildParams(); subPartyParams.culture = arg.Culture; subPartyParams.Name = subParty.X; subPartyParams.Remaining = (subParty.Y * arg.Difficulty); var subPartyCharacters = this._subPartyBuilder.Build(subPartyParams); if (subPartyCharacters != null) { foreach (var character in subPartyCharacters) { var model = characterFactory.CreateNewCharacter(character.X); var controller = new CChar(); var proxy = new PChar(model); proxy.StartCol = character.Y; controller.SetProxy(proxy); party.AddChar(controller); } } } return(party); } else { return(null); } }
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); }
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); }
private double GetHitDamageIgnore(MHit hit, PChar src, PChar tgt) { double flatDmgNegate = tgt.GetStat(ESecondaryStat.Damage_Ignore); 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()); } flatDmgNegate *= modifier; } return(flatDmgNegate); }
private void Process() { if (PredefinedCharTable.Instance.Table.ContainsKey(this._data.ToSummon)) { var preCharParams = PredefinedCharTable.Instance.Table[this._data.ToSummon]; var factory = new CharacterFactory(); var summon = factory.CreateNewCharacter(preCharParams); summon.SetLParty(this._data.LParty); var controller = new CChar(); var proxy = new PChar(summon); controller.SetProxy(proxy); this._data.Party.AddChar(controller); CombatManager.Instance.ProcessSummon(controller); this._data.TargetTile = this._data.TargetTile.GetNearestEmptyTile(); CharLoader.Instance.LoadSummon(controller, this._data.TargetTile); proxy.SetPointsToMax(ESecondaryStat.AP); proxy.SetPointsToMax(ESecondaryStat.HP); proxy.SetPointsToMax(ESecondaryStat.Stamina); proxy.SetPointsToMax(ESecondaryStat.Morale); this.ProcessParticles(controller); } }
public override void TryProcessAdd(PChar character, object equipment) { base.TryProcessAdd(character, equipment); if (equipment.GetType().Equals(typeof(CWeapon))) { //var wpn = equipment as CWeapon; //if (wpn.Model.Data.WpnType == EWeaponType.Two_Handed) //{ // var mightMod = new IndefPrimaryStatMod(EPrimaryStat.Might, this.Val); // var gearMods = character.GetMods().GetIndefPStatGearMods(); // var wpnMods = gearMods.Find(x => x.X.Equals(wpn)); // if (wpnMods.X != null) // { // wpnMods.Y.Add(mightMod); // } // else // { // var list = new List<IndefPrimaryStatMod>() { mightMod }; // var pair = new Pair<object, List<IndefPrimaryStatMod>>(wpn, list); // character.GetMods().AddMod(pair); // } //} } }
public void SetHoverModalStatValues(PChar c) { this._hoverModal.SetModalStatValues(c); }
public void SetProxy(PChar p) { this._proxy = p; p.SetController(this); }
public virtual void TryProcessRemove(PChar character, object equipment) { }