예제 #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();
 }