Skip to content

Commit

Permalink
Merge pull request #39 from GDG-Hackathon-77ia/feat/set-pet-point
Browse files Browse the repository at this point in the history
feat: Change const values related to point
  • Loading branch information
jhssong authored Nov 15, 2024
2 parents 02b4388 + b3daf49 commit f3f0c42
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/gdg/kkia/member/entity/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/com/gdg/kkia/pet/entity/Pet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/gdg/kkia/point/service/PointLogService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<PointLog.Type> ATTENDANCE_LISTS = Arrays.asList(
PointLog.Type.ATTENDANCE_DAY_1,
PointLog.Type.ATTENDANCE_DAY_2,
Expand Down

0 comments on commit f3f0c42

Please sign in to comment.