Esempio n. 1
0
        public MyBotAITemplate(MyAITemplateEnum templateId, BotBehaviorType idle, BotBehaviorType seeEnemy, BotBehaviorType atackedByEnemy, BotBehaviorType lowHealth, BotBehaviorType noAmmo, BotBehaviorType curious,
                               int idlePriority, int seeEnemyPriority, int atackedByEnemyPriority, int lowHealthPriority, int noAmmoPriority, int curiousPriority)
        {
            TemplateId = templateId;

            m_selectedBehaviors = new BotBehaviorType[DESIRE_TYPE_COUNT];

            m_selectedBehaviors[(int)BotDesireType.IDLE]             = idle;
            m_selectedBehaviors[(int)BotDesireType.SEE_ENEMY]        = seeEnemy;
            m_selectedBehaviors[(int)BotDesireType.ATACKED_BY_ENEMY] = atackedByEnemy;
            m_selectedBehaviors[(int)BotDesireType.NO_AMMO]          = noAmmo;
            m_selectedBehaviors[(int)BotDesireType.LOW_HEALTH]       = lowHealth;
            m_selectedBehaviors[(int)BotDesireType.CURIOUS]          = curious;
            m_selectedBehaviors[(int)BotDesireType.KILL]             = BotBehaviorType.ATTACK;
            m_selectedBehaviors[(int)BotDesireType.FLASHED]          = BotBehaviorType.PANIC;

            m_priorities = new int[DESIRE_TYPE_COUNT];

            m_priorities[(int)BotDesireType.IDLE]             = idlePriority;
            m_priorities[(int)BotDesireType.SEE_ENEMY]        = seeEnemyPriority;
            m_priorities[(int)BotDesireType.ATACKED_BY_ENEMY] = atackedByEnemyPriority;
            m_priorities[(int)BotDesireType.NO_AMMO]          = noAmmoPriority;
            m_priorities[(int)BotDesireType.LOW_HEALTH]       = lowHealthPriority;
            m_priorities[(int)BotDesireType.CURIOUS]          = curiousPriority;
            m_priorities[(int)BotDesireType.KILL]             = 1000;
            m_priorities[(int)BotDesireType.FLASHED]          = 2000;

            // IMPORTANT: Don't forget to modify GetCopy() method
        }
Esempio n. 2
0
        public MyBotAITemplate(MyAITemplateEnum templateId, BotBehaviorType idle, BotBehaviorType seeEnemy, BotBehaviorType atackedByEnemy, BotBehaviorType lowHealth, BotBehaviorType noAmmo, BotBehaviorType curious,
                             int idlePriority, int seeEnemyPriority, int atackedByEnemyPriority, int lowHealthPriority, int noAmmoPriority, int curiousPriority)
        {
            TemplateId = templateId;

            m_selectedBehaviors = new BotBehaviorType[DESIRE_TYPE_COUNT];

            m_selectedBehaviors[(int)BotDesireType.IDLE] = idle;
            m_selectedBehaviors[(int)BotDesireType.SEE_ENEMY] = seeEnemy;
            m_selectedBehaviors[(int)BotDesireType.ATACKED_BY_ENEMY] = atackedByEnemy;
            m_selectedBehaviors[(int)BotDesireType.NO_AMMO] = noAmmo;
            m_selectedBehaviors[(int)BotDesireType.LOW_HEALTH] = lowHealth;
            m_selectedBehaviors[(int)BotDesireType.CURIOUS] = curious;
            m_selectedBehaviors[(int)BotDesireType.KILL] = BotBehaviorType.ATTACK;
            m_selectedBehaviors[(int)BotDesireType.FLASHED] = BotBehaviorType.PANIC;

            m_priorities = new int[DESIRE_TYPE_COUNT];

            m_priorities[(int)BotDesireType.IDLE] = idlePriority;
            m_priorities[(int)BotDesireType.SEE_ENEMY] = seeEnemyPriority;
            m_priorities[(int)BotDesireType.ATACKED_BY_ENEMY] = atackedByEnemyPriority;
            m_priorities[(int)BotDesireType.NO_AMMO] = noAmmoPriority;
            m_priorities[(int)BotDesireType.LOW_HEALTH] = lowHealthPriority;
            m_priorities[(int)BotDesireType.CURIOUS] = curiousPriority;
            m_priorities[(int)BotDesireType.KILL] = 1000;
            m_priorities[(int)BotDesireType.FLASHED] = 2000;

            // IMPORTANT: Don't forget to modify GetCopy() method
        }
Esempio n. 3
0
 public MyMwcObjectBuilder_SmallShip_Bot(MyMwcObjectBuilder_SmallShip smallShip,
                                         MyAITemplateEnum aiTemplate,
                                         float aggressivity,
                                         float seeDistance,
                                         float sleepDistance,
                                         MyPatrolMode patrolMode,
                                         int?shipTemplateId,
                                         uint?leader,
                                         BotBehaviorType idleBehavior,
                                         int aiPriority,
                                         bool leaderLostEnabled,
                                         bool activeAI)
     : this(smallShip.ShipType, smallShip.Inventory, smallShip.Weapons, smallShip.Engine, smallShip.AssignmentOfAmmo, smallShip.Armor, smallShip.Radar,
            smallShip.ShipMaxHealth, smallShip.ShipHealthRatio, smallShip.ArmorHealth, smallShip.Oxygen, smallShip.Fuel,
            smallShip.ReflectorLight, smallShip.ReflectorLongRange, smallShip.Faction, aiTemplate, aggressivity, seeDistance, sleepDistance, patrolMode, leader, idleBehavior, smallShip.ReflectorShadowDistance,
            aiPriority, leaderLostEnabled, activeAI)
 {
     ShipTemplateID = shipTemplateId;
 }
Esempio n. 4
0
 public MyMwcObjectBuilder_SmallShip_Bot(MyMwcObjectBuilder_SmallShip_TypesEnum shipType,
                                         MyMwcObjectBuilder_Inventory inventory,
                                         List <MyMwcObjectBuilder_SmallShip_Weapon> weapons,
                                         MyMwcObjectBuilder_SmallShip_Engine engine,
                                         List <MyMwcObjectBuilder_AssignmentOfAmmo> assignmentOfAmmo,
                                         MyMwcObjectBuilder_SmallShip_Armor armor,
                                         MyMwcObjectBuilder_SmallShip_Radar radar,
                                         float?shipMaxHealth,
                                         float shipHealthRatio,
                                         float armorHealth,
                                         float oxygen,
                                         float fuel,
                                         bool reflectorLight,
                                         bool reflectorLongRange,
                                         MyMwcObjectBuilder_FactionEnum shipFaction,
                                         MyAITemplateEnum aiTemplate,
                                         float aggressivity,
                                         float seeDistance,
                                         float sleepDistance,
                                         MyPatrolMode patrolMode,
                                         uint?leader,
                                         BotBehaviorType idleBehavior,
                                         float reflectorShadowDistance,
                                         int aiPriority,
                                         bool leaderLostEnabled,
                                         bool activeAI)
     : base(shipType, inventory, weapons, engine, assignmentOfAmmo, armor, radar, shipMaxHealth, shipHealthRatio, armorHealth, oxygen, fuel, reflectorLight, reflectorLongRange, reflectorShadowDistance, aiPriority)
 {
     Faction           = shipFaction;
     AITemplate        = aiTemplate;
     Aggressivity      = aggressivity;
     SeeDistance       = seeDistance;
     SleepDistance     = sleepDistance;
     PatrolMode        = patrolMode;
     Leader            = leader;
     IdleBehavior      = idleBehavior;
     LeaderLostEnabled = leaderLostEnabled;
     ActiveAI          = activeAI;
     SlowDown          = 1;
 }
Esempio n. 5
0
        public MyBotBehaviorBase GetBehavior(BotDesireType desire)
        {
            BotBehaviorType behaviorType = m_selectedBehaviors[(int)desire];

            switch (behaviorType)
            {
            case BotBehaviorType.IGNORE:
                return(null);

            case BotBehaviorType.PATROL:
                return(new MyBotBehaviorPatrol());

            case BotBehaviorType.FOLLOW:
                return(new MyBotBehaviorFollow());

            case BotBehaviorType.ATTACK:
                return(new MyBotBehaviorAttack());

            case BotBehaviorType.RUN_AWAY:
                return(new MyBotBehaviorRunAway());

            case BotBehaviorType.PANIC:
                return(new MyBotBehaviorPanic());

            case BotBehaviorType.KAMIKADZE:
                return(new MyBotBehaviorKamikadze());

            case BotBehaviorType.IDLE:
                return(new MyBotBehaviorIdle());

            case BotBehaviorType.CURIOUS:
                return(new MyBotBehaviorCurious());
            }
            System.Diagnostics.Debug.Fail("Unexpected behavior: " + behaviorType);
            return(null);
        }
Esempio n. 6
0
 public void SetIdleBehavior(BotBehaviorType idleBehavior)
 {
     m_selectedBehaviors[(int)BotDesireType.IDLE] = idleBehavior;
 }
Esempio n. 7
0
 public void SetIdleBehavior(BotBehaviorType idleBehavior)
 {
     m_selectedBehaviors[(int)BotDesireType.IDLE] = idleBehavior;
 }
 public MyMwcObjectBuilder_SmallShip_Bot(MyMwcObjectBuilder_SmallShip smallShip,
     MyAITemplateEnum aiTemplate,
     float aggressivity,
     float seeDistance,
     float sleepDistance,
     MyPatrolMode patrolMode,
     int? shipTemplateId,
     uint? leader,
     BotBehaviorType idleBehavior,
     int aiPriority,
     bool leaderLostEnabled,
     bool activeAI)
     : this(smallShip.ShipType, smallShip.Inventory, smallShip.Weapons, smallShip.Engine, smallShip.AssignmentOfAmmo, smallShip.Armor, smallShip.Radar,
     smallShip.ShipMaxHealth, smallShip.ShipHealthRatio, smallShip.ArmorHealth, smallShip.Oxygen, smallShip.Fuel,
     smallShip.ReflectorLight, smallShip.ReflectorLongRange, smallShip.Faction, aiTemplate, aggressivity, seeDistance, sleepDistance, patrolMode, leader, idleBehavior, smallShip.ReflectorShadowDistance,
     aiPriority, leaderLostEnabled, activeAI) 
 {
     ShipTemplateID = shipTemplateId;
 }
 public MyMwcObjectBuilder_SmallShip_Bot(MyMwcObjectBuilder_SmallShip_TypesEnum shipType,
     MyMwcObjectBuilder_Inventory inventory,
     List<MyMwcObjectBuilder_SmallShip_Weapon> weapons,
     MyMwcObjectBuilder_SmallShip_Engine engine, 
     List<MyMwcObjectBuilder_AssignmentOfAmmo> assignmentOfAmmo,
     MyMwcObjectBuilder_SmallShip_Armor armor,
     MyMwcObjectBuilder_SmallShip_Radar radar,            
     float? shipMaxHealth,
     float shipHealthRatio,
     float armorHealth,
     float oxygen,
     float fuel,
     bool reflectorLight,
     bool reflectorLongRange,
     MyMwcObjectBuilder_FactionEnum shipFaction,
     MyAITemplateEnum aiTemplate,
     float aggressivity,
     float seeDistance,
     float sleepDistance,
     MyPatrolMode patrolMode,
     uint? leader,
     BotBehaviorType idleBehavior,
     float reflectorShadowDistance,
     int aiPriority,
     bool leaderLostEnabled,
     bool activeAI)
     : base(shipType, inventory, weapons, engine, assignmentOfAmmo, armor, radar, shipMaxHealth, shipHealthRatio, armorHealth, oxygen, fuel, reflectorLight, reflectorLongRange, reflectorShadowDistance, aiPriority)
 {
     Faction = shipFaction;
     AITemplate = aiTemplate;
     Aggressivity = aggressivity;
     SeeDistance = seeDistance;
     SleepDistance = sleepDistance;
     PatrolMode = patrolMode;
     Leader = leader;
     IdleBehavior = idleBehavior;
     LeaderLostEnabled = leaderLostEnabled;
     ActiveAI = activeAI;
     SlowDown = 1;
 }