/// <summary> /// Constructs a new player tank, which also initializes it's inner Object3 class. /// </summary> /// <param name="_tankModel">Model to load into the tank.</param> /// <param name="_attr"></param> /// <param name="_pos"></param> /// <param name="_alive"></param> /// <param name="_angle"></param> /// <param name="_id"></param> /// <param name="_team"></param> public PlayerTank(Model _tankModel, VTankObject.TankAttributes _attr, Vector3 _pos, bool _alive, float _angle, int _id, GameSession.Alliance _team) : base(_tankModel, _pos) { hoverValue = new HoverTranslation(); activeUtilities = new List <ActiveUtility>(); utilities = new List <Utility>(); assistList = new List <int>(); emitters = new List <ParticleEmitter>(); attributes = _attr; position = _pos; if (_attr.model == "Icarus") { this.Translate(new Vector3(0, 0, 20)); this.AddEmitters(); } alive = _alive; Angle = _angle; ID = _id; RenderID = -1; TurretRenderID = -1; HealthBarRenderID = -1; Team = _team; weapon = WeaponLoader.GetWeapon(attributes.weaponID); elapsed = weapon.Cooldown; LastDirectionMovement = VTankObject.Direction.NONE; PreviouslyCollidied = false; IsCharging = false; /*AlternateModelTexture = ServiceManager.Resources.Load<Texture2D>( * @"models\tanks\skins\camo-forest"); */ if (_attr.name != PlayerManager.LocalPlayerName) { HealthBar = new HealthBar(position, attributes.health); NameObject = new TextObject(); NameObject.SetText(attributes.name); } if (Team == GameSession.Alliance.BLUE) { meshColor = Color.Blue; } else if (Team == GameSession.Alliance.RED) { meshColor = Color.Red; } else { meshColor = Toolkit.GetColor(attributes.color); } SetUpSphereBoundaries(); ApplyTankSkin(); }
/// <summary> /// Constructs a new player tank, which also initializes it's inner Object3 class. /// </summary> /// <param name="_tankModel">Model to load into the tank.</param> /// <param name="_attr"></param> /// <param name="_pos"></param> /// <param name="_alive"></param> /// <param name="_angle"></param> /// <param name="_id"></param> /// <param name="_team"></param> public PlayerTank(Model _tankModel, VTankObject.TankAttributes _attr, Vector3 _pos, bool _alive, float _angle, int _id, GameSession.Alliance _team) : base(_tankModel, _pos) { hoverValue = new HoverTranslation(); activeUtilities = new List<ActiveUtility>(); utilities = new List<Utility>(); assistList = new List<int>(); emitters = new List<ParticleEmitter>(); attributes = _attr; position = _pos; if (_attr.model == "Icarus") { this.Translate(new Vector3(0, 0, 20)); this.AddEmitters(); } alive = _alive; Angle = _angle; ID = _id; RenderID = -1; TurretRenderID = -1; HealthBarRenderID = -1; Team = _team; weapon = WeaponLoader.GetWeapon(attributes.weaponID); elapsed = weapon.Cooldown; LastDirectionMovement = VTankObject.Direction.NONE; PreviouslyCollidied = false; IsCharging = false; /*AlternateModelTexture = ServiceManager.Resources.Load<Texture2D>( @"models\tanks\skins\camo-forest"); */ if (_attr.name != PlayerManager.LocalPlayerName) { HealthBar = new HealthBar(position, attributes.health); NameObject = new TextObject(); NameObject.SetText(attributes.name); } if (Team == GameSession.Alliance.BLUE) { meshColor = Color.Blue; } else if (Team == GameSession.Alliance.RED) { meshColor = Color.Red; } else { meshColor = Toolkit.GetColor(attributes.color); } SetUpSphereBoundaries(); ApplyTankSkin(); }