Files
@ r5149:d4d2b8888034
Branch filter:
Location: cpp/openttd-patchpack/source/disaster_cmd.c - annotation
r5149:d4d2b8888034
21.7 KiB
text/x-c
(svn r7241) -Fix: czech town name generator now uses proper diacritics (Hadez)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | r2186:5ee653b1b5e1 r2186:5ee653b1b5e1 r0:d63b455452f6 r1891:c5c5466afa35 r4356:03f88658c85b r3314:95a9020945e1 r3315:71e0b8841575 r507:b1b0a0a3c313 r679:3a7b08cc8504 r1209:5955f8748394 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2435:202ec17a33db r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3701:4907476dec3f r337:998f55d0b04c r2159:2c706fe6b0a7 r2535:5649d4ab371b r4261:8c2d0c75e37a r0:d63b455452f6 r1048:e77c229656dc r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r1214:2ed99b1b4b97 r1048:e77c229656dc r4845:2200ed004c20 r3900:1c2675abec23 r3900:1c2675abec23 r3900:1c2675abec23 r3900:1c2675abec23 r3900:1c2675abec23 r1048:e77c229656dc r0:d63b455452f6 r1048:e77c229656dc r2435:202ec17a33db r1048:e77c229656dc r3491:10ed78e15d31 r1048:e77c229656dc r1048:e77c229656dc r1048:e77c229656dc r1048:e77c229656dc r1048:e77c229656dc r1048:e77c229656dc r0:d63b455452f6 r1048:e77c229656dc r1048:e77c229656dc r1048:e77c229656dc r1048:e77c229656dc r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r0:d63b455452f6 r0:d63b455452f6 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r4344:bff007ae1fd1 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1980:3622a0cd06c2 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r555:cefc6ad212ed r555:cefc6ad212ed r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1980:3622a0cd06c2 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4249:75d6e872a677 r4249:75d6e872a677 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r4249:75d6e872a677 r4249:75d6e872a677 r4249:75d6e872a677 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1977:1f8b99c96041 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1359:705db2bcef93 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r1212:e869b0e3bcbe r1212:e869b0e3bcbe r3338:51be01a214b5 r4845:2200ed004c20 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r3315:71e0b8841575 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r193:6aa65dc5a4b4 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r1212:e869b0e3bcbe r1212:e869b0e3bcbe r3338:51be01a214b5 r4845:2200ed004c20 r3315:71e0b8841575 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1359:705db2bcef93 r541:062eeec7f0a4 r2535:5649d4ab371b r0:d63b455452f6 r2535:5649d4ab371b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2140:efb49af98a17 r2140:efb49af98a17 r2140:efb49af98a17 r1359:705db2bcef93 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1212:e869b0e3bcbe r1212:e869b0e3bcbe r3338:51be01a214b5 r4845:2200ed004c20 r3315:71e0b8841575 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2535:5649d4ab371b r193:6aa65dc5a4b4 r4527:4b01e6756ce8 r193:6aa65dc5a4b4 r3421:37cf03a40408 r3421:37cf03a40408 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2051:04d7c352ccc4 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r4845:2200ed004c20 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r919:57ef81f1ba8e r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1359:705db2bcef93 r541:062eeec7f0a4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1977:1f8b99c96041 r0:d63b455452f6 r2026:25935f6b221a r3314:95a9020945e1 r3495:3c692ea3e92d r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r555:cefc6ad212ed r4527:4b01e6756ce8 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r919:57ef81f1ba8e r3421:37cf03a40408 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2140:efb49af98a17 r2140:efb49af98a17 r2140:efb49af98a17 r1359:705db2bcef93 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r919:57ef81f1ba8e r0:d63b455452f6 r0:d63b455452f6 r534:46e9db8de483 r0:d63b455452f6 r541:062eeec7f0a4 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r1977:1f8b99c96041 r3314:95a9020945e1 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r1980:3622a0cd06c2 r1035:d35ec5ea5f73 r0:d63b455452f6 r0:d63b455452f6 r3314:95a9020945e1 r3314:95a9020945e1 r0:d63b455452f6 r919:57ef81f1ba8e r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r555:cefc6ad212ed r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r919:57ef81f1ba8e r3421:37cf03a40408 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2140:efb49af98a17 r2140:efb49af98a17 r2140:efb49af98a17 r1359:705db2bcef93 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r919:57ef81f1ba8e r0:d63b455452f6 r0:d63b455452f6 r534:46e9db8de483 r0:d63b455452f6 r541:062eeec7f0a4 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r1977:1f8b99c96041 r3314:95a9020945e1 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r1980:3622a0cd06c2 r1035:d35ec5ea5f73 r0:d63b455452f6 r0:d63b455452f6 r3314:95a9020945e1 r3314:95a9020945e1 r0:d63b455452f6 r919:57ef81f1ba8e r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2535:5649d4ab371b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1977:1f8b99c96041 r1977:1f8b99c96041 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r3645:de3cfb719308 r3645:de3cfb719308 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r534:46e9db8de483 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r4175:d351c4462abf r4527:4b01e6756ce8 r193:6aa65dc5a4b4 r3421:37cf03a40408 r3421:37cf03a40408 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2051:04d7c352ccc4 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r2051:04d7c352ccc4 r0:d63b455452f6 r1035:d35ec5ea5f73 r3269:8d60c2e8981e r4845:2200ed004c20 r1901:e806afa50723 r3269:8d60c2e8981e r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4527:4b01e6756ce8 r919:57ef81f1ba8e r3421:37cf03a40408 r0:d63b455452f6 r4527:4b01e6756ce8 r0:d63b455452f6 r1359:705db2bcef93 r541:062eeec7f0a4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2952:e97f823d2dbe r0:d63b455452f6 r0:d63b455452f6 r2140:efb49af98a17 r2140:efb49af98a17 r0:d63b455452f6 r1359:705db2bcef93 r0:d63b455452f6 r0:d63b455452f6 r1981:addba4bccc89 r0:d63b455452f6 r0:d63b455452f6 r1981:addba4bccc89 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1977:1f8b99c96041 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r4559:2222e3ea9700 r0:d63b455452f6 r159:dfa73da8fbde r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3160:94bec5ef9c5a r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r4077:259c4c4aacad r3645:de3cfb719308 r919:57ef81f1ba8e r919:57ef81f1ba8e r4346:fa4ac6b6f852 r0:d63b455452f6 r4845:2200ed004c20 r3421:37cf03a40408 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r4175:d351c4462abf r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r3645:de3cfb719308 r0:d63b455452f6 r3157:d2dcc469a38b r1981:addba4bccc89 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r4175:d351c4462abf r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r830:5b6fa1e7dd30 r830:5b6fa1e7dd30 r830:5b6fa1e7dd30 r4346:fa4ac6b6f852 r4077:259c4c4aacad r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r3421:37cf03a40408 r3421:37cf03a40408 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r4175:d351c4462abf r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r830:5b6fa1e7dd30 r830:5b6fa1e7dd30 r830:5b6fa1e7dd30 r4346:fa4ac6b6f852 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r0:d63b455452f6 r4077:259c4c4aacad r0:d63b455452f6 r3421:37cf03a40408 r3421:37cf03a40408 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r4175:d351c4462abf r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r3645:de3cfb719308 r0:d63b455452f6 r3421:37cf03a40408 r3157:d2dcc469a38b r1981:addba4bccc89 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r4175:d351c4462abf r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r0:d63b455452f6 r3645:de3cfb719308 r0:d63b455452f6 r3157:d2dcc469a38b r3645:de3cfb719308 r3157:d2dcc469a38b r3157:d2dcc469a38b r3645:de3cfb719308 r3157:d2dcc469a38b r3157:d2dcc469a38b r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r0:d63b455452f6 r3645:de3cfb719308 r0:d63b455452f6 r3157:d2dcc469a38b r3645:de3cfb719308 r3157:d2dcc469a38b r3157:d2dcc469a38b r3645:de3cfb719308 r3157:d2dcc469a38b r3157:d2dcc469a38b r3157:d2dcc469a38b r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r2642:9b5b716920be r2648:6935682387d2 r193:6aa65dc5a4b4 r2648:6935682387d2 r2989:c7c58e254010 r2989:c7c58e254010 r830:5b6fa1e7dd30 r4346:fa4ac6b6f852 r534:46e9db8de483 r193:6aa65dc5a4b4 r1981:addba4bccc89 r193:6aa65dc5a4b4 r0:d63b455452f6 r1977:1f8b99c96041 r4559:2222e3ea9700 r2648:6935682387d2 r1977:1f8b99c96041 r2674:89de0337ece4 r0:d63b455452f6 r0:d63b455452f6 r2648:6935682387d2 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2648:6935682387d2 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2655:6def093d889a r4293:cbb984a32af5 r4293:cbb984a32af5 r2655:6def093d889a r4293:cbb984a32af5 r4293:cbb984a32af5 r4293:cbb984a32af5 r4293:cbb984a32af5 r4293:cbb984a32af5 r4293:cbb984a32af5 r4293:cbb984a32af5 r4293:cbb984a32af5 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r2639:e298192a7c03 r2639:e298192a7c03 r2639:e298192a7c03 r0:d63b455452f6 r2639:e298192a7c03 r2639:e298192a7c03 r4293:cbb984a32af5 r0:d63b455452f6 r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r2637:f38933d7a037 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r2484:d3b91bb07536 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2639:e298192a7c03 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 | /* $Id$ */
#include "stdafx.h"
#include "openttd.h"
#include "functions.h"
#include "industry_map.h"
#include "station_map.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
#include "vehicle.h"
#include "command.h"
#include "news.h"
#include "station.h"
#include "waypoint.h"
#include "town.h"
#include "industry.h"
#include "player.h"
#include "airport.h"
#include "sound.h"
#include "variables.h"
#include "table/sprites.h"
#include "date.h"
static void DisasterClearSquare(TileIndex tile)
{
if (!EnsureNoVehicle(tile)) return;
switch (GetTileType(tile)) {
case MP_RAILWAY:
if (IsHumanPlayer(GetTileOwner(tile)) && !IsRailWaypoint(tile)) {
PlayerID p = _current_player;
_current_player = OWNER_WATER;
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
_current_player = p;
}
break;
case MP_HOUSE: {
PlayerID p = _current_player;
_current_player = OWNER_NONE;
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
_current_player = p;
break;
}
case MP_TREES:
case MP_CLEAR:
DoClearSquare(tile);
break;
default:
break;
}
}
static const SpriteID _disaster_images_1[] = {0xF41, 0xF41, 0xF41, 0xF41, 0xF41, 0xF41, 0xF41, 0xF41};
static const SpriteID _disaster_images_2[] = {0xF44, 0xF44, 0xF44, 0xF44, 0xF44, 0xF44, 0xF44, 0xF44};
static const SpriteID _disaster_images_3[] = {0xF4E, 0xF4E, 0xF4E, 0xF4E, 0xF4E, 0xF4E, 0xF4E, 0xF4E};
static const SpriteID _disaster_images_4[] = {0xF46, 0xF46, 0xF47, 0xF47, 0xF48, 0xF48, 0xF49, 0xF49};
static const SpriteID _disaster_images_5[] = {0xF4A, 0xF4A, 0xF4B, 0xF4B, 0xF4C, 0xF4C, 0xF4D, 0xF4D};
static const SpriteID _disaster_images_6[] = {0xF50, 0xF50, 0xF50, 0xF50, 0xF50, 0xF50, 0xF50, 0xF50};
static const SpriteID _disaster_images_7[] = {0xF51, 0xF51, 0xF51, 0xF51, 0xF51, 0xF51, 0xF51, 0xF51};
static const SpriteID _disaster_images_8[] = {0xF52, 0xF52, 0xF52, 0xF52, 0xF52, 0xF52, 0xF52, 0xF52};
static const SpriteID _disaster_images_9[] = {0xF3E, 0xF3E, 0xF3E, 0xF3E, 0xF3E, 0xF3E, 0xF3E, 0xF3E};
static const SpriteID * const _disaster_images[] = {
_disaster_images_1, _disaster_images_1,
_disaster_images_2, _disaster_images_2,
_disaster_images_3, _disaster_images_3,
_disaster_images_8, _disaster_images_8, _disaster_images_9,
_disaster_images_6, _disaster_images_6,
_disaster_images_7, _disaster_images_7,
_disaster_images_4, _disaster_images_5,
};
static void DisasterVehicleUpdateImage(Vehicle *v)
{
int img = v->u.disaster.image_override;
if (img == 0)
img = _disaster_images[v->subtype][v->direction];
v->cur_image = img;
}
static void InitializeDisasterVehicle(Vehicle* v, int x, int y, byte z, Direction direction, byte subtype)
{
v->type = VEH_Disaster;
v->x_pos = x;
v->y_pos = y;
v->z_pos = z;
v->tile = TileVirtXY(x, y);
v->direction = direction;
v->subtype = subtype;
v->x_offs = -1;
v->y_offs = -1;
v->sprite_width = 2;
v->sprite_height = 2;
v->z_height = 5;
v->owner = OWNER_NONE;
v->vehstatus = VS_UNCLICKABLE;
v->u.disaster.image_override = 0;
v->current_order.type = OT_NOTHING;
v->current_order.flags = 0;
v->current_order.dest = 0;
DisasterVehicleUpdateImage(v);
VehiclePositionChanged(v);
BeginVehicleMove(v);
EndVehicleMove(v);
}
static void DeleteDisasterVeh(Vehicle *v)
{
DeleteVehicleChain(v);
}
static void SetDisasterVehiclePos(Vehicle *v, int x, int y, byte z)
{
Vehicle *u;
BeginVehicleMove(v);
v->x_pos = x;
v->y_pos = y;
v->z_pos = z;
v->tile = TileVirtXY(x, y);
DisasterVehicleUpdateImage(v);
VehiclePositionChanged(v);
EndVehicleMove(v);
if ( (u=v->next) != NULL) {
int safe_x = clamp(x, 0, MapMaxX() * TILE_SIZE);
int safe_y = clamp(y - 1, 0, MapMaxY() * TILE_SIZE);
BeginVehicleMove(u);
u->x_pos = x;
u->y_pos = y - 1 - (max(z - GetSlopeZ(safe_x, safe_y), 0) >> 3);
safe_y = clamp(u->y_pos, 0, MapMaxY() * TILE_SIZE);
u->z_pos = GetSlopeZ(safe_x, safe_y);
u->direction = v->direction;
DisasterVehicleUpdateImage(u);
VehiclePositionChanged(u);
EndVehicleMove(u);
if ( (u=u->next) != NULL) {
BeginVehicleMove(u);
u->x_pos = x;
u->y_pos = y;
u->z_pos = z + 5;
VehiclePositionChanged(u);
EndVehicleMove(u);
}
}
}
static void DisasterTick_Zeppeliner(Vehicle *v)
{
GetNewVehiclePosResult gp;
Station *st;
int x,y;
byte z;
TileIndex tile;
++v->tick_counter;
if (v->current_order.dest < 2) {
if (v->tick_counter&1)
return;
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
if (v->current_order.dest == 1) {
if (++v->age == 38) {
v->current_order.dest = 2;
v->age = 0;
}
if ((v->tick_counter&7)==0) {
CreateEffectVehicleRel(v, 0, -17, 2, EV_SMOKE);
}
} else if (v->current_order.dest == 0) {
tile = v->tile; /**/
if (IsValidTile(tile) &&
IsTileType(tile, MP_STATION) &&
IsAirport(tile) &&
IsHumanPlayer(GetTileOwner(tile))) {
v->current_order.dest = 1;
v->age = 0;
SetDParam(0, GetStationIndex(tile));
AddNewsItem(STR_B000_ZEPPELIN_DISASTER_AT,
NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0),
v->index,
0);
}
}
if (v->y_pos >= ((int)MapSizeY() + 9) * TILE_SIZE - 1)
DeleteDisasterVeh(v);
return;
}
if (v->current_order.dest > 2) {
if (++v->age <= 13320)
return;
tile = v->tile; /**/
if (IsValidTile(tile) &&
IsTileType(tile, MP_STATION) &&
IsAirport(tile) &&
IsHumanPlayer(GetTileOwner(tile))) {
st = GetStationByTile(tile);
CLRBITS(st->airport_flags, RUNWAY_IN_block);
}
SetDisasterVehiclePos(v, v->x_pos, v->y_pos, v->z_pos);
DeleteDisasterVeh(v);
return;
}
x = v->x_pos;
y = v->y_pos;
z = GetSlopeZ(x,y);
if (z < v->z_pos)
z = v->z_pos - 1;
SetDisasterVehiclePos(v, x, y, z);
if (++v->age == 1) {
CreateEffectVehicleRel(v, 0, 7, 8, EV_EXPLOSION_LARGE);
SndPlayVehicleFx(SND_12_EXPLOSION, v);
v->u.disaster.image_override = SPR_BLIMP_CRASHING;
} else if (v->age == 70) {
v->u.disaster.image_override = SPR_BLIMP_CRASHED;
} else if (v->age <= 300) {
if (!(v->tick_counter&7)) {
uint32 r = Random();
CreateEffectVehicleRel(v,
GB(r, 0, 4) - 7,
GB(r, 4, 4) - 7,
GB(r, 8, 3) + 5,
EV_EXPLOSION_SMALL);
}
} else if (v->age == 350) {
v->current_order.dest = 3;
v->age = 0;
}
tile = v->tile;/**/
if (IsValidTile(tile) &&
IsTileType(tile, MP_STATION) &&
IsAirport(tile) &&
IsHumanPlayer(GetTileOwner(tile))) {
st = GetStationByTile(tile);
SETBITS(st->airport_flags, RUNWAY_IN_block);
}
}
// UFO starts in the middle, and flies around a bit until it locates
// a road vehicle which it targets.
static void DisasterTick_UFO(Vehicle *v)
{
GetNewVehiclePosResult gp;
Vehicle *u;
uint dist;
byte z;
v->u.disaster.image_override = (++v->tick_counter & 8) ? SPR_UFO_SMALL_SCOUT_DARKER : SPR_UFO_SMALL_SCOUT;
if (v->current_order.dest == 0) {
// fly around randomly
int x = TileX(v->dest_tile) * TILE_SIZE;
int y = TileY(v->dest_tile) * TILE_SIZE;
if (abs(x - v->x_pos) + abs(y - v->y_pos) >= TILE_SIZE) {
v->direction = GetDirectionTowards(v, x, y);
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
return;
}
if (++v->age < 6) {
v->dest_tile = RandomTile();
return;
}
v->current_order.dest = 1;
FOR_ALL_VEHICLES(u) {
if (u->type == VEH_Road && IsHumanPlayer(u->owner)) {
v->dest_tile = u->index;
v->age = 0;
return;
}
}
DeleteDisasterVeh(v);
} else {
// target a vehicle
u = GetVehicle(v->dest_tile);
if (u->type != VEH_Road) {
DeleteDisasterVeh(v);
return;
}
dist = abs(v->x_pos - u->x_pos) + abs(v->y_pos - u->y_pos);
if (dist < TILE_SIZE && !(u->vehstatus&VS_HIDDEN) && u->breakdown_ctr==0) {
u->breakdown_ctr = 3;
u->breakdown_delay = 140;
}
v->direction = GetDirectionTowards(v, u->x_pos, u->y_pos);
GetNewVehiclePos(v, &gp);
z = v->z_pos;
if (dist <= TILE_SIZE && z > u->z_pos) z--;
SetDisasterVehiclePos(v, gp.x, gp.y, z);
if (z <= u->z_pos && (u->vehstatus&VS_HIDDEN)==0) {
v->age++;
if (u->u.road.crashed_ctr == 0) {
u->u.road.crashed_ctr++;
u->vehstatus |= VS_CRASHED;
AddNewsItem(STR_B001_ROAD_VEHICLE_DESTROYED,
NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0),
u->index,
0);
}
}
// destroy?
if (v->age > 50) {
CreateEffectVehicleRel(v, 0, 7, 8, EV_EXPLOSION_LARGE);
SndPlayVehicleFx(SND_12_EXPLOSION, v);
DeleteDisasterVeh(v);
}
}
}
static void DestructIndustry(Industry *i)
{
TileIndex tile;
for (tile = 0; tile != MapSize(); tile++) {
if (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == i->index) {
ResetIndustryConstructionStage(tile);
MarkTileDirtyByTile(tile);
}
}
}
// Airplane which destroys an oil refinery
static void DisasterTick_2(Vehicle *v)
{
GetNewVehiclePosResult gp;
v->tick_counter++;
v->u.disaster.image_override =
(v->current_order.dest == 1 && v->tick_counter & 4) ? SPR_F_15_FIRING : 0;
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
if (gp.x < -160) {
DeleteDisasterVeh(v);
return;
}
if (v->current_order.dest == 2) {
if (!(v->tick_counter&3)) {
Industry *i = GetIndustry(v->dest_tile);
int x = TileX(i->xy) * TILE_SIZE;
int y = TileY(i->xy) * TILE_SIZE;
uint32 r = Random();
CreateEffectVehicleAbove(
GB(r, 0, 6) + x,
GB(r, 6, 6) + y,
GB(r, 12, 4),
EV_EXPLOSION_SMALL);
if (++v->age >= 55)
v->current_order.dest = 3;
}
} else if (v->current_order.dest == 1) {
if (++v->age == 112) {
Industry *i;
v->current_order.dest = 2;
v->age = 0;
i = GetIndustry(v->dest_tile);
DestructIndustry(i);
SetDParam(0, i->town->index);
AddNewsItem(STR_B002_OIL_REFINERY_EXPLOSION, NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy, 0);
SndPlayTileFx(SND_12_EXPLOSION, i->xy);
}
} else if (v->current_order.dest == 0) {
int x,y;
TileIndex tile;
uint ind;
x = v->x_pos - 15 * TILE_SIZE;
y = v->y_pos;
if ( (uint)x > MapMaxX() * TILE_SIZE - 1)
return;
tile = TileVirtXY(x, y);
if (!IsTileType(tile, MP_INDUSTRY))
return;
ind = GetIndustryIndex(tile);
v->dest_tile = ind;
if (GetIndustry(ind)->type == IT_OIL_REFINERY) {
v->current_order.dest = 1;
v->age = 0;
}
}
}
// Helicopter which destroys a factory
static void DisasterTick_3(Vehicle *v)
{
GetNewVehiclePosResult gp;
v->tick_counter++;
v->u.disaster.image_override =
(v->current_order.dest == 1 && v->tick_counter & 4) ? SPR_AH_64A_FIRING : 0;
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
if (gp.x > (int)MapSizeX() * TILE_SIZE + 9 * TILE_SIZE - 1) {
DeleteDisasterVeh(v);
return;
}
if (v->current_order.dest == 2) {
if (!(v->tick_counter&3)) {
Industry *i = GetIndustry(v->dest_tile);
int x = TileX(i->xy) * TILE_SIZE;
int y = TileY(i->xy) * TILE_SIZE;
uint32 r = Random();
CreateEffectVehicleAbove(
GB(r, 0, 6) + x,
GB(r, 6, 6) + y,
GB(r, 12, 4),
EV_EXPLOSION_SMALL);
if (++v->age >= 55)
v->current_order.dest = 3;
}
} else if (v->current_order.dest == 1) {
if (++v->age == 112) {
Industry *i;
v->current_order.dest = 2;
v->age = 0;
i = GetIndustry(v->dest_tile);
DestructIndustry(i);
SetDParam(0, i->town->index);
AddNewsItem(STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS, NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy, 0);
SndPlayTileFx(SND_12_EXPLOSION, i->xy);
}
} else if (v->current_order.dest == 0) {
int x,y;
TileIndex tile;
uint ind;
x = v->x_pos - 15 * TILE_SIZE;
y = v->y_pos;
if ( (uint)x > MapMaxX() * TILE_SIZE - 1)
return;
tile = TileVirtXY(x, y);
if (!IsTileType(tile, MP_INDUSTRY))
return;
ind = GetIndustryIndex(tile);
v->dest_tile = ind;
if (GetIndustry(ind)->type == IT_FACTORY) {
v->current_order.dest = 1;
v->age = 0;
}
}
}
// Helicopter rotor blades
static void DisasterTick_3b(Vehicle *v)
{
if (++v->tick_counter & 1)
return;
if (++v->cur_image > SPR_ROTOR_MOVING_3) v->cur_image = SPR_ROTOR_MOVING_1;
VehiclePositionChanged(v);
BeginVehicleMove(v);
EndVehicleMove(v);
}
// Big UFO which lands on a piece of rail.
// Will be shot down by a plane
static void DisasterTick_4(Vehicle *v)
{
GetNewVehiclePosResult gp;
byte z;
Vehicle *u,*w;
Town *t;
TileIndex tile;
TileIndex tile_org;
v->tick_counter++;
if (v->current_order.dest == 1) {
int x = TileX(v->dest_tile) * TILE_SIZE + TILE_SIZE / 2;
int y = TileY(v->dest_tile) * TILE_SIZE + TILE_SIZE / 2;
if (abs(v->x_pos - x) + abs(v->y_pos - y) >= 8) {
v->direction = GetDirectionTowards(v, x, y);
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
return;
}
z = GetSlopeZ(v->x_pos, v->y_pos);
if (z < v->z_pos) {
SetDisasterVehiclePos(v, v->x_pos, v->y_pos, v->z_pos - 1);
return;
}
v->current_order.dest = 2;
FOR_ALL_VEHICLES(u) {
if (u->type == VEH_Train || u->type == VEH_Road) {
if (abs(u->x_pos - v->x_pos) + abs(u->y_pos - v->y_pos) <= 12 * TILE_SIZE) {
u->breakdown_ctr = 5;
u->breakdown_delay = 0xF0;
}
}
}
t = ClosestTownFromTile(v->dest_tile, (uint)-1);
SetDParam(0, t->index);
AddNewsItem(STR_B004_UFO_LANDS_NEAR,
NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ACCIDENT, 0),
v->tile,
0);
u = ForceAllocateSpecialVehicle();
if (u == NULL) {
DeleteDisasterVeh(v);
return;
}
InitializeDisasterVehicle(u, -6 * TILE_SIZE, v->y_pos, 135, DIR_SW, 11);
u->u.disaster.unk2 = v->index;
w = ForceAllocateSpecialVehicle();
if (w == NULL)
return;
u->next = w;
InitializeDisasterVehicle(w, -6 * TILE_SIZE, v->y_pos, 0, DIR_SW, 12);
w->vehstatus |= VS_SHADOW;
} else if (v->current_order.dest < 1) {
int x = TileX(v->dest_tile) * TILE_SIZE;
int y = TileY(v->dest_tile) * TILE_SIZE;
if (abs(x - v->x_pos) + abs(y - v->y_pos) >= TILE_SIZE) {
v->direction = GetDirectionTowards(v, x, y);
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
return;
}
if (++v->age < 6) {
v->dest_tile = RandomTile();
return;
}
v->current_order.dest = 1;
tile_org = tile = RandomTile();
do {
if (IsTileType(tile, MP_RAILWAY) &&
IsPlainRailTile(tile) &&
IsHumanPlayer(GetTileOwner(tile))) {
break;
}
tile = TILE_MASK(tile+1);
} while (tile != tile_org);
v->dest_tile = tile;
v->age = 0;
} else {
return;
}
}
// The plane which will shoot down the UFO
static void DisasterTick_4b(Vehicle *v)
{
GetNewVehiclePosResult gp;
Vehicle *u;
int i;
v->tick_counter++;
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
if (gp.x > (int)MapSizeX() * TILE_SIZE + 9 * TILE_SIZE - 1) {
DeleteDisasterVeh(v);
return;
}
if (v->current_order.dest == 0) {
u = GetVehicle(v->u.disaster.unk2);
if (abs(v->x_pos - u->x_pos) > TILE_SIZE)
return;
v->current_order.dest = 1;
CreateEffectVehicleRel(u, 0, 7, 8, EV_EXPLOSION_LARGE);
SndPlayVehicleFx(SND_12_EXPLOSION, u);
DeleteDisasterVeh(u);
for (i = 0; i != 80; i++) {
uint32 r = Random();
CreateEffectVehicleAbove(
GB(r, 0, 6) + v->x_pos - 32,
GB(r, 5, 6) + v->y_pos - 32,
0,
EV_EXPLOSION_SMALL);
}
BEGIN_TILE_LOOP(tile, 6, 6, v->tile - TileDiffXY(3, 3))
tile = TILE_MASK(tile);
DisasterClearSquare(tile);
END_TILE_LOOP(tile, 6, 6, v->tile - TileDiffXY(3, 3))
}
}
// Submarine handler
static void DisasterTick_5_and_6(Vehicle *v)
{
uint32 r;
GetNewVehiclePosResult gp;
TileIndex tile;
v->tick_counter++;
if (++v->age > 8880) {
VehiclePositionChanged(v);
BeginVehicleMove(v);
EndVehicleMove(v);
DeleteVehicle(v);
return;
}
if (!(v->tick_counter & 1)) return;
tile = v->tile + TileOffsByDiagDir(DirToDiagDir(v->direction));
if (IsValidTile(tile) &&
(r=GetTileTrackStatus(tile,TRANSPORT_WATER),(byte)(r+(r >> 8)) == 0x3F) &&
!CHANCE16(1,90)) {
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
return;
}
v->direction = ChangeDir(v->direction, GB(Random(), 0, 1) ? DIRDIFF_90RIGHT : DIRDIFF_90LEFT);
}
static void DisasterTick_NULL(Vehicle *v) {}
typedef void DisasterVehicleTickProc(Vehicle *v);
static DisasterVehicleTickProc * const _disastervehicle_tick_procs[] = {
DisasterTick_Zeppeliner,DisasterTick_NULL,
DisasterTick_UFO,DisasterTick_NULL,
DisasterTick_2,DisasterTick_NULL,
DisasterTick_3,DisasterTick_NULL,DisasterTick_3b,
DisasterTick_4,DisasterTick_NULL,
DisasterTick_4b,DisasterTick_NULL,
DisasterTick_5_and_6,
DisasterTick_5_and_6,
};
void DisasterVehicle_Tick(Vehicle *v)
{
_disastervehicle_tick_procs[v->subtype](v);
}
void OnNewDay_DisasterVehicle(Vehicle *v)
{
// not used
}
typedef void DisasterInitProc(void);
// Zeppeliner which crashes on a small airport
static void Disaster0_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle(), *u;
Station *st;
int x;
if (v == NULL) return;
/* Pick a random place, unless we find a small airport */
x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2;
FOR_ALL_STATIONS(st) {
if (st->airport_tile != 0 &&
st->airport_type <= 1 &&
IsHumanPlayer(st->owner)) {
x = (TileX(st->xy) + 2) * TILE_SIZE;
break;
}
}
InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, 0);
// Allocate shadow too?
u = ForceAllocateSpecialVehicle();
if (u != NULL) {
v->next = u;
InitializeDisasterVehicle(u, x, 0, 0, DIR_SE, 1);
u->vehstatus |= VS_SHADOW;
}
}
static void Disaster1_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle(), *u;
int x;
if (v == NULL) return;
x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2;
InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, 2);
v->dest_tile = TileXY(MapSizeX() / 2, MapSizeY() / 2);
v->age = 0;
// Allocate shadow too?
u = ForceAllocateSpecialVehicle();
if (u != NULL) {
v->next = u;
InitializeDisasterVehicle(u, x, 0, 0, DIR_SE, 3);
u->vehstatus |= VS_SHADOW;
}
}
static void Disaster2_Init(void)
{
Industry *i, *found;
Vehicle *v,*u;
int x,y;
found = NULL;
FOR_ALL_INDUSTRIES(i) {
if (i->type == IT_OIL_REFINERY &&
(found == NULL || CHANCE16(1, 2))) {
found = i;
}
}
if (found == NULL) return;
v = ForceAllocateSpecialVehicle();
if (v == NULL) return;
x = (MapSizeX() + 9) * TILE_SIZE - 1;
y = TileY(found->xy) * TILE_SIZE + 37;
InitializeDisasterVehicle(v, x, y, 135, DIR_NE, 4);
u = ForceAllocateSpecialVehicle();
if (u != NULL) {
v->next = u;
InitializeDisasterVehicle(u, x, y, 0, DIR_SE, 5);
u->vehstatus |= VS_SHADOW;
}
}
static void Disaster3_Init(void)
{
Industry *i, *found;
Vehicle *v,*u,*w;
int x,y;
found = NULL;
FOR_ALL_INDUSTRIES(i) {
if (i->type == IT_FACTORY &&
(found==NULL || CHANCE16(1,2))) {
found = i;
}
}
if (found == NULL) return;
v = ForceAllocateSpecialVehicle();
if (v == NULL) return;
x = -16 * TILE_SIZE;
y = TileY(found->xy) * TILE_SIZE + 37;
InitializeDisasterVehicle(v, x, y, 135, DIR_SW, 6);
u = ForceAllocateSpecialVehicle();
if (u != NULL) {
v->next = u;
InitializeDisasterVehicle(u, x, y, 0, DIR_SW, 7);
u->vehstatus |= VS_SHADOW;
w = ForceAllocateSpecialVehicle();
if (w != NULL) {
u->next = w;
InitializeDisasterVehicle(w, x, y, 140, DIR_SW, 8);
}
}
}
static void Disaster4_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle(), *u;
int x,y;
if (v == NULL) return;
x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2;
y = MapMaxX() * TILE_SIZE - 1;
InitializeDisasterVehicle(v, x, y, 135, DIR_NW, 9);
v->dest_tile = TileXY(MapSizeX() / 2, MapSizeY() / 2);
v->age = 0;
// Allocate shadow too?
u = ForceAllocateSpecialVehicle();
if (u != NULL) {
v->next = u;
InitializeDisasterVehicle(u, x, y, 0, DIR_NW, 10);
u->vehstatus |= VS_SHADOW;
}
}
// Submarine type 1
static void Disaster5_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle();
int x,y;
Direction dir;
uint32 r;
if (v == NULL) return;
r = Random();
x = TileX(r) * TILE_SIZE + TILE_SIZE / 2;
if (r & 0x80000000) {
y = MapMaxX() * TILE_SIZE - TILE_SIZE / 2 - 1;
dir = DIR_NW;
} else {
y = TILE_SIZE / 2;
dir = DIR_SE;
}
InitializeDisasterVehicle(v, x, y, 0, dir, 13);
v->age = 0;
}
// Submarine type 2
static void Disaster6_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle();
int x,y;
Direction dir;
uint32 r;
if (v == NULL) return;
r = Random();
x = TileX(r) * TILE_SIZE + TILE_SIZE / 2;
if (r & 0x80000000) {
y = MapMaxX() * TILE_SIZE - TILE_SIZE / 2 - 1;
dir = DIR_NW;
} else {
y = TILE_SIZE / 2;
dir = DIR_SE;
}
InitializeDisasterVehicle(v, x, y, 0, dir, 14);
v->age = 0;
}
static void Disaster7_Init(void)
{
int index = GB(Random(), 0, 4);
uint m;
for (m = 0; m < 15; m++) {
const Industry* i;
FOR_ALL_INDUSTRIES(i) {
if (i->type == IT_COAL_MINE && --index < 0) {
SetDParam(0, i->town->index);
AddNewsItem(STR_B005_COAL_MINE_SUBSIDENCE_LEAVES,
NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy + TileDiffXY(1, 1), 0);
{
TileIndex tile = i->xy;
TileIndexDiff step = TileOffsByDiagDir(GB(Random(), 0, 2));
uint n;
for (n = 0; n < 30; n++) {
DisasterClearSquare(tile);
tile = TILE_MASK(tile + step);
}
}
return;
}
}
}
}
static DisasterInitProc * const _disaster_initprocs[] = {
Disaster0_Init,
Disaster1_Init,
Disaster2_Init,
Disaster3_Init,
Disaster4_Init,
Disaster5_Init,
Disaster6_Init,
Disaster7_Init,
};
static const struct {
Year min;
Year max;
} _dis_years[] = {
{ 1930, 1955 },
{ 1940, 1970 },
{ 1960, 1990 },
{ 1970, 2000 },
{ 2000, 2100 },
{ 1940, 1965 },
{ 1975, 2010 },
{ 1950, 1985 }
};
static void DoDisaster(void)
{
byte buf[lengthof(_dis_years)];
uint i;
uint j;
j = 0;
for (i = 0; i != lengthof(_dis_years); i++) {
if (_cur_year >= _dis_years[i].min && _cur_year < _dis_years[i].max) buf[j++] = i;
}
if (j == 0) return;
_disaster_initprocs[buf[RandomRange(j)]]();
}
static void ResetDisasterDelay(void)
{
_disaster_delay = GB(Random(), 0, 9) + 730;
}
void DisasterDailyLoop(void)
{
if (--_disaster_delay != 0) return;
ResetDisasterDelay();
if (_opt.diff.disasters != 0) DoDisaster();
}
void StartupDisasters(void)
{
ResetDisasterDelay();
}
|