コード例 #1
0
ファイル: CardOrganizer.cs プロジェクト: jlfulmer/SageScrolls
 public void NewTask(Task a_Task)
 {
     //create the new cards based on the task goal
     for(int i = 0; i<a_Task.Goals.Length; i++)
     {
         m_arrNewCards.Add(new Card(a_Task.Goals[i], new Vector2(m_narrXValues[i % 4], m_narrYValues[i / 4]), m_Level,
             (i < 4 ? Card.State.Available : (i < 8 ? Card.State.Disabled : Card.State.ReallyDisabled))));
     }
     //if we are at the beginning of the game, then just
     //set the new cards as current cards and get started right away
     if (m_arrCards.Count == 0)
     {
         m_arrCards = m_arrNewCards;
         m_arrNewCards = new List<Card>();
     }
     else//otherwise tell the old cards to start clearing themselves out of the way
     {
         foreach (Card c in m_arrCards)
         {
             c.ClearCard();
         }
         m_State = State.TaskTransition;
         m_nTimer = 0;
     }
 }
コード例 #2
0
 public void NewTask(Task a_Task)
 {
     m_sOldText = m_sCurrText;
     m_sCurrText = a_Task.Text;
     m_nOldPoints = m_nCurrPoints;
     m_nCurrPoints = a_Task.Points;
     m_CurrState = State.FADE;
     m_nMillisSinceFadeStart = 0;
 }
コード例 #3
0
ファイル: Level.cs プロジェクト: jlfulmer/SageScrolls
        public void TaskFinished()
        {
            int nLastPrestige = score.Prestige;

            if (timer.TimeRemaining <= 0)
                score.UpdateScore(timer, false);
            else
                score.UpdateScore(timer, true);

            if (nLastPrestige == 1 && score.Prestige == 2)
            {
                StartTutorial(Tutorial.TutorialNumber.Tutorial_2);
            }
            else if (!gameFinished)
            {
                task = new Task(score.Prestige);
                if (score.Prestige == 1)
                {
                    timer.TotalTime = 30000;
                }
                else
                {
                    Element.Type[] elements = task.Goals;
                    timer.TotalTime = 20000;
                    foreach (Element.Type e in elements)
                    {
                        if (e >= Element.Type.Spirit)
                            timer.TotalTime = timer.TotalTime + 24000;
                        else if (e >= Element.Type.Phoenix)
                            timer.TotalTime = timer.TotalTime + 18000;
                        else if (e >= Element.Type.Metal)
                            timer.TotalTime = timer.TotalTime + 12000;
                        else if (e >= Element.Type.Magma)
                            timer.TotalTime = timer.TotalTime + 8000;
                        else if (e >= Element.Type.Combustion)
                            timer.TotalTime = timer.TotalTime + 3000;
                    }
                }
                timer.Reset();
            }

            updateTaskValue(0);
        }
コード例 #4
0
ファイル: Level.cs プロジェクト: jlfulmer/SageScrolls
 private void StartTutorial(Tutorial.TutorialNumber a_eTutorial)
 {
     Add(tutorial);
         tutorial.StartTutorial(a_eTutorial);
         timer.TotalTime = double.MaxValue;
         //adjust the time remaining so there is no change in happiness
         timer.TimeRemaining = timer.TotalTime;
         timer.help = true;
         task = new Task(tutorial, score.Prestige);
 }
コード例 #5
0
ファイル: Level.cs プロジェクト: jlfulmer/SageScrolls
 public void Dispose()
 {
     timer = null;
     score = null;
     task = null;
     Element.ElementBuilder.OnBuild -= Add;
     if (!displayItems.Contains(tutorial))
         tutorial.Dispose();
     tutorial = null;
     foreach (IDisplayableItem item in displayItems)
     {
         item.Dispose();
     }
     displayItems = null;
     foreach (IDisplayableItem item in guiItems)
     {
         item.Dispose();
     }
     guiItems = null;
     foreach (IDisplayableItem item in displayItemsToAdd)
     {
         item.Dispose();
     }
     displayItemsToAdd = null;
     foreach (IDisplayableItem item in displayItemsToRemove)
     {
         item.Dispose();
     }
     displayItemsToRemove = null;
 }