public IHeroController GetHeroController(HeroSide side) { if (side == HeroSide.Bottom) { return(BottomHeroController); } return(TopHeroController); }
public static IProjectile CreateProjectile(Projectiles projectile, HeroSide side, Vector2 position) { var prefab = Game.Resources.LoadPrefab <Projectile>(projectilePaths[projectile]); prefab.Initialize(side, position); return(prefab); }
public IPlayer GetPlayer(HeroSide side) { if (side == HeroSide.Top) { return(TopPlayer); } return(BottomPlayer); }
public static HeroSide GetOppositeSide(HeroSide side) { if (side == HeroSide.Top) { return(HeroSide.Bottom); } return(HeroSide.Top); }
public IHero GetHero(HeroSide side) { if (side == HeroSide.Bottom) { return(BottomHero); } return(TopHero); }
public IPlayer GetEnemyPlayer(HeroSide side) { if (side == HeroSide.Bottom) { return(TopPlayer); } return(BottomPlayer); }
public IGoal GetGoal(HeroSide side) { if (side == HeroSide.Bottom) { return(BottomGoal); } return(TopGoal); }
public IGoal GetOpponentGoal(HeroSide side) { if (side == HeroSide.Top) { return(BottomGoal); } return(TopGoal); }
public Vector2 GetHeroSpawn(HeroSide side) { if (side == HeroSide.Bottom) { return(BottomHeroSpawn); } return(TopHeroSpawn); }
public IHero GetEnemyHero(HeroSide side) { if (side == HeroSide.Top) { return(BottomHero); } return(TopHero); }
public static IHero CreateHero(GameObject entityRoot, Heroes hero, HeroSide side, Vector2 position) { var prefab = Game.Resources.LoadPrefab <Hero>(heroesPaths[hero]); entityRoot.AddChildEntity(prefab); prefab.Initialize(side, position); return(prefab); }
public void AttachHero(HeroSide side, IHero hero) { if (side == HeroSide.Bottom) { friendlyHero = hero; } else { enemyHero = hero; } }
public void Initialize(HeroSide side, Vector2 position) { this.side = side; this.transform.position = position; if (mover != null) { mover.Initialize(this, side); } OnCreate(); }
protected override void OnConstruct() { defaultSprite = this.AddChild(Game.Objects.CreatePrefab <SpriteWrapper>(defaultOrbSprite)); ClearOrbBehavior(); direction = startDirection; speed = startSpeed; collider = this.GetComponentStrict <CircleCollider2D>(); respawnTimer = new Timer(1); state = OrbState.Spawning; scoredSide = HeroSide.Bottom; sprites = new Dictionary <HeroSide, ISpriteWrapper>(); }
public override void Initialize(IProjectile projectile, HeroSide side) { var pos = (Vector2)transform.position; if (side == HeroSide.Top) { goal = new Vector2(pos.x, Game.Levels.CurrentLevel.BottomGoal.Position.y); } else { goal = new Vector2(pos.x, Game.Levels.CurrentLevel.TopGoal.Position.y); } this.projectile = projectile; this.side = side; }
public IHero CreateHero(Heroes hero, HeroSide side) { var result = HeroFactory.CreateHero(entityRoot, hero, side, Game.Levels.CurrentLevel.GetHeroSpawn(side)); if (side == HeroSide.Top) { Game.Hud.CurrentHud.ScoreBar.AttachHero(HeroSide.Top, result); TopHero = result; } else { Game.Hud.CurrentHud.ScoreBar.AttachHero(HeroSide.Bottom, result); BottomHero = result; } Game.Hud.CurrentHud.GetHeroController(side).AttachHero(result); return(result); }
private void OnTriggerEnter2D(Collider2D collision) { IGoal goal = collision.gameObject.GetComponent <Goal>(); if (goal != null) { if (currentBehavior != null) { currentBehavior.OnScore(); } Game.Entities.GetEnemyPlayer(goal.Side).Score += 1; this.scoredSide = goal.Side; Game.FloatingText.CreateFloatingText("+1", TextStyles.Points, Game.Entities.GetEnemyHero(goal.Side).Position); Respawn(); } IMinion minion = collision.gameObject.GetComponent <Minion>(); if (minion != null) { if (currentBehavior != null) { if (minion.Owner.Side == currentBehavior.Owner.Side) { currentBehavior.OnHitAllyMinion(minion); } else { currentBehavior.HitEnemyMinion(minion); } } } IBumper bumper = collision.AsBumper(); if (bumper != null) { timeOfLastBumperHit = Time.timeSinceLevelLoad; Vector2 collisionPoint = collision.bounds.ClosestPoint(this.Position); bumper.OnBump(this, collisionPoint); } }
public void Initialize(HeroSide side, Heroes selectedHero) { this.SelectedHero = selectedHero; this.Side = side; }
public abstract void Initialize(IProjectile projectile, HeroSide side);
public void Initialize(HeroSide side, Vector2 position) { this.transform.position = position; this.Side = side; }
public override void EnemyTurn() { Random random = new Random(); Creature vamp = EnemySide[0].creature; if (vamp != null) { Ability chosenAbility = null; if (Rounds % 10 == 0) { chosenAbility = vamp.Abilities[1]; } else { chosenAbility = vamp.Abilities[0]; } int index = -1; Space[] side = new Space[3]; if (chosenAbility.TargetType == "Hero") { HeroSide.CopyTo(side, 0); } else if (chosenAbility.TargetType == "Enemy") { EnemySide.CopyTo(side, 0); } while (index < 0) { index = random.Next(side.Length); { if (side[index].creature != null) { if (side[index].creature.CurrHP > 0) { chosenAbility.setTargets(side, index); } else { index = -1; } } else { index = -1; } } } int open = random.Next(3); if (open == 0) { vamp.TopMod = 1; vamp.FrontMod = 0; vamp.BottomMod = 0; Console.WriteLine("\nVampire Chicken pokes its head out of the top of the eggshell."); Console.ReadLine(); } else if (open == 1) { vamp.TopMod = 0; vamp.FrontMod = 1; vamp.BottomMod = 0; Console.WriteLine("\nVampire Chicken pokes its head out of a hole in the front of the shell."); Console.ReadLine(); } else if (open == 2) { vamp.TopMod = 0; vamp.FrontMod = 0; vamp.BottomMod = 1; Console.WriteLine("\nVampire Chicken hangs upside down like a bat. His head touches the floor."); Console.ReadLine(); } chosenAbility.execute(vamp); chosenAbility.Targets.Clear(); } }