Example #1
0
        public static void Execute(ScriptDescription script, object value)
        {
            switch (script)
            {
            case ScriptDescription.GivePlayerGold:
                int gold = 0;
                if (int.TryParse(value.ToString(), out gold))
                {
                    Global.Player.Info.Gold += gold;
                }
                SoundPlayer.PlaySound(Sound.PickupCoins);
                break;

            case ScriptDescription.HealPlayer:
                int health;
                if (int.TryParse(value.ToString(), out health))
                {
                    Global.Player.Info.Health += health;
                }
                break;
            }
        }
Example #2
0
 public static void EditTile(int type, Texture2D texture, float scale, float layerDepth, bool walkable, bool destructs,
                             bool isObject, bool isDoor, bool isItem, string name, string description, ScriptDescription script, object parameter, int goldValue)
 {
     if (_tileInfo.ContainsKey(type))
     {
         _tileInfo[type]._tileType      = type;
         _textures[type]                = texture;
         _tileInfo[type]._scale         = scale;
         _tileInfo[type]._layerDepth    = layerDepth;
         _tileInfo[type]._walkable      = walkable;
         _tileInfo[type]._useOnInteract = destructs;
         _tileInfo[type]._isObject      = isObject;
         _tileInfo[type]._isDoor        = isDoor;
         _tileInfo[type]._isPickupItem  = isItem;
         _tileInfo[type]._name          = name;
         _tileInfo[type]._description   = description;
         _tileInfo[type]._script        = script;
         _tileInfo[type]._parameter     = parameter;
         _tileInfo[type]._goldValue     = goldValue;
     }
 }
Example #3
0
        public static void AddTile(int type, Texture2D texture, float layerDepth, bool walkable, bool destructs,
                                   bool isObject, bool isDoor, bool isItem, string name, ScriptDescription script, object parameter, int goldValue)
        {
            TileInfo tileInfo = new TileInfo();

            tileInfo._tileType = type;
            _textures.Add(texture);
            tileInfo._layerDepth    = layerDepth;
            tileInfo._walkable      = walkable;
            tileInfo._useOnInteract = destructs;
            tileInfo._isObject      = isObject;
            tileInfo._isDoor        = isDoor;
            tileInfo._isPickupItem  = isItem;
            tileInfo._name          = name;
            tileInfo._script        = script;
            tileInfo._parameter     = parameter;
            tileInfo._goldValue     = goldValue;
            _tileInfo[type]         = tileInfo;
        }