Skip to content

Commit

Permalink
make crossbows benefit from bows features as a setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ThyWoof committed Jun 9, 2022
1 parent 176ba61 commit 8566ec8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
8 changes: 8 additions & 0 deletions SolastaCommunityExpansion/Displays/RulesDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ internal static void DisplayRules()

UI.Label("");

toggle = Main.Settings.AllowCrossbowsToUseBowFeatures;
if (UI.Toggle(Gui.Localize("ModUi/&AllowCrossbowsToUseBowFeatures"), ref toggle, UI.AutoWidth()))
{
Main.Settings.AllowCrossbowsToUseBowFeatures = toggle;
}

UI.Label("");

toggle = Main.Settings.AddBleedingToLesserRestoration;
if (UI.Toggle(Gui.Localize("ModUi/&AddBleedingToLesserRestoration"), ref toggle, UI.AutoWidth()))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ internal static class RulesetCharacterHero_IsWieldingBow
{
internal static bool Prefix(RulesetCharacterHero __instance, ref bool __result)
{
if (!Main.Settings.AllowCrossbowsToUseBowFeatures)
{
return true;
}

var equipedItem = __instance.characterInventory.InventorySlotsByName[EquipmentDefinitions.SlotTypeMainHand]
.EquipedItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ ModUi/&UnlockMarkAndTatoosForAllCharacters Schalte Markierungen und Tattoos für
ModUi/&UsableDevice <color=yellow>Verwendbares Gerät</color>
ModUi/&UseOfficialAdvantageDisadvantageRules Verwenden Sie die offiziellen Vorteils- / Nachteilsregeln
ModUi/&Visuals <color=yellow>Visuals:</color>
ModUi/&Weapon <color=yellow>Waffen</color>
ModUi/&Weapon <color=yellow>Waffen</color>
ModUi/&AllowCrossbowsToUseBowFeatures Ermöglichen Sie Armbrüsten, von den Bogenfunktionen zu profitieren
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ ModUi/&UnlockMarkAndTatoosForAllCharacters Unlock markings and tattoos for all c
ModUi/&UsableDevice <color=yellow>Usable Device</color>
ModUi/&UseOfficialAdvantageDisadvantageRules Use official advantage / disadvantage rules
ModUi/&Visuals <color=yellow>Visuals:</color>
ModUi/&Weapon <color=yellow>Weapons</color>
ModUi/&Weapon <color=yellow>Weapons</color>
ModUi/&AllowCrossbowsToUseBowFeatures Allow crossbows to benefit from bows features
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ ModUi/&UnlockMarkAndTatoosForAllCharacters Débloquez des marquages ​​et des
ModUi/&UsableDevice <color=yellow>Appareil utilisable</color>
ModUi/&UseOfficialAdvantageDisadvantageRules Utiliser les règles officielles d'avantage/désavantage
ModUi/&Visuals <color=yellow>Visuels :</color>
ModUi/&Weapon <color=yellow>Armes</color>
ModUi/&Weapon <color=yellow>Armes</color>
ModUi/&AllowCrossbowsToUseBowFeatures Permettre aux arbalètes de bénéficier des fonctionnalités des arcs
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ ModUi/&UnlockMarkAndTatoosForAllCharacters Desbloqueie marcações e tatuagens p
ModUi/&UsableDevice <color=yellow>Dispositivos</color>
ModUi/&UseOfficialAdvantageDisadvantageRules Use regras oficiais de vantagem/desvantagem
ModUi/&Visuals <color=yellow>Visual:</color>
ModUi/&Weapon <color=yellow>Armas</color>
ModUi/&Weapon <color=yellow>Armas</color>
ModUi/&AllowCrossbowsToUseBowFeatures Permitir que as bestas se beneficiem dos recursos dos arcos
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ ModUi/&UnlockMarkAndTatoosForAllCharacters Разблокировать отме
ModUi/&UsableDevice <color=yellow>Используемое устройство</color>
ModUi/&UseOfficialAdvantageDisadvantageRules Использовать официальные правила преимущества/помехи
ModUi/&Visuals <color=yellow>Визуальные эффекты:</color>
ModUi/&Weapon <color=yellow>Оружие</color>
ModUi/&Weapon <color=yellow>Оружие</color>
ModUi/&AllowCrossbowsToUseBowFeatures Разрешить арбалетам пользоваться преимуществами луков
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ ModUi/&UnlockMarkAndTatoosForAllCharacters 解锁全部角色的标记和纹身
ModUi/&UsableDevice <color=yellow>可用装置</color>
ModUi/&UseOfficialAdvantageDisadvantageRules 应用官方的优势/劣势规则
ModUi/&Visuals <color=yellow>视效:</color>
ModUi/&Weapon <color=yellow>武器</color>
ModUi/&Weapon <color=yellow>武器</color>
ModUi/&AllowCrossbowsToUseBowFeatures 允许弩从弓相关的特性中收益
1 change: 1 addition & 0 deletions SolastaCommunityExpansion/Utils/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public class Settings : UnityModManager.ModSettings

// SRD
public bool UseOfficialAdvantageDisadvantageRules { get; set; }
public bool AllowCrossbowsToUseBowFeatures { get; set; }
public bool AddBleedingToLesserRestoration { get; set; }
public bool BlindedConditionDontAllowAttackOfOpportunity { get; set; }
public bool AllowTargetingSelectionWhenCastingChainLightningSpell { get; set; }
Expand Down

0 comments on commit 8566ec8

Please sign in to comment.