-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
175 lines (169 loc) · 7.81 KB
/
Main.java
File metadata and controls
175 lines (169 loc) · 7.81 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import java.util.HashMap;
import MainBranch.Database;
import Packages.CoreTypes.EntityMechanics.LancerCharacter;
import Packages.CoreTypes.EntityMechanics.License;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.Mech;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.mech.Mount;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.mech.Equipment.Verified.equipment.systemBase.MechSystem;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.mech.Frame.frameBase.FrameEnum;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.pilot.Loadout.Loadout;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.pilot.Loadout.loadout.Verified.pilotEquipment.PilotGear;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.pilot.Loadout.loadout.Verified.pilotEquipment.PilotWeapon;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.pilot.SkillTriggersList.SkillTriggersList;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.pilot.SkillTriggersList.skillTriggersList.Skill;
import Packages.CoreTypes.EntityMechanics.EntityTypes.damageable.pilot.Talent.Talent;
/**
* This program is intended to simulate one (or more) characters within the
* tabletop roleplaying game Lancer.
* A helper site for this game, COMP/CON, which allows one to reference many of
* the game's items and equipment, is available at https://compcon.app/
* Reference pages for the game, including the full core rulebook, are available
* at https://lancer-rules.carrd.co/ and
* https://massif-press.itch.io/corebook-pdf-free
* A Lancer character consists of a pilot and (optionally) their mech. Thus, I
* have constructed a LancerCharacter class as well as Pilot and Mech
* classes which it utilizes.
*
* Some terms:
* - A "frame" is a template from which mechanized chassis (mechs) can be
* created. For example, the GMS Everest is a frame. It can be thought of
* as a species; all Everest mechs may not be exactly alike, but they are
* all hewn from the same original statblock of the GMS Everest frame.
* - A "mech" is an instance of that species; every mech is a copy of some
* original frame which is then modified by its pilot's stats and
* abilities and other such things.
*
* Mechs are able to be modified in several key ways:
* - They are affected by their pilot's stats (their "mech stats" and their
* "grit").
* - They are affected by special abilities called "core bonuses" and "talents"
* belonging to their pilot.
* - They can be given equipment, such as weapons and systems, which change
* their stats or give them access to new abilities.
*
* A Mech is an empty shell which does not itself have any stats, so I have
* created Frame classes for each different possible frame and I pass them
* to a Mech object to create it.
*
* =============================================================================
*
* All methods that are not basic accessors or basic mutators (have names of the
* form get[Property]() or set[Property]()) have a Javadoc comment. Any
* set[Property]() methods within this code have a Javadoc comment if one of
* the following conditions is met:
* - For properties of a primitive type (such as int), the property must be
* governed by a rule that is not as simple as a single bound (i.e.
* "[Property] cannot be < 0").
* - For properties of type String specifically, the property must be
* governed by a rule that is not as simple as '[Property] cannot
* be null or ""'.
* - For properties of type Array or any other class (other than String),
* all set[Property]() methods have a Javadoc comment.
*/
/**
* Represents absolutely nothing. Contains the main() method for the project.
* Doesn't really do anything else.
*
* Cannot be instantiated.
*
* Used for its main() method only.
*
* Safety: N/A because this class cannot be instantiated.
*/
public final class Main {
// prevent user from instantiating
private Main() {}
public static void main(String[] args) {
LancerCharacter myCharacter;
HashMap<String, Object> mechProperties;
HashMap<String, Object> pilotProperties;
Database.initialize();
// compile a character
myCharacter = new LancerCharacter("Coral Nolan",
"Apocalypse", new Mech("Wraith",
FrameEnum.SWALLOWTAIL_RANGER)
);
mechProperties = myCharacter.getMechProperties();
mechProperties.put("mounts", new Mount[] {
new Mount(
Database.getMountType("Aux"),
Database.getWeapon("Slag Cannon")
),
new Mount(
Database.getMountType("Aux"),
Database.getWeapon("Vulture DMR"), null,
"Overpower Caliber"
)
});
mechProperties.put("systems", new MechSystem[] {
Database.getMechSystem("ms_pattern_a_smoke_charges"),
Database.getMechSystem("ms_seismic_pulse"),
Database.getMechSystem("ms_high_stress_mag_clamps"),
Database.getMechSystem("ms_athena_class_nhp"),
Database.getMechSystem("ms_markerlight"),
Database.getMechSystem("ms_immolate"),
Database.getMechSystem("ms_tear_firmament")
});
myCharacter.setMechProperties(mechProperties);
pilotProperties = myCharacter.getPilotProperties();
pilotProperties.put("player", "Luna");
pilotProperties.put(
"background", "sample background text here"
);
pilotProperties.put(
"biography", "sample biography text here"
);
pilotProperties.put(
"appearance", "sample appearance description here"
);
pilotProperties.put(
"playerNotes", "sample player notes here"
);
pilotProperties.put("skills", new SkillTriggersList(
new Skill[] {
new Skill("Apply Fists to Faces",
2),
new Skill("Assault", 2),
new Skill("Blow Something Up", 2),
new Skill("Survive", 2)
}
));
pilotProperties.put("loadout", new Loadout());
pilotProperties.put("licenseLevel", 9);
pilotProperties.put("licenseList", new License[] {
new License("Swallowtail", 3),
new License("Death's Head", 3),
new License("Kobold", 3),
new License("Lich", 1)
});
pilotProperties.put("mechSkills", new int[] {4, 0, 5, 2});
pilotProperties.put("coreBonuses", new String[] {
"Neurolink Targeting",
"Overpower Caliber"
});
pilotProperties.put("talents", new Talent[] {
new Talent(Database.getTalent("t_tactician"),
3),
new Talent(Database.getTalent("t_siege_specialist"),
3),
new Talent(Database.getTalent("t_spotter"), 2),
new Talent(Database.getTalent("t_walking_armory"),
2),
new Talent(Database.getTalent("t_leader"), 2)
});
pilotProperties.put("loadout", new Loadout(
Database.getPilotArmor("pg_mobility_hardsuit"),
new PilotWeapon[] {
Database.getPilotWeapon("pg_heavy_signature"),
Database.getPilotWeapon("pg_archaic_melee")
}, new PilotGear[] {
Database.getPilotGear("pg_wilderness_survival_kit"),
Database.getPilotGear("pg_flexsuit"),
Database.getPilotGear("pg_personal_drone")
}
));
myCharacter.setPilotProperties(pilotProperties);
System.out.print(myCharacter.generateStatblock(
"mech build"));
}
}