From b3daf49ce9553213c9b107d97d9c19f70d6f2a0c Mon Sep 17 00:00:00 2001 From: jhssong Date: Sat, 16 Nov 2024 06:04:54 +0900 Subject: [PATCH] feat: Change const values related to point --- .../java/com/gdg/kkia/member/entity/Member.java | 8 ++++---- src/main/java/com/gdg/kkia/pet/entity/Pet.java | 15 ++++++++------- .../gdg/kkia/point/service/PointLogService.java | 16 ++++++++-------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/gdg/kkia/member/entity/Member.java b/src/main/java/com/gdg/kkia/member/entity/Member.java index aed89a7..29d7b54 100644 --- a/src/main/java/com/gdg/kkia/member/entity/Member.java +++ b/src/main/java/com/gdg/kkia/member/entity/Member.java @@ -18,10 +18,10 @@ @AllArgsConstructor public class Member { - public static final int INITIAL_POINT = 30000; - public static final int NORMAL_BUTTON_PRICE = 100; - public static final int PREMIUM_BUTTON_PRICE = 1000; - public static final int SUPER_BUTTON_PRICE = 2000; + public static final int INITIAL_POINT = 100; + public static final int NORMAL_BUTTON_PRICE = 15; + public static final int PREMIUM_BUTTON_PRICE = 30; + public static final int SUPER_BUTTON_PRICE = 40; @Id diff --git a/src/main/java/com/gdg/kkia/pet/entity/Pet.java b/src/main/java/com/gdg/kkia/pet/entity/Pet.java index 8cc4cb3..d160162 100644 --- a/src/main/java/com/gdg/kkia/pet/entity/Pet.java +++ b/src/main/java/com/gdg/kkia/pet/entity/Pet.java @@ -21,10 +21,10 @@ public class Pet { private final int INITIAL_LEVEL = 1; private final int INITIAL_EXPERIENCE = 0; private final int MAX_LEVEL = 3; - private final int MAX_EXPERIENCE = 100; - private final int WATER_PLUS = 1; - private final int SUN_PLUS = 12; - private final int NUTRIENT_PLUS = 30; + private final int MAX_EXPERIENCE = 150; + private final int WATER_PLUS = 15; + private final int SUN_PLUS = 30; + private final int NUTRIENT_PLUS = 40; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -81,13 +81,14 @@ public void changePetName(String name) { public int earnExperience(GrowthButton growthButton) { int plusExperience = experienceToEarn(growthButton); + int nextLevelExperience = MAX_EXPERIENCE * this.level; - if (this.experience + plusExperience >= MAX_EXPERIENCE) { + if (this.experience + plusExperience >= nextLevelExperience) { if (this.level < MAX_LEVEL) { levelUP(); - this.experience = (this.experience + plusExperience) - MAX_EXPERIENCE; + this.experience = (this.experience + plusExperience) - nextLevelExperience; } else { - this.experience = MAX_EXPERIENCE; + this.experience = nextLevelExperience; this.level = MAX_LEVEL; this.isMaxGrowth = true; } diff --git a/src/main/java/com/gdg/kkia/point/service/PointLogService.java b/src/main/java/com/gdg/kkia/point/service/PointLogService.java index c42e356..23b8d56 100644 --- a/src/main/java/com/gdg/kkia/point/service/PointLogService.java +++ b/src/main/java/com/gdg/kkia/point/service/PointLogService.java @@ -23,14 +23,14 @@ @RequiredArgsConstructor public class PointLogService { - private final static int ATTENDANCE_BASE_POINT = 100; - private final static int ATTENDANCE_BONUS_2_DAYS = 50; - private final static int ATTENDANCE_BONUS_3_DAYS = 100; - private final static int ATTENDANCE_BONUS_4_DAYS = 150; - private final static int ATTENDANCE_BONUS_5_DAYS = 200; - private final static int DIARY_WRITE_POINT = 300; - private final static int USING_CHAT_BOT_POINT = 200; - private final static int DAILY_QUESTION_ANSWER_POINT = 200; + private final static int ATTENDANCE_BASE_POINT = 10; + private final static int ATTENDANCE_BONUS_2_DAYS = 15; + private final static int ATTENDANCE_BONUS_3_DAYS = 20; + private final static int ATTENDANCE_BONUS_4_DAYS = 25; + private final static int ATTENDANCE_BONUS_5_DAYS = 30; + private final static int DIARY_WRITE_POINT = 15; + private final static int USING_CHAT_BOT_POINT = 5; + private final static int DAILY_QUESTION_ANSWER_POINT = 10; private final static List ATTENDANCE_LISTS = Arrays.asList( PointLog.Type.ATTENDANCE_DAY_1, PointLog.Type.ATTENDANCE_DAY_2,