Пример #1
0
 // Generate an enemy around a certain difficulty level
 public Enemy(int difficulty)
 {
     _strength        = Random.Range(difficulty, 30);
     _visibility      = Random.Range(difficulty, 20);
     _aggressiveness  = Random.Range(difficulty, difficulty + 4);
     _scoutedProgress = ScoutingProgress.mystery;
     _located         = false;
     _readiness       = -5;
 }
Пример #2
0
 // =========================================================== constructor
 // Randomly generate an enemy -- should procedurally generate based off of progress
 public Enemy()
 {
     _strength        = Random.Range(0, 10);
     _visibility      = Random.Range(0, 10);
     _aggressiveness  = Random.Range(0, 10);
     _scoutedProgress = ScoutingProgress.mystery;
     _located         = false;
     _readiness       = -5;
 }
Пример #3
0
        bool _located = false;          // whether is aware by player


        public Report MakeScoutingProgress(int proficiency)
        {
            //Debug.Log ("36: Making scouting progress, proficiency:" + proficiency);
            Report r = new Report();

            if (_scoutedProgress != ScoutingProgress.exactLocation)
            {
                if (proficiency > 20)
                {
                    //increase by 2 points
                    _scoutedProgress = (ScoutingProgress)((int)_scoutedProgress + 1);
                    if (_scoutedProgress == ScoutingProgress.exactLocation)
                    {
                        _located = true;
                    }
                    _scoutedProgress = (ScoutingProgress)((int)_scoutedProgress + 1);
                    if (_scoutedProgress == ScoutingProgress.exactLocation)
                    {
                        _located = true;
                    }
                }
                else if (proficiency > 5 || Random.Range(0, 10) > 5)
                {
                    //increase by 1 point
                    _scoutedProgress = (ScoutingProgress)((int)_scoutedProgress + 1);
                    if (_scoutedProgress == ScoutingProgress.exactLocation)
                    {
                        _located = true;
                    }
                }
            }
            if (_located == true && _scoutedProgress == ScoutingProgress.exactLocation)
            {
                r.SetMessage("The exact location of an enemy camp has been located. You can attack it now.");
            }
            else
            {
                switch (_scoutedProgress)
                {
                case ScoutingProgress.mystery:
                    //r.SetMessage("Your scouts have no idea where the enemy camp is.");
                    break;

                case ScoutingProgress.vagueIdea:
                    //r.SetMessage("Your scouts have a vague idea where the enemy camp is.");
                    break;

                case ScoutingProgress.generalVicinity:
                    //r.SetMessage("Your scouts have determined the general vicinity of where the enemy camp is.");
                    break;

                case ScoutingProgress.exactLocation:
                    //r.SetMessage("Your scouts have pinpointed the exact location of the enemy camp.");
                    break;

                default:
                    //Debug.LogError("ERROR in Gameworld, _scoutedProgress is not a valid enum.");
                    break;
                }
            }


            //Debug.LogError ("Scouting progress has been made. Scouting progress is now: " + _scoutedProgress.ToString());
            return(r);
        }