Example #1
0
 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));
    }
Example #4
0
 public Nipper(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic    = false;
     Body.mIgnoresGravity = true;
     Body.mIgnoresOneWay  = true;
     baseMovementSpeed    = proto.movementSpeed;
     baseJumpHeight       = proto.jumpHeight;
     mEnemyState          = EnemyState.Moving;
 }
Example #5
0
    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;
    }
Example #6
0
    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));
        }
    }
Example #7
0
    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();
    }
Example #8
0
 public void AddPrototype(string key, EnemyPrototype prototype)
 {
     _prototypes[key] = prototype;
 }
Example #9
0
 public Eye(EnemyPrototype proto) : base(proto)
 {
     Body.mIgnoresOneWay = true;
 }
Example #10
0
 public BogBeast(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic = true;
 }
Example #11
0
 public PhoenixEgg(EnemyPrototype proto) : base(proto)
 {
     hatchTimer = 0;
 }
Example #12
0
 public FrogLegs(EnemyPrototype proto) : base(proto)
 {
 }
Example #13
0
 public Shroombo(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic = true;
 }
Example #14
0
 public Snek(EnemyPrototype proto) : base(proto)
 {
 }
Example #15
0
 public Miniboss(EnemyPrototype proto) : base(proto)
 {
     ExpValue = 50;
 }
 public Snowdrift(EnemyPrototype proto) : base(proto)
 {
 }
Example #17
0
 public Snowball(EnemyPrototype proto) : base(proto)
 {
 }
 public VoidBossHand(EnemyPrototype proto, Enemy parent) : base(proto, parent)
 {
     Body.mState = ColliderState.Closed;
 }
Example #19
0
 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);
    }
Example #21
0
 public Ghost(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic    = false;
     Body.mIgnoresGravity = true;
     Body.mIgnoresOneWay  = true;
 }
Example #22
0
 public Treedude(EnemyPrototype proto) : base(proto)
 {
     Body.mSpeed.x     = GetMovementSpeed();
     Body.mIsKinematic = false;
 }
Example #23
0
    public Slime(EnemyPrototype proto) : base(proto)
    {
        //Body.mAABB.ScaleX *= -1;

        Body.mIsKinematic = false;
    }
 public Salamander(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic = true;
 }
Example #25
0
 public EnemyPart(EnemyPrototype proto, Enemy parent) : base(proto)
 {
     mEnemyType   = EnemyType.SubEnemy;
     parentEntity = parent;
 }
Example #26
0
 public Voidling(EnemyPrototype proto) : base(proto)
 {
     Body.mIgnoresOneWay = true;
 }
Example #27
0
 public Stag(EnemyPrototype proto) : base(proto)
 {
 }
Example #28
0
 public Sporby(EnemyPrototype proto) : base(proto)
 {
 }
Example #29
0
 public IceShard(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic = true;
 }
Example #30
0
 public Nest(EnemyPrototype proto) : base(proto)
 {
     Body.mIsKinematic = true;
     spawns            = new List <Enemy>();
 }