Add joker type. Allow automatic conversion to are you
This commit is contained in:
@@ -17,6 +17,10 @@
|
|||||||
{
|
{
|
||||||
"type": "BASE",
|
"type": "BASE",
|
||||||
"action": "TRUTHER"
|
"action": "TRUTHER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BASE",
|
||||||
|
"action": "JOKER"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"guardsmods": [
|
"guardsmods": [
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using DefaultNamespace;
|
using DefaultNamespace;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
@@ -230,6 +231,13 @@ public class DialogManager : Singleton<DialogManager>
|
|||||||
|
|
||||||
r = r.Replace("NOREC_", "");
|
r = r.Replace("NOREC_", "");
|
||||||
|
|
||||||
|
r = Regex.Replace(
|
||||||
|
r,
|
||||||
|
@"^is\s+(?:\S+\s+)*guard\s+\(you\)",
|
||||||
|
"are you",
|
||||||
|
RegexOptions.IgnoreCase
|
||||||
|
);
|
||||||
|
|
||||||
string responsePrefix = "";
|
string responsePrefix = "";
|
||||||
if (FullQuestion.Contains("%"))
|
if (FullQuestion.Contains("%"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using DefaultNamespace;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
public class GuardManager : MonoBehaviour, IDescribable
|
public class GuardManager : MonoBehaviour, IDescribable
|
||||||
{
|
{
|
||||||
@@ -61,10 +62,12 @@ public class GuardManager : MonoBehaviour, IDescribable
|
|||||||
QuestionAnswer.NO_YES => QuestionAnswer.NO_YES // i think? since we cannot confidently lie?
|
QuestionAnswer.NO_YES => QuestionAnswer.NO_YES // i think? since we cannot confidently lie?
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else if (type == "JOKER")
|
||||||
{//add joker at some point
|
{
|
||||||
throw new NotImplementedException();
|
return Random.value > 0.5? QuestionAnswer.YES : QuestionAnswer.NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -129,8 +132,12 @@ public class GuardManager : MonoBehaviour, IDescribable
|
|||||||
else if (mod == "HAT")
|
else if (mod == "HAT")
|
||||||
{
|
{
|
||||||
return "the guard with the hat";
|
return "the guard with the hat";
|
||||||
}// add more modification here
|
}
|
||||||
throw new NotImplementedException();
|
else
|
||||||
|
{
|
||||||
|
return "the plain guard";
|
||||||
|
}
|
||||||
|
// add more modification here
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuestionAnswer GetProperty(string property)
|
public QuestionAnswer GetProperty(string property)
|
||||||
|
|||||||
Reference in New Issue
Block a user