public Crawler(EnemyPrototype proto) : base(proto) { mEnemyState = EnemyState.Moving; direction = Direction.Left; abilityFlags.SetFlag(AbilityFlag.SpikeProtection, true); }
public WurmAlien(EnemyPrototype proto) : base(proto) { Body.mSpeed.x = GetMovementSpeed(); Body.mIsKinematic = false; //abilityFlags.SetFlag(AbilityFlag.Heavy, true); //Body.mAABB.Scale = new Vector3(.5f, .5f, .5f); }
public Hedgehog(EnemyPrototype proto) : base(proto) { Body.mSpeed.x = GetMovementSpeed(); Body.mIsKinematic = false; //Body.mAABB.Scale = new Vector3(.5f, .5f, .5f); //StartCoroutine(EnemyBehaviour.Wait(this, 2, EnemyState.Moving)); }
public Nipper(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = false; Body.mIgnoresGravity = true; Body.mIgnoresOneWay = true; baseMovementSpeed = proto.movementSpeed; baseJumpHeight = proto.jumpHeight; mEnemyState = EnemyState.Moving; }
public Roller(EnemyPrototype proto) : base(proto) { //Body.mAABB.ScaleX *= -1; Body.mAABB.baseOffset = Vector3.zero; Body.mAABB.Offset = Vector3.zero; Body.mIsKinematic = true; Body.mIgnoresGravity = true; mEnemyState = EnemyState.Moving; Body.mSpeed.x = mMovingSpeed; }
public Enemy(EnemyPrototype proto) : base(proto) { prototype = proto; ExpValue = proto.expValue; mEnemyType = prototype.enemyType; mMovingSpeed = proto.movementSpeed; jumpHeight = proto.jumpHeight; mCollidesWith.Add(EntityType.Player); mCollidesWith.Add(EntityType.Obstacle); mCollidesWith.Add(EntityType.Platform); Body.mIgnoresGravity = proto.ignoreGravity; HurtBox = new Hurtbox(this, new CustomAABB(Position, prototype.bodySize, new Vector2(0, prototype.bodySize.y))); HurtBox.UpdatePosition(); sight = new Sightbox(this, new CustomAABB(Position, new Vector2(prototype.sightRange, prototype.sightRange), new Vector2(0, prototype.bodySize.y))); sight.UpdatePosition(); ScaleStatsToLevel(); mHealth = new Health(this, prototype.health); mAttackManager = new AttackManager(this); //Debug.Log("Melee Attacks: " + prototype.meleeAttacks.Count); foreach (MeleeAttackPrototype meleeAttack in prototype.meleeAttacks) { MeleeAttack melee = new MeleeAttack(this, meleeAttack); mAttackManager.meleeAttacks.Add(melee); //Debug.Log("Adding Slime melee attack"); } foreach (RangedAttackPrototype rangedAttack in prototype.rangedAttacks) { mAttackManager.rangedAttacks.Add(new RangedAttack(this, rangedAttack)); } }
public override void EntityUpdate() { EnemyBehaviour.CheckForTargets(this); if (Target != null) { spawnTimer += Time.deltaTime; if (spawns.Count < maxSpawns && spawnTimer >= spawnCooldown) { EnemyPrototype proto = EnemyDatabase.GetEnemyPrototype(spawnType); Slime temp = new Slime(proto); temp.Spawn(Position + spawnOffset); //EnemyBehaviour.Jump(temp, 120); spawnTimer = 0; temp.nestParent = this; spawns.Add(temp); } } base.EntityUpdate(); }
public void AddPrototype(string key, EnemyPrototype prototype) { _prototypes[key] = prototype; }
public Eye(EnemyPrototype proto) : base(proto) { Body.mIgnoresOneWay = true; }
public BogBeast(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = true; }
public PhoenixEgg(EnemyPrototype proto) : base(proto) { hatchTimer = 0; }
public FrogLegs(EnemyPrototype proto) : base(proto) { }
public Shroombo(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = true; }
public Snek(EnemyPrototype proto) : base(proto) { }
public Miniboss(EnemyPrototype proto) : base(proto) { ExpValue = 50; }
public Snowdrift(EnemyPrototype proto) : base(proto) { }
public Snowball(EnemyPrototype proto) : base(proto) { }
public VoidBossHand(EnemyPrototype proto, Enemy parent) : base(proto, parent) { Body.mState = ColliderState.Closed; }
public GiantCrab(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = true; }
public Enemy AddEnemyEntity(EnemyData data) { EnemyPrototype proto = EnemyDatabase.GetEnemyPrototype(data.type); if (proto == null) { return(null); } Enemy temp = null; switch (proto.enemyType) { case EnemyType.Slime: temp = new Slime(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Eye: temp = new Eye(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.WurmAlien: temp = new WurmAlien(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Snek: temp = new Snek(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Stag: temp = new Stag(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Snowball: temp = new Snowball(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Sporby: temp = new Sporby(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Voidling: temp = new Voidling(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Ghost: temp = new Ghost(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Snowdrift: temp = new Snowdrift(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Treedude: temp = new Treedude(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.FrogLegs: temp = new FrogLegs(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Hedgehog: temp = new Hedgehog(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Nest: temp = new Nest(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Crawler: temp = new Crawler(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.Nipper: temp = new Nipper(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; case EnemyType.PhoenixEgg: temp = new PhoenixEgg(proto); temp.Spawn(GetMapTilePosition(data.TilePosition)); break; } return(temp); }
public Ghost(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = false; Body.mIgnoresGravity = true; Body.mIgnoresOneWay = true; }
public Treedude(EnemyPrototype proto) : base(proto) { Body.mSpeed.x = GetMovementSpeed(); Body.mIsKinematic = false; }
public Slime(EnemyPrototype proto) : base(proto) { //Body.mAABB.ScaleX *= -1; Body.mIsKinematic = false; }
public Salamander(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = true; }
public EnemyPart(EnemyPrototype proto, Enemy parent) : base(proto) { mEnemyType = EnemyType.SubEnemy; parentEntity = parent; }
public Voidling(EnemyPrototype proto) : base(proto) { Body.mIgnoresOneWay = true; }
public Stag(EnemyPrototype proto) : base(proto) { }
public Sporby(EnemyPrototype proto) : base(proto) { }
public IceShard(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = true; }
public Nest(EnemyPrototype proto) : base(proto) { Body.mIsKinematic = true; spawns = new List <Enemy>(); }