Exemple #1
0
    public void OnConsumedKey(string key_type)
    {
        //Debug.Log ("consumed key --- " + type);

        DoorControl door = null;

        do
        {
            // 열쇠에 대응하는 문을 찾는다.

            Item.KEY_COLOR key_color = Item.Key.getColorFromTypeName(key_type);

            if (key_color == Item.KEY_COLOR.NONE)
            {
                break;
            }

            door = this.doors.Find(x => x.KeyType == (int)key_color);

            if (door == null)
            {
                break;
            }

            // 언락.
            door.Unlock();

            // 연결된 문도 언락.
            if (door.connect_to != null)
            {
                door.connect_to.Unlock();
            }
        } while(false);
    }
Exemple #2
0
    private void    resolve_pick_item_query(QueryItemPick query)
    {
        do
        {
            if (!query.isSuccess())
            {
                break;
            }

            // ?꾩씠???⑤뒫留?蹂듭궗?섍퀬 ??젣?쒕떎.

            ItemController item = this.control.cmdItemPick(query, query.target);

            if (item == null)
            {
                break;
            }

            // ?④낵.
            EffectRoot.get().createItemGetEffect(this.control.getPosition());

            SoundManager.get().playSE(Sound.ID.DDG_SE_SYS02);

            switch (item.behavior.item_favor.category)
            {
            case Item.CATEGORY.CANDY:
            {
                // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆.
                this.item_slot.candy.favor = item.behavior.item_favor.clone();

                ItemWindow.get().setItem(Item.SLOT_TYPE.CANDY, 0, this.item_slot.candy.favor);

                // ?룹쓽 ?쇱젙?쒓컙 ?뚯썙??					this.startShotBoost();
            }
            break;

            case Item.CATEGORY.SODA_ICE:
            case Item.CATEGORY.ETC:
            {
                // 鍮??щ’???꾩씠???ㅼ젙.
                int slot_index = this.item_slot.getEmptyMiscSlot();

                if (slot_index >= 0)
                {
                    this.item_slot.miscs[slot_index].item_id = query.target;
                    this.item_slot.miscs[slot_index].favor   = item.behavior.item_favor.clone();

                    // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆.
                    ItemWindow.get().setItem(Item.SLOT_TYPE.MISC, slot_index, this.item_slot.miscs[slot_index].favor);
                }
            }
            break;

            case Item.CATEGORY.FOOD:
            {
                // 泥대젰 ?뚮났.
                if (GameRoot.get().isNowCakeBiking())
                {
                    this.control.vital.healFullInternal();
                }
                else
                {
                    this.control.vital.healFull();

                    // ?덉씤蹂댁슦 移쇰윭 ?④낵.
                    this.skin_color_control.startHealing();
                }

                // 泥대젰 ?뚮났???뚮┝.
                CharacterRoot.get().NotifyHitPoint(this.getAcountID(), this.control.vital.getHitPoint());

                // ?꾩씠???먭린瑜??뚮┝.
                this.control.cmdItemDrop(query.target);

                // 耳€?댄겕瑜?癒뱀? ??耳€?댄겕 臾댄븳?쒓났??.
                this.cake_count++;
            }
            break;

            // 諛??댁뇿.
            case Item.CATEGORY.KEY:
            {
                PartyControl.get().getLocalPlayer().control.consumeKey(item);

                Item.KEY_COLOR key_color = Item.Key.getColorFromInstanceName(item.name);

                // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆.
                if (key_color != Item.KEY_COLOR.NONE)
                {
                    ItemWindow.get().setItem(Item.SLOT_TYPE.KEY, (int)key_color, item.behavior.item_favor);
                }
            }
            break;

            // ?뚮줈???대룞 臾??댁뇿.
            case Item.CATEGORY.FLOOR_KEY:
            {
                MapCreator.getInstance().UnlockBossDoor();

                // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆.
                ItemWindow.get().setItem(Item.SLOT_TYPE.FLOOR_KEY, 0, item.behavior.item_favor);
            }
            break;

            case Item.CATEGORY.WEAPON:
            {
                // ??蹂€寃??€??諛쒖뭏 / ?좎옄 ??깂).
                SHOT_TYPE shot_type = Item.Weapon.getShotType(item.name);

                if (shot_type != SHOT_TYPE.NONE)
                {
                    this.changeBulletShooter(shot_type);
                }
            }
            break;
            }

            item.vanish();
        } while(false);

        query.set_expired(true);
    }
Exemple #3
0
    private void    resolve_pick_item_query(QueryItemPick query)
    {
        do
        {
            if (!query.isSuccess())
            {
                break;
            }

            // 아이템 효능만 복사하고 삭제한다.

            ItemController item = this.control.cmdItemPick(query, query.target);

            if (item == null)
            {
                break;
            }

            // 효과.
            EffectRoot.get().createItemGetEffect(this.control.getPosition());

            SoundManager.get().playSE(Sound.ID.DDG_SE_SYS02);

            switch (item.behavior.item_favor.category)
            {
            case Item.CATEGORY.CANDY:
            {
                // 아이템 창에 아이콘 표시.
                this.item_slot.candy.favor = item.behavior.item_favor.clone();

                ItemWindow.get().setItem(Item.SLOT_TYPE.CANDY, 0, this.item_slot.candy.favor);

                // 샷의 일정시간 파워업
                this.startShotBoost();
            }
            break;

            case Item.CATEGORY.SODA_ICE:
            case Item.CATEGORY.ETC:
            {
                // 빈 슬롯에 아이템 설정.
                int slot_index = this.item_slot.getEmptyMiscSlot();

                if (slot_index >= 0)
                {
                    this.item_slot.miscs[slot_index].item_id = query.target;
                    this.item_slot.miscs[slot_index].favor   = item.behavior.item_favor.clone();

                    // 아이템 창에 아이콘 표시.
                    ItemWindow.get().setItem(Item.SLOT_TYPE.MISC, slot_index, this.item_slot.miscs[slot_index].favor);
                }
            }
            break;

            case Item.CATEGORY.FOOD:
            {
                // 체력 회복.
                if (GameRoot.get().isNowCakeBiking())
                {
                    this.control.vital.healFullInternal();
                }
                else
                {
                    this.control.vital.healFull();

                    // 레인보우 칼러 효과.
                    this.skin_color_control.startHealing();
                }

                // 체력 회복을 알림.
                CharacterRoot.get().NotifyHitPoint(this.getAcountID(), this.control.vital.getHitPoint());

                // 아이템 폐기를 알림.
                this.control.cmdItemDrop(query.target);

                // 케이크를 먹은 수(케이크 무한제공용).
                this.cake_count++;
            }
            break;

            // 방 열쇠.
            case Item.CATEGORY.KEY:
            {
                PartyControl.get().getLocalPlayer().control.consumeKey(item);

                Item.KEY_COLOR key_color = Item.Key.getColorFromInstanceName(item.name);

                // 아이템 창에 아이콘 표시.
                if (key_color != Item.KEY_COLOR.NONE)
                {
                    ItemWindow.get().setItem(Item.SLOT_TYPE.KEY, (int)key_color, item.behavior.item_favor);
                }
            }
            break;

            // 플로어 이동 문 열쇠.
            case Item.CATEGORY.FLOOR_KEY:
            {
                MapCreator.getInstance().UnlockBossDoor();

                // 아이템 창에 아이콘 표시.
                ItemWindow.get().setItem(Item.SLOT_TYPE.FLOOR_KEY, 0, item.behavior.item_favor);
            }
            break;

            case Item.CATEGORY.WEAPON:
            {
                // 샷 변경(대파 발칸 / 유자 폭탄).
                SHOT_TYPE shot_type = Item.Weapon.getShotType(item.name);

                if (shot_type != SHOT_TYPE.NONE)
                {
                    this.changeBulletShooter(shot_type);
                }
            }
            break;
            }

            item.vanish();
        } while(false);

        query.set_expired(true);
    }