public Ship(SceneManager pSceneManager, Controller pController) : base(pController) { var name = Methods.GenerateUniqueID.ToString(); Node = pSceneManager.RootSceneNode.CreateChildSceneNode(name); MeshNode = Node.CreateChildSceneNode(); MeshNode.Orientation = new Quaternion(0.5, 0.5, -0.5, -0.5); MeshNode.AttachObject(pSceneManager.CreateEntity(name, "ship_assault_1.mesh")); UpgradeGroup = new UpgradeGroup { CannonAutoFire = { Level = 10 }, CannonMultiFire = { Level = 10 }, CannonSpeed = { Level = 7 }, CannonPower = { Level = 5 } }; cannon = new Cannon(this); UpgradeGroup.UpgradeCannon(ref cannon, UpgradeGroup); }
public static void UpgradeCannon(ref Cannon pCannon, UpgradeGroup pLevels) { switch (pLevels.CannonPower.Level) { case 0: pCannon.Damage = 3; break; case 1: pCannon.Damage = 4; break; case 2: pCannon.Damage = 6; break; case 3: pCannon.Damage = 8; break; case 4: pCannon.Damage = 11; break; case 5: pCannon.Damage = 14; break; case 6: pCannon.Damage = 14; break; case 7: pCannon.Damage = 14; break; case 8: pCannon.Damage = 14; break; case 9: pCannon.Damage = 14; break; case 10: pCannon.Damage = 14; break; } switch (pLevels.CannonSpeed.Level) { case 0: pCannon.Speed = 4; break; case 1: pCannon.Speed = 4.5; break; case 2: pCannon.Speed = 5; break; case 3: pCannon.Speed = 5.5; break; case 4: pCannon.Speed = 6; break; case 5: pCannon.Speed = 7; break; case 6: pCannon.Speed = 8; break; case 7: pCannon.Speed = 9; break; case 8: pCannon.Speed = 10; break; case 9: pCannon.Speed = 11; break; case 10: pCannon.Speed = 12; break; } switch (pLevels.CannonAutoFire.Level) { case 0: pCannon.Delay = 18; break; case 1: pCannon.Delay = 16; break; case 2: pCannon.Delay = 14; break; case 3: pCannon.Delay = 12; break; case 4: pCannon.Delay = 10; break; case 5: pCannon.Delay = 8; break; case 6: pCannon.Delay = 7; break; case 7: pCannon.Delay = 6; break; case 8: pCannon.Delay = 5; break; case 9: pCannon.Delay = 4; break; case 10: pCannon.Delay = 3; break; } switch (pLevels.CannonHoming.Level) { case 0: pCannon.HomingAngle = 4; break; case 1: pCannon.HomingAngle = 8; break; case 2: pCannon.HomingAngle = 12; break; case 3: pCannon.HomingAngle = 16; break; case 4: pCannon.HomingAngle = 20; break; case 5: pCannon.HomingAngle = 24; break; case 6: pCannon.HomingAngle = 24; break; case 7: pCannon.HomingAngle = 24; break; case 8: pCannon.HomingAngle = 24; break; case 9: pCannon.HomingAngle = 24; break; case 10: pCannon.HomingAngle = 24; break; } switch (pLevels.CannonMultiFire.Level) { case 0: pCannon.MultiGuns = 2; break; case 1: pCannon.MultiGuns = 3; break; case 2: pCannon.MultiGuns = 4; break; case 3: pCannon.MultiGuns = 5; break; case 4: pCannon.MultiGuns = 6; break; case 5: pCannon.MultiGuns = 7; break; case 6: pCannon.MultiGuns = 8; break; case 7: pCannon.MultiGuns = 9; break; case 8: pCannon.MultiGuns = 10; break; case 9: pCannon.MultiGuns = 11; break; case 10: pCannon.MultiGuns = 12; break; } }