Exemplo n.º 1
0
        /// <summary>
        /// Contains basic example usage scenarios.
        /// </summary>
        public static void ShowZodiacBasicExamples()
        {
            var zodiacSign = Zodiac.GetZodiacSignForDate(new DateTime(1966, 2, 12));

            Console.WriteLine($"\nZodiac details for {new DateTime(1966, 2, 12).ToShortDateString()}");
            Console.WriteLine($"Name: {zodiacSign.ZodiacName} English name: {zodiacSign.ZodiacEnglishTranslation} Duration: {zodiacSign.ZodiacDuration}");

            // Another option would be:
            var givenDate         = new DateTime(1995, 8, 26);
            var anotherZodiacSign = givenDate.GetZodiacSign();

            Console.WriteLine($"\nZodiac details for {givenDate.ToShortDateString()}");
            Console.WriteLine($"Name: {anotherZodiacSign.ZodiacName} English name: {anotherZodiacSign.ZodiacEnglishTranslation} Duration: {anotherZodiacSign.ZodiacDuration}");

            var capriconZodiacSign = Zodiac.GetZodiacSign(ZodiacSigns.Capricorn);

            Console.WriteLine($"\nZodiac duration for {ZodiacSigns.Capricorn}");
            Console.WriteLine(capriconZodiacSign.ZodiacDuration);

            var allZodiacSigns = Zodiac.GetAllZodiacSigns();

            Console.WriteLine($"\nGet a list of all zodiac signs");
            foreach (var currentZodiacSign in allZodiacSigns)
            {
                Console.WriteLine($"-\t{currentZodiacSign.ZodiacName}");
            }
        }
Exemplo n.º 2
0
        public static Prediction CreatePrediction(SQLiteDataReader dataReader, Zodiac zodiac, TimeInterval timeInterval)
        {
            dataReader.Read();
            var text = dataReader.GetString(2);

            return(new Prediction(zodiac, timeInterval, text));
        }
Exemplo n.º 3
0
    public void LoadLevel(Zodiac level)
    {
        switch (level)
        {
        case Zodiac.Aquarius: SceneManager.LoadScene("Aquarius"); break;

        case Zodiac.Aries: SceneManager.LoadScene("Aries"); break;

        case Zodiac.Cancer: SceneManager.LoadScene("Cancer"); break;

        case Zodiac.Capricorn: SceneManager.LoadScene("Capricorn"); break;

        case Zodiac.Gemini: SceneManager.LoadScene("Gemini"); break;

        case Zodiac.Leo: SceneManager.LoadScene("Leo"); break;

        case Zodiac.Libra: SceneManager.LoadScene("Libra"); break;

        case Zodiac.Picese: SceneManager.LoadScene("Picese"); break;

        case Zodiac.Sagittarius: SceneManager.LoadScene("Sagittarius"); break;

        case Zodiac.Scorpio: SceneManager.LoadScene("Scorpio"); break;

        case Zodiac.Taurus: SceneManager.LoadScene("Taurus"); break;

        case Zodiac.Virgo: SceneManager.LoadScene("Virgo"); break;
        }
    }
Exemplo n.º 4
0
        public void OnPost(DateTime date)
        {
            var years = Dates.GetAge(date);

            if (years < 0)
            {
                Header      = "Hello, man from the future!";
                Information = $"Please, input correct date. (before {today.ToShortDateString()})";
            }

            else if (years > 135)
            {
                Header      = "Hello, man from the afterlife!";
                Information = $"Please, input correct date. (after {today.Year - 135} year)";
            }

            else
            {
                Header = $"You are {years} years old.";

                if (Dates.Birthday(date))
                {
                    Header += " Happy birthday!";
                }

                Information = $"In western system your zodiac is {Zodiac.ZodiacWestern(date.Day, date.Month)} ";

                Information += $" and in chinese system your zodiac is {Zodiac.ZodiacChinese(date.Year)}.";
            }
        }
Exemplo n.º 5
0
        void Awake()
        {
            cooldown        = GetComponent <CoolDown>();
            cooldown.isOnCD = false;

            art = this;

            health    = actor.health;
            maxHealth = actor.health;
            strength  = actor.armor;
            speed     = actor.speed;
            evasion   = actor.evasion;
            armor     = actor.armor;
            zodiac    = actor.zodiac;

            spellsEquipped = GetComponent <SpellsEquipped>();
            abilities[0]   = spellsEquipped.ability[0];
            abilities[1]   = spellsEquipped.ability[1];
            abilities[2]   = spellsEquipped.ability[2];
            abilities[3]   = spellsEquipped.ability[3];

            animationHandler = GetComponent <AnimationHandler>();

            combatController = FindObjectOfType <CombatController>();
            mover            = GetComponent <Mover>();
            cooldown         = GetComponent <CoolDown>();
            channel          = GetComponent <Channel>();
            targetingManager = GetComponent <TargetingManager>();
            attackExecutor   = GetComponent <AttackExecutor>();
            playerStats      = GetComponent <PlayerStats>();
            //materialRenderer = GetComponent<Renderer>();


            savedAbility = null;
        }
Exemplo n.º 6
0
        public void ResetStats(bool doIncludeHealth)
        {
            if (GetComponent <Fighter>() != null)
            {
                if (doIncludeHealth)
                {
                    health    = fighter.health;
                    maxHealth = fighter.health;
                }
                strength = fighter.strength;
                speed    = fighter.speed;
                evasion  = fighter.evasion;
                armor    = fighter.armor;
                zodiac   = fighter.zodiac;
            }

            if (GetComponent <EnemyTarget>() != null)
            {
                if (doIncludeHealth)
                {
                    health    = enemyTarget.health;
                    maxHealth = enemyTarget.health;
                }
                strength = enemyTarget.strength;
                speed    = enemyTarget.speed;
                evasion  = enemyTarget.evasion;
                armor    = enemyTarget.armor;
                zodiac   = enemyTarget.zodiac;
            }
        }
Exemplo n.º 7
0
        public string FindWestZodiac(DateTime date)
        {
            var day   = date.Day;
            var month = date.Month;

            WestZodiac.WestZodiacSigns Zodiac;
            if ((month == 3 && day >= 21) || (month == 4 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Aries;
            }
            else if ((month == 4 && day >= 21) || (month == 5 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Taurus;
            }
            else if ((month == 5 && day >= 21) || (month == 6 && day <= 21))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Gemini;
            }
            else if ((month == 6 && day >= 22) || (month == 7 && day <= 22))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Cancer;
            }
            else if ((month == 7 && day >= 23) || (month == 8 && day <= 23))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Leo;
            }
            else if ((month == 8 && day >= 24) || (month == 9 && day <= 23))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Virgo;
            }
            else if ((month == 9 && day >= 24) || (month == 10 && day <= 22))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Libra;
            }
            else if ((month == 10 && day >= 23) || (month == 11 && day <= 22))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Scorpio;
            }
            else if ((month == 11 && day >= 23) || (month == 12 && day <= 21))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Sagittarius;
            }
            else if ((month == 12 && day >= 22) || (month == 1 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Capricorn;
            }
            else if ((month == 1 && day >= 21) || (month == 2 && day <= 19))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Aquarius;
            }
            else if ((month == 2 && day >= 20) || (month == 3 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Pisces;
            }
            else
            {
                return("Error!");
            }
            return(Zodiac.ToString());
        }
Exemplo n.º 8
0
        public string FindChineseZodiac(int year)
        {
            var modY = year % 12;

            AsianZodiac.AsianZodiacSigns Zodiac;
            switch (modY)
            {
            case 0: Zodiac = AsianZodiac.AsianZodiacSigns.Monkey; break;

            case 1: Zodiac = AsianZodiac.AsianZodiacSigns.Rooster; break;

            case 2: Zodiac = AsianZodiac.AsianZodiacSigns.Dog; break;

            case 3: Zodiac = AsianZodiac.AsianZodiacSigns.Pig; break;

            case 4: Zodiac = AsianZodiac.AsianZodiacSigns.Rat; break;

            case 5: Zodiac = AsianZodiac.AsianZodiacSigns.Ox; break;

            case 6: Zodiac = AsianZodiac.AsianZodiacSigns.Tiger; break;

            case 7: Zodiac = AsianZodiac.AsianZodiacSigns.Rabbit; break;

            case 8: Zodiac = AsianZodiac.AsianZodiacSigns.Dragon; break;

            case 9: Zodiac = AsianZodiac.AsianZodiacSigns.Snake; break;

            case 10: Zodiac = AsianZodiac.AsianZodiacSigns.Horse; break;

            case 11: Zodiac = AsianZodiac.AsianZodiacSigns.Ram; break;

            default: return("Error!");
            }
            return(Zodiac.ToString());
        }
Exemplo n.º 9
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                List <ZodiacSign.Item> allOptions = new List <ZodiacSign.Item>();

                foreach (Zodiac zodiac in Enum.GetValues(typeof(Zodiac)))
                {
                    if (zodiac == Zodiac.Unset)
                    {
                        continue;
                    }

                    allOptions.Add(new ZodiacSign.Item(zodiac));
                }

                ZodiacSign.Item choice = new CommonSelection <ZodiacSign.Item>(Name, me.FullName, allOptions).SelectSingle();
                if (choice == null)
                {
                    return(false);
                }

                mZodiac = choice.Value;
            }

            me.mZodiacSign = mZodiac;
            return(true);
        }
Exemplo n.º 10
0
        public static string GetTodayPrediction(Zodiac moonSign)
        {
            //TODO: invoke a web-service to get today's prediction
            //

            return(string.Empty);
        }
Exemplo n.º 11
0
 void Start()
 {
     m_ToolMenu    = instantiateMenuUI(rayOrigin, m_MenuPrefab);
     m_connectMenu = m_ToolMenu.GetComponent <ZodiacConnectMenu> ();
     this.ConnectInterfaces(m_connectMenu, rayOrigin);
     m_connectMenu.fire = m_zodiacConnector.Fire;
     m_zodiacConnector  = Zodiac.GetZodiacRoot().GetComponent <ZodiacConnector> ();
 }
Exemplo n.º 12
0
        public void GetZodiacSign_Pisces_Test()
        {
            var symbols = Zodiac.GetZodiacSign(ZodiacSigns.Pisces);

            Assert.Equal("Pisces", symbols.ZodiacName);
            Assert.Equal("The Fish", symbols.ZodiacEnglishTranslation);
            Assert.Equal("February 19 to March 20", symbols.ZodiacDuration);
        }
Exemplo n.º 13
0
        public void GetZodiacSign_Capricorn_Test()
        {
            var symbols = Zodiac.GetZodiacSign(ZodiacSigns.Capricorn);

            Assert.Equal("Capricorn", symbols.ZodiacName);
            Assert.Equal("The Goat", symbols.ZodiacEnglishTranslation);
            Assert.Equal("December 22 to January 19", symbols.ZodiacDuration);
        }
Exemplo n.º 14
0
    public static Coin SpawnCoin(Zodiac zodiac)
    {
        Coin coin = Instantiate(coinModel) as Coin;

        coin.transform.parent        = spawnPoint;
        coin.transform.localPosition = Vector3.zero;
        return(coin);
    }
Exemplo n.º 15
0
    private void Awake()
    {
        if (UnitBirthDate == null)
        {
            UnitBirthDate = new DateTime(BirthYear, BirthMonth, BirthDay);
        }

        UnitZodiacSign = Calendar.GetZodiacByDate(UnitBirthDate);
    }
        public void SaveAndGetZodiac()
        {
            var expectedZodiac = new Zodiac("Scorpius", ZodiacType.Scorpius);

            _connection.SaveOrUpdate(expectedZodiac);
            _actualZodiac = _connection.GetZodiac(ZodiacType.Scorpius);
            Assert.AreEqual(expectedZodiac, _actualZodiac,
                            $"Returned from db Zodiac '{_actualZodiac}' is not equal to saved in db Zodiac '{expectedZodiac}'");
        }
Exemplo n.º 17
0
        public static Zodiac GetZodiacSign(int day, int month)
        {
            Zodiac astroSign = Zodiac.Козерог;

            switch (month)
            {
            case 1:
                astroSign = (day < 20) ? Zodiac.Козерог : Zodiac.Водолей;
                break;

            case 2:
                astroSign = (day < 19) ? Zodiac.Водолей : Zodiac.ыбы;
                break;

            case 3:
                astroSign = (day < 21) ? Zodiac.ыбы : Zodiac.Овен;
                break;

            case 4:
                astroSign = (day < 20) ? Zodiac.Овен : Zodiac.Телец;
                break;

            case 5:
                astroSign = (day < 21) ? Zodiac.Телец : Zodiac.Близнецы;
                break;

            case 6:
                astroSign = (day < 21) ? Zodiac.Близнецы : Zodiac.ак;
                break;

            case 7:
                astroSign = (day < 23) ? Zodiac.ак : Zodiac.Лев;
                break;

            case 8:
                astroSign = (day < 23) ? Zodiac.Лев : Zodiac.Дева;
                break;

            case 9:
                astroSign = (day < 23) ? Zodiac.Дева : Zodiac.Весы;
                break;

            case 10:
                astroSign = (day < 23) ? Zodiac.Весы : Zodiac.Скорпион;
                break;

            case 11:
                astroSign = (day < 22) ? Zodiac.Скорпион : Zodiac.Стрелец;
                break;

            case 12:
                astroSign = (day < 22) ? Zodiac.Стрелец : Zodiac.Козерог;
                break;
            }

            return(astroSign);
        }
 private SQLiteDataReader GetZodiacsDataReader()
 {
     using var command   = _connection.CreateCommand();
     command.Connection  = _connection;
     command.CommandText =
         $"select {Zodiac.GetIdColumnName()}, {Zodiac.GetNameColumnName()}, {Zodiac.GetTypeColumnName()} " +
         $"from {Zodiac.GetTableName()};";
     Console.WriteLine("Execute SQL: " + command.CommandText);
     return(command.ExecuteReader());
 }
 private void Delete(Zodiac zodiac)
 {
     using var command   = _connection.CreateCommand();
     command.Connection  = _connection;
     command.CommandText =
         $"delete from {Zodiac.GetTableName()} " +
         $"where {Zodiac.GetTypeColumnName()} = :enum_number;";
     command.Parameters.AddWithValue("zodiac_id", (int)zodiac.Type);
     Console.WriteLine("Execute SQL: " + command.CommandText);
     command.ExecuteNonQuery();
 }
 private SQLiteDataReader GetZodiacDataReader(ZodiacType zodiacType)
 {
     using var command   = _connection.CreateCommand();
     command.Connection  = _connection;
     command.CommandText =
         $"select {Zodiac.GetIdColumnName()}, {Zodiac.GetNameColumnName()}, {Zodiac.GetTypeColumnName()} " +
         $"from {Zodiac.GetTableName()} " +
         $"where {Zodiac.GetTypeColumnName()} = :enum_number;";
     command.Parameters.AddWithValue("enum_number", (int)zodiacType);
     Console.WriteLine("Execute SQL: " + command.CommandText);
     return(command.ExecuteReader());
 }
 public Zodiac GetZodiac(int id)
 {
     using var command   = _connection.CreateCommand();
     command.Connection  = _connection;
     command.CommandText =
         $"select {Zodiac.GetIdColumnName()}, {Zodiac.GetNameColumnName()}, {Zodiac.GetTypeColumnName()} " +
         $"from {Zodiac.GetTableName()} " +
         $"where {Zodiac.GetIdColumnName()} = :id;";
     command.Parameters.AddWithValue("id", id);
     Console.WriteLine("Execute SQL: " + command.CommandText);
     return(Factory.CreateZodiac(command.ExecuteReader()));
 }
 private SQLiteDataReader GetPredictionDataReader(Zodiac zodiac, TimeInterval timeInterval)
 {
     using var command   = _connection.CreateCommand();
     command.Connection  = _connection;
     command.CommandText =
         $"select {Prediction.GetZodiacColumnName()}, {Prediction.GetTimeIntervalColumnName()}, {Prediction.GetTextColumnName()} from {Prediction.GetTableName()} " +
         $"where {Prediction.GetZodiacColumnName()} = :zodiac_id " +
         $"and {Prediction.GetTimeIntervalColumnName()} = :interval_id;";
     command.Parameters.AddWithValue("zodiac_id", zodiac.Id);
     command.Parameters.AddWithValue("interval_id", timeInterval.Id);
     Console.WriteLine("Execute SQL: " + command.CommandText);
     return(command.ExecuteReader());
 }
Exemplo n.º 23
0
        private void GetZodiac()
        {
            // memaksa culture agar id-ID
            CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = new CultureInfo("id-ID");

            // mengambil nilai dari UI
            string tanggalPilihan = dtpTanggalLahir.Value.ToShortDateString();

            // memanggil library Zodiac
            hasil          = Zodiac.FindZodiac(tanggalPilihan);
            lblZodiac.Text = "Selamat Datang:" + hasil;
        }
Exemplo n.º 24
0
        //standalone properties
        public override void InstantiateListener(object sender, PrimitiveEventArgs e)
        {
            var instance = CreateMonoObject(e.componentType, Zodiac.GetZodiacRoot());

            if (e.componentType.IsSubclassOf(typeof(MemberMono)))
            {
                ((MemberMono)instance).StandaloneInit(CreateUnityObjectPointer(instance));
            }
            else
            {
                //standalone Init
                instance.Init();
            }
        }
Exemplo n.º 25
0
 protected override void OnGUI()
 {
     base.OnGUI();
     if (zodiacConnector == null)
     {
         zodiacConnector = Zodiac.GetZodiacRoot().gameObject.GetComponent <ZodiacConnector> ();
     }
     zodiacConnector.enabled = EditorGUILayout.Toggle("Enabled", zodiacConnector.enabled);
     if (!zodiacConnector.enabled || !zodiacConnector)
     {
         return;
     }
     drawContext();
     drawSelected();
 }
Exemplo n.º 26
0
 public void ReportDeath(int studentsDied, Zodiac Team)
 {
     DeathText.SetActive(true);
     if (studentsDied == 1)
     {
         DeathText.GetComponent <Text>().text = studentsDied + " " + Team.name + " student has died!";
     }
     else
     {
         DeathText.GetComponent <Text>().text = studentsDied + " " + Team.name + " students have died!";
     }
     if (Team.hasLost)
     {
         DeathText.GetComponent <Text>().text += " " + Team.name + " has lost!";
     }
 }
Exemplo n.º 27
0
        public static string GetSign(Zodiac zodiac)
        {
            var zodiacs = ZodiacOperations.GetAllZodiacs();

            return((from variable in zodiacs

                    let startMonth = int.Parse(variable.Item1.Date.Substring(0, 2))
                                     let startDay = int.Parse(variable.Item1.Date.Substring(3, 2))
                                                    let endMonth = int.Parse(variable.Item2.Date.Substring(0, 2))
                                                                   let endDay = int.Parse(variable.Item2.Date.Substring(3, 2))

                                                                                let thisMonth = int.Parse(zodiac.Date.Substring(0, 2))
                                                                                                let thisDay = int.Parse(zodiac.Date.Substring(3, 2))

                                                                                                              where thisMonth == startMonth && thisDay >= startDay || thisMonth == endMonth && thisDay <= endDay
                                                                                                              select variable.Item3).FirstOrDefault());
        }
Exemplo n.º 28
0
        string connectionString = ConfigurationManager.AppSettings["sql"];                 // define app settings
        public List <Zodiac> ZodiacSignData(string sql)                                    // define new list of type zodiac named Zodiac Sign Data while passing in the string sql
        {
            MySqlCommand    mySqlCommandZodiac;                                            // define mysql command
            MySqlDataReader mySqlDataReaderZodiac;                                         // define mysql datareader
            MySqlConnection mySqlConnectionZodiac = new MySqlConnection(connectionString); // define new connection
            List <Zodiac>   zodiacSigns           = new List <Zodiac>();                   // define new list

            try
            {
                mySqlConnectionZodiac.Open();                                                  // open the connection
                mySqlCommandZodiac    = new MySqlCommand(sql, mySqlConnectionZodiac);          // define new mysql command with the string sql and mysql connection zodiac
                mySqlDataReaderZodiac = mySqlCommandZodiac.ExecuteReader();                    // execute reader
                if (mySqlDataReaderZodiac.HasRows)                                             // if the data table has rows
                {
                    while (mySqlDataReaderZodiac.Read())                                       // read the table
                    {
                        Zodiac zodiac = new Zodiac();                                          // define new variable zodiac of type zodiac
                        zodiac.Id         = mySqlDataReaderZodiac["id"].ToString().Trim();     // read the id column in the data table
                        zodiac.ZodiacSign = mySqlDataReaderZodiac["zodiac"].ToString().Trim(); // read the zodiac column on the data table
                        zodiacSigns.Add(zodiac);                                               // finally, append the zodiac sign
                    }
                }
                mySqlDataReaderZodiac.Close();          // close the data reader
                mySqlConnectionZodiac.Close();          // close the connection
                return(zodiacSigns);                    // rmake sure all code paths return a value
            }
            catch (MySqlException mySqlException)       // put the general exception first
            {
                string excptn = mySqlException.Message; // output the error in a string
                return(zodiacSigns);                    // return zodiac signs
            }
            catch (Exception err)                       // then catch this exception
            {
                string errMsg = err.Message;            // output the error to a string
                return(zodiacSigns);                    // return zodiac signs
            }
            finally                                     // this statement will execute no matter what
            {
                if (mySqlConnectionZodiac != null)      // if the connection is not null
                {
                    mySqlConnectionZodiac.Dispose();    // dump everything
                }
            }
        }
Exemplo n.º 29
0
        public static double GetStartDegree(this Zodiac zodiac)
        {
            switch (zodiac)
            {
            case Zodiac.Aries:
                return(0.0);

            case Zodiac.Taurus:
                return(30.0);

            case Zodiac.Gemini:
                return(60.0);

            case Zodiac.Cancer:
                return(90.0);

            case Zodiac.Leo:
                return(120.0);

            case Zodiac.Virgo:
                return(150.0);

            case Zodiac.Libra:
                return(180.0);

            case Zodiac.Scorpio:
                return(210.0);

            case Zodiac.Sagittarius:
                return(240.0);

            case Zodiac.Capricorn:
                return(270.0);

            case Zodiac.Aquarius:
                return(300.0);

            case Zodiac.Pisces:
                return(330.0);

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 30
0
        public static string GetSign(this Zodiac zodiac)
        {
            switch (zodiac)
            {
            case Zodiac.Aries:
                return(Signs[0]);

            case Zodiac.Taurus:
                return(Signs[1]);

            case Zodiac.Gemini:
                return(Signs[2]);

            case Zodiac.Cancer:
                return(Signs[3]);

            case Zodiac.Leo:
                return(Signs[4]);

            case Zodiac.Virgo:
                return(Signs[5]);

            case Zodiac.Libra:
                return(Signs[6]);

            case Zodiac.Scorpio:
                return(Signs[7]);

            case Zodiac.Sagittarius:
                return(Signs[8]);

            case Zodiac.Capricorn:
                return(Signs[9]);

            case Zodiac.Aquarius:
                return(Signs[10]);

            case Zodiac.Pisces:
                return(Signs[11]);

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 31
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                List<ZodiacSign.Item> allOptions = new List<ZodiacSign.Item>();

                foreach (Zodiac zodiac in Enum.GetValues(typeof(Zodiac)))
                {
                    if (zodiac == Zodiac.Unset) continue;

                    allOptions.Add(new ZodiacSign.Item(zodiac));
                }

                ZodiacSign.Item choice = new CommonSelection<ZodiacSign.Item>(Name, me.FullName, allOptions).SelectSingle();
                if (choice == null) return false;

                mZodiac = choice.Value;
            }

            me.mZodiacSign = mZodiac;
            return true;
        }
Exemplo n.º 32
0
        /// <summary>
        /// Builds a character with "default" stats
        /// </summary>
        private void BuildDummyCharacter()
        {
            accessory = Item.GetItemAtOffset(0);
            body = Item.GetItemAtOffset(0);
            bravery = 0;
            experience = 0;
            faith = 0;

            gender = ((rng.Next() % 2) == 0) ? Gender.Male : Gender.Female;
            Name = string.Empty;

            head = Item.GetItemAtOffset(0);
            isPresent = false;
            job = Class.ClassDictionary[0x00];

            jobLevels = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
            jobsUnlocked = new byte[] { 0x00, 0x00, 0x00 };
            jp = new ushort[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            totalJP = new ushort[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            jobsAndAbilities = new JobsAndAbilities(new byte[173]);

            leftHand = Item.GetItemAtOffset(0);
            leftShield = Item.GetItemAtOffset(0);
            level = 0;
            movementAbility = Ability.GetAbilityFromOffset(0);
            rawHP = Job.GetRawHPFromActualHP(0);
            rawMA = Job.GetRawMAFromActualMA(0);
            rawMP = Job.GetRawMPFromActualMP(0);
            rawPA = Job.GetRawPAFromActualPA(0);
            rawSP = Job.GetRawSPFromActualSP(0);
            reactAbility = Ability.GetAbilityFromOffset(0);
            rightHand = Item.GetItemAtOffset(0);
            rightShield = Item.GetItemAtOffset(0);
            secondaryAction = SecondaryAction.ActionDictionary[0x00];
            for (int i = 0; i < 22; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    skillsUnlocked[i, j] = 0x00;
                }
            }

            spriteSet = SpriteSet.AllSprites[0x00];
            supportAbility = Ability.GetAbilityFromOffset(0);
            unknownOffset03 = 0x00;
            unknownOffset05 = 0x00;
            zodiacSign = (Zodiac)0;
            OnProposition = false;
            Kills = 0;

            isDummy = true;
        }
Exemplo n.º 33
0
 public void RequestSetSign(Zodiac zodiac)
 {
     mCASModel.RequestSetSign(zodiac);
 }
Exemplo n.º 34
0
        /// <summary>
        /// Builds an actual character from its binary data
        /// </summary>
        /// <param name="charData"></param>
        private void BuildCharacter(byte[] charData)
        {
            spriteSet = SpriteSet.AllSprites[charData[0]];
            isPresent = (charData[1] != 0xFF);

            if (!Class.ClassDictionary.TryGetValue(charData[2], out job))
            {
                job = Class.ClassDictionary[0x4A];
            }
            unknownOffset03 = charData[3];
            gender = (Gender)(charData[4] & 0xE0);
            unknownOffset05 = charData[5];
            zodiacSign = (Zodiac)(charData[6] & 0xF0);

            if (gender == Gender.Monster)
            {
                secondaryAction = SecondaryAction.ActionDictionary[0x00];
                supportAbility = Ability.AbilityList[0];
                reactAbility = Ability.AbilityList[0];
                movementAbility = Ability.AbilityList[0];
                head = Item.ItemList[0];
                body = Item.ItemList[0];
                accessory = Item.ItemList[0];
                rightHand = Item.ItemList[0];
                rightShield = Item.ItemList[0];
                leftHand = Item.ItemList[0];
                leftShield = Item.ItemList[0];
            }
            else
            {
                secondaryAction = SecondaryAction.ActionDictionary[charData[7]];
                reactAbility = Ability.GetAbilityFromOffset(TwoBytesToUShort(charData[8], charData[9]));
                supportAbility = Ability.GetAbilityFromOffset(TwoBytesToUShort(charData[10], charData[11]));
                movementAbility = Ability.GetAbilityFromOffset(TwoBytesToUShort(charData[12], charData[13]));
                head = Item.GetItemAtOffset(TwoBytesToUShort(charData[14], charData[15]));
                body = Item.GetItemAtOffset(TwoBytesToUShort(charData[16], charData[17]));
                accessory = Item.GetItemAtOffset(TwoBytesToUShort(charData[18], charData[19]));
                rightHand = Item.GetItemAtOffset(TwoBytesToUShort(charData[20], charData[21]));
                rightShield = Item.GetItemAtOffset(TwoBytesToUShort(charData[22], charData[23]));
                leftHand = Item.GetItemAtOffset(TwoBytesToUShort(charData[24], charData[25]));
                leftShield = Item.GetItemAtOffset(TwoBytesToUShort(charData[26], charData[27]));
            }

            experience = charData[28];
            level = charData[29];
            bravery = charData[30];
            faith = charData[31];

            rawHP = ThreeBytesToUInt(charData[32], charData[33], charData[34]);
            rawMP = ThreeBytesToUInt(charData[35], charData[36], charData[37]);
            rawSP = ThreeBytesToUInt(charData[38], charData[39], charData[40]);
            rawPA = ThreeBytesToUInt(charData[41], charData[42], charData[43]);
            rawMA = ThreeBytesToUInt(charData[44], charData[45], charData[46]);

            byte[] jaBytes = new byte[173];

            Savegame.CopyArray(charData, jaBytes, 0x4BB - 0x48C, 173);
            jobsAndAbilities = new JobsAndAbilities(jaBytes);

            for (int i = 0; i < 15; i++)
            {
                rawName[i] = charData[0xDC + i];
            }

            for (int k = 0; k < 21; k++)
            {
                afterName[k] = charData[0xEB + k];
            }
        }
Exemplo n.º 35
0
 public void OnSignUpdatedProxy(Zodiac zodiac)
 {
     try
     {
         if (SignUpdated != null)
         {
             SignUpdated(zodiac);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnSignUpdatedProxy", e);
     }
 }