示例#1
0
 //-----------------------------------------------------------------------------
 // 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;
 }
示例#2
0
 public void Initialize(Unit unit)
 {
     this.unit = unit;
     OnInitialize();
 }
示例#3
0
 //-----------------------------------------------------------------------------
 // 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;
 }