public override bool Use(Player player)
    {
        foreach (Ability effect in player.abilities)
        {
            effect.OnConsumeItem(player, this);
        }

        Vector2i     tilePos = MapManager.instance.GetMapTileAtPoint(player.Position);
        MinibossData data    = new MinibossData(tilePos.x, tilePos.y, minibossType);
        Miniboss     spawn   = MapManager.instance.AddMinibossEntity(data);

        spawn.SetHostility(Hostility.Friendly);

        return(true);
        //player.Inventory.RemoveItem(index);
    }
Exemplo n.º 2
0
    public Miniboss AddMinibossEntity(MinibossData data)
    {
        MinibossPrototype proto = MinibossDatabase.GetMinibossPrototype(data.type);
        Miniboss          temp  = null;

        switch (proto.minibossType)
        {
        case MinibossType.BogBeast:
            temp = new BogBeast(proto);
            temp.Spawn(GetMapTilePosition(data.TilePosition));
            break;

        case MinibossType.Salamander:
            temp = new Salamander(proto);
            temp.Spawn(GetMapTilePosition(data.TilePosition));
            break;

        case MinibossType.IceShard:
            temp = new IceShard(proto);
            temp.Spawn(GetMapTilePosition(data.TilePosition));
            break;

        case MinibossType.Shroombo:
            temp = new Shroombo(proto);
            temp.Spawn(GetMapTilePosition(data.TilePosition));
            break;

        case MinibossType.GiantCrab:
            temp = new GiantCrab(proto);
            temp.Spawn(GetMapTilePosition(data.TilePosition));
            break;

        case MinibossType.Voidbeast:
            temp = new Voidbeast(proto);
            temp.Spawn(GetMapTilePosition(data.TilePosition));
            break;
        }

        return(temp);
    }