Merge pull request #906 from Clyybber/fix#673

This commit is contained in:
Pieter-Jan Briers
2020-05-11 14:13:43 +02:00
committed by GitHub
2 changed files with 6 additions and 7 deletions

View File

@@ -28,12 +28,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
[Dependency] private readonly IPhysicsManager _physicsManager;
#pragma warning restore 649
private int _damage = 1;
private float _range = 1;
private float _arcWidth = 90;
private int _damage;
private float _range;
private float _arcWidth;
private string _arc;
private string _hitSound;
private float _cooldownTime = 1f;
private float _cooldownTime;
[ViewVariables(VVAccess.ReadWrite)]
public string Arc
@@ -122,9 +122,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
private HashSet<IEntity> ArcRayCast(Vector2 position, Angle angle, IEntity ignore)
{
// Maybe make this increment count depend on the width/length?
const int increments = 5;
var widthRad = Angle.FromDegrees(ArcWidth);
var increments = 1 + (35 * (int) Math.Ceiling(widthRad / (2 * Math.PI)));
var increment = widthRad / increments;
var baseAngle = angle - widthRad / 2;

View File

@@ -13,7 +13,7 @@
- type: MeleeWeapon
range: 1.5
arcwidth: 10
arcwidth: 0
arc: spear
- type: Item