Skip to content

Commit

Permalink
Got to MVP state
Browse files Browse the repository at this point in the history
  • Loading branch information
grumpy-lions committed Jan 6, 2024
1 parent 2c0e345 commit f87067d
Show file tree
Hide file tree
Showing 40 changed files with 2,910 additions and 354 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,5 @@ MigrationBackup/
FodyWeavers.xsd
*.pptx
/DDPlayerEngine/Data/CharacterExporter.cs
/DDPlayerEngine/Resources
/DDPlayerEngine/Cipher.cs
6 changes: 6 additions & 0 deletions DDPlayerEngine/App.config

Large diffs are not rendered by default.

259 changes: 180 additions & 79 deletions DDPlayerEngine/Custom Elements/BackgroundCustomization.Designer.cs

Large diffs are not rendered by default.

72 changes: 64 additions & 8 deletions DDPlayerEngine/Custom Elements/BackgroundCustomization.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,77 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using PlayerEngine.Data;

namespace PlayerEngine.Custom_Elements {
public partial class BackgroundCustomization : UserControl {
public BackgroundCustomization() {
public BackgroundCustomization(Background Target) {
InitializeComponent();
foreach (Control c in Controls)
c.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Regular);
Equipment.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Regular);

label9.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
label10.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
label4.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
label1.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
label3.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
label2.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);

PersonalityBox.Items.Clear();
IdealBox.Items.Clear();
BondBox.Items.Clear();
FlawBox.Items.Clear();

PersonalityBox.Items.AddRange(Target.Personality);
IdealBox.Items.AddRange(Target.Ideals);
BondBox.Items.AddRange(Target.Bonds);
FlawBox.Items.AddRange(Target.Flaws);

if (Target.Skills == null || Target.Skills.Length == 0) {
Skills.Controls.Add(new Label() { Text = "None", Size = new System.Drawing.Size(302, 21) });
} else {
foreach (var t in Target.Skills) {
if (t.Contains("Choose")) {
Skills.Controls.Add(new ComboBox() { Size = new System.Drawing.Size(302, 21) });
((ComboBox)Skills.Controls[Skills.Controls.Count - 1]).Items.AddRange(RuntimeSettings.EngineData.SKILLS);
} else {
Skills.Controls.Add(new Label() { Text = t, Size = new System.Drawing.Size(302, 21) });
}
}
}

if (Target.Languages == null || Target.Languages.Length == 0) {
LanguageBox1.Controls.Add(new Label() { Text = "None", Size = new System.Drawing.Size(302, 21) });
} else {
foreach (var t in Target.Languages) {
if (t.Contains("Choose")) {
LanguageBox1.Controls.Add(new ComboBox() { Size = new System.Drawing.Size(302, 21) });
((ComboBox)LanguageBox1.Controls[LanguageBox1.Controls.Count - 1]).Items.AddRange(RuntimeSettings.EngineData.LANGUAGES);
} else {
LanguageBox1.Controls.Add(new Label() { Text = t, Size = new System.Drawing.Size(302, 21) });
}
}
}

if (Target.Tools == null || Target.Tools.Length == 0) {
ToolBox1.Controls.Add(new Label() { Text = "None", Size = new System.Drawing.Size(302, 21) });
} else {
foreach(var t in Target.Tools) {
if (t.Contains("Choose")) {
ToolBox1.Controls.Add(new ComboBox() { Size = new System.Drawing.Size(302, 21) });
((ComboBox)ToolBox1.Controls[ToolBox1.Controls.Count - 1]).Items.AddRange(RuntimeSettings.EngineData.ARTISAN_TOOLS);
} else {
ToolBox1.Controls.Add(new Label() { Text = t, Size = new System.Drawing.Size(302, 21) });
}
}
}

foreach(string s in Target.Items) {
Equipment.Text += s + ", ";
}
Equipment.Text = Equipment.Text.Trim( ' ', ',');

}
}
Expand Down
4 changes: 4 additions & 0 deletions DDPlayerEngine/Custom Elements/Class Options/Bard.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions DDPlayerEngine/Custom Elements/Class Options/Bard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace PlayerEngine.Custom_Elements.Class_Options {
public partial class Bard : UserControl {

public Bard() {
InitializeComponent();
foreach (Control c in Controls)
Expand All @@ -15,6 +16,11 @@ public Bard() {
Item1.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
Item2.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);
Item3.Font = new Font(RuntimeSettings.DefaultFont, 12, FontStyle.Bold);

}

private void button1_Click(object sender, System.EventArgs e) {
// new SpellList(PC).ShowDialog();
}
}
}
12 changes: 6 additions & 6 deletions DDPlayerEngine/Custom Elements/DataDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ private void DataDisplay_MouseClick(object sender, MouseEventArgs e) {
case DisplaySetting.Background:
foreach (Book b in RuntimeSettings.EngineData.Books) {
foreach (Background bg in b.Backgrounds) {
if (bg.FindData(text) != "")
MessageBox.Show(bg.FindData(text), Application.ProductName + " Help");
//if (bg.FindData(text) != "")
//MessageBox.Show(bg.FindData(text), Application.ProductName + " Help");
}
}
break;
case DisplaySetting.Lineage:
foreach (Book b in RuntimeSettings.EngineData.Books) {
foreach (Lineage r in b.Lineages) {
if (r.FindData(text) != "")
MessageBox.Show(r.FindData(text), Application.ProductName + " Help");
//if (r.FindData(text) != "")
//MessageBox.Show(r.FindData(text), Application.ProductName + " Help");
}
}
break;
case DisplaySetting.Class:
foreach (Book b in RuntimeSettings.EngineData.Books) {
foreach (Class cl in b.Classes) {
if (cl.FindData(text) != "")
MessageBox.Show(cl.FindData(text), Application.ProductName + " Help");
//if (cl.FindData(text) != "")
//MessageBox.Show(cl.FindData(text), Application.ProductName + " Help");
}
}
break;
Expand Down
132 changes: 1 addition & 131 deletions DDPlayerEngine/Custom Elements/Play Engine Elements/ActionMenu.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using PlayerEngine.Data;
Expand All @@ -16,139 +10,15 @@ public partial class ActionMenu : UserControl {
public ActionMenu(Character PC) {
InitializeComponent();

PC.Inventory.Add(new Item() {
Name = "Dagger",
DiceForDamage = 1,
DiceToRoll = HitDie.d4,
Price = 2,
DamageType = DamageType.Slashing,
Equipped = true,
Type = Item.ItemType.SimpleMeleeWeapon,
WeaponProperties = Item.WeaponProps.Finesse | Item.WeaponProps.Light | Item.WeaponProps.Thrown,
Weight = 1
});
PC.Inventory.Add(new Item() {
Name = "Dagger",
DiceForDamage = 1,
DiceToRoll = HitDie.d4,
Price = 2,
DamageType = DamageType.Slashing,
Equipped = true,
Type = Item.ItemType.SimpleMeleeWeapon,
WeaponProperties = Item.WeaponProps.Finesse | Item.WeaponProps.Light | Item.WeaponProps.Thrown,
Weight = 1
});
PC.Inventory.Add(new Item() {
Name = "Dagger",
DiceForDamage = 1,
DiceToRoll = HitDie.d4,
Price = 2,
DamageType = DamageType.Slashing,
Equipped = true,
Type = Item.ItemType.SimpleMeleeWeapon,
WeaponProperties = Item.WeaponProps.Finesse | Item.WeaponProps.Light | Item.WeaponProps.Thrown,
Weight = 1
});
PC.Inventory.Add(new Item() {
Name = "Dagger",
DiceForDamage = 1,
DiceToRoll = HitDie.d4,
Price = 2,
DamageType = DamageType.Slashing,
Equipped = true,
Type = Item.ItemType.SimpleMeleeWeapon,
WeaponProperties = Item.WeaponProps.Finesse | Item.WeaponProps.Light | Item.WeaponProps.Thrown,
Weight = 1
});
PC.Inventory.Add(new Item() {
Name = "Dagger",
DiceForDamage = 1,
DiceToRoll = HitDie.d4,
Price = 2,
DamageType = DamageType.Slashing,
Equipped = true,
Type = Item.ItemType.MartialRangeWeapon,
WeaponProperties = Item.WeaponProps.Finesse | Item.WeaponProps.Light | Item.WeaponProps.Thrown,
Weight = 1
});

foreach (var item in PC.Inventory.Where(item => item.IsWeapon))
Attacks.Controls.Add(new WeaponPreview(item, PC));

PC.SpellsKnown.Add(new Spell() {
Name = "Dissonant Whispers",
SchoolOfMagic = Spell.School.Enchantment,
Level = Spell.SpellLevel.First,
CastingTime = "1 Action",
Range = "60 ft",
Duration = "Instanaeous",
IsRitual = false,
RequiresConcentration = false,
SpellActions = Spell.SpellComponents.Verbal,
NumDice = 3,
DamageDie = HitDie.d6,
DamageType = DamageType.Psychic
});
PC.SpellsKnown.Add(new Spell() {
Name = "Mage Hand",
SchoolOfMagic = Spell.School.Conjuration,
Level = Spell.SpellLevel.Cantrip,
CastingTime = "1 Action",
Range = "30 ft",
Duration = "1 minute",
IsRitual = false,
RequiresConcentration = false,
SpellActions = Spell.SpellComponents.Verbal | Spell.SpellComponents.Somatic,
});
PC.SpellsKnown.Add(new Spell() {
Name = "Mage Hand",
SchoolOfMagic = Spell.School.Conjuration,
Level = Spell.SpellLevel.Cantrip,
CastingTime = "1 Action",
Range = "30 ft",
Duration = "1 minute",
IsRitual = false,
RequiresConcentration = false,
SpellActions = Spell.SpellComponents.Verbal | Spell.SpellComponents.Somatic,
});
PC.SpellsKnown.Add(new Spell() {
Name = "Mage Hand",
SchoolOfMagic = Spell.School.Conjuration,
Level = Spell.SpellLevel.Cantrip,
CastingTime = "1 Action",
Range = "30 ft",
Duration = "1 minute",
IsRitual = false,
RequiresConcentration = false,
SpellActions = Spell.SpellComponents.Verbal | Spell.SpellComponents.Somatic,
});

Spells.Visible = PC.IsMagicUser;
SpellSummary.Text = $"Spell Ability: {PC.Class[0].CastingAbility}, Spell Attack Bonus: {PC.SpellBonus.ParseAsString()}, Save DC: {PC.SpellDC}";
foreach (var item in PC.SpellsKnown)
Spells.Controls.Add(new WeaponPreview(item, PC));


PC.Lineage.LineageTraits = new List<LineageTrait>() {
new LineageTrait() {
Name = "",
Description = "",
TraitData = new Spell() {
Name = "Testing123",
SchoolOfMagic = Spell.School.Conjuration,
Level = Spell.SpellLevel.Cantrip,
CastingTime = "1 Action",
Range = "30 ft",
Duration = "1 minute",
IsRitual = false,
RequiresConcentration = false,
SpellActions = Spell.SpellComponents.Verbal | Spell.SpellComponents.Somatic,
},
Type = ITrait.TraitType.Spell
},
};


ITrait[] ITraits = null;
try {
ITraits = PC.Lineage.LineageTraits.AsQueryable<ITrait>().Union(PC.Class[0].Abilities.AsQueryable<ITrait>()).ToArray();
Expand Down
Loading

0 comments on commit f87067d

Please sign in to comment.