Overview
Comment: | Add the Walkable instruction. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4436b9f0d22b3a517b351406fb9296b2 |
User & Date: | user on 2022-04-26 18:27:12 |
Other Links: | manifest | tags |
Context
2022-04-26
| ||
23:18 | Ensure that undef_message is set when loading message numbers from the CLASS.DEF lump. check-in: e6ec7babc9 user: user tags: trunk | |
18:27 | Add the Walkable instruction. check-in: 4436b9f0d2 user: user tags: trunk | |
2022-04-24
| ||
20:33 | Implement (Rook), (Bishop), and (Queen) blocks in class definition blocks. check-in: 3a5d5440cc user: user tags: trunk | |
Changes
Modified class.doc from [706c43e646] to [2b0f0507f9].
︙ | |||
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 | + + + + + + + + + + + | Check if the top value matches any others in the list above the mark. If it doesn't match any, then the value remains and it pushes true; if it does match, then the top value is removed and it pushes false instead. VolumeAt ( x y -- volume ) Finds the greatest volume among objects at the specified location. Walkable ( x y -- bool ) Tells if the current object could walk on the specified coordinates, according to Height, Climb, and CollisionLayers. This object is not counted, even if it is at the specified coordinates. Shoving, hit bits, Volume, etc are not checked. ,Walkable ( obj x y -- bool ) Similar to Walkable but for a specified object instead of this one. You may also specify a class, in which case it uses the default values of that class instead of the current values of an object. WinLevel ( -- ) Ends all execution and accepts the input sequence that resulted in the current game state as a valid solution. (In other words, the goal of the game is to find a sequence of inputs that result in the execution of a WinLevel instruction, without causing any errors or executing LoseLevel.) ,WinLevel ( score -- ) |
︙ |
Modified exec.c from [ee9e164ba7] to [89f1dc5e15].
︙ | |||
2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 | 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | o->oflags&=~OF_MOVING; if(conn[i].visual) o->oflags|=OF_VISUALONLY; else o->oflags&=~OF_VISUALONLY; } pconn=nconn=first; StackReq(0,1); return v; } static Uint32 v_walkable(Uint32 obj,Uint32 x,Uint32 y) { Uint32 r=0; Object*o; Uint32 n; Uint8 lay; if(obj==VOIDLINK) return 0; o=objects[obj]; if(o->oflags&OF_DESTROYED) return 0; lay=classes[o->class]->collisionLayers; if(x<1 || x>pfwidth || y<1 || y>pfheight) return 0; n=playfield[x+y*64-65]; while(n!=VOIDLINK) { if(n!=obj) { if(lay&classes[objects[n]->class]->collisionLayers) return 0; if(!(objects[n]->oflags&(OF_VISUALONLY|OF_DESTROYED))) { if(o->climb<objects[n]->height) return 0; r=1; } } n=objects[n]->up; } return r; } static Uint32 v_walkable_c(Uint32 c,Uint32 x,Uint32 y) { Class*cl=classes[c]; Uint32 r=0; Uint8 lay=cl->collisionLayers; Uint32 n; if(cl->cflags&CF_NOCLASS2) Throw("Invalid class number"); if(x<1 || x>pfwidth || y<1 || y>pfheight) return 0; n=playfield[x+y*64-65]; while(n!=VOIDLINK) { if(lay&classes[objects[n]->class]->collisionLayers) return 0; if(!(objects[n]->oflags&(OF_VISUALONLY|OF_DESTROYED))) { if(cl->climb<objects[n]->height) return 0; r=1; } n=objects[n]->up; } return r; } // Here is where the execution of a Free Hero Mesh bytecode subroutine is executed. #define NoIgnore() do{ changed=1; }while(0) #define GetVariableOf(a,b) (i=v_object(Pop()),i==VOIDLINK?NVALUE(0):b(objects[i]->a)) #define GetVariableOrAttributeOf(a,b) (t2=Pop(),t2.t==TY_CLASS?NVALUE(classes[t2.u]->a):(i=v_object(t2),i==VOIDLINK?NVALUE(0):b(objects[i]->a))) #define Numeric(a) do{ if((a).t!=TY_NUMBER) Throw("Type mismatch"); }while(0) #define DivideBy(a) do{ Numeric(a); if(!(a).u) Throw("Division by zero"); }while(0) |
︙ | |||
3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 | 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 | + + | case OP_VOLUME: StackReq(0,1); Push(NVALUE(o->volume)); break; case OP_VOLUME_C: StackReq(1,1); Push(GetVariableOrAttributeOf(volume,NVALUE)); break; case OP_VOLUME_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->volume=t1.u; break; case OP_VOLUME_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->volume=t1.u&0xFFFF; break; case OP_VOLUME_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->volume=t1.u; break; case OP_VOLUME_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->volume=t1.u&0xFFFF; break; case OP_VOLUMEAT: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(volume_at(t1.u,t2.u))); break; case OP_WALKABLE: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); i=v_walkable(obj,t1.u,t2.u); Push(NVALUE(i)); break; case OP_WALKABLE_C: StackReq(3,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); t3=Pop(); i=(t3.t==TY_CLASS?v_walkable_c(t3.u,t1.u,t2.u):v_walkable(v_object(t3),t1.u,t2.u)); Push(NVALUE(i)); break; case OP_WEIGHT: StackReq(0,1); Push(NVALUE(o->weight)); break; case OP_WEIGHT_C: StackReq(1,1); Push(GetVariableOrAttributeOf(weight,NVALUE)); break; case OP_WEIGHT_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->weight=t1.u; break; case OP_WEIGHT_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->weight=t1.u&0xFFFF; break; case OP_WEIGHT_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->weight=t1.u; break; case OP_WEIGHT_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->weight=t1.u&0xFFFF; break; case OP_WINLEVEL: key_ignored=0; gameover=1; gameover_score=move_number+1; Throw(0); break; |
︙ |
Modified instruc from [916ec56ae6] to [73aaa87d9d].
︙ | |||
285 286 287 288 289 290 291 292 293 294 295 296 297 298 | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | + | Synchronize ,Target Trace ,TraceStack Trigger TriggerAt VolumeAt ,Walkable ,WinLevel ,XDir ,XStep XYDir ,YDir ,YStep |
︙ |
Modified instruc.h from [d8eb492638] to [fbb0050b59].
︙ | |||
426 427 428 429 430 431 432 | 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 | + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + | #define OP_TARGET_C 35028 #define OP_TRACE 32981 #define OP_TRACESTACK 32982 #define OP_TRACESTACK_C 35030 #define OP_TRIGGER 32983 #define OP_TRIGGERAT 32984 #define OP_VOLUMEAT 32985 #define OP_WALKABLE 32986 #define OP_WALKABLE_C 35034 |
︙ | |||
553 554 555 556 557 558 559 | 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | - + | {"CodePage",8683656}, {"CollisionLayers",8487036}, {"Coloc",8487074}, {"Compatible",8487035}, {"Connect",8487075}, {"Connection",8618104}, {"Control",8421514}, |
︙ | |||
575 576 577 578 579 580 581 | 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 | - + - + - + | {"Departed",8618091}, {"Departures",8618093}, {"Destroy",10584232}, {"Destroyed",8487033}, {"Dir",8618054}, {"Distance",9142346}, {"Done",8618103}, |
︙ | |||
672 673 674 675 676 677 678 | 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 | - - + + - + - + - + - - + + | {"ObjClassAt",8421572}, {"ObjDir",8487109}, {"ObjLayerAt",8421574}, {"ObjMovingTo",8421575}, {"ObjTopAt",8421576}, {"Order",8683657}, {"Others",8683666}, |
︙ | |||
739 740 741 742 743 744 745 746 | 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 | + - - - - + + + + - + - + - + | {"VACUUM",8389411}, {"VisualOnly",8618099}, {"Volume",9142350}, {"VolumeAt",8421593}, {"W",9437188}, {"WAHOO",8389400}, {"WHACK",8389423}, {"Walkable",8487130}, {"Weight",9142352}, |
︙ | |||
794 795 796 797 798 799 800 | 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 | - - - + + + - + - + - + - + - + - + - + | {"bit9",8423401}, {"bnot",8421418}, {"bor",8421416}, {"bxor",8421417}, {"c?",8421433}, {"case",8683542}, {"chain",8421536}, |