-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
XeoNovaDan
committed
Sep 25, 2018
1 parent
7dd7710
commit d1a4246
Showing
22 changed files
with
240 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<LanguageData> | ||
|
||
<!-- Settings --> | ||
<TargetingModesSettingsCategory>Targeting Modes</TargetingModesSettingsCategory> | ||
<Settings_AccuracyPenalties>Accuracy penalties</Settings_AccuracyPenalties> | ||
<Settings_AccuracyPenalties_Tooltip>Whether or not targeting modes have an effect on the accuracy of a pawn's attacks.</Settings_AccuracyPenalties_Tooltip> | ||
|
||
<Settings_TargModeResetFrequency>Targeting mode resetting frequency</Settings_TargModeResetFrequency> | ||
<Settings_TargModeResetFrequency_0>Never</Settings_TargModeResetFrequency_0> | ||
<Settings_TargModeResetFrequency_1>1d</Settings_TargModeResetFrequency_1> | ||
<Settings_TargModeResetFrequency_2>12h</Settings_TargModeResetFrequency_2> | ||
<Settings_TargModeResetFrequency_3>6h</Settings_TargModeResetFrequency_3> | ||
<Settings_TargModeResetFrequency_4>3h</Settings_TargModeResetFrequency_4> | ||
<Settings_TargModeResetFrequency_5>1h</Settings_TargModeResetFrequency_5> | ||
|
||
<Settings_RaidersUseTargetingModes>Hostile NPCs use Targeting Modes</Settings_RaidersUseTargetingModes> | ||
<Settings_RaidersUseTargetingModes_Tooltip>Whether or not any hostile NPCs are able to use targeting modes other than general.</Settings_RaidersUseTargetingModes_Tooltip> | ||
<Settings_MinRaiderWeaponSkill>Minimum weapon skill for raiders</Settings_MinRaiderWeaponSkill> | ||
<Settings_MechTargModeChance>Chance for mechanoids</Settings_MechTargModeChance> | ||
<Settings_BaseManhunterTargModeChance>Base chance for manhunters</Settings_BaseManhunterTargModeChance> | ||
|
||
<!-- GameplayCommands --> | ||
<CommandSetTargetingModeMulti>Set targeting mode</CommandSetTargetingModeMulti> | ||
<CommandSetTargetingMode>Targeting: {0}</CommandSetTargetingMode> | ||
<CommandSetTargetingModeDesc>Determine which targeting mode the pawn should use.</CommandSetTargetingModeDesc> | ||
|
||
</LanguageData> |
Binary file not shown.
Binary file modified
BIN
+8 KB
(100%)
Source/TargetingModes/.vs/TargetingModes/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Source/TargetingModes/.vs/TargetingModes/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Source/TargetingModes/.vs/TargetingModes/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using UnityEngine; | ||
using Verse; | ||
using RimWorld; | ||
using SettingsHelper; | ||
|
||
namespace TargetingModes | ||
{ | ||
public class TargetingModesSettings : ModSettings | ||
{ | ||
|
||
public static bool accuracyPenalties = true; | ||
#region TargModeResetFrequencyInt | ||
private static float targModeResetFrequencyInt = 3f; | ||
public static int TargModeResetFrequencyInt => | ||
(int)targModeResetFrequencyInt; | ||
#endregion | ||
public static bool raidersUseTargModes = true; | ||
#region MinimumSkillForRandomTargetingMode | ||
private static float raiderMinSkillForTargMode = 8f; | ||
public static int MinimumSkillForRandomTargetingMode => | ||
(int)raiderMinSkillForTargMode; | ||
#endregion | ||
public static float mechanoidTargModeChance = 0.35f; | ||
public static float baseManhunterTargModeChance = 0.2f; | ||
|
||
public void DoWindowContents(Rect wrect) | ||
{ | ||
Listing_Standard options = new Listing_Standard(); | ||
Color defaultColor = GUI.color; | ||
options.Begin(wrect); | ||
|
||
GUI.color = defaultColor; | ||
Text.Font = GameFont.Small; | ||
Text.Anchor = TextAnchor.UpperLeft; | ||
options.Gap(); | ||
// General settings | ||
options.CheckboxLabeled("Settings_AccuracyPenalties".Translate(), ref accuracyPenalties, "Settings_AccuracyPenalties_Tooltip".Translate()); | ||
options.Gap(); | ||
options.AddLabeledSlider("Settings_TargModeResetFrequency".Translate(), ref targModeResetFrequencyInt, 0, 5, | ||
rightAlignedLabel: $"Settings_TargModeResetFrequency_{targModeResetFrequencyInt}".Translate(), roundTo: 1); | ||
options.GapLine(24); | ||
|
||
// Settings for AI | ||
options.CheckboxLabeled("Settings_RaidersUseTargetingModes".Translate(), ref raidersUseTargModes, "Settings_RaidersUseTargetingModes_Tooltip".Translate()); | ||
options.Gap(); | ||
|
||
// Grey out this section if raiders can't use targeting modes | ||
if (!raidersUseTargModes) | ||
GUI.color = Color.grey; | ||
|
||
options.AddLabeledSlider("Settings_MinRaiderWeaponSkill".Translate(), ref raiderMinSkillForTargMode, 0, 20, | ||
rightAlignedLabel: raiderMinSkillForTargMode.ToString(), roundTo: 1); | ||
options.Gap(); | ||
options.AddLabeledSlider("Settings_MechTargModeChance".Translate(), ref mechanoidTargModeChance, 0, 1, | ||
rightAlignedLabel: mechanoidTargModeChance.ToStringPercent(), roundTo: 0.01f); | ||
options.Gap(); | ||
options.AddLabeledSlider("Settings_BaseManhunterTargModeChance".Translate(), ref baseManhunterTargModeChance, 0, 1, | ||
rightAlignedLabel: baseManhunterTargModeChance.ToStringPercent(), roundTo: 0.01f); | ||
// End of section | ||
GUI.color = defaultColor; | ||
|
||
options.End(); | ||
|
||
Mod.GetSettings<TargetingModesSettings>().Write(); | ||
|
||
} | ||
|
||
public override void ExposeData() | ||
{ | ||
Scribe_Values.Look(ref accuracyPenalties, "accuracyPenalties", true); | ||
Scribe_Values.Look(ref raidersUseTargModes, "raidersUseTargModes", true); | ||
Scribe_Values.Look(ref raiderMinSkillForTargMode, "raiderMinSkillForTargMode", 8f); | ||
Scribe_Values.Look(ref mechanoidTargModeChance, "mechanoidTargModeChance", 0.35f); | ||
Scribe_Values.Look(ref baseManhunterTargModeChance, "baseManhunterTargModeChance", 0.2f); | ||
} | ||
|
||
} | ||
|
||
public class TargetingModes : Mod | ||
{ | ||
public TargetingModesSettings settings; | ||
|
||
public TargetingModes(ModContentPack content) : base(content) | ||
{ | ||
GetSettings<TargetingModesSettings>(); | ||
} | ||
|
||
public override string SettingsCategory() => "TargetingModesSettingsCategory".Translate(); | ||
|
||
public override void DoSettingsWindowContents(Rect inRect) | ||
{ | ||
GetSettings<TargetingModesSettings>().DoWindowContents(inRect); | ||
} | ||
} | ||
} |
Oops, something went wrong.