public static SortEnergie[] getAdaptedComp(SortNubia originale, NubiaPlayer eleve)
        {
            //SortNubia newSortNubia = (SortNubia)KonohaHelper.CopyItem(originale);
            ArrayList compPoss = new ArrayList();

            for (int i = 0; i < originale.allowCompetence.Length; i++)
            {
                CompType comp = (CompType)originale.allowCompetence[i];
                Console.WriteLine("Competence autorisé pour le SortNubia: " + comp.ToString());
                //if(eleve.getValueFor(comp) > 0.0)
                //{
                //	Console.WriteLine("-- Competence Ok pour l'élève: "+comp.ToString() );
                //TODO
                compPoss.Add(comp);
                //}
            }
            if (compPoss.Count == 0)
            {
                return(null);
            }
            SortEnergie[] cp = new SortEnergie[compPoss.Count];

            for (int f = 0; f < cp.Length; f++)
            {
                cp[f] = (SortEnergie)compPoss[f];
            }
            return(cp);
        }
Example #2
0
        public void addSort(SortNubia sort)
        {
            /*foreach(Jutsu jut in m_jutsuList)
             * {
             *  if(jut.Nom == jutsu.Nom)
             *      return;
             * }*/
            int  count = m_sorts.Count;
            bool exist = false;

            for (int i = 0; i < count; i++)
            {
                SortNubia juti = m_sorts[i] as SortNubia;
                if (juti.Nom == sort.Nom)
                {
                    exist = true;
                }
            }
            if (exist)
            {
                return;
            }
            else
            {
                sort.Owner = this.mOwner;
                m_sorts.Add(sort);
            }
        }
Example #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_owner      = (NubiaPlayer)reader.ReadMobile();
            m_createur   = reader.ReadString();
            m_name       = reader.ReadString();
            m_time       = reader.ReadDouble();
            m_timeToCast = reader.ReadDouble();

            m_maitrise = reader.ReadDouble();
            m_distance = reader.ReadInt();
            m_energie  = (SortEnergie)reader.ReadInt();
            //	m_skill = (SkillName)reader.ReadInt();
            m_emote = reader.ReadString();

            m_couleur = (MagieColor)reader.ReadInt();
            m_state   = (MagieState)reader.ReadInt();
            m_disturb = (MagieDisturb)reader.ReadInt();

            m_condition = (MagieCondition)reader.ReadInt();
            m_Object    = (Item)reader.ReadItem();
            m_Mobile    = (Mobile)reader.ReadMobile();
            m_SortNubia = (SortNubia)reader.ReadItem();

            if (m_owner != null)
            {
                m_owner.Magie.addSort(this);
            }

            //Console.WriteLine("Deserialize SortNubia: " +Nom);
        }
Example #4
0
 public InternalTimer(bool first, SortNubia item, double t) : base(TimeSpan.FromSeconds(t))
 {
     Priority = TimerPriority.OneSecond;
     m_Item   = item;
     m_first  = first;
     m_t      = t;
 }
Example #5
0
 public void executeSort(int index)
 {
     try
     {
         SortNubia sort = m_sorts[index] as SortNubia;
         sort.StartCast();
     }
     catch { }//	SendMessage("Le jutsu que vous voulez executez n'existe pas");	}
 }
Example #6
0
 public override void OnDoubleClick(Mobile f)
 {
     if (f is NubiaPlayer)
     {
         SortNubia cop = (SortNubia)NubiaHelper.CopyItem(this);
         ((NubiaPlayer)f).Magie.addSort(cop);
         f.SendMessage("Sort {0} assimilé", Name);
         Delete();
     }
 }
Example #7
0
        public virtual void EndSortNubia()         //Pour les timers général sur le timer Turn du Konoha Player
        {
            //Console.WriteLine("End de SortNubia: "+Nom);
            m_state   = MagieState.None;
            m_disturb = MagieDisturb.None;

            if (Owner == null)
            {
                return;
            }
            //Fin des fils
            for (int i = 0; i < Owner.Magie.Sorts.Count; i++)
            {
                if (Owner.Magie.Sorts[i] is SortNubia)
                {
                    SortNubia jut = Owner.Magie.Sorts[i] as SortNubia;
                    if (jut.SortNubiaPere == this)
                    {
                        jut.EndSortNubia();
                    }
                }
            }
        }
Example #8
0
        public static void MakeEffect(NubiaPlayer caster, Mobile cible, SortNubia SortNubia, bool move, bool explose)
        {
            //COULEUR
            int color  = 0;
            int render = (int)SortNubia.render;

            switch (SortNubia.couleur)
            {
            case MagieColor.Chakra: color = caster.ChakraColor; break;
                // case MagieColor.Connaissance: color = KonohaCompHelper.getCompColor(SortNubia.competence); Console.WriteLine("Connaissance dans MakeEffect:" + SortNubia.competence.ToString()); break;
            }

            int effet        = 0x36D4;
            int exploseEffet = 4019;
            int sound        = 0x15E;


            switch (Utility.RandomMinMax(0, 2))
            {
            case 0: exploseEffet = 0x36B0; break;

            case 1: exploseEffet = 0x36BD; break;

            case 2: exploseEffet = 0x36CA; break;
            }

            switch (SortNubia.effect)
            {
            case SortNubiaEffect.Bee: effet = 0x923; break;

            case SortNubiaEffect.BladeSpirit: effet = 0x37EB; break;

            case SortNubiaEffect.BlueSparkle: effet = 0x373A; break;

            case SortNubiaEffect.BlueGoldSparkle1: effet = 0x375A; break;

            case SortNubiaEffect.BlueGoldSparkle2: effet = 0x376A; break;

            case SortNubiaEffect.BluePurpleSparkle: effet = 0x3779; break;

            case SortNubiaEffect.RedSparkle: effet = 0x374A; break;

            case SortNubiaEffect.Energy: effet = 0x3819; break;

            case SortNubiaEffect.Vortex: effet = 0x3789; break;

            case SortNubiaEffect.ExplosionBall: effet = 0x36FE; break;

            case SortNubiaEffect.FireSnake: effet = 0x36F4; break;

            case SortNubiaEffect.Glow1: effet = 0x37B9; break;

            case SortNubiaEffect.Glow2: effet = 0x37BE; break;

            case SortNubiaEffect.Glow3: effet = 0x37C4; break;

            case SortNubiaEffect.Visage: effet = 0x1ED9; break;

            case SortNubiaEffect.SmallFireBall: effet = 0x36E4; break;

            case SortNubiaEffect.Smoke: effet = 0x3728; break;

            case SortNubiaEffect.DoubleHead: effet = 0x1F1F; break;

            case SortNubiaEffect.Rock: effet = Utility.RandomMinMax(0x1363, 0x123D); break;

            case SortNubiaEffect.Crane: effet = 0x1456; break;

            case SortNubiaEffect.Trait: effet = 0x1BFE; break;
            }

            if (move)
            {
                caster.MovingParticles(cible, effet, 7, 0, false, explose, color - 1, render, 9502, exploseEffet, 0x160, 0);
            }
            else             //( int itemID, int speed, int duration, int effect, int hue, int renderMode, EffectLayer layer )
            {
                cible.FixedParticles(effet, 9, 32, 5030, color - 1, render, EffectLayer.Waist);
            }
            cible.PlaySound(sound);
        }
Example #9
0
 public static string formatName(SortNubia sort)
 {
     return(SortNubiaHelper.getDomaineString(sort.Domaine) + ": " + sort.DefaultName);
 }
Example #10
0
        public bool CheckCondition()
        {
            //Console.WriteLine("Check condition");
            if (m_condition == MagieCondition.None)
            {
                return(true);
            }
            if (Owner == null)
            {
                return(false);
            }
            else if (m_condition == MagieCondition.MainNue)
            {
                Item handOne = Owner.FindItemOnLayer(Layer.OneHanded);
                Item handTwo = Owner.FindItemOnLayer(Layer.TwoHanded);
                //Console.WriteLine("Main nue");
                if (handTwo is BaseWeapon)
                {
                    handOne = handTwo;
                }

                if (handOne == null && handTwo == null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else if (m_condition == MagieCondition.ObjetEquiper)
            {
                if (m_Object == null)
                {
                    Owner.PrivateOverheadMessage(MessageType.System, 0, true, "[ERREUR] Cette technique requiere un objet, mais il est Inconnu", Owner.NetState);
                    return(false);
                }

                Item itemEquiped = Owner.FindItemOnLayer(m_Object.Layer);

                bool ok = (itemEquiped.ItemID == m_Object.ItemID);
                if (mustConsume)
                {
                    itemEquiped.Delete();
                }

                return(ok);
            }
            else if (m_condition == MagieCondition.ObjetAlentour)
            {
                if (m_Object == null)
                {
                    Owner.PrivateOverheadMessage(MessageType.System, 0, true, "[ERREUR] Cette technique requiere un objet, mais il est Inconnu", Owner.NetState);
                    return(false);
                }

                Map map = Owner.Map;

                if (map == null)
                {
                    return(false);
                }

                bool ok = false;
                IPooledEnumerable eable = map.GetItemsInRange(Owner.Location, 10);

                foreach (Item item in eable)
                {
                    Type type = item.GetType();
                    if (type == m_Object.GetType())
                    {
                        ok = true;
                    }
                }

                eable.Free();
                return(ok);
            }
            else if (m_condition == MagieCondition.MobileAlentour)
            {
                if (m_Mobile == null)
                {
                    Owner.PrivateOverheadMessage(MessageType.System, 0, true, "[ERREUR] Cette technique requiere un mobile, mais il est Inconnu", Owner.NetState);
                    return(false);
                }

                Map map = Owner.Map;

                if (map == null)
                {
                    return(false);
                }

                bool ok = false;
                IPooledEnumerable eable = map.GetMobilesInRange(Owner.Location, 10);

                foreach (Mobile mob in eable)
                {
                    Type type = mob.GetType();
                    if (type == m_Mobile.GetType())
                    {
                        ok = true;
                    }
                }

                eable.Free();
                return(ok);
            }
            else if (m_condition == MagieCondition.SortNubia)
            {
                if (m_SortNubia == null)
                {
                    Owner.PrivateOverheadMessage(MessageType.System, 0, true, "[ERREUR] Cette technique requiere un SortNubia, mais il est Inconnu", Owner.NetState);
                    return(false);
                }
                bool ok = false;
                for (int i = 0; i < Owner.Magie.sortList.Length; i++)
                {
                    SortNubia jut = Owner.Magie.sortList[i];
                    if ((jut == m_SortNubia && jut.state == MagieState.WaitEnd) || (jut is SortNubiaTransformation && m_SortNubia is SortNubiaTransformation))
                    {
                        ok = true;
                    }
                }
                return(ok);
            }
            return(false);
        }