Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static int addHeart(int heart, int plusHeart) {
- if (heart<100){
- if (heart+plusHeart<=100){
- heart+=plusHeart;
- System.out.println(String.format("You healed for %d hp.",plusHeart));
- System.out.println(String.format("Current health: %d hp.",heart));
- }else {
- System.out.println(String.format("You healed for %d hp.",100-heart));
- heart=100;
- System.out.println("Current health: 100 hp.");
- }
- }else {
- System.out.println("You healed for 0 hp.");
- System.out.println("Current health: 100 hp.");
- }
- return heart;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement