Пример #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);
        }
Пример #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);
        }
Пример #3
0
 public static bool hasInteractingEntity(ActionArgs action)
 {
     return(action is InteractEntityActionArgs);
 }
Пример #4
0
 public abstract bool interact(Action.ActionArgs action);
Пример #5
0
 /// <summary>
 /// Odziaływanie na inny obiekt
 /// </summary>
 /// <param name="action">Akcja</param>
 public virtual bool interact(Action.ActionArgs action)
 {
     return(false);
 }
Пример #6
0
 public bool interact(Entity.Action.ActionArgs action)
 {
     return(false);
 }
Пример #7
0
 public override bool interact(Action.ActionArgs action)
 {
     throw new NotImplementedException();
 }