Ejemplo n.º 1
0
    /// <summary>
    /// Raid the specified shelter.
    /// </summary>
    /// <param name="s">S.</param>
    public Report Raid(Shelter s)
    {
        // boost up to 3 points by using 3 food, 3 medicine and 3 parts
        int boost = 0;

        if (s.ConsumeFood(3))
        {
            boost++;
        }
        if (s.ConsumeMedicine(3))
        {
            boost++;
        }

        if (s.ConsumeParts(3))
        {
            boost++;
        }

        int spillover = 0;

        if (Fatigue < 0)
        {
            spillover = Mathf.Abs(Fatigue);
        }
        int fatigueModifier = -Fatigue / 10;

        int proficiency = GetProficiency(task.Raiding) + fatigueModifier + boost;
        int newAttack   = s.BolsterAttack(proficiency);

        Report r = new Report();

        r.SetMessage(_name + " bolstered attack strength to " + newAttack);
        return(r);
    }
Ejemplo n.º 2
0
    // =================================================== tasks
    // scout
    public ArrayList Scout(Shelter s)
    {
        int boost = 0;

        if (s.ConsumeFood(1))
        {
            boost++;
        }

        Report rTemporary = new Report();

        int spillover = 0;

        if (Fatigue < 0)
        {
            spillover = Mathf.Abs(Fatigue);
        }
        int fatigueModifier = -Fatigue / 10;

        int proficiency = GetProficiency(task.Scout) + 10 + fatigueModifier;

        wound sWound = wound.Uninjured;

        ArrayList NewReps = new ArrayList();

        if (WoundCheck(s, rTemporary, proficiency, "scouting", "scout", ref sWound))
        {
            int locationBonus = (int)Mathf.Pow(Random.Range(1.0f, 4.0f) * proficiency, .36f);


            _gameWorld.AddScoutingBonus(locationBonus);
            if (sWound == wound.Uninjured)
            {
                rTemporary.SetMessage(_name + " successfully scouted and helped to locate a scavenging target.");
            }
            else
            {
                rTemporary.SetMessage(_name + " sustained a " + sWound.ToString() + " wound while scouting but still helped to locate a scavenging target.");
            }
            //Look for enemy camps
            NewReps = _gameWorld.ScoutForShelters(proficiency + boost);
        }
        if (rTemporary.IsInitialized())
        {
            NewReps.Add(rTemporary);
        }
        return(NewReps);
    }