Skip to content
Permalink
Browse files
v0.2: iteminventory sync bugfix, meleeweapon "reload time", spears ca…
…n 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
  • Loading branch information
Regalis committed Oct 17, 2015
1 parent 838022f commit 3c1a66078c22d3e97e998e72b7e76d7d0e1610a6
Showing with 457 additions and 213 deletions.
  1. +6 −1 Subsurface/Barotrauma.csproj
  2. +3 −3 Subsurface/Content/Characters/Moloch/moloch.xml
  3. +1 −1 Subsurface/Content/Items/Clothes/clothes.xml
  4. +1 −1 Subsurface/Content/Items/OxygenGenerator/oxygengenerator.xml
  5. +2 −1 Subsurface/Content/Items/Reactor/reactor.xml
  6. BIN Subsurface/Content/Items/Weapons/smack.ogg
  7. +10 −8 Subsurface/Content/Items/Weapons/weapons.xml
  8. +6 −4 Subsurface/Content/Jobs.xml
  9. +3 −3 Subsurface/Content/Map/StructurePrefabs.xml
  10. BIN Subsurface/Content/Map/testroom.png
  11. +1 −1 Subsurface/Content/Quests.xml
  12. 0 Subsurface/Data/ContentPackages/{Vanilla 0.1.3.xml → Vanilla 0.2.xml}
  13. +2 −2 Subsurface/Properties/AssemblyInfo.cs
  14. +3 −1 Subsurface/Source/Characters/AICharacter.cs
  15. +44 −15 Subsurface/Source/Characters/Character.cs
  16. +38 −4 Subsurface/Source/Characters/StatusEffect.cs
  17. +0 −3 Subsurface/Source/CoroutineManager.cs
  18. +3 −1 Subsurface/Source/DebugConsole.cs
  19. +1 −1 Subsurface/Source/Events/Quests/SalvageQuest.cs
  20. +2 −0 Subsurface/Source/GameMain.cs
  21. +14 −28 Subsurface/Source/GameSession/GameModes/GameMode.cs
  22. +2 −2 Subsurface/Source/GameSession/GameModes/QuestMode.cs
  23. +7 −4 Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs
  24. +3 −11 Subsurface/Source/GameSession/GameModes/TraitorMode.cs
  25. +23 −13 Subsurface/Source/GameSession/GameModes/TutorialMode.cs
  26. +5 −5 Subsurface/Source/GameSession/GameSession.cs
  27. +12 −5 Subsurface/Source/GameSettings.cs
  28. +6 −1 Subsurface/Source/Items/CharacterInventory.cs
  29. +24 −11 Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs
  30. +10 −10 Subsurface/Source/Items/Components/Machines/Engine.cs
  31. +7 −1 Subsurface/Source/Items/Components/Machines/MiniMap.cs
  32. +12 −2 Subsurface/Source/Items/Components/Machines/OxygenGenerator.cs
  33. +5 −2 Subsurface/Source/Items/Item.cs
  34. +8 −0 Subsurface/Source/Items/ItemPrefab.cs
  35. +36 −0 Subsurface/Source/Items/RelatedItem.cs
  36. +1 −1 Subsurface/Source/Map/Levels/Level.cs
  37. +3 −2 Subsurface/Source/Map/Structure.cs
  38. +6 −0 Subsurface/Source/Map/Submarine.cs
  39. +9 −8 Subsurface/Source/Networking/GameClient.cs
  40. +16 −12 Subsurface/Source/Networking/GameServer.cs
  41. +6 −3 Subsurface/Source/Networking/NetworkEvent.cs
  42. +0 −2 Subsurface/Source/Screens/GameScreen.cs
  43. +2 −2 Subsurface/Source/Screens/LobbyScreen.cs
  44. +1 −1 Subsurface/Source/Screens/MainMenuScreen.cs
  45. +21 −32 Subsurface/Source/Screens/NetLobbyScreen.cs
  46. +2 −1 Subsurface/Source/Screens/ServerListScreen.cs
  47. +16 −0 Subsurface/Source/Sounds/AmbientSoundManager.cs
  48. +8 −1 Subsurface/Source/Sounds/OggStream.cs
  49. +3 −3 Subsurface/Source/Utils/SaveUtil.cs
  50. +63 −0 Subsurface/changelog.txt
  51. BIN Subsurface_Solution.v12.suo
@@ -747,7 +747,9 @@
<Content Include="Content\waterbump.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Data\ContentPackages\Vanilla 0.1.3.xml" />
<Content Include="Data\ContentPackages\Vanilla 0.2.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Icon.ico" />
<Content Include="OpenAL32.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -884,6 +886,9 @@
<None Include="Content\Items\Weapons\railgun.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Weapons\smack.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Weapons\stunbaton.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -46,15 +46,15 @@

<joint limb1="0" limb1anchor="112,77" limb2="1" limb2anchor="0,-190" lowerlimit="-180" upperlimit="-90"/>
<joint limb1="1" limb1anchor="0,190" limb2="2" limb2anchor="0,-100" lowerlimit="-50" upperlimit="0"/>
<joint limb1="2" limb1anchor="0,120" limb2="3" limb2anchor="-15,-250" lowerlimit="-50" upperlimit="0"/>
<joint limb1="2" limb1anchor="0,120" limb2="3" limb2anchor="15,-250" lowerlimit="-50" upperlimit="0"/>

<joint limb1="0" limb1anchor="0,0" limb2="4" limb2anchor="0,-190" lowerlimit="-180" upperlimit="-90"/>
<joint limb1="4" limb1anchor="0,190" limb2="5" limb2anchor="0,-100" lowerlimit="-50" upperlimit="0"/>
<joint limb1="5" limb1anchor="0,120" limb2="6" limb2anchor="-15,-250" lowerlimit="-50" upperlimit="0"/>
<joint limb1="5" limb1anchor="0,120" limb2="6" limb2anchor="15,-250" lowerlimit="-50" upperlimit="0"/>

<joint limb1="0" limb1anchor="-53,-164" limb2="7" limb2anchor="0,-190" lowerlimit="-180" upperlimit="-90"/>
<joint limb1="7" limb1anchor="0,190" limb2="8" limb2anchor="0,-100" lowerlimit="-50" upperlimit="0"/>
<joint limb1="8" limb1anchor="0,120" limb2="9" limb2anchor="-15,-250" lowerlimit="-50" upperlimit="0"/>
<joint limb1="8" limb1anchor="0,120" limb2="9" limb2anchor="15,-250" lowerlimit="-50" upperlimit="0"/>

</ragdoll>

@@ -53,7 +53,7 @@
</Item>

<Item
name="Body Armour"
name="Body Armor"
pickdistance="150"
tags="smallitem">

@@ -27,7 +27,7 @@
name="Vent"
linkable="true">

<Sprite texture ="vent.png" depth="0.85"/>
<Sprite texture ="vent.png" depth="0.91"/>

<Vent>
<sound file="ventilation.ogg" type="OnActive" range="600.0" volume="OxygenFlow" volumemultiplier="0.001f" loop="true"/>
@@ -50,7 +50,8 @@
<Item
name="Fuel Rod"
Tags="smallitem"
pickdistance="150">
pickdistance="150"
price="200">

<Sprite texture ="fuelrod.png"/>

Binary file not shown.
@@ -4,6 +4,7 @@
<Item
name="Spear"
pickdistance="200"
pickthroughwalls="true"
price="50">

<Sprite texture ="spear.png" depth="0.55"/>
@@ -67,12 +68,12 @@
<Body width="90" height="30" density="10"/>

<MeleeWeapon slots="Any,RightHand,LeftHand"
aimpos="50,0" handle1="-15,-6" holdangle="100">
<RequiredItems name="Battery Cell" type="Contained" msg="Loaded Battery Cell required"/>
<Attack stun="10.0" sound="Content/Items/Electricity/zap1.ogg"/>
<StatusEffect type="OnUse" target="Contained" Condition="-25.0" disabledeltatime="true" sound="Content/Items/Weapons/stunbaton.ogg">
aimpos="50,0" handle1="-15,-6" holdangle="100" reload="1.0">
<Attack damage="2" stun="0.2" damagetype="Blunt" sound="Content/Items/Weapons/smack.ogg"/>
<StatusEffect type="OnUse" target="Contained,Character" Condition="-25.0" stun="10.0" disabledeltatime="true" sound="Content/Items/Weapons/stunbaton.ogg">
<RequiredItem name="Battery Cell" type="Contained" msg="Loaded Battery Cell required"/>
<Explosion range="100.0" force="0.1" shockwave="false" flames="false" camerashake="5.0"/>
</StatusEffect>
</StatusEffect>
</MeleeWeapon>

<ItemContainer capacity="1" hideitems="true">
@@ -81,9 +82,10 @@
</Item>

<Item
name="Battery Cell"
pickdistance="150"
tags="smallitem,loadable">
name="Battery Cell"
pickdistance="150"
tags="smallitem,loadable"
price="50">

<Sprite texture ="stunbaton.png" sourcerect="0,0,20,9" depth="0.8"/>

@@ -5,14 +5,14 @@
<Item name="Captain's Cap" equip="true"/>
<Item name="Captain's Jacket" equip="true"/>
<Item name="Captain's Trousers" equip="true"/>

<Skills>
<Skill name="Weapons" level="50,60"/>
<Skill name="Construction" level="20,30"/>
<Skill name="Electrical Engineering" level="20,30"/>
</Skills>
</Job>

<Job name="Engineer" description="Engineers have above-average construction and mechanic skills, but fixing complex mechanical devices is still usually out of their skill set. They are competent at fixing electrical devices however, and are the ones to turn to when the power grid starts failing." minnumber="1">
<Skills>
<Skill name="Weapons" level="10,30"/>
@@ -41,9 +41,11 @@
<Skill name="Construction" level="10,20"/>
<Skill name="Electrical Engineering" level="10,20"/>
</Skills>
<Item name="ID Card"/>
<Item name="Stun Baton"/>
<Item name="Body Armor"/>
<Item name="Ballistic Helmet"/>
<Item name="Battery Cell"/>
<Item name="Body Armor" equip="true"/>
<Item name="Ballistic Helmet" equip="true"/>
</Job>

<Job name="Assistant" description="Assistants don't have any specific responsibilities or areas of expertise. This job is a good choice for newcomers who want to get a hang of working on board the submarine without taking up tasks that they aren't qualified for." allowalways="true">
@@ -48,9 +48,6 @@
<topwall sprite="Content/Map/testroom.png" sourcerect="144,464,496,32" depth ="0.06" castshadow="true"
width = "64" height ="32" resizehorizontal="true" body="true" health="500"/>

<bottomwall sprite="Content/Map/testroom.png" flipvertical ="true" sourcerect="144,496,640,32" depth ="0.06" castshadow="true"
width = "64" height ="32" resizehorizontal="true" body="true" health="500"/>

<topwindow sprite="Content/Map/testroom.png" sourcerect="208,352,128,80" depth ="0.05"
width = "128" height ="80" body="true" health="100"/>

@@ -81,4 +78,7 @@
<stairsleft sprite="Content/Map/testroom.png" fliphorizontal="true" sourcerect="0,704,256,320"
width="256" height="320" depth = "0.1" stairdirection="Left"/>

<bunk sprite="Content/Map/testroom.png" fliphorizontal="true" sourcerect="0,546,173,129"
width="173" height="129" depth = "0.9"/>

</prefabs>
Binary file not shown.
@@ -7,7 +7,7 @@
reward="1000"
radarlabel="Infrasonic signal"
failuremessage="Retrieving the artifact failed"
successmessage="The artifact has been succesfully retrived"
successmessage="The artifact has been succesfully retrieved"
itemname="Skyholder Artifact">
</SalvageQuest>

@@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.3.2")]
[assembly: AssemblyFileVersion("0.1.3.2")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
@@ -131,7 +131,9 @@ public override void FillNetworkData(NetworkEventType type, NetOutgoingMessage m

public override void ReadNetworkData(NetworkEventType type, NetIncomingMessage message)
{
if (type == NetworkEventType.KillCharacter)
Enabled = true;

if (type == NetworkEventType.KillCharacter)
{
Kill(true);
return;
@@ -112,7 +112,7 @@ public string Name
{
get
{
return SpeciesName;
return (info != null && !string.IsNullOrWhiteSpace(info.Name)) ? info.Name : SpeciesName;
}
}

@@ -604,20 +604,30 @@ private Character FindClosestCharacter(Vector2 mouseSimPos, float maxDist = 150.
return closestCharacter;
}

private void ToggleSelectedCharacter(Character selected)
private void SelectCharacter(Character character, bool createNetworkEvent = true)
{
if (selectedCharacter != null)
{
foreach (Limb limb in selectedCharacter.AnimController.Limbs)
{
limb.pullJoint.Enabled = false;
}
selectedCharacter = null;
}
else
if (character == null) return;

selectedCharacter = character;

if (createNetworkEvent)
new NetworkEvent(NetworkEventType.SelectCharacter, ID, true, selectedCharacter.ID);

}

private void DeselectCharacter(bool createNetworkEvent = true)
{
if (selectedCharacter == null) return;

foreach (Limb limb in selectedCharacter.AnimController.Limbs)
{
selectedCharacter = selected;
limb.pullJoint.Enabled = false;
}

selectedCharacter = null;

if (createNetworkEvent)
new NetworkEvent(NetworkEventType.SelectCharacter, ID, true, -1);
}

/// <summary>
@@ -724,20 +734,20 @@ public void ControlLocalPlayer(float deltaTime, Camera cam, bool moveCam = true)
if (Vector2.Distance(selectedCharacter.SimPosition, SimPosition) > 2.0f ||
(!selectedCharacter.isDead && selectedCharacter.Stun <= 0.0f))
{
ToggleSelectedCharacter(selectedCharacter);
DeselectCharacter();
}
}

if (GetInputState(InputType.Select))
{
if (selectedCharacter != null)
{
ToggleSelectedCharacter(selectedCharacter);
DeselectCharacter();
}
else if (closestCharacter != null && closestCharacter.IsHumanoid &&
(closestCharacter.isDead || closestCharacter.AnimController.StunTimer > 0.0f))
{
selectedCharacter = closestCharacter;
SelectCharacter(closestCharacter);
}
}

@@ -1081,6 +1091,11 @@ public override void FillNetworkData(NetworkEventType type, NetOutgoingMessage m
message.Write((int)data);
return;
}
else if (type== NetworkEventType.SelectCharacter)
{
message.Write((int)data);
return;
}
else if (type == NetworkEventType.KillCharacter)
{
return;
@@ -1177,6 +1192,20 @@ public override void ReadNetworkData(NetworkEventType type, NetIncomingMessage m

return;
}
else if (type == NetworkEventType.SelectCharacter)
{
int characterId = message.ReadInt32();
if (characterId==-1)
{
DeselectCharacter(false);
}
else
{
Character character = FindEntityByID(characterId) as Character;
if (character != null) SelectCharacter(character, false);
}
return;
}
else if (type == NetworkEventType.KillCharacter)
{
Kill(true);
@@ -18,6 +18,8 @@ public enum TargetType
private TargetType targetTypes;
private string[] targetNames;

private List<RelatedItem> requiredItems;

public string[] propertyNames;
private object[] propertyEffects;

@@ -62,10 +64,11 @@ public static StatusEffect Load(XElement element)

protected StatusEffect(XElement element)
{
requiredItems = new List<RelatedItem>();

IEnumerable<XAttribute> attributes = element.Attributes();
List<XAttribute> propertyAttributes = new List<XAttribute>();



foreach (XAttribute attribute in attributes)
{
switch (attribute.Name.ToString())
@@ -140,6 +143,14 @@ protected StatusEffect(XElement element)
case "explosion":
explosion = new Explosion(subElement);
break;
case "requireditem":
case "requireditems":
RelatedItem newRequiredItem = RelatedItem.Load(subElement);

if (newRequiredItem == null) continue;

requiredItems.Add(newRequiredItem);
break;
}
}

@@ -156,19 +167,42 @@ protected StatusEffect(XElement element)
// if (this.type == type) Apply(deltaTime, character, item);
//}

private bool HasRequiredItems(Entity entity)
{
if (requiredItems == null) return true;
foreach (RelatedItem requiredItem in requiredItems)
{
Item item = entity as Item;
if (item != null)
{
if (!requiredItem.CheckRequirements(null, item)) return false;
}
Character character = entity as Character;
if (character != null)
{
if (!requiredItem.CheckRequirements(character, null)) return false;
}
}
return true;
}

public virtual void Apply(ActionType type, float deltaTime, Entity entity, IPropertyObject target)
{
if (this.type != type || !HasRequiredItems(entity)) return;

if (targetNames != null && !targetNames.Contains(target.Name)) return;

List<IPropertyObject> targets = new List<IPropertyObject>();
targets.Add(target);

if (this.type == type) Apply(deltaTime, entity, targets);
Apply(deltaTime, entity, targets);
}

public virtual void Apply(ActionType type, float deltaTime, Entity entity, List<IPropertyObject> targets)
{
if (this.type == type) Apply(deltaTime, entity, targets);
if (this.type != type || !HasRequiredItems(entity)) return;

Apply(deltaTime, entity, targets);
}

protected virtual void Apply(float deltaTime, Entity entity, List<IPropertyObject> targets)
@@ -95,10 +95,7 @@ public bool CheckFinished(float deltaTime)
{
timer -= deltaTime;
return timer<=0.0f;

}


}


0 comments on commit 3c1a660

Please sign in to comment.