Ejemplo n.º 1
0
        private void Fix_MH2O_Info(int pos)
        {
            ushort id   = adt.ReadUShort(pos);
            ushort type = adt.ReadUShort(pos + 0x2);

            if (id > 100)
            {
                switch (id)
                {
                case 181:
                case 221:
                case 301:
                case 406:
                case 407:
                case 411:
                case 689:
                case 733:
                case 750:
                case 751:
                case 752:
                case 760:
                case 761:
                case 763:
                case 764:
                case 765:
                case 787:
                case 805:
                case 806:
                case 807:
                case 808:
                case 809:
                case 812:
                case 814:
                case 834:
                case 837:
                case 839:
                case 844:
                case 848:
                case 849:
                case 850:
                case 851:
                case 852:
                case 853:
                case 855:
                case 864:
                case 865:
                case 866:
                case 872:
                case 880:
                case 881:
                case 884:
                case 885:
                case 886:
                case 887:
                case 888:
                case 892:
                case 894:
                default:     // water for default
                    id = 5;
                    break;

                case 101:
                case 321:
                case 324:
                case 350:
                case 412:
                case 868:
                case 890:
                case 891:
                case 896:
                    id = 2;
                    break;

                case 121:
                case 141:
                case 302:
                case 303:
                case 397:
                case 404:
                case 671:
                case 739:
                case 859:
                case 860:
                case 869:
                case 870:
                case 873:
                case 874:
                case 875:
                case 876:
                case 877:
                case 878:
                case 879:
                    id = 7;
                    break;

                case 586:
                    id = 4;
                    break;
                }
            }

            switch (id)
            {
            // ocean
            case 2:
            case 6:
            case 10:
            case 14:
            case 100:
                type = 2;
                break;

            // lava
            case 3:
            case 7:
            case 11:
            case 15:
                type = 1;
                break;

            // water and slime (no data found for this one that's why)
            default:
                type = 0;
                break;
            }
            adt.WriteUShort(pos, id);
            adt.WriteUShort(pos + 0x2, type);
        }