| 1145 | } |
| 1146 | |
| 1147 | void TechnoExt::ExtData::UpdateMindControlAnim() |
| 1148 | { |
| 1149 | auto const pThis = this->OwnerObject(); |
| 1150 | if (pThis->IsMindControlled()) |
| 1151 | { |
| 1152 | if (pThis->MindControlRingAnim && !this->MindControlRingAnimType) |
| 1153 | { |
| 1154 | this->MindControlRingAnimType = pThis->MindControlRingAnim->Type; |
| 1155 | } |
| 1156 | else if (!pThis->MindControlRingAnim && this->MindControlRingAnimType && |
| 1157 | pThis->CloakState == CloakState::Uncloaked && !pThis->InLimbo && pThis->IsAlive) |
| 1158 | { |
| 1159 | auto coords = pThis->GetCoords(); |
| 1160 | int offset = 0; |
| 1161 | |
| 1162 | if (const auto pBuilding = specific_cast<BuildingClass*, true>(pThis)) |
| 1163 | offset = Unsorted::LevelHeight * pBuilding->Type->Height; |
| 1164 | else |
| 1165 | offset = pThis->GetTechnoType()->MindControlRingOffset; |
| 1166 | |
| 1167 | coords.Z += offset; |
| 1168 | pThis->MindControlRingAnim = GameCreate<AnimClass>(this->MindControlRingAnimType, coords, 0, 1); |
| 1169 | pThis->MindControlRingAnim->SetOwnerObject(pThis); |
| 1170 | |
| 1171 | if (pThis->WhatAmI() == AbstractType::Building) |
| 1172 | pThis->MindControlRingAnim->ZAdjust = -1024; |
| 1173 | } |
| 1174 | } |
| 1175 | else if (this->MindControlRingAnimType) |
| 1176 | { |
| 1177 | this->MindControlRingAnimType = nullptr; |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | void TechnoExt::ApplyGainedSelfHeal(TechnoClass* pThis) |
| 1182 | { |
no test coverage detected