From dee7814038e3e18abd118e09c79e0b61ab7808bb Mon Sep 17 00:00:00 2001 From: snughnu Date: Tue, 3 Feb 2026 00:11:02 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=EC=8A=A4=ED=82=AC=20=EC=8B=9C?= =?UTF-8?q?=EC=8A=A4=ED=85=9C=20=EC=84=9C=EB=B8=8C=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameCore/Models/Systems/SkillSystem.swift | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift b/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift index af508f55..e3d85860 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift @@ -63,6 +63,49 @@ final class SkillSystem { try skill.upgrade() pay(cost: costBeforeUpgrade) } + + /// 게임의 현재 액션당 총 골드 획득량 계산 + func calculateCurrentTotalGold(for game: GameType) -> Int { + return user.skills + .filter { $0.key.game == game } + .reduce(0) { $0 + Int($1.gainGold) } + } + + /// 특정 스킬 업그레이드 후 해당 게임의 총 골드 획득량 계산 + func calculateTotalGoldAfterUpgrade(skill: Skill) -> Int { + let currentTotal = calculateCurrentTotalGold(for: skill.key.game) + + // 해당 스킬의 multiplier 계산 + let multiplier: Int + switch skill.key.game { + case .tap: + switch skill.key.tier { + case .beginner: multiplier = Policy.Skill.Tap.beginnerGoldMultiplier + case .intermediate: multiplier = Policy.Skill.Tap.intermediateGoldMultiplier + case .advanced: multiplier = Policy.Skill.Tap.advancedGoldMultiplier + } + case .language: + switch skill.key.tier { + case .beginner: multiplier = Policy.Skill.Language.beginnerGoldMultiplier + case .intermediate: multiplier = Policy.Skill.Language.intermediateGoldMultiplier + case .advanced: multiplier = Policy.Skill.Language.advancedGoldMultiplier + } + case .dodge: + switch skill.key.tier { + case .beginner: multiplier = Policy.Skill.Dodge.beginnerGoldMultiplier + case .intermediate: multiplier = Policy.Skill.Dodge.intermediateGoldMultiplier + case .advanced: multiplier = Policy.Skill.Dodge.advancedGoldMultiplier + } + case .stack: + switch skill.key.tier { + case .beginner: multiplier = Policy.Skill.Stack.beginnerGoldMultiplier + case .intermediate: multiplier = Policy.Skill.Stack.intermediateGoldMultiplier + case .advanced: multiplier = Policy.Skill.Stack.advancedGoldMultiplier + } + } + + return currentTotal + multiplier + } } private extension SkillSystem { From fc0acc0c6131a939a3dc234d4700624c7779e1f3 Mon Sep 17 00:00:00 2001 From: snughnu Date: Tue, 3 Feb 2026 00:11:24 +0900 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=EC=8A=A4=ED=82=AC=EB=B7=B0=20ItemRo?= =?UTF-8?q?w=20description=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Production/Presentation/SkillView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift index 3f09b5c9..e33551b1 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift @@ -38,7 +38,11 @@ struct SkillView: View { ForEach(skillSystem.skillList(), id: \.skill) { skillState in ItemRow( title: skillState.skill.title, - description: "액션당 \(Int(skillState.skill.gainGold).formatted()) 골드 획득", + description: { + let currentTotal = skillSystem.calculateCurrentTotalGold(for: skillState.skill.key.game) + let afterTotal = skillSystem.calculateTotalGoldAfterUpgrade(skill: skillState.skill) + return " 골드 획득: \(currentTotal.formatted()) -> \(afterTotal.formatted())" + }(), imageName: skillState.skill.imageName, cost: skillState.skill.upgradeCost, state: skillState.itemState From 83122457912e5edf174dfa0f635e2e2affadf07f Mon Sep 17 00:00:00 2001 From: snughnu Date: Tue, 3 Feb 2026 00:14:20 +0900 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=EC=8A=A4=ED=82=AC=20Row=20descripti?= =?UTF-8?q?on=20=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Production/Presentation/SkillView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift index e33551b1..1c57c62d 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift @@ -41,7 +41,7 @@ struct SkillView: View { description: { let currentTotal = skillSystem.calculateCurrentTotalGold(for: skillState.skill.key.game) let afterTotal = skillSystem.calculateTotalGoldAfterUpgrade(skill: skillState.skill) - return " 골드 획득: \(currentTotal.formatted()) -> \(afterTotal.formatted())" + return "골드 획득: \(currentTotal.formatted()) -> \(afterTotal.formatted())" }(), imageName: skillState.skill.imageName, cost: skillState.skill.upgradeCost, From 98afadaeb981a0778a050027aed212eaf83f8556 Mon Sep 17 00:00:00 2001 From: snughnu Date: Tue, 3 Feb 2026 13:58:23 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=EB=8B=A8=EC=9C=84=20=ED=8F=AC?= =?UTF-8?q?=EB=A7=B7=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Production/Presentation/SkillView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift index 1c57c62d..499b1825 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift @@ -41,7 +41,7 @@ struct SkillView: View { description: { let currentTotal = skillSystem.calculateCurrentTotalGold(for: skillState.skill.key.game) let afterTotal = skillSystem.calculateTotalGoldAfterUpgrade(skill: skillState.skill) - return "골드 획득: \(currentTotal.formatted()) -> \(afterTotal.formatted())" + return "골드 획득: \(currentTotal.formatted) -> \(afterTotal.formatted)" }(), imageName: skillState.skill.imageName, cost: skillState.skill.upgradeCost, From 838ecf2b34baf221a85ed9547966964587bbfcfb Mon Sep 17 00:00:00 2001 From: snughnu Date: Wed, 4 Feb 2026 01:10:45 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=EC=8A=A4=ED=82=AC=20=EB=A0=88?= =?UTF-8?q?=EB=B2=A8=EC=97=85=20description=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameCore/Models/User/Skill/Skill.swift | 51 +++++++++++++++++++ .../Production/Presentation/SkillView.swift | 6 +-- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/User/Skill/Skill.swift b/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/User/Skill/Skill.swift index 2bdc3423..b39addc5 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/User/Skill/Skill.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/User/Skill/Skill.swift @@ -71,6 +71,57 @@ final class Skill: Hashable { return Double(baseGold + multiplier * level) } + /// 레벨업 시 획득 재화량 (스킬에 국한된 스탯) + var gainGoldAfterUpgrade: Double { + let baseGold: Int + let multiplier: Int + + switch key.game { + case .tap: + baseGold = Policy.Skill.Tap.baseGold + switch key.tier { + case .beginner: + multiplier = Policy.Skill.Tap.beginnerGoldMultiplier + case .intermediate: + multiplier = Policy.Skill.Tap.intermediateGoldMultiplier + case .advanced: + multiplier = Policy.Skill.Tap.advancedGoldMultiplier + } + case .language: + baseGold = Policy.Skill.Language.baseGold + switch key.tier { + case .beginner: + multiplier = Policy.Skill.Language.beginnerGoldMultiplier + case .intermediate: + multiplier = Policy.Skill.Language.intermediateGoldMultiplier + case .advanced: + multiplier = Policy.Skill.Language.advancedGoldMultiplier + } + case .dodge: + baseGold = Policy.Skill.Dodge.baseGold + switch key.tier { + case .beginner: + multiplier = Policy.Skill.Dodge.beginnerGoldMultiplier + case .intermediate: + multiplier = Policy.Skill.Dodge.intermediateGoldMultiplier + case .advanced: + multiplier = Policy.Skill.Dodge.advancedGoldMultiplier + } + case .stack: + baseGold = Policy.Skill.Stack.baseGold + switch key.tier { + case .beginner: + multiplier = Policy.Skill.Stack.beginnerGoldMultiplier + case .intermediate: + multiplier = Policy.Skill.Stack.intermediateGoldMultiplier + case .advanced: + multiplier = Policy.Skill.Stack.advancedGoldMultiplier + } + } + + return Double(baseGold + multiplier * (level + 1)) + } + /// 이미지 리소스 var imageName: String { let gameName: String = { diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift index 3a2d0f0d..4de59ab4 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/Production/Presentation/SkillView.swift @@ -39,9 +39,9 @@ struct SkillView: View { ItemRow( title: skillState.skill.title, description: { - let currentTotal = skillSystem.calculateCurrentTotalGold(for: skillState.skill.key.game) - let afterTotal = skillSystem.calculateTotalGoldAfterUpgrade(skill: skillState.skill) - return "골드 획득: \(currentTotal.formatted) -> \(afterTotal.formatted)" + let current = skillState.skill.gainGold + let after = skillState.skill.gainGoldAfterUpgrade + return "레벨업시 골드 획득 \(Int(current).formatted) -> \(Int(after).formatted)" }(), imageName: skillState.skill.imageName, cost: skillState.skill.upgradeCost, From 1c71934bced7009b5f00b645e09e605410c9fcb5 Mon Sep 17 00:00:00 2001 From: snughnu Date: Wed, 4 Feb 2026 01:11:37 +0900 Subject: [PATCH 6/6] =?UTF-8?q?remove:=20SkillSystem=20=EB=A0=88=EA=B1=B0?= =?UTF-8?q?=EC=8B=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameCore/Models/Systems/SkillSystem.swift | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift b/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift index d3076845..b813ab0a 100644 --- a/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift +++ b/SoloDeveloperTraining/SoloDeveloperTraining/GameCore/Models/Systems/SkillSystem.swift @@ -63,49 +63,6 @@ final class SkillSystem { try skill.upgrade() pay(cost: costBeforeUpgrade) } - - /// 게임의 현재 액션당 총 골드 획득량 계산 - func calculateCurrentTotalGold(for game: GameType) -> Int { - return user.skills - .filter { $0.key.game == game } - .reduce(0) { $0 + Int($1.gainGold) } - } - - /// 특정 스킬 업그레이드 후 해당 게임의 총 골드 획득량 계산 - func calculateTotalGoldAfterUpgrade(skill: Skill) -> Int { - let currentTotal = calculateCurrentTotalGold(for: skill.key.game) - - // 해당 스킬의 multiplier 계산 - let multiplier: Int - switch skill.key.game { - case .tap: - switch skill.key.tier { - case .beginner: multiplier = Policy.Skill.Tap.beginnerGoldMultiplier - case .intermediate: multiplier = Policy.Skill.Tap.intermediateGoldMultiplier - case .advanced: multiplier = Policy.Skill.Tap.advancedGoldMultiplier - } - case .language: - switch skill.key.tier { - case .beginner: multiplier = Policy.Skill.Language.beginnerGoldMultiplier - case .intermediate: multiplier = Policy.Skill.Language.intermediateGoldMultiplier - case .advanced: multiplier = Policy.Skill.Language.advancedGoldMultiplier - } - case .dodge: - switch skill.key.tier { - case .beginner: multiplier = Policy.Skill.Dodge.beginnerGoldMultiplier - case .intermediate: multiplier = Policy.Skill.Dodge.intermediateGoldMultiplier - case .advanced: multiplier = Policy.Skill.Dodge.advancedGoldMultiplier - } - case .stack: - switch skill.key.tier { - case .beginner: multiplier = Policy.Skill.Stack.beginnerGoldMultiplier - case .intermediate: multiplier = Policy.Skill.Stack.intermediateGoldMultiplier - case .advanced: multiplier = Policy.Skill.Stack.advancedGoldMultiplier - } - } - - return currentTotal + multiplier - } } private extension SkillSystem {