Esempio n. 1
0
    public void TravelEventCallBack()
    {
        if (flipped)
        {
            postFlipSanityTokens++;
            GameManager.SingleInstance.App.Controller.ancientOneController.UpdatePostFlipTokenVal(postFlipSanityTokens);
        }

        targetInvestigator.BecomeDelayed();

        targetInvestigator.SetIncomingDamage(1);
        GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(LoseSanity); // Create Queue
        GameManager.SingleInstance.App.Model.eventModel.LoseSanityEvent(targetInvestigator, 1);    // Populate Queue
        GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();            // Start Queue
    }
Esempio n. 2
0
    public override void FinishEncounter(bool passed)
    {
        Investigator active = GameManager.SingleInstance.App.Model.encounterMenuModel.currentInvestigator;

        if (passed)
        {
            // Gain this Clue and 1 additional Clue
            Location l = active.currentLocation;
            Clue     c = l.cluesOnLocation[0];

            GameManager.SingleInstance.App.Controller.locationController.MoveClueFromLocation(c, l);
            active.GainClue(c);
            GameManager.SingleInstance.App.Model.clueModel.ClueClaimed(c);

            GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(ResearchClueClaimed); // Create Queue
            GameManager.SingleInstance.App.Model.eventModel.ResearchClueClaimedEvent();                         // Populate Queue
            GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();                     // Start Queue
        }
        else
        {
            // Lose 1 Sanity
            active.SetIncomingDamage(1);
            GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(LoseSanity); // Create Queue
            GameManager.SingleInstance.App.Model.eventModel.LoseSanityEvent(active, 1);                // Populate Queue
            GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();            // Start Queue
        }
    }
Esempio n. 3
0
 public void DealNextSanityDamage()
 {
     dealSanityInvestigatorIndex++;
     if (dealSanityInvestigatorIndex == GameManager.SingleInstance.App.Model.investigatorModel.investigators.Count)
     {
         string screenText = "Each Investigator loses " + postFlipSanityTokens + " Sanity";
         GameManager.SingleInstance.App.Controller.reckoningMythosController.SetReckoningText(screenText);
         GameManager.SingleInstance.App.Controller.reckoningMythosController.FinishReckoning();
     }
     else
     {
         Investigator i = GameManager.SingleInstance.App.Model.investigatorModel.investigators[dealSanityInvestigatorIndex];
         if (i.deathEncounter != null) // Investigator is dead
         {
             DealNextSanityDamage();
         }
         else
         {
             i.SetIncomingDamage(postFlipSanityTokens);
             GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(FlipLoseSanity); // Create Queue
             GameManager.SingleInstance.App.Model.eventModel.LoseSanityEvent(i, postFlipSanityTokens);      // Populate Queue
             GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();                // Start Queue
         }
     }
 }
Esempio n. 4
0
    public void LoseSanity()
    {
        Investigator active = GameManager.SingleInstance.App.Model.encounterMenuModel.currentInvestigator;

        active.LoseSanity(active.GetIncomingDamage());
        active.SetIncomingDamage(0);

        GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(FinishEncounter); // Create Queue
        GameManager.SingleInstance.App.Model.eventModel.DamageTakenEvent();                             // Populate Queue
        GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();                 // Start Queue
    }
Esempio n. 5
0
    public void FlipLoseSanity()
    {
        Investigator active = GameManager.SingleInstance.App.Model.investigatorModel.investigators[dealSanityInvestigatorIndex];

        active.LoseSanity(active.GetIncomingDamage());
        active.SetIncomingDamage(0);

        GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(DealNextSanityDamage); // Create Queue
        GameManager.SingleInstance.App.Model.eventModel.DamageTakenEvent();                                  // Populate Queue
        GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();                      // Start Queue
    }
Esempio n. 6
0
    public void UseAsset()
    {
        int incoming = targetReference.GetIncomingDamage();

        incoming -= 2;
        if (incoming < 0)
        {
            incoming = 0;
        }
        targetReference.SetIncomingDamage(incoming);
        ownerReference.LoseAsset(this);
        GameManager.SingleInstance.App.Controller.queueController.NextCallBack();
    }
    public void LoseHealth()
    {
        Investigator active = App.Model.combatModel.currentInvestigator;

        if (active.deathEncounter != null)
        {
            App.View.combatView.NextFight();
            FinishCombat();
        }
        else
        {
            active.LoseHealth(active.GetIncomingDamage());
            active.SetIncomingDamage(0);

            GameManager.SingleInstance.App.Controller.queueController.CreateCallBackQueue(DealDamageToMonster); // Create Queue
            GameManager.SingleInstance.App.Model.eventModel.DamageTakenEvent();                                 // Populate Queue
            GameManager.SingleInstance.App.Controller.queueController.StartCallBackQueue();                     // Start Queue
        }
    }
    public void Test1Complete(List <int> results)
    {
        Investigator active = App.Model.combatModel.currentInvestigator;

        if (active.deathEncounter != null) // If the Investigator died during the test trying to buff up or add results before finishing
        {
            App.View.combatView.NextFight();
            FinishCombat();
            return;
        }

        int numSuccesses = 0;

        foreach (int num in results)
        {
            if (num >= active.SUCCESS)
            {
                numSuccesses++;
            }
        }
        App.Model.combatModel.TestFinished(numSuccesses);
        App.View.combatView.Test1Complete(numSuccesses);

        Monster m = App.Model.combatModel.currentMonster;

        if (numSuccesses < m.horror)
        {
            int damage = m.horror - numSuccesses;
            // Lose Sanity
            active.SetIncomingDamage(damage);
            App.Controller.queueController.CreateCallBackQueue(LoseSanity); // Create Queue
            App.Model.eventModel.LoseSanityEvent(active, damage);           // Populate Queue
            App.Controller.queueController.StartCallBackQueue();            // Start Queue
        }
        else
        {
            m.FinishTest1(numSuccesses); // Will call StartTest2
        }
    }