zc
This commit is contained in:
Binary file not shown.
@@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using RimWorld;
|
using RimWorld;
|
||||||
using Verse;
|
using Verse;
|
||||||
using Verse.AI.Group;
|
using Verse.AI.Group;
|
||||||
|
using WulaFallenEmpire;
|
||||||
|
|
||||||
namespace WulaFallenEmpire.EventSystem.AI.Tools
|
namespace WulaFallenEmpire.EventSystem.AI.Tools
|
||||||
{
|
{
|
||||||
@@ -107,7 +108,7 @@ namespace WulaFallenEmpire.EventSystem.AI.Tools
|
|||||||
if (pawnsToSpawn.Count == 0) return "Error: No valid units specified.";
|
if (pawnsToSpawn.Count == 0) return "Error: No valid units specified.";
|
||||||
|
|
||||||
// Apply Goodwill modifier to points
|
// Apply Goodwill modifier to points
|
||||||
var eventVarManager = Find.World.GetComponent<WulaFallenEmpire.EventVariableManager>();
|
var eventVarManager = Find.World.GetComponent<EventVariableManager>();
|
||||||
int goodwill = eventVarManager.GetVariable<int>("Wula_Goodwill_To_PIA", 0);
|
int goodwill = eventVarManager.GetVariable<int>("Wula_Goodwill_To_PIA", 0);
|
||||||
float goodwillFactor = 1.0f;
|
float goodwillFactor = 1.0f;
|
||||||
bool hostile = faction.HostileTo(Faction.OfPlayer);
|
bool hostile = faction.HostileTo(Faction.OfPlayer);
|
||||||
|
|||||||
@@ -444,7 +444,8 @@ When the player requests any form of resources, you MUST follow this multi-turn
|
|||||||
{
|
{
|
||||||
// If there is text, we treat it as the final response for this turn.
|
// If there is text, we treat it as the final response for this turn.
|
||||||
// We don't recurse. We just update the UI state.
|
// We don't recurse. We just update the UI state.
|
||||||
ParseResponse(xml);
|
// We've already added the full 'xml' to history, so tell ParseResponse not to add it again.
|
||||||
|
ParseResponse(xml, addToHistory: false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -460,14 +461,17 @@ When the player requests any form of resources, you MUST follow this multi-turn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParseResponse(string rawResponse)
|
private void ParseResponse(string rawResponse, bool addToHistory = true)
|
||||||
{
|
{
|
||||||
_currentResponse = rawResponse;
|
_currentResponse = rawResponse;
|
||||||
var parts = rawResponse.Split(new[] { "OPTIONS:" }, StringSplitOptions.None);
|
var parts = rawResponse.Split(new[] { "OPTIONS:" }, StringSplitOptions.None);
|
||||||
|
if (addToHistory)
|
||||||
|
{
|
||||||
if (_history.Count == 0 || _history.Last().role != "assistant" || _history.Last().message != rawResponse)
|
if (_history.Count == 0 || _history.Last().role != "assistant" || _history.Last().message != rawResponse)
|
||||||
{
|
{
|
||||||
_history.Add(("assistant", rawResponse));
|
_history.Add(("assistant", rawResponse));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (parts.Length > 1)
|
if (parts.Length > 1)
|
||||||
{
|
{
|
||||||
_options.Clear();
|
_options.Clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user