public void Execute(List <Entity> entities) { GetExitsForCurrentPuzzle().ForEach(x => { x.IsBlockingTile(false); x.ReplaceExitGate(false); }); _pool.GetHero().isCursed = false; }
public static void SwitchCurse(this Pool pool) { var hero = pool.GetHero(); var activeBoss = pool.GetActiveBoss(); if (activeBoss != null) { hero.isCursed = !hero.isCursed; activeBoss.isCursed = !activeBoss.isCursed; } }
public void MoveBoss(Entity boss) { var hero = _pool.GetHero(); var heroPosition = hero.position.Value; var pathToHero = _movementCalculator.CalculateMoveToTarget( boss.position.Value, LocalDirections.ToDirection(boss.rotation.Value), heroPosition); if (!pathToHero.HasStepsLeft) { return; } var nextStep = pathToHero.NextStep(); if (nextStep.Position != heroPosition) { if (Debug.isDebugBuild) { DrawBossPath(pathToHero); } boss.ReplacePosition(nextStep.Position); var knockedObjectInFront = _pool.KnockObjectsInFront(nextStep.Position, nextStep.Direction, false, 0.4f); if (knockedObjectInFront) { boss.HasBumpedIntoObject(true); } else if (_pool.GetTileAt(nextStep.Position + nextStep.Direction) == null) { boss.HasRecoveredAtEdge(true); } } else { boss.IsAttacking(true); hero.ReplaceHealth(hero.health.Value - 1); _pool.SwitchCurse(); } boss.ReplaceRotation(LocalDirections.ToRotation(nextStep.Direction)); }
public static Entity GetCurrentPuzzleArea(this Pool pool) { var hero = pool.GetHero(); return(pool.GetEntityAt(hero.position.Value, x => x.isPuzzleArea)); }