コード例 #1
0
 public static void InvokeOnFoodEffectSystemUpdate(FoodEffectsCore core)
 {
     if (OnFoodEffectSystemUpdate != null)
     {
         OnFoodEffectSystemUpdate(new BaseCoreEventArgs(core));
     }
 }
コード例 #2
0
ファイル: FoodEffectsCore.cs プロジェクト: kejel/ForkUO
        public static void Initialize()
        {
            FoodEffectsCore core = World.GetCore(typeof(FoodEffectsCore)) as FoodEffectsCore;

            if (core == null)
            {
                core = new FoodEffectsCore();
                core.Prep();

                core.FoodEffects.Add(typeof(BreadLoaf), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Cookies), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Cake), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Muffins), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Quiche), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(MeatPie), new FoodEffect(10, 10, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(SausagePizza), new FoodEffect(10, 10, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(CheesePizza), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(FruitPie), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(PeachCobbler), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(ApplePie), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(PumpkinPie), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(WasabiClumps), new FoodEffect(10, 10, 10, 0, 0, 0, 15));
                core.FoodEffects.Add(typeof(GreenTea), new FoodEffect(10, 10, 10, 0, 0, 0, 30));

                core.FoodEffects.Add(typeof(DarkChocolate), new FoodEffect(-5, -5, -5, 0, 0, 5, 20));
                core.FoodEffects.Add(typeof(MilkChocolate), new FoodEffect(-5, -5, -5, 0, 0, 10, 10));
                core.FoodEffects.Add(typeof(WhiteChocolate), new FoodEffect(-5, -5, -5, 0, 0, 20, 5));

                core.FoodEffects.Add(typeof(CookedBird), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(ChickenLeg), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(FriedEggs), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(LambLeg), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(Ribs), new FoodEffect(5, 5, 0, 5, 5, 0, 30));

                core.FoodEffects.Add(typeof(FishSteak), new FoodEffect(5, -2, 5, 5, 0, 5, 30));
                core.FoodEffects.Add(typeof(MisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20)); // 60
                core.FoodEffects.Add(typeof(WhiteMisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20)); // 60
                core.FoodEffects.Add(typeof(RedMisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20)); // 60
                core.FoodEffects.Add(typeof(AwaseMisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20)); // 60
                core.FoodEffects.Add(typeof(SushiRolls), new FoodEffect(10, 0, 10, 20, 0, 20, 10)); //90
                core.FoodEffects.Add(typeof(SushiPlatter), new FoodEffect(10, 0, 10, 20, 0, 20, 10)); //90
            }

            m_Core = core;

            CommandSystem.Register("FES", AccessLevel.Developer, new CommandEventHandler(FES_OnCommand));
        }
コード例 #3
0
        public static void Initialize()
        {
            FoodEffectsCore core = World.GetCore(typeof(FoodEffectsCore)) as FoodEffectsCore;

            if (core == null)
            {
                core = new FoodEffectsCore();
                core.Prep();

                core.FoodEffects.Add(typeof(BreadLoaf), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Cookies), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Cake), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Muffins), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(Quiche), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(MeatPie), new FoodEffect(10, 10, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(SausagePizza), new FoodEffect(10, 10, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(CheesePizza), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(FruitPie), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(PeachCobbler), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(ApplePie), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(PumpkinPie), new FoodEffect(5, 5, 5, 0, 0, 0, 30));
                core.FoodEffects.Add(typeof(WasabiClumps), new FoodEffect(10, 10, 10, 0, 0, 0, 15));
                core.FoodEffects.Add(typeof(GreenTea), new FoodEffect(10, 10, 10, 0, 0, 0, 30));

                core.FoodEffects.Add(typeof(DarkChocolate), new FoodEffect(-5, -5, -5, 0, 0, 5, 20));
                core.FoodEffects.Add(typeof(MilkChocolate), new FoodEffect(-5, -5, -5, 0, 0, 10, 10));
                core.FoodEffects.Add(typeof(WhiteChocolate), new FoodEffect(-5, -5, -5, 0, 0, 20, 5));

                core.FoodEffects.Add(typeof(CookedBird), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(ChickenLeg), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(FriedEggs), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(LambLeg), new FoodEffect(5, 5, 0, 5, 5, 0, 30));
                core.FoodEffects.Add(typeof(Ribs), new FoodEffect(5, 5, 0, 5, 5, 0, 30));

                core.FoodEffects.Add(typeof(FishSteak), new FoodEffect(5, -2, 5, 5, 0, 5, 30));
                core.FoodEffects.Add(typeof(MisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20));      // 60
                core.FoodEffects.Add(typeof(WhiteMisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20)); // 60
                core.FoodEffects.Add(typeof(RedMisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20));   // 60
                core.FoodEffects.Add(typeof(AwaseMisoSoup), new FoodEffect(10, -2, 10, 10, 0, 10, 20)); // 60
                core.FoodEffects.Add(typeof(SushiRolls), new FoodEffect(10, 0, 10, 20, 0, 20, 10));     //90
                core.FoodEffects.Add(typeof(SushiPlatter), new FoodEffect(10, 0, 10, 20, 0, 20, 10));   //90
            }

            m_Core = core;

            CommandSystem.Register("FES", AccessLevel.Developer, new CommandEventHandler(FES_OnCommand));
        }
コード例 #4
0
        private void SaveButtonPressed(IGumpComponent sender, object param)
        {
            FoodEffectsCore.Core.Enabled = _CoreEnabled;

            FoodEffectsCore.Core.FoodEffects.Clear();

            for (Int32 i = 0; i < _FoodTypes.Count; i++)
            {
                if (_FoodTypes[i] != null)
                {
                    FoodEffectsCore.Core.FoodEffects[_FoodTypes[i]] = _FoodEffects[i];
                }
            }

            if (Address != null)
            {
                Address.SendMessage("Food effect System is {0}!  System contains {1} foods defined.", (FoodEffectsCore.Core.Enabled ? "enabled" : "disabled"), FoodEffectsCore.Core.FoodEffects.Keys.Count);
            }

            FoodEffectsCore.InvokeOnFoodEffectSystemUpdate(FoodEffectsCore.Core);
        }
コード例 #5
0
        public void EffectExpired(Boolean silent)
        {
            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            if (m_FoodEffect != null)
            {
                if (LinkedMobile != null)
                {
                    LinkedMobile.RemoveStatMod("Food-StrBonus");
                    LinkedMobile.RemoveStatMod("Food-DexBonus");
                    LinkedMobile.RemoveStatMod("Food-IntBonus");

                    if (m_BuffInfo != null)
                    {
                        BuffInfo.RemoveBuff(LinkedMobile, m_BuffInfo);
                    }

                    if (!silent)
                    {
                        LinkedMobile.PlaySound(0x1E6);

                        LinkedMobile.SendMessage(12, "Your food effect has worn off");
                    }

                    if (m_FoodEffect != null)
                    {
                        FoodEffectsCore.InvokeOnEffectExpired(LinkedMobile, m_FoodEffect);
                    }
                }

                m_FoodEffect = null;
            }
        }
コード例 #6
0
        public void ApplyEffect(FoodEffect effect, Boolean silent)
        {
            if (FoodEffectsCore.Core == null || !FoodEffectsCore.Core.Enabled || !Core.AOS)
            {
                EffectExpired(true);
                return;
            }

            if (LinkedMobile != null)
            {
                if (m_Timer != null)
                {
                    m_Timer.Stop();
                    m_Timer = null;
                }

                LinkedMobile.RemoveStatMod("Food-StrBonus");
                LinkedMobile.RemoveStatMod("Food-DexBonus");
                LinkedMobile.RemoveStatMod("Food-IntBonus");

                if (m_BuffInfo != null)
                {
                    BuffInfo.RemoveBuff(LinkedMobile, m_BuffInfo);
                }

                if (m_FoodEffect != null)
                {
                    FoodEffectsCore.InvokeOnEffectCanceled(LinkedMobile, m_FoodEffect);
                }

                m_FoodEffect = new FoodEffect(effect.RegenHits, effect.RegenStam, effect.RegenMana, effect.StrBonus, effect.DexBonus, effect.IntBonus, effect.Duration);

                if (m_FoodEffect.StrBonus != 0)
                {
                    LinkedMobile.AddStatMod(new StatMod(StatType.Str, "Food-StrBonus", m_FoodEffect.StrBonus, m_FoodEffect.EffectTimeSpan));
                }

                if (m_FoodEffect.DexBonus != 0)
                {
                    LinkedMobile.AddStatMod(new StatMod(StatType.Dex, "Food-DexBonus", m_FoodEffect.DexBonus, m_FoodEffect.EffectTimeSpan));
                }

                if (m_FoodEffect.IntBonus != 0)
                {
                    LinkedMobile.AddStatMod(new StatMod(StatType.Int, "Food-IntBonus", m_FoodEffect.IntBonus, m_FoodEffect.EffectTimeSpan));
                }

                if (!silent)
                {
                    LinkedMobile.FixedEffect(0x375A, 10, 15);
                    LinkedMobile.PlaySound(0x1EE);

                    LinkedMobile.SendMessage(12, "The food you ate is now affecting your performance...");
                }

                m_Timer = new EffectTimer(this);

                FoodEffectsCore.InvokeOnEffectActivated(LinkedMobile, m_FoodEffect);

                m_BuffInfo = new BuffInfo(BuffIcon.ActiveMeditation, 1074240, 1114057, m_FoodEffect.EffectTimeSpan, LinkedMobile, m_FoodEffect.GetBuffInfoText());
                BuffInfo.AddBuff(LinkedMobile, m_BuffInfo);
            }
        }
コード例 #7
0
ファイル: FoodEffectsCore.cs プロジェクト: kejel/ForkUO
 public static void InvokeOnFoodEffectSystemUpdate(FoodEffectsCore core)
 {
     if (OnFoodEffectSystemUpdate != null)
         OnFoodEffectSystemUpdate(new BaseCoreEventArgs(core));
 }