public WarpPipeEnemyModel(BlockSpriteFactory blockSpriteFactory, Vector2 coordinates, Vector2 velocity, EnemyModelFactory enemyModelFactory, string enemyType, int numOfEnemies, CollisionGrid collisionGrid) : base(blockSpriteFactory) { //Constructor for warppipe that hides enemies //Initialize Texture first Texture = BlockSpriteFactory.GetBlockSprite("pipetop"); CurrentState = new WarpPipeEntityStandardState(this); CurrentState.Enter(null); //Define the characteristics of a pipe block here Position = coordinates; CurrentFrame = 0; Columns = 1; Rows = 1; LayerDepth = 1; Scale = new Vector2(10, 10); Width = Texture.Width / Columns; Height = Texture.Height / Rows; Velocity = velocity; //Enemies EnemyModelFactory = enemyModelFactory; EnemyType = enemyType; CollisionGrid = collisionGrid; EnemyModel = enemyModelFactory.GetEnemyModel(enemyType, coordinates, Velocity); EnemyModel.IsVisible = false; NumOfEnemies = numOfEnemies; }
/* * public void defend(MainPlayer mp) // maybe place main player in here to weaken attack * { * mp.attck(); // not sure about this, need to think about it * } */ public void heal() { string Spear = "Spear Man"; EnemyModelFactory emf = EnemyModelFactory.getEnemyModelFactory(); EnemyModel em = new EnemyModel(); if (Spear == em.Type) { int hCheck = emf.getHealth("Spear"); if (enemyModel.Health == hCheck) { System.Console.WriteLine(em.Type + " can not heal anymore"); } else { enemyModel.Health += 10; // may heal more than their max atm } } // simple heal below - no check to see max health //enemyModel.Health += 10; }