Skip to content

Commit

Permalink
Modified crew assignments; Ships can have crew manifests of player ch…
Browse files Browse the repository at this point in the history
…aracters
  • Loading branch information
qkmaxware committed Oct 6, 2021
1 parent e890d7c commit 76e7f98
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 39 deletions.
12 changes: 11 additions & 1 deletion TrekSharp.AdventureTools/Pages/ViewCharacterSheet.razor
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@
</div>
<div class="w3-row">
<div class="w3-quarter text-secondary typeface">ASSIGNMENT:</div>
<div class="w3-threequarter w3-border-bottom">@Player.Assignment</div>
<div class="w3-threequarter w3-border-bottom">
@Player.Assignment
@if (!string.IsNullOrEmpty(Player.VesselAssignedTo)) {
var ship = Data.Ships.Where(ship => Player.VesselAssignedTo == ship.Name).FirstOrDefault();
if (ship != null) {
<span>
aboard <a style="text-decoration: none; cursor: pointer;" class="text-secondary" @onclick:preventDefault="true" @onclick:stopPropagation="true" @onclick=@(() => NavigateToPlayerVessel(ship))>@Player.VesselAssignedTo</a>
</span>
}
}
</div>
</div>
<div class="w3-row">
<div class="w3-quarter text-secondary typeface">ENVIRONMENT:</div>
Expand Down
14 changes: 14 additions & 0 deletions TrekSharp.AdventureTools/Pages/ViewCharacterSupportSheet.razor
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@
<div class="w3-quarter text-secondary typeface">SPECIES:</div>
<div class="w3-threequarter w3-border-bottom">@Player.Species.ToFullString()</div>
</div>
<div class="w3-row">
<div class="w3-quarter text-secondary typeface">ASSIGNMENT:</div>
<div class="w3-threequarter w3-border-bottom">
@Player.Assignment
@if (!string.IsNullOrEmpty(Player.VesselAssignedTo)) {
var ship = Data.Ships.Where(ship => Player.VesselAssignedTo == ship.Name).FirstOrDefault();
if (ship != null) {
<span>
aboard <a style="text-decoration: none; cursor: pointer;" class="text-secondary" @onclick:preventDefault="true" @onclick:stopPropagation="true" @onclick=@(() => NavigateToPlayerVessel(ship))>@Player.VesselAssignedTo</a>
</span>
}
}
</div>
</div>
</div>
</div>

Expand Down
16 changes: 16 additions & 0 deletions TrekSharp.AdventureTools/Pages/ViewShip.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@

@if (HasShip) {
<VesselEditorPopupTab Ship=@Ship OnDelete=onConfirmDelete OnChange=StateHasChanged></VesselEditorPopupTab>

<PopoutTab Name="Crew Manifest" TabPosition=168>
<div class="lcars">
<div class="typeface text-secondary w3-border-bottom w3-large">
<b>Crew Manifest</b>
</div>
@foreach (var crew in Data.Party.Cast<Character>().Concat(Data.Supports.Cast<Character>()).Where(c => Ship.Name == c.VesselAssignedTo).OrderByDescending(c => c.Rank.Order)) {
<div class="w3-bar-block w3-padding">
<button class="w3-bar-item" style="font-size: medium;" @onclick=@(() => { if (crew is PlayerCharacter pc) { NavigateToPlayerCharacter(pc); } else if (crew is SupportCharacter npc) { NaviateToSupportCharacter(npc); } })>
@crew.Assignment @crew.Rank @crew.Name
</button>
</div>
}
</div>
</PopoutTab>

<PrintNotification/>

<div id="character-sheet" class="lcars">
Expand Down
75 changes: 75 additions & 0 deletions TrekSharp.AdventureTools/Shared/AssignmentEditor.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@inject AppData Data;

<Popup @ref="popup">
<div class="w3-panel typeface">
Characters can be assigned to different roles onboard various vessels throughout starfleet. Use this dialog to change a character's assignment or assigned vessel among the various player vessels.
</div>
<div class="w3-padding" style="max-height: 50vh; overflow: auto;">
<label>Role</label>
<select @bind="nextAssignment" class="w3-black w3-input lcars-border-primary">
@foreach (var group in Assignments.EnumerateByDepartment()) {
<optgroup label=@group.Key>
@foreach (var assignment in group.Value) {
<option>@assignment.Name</option>
}
</optgroup>
}
</select>
<p class="w3-container">
@Assignments.EnumerateAll().Where(a => a.Name == nextAssignment).FirstOrDefault()?.Description
</p>
<label>Onboard</label>
<select @bind="assignmentVessel" class="w3-black w3-input lcars-border-primary">
<option value="null" selected>no vessel</option>
@foreach (var vessel in Data.Ships) {
<option>@vessel.Name</option>
}
</select>
</div>
<div class="w3-row">
<div class="w3-col s6 w3-left-align">
<button class="w3-red" @onclick=@(() => Close())>
Cancel
</button>
</div>
<div class="w3-col s6 w3-right-align">
<button class="w3-green" @onclick=@(() => Save())>
Change Assignment
</button>
</div>
</div>
</Popup>

@code {
Popup popup;
private Character Character {get; set;}
[Parameter] public Action OnSave {get; set;}

private string nextAssignment;
private string assignmentVessel;

public void Open(Character character) {
this.Character = character;
nextAssignment = character.Assignment;
assignmentVessel = character.VesselAssignedTo;
popup.Open();
StateHasChanged();
}

public void Close() {
popup.Close();
StateHasChanged();
}

private void Save() {
if (Character != null && !string.IsNullOrEmpty(nextAssignment)) {
Character.Assignment = nextAssignment;
if (assignmentVessel == "null") {
assignmentVessel = null;
}
Character.VesselAssignedTo = assignmentVessel;
Close();
OnSave?.Invoke();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<div class="w3-bar-block w3-padding">
<button class="w3-bar-item w3-margin-bottom" style="font-size: medium;" @onclick=AddMilestone>+ Milestone</button>
<button class="w3-bar-item w3-margin-bottom" style="font-size: medium;" @onclick=Promote>+ Promotion</button>
<button class="w3-bar-item w3-margin-bottom" style="font-size: medium;" @onclick=ChangeAssignment>Change Assignment</button>

@if (Character is SupportCharacter sc) {
<button class="w3-bar-item w3-margin-bottom" style="font-size: medium;" @onclick=assumingDirectControl>Reintroduce</button>
@if (sc.IsPlayerEquivalent) {
Expand All @@ -30,6 +32,7 @@

<MilestoneEditor @ref=milestones OnSave=changesMade></MilestoneEditor>
<PromotionEditor @ref=promotions OnSave=changesMade></PromotionEditor>
<AssignmentEditor @ref=assignment OnSave=changesMade></AssignmentEditor>
<SupportIntroductionPopup @ref=introduce OnSave=changesMade></SupportIntroductionPopup>

<ConfirmationDialog @ref="confirm">
Expand Down Expand Up @@ -60,6 +63,12 @@
milestones.Open(this.Character);
}

private AssignmentEditor assignment;
private void ChangeAssignment() {
if (this.HasCharacter)
assignment.Open(this.Character);
}

private PromotionEditor promotions;
private void Promote() {
if (HasCharacter) {
Expand Down
39 changes: 1 addition & 38 deletions TrekSharp.AdventureTools/Shared/LifepathWizard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -1167,45 +1167,8 @@
}
}
}
private List<KeyValuePair<string,string>> Assignments = new List<KeyValuePair<string,string>> {
// Command Positions
new KeyValuePair<string, string>("Commanding Officer", "The captain. Even if the commanding officer does not hold the rank of captain, they will be referred to as captain by their subordinates. Every ship must have a commanding officer."),
new KeyValuePair<string, string>("Executive Officer", "Second-in-Command. The executive officer is the captain’s chief advisor, and takes command in situations where the captain is unable to. If a ship does not have a dedicated executive officer, an officer in another role should be noted as second-in-command, but they will not gain the benefits of this role."),
new KeyValuePair<string, string>("Second Officer", "At times the XO must assume command of a Starship or base, when this happens the XO needs the help of another officer to assume his/her role as XO. The second officer is not a stand alone position, but a role given to the highest ranked and trusted officer aboard. When required the Second Officer will assume the role of XO, or if needed CO, and performs their duties as listed, for as long as required."),
new KeyValuePair<string, string>("Intelligence Officer", "On all starships and starbases, a single individual amongst the command staff is designated the Intelligence Officer for that ship/base. Responsible for liaising with Starfleet Intelligence on a daily basis, the Intelligence Officer reads numerous classified reports as forwarded to them by SFI, and makes the decision on which reports are relevant to the crew to designate the command staff as having the need-to-know in order to view them. They are responsible for mission briefings involving information provided by Starfleet Intelligence, and act as a conduit from the command staff to SFI. The role of Intelligence Officer is considered an additional duty, in addition to a standard duty assignment."),
new KeyValuePair<string, string>("Diplomatic Officer", "The Diplomatic Officer of each vessel/base must be familiar with a variety of areas: history, religion, politics, economics, and military, and understand how they affect potential threats. A wide range of operations can occur in response to these areas and threats. These operations occur within three general states of being: peacetime competition, conflict and war. This position is held jointly with another aboard the ship, and is considered a secondary duty."),
new KeyValuePair<string, string>("Yeoman", "The Captain's Yeoman is for Petty Officers who wish to continue as administrators. It is technically a non-Mate position. Use of this position is completely at the discretion of the Commanding Officer. File work, and sensitive message transport are but two examples of the Yeoman's possible duties. The Yeoman assists the CO in day-to-day duties that the CO would otherwise not have the time to do."),

// Conn Positions
new KeyValuePair<string, string>("Flight Control Officer", "Not a typical senior staff role, some captains, particularly those operating in uncharted space, choose the most senior helmsman or flight control officer to serve as senior staff as well."),
new KeyValuePair<string, string>("Shuttlebay Manager", "The Shuttlebay Manager is responsible for pre and post flight checks of all support craft involved in away missions."),
new KeyValuePair<string, string>("Support Craft Pilot", "All small spacecrafts aboard a starship, starbase or a facility (Shuttles, Runabouts, Transports, Captain's yacht, Patrol Vessels etc.) but excluding fighters are flown by Support Craft Pilots. This is often the proving ground for pilots until they earn a berth on a starship as a Flight Control Officer."),

// Security Positions
new KeyValuePair<string, string>("Chief of Security", "The chief of security oversees the ship’s security department, and is responsible for ensuring the safety of the ship and crew during missions, for the investigation of disciplinary and criminal matters, and for overseeing the protection of important persons aboard the ship. On many ships, the chief of security operates from the Tactical station on the bridge."),
new KeyValuePair<string, string>("Security Officer", "There are several Security Officers aboard each vessel. They are assigned to their duties by the Chief of Security and mostly guard sensitive areas, protect people, patrol, and handle other threats to the Federation."),
new KeyValuePair<string, string>("Tactical Officer", "The Tactical Officers are the vessels gunmen. Very often Tactical Officers are also trained in ground combat and small unit tactics."),
new KeyValuePair<string, string>("Master-at-Arms", "The Master-at-Arms trains and supervises Security crewmen in departmental operations, repairs, and protocols; maintains duty assignments for all Security personnel; supervises weapons locker access and firearm deployment; and is qualified to temporarily act as Chief of Security if so ordered. The Master-at-Arms reports to the Chief of Security."),

// Engineering Positions
new KeyValuePair<string, string>("Operations Manager", "The operations manager manages and oversees all technical operations aboard or involving the ship, normally from the Operations station on the Bridge, or in conjunction with the chief engineer (on smaller ships, one officer may fill both roles). This often entails taking on the duties of a science officer, if there is no dedicated science officer in the senior staff."),
new KeyValuePair<string, string>("Chief Engineer", "The chief engineer is responsible for ensuring that the ship remains operational and functional, and commands the engineering department aboard the ship."),

// Science Positions
new KeyValuePair<string, string>("Science Officer", "A science officer is responsible for advising the commanding officer of all matters scientific, providing hypotheses in matters concerning the unknown. Not all ships have a dedicated science officer within the senior staff, often having the operations manager take on these duties."),
new KeyValuePair<string, string>("Astrometrics Officer", "Specialized Science Officer in charge of the Astrometrics Section. This role entails the maintaining, correction and production of new stellar maps. Has close ties with the the Physicist and Stellar Cartographers."),
private List<KeyValuePair<string,string>> Assignments = TrekSharp.Assignments.EnumerateAll().Select(a => new KeyValuePair<string,string>(a.Name, a.Description)).ToList();

// Medical Positions
new KeyValuePair<string, string>("Ship's Counselor", "On larger ships and starbases, it’s common to have personnel dedicated to the mental soak. Some captains regard them as valuable advisors, as their training covers both culture and psychology, making them exceptionally good at reading the moods and intentions of others."),
new KeyValuePair<string, string>("Morale Officer", "Responsible for keeping the morale of the crew high. Delivers regular reports on morale to the Executive Officer. The Morale Officer plans activities that will keep the crew's morale and demeanor up. If any crew member is having problems, the Morale Officer can assist that crew member."),
new KeyValuePair<string, string>("Chief Medical Officer", "The chief medical officer, also known as ship’s surgeon, or ship’s doctor, is responsible for the health and wellbeing of the crew and other persons aboard the ship, and leads the ship’s medical department. A chief medical officer can order, and countermand the orders of, senior officers where matters of that officer’s health are concerned."),
new KeyValuePair<string, string>("Surgeon", "Doctors of the federation still specialize and mostly, the Chief Medical Officer position is usually held by a general practitioner. While simple surgery is part of their training, some doctors on larger vessels and starbases prefer to have a surgeon on staff."),
new KeyValuePair<string, string>("Head Nurse", "The Head Nurse oversees all the Nurses currently aboard, ensuring they are assigned to tasks and working as required in their area. Additionally the Head nurse performs the normal duties of the nurse, assisting the Duty Medical Officer in sickbay."),
new KeyValuePair<string, string>("Nurse", "Nurses are trained in basic medical care, and are capable of dealing with less serious medical cases. In more serious matters the nurse assists the medical officer in the examination and administration of medical care, be this injecting required drugs, or simply assuring the injured party that they will be ok."),

// Communications Positions
new KeyValuePair<string, string>("Communications Officer", "More common in the earlier days of Starfleet, dedicated communications officers are typically skilled in linguistics and cryptography, and aided with advanced translation and decryption technologies, and thus valuable during encounters with both new cultures, and with hostile ones."),
};
#endregion

}
Loading

0 comments on commit 76e7f98

Please sign in to comment.