From ca0ff013d47c2ee65ea88fdf6d30336aa6789b4e Mon Sep 17 00:00:00 2001 From: Fiftytwo Date: Thu, 21 Dec 2017 01:49:56 +0100 Subject: [PATCH] Update Trainer bots --- src/level/parser/parserparam.cpp | 9 +- src/object/motion/motionvehicle.cpp | 126 ++++++++++++++++++++++++---- src/object/object_type.h | 9 +- src/object/old_object.cpp | 80 +++++++++--------- src/physics/physics.cpp | 24 ++++-- src/script/cbottoken.cpp | 9 +- src/script/scriptfunc.cpp | 16 +++- 7 files changed, 202 insertions(+), 71 deletions(-) diff --git a/src/level/parser/parserparam.cpp b/src/level/parser/parserparam.cpp index 9110ceb5..9a671976 100644 --- a/src/level/parser/parserparam.cpp +++ b/src/level/parser/parserparam.cpp @@ -339,6 +339,10 @@ ObjectType CLevelParserParam::ToObjectType(std::string value) if (value == "Portico" ) return OBJECT_PORTICO; if (value == "SpaceShip" ) return OBJECT_BASE; if (value == "PracticeBot" ) return OBJECT_MOBILEwt; + if (value == "WingedTrainer" ) return OBJECT_MOBILEft; + if (value == "TrackedTrainer" ) return OBJECT_MOBILEtt; + if (value == "WheeledTrainer" ) return OBJECT_MOBILEwt; + if (value == "LeggedTrainer" ) return OBJECT_MOBILEit; if (value == "WingedGrabber" ) return OBJECT_MOBILEfa; if (value == "TrackedGrabber" ) return OBJECT_MOBILEta; if (value == "WheeledGrabber" ) return OBJECT_MOBILEwa; @@ -543,7 +547,10 @@ const std::string CLevelParserParam::FromObjectType(ObjectType value) { if (value == OBJECT_PORTICO ) return "Portico"; if (value == OBJECT_BASE ) return "SpaceShip"; - if (value == OBJECT_MOBILEwt ) return "PracticeBot"; + if (value == OBJECT_MOBILEwt ) return "WheeledTrainer"; + if (value == OBJECT_MOBILEft ) return "WingedTrainer"; + if (value == OBJECT_MOBILEtt ) return "TrackedTrainer"; + if (value == OBJECT_MOBILEit ) return "LeggedTrainer"; if (value == OBJECT_MOBILEfa ) return "WingedGrabber"; if (value == OBJECT_MOBILEta ) return "TrackedGrabber"; if (value == OBJECT_MOBILEwa ) return "WheeledGrabber"; diff --git a/src/object/motion/motionvehicle.cpp b/src/object/motion/motionvehicle.cpp index a9cfa402..be89509a 100644 --- a/src/object/motion/motionvehicle.cpp +++ b/src/object/motion/motionvehicle.cpp @@ -100,21 +100,60 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object m_object->SetObjectRank(0, rank); + if (m_object->GetTrainer() || + type == OBJECT_MOBILEwt || + type == OBJECT_MOBILEtt || + type == OBJECT_MOBILEft || + type == OBJECT_MOBILEit) + { + modelManager->AddModelReference("trainer.mod", false, rank, m_object->GetTeam()); + } + if (type == OBJECT_MOBILEfa || type == OBJECT_MOBILEfb || type == OBJECT_MOBILEfc || type == OBJECT_MOBILEfi || type == OBJECT_MOBILEfs) { - modelManager->AddModelReference("lem1f.mod", false, rank, m_object->GetTeam()); + if (!m_object->GetTrainer()) + modelManager->AddModelReference("lem1f.mod", false, rank, m_object->GetTeam()); + else + { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); + modelManager->AddModelReference("trainerf.mod", false, rank, m_object->GetTeam()); + + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(29, rank); + m_object->SetObjectParent(29, 0); + modelManager->AddModelReference("trainera.mod", false, rank, m_object->GetTeam()); + } } else if (type == OBJECT_MOBILEta || type == OBJECT_MOBILEtb || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || type == OBJECT_MOBILEts) - { - modelManager->AddModelReference("lem1t.mod", false, rank, m_object->GetTeam()); + { + if (!m_object->GetTrainer()) + modelManager->AddModelReference("lem1t.mod", false, rank, m_object->GetTeam()); + else + { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); + modelManager->AddModelReference("trainert.mod", false, rank, m_object->GetTeam()); + + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(29, rank); + m_object->SetObjectParent(29, 0); + modelManager->AddModelReference("trainera.mod", false, rank, m_object->GetTeam()); + } } else if (type == OBJECT_MOBILEwa || type == OBJECT_MOBILEwb || @@ -122,13 +161,21 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type == OBJECT_MOBILEwi || type == OBJECT_MOBILEws) { - if (m_object->GetTrainer()) - { - modelManager->AddModelReference("lem1wt.mod", false, rank, m_object->GetTeam()); - } + if (!m_object->GetTrainer()) + modelManager->AddModelReference("lem1w.mod", false, rank, m_object->GetTeam()); else { - modelManager->AddModelReference("lem1w.mod", false, rank, m_object->GetTeam()); + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); + modelManager->AddModelReference("trainerw.mod", false, rank, m_object->GetTeam()); + + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(29, rank); + m_object->SetObjectParent(29, 0); + modelManager->AddModelReference("trainera.mod", false, rank, m_object->GetTeam()); } } else if (type == OBJECT_MOBILEia || @@ -137,7 +184,22 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type == OBJECT_MOBILEii || type == OBJECT_MOBILEis) { - modelManager->AddModelReference("lem1i.mod", false, rank, m_object->GetTeam()); + if (!m_object->GetTrainer()) + modelManager->AddModelReference("lem1i.mod", false, rank, m_object->GetTeam()); + else + { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); + modelManager->AddModelReference("traineri.mod", false, rank, m_object->GetTeam()); + + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(29, rank); + m_object->SetObjectParent(29, 0); + modelManager->AddModelReference("trainera.mod", false, rank, m_object->GetTeam()); + } } else if (type == OBJECT_MOBILErt || type == OBJECT_MOBILErc || @@ -156,18 +218,34 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, } else if (type == OBJECT_MOBILEwt) { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); modelManager->AddModelReference("trainerw.mod", false, rank, m_object->GetTeam()); } else if (type == OBJECT_MOBILEft) { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); modelManager->AddModelReference("trainerf.mod", false, rank, m_object->GetTeam()); } else if (type == OBJECT_MOBILEtt) { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); modelManager->AddModelReference("trainert.mod", false, rank, m_object->GetTeam()); } else if (type == OBJECT_MOBILEit) { + rank = m_engine->CreateObject(); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); + m_object->SetObjectRank(28, rank); + m_object->SetObjectParent(28, 0); modelManager->AddModelReference("traineri.mod", false, rank, m_object->GetTeam()); } else if (type == OBJECT_MOBILEdr) @@ -435,7 +513,8 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type == OBJECT_MOBILEtb || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || - type == OBJECT_MOBILEts) // caterpillars? + type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt) // caterpillars? { // Creates the right caterpillar. rank = m_engine->CreateObject(); @@ -443,7 +522,10 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelCopy("lem2t.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.0f)); + if (m_object->GetTrainer() || type == OBJECT_MOBILEtt) + m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.8f)); + else + m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.0f)); // Creates the left caterpillar. rank = m_engine->CreateObject(); @@ -451,7 +533,10 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelCopy("lem3t.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.0f)); + if (m_object->GetTrainer() || type == OBJECT_MOBILEtt) + m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.8f)); + else + m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.0f)); } if (type == OBJECT_MOBILErt || @@ -552,7 +637,8 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEis || - type == OBJECT_MOBILEii) // insect legs? + type == OBJECT_MOBILEii || + type == OBJECT_MOBILEit) // insect legs? { float table[] = { @@ -895,6 +981,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt || type == OBJECT_MOBILEsa) { m_object->CreateShadowCircle(5.0f, 1.0f); @@ -1034,7 +1121,8 @@ void CMotionVehicle::CreatePhysics(ObjectType type) type == OBJECT_MOBILEtb || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || - type == OBJECT_MOBILEts ) // caterpillars? + type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt ) // caterpillars? { character->wheelFront = 4.0f; character->wheelBack = 4.0f; @@ -1064,7 +1152,8 @@ void CMotionVehicle::CreatePhysics(ObjectType type) type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEii || - type == OBJECT_MOBILEis ) // legs? + type == OBJECT_MOBILEis || + type == OBJECT_MOBILEit) // legs? { character->wheelFront = 4.0f; character->wheelBack = 4.0f; @@ -1441,6 +1530,7 @@ bool CMotionVehicle::EventFrame(const Event &event) type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt || type == OBJECT_MOBILErt || type == OBJECT_MOBILErc || type == OBJECT_MOBILErr || @@ -1471,7 +1561,8 @@ bool CMotionVehicle::EventFrame(const Event &event) if ( type == OBJECT_MOBILEta || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || - type == OBJECT_MOBILEts ) + type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt ) { limit[0] = 8.0f*Math::PI/180.0f; limit[1] = -12.0f*Math::PI/180.0f; @@ -1569,7 +1660,8 @@ bool CMotionVehicle::EventFrame(const Event &event) type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEii || - type == OBJECT_MOBILEis ) // legs? + type == OBJECT_MOBILEis || + type == OBJECT_MOBILEit ) // legs? { EventFrameInsect(event); } diff --git a/src/object/object_type.h b/src/object/object_type.h index 6d1b7039..f3acfc2e 100644 --- a/src/object/object_type.h +++ b/src/object/object_type.h @@ -101,10 +101,10 @@ enum ObjectType OBJECT_TREE3 = 93, //!< Tree3 OBJECT_TREE4 = 94, //!< Tree4 OBJECT_TREE5 = 95, //!< Tree5 - OBJECT_MOBILEwt = 100, //!< PracticeBot - OBJECT_MOBILEtt = 101, //!< track-trainer (unused) - OBJECT_MOBILEft = 102, //!< fly-trainer (unused) - OBJECT_MOBILEit = 103, //!< insect-trainer (unused) + OBJECT_MOBILEwt = 100, //!< WheeledTrainer (PracticeBot) + OBJECT_MOBILEtt = 101, //!< TrackedTrainer + OBJECT_MOBILEft = 102, //!< WingedTrainer + OBJECT_MOBILEit = 103, //!< LeggedTrainer OBJECT_MOBILEwa = 110, //!< WheeledGrabber OBJECT_MOBILEta = 111, //!< TrackedGrabber OBJECT_MOBILEfa = 112, //!< WingedGrabber @@ -133,6 +133,7 @@ enum ObjectType OBJECT_MOBILEtb = 221, //!< TrackedBuilder OBJECT_MOBILEfb = 222, //!< WingedBuilder OBJECT_MOBILEib = 223, //!< LeggedBuilder + OBJECT_MOBILEpr = 224, //!< PracticeBot (alias) OBJECT_WAYPOINT = 250, //!< WayPoint OBJECT_FLAGb = 260, //!< BlueFlag OBJECT_FLAGr = 261, //!< RedFlag diff --git a/src/object/old_object.cpp b/src/object/old_object.cpp index 685c9bd8..99b471e1 100644 --- a/src/object/old_object.cpp +++ b/src/object/old_object.cpp @@ -682,7 +682,7 @@ void COldObject::SetType(ObjectType type) m_type == OBJECT_MOBILEfs || // WingedSniffer m_type == OBJECT_MOBILEfc || // WingedShooter m_type == OBJECT_MOBILEfi || // WingedOrgaShooter - m_type == OBJECT_MOBILEft || // winged PracticeBot (unused) + m_type == OBJECT_MOBILEft || // WingedTrainer m_type == OBJECT_HUMAN || // Me m_type == OBJECT_TECH || // Tech m_type == OBJECT_CONTROLLER) @@ -2922,16 +2922,6 @@ void COldObject::UpdateSelectParticle() dim[0].x = 1.5f; dim[1].x = 1.5f; } - else if ( m_type == OBJECT_MOBILEwt || - m_type == OBJECT_MOBILEtt || - m_type == OBJECT_MOBILEft || - m_type == OBJECT_MOBILEit ) // trainer ? - { - pos[0] = Math::Vector(4.2f, 2.5f, 1.2f); - pos[1] = Math::Vector(4.2f, 2.5f, -1.2f); - dim[0].x = 1.5f; - dim[1].x = 1.5f; - } else if ( m_type == OBJECT_MOBILEsa ) // submarine? { pos[0] = Math::Vector(3.6f, 4.0f, 2.0f); @@ -2947,6 +2937,17 @@ void COldObject::UpdateSelectParticle() pos[0] = Math::Vector(4.9f, 3.5f, 2.5f); pos[1] = Math::Vector(4.9f, 3.5f, -2.5f); } + else if ( m_type == OBJECT_MOBILEwt || + m_type == OBJECT_MOBILEtt || + m_type == OBJECT_MOBILEft || + m_type == OBJECT_MOBILEit || + GetTrainer()) // trainer ? + { + pos[0] = Math::Vector(4.2f, 2.5f, 1.2f); + pos[1] = Math::Vector(4.2f, 2.5f, -1.2f); + dim[0].x = 1.5f; + dim[1].x = 1.5f; + } else { pos[0] = Math::Vector(4.2f, 2.5f, 1.5f); @@ -2954,48 +2955,49 @@ void COldObject::UpdateSelectParticle() } // Red back lens - if ( m_type == OBJECT_MOBILEfa || - m_type == OBJECT_MOBILEfb || - m_type == OBJECT_MOBILEfc || - m_type == OBJECT_MOBILEfi || - m_type == OBJECT_MOBILEfs || - m_type == OBJECT_MOBILEft ) // flying? + if ( m_type == OBJECT_MOBILEwt || + m_type == OBJECT_MOBILEtt || + m_type == OBJECT_MOBILEft || + m_type == OBJECT_MOBILEit || + GetTrainer()) // trainer? + { + pos[2] = Math::Vector(-4.0f, 2.5f, 2.2f); + pos[3] = Math::Vector(-4.0f, 2.5f, -2.2f); + } + else if ( m_type == OBJECT_MOBILEfa || + m_type == OBJECT_MOBILEfb || + m_type == OBJECT_MOBILEfc || + m_type == OBJECT_MOBILEfi || + m_type == OBJECT_MOBILEfs ) // flying? { pos[2] = Math::Vector(-4.0f, 3.1f, 4.5f); pos[3] = Math::Vector(-4.0f, 3.1f, -4.5f); dim[2].x = 0.6f; dim[3].x = 0.6f; } - if ( m_type == OBJECT_MOBILEwa || - m_type == OBJECT_MOBILEwb || - m_type == OBJECT_MOBILEwc || - m_type == OBJECT_MOBILEwi || - m_type == OBJECT_MOBILEws ) // wheels? + else if ( m_type == OBJECT_MOBILEwa || + m_type == OBJECT_MOBILEwb || + m_type == OBJECT_MOBILEwc || + m_type == OBJECT_MOBILEwi || + m_type == OBJECT_MOBILEws ) // wheels? { pos[2] = Math::Vector(-4.5f, 2.7f, 2.8f); pos[3] = Math::Vector(-4.5f, 2.7f, -2.8f); } - if ( m_type == OBJECT_MOBILEwt ) // wheels? - { - pos[2] = Math::Vector(-4.0f, 2.5f, 2.2f); - pos[3] = Math::Vector(-4.0f, 2.5f, -2.2f); - } - if ( m_type == OBJECT_MOBILEia || - m_type == OBJECT_MOBILEib || - m_type == OBJECT_MOBILEic || - m_type == OBJECT_MOBILEii || - m_type == OBJECT_MOBILEis || - m_type == OBJECT_MOBILEit ) // legs? + else if ( m_type == OBJECT_MOBILEia || + m_type == OBJECT_MOBILEib || + m_type == OBJECT_MOBILEic || + m_type == OBJECT_MOBILEii || + m_type == OBJECT_MOBILEis ) // legs? { pos[2] = Math::Vector(-4.5f, 2.7f, 2.8f); pos[3] = Math::Vector(-4.5f, 2.7f, -2.8f); } - if ( m_type == OBJECT_MOBILEta || - m_type == OBJECT_MOBILEtb || - m_type == OBJECT_MOBILEtc || - m_type == OBJECT_MOBILEti || - m_type == OBJECT_MOBILEts || - m_type == OBJECT_MOBILEtt ) // caterpillars? + else if ( m_type == OBJECT_MOBILEta || + m_type == OBJECT_MOBILEtb || + m_type == OBJECT_MOBILEtc || + m_type == OBJECT_MOBILEti || + m_type == OBJECT_MOBILEts ) // caterpillars? { pos[2] = Math::Vector(-3.6f, 4.2f, 3.0f); pos[3] = Math::Vector(-3.6f, 4.2f, -3.0f); diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index 65293510..b7aa80ba 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -991,7 +991,8 @@ void CPhysics::MotorUpdate(float aTime, float rTime) type == OBJECT_MOBILEib || type == OBJECT_MOBILEis || type == OBJECT_MOBILEic || - type == OBJECT_MOBILEii ) factor = 0.5f; + type == OBJECT_MOBILEii || + type == OBJECT_MOBILEit ) factor = 0.5f; energy = power->GetEnergy(); energy -= fabs(motorSpeed.x)*rTime*factor*0.005f; @@ -1848,7 +1849,8 @@ void CPhysics::SoundMotorFull(float rTime, ObjectType type) type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEii || - type == OBJECT_MOBILEis ) + type == OBJECT_MOBILEis || + type == OBJECT_MOBILEit ) { if ( m_soundChannel == -1 ) { @@ -1893,7 +1895,8 @@ void CPhysics::SoundMotorFull(float rTime, ObjectType type) else if ( type == OBJECT_MOBILEta || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || - type == OBJECT_MOBILEts ) + type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt ) { sound = SOUND_MOTORt; amplitude = 1.0f; @@ -1964,7 +1967,8 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type) type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEii || - type == OBJECT_MOBILEis ) + type == OBJECT_MOBILEis || + type == OBJECT_MOBILEit ) { if ( m_soundChannel != -1 ) // engine is running? { @@ -1992,7 +1996,8 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type) type == OBJECT_MOBILEtb || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || - type == OBJECT_MOBILEts ) + type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt ) { sound = SOUND_MOTORt; amplitude = 0.7f; @@ -2087,7 +2092,8 @@ void CPhysics::SoundMotorStop(float rTime, ObjectType type) type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEii || - type == OBJECT_MOBILEis ) + type == OBJECT_MOBILEis || + type == OBJECT_MOBILEit ) { if ( m_soundChannel != -1 ) // engine is running? { @@ -3041,7 +3047,8 @@ void CPhysics::MotorParticle(float aTime, float rTime) type == OBJECT_MOBILEib || type == OBJECT_MOBILEic || type == OBJECT_MOBILEii || - type == OBJECT_MOBILEis || // legs? + type == OBJECT_MOBILEis || + type == OBJECT_MOBILEit || // legs? type == OBJECT_MOBILEdr || type == OBJECT_MOTHER || type == OBJECT_ANT || @@ -3147,7 +3154,8 @@ void CPhysics::MotorParticle(float aTime, float rTime) type == OBJECT_MOBILEtb || type == OBJECT_MOBILEtc || type == OBJECT_MOBILEti || - type == OBJECT_MOBILEts ) // caterpillars? + type == OBJECT_MOBILEts || + type == OBJECT_MOBILEtt ) // caterpillars? { if ( aTime-m_lastSlideParticle >= m_engine->ParticleAdapt(0.05f) ) { diff --git a/src/script/cbottoken.cpp b/src/script/cbottoken.cpp index 2153b017..71ca67d1 100644 --- a/src/script/cbottoken.cpp +++ b/src/script/cbottoken.cpp @@ -82,7 +82,10 @@ const char* GetObjectName(ObjectType type) if ( type == OBJECT_MARKKEYb ) return "KeyBSpot"; if ( type == OBJECT_MARKKEYc ) return "KeyCSpot"; if ( type == OBJECT_MARKKEYd ) return "KeyDSpot"; - if ( type == OBJECT_MOBILEwt ) return "PracticeBot"; + if ( type == OBJECT_MOBILEwt ) return "WheeledTrainer"; + if ( type == OBJECT_MOBILEtt ) return "TrackedTrainer"; + if ( type == OBJECT_MOBILEft ) return "WingedTrainer"; + if ( type == OBJECT_MOBILEit ) return "LeggedTrainer"; if ( type == OBJECT_MOBILEwa ) return "WheeledGrabber"; if ( type == OBJECT_MOBILEta ) return "TrackedGrabber"; if ( type == OBJECT_MOBILEfa ) return "WingedGrabber"; @@ -110,6 +113,7 @@ const char* GetObjectName(ObjectType type) if ( type == OBJECT_MOBILEsa ) return "Subber"; if ( type == OBJECT_MOBILEtg ) return "TargetBot"; if ( type == OBJECT_MOBILEdr ) return "Scribbler"; + if ( type == OBJECT_MOBILEpr ) return "PracticeBot"; if ( type == OBJECT_HUMAN ) return "Me"; if ( type == OBJECT_TECH ) return "Tech"; if ( type == OBJECT_MOTHER ) return "AlienQueen"; @@ -210,6 +214,9 @@ std::string GetHelpFilename(ObjectType type) if ( type == OBJECT_MOBILErs ) helpfile = "object/botshld"; if ( type == OBJECT_MOBILEsa ) helpfile = "object/botsub"; if ( type == OBJECT_MOBILEwt ) helpfile = "object/bottr"; + if ( type == OBJECT_MOBILEtt ) helpfile = "object/bottr"; + if ( type == OBJECT_MOBILEft ) helpfile = "object/bottr"; + if ( type == OBJECT_MOBILEit ) helpfile = "object/bottr"; if ( type == OBJECT_MOBILEtg ) helpfile = "object/bottarg"; if ( type == OBJECT_MOBILEdr ) helpfile = "object/botdraw"; if ( type == OBJECT_APOLLO2 ) helpfile = "object/lrv"; diff --git a/src/script/scriptfunc.cpp b/src/script/scriptfunc.cpp index 4696ee10..2650df83 100644 --- a/src/script/scriptfunc.cpp +++ b/src/script/scriptfunc.cpp @@ -984,16 +984,30 @@ bool runRadar(CBotVar* var, std::function, float, f { while ( array != nullptr ) { + if (array->GetValInt() == OBJECT_MOBILEpr) + { + type_v.push_back(OBJECT_MOBILEwt); + type_v.push_back(OBJECT_MOBILEtt); + type_v.push_back(OBJECT_MOBILEft); + type_v.push_back(OBJECT_MOBILEit); + } type_v.push_back(static_cast(array->GetValInt())); array = array->GetNext(); } } else { - if (type != OBJECT_NULL) + if (type != OBJECT_NULL && type != OBJECT_MOBILEpr) { type_v.push_back(static_cast(type)); } + else if (type == OBJECT_MOBILEpr) + { + type_v.push_back(OBJECT_MOBILEwt); + type_v.push_back(OBJECT_MOBILEtt); + type_v.push_back(OBJECT_MOBILEft); + type_v.push_back(OBJECT_MOBILEit); + } } return code(type_v, angle, focus, minDist, maxDist, sens < 0, filter);