Esempio n. 1
0
 public void IsRobbery(string _incidentName)
 {
     if (_incidentName == "Robbery")
     {
         Robbery?.Invoke();
     }
 }
    public void HideRobberyIcon(Robbery robbery)
    {
        // Borramos el robo de la lista de robos
        TutorialGameManager.instance.robberies.Remove(robbery);

        // Eliminamos el GameObject del robo
        Destroy(robbery.gameObject);
    }
    public void ShowRobberyIcon(Vector3 location)
    {
        GameObject robberyGameObject = Instantiate(robberyPrefab, robberiesParent.transform);
        Robbery    newRobbery        = robberyGameObject.GetComponent <Robbery>();

        newRobbery.robberyPosition = location;
        newRobbery.robberyRectTransform.anchoredPosition = new Vector2(100000, 100000);
        TutorialGameManager.instance.robberies.Add(newRobbery);
    }
Esempio n. 4
0
    /// <summary>
    /// Método Event18, que ejecuta la funcionalidad requerida por el evento 18
    /// </summary>
    public void Event18()
    {
        // Ocultamos el texto del tutorial
        marshugusGameObject.SetActive(false);
        tutorialText.gameObject.SetActive(false);

        // Dejamos al jugador que se mueva
        playerCanMove = true;

        // Establecemos un "robo" que hace de flecha para la plaza
        GameObject robberyGameObject = Instantiate(robberyPrefab, robberiesParent.transform);
        Robbery    newRobbery        = robberyGameObject.GetComponent <Robbery>();

        newRobbery.robberyPosition = new Vector3(-13.25f, 4.75f, -8f);
        newRobbery.robberyRectTransform.anchoredPosition = new Vector2(100000, 100000);
        newRobbery.robberyIconImage.sprite     = arrowSprite;
        robberyGameObject.transform.localScale = new Vector3(1.5f, 1.5f, 1);
        TutorialGameManager.instance.robberies.Add(newRobbery);

        /// Instanciamos aldeano aleatorio y movemos ladrón
        /// Aldeano aleatorio
        // Obtener datos aleatorios
        Quaternion randomRotation = Quaternion.Euler(0, Random.Range(0, 360), 0);

        // La instanciamos
        GameObject villagerGameObject = Instantiate(scriptedVillagerPrefab, new Vector3(-14.95f, 4.65f, -12f), randomRotation, villagersParent.transform);;

        // Obtener componente ScriptedVillager
        ScriptedVillager fifthScriptedVillager = villagerGameObject.GetComponent <ScriptedVillager>();

        // Establecemos sus objetos
        fifthScriptedVillager.items.villagerColor = ItemDatabase.instance.characterColors[0];
        fifthScriptedVillager.items.eyes          = ItemDatabase.instance.eyes[1];
        fifthScriptedVillager.items.hatItem       = ItemDatabase.instance.hatItems[0];
        fifthScriptedVillager.items.hornItem      = ItemDatabase.instance.hornItems[0];
        fifthScriptedVillager.items.neckItem      = ItemDatabase.instance.neckItems[0];

        // Instanciamos sus objetos
        fifthScriptedVillager.PutItems();

        // Añadimos al aldeano a la lista
        TutorialGameManager.instance.villagers.Add(fifthScriptedVillager);

        // Establecemos su id de tutorial
        fifthScriptedVillager.tutorialID = 4;

        /// Ladrón
        // Lo desactivamos
        scriptedThief.gameObject.SetActive(true);
    }
Esempio n. 5
0
    /// <summary>
    /// Método Event6, que ejecuta la funcionalidad requerida por el evento 6
    /// </summary>
    public void Event6()
    {
        // Ocultamos el texto del tutorial
        marshugusGameObject.SetActive(false);
        tutorialText.gameObject.SetActive(false);

        // Dejamos al jugador que se mueva
        playerCanMove = true;

        // Establecemos un "robo" que hace de flecha para la forja
        GameObject robberyGameObject = Instantiate(robberyPrefab, robberiesParent.transform);
        Robbery    newRobbery        = robberyGameObject.GetComponent <Robbery>();

        newRobbery.robberyPosition = new Vector3(12.66f, 7.85f, 30.85f);
        newRobbery.robberyRectTransform.anchoredPosition = new Vector2(100000, 100000);
        newRobbery.robberyIconImage.sprite     = arrowSprite;
        robberyGameObject.transform.localScale = new Vector3(1.5f, 1.5f, 1);
        TutorialGameManager.instance.robberies.Add(newRobbery);
    }
Esempio n. 6
0
        public void ExampleRobberyActTest()
        {
            var testAct = new Robbery
            {
                Consent = new VictimConsent
                {
                    IsApprovalExpressed = lp => false,
                    IsCapableThereof    = lp => lp is LindseyDealinEg
                },
                IsTakenPossession = lp => lp is RodneyBlackmailEg,
                IsAsportation     = lp => lp is RodneyBlackmailEg,
                IsByViolence      = lp => lp is RodneyBlackmailEg,
                SubjectProperty   = new LegalProperty("money")
                {
                    IsEntitledTo = lp => lp is LindseyDealinEg, IsInPossessionOf = lp => lp is LindseyDealinEg, PropertyValue = dt => 15000m
                },
            };

            var testResult = testAct.IsValid(new RodneyBlackmailEg(), new LindseyDealinEg());

            Console.WriteLine(testAct.ToString());
            Assert.IsTrue(testResult);
        }