コード例 #1
0
ファイル: CeintureForce.cs プロジェクト: bsenyuva/terranubia3
        public CeintureForce()
        {
            Hue  = 2118;
            Name = "Ceinture de l'ours";
            ArtefactModus modus = new ArtefactModus();

            modus.DndStat      = Server.Mobiles.DndStat.Force;
            modus.StatValue    = 2;
            this.ArtefactModus = modus;
        }
コード例 #2
0
ファイル: ArtefactModus.cs プロジェクト: bsenyuva/terranubia3
        public static ArtefactModus generate(ArtefactQuality qualite)
        {
            ArtefactModus arte = new ArtefactModus();

            while (arte.getArtefactQuality() < qualite)
            {
                int rand = Utility.Random(2);
                if (rand == 0) // STAT
                {
                    arte.mDndStat = (DndStat)Utility.Random(5);
                    arte.mStatValue++;
                }
                else if (rand == 1) //CompetenceMod
                {
                    CompType ctype = (CompType)Utility.Random((int)CompType.Maximum);
                    if (ctype != CompType.All && ctype != CompType.Maximum)
                    {
                        int value = 0;
                        if (qualite >= ArtefactQuality.Superieur)
                        {
                            value = Utility.Random(4) + 1;
                        }
                        else
                        {
                            value = Utility.Random(2) + 1;
                        }
                        bool c*k = false;
                        foreach (CompetenceMod cmod in arte.mCompetenceMod)
                        {
                            if (cmod.Comp == ctype)
                            {
                                c*k = false;
                                break;
                            }
                        }
                        if (c*k)
                        {
                            arte.mCompetenceMod.Add(new CompetenceMod(value, ctype));
                        }
                    }
                }
                else if (rand == 2) //Sauvegarde Mod)
                {
                    SauvegardeEnum save    = (SauvegardeEnum)Utility.Random(3);
                    bool           doEcole = true;
                    int            value   = Utility.Random(4) + 1;

                    if (qualite >= ArtefactQuality.Rare)
                    {
                        doEcole = Utility.RandomBool();
                    }
                    if (doEcole)
                    {
                        int           nbrEcole = Utility.Random(2) + 1;
                        SortEnergie[] ecoles   = new SortEnergie[nbrEcole];
                        for (int e = 0; e < (int)nbrEcole; e++)
                        {
                            SortEnergie ecole = 1 + (SortEnergie)Utility.Random((int)SortEnergie.Air);

                            ecoles[e] = ecole;
                        }
                        arte.mSaugevardMod.Add(new SauvegardeMod(value, save, ecoles));
                    }
                    else
                    {
                        arte.mSaugevardMod.Add(new SauvegardeMod(value, save));
                    }
                }

                /*   else if (rand == 3) // CA MOD
                 * {
                 *     arte.mCAMod += Utility.Random(4) + 1;
                 * }
                 * else if (rand == 4)
                 * {
                 *     arte.mDegatMod += Utility.Random(1) + 1;
                 * }*/
            }
            return(arte);
        }