Thermal artifact, mid-quest message popups, sortmode from immediate to deferred, saving bugfixes
This commit is contained in:
@@ -10,9 +10,11 @@ namespace Barotrauma
|
||||
{
|
||||
class MonsterQuest : Quest
|
||||
{
|
||||
string monsterFile;
|
||||
private string monsterFile;
|
||||
|
||||
Character monster;
|
||||
private int state;
|
||||
|
||||
private Character monster;
|
||||
|
||||
public override Vector2 RadarPosition
|
||||
{
|
||||
@@ -31,6 +33,18 @@ namespace Barotrauma
|
||||
|
||||
monster = new AICharacter(monsterFile, ConvertUnits.ToSimUnits(position+level.Position));
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
if (!monster.IsDead) return;
|
||||
ShowMessage(state);
|
||||
state = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void End()
|
||||
{
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace Barotrauma
|
||||
|
||||
protected string radarLabel;
|
||||
|
||||
protected List<string> headers;
|
||||
protected List<string> messages;
|
||||
|
||||
private int reward;
|
||||
|
||||
public string Name
|
||||
@@ -69,6 +72,15 @@ namespace Barotrauma
|
||||
failureMessage = ToolBox.GetAttributeString(element, "failuremessage", "");
|
||||
|
||||
radarLabel = ToolBox.GetAttributeString(element, "radarlabel", "");
|
||||
|
||||
messages = new List<string>();
|
||||
headers = new List<string>();
|
||||
foreach (XElement subElement in element.Elements())
|
||||
{
|
||||
if (subElement.Name.ToString().ToLower() != "message") continue;
|
||||
headers.Add(ToolBox.GetAttributeString(subElement, "header", ""));
|
||||
messages.Add(ToolBox.GetAttributeString(subElement, "text", ""));
|
||||
}
|
||||
}
|
||||
|
||||
public static Quest LoadRandom(Location[] locations, Random rand)
|
||||
@@ -142,8 +154,17 @@ namespace Barotrauma
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual void Start(Level level)
|
||||
public virtual void Start(Level level) { }
|
||||
|
||||
public virtual void Update(float deltaTime) { }
|
||||
|
||||
public void ShowMessage(int index)
|
||||
{
|
||||
if (index >= headers.Count && index >= messages.Count) return;
|
||||
|
||||
new GUIMessageBox(
|
||||
index < headers.Count ? headers[index] : "",
|
||||
index < messages.Count ? messages[index] : "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace Barotrauma
|
||||
|
||||
private Item item;
|
||||
|
||||
private int state;
|
||||
|
||||
public override Vector2 RadarPosition
|
||||
{
|
||||
get
|
||||
@@ -69,6 +71,23 @@ namespace Barotrauma
|
||||
//item.MoveWithLevel = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
if (item.CurrentHull == null) return;
|
||||
ShowMessage(state);
|
||||
state = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!Level.Loaded.AtEndPosition && !Level.Loaded.AtStartPosition) return;
|
||||
ShowMessage(state);
|
||||
state = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void End()
|
||||
{
|
||||
item.Remove();
|
||||
|
||||
Reference in New Issue
Block a user