Ejemplo n.º 1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                m_Bait   = (Bait)reader.ReadInt();
                m_Charge = reader.ReadInt();
                break;
            }

            case 1:
            {
                reader.ReadItem();
                goto case 0;
            }

            case 0:
            {
                break;
            }
            }

            Name = "canne à pêche";
        }
Ejemplo n.º 2
0
        public static BaseBait CreateBait(Bait bait, int charge)
        {
            switch (bait)
            {
            case Bait.Truite: return(new BaitTruite(charge));

            case Bait.Dore: return(new BaitDore(charge));

            case Bait.Carpe: return(new BaitCarpe(charge));

            case Bait.Anguille: return(new BaitAnguille(charge));

            case Bait.Esturgeon: return(new BaitEsturgeon(charge));

            case Bait.Brochet: return(new BaitBrochet(charge));

            case Bait.Morue: return(new BaitMorue(charge));

            case Bait.Fletan: return(new BaitFletan(charge));

            case Bait.Maquereau: return(new BaitMaquereau(charge));

            case Bait.Sole: return(new BaitSole(charge));

            case Bait.Thon: return(new BaitThon(charge));

            case Bait.Saumon: return(new BaitSaumon(charge));

            case Bait.Raie: return(new BaitRaie(charge));

            case Bait.Espadon: return(new BaitEspadon(charge));

            default: return(null);
            }
        }
Ejemplo n.º 3
0
        public BaseBait(Bait bait, int charge) : base(0xDCE)
        {
            Name   = "appât";
            Weight = 0.5;

            m_Bait    = bait;
            m_Charge  = charge;
            Stackable = true;
        }
Ejemplo n.º 4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_Bait   = (Bait)reader.ReadInt();
                m_Charge = reader.ReadInt();
                break;
            }
            }
        }
Ejemplo n.º 5
0
 public InternalTarget(Bait bait, int amount)
     : base(0, false, TargetFlags.None)
 {
     m_Bait = bait;
     m_Amount = amount;
 }
Ejemplo n.º 6
0
 public InternalPrompt(Bait bait)
 {
     m_Bait = bait;
 }
Ejemplo n.º 7
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted == m_Bait)
                {
                    return;
                }

                if (targeted is FishingPole)
                {
                    if (!m_Bait.IsFishBait())
                    {
                        from.SendMessage("Think again before applying lobster or crab bait to a fishing pole!");
                        return;
                    }

                    FishingPole pole = (FishingPole)targeted;

                    bool hasBait = pole.BaitType != null;

                    if (hasBait && pole.BaitType != m_Bait.BaitType)
                    {
                        from.SendMessage("You swap out the old bait for new.");
                    }

                    if (pole.BaitType == m_Bait.BaitType)
                    {
                        pole.BaitUses += m_Amount;
                    }
                    else
                    {
                        pole.BaitType  = m_Bait.BaitType;
                        pole.BaitUses += m_Amount;
                    }

                    if (m_Bait.Enhanced)
                    {
                        pole.EnhancedBait = true;
                    }

                    from.SendLocalizedMessage(1149759);  //You bait the hook.
                    m_Bait.UsesRemaining -= m_Amount;
                }
                else if (targeted is LobsterTrap)
                {
                    if (m_Bait.IsFishBait())
                    {
                        from.SendMessage("Think again before applying fish bait to a lobster trap!");
                        return;
                    }

                    LobsterTrap trap = (LobsterTrap)targeted;

                    bool hasBait = trap.BaitType != null;

                    trap.BaitType = m_Bait.BaitType;
                    //trap.Hue = m_Bait.Hue;

                    if (hasBait && trap.BaitType != m_Bait.BaitType)
                    {
                        from.SendMessage("You swap out the old bait for new.");
                    }

                    if (trap.BaitType == m_Bait.BaitType)
                    {
                        trap.BaitUses += m_Amount;
                    }
                    else
                    {
                        trap.BaitType  = m_Bait.BaitType;
                        trap.BaitUses += m_Amount;
                    }

                    if (m_Bait.Enhanced)
                    {
                        trap.EnhancedBait = true;
                    }

                    from.SendLocalizedMessage(1149760); //You bait the trap.
                    m_Bait.UsesRemaining -= m_Amount;
                }
                else if (targeted is Bait && ((Bait)targeted).IsChildOf(from.Backpack) && ((Bait)targeted).BaitType == m_Bait.BaitType)
                {
                    Bait bait = (Bait)targeted;

                    bait.UsesRemaining   += m_Amount;
                    m_Bait.UsesRemaining -= m_Amount;

                    if (m_Bait.UsesRemaining <= 0)
                    {
                        m_Bait.Delete();
                        from.SendLocalizedMessage(1116469); //You combine these baits into one cup and destroy the other cup.
                    }
                    else
                    {
                        from.SendMessage("You combine these baits into one cup.");
                    }

                    return;
                }

                if (m_Bait.UsesRemaining <= 0)
                {
                    m_Bait.Delete();
                    from.SendLocalizedMessage(1116467); //Your bait is used up so you destroy the container.
                }
            }
Ejemplo n.º 8
0
 public InternalTarget(Bait bait, int amount)
     : base(0, false, TargetFlags.None)
 {
     m_Bait   = bait;
     m_Amount = amount;
 }
Ejemplo n.º 9
0
 public InternalPrompt(Bait bait)
 {
     m_Bait = bait;
 }