コード例 #1
0
        public MagicEditor(MagicSpell ActiveMagicSpell, ProjectileContext GlobalProjectileContext, ProjectileParams.SharedProjectileParams SharedParams)
        {
            this.ActiveMagicSpell        = ActiveMagicSpell;
            this.GlobalProjectileContext = GlobalProjectileContext;
            this.SharedParams            = SharedParams;
            ZoomLevel = 1f;

            SelectionRadius      = 10;
            MagicElementSelected = null;

            ListMagicElement = new List <MagicElement>();
            ListMagicElement.AddRange(ActiveMagicSpell.ListMagicCore);
            ListActionMenuChoice = new ActionPanelHolder();
        }
コード例 #2
0
        public MagicSpell(MagicSpell Other, IMagicUser Owner)
        {
            Name = Other.Name;

            ListMagicSpell             = new List <BaseAutomaticSkill>();
            ListMagicCore              = new List <MagicCore>();
            GlobalContext              = Other.GlobalContext;
            GlobalContext.ActiveUser   = Owner;
            GlobalContext.ActiveTarget = Owner;

            for (int C = 0; C < Other.ListMagicCore.Count; ++C)
            {
                MagicCore NewMagicCore = (MagicCore)Other.ListMagicCore[C].Copy();
                NewMagicCore.CopyElements(Other.ListMagicCore[C]);
                ListMagicCore.Add(NewMagicCore);
            }
        }
コード例 #3
0
        public MagicPreviewerPanel(ContentManager Content, MagicSpell ActiveMagicSpell, ActionPanelHolder ListActionMenuChoice, ProjectileContext GlobalProjectileContext, SharedProjectileParams SharedParams, Vector2 UserPosition, Rectangle EnemyBounds)
            : base("Previewer", ListActionMenuChoice, true)
        {
            sprPixel = Content.Load <Texture2D>("pixel");

            ListProjectile = new List <Projectile>();

            Vector2[] SandboxPoints = new Vector2[4]
            {
                new Vector2(0, 0),
                new Vector2(0, Constants.Height),
                new Vector2(Constants.Width, Constants.Height),
                new Vector2(Constants.Width, 0),
            };
            SandboxCollisionBox = new Polygon(SandboxPoints, Constants.Width, Constants.Height);

            Vector2[] EnemyPoints = new Vector2[4]
            {
                new Vector2(EnemyBounds.X, EnemyBounds.Y),
                new Vector2(EnemyBounds.X, EnemyBounds.Bottom),
                new Vector2(EnemyBounds.Right, EnemyBounds.Bottom),
                new Vector2(EnemyBounds.Right, EnemyBounds.Y),
            };
            EnemyCollisionBox = new Polygon(EnemyPoints, Constants.Width, Constants.Height);

            MagicUser ActiveUser = new MagicUser();

            ActiveUser.ManaReserves = 1000;
            ActiveUser.CurrentMana  = 100;

            SharedParams.OwnerPosition           = UserPosition;
            GlobalProjectileContext.OwnerSandbox = this;

            MagicSpell NewSpell = new MagicSpell(ActiveMagicSpell, ActiveUser);

            ListMagicSpell = NewSpell.ComputeSpell();
        }
コード例 #4
0
 public MagicPreviewerPanel(ContentManager Content, MagicSpell ActiveMagicSpell, ActionPanelHolder ListActionMenuChoice, ProjectileContext GlobalProjectileContext, SharedProjectileParams SharedParams)
     : this(Content, ActiveMagicSpell, ListActionMenuChoice, GlobalProjectileContext, SharedParams,
            new Vector2(Constants.Width - 50, Constants.Height / 2),
            new Rectangle(50, Constants.Height / 2, 100, 100))
 {
 }