1. Список говнокодов пользователя kyzi007

    Всего: 128

  2. ActionScript / Говнокод #13226

    −143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    public class PreloaderMediator extends Mediator {
    
    private var myProgress:int;
    private function setProgress(progress:Number = 0):void {
        //progress was taken from Lib
        myProgress +=int(Math.random()*3 + 0.5); //ahahahah
        myProgress = Math.min(myProgress, 100);
        percentTxt.text = '' + myProgress + '%';
    }

    kyzi007, 24 Июня 2013

    Комментарии (10)
  3. ActionScript / Говнокод #13207

    −157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    override public function handleNotification(notification:INotification):void {
        super.handleNotification(notification);
        var name:String = notification.getName();
        if (name == EnemyNotifications.ENEMY_ADDED && !_enemy) {
            _enemy = Core.getObjectMediator(notification.getBody().id);
        }
    
        if (name == UINotifications.CLOSE_CURRENT_WINDOW && _enemy && !_started) {
            _win++;
            if (_win == 2) {
                start();
            }
    
        }
    
        if (name == EnemyNotifications.CLEAR_INTERACT_AREA && !_finished) {
            finish();
        }
    }

    Десять дней до релиза...

    kyzi007, 21 Июня 2013

    Комментарии (16)
  4. ActionScript / Говнокод #13137

    −132

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    public var view:LevelView;
    ...
    public function removeListeners():void {
        var view:LevelView = this.view;
        ...
    }

    Коллега говорит - бестпрактис. Я говорю - заебали строчки плодить.

    kyzi007, 10 Июня 2013

    Комментарии (11)
  5. ActionScript / Говнокод #13129

    −170

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    public function set flip(value:Boolean):void {
        if (this.object.flip != value) {
            this.object.flip = value;
            this.clearCells();
            var cell:Cell = this.cell;
        }
    }
    
    public function get cell():Cell {
        if (!this._cell) {
            createCell();
        }
        return this._cell;
    }

    Ненавижу подергивание.

    kyzi007, 07 Июня 2013

    Комментарии (40)
  6. ActionScript / Говнокод #12994

    −159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    internal override function createTweens($target:Object, $property:String, $duration:Number):Array {
        var pa:Array = getOrderedLabels();
        var ta:Array = [];
        //skip begin point (i=1), it gets set and doesn't need to be tweened to initial value
        for (var i:int = 1; i < pa.length; i++) {
            //if null, sets it to starting value
            var np:Object = this[pa[i]];
            var nv:*;
            if(np.value == 'none' && np.extras.type == 'tint'){
                np.extras.type = 'clear';
            } else {
                var nuv:*;
                if(np.value == null){
                    if($property == null){
                        var tc:* = $target.transform.colorTransform.color;
                        if(tc == 0){
                            nuv = null;
                            np.extras.type = 'clear';
                        } else {
                            nuv = tc;
                        }
                    } else {
                        nuv = $target[$property];
                    }
                } else nuv = np.value;
                nv = (np.spread != '0') ? RandomColor.fromRange(nuv, np.spread) : nuv;
            }
            var tmo:Object = {target:$target, property:$property, value:nv, ease:np.ease, duration:calculateDuration($duration, this[pa[i-1]].position, np.position), delay:0};
            for (var h:String in np.extras) {
                tmo[h] = np.extras[h];
            }
            ta.push(tmo);
        }
        return ta;
    }

    Ищу совсем бесплатный и опенсорсный твиннер. Нигодую.

    kyzi007, 13 Мая 2013

    Комментарии (12)
  7. ActionScript / Говнокод #12958

    −93

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    private function showTick():void {
        d=getTimer() - startT;
        if (d<ACT_TIME) {
            if(d<=200){
                //scale up
                sprite.scaleX = 0.3+(d/200)*0.7;
                sprite.scaleY = 0.3+(d/200)*0.7;
            }else if(d>200 && d<500){
                sprite.scaleX = 1;
                sprite.scaleY = 1;
            }
            if(d<=300){
                sprite.alpha = d/300;
                //alpha up
            }else if(d>300 && d<500){
                sprite.alpha = 1;
            }
            if(d>=500 && d<=800){
                //scale down
                sprite.scaleX = 1-((d-500)/300);
                sprite.scaleY = 1-((d-500)/300);
                sprite.alpha = 1-((d-500)/300);
            }else if(d>800){
                sprite.scaleX = 0;
                sprite.scaleY = 0;
                sprite.alpha = 0;
            }
    
        }else {
            EnterFrame.removeAction(this._action);
            this._action = null;
        }
    }

    Хотела поменять скорость анимации текста... Уже не хочу.

    kyzi007, 01 Мая 2013

    Комментарии (13)
  8. ActionScript / Говнокод #12753

    −84

    1. 1
    public static function get(cls:Class):IReusable

    И ошибка парсинга в глазах

    kyzi007, 15 Марта 2013

    Комментарии (4)
  9. ActionScript / Говнокод #12741

    −114

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    private static const COST_DELTA:Array = [
        {d:5,c:0},
        {d:10,c:500},
        {d:15,c:1000},
        {d:20,c:2000},
        {d:25,c:3500},
        {d:30,c:5000},
        {d:35,c:7500},
        {d:40,c:10000},
        {d:45,c:15000}
    ];
    
    private var _cost:int = -1;
    private static const HARDCODED_FRIENDS:Set = new Set(['yorick']);
    override public function get cost():int {
        if (HARDCODED_FRIENDS.find(this.id)) {
            return 0;
        }
        var playerLevel:int = Player.instance.playerLevel;
        var delta:int = Math.max(this.level - playerLevel, 0);
        for each (var cost:Object in COST_DELTA) {
            var num:int = cost['d'];
            if (num > delta) {
                break;
            }
        }
        return cost['c'];
    }
    
    // Player
    
    public function get playerLevel() : int {
        return 0;//this.getResource(Resources.LEVEL).quantity;
    }

    kyzi007, 13 Марта 2013

    Комментарии (135)
  10. ActionScript / Говнокод #12740

    −114

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    override public function get name():String {
        if (!this._name) {
            var fullName:String = this.data[FULL_NAME];
            var firstName:String = this.data[FIRST_NAME];
            var lastName:String = this.data[LAST_NAME];
    
            if (fullName) {
                if (fullName == "Yorick") {
                    this._name = Translations.instance.getString(fullName);
                } else {
                    this._name = fullName;
                }
            } else {
                var split:Array = [];
                if (firstName) {
                    split.push(firstName);
                }
                if (lastName) {
                    split.push(lastName);
                }
                this._name = split.join(' ');
            }
        }
        return this._name;
    }

    Люблю свою работу.
    Даже выпиливать не буду.

    kyzi007, 13 Марта 2013

    Комментарии (5)
  11. ActionScript / Говнокод #12687

    −118

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    override public function onRemove() : void {
        super.onRemove();
        var status : String = this.status;
        var index : int = questList.indexOf(this);
        var questList : Vector.<Quest> = Quest[status];
    
        questList.splice(index, 1);
    }

    Судя по тому что проект не падает квесты не удаляются...

    kyzi007, 04 Марта 2013

    Комментарии (20)