diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..dfe0770
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e44dd1a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.vs/
+obj/
+bin/
diff --git a/App.config b/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Program.cs b/Program.cs
new file mode 100644
index 0000000..9ec7f33
--- /dev/null
+++ b/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace cdda_item_creator
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new spell_form());
+ }
+ }
+}
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..37d6588
--- /dev/null
+++ b/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("cdda-item-creator")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("cdda-item-creator")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("34eff2c2-0506-4d9c-8da1-3c467ca7b523")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Properties/DataSources/cdda_item_creator.spell.allowed_strings.datasource b/Properties/DataSources/cdda_item_creator.spell.allowed_strings.datasource
new file mode 100644
index 0000000..4c5df20
--- /dev/null
+++ b/Properties/DataSources/cdda_item_creator.spell.allowed_strings.datasource
@@ -0,0 +1,10 @@
+
+
+
+ cdda_item_creator.spell.allowed_strings, cdda-item-creator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
\ No newline at end of file
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..6cdd130
--- /dev/null
+++ b/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace cdda_item_creator.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cdda_item_creator.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..14e1076
--- /dev/null
+++ b/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace cdda_item_creator.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ff3c5a6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# cdda-item-creator
+ cdda item creator
diff --git a/cdda-item-creator.csproj b/cdda-item-creator.csproj
new file mode 100644
index 0000000..1266a86
--- /dev/null
+++ b/cdda-item-creator.csproj
@@ -0,0 +1,85 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {34EFF2C2-0506-4D9C-8DA1-3C467CA7B523}
+ WinExe
+ cdda_item_creator
+ cdda-item-creator
+ v4.7.2
+ 512
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ spell_form.cs
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ spell_form.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cdda-item-creator.sln b/cdda-item-creator.sln
new file mode 100644
index 0000000..9d4e8c7
--- /dev/null
+++ b/cdda-item-creator.sln
@@ -0,0 +1,30 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29509.3
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cdda-item-creator", "cdda-item-creator.csproj", "{34EFF2C2-0506-4D9C-8DA1-3C467CA7B523}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{021F3EFA-8074-426F-B55A-04FC144C420C}"
+ ProjectSection(SolutionItems) = preProject
+ spell_type.cs = spell_type.cs
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {34EFF2C2-0506-4D9C-8DA1-3C467CA7B523}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {34EFF2C2-0506-4D9C-8DA1-3C467CA7B523}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {34EFF2C2-0506-4D9C-8DA1-3C467CA7B523}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {34EFF2C2-0506-4D9C-8DA1-3C467CA7B523}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3DDB57A4-13E2-4325-9968-39C9BF0E482A}
+ EndGlobalSection
+EndGlobal
diff --git a/spell_form.Designer.cs b/spell_form.Designer.cs
new file mode 100644
index 0000000..9dc984e
--- /dev/null
+++ b/spell_form.Designer.cs
@@ -0,0 +1,179 @@
+namespace cdda_item_creator
+{
+ partial class spell_form
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.spell_name_textbox = new System.Windows.Forms.TextBox();
+ this.spell_description_textbox = new System.Windows.Forms.TextBox();
+ this.energy_type_combobox = new System.Windows.Forms.ComboBox();
+ this.name_label = new System.Windows.Forms.Label();
+ this.id_textbox = new System.Windows.Forms.TextBox();
+ this.id_label = new System.Windows.Forms.Label();
+ this.description_label = new System.Windows.Forms.Label();
+ this.energy_type_label = new System.Windows.Forms.Label();
+ this.allowedstringsBindingSource = new System.Windows.Forms.BindingSource(this.components);
+ this.allowedstringsBindingSource1 = new System.Windows.Forms.BindingSource(this.components);
+ this.button1 = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.allowedstringsBindingSource)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.allowedstringsBindingSource1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // spell_name_textbox
+ //
+ this.spell_name_textbox.Location = new System.Drawing.Point(12, 24);
+ this.spell_name_textbox.Name = "spell_name_textbox";
+ this.spell_name_textbox.Size = new System.Drawing.Size(100, 20);
+ this.spell_name_textbox.TabIndex = 0;
+ this.spell_name_textbox.TextChanged += new System.EventHandler(this.spell_name_textbox_TextChanged);
+ //
+ // spell_description_textbox
+ //
+ this.spell_description_textbox.Location = new System.Drawing.Point(12, 68);
+ this.spell_description_textbox.Multiline = true;
+ this.spell_description_textbox.Name = "spell_description_textbox";
+ this.spell_description_textbox.Size = new System.Drawing.Size(227, 56);
+ this.spell_description_textbox.TabIndex = 1;
+ //
+ // energy_type_combobox
+ //
+ this.energy_type_combobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.energy_type_combobox.Items.AddRange(new object[] {
+ "NONE",
+ "HP",
+ "MANA",
+ "STAMINA",
+ "BIONIC",
+ "FATGIUE"});
+ this.energy_type_combobox.Location = new System.Drawing.Point(12, 148);
+ this.energy_type_combobox.Name = "energy_type_combobox";
+ this.energy_type_combobox.Size = new System.Drawing.Size(70, 21);
+ this.energy_type_combobox.TabIndex = 0;
+ this.energy_type_combobox.SelectedIndexChanged += new System.EventHandler(this.energy_type_combobox_SelectedIndexChanged);
+ //
+ // name_label
+ //
+ this.name_label.AutoSize = true;
+ this.name_label.Location = new System.Drawing.Point(22, 8);
+ this.name_label.Name = "name_label";
+ this.name_label.Size = new System.Drawing.Size(35, 13);
+ this.name_label.TabIndex = 2;
+ this.name_label.Text = "Name";
+ //
+ // id_textbox
+ //
+ this.id_textbox.Location = new System.Drawing.Point(139, 24);
+ this.id_textbox.Name = "id_textbox";
+ this.id_textbox.Size = new System.Drawing.Size(100, 20);
+ this.id_textbox.TabIndex = 3;
+ this.id_textbox.TextChanged += new System.EventHandler(this.id_textbox_TextChanged);
+ //
+ // id_label
+ //
+ this.id_label.AutoSize = true;
+ this.id_label.Location = new System.Drawing.Point(157, 8);
+ this.id_label.Name = "id_label";
+ this.id_label.Size = new System.Drawing.Size(15, 13);
+ this.id_label.TabIndex = 4;
+ this.id_label.Text = "id";
+ //
+ // description_label
+ //
+ this.description_label.AutoSize = true;
+ this.description_label.Location = new System.Drawing.Point(22, 52);
+ this.description_label.Name = "description_label";
+ this.description_label.Size = new System.Drawing.Size(60, 13);
+ this.description_label.TabIndex = 5;
+ this.description_label.Text = "Description";
+ //
+ // energy_type_label
+ //
+ this.energy_type_label.AutoSize = true;
+ this.energy_type_label.Location = new System.Drawing.Point(15, 127);
+ this.energy_type_label.Name = "energy_type_label";
+ this.energy_type_label.Size = new System.Drawing.Size(67, 13);
+ this.energy_type_label.TabIndex = 6;
+ this.energy_type_label.Text = "Energy Type";
+ //
+ // allowedstringsBindingSource
+ //
+ this.allowedstringsBindingSource.DataSource = typeof(cdda_item_creator.spell.allowed_strings);
+ //
+ // allowedstringsBindingSource1
+ //
+ this.allowedstringsBindingSource1.DataSource = typeof(cdda_item_creator.spell.allowed_strings);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(699, 8);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 7;
+ this.button1.Text = "button1";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // spell_form
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.energy_type_label);
+ this.Controls.Add(this.description_label);
+ this.Controls.Add(this.id_label);
+ this.Controls.Add(this.id_textbox);
+ this.Controls.Add(this.name_label);
+ this.Controls.Add(this.energy_type_combobox);
+ this.Controls.Add(this.spell_description_textbox);
+ this.Controls.Add(this.spell_name_textbox);
+ this.Name = "spell_form";
+ this.Text = "Spell";
+ ((System.ComponentModel.ISupportInitialize)(this.allowedstringsBindingSource)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.allowedstringsBindingSource1)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox spell_name_textbox;
+ private System.Windows.Forms.TextBox spell_description_textbox;
+ private System.Windows.Forms.ComboBox energy_type_combobox;
+ private System.Windows.Forms.BindingSource allowedstringsBindingSource1;
+ private System.Windows.Forms.BindingSource allowedstringsBindingSource;
+ private System.Windows.Forms.Label name_label;
+ private System.Windows.Forms.TextBox id_textbox;
+ private System.Windows.Forms.Label id_label;
+ private System.Windows.Forms.Label description_label;
+ private System.Windows.Forms.Label energy_type_label;
+ private System.Windows.Forms.Button button1;
+ }
+}
+
diff --git a/spell_form.cs b/spell_form.cs
new file mode 100644
index 0000000..823f334
--- /dev/null
+++ b/spell_form.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace cdda_item_creator
+{
+ public partial class spell_form : Form
+ {
+ public spell_form()
+ {
+ InitializeComponent();
+ }
+
+ private void spell_name_textbox_TextChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void energy_type_combobox_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void id_textbox_TextChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
diff --git a/spell_form.resx b/spell_form.resx
new file mode 100644
index 0000000..c9b31e0
--- /dev/null
+++ b/spell_form.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 226, 17
+
+
\ No newline at end of file
diff --git a/spell_type.cs b/spell_type.cs
new file mode 100644
index 0000000..10b2969
--- /dev/null
+++ b/spell_type.cs
@@ -0,0 +1,251 @@
+using System.Collections.Generic;
+
+namespace cdda_item_creator
+{
+ namespace spell
+ {
+ static class allowed_strings
+ {
+ // flag, description
+ public static Dictionary spell_flags = new Dictionary
+ {
+ { "PERMANENT", "items or creatures spawned with this spell do not disappear and die as normal" },
+ { "IGNORE_WALLS", "spell's aoe goes through walls" },
+ { "HOSTILE_SUMMON", "summon spell always spawns a hostile monster" },
+ { "HOSTILE_50", "summoned monster spawns friendly 50% of the time" },
+ { "SILENT", "spell makes no noise at target" },
+ { "LOUD", "spell makes extra noise at target" },
+ { "VERBAL", "spell makes noise at caster location, mouth encumbrance affects fail %" },
+ { "SOMATIC", "arm encumbrance affects fail % and casting time (slightly)" },
+ { "NO_HANDS", "hands do not affect spell energy cost" },
+ { "UNSAFE_TELEPORT", "teleport spell risks killing the caster or others" },
+ { "NO_LEGS", "focus affects spell fail %" },
+ { "CONCENTRATE", "picks random number between min+increment*level and max instead of normal behavior" },
+ { "RANDOM_AOE", "picks random number between min+increment*level and max instead of normal behavior" },
+ { "RANDOM_DAMAGE", "picks random number between min+increment*level and max instead of normal behavior" },
+ { "RANDOM_DURATION", "picks random number between min+increment*level and max instead of normal behavior" },
+ { "RANDOM_TARGET", "picks a random valid target within your range instead of normal behavior" },
+ { "MUTATE_TRAIT", "overrides the mutate spell_effect to use a specific trait_id instead of a category" },
+ { "WONDER", "instead of casting each of the extra_spells, it picks N of them and casts them (where N is std::min( damage(), number_of_spells ))" }
+ };
+ public static string[] energy_types =
+ {
+ "NONE",
+ "HP",
+ "MANA",
+ "STAMINA",
+ "BIONIC",
+ "FATGIUE"
+ };
+ public static HashSet valid_targets = new HashSet
+ {
+ "ally",
+ "hostile",
+ "self",
+ "ground",
+ "none",
+ "item",
+ "fd_fire",
+ "fd_blood"
+ };
+ public static HashSet damage_types = new HashSet
+ {
+ "fire",
+ "acid",
+ "bash",
+ "bio",
+ "cold",
+ "cut",
+ "electric",
+ "stab",
+ "none"
+ };
+ // available options for recover_energy effect
+ public static HashSet recover_energy = new HashSet
+ {
+ "MANA",
+ "STAMINA",
+ "FATIGUE",
+ "PAIN",
+ "BIONIC"
+ };
+ // available options for timed_event effect
+ public static HashSet timed_event = new HashSet
+ {
+ "help",
+ "wanted",
+ "robot_attack",
+ "spawn_wyrms",
+ "amigara",
+ "roots_die",
+ "temple_open",
+ "temple_flood",
+ "temple_spawn",
+ "dim",
+ "artifact_light"
+ };
+ // effect, description
+ public static Dictionary effects = new Dictionary
+ {
+ { "pain_split", "makes all of your limbs' damage even out" },
+ { "target_attack", "deals damage to a target (ignores walls). If effect_str is included, it will add that effect (defined elsewhere in json) to the targets if able, to the body parts defined in effected_body_parts. Any aoe will manifest as a circular area centered on the target, and will only deal damage to valid_targets. (aoe does not ignore walls)" },
+ { "projectile_attack", "similar to target_attack, except the projectile you shoot will stop short at impassable terrain. If effect_str is included, it will add that effect (defined elsewhere in json) to the targets if able, to the body parts defined in effected_body_parts." },
+ { "cone_attack", "fires a cone toward the target up to your range. The arc of the cone in degrees is aoe. Stops at walls. If effect_str is included, it will add that effect (defined elsewhere in json) to the targets if able, to the body parts defined in effected_body_parts." },
+ { "line_attack", "fires a line with width aoe toward the target, being blocked by walls on the way. If effect_str is included, it will add that effect (defined elsewhere in json) to the targets if able, to the body parts defined in effected_body_parts." },
+ { "spawn_item", "spawns an item that disappear at the end of its duration. default duration is 0." },
+ { "teleport_random", "teleports the player randomly range spaces with aoe variation" },
+ { "recover_energy", "recovers an energy source (defined in the effect_str) equal to damage of the spell" },
+ { "ter_transform", "transform the terrain and furniture in an area centered at the target. The chance of any one of the points in the area of effect changing is one_in( damage ). The effect_str is the id of a ter_furn_transform." },
+ { "vomit", "any creature within its area of effect will instantly vomit, if it's able to do so." },
+ { "timed_event", "adds a timed event to the player only. NOTE: This was added only for artifact active effects. support is limited, use at your own risk" },
+ { "explosion", "an explosion is centered on the target, with power damage() and factor aoe()/10" },
+ { "flashbang", "a flashbang effect is centered on the target, with poewr damage() and factor aoe()/10" },
+ { "mod_moves", "adds damage() moves to the target. can be negative to freeze the target for that amount of time" },
+ { "map", "maps the overmap centered on the player out to a radius of aoe()" },
+ { "morale", "gives a morale effect to all npcs or avatar within aoe, with value damage(). decay_start is duration() / 10." },
+ { "charm_monster", "charms a monster that has less hp than damage() for approximately duration()" },
+ { "mutate", "mutates the target(s). if effect_str is defined, mutates toward that category instead of picking at random. the MUTATE_TRAIT flag allows effect_str to be a specific trait instead of a category. damage() / 100 is the percent chance the mutation will be successful (a value of 10000 represents 100.00%)" },
+ { "bash", "bashes the terrain at the target. uses damage() as the strength of the bash." }
+ };
+ }
+ struct fake_spell
+ {
+ string id;
+ int max_level;
+ int level;
+ bool self;
+ }
+
+ class spell_value_member
+ {
+ public spell_value_member(string name)
+ {
+ name_ = name;
+ }
+ public void update_values( int min, float increment, int max )
+ {
+ min_ = min;
+ increment_ = increment;
+ max_ = max;
+ }
+
+ public string create_json()
+ {
+ const string spacing = " ";
+ string ret = "";
+
+ if( max_ == 0 )
+ {
+ return ret;
+ }
+
+ ret += "\n" + spacing + "\"min_" + name_ + "\": " + min_.ToString() + ",";
+ ret += "\n" + spacing + "\"max_" + name_ + "\": " + max_.ToString() + ",";
+
+ if( increment_ != 0.0f )
+ {
+ ret += "\n" + spacing + "\"" + name_ + "_increment\": " + increment_.ToString() + ",";
+ }
+
+ return ret;
+ }
+
+ string name_;
+ int min_ = 0;
+ float increment_ = 0.0f;
+ int max_ = 0;
+ }
+
+ class spell_type
+ {
+ spell_type( string name )
+ {
+ this.name = name;
+ }
+
+ string id = "";
+ string name = "";
+ string description = "";
+ string message = "You cast %s!";
+ string sound_description = "an explosion";
+ string sound_type = "combat";
+ bool sound_ambient = false;
+ string sound_id = "";
+ string sound_variant = "default";
+ string effect = "none";
+ string effect_str = "";
+ List additional_spells;
+ string field = "";
+ int field_chance = 1;
+
+ spell_value_member field_intensity = new spell_value_member("field_intensity");
+
+ float field_intensity_variance = 0.0f;
+
+ spell_value_member damage = new spell_value_member("damage");
+ spell_value_member range = new spell_value_member("range");
+ spell_value_member aoe = new spell_value_member("aoe");
+ spell_value_member dot = new spell_value_member("dot");
+ spell_value_member pierce = new spell_value_member("pierce");
+
+ int min_duration = 0;
+ int duration_increment = 0;
+ int max_duration = 0;
+
+ int base_energy_cost = 0;
+ float energy_increment = 0.0f;
+ int final_energy_cost = 0;
+
+ string spell_class = "NONE";
+
+ int difficulty = 0;
+ int max_level = 0;
+
+ int base_casting_time = 0;
+ float casting_time_increment = 0.0f;
+ int final_casting_time = 0;
+
+ Dictionary learn_spells;
+
+ string energy_source = "none";
+ string dmg_type = "NONE";
+
+ HashSet effect_targets;
+ HashSet valid_targets;
+ HashSet affected_bps;
+ HashSet spell_tags;
+
+ public string create_json()
+ {
+ string ret = " {";
+
+ const string begin = "\n \"";
+
+ ret += begin + "id\": \"" + id + "\",";
+ ret += begin + "type\": \"SPELL\",";
+ ret += begin + "name\": \"" + name + "\",";
+ ret += begin + "description\": \"" + description + "\",";
+ ret += begin + "effect\": \"" + effect + "\",";
+ if (effect_str != "")
+ {
+ ret += begin + "effect_str\": \"" + effect_str + "\",";
+ }
+ ret += begin + "spell_class\": \"" + spell_class + "\",";
+ if (difficulty != 0)
+ {
+ ret += begin + "difficulty\": " + difficulty.ToString() + ",";
+ }
+ if(max_level != 0)
+ {
+ ret += begin + "max_level\": " + max_level.ToString() + ",";
+ }
+ ret += damage.create_json();
+ ret += range.create_json();
+ ret += aoe.create_json();
+
+ ret += "\n }";
+ return ret;
+ }
+ }
+ }
+}
\ No newline at end of file