Ejemplo n.º 1
0
 public void ActionX(int i, LivingObject o)
 {
     if (actionbarSlots[i].Item != null)
     {
         actionbarSlots[i].Item.Action(actionbarSlots[i].Item, o);
     }
 }
Ejemplo n.º 2
0
        //public void HitOtherObject(LivingObject target)
        //{
        //    target.Health -= Damage;
        //    target.Push(Position - target.Position, KnockbackPower);
        //    target.IsHit = true;

        //    DidAttack();
        //}

        public void GetHitBy(LivingObject damageSource)
        {
            Nemesis = damageSource;
            //NemesisTimer = 20;
            ModifyResourceValue("hp", -damageSource.Damage);
            Push(damageSource.Position - Position, damageSource.KnockbackPower);
            IsHit      = true;
            IsInCombat = true;
            //textList.Add(new DynamicText(ScreenManager.DebugFont, Position, Size, new Vector2(0, -1), 10f, Color.DarkRed, "-" + damageSource.Damage.ToString()) { TextShader = true });
            damageSource.OnAttack();
        }
Ejemplo n.º 3
0
        public void Use(Item item, LivingObject o)
        {
            var i = item.GetItem <Usable>();

            switch (i.type)
            {
            case UsableType.HealthPot:
                if (o.Health >= o.MaxHealth)
                {
                    Console.WriteLine("full hp");
                    return;
                }
                Console.WriteLine("hp restored: " + i.Value);
                o.ModifyResourceValue("hp", i.Value);
                break;

            case UsableType.ManaPot:
                o.Mana += i.Value;
                break;
            }
            i.Exist = false;
        }
Ejemplo n.º 4
0
        public void Action(Item item, LivingObject player)
        {
            switch (item.Type)
            {
            case ItemType.Usable:
                GetItem <Usable>().Use(item, player);

                break;

            case ItemType.Weapon:
                //GetItem<Weapon>().Use();

                break;

            case ItemType.Armor:
                //GetItem<Armor>().Use();

                break;

            default:
                break;
            }
        }