Beispiel #1
0
    /// <summary>
    /// Just runs because Unity components
    /// </summary>
    void Start()
    {
        _CombatInitiator = GetComponent <CombatInitiator>();
        if (_CombatInitiator == null)
        {
            throw new Exception("CombatInitiator does not exist on object");
        }

        _DishScoreManager = GetComponent <DishScoreManager>();
        if (_DishScoreManager == null)
        {
            throw new Exception("DishScoreManager does not exist on object");
        }

        _GameNarrativeManager = GetComponent <GameNarrativeManager>();
        if (_GameNarrativeManager == null)
        {
            throw new Exception("GameNarrativeManager does not exist on object");
        }

        _MonsterFactory = GetComponent <MonsterFactory>();
        if (_MonsterFactory == null)
        {
            throw new Exception("MonsterFactory does not exist on object");
        }

        _IngredientsQueue = null;
    }
Beispiel #2
0
 void Awake()
 {
     _CombatInitiator      = GameObject.FindObjectOfType <CombatInitiator>();
     _GameNarrativeManager = GameObject.FindObjectOfType <GameNarrativeManager>();
     _MonsterFactory       = GameObject.FindObjectOfType <MonsterFactory>();
     _AreItemsLoaded       = true;
 }
 void Start()
 {
     _CombatInitiator = GameObject.FindObjectOfType <CombatInitiator>();
     if (_CombatInitiator != null)
     {
         var monsterFactory = GameObject.FindObjectOfType <MonsterFactory>();
         CurrentMonster = monsterFactory.LoadMonster(_CombatInitiator.MonsterID);
         if (CurrentMonster.ToString() == Names._NESSIE_NAME)
         {
             Nessie_BGM.Play();
             Cerberus_BGM.Stop();
             REDACTED_BGM.Stop();
         }
         else if (CurrentMonster.ToString() == Names._CERBERUS_NAME)
         {
             Nessie_BGM.Stop();
             Cerberus_BGM.Play();
             REDACTED_BGM.Stop();
         }
         else if (CurrentMonster.ToString() == Names._REDACTED_NAME)
         {
             Nessie_BGM.Stop();
             Cerberus_BGM.Stop();
             REDACTED_BGM.Play();
         }
     }
     else
     {
         CurrentMonster = new MonsterData("[REDACTED]", 0, null, null);
         if (CurrentMonster.ToString() == Names._NESSIE_NAME)
         {
             Nessie_BGM.Play();
             Cerberus_BGM.Stop();
             REDACTED_BGM.Stop();
         }
         else if (CurrentMonster.ToString() == Names._CERBERUS_NAME)
         {
             Nessie_BGM.Stop();
             Cerberus_BGM.Play();
             REDACTED_BGM.Stop();
         }
         else if (CurrentMonster.ToString() == Names._REDACTED_NAME)
         {
             Nessie_BGM.Stop();
             Cerberus_BGM.Stop();
             REDACTED_BGM.Play();
         }
     }
 }
Beispiel #4
0
    public Combat CreateCombat(List <AICharacterData> characters, AIAbilityData ambushAbility, CombatInitiator combatInitiator, System.Action finishedCallback)
    {
        var go = GameObject.Instantiate(CombatReferences.Get().combatViewPrefab) as GameObject;
        //THIS IS SO HACKY! We should find a better way to pass this in here.
        var parent = GameObject.Find("ApplicationRoot").transform;

        go.transform.SetParent(parent);
        var combatView = go.GetComponent <CombatView>();

        var enemies = CreateCombatants(characters);

        combatView.PlaceCharacters(enemies, Faction.Enemy);

        var allies        = playerTeam.GetCombatAlliesControllers();
        var playerFactory = DesertContext.StrangeNew <PlayerCombatCharacterFactory>();
        var player        = playerFactory.CreatePlayerCombatCharacter();

        allies.Add(player);
        combatView.PlaceCharacters(allies, Faction.Player);

        combatView.SetupVisuals(mapViewData, mapCreator);

        var combat = DesertContext.StrangeNew <Combat>();

        combat.Setup(enemies, allies, () => { GameObject.Destroy(go); finishedCallback(); });

        combat.SetupEnemyAmbush(ambushAbility, () => combat.SetupPlayerAmbush(combat.RunCombat));

        /*
         * if (combatInitiator == CombatInitiator.Enemy && ambushAbility != null)
         *  combat.SetupEnemyAmbush(CreateAmbushAbility(enemies[0], ambushAbility));
         * else if (combatInitiator == CombatInitiator.Player)
         *  combat.SetupPlayerAmbush();
         * else
         *  combat.RunCombat();
         */

        return(combat);
    }
Beispiel #5
0
 public Combat CreateCombat(CombatEncounterData encounterData, CombatInitiator combatInitiator, System.Action finishedCallback)
 {
     return(CreateCombat(encounterData.characters, encounterData.ambushAbility, combatInitiator, finishedCallback));
 }
Beispiel #6
0
 public Combat CreateCombat(List <AICharacterData> characters, CombatInitiator combatInitiator, System.Action finishedCallback)
 {
     return(CreateCombat(characters, null, combatInitiator, finishedCallback));
 }
 void Start()
 {
     _CombatInitiator = GameObject.FindObjectOfType <CombatInitiator>();
     if (_CombatInitiator != null)
     {
         var monsterFactory = GameObject.FindObjectOfType <MonsterFactory>();
         CurrentMonster = monsterFactory.LoadMonster(_CombatInitiator.MonsterID);
         if (CurrentMonster.ToString() == Names._NESSIE_NAME)
         {
             Nessie.SetActive(true);
             Cerberus.SetActive(false);
             REDACTED.SetActive(false);
         }
         else if (CurrentMonster.ToString() == Names._CERBERUS_NAME)
         {
             Nessie.SetActive(false);
             Cerberus.SetActive(true);
             REDACTED.SetActive(false);
         }
         else if (CurrentMonster.ToString() == Names._REDACTED_NAME)
         {
             Nessie.SetActive(false);
             Cerberus.SetActive(false);
             REDACTED.SetActive(true);
         }
         Movement = GameObject.Find(CurrentMonster.ToString()).GetComponent <Animator>();
         Bar.SetValue((int)Mathf.Ceil(_CombatInitiator.InitialManagerMeterValue * Bar.maxManagerValue));
     }
     else
     {
         //intial conbatchoice and its decay rates
         var combatChoices = new Dictionary <CombatChoice, CombatChoiceStatus>();
         combatChoices.Add(CombatChoice.Beg, new CombatChoiceStatus(35, 0f, 35));
         combatChoices.Add(CombatChoice.Coupon, new CombatChoiceStatus(15, 0.85f, 5));
         combatChoices.Add(CombatChoice.Flatter, new CombatChoiceStatus(-5, 1.5f, -15));
         combatChoices.Add(CombatChoice.FreeFood, new CombatChoiceStatus(10, 0.75f, 3));
         combatChoices.Add(CombatChoice.OfferDrink, new CombatChoiceStatus(25, 0.80f, 10));
         combatChoices.Add(CombatChoice.Reason, new CombatChoiceStatus(10, 0.9f, 2));
         // Just default, other values are not necessary for this scene.
         CurrentMonster = new MonsterData("[REDACTED]", 0, null, combatChoices);
         Debug.Log(CurrentMonster.ToString());
         if (CurrentMonster.ToString() == Names._NESSIE_NAME)
         {
             Nessie.SetActive(true);
             Cerberus.SetActive(false);
             REDACTED.SetActive(false);
         }
         if (CurrentMonster.ToString() == Names._CERBERUS_NAME)
         {
             Nessie.SetActive(false);
             Cerberus.SetActive(true);
             REDACTED.SetActive(false);
         }
         if (CurrentMonster.ToString() == Names._REDACTED_NAME)
         {
             Nessie.SetActive(false);
             Cerberus.SetActive(false);
             REDACTED.SetActive(true);
         }
         Movement = GameObject.Find(CurrentMonster.ToString()).GetComponent <Animator>();
     }
     StartCoroutine("CombatFunction");
 }