v0.2: iteminventory sync bugfix, meleeweapon "reload time", spears can be picked even if they're stuck inside a wall, tutorial bugfixes, "submarine godmode", removed round duration, drag character sync, reliable structure damage messages, job assignment bugfixes, some extra sounds

This commit is contained in:
Regalis
2015-10-17 16:01:42 +03:00
parent 838022fcd5
commit 3c1a66078c
51 changed files with 457 additions and 213 deletions
@@ -10,14 +10,10 @@ namespace Barotrauma
{
public static List<GameModePreset> PresetList = new List<GameModePreset>();
TimeSpan duration;
protected DateTime startTime;
protected DateTime endTime;
//public readonly bool IsSinglePlayer;
private GUIProgressBar timerBar;
protected bool isRunning;
//protected string name;
@@ -31,16 +27,6 @@ namespace Barotrauma
get { return null; }
}
public DateTime StartTime
{
get { return startTime; }
}
public DateTime EndTime
{
get { return endTime; }
}
public bool IsRunning
{
get { return isRunning; }
@@ -68,19 +54,19 @@ namespace Barotrauma
public virtual void Draw(SpriteBatch spriteBatch)
{
if (timerBar != null) timerBar.Draw(spriteBatch);
//if (timerBar != null) timerBar.Draw(spriteBatch);
}
public virtual void Start(TimeSpan duration)
public virtual void Start()
{
startTime = DateTime.Now;
if (duration!=TimeSpan.Zero)
{
endTime = startTime + duration;
this.duration = duration;
//if (duration!=TimeSpan.Zero)
//{
// endTime = startTime + duration;
// this.duration = duration;
timerBar = new GUIProgressBar(new Rectangle(GameMain.GraphicsWidth - 120, 20, 100, 25), Color.Gold, 0.0f, null);
}
// timerBar = new GUIProgressBar(new Rectangle(GameMain.GraphicsWidth - 120, 20, 100, 25), Color.Gold, 0.0f, null);
//}
endMessage = "The round has ended!";
@@ -89,13 +75,13 @@ namespace Barotrauma
public virtual void Update(float deltaTime)
{
if (!isRunning) return;
//if (!isRunning) return;
if (duration != TimeSpan.Zero)
{
double elapsedTime = (DateTime.Now - startTime).TotalSeconds;
timerBar.BarSize = (float)(elapsedTime / duration.TotalSeconds);
}
//if (duration != TimeSpan.Zero)
//{
// double elapsedTime = (DateTime.Now - startTime).TotalSeconds;
// timerBar.BarSize = (float)(elapsedTime / duration.TotalSeconds);
//}
//if (DateTime.Now >= endTime)
//{
// End(endMessage);
@@ -32,9 +32,9 @@ namespace Barotrauma
quest = Quest.LoadRandom(locations, rand);
}
public override void Start(TimeSpan duration)
public override void Start()
{
base.Start(duration);
base.Start();
new GUIMessageBox(quest.Name, quest.Description, 400, 400);
@@ -88,6 +88,8 @@ namespace Barotrauma
CrewManager = new CrewManager(subElement);
}
savedOnStart = true;
}
public void GenerateMap(string seed)
@@ -95,7 +97,7 @@ namespace Barotrauma
Map = new Map(seed, 500);
}
public override void Start(TimeSpan duration)
public override void Start()
{
CargoManager.CreateItems();
@@ -181,11 +183,13 @@ namespace Barotrauma
isRunning = false;
GameMain.GameSession.EndShift("");
//if (endMessage != "" || this.endMessage == null) this.endMessage = endMessage;
StringBuilder sb = new StringBuilder();
List<Character> casualties = CrewManager.characters.FindAll(c => c.IsDead);
List<Character> casualties = CrewManager.characters.FindAll(c => c.IsDead);
if (casualties.Count == CrewManager.characters.Count)
{
@@ -226,8 +230,7 @@ namespace Barotrauma
Character.CharacterList[i].Remove();
}
GameMain.GameSession.EndShift("");
Submarine.Unload();
}
private bool EndShift(GUIButton button, object obj)
@@ -15,9 +15,9 @@ namespace Barotrauma
}
public override void Start(TimeSpan duration)
public override void Start()
{
base.Start(duration);
base.Start();
traitor = null;
target = null;
@@ -56,7 +56,7 @@ namespace Barotrauma
{
string endMessage = traitor.character.Info.Name + " was a traitor! ";
endMessage += (traitor.character.Info.Gender == Gender.Male) ? "His" : "Her";
endMessage += " task was to assassinate " + target.character.Info.Name + ". The task was succesful.";
endMessage += " task was to assassinate " + target.character.Info.Name + ". The task was successful.";
End(endMessage);
}
else if (traitor.character.IsDead)
@@ -78,14 +78,6 @@ namespace Barotrauma
endMessage += "The task was unsuccessful - the has submarine reached its destination.";
End(endMessage);
return;
}
else if (DateTime.Now >= endTime)
{
string endMessage = traitor.character.Info.Name + " was a traitor! ";
endMessage += (traitor.character.Info.Gender == Gender.Male) ? "His" : "Her";
endMessage += " task was to assassinate " + target.character.Info.Name + ". The task was unsuccesful.";
End(endMessage);
return;
}
}
@@ -15,13 +15,13 @@ namespace Barotrauma
private GUIComponent infoBox;
public static void Start()
public static void StartTutorial()
{
Submarine.Load("Content/Map/TutorialSub.sub", "");
GameMain.GameSession = new GameSession(Submarine.Loaded, "", GameModePreset.list.Find(gm => gm.Name.ToLower()=="tutorial"));
GameMain.GameSession.StartShift(TimeSpan.Zero, "tutorial");
GameMain.GameSession.StartShift("tutorial");
GameMain.GameSession.taskManager.Tasks.Clear();
@@ -34,9 +34,9 @@ namespace Barotrauma
CrewManager = new CrewManager();
}
public override void Start(TimeSpan duration)
public override void Start()
{
base.Start(duration);
base.Start();
WayPoint wayPoint = WayPoint.GetRandom(SpawnType.Cargo, null);
if (wayPoint==null)
@@ -273,8 +273,15 @@ namespace Barotrauma
yield return new WaitForSeconds(2.0f);
infoBox = CreateInfoFrame("You can now move the other end of the wire around, and attach it on the wall by left clicking or "
+ "remove the previous attachment by right clicking. Or you can just run the wire straight to the junction box and attach it "
+ " the same way you did to the navigation terminal.");
+ "remove the previous attachment by right clicking. Or if you don't care for neatly laid out wiring, you can just "
+"run it straight to the junction box.");
while (Character.Controlled.SelectedConstruction == null || Character.Controlled.SelectedConstruction.GetComponent<PowerTransfer>()==null)
{
yield return CoroutineStatus.Running;
}
infoBox = CreateInfoFrame("Connect the wire to the junction box by pulling it to the power connection, the same way you did with the navigation terminal.");
while (radar.Voltage<0.1f)
{
@@ -346,10 +353,10 @@ namespace Barotrauma
Vector2 steeringDir = windows[0].Position - moloch.Position;
if (steeringDir != Vector2.Zero) steeringDir = Vector2.Normalize(steeringDir);
foreach (Limb limb in moloch.AnimController.Limbs)
{
limb.body.LinearVelocity = new Vector2(limb.LinearVelocity.X*2.0f, limb.LinearVelocity.Y + steeringDir.Y*10.0f);
}
//foreach (Limb limb in moloch.AnimController.Limbs)
//{
// limb.body.LinearVelocity = new Vector2(limb.LinearVelocity.X*2.0f, limb.LinearVelocity.Y + steeringDir.Y*10.0f);
//}
moloch.AIController.Steering = steeringDir;
@@ -365,11 +372,12 @@ namespace Barotrauma
}
yield return new WaitForSeconds(1.0f);
yield return new WaitForSeconds(0.1f);
} while (!broken);
yield return new WaitForSeconds(0.5f);
Submarine.Loaded.GodMode = true;
var capacitor1 = Item.itemList.Find(i => i.HasTag("capacitor1")).GetComponent<PowerContainer>();
var capacitor2 = Item.itemList.Find(i => i.HasTag("capacitor1")).GetComponent<PowerContainer>();
@@ -470,6 +478,8 @@ namespace Barotrauma
yield return CoroutineStatus.Running;
}
Submarine.Loaded.GodMode = false;
infoBox = CreateInfoFrame("The creature has died. Now you should fix the damages in the control room: "+
"Grab a welding tool from the closet in the railgun room.");
@@ -584,7 +594,7 @@ namespace Barotrauma
private bool Restart(GUIButton button, object obj)
{
TutorialMode.Start();
TutorialMode.StartTutorial();
return true;
}
+5 -5
View File
@@ -98,14 +98,14 @@ namespace Barotrauma
}
}
public void StartShift(TimeSpan duration, string levelSeed)
public void StartShift(string levelSeed)
{
Level level = Level.CreateRandom(levelSeed);
StartShift(duration, level);
StartShift(level);
}
public void StartShift(TimeSpan duration, Level level, bool reloadSub = true)
public void StartShift(Level level, bool reloadSub = true)
{
GameMain.LightManager.LosEnabled = (GameMain.Server==null || GameMain.Server.CharacterInfo!=null);
@@ -129,7 +129,7 @@ namespace Barotrauma
if (Quest!=null) Quest.Start(Level.Loaded);
if (gameMode!=null) gameMode.Start(duration);
if (gameMode!=null) gameMode.Start();
taskManager.StartShift(level);
}
@@ -145,7 +145,7 @@ namespace Barotrauma
}
else if (GameMain.Client==null)
{
Submarine.Unload();
//Submarine.Unload();
GameMain.LobbyScreen.Select();
}