Skip to content

Commit

Permalink
Check midas property on explosions hitting doors
Browse files Browse the repository at this point in the history
Also made sure the dkfans/FXGraphics#74 files are bundled on the alpha.
  • Loading branch information
Loobinex committed Sep 28, 2024
1 parent 5117291 commit 529444a
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions src/thing_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,37 @@
*/
/******************************************************************************/
#include "pre_inc.h"
#include "thing_effects.h"
#include "globals.h"

#include "bflib_memory.h"
#include "bflib_math.h"
#include "bflib_sound.h"
#include "bflib_memory.h"
#include "bflib_planar.h"
#include "math.h"
#include "thing_objects.h"
#include "thing_list.h"
#include "thing_stats.h"
#include "thing_physics.h"
#include "thing_factory.h"
#include "thing_navigate.h"
#include "thing_shots.h"
#include "creature_battle.h"
#include "creature_senses.h"
#include "bflib_sound.h"
#include "config_creature.h"
#include "config_effects.h"
#include "front_simple.h"
#include "map_data.h"
#include "map_blocks.h"
#include "creature_battle.h"
#include "creature_graphics.h"
#include "gui_topmsg.h"
#include "game_legacy.h"
#include "creature_senses.h"
#include "engine_redraw.h"
#include "keeperfx.hpp"
#include "front_simple.h"
#include "game_legacy.h"
#include "globals.h"
#include "gui_soundmsgs.h"
#include "gui_topmsg.h"
#include "keeperfx.hpp"
#include "map_blocks.h"
#include "map_data.h"
#include "math.h"
#include "player_utils.h"
#include "room_util.h"
#include "thing_effects.h"
#include "thing_factory.h"
#include "thing_list.h"
#include "thing_navigate.h"
#include "thing_objects.h"
#include "thing_physics.h"
#include "thing_shots.h"
#include "thing_stats.h"

#include "post_inc.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -1084,6 +1086,17 @@ TbBool explosion_affecting_door(struct Thing *tngsrc, struct Thing *tngdst, cons
if (distance < max_dist)
{
HitPoints damage = get_radially_decaying_value(max_damage, max_dist / 4, 3 * max_dist / 4, distance) + 1;

const struct DoorConfigStats* doorst = get_door_model_stats(tngdst->model);
if (flag_is_set(doorst->model_flags, DoMF_Midas))
{
GoldAmount received = take_money_from_dungeon(tngdst->owner, damage, 0);
damage -= received;
for (int i = received; i > 0; i -= 32)
{
create_effect(pos, TngEff_CoinFountain, tngdst->owner);
}
}
SYNCDBG(7,"Causing %d damage to %s at distance %d",(int)damage,thing_model_name(tngdst),(int)distance);
apply_damage_to_thing(tngdst, damage, damage_type, -1);
affected = true;
Expand Down

0 comments on commit 529444a

Please sign in to comment.