335 end; |
335 end; |
336 |
336 |
337 if State <> 0 then gear^.State:= State; |
337 if State <> 0 then gear^.State:= State; |
338 |
338 |
339 case Gear^.Kind of |
339 case Gear^.Kind of |
340 vgtFlake: if random(2) = 0 then gear^.Layer:= 0 // 50% |
340 vgtFlake: if cFlattenFlakes then gear^.Layer:= 0 |
341 else if random(2) = 0 then gear^.Layer:= 1 // 25% |
341 else if random(3) = 0 then gear^.Layer:= 0 // 33% - far back |
342 else gear^.Layer:= random(2)+2; // 12.5% each |
342 else if random(3) = 0 then gear^.Layer:= 4 // 22% - mid-distance |
343 |
343 else if random(3) <> 0 then gear^.Layer:= 5 // 30% - just behind land |
344 // 0: this layer is very distant in the background when stereo |
344 else if random(2) = 0 then gear^.Layer:= 6 // 7% - just in front of land |
|
345 else gear^.Layer:= 2; // 7% - close up |
|
346 |
|
347 vgtCloud: if cFlattenClouds then gear^.Layer:= 5 |
|
348 else if random(3) = 0 then gear^.Layer:= 0 |
|
349 else gear^.Layer:= random(2) + 4; |
|
350 |
|
351 // 0: this layer is very distant in the background when in stereo |
345 vgtTeamHealthSorter, |
352 vgtTeamHealthSorter, |
346 vgtSmoothWindBar, |
353 vgtSmoothWindBar: gear^.Layer:= 0; |
347 vgtCloud: gear^.Layer:= 0; |
354 |
348 |
355 |
349 // 1: this layer is on the land level (which is close but behind the screen plane) when stereo |
356 // 1: this layer is on the land level (which is close but behind the screen plane) when stereo |
350 vgtSmokeTrace, |
357 vgtSmokeTrace, |
351 vgtEvilTrace, |
358 vgtEvilTrace, |
352 vgtLineTrail, |
359 vgtLineTrail, |
425 end |
432 end |
426 end; |
433 end; |
427 |
434 |
428 procedure KickFlakes(Radius, X, Y: LongInt); |
435 procedure KickFlakes(Radius, X, Y: LongInt); |
429 var Gear, t: PVisualGear; |
436 var Gear, t: PVisualGear; |
430 dmg: LongInt; |
437 dmg, i: LongInt; |
431 begin |
438 begin |
432 if (vobCount = 0) or (vobCount > 200) then exit; |
439 if (vobCount = 0) or (vobCount > 200) then exit; |
433 t:= VisualGearLayers[1]; |
440 for i:= 2 to 6 do |
434 while t <> nil do |
441 if i <> 3 then |
435 begin |
442 begin |
436 Gear:= t; |
443 t:= VisualGearLayers[i]; |
437 if Gear^.Kind = vgtFlake then |
444 while t <> nil do |
438 begin |
|
439 // Damage calc from doMakeExplosion |
|
440 dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); |
|
441 if dmg > 1 then |
|
442 begin |
445 begin |
443 Gear^.tdX:= 0.02 * dmg + 0.01; |
446 Gear:= t; |
444 if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; |
447 if Gear^.Kind = vgtFlake then |
445 Gear^.tdY:= 0.02 * dmg + 0.01; |
448 begin |
446 if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
449 // Damage calc from doMakeExplosion |
447 Gear^.Timer:= 200 |
450 dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); |
|
451 if dmg > 1 then |
|
452 begin |
|
453 Gear^.tdX:= 0.02 * dmg + 0.01; |
|
454 if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; |
|
455 Gear^.tdY:= 0.02 * dmg + 0.01; |
|
456 if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
|
457 Gear^.Timer:= 200 |
|
458 end |
|
459 end; |
|
460 t:= Gear^.NextGear |
448 end |
461 end |
449 end; |
462 end |
450 t:= Gear^.NextGear |
|
451 end; |
|
452 t:= VisualGearLayers[3]; |
|
453 while t <> nil do |
|
454 begin |
|
455 Gear:= t; |
|
456 if Gear^.Kind = vgtFlake then |
|
457 begin |
|
458 // Damage calc from doMakeExplosion |
|
459 dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); |
|
460 if dmg > 1 then |
|
461 begin |
|
462 Gear^.tdX:= 0.02 * dmg + 0.01; |
|
463 if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; |
|
464 Gear^.tdY:= 0.02 * dmg + 0.01; |
|
465 if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; |
|
466 Gear^.Timer:= 200 |
|
467 end |
|
468 end; |
|
469 t:= Gear^.NextGear |
|
470 end |
|
471 end; |
463 end; |
472 |
464 |
473 procedure DrawVisualGears(Layer: LongWord); |
465 procedure DrawVisualGears(Layer: LongWord); |
474 var Gear: PVisualGear; |
466 var Gear: PVisualGear; |
475 tinted: boolean; |
467 tinted: boolean; |
482 Gear:= VisualGearLayers[0]; |
474 Gear:= VisualGearLayers[0]; |
483 while Gear <> nil do |
475 while Gear <> nil do |
484 begin |
476 begin |
485 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
477 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
486 case Gear^.Kind of |
478 case Gear^.Kind of |
487 vgtFlake: if SuddenDeathDmg then |
479 vgtCloud: if SuddenDeathDmg then |
488 if vobSDVelocity = 0 then |
480 DrawTextureF(SpritesData[sprSDCloud].Texture, 0.25, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height) |
489 DrawTextureF(SpritesData[sprSDFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
481 else |
490 else |
482 DrawTextureF(SpritesData[sprCloud].Texture, 0.25, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height); |
491 DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
483 vgtFlake: if cFlattenFlakes then |
492 else |
484 begin |
493 if vobVelocity = 0 then |
485 if SuddenDeathDmg then |
494 DrawTextureF(SpritesData[sprFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
486 if vobSDVelocity = 0 then |
495 else |
487 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
496 DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); |
488 else |
497 vgtCloud: if SuddenDeathDmg then |
489 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
498 DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
490 else |
499 else |
491 if vobVelocity = 0 then |
500 DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); |
492 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
493 else |
|
494 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
|
495 end |
|
496 else |
|
497 begin |
|
498 if SuddenDeathDmg then |
|
499 if vobSDVelocity = 0 then |
|
500 DrawTextureF(SpritesData[sprSDFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
|
501 else |
|
502 DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
|
503 else |
|
504 if vobVelocity = 0 then |
|
505 DrawTextureF(SpritesData[sprFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
|
506 else |
|
507 DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
|
508 end; |
501 end; |
509 end; |
502 if Gear^.Tint <> $FFFFFFFF then Tint($FF,$FF,$FF,$FF); |
510 if Gear^.Tint <> $FFFFFFFF then Tint($FF,$FF,$FF,$FF); |
503 Gear:= Gear^.NextGear |
511 Gear:= Gear^.NextGear |
504 end |
512 end |
505 end; |
513 end; |
525 vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
533 vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); |
526 vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF)); |
534 vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF)); |
527 end; |
535 end; |
528 if (cReducedQuality and rqAntiBoom) = 0 then |
536 if (cReducedQuality and rqAntiBoom) = 0 then |
529 case Gear^.Kind of |
537 case Gear^.Kind of |
530 vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 0, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height); |
538 vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 1, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height); |
531 vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
539 vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
532 vgtDust: if Gear^.State = 1 then |
540 vgtDust: if Gear^.State = 1 then |
533 DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame) |
541 DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame) |
534 else |
542 else |
535 DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
543 DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); |
558 while Gear <> nil do |
566 while Gear <> nil do |
559 begin |
567 begin |
560 tinted:= false; |
568 tinted:= false; |
561 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
569 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
562 case Gear^.Kind of |
570 case Gear^.Kind of |
|
571 (* |
563 vgtFlake: if SuddenDeathDmg then |
572 vgtFlake: if SuddenDeathDmg then |
564 if vobSDVelocity = 0 then |
573 if vobSDVelocity = 0 then |
565 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
574 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
566 else |
575 else |
567 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
576 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
568 else |
577 else |
569 if vobVelocity = 0 then |
578 if vobVelocity = 0 then |
570 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
579 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
571 else |
580 else |
572 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
581 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*) |
573 vgtSpeechBubble: begin |
582 vgtSpeechBubble: begin |
574 if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then |
583 if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then |
575 begin |
584 begin |
576 tinted:= true; |
585 tinted:= true; |
577 Tint($FF, $FF, $FF, $66); |
586 Tint($FF, $FF, $FF, $66); |
684 else DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer); |
693 else DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer); |
685 end; |
694 end; |
686 if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
695 if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); |
687 Gear:= Gear^.NextGear |
696 Gear:= Gear^.NextGear |
688 end |
697 end |
689 end |
698 end; |
|
699 // this layer is half-way between the screen plane (depth = 0) when in stereo, and the land |
|
700 4: begin |
|
701 Gear:= VisualGearLayers[4]; |
|
702 while Gear <> nil do |
|
703 begin |
|
704 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
|
705 case Gear^.Kind of |
|
706 vgtCloud: if SuddenDeathDmg then |
|
707 DrawTextureF(SpritesData[sprSDCloud].Texture, 0.4, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height) |
|
708 else |
|
709 DrawTextureF(SpritesData[sprCloud].Texture, 0.4, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height); |
|
710 vgtFlake: if SuddenDeathDmg then |
|
711 if vobSDVelocity = 0 then |
|
712 DrawTextureF(SpritesData[sprSDFlake].Texture, 0.8, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
|
713 else |
|
714 DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.8, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) |
|
715 else |
|
716 if vobVelocity = 0 then |
|
717 DrawTextureF(SpritesData[sprFlake].Texture, 0.8, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) |
|
718 else |
|
719 DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.8, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); |
|
720 end; |
|
721 if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); |
|
722 Gear:= Gear^.NextGear |
|
723 end |
|
724 end; |
|
725 // this layer is on the screen plane (depth = 0) when stereo, but just behind the land |
|
726 5: begin |
|
727 Gear:= VisualGearLayers[5]; |
|
728 while Gear <> nil do |
|
729 begin |
|
730 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
|
731 case Gear^.Kind of |
|
732 vgtCloud: if SuddenDeathDmg then |
|
733 DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
734 else |
|
735 DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); |
|
736 vgtFlake: if SuddenDeathDmg then |
|
737 if vobSDVelocity = 0 then |
|
738 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
739 else |
|
740 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
|
741 else |
|
742 if vobVelocity = 0 then |
|
743 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
744 else |
|
745 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
|
746 end; |
|
747 if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); |
|
748 Gear:= Gear^.NextGear |
|
749 end |
|
750 end; |
|
751 // this layer is on the screen plane (depth = 0) when stereo, but just in front of the land |
|
752 6: begin |
|
753 Gear:= VisualGearLayers[6]; |
|
754 while Gear <> nil do |
|
755 begin |
|
756 if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); |
|
757 case Gear^.Kind of |
|
758 vgtFlake: if SuddenDeathDmg then |
|
759 if vobSDVelocity = 0 then |
|
760 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
761 else |
|
762 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) |
|
763 else |
|
764 if vobVelocity = 0 then |
|
765 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) |
|
766 else |
|
767 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); |
|
768 end; |
|
769 if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); |
|
770 Gear:= Gear^.NextGear |
|
771 end |
|
772 end; |
690 end; |
773 end; |
691 end; |
774 end; |
692 |
775 |
693 function VisualGearByUID(uid : Longword) : PVisualGear; |
776 function VisualGearByUID(uid : Longword) : PVisualGear; |
694 var vg: PVisualGear; |
777 var vg: PVisualGear; |