AI operating reactors & railguns, misc AI improvements

This commit is contained in:
Regalis
2015-11-30 19:06:27 +02:00
parent 6f2db08be0
commit 11857f894b
40 changed files with 804 additions and 272 deletions
+22 -15
View File
@@ -85,24 +85,28 @@ namespace Barotrauma
characterInfos.Add(character.Info);
}
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, null, listBox);
frame.UserData = character;
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
frame.HoverColor = Color.LightGray * 0.5f;
frame.SelectedColor = Color.Gold * 0.5f;
commander.UpdateCharacters();
string name = character.Info.Name.Replace(' ', '\n');
character.Info.CreateCharacterFrame(listBox, character.Info.Name.Replace(' ', '\n'), character);
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(40, 0, 0, 25),
name,
Color.Transparent, Color.White,
Alignment.Left, Alignment.Left,
null, frame, false);
textBlock.Font = GUI.SmallFont;
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
//GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, null, listBox);
//frame.UserData = character;
//frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
//frame.HoverColor = Color.LightGray * 0.5f;
//frame.SelectedColor = Color.Gold * 0.5f;
new GUIImage(new Rectangle(-10, -5, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);
//string name = character.Info.Name.Replace(' ', '\n');
//GUITextBlock textBlock = new GUITextBlock(
// new Rectangle(40, 0, 0, 25),
// name,
// Color.Transparent, Color.White,
// Alignment.Left, Alignment.Left,
// null, frame, false);
//textBlock.Font = GUI.SmallFont;
//textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
//new GUIImage(new Rectangle(-10, -5, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);
}
public void Update(float deltaTime)
@@ -123,6 +127,9 @@ namespace Barotrauma
GUIComponent characterBlock = listBox.GetChild(killedCharacter) as GUIComponent;
if (characterBlock != null) characterBlock.Color = Color.DarkRed * 0.5f;
commander.UpdateCharacters();
//if (characters.Find(c => !c.IsDead)==null)
//{
// Game1.GameSession.EndShift(null, null);
+7 -5
View File
@@ -12,13 +12,15 @@ namespace Barotrauma
{
availableCharacters = new List<CharacterInfo>();
}
public void GenerateCharacters(string file, int amount)
{
public void GenerateCharacters(Location location, int amount)
{
for (int i = 0 ; i<amount ; i++)
{
availableCharacters.Add(new CharacterInfo(file));
JobPrefab job = location.Type.GetRandomHireable();
if (job == null) return;
availableCharacters.Add(new CharacterInfo(Character.HumanConfigFile, "", Gender.None, job));
}
}
}