示例#1
0
    // Defend the specified shelter s.
    public Report Defend(Shelter s)
    {
        int spillover = 0;

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

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

        Shelter.DefenseLevel newDefenses = s.BolsterDefenses(proficiency);

        string defenseDescription = " undefended.";

        switch (newDefenses)
        {
        case Shelter.DefenseLevel.Undefended:
            defenseDescription = " undefended.";
            break;

        case Shelter.DefenseLevel.BarelyDefended:
            defenseDescription = " barely defended.";
            break;

        case Shelter.DefenseLevel.SlightlyDefended:
            defenseDescription = " slightly defended.";
            break;

        case Shelter.DefenseLevel.ModeratelyDefended:
            defenseDescription = " moderately defended.";
            break;

        case Shelter.DefenseLevel.HeavilyDefended:
            defenseDescription = " heavily defended.";
            break;

        case Shelter.DefenseLevel.WellDefended:
            defenseDescription = " well defended.";
            break;

        case Shelter.DefenseLevel.InpenetrableFortress:
            defenseDescription = " very well defended.";
            break;

        default:
            defenseDescription = " undefended.";
            break;
        }


        Report r = new Report();

        r.SetMessage(_name + " bolstered defenses to" + defenseDescription);
        return(r);
    }
示例#2
0
    // Rest.
    public Report Rest(Shelter s)
    {
        Report r           = new Report();
        int    restoration = RestMe();
        int    proficiency = GetProficiency(task.Defend);

        s.BolsterDefenses(proficiency / 4);

        if (restoration > 0)
        {
            r.SetMessage(_name + "'s fatigue is restored to " + restoration);
        }
        else if (restoration < 0)
        {
            r.SetMessage(_name + " has rested to " + restoration + " points.");
        }
        else
        {
            r.SetMessage(_name + " has rested to " + restoration + " points.");
        }
        return(r);
    }