assigning jobs when a round starts, crew tab in multiplayer, repairtool particles light & sounds, attachable buttons, increased repairtool range & limbdamage, captain's uniform, wearable sprite bugfixes
@@ -7,14 +7,14 @@
|
|||||||
stepsize="42.0, 12.0">
|
stepsize="42.0, 12.0">
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<limb id = "0" radius="13" mass = "6" type="Head" attackpriority="2" impacttolerance="3.0">
|
<limb id = "0" radius="13" mass = "6" type="Head" attackpriority="2" impacttolerance="4.0">
|
||||||
<sprite texture="Content/Characters/Human/[GENDER]head[HEADID].png" sourcerect="1,1,37,38" depth="0.04" origin="0.5,0.5"/>
|
<sprite texture="Content/Characters/Human/[GENDER]head[HEADID].png" sourcerect="1,1,37,38" depth="0.04" origin="0.5,0.5"/>
|
||||||
</limb>
|
</limb>
|
||||||
<!-- body -->
|
<!-- body -->
|
||||||
<limb id = "1" radius="14" height="21" mass = "20" type="Torso" attackpriority="3" impacttolerance="5.0">
|
<limb id = "1" radius="14" height="21" mass = "20" type="Torso" attackpriority="3" impacttolerance="6.0">
|
||||||
<sprite texture="Content/Characters/Human/[GENDER]torso.png" sourcerect="0,0,29,58" depth="0.05" origin="0.5,0.6"/>
|
<sprite texture="Content/Characters/Human/[GENDER]torso.png" sourcerect="0,0,29,58" depth="0.05" origin="0.5,0.6"/>
|
||||||
</limb>
|
</limb>
|
||||||
<limb id = "12" radius="13" mass = "20" type="Waist" impacttolerance="5.0">
|
<limb id = "12" radius="13" mass = "20" type="Waist" impacttolerance="6.0">
|
||||||
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="0,0,32,29" depth="0.045" origin="0.5,0.5"/>
|
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="0,0,32,29" depth="0.045" origin="0.5,0.5"/>
|
||||||
</limb>
|
</limb>
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,10 @@
|
|||||||
price="10">
|
price="10">
|
||||||
|
|
||||||
<Sprite texture ="button.png" depth="0.8"/>
|
<Sprite texture ="button.png" depth="0.8"/>
|
||||||
|
|
||||||
<Controller userpos="0" direction ="None" canbepicked = "true">
|
<Body width="32" height="32"/>
|
||||||
|
|
||||||
|
<Controller userpos="0" direction ="None" canbepicked = "true" msg="Open [E]">
|
||||||
<RequiredItem name="ID Card" type="Picked" msg="UNAUTHORIZED ACCESS"/>
|
<RequiredItem name="ID Card" type="Picked" msg="UNAUTHORIZED ACCESS"/>
|
||||||
</Controller>
|
</Controller>
|
||||||
|
|
||||||
@@ -15,5 +17,10 @@
|
|||||||
<RequiredItem name="Screwdriver" type="Equipped"/>
|
<RequiredItem name="Screwdriver" type="Equipped"/>
|
||||||
<output name="signal_out"/>
|
<output name="signal_out"/>
|
||||||
</ConnectionPanel>
|
</ConnectionPanel>
|
||||||
|
|
||||||
|
<Holdable slots="Any,RightHand,LeftHand" msg="Detach [Wrench]"
|
||||||
|
aimpos="35,-10" handle1="0,0" attachable="true" attachedbydefault="true" aimable="true">
|
||||||
|
<requireditem name="Wrench" type="Equipped"/>
|
||||||
|
</Holdable>
|
||||||
|
|
||||||
</Item>
|
</Item>
|
||||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 2.0 KiB |
@@ -1,14 +1,54 @@
|
|||||||
<Items>
|
<Items>
|
||||||
<Item
|
<Item
|
||||||
name="Captain's Cap"
|
name="Captain's Cap"
|
||||||
pickdistance="150">
|
pickdistance="150"
|
||||||
|
tags="smallitem">
|
||||||
|
|
||||||
<Sprite texture ="captainhat.png" depth="0.4"/>
|
<Sprite texture ="captainhat.png" depth="0.4"/>
|
||||||
|
|
||||||
<Body radius="8" density="5"/>
|
<Body radius="8" density="5"/>
|
||||||
|
|
||||||
<Wearable limbtype="Head" slots="Any,Head">
|
<Wearable limbtype="Head" slots="Any,Head">
|
||||||
<sprite texture="captainhat.png" limb="Head" origin="0.4,0.94"/>
|
<sprite texture="captainhat.png" limb="Head" origin="0.5,0.9"/>
|
||||||
|
</Wearable>
|
||||||
|
</Item>
|
||||||
|
|
||||||
|
<Item
|
||||||
|
name="Captain's Jacket"
|
||||||
|
pickdistance="150"
|
||||||
|
tags="smallitem">
|
||||||
|
|
||||||
|
<Sprite texture ="captainTorso.png" depth="0.4"/>
|
||||||
|
|
||||||
|
<Body radius="8" density="5"/>
|
||||||
|
|
||||||
|
<Wearable slots="Torso">
|
||||||
|
<sprite texture="captainTorso.png" limb="Torso" sourcerect="0,3,30,58" origin="0.5,0.45" depth="0.01"/>
|
||||||
|
|
||||||
|
<sprite texture="captainTorso.png" limb="RightHand" sourcerect="47,0,15,39" origin="0.45,0.6"/>
|
||||||
|
<sprite texture="captainTorso.png" limb="LeftHand" sourcerect="47,0,15,39" origin="0.45,0.6" depth="0.14"/>
|
||||||
|
|
||||||
|
<sprite texture="captainTorso.png" limb="RightArm" sourcerect="30,0,17,42" origin="0.5,0.5" depth="0.005" hidelimb="true"/>
|
||||||
|
<sprite texture="captainTorso.png" limb="LeftArm" sourcerect="30,0,17,42" origin="0.5,0.5" depth="0.13" hidelimb="true"/>
|
||||||
|
</Wearable>
|
||||||
|
</Item>
|
||||||
|
|
||||||
|
<Item
|
||||||
|
name="Captain's Trousers"
|
||||||
|
pickdistance="150"
|
||||||
|
tags="smallitem">
|
||||||
|
|
||||||
|
<Sprite texture ="captainLegs.png" depth="0.4"/>
|
||||||
|
|
||||||
|
<Body radius="8" density="5"/>
|
||||||
|
|
||||||
|
<Wearable slots="Legs">
|
||||||
|
<sprite texture="captainLegs.png" limb="Waist" sourcerect="0,0,1,1" origin="0.5,0.5" hidelimb="true"/>
|
||||||
|
<sprite texture="captainLegs.png" limb="RightThigh" sourcerect="52,34,28,46" origin="0.5,0.5" depth="0.10" hidelimb="true"/>
|
||||||
|
<sprite texture="captainLegs.png" limb="LeftThigh" sourcerect="52,34,28,46" origin="0.5,0.5" depth="0.14" hidelimb="true"/>
|
||||||
|
|
||||||
|
<sprite texture="captainLegs.png" limb="RightLeg" sourcerect="31,0,21,49" origin="0.5,0.5" depth="0.11" hidelimb="true"/>
|
||||||
|
<sprite texture="captainLegs.png" limb="LeftLeg" sourcerect="31,0,21,49" origin="0.5,0.5" depth="0.15" hidelimb="true"/>
|
||||||
</Wearable>
|
</Wearable>
|
||||||
</Item>
|
</Item>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
pickdistance="150"
|
pickdistance="150"
|
||||||
price="50">
|
price="50">
|
||||||
|
|
||||||
<Sprite texture ="oxygentank.png" depth="0.05"/>
|
<Sprite texture ="oxygentank.png" depth="0.5"/>
|
||||||
|
|
||||||
<Body radius="6" height="22" density="5"/>
|
<Body radius="6" height="22" density="5"/>
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<Body width="37" height="113" density="5"/>
|
<Body width="37" height="113" density="5"/>
|
||||||
|
|
||||||
<Wearable slots="Head,Torso">
|
<Wearable slots="Head,Torso,Legs">
|
||||||
<sprite texture="DivingSuit.png" limb="Head" sourcerect="1,94,32,33" origin="0.5,0.5" depth="0.02"/>
|
<sprite texture="DivingSuit.png" limb="Head" sourcerect="1,94,32,33" origin="0.5,0.5" depth="0.02"/>
|
||||||
<sprite texture="DivingSuit.png" limb="Torso" sourcerect="40,0,38,65" origin="0.5,0.33" depth="0.01"/>
|
<sprite texture="DivingSuit.png" limb="Torso" sourcerect="40,0,38,65" origin="0.5,0.33" depth="0.01"/>
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,12 @@
|
|||||||
<Holdable slots="Any,BothHands"
|
<Holdable slots="Any,BothHands"
|
||||||
aimpos="50,0" handle1="-17,0" handle2="8,0"/>
|
aimpos="50,0" handle1="-17,0" handle2="8,0"/>
|
||||||
|
|
||||||
<RepairTool structurefixamount="50.0" range="80" barrelpos="19,8">
|
<RepairTool structurefixamount="5.0" limbfixamount="-0.5" range="100" barrelpos="19,8" particles="weld">
|
||||||
<!-- the item must contain a welding fuel tank for it to work -->
|
<!-- the item must contain a welding fuel tank for it to work -->
|
||||||
<RequiredItems name="Welding Fuel Tank" type="Contained" msg="Welding fuel required"/>
|
<RequiredItems name="Welding Fuel Tank" type="Contained" msg="Welding fuel required"/>
|
||||||
|
|
||||||
|
<sound file="weldingTool.ogg" type="OnUse" range="500.0"/>
|
||||||
|
|
||||||
<!-- when using, the contained welding fuel tank will detoriate (= lose fuel) -->
|
<!-- when using, the contained welding fuel tank will detoriate (= lose fuel) -->
|
||||||
<StatusEffect type="OnUse" target="Contained" targetnames="Welding Fuel Tank" Condition="-0.7"/>
|
<StatusEffect type="OnUse" target="Contained" targetnames="Welding Fuel Tank" Condition="-0.7"/>
|
||||||
|
|
||||||
@@ -34,6 +36,10 @@
|
|||||||
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-100.0" sound="Content/Items/Weapons/stunGrenade.ogg">
|
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-100.0" sound="Content/Items/Weapons/stunGrenade.ogg">
|
||||||
<Explosion range="5" damage="20" stun="10" force="5.0"/>
|
<Explosion range="5" damage="20" stun="10" force="5.0"/>
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
|
|
||||||
|
<LightComponent color="1.0,0.9,0.7,1.0" Flicker="0.5">
|
||||||
|
<sprite texture="Content/Items/Electricity/lightsprite.png" origin="0.5,0.5"/>
|
||||||
|
</LightComponent>
|
||||||
</RepairTool>
|
</RepairTool>
|
||||||
|
|
||||||
<!-- one welding fuel or oxygen tank can be contained inside the welding tool -->
|
<!-- one welding fuel or oxygen tank can be contained inside the welding tool -->
|
||||||
@@ -56,11 +62,13 @@
|
|||||||
<Holdable slots="Any,RightHand,LeftHand"
|
<Holdable slots="Any,RightHand,LeftHand"
|
||||||
aimpos="50,0" handle1="-12,4"/>
|
aimpos="50,0" handle1="-12,4"/>
|
||||||
|
|
||||||
<RepairTool structurefixamount="-10.0" range="50" barrelpos="19,8">
|
<RepairTool structurefixamount="-2.0" limbfixamount="-0.5" range="100" barrelpos="19,8" particles="plasma">
|
||||||
<RequiredItems name="Oxygen Tank" type="Contained" msg="Oxygen tank required"/>
|
<RequiredItems name="Oxygen Tank" type="Contained" msg="Oxygen tank required"/>
|
||||||
<StatusEffect type="OnUse" target="Contained" targetnames="Oxygen Tank" Condition="-0.7"/>
|
<StatusEffect type="OnUse" target="Contained" targetnames="Oxygen Tank" Condition="-0.7"/>
|
||||||
<StatusEffect type="OnUse" target="UseTarget" targetnames="Door,Windowed Door" Stuck="-10.0"/>
|
<StatusEffect type="OnUse" target="UseTarget" targetnames="Door,Windowed Door" Stuck="-10.0"/>
|
||||||
|
|
||||||
|
<sound file="plasmaCutter.ogg" type="OnUse" range="500.0"/>
|
||||||
|
|
||||||
<Fixable name="structure"/>
|
<Fixable name="structure"/>
|
||||||
|
|
||||||
<RequiredSkill name="Construction" level="30"/>
|
<RequiredSkill name="Construction" level="30"/>
|
||||||
@@ -68,6 +76,10 @@
|
|||||||
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-100.0" sound="Content/Items/Weapons/stunGrenade.ogg">
|
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-100.0" sound="Content/Items/Weapons/stunGrenade.ogg">
|
||||||
<Explosion range="5" damage="20" stun="10" force="5.0"/>
|
<Explosion range="5" damage="20" stun="10" force="5.0"/>
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
|
|
||||||
|
<LightComponent color="1.0,1.0,1.0,1.0" Flicker="0.5">
|
||||||
|
<sprite texture="Content/Items/Electricity/lightsprite.png" origin="0.5,0.5"/>
|
||||||
|
</LightComponent>
|
||||||
</RepairTool>
|
</RepairTool>
|
||||||
|
|
||||||
<ItemContainer capacity="1" hideitems="false" itempos="9,-15">
|
<ItemContainer capacity="1" hideitems="false" itempos="9,-15">
|
||||||
|
|||||||
@@ -27,14 +27,10 @@
|
|||||||
|
|
||||||
<Body width="16" height="9"/>
|
<Body width="16" height="9"/>
|
||||||
|
|
||||||
<Holdable aimpos="35,-10" handle1="0,0" attachable="true" aimable="true">
|
<Holdable slots="Any,RightHand,LeftHand" msg="Detach [Wrench]" aimpos="35,-10" handle1="0,0" attachable="true" aimable="true">
|
||||||
<requireditem name="Wrench" type="Equipped"/>
|
<requireditem name="Wrench" type="Equipped"/>
|
||||||
</Holdable>
|
</Holdable>
|
||||||
|
|
||||||
<Pickable slots="Any,RightHand,LeftHand" msg="Detach [Wrench]">
|
|
||||||
<requireditem name="Wrench" type="Equipped"/>
|
|
||||||
</Pickable>
|
|
||||||
|
|
||||||
<ItemContainer capacity="1" itempos="0,0" hideitems="false">
|
<ItemContainer capacity="1" itempos="0,0" hideitems="false">
|
||||||
<Containable name="explosive"/>
|
<Containable name="explosive"/>
|
||||||
</ItemContainer>
|
</ItemContainer>
|
||||||
|
|||||||
@@ -61,11 +61,11 @@
|
|||||||
name="Railgun Shell"
|
name="Railgun Shell"
|
||||||
pickdistance="200">
|
pickdistance="200">
|
||||||
|
|
||||||
<Sprite texture ="railgunshell.png"/>
|
<Sprite texture ="railgunshell.png" depth ="0.5"/>
|
||||||
|
|
||||||
<Body radius="14" height="63" density="15"/>
|
<Body radius="9" height="67"/>
|
||||||
|
|
||||||
<Holdable slots="BothHands" holdpos="30,-15" handle1="0,20" handle2="0,-20"/>
|
<Holdable slots="BothHands" holdpos="0,-50" handle1="-10,0" handle2="10,0" aimable="false"/>
|
||||||
|
|
||||||
<Projectile launchimpulse="80.0">
|
<Projectile launchimpulse="80.0">
|
||||||
<Attack damage="100" bleedingdamage="10" structuredamage="200" damagetype="Blunt"/>
|
<Attack damage="100" bleedingdamage="10" structuredamage="200" damagetype="Blunt"/>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -2,6 +2,10 @@
|
|||||||
<Jobs>
|
<Jobs>
|
||||||
<Captain description="The Commanding Officer with authority over the entire crew." minnumber="1" maxnumber="1">
|
<Captain description="The Commanding Officer with authority over the entire crew." minnumber="1" maxnumber="1">
|
||||||
<Item name="ID Card"/>
|
<Item name="ID Card"/>
|
||||||
|
<Item name="Captain's Cap" equip="true"/>
|
||||||
|
<Item name="Captain's Jacket" equip="true"/>
|
||||||
|
<Item name="Captain's Trousers" equip="true"/>
|
||||||
|
|
||||||
<Skills>
|
<Skills>
|
||||||
<Skill name="Weapons" level="50,60"/>
|
<Skill name="Weapons" level="50,60"/>
|
||||||
<Skill name="Construction" level="10,20"/>
|
<Skill name="Construction" level="10,20"/>
|
||||||
|
|||||||
@@ -5,6 +5,40 @@
|
|||||||
<smallhorizontalback sprite="Content/Map/testroom.png" sourcerect="0,64,896,32" depth ="0.4"
|
<smallhorizontalback sprite="Content/Map/testroom.png" sourcerect="0,64,896,32" depth ="0.4"
|
||||||
width = "128" height ="32" resizehorizontal="true"/>
|
width = "128" height ="32" resizehorizontal="true"/>
|
||||||
|
|
||||||
|
<largeverticalback sprite="Content/Map/testroom.png" sourcerect="0,96,64,448" depth ="0.4"
|
||||||
|
width = "64" height ="128" resizevertical="true"/>
|
||||||
|
<largeverticalback2 sprite="Content/Map/testroom.png" sourcerect="64,96,64,448" depth ="0.4"
|
||||||
|
width = "64" height ="128" resizevertical="true"/>
|
||||||
|
|
||||||
|
<smallverticalback sprite="Content/Map/testroom.png" sourcerect="128,96,32,352" depth ="0.85"
|
||||||
|
width = "32" height ="128" resizevertical="true"/>
|
||||||
|
<smallverticalback2 sprite="Content/Map/testroom.png" sourcerect="160,96,32,352" depth ="0.85"
|
||||||
|
width = "32" height ="128" resizevertical="true"/>
|
||||||
|
|
||||||
|
<engineeringLabel sprite="Content/Map/testroom.png" sourcerect="464,336,153,16" depth ="0.99"
|
||||||
|
width = "153" height ="16"/>
|
||||||
|
|
||||||
|
<commandLabel sprite="Content/Map/testroom.png" sourcerect="464,352,128,16" depth ="0.99"
|
||||||
|
width = "128" height ="16"/>
|
||||||
|
|
||||||
|
<airlockLabel sprite="Content/Map/testroom.png" sourcerect="464,368,199,16" depth ="0.99"
|
||||||
|
width = "99" height ="16"/>
|
||||||
|
|
||||||
|
<cabinsLabel sprite="Content/Map/testroom.png" sourcerect="464,384,83,16" depth ="0.99"
|
||||||
|
width = "83" height ="16"/>
|
||||||
|
|
||||||
|
<arrowUp sprite="Content/Map/testroom.png" sourcerect="592,367,16,16" depth ="0.99"
|
||||||
|
width = "16" height ="16"/>
|
||||||
|
|
||||||
|
<arrowDown sprite="Content/Map/testroom.png" sourcerect="608,367,16,16" depth ="0.99"
|
||||||
|
width = "16" height ="16"/>
|
||||||
|
|
||||||
|
<arrowLeft sprite="Content/Map/testroom.png" sourcerect="592,383,16,16" depth ="0.99"
|
||||||
|
width = "16" height ="16"/>
|
||||||
|
|
||||||
|
<arrowRight sprite="Content/Map/testroom.png" sourcerect="608,383,16,16" depth ="0.99"
|
||||||
|
width = "16" height ="16"/>
|
||||||
|
|
||||||
<leftwall sprite="Content/Map/testroom.png" sourcerect="688,368,32,496" depth ="0.05" castshadow="true"
|
<leftwall sprite="Content/Map/testroom.png" sourcerect="688,368,32,496" depth ="0.05" castshadow="true"
|
||||||
width = "32" height ="64" resizevertical="true" fliphorizontal="true" body="true" health="500"/>
|
width = "32" height ="64" resizevertical="true" fliphorizontal="true" body="true" health="500"/>
|
||||||
|
|
||||||
@@ -32,16 +66,6 @@
|
|||||||
<platform sprite="Content/Map/testroom.png" sourcerect="896,64,128,32" depth ="0.9"
|
<platform sprite="Content/Map/testroom.png" sourcerect="896,64,128,32" depth ="0.9"
|
||||||
width = "64" height ="32" resizehorizontal="true" body="true" platform="true"/>
|
width = "64" height ="32" resizehorizontal="true" body="true" platform="true"/>
|
||||||
|
|
||||||
<largeverticalback sprite="Content/Map/testroom.png" sourcerect="0,96,64,448" depth ="0.4"
|
|
||||||
width = "64" height ="128" resizevertical="true"/>
|
|
||||||
<largeverticalback2 sprite="Content/Map/testroom.png" sourcerect="64,96,64,448" depth ="0.4"
|
|
||||||
width = "64" height ="128" resizevertical="true"/>
|
|
||||||
|
|
||||||
<smallverticalback sprite="Content/Map/testroom.png" sourcerect="128,96,32,352" depth ="0.85"
|
|
||||||
width = "32" height ="128" resizevertical="true"/>
|
|
||||||
<smallverticalback2 sprite="Content/Map/testroom.png" sourcerect="160,96,32,352" depth ="0.85"
|
|
||||||
width = "32" height ="128" resizevertical="true"/>
|
|
||||||
|
|
||||||
<roughbgwall sprite="Content/Map/testroom.png" sourcerect="200,104,240,240" depth = "1.0"
|
<roughbgwall sprite="Content/Map/testroom.png" sourcerect="200,104,240,240" depth = "1.0"
|
||||||
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
width="64" height="64" resizehorizontal="true" resizevertical="true"/>
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 673 KiB After Width: | Height: | Size: 684 KiB |
@@ -1,84 +1,109 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<prefabs>
|
<prefabs>
|
||||||
<watersplash sprite="Content/Particles/spatter.png"
|
<watersplash
|
||||||
startsizemin="0.15,0.15" startsizemax="0.3,0.3"
|
startsizemin="0.15,0.15" startsizemax="0.3,0.3"
|
||||||
sizechangemin="0.9,0.9" sizechangemax="1.2,1.2"
|
sizechangemin="0.9,0.9" sizechangemax="1.2,1.2"
|
||||||
startrotationmin ="0.0" startrotationmax="6.28"
|
startrotationmin ="0.0" startrotationmax="6.28"
|
||||||
startcolor="1.0, 1.0, 1.0" startalpha="0.8"
|
startcolor="1.0, 1.0, 1.0" startalpha="0.8"
|
||||||
colorchange="0.0, 0.0, 0.0, -0.25"
|
colorchange="0.0, 0.0, 0.0, -0.25"
|
||||||
lifetime="3"
|
lifetime="3"
|
||||||
deleteonhit="true"
|
deleteonhit="true"
|
||||||
velocitychange="0.0, -9.8"/>
|
velocitychange="0.0, -9.8">
|
||||||
|
<sprite texture="Content/Particles/spatter.png"/>
|
||||||
<mist sprite="Content/Particles/spatter.png"
|
</watersplash>
|
||||||
startsizemin="0.4,0.4" startsizemax="0.5,0.5"
|
|
||||||
sizechangemin="0.25,0.25" sizechangemax="0.3,0.3"
|
<mist
|
||||||
startrotationmin ="0.0" startrotationmax="6.28"
|
startsizemin="0.4,0.4" startsizemax="0.5,0.5"
|
||||||
startcolor="1.0, 1.0, 1.0" startalpha="0.5"
|
sizechangemin="0.25,0.25" sizechangemax="0.3,0.3"
|
||||||
colorchange="0.0, 0.0, 0.0, -0.25"
|
startrotationmin ="0.0" startrotationmax="6.28"
|
||||||
lifetime="3"
|
startcolor="1.0, 1.0, 1.0" startalpha="0.5"
|
||||||
velocitychange="0.0, -0.05"/>
|
colorchange="0.0, 0.0, 0.0, -0.25"
|
||||||
|
lifetime="3"
|
||||||
<dustcloud sprite="Content/Particles/spatter.png"
|
velocitychange="0.0, -0.05">
|
||||||
startsizemin="0.8,0.8" startsizemax="1.0,1.0"
|
<sprite texture="Content/Particles/spatter.png"/>
|
||||||
sizechangemin="0.0,0.0" sizechangemax="0.0,0.0"
|
</mist>
|
||||||
startrotationmin ="0.0" startrotationmax="6.28"
|
|
||||||
startcolor="0.2, 0.2, 0.2" startalpha="0.5"
|
<dustcloud
|
||||||
colorchange="0.0, 0.0, 0.0, -0.3"
|
startsizemin="0.8,0.8" startsizemax="1.0,1.0"
|
||||||
lifetime="3"
|
sizechangemin="0.0,0.0" sizechangemax="0.0,0.0"
|
||||||
velocitychange="0.0, -5.0"/>
|
startrotationmin ="0.0" startrotationmax="6.28"
|
||||||
|
startcolor="0.2, 0.2, 0.2" startalpha="0.5"
|
||||||
<bubbles sprite="Content/Particles/bubbles.png"
|
colorchange="0.0, 0.0, 0.0, -0.3"
|
||||||
startsizemin="0.4,0.4" startsizemax="0.5,0.5"
|
lifetime="3"
|
||||||
sizechangemin="0.0,0.0" sizechangemax="0.1,0.1"
|
velocitychange="0.0, -5.0">
|
||||||
startrotationmin ="0.0" startrotationmax="3.14"
|
<sprite texture="Content/Particles/spatter.png"/>
|
||||||
startcolor="1.0, 1.0, 1.0" startalpha="0.8"
|
</dustcloud>
|
||||||
colorchange="0.0, 0.0, 0.0, -0.5"
|
|
||||||
lifetime="3"
|
<bubbles
|
||||||
deleteonhit="true"
|
startsizemin="0.4,0.4" startsizemax="0.5,0.5"
|
||||||
inwater="true"
|
sizechangemin="0.0,0.0" sizechangemax="0.1,0.1"
|
||||||
velocitychange="0.0, 0.1"/>
|
startrotationmin ="0.0" startrotationmax="3.14"
|
||||||
|
startcolor="1.0, 1.0, 1.0" startalpha="0.8"
|
||||||
<blood sprite="Content/Particles/blood.png"
|
colorchange="0.0, 0.0, 0.0, -0.5"
|
||||||
startsizemin="0.05,0.05" startsizemax="0.6,0.6"
|
lifetime="3"
|
||||||
sizechangemin="0.3,0.2" sizechangemax="0.4,0.2"
|
deleteonhit="true"
|
||||||
startrotationmin ="0.0" startrotationmax="0.0"
|
inwater="true"
|
||||||
startcolor="0.5, 0.0, 0.0" startalpha="1.0"
|
velocitychange="0.0, 0.1">
|
||||||
colorchange="0.0, 0.0, 0.0, -1.0"
|
<sprite texture="Content/Particles/bubbles.png"/>
|
||||||
lifetime="2"
|
</bubbles>
|
||||||
deleteonhit="true"
|
|
||||||
rotatetodirection="true"
|
<blood
|
||||||
velocitychange="0.0, -9.8"/>
|
startsizemin="0.05,0.05" startsizemax="0.6,0.6"
|
||||||
|
sizechangemin="0.3,0.2" sizechangemax="0.4,0.2"
|
||||||
<waterblood sprite="Content/Particles/spatter.png"
|
startrotationmin ="0.0" startrotationmax="0.0"
|
||||||
startsizemin="0.1,0.1" startsizemax="0.1,0.1"
|
startcolor="0.5, 0.0, 0.0" startalpha="1.0"
|
||||||
sizechangemin="0.15,0.15" sizechangemax="0.2,0.2"
|
colorchange="0.0, 0.0, 0.0, -1.0"
|
||||||
startrotationmin ="0.0" startrotationmax="6.28"
|
lifetime="2"
|
||||||
startcolor="0.5, 0.0, 0.0" startalpha="1.0"
|
deleteonhit="true"
|
||||||
colorchange="0.0, 0.0, 0.0, -0.25"
|
rotatetodirection="true"
|
||||||
lifetime="5.0"
|
velocitychange="0.0, -9.8">
|
||||||
inwater="true"
|
<sprite texture="Content/Particles/blood.png"/>
|
||||||
velocitychange="0.0, 0.0"/>
|
</blood>
|
||||||
|
|
||||||
<explosionfire sprite="Content/Particles/explosion.png"
|
<waterblood
|
||||||
startsizemin="1.5,1.5" startsizemax="3.0,3.0"
|
startsizemin="0.1,0.1" startsizemax="0.1,0.1"
|
||||||
sizechangemin="0.5,0.5" sizechangemax="0.6,0.6"
|
sizechangemin="0.15,0.15" sizechangemax="0.2,0.2"
|
||||||
startrotationmin ="0.0" startrotationmax="6.28"
|
startrotationmin ="0.0" startrotationmax="6.28"
|
||||||
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
startcolor="0.5, 0.0, 0.0" startalpha="1.0"
|
||||||
colorchange="-0.4, -0.4, -0.4, -0.3"
|
colorchange="0.0, 0.0, 0.0, -0.25"
|
||||||
lifetime="5.0"
|
lifetime="5.0"
|
||||||
inwater="false"
|
inwater="true"
|
||||||
deleteonhit="true"
|
velocitychange="0.0, 0.0">
|
||||||
velocitychange="0.0, 0.5"/>
|
<sprite texture="Content/Particles/spatter.png"/>
|
||||||
|
</waterblood>
|
||||||
<weld sprite="Content/Particles/explosion.png"
|
|
||||||
startsizemin="0.1,0.1" startsizemax="0.2,0.2"
|
<explosionfire
|
||||||
sizechangemin="0.5,0.5" sizechangemax="0.7,0.7"
|
startsizemin="1.5,1.5" startsizemax="3.0,3.0"
|
||||||
startrotationmin ="0.0" startrotationmax="6.28"
|
sizechangemin="0.5,0.5" sizechangemax="0.6,0.6"
|
||||||
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
startrotationmin ="0.0" startrotationmax="6.28"
|
||||||
colorchange="0.0, 0.0, -1.0, -5.0"
|
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||||
lifetime="1.0"
|
colorchange="-0.4, -0.4, -0.4, -0.3"
|
||||||
inwater="false"
|
lifetime="5.0"
|
||||||
deleteonhit="true"
|
inwater="false"
|
||||||
velocitychange="0.0, 0.0"/>
|
deleteonhit="true"
|
||||||
</prefabs>
|
velocitychange="0.0, 0.5">
|
||||||
|
<sprite texture="Content/Particles/explosion.png"/>
|
||||||
|
</explosionfire>
|
||||||
|
|
||||||
|
<weld
|
||||||
|
startsizemin="0.9,0.9" startsizemax="1.1,1.1"
|
||||||
|
sizechangemin="-0.1,-0.1" sizechangemax="0.1,0.1"
|
||||||
|
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||||
|
colorchange="0.0, 0.0, -1.0, -5.0"
|
||||||
|
lifetime="0.5"
|
||||||
|
inwater="false"
|
||||||
|
velocitychange="0.0, 0.0">
|
||||||
|
<sprite texture="Content/Particles/flames.png" sourcerect="0,0,128,64" origin="0.15,0.5"/>
|
||||||
|
</weld>
|
||||||
|
|
||||||
|
<plasma
|
||||||
|
startsizemin="0.9,0.9" startsizemax="1.1,1.1"
|
||||||
|
sizechangemin="-0.1,-0.1" sizechangemax="0.1,0.1"
|
||||||
|
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||||
|
colorchange="0.0, 0.0, -1.0, -5.0"
|
||||||
|
lifetime="0.5"
|
||||||
|
inwater="false"
|
||||||
|
velocitychange="0.0, 0.0">
|
||||||
|
<sprite texture="Content/Particles/flames.png" sourcerect="0,64,128,64" origin="0.15,0.5"/>
|
||||||
|
</plasma>
|
||||||
|
</prefabs>
|
||||||
|
After Width: | Height: | Size: 9.9 KiB |
@@ -418,10 +418,12 @@ namespace Subsurface
|
|||||||
|
|
||||||
public void GiveJobItems(WayPoint spawnPoint)
|
public void GiveJobItems(WayPoint spawnPoint)
|
||||||
{
|
{
|
||||||
if (Info == null || Info.Job == null) return;
|
if (info == null || info.Job == null) return;
|
||||||
|
|
||||||
foreach (string itemName in Info.Job.SpawnItemNames)
|
for (int i = 0; i < info.Job.SpawnItemNames.Count; i++ )
|
||||||
{
|
{
|
||||||
|
string itemName = info.Job.SpawnItemNames[i];
|
||||||
|
|
||||||
ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == itemName) as ItemPrefab;
|
ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == itemName) as ItemPrefab;
|
||||||
if (itemPrefab == null)
|
if (itemPrefab == null)
|
||||||
{
|
{
|
||||||
@@ -431,14 +433,18 @@ namespace Subsurface
|
|||||||
|
|
||||||
Item item = new Item(itemPrefab, Position);
|
Item item = new Item(itemPrefab, Position);
|
||||||
inventory.TryPutItem(item, item.AllowedSlots, false);
|
inventory.TryPutItem(item, item.AllowedSlots, false);
|
||||||
|
|
||||||
if (item.Prefab.Name == "ID Card" && spawnPoint!=null)
|
if (info.Job.EquipSpawnItem[i])
|
||||||
|
{
|
||||||
|
item.Equip(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.Prefab.Name == "ID Card" && spawnPoint != null)
|
||||||
{
|
{
|
||||||
foreach (string s in spawnPoint.IdCardTags)
|
foreach (string s in spawnPoint.IdCardTags)
|
||||||
{
|
{
|
||||||
|
|
||||||
item.AddTag(s);
|
item.AddTag(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,8 +482,7 @@ namespace Subsurface
|
|||||||
if (i == 1 && selectedItems[0] == selectedItems[1]) continue;
|
if (i == 1 && selectedItems[0] == selectedItems[1]) continue;
|
||||||
|
|
||||||
if (actionKeyDown.State) selectedItems[i].Use(deltaTime, this);
|
if (actionKeyDown.State) selectedItems[i].Use(deltaTime, this);
|
||||||
if (secondaryKeyDown.State && selectedItems[i] != null) selectedItems[i].SecondaryUse(deltaTime, this);
|
if (secondaryKeyDown.State && selectedItems[i] != null) selectedItems[i].SecondaryUse(deltaTime, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedConstruction != null)
|
if (selectedConstruction != null)
|
||||||
@@ -906,6 +911,8 @@ namespace Subsurface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
health = 0.0f;
|
||||||
|
|
||||||
isDead = true;
|
isDead = true;
|
||||||
AnimController.movement = Vector2.Zero;
|
AnimController.movement = Vector2.Zero;
|
||||||
AnimController.TargetMovement = Vector2.Zero;
|
AnimController.TargetMovement = Vector2.Zero;
|
||||||
@@ -914,7 +921,6 @@ namespace Subsurface
|
|||||||
{
|
{
|
||||||
if (selectedItems[i] != null) selectedItems[i].Drop(this);
|
if (selectedItems[i] != null) selectedItems[i].Drop(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
aiTarget.Remove();
|
aiTarget.Remove();
|
||||||
aiTarget = null;
|
aiTarget = null;
|
||||||
|
|||||||
@@ -172,22 +172,27 @@ namespace Subsurface
|
|||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
new GUITextBlock(new Rectangle(x+80, y, 200, 20), Name, GUI.style, frame);
|
new GUITextBlock(new Rectangle(x+80, y, 200, 20), Name, GUI.style, frame);
|
||||||
y += 20;
|
y += 20;
|
||||||
new GUITextBlock(new Rectangle(x+80, y, 200, 20), Job.Name, GUI.style, frame);
|
|
||||||
y += 30;
|
|
||||||
|
|
||||||
var skills = Job.Skills;
|
if (Job!=null)
|
||||||
skills.Sort((s1, s2) => -s1.Level.CompareTo(s2.Level));
|
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle(x, y, 200, 20), "Skills:", GUI.style, frame);
|
|
||||||
y += 20;
|
|
||||||
foreach (Skill skill in skills)
|
|
||||||
{
|
{
|
||||||
Color textColor = Color.White * (0.5f + skill.Level/200.0f);
|
new GUITextBlock(new Rectangle(x+80, y, 200, 20), Job.Name, GUI.style, frame);
|
||||||
new GUITextBlock(new Rectangle(x+20, y, 200, 20), skill.Name, Color.Transparent, textColor, Alignment.Left, GUI.style, frame);
|
y += 30;
|
||||||
new GUITextBlock(new Rectangle(x + 20, y, 200, 20), skill.Level.ToString(), Color.Transparent, textColor, Alignment.Right, GUI.style, frame);
|
|
||||||
|
var skills = Job.Skills;
|
||||||
|
skills.Sort((s1, s2) => -s1.Level.CompareTo(s2.Level));
|
||||||
|
|
||||||
|
new GUITextBlock(new Rectangle(x, y, 200, 20), "Skills:", GUI.style, frame);
|
||||||
y += 20;
|
y += 20;
|
||||||
|
foreach (Skill skill in skills)
|
||||||
|
{
|
||||||
|
Color textColor = Color.White * (0.5f + skill.Level/200.0f);
|
||||||
|
new GUITextBlock(new Rectangle(x+20, y, 200, 20), skill.Name, Color.Transparent, textColor, Alignment.Left, GUI.style, frame);
|
||||||
|
new GUITextBlock(new Rectangle(x + 20, y, 200, 20), skill.Level.ToString(), Color.Transparent, textColor, Alignment.Right, GUI.style, frame);
|
||||||
|
y += 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ namespace Subsurface
|
|||||||
get { return prefab.ItemNames; }
|
get { return prefab.ItemNames; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<bool> EquipSpawnItem
|
||||||
|
{
|
||||||
|
get { return prefab.EquipItem; }
|
||||||
|
}
|
||||||
|
|
||||||
public List<Skill> Skills
|
public List<Skill> Skills
|
||||||
{
|
{
|
||||||
get { return skills.Values.ToList(); }
|
get { return skills.Values.ToList(); }
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace Subsurface
|
|||||||
|
|
||||||
//names of the items the character spawns with
|
//names of the items the character spawns with
|
||||||
public List<string> ItemNames;
|
public List<string> ItemNames;
|
||||||
|
public List<bool> EquipItem;
|
||||||
|
|
||||||
public Dictionary<string, Vector2> Skills;
|
public Dictionary<string, Vector2> Skills;
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ namespace Subsurface
|
|||||||
AllowAlways = ToolBox.GetAttributeBool(element, "allowalways", false);
|
AllowAlways = ToolBox.GetAttributeBool(element, "allowalways", false);
|
||||||
|
|
||||||
ItemNames = new List<string>();
|
ItemNames = new List<string>();
|
||||||
|
EquipItem = new List<bool>();
|
||||||
|
|
||||||
Skills = new Dictionary<string, Vector2>();
|
Skills = new Dictionary<string, Vector2>();
|
||||||
|
|
||||||
@@ -72,7 +74,12 @@ namespace Subsurface
|
|||||||
{
|
{
|
||||||
case "item":
|
case "item":
|
||||||
string itemName = ToolBox.GetAttributeString(subElement, "name", "");
|
string itemName = ToolBox.GetAttributeString(subElement, "name", "");
|
||||||
if (!string.IsNullOrEmpty(itemName)) ItemNames.Add(itemName);
|
bool equipItem = ToolBox.GetAttributeBool(subElement, "equip", false);
|
||||||
|
if (!string.IsNullOrEmpty(itemName))
|
||||||
|
{
|
||||||
|
ItemNames.Add(itemName);
|
||||||
|
EquipItem.Add(equipItem);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "skills":
|
case "skills":
|
||||||
LoadSkills(subElement);
|
LoadSkills(subElement);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using FarseerPhysics.Dynamics;
|
|||||||
using FarseerPhysics.Dynamics.Joints;
|
using FarseerPhysics.Dynamics.Joints;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using Subsurface.Items.Components;
|
||||||
|
|
||||||
namespace Subsurface
|
namespace Subsurface
|
||||||
{
|
{
|
||||||
@@ -60,7 +61,7 @@ namespace Subsurface
|
|||||||
private Direction dir;
|
private Direction dir;
|
||||||
|
|
||||||
private Item wearingItem;
|
private Item wearingItem;
|
||||||
private Sprite wearingItemSprite;
|
private WearableSprite wearingItemSprite;
|
||||||
|
|
||||||
private Vector2 animTargetPos;
|
private Vector2 animTargetPos;
|
||||||
|
|
||||||
@@ -154,7 +155,7 @@ namespace Subsurface
|
|||||||
set { wearingItem = value; }
|
set { wearingItem = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sprite WearingItemSprite
|
public WearableSprite WearingItemSprite
|
||||||
{
|
{
|
||||||
get { return wearingItemSprite; }
|
get { return wearingItemSprite; }
|
||||||
set { wearingItemSprite = value; }
|
set { wearingItemSprite = value; }
|
||||||
@@ -184,7 +185,7 @@ namespace Subsurface
|
|||||||
body.CollidesWith = Physics.CollisionAll & ~Physics.CollisionCharacter & ~Physics.CollisionMisc;
|
body.CollidesWith = Physics.CollisionAll & ~Physics.CollisionCharacter & ~Physics.CollisionMisc;
|
||||||
}
|
}
|
||||||
|
|
||||||
impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", 8.0f);
|
impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", 10.0f);
|
||||||
|
|
||||||
body.UserData = this;
|
body.UserData = this;
|
||||||
|
|
||||||
@@ -398,16 +399,28 @@ namespace Subsurface
|
|||||||
Color color = Color.White;// new Color(1.0f, 1.0f - damage / maxHealth, 1.0f - damage / maxHealth);
|
Color color = Color.White;// new Color(1.0f, 1.0f - damage / maxHealth, 1.0f - damage / maxHealth);
|
||||||
|
|
||||||
body.Dir = Dir;
|
body.Dir = Dir;
|
||||||
body.Draw(spriteBatch, sprite, color);
|
|
||||||
|
if (wearingItem == null || !wearingItemSprite.HideLimb)
|
||||||
|
{
|
||||||
|
body.Draw(spriteBatch, sprite, color);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
body.UpdateDrawPosition();
|
||||||
|
}
|
||||||
|
|
||||||
if (wearingItem != null)
|
if (wearingItem != null)
|
||||||
{
|
{
|
||||||
SpriteEffects spriteEffect = (dir == Direction.Right) ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
SpriteEffects spriteEffect = (dir == Direction.Right) ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||||
wearingItemSprite.Draw(spriteBatch,
|
|
||||||
|
Vector2 origin = wearingItemSprite.Sprite.Origin;
|
||||||
|
if (body.Dir == -1.0f) origin.X = wearingItemSprite.Sprite.SourceRect.Width - origin.X;
|
||||||
|
|
||||||
|
wearingItemSprite.Sprite.Draw(spriteBatch,
|
||||||
new Vector2(body.DrawPosition.X, -body.DrawPosition.Y),
|
new Vector2(body.DrawPosition.X, -body.DrawPosition.Y),
|
||||||
color,
|
color, origin,
|
||||||
-body.DrawRotation,
|
-body.DrawRotation,
|
||||||
1.0f, spriteEffect);
|
1.0f, spriteEffect, sprite.Depth - 0.000001f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Game1.DebugDraw) return;
|
if (!Game1.DebugDraw) return;
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ namespace Subsurface
|
|||||||
}
|
}
|
||||||
|
|
||||||
float startDepth = 0.1f;
|
float startDepth = 0.1f;
|
||||||
float increment = 0.0001f;
|
float increment = 0.001f;
|
||||||
|
|
||||||
foreach (Character otherCharacter in Character.CharacterList)
|
foreach (Character otherCharacter in Character.CharacterList)
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ namespace Subsurface
|
|||||||
|
|
||||||
foreach (Limb limb in limbs)
|
foreach (Limb limb in limbs)
|
||||||
{
|
{
|
||||||
limb.sprite.Depth = startDepth + limb.sprite.Depth * 0.00001f;
|
limb.sprite.Depth = startDepth + limb.sprite.Depth * 0.0001f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -339,6 +339,16 @@ namespace Subsurface
|
|||||||
if (children.Contains(child)) children.Remove(child);
|
if (children.Contains(child)) children.Remove(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GUIComponent FindChild(object userData)
|
||||||
|
{
|
||||||
|
foreach (GUIComponent child in children)
|
||||||
|
{
|
||||||
|
if (child.userData == userData) return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void ClearChildren()
|
public virtual void ClearChildren()
|
||||||
{
|
{
|
||||||
children.Clear();
|
children.Clear();
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ namespace Subsurface
|
|||||||
EditCharacterScreen = new EditCharacterScreen();
|
EditCharacterScreen = new EditCharacterScreen();
|
||||||
yield return Status.Running;
|
yield return Status.Running;
|
||||||
|
|
||||||
ParticleManager = new ParticleManager("Content/Particles/prefabs.xml", Cam);
|
ParticleManager = new ParticleManager("Content/Particles/ParticlePrefabs.xml", Cam);
|
||||||
yield return Status.Running;
|
yield return Status.Running;
|
||||||
|
|
||||||
GUIComponent.Init(Window);
|
GUIComponent.Init(Window);
|
||||||
@@ -262,7 +262,7 @@ namespace Subsurface
|
|||||||
|
|
||||||
if (NetworkMember != null)
|
if (NetworkMember != null)
|
||||||
{
|
{
|
||||||
NetworkMember.Update();
|
NetworkMember.Update((float)deltaTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -298,8 +298,6 @@ namespace Subsurface
|
|||||||
Screen.Selected.Draw(deltaTime, GraphicsDevice, spriteBatch);
|
Screen.Selected.Draw(deltaTime, GraphicsDevice, spriteBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//renderTimeElapsed = (int)renderTimer.Elapsed.Ticks;
|
|
||||||
//renderTimer.Stop();
|
|
||||||
if (sw.Elapsed.TotalSeconds < Physics.step)
|
if (sw.Elapsed.TotalSeconds < Physics.step)
|
||||||
{
|
{
|
||||||
System.Threading.Thread.Sleep((int)((Physics.step - sw.Elapsed.TotalSeconds)*1000.0));
|
System.Threading.Thread.Sleep((int)((Physics.step - sw.Elapsed.TotalSeconds)*1000.0));
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
string prevMsg;
|
string prevMsg;
|
||||||
|
|
||||||
//protected Character picker;
|
|
||||||
|
|
||||||
//the distance from the holding characters elbow to center of the physics body of the item
|
//the distance from the holding characters elbow to center of the physics body of the item
|
||||||
protected Vector2 holdPos;
|
protected Vector2 holdPos;
|
||||||
|
|
||||||
@@ -23,8 +21,7 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
protected bool aimable;
|
protected bool aimable;
|
||||||
|
|
||||||
private bool attachable;
|
private bool attachable, attached, attachedByDefault;
|
||||||
private bool attached;
|
|
||||||
private PhysicsBody body;
|
private PhysicsBody body;
|
||||||
|
|
||||||
//the angle in which the character holds the item
|
//the angle in which the character holds the item
|
||||||
@@ -51,6 +48,13 @@ namespace Subsurface.Items.Components
|
|||||||
set { attachable = value; }
|
set { attachable = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HasDefaultValue(false, false)]
|
||||||
|
public bool AttachedByDefault
|
||||||
|
{
|
||||||
|
get { return attachedByDefault; }
|
||||||
|
set { attachedByDefault = value; }
|
||||||
|
}
|
||||||
|
|
||||||
[HasDefaultValue("0.0,0.0", false)]
|
[HasDefaultValue("0.0,0.0", false)]
|
||||||
public string HoldPos
|
public string HoldPos
|
||||||
{
|
{
|
||||||
@@ -97,6 +101,8 @@ namespace Subsurface.Items.Components
|
|||||||
Msg = "";
|
Msg = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attachedByDefault) Use(1.0f);
|
||||||
|
|
||||||
|
|
||||||
//holdAngle = ToolBox.GetAttributeFloat(element, "holdangle", 0.0f);
|
//holdAngle = ToolBox.GetAttributeFloat(element, "holdangle", 0.0f);
|
||||||
//holdAngle = MathHelper.ToRadians(holdAngle);
|
//holdAngle = MathHelper.ToRadians(holdAngle);
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
Vector2 barrelPos;
|
Vector2 barrelPos;
|
||||||
|
|
||||||
|
private string particles;
|
||||||
|
|
||||||
float structureFixAmount, limbFixAmount;
|
float structureFixAmount, limbFixAmount;
|
||||||
|
|
||||||
[HasDefaultValue(0.0f, false)]
|
[HasDefaultValue(0.0f, false)]
|
||||||
@@ -42,6 +44,13 @@ namespace Subsurface.Items.Components
|
|||||||
set { limbFixAmount = value; }
|
set { limbFixAmount = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HasDefaultValue("", false)]
|
||||||
|
public string Particles
|
||||||
|
{
|
||||||
|
get { return particles; }
|
||||||
|
set { particles = value; }
|
||||||
|
}
|
||||||
|
|
||||||
[HasDefaultValue("0.0,0.0", false)]
|
[HasDefaultValue("0.0,0.0", false)]
|
||||||
public string BarrelPos
|
public string BarrelPos
|
||||||
{
|
{
|
||||||
@@ -178,12 +187,17 @@ namespace Subsurface.Items.Components
|
|||||||
{
|
{
|
||||||
if (!isActive) return;
|
if (!isActive) return;
|
||||||
|
|
||||||
Vector2 particleSpeed = new Vector2(
|
//Vector2 particleSpeed = new Vector2(
|
||||||
(float)Math.Cos(item.body.Rotation),
|
// (float)Math.Cos(item.body.Rotation),
|
||||||
(float)Math.Sin(item.body.Rotation)) *item.body.Dir * 5.0f;
|
// (float)Math.Sin(item.body.Rotation)) *item.body.Dir * 0.1f;
|
||||||
|
|
||||||
Game1.ParticleManager.CreateParticle("weld", TransformedBarrelPos, particleSpeed);
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(particles))
|
||||||
|
{
|
||||||
|
Game1.ParticleManager.CreateParticle(particles, TransformedBarrelPos,
|
||||||
|
-item.body.Rotation + ((item.body.Dir>0.0f) ? 0.0f : MathHelper.Pi), 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
//Vector2 startPos = ConvertUnits.ToDisplayUnits(item.body.Position);
|
//Vector2 startPos = ConvertUnits.ToDisplayUnits(item.body.Position);
|
||||||
//Vector2 endPos = ConvertUnits.ToDisplayUnits(pickedPosition);
|
//Vector2 endPos = ConvertUnits.ToDisplayUnits(pickedPosition);
|
||||||
//endPos = new Vector2(endPos.X + Game1.localRandom.Next(-2, 2), endPos.Y + Game1.localRandom.Next(-2, 2));
|
//endPos = new Vector2(endPos.X + Game1.localRandom.Next(-2, 2), endPos.Y + Game1.localRandom.Next(-2, 2));
|
||||||
|
|||||||
@@ -22,12 +22,16 @@ namespace Subsurface.Items.Components
|
|||||||
public float VolumeMultiplier;
|
public float VolumeMultiplier;
|
||||||
|
|
||||||
public readonly float Range;
|
public readonly float Range;
|
||||||
|
|
||||||
|
public readonly bool Loop;
|
||||||
|
|
||||||
public ItemSound(Sound sound, ActionType type, float range)
|
public ItemSound(Sound sound, ActionType type, float range, bool loop = true)
|
||||||
{
|
{
|
||||||
this.Sound = sound;
|
this.Sound = sound;
|
||||||
this.Type = type;
|
this.Type = type;
|
||||||
this.Range = range;
|
this.Range = range;
|
||||||
|
|
||||||
|
this.Loop = loop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +51,8 @@ namespace Subsurface.Items.Components
|
|||||||
protected bool canBePicked;
|
protected bool canBePicked;
|
||||||
protected bool canBeSelected;
|
protected bool canBeSelected;
|
||||||
|
|
||||||
|
public bool WasUsed;
|
||||||
|
|
||||||
public List<StatusEffect> statusEffects;
|
public List<StatusEffect> statusEffects;
|
||||||
|
|
||||||
protected bool updated;
|
protected bool updated;
|
||||||
@@ -59,6 +65,8 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
private GUIFrame guiFrame;
|
private GUIFrame guiFrame;
|
||||||
|
|
||||||
|
public ItemComponent Parent;
|
||||||
|
|
||||||
public readonly Dictionary<string, ObjectProperty> properties;
|
public readonly Dictionary<string, ObjectProperty> properties;
|
||||||
public Dictionary<string, ObjectProperty> ObjectProperties
|
public Dictionary<string, ObjectProperty> ObjectProperties
|
||||||
{
|
{
|
||||||
@@ -217,9 +225,6 @@ namespace Subsurface.Items.Components
|
|||||||
if (filePath=="") continue;
|
if (filePath=="") continue;
|
||||||
if (!filePath.Contains("\\")) filePath = Path.GetDirectoryName(item.Prefab.ConfigFile)+"\\"+filePath;
|
if (!filePath.Contains("\\")) filePath = Path.GetDirectoryName(item.Prefab.ConfigFile)+"\\"+filePath;
|
||||||
|
|
||||||
//int index = item.Prefab.sounds.FindIndex(x => x.FilePath == filePath);
|
|
||||||
|
|
||||||
|
|
||||||
ActionType type;
|
ActionType type;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -240,6 +245,13 @@ namespace Subsurface.Items.Components
|
|||||||
itemSound.VolumeMultiplier = ToolBox.GetAttributeFloat(subElement, "volumemultiplier", 1.0f);
|
itemSound.VolumeMultiplier = ToolBox.GetAttributeFloat(subElement, "volumemultiplier", 1.0f);
|
||||||
sounds.Add(itemSound);
|
sounds.Add(itemSound);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
ItemComponent ic = ItemComponent.Load(subElement, item, item.ConfigFile, false);
|
||||||
|
if (ic == null) break;
|
||||||
|
|
||||||
|
ic.Parent = this;
|
||||||
|
item.components.Add(ic);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -247,34 +259,52 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
private ItemSound loopingSound;
|
private ItemSound loopingSound;
|
||||||
private int loopingSoundIndex;
|
private int loopingSoundIndex;
|
||||||
public void PlaySound(ActionType type, Vector2 position, bool loop=false)
|
public void PlaySound(ActionType type, Vector2 position)
|
||||||
{
|
{
|
||||||
ItemSound itemSound = null;
|
ItemSound itemSound = null;
|
||||||
if (!loop || !Sounds.SoundManager.IsPlaying(loopingSoundIndex))
|
if (!Sounds.SoundManager.IsPlaying(loopingSoundIndex))
|
||||||
{
|
{
|
||||||
List<ItemSound> matchingSounds = sounds.FindAll(x => x.Type == type);
|
List<ItemSound> matchingSounds = sounds.FindAll(x => x.Type == type);
|
||||||
if (matchingSounds.Count == 0) return;
|
if (matchingSounds.Count == 0) return;
|
||||||
|
|
||||||
int index = Rand.Int(matchingSounds.Count);
|
int index = Rand.Int(matchingSounds.Count);
|
||||||
itemSound = matchingSounds[index];
|
itemSound = matchingSounds[index];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (loop) loopingSound = itemSound;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (loop)
|
|
||||||
|
if (loopingSound!=null)
|
||||||
{
|
{
|
||||||
loopingSoundIndex = loopingSound.Sound.Loop(loopingSoundIndex, GetSoundVolume(loopingSound), position, loopingSound.Range);
|
loopingSoundIndex = loopingSound.Sound.Loop(loopingSoundIndex, GetSoundVolume(loopingSound), position, loopingSound.Range);
|
||||||
}
|
}
|
||||||
else
|
else if (itemSound!=null)
|
||||||
{
|
{
|
||||||
|
if (itemSound.Loop)
|
||||||
itemSound.Sound.Play(GetSoundVolume(itemSound), itemSound.Range, position);
|
{
|
||||||
|
loopingSound = itemSound;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemSound.Sound.Play(GetSoundVolume(itemSound), itemSound.Range, position);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void StopSounds(ActionType type)
|
||||||
|
{
|
||||||
|
if (loopingSoundIndex <= 0) return;
|
||||||
|
|
||||||
|
if (loopingSound == null) return;
|
||||||
|
|
||||||
|
if (loopingSound.Type != type) return;
|
||||||
|
|
||||||
|
if (Sounds.SoundManager.IsPlaying(loopingSoundIndex))
|
||||||
|
{
|
||||||
|
Sounds.SoundManager.Stop(loopingSoundIndex);
|
||||||
|
loopingSound = null;
|
||||||
|
loopingSoundIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private float GetSoundVolume(ItemSound sound)
|
private float GetSoundVolume(ItemSound sound)
|
||||||
{
|
{
|
||||||
if (sound.VolumeProperty == "") return 1.0f;
|
if (sound.VolumeProperty == "") return 1.0f;
|
||||||
@@ -326,13 +356,7 @@ namespace Subsurface.Items.Components
|
|||||||
//called when isActive is true and condition == 0.0f
|
//called when isActive is true and condition == 0.0f
|
||||||
public virtual void UpdateBroken(float deltaTime, Camera cam)
|
public virtual void UpdateBroken(float deltaTime, Camera cam)
|
||||||
{
|
{
|
||||||
if (loopingSoundIndex <= 0) return;
|
StopSounds(ActionType.OnActive);
|
||||||
|
|
||||||
if (Sounds.SoundManager.IsPlaying(loopingSoundIndex))
|
|
||||||
{
|
|
||||||
Sounds.SoundManager.Stop(loopingSoundIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//called when the item is equipped and left mouse button is pressed
|
//called when the item is equipped and left mouse button is pressed
|
||||||
@@ -565,30 +589,30 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
public virtual void OnMapLoaded() { }
|
public virtual void OnMapLoaded() { }
|
||||||
|
|
||||||
public static ItemComponent Load(XElement element, Item item, string file)
|
public static ItemComponent Load(XElement element, Item item, string file, bool errorMessages = true)
|
||||||
{
|
{
|
||||||
Type t;
|
Type t;
|
||||||
string type = element.Name.ToString().ToLower();
|
string type = element.Name.ToString().ToLower();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Get the type of a specified class.
|
// Get the type of a specified class.
|
||||||
t = Type.GetType("Subsurface.Items.Components." + type + ", Subsurface", true, true);
|
t = Type.GetType("Subsurface.Items.Components." + type + ", Subsurface", false, true);
|
||||||
if (t == null)
|
if (t == null)
|
||||||
{
|
{
|
||||||
DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")");
|
if (errorMessages) DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")", e);
|
if (errorMessages) DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstructorInfo constructor;
|
ConstructorInfo constructor;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (t!=typeof(ItemComponent) && !t.IsSubclassOf(typeof(ItemComponent))) return null;
|
if (t != typeof(ItemComponent) && !t.IsSubclassOf(typeof(ItemComponent))) return null;
|
||||||
constructor = t.GetConstructor(new Type[] { typeof(Item), typeof(XElement) });
|
constructor = t.GetConstructor(new Type[] { typeof(Item), typeof(XElement) });
|
||||||
if (constructor == null)
|
if (constructor == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -136,27 +136,8 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
private bool OnProjectileCollision(Fixture f1, Fixture f2, Contact contact)
|
private bool OnProjectileCollision(Fixture f1, Fixture f2, Contact contact)
|
||||||
{
|
{
|
||||||
//doesn't collide with items
|
|
||||||
//if (f2.Body.UserData is Item) return false;
|
|
||||||
|
|
||||||
if (ignoredBodies.Contains(f2.Body)) return false;
|
if (ignoredBodies.Contains(f2.Body)) return false;
|
||||||
|
|
||||||
//Structure structure = f1.Body.UserData as Structure;
|
|
||||||
//if (structure!=null && (structure.IsPlatform || structure.StairDirection != Direction.None)) return false;
|
|
||||||
|
|
||||||
//Vector2 force = f1.Body.LinearVelocity * f1.Body.Mass;
|
|
||||||
//float forceLength = force.Length();
|
|
||||||
|
|
||||||
//if (forceLength > 20.0f)
|
|
||||||
//{
|
|
||||||
// force = force / forceLength * 20.0f;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//f2.Body.ApplyLinearImpulse(force);
|
|
||||||
//f1.Body.ApplyLinearImpulse(-f1.Body.LinearVelocity * f1.Body.Mass);
|
|
||||||
|
|
||||||
//float damage = f1.Body.LinearVelocity.Length();
|
|
||||||
|
|
||||||
AttackResult attackResult = new AttackResult(0.0f, 0.0f);
|
AttackResult attackResult = new AttackResult(0.0f, 0.0f);
|
||||||
if (attack!=null)
|
if (attack!=null)
|
||||||
{
|
{
|
||||||
@@ -195,6 +176,11 @@ namespace Subsurface.Items.Components
|
|||||||
if (Vector2.Dot(f1.Body.LinearVelocity, normal)<0 ) return StickToTarget(f2.Body, dir);
|
if (Vector2.Dot(f1.Body.LinearVelocity, normal)<0 ) return StickToTarget(f2.Body, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (Item contained in item.ContainedItems)
|
||||||
|
{
|
||||||
|
contained.Condition = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
float lightBrightness;
|
float lightBrightness;
|
||||||
|
|
||||||
|
private float flicker;
|
||||||
|
|
||||||
[Editable, HasDefaultValue(100.0f, true)]
|
[Editable, HasDefaultValue(100.0f, true)]
|
||||||
public float Range
|
public float Range
|
||||||
{
|
{
|
||||||
@@ -31,6 +33,16 @@ namespace Subsurface.Items.Components
|
|||||||
range = MathHelper.Clamp(value, 0.0f, 2048.0f);
|
range = MathHelper.Clamp(value, 0.0f, 2048.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HasDefaultValue(0.0f, false)]
|
||||||
|
public float Flicker
|
||||||
|
{
|
||||||
|
get { return flicker; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
flicker = MathHelper.Clamp(value, 0.0f, 1.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[InGameEditable, HasDefaultValue("1.0,1.0,1.0,1.0", true)]
|
[InGameEditable, HasDefaultValue("1.0,1.0,1.0,1.0", true)]
|
||||||
public string LightColor
|
public string LightColor
|
||||||
@@ -61,7 +73,7 @@ namespace Subsurface.Items.Components
|
|||||||
string dir = Path.GetDirectoryName(item.Prefab.ConfigFile)+"\\";
|
string dir = Path.GetDirectoryName(item.Prefab.ConfigFile)+"\\";
|
||||||
for (int i = 0; i<4; i++)
|
for (int i = 0; i<4; i++)
|
||||||
{
|
{
|
||||||
sparkSounds[i] = Sound.Load(dir+"zap"+(i+1)+".ogg");
|
sparkSounds[i] = Sound.Load("Content/Items/Electricity/zap"+(i+1)+".ogg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +101,7 @@ namespace Subsurface.Items.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pickable pickable = item.GetComponent<Pickable>();
|
Pickable pickable = item.GetComponent<Pickable>();
|
||||||
if (item.container!= null || (pickable!=null && pickable.Picker!=null))
|
if (item.container!= null)
|
||||||
{
|
{
|
||||||
light.Color = Color.Transparent;
|
light.Color = Color.Transparent;
|
||||||
return;
|
return;
|
||||||
@@ -114,7 +126,7 @@ namespace Subsurface.Items.Components
|
|||||||
lightBrightness = MathHelper.Lerp(lightBrightness, Math.Min(voltage, 1.0f), 0.1f);
|
lightBrightness = MathHelper.Lerp(lightBrightness, Math.Min(voltage, 1.0f), 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
light.Color = lightColor * lightBrightness;
|
light.Color = lightColor * lightBrightness * (1.0f-Rand.Range(0.0f,Flicker));
|
||||||
|
|
||||||
light.Range = range * (float)Math.Sqrt(lightBrightness);
|
light.Range = range * (float)Math.Sqrt(lightBrightness);
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,21 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace Subsurface.Items.Components
|
namespace Subsurface.Items.Components
|
||||||
{
|
{
|
||||||
|
class WearableSprite
|
||||||
|
{
|
||||||
|
public Sprite Sprite;
|
||||||
|
public bool HideLimb;
|
||||||
|
|
||||||
|
public WearableSprite(Sprite sprite, bool hideLimb)
|
||||||
|
{
|
||||||
|
Sprite = sprite;
|
||||||
|
HideLimb = hideLimb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Wearable : Pickable
|
class Wearable : Pickable
|
||||||
{
|
{
|
||||||
Sprite[] sprite;
|
WearableSprite[] wearableSprite;
|
||||||
LimbType[] limbType;
|
LimbType[] limbType;
|
||||||
Limb[] limb;
|
Limb[] limb;
|
||||||
|
|
||||||
@@ -18,7 +30,7 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
var sprites = element.Elements().Where(x => x.Name.ToString() == "sprite").ToList();
|
var sprites = element.Elements().Where(x => x.Name.ToString() == "sprite").ToList();
|
||||||
int spriteCount = sprites.Count();
|
int spriteCount = sprites.Count();
|
||||||
sprite = new Sprite[spriteCount];
|
wearableSprite = new WearableSprite[spriteCount];
|
||||||
limbType = new LimbType[spriteCount];
|
limbType = new LimbType[spriteCount];
|
||||||
limb = new Limb[spriteCount];
|
limb = new Limb[spriteCount];
|
||||||
|
|
||||||
@@ -40,7 +52,8 @@ namespace Subsurface.Items.Components
|
|||||||
string spritePath = subElement.Attribute("texture").Value;
|
string spritePath = subElement.Attribute("texture").Value;
|
||||||
spritePath = Path.GetDirectoryName( item.Prefab.ConfigFile)+"\\"+spritePath;
|
spritePath = Path.GetDirectoryName( item.Prefab.ConfigFile)+"\\"+spritePath;
|
||||||
|
|
||||||
sprite[i] = new Sprite(subElement, "", spritePath);
|
var sprite = new Sprite(subElement, "", spritePath);
|
||||||
|
wearableSprite[i] = new WearableSprite(sprite, ToolBox.GetAttributeBool(subElement, "hidelimb", false));
|
||||||
//sprite[i].origin = new Vector2(sourceRect.Width / 2.0f, sourceRect.Height / 2.0f);
|
//sprite[i].origin = new Vector2(sourceRect.Width / 2.0f, sourceRect.Height / 2.0f);
|
||||||
|
|
||||||
limbType[i] = (LimbType)Enum.Parse(typeof(LimbType),
|
limbType[i] = (LimbType)Enum.Parse(typeof(LimbType),
|
||||||
@@ -53,7 +66,7 @@ namespace Subsurface.Items.Components
|
|||||||
public override void Equip(Character character)
|
public override void Equip(Character character)
|
||||||
{
|
{
|
||||||
picker = character;
|
picker = character;
|
||||||
for (int i = 0; i < sprite.Length; i++ )
|
for (int i = 0; i < wearableSprite.Length; i++ )
|
||||||
{
|
{
|
||||||
Limb equipLimb = character.AnimController.GetLimb(limbType[i]);
|
Limb equipLimb = character.AnimController.GetLimb(limbType[i]);
|
||||||
if (equipLimb == null) continue;
|
if (equipLimb == null) continue;
|
||||||
@@ -64,7 +77,7 @@ namespace Subsurface.Items.Components
|
|||||||
equipLimb.WearingItem.Unequip(character);
|
equipLimb.WearingItem.Unequip(character);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite[i].Depth = equipLimb.sprite.Depth - 0.001f;
|
//sprite[i].Depth = equipLimb.sprite.Depth - 0.001f;
|
||||||
|
|
||||||
item.body.Enabled = false;
|
item.body.Enabled = false;
|
||||||
|
|
||||||
@@ -72,7 +85,7 @@ namespace Subsurface.Items.Components
|
|||||||
|
|
||||||
limb[i] = equipLimb;
|
limb[i] = equipLimb;
|
||||||
equipLimb.WearingItem = item;
|
equipLimb.WearingItem = item;
|
||||||
equipLimb.WearingItemSprite = sprite[i];
|
equipLimb.WearingItemSprite = wearableSprite[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +102,7 @@ namespace Subsurface.Items.Components
|
|||||||
public override void Unequip(Character character)
|
public override void Unequip(Character character)
|
||||||
{
|
{
|
||||||
if (picker == null) return;
|
if (picker == null) return;
|
||||||
for (int i = 0; i < sprite.Length; i++)
|
for (int i = 0; i < wearableSprite.Length; i++)
|
||||||
{
|
{
|
||||||
Limb equipLimb = character.AnimController.GetLimb(limbType[i]);
|
Limb equipLimb = character.AnimController.GetLimb(limbType[i]);
|
||||||
if (equipLimb == null) continue;
|
if (equipLimb == null) continue;
|
||||||
|
|||||||
@@ -134,6 +134,11 @@ namespace Subsurface
|
|||||||
get { return prefab; }
|
get { return prefab; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ConfigFile
|
||||||
|
{
|
||||||
|
get { return prefab.ConfigFile; }
|
||||||
|
}
|
||||||
|
|
||||||
//which type of inventory slots (head, torso, any, etc) the item can be placed in
|
//which type of inventory slots (head, torso, any, etc) the item can be placed in
|
||||||
public LimbSlot AllowedSlots
|
public LimbSlot AllowedSlots
|
||||||
{
|
{
|
||||||
@@ -443,12 +448,22 @@ namespace Subsurface
|
|||||||
{
|
{
|
||||||
foreach (ItemComponent ic in components)
|
foreach (ItemComponent ic in components)
|
||||||
{
|
{
|
||||||
if (!ic.IsActive) continue;
|
if (ic.Parent != null) ic.IsActive = ic.Parent.IsActive;
|
||||||
|
|
||||||
|
if (!ic.WasUsed) ic.StopSounds(ActionType.OnUse);
|
||||||
|
ic.WasUsed = false;
|
||||||
|
|
||||||
|
|
||||||
|
if (!ic.IsActive)
|
||||||
|
{
|
||||||
|
ic.StopSounds(ActionType.OnActive);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (condition > 0.0f)
|
if (condition > 0.0f)
|
||||||
{
|
{
|
||||||
ic.Update(deltaTime, cam);
|
ic.Update(deltaTime, cam);
|
||||||
|
|
||||||
ic.PlaySound(ActionType.OnActive, Position, true);
|
ic.PlaySound(ActionType.OnActive, Position);
|
||||||
ic.ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
ic.ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -462,7 +477,6 @@ namespace Subsurface
|
|||||||
|
|
||||||
if (body.LinearVelocity.Length()>0.001f) FindHull();
|
if (body.LinearVelocity.Length()>0.001f) FindHull();
|
||||||
|
|
||||||
|
|
||||||
Vector2 displayPos = ConvertUnits.ToDisplayUnits(body.Position);
|
Vector2 displayPos = ConvertUnits.ToDisplayUnits(body.Position);
|
||||||
|
|
||||||
rect.X = (int)(displayPos.X - rect.Width / 2.0f);
|
rect.X = (int)(displayPos.X - rect.Width / 2.0f);
|
||||||
@@ -618,7 +632,6 @@ namespace Subsurface
|
|||||||
{
|
{
|
||||||
foreach (RelatedItem relatedItem in ic.requiredItems)
|
foreach (RelatedItem relatedItem in ic.requiredItems)
|
||||||
{
|
{
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle(0, y, 100, 20), ic.Name + ": " + relatedItem.Type.ToString() + " required", GUI.style, editingHUD);
|
new GUITextBlock(new Rectangle(0, y, 100, 20), ic.Name + ": " + relatedItem.Type.ToString() + " required", GUI.style, editingHUD);
|
||||||
GUITextBox namesBox = new GUITextBox(new Rectangle(0, y, 200, 20), Alignment.Right, GUI.style, editingHUD);
|
GUITextBox namesBox = new GUITextBox(new Rectangle(0, y, 200, 20), Alignment.Right, GUI.style, editingHUD);
|
||||||
|
|
||||||
@@ -809,6 +822,8 @@ namespace Subsurface
|
|||||||
if (!ic.HasRequiredContainedItems(character == Character.Controlled)) continue;
|
if (!ic.HasRequiredContainedItems(character == Character.Controlled)) continue;
|
||||||
if (ic.Use(deltaTime, character))
|
if (ic.Use(deltaTime, character))
|
||||||
{
|
{
|
||||||
|
ic.WasUsed = true;
|
||||||
|
|
||||||
ic.PlaySound(ActionType.OnUse, Position);
|
ic.PlaySound(ActionType.OnUse, Position);
|
||||||
|
|
||||||
ic.ApplyStatusEffects(ActionType.OnUse, deltaTime, character);
|
ic.ApplyStatusEffects(ActionType.OnUse, deltaTime, character);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace Subsurface.Networking
|
|||||||
name = newName;
|
name = newName;
|
||||||
|
|
||||||
characterInfo = new CharacterInfo(Character.HumanConfigFile, name);
|
characterInfo = new CharacterInfo(Character.HumanConfigFile, name);
|
||||||
|
characterInfo.Job = null;
|
||||||
|
|
||||||
otherClients = new List<Client>();
|
otherClients = new List<Client>();
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ namespace Subsurface.Networking
|
|||||||
|
|
||||||
private bool RetryConnection(GUIButton button, object obj)
|
private bool RetryConnection(GUIButton button, object obj)
|
||||||
{
|
{
|
||||||
|
if (client != null) client.Shutdown("Disconnecting");
|
||||||
ConnectToServer(serverIP);
|
ConnectToServer(serverIP);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -175,6 +177,7 @@ namespace Subsurface.Networking
|
|||||||
Client otherClient = new Client(inc.ReadString(), inc.ReadInt32());
|
Client otherClient = new Client(inc.ReadString(), inc.ReadInt32());
|
||||||
|
|
||||||
Game1.NetLobbyScreen.AddPlayer(otherClient);
|
Game1.NetLobbyScreen.AddPlayer(otherClient);
|
||||||
|
otherClients.Add(otherClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
//add the name of own client to the lobby screen
|
//add the name of own client to the lobby screen
|
||||||
@@ -230,20 +233,9 @@ namespace Subsurface.Networking
|
|||||||
yield return Status.Success;
|
yield return Status.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update(float deltaTime)
|
||||||
{
|
{
|
||||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
base.Update(deltaTime);
|
||||||
//if (PlayerInput.KeyDown(Microsoft.Xna.Framework.Input.Keys.K))
|
|
||||||
//{
|
|
||||||
// SendRandomData();
|
|
||||||
//}
|
|
||||||
//if (PlayerInput.KeyDown(Microsoft.Xna.Framework.Input.Keys.L))
|
|
||||||
//{
|
|
||||||
// ConnectToServer(serverIP);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
if (gameStarted) inGameHUD.Update((float)Physics.step);
|
|
||||||
|
|
||||||
if (!connected || updateTimer > DateTime.Now) return;
|
if (!connected || updateTimer > DateTime.Now) return;
|
||||||
|
|
||||||
@@ -341,17 +333,15 @@ namespace Subsurface.Networking
|
|||||||
//myCharacter = ReadCharacterData(inc);
|
//myCharacter = ReadCharacterData(inc);
|
||||||
//Character.Controlled = myCharacter;
|
//Character.Controlled = myCharacter;
|
||||||
|
|
||||||
|
List<Character> crew = new List<Character>();
|
||||||
|
|
||||||
int count = inc.ReadInt32();
|
int count = inc.ReadInt32();
|
||||||
for (int n = 0; n < count; n++)
|
for (int n = 0; n < count; n++)
|
||||||
{
|
{
|
||||||
int id = inc.ReadInt32();
|
int id = inc.ReadInt32();
|
||||||
Character newCharacter = ReadCharacterData(inc);
|
Character newCharacter = ReadCharacterData(inc, id == myID);
|
||||||
|
|
||||||
if (id == myID)
|
crew.Add(newCharacter);
|
||||||
{
|
|
||||||
myCharacter = newCharacter;
|
|
||||||
Character.Controlled = myCharacter;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gameStarted = true;
|
gameStarted = true;
|
||||||
@@ -360,6 +350,8 @@ namespace Subsurface.Networking
|
|||||||
|
|
||||||
AddChatMessage("Press TAB to chat", ChatMessageType.Server);
|
AddChatMessage("Press TAB to chat", ChatMessageType.Server);
|
||||||
|
|
||||||
|
CreateCrewFrame(crew);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case (byte)PacketTypes.EndGame:
|
case (byte)PacketTypes.EndGame:
|
||||||
string endMessage = inc.ReadString();
|
string endMessage = inc.ReadString();
|
||||||
@@ -370,6 +362,7 @@ namespace Subsurface.Networking
|
|||||||
Client otherClient = new Client(inc.ReadString(), inc.ReadInt32());
|
Client otherClient = new Client(inc.ReadString(), inc.ReadInt32());
|
||||||
|
|
||||||
Game1.NetLobbyScreen.AddPlayer(otherClient);
|
Game1.NetLobbyScreen.AddPlayer(otherClient);
|
||||||
|
otherClients.Add(otherClient);
|
||||||
|
|
||||||
AddChatMessage(otherClient.name + " has joined the server", ChatMessageType.Server);
|
AddChatMessage(otherClient.name + " has joined the server", ChatMessageType.Server);
|
||||||
|
|
||||||
@@ -459,7 +452,7 @@ namespace Subsurface.Networking
|
|||||||
client.SendMessage(msg, NetDeliveryMethod.ReliableUnordered);
|
client.SendMessage(msg, NetDeliveryMethod.ReliableUnordered);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Character ReadCharacterData(NetIncomingMessage inc)
|
private Character ReadCharacterData(NetIncomingMessage inc, bool isMyCharacter)
|
||||||
{
|
{
|
||||||
string newName = inc.ReadString();
|
string newName = inc.ReadString();
|
||||||
int ID = inc.ReadInt32();
|
int ID = inc.ReadInt32();
|
||||||
@@ -494,16 +487,20 @@ namespace Subsurface.Networking
|
|||||||
}
|
}
|
||||||
|
|
||||||
Character character = (closestWaypoint == null) ?
|
Character character = (closestWaypoint == null) ?
|
||||||
new Character(ch, position) :
|
new Character(ch, position, true) :
|
||||||
new Character(ch, closestWaypoint);
|
new Character(ch, closestWaypoint, true);
|
||||||
|
|
||||||
character.ID = ID;
|
character.ID = ID;
|
||||||
character.Inventory.ID = inventoryID;
|
character.Inventory.ID = inventoryID;
|
||||||
|
|
||||||
character.IsNetworkPlayer = true;
|
|
||||||
|
|
||||||
character.GiveJobItems(closestWaypoint);
|
character.GiveJobItems(closestWaypoint);
|
||||||
|
|
||||||
|
if (isMyCharacter)
|
||||||
|
{
|
||||||
|
myCharacter = character;
|
||||||
|
Character.Controlled = character;
|
||||||
|
}
|
||||||
|
|
||||||
return character;
|
return character;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,12 +58,9 @@ namespace Subsurface.Networking
|
|||||||
DebugConsole.NewMessage("Server started", Color.Green);
|
DebugConsole.NewMessage("Server started", Color.Green);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update(float deltaTime)
|
||||||
{
|
{
|
||||||
//if (PlayerInput.KeyDown(Microsoft.Xna.Framework.Input.Keys.K))
|
base.Update(deltaTime);
|
||||||
//{
|
|
||||||
// SendRandomData();
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (gameStarted) inGameHUD.Update((float)Physics.step);
|
if (gameStarted) inGameHUD.Update((float)Physics.step);
|
||||||
|
|
||||||
@@ -208,7 +205,7 @@ namespace Subsurface.Networking
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AssignJobs();
|
//AssignJobs();
|
||||||
|
|
||||||
Game1.NetLobbyScreen.AddPlayer(sender);
|
Game1.NetLobbyScreen.AddPlayer(sender);
|
||||||
|
|
||||||
@@ -346,6 +343,8 @@ namespace Subsurface.Networking
|
|||||||
{
|
{
|
||||||
int seed = DateTime.Now.Millisecond;
|
int seed = DateTime.Now.Millisecond;
|
||||||
Rand.SetSyncedSeed(seed);
|
Rand.SetSyncedSeed(seed);
|
||||||
|
|
||||||
|
AssignJobs();
|
||||||
|
|
||||||
Submarine selectedMap = Game1.NetLobbyScreen.SelectedMap as Submarine;
|
Submarine selectedMap = Game1.NetLobbyScreen.SelectedMap as Submarine;
|
||||||
|
|
||||||
@@ -369,9 +368,12 @@ namespace Subsurface.Networking
|
|||||||
}
|
}
|
||||||
characterInfos.Add(client.characterInfo);
|
characterInfos.Add(client.characterInfo);
|
||||||
|
|
||||||
|
client.characterInfo.Job = new Job(client.assignedJob);
|
||||||
|
|
||||||
//client.character = new Character(client.characterInfo, (spawnPoint == null) ? Vector2.Zero : spawnPoint.SimPosition, true);
|
//client.character = new Character(client.characterInfo, (spawnPoint == null) ? Vector2.Zero : spawnPoint.SimPosition, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Character> crew = new List<Character>();
|
||||||
WayPoint[] assignedWayPoints = WayPoint.SelectCrewSpawnPoints(characterInfos);
|
WayPoint[] assignedWayPoints = WayPoint.SelectCrewSpawnPoints(characterInfos);
|
||||||
|
|
||||||
for (int i = 0; i < connectedClients.Count; i++ )
|
for (int i = 0; i < connectedClients.Count; i++ )
|
||||||
@@ -379,6 +381,8 @@ namespace Subsurface.Networking
|
|||||||
connectedClients[i].character = new Character(
|
connectedClients[i].character = new Character(
|
||||||
connectedClients[i].characterInfo, assignedWayPoints[i], true);
|
connectedClients[i].characterInfo, assignedWayPoints[i], true);
|
||||||
connectedClients[i].character.GiveJobItems(assignedWayPoints[i]);
|
connectedClients[i].character.GiveJobItems(assignedWayPoints[i]);
|
||||||
|
|
||||||
|
crew.Add(connectedClients[i].character);
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo: fix
|
//todo: fix
|
||||||
@@ -427,6 +431,9 @@ namespace Subsurface.Networking
|
|||||||
|
|
||||||
Game1.GameScreen.Select();
|
Game1.GameScreen.Select();
|
||||||
|
|
||||||
|
|
||||||
|
CreateCrewFrame(crew);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,7 +692,7 @@ namespace Subsurface.Networking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateNetLobby(null);
|
//UpdateNetLobby(null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Subsurface.Networking
|
namespace Subsurface.Networking
|
||||||
{
|
{
|
||||||
@@ -40,9 +42,14 @@ namespace Subsurface.Networking
|
|||||||
|
|
||||||
protected GUIFrame inGameHUD;
|
protected GUIFrame inGameHUD;
|
||||||
protected GUIListBox chatBox;
|
protected GUIListBox chatBox;
|
||||||
|
protected GUITextBox chatMsgBox;
|
||||||
|
|
||||||
public int Port;
|
public int Port;
|
||||||
|
|
||||||
|
private bool crewFrameOpen;
|
||||||
|
private GUIButton crewButton;
|
||||||
|
private GUIFrame crewFrame;
|
||||||
|
|
||||||
protected bool gameStarted;
|
protected bool gameStarted;
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
@@ -72,13 +79,73 @@ namespace Subsurface.Networking
|
|||||||
width, height),
|
width, height),
|
||||||
Color.White * 0.5f, GUI.style, inGameHUD);
|
Color.White * 0.5f, GUI.style, inGameHUD);
|
||||||
|
|
||||||
var textBox = new GUITextBox(
|
chatMsgBox = new GUITextBox(
|
||||||
new Rectangle(chatBox.Rect.X, chatBox.Rect.Y + chatBox.Rect.Height + 20, chatBox.Rect.Width, 25),
|
new Rectangle(chatBox.Rect.X, chatBox.Rect.Y + chatBox.Rect.Height + 20, chatBox.Rect.Width, 25),
|
||||||
Color.White * 0.5f, Color.Black, Alignment.TopLeft, Alignment.Left, GUI.style, inGameHUD);
|
Color.White * 0.5f, Color.Black, Alignment.TopLeft, Alignment.Left, GUI.style, inGameHUD);
|
||||||
textBox.Font = GUI.SmallFont;
|
chatMsgBox.Font = GUI.SmallFont;
|
||||||
textBox.OnEnter = EnterChatMessage;
|
chatMsgBox.OnEnter = EnterChatMessage;
|
||||||
|
|
||||||
|
crewButton = new GUIButton(new Rectangle(chatBox.Rect.Right-80, chatBox.Rect.Y-30, 80, 20), "Crew", GUI.style, inGameHUD);
|
||||||
|
crewButton.OnClicked = ToggleCrewFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void CreateCrewFrame(List<Character> crew)
|
||||||
|
{
|
||||||
|
int width = 500, height = 400;
|
||||||
|
|
||||||
|
crewFrame = new GUIFrame(new Rectangle(Game1.GraphicsWidth / 2 - width / 2, Game1.GraphicsHeight / 2 - height / 2, width, height), GUI.style);
|
||||||
|
crewFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||||
|
|
||||||
|
GUIListBox crewList = new GUIListBox(new Rectangle(0, 0, 200, 300), Color.White * 0.7f, GUI.style, crewFrame);
|
||||||
|
crewList.OnSelected = SelectCharacter;
|
||||||
|
|
||||||
|
foreach (Character character in crew)
|
||||||
|
{
|
||||||
|
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, null, crewList);
|
||||||
|
frame.UserData = character;
|
||||||
|
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||||
|
frame.HoverColor = Color.LightGray * 0.5f;
|
||||||
|
frame.SelectedColor = Color.Gold * 0.5f;
|
||||||
|
|
||||||
|
GUITextBlock textBlock = new GUITextBlock(
|
||||||
|
new Rectangle(40, 0, 0, 25),
|
||||||
|
character.Info.Name + " ("+character.Info.Job.Name+")",
|
||||||
|
Color.Transparent, Color.White,
|
||||||
|
Alignment.Left, Alignment.Left,
|
||||||
|
null, frame);
|
||||||
|
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
||||||
|
|
||||||
|
new GUIImage(new Rectangle(-10, -10, 0, 0), character.AnimController.limbs[0].sprite, Alignment.Left, frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
var closeButton = new GUIButton(new Rectangle(0,0, 80, 20), "Close", Alignment.BottomCenter, GUI.style, crewFrame);
|
||||||
|
closeButton.OnClicked = ToggleCrewFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool SelectCharacter(object obj)
|
||||||
|
{
|
||||||
|
Character character = obj as Character;
|
||||||
|
if (obj == null) return false;
|
||||||
|
|
||||||
|
GUIComponent existingFrame = crewFrame.FindChild("selectedcharacter");
|
||||||
|
if (existingFrame != null) crewFrame.RemoveChild(existingFrame);
|
||||||
|
|
||||||
|
var previewPlayer = new GUIFrame(
|
||||||
|
new Rectangle(0,0, 230, 300),
|
||||||
|
new Color(0.0f, 0.0f, 0.0f, 0.8f), Alignment.TopRight, GUI.style, crewFrame);
|
||||||
|
previewPlayer.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||||
|
previewPlayer.UserData = "selectedcharacter";
|
||||||
|
|
||||||
|
var infoFrame = character.Info.CreateInfoFrame(previewPlayer);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ToggleCrewFrame(GUIButton button, object obj)
|
||||||
|
{
|
||||||
|
crewFrameOpen = !crewFrameOpen;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public bool EnterChatMessage(GUITextBox textBox, string message)
|
public bool EnterChatMessage(GUITextBox textBox, string message)
|
||||||
{
|
{
|
||||||
@@ -122,13 +189,36 @@ namespace Subsurface.Networking
|
|||||||
|
|
||||||
public virtual void SendChatMessage(string message, ChatMessageType type = ChatMessageType.Server) { }
|
public virtual void SendChatMessage(string message, ChatMessageType type = ChatMessageType.Server) { }
|
||||||
|
|
||||||
public virtual void Update() { }
|
public virtual void Update(float deltaTime)
|
||||||
|
{
|
||||||
|
if (gameStarted)
|
||||||
|
{
|
||||||
|
inGameHUD.Update(deltaTime);
|
||||||
|
|
||||||
|
if (crewFrameOpen) crewFrame.Update(deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PlayerInput.KeyHit(Keys.Tab))
|
||||||
|
{
|
||||||
|
if (chatMsgBox.Selected)
|
||||||
|
{
|
||||||
|
chatMsgBox.Text = "";
|
||||||
|
chatMsgBox.Deselect();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chatMsgBox.Select();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
|
public virtual void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
if (!gameStarted) return;
|
if (!gameStarted) return;
|
||||||
|
|
||||||
inGameHUD.Draw(spriteBatch);
|
inGameHUD.Draw(spriteBatch);
|
||||||
|
|
||||||
|
if (crewFrameOpen) crewFrame.Draw(spriteBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Disconnect() { }
|
public virtual void Disconnect() { }
|
||||||
|
|||||||
@@ -82,7 +82,14 @@ namespace Subsurface.Particles
|
|||||||
color = prefab.startColor;
|
color = prefab.startColor;
|
||||||
alpha = prefab.startAlpha;
|
alpha = prefab.startAlpha;
|
||||||
|
|
||||||
velocityChange = prefab.velocityChange;
|
velocityChange = prefab.velocityChange;
|
||||||
|
|
||||||
|
if (prefab.rotateToDirection)
|
||||||
|
{
|
||||||
|
this.rotation = MathUtils.VectorToAngle(new Vector2(velocity.X, -velocity.Y));
|
||||||
|
|
||||||
|
prevRotation = rotation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Update(float deltaTime)
|
public bool Update(float deltaTime)
|
||||||
@@ -93,7 +100,10 @@ namespace Subsurface.Particles
|
|||||||
|
|
||||||
if (prefab.rotateToDirection)
|
if (prefab.rotateToDirection)
|
||||||
{
|
{
|
||||||
rotation = MathUtils.VectorToAngle(velocity);
|
if (velocityChange != Vector2.Zero || angularVelocity != 0.0f)
|
||||||
|
{
|
||||||
|
rotation = MathUtils.VectorToAngle(new Vector2(velocity.X, -velocity.Y));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -153,15 +163,17 @@ namespace Subsurface.Particles
|
|||||||
drawPosition = ConvertUnits.ToDisplayUnits(drawPosition);
|
drawPosition = ConvertUnits.ToDisplayUnits(drawPosition);
|
||||||
|
|
||||||
|
|
||||||
spriteBatch.Draw(
|
prefab.sprite.Draw(spriteBatch, drawPosition, color*alpha, drawRotation, size.X, SpriteEffects.None, prefab.sprite.Depth);
|
||||||
prefab.sprite.Texture,
|
|
||||||
drawPosition,
|
//spriteBatch.Draw(
|
||||||
null,
|
// prefab.sprite.Texture,
|
||||||
color*alpha,
|
// drawPosition,
|
||||||
drawRotation,
|
// null,
|
||||||
prefab.sprite.origin,
|
// color*alpha,
|
||||||
size,
|
// drawRotation,
|
||||||
SpriteEffects.None, prefab.sprite.Depth);
|
// prefab.sprite.origin,
|
||||||
|
// size,
|
||||||
|
// SpriteEffects.None, prefab.sprite.Depth);
|
||||||
|
|
||||||
prevPosition = position;
|
prevPosition = position;
|
||||||
prevRotation = rotation;
|
prevRotation = rotation;
|
||||||
|
|||||||
@@ -35,8 +35,12 @@ namespace Subsurface.Particles
|
|||||||
{
|
{
|
||||||
name = element.Name.ToString();
|
name = element.Name.ToString();
|
||||||
|
|
||||||
string spritePath = ToolBox.GetAttributeString(element, "sprite", "");
|
foreach (XElement subElement in element.Elements())
|
||||||
sprite = new Sprite(spritePath, new Vector2(0.5f,0.5f));
|
{
|
||||||
|
if (subElement.Name.ToString().ToLower() != "sprite") continue;
|
||||||
|
|
||||||
|
sprite = new Sprite(subElement);
|
||||||
|
}
|
||||||
|
|
||||||
angularVelocityMin = ToolBox.GetAttributeFloat(element, "angularvelocitymin", 0.0f);
|
angularVelocityMin = ToolBox.GetAttributeFloat(element, "angularvelocitymin", 0.0f);
|
||||||
angularVelocityMax = ToolBox.GetAttributeFloat(element, "angularvelocitymax", 0.0f);
|
angularVelocityMax = ToolBox.GetAttributeFloat(element, "angularvelocitymax", 0.0f);
|
||||||
|
|||||||
@@ -285,17 +285,22 @@ namespace Subsurface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw(SpriteBatch spriteBatch, Sprite sprite, Color color, float? depth = null)
|
public void UpdateDrawPosition()
|
||||||
{
|
{
|
||||||
if (!body.Enabled) return;
|
|
||||||
|
|
||||||
SpriteEffects spriteEffect = (dir == 1.0f) ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
|
||||||
|
|
||||||
drawPosition = Physics.Interpolate(prevPosition, body.Position);
|
drawPosition = Physics.Interpolate(prevPosition, body.Position);
|
||||||
drawPosition = ConvertUnits.ToDisplayUnits(drawPosition);
|
drawPosition = ConvertUnits.ToDisplayUnits(drawPosition);
|
||||||
|
|
||||||
drawRotation = Physics.Interpolate(prevRotation, body.Rotation);
|
drawRotation = Physics.Interpolate(prevRotation, body.Rotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Draw(SpriteBatch spriteBatch, Sprite sprite, Color color, float? depth = null)
|
||||||
|
{
|
||||||
|
if (!body.Enabled) return;
|
||||||
|
|
||||||
|
UpdateDrawPosition();
|
||||||
|
|
||||||
|
SpriteEffects spriteEffect = (dir == 1.0f) ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||||
|
|
||||||
sprite.Draw(spriteBatch, new Vector2(drawPosition.X, -drawPosition.Y), color, -drawRotation, 1.0f, spriteEffect, depth);
|
sprite.Draw(spriteBatch, new Vector2(drawPosition.X, -drawPosition.Y), color, -drawRotation, 1.0f, spriteEffect, depth);
|
||||||
|
|
||||||
//prevPosition = body.Position;
|
//prevPosition = body.Position;
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ namespace Subsurface
|
|||||||
serverName.Enabled = Game1.Server != null;
|
serverName.Enabled = Game1.Server != null;
|
||||||
serverName.OnTextChanged = ChangeServerName;
|
serverName.OnTextChanged = ChangeServerName;
|
||||||
|
|
||||||
|
|
||||||
serverMessage = new GUITextBox(new Rectangle(0, 30, 360, 70), null, null, Alignment.TopLeft, Alignment.TopLeft, GUI.style, infoFrame);
|
serverMessage = new GUITextBox(new Rectangle(0, 30, 360, 70), null, null, Alignment.TopLeft, Alignment.TopLeft, GUI.style, infoFrame);
|
||||||
serverMessage.Wrap = true;
|
serverMessage.Wrap = true;
|
||||||
serverMessage.TextGetter = GetServerMessage;
|
serverMessage.TextGetter = GetServerMessage;
|
||||||
@@ -266,10 +265,10 @@ namespace Subsurface
|
|||||||
if (subList.CountChildren > 0) subList.Select(0);
|
if (subList.CountChildren > 0) subList.Select(0);
|
||||||
if (GameModePreset.list.Count > 0) modeList.Select(0);
|
if (GameModePreset.list.Count > 0) modeList.Select(0);
|
||||||
}
|
}
|
||||||
else
|
else if (playerFrame.children.Count==0)
|
||||||
{
|
{
|
||||||
int x = playerFrame.Rect.Width / 2;
|
int x = playerFrame.Rect.Width / 2;
|
||||||
|
|
||||||
playerFrame.ClearChildren();
|
playerFrame.ClearChildren();
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle(x, 0, 200, 30), "Name: ", GUI.style, playerFrame);
|
new GUITextBlock(new Rectangle(x, 0, 200, 30), "Name: ", GUI.style, playerFrame);
|
||||||
@@ -312,7 +311,6 @@ namespace Subsurface
|
|||||||
UpdateJobPreferences(jobList);
|
UpdateJobPreferences(jobList);
|
||||||
|
|
||||||
UpdatePreviewPlayer(Game1.Client.CharacterInfo);
|
UpdatePreviewPlayer(Game1.Client.CharacterInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Select();
|
base.Select();
|
||||||
@@ -594,13 +592,13 @@ namespace Subsurface
|
|||||||
msg.Write(durationBar.BarScroll);
|
msg.Write(durationBar.BarScroll);
|
||||||
msg.Write(LevelSeed);
|
msg.Write(LevelSeed);
|
||||||
|
|
||||||
msg.Write(playerList.CountChildren - 1);
|
//msg.Write(playerList.CountChildren - 1);
|
||||||
for (int i = 1; i < playerList.CountChildren; i++)
|
//for (int i = 1; i < playerList.CountChildren; i++)
|
||||||
{
|
//{
|
||||||
Client client = playerList.children[i].UserData as Client;
|
// Client client = playerList.children[i].UserData as Client;
|
||||||
msg.Write(client.ID);
|
// msg.Write(client.ID);
|
||||||
msg.Write(client.assignedJob==null ? "" : client.assignedJob.Name);
|
// msg.Write(client.assignedJob==null ? "" : client.assignedJob.Name);
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,48 +640,48 @@ namespace Subsurface
|
|||||||
|
|
||||||
LevelSeed = levelSeed;
|
LevelSeed = levelSeed;
|
||||||
|
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
int playerCount = msg.ReadInt32();
|
// int playerCount = msg.ReadInt32();
|
||||||
|
|
||||||
for (int i = 0; i < playerCount; i++)
|
// for (int i = 0; i < playerCount; i++)
|
||||||
{
|
// {
|
||||||
int clientID = msg.ReadInt32();
|
// int clientID = msg.ReadInt32();
|
||||||
string jobName = msg.ReadString();
|
// string jobName = msg.ReadString();
|
||||||
|
|
||||||
Client client = null;
|
// Client client = null;
|
||||||
GUITextBlock textBlock = null;
|
// GUITextBlock textBlock = null;
|
||||||
foreach (GUIComponent child in playerList.children)
|
// foreach (GUIComponent child in playerList.children)
|
||||||
{
|
// {
|
||||||
Client tempClient = child.UserData as Client;
|
// Client tempClient = child.UserData as Client;
|
||||||
if (tempClient == null || tempClient.ID != clientID) continue;
|
// if (tempClient == null || tempClient.ID != clientID) continue;
|
||||||
|
|
||||||
client = tempClient;
|
// client = tempClient;
|
||||||
textBlock = child as GUITextBlock;
|
// textBlock = child as GUITextBlock;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
if (client == null) continue;
|
// if (client == null) continue;
|
||||||
|
|
||||||
client.assignedJob = JobPrefab.List.Find(jp => jp.Name == jobName);
|
// client.assignedJob = JobPrefab.List.Find(jp => jp.Name == jobName);
|
||||||
|
|
||||||
textBlock.Text = client.name + ((client.assignedJob==null) ? "" : " (" + client.assignedJob.Name + ")");
|
// textBlock.Text = client.name + ((client.assignedJob==null) ? "" : " (" + client.assignedJob.Name + ")");
|
||||||
|
|
||||||
if (client.assignedJob==null || jobName != client.assignedJob.Name)
|
// if (client.assignedJob==null || jobName != client.assignedJob.Name)
|
||||||
{
|
// {
|
||||||
if (clientID == Game1.Client.ID)
|
// if (clientID == Game1.Client.ID)
|
||||||
{
|
// {
|
||||||
Game1.Client.CharacterInfo.Job = new Job(client.assignedJob);
|
// Game1.Client.CharacterInfo.Job = new Job(client.assignedJob);
|
||||||
Game1.Client.CharacterInfo.Name = client.name;
|
// Game1.Client.CharacterInfo.Name = client.name;
|
||||||
UpdatePreviewPlayer(Game1.Client.CharacterInfo);
|
// UpdatePreviewPlayer(Game1.Client.CharacterInfo);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
catch
|
//catch
|
||||||
{
|
//{
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,13 +172,9 @@ namespace Subsurface
|
|||||||
}
|
}
|
||||||
|
|
||||||
return sourceIndex;
|
return sourceIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return SoundManager.Loop(this, sourceIndex, position, volume, volume);
|
return SoundManager.Loop(this, sourceIndex, position, volume, volume);
|
||||||
|
|
||||||
//return UpdatePosition(newIndex, position, range, volume);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,11 @@ namespace Subsurface
|
|||||||
public void Draw(SpriteBatch spriteBatch, Vector2 pos, Color color, float rotate = 0.0f, float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float? depth = null)
|
public void Draw(SpriteBatch spriteBatch, Vector2 pos, Color color, float rotate = 0.0f, float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float? depth = null)
|
||||||
{
|
{
|
||||||
spriteBatch.Draw(texture, pos + offset, sourceRect, color, rotation + rotate, origin, scale, spriteEffect, depth==null ? this.depth : (float)depth);
|
spriteBatch.Draw(texture, pos + offset, sourceRect, color, rotation + rotate, origin, scale, spriteEffect, depth==null ? this.depth : (float)depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Draw(SpriteBatch spriteBatch, Vector2 pos, Color color, Vector2 origin, float rotate = 0.0f, float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float? depth = null)
|
||||||
|
{
|
||||||
|
spriteBatch.Draw(texture, pos + offset, sourceRect, color, rotation + rotate, origin, scale, spriteEffect, depth == null ? this.depth : (float)depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Color color)
|
public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Color color)
|
||||||
|
|||||||
@@ -292,6 +292,12 @@
|
|||||||
<Content Include="Content\Items\Artifacts\artifacts.xml">
|
<Content Include="Content\Items\Artifacts\artifacts.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="Content\Items\Clothes\captainLegs.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Content\Items\Clothes\captainTorso.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Content\Items\Electricity\lamp.png">
|
<Content Include="Content\Items\Electricity\lamp.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -469,6 +475,9 @@
|
|||||||
<Content Include="Content\Map\locationTypes.xml">
|
<Content Include="Content\Map\locationTypes.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="Content\Particles\flames.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Content\UI\caret.png">
|
<Content Include="Content\UI\caret.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -641,7 +650,7 @@
|
|||||||
<Content Include="Content\Particles\explosion.png">
|
<Content Include="Content\Particles\explosion.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="Content\Particles\prefabs.xml">
|
<Content Include="Content\Particles\ParticlePrefabs.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -770,6 +779,12 @@
|
|||||||
<None Include="Content\Items\Reactor\reactor.ogg">
|
<None Include="Content\Items\Reactor\reactor.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="Content\Items\Tools\plasmaCutter.ogg">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="Content\Items\Tools\weldingTool.ogg">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="Content\Items\Weapons\harpoon1.ogg">
|
<None Include="Content\Items\Weapons\harpoon1.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||