Exemplo n.º 1
0
 public BasePlante(EnumPlante _type) : base(0xF27)
 {
     Stackable = true;
     m_Plante  = _type;
     InitialTurn();
     Name = AgriHelper.GetPlanteString(m_Plante);
     UpdateLook();
 }
 public PlanteRecoltePutralide(int amount) : base(8751)
 {
     Stackable = true;
     Amount    = amount;
     Hue       = 1442;
     Name      = AgriHelper.GetPlanteString(EnumPlante.Putralide);
     ItemID    = AgriHelper.GetPlanteID(EnumPlante.Putralide, EnumPlanteState.Recolte);
 }
Exemplo n.º 3
0
 public NubiaRecolte(EnumPlante plante, int roll, bool caneat) : base(8751)
 {
     Stackable    = true;
     m_canEat     = caneat;
     m_Plante     = plante;
     m_rollResult = roll;
     Name         = AgriHelper.GetPlanteString(m_Plante);
     ItemID       = AgriHelper.GetPlanteID(m_Plante, EnumPlanteState.Recolte);
 }
Exemplo n.º 4
0
 public override void OnSingleClick(Mobile from)
 {
     if (Amount <= 1)
     {
         LabelTo(from, Name + ", " + AgriHelper.GetStateString(m_State));
     }
     else
     {
         LabelTo(from, Name + ", " + Amount + " " + AgriHelper.GetStateString(m_State) + "s");
     }
     if (((NubiaMobile)from).Competences[CompType.Agriculture].getPureMaitrise() > 5)
     {
         from.SendMessage("Il reste environ {0} heure(s) avant la prochaine phase", m_turn);
     }
 }
Exemplo n.º 5
0
 public void UpdateLook()
 {
     ItemID = AgriHelper.GetPlanteID(m_Plante, m_State);
     if (m_State == EnumPlanteState.GrainePlante)
     {
         Visible = false;
     }
     else
     {
         Visible = true;
     }
     if (m_State == EnumPlanteState.Pourri)
     {
         Hue = 1445;
     }
 }
Exemplo n.º 6
0
        public override void OnDoubleClick(Mobile f)
        {
            NubiaPlayer from = f as NubiaPlayer;

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage("C'est trop loin");
                return;
            }

            if (m_State == EnumPlanteState.Graine)
            {
                CheckPlantation(from);
            }
            else if (m_State == EnumPlanteState.GrainePlante)
            {
                from.Emote("*Ecrase la graine*");
                this.Delete();
            }
            else if (m_State == EnumPlanteState.Naissante)
            {
                from.Emote("*Saccage la plante*");
                this.Delete();
            }
            else if (m_State == EnumPlanteState.Jeune)
            {
                int rollGraine = from.Competences[CompType.Agriculture].intRoll();
                if (rollGraine <= DD)
                {
                    from.Emote("*Saccage la plante*");
                    this.Delete();
                }
                else
                {
                    from.Emote("*Cueille et récupère les graines*");
                    Type       type   = this.GetType();
                    BasePlante plante = (BasePlante)Activator.CreateInstance(type);
                    int        amount = (int)rollGraine / 5;
                    if (amount < 1)
                    {
                        amount = 1;
                    }
                    from.SendMessage("Vous récupérez {0} graines", amount);
                    plante.Amount = amount;
                    plante.Hue    = Hue;
                    if (from.Backpack != null)
                    {
                        from.Backpack.DropItem(plante);
                    }
                }
            }
            else if (m_State == EnumPlanteState.Mature)
            {
                int rollRecolte = from.Competences[CompType.Agriculture].intRoll();
                if (rollRecolte <= DD)
                {
                    from.Emote("*Saccage la plante*");
                    this.Delete();
                }
                else
                {
                    from.Emote("*Récolte*");
                    Item item = AgriHelper.GetRecolteItem(m_Plante);
                    if (item == null)
                    {
                        NubiaRecolte plante = new NubiaRecolte(m_Plante, rollRecolte, CanEat);
                        plante.Hue = Hue;
                        if (from.Backpack != null)
                        {
                            from.Backpack.DropItem(plante);
                        }
                    }
                    else
                    {
                        if (item.Stackable && (int)m_rollResult > 1)
                        {
                            item.Amount = (int)m_rollResult;
                        }
                        if (from.Backpack != null)
                        {
                            from.Backpack.DropItem(item);
                        }
                    }
                    this.Delete();
                }
            }
            else if (m_State == EnumPlanteState.Pourri)
            {
                from.Emote("*Déffriche*");
                this.Delete();
            }
        }