Adds crowbar function to force-open doors...
***except the Door component ignores the damn requireditem and allows bare fukken hands to open it goddamnit***
This commit is contained in:
@@ -7,7 +7,7 @@ using System;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class Door : ItemComponent, IDrawableComponent, IServerSerializable
|
||||
partial class Door : Pickable, IDrawableComponent, IServerSerializable
|
||||
{
|
||||
private ConvexHull convexHull;
|
||||
private ConvexHull convexHull2;
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
<Sprite texture ="door.png" sourcerect="1,0,48,208" depth="0.01" origin="0.5,0.5"/>
|
||||
|
||||
<Door canbeselected="true">
|
||||
<Door canbeselected="true" selectkey="Action" msg="Force Open [Crowbar]" PickingTime="6.0">
|
||||
<requireditem name="Crowbar" type="Equipped"/>
|
||||
<Sprite texture ="door.png" sourcerect="80,0,19,208" depth="0.05" origin="0.5,0.0"/>
|
||||
<WeldedSprite texture ="door.png" sourcerect="99,0,32,188" depth="0.0" origin="0.5,0.5"/>
|
||||
<BrokenSprite texture ="door.png" sourcerect="133,0,58,208" depth="0.051" origin="0.5,0.0" scale="true"/>
|
||||
@@ -35,7 +36,8 @@
|
||||
|
||||
<Sprite texture="door.png" sourcerect="1,0,48,208" depth="0.01" origin="0.5,0.5"/>
|
||||
|
||||
<Door window="0,-32,10,75" canbeselected="true">
|
||||
<Door window="0,-32,10,75" canbeselected="true" selectkey="Action" msg="Force Open [Crowbar]" PickingTime="6.0">
|
||||
<requireditem name="Crowbar" type="Equipped"/>
|
||||
<Sprite texture="door.png" sourcerect="56,0,19,208" depth="0.05" origin="0.5,0.0"/>
|
||||
<WeldedSprite texture="door.png" sourcerect="9,0,32,188" depth="0.0" origin="0.5,0.5"/>
|
||||
<BrokenSprite texture="door.png" sourcerect="192,0,40,208" depth="0.051" origin="0.5,0.0" scale="true"/>
|
||||
@@ -64,7 +66,8 @@
|
||||
|
||||
<Sprite texture="hatch.png" sourcerect="0,0,128,46" depth="0.01" origin="0.5,0.5"/>
|
||||
|
||||
<Door canbeselected="true" horizontal="true">
|
||||
<Door canbeselected="true" horizontal="true" selectkey="Action" msg="Force Open [Crowbar]" PickingTime="6.0">
|
||||
<requireditem name="Crowbar" type="Equipped"/>
|
||||
<Sprite texture="hatch.png" sourcerect="128,0,128,19" depth="0.05" origin="0.0,0.5"/>
|
||||
<WeldedSprite texture="hatch.png" sourcerect="0,56,108,33" depth="0.0" origin="0.5,0.5"/>
|
||||
<BrokenSprite texture="hatch.png" sourcerect="128,21,128,58" depth="0.051" origin="0.0,0.5" scale="true"/>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 9.6 KiB |
@@ -175,7 +175,7 @@
|
||||
|
||||
price="10">
|
||||
|
||||
<Sprite texture ="tools.png" sourcerect="0,50,26,7" depth="0.55"/>
|
||||
<Sprite texture ="tools.png" sourcerect="0,50,26,7" depth="0.55"/>
|
||||
|
||||
<Body width="30" height="7" density="50"/>
|
||||
|
||||
@@ -185,6 +185,23 @@
|
||||
</MeleeWeapon>
|
||||
</Item>
|
||||
|
||||
<Item
|
||||
name="Crowbar"
|
||||
category="Equipment"
|
||||
Tags="smallitem"
|
||||
|
||||
price="10">
|
||||
|
||||
<Sprite texture ="tools.png" sourcerect="0,65,64,12" depth="0.55"/>
|
||||
|
||||
<Body width="60" height="10" density="50"/>
|
||||
|
||||
<MeleeWeapon slots="Any,RightHand,LeftHand"
|
||||
aimpos="50,0" handle1="-5,0" holdangle="30" reload="1.8">
|
||||
<Attack damage="15" stun="0.4" damagetype="Blunt" sound="Content/Items/Weapons/smack.ogg"/>
|
||||
</MeleeWeapon>
|
||||
</Item>
|
||||
|
||||
<Item
|
||||
name="Handheld Sonar"
|
||||
category="Equipment"
|
||||
|
||||
@@ -13,7 +13,7 @@ using Barotrauma.Lights;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class Door : ItemComponent, IDrawableComponent, IServerSerializable
|
||||
partial class Door : Pickable, IDrawableComponent, IServerSerializable
|
||||
{
|
||||
private Gap linkedGap;
|
||||
|
||||
@@ -203,12 +203,10 @@ namespace Barotrauma.Items.Components
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public override bool Pick(Character picker)
|
||||
public override bool OnPicked(Character picker)
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
|
||||
return true;
|
||||
SetState(predictedState == null ? !isOpen : !predictedState.Value, false, true); //crowbar function
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Select(Character character)
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool OnPicked(Character picker)
|
||||
public override bool OnPicked(Character picker)
|
||||
{
|
||||
if (base.OnPicked(picker))
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual bool OnPicked(Character picker)
|
||||
public virtual bool OnPicked(Character picker)
|
||||
{
|
||||
if (picker.Inventory.TryPutItem(item, picker, allowedSlots))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user