//----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- public UnitTool() { unit = null; drawAboveUnit = false; animationPlayer = new AnimationPlayer(); collisionBox = new Rectangle2I(-1, -1, 2, 2); toolType = UnitToolType.Visual; isEquipped = false; isPhysicsEnabled = true; imageVariantID = GameData.VARIANT_NONE; syncAnimationWithDirection = true; }
public void Initialize(Unit unit) { this.unit = unit; OnInitialize(); }
//----------------------------------------------------------------------------- // Virtual Methods //----------------------------------------------------------------------------- public virtual void OnParry(Unit other, Vector2F contactPoint) { }
public override void OnParry(Unit other, Vector2F contactPoint) { // Stab if holding sword. if (Player.CurrentState == Player.HoldSwordState) Player.HoldSwordState.Stab(true); else if (Player.CurrentState == Player.SwingSwordState) Player.SwingSwordState.AllowSwordHold = false; }