Updated and refactored how items and characters are chosen for interactions in the world. The new system has more precision, with items under the cursor taking priority (this helps with small items which are in front of large items). A new method CanInteractWith(Item) has been added to the Character class which does all validation of interaction with items, including new distance calculations based on bounding boxes. This gives more consistency in selecting and interacting with all sizes and shapes of items. Because of this pickdistance (not interactdistance) has been removed from all item configurations (in their XML config files) and the default InteractDistance for all items is now 120.

This commit is contained in:
Faerdan
2017-06-18 22:30:54 +01:00
parent 5cd2a5a838
commit a09367c78f
45 changed files with 483 additions and 476 deletions
@@ -2,7 +2,7 @@
<Item
name="Captain's Cap"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="A token of the Captain's unquestionable authority.">
@@ -18,7 +18,7 @@
<Item
name="Captain's Jacket"
category="Equipment"
pickdistance="150"
tags="smallitem">
<Sprite texture ="captainLegs.png" sourcerect="0,49,52,17" depth="0.6"/>
@@ -39,7 +39,7 @@
<Item
name="Captain's Trousers"
category="Equipment"
pickdistance="150"
tags="smallitem">
<Sprite texture ="captainLegs.png" sourcerect="0,67,51,13" depth="0.6"/>
@@ -2,7 +2,7 @@
<Item
name="Health Scanner HUD"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="A heads-up display that displays information of the vital signs and status of nearby humans.">
@@ -20,7 +20,7 @@
<Item
name="Doctor's Coat"
category="Equipment"
pickdistance="150"
tags="smallitem">
<Sprite texture ="doctorgear.png" sourcerect="75,0,53,18" depth="0.6"/>
@@ -45,7 +45,7 @@
<Item
name="Doctor's Trousers"
category="Equipment"
pickdistance="150"
tags="smallitem">
<Sprite texture ="doctorgear.png" sourcerect="76,19,51,13" depth="0.6"/>
@@ -2,7 +2,7 @@
<Item
name="Orange Jumpsuit"
category="Equipment"
pickdistance="150"
tags="smallitem"
fireproof="true"
description="The fire-resistant fabric offers some protection against fires. Plenty of pockets for carrying any extra gear an engineer might need.">
@@ -30,7 +30,7 @@
<Item
name="Blue Jumpsuit"
category="Equipment"
pickdistance="150"
tags="smallitem"
fireproof="true"
description="The fire-resistant fabric offers some protection against fires. Plenty of pockets for carrying any extra gear a mechanic might need.">
+3 -3
View File
@@ -2,7 +2,7 @@
<Item
name="Headset"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="Allows remote communication between the crew.">
@@ -28,7 +28,7 @@
<Item
name="Clown Mask"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="Praise the honkmother.">
@@ -44,7 +44,7 @@
<Item
name="Clown Costume"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="Praise the honkmother.">
@@ -2,7 +2,7 @@
<Item
name="Body Armor"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="While the body armor won't offer adequate protection against most of the inhabitants of the subsurface ocean, it can be extremely useful if there are traitors on board.">
@@ -20,7 +20,7 @@
<Item
name="Ballistic Helmet"
category="Equipment"
pickdistance="150"
tags="smallitem"
description="While the helmet won't offer adequate protection against most of the inhabitants of the subsurface ocean, it can be extremely useful if there are traitors on board.">
@@ -41,7 +41,7 @@
<Item
name="Handcuffs"
category="Equipment"
pickdistance="150"
tags="smallitem" >
<Sprite texture = "securitygear.png" sourcerect="0,63,32,14" depth="0.6"/>