Exemplo n.º 1
0
 public void ResetState()
 {
     magicPower                = 0;
     nowMagicState             = MagicState.Waiting;
     chargeEffect.emissionRate = 0;
     chargeEffect.startColor   = Color.white;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public MagicItem(string filePath,string owner, string p_ItemType, int p_Duration, Enemy enemy)
        {
            Enemy = enemy;
            Owner = owner;
            sprite = new Sprite(GV.ContentManager, filePath);
            Sprite.Scale = 1.0f;
            if (Owner != "player")
            {
                if (p_ItemType == "arrow")
                {
                    this.state = new ArrowState(this);
                    Position = new Vector2(enemy.Position.X, enemy.Position.Y -9) ;
                    Direction = enemy.Direction;

                }
                else if (p_ItemType == "fireMage")
                {
                    //this.state = new fireMageState(this);
                }
            }
            else
            {
                this.state = new InAirState(this);
                Position = GV.Player.Position;

            }

            itemType = p_ItemType;
            Duration = p_Duration;
            active = true;
        }
Exemplo n.º 3
0
        public void DoCastSpell(MagicState _state)
        {
            var state = _state?.CastSpellParams;

            if (state == null)
            {
                log.Warn($"{Name}.DoCastSpell(): null state detected");
                log.Warn(_state);

                // send UseDone?
                SendUseDoneEvent(WeenieError.BadCast);

                return;
            }

            DoCastSpell(state.Spell, state.IsWeaponSpell, state.MagicSkill, state.ManaUsed, state.Target, state.Status);
        }
Exemplo n.º 4
0
    void ChangeState(MagicState state)
    {
        nowMagicState = state;
        switch (nowMagicState)
        {
        case MagicState.MagicFire:
            chargeEffect.startColor = MAGIC_COLOR_TABLE[0];
            break;

        case MagicState.MagicIce:
            chargeEffect.startColor = MAGIC_COLOR_TABLE[1];
            break;

        case MagicState.MagicThunder:
            chargeEffect.startColor = MAGIC_COLOR_TABLE[2];
            break;
        }
    }
Exemplo n.º 5
0
        private void SetEphemeralValues()
        {
            ObjectDescriptionFlags |= ObjectDescriptionFlag.Player;

            // This is the default send upon log in and the most common. Anything with a velocity will need to add that flag.
            // This should be handled automatically...
            //PositionFlags |= PositionFlags.OrientationHasNoX | PositionFlags.OrientationHasNoY | PositionFlags.IsGrounded | PositionFlags.HasPlacementID;

            FirstEnterWorldDone = false;

            SetStance(MotionStance.NonCombat, false);

            // radius for object updates
            ListeningRadius = 5f;

            if (Session != null && Common.ConfigManager.Config.Server.Accounts.OverrideCharacterPermissions)
            {
                if (Session.AccessLevel == AccessLevel.Admin)
                {
                    IsAdmin = true;
                }
                if (Session.AccessLevel == AccessLevel.Developer)
                {
                    IsArch = true;
                }
                if (Session.AccessLevel == AccessLevel.Envoy || Session.AccessLevel == AccessLevel.Sentinel)
                {
                    IsSentinel = true;
                }
                if (Session.AccessLevel == AccessLevel.Advocate)
                {
                    IsAdvocate = true;
                }
            }

            ContainerCapacity = (byte)(7 + AugmentationExtraPackSlot);

            if (Session != null && AdvocateQuest && IsAdvocate) // Advocate permissions are per character regardless of override
            {
                if (Session.AccessLevel == AccessLevel.Player)
                {
                    Session.SetAccessLevel(AccessLevel.Advocate); // Elevate to Advocate permissions
                }
                if (AdvocateLevel > 4)
                {
                    IsPsr = true; // Enable AdvocateTeleport via MapClick
                }
            }

            CombatTable = DatManager.PortalDat.ReadFromDat <CombatManeuverTable>(CombatTableDID.Value);

            _questManager = new QuestManager(this);

            ContractManager = new ContractManager(this);

            ConfirmationManager = new ConfirmationManager(this);

            LootPermission = new Dictionary <ObjectGuid, DateTime>();

            SquelchManager = new SquelchManager(this);

            MagicState = new MagicState(this);

            RecordCast = new RecordCast(this);

            AttackQueue = new AttackQueue(this);

            return; // todo

            // =======================================
            // This code was taken from the old Load()
            // =======================================

            /*AceCharacter character;
             *
             * if (Common.ConfigManager.Config.Server.Accounts.OverrideCharacterPermissions)
             * {
             *  if (Session.AccessLevel == AccessLevel.Admin)
             *      character.IsAdmin = true;
             *  if (Session.AccessLevel == AccessLevel.Developer)
             *      character.IsArch = true;
             *  if (Session.AccessLevel == AccessLevel.Envoy)
             *      character.IsEnvoy = true;
             *  // TODO: Need to setup and account properly for IsSentinel and IsAdvocate.
             *  // if (Session.AccessLevel == AccessLevel.Sentinel)
             *  //    character.IsSentinel = true;
             *  // if (Session.AccessLevel == AccessLevel.Advocate)
             *  //    character.IsAdvocate= true;
             * }*/

            // FirstEnterWorldDone = false;

            // IsAlive = true;
        }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public InAirState(MagicState state)
     : this(state.MagicItem)
 {
 }
Exemplo n.º 7
0
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public MagicItem(string filePath,string owner, string p_ItemType, int p_Duration, Enemy enemy)
        {
            Enemy = enemy;
            Owner = owner;
            sprite = new Sprite(GV.ContentManager, filePath);
            Sprite.Scale = 1.0f;
            if (Owner != "player")
            {
                if (p_ItemType == "arrow")
                {
                    this.state = new ArrowState(this);
                    Position = new Vector2(enemy.Position.X, enemy.Position.Y -9) ;
                    Velocity = new Vector2((GV.Player.Position.X - enemy.Position.X) / 20, (GV.Player.Position.Y - enemy.Position.Y)/20);
                    Direction = enemy.Direction;
                    Sprite.Rotation = 0.0f;
                    itemType = p_ItemType;

                }
                else if (p_ItemType == "fireRow")
                {
                        this.state = new FireState(this);
                        //Position = new Vector2(enemy.Position.X, enemy.Position.Y);
                        //Direction = enemy.Direction;
                        light = new LightSource((int)Position.X, (int)Position.Y, (int)Position.X, (int)Position.Y, 200, 2);
                        itemType = p_ItemType;
                }
                else if (p_ItemType == "egg")
                {
                        Position = Enemy.Position;
                        this.state = new EggState(this);

                        light = new LightSource((int)Position.X, (int)Position.Y, (int)Position.X, (int)Position.Y, 200, 2);

                        itemType = "light";

                    //Position = new Vector2(enemy.Position.X, enemy.Position.Y);
                    //Direction = enemy.Direction;
                }
            }
            else
            {
                this.state = new InAirState(this);
                Position = GV.Player.Position;

               if (p_ItemType == "light")
               {
                    light = new LightSource((int)Position.X, (int)Position.Y, (int)Position.X, (int)Position.Y, 200, 2);
                    EffectRadius = light.Radius;
                }
                else if (p_ItemType == "dark")
                {
                    EffectRadius = 100.0f;
                }
                else
                    EffectRadius = 0.0f;

                //this.state = new InAirState(this);
                //Position = GV.Player.Position;
                itemType = p_ItemType;
            }

            Duration = p_Duration;
            active = true;
        }
Exemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public ArrowState(MagicState state)
     : this(state.MagicItem)
 {
 }
Exemplo n.º 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public InUseState(MagicState state)
     : this(state.MagicItem)
 {
 }
Exemplo n.º 10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public EggState(MagicState state)
     : this(state.MagicItem)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public FireState(MagicState state)
     : this(state.MagicItem)
 {
 }