Merge remote-tracking branch 'refs/remotes/barotrauma/master'

Conflicts:
	Subsurface/Barotrauma.csproj
This commit is contained in:
juanjp600
2016-09-05 13:28:21 -03:00
8 changed files with 1519 additions and 1450 deletions
@@ -66,7 +66,7 @@ namespace Lidgren.Network
return new IPAddress(bytes); return new IPAddress(bytes);
} }
private static readonly SHA1 s_sha = SHA1.Create(); private static readonly SHA256 s_sha = SHA256.Create();
public static byte[] ComputeSHAHash(byte[] bytes, int offset, int count) public static byte[] ComputeSHAHash(byte[] bytes, int offset, int count)
{ {
return s_sha.ComputeHash(bytes, offset, count); return s_sha.ComputeHash(bytes, offset, count);
+16 -1
View File
@@ -150,11 +150,13 @@
<Compile Include="Source\Networking\BanList.cs" /> <Compile Include="Source\Networking\BanList.cs" />
<Compile Include="Source\Networking\ChatMessage.cs" /> <Compile Include="Source\Networking\ChatMessage.cs" />
<Compile Include="Source\Networking\Client.cs" /> <Compile Include="Source\Networking\Client.cs" />
<Compile Include="Source\Networking\FileStreamReceiver.cs" />
<Compile Include="Source\Networking\FileStreamSender.cs" />
<Compile Include="Source\Networking\GameServerLogin.cs" /> <Compile Include="Source\Networking\GameServerLogin.cs" />
<Compile Include="Source\Networking\INetSerializable.cs" />
<Compile Include="Source\Networking\NetBufferExtensions.cs" /> <Compile Include="Source\Networking\NetBufferExtensions.cs" />
<Compile Include="Source\Networking\NetConfig.cs" /> <Compile Include="Source\Networking\NetConfig.cs" />
<Compile Include="Source\Networking\NetStats.cs" /> <Compile Include="Source\Networking\NetStats.cs" />
<Compile Include="Source\Networking\ReliableSender.cs" />
<Compile Include="Source\Networking\RespawnManager.cs" /> <Compile Include="Source\Networking\RespawnManager.cs" />
<Compile Include="Source\Networking\ServerLog.cs" /> <Compile Include="Source\Networking\ServerLog.cs" />
<Compile Include="Source\Networking\WhiteList.cs" /> <Compile Include="Source\Networking\WhiteList.cs" />
@@ -240,6 +242,7 @@
<Compile Include="Source\Map\Levels\VoronoiElements.cs" /> <Compile Include="Source\Map\Levels\VoronoiElements.cs" />
<Compile Include="Source\Utils\MathUtils.cs" /> <Compile Include="Source\Utils\MathUtils.cs" />
<Compile Include="Source\Physics\PhysicsBody.cs" /> <Compile Include="Source\Physics\PhysicsBody.cs" />
<Compile Include="Source\Networking\NetworkEvent.cs" />
<Compile Include="Source\Networking\NetworkMember.cs" /> <Compile Include="Source\Networking\NetworkMember.cs" />
<Compile Include="Source\Particles\Particle.cs" /> <Compile Include="Source\Particles\Particle.cs" />
<Compile Include="Source\Particles\ParticleManager.cs" /> <Compile Include="Source\Particles\ParticleManager.cs" />
@@ -346,6 +349,12 @@
<Content Include="Content\BackgroundSprites\vegetation2.png"> <Content Include="Content\BackgroundSprites\vegetation2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Characters\Charybdis\charybdis.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Characters\Charybdis\charybdis.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Characters\Coelanth\coelanth.png"> <Content Include="Content\Characters\Coelanth\coelanth.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@@ -1033,6 +1042,9 @@
<None Include="Content\blurshader.xnb"> <None Include="Content\blurshader.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="Content\Characters\Charybdis\charybdisattack.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Characters\Crawler\attack1.ogg"> <None Include="Content\Characters\Crawler\attack1.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
@@ -1279,6 +1291,9 @@
<None Include="Content\Sounds\Music\Enter the Maze.ogg"> <None Include="Content\Sounds\Music\Enter the Maze.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="Content\Sounds\Music\Phantom From Space.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Sounds\Music\Road to Hell.ogg"> <None Include="Content\Sounds\Music\Road to Hell.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
Binary file not shown.

After

Width:  |  Height:  |  Size: 609 KiB

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<Character name ="charybdis" humanoid="false" health="1000.0" bleedingdecreasespeed="0.2">
<sound file="Content/Characters/Charybdis/charybdisattack.ogg" state="Attack" range="8000" />
<ragdoll waveamplitude="150.0" wavelength="10000" swimspeed="4.0" scale="1.5" canentersubmarine="false">
<!-- body -->
<limb id = "0" radius="100" height="470" type="Torso" steerforce="1.0" pullpos="0,250">
<sprite texture="Content/Characters/Charybdis/charybdis.png" sourcerect="160,0,242,688" depth="0.015" origin="0.5,0.5"/>
</limb>
<!-- lower yaw -->
<limb id = "1" radius="70" height="100" impacttolerance="50.0">
<sprite texture="Content/Characters/Charybdis/charybdis.png" sourcerect="416,0,192,256" depth="0.025" origin="0.65,0.5"/>
<attack range="300" duration="0.5" damage="5.00" bleedingdamage="50" structuredamage="500" damagetype="slash" torque="200" targetforce="-50"/>
</limb>
<!-- front fins -->
<limb id = "2" radius="60" height="430">
<sprite texture="Content/Characters/Charybdis/charybdis.png" sourcerect="432,272,128,560" depth="0.008" origin="0.5,0.5"/>
</limb>
<!-- tail -->
<limb id = "3" radius="80" height="580" type="Tail">
<sprite texture="Content/Characters/Charybdis/charybdis.png" sourcerect="0,0,160,752" depth="0.02" origin="0.5,0.5"/>
</limb>
<!-- body to lower yaw -->
<joint limb1="0" limb1anchor="48,128" limb2="1" limb2anchor="-30,-90" lowerlimit="-10" upperlimit="30"/>
<!-- body to front fin -->
<joint limb1="0" limb1anchor="32,-32" limb2="2" limb2anchor="-32,260" lowerlimit="-50" upperlimit="0"/>
<!-- body to tail -->
<joint limb1="0" limb1anchor="0,-270" limb2="3" limb2anchor="0,280" lowerlimit="-20" upperlimit="20"/>
</ragdoll>
<ai attackhumans="100.0" attackrooms="50.0" attackweaker="50" attackstronger="-30" sight="0.5" hearing="1.0"/>
</Character>
@@ -7,7 +7,7 @@
<sound file="Content/Characters/Crawler/idle2.ogg" state="None" range="500"/> <sound file="Content/Characters/Crawler/idle2.ogg" state="None" range="500"/>
<ragdoll headposition="50" headangle="-70" <ragdoll headposition="50" headangle="-70"
waveamplitude="50.0" wavelength="2500" waveamplitude="5.0" wavelength="5000"
swimspeed="2.0" walkspeed="2.0" swimspeed="2.0" walkspeed="2.0"
stepsize ="15.0,20.0" stepsize ="15.0,20.0"
legtorque="10" legtorque="10"
+9
View File
@@ -40,6 +40,15 @@
spawntype="mainpath" spawntype="mainpath"
musictype="monster"/> musictype="monster"/>
<MonsterEvent name="Under attack" description=""
characterfile="Content/Characters/Charybdis/charybdis.xml"
spawndeep="true"
commonness="3"
difficulty="5"
minamount="1" maxamount="1"
spawntype="deep"
musictype="monster"/>
<MonsterEvent name="Under attack" description="" <MonsterEvent name="Under attack" description=""
characterfile="Content/Characters/Endworm/endworm.xml" characterfile="Content/Characters/Endworm/endworm.xml"
spawndeep="true" spawndeep="true"
@@ -102,6 +102,8 @@ namespace Barotrauma
else else
{ {
Limb head = GetLimb(LimbType.Head); Limb head = GetLimb(LimbType.Head);
if (head == null) head = GetLimb(LimbType.Torso);
float rotation = MathUtils.WrapAngleTwoPi(head.Rotation); float rotation = MathUtils.WrapAngleTwoPi(head.Rotation);
rotation = MathHelper.ToDegrees(rotation); rotation = MathHelper.ToDegrees(rotation);
@@ -147,11 +149,9 @@ namespace Barotrauma
{ {
walkPos -= movement.Length(); walkPos -= movement.Length();
float waveRotation = (float)Math.Sin(walkPos / waveLength) * waveAmplitude; float waveRotation = (float)Math.Sin(walkPos / waveLength);
float angle = MathUtils.GetShortestAngle(tail.body.Rotation, movementAngle + waveRotation); tail.body.ApplyTorque(waveRotation * tail.Mass * 100.0f * waveAmplitude);
tail.body.ApplyTorque(angle * tail.Mass);
//limbs[tailIndex].body.ApplyTorque((Math.Sign(angle) + Math.Max(Math.Min(angle * 10.0f, 10.0f), -10.0f)) * limbs[tailIndex].body.Mass); //limbs[tailIndex].body.ApplyTorque((Math.Sign(angle) + Math.Max(Math.Min(angle * 10.0f, 10.0f), -10.0f)) * limbs[tailIndex].body.Mass);
//limbs[tailIndex].body.ApplyTorque(-limbs[tailIndex].body.AngularVelocity * 0.5f * limbs[tailIndex].body.Mass); //limbs[tailIndex].body.ApplyTorque(-limbs[tailIndex].body.AngularVelocity * 0.5f * limbs[tailIndex].body.Mass);
@@ -160,6 +160,8 @@ namespace Barotrauma
Vector2 steerForce = Vector2.Zero; Vector2 steerForce = Vector2.Zero;
Limb head = GetLimb(LimbType.Head); Limb head = GetLimb(LimbType.Head);
if (head == null) head = GetLimb(LimbType.Torso);
if (head != null) if (head != null)
{ {
float angle = (rotateTowardsMovement) ? float angle = (rotateTowardsMovement) ?
@@ -196,7 +198,11 @@ namespace Barotrauma
for (int i = 0; i < Limbs.Count(); i++) for (int i = 0; i < Limbs.Count(); i++)
{ {
if (steerForce != Vector2.Zero) if (steerForce != Vector2.Zero)
Limbs[i].body.ApplyForce(steerForce * Limbs[i].SteerForce * Limbs[i].Mass); {
Vector2 pullPos = Limbs[i].pullJoint == null ? Limbs[i].SimPosition : Limbs[i].pullJoint.WorldAnchorA;
Limbs[i].body.ApplyForce(steerForce * Limbs[i].SteerForce * Limbs[i].Mass, pullPos);
}
if (Limbs[i].type != LimbType.Torso) continue; if (Limbs[i].type != LimbType.Torso) continue;