public override void Intersect(InteractiveModel interactive) { if (this == interactive || hasBeenVisited == true) { return; } if (interactive.GetType().IsSubclassOf(typeof(Ant))) { if (this.model.BoundingSphere.Intersects(interactive.Model.BoundingSphere)) hasBeenVisited = true; } }
public override void Intersect(InteractiveModel interactive) { if (interactive == this) { return; } if (model.BoundingSphere.Intersects(interactive.Model.BoundingSphere)) { //Console.WriteLine("Wlazło w pułapke"); } }
public InteractiveObject(short _gfx, Cell _cell) { Gfx = _gfx; Cell = _cell; InteractiveModel _model = InteractiveModel.GetGfxModel(Gfx); if (_model != null) { Model = _model; IsUsable = true; } }
public Beetle(LoadModel model) : base(model) { sfereModel = new InteractiveModel(new LoadModel(StaticHelpers.StaticHelper.Content.Load<Model>("Models/sferazuka"), model.Position, Vector3.Zero, new Vector3(4.5f), StaticHelpers.StaticHelper.Device, model.light)); Scope = 300; ArmorBuffValue = 100; LifeBar.LifeLength = model.Scale.X * 100; circle.Scale = this.model.Scale.Y * 120; LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar")); circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa")); this.Hp = 200; this.modelHeight = 30; this.MaxHp = this.Hp; this.strength = 10; model.switchAnimation("Idle"); }
public override void Intersect(InteractiveModel interactive) { base.Intersect(interactive); }
public override void Intersect(InteractiveModel interactive) { if (this == interactive) { return; } foreach (BoundingSphere b in model.Spheres) { foreach (BoundingSphere b2 in interactive.Model.Spheres) { if (b.Intersects(b2)) { if (gaterMaterialObject == interactive) { if (interactive.GetType().BaseType == typeof(Material)) { if (gaterTime < elapsedTime) { gaterMaterial((Material)interactive); } } } else if (interactive.GetType() == typeof(AntGranary)) { Console.WriteLine("Oddaje"); //AntHill.Player.addMaterial(releaseMaterial()); this.materials.Clear(); Console.WriteLine(Capacity); } } } } }
public override void Intersect(InteractiveModel interactive) { }
public override void Intersect(InteractiveModel interactive) { base.Intersect(interactive); if (this == interactive) { return; } if (interactive.GetType().IsSubclassOf(typeof(Material))) { if (model.BoundingSphere.Intersects(interactive.Model.BoundingSphere)) { if (gaterMaterialObject == interactive) { if (gaterTime < elapsedTime) { ImGatering = true; gaterMaterial((Material)gaterMaterialObject); // SoundController.SoundController.Play(SoundController.SoundEnum.Gater); Logic.Player.Player.addMaterial(releaseMaterial()); materials.Clear(); } } } } }
public override void Intersect(InteractiveModel interactive) { if (this == interactive) { return; } if (this.model.BoundingSphere.Intersects(interactive.Model.BoundingSphere)) { Hit(interactive); } }
public void Hit(InteractiveModel b) { if (b.GetType()==typeof(EnviroModel.Cone) || b.GetType()==typeof(EnviroModel.Cone1)) { if (b.Hp > 0) { b.Hp -= 1; Console.WriteLine("Niszcze szyszke!"); ((EnviroModel.EnviroModels)b).LifeBar.LifeLength -= 1; b.hasBeenHit = true; b.Model.Hit = true; b.Model.Rotation -= new Vector3(0, 0.1f, 0); b.Model.Position -= new Vector3(0, 0, 1f); } } }
public void Hit(InteractiveModel b) { if(b.GetType().IsSubclassOf(typeof(Unit)) ) { b.Hp -= 10; ((Unit)b).LifeBar.LifeLength -= ((Unit)b).LifeBar.LifeLength * ((10)/b.MaxHp ); b.hasBeenHit = true; b.Model.Hit = true; // SoundController.SoundController.Play(SoundController.SoundEnum.RangeHit); } }
public override void Intersect(InteractiveModel interactive) { if (this == interactive) { return; } foreach (SpitMissle sm in bullets) { sm.Intersect(interactive); } if (model.BoundingSphere.Intersects(interactive.Model.BoundingSphere)) { } }