Beispiel #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="p"></param>
    public void Init(Player p)
    {
        player         = p;
        UsableSelected = new AbstractUsable();
        ItemMenu       = new ScrollNavigator <AbstractUsable, AbstractAbility>();
        SelectionName  = "Attack";
        SelectionMenu  = new Navigator();
        ItemMenu.Init(new Vector3(-76, 40), new Vector3(-33, 40), new Vector3(92, -11), -24, 0, 4, GameObject.Find("List Panel").transform.FindChild("Arrow2").gameObject, GameObject.Find("List Panel").transform.FindChild("NextArrow").gameObject, GameObject.Find("List Panel").transform.FindChild("PrevArrow").gameObject, GameObject.Find("List Panel"));
        GameObject SelectPanel = GameObject.Find("Select Panel");

        Message = GameObject.Find("Message");
        List <GameObject> SelectItem = new List <GameObject>();

        GameObject.Find("List Panel").transform.FindChild("Quantity").gameObject.SetActive(false);
        for (int i = 0; i < SelectPanel.transform.childCount; i++)
        {
            GameObject ic = SelectPanel.transform.GetChild(i).gameObject;
            if (!ic.name.Contains("Arrow"))
            {
                SelectItem.Add(ic);
            }
        }
        SelectionMenu.Init(GameObject.Find("Arrow3"), SelectItem);
        ItemMenu.HideList();
    }
Beispiel #2
0
    public List <AbstractUsable> getItem()
    {
        List <AbstractUsable> returnVal = new List <AbstractUsable>();

        foreach (var i in this.BattleEnemy.Data.Items)
        {
            if (i.ApplyRate >= UnityEngine.Random.Range(1, 100))
            {
                AbstractUsable newVal = new AbstractUsable();
                newVal.AreaOfEffect = i.Element.AreaOfEffect;
                newVal.Attribute    = i.Element.Attribute;
                newVal.Available    = i.Element.Available;
                newVal.Available    = i.Element.Available;
                newVal.Description  = i.Element.Description;
                newVal.HitRate      = i.Element.HitRate;
                newVal.Image        = i.Element.Image;
                newVal.ItemName     = i.Element.ItemName;
                newVal.KeyItem      = i.Element.KeyItem;
                newVal.Power        = i.Element.Power;
                newVal.Price        = i.Element.Price;
                newVal.States       = i.Element.States;
                newVal.StateType    = i.Element.StateType;
                returnVal.Add(newVal);
            }
        }
        return(returnVal);
    }
Beispiel #3
0
 public void UseItem(AbstractUsable UsableSelected)
 {
     ActionSelected = Actions.Usable;
     SELECTIONMODE  = true;
     UsableToUse    = UsableSelected;
     if (UsableToUse.AreaOfEffect == Constant.AOE.OneEnemy)
     {
         ActiveSelector();
     }
 }
Beispiel #4
0
 /// <summary>
 /// Inserta un usable en el inventorio
 /// </summary>
 /// <param name="u">Usable a insertar</param>
 public void InsertUsable(AbstractUsable u)
 {
     if (Usables.ContainsKey(u.ItemName))
     {
         Usables[u.ItemName].Second++;
     }
     else
     {
         Usables[u.ItemName] = new Tuple <AbstractUsable, int>(u, 1);
     }
 }
Beispiel #5
0
    /// <summary>
    /// Retorna la lista de usables y su cantidad
    /// </summary>
    /// <returns></returns>
    public List <Tuple <AbstractUsable, int> > GetUsables()
    {
        List <Tuple <AbstractUsable, int> > returnList = new List <Tuple <AbstractUsable, int> >();

        foreach (string key in Usables.Keys)
        {
            AbstractUsable i    = Usables[key].First;
            int            cant = Usables[key].Second;
            returnList.Add(new Tuple <AbstractUsable, int>(i, cant));
        }
        return(returnList);
    }
Beispiel #6
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="selected"></param>
    public override void On(Item selected)
    {
        UsableSelected = selected as AbstractUsable;
        switch (MenuSelection)
        {
        case 0:
            break;

        case 1:
            GameObject.Find("Description").GetComponent <Text>().text = "Attribute affected " + UsableSelected.Attribute.ToString() + " " + UsableSelected.Power.ToString() + ", " + UsableSelected.AreaOfEffect.ToString() + "." + UsableSelected.Description;
            break;

        default:
            break;
        }
    }
Beispiel #7
0
 public Rate()
 {
     Element = new AbstractUsable();
 }
Beispiel #8
0
 public Usable()
 {
     Data = new AbstractUsable();
 }
Beispiel #9
0
 public Pickup()
 {
     ItemUsable = new AbstractUsable();
     ItemArmor  = new AbstractArmor();
     ItemWeapon = new AbstractWeapon();
 }
Beispiel #10
0
 public void Initialize(ref AbstractUsable item)
 {
     UsableSelected = item;
     Init();
 }