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
@@ -6,7 +6,7 @@
name="Lamp"
category="Electrical"
Tags="smallitem"
pickdistance="150">
>
<Sprite texture="lamp.png" sourcerect="0,0,16,32" depth="0.8"/>
@@ -26,7 +26,7 @@
name="Emergency Light"
category="Electrical"
Tags="smallitem"
pickdistance="150">
>
<Sprite texture="lamp.png" sourcerect="0,48,48,16" depth="0.8"/>
@@ -2,7 +2,7 @@
<Item
name="Monitor"
linkable="true"
pickdistance="150">
>
<Sprite texture ="monitor.png" depth="0.85"/>
@@ -4,7 +4,7 @@
name="Junction Box"
category="Electrical"
linkable="true"
pickdistance="150"
description="Serves as a hub for power distribution and relaying signals between devices.">
<Sprite texture="junctionbox.png" depth="0.8" canflipx="false"/>
@@ -40,7 +40,7 @@
name="Battery"
category="Electrical"
linkable="true"
pickdistance="150"
description="Generally used for storing backup power in case of a reactor failure.">
<Sprite texture ="battery.png" depth="0.8"/>
@@ -68,7 +68,7 @@
name="Supercapacitor"
category="Electrical"
linkable="true"
pickdistance="150"
description="Can deliver charge much faster than batteries.">
<Sprite texture ="supercapacitor.png" depth="0.8"/>
@@ -6,7 +6,7 @@
name="Wire"
category="Electrical"
Tags="smallitem,wire"
pickdistance="150"
linkable="true"
canbepicked="true"
price="10">
@@ -29,7 +29,7 @@
category="Electrical"
Tags="smallitem,wire"
spritecolor="1.0,0.0,0.0,1.0"
pickdistance="150"
linkable="true"
canbepicked="true"
price="10">
@@ -51,7 +51,7 @@
category="Electrical"
Tags="smallitem,wire"
spritecolor="0.0,0.6,1.0,1.0"
pickdistance="150"
linkable="true"
canbepicked="true"
price="10">
@@ -73,7 +73,7 @@
category="Electrical"
Tags="smallitem,wire"
spritecolor="1.0,0.5,0.0,1.0"
pickdistance="150"
linkable="true"
canbepicked="true"
price="10">
@@ -94,7 +94,7 @@
name="FPGA Circuit"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="100"
description="Field-programmable gate array - a multi-purpose circuit which can be reconfigured for use in a large variety of electrical devices.">
@@ -110,7 +110,7 @@
name="And Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends a signal when both inputs receive a signal within a set period of each other.">
@@ -145,7 +145,7 @@
name="Or Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends a signal if either of the inputs receive a signal.">
@@ -179,7 +179,7 @@
name="Not Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends a signal when the input is NOT receiving a signal.">
@@ -211,7 +211,7 @@
name="Relay Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="When switched on, forwards all received signals from the input connections to the outputs.">
@@ -257,7 +257,7 @@
name="Delay Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Delays all received signals for a specific amount of time.">
@@ -289,7 +289,7 @@
name="Light Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10">
@@ -324,7 +324,7 @@
name="Oxygen Detector"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends out a value between 0-100 depending on the quality of the surrounding air.">
@@ -355,7 +355,7 @@
name="Water Detector"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends out a signal when the detector is submerged.">
@@ -386,7 +386,7 @@
name="Signal Check Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends a signal when a signal matching a specific value is received.">
@@ -420,7 +420,7 @@
name="RegEx Find Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10"
description="Sends a signal if the received signal matches a specific regular expression pattern.">
@@ -452,7 +452,7 @@
name="Wifi Component"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="20"
description="Allows remote communication between other Wifi Components that are using the same channel.">
@@ -484,7 +484,7 @@
name="Emergency Siren"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10">
@@ -517,7 +517,7 @@
name="Alarm Buzzer"
category="Electrical"
Tags="smallitem"
pickdistance="150"
linkable="true"
price="10">
@@ -550,7 +550,7 @@
name="Camera"
category="Electrical"
Tags="smallitem"
pickdistance="150"
focusonselected="true"
offsetonselected="500"
linkable="true"