コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: NubiaCompItem.cs プロジェクト: bsenyuva/terranubia3
        public override bool OnMoveOver(Mobile m)
        {
            if (!(m is NubiaMobile))
            {
                return(false);
            }
            NubiaMobile mob      = m as NubiaMobile;
            bool        resultOk = mob.Competences[mComp].roll(10);

            mob.Competences.wait(1);
            if (isBloquant)
            {
                if (resultOk)
                {
                    mob.SendMessage("Vous n'arrivez pas à passer ici ( jet de " + mComp.ToString() + " raté)");
                }
                else
                {
                    mob.SendMessage("En utilisant {0} vous arrivez à passer", mComp.ToString());
                }
                return(resultOk);
            }
            else if (provocChute)
            {
                if (!resultOk)
                {
                    mob.Emote("*chute*");
                    mob.SetLocation(mteleportTarget, false);
                }
            }
            else if (misTeleport)
            {
                if (resultOk)
                {
                    mob.SetLocation(mteleportTarget, false);
                }
                else
                {
                    mob.SendMessage("Vous n'arrivez pas à passer ici ( jet de " + mComp.ToString() + " raté)");
                }
            }
            return(true);
        }
コード例 #3
0
		internal bool CompareFilter(int cmp, CompType type) {
			switch (type) {
			case CompType.LT: return cmp < 0;
			case CompType.LE: return cmp <= 0;
			case CompType.NE: return cmp != 0;
			case CompType.EQ: return cmp == 0;
			case CompType.GT: return cmp > 0;
			case CompType.GE: return cmp >= 0;
			default: throw new ArgumentException(type.ToString());
			}
		}
コード例 #4
0
        internal bool CompareFilter(int cmp, CompType type)
        {
            switch (type)
            {
            case CompType.LT: return(cmp < 0);

            case CompType.LE: return(cmp <= 0);

            case CompType.NE: return(cmp != 0);

            case CompType.EQ: return(cmp == 0);

            case CompType.GT: return(cmp > 0);

            case CompType.GE: return(cmp >= 0);

            default: throw new ArgumentException(type.ToString());
            }
        }
コード例 #5
0
ファイル: BaseBuff.cs プロジェクト: bsenyuva/terranubia3
        public string getModusDescript()
        {
            string des = "<br>";

            if (m_Freeze)
            {
                des += "<br>Paralisant !";
            }
            if (mStr != 0)
            {
                des += "<br><i>Force:</i> " + (mStr > 0 ? "+" : "") + mStr + "";
            }
            if (mDex != 0)
            {
                des += "<br><i>Dexterité:</i> " + (mDex > 0 ? "+" : "") + mDex + "";
            }
            if (mInt != 0)
            {
                des += "<br><i>Intelligence:</i> " + (mInt > 0 ? "+" : "") + mInt + "";
            }
            if (mSag != 0)
            {
                des += "<br><i>Sagesse:</i> " + (mSag > 0 ? "+" : "") + mSag + "";
            }
            if (mCons != 0)
            {
                des += "<br><i>Constitution:</i> " + (mCons > 0 ? "+" : "") + mCons + "";
            }
            if (mCha != 0)
            {
                des += "<br><i>Charisme:</i> " + (mCha > 0 ? "+" : "") + mCha + "";
            }

            if (mDegatBonus != 0)
            {
                des += "<br><i>Bonus de dégat:</i> " + (mDegatBonus > 0 ? "+" : "") + mDegatBonus + "";
            }
            for (int s = 0; s < (int)SauvegardeEnum.Reflexe; s++)
            {
                SauvegardeEnum save       = (SauvegardeEnum)s;
                int            generalVal = -999;
                for (int i = 0; i <= (int)SortEnergie.Mental; i++)
                {
                    SortEnergie ecole = (SortEnergie)i;
                    int         val   = getSauvegarde(save, ecole);
                    if (ecole == SortEnergie.All)
                    {
                        generalVal = val;
                    }
                    if (val != 0 && (val != generalVal || ecole == SortEnergie.All))
                    {
                        des += "<br><i>" + save.ToString() + ":</i> " + (val > 0 ? "+": "") + val;
                        if (ecole != SortEnergie.All)
                        {
                            des += " <i>( " + ecole.ToString() + " )</i>";
                        }
                    }
                }
            }

            int compVal = -999;

            for (int c = -1; c < (int)CompType.Maximum; c++)
            {
                CompType comp = (CompType)c;
                int      val  = getCompetence(comp);
                if (comp == CompType.All)
                {
                    compVal = val;
                }
                if (val != 0 && (val != compVal || comp == CompType.All))
                {
                    string compName = comp.ToString();
                    if (!(m_caster.Competences[comp] is NullCompetence))
                    {
                        compName = m_caster.Competences[comp].Name;
                    }

                    if (comp == CompType.All)
                    {
                        compName = "Compétences";
                    }
                    des += "<br><i>" + compName + ":</i> " + (val > 0 ? "+" : "") + val;
                }
            }
            return(des);
        }
コード例 #6
0
 public override void GetProperties(ObjectPropertyList list)
 {
     base.GetProperties(list);
     list.Add("Compétence: " + mCompetence.ToString());
 }
コード例 #7
0
 public override string ToString()
 {
     return(String.Format("Load {0}, {1} at {2}", CompType.ToString(), Value.ToString("F2"), Component.ToString()));
 }