| 89 | } |
| 90 | |
| 91 | void Sprite_Enemy::Draw(Bitmap& dst) { |
| 92 | |
| 93 | auto alpha = 255; |
| 94 | auto zoom = 1.0; |
| 95 | |
| 96 | auto* enemy = static_cast<Game_Enemy*>(GetBattler()); |
| 97 | |
| 98 | const auto bt = enemy->GetBlinkTimer(); |
| 99 | const auto dt = enemy->GetDeathTimer(); |
| 100 | const auto et = enemy->GetExplodeTimer(); |
| 101 | |
| 102 | if (!enemy->Exists() && dt == 0 && et == 0) { |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | if (bt % 10 >= 5) { |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | if (dt > 0) { |
| 111 | alpha = 7 * dt; |
| 112 | } else if (et > 0) { |
| 113 | alpha = 12 * et; |
| 114 | zoom = static_cast<double>(20 - et) / 20.0 + 1.0; |
| 115 | } |
| 116 | |
| 117 | if (enemy->IsTransparent()) { |
| 118 | alpha = 160 * alpha / 255; |
| 119 | } |
| 120 | |
| 121 | SetOpacity(alpha); |
| 122 | SetZoomX(zoom); |
| 123 | SetZoomY(zoom); |
| 124 | |
| 125 | SetTone(Main_Data::game_screen->GetTone()); |
| 126 | SetX(enemy->GetDisplayX()); |
| 127 | SetY(enemy->GetDisplayY()); |
| 128 | SetFlashEffect(enemy->GetFlashColor()); |
| 129 | if (fixed_facing != Disabled) { |
| 130 | SetFixedFlipX(); |
| 131 | } else { |
| 132 | SetFlipX(enemy->IsDirectionFlipped()); |
| 133 | } |
| 134 | |
| 135 | Sprite_Battler::Draw(dst); |
| 136 | } |
| 137 | |
| 138 | void Sprite_Enemy::Refresh() { |
| 139 | if (sprite_name != GetBattler()->GetSpriteName() || hue != GetBattler()->GetHue()) { |
nothing calls this directly
no test coverage detected