Esempio n. 1
0
    public override float Start()
    {
        GameState.SetBoon(BoonType.BONUS_FOOD_PERCENT, GameState.GetBoonValue(BoonType.BONUS_FOOD_PERCENT) - 50);
        // ~15s at minute 0, ~20s at minute 4, ~25s at minute 9, ~30s at minute 16
        float diffIncrease = Mathf.Sqrt(GameState.GameTimeElapsed / 60f);

        mDuration   = (Random.Range(13, 18) + Mathf.FloorToInt(5 * diffIncrease));
        mIntervened = false;

        Image background = Utilities.GetBackground();

        mPrevBackgroundSprite = background.sprite;
        background.sprite     = Utilities.GetSpriteManager().GetSprite("DroughtBackground");

        string description = "-50% food production for " + mDuration + " seconds";

        mOngoing = new Ongoing("DROUGHT", "Drought!", description, mDuration, false);
        GameState.Ongoings.Add(mOngoing);
        Utilities.LogEvent("A drought has befallen your farmland", 1f);
        mDemandId = Utilities.GetGod().AddFleetingDemand(
            (int)diffIncrease,
            new GodIntervention(this),
            null,
            mDuration,
            "God offers RAIN in exchange for "
            );

        return(mDuration);
    }
        public FertilityEvent(int boost, float duration)
        {
            mBoost    = boost;
            mDuration = duration;
            string description = "+" + mBoost + "% birth rate";

            mOngoing = new Ongoing("BirthRateBoost", sName, description, mDuration, true);
        }
Esempio n. 3
0
    public override float Start()
    {
        mDuration = 60f;
        int difficultyBoost = Mathf.FloorToInt(GameState.GameTimeElapsed / 90);

        mRequiredWarriors     = Random.Range(1, 3) + difficultyBoost;
        GameState.InvaderSize = mRequiredWarriors;

        Utilities.LogEvent("An enemy army approaches! They look to be " + mRequiredWarriors + " strong");
        mOngoing = new Ongoing("ATTACK", "Invaders!", mRequiredWarriors + " enemy warrior" + (mRequiredWarriors == 1 ? " approaches" : "s approach") + "!\r\n(Match their numbers with your army)", mDuration, false);
        GameState.Ongoings.Add(mOngoing);

        mIntervened = false;
        mDemandId   = Utilities.GetGod().AddFleetingDemand(
            difficultyBoost,
            new InvaderAttack.GodIntervention(this),
            null,
            mDuration,
            "God offers PROTECTION in exchange for "
            );     // for now, will just let the god generate the random demand

        return(mDuration);
    }
Esempio n. 4
0
 public GoodCropEvent(int boost, float duration)
 {
     mBoost    = boost;
     mDuration = duration;
     mOngoing  = new Ongoing("FoodBoost", "Blessed Crops", sDesc, mDuration, true);
 }