1. Java / Говнокод #18754

    −54

    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
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    void go(int c) {
            int c1;
            Point startPoint = Game.soldiers.soldier_array[c].SoldierView.getLocation();
            int g = this.random.nextInt(5);
            for (c1 = 0; c1 < Game.soldiers.soldier_array.length; ++c1) {
                if (c1 == c) continue;
                if (Game.soldiers.soldier_array[c].SoldierView.getX() == Game.soldiers.soldier_array[c1].SoldierView.getX() & Game.soldiers.soldier_array[c].SoldierView.getY() + Game.side_length == Game.soldiers.soldier_array[c1].SoldierView.getY() && !Game.soldiers.soldier_array[c].fraction.equals(Game.soldiers.soldier_array[c1].fraction)) {
                    g = 0;
                }
                if (Game.soldiers.soldier_array[c].SoldierView.getX() == Game.soldiers.soldier_array[c1].SoldierView.getX() & Game.soldiers.soldier_array[c].SoldierView.getY() - Game.side_length == Game.soldiers.soldier_array[c1].SoldierView.getY() && !Game.soldiers.soldier_array[c].fraction.equals(Game.soldiers.soldier_array[c1].fraction)) {
                    g = 1;
                }
                if (Game.soldiers.soldier_array[c].SoldierView.getX() + Game.side_length == Game.soldiers.soldier_array[c1].SoldierView.getX() & Game.soldiers.soldier_array[c].SoldierView.getY() == Game.soldiers.soldier_array[c1].SoldierView.getY() && !Game.soldiers.soldier_array[c].fraction.equals(Game.soldiers.soldier_array[c1].fraction)) {
                    g = 2;
                }
                if (!(Game.soldiers.soldier_array[c].SoldierView.getX() - Game.side_length == Game.soldiers.soldier_array[c1].SoldierView.getX() & Game.soldiers.soldier_array[c].SoldierView.getY() == Game.soldiers.soldier_array[c1].SoldierView.getY()) || Game.soldiers.soldier_array[c].fraction.equals(Game.soldiers.soldier_array[c1].fraction)) continue;
                g = 3;
            }
            if (g == 0 && Game.soldiers.soldier_array[c].SoldierView.getY() < Game.side_length * Game.titles_line_length - Game.side_length) {
                Game.soldiers.soldier_array[c].SoldierView.setLocation(Game.soldiers.soldier_array[c].SoldierView.getX(), Game.soldiers.soldier_array[c].SoldierView.getY() + Game.side_length);
            }
            if (g == 1 && Game.soldiers.soldier_array[c].SoldierView.getY() > 0) {
                Game.soldiers.soldier_array[c].SoldierView.setLocation(Game.soldiers.soldier_array[c].SoldierView.getX(), Game.soldiers.soldier_array[c].SoldierView.getY() - Game.side_length);
            }
            if (g == 2 && Game.soldiers.soldier_array[c].SoldierView.getX() < Game.side_length * Game.titles_line_length - Game.side_length) {
                Game.soldiers.soldier_array[c].SoldierView.setLocation(Game.soldiers.soldier_array[c].SoldierView.getX() + Game.side_length, Game.soldiers.soldier_array[c].SoldierView.getY());
            }
            if (g == 3 && Game.soldiers.soldier_array[c].SoldierView.getX() > 0) {
                Game.soldiers.soldier_array[c].SoldierView.setLocation(Game.soldiers.soldier_array[c].SoldierView.getX() - Game.side_length, Game.soldiers.soldier_array[c].SoldierView.getY());
            }
            for (c1 = 0; c1 < Game.soldiers.soldier_array.length; ++c1) {
                if (c1 == c || !(Game.soldiers.soldier_array[c1].SoldierView.getX() == Game.soldiers.soldier_array[c].SoldierView.getX() & Game.soldiers.soldier_array[c1].SoldierView.getY() == Game.soldiers.soldier_array[c].SoldierView.getY())) continue;
                Game.soldiers.soldier_array[c].SoldierView.setLocation(startPoint);
                if (Game.soldiers.soldier_array[c].fraction.equals(Game.soldiers.soldier_array[c1].fraction)) continue;
                Game.soldiers.soldier_array[c].health-=Game.soldiers.soldier_array[c1].damage;
                Game.soldiers.soldier_array[c1].health-=Game.soldiers.soldier_array[c].damage;
                if (Game.soldiers.soldier_array[c].health <= 0) {
                    Game.soldiers.soldier_array[c].SoldierView.setLocation(0, - Game.side_length);
                }
                if (Game.soldiers.soldier_array[c1].health > 0) continue;
                Game.soldiers.soldier_array[c1].SoldierView.setLocation(0, - Game.side_length);
            }
        }

    Запостил: thepotato, 23 Сентября 2015

    Комментарии (6) RSS

    • Грешно смеяться над больными людьми поделиями 14-летних школьников.
      Ответить

    Добавить комментарий