Exemplo n.º 1
0
    // wound a random defender
    public void WoundRandomDefender(ArrayList reports)
    {
        int length = 0;

        foreach (Survivor s in _survivors)
        {
            if (Random.Range(0, 10) > 5 && (s.AssignedTask == Survivor.task.Defend || s.AssignedTask == Survivor.task.Heal || s.AssignedTask == Survivor.task.Resting || s.AssignedTask == Survivor.task.Unassigned))
            {
                Report         r = new Report();
                Survivor.wound w = Survivor.wound.Uninjured;
                s.WoundCheck(this, r, 0, "defending", "defend", ref w);

                if (w != Survivor.wound.Uninjured)
                {
                    if (s.Health > 0)
                    {
                        r.SetMessage(s.Name + " died defending.");
                    }
                    else
                    {
                        r.SetMessage(s.Name + " sustained a " + w.ToString() + " wound defending.");
                    }
                    reports.Add(r);
                }
            }
        }
    }
Exemplo n.º 2
0
    // Scavenge.
    public Report Scavenge(Shelter s)
    {
        Report r         = new Report();
        int    spillover = 0;

        if (Fatigue < 0)
        {
            spillover = Mathf.Abs(Fatigue);
        }
        int fatigueModifier = -Fatigue / 10;
        int proficiency     = GetProficiency(task.Scavenge) + fatigueModifier;

        Survivor.wound sustainedWound = Survivor.wound.Uninjured;

        if (WoundCheck(s, r, proficiency, "scavenging", "scavenge", ref sustainedWound))
        {
            int sFood     = 0;
            int sMedicine = 0;
            int sParts    = 0;

            int qualityMultiplier = 1 + (int)_gameWorld.ScavengeQualityLevel;

            switch (_gameWorld.ScavengeTarget)
            {
            case GameWorld.ScavengeableLocation.GroceryStore:
                sFood += 1 + qualityMultiplier * (int)(Random.Range(3, 6) * (Mathf.Max(proficiency + fatigueModifier + 11, 3)) * .5f);
                r.SetMessage(_name + " scavenged " + sFood + " food.");
                s.Food += sFood;
                break;

            case GameWorld.ScavengeableLocation.Hospital:
                sMedicine += 1 + qualityMultiplier * (int)(Random.Range(3, 6) * (Mathf.Max(proficiency + fatigueModifier + 11, 3)) * .5f);
                r.SetMessage(_name + " scavenged " + sMedicine + " medicine.");
                s.Medicine += sMedicine;
                break;


            case GameWorld.ScavengeableLocation.Mall:
                sParts += 1 + qualityMultiplier * (int)(Random.Range(3, 6) * (Mathf.Max(proficiency + fatigueModifier + 11, 3)) * .5f);
                if (sParts == 1)
                {
                    r.SetMessage(_name + " scavenged " + sParts + " part.");
                }
                else
                {
                    r.SetMessage(_name + " scavenged " + sParts + " parts.");
                }
                s.Parts += sParts;
                break;
            }

            if (sustainedWound != Survivor.wound.Uninjured)
            {
                r.AddWoundMessage(sustainedWound);
            }
        }
        return(r);
    }
Exemplo n.º 3
0
    // wound a random raider.
    public void WoundRandomRaider(ArrayList reports)
    {
        int length = 0;

        foreach (Survivor s in _survivors)
        {
            if (s.AssignedTask == Survivor.task.Raiding)
            {
                Report         r = new Report();
                Survivor.wound w = Survivor.wound.Uninjured;
                s.WoundCheck(this, r, 0, "raiding", "raid", ref w);
                reports.Add(r);
            }
        }
    }
Exemplo n.º 4
0
 public void AddWoundMessage(Survivor.wound sustainedWound)
 {
     _message += " In the process a " + sustainedWound.ToString().ToLower() + " wound was sustained.";
 }