Skip to content

Commit

Permalink
Added more NPC types; Can copy NPC stats when creating new types
Browse files Browse the repository at this point in the history
  • Loading branch information
qkmaxware committed May 16, 2021
1 parent c9901be commit d3098e8
Show file tree
Hide file tree
Showing 5 changed files with 584 additions and 0 deletions.
50 changes: 50 additions & 0 deletions TrekSharp.AdventureTools/Pages/CreateNpcType.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,68 @@
@inherits Page

<LCARS Title="NEW NPC TYPE">
<div class="w3-padding">
<button @onclick=copy>Copy From Existing</button>
</div>
<NpcTypeEditor Character=character AllSpeciesOptions=AllSpeciesOptions></NpcTypeEditor>
<div class="w3-padding w3-right-align">
<button class="w3-blue" @onclick=save>Save</button>
</div>
</LCARS>

<AssetAddList
@ref=CopyDialog
Title="Copy NPC"
Store=ExistingCharacters
OnAdd=onCopyNpc
>
</AssetAddList>

@code {
private RulebookContainer books = new RulebookContainer();
private IEnumerable<Species> AllSpeciesOptions => books.AllRulebooks.SelectMany(book => book.Value.Species);

private AssetAddList<NpcCharacter> CopyDialog;
private List<NpcCharacter> ExistingCharacters;

protected override void OnInitialized() {
books.AddRulebook("Homebrew", new UserCreatedSpeciesRulebook(Data));
ExistingCharacters = books.AllRulebooks.SelectMany(book => book.Value.NpcCharacters).ToList();
}


private void copy() {
CopyDialog?.Open();
}
private void onCopyNpc(NpcCharacter toCopy) {
character.Name = toCopy.Name;
character.BaseStress = toCopy.BaseStress;
character.Resistance = toCopy.Resistance;
character.Species = new Species {
Name = toCopy.Species.Name,
};
character.Values = new List<string>(toCopy.Values);
character.Focuses = new List<string>(toCopy.Focuses);
character.Attributes = new Attributes {
Control = toCopy.Attributes.Control,
Fitness = toCopy.Attributes.Fitness,
Presence = toCopy.Attributes.Presence,
Daring = toCopy.Attributes.Daring,
Insight = toCopy.Attributes.Insight,
Reason = toCopy.Attributes.Reason,
};
character.Disciplines = new Disciplines {
Command = toCopy.Disciplines.Command,
Security = toCopy.Disciplines.Security,
Science = toCopy.Disciplines.Science,
Conn = toCopy.Disciplines.Conn,
Engineering = toCopy.Disciplines.Engineering,
Medicine = toCopy.Disciplines.Medicine,
};
character.SpecialRules = new List<string>(toCopy.SpecialRules);
character.Equipment = new List<Item>(toCopy.Equipment);

StateHasChanged();
}

private NpcCharacter character = new NpcCharacter() {
Expand Down
5 changes: 5 additions & 0 deletions TrekSharp/src/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public float PlayerDifficulty {
public bool IsMinor => Disciplines.Enumerate().Select(x => x.Value).Sum() <= 8;
public bool IsNotable => !IsMinor && !IsMajor;
public bool IsMajor => Disciplines.Enumerate().Select(x => x.Value).Sum() > 16;

}

public class Character {
Expand Down Expand Up @@ -60,6 +61,10 @@ public void ApplyDamage(int damage) {
}
}
}

public override string ToString() {
return this.Name;
}
}

public class PlayableCharacter : Character {
Expand Down
240 changes: 240 additions & 0 deletions TrekSharp/src/Rulebooks/CommandDivision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,246 @@ private CommandDivision() {}
"Independent Phaser Supply",
"Common prior to the 2270s, the ship’s phasers use an independent power supply, rather than drawing directly from the ship’s other power sources. Attacking with the ship’s phasers no longer has a Power Requirement. However, the ship may not spend additional Power to boost the effectiveness of an attack with the phasers."
)
},
NpcCharacters = new List<NpcCharacter> {
new NpcCharacter {
Name = "Human Diplomat",
BaseStress = 8,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {
"Peace can be attained through effort and compromise"
},
Focuses = new List<string> {
"Diplomacy",
"Politics",
"Research"
},
Attributes = new Attributes {
Control = 09,
Fitness = 07,
Presence = 11,
Daring = 08,
Insight = 10,
Reason = 09
},
Disciplines = new Disciplines {
Command = 03,
Security = 01,
Science = 02,
Conn = 01,
Engineering = 02,
Medicine = 00
},
SpecialRules = new List<string> {
"Defuse the Tension (Talent)"
},
Equipment = new List<Item> {
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
new NpcCharacter {
Name = "Human Attache",
BaseStress = 8,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {},
Focuses = new List<string> {},
Attributes = new Attributes {
Control = 09,
Fitness = 07,
Presence = 08,
Daring = 07,
Insight = 10,
Reason = 10
},
Disciplines = new Disciplines {
Command = 02,
Security = 01,
Science = 02,
Conn = 00,
Engineering = 01,
Medicine = 00
},
SpecialRules = new List<string> {
"Specialist Subject: An Attache may be given a specialty granting them a single focus."
},
Equipment = new List<Item> {
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
new NpcCharacter {
Name = "Human Negotiator",
BaseStress = 8,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {},
Focuses = new List<string> {},
Attributes = new Attributes {
Control = 08,
Fitness = 07,
Presence = 10,
Daring = 08,
Insight = 09,
Reason = 09
},
Disciplines = new Disciplines {
Command = 02,
Security = 01,
Science = 02,
Conn = 00,
Engineering = 01,
Medicine = 00
},
SpecialRules = new List<string> {
"Focused Training: Negotiators have a single focus even though they are minor NPCs."
},
Equipment = new List<Item> {
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
new NpcCharacter {
Name = "Human Pathfinder Specialist",
BaseStress = 9,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {
"The First to See Those Stars Up Close"
},
Focuses = new List<string> {
"Astronavigation",
"Helm Operations"
},
Attributes = new Attributes {
Control = 11,
Fitness = 08,
Presence = 07,
Daring = 10,
Insight = 08,
Reason = 10
},
Disciplines = new Disciplines {
Command = 02,
Security = 01,
Science = 02,
Conn = 03,
Engineering = 01,
Medicine = 01
},
SpecialRules = new List<string> {
"Find the Path: If the specialist buys additional d20 for Tasks to navigate or chart a dangerous region, they may re-roll a single d20. When performing an Extended Task the character gains scrutinize 2 when rolling Challenge Dice."
},
Equipment = new List<Item> {
new Item { Name = "Phaser Type 1", Size = ItemSize.OneHanded, DamageDice = 2, Qualities = new List<string>{ "Charge", "Hidden 1" } },
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
new NpcCharacter {
Name = "Human Academy Instructor",
BaseStress = 9,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {
"There's Nothing as Important as Shaping the Next Generation"
},
Focuses = new List<string> {
"Teaching",
},
Attributes = new Attributes {
Control = 09,
Fitness = 08,
Presence = 10,
Daring = 07,
Insight = 10,
Reason = 10
},
Disciplines = new Disciplines {
Command = 03,
Security = 01,
Science = 01,
Conn = 01,
Engineering = 01,
Medicine = 01
},
SpecialRules = new List<string> {
"Collaboration (Talent)",
"Teacher: Choose a Discipline other than Command and increase it by 1. Then select a single Focus to represent the subject taught at the Academy."
},
Equipment = new List<Item> {
new Item { Name = "Phaser Type 1", Size = ItemSize.OneHanded, DamageDice = 2, Qualities = new List<string>{ "Charge", "Hidden 1" } },
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
new NpcCharacter {
Name = "Human Academy Cadet",
BaseStress = 10,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {},
Focuses = new List<string> {},
Attributes = new Attributes {
Control = 09,
Fitness = 09,
Presence = 08,
Daring = 08,
Insight = 09,
Reason = 08
},
Disciplines = new Disciplines {
Command = 02,
Security = 01,
Science = 00,
Conn = 02,
Engineering = 01,
Medicine = 00
},
SpecialRules = new List<string> {
"Untapped Potential (Talent)"
},
Equipment = new List<Item> {
new Item { Name = "Phaser Type 1", Size = ItemSize.OneHanded, DamageDice = 2, Qualities = new List<string>{ "Charge", "Hidden 1" } },
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
new NpcCharacter {
Name = "Human JAG Officer",
BaseStress = 9,
Resistance = 0,
Species = new Species{ Name="Human" },
Values = new List<string> {
"Law is the Foundation Upon Which an Orderly Society is Built"
},
Focuses = new List<string> {
"Law",
"History",
"Rhetoric"
},
Attributes = new Attributes {
Control = 09,
Fitness = 07,
Presence = 10,
Daring = 08,
Insight = 09,
Reason = 11
},
Disciplines = new Disciplines {
Command = 03,
Security = 02,
Science = 02,
Conn = 01,
Engineering = 01,
Medicine = 01
},
SpecialRules = new List<string> {
"Jurisprudence: The JAC Officer is extremely well-versed in the theory and philosophy of law, and may re-roll one d20 on a Task that uses the character's Reason and their Law Focus.",
"Advisor (Talent)",
"Threatening 3"
},
Equipment = new List<Item> {
new Item { Name = "Phaser Type 1", Size = ItemSize.OneHanded, DamageDice = 2, Qualities = new List<string>{ "Charge", "Hidden 1" } },
new Item { Name = "Unarmed Strike",Size = ItemSize.OneHanded, DamageDice = 1, Qualities = new List<string>{ "Knockdown", "Non-lethal" } },
}
},
}
};
}
Expand Down
Loading

0 comments on commit d3098e8

Please sign in to comment.