Overview
Comment: | Add the AnimateDead instruction to create dead animations directly. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
49e106bc447f73884ea4c54347ada439 |
User & Date: | user on 2021-03-24 04:16:51 |
Other Links: | manifest | tags |
Context
2021-03-24
| ||
04:23 | Add some missing documentation of From/Arg1/Arg2/Arg3 values of some messages. check-in: 0797afdd8b user: user tags: trunk | |
04:16 | Add the AnimateDead instruction to create dead animations directly. check-in: 49e106bc44 user: user tags: trunk | |
2021-03-23
| ||
23:27 | Add a note into README about the distributor editing man6/heromesh.str check-in: 1860f39035 user: user tags: trunk | |
Changes
Modified class.doc from [455879bbc3] to [7c6952dc8d].
︙ | |||
978 979 980 981 982 983 984 985 986 987 988 989 990 991 | 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 | + + + + + + + + | variable equal to the start value. The flag can be STOP to stop an animation, ONCE to play the animation once (and to queue a LASTIMAGE event if the animation isn't changed before that happens; note that the message is sent even before the animation is actually visible), LOOP to play it in a loop, or OSCLOOP for an oscillating loop. The delay between frames is in centiseconds; the start and end are the image numbers in this class, and may be ascending or descending. AnimateDead ( x y class start end delay -- ) Create a dead animation, at the specified coordinates. Give the class to use the pictures of, and the start and end image number, and the delay between frames in centiseconds. This will draw the animation on the screen without being associated with any object; this animation is purely visual and does not affect the game state. The animation will play once and then it will disappear. Arg1 ( -- value ) The first message argument. =Arg1 ( value -- ) Allows setting the first message argument. This will last until the current message returns, and does not affect further messages sent; it |
︙ |
Modified exec.c from [8d61aca3bb] to [43426e4479].
︙ | |||
173 174 175 176 177 178 179 180 181 182 183 184 185 186 | 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 | + + + + + + + + + + + + + + + + + + + + | d->class=o->class; d->x=o->x; d->y=o->y; d->s=o->anim->step[o->anim->vstep]; d->vtime=o->anim->vtime; d->vimage=o->anim->vimage; } static void v_animate_dead(Value x,Value y,Value c,Value s,Value e,Value z) { DeadAnimation*d; if(no_dead_anim || ndeadanim>=0x1000) return; if(x.t || y.t || s.t || e.t || z.t || c.t!=TY_CLASS) return; if(!z.u || (z.u&~255) || x.u<1 || x.u>pfwidth || y.u<1 || y.u>pfheight) return; if(!classes[c.u] || !classes[c.u]->nimages || (classes[c.u]->cflags&(CF_GROUP|CF_NOCLASS2))) return; deadanim=realloc(deadanim,(ndeadanim+1)*sizeof(DeadAnimation)); if(!deadanim) fatal("Allocation failed\n"); d=deadanim+ndeadanim++; d->class=c.u; d->x=x.u; d->y=y.u; d->s.flag=ANI_ONCE; d->s.start=s.u; d->s.end=e.u; d->s.speed=z.u; d->vtime=0; d->vimage=s.u; } void objtrash(Uint32 n) { Object*o=objects[n]; if(!o) return; if(!main_options['e']) { if(n==traced_obj.u && o->generation==traced_obj.t && main_options['t']) { printf("# Object traced at (%d,%d)\n",o->x,o->y); |
︙ | |||
1367 1368 1369 1370 1371 1372 1373 | 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | - + | #define GetClassFlagOf(a) t2=Pop(),Push(t2.t==TY_CLASS?NVALUE(classes[t2.u]->cflags&a?1:0):(i=v_object(t2),i==VOIDLINK?NVALUE(0):NVALUE(classes[objects[i]->class]->cflags&a?1:0))) #define SetFlagOf(a) do{ t2=Pop(); i=v_object(Pop()); if(i!=VOIDLINK) { if(v_bool(t2)) objects[i]->oflags|=a; else objects[i]->oflags&=~a; } }while(0) #define NotSound(a) do{ if((a).t==TY_SOUND || (a).t==TY_USOUND) Throw("Cannot convert sound to type"); }while(0) static void execute_program(Uint16*code,int ptr,Uint32 obj) { Uint32 i,j; Object*o=objects[obj]; Value t1,t2; |
︙ | |||
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 | 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 | + | case 0x3000 ... 0x37FF: NoIgnore(); StackReq(1,0); o->uservars[code[ptr-1]&0x7FF]=Pop(); break; case 0x3800 ... 0x38FF: NoIgnore(); StackReq(1,0); globals[code[ptr-1]&0x7FF]=Pop(); break; case 0x4000 ... 0x7FFF: StackReq(0,1); Push(CVALUE(code[ptr-1]-0x4000)); break; case 0x87E8 ... 0x87FF: StackReq(0,1); Push(NVALUE(1UL<<(code[ptr-1]&31))); break; case 0xC000 ... 0xFFFF: StackReq(0,1); Push(MVALUE((code[ptr-1]&0x3FFF)+256)); break; case OP_ADD: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.u+t2.u)); break; case OP_ANIMATE: StackReq(4,0); t4=Pop(); Numeric(t4); t3=Pop(); Numeric(t3); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); animate(obj,t1.u,t2.u,t3.u,t4.u); break; case OP_ANIMATEDEAD: StackReq(6,0); t6=Pop(); t5=Pop(); t4=Pop(); t3=Pop(); t2=Pop(); t1=Pop(); v_animate_dead(t1,t2,t3,t4,t5,t6); break; case OP_ARG1: StackReq(0,1); Push(msgvars.arg1); break; case OP_ARG1_E: StackReq(1,0); msgvars.arg1=Pop(); break; case OP_ARG2: StackReq(0,1); Push(msgvars.arg2); break; case OP_ARG2_E: StackReq(1,0); msgvars.arg2=Pop(); break; case OP_ARG3: StackReq(0,1); Push(msgvars.arg3); break; case OP_ARG3_E: StackReq(1,0); msgvars.arg3=Pop(); break; case OP_ARRAYCELL: StackReq(3,1); t3=Pop(); Numeric(t3); t2=Pop(); Numeric(t2); t1=Pop(); Push(v_array_cell(t1,t2.u,t3.u)); break; |
︙ |
Modified instruc from [759d434e25] to [7610241667].
︙ | |||
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | + | -DefaultImage -Help -EditorHelp -SUBS ; Main operations Animate AnimateDead ,Assassinate ; destroy without sending any messages .Broadcast *BroadcastClass ; for (Broadcast [class]) .BroadcastEx ; broadcast with three arguments BroadcastSum ; Broadcast, but result is sum of return values BroadcastSumEx chain |
︙ |
Modified instruc.h from [f997fef66a] to [4594caa8a8].
︙ | |||
278 279 280 281 282 283 284 | 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 | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - - + + + + - + - - + + - + - - + + - - + + - + - + - + - + - + - - - + + + - + - - + + - + - - - + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - + - + - + - + - - - + + + - + - + | #define OP_QUIZ 32894 #define OP_INPLACE 32895 #define OP_DEFAULTIMAGE 32896 #define OP_HELP 32897 #define OP_EDITORHELP 32898 #define OP_SUBS 32899 #define OP_ANIMATE 32900 #define OP_ANIMATEDEAD 32901 |
︙ | |||
637 638 639 640 641 642 643 | 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 | - + - + - + - + - + - + | {"bit7",8388736}, {"bit8",8423400}, {"bit9",8423401}, {"bnot",8421410}, {"bor",8421408}, {"bxor",8421409}, {"c?",8421424}, |