diff --git a/src/defines.h b/src/defines.h index 3a2d954..b3dd6ff 100644 --- a/src/defines.h +++ b/src/defines.h @@ -70,6 +70,7 @@ #define C_YELLOW (SDL_Color) { 255, 255, 0, 255 } #define C_BLACK (SDL_Color) { 0, 0, 0, 255 } #define C_PURPLE (SDL_Color) { 137, 16, 229, 255 } +#define C_GREY (SDL_Color) { 89, 89, 89, 255 } // MSVC seems to have min/max defined. // Haven't looked into it further. diff --git a/src/map.c b/src/map.c index 258ebc1..ae5e9ca 100644 --- a/src/map.c +++ b/src/map.c @@ -418,6 +418,9 @@ void map_room_destroy(Room *room) void map_trigger_tile_fall(MapTile *tile) { + if (tile->sprite->state != SPRITE_STATE_FALLING && tile->sprite->state != SPRITE_STATE_PLUMMETED) + particle_engine_dust_puff(tile->sprite->pos, tile->sprite->dim); + tile->sprite->state = SPRITE_STATE_FALLING; tile->lethal = true; } diff --git a/src/map_lua.c b/src/map_lua.c index 6cd6fae..47f67b2 100644 --- a/src/map_lua.c +++ b/src/map_lua.c @@ -525,7 +525,7 @@ l_create_shop_artifact(lua_State *L) Artifact *a = artifact_create_random(player, 2); a->sprite->pos = POS(x, y); - artifact_add_price(a, map->level * 50); + artifact_add_price(a, 100); linkedlist_append(&map->artifacts, a); diff --git a/src/monster.c b/src/monster.c index c14c62f..ffc1f93 100644 --- a/src/monster.c +++ b/src/monster.c @@ -691,7 +691,7 @@ monster_drop_loot(Monster *monster, Map *map, Player *player) } if (strcmp(monster->label, "The Trader") == 0) { - Item *treasure = item_builder_build_treasure(PLATINUM, 25 * monster->stats.lvl); + Item *treasure = item_builder_build_treasure(PLATINUM, 10 * monster->stats.lvl); treasure->sprite->pos = monsterTilePos; linkedlist_append(&map->items, treasure); } diff --git a/src/particle_engine.c b/src/particle_engine.c index 40d1d66..8bf6dde 100644 --- a/src/particle_engine.c +++ b/src/particle_engine.c @@ -188,6 +188,38 @@ particle_engine_eldritch_explosion(Position pos, Dimension dim) create_explosion(pos, dim, 1, C_GREEN); } +void +particle_engine_dust_puff(Position pos, Dimension dim) +{ + check_engine(); + for (unsigned int i = 0; i < 50; ++i) { + int x, y, xv, yv, w, h; + unsigned int lt; + Particle *p; + + x = get_random(dim.width) + pos.x; + y = get_random(dim.height) + pos.y; + + xv = get_random(200) - 100; + yv = get_random(200) - 100; + + lt = get_random(10) + 10; + + w = get_random(3); + h = get_random(3); + + p = create_rect_particle(); + p->particle.rect.pos = (Position) { x, y }; + p->particle.rect.dim = (Dimension) { w, h }; + p->velocity = (Vector2d) { (float) xv, (float) yv }; + p->movetime = lt; + p->lifetime = lt; + p->color = C_GREY; + p->blend_mode = SDL_BLENDMODE_BLEND; + linkedlist_append(&engine->game_particles, p); + } +} + void particle_engine_speed_lines(Position pos, Dimension dim, bool horizontal) { diff --git a/src/particle_engine.h b/src/particle_engine.h index 0e05c32..fb94134 100644 --- a/src/particle_engine.h +++ b/src/particle_engine.h @@ -37,6 +37,9 @@ particle_engine_fire_explosion(Position, Dimension); void particle_engine_eldritch_explosion(Position, Dimension); +void +particle_engine_dust_puff(Position, Dimension); + void particle_engine_speed_lines(Position, Dimension, bool horizontal);