Esempio n. 1
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);
            string infos = "";

            if (mNubiaQuality != NubiaQualityEnum.Normale)
            {
                infos += NubiaQuality.getQualityName(mNubiaQuality) + "\n";
            }
            if (mTRessourceList.Count > 0)
            {
                for (int i = 0; i < mTRessourceList.Count; i++)
                {
                    infos += NubiaInfoRessource.GetInfoRessource(mTRessourceList[i]).Name;
                    if (i < mTRessourceList.Count - 1)
                    {
                        infos += ", ";
                    }
                }
                infos += "\n";
            }
            infos += String.Format("Catégorie: {0}\nModus dex Maxi: +{1}\nMalus: {2}\nEchec aux sorts: {3}%\nDurabilitée: {4}/{5}", TArmorType,
                                   ModDexMaximum,
                                   MalusArmure,
                                   PercentEchecSort,
                                   mHits.ToString(),
                                   mHitsMax.ToString());
            // Console.WriteLine(infos);
            list.Add(infos);
        }
Esempio n. 2
0
        public void AfterCraft(NubiaQualityEnum quality)
        {
            mNubiaQuality = quality;
            for (int i = 0; i < mTRessourceList.Count; i++)
            {
                NubiaRessource     res   = mTRessourceList[i];
                NubiaInfoRessource infos =
                    NubiaInfoRessource.GetInfoRessource(res);
                mArBoost = Math.Max(mArBoost, infos.GlobalAR);
                mHitsMax = Math.Max((int)(50.0 * infos.Durabilite), mHitsMax);
                mHits    = mHitsMax;
            }
            switch (mNubiaQuality)
            {
            case NubiaQualityEnum.Mauvaise: mArBoost--; break;

            case NubiaQualityEnum.Bonne: mHitsMax += 20; break;

            case NubiaQualityEnum.Excellente: mArBoost++; mHitsMax += 40; break;

            case NubiaQualityEnum.Maitre: mArBoost++; mHitsMax += 60; break;
            }
        }
Esempio n. 3
0
 protected virtual void updateName()
 {
     Name = "Ressource de " + NubiaInfoRessource.GetInfoRessource(mRessource).Name;
 }
Esempio n. 4
0
 protected override void updateName()
 {
     Name = "Arbre (" + NubiaInfoRessource.GetInfoRessource(Ressource).Name + ")";
 }
Esempio n. 5
0
        private void FinishSpecialHarvest(NubiaPlayer from, Item tool)
        {
            doHarvestEffect(from, tool);

            NubiaInfoRessource infos = NubiaInfoRessource.GetInfoRessource(Ressource);

            CompType comp = CompType.Minage;

            if (NubiaInfoRessource.GetRessourceType(Ressource) == NubiaRessourceType.Bois)
            {
                comp = CompType.Buchage;
            }

            bool check = from.Competences[comp].roll(infos.Diff);

            if (tool is IUsesRemaining)
            {
                IUsesRemaining utool = tool as IUsesRemaining;
                utool.UsesRemaining--;
                if (utool.UsesRemaining <= 0)
                {
                    tool.Consume();
                }
            }

            if (check)
            {
                if (from.Competences[comp].roll(infos.Diff - 5))
                {
                    RessourceConsume();
                    from.SendMessage("Vous exploitez la ressource avec succès");
                    Item special = BaseRessource.getRessource(Ressource);
                    if (special != null)
                    {
                        if (from.Backpack != null)
                        {
                            from.Backpack.AddItem(special);
                        }
                        else
                        {
                            special.MoveToWorld(from.Location, from.Map);
                        }
                    }
                    else
                    {
                        from.SendMessage("BUG: la ressource n'a pas de class correspondante. Contactez l'équipe");
                    }
                }
                else
                {
                    from.SendMessage("Vous n'arrivez pas à extraire la ressource spéciale");

                    Item normal = null;

                    if (NubiaInfoRessource.GetRessourceType(Ressource) == NubiaRessourceType.Bois)
                    {
                        normal = new BoisNormal();
                    }
                    else
                    {
                        normal = new MetalFer();
                    }

                    if (from.Backpack != null)
                    {
                        from.Backpack.AddItem(normal);
                    }
                    else
                    {
                        normal.MoveToWorld(from.Location, from.Map);
                    }
                }
            }
            else
            {
                if (!from.Competences[comp].roll(infos.Diff - 5))
                {
                    RessourceConsume();
                    from.SendMessage("Une partie de la ressource est saccagée");
                    from.Emote("*Saccage*");
                }
                from.SendMessage("Vous n'arrivez pas à exploiter correctement la ressource");
            }
        }