Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <cmath>
- namespace dpscalc {
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- /// <summary>
- /// Summary for Form1
- ///
- /// WARNING: If you change the name of this class, you will need to change the
- /// 'Resource File Name' property for the managed resource compiler tool
- /// associated with all .resx files this class depends on. Otherwise,
- /// the designers will not be able to interact properly with localized
- /// resources associated with this form.
- /// </summary>
- public ref class Form1 : public System::Windows::Forms::Form
- {
- public:
- Form1(void)
- {
- InitializeComponent();
- //
- //TODO: Add the constructor code here
- //
- }
- protected:
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- ~Form1()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::TextBox^ pershot;
- protected:
- protected:
- private: System::Windows::Forms::Label^ label1;
- private: System::Windows::Forms::Label^ label2;
- private: System::Windows::Forms::TextBox^ rof;
- private: System::Windows::Forms::Label^ label3;
- private: System::Windows::Forms::TextBox^ mag;
- private: System::Windows::Forms::ComboBox^ comboBox1;
- private: System::Windows::Forms::Label^ label4;
- private: System::Windows::Forms::Label^ label7;
- private: System::Windows::Forms::TextBox^ reload;
- private: System::Windows::Forms::TextBox^ rofendo;
- private: System::Windows::Forms::TextBox^ magendo;
- private: System::Windows::Forms::Label^ label8;
- private: System::Windows::Forms::TextBox^ reloadendo;
- private: System::Windows::Forms::Label^ label9;
- private: System::Windows::Forms::Label^ label5;
- private: System::Windows::Forms::TextBox^ dps;
- private: System::Windows::Forms::Label^ label6;
- private: System::Windows::Forms::Label^ label10;
- private: System::Windows::Forms::TextBox^ endodps;
- private: System::Windows::Forms::Label^ label11;
- private: System::Windows::Forms::TextBox^ dpsgain;
- private: System::Windows::Forms::Label^ label12;
- private: System::Windows::Forms::TextBox^ noreload;
- private: System::Windows::Forms::Label^ label13;
- private: System::Windows::Forms::NumericUpDown^ level;
- private: System::Windows::Forms::Label^ label14;
- private: System::Windows::Forms::NumericUpDown^ offence;
- private: System::Windows::Forms::RadioButton^ bots;
- private: System::Windows::Forms::RadioButton^ turrets;
- private: System::Windows::Forms::RadioButton^ players;
- private: System::Windows::Forms::ToolTip^ toolTip1;
- private: System::Windows::Forms::Button^ button1;
- private: System::ComponentModel::IContainer^ components;
- protected:
- private:
- /// <summary>
- /// Required designer variable.
- /// </summary>
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- void InitializeComponent(void)
- {
- this->components = (gcnew System::ComponentModel::Container());
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
- this->pershot = (gcnew System::Windows::Forms::TextBox());
- this->label1 = (gcnew System::Windows::Forms::Label());
- this->label2 = (gcnew System::Windows::Forms::Label());
- this->rof = (gcnew System::Windows::Forms::TextBox());
- this->label3 = (gcnew System::Windows::Forms::Label());
- this->mag = (gcnew System::Windows::Forms::TextBox());
- this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
- this->label4 = (gcnew System::Windows::Forms::Label());
- this->label7 = (gcnew System::Windows::Forms::Label());
- this->reload = (gcnew System::Windows::Forms::TextBox());
- this->rofendo = (gcnew System::Windows::Forms::TextBox());
- this->magendo = (gcnew System::Windows::Forms::TextBox());
- this->label8 = (gcnew System::Windows::Forms::Label());
- this->reloadendo = (gcnew System::Windows::Forms::TextBox());
- this->label9 = (gcnew System::Windows::Forms::Label());
- this->label5 = (gcnew System::Windows::Forms::Label());
- this->dps = (gcnew System::Windows::Forms::TextBox());
- this->label6 = (gcnew System::Windows::Forms::Label());
- this->label10 = (gcnew System::Windows::Forms::Label());
- this->endodps = (gcnew System::Windows::Forms::TextBox());
- this->label11 = (gcnew System::Windows::Forms::Label());
- this->dpsgain = (gcnew System::Windows::Forms::TextBox());
- this->label12 = (gcnew System::Windows::Forms::Label());
- this->noreload = (gcnew System::Windows::Forms::TextBox());
- this->label13 = (gcnew System::Windows::Forms::Label());
- this->level = (gcnew System::Windows::Forms::NumericUpDown());
- this->label14 = (gcnew System::Windows::Forms::Label());
- this->offence = (gcnew System::Windows::Forms::NumericUpDown());
- this->bots = (gcnew System::Windows::Forms::RadioButton());
- this->turrets = (gcnew System::Windows::Forms::RadioButton());
- this->players = (gcnew System::Windows::Forms::RadioButton());
- this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
- this->button1 = (gcnew System::Windows::Forms::Button());
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->level))->BeginInit();
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->offence))->BeginInit();
- this->SuspendLayout();
- //
- // pershot
- //
- this->pershot->BackColor = System::Drawing::SystemColors::Window;
- this->pershot->Location = System::Drawing::Point(106, 12);
- this->pershot->Name = L"pershot";
- this->pershot->Size = System::Drawing::Size(56, 20);
- this->pershot->TabIndex = 0;
- this->pershot->Text = L"0";
- this->pershot->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->pershot->Leave += gcnew System::EventHandler(this, &Form1::pershot_Leave);
- //
- // label1
- //
- this->label1->AutoSize = true;
- this->label1->Location = System::Drawing::Point(12, 19);
- this->label1->Name = L"label1";
- this->label1->Size = System::Drawing::Size(88, 13);
- this->label1->TabIndex = 1;
- this->label1->Text = L"Damage per shot";
- //
- // label2
- //
- this->label2->AutoSize = true;
- this->label2->Location = System::Drawing::Point(12, 45);
- this->label2->Name = L"label2";
- this->label2->Size = System::Drawing::Size(59, 13);
- this->label2->TabIndex = 3;
- this->label2->Text = L"Rate of fire";
- //
- // rof
- //
- this->rof->Location = System::Drawing::Point(106, 38);
- this->rof->Name = L"rof";
- this->rof->Size = System::Drawing::Size(56, 20);
- this->rof->TabIndex = 2;
- this->rof->Text = L"0";
- this->rof->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->rof->Leave += gcnew System::EventHandler(this, &Form1::rof_Leave);
- //
- // label3
- //
- this->label3->AutoSize = true;
- this->label3->Location = System::Drawing::Point(12, 71);
- this->label3->Name = L"label3";
- this->label3->Size = System::Drawing::Size(49, 13);
- this->label3->TabIndex = 5;
- this->label3->Text = L"Mag size";
- //
- // mag
- //
- this->mag->Location = System::Drawing::Point(106, 64);
- this->mag->Name = L"mag";
- this->mag->Size = System::Drawing::Size(56, 20);
- this->mag->TabIndex = 4;
- this->mag->Text = L"0";
- this->mag->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->mag->Leave += gcnew System::EventHandler(this, &Form1::mag_Leave);
- //
- // comboBox1
- //
- this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
- this->comboBox1->FormattingEnabled = true;
- this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^ >(14) {L"Assassin", L"Assault", L"Cheston", L"Combat Girl",
- L"Gunner", L"Gunslinger", L"Karl", L"Megabeth", L"Sniper", L"Spark", L"Support", L"Tank", L"Veteran", L"Wascot"});
- this->comboBox1->Location = System::Drawing::Point(15, 116);
- this->comboBox1->Name = L"comboBox1";
- this->comboBox1->Size = System::Drawing::Size(85, 21);
- this->comboBox1->Sorted = true;
- this->comboBox1->TabIndex = 6;
- this->comboBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox1_SelectedIndexChanged);
- //
- // label4
- //
- this->label4->AutoSize = true;
- this->label4->Location = System::Drawing::Point(12, 206);
- this->label4->Name = L"label4";
- this->label4->Size = System::Drawing::Size(59, 13);
- this->label4->TabIndex = 9;
- this->label4->Text = L"RoF endos";
- //
- // label7
- //
- this->label7->AutoSize = true;
- this->label7->Location = System::Drawing::Point(12, 97);
- this->label7->Name = L"label7";
- this->label7->Size = System::Drawing::Size(73, 13);
- this->label7->TabIndex = 13;
- this->label7->Text = L"Reload speed";
- //
- // reload
- //
- this->reload->Location = System::Drawing::Point(106, 90);
- this->reload->Name = L"reload";
- this->reload->Size = System::Drawing::Size(56, 20);
- this->reload->TabIndex = 12;
- this->reload->Text = L"0";
- this->reload->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->reload->Leave += gcnew System::EventHandler(this, &Form1::reload_Leave);
- //
- // rofendo
- //
- this->rofendo->Location = System::Drawing::Point(106, 199);
- this->rofendo->Name = L"rofendo";
- this->rofendo->Size = System::Drawing::Size(56, 20);
- this->rofendo->TabIndex = 14;
- this->rofendo->Text = L"0";
- this->rofendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->rofendo->Leave += gcnew System::EventHandler(this, &Form1::rofendo_Leave);
- //
- // magendo
- //
- this->magendo->Location = System::Drawing::Point(106, 225);
- this->magendo->Name = L"magendo";
- this->magendo->Size = System::Drawing::Size(56, 20);
- this->magendo->TabIndex = 16;
- this->magendo->Text = L"0";
- this->magendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->magendo->Leave += gcnew System::EventHandler(this, &Form1::magendo_Leave);
- //
- // label8
- //
- this->label8->AutoSize = true;
- this->label8->Location = System::Drawing::Point(12, 232);
- this->label8->Name = L"label8";
- this->label8->Size = System::Drawing::Size(60, 13);
- this->label8->TabIndex = 15;
- this->label8->Text = L"Mag endos";
- //
- // reloadendo
- //
- this->reloadendo->Location = System::Drawing::Point(106, 251);
- this->reloadendo->Name = L"reloadendo";
- this->reloadendo->Size = System::Drawing::Size(56, 20);
- this->reloadendo->TabIndex = 18;
- this->reloadendo->Text = L"0";
- this->reloadendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->reloadendo->Leave += gcnew System::EventHandler(this, &Form1::reloadendo_Leave);
- //
- // label9
- //
- this->label9->AutoSize = true;
- this->label9->Location = System::Drawing::Point(12, 258);
- this->label9->Name = L"label9";
- this->label9->Size = System::Drawing::Size(73, 13);
- this->label9->TabIndex = 17;
- this->label9->Text = L"Reload endos";
- //
- // label5
- //
- this->label5->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
- this->label5->Location = System::Drawing::Point(12, 308);
- this->label5->Name = L"label5";
- this->label5->Size = System::Drawing::Size(148, 2);
- this->label5->TabIndex = 19;
- this->label5->Text = L" ";
- //
- // dps
- //
- this->dps->BackColor = System::Drawing::SystemColors::Control;
- this->dps->Location = System::Drawing::Point(106, 348);
- this->dps->Name = L"dps";
- this->dps->ReadOnly = true;
- this->dps->Size = System::Drawing::Size(56, 20);
- this->dps->TabIndex = 20;
- this->dps->Text = L"0";
- this->dps->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- //
- // label6
- //
- this->label6->AutoSize = true;
- this->label6->Location = System::Drawing::Point(12, 355);
- this->label6->Name = L"label6";
- this->label6->Size = System::Drawing::Size(54, 13);
- this->label6->TabIndex = 21;
- this->label6->Text = L"Real DPS";
- //
- // label10
- //
- this->label10->AutoSize = true;
- this->label10->Location = System::Drawing::Point(12, 381);
- this->label10->Name = L"label10";
- this->label10->Size = System::Drawing::Size(77, 13);
- this->label10->TabIndex = 23;
- this->label10->Text = L"Endorsed DPS";
- //
- // endodps
- //
- this->endodps->Location = System::Drawing::Point(106, 374);
- this->endodps->Name = L"endodps";
- this->endodps->ReadOnly = true;
- this->endodps->Size = System::Drawing::Size(56, 20);
- this->endodps->TabIndex = 22;
- this->endodps->Text = L"0";
- this->endodps->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- //
- // label11
- //
- this->label11->AutoSize = true;
- this->label11->Location = System::Drawing::Point(12, 407);
- this->label11->Name = L"label11";
- this->label11->Size = System::Drawing::Size(52, 13);
- this->label11->TabIndex = 25;
- this->label11->Text = L"DPS gain";
- //
- // dpsgain
- //
- this->dpsgain->Location = System::Drawing::Point(106, 400);
- this->dpsgain->Name = L"dpsgain";
- this->dpsgain->ReadOnly = true;
- this->dpsgain->Size = System::Drawing::Size(56, 20);
- this->dpsgain->TabIndex = 24;
- this->dpsgain->Text = L"0%";
- this->dpsgain->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- //
- // label12
- //
- this->label12->AutoSize = true;
- this->label12->Location = System::Drawing::Point(12, 329);
- this->label12->Name = L"label12";
- this->label12->Size = System::Drawing::Size(78, 13);
- this->label12->TabIndex = 27;
- this->label12->Text = L"No-reload DPS";
- //
- // noreload
- //
- this->noreload->BackColor = System::Drawing::SystemColors::Control;
- this->noreload->Location = System::Drawing::Point(106, 322);
- this->noreload->Name = L"noreload";
- this->noreload->ReadOnly = true;
- this->noreload->Size = System::Drawing::Size(56, 20);
- this->noreload->TabIndex = 26;
- this->noreload->Text = L"0";
- this->noreload->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- //
- // label13
- //
- this->label13->AutoSize = true;
- this->label13->Location = System::Drawing::Point(12, 154);
- this->label13->Name = L"label13";
- this->label13->Size = System::Drawing::Size(70, 13);
- this->label13->TabIndex = 29;
- this->label13->Text = L"Offence level";
- //
- // level
- //
- this->level->Location = System::Drawing::Point(106, 173);
- this->level->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {15, 0, 0, 0});
- this->level->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
- this->level->Name = L"level";
- this->level->Size = System::Drawing::Size(54, 20);
- this->level->TabIndex = 30;
- this->level->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->level->UpDownAlign = System::Windows::Forms::LeftRightAlignment::Left;
- this->level->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
- this->level->ValueChanged += gcnew System::EventHandler(this, &Form1::level_ValueChanged);
- this->level->Leave += gcnew System::EventHandler(this, &Form1::level_Leave);
- //
- // label14
- //
- this->label14->AutoSize = true;
- this->label14->Location = System::Drawing::Point(12, 180);
- this->label14->Name = L"label14";
- this->label14->Size = System::Drawing::Size(48, 13);
- this->label14->TabIndex = 31;
- this->label14->Text = L"Pro level";
- //
- // offence
- //
- this->offence->Location = System::Drawing::Point(106, 147);
- this->offence->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {4, 0, 0, 0});
- this->offence->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
- this->offence->Name = L"offence";
- this->offence->Size = System::Drawing::Size(54, 20);
- this->offence->TabIndex = 32;
- this->offence->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
- this->offence->UpDownAlign = System::Windows::Forms::LeftRightAlignment::Left;
- this->offence->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
- this->offence->ValueChanged += gcnew System::EventHandler(this, &Form1::offence_ValueChanged);
- this->offence->Leave += gcnew System::EventHandler(this, &Form1::offence_Leave);
- //
- // bots
- //
- this->bots->AutoSize = true;
- this->bots->CheckAlign = System::Drawing::ContentAlignment::TopCenter;
- this->bots->Location = System::Drawing::Point(13, 276);
- this->bots->Name = L"bots";
- this->bots->Size = System::Drawing::Size(32, 30);
- this->bots->TabIndex = 33;
- this->bots->Text = L"Bots";
- this->bots->UseVisualStyleBackColor = true;
- this->bots->Click += gcnew System::EventHandler(this, &Form1::bots_Click);
- //
- // turrets
- //
- this->turrets->AutoSize = true;
- this->turrets->CheckAlign = System::Drawing::ContentAlignment::TopCenter;
- this->turrets->Location = System::Drawing::Point(61, 276);
- this->turrets->Name = L"turrets";
- this->turrets->Size = System::Drawing::Size(44, 30);
- this->turrets->TabIndex = 34;
- this->turrets->Text = L"Turrets";
- this->turrets->UseVisualStyleBackColor = true;
- this->turrets->Click += gcnew System::EventHandler(this, &Form1::turrets_Click);
- //
- // players
- //
- this->players->AutoSize = true;
- this->players->CheckAlign = System::Drawing::ContentAlignment::TopCenter;
- this->players->Checked = true;
- this->players->Location = System::Drawing::Point(115, 276);
- this->players->Name = L"players";
- this->players->Size = System::Drawing::Size(45, 30);
- this->players->TabIndex = 35;
- this->players->TabStop = true;
- this->players->Text = L"Players";
- this->players->UseVisualStyleBackColor = true;
- this->players->Click += gcnew System::EventHandler(this, &Form1::players_Click);
- //
- // toolTip1
- //
- this->toolTip1->IsBalloon = true;
- //
- // button1
- //
- this->button1->Location = System::Drawing::Point(106, 116);
- this->button1->Name = L"button1";
- this->button1->Size = System::Drawing::Size(56, 21);
- this->button1->TabIndex = 36;
- this->button1->UseVisualStyleBackColor = true;
- this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
- //
- // Form1
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->ClientSize = System::Drawing::Size(174, 432);
- this->Controls->Add(this->button1);
- this->Controls->Add(this->players);
- this->Controls->Add(this->turrets);
- this->Controls->Add(this->bots);
- this->Controls->Add(this->offence);
- this->Controls->Add(this->label14);
- this->Controls->Add(this->level);
- this->Controls->Add(this->label13);
- this->Controls->Add(this->label12);
- this->Controls->Add(this->noreload);
- this->Controls->Add(this->label11);
- this->Controls->Add(this->dpsgain);
- this->Controls->Add(this->label10);
- this->Controls->Add(this->endodps);
- this->Controls->Add(this->label6);
- this->Controls->Add(this->dps);
- this->Controls->Add(this->label5);
- this->Controls->Add(this->reloadendo);
- this->Controls->Add(this->label9);
- this->Controls->Add(this->magendo);
- this->Controls->Add(this->label8);
- this->Controls->Add(this->rofendo);
- this->Controls->Add(this->label7);
- this->Controls->Add(this->reload);
- this->Controls->Add(this->label4);
- this->Controls->Add(this->comboBox1);
- this->Controls->Add(this->label3);
- this->Controls->Add(this->mag);
- this->Controls->Add(this->label2);
- this->Controls->Add(this->rof);
- this->Controls->Add(this->label1);
- this->Controls->Add(this->pershot);
- this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
- this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
- this->MaximizeBox = false;
- this->MinimizeBox = false;
- this->Name = L"Form1";
- this->ShowIcon = false;
- this->ShowInTaskbar = false;
- this->Text = L"DPS calc";
- this->TopMost = true;
- this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->level))->EndInit();
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->offence))->EndInit();
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- #pragma endregion
- private: System::Void comboBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
- if (this->comboBox1->Text == L"Assault") {
- mygun->name = L"AR";
- mygun->fullname = L"Assault Rifle";
- mygun->pershot = 18;
- mygun->rof = 0.1;
- mygun->mag = 25;
- mygun->reload = 1;
- mygun->next->name = L"GL";
- mygun->next->fullname = L"Grenade Launcher";
- mygun->next->pershot = 99;
- mygun->next->rof = 0.75;
- mygun->next->mag = 6;
- mygun->next->reload = 1.8;
- } else if (this->comboBox1->Text == L"Assassin") {
- mygun->name = L"BL";
- mygun->fullname = L"Blade";
- mygun->pershot = 65;
- mygun->rof = 0.5;
- mygun->mag = 1;
- mygun->reload = 0;
- mygun->next->name = L"SL";
- mygun->next->fullname = L"Shuriken Launcher";
- mygun->next->pershot = 30;
- mygun->next->rof = 0.1;
- mygun->next->mag = 5;
- mygun->next->reload = 1;
- } else if (this->comboBox1->Text == L"Cheston") {
- mygun->name = L"TG";
- mygun->fullname = L"Tommy Gun";
- mygun->pershot = 21;
- mygun->rof = 0.1;
- mygun->mag = 100;
- mygun->reload = 2;
- mygun->next->name = L"FJ";
- mygun->next->fullname = L"Family Jewel";
- mygun->next->pershot = 88;
- mygun->next->rof = 0.5;
- mygun->next->mag = 1;
- mygun->next->reload = 0;
- } else if (this->comboBox1->Text == L"Combat Girl") {
- mygun->name = L"CH";
- mygun->fullname = L"Combat Healer";
- mygun->pershot = 5;
- mygun->rof = 0.25;
- mygun->mag = 1;
- mygun->reload = 0;
- mygun->next->name = L"NG";
- mygun->next->fullname = L"Nailgun";
- mygun->next->pershot = 27;
- mygun->next->rof = 0.15;
- mygun->next->mag = 15;
- mygun->next->reload = 1;
- } else if (this->comboBox1->Text == L"Gunner") {
- mygun->name = L"MG";
- mygun->fullname = L"Minigun";
- mygun->pershot = 25;
- mygun->rof = 0.1;
- mygun->mag = 200;
- mygun->reload = 5;
- mygun->next->name = L"MOR";
- mygun->next->fullname = L"Mortar";
- mygun->next->pershot = 50;
- mygun->next->rof = 1;
- mygun->next->mag = 10;
- mygun->next->reload = 2;
- } else if (this->comboBox1->Text == L"Gunslinger") {
- mygun->name = L"LUC";
- mygun->fullname = L"Lucinda";
- mygun->pershot = 54;
- mygun->rof = 0.75;
- mygun->mag = 10;
- mygun->reload = 1.5;
- mygun->next->name = L"LP";
- mygun->next->fullname = L"Love Pistol";
- mygun->next->pershot = 37;
- mygun->next->rof = 0.3;
- mygun->next->mag = 6;
- mygun->next->reload = 1;
- } else if (this->comboBox1->Text == L"Karl") {
- mygun->name = L"HAN";
- mygun->fullname = L"Handler";
- mygun->pershot = 36;
- mygun->rof = 0.2;
- mygun->mag = 15;
- mygun->reload = 1;
- mygun->next->name = L"BB";
- mygun->next->fullname = L"Bouncing Buddies";
- mygun->next->pershot = 70;
- mygun->next->rof = 0.25;
- mygun->next->mag = 4;
- mygun->next->reload = 1.75;
- } else if (this->comboBox1->Text == L"Megabeth") {
- mygun->name = L"RM";
- mygun->fullname = L"Rocket Ma'am";
- mygun->pershot = 120;
- mygun->rof = 0.7;
- mygun->mag = 4;
- mygun->reload = 1.35;
- mygun->next->name = L"BH";
- mygun->next->fullname = L"Bearing Hates";
- mygun->next->pershot = 27;
- mygun->next->rof = 0.2;
- mygun->next->mag = 20;
- mygun->next->reload = 1;
- } else if (this->comboBox1->Text == L"Sniper") {
- mygun->name = L"SR";
- mygun->fullname = L"Sniper Rifle";
- mygun->pershot = 67;
- mygun->rof = 1;
- mygun->mag = 5;
- mygun->reload = 2;
- mygun->next->name = L"SMG";
- mygun->next->fullname = L"Submachine Gun";
- mygun->next->pershot = 16;
- mygun->next->rof = 0.1;
- mygun->next->mag = 15;
- mygun->next->reload = 1;
- } else if (this->comboBox1->Text == L"Spark") {
- mygun->name = L"VS";
- mygun->fullname = L"Voltage Spike";
- mygun->pershot = 50;
- mygun->rof = 0.325;
- mygun->mag = 1;
- mygun->reload = 0;
- mygun->next->name = L"RG";
- mygun->next->fullname = L"Ray Gun";
- mygun->next->pershot = 64;
- mygun->next->rof = 0.5;
- mygun->next->mag = 10;
- mygun->next->reload = 1;
- } else if (this->comboBox1->Text == L"Support") {
- mygun->name = L"H/H";
- mygun->fullname = L"Heal/Hurt Gun";
- mygun->pershot = 10;
- mygun->rof = 0.25;
- mygun->mag = 20;
- mygun->reload = 1.2;
- mygun->next->name = L"SG";
- mygun->next->fullname = L"Shotgun";
- mygun->next->pershot = 120;
- mygun->next->rof = 0.8;
- mygun->next->mag = 8;
- mygun->next->reload = 1.75;
- } else if (this->comboBox1->Text == L"Tank") {
- mygun->name = L"JG";
- mygun->fullname = L"Jet Gun";
- mygun->pershot = 23;
- mygun->rof = 0.1;
- mygun->mag = 100;
- mygun->reload = 2;
- mygun->next->name = L"RG";
- mygun->next->fullname = L"Rail Gun";
- mygun->next->pershot = 75;
- mygun->next->rof = 1;
- mygun->next->mag = 6;
- mygun->next->reload = 2;
- } else if (this->comboBox1->Text == L"Veteran") {
- mygun->name = L"FF";
- mygun->fullname = L"Flying Falcon";
- mygun->pershot = 46;
- mygun->rof = 0.75;
- mygun->mag = 3;
- mygun->reload = 1;
- mygun->next->name = L"HS";
- mygun->next->fullname = L"Hot Seat";
- mygun->next->pershot = 79;
- mygun->next->rof = 0.5;
- mygun->next->mag = 1;
- mygun->next->reload = 0;
- } else if (this->comboBox1->Text == L"Wascot") {
- mygun->name = L"CL";
- mygun->fullname = L"Coin Launcher";
- mygun->pershot = 100;
- mygun->rof = 1;
- mygun->mag = 4;
- mygun->reload = 1.5;
- mygun->next->name = L"HB";
- mygun->next->fullname = L"Heartbreaker";
- mygun->next->pershot = 50;
- mygun->next->rof = 0.325;
- mygun->next->mag = 1;
- mygun->next->reload = 0;
- }
- init(mygun);
- calculate();
- }
- ref class gun {
- public:
- System::String^ fullname;
- System::String^ name;
- double pershot;
- double rof;
- double mag;
- double reload;
- gun^ next;
- };
- void init(gun^ x) {
- this->pershot->Text = x->pershot.ToString();
- this->rof->Text = x->rof.ToString()->Replace(L',',L'.');
- this->mag->Text = x->mag.ToString();
- this->reload->Text = x->reload.ToString()->Replace(L',',L'.');
- this->button1->Text = x->name;
- pershotv = x->pershot;
- rofv = x->rof;
- magv = x->mag;
- reloadv = x->reload;
- if (magv!=1) {
- maxmag = ceil((round(magv*0.25)/magv-0.5/magv)*10000)/100;
- } else {
- maxmag = 0;
- }
- toolTip1->SetToolTip(this->button1, L"Current weapon preset is for "+x->fullname);
- toolTip1->SetToolTip(this->label8, L"Max useful mag bonus is "+maxmag.ToString()+L"%\nYour endorsed mag size is "+(magv+round(magendov*magv)).ToString());
- toolTip1->SetToolTip(this->label9, L"Your endorsed reload speed is "+(round(100*(reloadv*reloadendov))/100).ToString()->Replace(L',',L'.'));
- toolTip1->SetToolTip(this->label4, L"Your endorsed rate of fire is "+(round(1000*(rofv*rofendov))/1000).ToString()->Replace(L',',L'.'));
- }
- void swap(gun^ %x) {
- gun^ z;
- z = x;
- x = x->next;
- x->next = z;
- }
- double round(double x) {
- double t;
- t = x-floor(x);
- if (t>=0.5) {
- t=ceil(x);
- }
- else {
- t=floor(x);
- }
- return(t);
- }
- bool Parse(System::String ^s, double %result) {
- if (s->Contains(L".")) {
- s=s->Replace(L'.',L',');
- }
- if (Double::TryParse(s,result)) {
- return false;
- }
- else {
- return true;
- }
- }
- gun^ mygun;
- double pershotv,rofv,magv,reloadv,rofendov,magendov,reloadendov,maxmag;
- int target,offencev,levelv;
- void calculate(void) {
- double pershotmod;
- pershotmod = pershotv * ((levelv-1)*0.142857143+1);
- switch (offencev) {
- case 2: pershotmod*=1.16; break;
- case 3: pershotmod*=1.33; break;
- case 4: pershotmod*=1.5; break;
- }
- switch (target) {
- case 2: pershotmod*=((levelv-1)*0.0714285714+1); break;
- case 3: pershotmod*=((levelv-1)*0.142857143+1); break;
- }
- double noreload = round(100*floor(pershotmod)/rofv)/100;
- double dps = round(100*floor(pershotmod)*magv/(rofv*magv+reloadv))/100;
- double dpsendo = round(100*floor(pershotmod)*(magv+round(magendov*magv))/(rofv*rofendov*(magv+round(magendov*magv))+reloadv*reloadendov))/100;
- double dpsgain = round(100*(dpsendo-dps)/dps*100)/100;
- if (rofv==0 || magv==0) {
- noreload=0;
- dps=0;
- dpsendo=0;
- dpsgain=0;
- }
- this->noreload->Text = noreload.ToString()->Replace(L',',L'.');
- this->dps->Text = dps.ToString()->Replace(L',',L'.');
- this->endodps->Text = dpsendo.ToString()->Replace(L',',L'.');
- this->dpsgain->Text = dpsgain.ToString()->Replace(L',',L'.')+L'%';
- }
- private: System::Void pershot_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->pershot->Text,pershotv)) {this->pershot->Text=L"0"; pershotv=0;}
- calculate();
- }
- private: System::Void rof_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->rof->Text,rofv)) {this->rof->Text=L"0"; rofv=0;}
- toolTip1->SetToolTip(this->label4, L"Your endorsed rate of fire is "+(round(1000*(rofv*rofendov))/1000).ToString()->Replace(L',',L'.'));
- calculate();
- }
- private: System::Void mag_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->mag->Text,magv)) {this->mag->Text=L"0"; magv=0;}
- if (magv!=1) {
- maxmag = ceil((round(magv*0.25)/magv-0.5/magv)*10000)/100;
- } else {
- maxmag = 0;
- }
- toolTip1->SetToolTip(this->label8, L"Max useful mag bonus is "+maxmag.ToString()+L"%\nYour endorsed mag size is "+(magv+round(magendov*magv)).ToString());
- calculate();
- }
- private: System::Void reload_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->reload->Text,reloadv)) {this->reload->Text=L"0"; reloadv=0;}
- toolTip1->SetToolTip(this->label9, L"Your endorsed reload speed is "+(round(100*(reloadv*reloadendov))/100).ToString()->Replace(L',',L'.'));
- calculate();
- }
- private: System::Void rofendo_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->rofendo->Text,rofendov)) {this->rofendo->Text=L"0"; rofendov=0;}
- else if (rofendov>10) {this->rofendo->Text=L"10"; rofendov=10;}
- rofendov = 1-rofendov/100;
- toolTip1->SetToolTip(this->label4, L"Your endorsed rate of fire is "+(round(1000*(rofv*rofendov))/1000).ToString()->Replace(L',',L'.'));
- calculate();
- }
- private: System::Void magendo_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->magendo->Text,magendov)) {this->magendo->Text=L"0"; magendov=0;}
- else if (magendov>25) {this->magendo->Text=L"25"; magendov=25;}
- magendov/=100;
- toolTip1->SetToolTip(this->label8, L"Max useful mag bonus is "+maxmag.ToString()+L"%\nYour endorsed mag size is "+(magv+round(magendov*magv)).ToString());
- calculate();
- }
- private: System::Void reloadendo_Leave(System::Object^ sender, System::EventArgs^ e) {
- if (Parse(this->reloadendo->Text,reloadendov)) {this->reloadendo->Text=L"0"; reloadendov=0;}
- else if (magendov>25) {this->reloadendo->Text=L"25"; reloadendov=25;}
- reloadendov=1-reloadendov/100;
- toolTip1->SetToolTip(this->label9, L"Your endorsed reload speed is "+(round(100*(reloadv*reloadendov))/100).ToString()->Replace(L',',L'.'));
- calculate();
- }
- private: System::Void players_Click(System::Object^ sender, System::EventArgs^ e) {
- target=1;
- calculate();
- }
- private: System::Void turrets_Click(System::Object^ sender, System::EventArgs^ e) {
- target=2;
- calculate();
- }
- private: System::Void bots_Click(System::Object^ sender, System::EventArgs^ e) {
- target=3;
- calculate();
- }
- private: System::Void offence_ValueChanged(System::Object^ sender, System::EventArgs^ e) {
- if (levelv<4 && this->offence->Value>2) {
- this->offence->Value=2;
- } else if (levelv<8 && this->offence->Value==4) {
- this->offence->Value=3;
- }
- if (this->comboBox1->Text == L"Gunner") {
- if (this->offence->Value==4 && mygun->fullname==L"Minigun") {
- mygun->name = L"DMG";
- mygun->fullname = L"Dual Minigun";
- mygun->pershot = 20;
- mygun->rof = 0.075;
- mygun->mag = 300;
- init(mygun);
- } else if (this->offence->Value==4 && mygun->next->fullname==L"Minigun") {
- mygun->next->name = L"DMG";
- mygun->next->fullname = L"Dual Minigun";
- mygun->next->pershot = 20;
- mygun->next->rof = 0.075;
- mygun->next->mag = 300;
- } else if (this->offence->Value<4 && mygun->fullname==L"Dual Minigun") {
- mygun->name = L"MG";
- mygun->fullname = L"Minigun";
- mygun->pershot = 25;
- mygun->rof = 0.1;
- mygun->mag = 200;
- init(mygun);
- } else if (this->offence->Value<4 && mygun->next->fullname==L"Dual Minigun") {
- mygun->next->name = L"MG";
- mygun->next->fullname = L"Minigun";
- mygun->next->pershot = 25;
- mygun->next->rof = 0.1;
- mygun->next->mag = 200;
- }
- }
- offencev=int(this->offence->Value);
- calculate();
- }
- private: System::Void level_ValueChanged(System::Object^ sender, System::EventArgs^ e) {
- levelv=int(this->level->Value);
- if (levelv<4 && this->offence->Value>2) {
- this->offence->Value=2;
- } else if (levelv<8 && this->offence->Value==4) {
- this->offence->Value=3;
- }
- calculate();
- }
- private: System::Void offence_Leave(System::Object^ sender, System::EventArgs^ e) {
- this->offence->Text=this->offence->Value.ToString();
- }
- private: System::Void level_Leave(System::Object^ sender, System::EventArgs^ e) {
- this->level->Text=this->level->Value.ToString();
- }
- private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
- toolTip1->SetToolTip(this->bots, L"Jackbots have 30000 hp\nFujibots have 10800 hp\nBouncers have 7750 hp\nShadybots and Blackjacks have 2700 hp\nScramblers have 1800 hp\nGremlins have 450 hp\nSlims have 90 hp");
- pershotv = 0;
- rofv = 0;
- magv = 0;
- reloadv = 0;
- rofendov = 1;
- magendov = 0;
- reloadendov = 1;
- maxmag = 0;
- target = 1;
- offencev = 1;
- levelv = 1;
- mygun = gcnew gun;
- mygun->next = gcnew gun;
- }
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- swap(mygun);
- init(mygun);
- calculate();
- }
- };
- }
Add Comment
Please, Sign In to add comment