Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponent<Animator>();
        players = new Dictionary<PlayerIndex, Player>();

        var rng = new System.Random();
        var playerIndexes = GameManager.GetInstance().players;
        var npcs = GameObject.FindGameObjectsWithTag("NPC");

        var pickedNPCs = new List<GameObject>();
        foreach (var playerIndex in playerIndexes)
        {
            GameObject npc;
            do
            {
                npc = npcs[rng.Next(0, npcs.Length)];

            } while (pickedNPCs.Contains(npc));

            pickedNPCs.Add(npc);
            Humanify(npc, playerIndex);
            players.Add(playerIndex, npc.GetComponent<Player>());
        }


        rmg = new RandomMalusGenerator(maluses);

        rrg = new RandomRitualGenerator(players, actions, zones);
        nextRitual = rrg.GetRandomRitual();
        explainRitual(nextRitual);
    }
Esempio n. 2
0
        public OptionRitualForm(Ritual ritual)
        {
            InitializeComponent();

            Array cats = Enum.GetValues(typeof(RitualCategory));

            foreach (RitualCategory cat in cats)
            {
                CatBox.Items.Add(cat);
            }

            fRitual = ritual.Copy();

            NameBox.Text        = fRitual.Name;
            LevelBox.Value      = fRitual.Level;
            CatBox.SelectedItem = fRitual.Category;

            TimeBox.Text      = fRitual.Time;
            DurationBox.Text  = fRitual.Duration;
            ComponentBox.Text = fRitual.ComponentCost;
            MarketBox.Text    = fRitual.MarketPrice;
            SkillBox.Text     = fRitual.KeySkill;

            DetailsBox.Text   = fRitual.Details;
            ReadAloudBox.Text = fRitual.ReadAloud;
        }
Esempio n. 3
0
 public void Init()
 {
     animator   = Canvas.GetComponent <Animator>();
     this.state = false;
     this.Canvas.SetActive(false);
     this.Ritual = PlayerManager.Instance.player.ritualPlayer;
     Ritual.ritualHud.SetActiveRitualEvent += PowerUpLauchedEventHandler;
 }
        public static void CalculateTotalWithBonus(this Ritual r, int bonusPercentage)
        {
            var bonus = (int)Math.Round((double)r.GemTotal * bonusPercentage / 100);

            r.Bonus = bonus;

            r.TotalWithBonus = r.GemTotal + bonus;
        }
Esempio n. 5
0
    void NoumenonRituals(GameObject player)
    {
        Ritual ritual1 = new Ritual("Hide Area", 2, 1, "Hide target\nnode and\nits neighbours", 2, 1, HideArea); //1

        player.GetComponent <Player>().ritualBlueprints.Add(ritual1);
        Ritual ritual2 = new Ritual("Hide Map", 5, 3, "Cover the\nmap in\nfog of war", 1, 1, HideMap); // 3

        player.GetComponent <Player>().ritualBlueprints.Add(ritual2);
    }
Esempio n. 6
0
 private void OnEnable()
 {
     currentRitual = null;
     currentCrew   = null;
     GetComponent <StormMGmovement>().ToggleMovement(false);
     DisplayStartingText();
     cloutChange = 0;
     Globals.GameVars.playerShip.GetComponent <script_player_controls>().cursorRing.SetActive(false);
 }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        if (m_Ritual != null)
            m_Ritual = Instantiate(m_Ritual);


        if (m_CurrentMovementType != MovementType.Random)
            m_IsMoving = m_EnableMovement;
    }
Esempio n. 8
0
    void SamataRituals(GameObject player)
    {
        Ritual ritual1 = new Ritual("Balance Health", 3, 2, "Average health of\narmies adjacent\nto target", 3, 1, BalanceHealth); // 2

        player.GetComponent <Player>().ritualBlueprints.Add(ritual1);
        Ritual ritual2 = new Ritual("Perfect Match", 5, 3, "Army1 becomes\na copy of\nArmy2", 5, 2, PerfectMatch); // 3

        player.GetComponent <Player>().ritualBlueprints.Add(ritual2);
    }
Esempio n. 9
0
    void CarnotRituals(GameObject player)
    {
        Ritual ritual1 = new Ritual("Random Step", 2, 1, "Target army\ntakes one\nrandom move", 6, 1, RandomStep); // 1

        player.GetComponent <Player>().ritualBlueprints.Add(ritual1);
        Ritual ritual2 = new Ritual("Random Warp", 6, 2, "Warp target\narmy to a\nrandom location", 2, 1, RandomWarp); // 2

        player.GetComponent <Player>().ritualBlueprints.Add(ritual2);
    }
Esempio n. 10
0
    void DukkhaRituals(GameObject player)
    {
        Ritual ritual1 = new Ritual("Restoration", 3, 2, "Heal all\nunits to\nfull HP", 3, 1, DealDamage);

        player.GetComponent <Player>().ritualBlueprints.Add(ritual1);
        Ritual ritual2 = new Ritual("Devastation", 4, 7, "\n \n", 2, 1, DealDamage);

        player.GetComponent <Player>().ritualBlueprints.Add(ritual2);
    }
Esempio n. 11
0
    void ParatrophRituals(GameObject player)
    {
        Ritual ritual1 = new Ritual("Prior Ritual", 3, 2, "Use the\nlast ritual\nused", 6, 1, PriorRitual); // 2

        player.GetComponent <Player>().ritualBlueprints.Add(ritual1);
        Ritual ritual2 = new Ritual("Borrow Rituals", 2, 1, "Buy rituals from\nneighbour faction\nfor one round", 2, 1, BorrowRituals); // 1

        player.GetComponent <Player>().ritualBlueprints.Add(ritual2);
    }
Esempio n. 12
0
    void UnmarRituals(GameObject player)
    {
        Ritual ritual1 = new Ritual("Sacrifice", 1, 0, "Sacrifice all\nmar units\nfor zeal", 5, 1, Sacrifice); // 2

        player.GetComponent <Player>().ritualBlueprints.Add(ritual1);
        Ritual ritual2 = new Ritual("Reward Purity", 6, 0, "Buff target\narmy with only\nUnmar units", 1, 1, RewardPurity); // 4

        player.GetComponent <Player>().ritualBlueprints.Add(ritual2);
    }
        private static void CalculateRemaining(Ritual r, int bonusPercentage)
        {
            r.ResultTotal = r.TotalWithBonus;

            var percentage = (double)bonusPercentage / 100 + 1;

            var maxWithoutBonus = (int)Math.Round(r.Goal / percentage);

            r.Remaining = maxWithoutBonus - r.GemTotal;
        }
    private Ritual MakeRitual(Ritual.Point[] pattern, string textureId)
    {
        Ritual ritual = new Ritual();

        ritual.image = Resources.Load<Texture2D>("RitualPatterns/" + textureId);

        ritual.pattern = pattern;

        return ritual;
    }
Esempio n. 15
0
 private void initializeRandomRitual() {
     ritual = new Ritual();
     for (var i = 0; i < ritual.intervals.Length; i++)
     {
         Interval interval = ritual.intervals[i];
         for (var k = 0; k < interval.actions.Length; k++)
         {
             Action action = interval.actions[k];
         }
     }
 }
Esempio n. 16
0
 public bool BuyRitual(Ritual ritual)
 {
     if (zeal >= ritual.zealCost)
     {
         print("Ritual Purchased");
         zeal -= ritual.zealCost;
         NodeMenu.currentNode.GetComponent <Node>().ritual = ritual.DeepCopy();
         print("ritual name = " + NodeMenu.currentNode.GetComponent <Node>().ritual.name);
         return(true);
     }
     return(false);
 }
Esempio n. 17
0
 public override void Action(CommandCaller caller, string input, string[] args)
 {
     try
     {
         Ritual          ritual    = Constants.ritualByName[args[0]];
         PlayerCharacter character = caller.Player.GetModPlayer <PlayerCharacter>();
         character.Rituals[ritual] = !character.Rituals[ritual];
     }
     catch (KeyNotFoundException)
     {
         throw new UsageException("Ritual not found: " + args);
     }
 }
Esempio n. 18
0
    public Ritual DeepCopy()
    {
        Ritual newRitual = new Ritual();

        newRitual.zealCost    = zealCost;
        newRitual.prepTime    = prepTime;
        newRitual.name        = name;
        newRitual.description = description;
        newRitual.range       = range;
        newRitual.numTargets  = numTargets;
        newRitual.Activate    = Activate;
        return(newRitual);
    }
        public static void CalculatePerfectRitual(this Ritual r, int bonusPercentage)
        {
            r.Goal = Constants.Constants.GemSizes.PERFECT;

            if (r.TotalWithBonus >= r.Goal)
            {
                CalculateActualBonus(r);
            }
            else
            {
                CalculateRemaining(r, bonusPercentage);
            }
        }
Esempio n. 20
0
 public void SetupRitualSelection(Ritual newRitual, GameObject newNode)
 {
     print("Setting up Ritual Selection");
     if (newRitual.name == "Prior Ritual")
     {
         newRitual = previousRitual;
     }
     Player.menuOpen = 1;
     selectedNodes.Clear();
     ritualSelected = true;
     selectedRitual = newRitual;
     ritualNode     = newNode;
     HighLightNodes();
 }
        private void SeedRituals(AbilitiesDbContext context)
        {
            var rituals = new Ritual[]
            {
                new Ritual
                {
                    Name        = "Ritual 1",
                    Description = "Ritual 1 description",
                    Tradition   = Tradition.Sorcery
                },
            };

            context.Abilities.AddRange(rituals);
            context.SaveChanges();
        }
Esempio n. 22
0
    public void ChooseRitual()
    {
        //Determine if the player has a seer or not
        List <Ritual> possibleRituals = new List <Ritual>();

        bool hasSeer = CheckForSeer();

        possibleRituals = Globals.GameVars.stormRituals.FindAll(x => x.HasSeer == hasSeer);

        //Select an appropriate ritual
        currentRitual = possibleRituals[RandomIndex(possibleRituals)];
        currentCrew   = Globals.GameVars.playerShipVariables.ship.crewRoster[RandomIndex(Globals.GameVars.playerShipVariables.ship.crewRoster)];

        DisplayRitualText();
    }
Esempio n. 23
0
    void Start()
    {
        startAt_ = GetComponent<RectTransform>().localPosition;

        renderers_ = GetComponentsInChildren<CanvasRenderer>();
        texts_ = GetComponentsInChildren<Text>();

        currentCombo_ = 0;

        currentRitual_ = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>().currentRitual;
        currentRitual_.OnReset += OnFailed;
        currentRitual_.OnComplete += OnComplete;

        Reset(0);
    }
        public static void CalculateSemiPerfectRitual(this Ritual r, int bonusPercentage)
        {
            r.Goal = Constants.Constants.GemSizes.SEMI_PERFECT;

            var max = r.Goal + r.Bonus;

            if (r.TotalWithBonus >= r.Goal & r.TotalWithBonus <= max)
            {
                CalculateActualBonus(r);
            }
            else
            {
                CalculateRemaining(r, bonusPercentage);
            }
        }
        public static bool ValidateGems(this Ritual r, Gem firstGem, Gem secondGem, Gem thirdGem)
        {
            var firstGemSize  = firstGem.GetGemSize();
            var secondGemSize = secondGem.GetGemSize();
            var thirdGemSize  = thirdGem.GetGemSize();

            if (firstGemSize == 0 || secondGemSize == 0 || thirdGemSize == 0)
            {
                return(false);
            }

            r.GemTotal = firstGemSize + secondGemSize + thirdGemSize;

            return(true);
        }
Esempio n. 26
0
    private void OnMouseDown()
    {
        if (Player.menuOpen == 1)
        {
            Ritual ritual = NodeMenu.currentNode.GetComponent <Node>().ritual;

            if (ritual.IsReady())
            {
                SelectNodesForRitual();
            }
            else if (NodeMenu.currentNode.GetComponent <Node>().owner&& NodeMenu.currentNode.GetComponent <Node>().owner == Player.human)
            {
                ritualMenu.GetComponent <RitualMenu>().EnterMenu();
            }
        }
    }
Esempio n. 27
0
 public void LoadPlayerRituals()
 {
     for (int j = 0; j < Player.human.GetComponent <Player>().ritualBlueprints.Count; j++)
     {
         GameObject ritualSlot = Tools.GetChildNamed(gameObject, "Ritual Slot " + j.ToString());
         if (ritualSlot != null)
         {
             Ritual blueprint = Player.human.GetComponent <Player>().ritualBlueprints[j];
             ritualSlot.GetComponent <RitualSlot>().ritualBlueprint = blueprint;
             Tools.GetChildNamed(ritualSlot, "Ritual Name Text").GetComponent <TextMesh>().text        = "Ritual of " + blueprint.name;
             Tools.GetChildNamed(ritualSlot, "Ritual Zeal Cost Text").GetComponent <TextMesh>().text   = blueprint.zealCost.ToString();
             Tools.GetChildNamed(ritualSlot, "Ritual Time Cost Text").GetComponent <TextMesh>().text   = blueprint.prepTime.ToString();
             Tools.GetChildNamed(ritualSlot, "Ritual Description Text").GetComponent <TextMesh>().text = blueprint.description;
         }
     }
 }
Esempio n. 28
0
 private void OnMouseDown()
 {
     if (Player.menuOpen == 2)
     {
         Ritual ritualToBuy = ritualBlueprint.DeepCopy();
         if (NodeMenu.currentNode.GetComponent <Node>().temple != null && NodeMenu.currentNode.GetComponent <Node>().temple.name == TempleName.Tradition)
         {
             ritualToBuy.zealCost--;
         }
         if (Player.human.GetComponent <Player>().BuyRitual(ritualToBuy))
         {
             transform.parent.GetComponent <RitualMenu>().ExitMenu();
         }
         else
         {
             Tools.CreatePopup(gameObject, "Not Enough Zeal", 40, Color.red);
         }
     }
 }
Esempio n. 29
0
    void Awake()
    {
        keys_ = new List<GameObject>();
        SetupMapping();

        GameObject gameController = GameObject.FindGameObjectWithTag("GameController");

        if (gameController == null)
        {
            Debug.LogError("Could not find a GameController object tagged with 'GameController'");
            return;
        }

        gameController_ = gameController.GetComponent<GameController>();
        currentRitual_ = gameController_.currentRitual;

        currentRitual_.Changed += CreateKeys;
        currentRitual_.OnPress += OnPress;
    }
Esempio n. 30
0
    // Use this for initialization
    void Start()
    {
        m_LastPathIndex = 0;
        m_CurrentPathIndex = 0;

        foreach (PatrolPoint p in m_PatrolPath)
        {
            Renderer r = p.GetComponent<Renderer>();
            if(r != null)
                r.enabled = false;
        }

		if (m_Ritual != null)
			m_Ritual = Instantiate (m_Ritual);
		else
			Debug.Log ("Ritual is null");
        m_EyeMark.SetActive(false);
        m_ExclamationMark.SetActive(false);
    }
Esempio n. 31
0
	// Use this for initialization
	void Start () {
        PlayerList = new List<Shaman>();
	    TotemRitual = new Ritual();
        TotemRitual.RandomizeSequence();

	    GameObject basePiece = GameObject.Instantiate(BasePrefab);
	    basePiece.transform.position = transform.position;
	    basePiece.transform.parent = transform;

        var y = basePiece.transform.localScale.y * 9;
        float totalHeight = 0;
	    for (int i = TotemRitual.Sequence.Length-1; i >= 0 ; i--)
	    {
	        GameObject piece = null;
	        switch (TotemRitual[TotemRitual.Sequence.Length-1-i])
	        {
                case GamePad.Button.A:
	                piece = GameObject.Instantiate(PieceAPrefab);
	                break;
                case GamePad.Button.B:
                    piece = GameObject.Instantiate(PieceBPrefab);
                    break;
                case GamePad.Button.X:
                    piece = GameObject.Instantiate(PieceXPrefab);
                    break;
                case GamePad.Button.Y:
                    piece = GameObject.Instantiate(PieceYPrefab);
                    break;
	        }
	        if (piece != null)
	        {
	            var height = piece.transform.localScale.y*1.2f;
                piece.transform.position = new Vector3(transform.position.x, y + (i * height), transform.position.z);
                piece.transform.parent = transform;
	            totalHeight = height*4;

	        }
        }

        GameObject headPiece = GameObject.Instantiate(HeadPrefab);
        headPiece.transform.position = new Vector3(transform.position.x, y + totalHeight, transform.position.z);
        headPiece.transform.parent = transform;
    }
Esempio n. 32
0
    void UpdateSprite()
    {
        if (NodeMenu.currentNode)
        {
            Ritual currentRitual = NodeMenu.currentNode.GetComponent <Node>().ritual;

            if (currentRitual.IsReady())
            {
                readySprite.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Icons/Ritual3");
            }
            else if (!currentRitual.IsEmpty())
            {
                readySprite.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Icons/Ritual1");
            }
            else
            {
                readySprite.GetComponent <SpriteRenderer>().sprite = null;
            }
        }
    }
Esempio n. 33
0
        public static async Task <bool> TryWriteAppointmentAsync(Ritual r)
        {
            try{
                Appointment appt = new Appointment();

                appt.Subject   = r.Name;
                appt.StartTime = r.EventDate;
                appt.Details   = r.Description;

                var reminderTime = new TimeSpan();
                appt.Reminder = reminderTime;  //vinay

                await _calendar.SaveAppointmentAsync(appt);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Esempio n. 34
0
    public static Faction GetRitualFaction(Ritual ritual)
    {
        GameObject players = GameObject.Find("/Players");

        for (int i = 0; i < players.transform.childCount; i++)
        {
            GameObject    player      = players.transform.GetChild(i).gameObject;
            List <string> ritualNames = new List <string>();

            for (int j = 0; j < player.GetComponent <Player>().ritualBlueprints.Count; j++)
            {
                Ritual playerRitual = player.GetComponent <Player>().ritualBlueprints[j];
                ritualNames.Add(playerRitual.name);
            }
            if (ritualNames.Contains(ritual.name))
            {
                return(player.GetComponent <Player>().faction);
            }
        }
        return(Faction.None);
    }
Esempio n. 35
0
    public void ChooseRitual()
    {
        //Determine if the player has a seer or not
        List <Ritual> possibleRituals = new List <Ritual>();

        bool hasSeer = CheckForSeer();

        for (int i = 0; i < Globals.GameVars.stormRituals.Count; i++)
        {
            if (Globals.GameVars.stormRituals[i].HasSeer == hasSeer)
            {
                possibleRituals.Add(Globals.GameVars.stormRituals[i]);
            }
        }

        //Select an appropriate ritual
        currentRitual = possibleRituals[RandomIndex(possibleRituals)];
        currentCrew   = Globals.GameVars.playerShipVariables.ship.crewRoster[RandomIndex(Globals.GameVars.playerShipVariables.ship.crewRoster)];

        DisplayRitualText();
    }
Esempio n. 36
0
        public static async Task <bool> TryDeleteAppointmentAsync(Ritual r)
        {
            try
            {
                TimeSpan ts = new TimeSpan(0, 0, 2);

                var _list = await _calendar.FindAppointmentsAsync(r.EventDate, ts);

                foreach (Appointment a in _list)
                {
                    if (a.Subject == r.Name)
                    {
                        await _calendar.DeleteAppointmentAsync(a.LocalId);
                    }
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
    public void Awake()
    {
        rumble_ = new RumbleValues[2];

        rumble_[0].time = 0.0f;
        rumble_[1].time = 0.0f;

        joystickPressed = new bool[2]
        {
            false, false
        };

        KeyMapping.Initialise();

        currentRitual = new Ritual();
        currentRitual.OnReset += Rumble;

        Instantiate(ritualUIPrefab);
        Instantiate(player1PortraitPrefab);
        Instantiate(player2PortraitPrefab);
        Instantiate(comboUIPrefab);

        currentRitual.ConstructRitual(Random.Range(3, 9), (Ritual.Difficulty)PlayerPrefs.GetInt("difficulty"));
    }
	public void InitializeRituals(int randomSeed)
	{
        completedRitualMessages.Clear();
        lastCompletedRitual = -1;

        currentRitualProgress.isDud = true;
        currentRitualProgress.ritualNumber = -1;
        currentRitualProgress.currentSteps = -1;
        currentRitualProgress.currentSteps = -1;

		System.Random rng = new System.Random(randomSeed);

		for (int i = 0; i < summonRitualCount + dudRitualCount; ++i)
		{
			Ritual currentRitual = new Ritual();
			int ritualLength = 0;
			// Is this a summon ritual, or a dud ritual?
			if (i < summonRitualCount)
			{
				currentRitual.isDud = false;
				currentRitual.ritualNumber = i;
				// Generate a length of ritual;
				ritualLength = rng.Next(summonRitualMinInteractions, summonRitualMaxInteractions);
			}
			else
			{
				currentRitual.isDud = true;
				currentRitual.ritualNumber = i - summonRitualCount;
				// Generate a length of ritual;
				ritualLength = rng.Next(dudRitualMinInteractions, dudRitualMaxInteractions);
			}
			for (int ritualInteractionIndex = 0; ritualInteractionIndex < ritualLength; ++ritualInteractionIndex)
			{
				// generate a random object interaction, but
				// Make sure this doesn't start another ritual
				int objectToInteractWith = 0;
				int objectInteraction = 0;

				bool interactionConflicts = false;
				do
				{
                    interactionConflicts = false;

					objectToInteractWith = rng.Next(0, objectCount);
					objectInteraction = rng.Next(0, objectInteractionCount);				
					
					for (int j = 0; j < rituals.Count; ++j)
					{
						if (rituals[j].objects[0] == objectToInteractWith && rituals[j].interactions[0] == objectInteraction)
						{
							interactionConflicts = true;
							break;
						}
					}
				}
				while (interactionConflicts);

				currentRitual.objects.Add(objectToInteractWith);
				currentRitual.interactions.Add(objectInteraction);
			}
            rituals.Add(currentRitual);
		}
	}
Esempio n. 39
0
    // Update is called once per frame
    void Update()
    {
        float dt = Time.deltaTime;

        if (currentRitual != null)
        {
            timeSinceRitualBegin += dt;

            if (timeSinceRitualBegin >= ritualDuration)
            {
				GameObject.Find ("Audio").GetComponent<Soundscript>().Play_sound ("Clap");
				GameObject.Find ("Audio").GetComponent<Soundscript>().Music_FadeVolumeTo (1f, 3f);
                animator.SetTrigger("Clap");
                PunishUnfaithfulPlayers();
                currentRitual = null;
                nextRitual = rrg.GetRandomRitual();
                explainRitual(nextRitual);
            }
        }
        else
        {
            timeSinceLastRitual += dt;

            if (timeSinceLastRitual >= ritualTempo)
            {
                timeSinceLastRitual -= ritualTempo;
                currentRitual = nextRitual;
                ritualDuration = currentRitual.duration;
                timeSinceRitualBegin = 0;
				GameObject.Find ("Audio").GetComponent<Soundscript>().Play_sound ("Clap");
				GameObject.Find ("Audio").GetComponent<Soundscript>().Play_sound ("Dong");
				GameObject.Find ("Audio").GetComponent<Soundscript>().Music_FadeVolumeTo (0f, 3f);
                animator.SetTrigger("Clap");
                StartRitual(currentRitual);
            }
        }


    }
Esempio n. 40
0
 void Start()
 {
     ritual = GameObject.FindGameObjectWithTag("Circle").GetComponent<Ritual>();
 }
Esempio n. 41
0
    public void startPraying(Ritual ritual)
    {
        currentRitual = ritual;

        if (ritual.GetType() == typeof(ActionSequence))
        {
            navMeshAgent.Stop();
            //IAtargetPosition.transform.position = character.transform.position;
            state = State.PRAY;
            actions = ((ActionSequence)ritual).actions;
            currentAction = 0;
        }
        else
        {
            var zone = (ZoneOrder)ritual;
            if (zone.isAllowed)
            {
                state = State.OBEY;
                getClosestSpecificArea((ZoneOrder)ritual);
            }
        }
    }
Esempio n. 42
0
 public void sendRitual(Ritual ritual)
 {
     if (currentPhase == Phase.Player1)
     {
         player1.getTurn().ritualCast = ritual;
     }
     else
     {
         player2.getTurn().ritualCast = ritual;
     }
 }
Esempio n. 43
0
    private void explainRitual(Ritual ritual)
    {
        if(ritual.GetType() == typeof(ActionSequence))
        {
            var seq = (ActionSequence)ritual;
			GameObject.Find ("Audio").GetComponent<Soundscript>().Play_sound ("Chant2");
            StartCoroutine(ExplainSequence(seq.actions, 0));
        } else
        {
            var zo = (ZoneOrder)ritual;
			GameObject.Find ("Audio").GetComponent<Soundscript>().Play_sound ("Chant1");
            StartCoroutine(ExplainZone(zo.zone, zo.isAllowed));
        }
        ritual.Explain();
    }
 public void AddRitual(Ritual ritual) {
     if (!ActiveRituals.Contains(ritual)) {
         ActiveRituals.Add(ritual);
     }
 }
Esempio n. 45
0
    // Kylie's Stuff!
    public static List <Ritual> LoadRituals()
    {
        List <Ritual> rituals = new List <Ritual>();

        char[] lineDelimiter      = new char[] { '@' };
        char[] resourcesDelimiter = new char[] { ';' };
        string filename           = "ritual_types";

        string[] fileByLine = TryLoadListFromGameFolder(filename);

        //Ignore top header row
        for (int lineCount = 1; lineCount < fileByLine.Length; lineCount++)
        {
            //0: has seer or not (int to be cast into a bool)
            //1: flavor text (string)
            //2: success chance (float)
            //3: clout gain (int)
            //4: lost resource ID (blank for none, int otherwise, separated by ; if more than one)
            //5: lost resource quantity (0 for none, int otherwise, separated by ; if more than one)

            string[] ritualInfo    = fileByLine[lineCount].Split(lineDelimiter, StringSplitOptions.None);
            bool     hasSeer       = int.Parse(ritualInfo[0]) != 0;
            float    successChance = float.Parse(ritualInfo[2]);
            int      cloutGain     = int.Parse(ritualInfo[3]);
            int      cloutLoss     = 10;
            int[]    resourceID;
            if (ritualInfo[4] == "")
            {
                resourceID = new int[0];
            }
            else
            {
                string[] resources = ritualInfo[4].Split(resourcesDelimiter, StringSplitOptions.None);
                resourceID = new int[resources.Length];
                for (int i = 0; i < resources.Length; i++)
                {
                    resourceID[i] = int.Parse(resources[i]);
                }
            }

            int[] resourceAmounts = new int[resourceID.Length];
            if (resourceAmounts.Length > 0)
            {
                string[] amts = ritualInfo[5].Split(resourcesDelimiter, StringSplitOptions.None);
                if (resourceAmounts.Length != amts.Length)
                {
                    Debug.Log("Wrong quantities for resources");
                }
                for (int i = 0; i < resourceAmounts.Length; i++)
                {
                    resourceAmounts[i] = int.Parse(amts[i]);
                }
            }

            Ritual r = new Ritual(hasSeer, ritualInfo[1], successChance, cloutGain, cloutLoss, resourceID, resourceAmounts);

            rituals.Add(r);
        }

        return(rituals);
    }
Esempio n. 46
0
 public void StartRitual(Ritual ritual)
 {
     var npcs = GameObject.FindGameObjectsWithTag("NPC");
     foreach (var npc in npcs)
     {
         npc.GetComponentInChildren<IABehavior>().startPraying(ritual);
     }
 }
        private static void CalculateActualBonus(Ritual r)
        {
            r.Bonus = r.Bonus - Math.Abs(r.Goal - r.TotalWithBonus);

            r.ResultTotal = r.Goal;
        }
Esempio n. 48
0
 public virtual void ShowRitual()
 {
     currentRitual = this;
     DeskObjectManager.SetDeskObjectsActive(false);
     gameObject.SetActive(true);
 }
Esempio n. 49
0
 protected virtual void CloseRitual()
 {
     gameObject.SetActive(false);
     DeskObjectManager.SetDeskObjectsActive(true);
     currentRitual = null;
 }
Esempio n. 50
0
	void Awake()
    {
        spriteMapping_ = new Dictionary<State, Sprite>()
        {
            { State.Neutral, neutralSprite },
            { State.Happy, happySprite },
            { State.Angry, angrySprite },
            { State.Hit, hitSprite },
            { State.Sad, sadSprite }
        };

        renderer_ = GetComponent<SpriteRenderer>();

        currentRitual_ = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>().currentRitual;

        currentRitual_.OnComplete += OnAcquire;
        currentRitual_.OnReset += OnMiss;

        portraitHealth_ = GetComponent<PortraitHealth>();
        portraitHealth_.OnPortraitHit += OnHit;
    }
Esempio n. 51
0
    public Ritual GenerateRitual(int i)
    {
        float gameTime = (GameEndTime / 3) / 2 + (GameEndTime / 3) * (i);

        Random.Range(0, GameEndTime * 0.1f);

        if (Random.Range(0, 2) >= 1f)
        {
            gameTime -= Random.Range(0, 15);
        }
        else
        {
            gameTime += Random.Range(0, 15);
        }

        Debug.Log(gameTime);
        PlayerParameters.Interaction type = PlayerParameters.Interaction.LOOK;

        if (Random.Range(0, 2) >= 1f)
        {
            type = PlayerParameters.Interaction.TAKE;
        }

        PlayerParameters.InteractiveObject usedObject = PlayerParameters.InteractiveObject.COFFEE_MACHINE;

        float random = Random.Range(0, 3);

        if (random >= 2)
        {
            usedObject = PlayerParameters.InteractiveObject.COMPUTER;
        }
        else if (random >= 1)
        {
            usedObject = PlayerParameters.InteractiveObject.WINDOW;
        }

        Ritual ritual = new Ritual(gameTime, usedObject, type);
        return ritual;
    }
Esempio n. 52
0
        public bool Equals(Ritual other){

            if (!type.Equals(other.type))
                return false;


            if (!usedObject.Equals(other.usedObject))
                return false;

            Debug.Log("Game time 1 : "+gameTime);
            Debug.Log("Game time 2 : " + other.gameTime);
            if (gameTime > other.gameTime + 5)
                return false;

            if (gameTime < other.gameTime - 5)
                return false;


            Debug.Log("Game time is good");

            return true;
        }
Esempio n. 53
0
	IEnumerator startChanting(Ritual r)
	{
        yield return new WaitForSeconds(Random.value);
        r.startChant();        
	}
Esempio n. 54
0
		} //End.ChangeLeveL()

		public void SetRitual( int ritual ) {
			currentRitual = (Ritual)ritual;
			//TODO ~Z 16.01.31 | Change ritual description text
			Debug.Log( currentRitual );
			var description = GameObject.Find ("Text Description").GetComponent<Text>();


			//Set description text
			switch (currentRitual)
			{
			case Ritual.None:
				description.text = "You have gathered in the unholy halls of meditation. Choose your trial.";
				break;
			case Ritual.PrayOnAltar:
				description.text = "You had an epiphany about a truly ancient instrument of worship. You must depart at once.";
				break;
			case Ritual.BargainWithAncient:
				description.text = "Nightmarish visions of your Lord refuse to leave you, even after you've already woken up.";
				break;
			case Ritual.CleanseDungeon:
				description.text = "The halls have grown cramped. You've been sent on a mission to sanctify the new cathedral with rivers of blood.";
				break;
			case Ritual.SummonMinions:
				description.text = "You shall indeed become the new Maou!";
				break;
			case Ritual.MapDungeon:
				description.text = "Truly a many soul has been lost underneath. You shall attain the forbidden knowledge at any cost.";
				break;
			default:
				description.text = "You transcendence grows near.";
				break;
			}//end.switch

		} //End.SetRitual()