Ejemplo n.º 1
0
        public override bool interact(Action.ActionArgs action)
        {
            if (action is Action.InteractEntityActionArgs)
            {
                IInteractable damager = ((Action.InteractEntityActionArgs)action).InteractedEntity;

                if (damager is Enemy)
                {
                    Enemy enemy = (Enemy)damager;
                    if (canDamage)
                    {
                        this.damageBy(enemy);
                        canDamage = false;
                        canMove   = false;
                        damageTimer.setDelay(3500, delegate() { this.canDamage = true; this.blinkTimer.resetTimer(); this.color = Color.White; });
                        moveTimer.setDelay(1000, delegate() { this.canMove = true; });
                        blinkTimer.setRepeat(75, delegate() { if (this.color.A == 255)
                                                              {
                                                                  this.color = Color.Transparent;
                                                              }
                                                              else
                                                              {
                                                                  this.color = Color.White;
                                                              } });
                    }
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public override bool interact(Action.ActionArgs action)
        {
            if (action is Action.InteractEntityActionArgs)
            {
                IInteractable damager = ((Action.InteractEntityActionArgs)action).InteractedEntity;

                if (damager is Shuriken)
                {
                    Shuriken enemy = (Shuriken)damager;
                    if (canDamage)
                    {
                        //enemy.bounce();
                        enemy.attachToEntity(this);
                        canDamage = false;
                        damageTimer.setDelay(3500, delegate() { this.canDamage = true; this.blinkTimer.resetTimer(); this.color = Color.Pink; });
                        blinkTimer.setRepeat(75, delegate() { if (this.color.A == 255)
                                                              {
                                                                  this.color = Color.Transparent;
                                                              }
                                                              else
                                                              {
                                                                  this.color = Color.Pink;
                                                              } });
                    }
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
 public static bool hasInteractingEntity(ActionArgs action)
 {
     return(action is InteractEntityActionArgs);
 }
Ejemplo n.º 4
0
 public abstract bool interact(Action.ActionArgs action);
Ejemplo n.º 5
0
 /// <summary>
 /// Odziaływanie na inny obiekt
 /// </summary>
 /// <param name="action">Akcja</param>
 public virtual bool interact(Action.ActionArgs action)
 {
     return(false);
 }
Ejemplo n.º 6
0
 public bool interact(Entity.Action.ActionArgs action)
 {
     return(false);
 }
Ejemplo n.º 7
0
 public override bool interact(Action.ActionArgs action)
 {
     throw new NotImplementedException();
 }