Пример #1
0
    public override void OnFinished(MainSystem sys)
    {
        Loc prevLoc = _player.Loc;

        Actor.UpdateLoc(_nextLoc);

        Room prev = sys.FindRoom(prevLoc);
        Room next = sys.FindRoom(_nextLoc);

        Debug.LogFormat("--> {0} -> {1}", prevLoc, _nextLoc);

        if (prev != null && next != null)   // 部屋内の移動
        {
            sys.OnRoomMoved(next, _nextLoc);
        }
        if (prev == null && next != null)   // 部屋に入った
        {
            sys.OnRoomEntered(next, _nextLoc);
        }
        else if (prev != null && next == null)   // 部屋から通路に出た
        {
            sys.OnRoomExited(prev, _nextLoc);
        }
        else
        {
            sys.OnPassageMoved(_nextLoc); // 通路を移動した
        }

        if (_fieldItem != null)
        {
            Item item = _fieldItem.Item;
            sys.Msg_TakeItem(item);
            if (item.Type == ItemType.Gold)
            {
                sys.IncGold(100);
            }
            else
            {
                // TODO:持ち物がいっぱいなら拾えない
                _player.AddItem(item);
            }
            sys.RemoveFieldItem(_fieldItem);
        }

        sys.UpdateMinimap();
    }
Пример #2
0
    public override void OnFinished(MainSystem sys)
    {
        Debug.LogFormat("アイテムを拾いました:{0}", _fieldItem);

        // TODO:ActPlayerMoveのアイテムを拾う処理と重複
        Item item = _fieldItem.Item;

        if (item.Type == ItemType.Gold)
        {
            Debug.LogFormat("{0} G 手に入れた", 100);
            sys.IncGold(100);
        }
        else
        {
            // TODO:持ち物がいっぱいなら拾えない
            ((Player)Actor).AddItem(item);
        }
        sys.RemoveFieldItem(_fieldItem);
    }