Merge branch 'walldamage'
This commit is contained in:
@@ -93,6 +93,7 @@
|
||||
<Compile Include="Source\Characters\CharacterInfo.cs" />
|
||||
<Compile Include="Source\Characters\AI\ISteerable.cs" />
|
||||
<Compile Include="Source\Characters\DelayedEffect.cs" />
|
||||
<Compile Include="Source\Characters\HUDProgressBar.cs" />
|
||||
<Compile Include="Source\Characters\HuskInfection.cs" />
|
||||
<Compile Include="Source\Characters\Jobs\Job.cs" />
|
||||
<Compile Include="Source\Characters\Jobs\JobPrefab.cs" />
|
||||
@@ -496,6 +497,7 @@
|
||||
<Content Include="Content\Characters\Watcher\watcher.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\damageshader.fx" />
|
||||
<Content Include="Content\InfoTexts.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -803,6 +805,9 @@
|
||||
<Content Include="Content\Map\structures2.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Map\walldamage.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Map\waypointIcons.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -812,6 +817,9 @@
|
||||
<Content Include="Content\Particles\flames.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Particles\shrapnel.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\UI\damageOverlay.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -1105,6 +1113,9 @@
|
||||
<None Include="Content\Content.mgcb">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\damageshader.xnb">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\effects.mgfx">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -1267,12 +1278,27 @@
|
||||
<None Include="Content\Sounds\Damage\LimbSlash2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureBlunt10.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureBlunt6.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureBlunt7.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureBlunt8.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureBlunt9.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureCrunch4.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\Damage\StructureCrunch5.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Sounds\fire.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -43,3 +43,9 @@
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:blurshader.fx
|
||||
|
||||
#begin damageshader.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:damageshader.fx
|
||||
|
||||
|
||||
@@ -1,167 +1,239 @@
|
||||
<prefabs>
|
||||
<largehorizontalback sprite="Content/Map/testroom.png" sourcerect="0,0,896,64" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "128" height ="64" resizehorizontal="true"/>
|
||||
<largehorizontalback description="A decorative structure with no collision detection"
|
||||
width="128" height = "64" resizehorizontal="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,0,896,64" depth="0.9"/>
|
||||
</largehorizontalback>
|
||||
|
||||
<smallhorizontalback sprite="Content/Map/testroom.png" sourcerect="0,64,896,32" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "128" height ="32" resizehorizontal="true"/>
|
||||
<smallhorizontalback description="A decorative structure with no collision detection"
|
||||
width="128" height="32" resizehorizontal="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,64,896,32" depth="0.9"/>
|
||||
</smallhorizontalback>
|
||||
|
||||
<largeverticalback sprite="Content/Map/testroom.png" sourcerect="0,96,64,448" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "64" height ="128" resizevertical="true"/>
|
||||
<largeverticalback2 sprite="Content/Map/testroom.png" sourcerect="64,96,64,448" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "64" height ="128" resizevertical="true"/>
|
||||
|
||||
<smallverticalback sprite="Content/Map/testroom.png" sourcerect="128,96,32,352" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "32" height ="128" resizevertical="true"/>
|
||||
<smallverticalback2 sprite="Content/Map/testroom.png" sourcerect="160,96,32,352" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "32" height ="128" resizevertical="true"/>
|
||||
|
||||
<engineeringLabel sprite="Content/Map/testroom.png" sourcerect="448,322,153,16" depth ="0.99"
|
||||
width = "153" height ="16"/>
|
||||
<largeverticalback description="A decorative structure with no collision detection"
|
||||
width="64" height="128" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,96,64,448" depth ="0.9"/>
|
||||
</largeverticalback>
|
||||
|
||||
<commandLabel sprite="Content/Map/testroom.png" sourcerect="448,339,128,16" depth ="0.99"
|
||||
width = "128" height ="16"/>
|
||||
<largeverticalback2 description="A decorative structure with no collision detection"
|
||||
width="64" height="128" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="64,96,64,448" depth="0.9"/>
|
||||
</largeverticalback2>
|
||||
|
||||
<airlockLabel sprite="Content/Map/testroom.png" sourcerect="448,356,199,16" depth ="0.99"
|
||||
width = "99" height ="16"/>
|
||||
<smallverticalback description="A decorative structure with no collision detection"
|
||||
width="32" height="128" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="128,96,32,352" depth ="0.9"/>
|
||||
</smallverticalback>
|
||||
<smallverticalback2 description="A decorative structure with no collision detection"
|
||||
width="32" height="128" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="160,96,32,352" depth="0.9"/>
|
||||
</smallverticalback2>
|
||||
|
||||
<engineeringLabel width="153" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,426,153,16" depth ="0.99"/>
|
||||
</engineeringLabel>
|
||||
|
||||
<commandLabel width="128" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,443,128,16" depth ="0.99"/>
|
||||
</commandLabel>
|
||||
|
||||
<airlockLabel width = "99" height ="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,460,199,16" depth ="0.99"/>
|
||||
</airlockLabel>
|
||||
|
||||
<cabinsLabel width="83" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,477,83,16" depth ="0.99"/>
|
||||
</cabinsLabel>
|
||||
|
||||
<medicalLabel width="110" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,494,110,16" depth="0.99"/>
|
||||
</medicalLabel>
|
||||
|
||||
<arrowUp width="16" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="129,460,16,16" depth ="0.99"/>
|
||||
</arrowUp>
|
||||
|
||||
<arrowDown width="16" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="146,460,16,16" depth ="0.99"/>
|
||||
</arrowDown>
|
||||
|
||||
<arrowLeft width="16" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="129,477,16,16" depth ="0.99"/>
|
||||
</arrowLeft>
|
||||
|
||||
<arrowRight width="16" height="16">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="146,477,16,16" depth ="0.99"/>
|
||||
</arrowRight>
|
||||
|
||||
<leftwall description="A vertical wall with collision detection"
|
||||
width = "32" height ="64" resizevertical="true" body="true" castshadow="true" health="500">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="953,214,32,576" depth ="0.05" fliphorizontal="true"/>
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="989,214,32,576" depth ="0.85" fliphorizontal="true"/>
|
||||
</leftwall>
|
||||
|
||||
<rightwall description="A vertical wall with collision detection"
|
||||
width="32" height="64" resizevertical="true" body="true" castshadow="true" health="500">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="953,214,32,576" depth ="0.05" />
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="989,214,32,576" depth ="0.85"/>
|
||||
</rightwall>
|
||||
|
||||
<topwall description="A horizontal wall with collision detection"
|
||||
width = "64" height ="32" resizehorizontal="true" body="true" castshadow="true" health="500">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,989,576,32" depth ="0.06"/>
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="0,953,576,32" depth ="0.85"/>
|
||||
</topwall>
|
||||
|
||||
<TopWallHeavy description="A horizontal wall with collision detection"
|
||||
width = "96" height ="96" resizehorizontal="true" body="true" castshadow="true" health="1000">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="197,347,480,96" depth ="0.06" />
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="197,446,480,96" depth ="0.85" />
|
||||
</TopWallHeavy>
|
||||
|
||||
<LeftWallHeavy description="A vertical wall with collision detection"
|
||||
width = "96" height ="96" resizevertical="true" body="true" castshadow="true" health="1000">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,546,96,384" depth ="0.06" fliphorizontal="true" />
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="98,546,96,384" depth ="0.85" fliphorizontal="true" />
|
||||
</LeftWallHeavy>
|
||||
|
||||
<RightWallHeavy description="A vertical wall with collision detection"
|
||||
width = "96" height ="96" resizevertical="true" body="true" castshadow="true" health="1000">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,546,96,384" depth ="0.06" />
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="98,546,96,384" depth ="0.85" />
|
||||
</RightWallHeavy>
|
||||
|
||||
<CableHolderHorizontal width="32" height="24" resizehorizontal="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="478,902,96,24" depth = "0.85" />
|
||||
</CableHolderHorizontal>
|
||||
|
||||
<cabinsLabel sprite="Content/Map/testroom.png" sourcerect="448,373,83,16" depth ="0.99"
|
||||
width = "83" height ="16"/>
|
||||
<CableHolderVertical width="24" height="32" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="550,804,24,96" depth = "0.85" />
|
||||
</CableHolderVertical>
|
||||
|
||||
<medicalLabel sprite="Content/Map/testroom.png" sourcerect="448,390,110,16" depth ="0.99"
|
||||
width = "110" height ="16"/>
|
||||
<topwindow width="128" height="49" body="true" health="100">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="208,848,128,80" depth ="0.05"/>
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="344,848,128,80" depth ="0.85"/>
|
||||
</topwindow>
|
||||
|
||||
<arrowUp sprite="Content/Map/testroom.png" sourcerect="577,356,16,16" depth ="0.99"
|
||||
width = "16" height ="16"/>
|
||||
<verticalwindow width="128" height ="224" body="true" health="100">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="368,544,128,224" depth ="0.05"/>
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="239,544,128,224" depth ="0.85"/>
|
||||
</verticalwindow>
|
||||
|
||||
<arrowDown sprite="Content/Map/testroom.png" sourcerect="594,356,16,16" depth ="0.99"
|
||||
width = "16" height ="16"/>
|
||||
<horizontalresizablewindow width="128" height ="64" body="true" health="100" resizehorizontal="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="207,771,128,64" depth ="0.06"/>
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="337,771,128,64" depth ="0.85"/>
|
||||
</horizontalresizablewindow>
|
||||
|
||||
<arrowLeft sprite="Content/Map/testroom.png" sourcerect="577,373,16,16" depth ="0.99"
|
||||
width = "16" height ="16"/>
|
||||
<verticalresizablewindow width = "64" height ="128" body="true" health="100" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="896,80,64,128" depth ="0.06"/>
|
||||
<backgroundsprite texture="Content/Map/testroom.png" sourcerect="961,80,64,128" depth ="0.85"/>
|
||||
</verticalresizablewindow>
|
||||
|
||||
<arrowRight sprite="Content/Map/testroom.png" sourcerect="597,373,16,16" depth ="0.99"
|
||||
width = "16" height ="16"/>
|
||||
<smallhorizontalback description="A decorative structure with no collision detection"
|
||||
width = "128" height ="32" resizehorizontal="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="0,65,896,32" depth ="0.4" />
|
||||
</smallhorizontalback>
|
||||
|
||||
<leftwall sprite="Content/Map/testroom.png" sourcerect="990,274,32,512" depth ="0.05" castshadow="true"
|
||||
description="A vertical wall with collision detection"
|
||||
width = "32" height ="64" resizevertical="true" fliphorizontal="true" body="true" health="500"/>
|
||||
<largeplatform width = "64" height ="64" resizehorizontal="true" body="true" platform="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="896,0,128,64" depth="0.9" />
|
||||
</largeplatform>
|
||||
|
||||
<rightwall sprite="Content/Map/testroom.png" sourcerect="990,274,32,512" depth ="0.05" castshadow="true"
|
||||
description="A vertical wall with collision detection"
|
||||
width = "32" height ="64" resizevertical="true" body="true" health="500"/>
|
||||
<platform width = "64" height ="26" resizehorizontal="true" body="true" platform="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="896,53,128,32" depth ="0.9" />
|
||||
</platform>
|
||||
|
||||
<topwall sprite="Content/Map/testroom.png" sourcerect="3,989,512,32" depth ="0.06" castshadow="true"
|
||||
description="A horizontal wall with collision detection"
|
||||
width = "64" height ="32" resizehorizontal="true" body="true" health="500"/>
|
||||
<roughbgwall width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="200,104,240,240" depth = "1.0" />
|
||||
</roughbgwall>
|
||||
|
||||
<TopWallHeavy sprite="Content/Map/testroom.png" sourcerect="193,414,512,96" depth ="0.06" castshadow="true"
|
||||
description="A horizontal wall with collision detection"
|
||||
width = "96" height ="96" resizehorizontal="true" body="true" health="1000"/>
|
||||
|
||||
<LeftWallHeavy sprite="Content/Map/testroom.png" sourcerect="0,546,96,384" depth ="0.06" castshadow="true"
|
||||
description="A horizontal wall with collision detection"
|
||||
width = "96" height ="96" fliphorizontal="true" resizevertical="true" body="true" health="1000"/>
|
||||
<cleanbgwall width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="448,96,448,224" depth = "1.0"/>
|
||||
</cleanbgwall>
|
||||
|
||||
<RightWallHeavy sprite="Content/Map/testroom.png" sourcerect="0,546,96,384" depth ="0.06" castshadow="true"
|
||||
description="A horizontal wall with collision detection"
|
||||
width = "96" height ="96" resizevertical="true" body="true" health="1000"/>
|
||||
|
||||
<CableHolderHorizontal sprite="Content/Map/testroom.png" sourcerect="199,348,96,24" depth = "0.85"
|
||||
width="32" height="24" resizehorizontal="true"/>
|
||||
<CableHolderVertical sprite="Content/Map/testroom.png" sourcerect="705,416,24,96" depth = "0.85"
|
||||
width="24" height="32" resizevertical="true"/>
|
||||
<bgpanels width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="720,336,224,224" depth = "1.0" />
|
||||
</bgpanels>
|
||||
|
||||
<topwindow sprite="Content/Map/testroom.png" sourcerect="625,327,128,80" depth ="0.05"
|
||||
width = "128" height ="49" body="true" health="100"/>
|
||||
<bgpanelswindow width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="724,560,224,224" depth = "1.0" />
|
||||
</bgpanelswindow>
|
||||
|
||||
<verticalwindow sprite="Content/Map/testroom.png" sourcerect="399,560,128,224" depth ="0.05"
|
||||
width = "128" height ="224" body="true" health="100"/>
|
||||
<bgorangepanels width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="576,798,446,224" depth = "1.0" />
|
||||
</bgorangepanels>
|
||||
|
||||
<horizontalresizablewindow sprite="Content/Map/testroom.png" sourcerect="896,208,128,64" depth ="0.06"
|
||||
width = "128" height ="64" body="true" health="100" resizehorizontal="true"/>
|
||||
<bgorangepanelwindow width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/testroom.png" sourcerect="501,560,224,224" depth = "1.0" />
|
||||
</bgorangepanelwindow>
|
||||
|
||||
<verticalresizablewindow sprite="Content/Map/testroom.png" sourcerect="896,80,64,128" depth ="0.06"
|
||||
width = "64" height ="128" body="true" health="100" resizevertical="true"/>
|
||||
<PipesBackground width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="320,0,192,192" depth = "1.0" />
|
||||
</PipesBackground>
|
||||
|
||||
<smallhorizontalback sprite="Content/Map/testroom.png" sourcerect="0,65,896,32" depth ="0.4"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "128" height ="32" resizehorizontal="true"/>
|
||||
<SlopeForward width="16" height="16" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,0,224,64" depth = "0.95" />
|
||||
</SlopeForward>
|
||||
|
||||
<largeplatform sprite="Content/Map/testroom.png" sourcerect="896,0,128,64" depth="0.9"
|
||||
width = "64" height ="64" resizehorizontal="true" body="true" platform="true"/>
|
||||
<SlopeBack width="16" height="16" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,64,224,64" depth = "0.95" />
|
||||
</SlopeBack>
|
||||
|
||||
<platform sprite="Content/Map/testroom.png" sourcerect="896,53,128,32" depth ="0.9"
|
||||
width = "64" height ="26" resizehorizontal="true" body="true" platform="true"/>
|
||||
<stairsright width="256" height="320" stairdirection="Right">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="256,193,256,319" depth = "0.1" />
|
||||
</stairsright>
|
||||
|
||||
<roughbgwall sprite="Content/Map/testroom.png" sourcerect="200,104,240,240" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
<stairsleft width="256" height="320" stairdirection="Left">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="256,193,256,319" fliphorizontal="true" depth = "0.1" />
|
||||
</stairsleft>
|
||||
|
||||
<cleanbgwall sprite="Content/Map/testroom.png" sourcerect="448,96,448,224" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
<bunk width="173" height="129">
|
||||
<sprite texture="Content/Map/structures2.png" sourcerect="0,129,173,129" depth = "0.9"/>
|
||||
</bunk>
|
||||
|
||||
<bgpanels sprite="Content/Map/testroom.png" sourcerect="768,320,224,224" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
|
||||
<bgpanelswindow sprite="Content/Map/testroom.png" sourcerect="752,560,224,224" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
<RuinWallHorizontal category="Alien" castshadow="true"
|
||||
width="128" height="128" resizehorizontal="true" body="true" health="500">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="0,896,832,128" depth ="0.06"/>
|
||||
</RuinWallHorizontal>
|
||||
|
||||
<bgorangepanels sprite="Content/Map/testroom.png" sourcerect="576,798,446,224" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
<RuinWallVertical category="Alien" castshadow="true"
|
||||
width="128" height="128" resizevertical="true" body="true" health="500">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="896,192,128,832" depth ="0.061"/>
|
||||
</RuinWallVertical>
|
||||
|
||||
<bgorangepanelwindow sprite="Content/Map/testroom.png" sourcerect="528,563,224,224" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
<RuinWallHorizontalSmall category="Alien" castshadow="true"
|
||||
width="128" height="54" resizehorizontal="true" body="true" health="500">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="0,842,832,54" depth ="0.062"/>
|
||||
</RuinWallHorizontalSmall>
|
||||
|
||||
<PipesBackground sprite="Content/Map/testroom.png" sourcerect="381,795,192,192" depth = "1.0"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
<RuinWallVerticalSmall category="Alien" castshadow="true"
|
||||
width= "54" height="128" resizevertical="true" body="true" health="500">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="842,192,54,832" depth ="0.063"/>
|
||||
</RuinWallVerticalSmall>
|
||||
|
||||
<SlopeForward sprite="Content/Map/structures2.png" sourcerect="0,0,224,64"
|
||||
width="16" height="16" resizehorizontal="true" resizevertical="true" depth = "0.95"/>
|
||||
|
||||
<SlopeBack sprite="Content/Map/structures2.png" sourcerect="0,64,224,64"
|
||||
width="16" height="16" resizehorizontal="true" resizevertical="true" depth = "0.95"/>
|
||||
<RuinBack category="Alien"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="0,0,512,512" depth ="0.98"/>
|
||||
</RuinBack>
|
||||
|
||||
<stairsright sprite="Content/Map/testroom.png" sourcerect="100,667,256,320"
|
||||
width="256" height="320" depth = "0.1" stairdirection="Right"/>
|
||||
<RuinBackCarvings category="Alien"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="512,0,233,512" depth ="0.981" />
|
||||
</RuinBackCarvings>
|
||||
|
||||
<stairsleft sprite="Content/Map/testroom.png" fliphorizontal="true" sourcerect="100,667,256,320"
|
||||
width="256" height="320" depth = "0.1" stairdirection="Left"/>
|
||||
<RuinBlock category="Alien"
|
||||
width="514" height="296">
|
||||
<sprite texture="Content/Map/ruins.png" sourcerect="0,513,514,296" depth ="0.99" />
|
||||
</RuinBlock>
|
||||
|
||||
<bunk sprite="Content/Map/testroom.png" sourcerect="130,514,173,129"
|
||||
width="173" height="129" depth = "0.9"/>
|
||||
<RuinFractalBall category="Alien"
|
||||
width="512" height="512">
|
||||
<sprite texture="Content/Map/ruins2.png" sourcerect="0,0,512,512" depth ="0.971" />
|
||||
</RuinFractalBall>
|
||||
|
||||
|
||||
<RuinWallHorizontal category="Alien" sprite="Content/Map/ruins.png" sourcerect="0,896,832,128" depth ="0.06" castshadow="true"
|
||||
width = "128" height ="128" resizehorizontal="true" body="true" health="500"/>
|
||||
|
||||
<RuinWallVertical category="Alien" sprite="Content/Map/ruins.png" sourcerect="896,192,128,832" depth ="0.061" castshadow="true"
|
||||
width = "128" height ="128" resizevertical="true" body="true" health="500"/>
|
||||
|
||||
<RuinWallHorizontalSmall category="Alien" sprite="Content/Map/ruins.png" sourcerect="0,842,832,54" depth ="0.062" castshadow="true"
|
||||
width = "128" height ="54" resizehorizontal="true" body="true" health="500"/>
|
||||
|
||||
<RuinWallVerticalSmall category="Alien" sprite="Content/Map/ruins.png" sourcerect="842,192,54,832" depth ="0.063" castshadow="true"
|
||||
width = "54" height ="128" resizevertical="true" body="true" health="500"/>
|
||||
|
||||
|
||||
<RuinBack category="Alien" sprite="Content/Map/ruins.png" sourcerect="0,0,512,512" depth ="0.98"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
|
||||
<RuinBackCarvings category="Alien" sprite="Content/Map/ruins.png" sourcerect="512,0,233,512" depth ="0.981"
|
||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||
|
||||
<RuinBlock category="Alien" sprite="Content/Map/ruins.png" sourcerect="0,513,514,296" depth ="0.99"
|
||||
width="514" height="296"/>
|
||||
|
||||
<RuinFractalBall category="Alien" sprite="Content/Map/ruins2.png" sourcerect="0,0,512,512" depth ="0.971"
|
||||
width="512" height="512"/>
|
||||
|
||||
<RuinClaw category="Alien" sprite="Content/Map/ruins2.png" sourcerect="512,517,126,270" depth ="0.97"
|
||||
width="126" height="270"/>
|
||||
<RuinClaw category="Alien"
|
||||
width="126" height="270">
|
||||
<sprite texture="Content/Map/ruins2.png" sourcerect="512,517,126,270" depth ="0.97"/>
|
||||
</RuinClaw>
|
||||
|
||||
</prefabs>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 162 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
Subsurface/Content/Map/walldamage.png
Normal file
BIN
Subsurface/Content/Map/walldamage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
@@ -234,4 +234,68 @@
|
||||
velocitychange="0.0, 1.0">
|
||||
<sprite texture="Content/Particles/spatter.png" sourcerect="128,128,128,128"/>
|
||||
</flare>
|
||||
|
||||
<shrapnel
|
||||
startsizemin="0.1,0.1" startsizemax="1.0,1.0"
|
||||
startrotationmin ="0.0" startrotationmax="360"
|
||||
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||
colorchange="0.0, 0.0, 0.0, -0.3"
|
||||
lifetime="10.0"
|
||||
drawtarget="both"
|
||||
collideswithwalls="true"
|
||||
collisionradius="10.0"
|
||||
restitution="0.2"
|
||||
waterdrag="0.1"
|
||||
growtime ="0.0"
|
||||
velocitychange="0.0, -5.0">
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="0,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="32,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="64,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="96,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="128,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="160,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="192,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="224,0,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="0,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="32,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="64,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="96,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="128,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="160,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="192,32,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="224,32,32,32"/>
|
||||
</shrapnel>
|
||||
|
||||
<iceshards
|
||||
startsizemin="0.1,0.1" startsizemax="1.0,1.0"
|
||||
startrotationmin ="0.0" startrotationmax="360"
|
||||
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||
colorchange="0.0, 0.0, 0.0, -0.3"
|
||||
lifetime="10.0"
|
||||
drawtarget="both"
|
||||
collideswithwalls="true"
|
||||
collisionradius="10.0"
|
||||
restitution="0.2"
|
||||
waterdrag="0.3"
|
||||
growtime ="0.0"
|
||||
velocitychange="0.0, -5.0">
|
||||
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="0,64,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="32,64,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="64,64,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="96,64,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="128,64,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="160,64,48,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="208,64,48,32"/>
|
||||
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="0,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="32,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="64,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="96,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="128,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="160,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="192,96,32,32"/>
|
||||
<sprite texture="Content/Particles/shrapnel.png" sourcerect="224,96,32,32"/>
|
||||
</iceshards>
|
||||
|
||||
</prefabs>
|
||||
|
||||
BIN
Subsurface/Content/Particles/shrapnel.png
Normal file
BIN
Subsurface/Content/Particles/shrapnel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
BIN
Subsurface/Content/Sounds/Damage/StructureBlunt10.ogg
Normal file
BIN
Subsurface/Content/Sounds/Damage/StructureBlunt10.ogg
Normal file
Binary file not shown.
BIN
Subsurface/Content/Sounds/Damage/StructureBlunt8.ogg
Normal file
BIN
Subsurface/Content/Sounds/Damage/StructureBlunt8.ogg
Normal file
Binary file not shown.
BIN
Subsurface/Content/Sounds/Damage/StructureBlunt9.ogg
Normal file
BIN
Subsurface/Content/Sounds/Damage/StructureBlunt9.ogg
Normal file
Binary file not shown.
BIN
Subsurface/Content/Sounds/Damage/StructureCrunch4.ogg
Normal file
BIN
Subsurface/Content/Sounds/Damage/StructureCrunch4.ogg
Normal file
Binary file not shown.
BIN
Subsurface/Content/Sounds/Damage/StructureCrunch5.ogg
Normal file
BIN
Subsurface/Content/Sounds/Damage/StructureCrunch5.ogg
Normal file
Binary file not shown.
@@ -3,14 +3,20 @@
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt1.ogg" damagerange="0.0,30.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt2.ogg" damagerange="20.0,30.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt3.ogg" damagerange="25.0,50.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt4.ogg" damagerange="40.0,80.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt5.ogg" damagerange="60.0,80.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt6.ogg" damagerange="60.0,100.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt7.ogg" damagerange="80.0,100.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt4.ogg" damagerange="25.0,50.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt5.ogg" damagerange="40.0,60.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt6.ogg" damagerange="40.0,70.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt7.ogg" damagerange="60.0,90.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt8.ogg" damagerange="60.0,90.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt9.ogg" damagerange="80.0,100.0" damagesoundtype="StructureBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureBlunt10.ogg" damagerange="80.0,100.0" damagesoundtype="StructureBlunt"/>
|
||||
|
||||
|
||||
<damagesound file="Content/Sounds/Damage/StructureCrunch1.ogg" damagerange="0.0,40.0" damagesoundtype="StructureSlash"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureCrunch2.ogg" damagerange="5.0,70.0" damagesoundtype="StructureSlash"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureCrunch3.ogg" damagerange="5.0,100.0" damagesoundtype="StructureSlash"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureCrunch3.ogg" damagerange="5.0,70.0" damagesoundtype="StructureSlash"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureCrunch4.ogg" damagerange="25.0,100.0" damagesoundtype="StructureSlash"/>
|
||||
<damagesound file="Content/Sounds/Damage/StructureCrunch5.ogg" damagerange="25.0,100.0" damagesoundtype="StructureSlash"/>
|
||||
|
||||
<damagesound file="Content/Sounds/Damage/LimbBlunt1.ogg" damagerange="0.0,40.0" damagesoundtype="LimbBlunt"/>
|
||||
<damagesound file="Content/Sounds/Damage/LimbBlunt2.ogg" damagerange="0.0,40.0" damagesoundtype="LimbBlunt"/>
|
||||
|
||||
38
Subsurface/Content/damageshader.fx
Normal file
38
Subsurface/Content/damageshader.fx
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
Texture xTexture;
|
||||
sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; };
|
||||
|
||||
Texture xStencil;
|
||||
sampler StencilSampler = sampler_state { Texture = <xStencil>; };
|
||||
|
||||
|
||||
float aCutoff;
|
||||
float aMultiplier;
|
||||
|
||||
float cCutoff;
|
||||
float cMultiplier;
|
||||
|
||||
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float4 c = tex2D(TextureSampler, texCoord);
|
||||
|
||||
float4 stencilColor = tex2D(StencilSampler, texCoord);
|
||||
|
||||
float aDiff = stencilColor.a - aCutoff;
|
||||
|
||||
clip(aDiff);
|
||||
|
||||
float cDiff = stencilColor.a - cCutoff;
|
||||
|
||||
return float4(
|
||||
lerp(stencilColor.rgb, c.rgb, clamp(cDiff * cMultiplier, 0.0f, 1.0f)),
|
||||
min(aDiff * aMultiplier, c.a));
|
||||
}
|
||||
|
||||
technique StencilShader
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_4_0_level_9_3 main();
|
||||
}
|
||||
}
|
||||
BIN
Subsurface/Content/damageshader.xnb
Normal file
BIN
Subsurface/Content/damageshader.xnb
Normal file
Binary file not shown.
@@ -93,6 +93,8 @@ namespace Barotrauma
|
||||
protected Item closestItem;
|
||||
private Character closestCharacter, selectedCharacter;
|
||||
|
||||
private Dictionary<object, HUDProgressBar> hudProgressBars;
|
||||
|
||||
protected bool isDead;
|
||||
private CauseOfDeath lastAttackCauseOfDeath;
|
||||
private CauseOfDeath causeOfDeath;
|
||||
@@ -301,6 +303,11 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<object, HUDProgressBar> HUDProgressBars
|
||||
{
|
||||
get { return hudProgressBars; }
|
||||
}
|
||||
|
||||
public HuskInfection huskInfection;
|
||||
public float HuskInfectionState
|
||||
{
|
||||
@@ -498,6 +505,8 @@ namespace Barotrauma
|
||||
|
||||
selectedItems = new Item[2];
|
||||
|
||||
hudProgressBars = new Dictionary<object, HUDProgressBar>();
|
||||
|
||||
IsNetworkPlayer = isNetworkPlayer;
|
||||
|
||||
oxygen = 100.0f;
|
||||
@@ -516,8 +525,6 @@ namespace Barotrauma
|
||||
|
||||
XDocument doc = ToolBox.TryLoadXml(file);
|
||||
if (doc == null || doc.Root == null) return;
|
||||
|
||||
|
||||
|
||||
SpeciesName = ToolBox.GetAttributeString(doc.Root, "name", "Unknown");
|
||||
|
||||
@@ -1184,6 +1191,16 @@ namespace Barotrauma
|
||||
{
|
||||
Lights.LightManager.ViewTarget = this;
|
||||
CharacterHUD.Update(deltaTime, this);
|
||||
|
||||
foreach (HUDProgressBar progressBar in hudProgressBars.Values)
|
||||
{
|
||||
progressBar.Update(deltaTime);
|
||||
}
|
||||
|
||||
foreach (var pb in hudProgressBars.Where(pb => pb.Value.FadeTimer<=0.0f).ToList())
|
||||
{
|
||||
hudProgressBars.Remove(pb.Key);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsUnconscious)
|
||||
@@ -1277,10 +1294,6 @@ namespace Barotrauma
|
||||
if (!Enabled) return;
|
||||
|
||||
AnimController.Draw(spriteBatch);
|
||||
|
||||
//GUI.DrawLine(spriteBatch, ConvertUnits.ToDisplayUnits(animController.limbs[0].SimPosition.X, animController.limbs[0].SimPosition.Y),
|
||||
// ConvertUnits.ToDisplayUnits(animController.limbs[0].SimPosition.X, animController.limbs[0].SimPosition.Y) +
|
||||
// ConvertUnits.ToDisplayUnits(animController.targetMovement.X, animController.targetMovement.Y), Color.Green);
|
||||
}
|
||||
|
||||
public void DrawHUD(SpriteBatch spriteBatch, Camera cam)
|
||||
@@ -1292,9 +1305,6 @@ namespace Barotrauma
|
||||
{
|
||||
if (!Enabled) return;
|
||||
|
||||
Vector2 pos = DrawPosition;
|
||||
pos.Y = -pos.Y;
|
||||
|
||||
if (GameMain.DebugDraw)
|
||||
{
|
||||
AnimController.DebugDraw(spriteBatch);
|
||||
@@ -1303,6 +1313,9 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
if (this == controlled) return;
|
||||
|
||||
Vector2 pos = DrawPosition;
|
||||
pos.Y = -pos.Y;
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
@@ -1333,6 +1346,26 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a progress bar that's "linked" to the specified object (or updates an existing one if there's one already linked to the object)
|
||||
/// The progress bar will automatically fade out after 1 sec if the method hasn't been called during that time
|
||||
/// </summary>
|
||||
public HUDProgressBar UpdateHUDProgressBar(object linkedObject, Vector2 worldPosition, float progress, Color emptyColor, Color fullColor)
|
||||
{
|
||||
HUDProgressBar progressBar = null;
|
||||
if (!hudProgressBars.TryGetValue(linkedObject, out progressBar))
|
||||
{
|
||||
progressBar = new HUDProgressBar(worldPosition, Submarine, emptyColor, fullColor);
|
||||
hudProgressBars.Add(linkedObject, progressBar);
|
||||
}
|
||||
|
||||
progressBar.WorldPosition = worldPosition;
|
||||
progressBar.FadeTimer = Math.Max(progressBar.FadeTimer, 1.0f);
|
||||
progressBar.Progress = progress;
|
||||
|
||||
return progressBar;
|
||||
}
|
||||
|
||||
public void PlaySound(AIController.AiState state)
|
||||
{
|
||||
if (sounds == null || !sounds.Any()) return;
|
||||
|
||||
@@ -150,7 +150,12 @@ namespace Barotrauma
|
||||
|
||||
textPos.Y += 25;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (HUDProgressBar progressBar in character.HUDProgressBars.Values)
|
||||
{
|
||||
progressBar.Draw(spriteBatch, cam);
|
||||
}
|
||||
}
|
||||
|
||||
if (Screen.Selected == GameMain.EditMapScreen) return;
|
||||
|
||||
87
Subsurface/Source/Characters/HUDProgressBar.cs
Normal file
87
Subsurface/Source/Characters/HUDProgressBar.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class HUDProgressBar
|
||||
{
|
||||
private float progress;
|
||||
|
||||
public float Progress
|
||||
{
|
||||
get { return progress; }
|
||||
set { progress = MathHelper.Clamp(value, 0.0f, 1.0f); }
|
||||
}
|
||||
|
||||
public float FadeTimer;
|
||||
|
||||
private Color fullColor, emptyColor;
|
||||
|
||||
private Vector2 worldPosition;
|
||||
|
||||
public Vector2 WorldPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return worldPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
worldPosition = value;
|
||||
if (parentSub != null)
|
||||
{
|
||||
worldPosition -= parentSub.DrawPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 Size;
|
||||
|
||||
private Submarine parentSub;
|
||||
|
||||
public HUDProgressBar(Vector2 worldPosition, Submarine parentSubmarine = null)
|
||||
: this(worldPosition, parentSubmarine, Color.Red, Color.Green)
|
||||
{
|
||||
}
|
||||
|
||||
public HUDProgressBar(Vector2 worldPosition, Submarine parentSubmarine, Color emptyColor, Color fullColor)
|
||||
{
|
||||
this.emptyColor = emptyColor;
|
||||
this.fullColor = fullColor;
|
||||
|
||||
parentSub = parentSubmarine;
|
||||
|
||||
WorldPosition = worldPosition;
|
||||
|
||||
Size = new Vector2(100.0f, 20.0f);
|
||||
|
||||
FadeTimer = 1.0f;
|
||||
}
|
||||
|
||||
public void Update(float deltatime)
|
||||
{
|
||||
FadeTimer -= deltatime;
|
||||
}
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch, Camera cam)
|
||||
{
|
||||
float a = Math.Min(FadeTimer, 1.0f);
|
||||
|
||||
Vector2 pos = new Vector2(WorldPosition.X - Size.X / 2, WorldPosition.Y + Size.Y / 2);
|
||||
|
||||
if (parentSub != null)
|
||||
{
|
||||
pos += parentSub.DrawPosition;
|
||||
}
|
||||
|
||||
pos = cam.WorldToScreen(pos);
|
||||
|
||||
GUI.DrawProgressBar(spriteBatch,
|
||||
new Vector2(pos.X, -pos.Y),
|
||||
Size, progress,
|
||||
Color.Lerp(emptyColor, fullColor, progress) * a,
|
||||
Color.White * a * 0.8f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -273,12 +273,15 @@ namespace Barotrauma
|
||||
|
||||
public static void DrawProgressBar(SpriteBatch sb, Vector2 start, Vector2 size, float progress, Color clr, float depth = 0.0f)
|
||||
{
|
||||
//outlinecolor = "0.5, 0.57, 0.6, 1.0" >
|
||||
DrawProgressBar(sb, start, size, progress, clr, new Color(0.5f, 0.57f, 0.6f, 1.0f), depth);
|
||||
}
|
||||
|
||||
DrawRectangle(sb, new Vector2(start.X, -start.Y), size, new Color(0.5f, 0.57f, 0.6f, 1.0f), false, depth);
|
||||
public static void DrawProgressBar(SpriteBatch sb, Vector2 start, Vector2 size, float progress, Color clr, Color outlineColor, float depth = 0.0f)
|
||||
{
|
||||
DrawRectangle(sb, new Vector2(start.X, -start.Y), size, outlineColor, false, depth);
|
||||
|
||||
int padding = 2;
|
||||
DrawRectangle(sb, new Rectangle((int)start.X + padding, -(int)(start.Y - padding), (int)((size.X - padding * 2)*progress), (int)size.Y - padding * 2),
|
||||
DrawRectangle(sb, new Rectangle((int)start.X + padding, -(int)(start.Y - padding), (int)((size.X - padding * 2) * progress), (int)size.Y - padding * 2),
|
||||
clr, true, depth);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
class Pickable : ItemComponent, IDrawableComponent
|
||||
class Pickable : ItemComponent
|
||||
{
|
||||
protected Character picker;
|
||||
|
||||
@@ -125,6 +125,13 @@ namespace Barotrauma.Items.Components
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
|
||||
picker.UpdateHUDProgressBar(
|
||||
this,
|
||||
item.WorldPosition,
|
||||
pickTimer / requiredTime,
|
||||
Color.Red, Color.Green);
|
||||
|
||||
picker.AnimController.Anim = AnimController.Animation.UsingConstruction;
|
||||
|
||||
picker.AnimController.TargetMovement = Vector2.Zero;
|
||||
@@ -175,23 +182,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch, bool editing = false)
|
||||
{
|
||||
if (pickTimer <= 0.0f)
|
||||
{
|
||||
Drawable = false;
|
||||
return;
|
||||
}
|
||||
|
||||
float progressBarWidth = 100.0f;
|
||||
|
||||
GUI.DrawProgressBar(spriteBatch, item.DrawPosition + new Vector2(-progressBarWidth/2.0f, 50.0f), new Vector2(progressBarWidth, 15.0f),
|
||||
pickTimer / PickingTime,
|
||||
Color.Lerp(Color.Red, Color.Green, pickTimer / PickingTime));
|
||||
}
|
||||
|
||||
public override void Drop(Character dropper)
|
||||
{
|
||||
if (picker == null)
|
||||
|
||||
@@ -178,11 +178,24 @@ namespace Barotrauma.Items.Components
|
||||
if ((targetStructure = (targetBody.UserData as Structure)) != null)
|
||||
{
|
||||
if (!fixableEntities.Contains(targetStructure.Name)) return;
|
||||
if (targetStructure.IsPlatform) return;
|
||||
|
||||
int sectionIndex = targetStructure.FindSectionIndex(ConvertUnits.ToDisplayUnits(pickedPosition));
|
||||
if (sectionIndex < 0) return;
|
||||
|
||||
targetStructure.HighLightSection(sectionIndex);
|
||||
Vector2 progressBarPos = targetStructure.SectionPosition(sectionIndex);
|
||||
if (targetStructure.Submarine != null)
|
||||
{
|
||||
progressBarPos += targetStructure.Submarine.DrawPosition;
|
||||
}
|
||||
|
||||
var progressBar = user.UpdateHUDProgressBar(
|
||||
targetStructure,
|
||||
progressBarPos,
|
||||
1.0f - targetStructure.SectionDamage(sectionIndex) / targetStructure.Health,
|
||||
Color.Red, Color.Green);
|
||||
|
||||
progressBar.Size = new Vector2(60.0f, 20.0f);
|
||||
|
||||
targetStructure.AddDamage(sectionIndex, -StructureFixAmount * degreeOfSuccess);
|
||||
|
||||
@@ -195,12 +208,10 @@ namespace Barotrauma.Items.Components
|
||||
(sectionIndex == targetStructure.SectionCount - 2 && i == 1) ||
|
||||
(nextSectionLength > 0 && nextSectionLength < Structure.wallSectionSize * 0.3f))
|
||||
{
|
||||
targetStructure.HighLightSection(sectionIndex + i);
|
||||
//targetStructure.HighLightSection(sectionIndex + i);
|
||||
targetStructure.AddDamage(sectionIndex + i, -StructureFixAmount * degreeOfSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ((targetLimb = (targetBody.UserData as Limb)) != null)
|
||||
{
|
||||
@@ -213,7 +224,7 @@ namespace Barotrauma.Items.Components
|
||||
ApplyStatusEffects(ActionType.OnUse, targetItem.AllPropertyObjects, deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool AIOperate(float deltaTime, Character character, AIObjectiveOperateItem objective)
|
||||
{
|
||||
Gap leak = objective.OperateTarget as Gap;
|
||||
@@ -222,7 +233,7 @@ namespace Barotrauma.Items.Components
|
||||
float dist = Vector2.Distance(leak.WorldPosition, item.WorldPosition);
|
||||
|
||||
//too far away -> consider this done and hope the AI is smart enough to move closer
|
||||
if (dist > range*5.0f) return true;
|
||||
if (dist > range * 5.0f) return true;
|
||||
|
||||
//steer closer if almost in range
|
||||
if (dist > range)
|
||||
@@ -240,8 +251,6 @@ namespace Barotrauma.Items.Components
|
||||
//close enough -> stop moving
|
||||
character.AIController.SteeringManager.Reset();
|
||||
}
|
||||
|
||||
|
||||
|
||||
character.CursorPosition = leak.Position;
|
||||
character.SetInput(InputType.Aim, false, true);
|
||||
|
||||
@@ -163,6 +163,8 @@ namespace Barotrauma
|
||||
hulls[1] = temp;
|
||||
}
|
||||
|
||||
flowTargetHull = hulls[0];
|
||||
|
||||
for (int i = 0 ; i <2; i++)
|
||||
{
|
||||
if (hulls[i]==null) continue;
|
||||
|
||||
@@ -86,6 +86,30 @@ namespace Barotrauma
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public virtual bool DrawBelowWater
|
||||
{
|
||||
get
|
||||
{
|
||||
return Sprite != null && Sprite.Depth > 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool DrawOverWater
|
||||
{
|
||||
get
|
||||
{
|
||||
return !DrawBelowWater;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool DrawDamageEffect
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool IsLinkable
|
||||
{
|
||||
@@ -203,6 +227,8 @@ namespace Barotrauma
|
||||
|
||||
public virtual void Draw(SpriteBatch spriteBatch, bool editing, bool back=true) {}
|
||||
|
||||
public virtual void DrawDamage(SpriteBatch spriteBatch, Effect damageEffect) {}
|
||||
|
||||
public override void Remove()
|
||||
{
|
||||
base.Remove();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using FarseerPhysics;
|
||||
@@ -21,11 +20,10 @@ namespace Barotrauma
|
||||
public float damage;
|
||||
public Gap gap;
|
||||
|
||||
public int GapIndex;
|
||||
public int GapID;
|
||||
|
||||
public float lastSentDamage;
|
||||
|
||||
public bool isHighLighted;
|
||||
public ConvexHull hull;
|
||||
|
||||
public WallSection(Rectangle rect)
|
||||
@@ -43,7 +41,7 @@ namespace Barotrauma
|
||||
|
||||
class Structure : MapEntity, IDamageable
|
||||
{
|
||||
public static int wallSectionSize = 100;
|
||||
public static int wallSectionSize = 96;
|
||||
public static List<Structure> WallList = new List<Structure>();
|
||||
|
||||
List<ConvexHull> convexHulls;
|
||||
@@ -105,6 +103,30 @@ namespace Barotrauma
|
||||
get { return prefab.MaxHealth; }
|
||||
}
|
||||
|
||||
public override bool DrawBelowWater
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.DrawBelowWater || prefab.BackgroundSprite != null;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DrawOverWater
|
||||
{
|
||||
get
|
||||
{
|
||||
return !DrawDamageEffect;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DrawDamageEffect
|
||||
{
|
||||
get
|
||||
{
|
||||
return prefab.HasBody;
|
||||
}
|
||||
}
|
||||
|
||||
public override Rectangle Rect
|
||||
{
|
||||
get
|
||||
@@ -373,6 +395,20 @@ namespace Barotrauma
|
||||
{
|
||||
if (prefab.sprite == null) return;
|
||||
|
||||
Draw(spriteBatch, editing, back, null);
|
||||
}
|
||||
|
||||
public override void DrawDamage(SpriteBatch spriteBatch, Effect damageEffect)
|
||||
{
|
||||
Draw(spriteBatch, false, false, damageEffect);
|
||||
}
|
||||
|
||||
private static float prevCutoff;
|
||||
|
||||
private void Draw(SpriteBatch spriteBatch, bool editing, bool back = true, Effect damageEffect = null)
|
||||
{
|
||||
if (prefab.sprite == null) return;
|
||||
|
||||
Color color = (isHighlighted) ? Color.Orange : Color.White;
|
||||
if (isSelected && editing)
|
||||
{
|
||||
@@ -382,51 +418,46 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
Vector2 drawOffset = Submarine == null ? Vector2.Zero : Submarine.DrawPosition;
|
||||
if(sections.Length == 1)
|
||||
prefab.sprite.DrawTiled(spriteBatch, new Vector2(rect.X + drawOffset.X, -(rect.Y + drawOffset.Y)), new Vector2(rect.Width, rect.Height), Vector2.Zero, color,Point.Zero);
|
||||
|
||||
foreach (WallSection s in sections)
|
||||
if (back && damageEffect == null)
|
||||
{
|
||||
Point offset = new Point(Math.Abs(rect.Location.X - s.rect.Location.X), Math.Abs(rect.Location.Y - s.rect.Location.Y));
|
||||
if (sections.Length != 1 && s.damage < prefab.MaxHealth)
|
||||
prefab.sprite.DrawTiled(spriteBatch, new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height), Vector2.Zero, color, offset);
|
||||
|
||||
if (s.isHighLighted)
|
||||
if (prefab.BackgroundSprite != null)
|
||||
{
|
||||
GUI.DrawRectangle(spriteBatch,
|
||||
new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height),
|
||||
new Color((s.damage / prefab.MaxHealth), 1.0f - (s.damage / prefab.MaxHealth), 0.0f, 1.0f), true);
|
||||
prefab.BackgroundSprite.DrawTiled(
|
||||
spriteBatch,
|
||||
new Vector2(rect.X + drawOffset.X, -(rect.Y + drawOffset.Y)),
|
||||
new Vector2(rect.Width, rect.Height),
|
||||
Vector2.Zero, color, Point.Zero);
|
||||
}
|
||||
|
||||
s.isHighLighted = false;
|
||||
|
||||
if (s.damage < 0.01f) continue;
|
||||
|
||||
GUI.DrawRectangle(spriteBatch,
|
||||
new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height),
|
||||
Color.Black * (s.damage / prefab.MaxHealth), true);
|
||||
}
|
||||
/*
|
||||
if(_convexHulls == null) return;
|
||||
var rand = new Random(32434324);
|
||||
foreach (var hull in _convexHulls)
|
||||
|
||||
if (back == prefab.sprite.Depth > 0.5f || editing)
|
||||
{
|
||||
if (sections.Count(x => x.hull == hull) <= 1)
|
||||
continue;
|
||||
var col = new Color((int) (255 * rand.NextDouble()), (int)(255 * rand.NextDouble()), (int)(255 * rand.NextDouble()), 255);
|
||||
GUI.DrawRectangle(spriteBatch,new Vector2 (hull.BoundingBox.X + drawOffset.X, -(hull.BoundingBox.Y + drawOffset.Y)), new Vector2(hull.BoundingBox.Width, hull.BoundingBox.Height),col,true );
|
||||
}*/
|
||||
foreach (WallSection s in sections)
|
||||
{
|
||||
if (damageEffect != null)
|
||||
{
|
||||
float newCutoff = Math.Min((s.damage / prefab.MaxHealth), 0.65f);
|
||||
|
||||
if (Math.Abs(newCutoff - prevCutoff) > 0.01f)
|
||||
{
|
||||
damageEffect.Parameters["aCutoff"].SetValue(newCutoff);
|
||||
damageEffect.Parameters["cCutoff"].SetValue(newCutoff*1.2f);
|
||||
|
||||
damageEffect.CurrentTechnique.Passes[0].Apply();
|
||||
|
||||
prevCutoff = newCutoff;
|
||||
}
|
||||
}
|
||||
|
||||
Point offset = new Point(Math.Abs(rect.Location.X - s.rect.Location.X), Math.Abs(rect.Location.Y - s.rect.Location.Y));
|
||||
prefab.sprite.DrawTiled(spriteBatch, new Vector2(s.rect.X + drawOffset.X, -(s.rect.Y + drawOffset.Y)), new Vector2(s.rect.Width, s.rect.Height), Vector2.Zero, color, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool OnWallCollision(Fixture f1, Fixture f2, Contact contact)
|
||||
{
|
||||
//Structure structure = f1.Body.UserData as Structure;
|
||||
|
||||
//if (f2.Body.UserData as Item != null)
|
||||
//{
|
||||
// if (prefab.IsPlatform || prefab.StairDirection != Direction.None) return false;
|
||||
//}
|
||||
|
||||
if (prefab.IsPlatform)
|
||||
{
|
||||
Limb limb;
|
||||
@@ -468,9 +499,12 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
|
||||
public void HighLightSection(int sectionIndex)
|
||||
public WallSection GetSection(int sectionIndex)
|
||||
{
|
||||
sections[sectionIndex].isHighLighted = true;
|
||||
if (sectionIndex < 0 || sectionIndex >= sections.Length) return null;
|
||||
|
||||
return sections[sectionIndex];
|
||||
|
||||
}
|
||||
|
||||
public bool SectionBodyDisabled(int sectionIndex)
|
||||
@@ -503,8 +537,24 @@ namespace Barotrauma
|
||||
|
||||
if (sectionIndex < 0 || sectionIndex > sections.Length - 1) return;
|
||||
|
||||
if (GameMain.Client == null) SetDamage(sectionIndex, sections[sectionIndex].damage + damage);
|
||||
var section = sections[sectionIndex];
|
||||
|
||||
int particleAmount = (int)(Math.Min(Health - section.damage, damage) * Rand.Range(0.01f, 1.0f));
|
||||
|
||||
particleAmount = Math.Min(particleAmount, 200);
|
||||
for (int i = 0; i < particleAmount; i++)
|
||||
{
|
||||
Vector2 particlePos = new Vector2(
|
||||
Rand.Range(section.rect.X, section.rect.Right),
|
||||
Rand.Range(section.rect.Y - section.rect.Height, section.rect.Y));
|
||||
|
||||
if (Submarine != null) particlePos += Submarine.DrawPosition;
|
||||
|
||||
var particle = GameMain.ParticleManager.CreateParticle("shrapnel", particlePos, Rand.Vector(Rand.Range(1.0f, 50.0f)));
|
||||
if (particle == null) break;
|
||||
}
|
||||
|
||||
if (GameMain.Client == null) SetDamage(sectionIndex, section.damage + damage);
|
||||
}
|
||||
|
||||
public int FindSectionIndex(Vector2 displayPos)
|
||||
@@ -763,7 +813,7 @@ namespace Barotrauma
|
||||
s.sections[index].damage =
|
||||
ToolBox.GetAttributeFloat(subElement, "damage", 0.0f);
|
||||
|
||||
s.sections[index].GapIndex = ToolBox.GetAttributeInt(subElement, "gap", -1);
|
||||
s.sections[index].GapID = ToolBox.GetAttributeInt(subElement, "gap", -1);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -774,9 +824,9 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (WallSection s in sections)
|
||||
{
|
||||
if (s.GapIndex == -1) continue;
|
||||
if (s.GapID == -1) continue;
|
||||
|
||||
s.gap = FindEntityByID((ushort)s.GapIndex) as Gap;
|
||||
s.gap = FindEntityByID((ushort)s.GapID) as Gap;
|
||||
if (s.gap != null) s.gap.ConnectedWall = this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,12 @@ namespace Barotrauma
|
||||
{
|
||||
get { return size; }
|
||||
}
|
||||
|
||||
public Sprite BackgroundSprite
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public static void LoadAll(List<string> filePaths)
|
||||
{
|
||||
@@ -74,22 +80,45 @@ namespace Barotrauma
|
||||
StructurePrefab sp = new StructurePrefab();
|
||||
sp.name = element.Name.ToString();
|
||||
|
||||
Vector4 sourceVector = ToolBox.GetAttributeVector4(element, "sourcerect", new Vector4(0,0,1,1));
|
||||
//Vector4 sourceVector = ToolBox.GetAttributeVector4(element, "sourcerect", new Vector4(0,0,1,1));
|
||||
|
||||
Rectangle sourceRect = new Rectangle(
|
||||
(int)sourceVector.X,
|
||||
(int)sourceVector.Y,
|
||||
(int)sourceVector.Z,
|
||||
(int)sourceVector.W);
|
||||
//Rectangle sourceRect = new Rectangle(
|
||||
// (int)sourceVector.X,
|
||||
// (int)sourceVector.Y,
|
||||
// (int)sourceVector.Z,
|
||||
// (int)sourceVector.W);
|
||||
|
||||
if (element.Attribute("sprite") != null)
|
||||
{
|
||||
sp.sprite = new Sprite(element.Attribute("sprite").Value, sourceRect, Vector2.Zero);
|
||||
//if (element.Attribute("sprite") != null)
|
||||
//{
|
||||
// sp.sprite = new Sprite(element.Attribute("sprite").Value, sourceRect, Vector2.Zero);
|
||||
|
||||
sp.sprite.Depth = ToolBox.GetAttributeFloat(element, "depth", 0.0f);
|
||||
// sp.sprite.Depth = ToolBox.GetAttributeFloat(element, "depth", 0.0f);
|
||||
|
||||
if (ToolBox.GetAttributeBool(element, "fliphorizontal", false)) sp.sprite.effects = SpriteEffects.FlipHorizontally;
|
||||
if (ToolBox.GetAttributeBool(element, "flipvertical", false)) sp.sprite.effects = SpriteEffects.FlipVertically;
|
||||
//}
|
||||
|
||||
foreach (XElement subElement in element.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString())
|
||||
{
|
||||
case "sprite":
|
||||
sp.sprite = new Sprite(subElement);
|
||||
|
||||
if (ToolBox.GetAttributeBool(subElement, "fliphorizontal", false))
|
||||
sp.sprite.effects = SpriteEffects.FlipHorizontally;
|
||||
if (ToolBox.GetAttributeBool(subElement, "flipvertical", false))
|
||||
sp.sprite.effects = SpriteEffects.FlipVertically;
|
||||
|
||||
break;
|
||||
case "backgroundsprite":
|
||||
sp.BackgroundSprite = new Sprite(subElement);
|
||||
|
||||
if (ToolBox.GetAttributeBool(subElement, "fliphorizontal", false))
|
||||
sp.BackgroundSprite.effects = SpriteEffects.FlipHorizontally;
|
||||
if (ToolBox.GetAttributeBool(subElement, "flipvertical", false))
|
||||
sp.BackgroundSprite.effects = SpriteEffects.FlipVertically;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MapEntityCategory category;
|
||||
@@ -119,8 +148,7 @@ namespace Barotrauma
|
||||
sp.stairDirection = (Direction)Enum.Parse(typeof(Direction), ToolBox.GetAttributeString(element, "stairdirection", "None"), true);
|
||||
|
||||
sp.castShadow = ToolBox.GetAttributeBool(element, "castshadow", false);
|
||||
|
||||
|
||||
|
||||
sp.hasBody = ToolBox.GetAttributeBool(element, "body", false);
|
||||
|
||||
return sp;
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Barotrauma
|
||||
{
|
||||
get
|
||||
{
|
||||
return subBody.Position;
|
||||
return subBody ==null ? Vector2.Zero : subBody.Position;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,16 +287,28 @@ namespace Barotrauma
|
||||
{
|
||||
for (int i = 0; i < MapEntity.mapEntityList.Count; i++)
|
||||
{
|
||||
if (MapEntity.mapEntityList[i].Sprite == null || MapEntity.mapEntityList[i].Sprite.Depth < 0.5f)
|
||||
if (MapEntity.mapEntityList[i].DrawOverWater)
|
||||
MapEntity.mapEntityList[i].Draw(spriteBatch, editing, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawDamageable(SpriteBatch spriteBatch, Effect damageEffect, bool editing = false)
|
||||
{
|
||||
for (int i = 0; i < MapEntity.mapEntityList.Count; i++)
|
||||
{
|
||||
if (MapEntity.mapEntityList[i].DrawDamageEffect)
|
||||
MapEntity.mapEntityList[i].DrawDamage(spriteBatch, damageEffect);
|
||||
}
|
||||
damageEffect.Parameters["aCutoff"].SetValue(0.0f);
|
||||
damageEffect.Parameters["cCutoff"].SetValue(0.0f);
|
||||
}
|
||||
|
||||
|
||||
public static void DrawBack(SpriteBatch spriteBatch, bool editing = false)
|
||||
{
|
||||
for (int i = 0; i < MapEntity.mapEntityList.Count; i++)
|
||||
{
|
||||
if (MapEntity.mapEntityList[i].Sprite == null || MapEntity.mapEntityList[i].Sprite.Depth >= 0.5f)
|
||||
if (MapEntity.mapEntityList[i].DrawBelowWater)
|
||||
MapEntity.mapEntityList[i].Draw(spriteBatch, editing, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,6 +444,18 @@ namespace Barotrauma
|
||||
float wallImpact = Vector2.Dot(Velocity, -collisionNormal);
|
||||
|
||||
ApplyImpact(wallImpact, -collisionNormal, contact);
|
||||
|
||||
Vector2 n;
|
||||
FixedArray2<Vector2> particlePos;
|
||||
contact.GetWorldManifold(out n, out particlePos);
|
||||
|
||||
int particleAmount = (int)(wallImpact*10.0f);
|
||||
for (int i = 0; i < particleAmount; i++)
|
||||
{
|
||||
var particle = GameMain.ParticleManager.CreateParticle("iceshards",
|
||||
ConvertUnits.ToDisplayUnits(particlePos[0]) + Rand.Vector(Rand.Range(1.0f, 50.0f)),
|
||||
Rand.Vector(Rand.Range(50.0f,500.0f)) + Velocity);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,8 @@ namespace Barotrauma.Particles
|
||||
private Vector2 velocityChange;
|
||||
|
||||
private Vector2 drawPosition;
|
||||
|
||||
//private float checkCollisionTimer;
|
||||
|
||||
private float drawRotation;
|
||||
|
||||
private Hull currentHull;
|
||||
|
||||
private List<Gap> hullGaps;
|
||||
@@ -65,35 +64,33 @@ namespace Barotrauma.Particles
|
||||
get { return velocityChange; }
|
||||
set { velocityChange = value; }
|
||||
}
|
||||
|
||||
public Vector2 Velocity
|
||||
{
|
||||
get { return velocity; }
|
||||
set { velocity = value; }
|
||||
}
|
||||
|
||||
public void Init(ParticlePrefab prefab, Vector2 position, Vector2 speed, float rotation, Hull hullGuess = null)
|
||||
{
|
||||
|
||||
this.prefab = prefab;
|
||||
|
||||
spriteIndex = Rand.Int(prefab.Sprites.Count);
|
||||
|
||||
currentHull = Hull.FindHull(position, hullGuess);
|
||||
//if (currentHull != null && currentHull.Submarine != null)
|
||||
//{
|
||||
// Vector2 subVel = ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity);
|
||||
// //subVel.Y = -subVel.Y;
|
||||
// speed += subVel;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// int a = 1;
|
||||
//}
|
||||
//if (currentHull == null) position = Submarine.Loaded == null ? position : position + Submarine.Loaded.Position;
|
||||
|
||||
this.position = position;
|
||||
prevPosition = position;
|
||||
|
||||
|
||||
drawPosition = position;
|
||||
|
||||
|
||||
velocity = MathUtils.IsValid(speed) ? speed : Vector2.Zero;
|
||||
|
||||
if (currentHull != null && currentHull.Submarine != null)
|
||||
{
|
||||
velocity += ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity);
|
||||
}
|
||||
|
||||
this.rotation = rotation + Rand.Range(prefab.StartRotationMin, prefab.StartRotationMax);
|
||||
prevRotation = rotation;
|
||||
|
||||
@@ -106,7 +103,7 @@ namespace Barotrauma.Particles
|
||||
|
||||
sizeChange = prefab.SizeChangeMin + (prefab.SizeChangeMax - prefab.SizeChangeMin) * Rand.Range(0.0f, 1.0f);
|
||||
|
||||
color = prefab.StartColor;
|
||||
color = new Color(prefab.StartColor, 1.0f);
|
||||
alpha = prefab.StartAlpha;
|
||||
|
||||
velocityChange = prefab.VelocityChange;
|
||||
@@ -116,8 +113,6 @@ namespace Barotrauma.Particles
|
||||
if (prefab.DeleteOnCollision || prefab.CollidesWithWalls)
|
||||
{
|
||||
hullGaps = currentHull == null ? new List<Gap>() : currentHull.ConnectedGaps;
|
||||
//hullLimits = new List<Hull>();
|
||||
//hullLimits = FindLimits(position);
|
||||
}
|
||||
|
||||
if (prefab.RotateToDirection)
|
||||
@@ -128,26 +123,14 @@ namespace Barotrauma.Particles
|
||||
}
|
||||
}
|
||||
|
||||
//private List<Hull> FindLimits(Vector2 position)
|
||||
//{
|
||||
// List<Hull> hullList = new List<Hull>();
|
||||
|
||||
// currentHull = Hull.FindHull(position);
|
||||
// if (currentHull == null) return hullList;
|
||||
|
||||
// hullList.Add(currentHull);
|
||||
|
||||
// return FindAdjacentHulls(hullList, currentHull, Math.Abs(velocity.X) > Math.Abs(velocity.Y));
|
||||
//}
|
||||
|
||||
public bool Update(float deltaTime)
|
||||
{
|
||||
|
||||
Vector2 subVel = currentHull ==null || currentHull.Submarine==null ? Vector2.Zero : ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity);
|
||||
prevPosition = position;
|
||||
prevRotation = rotation;
|
||||
|
||||
//over 3 times faster than position += velocity * deltatime
|
||||
position.X += (velocity.X+subVel.X) * deltaTime;
|
||||
position.Y += (velocity.Y+subVel.Y) * deltaTime;
|
||||
position.X += velocity.X * deltaTime;
|
||||
position.Y += velocity.Y * deltaTime;
|
||||
|
||||
if (prefab.RotateToDirection)
|
||||
{
|
||||
@@ -161,6 +144,16 @@ namespace Barotrauma.Particles
|
||||
rotation += angularVelocity * deltaTime;
|
||||
}
|
||||
|
||||
if (prefab.WaterDrag > 0.0f &&
|
||||
(currentHull == null || (currentHull.Submarine != null && position.Y - currentHull.Submarine.DrawPosition.Y < currentHull.Surface)))
|
||||
{
|
||||
ApplyDrag(prefab.WaterDrag, deltaTime);
|
||||
}
|
||||
else if (prefab.Drag > 0.0f)
|
||||
{
|
||||
ApplyDrag(prefab.Drag, deltaTime);
|
||||
}
|
||||
|
||||
velocity.X += velocityChange.X * deltaTime;
|
||||
velocity.Y += velocityChange.Y * deltaTime;
|
||||
|
||||
@@ -174,11 +167,21 @@ namespace Barotrauma.Particles
|
||||
color.G / 255.0f + prefab.ColorChange.Y * deltaTime,
|
||||
color.B / 255.0f + prefab.ColorChange.Z * deltaTime);
|
||||
|
||||
if ((prefab.DeleteOnCollision || prefab.CollidesWithWalls) && currentHull!=null)
|
||||
if (prefab.DeleteOnCollision || prefab.CollidesWithWalls)
|
||||
{
|
||||
Vector2 edgePos = position + prefab.CollisionRadius * Vector2.Normalize(velocity) * size.X;
|
||||
|
||||
if (!Submarine.RectContains(currentHull.WorldRect, edgePos))
|
||||
|
||||
if (currentHull == null)
|
||||
{
|
||||
Hull collidedHull = Hull.FindHull(position);
|
||||
if (collidedHull != null)
|
||||
{
|
||||
if (prefab.DeleteOnCollision) return false;
|
||||
OnWallCollisionOutside(collidedHull);
|
||||
}
|
||||
|
||||
}
|
||||
else if (!Submarine.RectContains(currentHull.WorldRect, edgePos))
|
||||
{
|
||||
if (prefab.DeleteOnCollision) return false;
|
||||
|
||||
@@ -196,15 +199,13 @@ namespace Barotrauma.Particles
|
||||
if (Math.Sign(velocity.X) != Math.Sign(gap.WorldRect.Center.X - currentHull.WorldRect.Center.X)) continue;
|
||||
}
|
||||
|
||||
//Rectangle enlargedRect = new Rectangle(gap.Rect.X - 10, gap.Rect.Y + 10, gap.Rect.Width + 20, gap.Rect.Height + 20);
|
||||
//if (!Submarine.RectContains(enlargedRect, position)) continue;
|
||||
gapFound = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!gapFound)
|
||||
{
|
||||
|
||||
OnWallCollision(currentHull, edgePos);
|
||||
OnWallCollisionInside(currentHull, edgePos);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -212,21 +213,8 @@ namespace Barotrauma.Particles
|
||||
hullGaps = currentHull == null ? new List<Gap>() : currentHull.ConnectedGaps;
|
||||
|
||||
if (OnChangeHull != null) OnChangeHull(edgePos, currentHull);
|
||||
|
||||
}
|
||||
|
||||
//Hull prevHull = Hull.FindHull(prevPosition, hullLimits, currentHull);
|
||||
|
||||
//if (prevHull == null) return false;
|
||||
|
||||
}
|
||||
|
||||
//if (position.Y < currentHull.Rect.Y-currentHull.Rect.Height)
|
||||
//{
|
||||
// position.Y = currentHull.Rect.Y - currentHull.Rect.Height;
|
||||
// velocity.Y *= -0.2f;
|
||||
//}
|
||||
//if (!Submarine.RectContains(currentHull.Rect, position)) return false;
|
||||
}
|
||||
|
||||
lifeTime -= deltaTime;
|
||||
@@ -236,58 +224,104 @@ namespace Barotrauma.Particles
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnWallCollision(Hull prevHull, Vector2 position)
|
||||
private void ApplyDrag(float dragCoefficient, float deltaTime)
|
||||
{
|
||||
if (velocity == Vector2.Zero) return;
|
||||
|
||||
float speed = velocity.Length();
|
||||
velocity -= (velocity / speed) * Math.Min(speed * speed * prefab.WaterDrag * deltaTime, 1.0f);
|
||||
}
|
||||
|
||||
private void OnWallCollisionInside(Hull prevHull, Vector2 position)
|
||||
{
|
||||
Rectangle prevHullRect = prevHull.WorldRect;
|
||||
|
||||
Vector2 subVel = ConvertUnits.ToDisplayUnits(prevHull.Submarine.Velocity);
|
||||
|
||||
velocity -= subVel;
|
||||
|
||||
if (position.Y < prevHullRect.Y - prevHullRect.Height)
|
||||
{
|
||||
position.Y = prevHullRect.Y - prevHullRect.Height + 1.0f;
|
||||
position.Y = prevHullRect.Y - prevHullRect.Height + prefab.CollisionRadius;
|
||||
velocity.Y = -velocity.Y;
|
||||
}
|
||||
else if (position.Y > prevHullRect.Y)
|
||||
{
|
||||
position.Y = prevHullRect.Y - 1.0f;
|
||||
position.Y = prevHullRect.Y - prefab.CollisionRadius;
|
||||
velocity.X = Math.Abs(velocity.Y) * Math.Sign(velocity.X);
|
||||
velocity.Y = -velocity.Y * 0.1f;
|
||||
}
|
||||
|
||||
if (position.X < prevHullRect.X)
|
||||
{
|
||||
position.X = prevHullRect.X + 1.0f;
|
||||
position.X = prevHullRect.X + prefab.CollisionRadius;
|
||||
velocity.X = -velocity.X;
|
||||
}
|
||||
else if (position.X > prevHullRect.X + prevHullRect.Width)
|
||||
{
|
||||
position.X = prevHullRect.X + prevHullRect.Width - 1.0f;
|
||||
position.X = prevHullRect.X + prevHullRect.Width - prefab.CollisionRadius;
|
||||
velocity.X = -velocity.X;
|
||||
}
|
||||
|
||||
velocity *= prefab.Restitution;
|
||||
|
||||
velocity += subVel;
|
||||
}
|
||||
|
||||
|
||||
private void OnWallCollisionOutside(Hull collisionHull)
|
||||
{
|
||||
Rectangle hullRect = collisionHull.WorldRect;
|
||||
|
||||
if (position.Y < hullRect.Y - hullRect.Height)
|
||||
{
|
||||
position.Y = hullRect.Y - hullRect.Height - prefab.CollisionRadius;
|
||||
velocity.Y = -velocity.Y;
|
||||
}
|
||||
else if (position.Y > hullRect.Y)
|
||||
{
|
||||
position.Y = hullRect.Y + prefab.CollisionRadius;
|
||||
velocity.X = Math.Abs(velocity.Y) * Math.Sign(velocity.X);
|
||||
velocity.Y = -velocity.Y;
|
||||
}
|
||||
|
||||
if (position.X < hullRect.X)
|
||||
{
|
||||
position.X = hullRect.X - prefab.CollisionRadius;
|
||||
velocity.X = -velocity.X;
|
||||
}
|
||||
else if (position.X > hullRect.X + hullRect.Width)
|
||||
{
|
||||
position.X = hullRect.X + hullRect.Width + prefab.CollisionRadius;
|
||||
velocity.X = -velocity.X;
|
||||
}
|
||||
|
||||
velocity *= prefab.Restitution;
|
||||
}
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch)
|
||||
|
||||
public void UpdateDrawPos()
|
||||
{
|
||||
drawPosition = Physics.Interpolate(prevPosition, position);
|
||||
float drawRotation = Physics.Interpolate(prevRotation, rotation);
|
||||
|
||||
//drawPosition = ConvertUnits.ToDisplayUnits(drawPosition);
|
||||
|
||||
Vector2 drawSize = size;
|
||||
|
||||
if (prefab.GrowTime>0.0f && totalLifeTime-lifeTime < prefab.GrowTime)
|
||||
{
|
||||
drawSize *= ((totalLifeTime - lifeTime) / prefab.GrowTime);
|
||||
}
|
||||
|
||||
prefab.Sprites[spriteIndex].Draw(spriteBatch,
|
||||
new Vector2(drawPosition.X, -drawPosition.Y),
|
||||
color * alpha,
|
||||
prefab.Sprites[spriteIndex].Origin, drawRotation,
|
||||
drawSize, SpriteEffects.None, prefab.Sprites[spriteIndex].Depth);
|
||||
drawRotation = Physics.Interpolate(prevRotation, rotation);
|
||||
|
||||
prevPosition = position;
|
||||
prevRotation = rotation;
|
||||
}
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
Vector2 drawSize = size;
|
||||
|
||||
if (prefab.GrowTime > 0.0f && totalLifeTime - lifeTime < prefab.GrowTime)
|
||||
{
|
||||
drawSize *= ((totalLifeTime - lifeTime) / prefab.GrowTime);
|
||||
}
|
||||
|
||||
prefab.Sprites[spriteIndex].Draw(spriteBatch,
|
||||
new Vector2(drawPosition.X, -drawPosition.Y),
|
||||
color * alpha,
|
||||
prefab.Sprites[spriteIndex].Origin, drawRotation,
|
||||
drawSize, SpriteEffects.None, prefab.Sprites[spriteIndex].Depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,14 @@ namespace Barotrauma.Particles
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateTransforms()
|
||||
{
|
||||
for (int i = 0; i < particleCount; i++)
|
||||
{
|
||||
particles[i].UpdateDrawPos();
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch, bool inWater, ParticleBlendState blendState)
|
||||
{
|
||||
ParticlePrefab.DrawTargetType drawTarget = inWater ? ParticlePrefab.DrawTargetType.Water : ParticlePrefab.DrawTargetType.Air;
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace Barotrauma.Particles
|
||||
public readonly Vector2 StartSizeMin, StartSizeMax;
|
||||
public readonly Vector2 SizeChangeMin, SizeChangeMax;
|
||||
|
||||
public readonly float Drag, WaterDrag;
|
||||
|
||||
public readonly Color StartColor;
|
||||
public readonly float StartAlpha;
|
||||
|
||||
@@ -89,6 +91,9 @@ namespace Barotrauma.Particles
|
||||
SizeChangeMax = SizeChangeMin;
|
||||
}
|
||||
|
||||
Drag = ToolBox.GetAttributeFloat(element, "drag", 0.0f);
|
||||
WaterDrag = ToolBox.GetAttributeFloat(element, "waterdrag", 0.0f);
|
||||
|
||||
Restitution = ToolBox.GetAttributeFloat(element, "restitution", 0.5f);
|
||||
|
||||
switch (ToolBox.GetAttributeString(element, "blendstate", "alphablend"))
|
||||
|
||||
@@ -18,6 +18,10 @@ namespace Barotrauma
|
||||
|
||||
private BlurEffect lightBlur;
|
||||
|
||||
private Effect damageEffect;
|
||||
|
||||
private Texture2D damageStencil;
|
||||
|
||||
public BackgroundCreatureManager BackgroundCreatureManager;
|
||||
|
||||
public Camera Cam
|
||||
@@ -46,10 +50,14 @@ namespace Barotrauma
|
||||
var blurEffect = content.Load<Effect>("blurshader");
|
||||
#endif
|
||||
|
||||
damageStencil = TextureLoader.FromFile("Content/Map/walldamage.png");
|
||||
|
||||
damageEffect = content.Load<Effect>("damageshader");
|
||||
damageEffect.Parameters["xStencil"].SetValue(damageStencil);
|
||||
damageEffect.Parameters["aMultiplier"].SetValue(50.0f);
|
||||
damageEffect.Parameters["cMultiplier"].SetValue(200.0f);
|
||||
|
||||
lightBlur = new BlurEffect(blurEffect, 0.001f, 0.001f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void Select()
|
||||
@@ -101,23 +109,24 @@ namespace Barotrauma
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GameMain.GameSession!=null) GameMain.GameSession.Update((float)deltaTime);
|
||||
//EventManager.Update(gameTime);
|
||||
|
||||
if (Level.Loaded != null) Level.Loaded.Update((float)deltaTime);
|
||||
|
||||
Character.UpdateAll(cam, (float)deltaTime);
|
||||
|
||||
BackgroundCreatureManager.Update(cam, (float)deltaTime);
|
||||
|
||||
GameMain.ParticleManager.Update((float)deltaTime);
|
||||
|
||||
StatusEffect.UpdateAll((float)deltaTime);
|
||||
|
||||
Physics.accumulator = Math.Min(Physics.accumulator, Physics.step * 6);
|
||||
//Physics.accumulator = Physics.step;
|
||||
while (Physics.accumulator >= Physics.step)
|
||||
{
|
||||
|
||||
if (GameMain.GameSession != null) GameMain.GameSession.Update((float)Physics.step);
|
||||
//EventManager.Update(gameTime);
|
||||
|
||||
if (Level.Loaded != null) Level.Loaded.Update((float)Physics.step);
|
||||
|
||||
Character.UpdateAll(cam, (float)Physics.step);
|
||||
|
||||
BackgroundCreatureManager.Update(cam, (float)Physics.step);
|
||||
|
||||
GameMain.ParticleManager.Update((float)Physics.step);
|
||||
|
||||
StatusEffect.UpdateAll((float)Physics.step);
|
||||
|
||||
if (Character.Controlled != null && Lights.LightManager.ViewTarget != null)
|
||||
{
|
||||
cam.TargetPos = Lights.LightManager.ViewTarget.WorldPosition;
|
||||
@@ -160,7 +169,10 @@ namespace Barotrauma
|
||||
|
||||
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
|
||||
{
|
||||
cam.UpdateTransform(true);
|
||||
cam.UpdateTransform(true);
|
||||
|
||||
|
||||
//damageStencil = TextureLoader.FromFile("Content/Map/background.png");
|
||||
|
||||
DrawMap(graphics, spriteBatch);
|
||||
|
||||
@@ -199,6 +211,8 @@ namespace Barotrauma
|
||||
sub.UpdateTransform();
|
||||
}
|
||||
|
||||
GameMain.ParticleManager.UpdateTransforms();
|
||||
|
||||
GameMain.LightManager.ObstructVision = Character.Controlled != null && Character.Controlled.ObstructVision;
|
||||
|
||||
GameMain.LightManager.UpdateLightMap(graphics, spriteBatch, cam);
|
||||
@@ -324,6 +338,17 @@ namespace Barotrauma
|
||||
Submarine.DrawFront(spriteBatch);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate,
|
||||
BlendState.NonPremultiplied, SamplerState.LinearWrap,
|
||||
null, null,
|
||||
damageEffect,
|
||||
cam.Transform);
|
||||
|
||||
Submarine.DrawDamageable(spriteBatch, damageEffect);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
|
||||
GameMain.LightManager.DrawLightMap(spriteBatch, cam, lightBlur.Effect);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user