Skip to content

Commit

Permalink
Show challenge fail screen when a player loses a challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Jan 1, 2024
1 parent 90456b2 commit 9170768
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ public void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatisti
default:
// Fail challenge
this.setStatus(ChallengeStatus.CHALLENGE_FAILED);
// Send challenge result data
player.sendPacket(new PacketChallengeSettleNotify(this));
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import emu.lunarcore.game.challenge.ChallengeInstance;
import emu.lunarcore.proto.ChallengeSettleNotifyOuterClass.ChallengeSettleNotify;
import emu.lunarcore.proto.ItemListOuterClass.ItemList;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;

Expand All @@ -14,9 +13,11 @@ public PacketChallengeSettleNotify(ChallengeInstance challenge) {
var data = ChallengeSettleNotify.newInstance()
.setChallengeId(challenge.getExcel().getId())
.setIsWin(challenge.isWin())
.setReward(ItemList.newInstance())
.setStars(challenge.getStars());

// Set empty rewards
data.getMutableReward();

this.setData(data);
}
}

0 comments on commit 9170768

Please sign in to comment.