Skip to content

Commit

Permalink
Minor fixes to text
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamKyle committed Dec 14, 2024
1 parent 8797d79 commit 191833d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
5 changes: 3 additions & 2 deletions app/Game/Battle/Handlers/BattleEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ public function processDeadCharacter(Character $character, ?Monster $monster = n
* @param integer $characterId
* @param integer $monsterId
* @param boolean $includeXp
* @param boolean $includeEventReward
* @return void
*/
public function processMonsterDeath(int $characterId, int $monsterId, bool $includeXp = true): void
public function processMonsterDeath(int $characterId, int $monsterId, bool $includeXp = true, $includeEventReward = true): void
{
$this->battleRewardService->setUp($characterId, $monsterId)->handleBaseRewards($includeXp);
$this->battleRewardService->setUp($characterId, $monsterId)->handleBaseRewards($includeXp, $includeEventReward);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,23 @@ public function setUp(int $characterId, int $monsterId): BattleRewardService
return $this;
}

public function handleBaseRewards($includeXp = true)
public function handleBaseRewards($includeXp = true, $includeEventRewards = true)
{

if ($includeXp) {
BattleXpHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_xp')->delay(now()->addSeconds(2));
}

if ($includeEventRewards) {
WinterEventChristmasGiftHandler::dispatch($this->characterId)->onQueue('event_battle_reward')->delay(now()->addSeconds(2));
}

BattleSecondaryRewardHandler::dispatch($this->characterId)->onQueue('battle_secondary_reward')->delay(now()->addSeconds(2));
BattleCurrenciesHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_currencies')->delay(now()->addSeconds(2));
BattleFactionHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_factions')->delay(now()->addSeconds(2));
BattleGlobalEventHandler::dispatch($this->characterId)->onQueue('battle_reward_global_event')->delay(now()->addSeconds(2));
BattleLocationHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_location_handlers')->delay(now()->addSeconds(2));
BattleWeeklyFightHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_weekly_fights')->delay(now()->addSeconds(2));
BattleItemHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_item_handler')->delay(now()->addSeconds(2));

// For special Events:
WinterEventChristmasGiftHandler::dispatch($this->characterId)->onQueue('event_battle_reward')->delay(now()->addSeconds(2));
}
}
4 changes: 2 additions & 2 deletions app/Game/Core/Handlers/AnnouncementHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function buildTheGoldMinesMessage(): void
}

$message = 'From now until: ' . $event->ends_at->format('l, j \of F \a\t h:ia \G\M\TP') . ' ' .
'Players who are in The Gold Mines will have double chance to get MEDIUM uniques gear. ' .
'Players who are in The Gold Mines will have double chance to get unique gear. ' .
'Players will also get 2x the amount of Gold Dust, Shards and Gold from critters.';

$announcement = Announcement::create([
Expand All @@ -111,7 +111,7 @@ private function buildTheOldChurchMessage(): void
}

$message = 'From now until: ' . $event->ends_at->format('l, j \of F \a\t h:ia \G\M\TP') . ' ' .
'Players who are in The Old Church will have double chance to get MEDIUM uniques Corrupted Ice gear. ' .
'Players who are in The Old Church will have double chance to get a unique Corrupted Ice gear. ' .
'Players will also get 2x the amount of Gold Dust, Shards and Gold from critters.';

$announcement = Announcement::create([
Expand Down
7 changes: 5 additions & 2 deletions app/Game/Exploration/Jobs/Exploration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use App\Flare\Values\MaxCurrenciesValue;
use App\Game\Battle\Events\UpdateCharacterStatus;
use App\Game\Battle\Handlers\BattleEventHandler;
use App\Game\BattleRewardProcessing\Jobs\Events\WinterEventChristmasGiftHandler;
use App\Game\BattleRewardProcessing\Jobs\ExplorationSkillXpHandler;
use App\Game\BattleRewardProcessing\Jobs\ExplorationXpHandler;
use App\Game\Character\Builders\AttackBuilders\CharacterCacheData;
Expand Down Expand Up @@ -136,14 +137,15 @@ private function encounter(MonsterPlayerFight $response, CharacterAutomation $au
$characterSkillService = $this->skillService->setSkillInTraining($this->character);

for ($i = 1; $i <= $enemies; $i++) {
$battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false);
$battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false, false);

$totalXpToReward += $characterRewardService->fetchXpForMonster($monster);
$totalSkillXpToReward += $characterSkillService->getXpForSkillIntraining($this->character, $monster->xp);
}

ExplorationXpHandler::dispatch($this->character->id, $enemies, $totalXpToReward)->onQueue('exploration_battle_xp_reward')->delay(now()->addSeconds(2));
ExplorationSkillXpHandler::dispatch($this->character->id, $totalSkillXpToReward)->onQueue('exploration_battle_skill_xp_reward')->delay(now()->addSeconds(2));
WinterEventChristmasGiftHandler::dispatch($this->character->id)->onQueue('event_battle_reward')->delay(now()->addSeconds(2));

$this->sendOutEventLogUpdate('The last of the enemies fall. Covered in blood, exhausted, you look around for any signs of more of their friends. The area is silent. "Another day, another battle.
We managed to survive." The Guide states as he walks from the shadows. The pair of you set off in search of the next adventure ...
Expand Down Expand Up @@ -182,6 +184,7 @@ private function canSurviveFight(MonsterPlayerFight $response, CharacterAutomati

ExplorationXpHandler::dispatch($this->character->id, 10, $totalXpToReward)->onQueue('exploration_battle_xp_reward')->delay(now()->addSeconds(2));
ExplorationSkillXpHandler::dispatch($this->character->id, $totalSkillXpToReward)->onQueue('exploration_battle_skill_xp_reward')->delay(now()->addSeconds(2));
WinterEventChristmasGiftHandler::dispatch($this->character->id)->onQueue('event_battle_reward')->delay(now()->addSeconds(2));

Cache::put('can-character-survive-' . $this->character->id, true);

Expand All @@ -208,7 +211,7 @@ private function fightAutomationMonster(MonsterPlayerFight $response, CharacterA

$response->resetBattleMessages();

$battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false);
$battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false, false);

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ protected function rewardTheUniqueItem(Character $character)
'item_id' => $newItem->id,
]);

event(new ServerMessageEvent($character->user, 'You found something of MEDIUM value child. A simple reward: ' . $item->affix_name, $slot->id));
event(new ServerMessageEvent($character->user, 'You found something Unique in value child. A simple reward: ' . $item->affix_name, $slot->id));
}

/**
Expand Down

0 comments on commit 191833d

Please sign in to comment.