Exemplo n.º 1
0
 public EffectRec(int name, EffectParams reqParams, EffectFlags flags,
                  int frameCount, string gfx, string sfx, MNXRange duration,
                  MNXRange magnitude, int mpReq, int levReq,
                  AbilityID resistance, MNXRange damage)
 {
     NameRS     = name;
     ReqParams  = reqParams;
     Flags      = flags;
     FrameCount = (sbyte)frameCount;
     GFX        = gfx;
     SFX        = sfx;
     Duration   = duration;
     Magnitude  = magnitude;
     MPReq      = (short)mpReq;
     LevReq     = (short)levReq;
     Resistance = resistance;
     Damage     = damage;
     ImageIndex = -1;
 }
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField fld = Field;

            Step(aX, aY);

            if (fld.IsBarrier(aX, aY))
            {
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)fld.FindCreature(aX, aY);
                aContinue = true;
                if (c != null)
                {
                    if (c.HasAffect(EffID))
                    {
                        MNXRange dmg = EffectsData.dbEffects[(int)EffID].Damage;
                        c.ApplyDamage(RandomHelper.GetBoundedRnd(dmg.Min, dmg.Max), DmgKind, null, "");
                    }
                    if (EffID == EffectID.eid_Slinn_Gout)
                    {
                        c.Luck--;
                    }
                    else
                    {
                        if (EffID == EffectID.eid_Ellegiant_Throw)
                        {
                            aContinue = false;
                            Item item = new Item(GameSpace.Instance, fld);
                            item.CLSID = GlobalVars.nwrDB.FindEntryBySign("Boulder").GUID;
                            item.Count = 1;
                            item.SetPos(aX, aY);
                            item.Owner = fld;
                            fld.Items.Add(item, false);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        public static int GetDuration(EffectID effectID, ItemState state, bool Inv)
        {
            if (Inv)
            {
                if (state != ItemState.is_Blessed)
                {
                    if (state == ItemState.is_Cursed)
                    {
                        state = ItemState.is_Blessed;
                    }
                }
                else
                {
                    state = ItemState.is_Cursed;
                }
            }
            MNXRange r = EffectsData.dbEffects[(int)effectID].Duration;
            float    f = StaticData.dbItemStates[(int)state].Factor;

            return(RandomHelper.GetBoundedRnd((int)((long)Math.Round(((double)r.Min * (double)f))), (int)((long)Math.Round(((double)r.Max * (double)f)))));
        }
Exemplo n.º 4
0
        public static int GetMagnitude(EffectID effectID)
        {
            MNXRange r = EffectsData.dbEffects[(int)effectID].Magnitude;

            return(RandomHelper.GetBoundedRnd(r.Min, r.Max));
        }
 public ItemEntry(object owner)
     : base(owner)
 {
     FramesLoaded = 0;
     BonusRange   = new MNXRange();
 }