Skip to content

Commit

Permalink
tweak exp calculation and add wing restore
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Jul 25, 2023
1 parent 9659faf commit 4ea0bb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions DragaliaAPI/Features/Dungeon/DungeonRecordController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,13 @@ await eventDropService.ProcessEventMaterialDrops(
await rewardService.GrantReward(new Entity(EntityTypes.Mana, Quantity: manaDrop));

// Constant for quests with no stamina usage, wip?
int staminaExpAmount =
session.QuestData.PayStaminaSingle == 0 ? 15 : session.QuestData.PayStaminaSingle;
int experience =
session.QuestData.PayStaminaSingle != 0
? session.QuestData.PayStaminaSingle * 10
: session.QuestData.PayStaminaMulti != 0
? session.QuestData.PayStaminaMulti * 100
: 150;

int experience = (int)Math.Floor(staminaExpAmount * 10d);
PlayerLevelResult playerLevelResult = await userService.AddExperience(experience); // TODO: Exp boost

UpdateDataList updateDataList = await updateDataService.SaveChangesAsync();
Expand Down
5 changes: 4 additions & 1 deletion DragaliaAPI/Features/Player/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ IDateTimeProvider dateTimeProvider
private const int MaxMultiStamina = 99;
private const int MaxQuestSkipPoint = 400;

private const int MaxMultiStaminaRegen = 12;

private const int WyrmiteLevelUpReward = 50;

public int QuestSkipPointMax => MaxQuestSkipPoint;
Expand Down Expand Up @@ -115,7 +117,7 @@ public async Task<int> GetAndUpdateStamina(StaminaType type)
break;
case StaminaType.Multi:
currentStamina = data.StaminaMulti;
maxStamina = 12;
maxStamina = MaxMultiStaminaRegen;
secondsToRegenOne = 1 * 60 * 60; // 1 Hour
lastUpdatedTime = data.LastStaminaMultiUpdateTime;
break;
Expand Down Expand Up @@ -206,6 +208,7 @@ public async Task<PlayerLevelResult> AddExperience(int experience)
totalReward += WyrmiteLevelUpReward;

await AddStamina(StaminaType.Single, next.StaminaSingle);
await AddStamina(StaminaType.Multi, MaxMultiStaminaRegen);
logger.LogDebug("Player leveled up to level {level}", data.Level);
current = next;
}
Expand Down

0 comments on commit 4ea0bb5

Please sign in to comment.