public CFibreReg SpawnItem(CFibre Fibre, int ArgCount)
    {
        if (ArgCount < 5)
        {
            return(null);
        }
        bool   match    = true;
        int    ownerId  = Fibre.GetInt(0, ref match);
        string itemName = Fibre.GetString(1, ref match);
        int    posX     = Fibre.GetInt(2, ref match);
        int    posY     = Fibre.GetInt(3, ref match);
        int    rot      = Fibre.GetInt(4, ref match);

        if (match)
        {
            CItem item = _world.SpawnItem(CGame.AssetManager.GetAsset <CItemAsset>(itemName), new Vector2(posX, posY), rot, ownerId);
            return(new CFibreReg(item.mID));
        }

        return(new CFibreReg(0));
    }
    public CFibreReg SetPopulationCap(CFibre Fibre, int ArgCount)
    {
        if (ArgCount < 1)
        {
            return(null);
        }
        bool match = true;
        int  value = Fibre.GetInt(0, ref match);

        if (match)
        {
            _world.mPopCap = value;
        }
        return(null);
    }
    public CFibreReg SetFailSeconds(CFibre Fibre, int ArgCount)
    {
        if (ArgCount < 1)
        {
            return(null);
        }
        bool match = true;
        int  value = Fibre.GetInt(0, ref match);

        if (match)
        {
            _world.mFailSeconds = value;
        }
        return(null);
    }
    public CFibreReg SetWinMoney(CFibre Fibre, int ArgCount)
    {
        if (ArgCount < 1)
        {
            return(null);
        }
        bool match = true;
        int  value = Fibre.GetInt(0, ref match);

        if (match)
        {
            _world.mWinMoney = value;
        }
        return(null);
    }
    public CFibreReg SetPlayerMoney(CFibre Fibre, int ArgCount)
    {
        if (ArgCount > 1)
        {
            bool match    = true;
            int  playerId = Fibre.GetInt(0, ref match);

            if (ArgCount == 1)
            {
                return(new CFibreReg(_world.mPlayers[playerId].mMoney));
            }
            else
            {
                int value = Fibre.GetInt(1, ref match);

                if (match)
                {
                    _world.mPlayers[playerId].mMoney = value;
                }
            }
        }

        return(null);
    }
    public CFibreReg SetUnitSpeech(CFibre Fibre, int ArgCount)
    {
        if (ArgCount == 2)
        {
            bool   match  = true;
            int    unitId = Fibre.GetInt(0, ref match);
            string text   = Fibre.GetString(1, ref match);

            if (match)
            {
                CUnit unit = _world.GetEntity <CUnit>(unitId);

                if (unit != null)
                {
                    unit.SetSpeech(text);
                }
            }
        }

        return(null);
    }
    public CFibreReg SetItemAvailable(CFibre Fibre, int ArgCount)
    {
        if (ArgCount == 3)
        {
            bool   match     = true;
            int    playerId  = Fibre.GetInt(0, ref match);
            string itemName  = Fibre.GetString(1, ref match);
            bool   available = Fibre.GetBool(2, ref match);

            if (match)
            {
                if (available)
                {
                    _world.mPlayers[playerId].mAvailableItems.Add(itemName);
                }
                else
                {
                    _world.mPlayers[playerId].mAvailableItems.Remove(itemName);
                }
            }
        }

        return(null);
    }