示例#1
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// </summary>
        public BasicDefense(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_CTFHQ _ctfhq, Player _owner)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            //Handle movements
            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            //Our weapon to use when we are close to the enemy
            _weaponClose = new WeaponController(_state, new WeaponController.WeaponSettings());
            _weaponFar   = new WeaponController(_state, new WeaponController.WeaponSettings());

            //Equip our normal weapon
            if (type.InventoryItems[0] != 0)
            {
                _weaponFar.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            //Setup our second weapon
            if (type.InventoryItems[1] != 0)
            {
                _weaponClose.equip(AssetManager.Manager.getItemByID(type.InventoryItems[1]));
            }



            ctfhq = _ctfhq;
            owner = _owner;
        }
    protected void Awake()
    {
        _steeringController = GetComponent<SteeringController>();
        _return = GetComponent<FS_Marge_ReturnHomer>();

        _pathFinder = GameObject.Find("PathFinder").GetComponent<PathFinder>();
    }
 protected void Awake()
 {
     _steeringController = GetComponent<SteeringController>();
     _flock = GetComponent<FS_Homer_Flock>();
     _escape = GetComponent<FS_Homer_Escape>();
     _homer = GetComponent<Homer>();
 }
示例#4
0
 protected void Awake()
 {
     _steeringController = GetComponent <SteeringController>();
     _wander             = GetComponent <FS_Homer_Wander>();
     _escape             = GetComponent <FS_Homer_Escape>();
     _homer = GetComponent <Homer>();
 }
示例#5
0
 void Awake()
 {
     this.steering = this.gameObject.GetComponent <SteeringController>();
     this.animator = this.gameObject.GetComponent <Animator>();
     this.ik       = this.animator.GetComponent <IKController>();
     this.RegisterWithIK();
 }
示例#6
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// Type = Vehicle bot uses
        /// State = direction and location of bot for spawn
        /// Arena = the arena the bot is in
        /// Team = the team the bot is on
        /// Lane = the lane the bot is assigned to [0=top,1=mid,2=bottom]
        /// Side = the side we are on, 0 = left -- 1 = right
        /// </summary>
        public RangeMinion(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_MOBA moba, Team team, int lane, int side)
        //: base(
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random(Environment.TickCount);

            _lane      = lane;
            _team      = team;
            _moba      = moba;
            _attacking = false;
            _side      = side;

            if (_side == 0)
            {
                _atWaypoint = 0;
            }
            else
            {
                _atWaypoint = _maxWaypoints;
            }

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;


            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }
        }
示例#7
0
        public void Initialize(Species species)
        {
            _builder = GetComponent <CreatureBuilder>();

            _species = species;
            _species.OnMutationAdded   += OnMutationAdded;
            _species.OnMutationRemoved += OnMutationRemoved;

            _senseses = GetComponentInChildren <Senses>();

            _steering = GetComponent <SteeringController>();
            _steering.AddBehaviour <PredatorAvoidance>();
            _steering.AddBehaviour <Pursuit>();
            _steering.AddBehaviour <Arrive>();
            _steering.AddBehaviour <Wander>();
            _steering.DisableAll();

            _health  = species.GetStat(StatType.Health);
            Calories = species.CalorieConsumption / 2.0f;

            for (int i = 0; i < _species.MutationCount; i++)
            {
                OnMutationAdded(_species.GetMutation(i));
            }

            UpdateStats();

            RethinkState();

            name += " -" + species.Name;
        }
示例#8
0
 protected void Awake()
 {
     _steeringController = GetComponent <SteeringController>();
     _wander             = GetComponent <FS_Marge_Wander>();
     _dropPoint          = GetComponent <Enemy>().zone.transform;
     _pathFinder         = GameObject.Find("PathFinder").GetComponent <PathFinder>();
 }
示例#9
0
    protected void Awake()
    {
        _steeringController = GetComponent <SteeringController>();
        _return             = GetComponent <FS_Marge_ReturnHomer>();

        _pathFinder = GameObject.Find("PathFinder").GetComponent <PathFinder>();
    }
示例#10
0
 void Awake()
 {
     this.steering = this.gameObject.GetComponent<SteeringController>();
     this.animator = this.gameObject.GetComponent<Animator>();
     this.ik = this.animator.GetComponent<IKController>();
     this.RegisterWithIK();
 }
示例#11
0
    protected void Awake()
    {
        _steeringController = GetComponent <SteeringController>();
        _catch = GetComponent <FS_Marge_CatchHomer>();
        _marge = GetComponent <Marge>();

        _pathFinder = GameObject.Find("PathFinder").GetComponent <PathFinder>();
    }
示例#12
0
    void Awake()
    {
        this.steering = this.gameObject.GetComponent <SteeringController>();
        if (this.steering == null)
        {
            this.steering = transform.gameObject.AddComponent <SteeringController>();
        }

        this.animator = this.gameObject.GetComponent <Animator>();
    }
        private void OnValidate()
        {
            steering      = GetComponent <SteeringController>();
            steeringAgent = GetComponent <SteeringAgent>();

            if (Application.isPlaying)
            {
                SetInput(isPlayerControlled);
            }
        }
示例#14
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// Type = Vehicle bot uses
        /// State = direction and location of bot for spawn
        /// Arena = the arena the bot is in
        /// </summary>
        public RangeMinion(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_Fantasy script, int ID)
        //: base(
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random(Environment.TickCount);

            _attacking = false;

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;


            //Assign all our stats
            foreach (var p in script._spawns)
            {
                if (p.ID == ID)
                {//Found our entry, now set all the settings
                    //Targetting settings
                    targetBot      = p.atkBots;
                    targetVehicles = p.atkVeh;
                    targetPlayer   = p.atkPlayer;

                    _homeID = p.spawnID;
                    _vehID  = p.vehID;
                    //Spawn point settings
                    //p.relyOnSpawn;

                    //Distances
                    _defenseRadius    = p.defenseRadius;
                    _distanceFromHome = p.distanceFromHome;
                    _radiusToPatrol   = p.patrolRadius;
                    _lockInTime       = p.lockInTime;
                    _attackRadius     = p.attackRadius;
                    foreach (var w in p._weapons)
                    {
                        _weapons.Add(new BotWeapon(w.ID));
                        _weapons[w.ID].weaponID       = w.weaponID;
                        _weapons[w.ID].allChance      = w.allChance;
                        _weapons[w.ID].shortChance    = w.shortChance;
                        _weapons[w.ID].midChance      = w.midChance;
                        _weapons[w.ID].longChance     = w.longChance;
                        _weapons[w.ID].preferredRange = w.preferredRange;
                    }
                    _midRange  = p.shortRange + 1;
                    _longRange = p.longRange + 1;
                }
            }
            //By default set out current weapon to close range
            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }
        }
示例#15
0
 void UpdateFlies()
 {
     GameObject[] flys = GameObject.FindGameObjectsWithTag("Fly");
     foreach (GameObject fly in flys)
     {
         SteeringController sc = fly.GetComponent <SteeringController>();
         if (sc != null)
         {
             sc.avoidObstacles = (PlayerPrefs.GetInt("AvoidObstacles") == 1)? true : false;
         }
     }
 }
示例#16
0
    // Use this for initialization
    void Start()
    {
        thisRb = GetComponent <Rigidbody>();
        thisRb.freezeRotation = true;

        steeringController = GameObject.Find("SteeringController").GetComponent <SteeringController>();
        steeringController.AddCharacter(gameObject);

        this.position    = transform.position;
        this.velocity    = thisRb.velocity;
        this.orientation = transform.eulerAngles.y;
        this.rotation    = 0.0f;
    }
示例#17
0
 // Update is called once per frame
 void Update()
 {
     if (this.targetPos != this.target.transform.position)
     {
         this.targetPos = this.target.transform.position;
         SteeringController steering =
             GetComponent <SteeringController>();
         if (steering != null)
         {
             steering.Target = this.targetPos;
         }
     }
 }
示例#18
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.P) == true)
     {
         this.targetPos = this.target.transform.position;
         SteeringController steering =
             GetComponent <SteeringController>();
         if (steering != null)
         {
             steering.Target = this.targetPos;
         }
     }
 }
示例#19
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// </summary>
        public RoamingAttacker(VehInfo.Car type, Helpers.ObjectState state, Arena arena)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }
        }
示例#20
0
        protected SteeringController steering;  //System for controlling the bot's steering


        public Chopper(VehInfo.Car type, Helpers.ObjectState state, Arena arena)
        //: base(
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random(Environment.TickCount);

            steering = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }
        }
        public EliteMarine(VehInfo.Car type, Helpers.ObjectState state, Arena arena)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;
            _rand       = new Random();
            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            _actionQueue = new List <Action>();
        }
示例#22
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// </summary>
        public JungleBot(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_MOBA _ctfhq, Vehicle home)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _home = home;

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }
        }
示例#23
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Generic constructor
        /// </summary>
        public CombatBot(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_ZombieZone _zz, Player engineer)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            zz      = _zz;
            creator = engineer;
        }
示例#24
0
        private bool _hq;                       //Tells us if HQ exists

        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// </summary>
        public Engineer(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_CTFHQ _ctfhq)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            ctfhq         = _ctfhq;
            _tickLastRet  = 0;
            _tickLastHeal = 0;
        }
示例#25
0
        public Juggernaut(VehInfo.Car type, Helpers.ObjectState state, Arena arena)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;
            _rand       = new Random();
            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            _shotsFired = new List <Projectile>();

            _tickSpawned = Environment.TickCount;
        }
示例#26
0
 void UpdateFlies()
 {
     GameObject[] flys = GameObject.FindGameObjectsWithTag("Fly");
     foreach (GameObject fly in flys)
     {
         SteeringController sc = fly.GetComponent <SteeringController>();
         if (sc != null)
         {
             if (gameMaster != null)
             {
                 sc.avoidObstacles = gameMaster.FlyDemoObstacleAvoidance;
             }
             else
             {
                 sc.avoidObstacles = true;
             }
         }
     }
 }
示例#27
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// </summary>
        public Captain(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_Eol BaseScript, Player _owner)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            _baseScript = BaseScript;
            owner       = _owner;
            //figure out method to keep track of level if they died otherwise they will multiply bots - big bug
            lastCheckedLevel = 2; //They had to have gotton to level two to get a bot
        }
示例#28
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////

        /// <summary>
        /// Generic constructor
        /// Type = Vehicle bot uses
        /// State = direction and location of bot for spawn
        /// Arena = the arena the bot is in
        /// Team = the team the bot is on
        /// Lane = the lane the bot is assigned to [0=top,1=mid,2=bottom]
        /// </summary>
        public Projectile(VehInfo.Car type, Helpers.ObjectState state, Arena arena, Script_MOBA moba, Team team)
        //: base(
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random(Environment.TickCount);

            _team = team;
            _moba = moba;

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }

            _lifeTime = Environment.TickCount;
        }
示例#29
0
    // Use this for initialization
    void Start()
    {
        appraisal       = GetComponent <Appraisal>();
        agentComponent  = GetComponent <AgentComponent>();
        affectComponent = GetComponent <AffectComponent>();
        steering        = GetComponent <SteeringController>();

        //   navmeshAgent.radius -= 0.1f; //smaller than regular size
        //navmeshAgent.speed += 0.6f; //faster than regular speed
        agentComponent.walkingSpeed = steering.maxSpeed;

        counterPos    = GameObject.Find("counter").transform.position;
        cashier       = GameObject.Find("cashier");
        storeEntrance = GameObject.Find("storeEntrance");

        acquiredObjCnt = 0;
        desiredObjCnt  = (int)(5f * affectComponent.personality[(int)OCEAN.E] + 6f); //correlated to extroversion [1 11]


        InitAppraisalStatus();
    }
示例#30
0
    // Use this for initialization
    void Start()
    {
        if (Random.Range(0, 1) == 0) //randomise the turn Direction
        {
            PreferedTurnDir = -1;
        }

        SteerController = GetComponent <SteeringController>();

        HomePosition      = transform.position;
        DefendingPosition = transform.position;
        AttackingPosition = AttackPoint.transform.position;

        CurrentState  = ReturnToHomeRegion.Instance();
        PreviousState = ReturnToHomeRegion.Instance();
        GlobalState   = GlobalPlayerState.Instance();

        CurrentState.Enter(gameObject);

        UpdateStateText();

        NextKick = Time.time + KickDelay;
    }
示例#31
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Generic constructor
        /// </summary>
        public Troop(VehInfo.Car type, Helpers.ObjectState state, Arena arena)
            : base(type, state, arena,
                   new SteeringController(type, state, arena))
        {
            Random rnd = new Random();

            _seperation = (float)rnd.NextDouble();
            steering    = _movement as SteeringController;

            if (type.InventoryItems[0] != 0)
            {
                _weapon.equip(AssetManager.Manager.getItemByID(type.InventoryItems[0]));
            }


            settings = new WeaponController.WeaponSettings();

            settings.aimFuzziness = 8;

            _weapon.setSettings(settings);

            _shotsFired = new List <Projectile>();
            _energy     = c_maxEnergy;
        }
示例#32
0
 private void OnValidate()
 {
     steering = GetComponent <SteeringController>();
 }
示例#33
0
 // Use this for initialization
 void Awake()
 {
     this._coordinator = this.gameObject.GetComponent <Coordinator>();
     this._steering    = this.gameObject.GetComponent <SteeringController>();
 }
示例#34
0
    // Use this for initialization
    void Start()
    {
        appraisal = GetComponent<Appraisal>();
        agentComponent = GetComponent<AgentComponent>();
        affectComponent = GetComponent<AffectComponent>();
        steering = GetComponent<SteeringController>();

         //   navmeshAgent.radius -= 0.1f; //smaller than regular size
        //navmeshAgent.speed += 0.6f; //faster than regular speed
        agentComponent.walkingSpeed = steering.maxSpeed;

        counterPos = GameObject.Find("counter").transform.position;
        cashier = GameObject.Find("cashier");
        storeEntrance = GameObject.Find("storeEntrance");

        acquiredObjCnt = 0;
        desiredObjCnt = (int)(5f * affectComponent.personality[(int)OCEAN.E] + 6f); //correlated to extroversion [1 11]

        InitAppraisalStatus();
    }
示例#35
0
 // Use this for initialization
 void Awake()
 {
     this._coordinator = this.gameObject.GetComponent<BodyCoordinator>();
     this._steering = this.gameObject.GetComponent<SteeringController>();
 }
示例#36
0
 protected void Awake()
 {
     _steeringController = GetComponent<SteeringController>();
     _wander = GetComponent<FS_Homer_Wander>();
     _homer = GetComponent<Homer>();
 }