Beispiel #1
0
        public override void Load()
        {
            gunner1 = new Gunner
            {
                PadIndex = PlayerIndex.One,
                Color = Color.Red,
                Location = new Vector2(200, 0),
                Speed = 0.5f
            };

            gunner2 = new Gunner
            {
                PadIndex = PlayerIndex.Two,
                Color = Color.Blue,
                Location = new Vector2(400, 0),
                Speed = 0.5f
            };

            powerGenerator1 = new PowerGenerator();
            powerGenerator2 = new PowerGenerator();

            players.Add (gunner1);
            players.Add (gunner2);

            Size screenSize = new Size (Moxy.ScreenWidth, Moxy.ScreenHeight);
            camera = new DynamicCamera ();
            //camera.Targets.AddRange (new Player[] {gunner1, gunner2});
        }
Beispiel #2
0
 public PowerSKill(PowerGenerator Gen)
     : base(Gen)
 {
     MatchArray[0] = ItemID.WindRune;
     MatchArray[1] = ItemID.EarthRune;
     MatchArray[2] = ItemID.FireRune;
     MatchArray[3] = ItemID.WaterRune;
 }
Beispiel #3
0
        public override bool OnSkillUsed(PowerGenerator Gen)
        {
            var newSkill = new PowerEffect(Gen);
            foreach(var skill in Gen.ActiveSkills)
            {
                if (skill.SkillID == newSkill.SkillID)
                {
                    skill.Duration = newSkill.Duration;
                }
                return false;
            }

            Gen.ActiveSkills.Add(newSkill);

            return true;
        }
Beispiel #4
0
        public static Texture2D GetRuneInSlot(PowerGenerator Generator, int slot)
        {
            switch (Generator.CurrentSkill.MatchArray[slot])
            {
                case ItemID.WaterRune:
                    return WaterRune;
                case ItemID.FireRune:
                    return FireRune;
                case ItemID.WindRune:
                    return AirRune;
                case ItemID.EarthRune:
                    return EarthRune;
            }

            return null;
        }
Beispiel #5
0
 public ProtectionEffect(PowerGenerator Gen)
 {
     this.Gen = Gen;
     Duration = new TimeSpan(0, 0, 20);
     SkillID = 2;
 }
Beispiel #6
0
 public RageEffect(PowerGenerator Gen)
 {
     this.Gen = Gen;
     Duration = new TimeSpan(0, 0, 20);
     SkillID = 3;
 }
Beispiel #7
0
 public ProtectionSkill(PowerGenerator Gen)
     : base(Gen)
 {
     MatchArray[0] = ItemID.WaterRune;
     MatchArray[1] = ItemID.EarthRune;
     MatchArray[2] = ItemID.EarthRune;
     MatchArray[3] = ItemID.FireRune;
 }
Beispiel #8
0
 public abstract bool OnSkillUsed(PowerGenerator Gen);
Beispiel #9
0
 public GeneratorSkill(PowerGenerator Gen)
 {
     MatchArray = new ItemID[4];
     this.Gen = Gen;
 }
Beispiel #10
0
 public TriShotSkill(PowerGenerator Gen)
     : base(Gen)
 {
     MatchArray[0] = ItemID.FireRune;
     MatchArray[1] = ItemID.FireRune;
     MatchArray[2] = ItemID.FireRune;
     MatchArray[3] = ItemID.FireRune;
 }
Beispiel #11
0
        private void LoadPlayers()
        {
            float gunnerSpeed = 0.2f;//0.1f;
            float enchanterSpeed = 0.3f;
            PlayerIndex invalidPlayerIndex = (PlayerIndex)5;

            if (characterSelectState.Gunner1 != invalidPlayerIndex
                || characterSelectState.PowerGenerator1 != invalidPlayerIndex)
            {
                gunner1 = new Gunner
                {
                    PadIndex = characterSelectState.Gunner1,
                    Color = Color.White,
                    Location = new Vector2 (700, 700),
                    Speed = gunnerSpeed,
                    Light = new Light (Color.White, lightTexture) { Scale = 1.5f },
                    Team = Team.Red,
                    FireballEmitter = FireballEmitter,
                    AIControlled = characterSelectState.Gunner1 == invalidPlayerIndex,
                };

                // Gunner 1 is controlled by AI
                if (gunner1.PadIndex == invalidPlayerIndex)
                {
                    gunner1.PadIndex = GenerateAIIndex();
                    gunner1.AIControlled = true;
                }

                powerGenerator1 = new PowerGenerator
                {
                    PadIndex = characterSelectState.PowerGenerator1,
                    Color = Color.White,
                    Location = new Vector2 (780, 700),
                    Speed = enchanterSpeed,
                    Light = new Light (Color.White, lightTexture) { Scale = 1.5f },
                    Team = Team.Red,
                    Gunner = gunner1,
                    AIControlled = characterSelectState.PowerGenerator1 == invalidPlayerIndex,
                };

                // Power gen 1 is controlled by AI
                if (powerGenerator1.PadIndex == invalidPlayerIndex)
                {
                    powerGenerator1.PadIndex = GenerateAIIndex ();
                    powerGenerator1.AIControlled = true;
                }

                gunner1.OnMovement += (Player_OnMovement);
                powerGenerator1.OnMovement += (Player_OnMovement);
                gunner1.OnDeath += (Player_OnDeath);

                gunner1.Generator = powerGenerator1;

                redPacketEmitter.Target = gunner1;
                redPacketEmitter.Source = powerGenerator1;

                lights.Add (gunner1.Light);
                lights.Add (powerGenerator1.Light);

                players.Add (gunner1);
                players.Add (powerGenerator1);

                camera.ViewTargets.Add (gunner1);
                camera.ViewTargets.Add (powerGenerator1);
            }

            if (characterSelectState.Gunner2 != invalidPlayerIndex
                || characterSelectState.PowerGenerator2 != invalidPlayerIndex)
            {
                gunner2 = new Gunner
                {
                    PadIndex = characterSelectState.Gunner2,
                    Color = Color.White,
                    Location = new Vector2 (200, 0),
                    Speed = gunnerSpeed,
                    Light = new Light (Color.White, lightTexture),
                    Team = Team.Red,
                    FireballEmitter = FireballEmitter
                };

                powerGenerator2 = new PowerGenerator
                {
                    PadIndex = characterSelectState.PowerGenerator2,
                    Color = Color.White,
                    Location = new Vector2 (400, 0),
                    Speed = enchanterSpeed,
                    Light = new Light (Color.White, lightTexture),
                    Team = Team.Red,
                    Gunner = gunner2,
                };

                gunner2.Generator = powerGenerator2;

                redPacketEmitter.Target = gunner2;
                redPacketEmitter.Source = powerGenerator2;

                lights.Add (gunner2.Light);
                lights.Add (powerGenerator2.Light);

                players.Add (gunner2);
                players.Add (powerGenerator2);

                camera.ViewTargets.Add (gunner2);
                camera.ViewTargets.Add (powerGenerator2);
            }

            uiOverlay.ActivePlayers = players;
        }