mudanças
This commit is contained in:
@@ -10,8 +10,6 @@ import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Scanner;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -80,11 +78,11 @@ public class Experientia {
|
||||
System.out.print("Nome: ");
|
||||
nomeJogador = scanner.next();
|
||||
|
||||
if (nomeJogador.equalsIgnoreCase("admin")) {
|
||||
if (nomeJogador.equalsIgnoreCase("Tralalero")) {
|
||||
|
||||
admin = true;
|
||||
|
||||
System.out.println("MODO ADMIN ATIVADO");
|
||||
System.out.println("MODO SECRETO ATIVADO");
|
||||
|
||||
nivelJogador = 100;
|
||||
xpJogador = 0;
|
||||
@@ -511,42 +509,30 @@ public class Experientia {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void GameOver() {
|
||||
|
||||
System.out.println("\nGAME OVER");
|
||||
|
||||
while (true) {
|
||||
|
||||
System.out.println("\nQueres recomeçar?");
|
||||
System.out.println("1-Sim");
|
||||
System.out.println("2-Não");
|
||||
|
||||
int op = scanner.nextInt();
|
||||
|
||||
if (op == 1) {
|
||||
resetJogo();
|
||||
System.out.println("Recomeçaste com o personagem atual!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (op == 2) {
|
||||
System.out.println("A sair do jogo...");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
System.out.println("Opção inválida");
|
||||
}
|
||||
}
|
||||
|
||||
public void adicionarItem(Item i) {
|
||||
|
||||
if (admin) {
|
||||
|
||||
if (itensCount >= inventario.length) {
|
||||
inventario = java.util.Arrays.copyOf(inventario, inventario.length + 20);
|
||||
}
|
||||
|
||||
inventario[itensCount++] = i;
|
||||
return;
|
||||
}
|
||||
@@ -557,26 +543,19 @@ public class Experientia {
|
||||
System.out.println("Inventário cheio");
|
||||
}
|
||||
}
|
||||
|
||||
public void removerItem(int i) {
|
||||
|
||||
if (i < 0 || i >= itensCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = i; j < itensCount - 1; j++) {
|
||||
inventario[j] = inventario[j + 1];
|
||||
}
|
||||
|
||||
inventario[itensCount - 1] = null;
|
||||
|
||||
itensCount--;
|
||||
|
||||
if (itensCount < 0) {
|
||||
itensCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void gerarLoja() {
|
||||
|
||||
for (int i = 0; i < loja.length; i++) {
|
||||
@@ -889,15 +868,11 @@ public class Experientia {
|
||||
System.out.println("1-Novo jogador");
|
||||
System.out.println("2-Carregar jogo");
|
||||
System.out.println("3-Login Admin");
|
||||
|
||||
int op = scanner.nextInt();
|
||||
|
||||
if (op == 1) {
|
||||
|
||||
criarPersonagem();
|
||||
loggedIn = true;
|
||||
} else if (op == 2) {
|
||||
|
||||
try {
|
||||
carregarJogo();
|
||||
loggedIn = true;
|
||||
@@ -907,20 +882,14 @@ public class Experientia {
|
||||
loggedIn = true;
|
||||
}
|
||||
} else if (op == 3) {
|
||||
|
||||
System.out.print("Nome admin: ");
|
||||
String n = scanner.next();
|
||||
|
||||
System.out.print("Password: ");
|
||||
String p = scanner.next();
|
||||
|
||||
if (n.equals("adminPro") && p.equals("adimn.epvc")) {
|
||||
|
||||
admin = true;
|
||||
loggedIn = true;
|
||||
|
||||
System.out.println("ADMIN LOGIN OK");
|
||||
|
||||
nivelJogador = 100;
|
||||
ouro = 999999;
|
||||
vidaMax = 9999;
|
||||
@@ -928,48 +897,33 @@ public class Experientia {
|
||||
ataqueBase = 999;
|
||||
defesaBase = 999;
|
||||
pontosStatus = 999;
|
||||
|
||||
} else {
|
||||
System.out.println("Login inválido");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loginAdmin() {
|
||||
|
||||
System.out.print("Nome admin: ");
|
||||
String nome = scanner.next();
|
||||
|
||||
System.out.print("Password: ");
|
||||
System.out.print("AdminPassword: ");
|
||||
String pass = scanner.next();
|
||||
|
||||
if (nome.equals("admin.epvc") && pass.equals("1234")) {
|
||||
|
||||
if (nome.equals("tuffdasilva") && pass.equals("tungtung")) {
|
||||
admin = true;
|
||||
|
||||
System.out.println("ADMIN LOGIN OK");
|
||||
|
||||
nivelJogador = 100;
|
||||
xpJogador = 0;
|
||||
ouro = 999999;
|
||||
|
||||
vidaMax = 9999;
|
||||
vidaAtual = vidaMax;
|
||||
|
||||
ataqueBase = 999;
|
||||
defesaBase = 999;
|
||||
|
||||
bonusAtaque = 999;
|
||||
bonusDefesa = 999;
|
||||
|
||||
pontosStatus = 999;
|
||||
|
||||
inventario = new Item[200];
|
||||
|
||||
carregarInventarioAdmin();
|
||||
|
||||
} else {
|
||||
System.out.println("Login inválido");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user