This repository was archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNPstar.java
More file actions
86 lines (62 loc) · 2.27 KB
/
Copy pathNPstar.java
File metadata and controls
86 lines (62 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import java.util.Random;
public class NPstar {
static Random rand = new Random();
public static boolean randReward = true;
public static void setRand(boolean t)
{
randReward = t;
}
public static String NPcap(int starNum, double x, double y, int puid) {
int resource = 50;
int econ = 10;
int indus = 5;
int sci = 2;
int gate = 1;
int ship = 10;
int uid = starNum;
String name = NameGen.nextName();
return "\t{\"uid\": " + uid + ", \"name\": \"" + name +"\", \"x\": "+ x+", \"y\": "+y+", \"r\": "+resource+", \"g\": "+gate+", \"e\": "+econ+", \"i\": "+indus+", \"s\": "+sci+", \"st\": "+ship+", \"puid\": "+puid+"},";
}
public static String NPclaimed(int starNum, double x, double y, int resource, int puid) {
int econ = 0;
int indus = 0;
int sci = 0;
int ship = 10;
int gate = 0;
int uid = starNum;
String name = NameGen.nextName();
return "\t{\"uid\": " + uid + ", \"name\": \"" + name +"\", \"x\": "+ x+", \"y\": "+y+", \"r\": "+resource+", \"g\": "+gate+", \"e\": "+econ+", \"i\": "+indus+", \"s\": "+sci+", \"st\": "+ship+", \"puid\": "+puid+"},";
}
public static String NPNotclaimed(int starNum, double x, double y, int resource) {
int econ = 0;
int indus = 0;
int sci = 0;
int ship = 0;
int gate = 0;
if(randReward) {
int num = rand.nextInt(20);
switch (num) {
case 1:
econ = 5;
break;
case 2:
indus = 2;
break;
case 3:
sci = 1;
break;
case 4:
ship = rand.nextInt(15);
break;
case 5:
gate = 1;
break;
default:
break;
}
}
int uid = starNum;
String name = NameGen.nextName();
return "\t{\"uid\": " + uid + ", \"name\": \"" + name +"\", \"x\": "+ x+", \"y\": "+y+", \"r\": "+resource+", \"g\": "+gate+", \"e\": "+econ+", \"i\": "+indus+", \"s\": "+sci+", \"st\": "+ship+"},";
}
}