Exemple #1
0
        public void InitWeapons()
        {
            ClearAbilities();
            if (MeleeWeaponModel != null && !MeleeWeaponModel.IsRemoved)
            {
                MeleeWeaponModel.Remove();
            }
            if (RangedWeaponModel != null && !RangedWeaponModel.IsRemoved)
            {
                RangedWeaponModel.Remove();
            }
            switch (MeleeWeapon)
            {
            case MeleeWeapons.Sword:
                AddAbility(new SwordThrust());
                MeleeWeaponModel = new Props.Sword1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                meleeWeapon = "sword";
                break;

            case MeleeWeapons.MayaHammer:
                AddAbility(new HammerThrust());
                MeleeWeaponModel = new Props.MayaHammer1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                meleeWeapon = "hammer";
                break;

            case MeleeWeapons.Spear:
                AddAbility(new SpearThrust());
                MeleeWeaponModel = new Props.Spear1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                meleeWeapon = "spear";
                break;
            }
            AddChild(MeleeWeaponModel);
            var slam = new Slam();

            slam.Start += new System.Action(slam_Start);
            slam.End   += new System.Action(slam_End);
            AddAbility(slam);
            switch (RangedWeapon)
            {
            case RangedWeapons.Rifle:
                AddAbility(new Blast());
                RangedWeaponModel = new Props.Rifle1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.HandCannon:
                AddAbility(new CannonballShot());
                RangedWeaponModel = new Props.HandCannon1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.Fire:
                AddAbility(new BurningBlast());
                RangedWeaponModel = new Props.Rifle1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.GatlingGun:
                AddAbility(new GatlingGun());
                RangedWeaponModel = new Props.GatlingGun1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.Blaster:
                AddAbility(new Blaster());
                RangedWeaponModel = new Props.HandMortar1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;
            }
            AddChild(RangedWeaponModel);
            //AddAbility(new Revolver());
            AddAbility(new GhostBullet());
        }
Exemple #2
0
        //Effects.RageFire rageHaloEffect;
        //Effects.RagePulse1 rageEffectLeftHand;

        private void ChangeMeleeModel()
        {
            if (MeleeWeaponModel != null && !MeleeWeaponModel.IsRemoved)
            {
                MeleeWeaponModel.Remove();
            }

            if (RageLevel >= 4)
            {
                if (meleeWeapon == "spear")
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.Spear3()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                }
                ;
                else if (meleeWeapon == "sword")
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.Sword3()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                }
                ;
                else
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.MayaHammer3()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                };
            }
            else if (RageLevel >= 2)
            {
                if (meleeWeapon == "spear")
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.Spear2()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                }
                ;
                else if (meleeWeapon == "sword")
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.Sword2()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                }
                ;
                else
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.MayaHammer2()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                };
            }
            else
            {
                if (meleeWeapon == "spear")
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.Spear1()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                }
                ;
                else if (meleeWeapon == "sword")
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.Sword1()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                }
                ;
                else
                {
                    MeleeWeaponModel = new Client.Game.Map.Props.MayaHammer1()
                    {
                        OrientationRelation = OrientationRelation.Absolute
                    }
                };
            }
            AddChild(MeleeWeaponModel);
        }