Adding bosses to the game #6
@ -28,7 +28,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
|||||||
// Events
|
// Events
|
||||||
|
|
||||||
event PlayerRegistered(address indexed player, uint256 initialGeld);
|
event PlayerRegistered(address indexed player, uint256 initialGeld);
|
||||||
event PleyerStrikesAgain(address indexed player, uint256 totalRewards, uint256 initialGeld);
|
event PlayerStrikesAgain(address indexed player, uint256 totalRewards, uint256 initialGeld);
|
||||||
event RaidPerformed(address indexed player, uint256 totalMinted, uint256 geldBalance);
|
event RaidPerformed(address indexed player, uint256 totalMinted, uint256 geldBalance);
|
||||||
event UnitAdded(
|
event UnitAdded(
|
||||||
address indexed player,
|
address indexed player,
|
||||||
@ -80,8 +80,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
|||||||
players[player].n_runs += 1;
|
players[player].n_runs += 1;
|
||||||
|
|
||||||
if (existing_player) {
|
if (existing_player) {
|
||||||
// TODO: Emit new run
|
emit PlayerStrikesAgain(player, players[player].total_rewards, INITIAL_GELD);
|
||||||
emit PleyerStrikesAgain(player, players[player].total_rewards, INITIAL_GELD);
|
|
||||||
} else {
|
} else {
|
||||||
// Emit event
|
// Emit event
|
||||||
emit PlayerRegistered(msg.sender, INITIAL_GELD);
|
emit PlayerRegistered(msg.sender, INITIAL_GELD);
|
||||||
|
|||||||
@ -148,4 +148,9 @@ contract raid_geldTest is Test {
|
|||||||
}
|
}
|
||||||
console.log("Total", total);
|
console.log("Total", total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_5_last_boss_is_unique(uint256 _randomSeed) public {
|
||||||
|
uint8[7] memory bosses = RaidGeldUtils.generate_boss_variants(_randomSeed);
|
||||||
|
vm.assertEq(bosses[6], 6);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user