Online quest mode, fixed bug when swimming from hull to another, monitors with editable text, choosing exe in content package, monster quests, misc bugfixes
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
using FarseerPhysics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Subsurface
|
||||
{
|
||||
class MonsterQuest : Quest
|
||||
{
|
||||
//string monsterName;
|
||||
|
||||
string monsterFile;
|
||||
|
||||
Character monster;
|
||||
|
||||
public override string RadarLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
return monster.SpeciesName;
|
||||
}
|
||||
}
|
||||
|
||||
public override Vector2 RadarPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return monster.Position;
|
||||
}
|
||||
}
|
||||
|
||||
public MonsterQuest(XElement element)
|
||||
: base(element)
|
||||
{
|
||||
//monsterName = ToolBox.GetAttributeString(element, "monstername", "");
|
||||
monsterFile = ToolBox.GetAttributeString(element, "monsterfile", "");
|
||||
}
|
||||
|
||||
public override void Start(Level level)
|
||||
{
|
||||
Vector2 position = level.PositionsOfInterest[Rand.Int(level.PositionsOfInterest.Count)];
|
||||
|
||||
monster = new Character(monsterFile, ConvertUnits.ToSimUnits(position+level.Position));
|
||||
}
|
||||
|
||||
public override void End()
|
||||
{
|
||||
if (!monster.IsDead) return;
|
||||
|
||||
GiveReward();
|
||||
|
||||
completed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ namespace Subsurface
|
||||
failureMessage = ToolBox.GetAttributeString(element, "failuremessage", "");
|
||||
}
|
||||
|
||||
public static Quest LoadRandom(Random rand)
|
||||
public static Quest LoadRandom(Location[] locations, Random rand)
|
||||
{
|
||||
XDocument doc = ToolBox.TryLoadXml(configFile);
|
||||
if (doc == null) return null;
|
||||
@@ -116,7 +116,11 @@ namespace Subsurface
|
||||
ConstructorInfo constructor = t.GetConstructor(new[] { typeof(XElement) });
|
||||
object instance = constructor.Invoke(new object[] { element });
|
||||
|
||||
return (Quest)instance;
|
||||
Quest quest = (Quest)instance;
|
||||
quest.description = quest.description.Replace("[location1]", locations[0].Name);
|
||||
quest.description = quest.description.Replace("[location2]", locations[1].Name);
|
||||
|
||||
return quest;
|
||||
}
|
||||
|
||||
randomNumber -= eventProbability[i];
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Subsurface
|
||||
{
|
||||
Vector2 position = level.PositionsOfInterest[Rand.Int(level.PositionsOfInterest.Count)];
|
||||
|
||||
item = new Item(itemPrefab, position+level.Position);
|
||||
item = new Item(itemPrefab, position + level.Position);
|
||||
//item.MoveWithLevel = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user