Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb161fa2

Browse files
committed
Avatar: Block XP gain after initial death frame
1 parent8241e37 commitb161fa2

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

‎RELEASE_NOTES.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ Engine fixes:
114114
* Fixed incorrect activation of passive powers on death.
115115
* Reduced spam of identical combat text messages.
116116
* Fix unintended stacking in active effects display for effects that don't have the same icon.
117+
* XP gain is now prevented after the initial death frame. This still allows for the player to revive if they die and level up on the same frame.
117118
* Android: Fix 'Flare' directory not being automatically created.
118119
* Android: Added a dialog to direct the player to the wiki page for installing if no game data is found.
119120

‎src/Avatar.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Avatar::Avatar()
9090
, feet_index(-1)
9191
, mm_target_object(MM_TARGET_NONE)
9292
, mm_target_object_pos()
93+
, block_xp_gain(false)
9394
{
9495
power_cooldown_timers.resize(powers->powers.size(),NULL);
9596
power_cast_timers.resize(powers->powers.size(),NULL);
@@ -520,6 +521,9 @@ void Avatar::logic() {
520521
}
521522
}
522523

524+
// we have a window of 1 frame to check if the player leveled up when dying. Once it passes, we block gaining any additional XP.
525+
block_xp_gain = (stats.hp ==0);
526+
523527
// assist mouse movement
524528
mm_key = settings->mouse_move_swap ? Input::MAIN2 : Input::MAIN1;
525529
if (!inpt->pressing[mm_key]) {

‎src/Avatar.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class Avatar : public Entity {
174174
int feet_index;
175175
int mm_target_object;
176176
FPoint mm_target_object_pos;
177+
bool block_xp_gain;
177178

178179
std::vector<ActionData> action_queue;
179180
};

‎src/CampaignManager.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ void CampaignManager::rewardCurrency(int amount) {
205205
}
206206

207207
voidCampaignManager::rewardXP(float amount,bool show_message) {
208+
if (pc->block_xp_gain)
209+
return;
210+
208211
bonus_xp += (amount * (100.0f +static_cast<float>(pc->stats.get(Stats::XP_GAIN)))) /100.0f;
209212

210213
int whole_xp =static_cast<int>(bonus_xp);

‎src/Version.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ FLARE. If not, see http://www.gnu.org/licenses/
3030

3131
#include<SDL.h>
3232

33-
VersionVersionInfo::ENGINE(1,14,172);
33+
VersionVersionInfo::ENGINE(1,14,173);
3434
VersionVersionInfo::MIN(0,0,0);
3535
VersionVersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);
3636

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp