| 1229 | } |
| 1230 | |
| 1231 | void zNPCFish::MonitorCowering(xScene* xscn, F32 dt) |
| 1232 | { |
| 1233 | xVec3 vec; // from dwarf, unused? |
| 1234 | NPCTarget* tgt = &this->tgt_robonear; |
| 1235 | NPCConfig* cfg = this->cfg_npc; |
| 1236 | |
| 1237 | tgt->HaveTarget(); |
| 1238 | if (!tgt->HaveTarget()) |
| 1239 | { |
| 1240 | tgt->TargetClear(); |
| 1241 | } |
| 1242 | else if (tgt->IsDead()) |
| 1243 | { |
| 1244 | tgt->TargetClear(); |
| 1245 | } |
| 1246 | else if (!tgt->InCylinder(xEntGetPos(this), g_rad_cowercheck, cfg->hyt_detect, cfg->off_detect)) |
| 1247 | { |
| 1248 | tgt->TargetClear(); |
| 1249 | } |
| 1250 | |
| 1251 | if (!tgt->HaveTarget()) |
| 1252 | { |
| 1253 | tgt->FindNearest(NPC_TGT_ENT, this, xEntGetPos(this), g_rad_cowercheck); |
| 1254 | } |
| 1255 | |
| 1256 | if (tgt->HaveTarget()) |
| 1257 | { |
| 1258 | this->tmr_robonear = cfg->tym_alert * (0.25f * (xurand() - 0.5f)) + cfg->tym_alert; |
| 1259 | this->tmr_checkagain = cfg->tym_alert * (0.25f * (xurand() - 0.5f)) + cfg->tym_alert; |
| 1260 | zNPCMsg_SendMsg(NPC_MID_BECOMESCARED, *(U32*)this); |
| 1261 | } |
| 1262 | else |
| 1263 | { |
| 1264 | this->tmr_robonear = -1.0f; |
| 1265 | this->tmr_checkagain = |
| 1266 | cfg->tym_alert * PI * (0.25f * (xurand() - 0.5f)) + cfg->tym_alert * PI; |
| 1267 | zNPCMsg_SendMsg(NPC_MID_NOLONGERSCARED, *(U32*)this); |
| 1268 | } |
| 1269 | } |
| 1270 | |
| 1271 | void zNPCFish::CheckDoChat() |
| 1272 | { |
no test coverage detected