diff --git a/assets/audio/Famishin - とおりゃんせ~甘美風来 (通行歌~甘美风来) (Inst_)_L.ogg b/assets/audio/Famishin - とおりゃんせ~甘美風来 (通行歌~甘美风来) (Inst_)_L.ogg new file mode 100644 index 0000000..2a461cd Binary files /dev/null and b/assets/audio/Famishin - とおりゃんせ~甘美風来 (通行歌~甘美风来) (Inst_)_L.ogg differ diff --git a/src/include/Tetris.h b/src/include/Tetris.h index 0709d56..3e2d489 100644 --- a/src/include/Tetris.h +++ b/src/include/Tetris.h @@ -108,6 +108,7 @@ struct UpgradeOption int id; int currentLevel; int targetPieceType; + int rarity; bool cursed; const TCHAR* name; const TCHAR* category; @@ -156,6 +157,13 @@ enum GameMode MODE_ROGUE = 1 }; +enum UpgradeRarity +{ + UPGRADE_RARITY_COMMON = 0, + UPGRADE_RARITY_UNCOMMON = 1, + UPGRADE_RARITY_RARE = 2 +}; + extern int nType; extern int type; extern int state; diff --git a/src/source/TetrisRender.cpp b/src/source/TetrisRender.cpp index ab25daa..f41e378 100644 --- a/src/source/TetrisRender.cpp +++ b/src/source/TetrisRender.cpp @@ -1640,18 +1640,40 @@ void TDrawScreen(HDC hdc, HWND hWnd) COLORREF cardBorder = RGB(221, 197, 208); COLORREF descColor = RGB(108, 86, 99); COLORREF footerColor = RGB(128, 104, 118); + const TCHAR* synthesisPath = GetUpgradeSynthesisPath(upgradeUiState.options[i].id); + bool hasSynthesisPath = synthesisPath != nullptr && lstrlen(synthesisPath) > 0; + const TCHAR* rarityText = _T("\u7a00\u6709\u5ea6\uff1a\u666e\u901a"); if (upgradeUiState.options[i].cursed) { - cardFill = isSelected ? RGB(255, 233, 233) : RGB(255, 243, 243); - cardBorder = isSelected ? RGB(210, 92, 92) : RGB(224, 156, 156); - descColor = RGB(120, 74, 74); - footerColor = RGB(150, 70, 70); + cardFill = isSelected ? RGB(238, 232, 238) : RGB(250, 245, 248); + cardBorder = RGB(38, 34, 42); + descColor = RGB(72, 62, 72); + footerColor = RGB(48, 42, 50); + rarityText = _T("\u7a00\u6709\u5ea6\uff1a\u8bc5\u5492"); } - else if (isSelected) + else if (hasSynthesisPath) + { + cardBorder = RGB(208, 74, 78); + footerColor = RGB(164, 58, 64); + rarityText = _T("\u7a00\u6709\u5ea6\uff1a\u8fdb\u9636"); + } + else if (upgradeUiState.options[i].rarity == UPGRADE_RARITY_RARE) + { + cardBorder = RGB(218, 172, 72); + footerColor = RGB(150, 111, 40); + rarityText = _T("\u7a00\u6709\u5ea6\uff1a\u73cd\u7a00"); + } + else if (upgradeUiState.options[i].rarity == UPGRADE_RARITY_UNCOMMON) + { + cardBorder = RGB(92, 152, 218); + footerColor = RGB(68, 112, 166); + rarityText = _T("\u7a00\u6709\u5ea6\uff1a\u7f55\u89c1"); + } + + if (isSelected && !upgradeUiState.options[i].cursed) { cardFill = RGB(255, 235, 242); - cardBorder = accentColor; } DrawPanelCardAlpha(cardRect, cardFill, cardBorder, 24, isSelected ? 238 : 226); @@ -1692,8 +1714,6 @@ void TDrawScreen(HDC hdc, HWND hWnd) SelectObject(hdc, bodyFont); SetTextColor(hdc, descColor); - const TCHAR* synthesisPath = GetUpgradeSynthesisPath(upgradeUiState.options[i].id); - bool hasSynthesisPath = synthesisPath != nullptr && lstrlen(synthesisPath) > 0; RECT descRect = { cardRect.left + SS(20), @@ -1727,7 +1747,7 @@ void TDrawScreen(HDC hdc, HWND hWnd) SetTextColor(hdc, footerColor); DrawText( hdc, - upgradeUiState.options[i].cursed ? _T("\u7a00\u6709\u5ea6\uff1a\u8bc5\u5492") : _T("\u7a00\u6709\u5ea6\uff1a\u5360\u4f4d"), + rarityText, -1, &footerRect, DT_LEFT | DT_VCENTER | DT_SINGLELINE); diff --git a/src/source/TetrisRogue.cpp b/src/source/TetrisRogue.cpp index 594f006..bad5cb4 100644 --- a/src/source/TetrisRogue.cpp +++ b/src/source/TetrisRogue.cpp @@ -97,6 +97,7 @@ static constexpr int kDifficultyLevelsPerLockedRow = 3; static int GetUpgradeCurrentLevel(int upgradeId); static bool IsUpgradePrerequisiteConsumed(int upgradeId); +static int GetUpgradeBaseRarity(int upgradeId); static int GetUpgradeDynamicWeight(const UpgradeEntry& entry); static const TCHAR* GetPieceShortName(int pieceType); static bool IsUpgradeSelectable(const UpgradeEntry& entry); @@ -337,6 +338,50 @@ const TCHAR* GetUpgradeSynthesisPath(int upgradeId) } } +static int GetUpgradeBaseRarity(int upgradeId) +{ + switch (upgradeId) + { + case UPGRADE_SCORE_MULTIPLIER: + case UPGRADE_EXP_MULTIPLIER: + case UPGRADE_SLOW_FALL: + case UPGRADE_COMBO_BONUS: + case UPGRADE_PRESSURE_RELIEF: + case UPGRADE_SWEEPER: + case UPGRADE_PIECE_TUNING: + return UPGRADE_RARITY_COMMON; + + case UPGRADE_PREVIEW_PLUS_ONE: + case UPGRADE_LAST_CHANCE: + case UPGRADE_HOLD_UNLOCK: + case UPGRADE_EXPLOSIVE_PIECE: + case UPGRADE_CHAIN_BLAST: + case UPGRADE_LASER_PIECE: + case UPGRADE_THUNDER_TETRIS: + case UPGRADE_FEVER_MODE: + case UPGRADE_RAGE_STACK: + case UPGRADE_SCREEN_BOMB: + case UPGRADE_PERFECT_ROTATE: + case UPGRADE_TIME_DILATION: + case UPGRADE_HIGH_PRESSURE: + case UPGRADE_TETRIS_GAMBLE: + case UPGRADE_BLOCK_STORM: + case UPGRADE_CROSS_PIECE: + case UPGRADE_BLACK_HOLE: + case UPGRADE_AIR_RESHAPE: + case UPGRADE_STABLE_STRUCTURE: + case UPGRADE_DOUBLE_GROWTH: + return UPGRADE_RARITY_UNCOMMON; + + case UPGRADE_RAINBOW_PIECE: + case UPGRADE_GAMBLER: + return UPGRADE_RARITY_RARE; + + default: + return UPGRADE_RARITY_RARE; + } +} + static bool IsUpgradePrerequisiteConsumed(int upgradeId) { switch (upgradeId) @@ -418,6 +463,16 @@ static int GetUpgradeDynamicWeight(const UpgradeEntry& entry) weight += 20; } + int rarity = GetUpgradeBaseRarity(entry.id); + if (rarity == UPGRADE_RARITY_UNCOMMON) + { + weight = weight * 65 / 100; + } + else if (rarity == UPGRADE_RARITY_RARE) + { + weight = weight * 40 / 100; + } + return weight < 1 ? 1 : weight; } @@ -1131,6 +1186,7 @@ static void FillUpgradeOptions() upgradeUiState.options[i].id = pickedEntry.id; upgradeUiState.options[i].currentLevel = GetUpgradeCurrentLevel(pickedEntry.id); upgradeUiState.options[i].targetPieceType = -1; + upgradeUiState.options[i].rarity = GetUpgradeBaseRarity(pickedEntry.id); upgradeUiState.options[i].cursed = false; upgradeUiState.options[i].name = pickedEntry.name; upgradeUiState.options[i].category = pickedEntry.category;