public Item generate()
    {
        int difficulty = 1 + GameObject.Find("Game Engine").GetComponent <EngineController>().floorNum;

        slot   = (Item.Slot)Random.Range(0, 4);
        rarity = (Item.Rarity)Random.Range(0, 5);
        float rarityImprovement = 1 + ((int)rarity * 0.25f);

        switch (slot)
        {
        case Item.Slot.Head:
            bonusHealth = bellRandom(0, 10 * rarityImprovement * difficulty);
            bonusAttack = bellRandom(0, 5 * rarityImprovement * difficulty);
            break;

        case Item.Slot.Chest:
            bonusHealth = bellRandom(0, 20 * rarityImprovement * difficulty);
            break;

        case Item.Slot.Feet:
            bonusSpeed = bellRandom(0, 1 * rarityImprovement * difficulty);
            bonusJump  = bellRandom(0, 1 * rarityImprovement * difficulty);
            break;

        case Item.Slot.Sword:
            bonusAttack = bellRandom(0, 10 * rarityImprovement * difficulty);
            break;
        }
        cost = bonusSpeed * 10 + bonusJump * 15 + bonusAttack * 2 + bonusHealth;

        return(this.getItem());
    }
Beispiel #2
0
 public SaveItemClass(Item i)
 {
     this.itm_Name           = i.itm_Name;
     this.itm_Desc           = i.itm_Desc;
     this.itm_FullName       = i.itm_FullName;
     this.itm_Lore           = i.itm_Lore;
     this.itm_Type           = i.itm_Type;
     this.itm_Slot           = i.itm_Slot;
     this.itm_Value          = i.itm_Value;
     this.itm_Quality        = i.itm_Quality;
     this.itm_AttackBonus    = i.itm_AttackBonus;
     this.itm_MinDamage      = i.itm_MinDamage;
     this.itm_MaxDamage      = i.itm_MaxDamage;
     this.itm_DefenseBonus   = i.itm_DefenseBonus;
     this.itm_MaxCharges     = i.itm_MaxCharges;
     this.itm_MaxFuel        = i.itm_MaxFuel;
     this.itm_Icon           = i.itm_Icon;
     this.itm_ID_Quality     = i.itm_ID_Quality;
     this.itm_ID_Damage      = i.itm_ID_Damage;
     this.itm_ID_Defense     = i.itm_ID_Defense;
     this.itm_ID_Charges     = i.itm_ID_Charges;
     this.itm_ID             = i.itm_ID;
     this.itm_Active         = i.itm_Active;
     this.itm_CurrentCharges = i.itm_CurrentCharges;
     this.itm_CurrentFuel    = i.itm_CurrentFuel;
 }
Beispiel #3
0
    void    Update()
    {
        // ---------------------------------------------------------------- //

        if (this.player == null)
        {
            this.player = PartyControl.getInstance().getLocalPlayer();
        }

        // ---------------------------------------------------------------- //

        // 아이템 아이콘(슬롯)을 클릭했을 때.
        if (this.clicked_slot >= 0)
        {
            GameInput gi = GameInput.getInstance();

            if (gi.pointing.trigger_off)
            {
                do
                {
                    // 아이템 사용 중.
                    if (this.player.step.get_next() == chrBehaviorLocal.STEP.USE_ITEM)
                    {
                        break;
                    }

                    Item.Slot slot = this.player.item_slot.miscs[this.clicked_slot];

                    if (slot.favor == null)
                    {
                        break;
                    }

                    // 사용 중인 아이템(조작은 할 수 있게 됐지만 슬롯에서는 아직.
                    // 삭제되지 않은 때).
                    if (slot.is_using)
                    {
                        break;
                    }

                    this.player.control.cmdUseItemSelf(this.clicked_slot, slot.favor, true);

                    SoundManager.getInstance().playSE(Sound.ID.DDG_SE_SYS03);
                } while(false);

                this.clicked_slot = -1;
            }
        }
    }
Beispiel #4
0
	public List<Slot>	miscs;		// 범용.

	public SlotArray()
	{
		this.candy = new Slot();
		this.miscs = new List<Slot>();

		for(int i = 0;i < MISC_NUM;i++) {

			this.miscs.Add(new Slot());
		}
	}