Guest User

Untitled

a guest
Jul 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 34.96 KB | None | 0 0
  1. #pragma once
  2. #include <cmath>
  3.  
  4. namespace dpscalc {
  5.  
  6.     using namespace System;
  7.     using namespace System::ComponentModel;
  8.     using namespace System::Collections;
  9.     using namespace System::Windows::Forms;
  10.     using namespace System::Data;
  11.     using namespace System::Drawing;
  12.  
  13.     /// <summary>
  14.     /// Summary for Form1
  15.     ///
  16.     /// WARNING: If you change the name of this class, you will need to change the
  17.     ///          'Resource File Name' property for the managed resource compiler tool
  18.     ///          associated with all .resx files this class depends on.  Otherwise,
  19.     ///          the designers will not be able to interact properly with localized
  20.     ///          resources associated with this form.
  21.     /// </summary>
  22.     public ref class Form1 : public System::Windows::Forms::Form
  23.     {
  24.     public:
  25.         Form1(void)
  26.         {
  27.             InitializeComponent();
  28.             //
  29.             //TODO: Add the constructor code here
  30.             //
  31.         }
  32.  
  33.     protected:
  34.         /// <summary>
  35.         /// Clean up any resources being used.
  36.         /// </summary>
  37.         ~Form1()
  38.         {
  39.             if (components)
  40.             {
  41.                 delete components;
  42.             }
  43.         }
  44.     private: System::Windows::Forms::TextBox^  pershot;
  45.     protected:
  46.  
  47.     protected:
  48.     private: System::Windows::Forms::Label^  label1;
  49.     private: System::Windows::Forms::Label^  label2;
  50.     private: System::Windows::Forms::TextBox^  rof;
  51.  
  52.     private: System::Windows::Forms::Label^  label3;
  53.     private: System::Windows::Forms::TextBox^  mag;
  54.  
  55.     private: System::Windows::Forms::ComboBox^  comboBox1;
  56.     private: System::Windows::Forms::Label^  label4;
  57.  
  58.  
  59.     private: System::Windows::Forms::Label^  label7;
  60.     private: System::Windows::Forms::TextBox^  reload;
  61.     private: System::Windows::Forms::TextBox^  rofendo;
  62.     private: System::Windows::Forms::TextBox^  magendo;
  63.  
  64.  
  65.  
  66.     private: System::Windows::Forms::Label^  label8;
  67.     private: System::Windows::Forms::TextBox^  reloadendo;
  68.  
  69.     private: System::Windows::Forms::Label^  label9;
  70.     private: System::Windows::Forms::Label^  label5;
  71.     private: System::Windows::Forms::TextBox^  dps;
  72.  
  73.     private: System::Windows::Forms::Label^  label6;
  74.     private: System::Windows::Forms::Label^  label10;
  75.     private: System::Windows::Forms::TextBox^  endodps;
  76.  
  77.     private: System::Windows::Forms::Label^  label11;
  78.     private: System::Windows::Forms::TextBox^  dpsgain;
  79.     private: System::Windows::Forms::Label^  label12;
  80.     private: System::Windows::Forms::TextBox^  noreload;
  81.  
  82.     private: System::Windows::Forms::Label^  label13;
  83.     private: System::Windows::Forms::NumericUpDown^  level;
  84.  
  85.     private: System::Windows::Forms::Label^  label14;
  86.     private: System::Windows::Forms::NumericUpDown^  offence;
  87.     private: System::Windows::Forms::RadioButton^  bots;
  88.  
  89.  
  90.     private: System::Windows::Forms::RadioButton^  turrets;
  91.  
  92.     private: System::Windows::Forms::RadioButton^  players;
  93.     private: System::Windows::Forms::ToolTip^  toolTip1;
  94.     private: System::Windows::Forms::Button^  button1;
  95.     private: System::ComponentModel::IContainer^  components;
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.     protected:
  104.  
  105.  
  106.     private:
  107.         /// <summary>
  108.         /// Required designer variable.
  109.         /// </summary>
  110.  
  111.  
  112. #pragma region Windows Form Designer generated code
  113.         /// <summary>
  114.         /// Required method for Designer support - do not modify
  115.         /// the contents of this method with the code editor.
  116.         /// </summary>
  117.         void InitializeComponent(void)
  118.         {
  119.             this->components = (gcnew System::ComponentModel::Container());
  120.             System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
  121.             this->pershot = (gcnew System::Windows::Forms::TextBox());
  122.             this->label1 = (gcnew System::Windows::Forms::Label());
  123.             this->label2 = (gcnew System::Windows::Forms::Label());
  124.             this->rof = (gcnew System::Windows::Forms::TextBox());
  125.             this->label3 = (gcnew System::Windows::Forms::Label());
  126.             this->mag = (gcnew System::Windows::Forms::TextBox());
  127.             this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
  128.             this->label4 = (gcnew System::Windows::Forms::Label());
  129.             this->label7 = (gcnew System::Windows::Forms::Label());
  130.             this->reload = (gcnew System::Windows::Forms::TextBox());
  131.             this->rofendo = (gcnew System::Windows::Forms::TextBox());
  132.             this->magendo = (gcnew System::Windows::Forms::TextBox());
  133.             this->label8 = (gcnew System::Windows::Forms::Label());
  134.             this->reloadendo = (gcnew System::Windows::Forms::TextBox());
  135.             this->label9 = (gcnew System::Windows::Forms::Label());
  136.             this->label5 = (gcnew System::Windows::Forms::Label());
  137.             this->dps = (gcnew System::Windows::Forms::TextBox());
  138.             this->label6 = (gcnew System::Windows::Forms::Label());
  139.             this->label10 = (gcnew System::Windows::Forms::Label());
  140.             this->endodps = (gcnew System::Windows::Forms::TextBox());
  141.             this->label11 = (gcnew System::Windows::Forms::Label());
  142.             this->dpsgain = (gcnew System::Windows::Forms::TextBox());
  143.             this->label12 = (gcnew System::Windows::Forms::Label());
  144.             this->noreload = (gcnew System::Windows::Forms::TextBox());
  145.             this->label13 = (gcnew System::Windows::Forms::Label());
  146.             this->level = (gcnew System::Windows::Forms::NumericUpDown());
  147.             this->label14 = (gcnew System::Windows::Forms::Label());
  148.             this->offence = (gcnew System::Windows::Forms::NumericUpDown());
  149.             this->bots = (gcnew System::Windows::Forms::RadioButton());
  150.             this->turrets = (gcnew System::Windows::Forms::RadioButton());
  151.             this->players = (gcnew System::Windows::Forms::RadioButton());
  152.             this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
  153.             this->button1 = (gcnew System::Windows::Forms::Button());
  154.             (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->level))->BeginInit();
  155.             (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->offence))->BeginInit();
  156.             this->SuspendLayout();
  157.             //
  158.             // pershot
  159.             //
  160.             this->pershot->BackColor = System::Drawing::SystemColors::Window;
  161.             this->pershot->Location = System::Drawing::Point(106, 12);
  162.             this->pershot->Name = L"pershot";
  163.             this->pershot->Size = System::Drawing::Size(56, 20);
  164.             this->pershot->TabIndex = 0;
  165.             this->pershot->Text = L"0";
  166.             this->pershot->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  167.             this->pershot->Leave += gcnew System::EventHandler(this, &Form1::pershot_Leave);
  168.             //
  169.             // label1
  170.             //
  171.             this->label1->AutoSize = true;
  172.             this->label1->Location = System::Drawing::Point(12, 19);
  173.             this->label1->Name = L"label1";
  174.             this->label1->Size = System::Drawing::Size(88, 13);
  175.             this->label1->TabIndex = 1;
  176.             this->label1->Text = L"Damage per shot";
  177.             //
  178.             // label2
  179.             //
  180.             this->label2->AutoSize = true;
  181.             this->label2->Location = System::Drawing::Point(12, 45);
  182.             this->label2->Name = L"label2";
  183.             this->label2->Size = System::Drawing::Size(59, 13);
  184.             this->label2->TabIndex = 3;
  185.             this->label2->Text = L"Rate of fire";
  186.             //
  187.             // rof
  188.             //
  189.             this->rof->Location = System::Drawing::Point(106, 38);
  190.             this->rof->Name = L"rof";
  191.             this->rof->Size = System::Drawing::Size(56, 20);
  192.             this->rof->TabIndex = 2;
  193.             this->rof->Text = L"0";
  194.             this->rof->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  195.             this->rof->Leave += gcnew System::EventHandler(this, &Form1::rof_Leave);
  196.             //
  197.             // label3
  198.             //
  199.             this->label3->AutoSize = true;
  200.             this->label3->Location = System::Drawing::Point(12, 71);
  201.             this->label3->Name = L"label3";
  202.             this->label3->Size = System::Drawing::Size(49, 13);
  203.             this->label3->TabIndex = 5;
  204.             this->label3->Text = L"Mag size";
  205.             //
  206.             // mag
  207.             //
  208.             this->mag->Location = System::Drawing::Point(106, 64);
  209.             this->mag->Name = L"mag";
  210.             this->mag->Size = System::Drawing::Size(56, 20);
  211.             this->mag->TabIndex = 4;
  212.             this->mag->Text = L"0";
  213.             this->mag->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  214.             this->mag->Leave += gcnew System::EventHandler(this, &Form1::mag_Leave);
  215.             //
  216.             // comboBox1
  217.             //
  218.             this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
  219.             this->comboBox1->FormattingEnabled = true;
  220.             this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^  >(14) {L"Assassin", L"Assault", L"Cheston", L"Combat Girl",
  221.                 L"Gunner", L"Gunslinger", L"Karl", L"Megabeth", L"Sniper", L"Spark", L"Support", L"Tank", L"Veteran", L"Wascot"});
  222.             this->comboBox1->Location = System::Drawing::Point(15, 116);
  223.             this->comboBox1->Name = L"comboBox1";
  224.             this->comboBox1->Size = System::Drawing::Size(85, 21);
  225.             this->comboBox1->Sorted = true;
  226.             this->comboBox1->TabIndex = 6;
  227.             this->comboBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox1_SelectedIndexChanged);
  228.             //
  229.             // label4
  230.             //
  231.             this->label4->AutoSize = true;
  232.             this->label4->Location = System::Drawing::Point(12, 206);
  233.             this->label4->Name = L"label4";
  234.             this->label4->Size = System::Drawing::Size(59, 13);
  235.             this->label4->TabIndex = 9;
  236.             this->label4->Text = L"RoF endos";
  237.             //
  238.             // label7
  239.             //
  240.             this->label7->AutoSize = true;
  241.             this->label7->Location = System::Drawing::Point(12, 97);
  242.             this->label7->Name = L"label7";
  243.             this->label7->Size = System::Drawing::Size(73, 13);
  244.             this->label7->TabIndex = 13;
  245.             this->label7->Text = L"Reload speed";
  246.             //
  247.             // reload
  248.             //
  249.             this->reload->Location = System::Drawing::Point(106, 90);
  250.             this->reload->Name = L"reload";
  251.             this->reload->Size = System::Drawing::Size(56, 20);
  252.             this->reload->TabIndex = 12;
  253.             this->reload->Text = L"0";
  254.             this->reload->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  255.             this->reload->Leave += gcnew System::EventHandler(this, &Form1::reload_Leave);
  256.             //
  257.             // rofendo
  258.             //
  259.             this->rofendo->Location = System::Drawing::Point(106, 199);
  260.             this->rofendo->Name = L"rofendo";
  261.             this->rofendo->Size = System::Drawing::Size(56, 20);
  262.             this->rofendo->TabIndex = 14;
  263.             this->rofendo->Text = L"0";
  264.             this->rofendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  265.             this->rofendo->Leave += gcnew System::EventHandler(this, &Form1::rofendo_Leave);
  266.             //
  267.             // magendo
  268.             //
  269.             this->magendo->Location = System::Drawing::Point(106, 225);
  270.             this->magendo->Name = L"magendo";
  271.             this->magendo->Size = System::Drawing::Size(56, 20);
  272.             this->magendo->TabIndex = 16;
  273.             this->magendo->Text = L"0";
  274.             this->magendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  275.             this->magendo->Leave += gcnew System::EventHandler(this, &Form1::magendo_Leave);
  276.             //
  277.             // label8
  278.             //
  279.             this->label8->AutoSize = true;
  280.             this->label8->Location = System::Drawing::Point(12, 232);
  281.             this->label8->Name = L"label8";
  282.             this->label8->Size = System::Drawing::Size(60, 13);
  283.             this->label8->TabIndex = 15;
  284.             this->label8->Text = L"Mag endos";
  285.             //
  286.             // reloadendo
  287.             //
  288.             this->reloadendo->Location = System::Drawing::Point(106, 251);
  289.             this->reloadendo->Name = L"reloadendo";
  290.             this->reloadendo->Size = System::Drawing::Size(56, 20);
  291.             this->reloadendo->TabIndex = 18;
  292.             this->reloadendo->Text = L"0";
  293.             this->reloadendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  294.             this->reloadendo->Leave += gcnew System::EventHandler(this, &Form1::reloadendo_Leave);
  295.             //
  296.             // label9
  297.             //
  298.             this->label9->AutoSize = true;
  299.             this->label9->Location = System::Drawing::Point(12, 258);
  300.             this->label9->Name = L"label9";
  301.             this->label9->Size = System::Drawing::Size(73, 13);
  302.             this->label9->TabIndex = 17;
  303.             this->label9->Text = L"Reload endos";
  304.             //
  305.             // label5
  306.             //
  307.             this->label5->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
  308.             this->label5->Location = System::Drawing::Point(12, 308);
  309.             this->label5->Name = L"label5";
  310.             this->label5->Size = System::Drawing::Size(148, 2);
  311.             this->label5->TabIndex = 19;
  312.             this->label5->Text = L" ";
  313.             //
  314.             // dps
  315.             //
  316.             this->dps->BackColor = System::Drawing::SystemColors::Control;
  317.             this->dps->Location = System::Drawing::Point(106, 348);
  318.             this->dps->Name = L"dps";
  319.             this->dps->ReadOnly = true;
  320.             this->dps->Size = System::Drawing::Size(56, 20);
  321.             this->dps->TabIndex = 20;
  322.             this->dps->Text = L"0";
  323.             this->dps->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  324.             //
  325.             // label6
  326.             //
  327.             this->label6->AutoSize = true;
  328.             this->label6->Location = System::Drawing::Point(12, 355);
  329.             this->label6->Name = L"label6";
  330.             this->label6->Size = System::Drawing::Size(54, 13);
  331.             this->label6->TabIndex = 21;
  332.             this->label6->Text = L"Real DPS";
  333.             //
  334.             // label10
  335.             //
  336.             this->label10->AutoSize = true;
  337.             this->label10->Location = System::Drawing::Point(12, 381);
  338.             this->label10->Name = L"label10";
  339.             this->label10->Size = System::Drawing::Size(77, 13);
  340.             this->label10->TabIndex = 23;
  341.             this->label10->Text = L"Endorsed DPS";
  342.             //
  343.             // endodps
  344.             //
  345.             this->endodps->Location = System::Drawing::Point(106, 374);
  346.             this->endodps->Name = L"endodps";
  347.             this->endodps->ReadOnly = true;
  348.             this->endodps->Size = System::Drawing::Size(56, 20);
  349.             this->endodps->TabIndex = 22;
  350.             this->endodps->Text = L"0";
  351.             this->endodps->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  352.             //
  353.             // label11
  354.             //
  355.             this->label11->AutoSize = true;
  356.             this->label11->Location = System::Drawing::Point(12, 407);
  357.             this->label11->Name = L"label11";
  358.             this->label11->Size = System::Drawing::Size(52, 13);
  359.             this->label11->TabIndex = 25;
  360.             this->label11->Text = L"DPS gain";
  361.             //
  362.             // dpsgain
  363.             //
  364.             this->dpsgain->Location = System::Drawing::Point(106, 400);
  365.             this->dpsgain->Name = L"dpsgain";
  366.             this->dpsgain->ReadOnly = true;
  367.             this->dpsgain->Size = System::Drawing::Size(56, 20);
  368.             this->dpsgain->TabIndex = 24;
  369.             this->dpsgain->Text = L"0%";
  370.             this->dpsgain->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  371.             //
  372.             // label12
  373.             //
  374.             this->label12->AutoSize = true;
  375.             this->label12->Location = System::Drawing::Point(12, 329);
  376.             this->label12->Name = L"label12";
  377.             this->label12->Size = System::Drawing::Size(78, 13);
  378.             this->label12->TabIndex = 27;
  379.             this->label12->Text = L"No-reload DPS";
  380.             //
  381.             // noreload
  382.             //
  383.             this->noreload->BackColor = System::Drawing::SystemColors::Control;
  384.             this->noreload->Location = System::Drawing::Point(106, 322);
  385.             this->noreload->Name = L"noreload";
  386.             this->noreload->ReadOnly = true;
  387.             this->noreload->Size = System::Drawing::Size(56, 20);
  388.             this->noreload->TabIndex = 26;
  389.             this->noreload->Text = L"0";
  390.             this->noreload->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  391.             //
  392.             // label13
  393.             //
  394.             this->label13->AutoSize = true;
  395.             this->label13->Location = System::Drawing::Point(12, 154);
  396.             this->label13->Name = L"label13";
  397.             this->label13->Size = System::Drawing::Size(70, 13);
  398.             this->label13->TabIndex = 29;
  399.             this->label13->Text = L"Offence level";
  400.             //
  401.             // level
  402.             //
  403.             this->level->Location = System::Drawing::Point(106, 173);
  404.             this->level->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {15, 0, 0, 0});
  405.             this->level->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
  406.             this->level->Name = L"level";
  407.             this->level->Size = System::Drawing::Size(54, 20);
  408.             this->level->TabIndex = 30;
  409.             this->level->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  410.             this->level->UpDownAlign = System::Windows::Forms::LeftRightAlignment::Left;
  411.             this->level->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
  412.             this->level->ValueChanged += gcnew System::EventHandler(this, &Form1::level_ValueChanged);
  413.             this->level->Leave += gcnew System::EventHandler(this, &Form1::level_Leave);
  414.             //
  415.             // label14
  416.             //
  417.             this->label14->AutoSize = true;
  418.             this->label14->Location = System::Drawing::Point(12, 180);
  419.             this->label14->Name = L"label14";
  420.             this->label14->Size = System::Drawing::Size(48, 13);
  421.             this->label14->TabIndex = 31;
  422.             this->label14->Text = L"Pro level";
  423.             //
  424.             // offence
  425.             //
  426.             this->offence->Location = System::Drawing::Point(106, 147);
  427.             this->offence->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {4, 0, 0, 0});
  428.             this->offence->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
  429.             this->offence->Name = L"offence";
  430.             this->offence->Size = System::Drawing::Size(54, 20);
  431.             this->offence->TabIndex = 32;
  432.             this->offence->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  433.             this->offence->UpDownAlign = System::Windows::Forms::LeftRightAlignment::Left;
  434.             this->offence->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
  435.             this->offence->ValueChanged += gcnew System::EventHandler(this, &Form1::offence_ValueChanged);
  436.             this->offence->Leave += gcnew System::EventHandler(this, &Form1::offence_Leave);
  437.             //
  438.             // bots
  439.             //
  440.             this->bots->AutoSize = true;
  441.             this->bots->CheckAlign = System::Drawing::ContentAlignment::TopCenter;
  442.             this->bots->Location = System::Drawing::Point(13, 276);
  443.             this->bots->Name = L"bots";
  444.             this->bots->Size = System::Drawing::Size(32, 30);
  445.             this->bots->TabIndex = 33;
  446.             this->bots->Text = L"Bots";
  447.             this->bots->UseVisualStyleBackColor = true;
  448.             this->bots->Click += gcnew System::EventHandler(this, &Form1::bots_Click);
  449.             //
  450.             // turrets
  451.             //
  452.             this->turrets->AutoSize = true;
  453.             this->turrets->CheckAlign = System::Drawing::ContentAlignment::TopCenter;
  454.             this->turrets->Location = System::Drawing::Point(61, 276);
  455.             this->turrets->Name = L"turrets";
  456.             this->turrets->Size = System::Drawing::Size(44, 30);
  457.             this->turrets->TabIndex = 34;
  458.             this->turrets->Text = L"Turrets";
  459.             this->turrets->UseVisualStyleBackColor = true;
  460.             this->turrets->Click += gcnew System::EventHandler(this, &Form1::turrets_Click);
  461.             //
  462.             // players
  463.             //
  464.             this->players->AutoSize = true;
  465.             this->players->CheckAlign = System::Drawing::ContentAlignment::TopCenter;
  466.             this->players->Checked = true;
  467.             this->players->Location = System::Drawing::Point(115, 276);
  468.             this->players->Name = L"players";
  469.             this->players->Size = System::Drawing::Size(45, 30);
  470.             this->players->TabIndex = 35;
  471.             this->players->TabStop = true;
  472.             this->players->Text = L"Players";
  473.             this->players->UseVisualStyleBackColor = true;
  474.             this->players->Click += gcnew System::EventHandler(this, &Form1::players_Click);
  475.             //
  476.             // toolTip1
  477.             //
  478.             this->toolTip1->IsBalloon = true;
  479.             //
  480.             // button1
  481.             //
  482.             this->button1->Location = System::Drawing::Point(106, 116);
  483.             this->button1->Name = L"button1";
  484.             this->button1->Size = System::Drawing::Size(56, 21);
  485.             this->button1->TabIndex = 36;
  486.             this->button1->UseVisualStyleBackColor = true;
  487.             this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  488.             //
  489.             // Form1
  490.             //
  491.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  492.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  493.             this->ClientSize = System::Drawing::Size(174, 432);
  494.             this->Controls->Add(this->button1);
  495.             this->Controls->Add(this->players);
  496.             this->Controls->Add(this->turrets);
  497.             this->Controls->Add(this->bots);
  498.             this->Controls->Add(this->offence);
  499.             this->Controls->Add(this->label14);
  500.             this->Controls->Add(this->level);
  501.             this->Controls->Add(this->label13);
  502.             this->Controls->Add(this->label12);
  503.             this->Controls->Add(this->noreload);
  504.             this->Controls->Add(this->label11);
  505.             this->Controls->Add(this->dpsgain);
  506.             this->Controls->Add(this->label10);
  507.             this->Controls->Add(this->endodps);
  508.             this->Controls->Add(this->label6);
  509.             this->Controls->Add(this->dps);
  510.             this->Controls->Add(this->label5);
  511.             this->Controls->Add(this->reloadendo);
  512.             this->Controls->Add(this->label9);
  513.             this->Controls->Add(this->magendo);
  514.             this->Controls->Add(this->label8);
  515.             this->Controls->Add(this->rofendo);
  516.             this->Controls->Add(this->label7);
  517.             this->Controls->Add(this->reload);
  518.             this->Controls->Add(this->label4);
  519.             this->Controls->Add(this->comboBox1);
  520.             this->Controls->Add(this->label3);
  521.             this->Controls->Add(this->mag);
  522.             this->Controls->Add(this->label2);
  523.             this->Controls->Add(this->rof);
  524.             this->Controls->Add(this->label1);
  525.             this->Controls->Add(this->pershot);
  526.             this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
  527.             this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
  528.             this->MaximizeBox = false;
  529.             this->MinimizeBox = false;
  530.             this->Name = L"Form1";
  531.             this->ShowIcon = false;
  532.             this->ShowInTaskbar = false;
  533.             this->Text = L"DPS calc";
  534.             this->TopMost = true;
  535.             this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
  536.             (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->level))->EndInit();
  537.             (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->offence))->EndInit();
  538.             this->ResumeLayout(false);
  539.             this->PerformLayout();
  540.  
  541.         }
  542. #pragma endregion
  543. private: System::Void comboBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
  544.              if (this->comboBox1->Text == L"Assault") {
  545.                  mygun->name = L"AR";
  546.                  mygun->fullname = L"Assault Rifle";
  547.                  mygun->pershot = 18;
  548.                  mygun->rof = 0.1;
  549.                  mygun->mag = 25;
  550.                  mygun->reload = 1;
  551.                  mygun->next->name = L"GL";
  552.                  mygun->next->fullname = L"Grenade Launcher";
  553.                  mygun->next->pershot = 99;
  554.                  mygun->next->rof = 0.75;
  555.                  mygun->next->mag = 6;
  556.                  mygun->next->reload = 1.8;
  557.              } else if (this->comboBox1->Text == L"Assassin") {
  558.                  mygun->name = L"BL";
  559.                  mygun->fullname = L"Blade";
  560.                  mygun->pershot = 65;
  561.                  mygun->rof = 0.5;
  562.                  mygun->mag = 1;
  563.                  mygun->reload = 0;
  564.                  mygun->next->name = L"SL";
  565.                  mygun->next->fullname = L"Shuriken Launcher";
  566.                  mygun->next->pershot = 30;
  567.                  mygun->next->rof = 0.1;
  568.                  mygun->next->mag = 5;
  569.                  mygun->next->reload = 1;
  570.              } else if (this->comboBox1->Text == L"Cheston") {
  571.                  mygun->name = L"TG";
  572.                  mygun->fullname = L"Tommy Gun";
  573.                  mygun->pershot = 21;
  574.                  mygun->rof = 0.1;
  575.                  mygun->mag = 100;
  576.                  mygun->reload = 2;
  577.                  mygun->next->name = L"FJ";
  578.                  mygun->next->fullname = L"Family Jewel";
  579.                  mygun->next->pershot = 88;
  580.                  mygun->next->rof = 0.5;
  581.                  mygun->next->mag = 1;
  582.                  mygun->next->reload = 0;
  583.              } else if (this->comboBox1->Text == L"Combat Girl") {
  584.                  mygun->name = L"CH";
  585.                  mygun->fullname = L"Combat Healer";
  586.                  mygun->pershot = 5;
  587.                  mygun->rof = 0.25;
  588.                  mygun->mag = 1;
  589.                  mygun->reload = 0;
  590.                  mygun->next->name = L"NG";
  591.                  mygun->next->fullname = L"Nailgun";
  592.                  mygun->next->pershot = 27;
  593.                  mygun->next->rof = 0.15;
  594.                  mygun->next->mag = 15;
  595.                  mygun->next->reload = 1;
  596.              } else if (this->comboBox1->Text == L"Gunner") {
  597.                  mygun->name = L"MG";
  598.                  mygun->fullname = L"Minigun";
  599.                  mygun->pershot = 25;
  600.                  mygun->rof = 0.1;
  601.                  mygun->mag = 200;
  602.                  mygun->reload = 5;
  603.                  mygun->next->name = L"MOR";
  604.                  mygun->next->fullname = L"Mortar";
  605.                  mygun->next->pershot = 50;
  606.                  mygun->next->rof = 1;
  607.                  mygun->next->mag = 10;
  608.                  mygun->next->reload = 2;
  609.              } else if (this->comboBox1->Text == L"Gunslinger") {
  610.                  mygun->name = L"LUC";
  611.                  mygun->fullname = L"Lucinda";
  612.                  mygun->pershot = 54;
  613.                  mygun->rof = 0.75;
  614.                  mygun->mag = 10;
  615.                  mygun->reload = 1.5;
  616.                  mygun->next->name = L"LP";
  617.                  mygun->next->fullname = L"Love Pistol";
  618.                  mygun->next->pershot = 37;
  619.                  mygun->next->rof = 0.3;
  620.                  mygun->next->mag = 6;
  621.                  mygun->next->reload = 1;
  622.              } else if (this->comboBox1->Text == L"Karl") {
  623.                  mygun->name = L"HAN";
  624.                  mygun->fullname = L"Handler";
  625.                  mygun->pershot = 36;
  626.                  mygun->rof = 0.2;
  627.                  mygun->mag = 15;
  628.                  mygun->reload = 1;
  629.                  mygun->next->name = L"BB";
  630.                  mygun->next->fullname = L"Bouncing Buddies";
  631.                  mygun->next->pershot = 70;
  632.                  mygun->next->rof = 0.25;
  633.                  mygun->next->mag = 4;
  634.                  mygun->next->reload = 1.75;
  635.              } else if (this->comboBox1->Text == L"Megabeth") {
  636.                  mygun->name = L"RM";
  637.                  mygun->fullname = L"Rocket Ma'am";
  638.                  mygun->pershot = 120;
  639.                  mygun->rof = 0.7;
  640.                  mygun->mag = 4;
  641.                  mygun->reload = 1.35;
  642.                  mygun->next->name = L"BH";
  643.                  mygun->next->fullname = L"Bearing Hates";
  644.                  mygun->next->pershot = 27;
  645.                  mygun->next->rof = 0.2;
  646.                  mygun->next->mag = 20;
  647.                  mygun->next->reload = 1;
  648.              } else if (this->comboBox1->Text == L"Sniper") {
  649.                  mygun->name = L"SR";
  650.                  mygun->fullname = L"Sniper Rifle";
  651.                  mygun->pershot = 67;
  652.                  mygun->rof = 1;
  653.                  mygun->mag = 5;
  654.                  mygun->reload = 2;
  655.                  mygun->next->name = L"SMG";
  656.                  mygun->next->fullname = L"Submachine Gun";
  657.                  mygun->next->pershot = 16;
  658.                  mygun->next->rof = 0.1;
  659.                  mygun->next->mag = 15;
  660.                  mygun->next->reload = 1;
  661.              } else if (this->comboBox1->Text == L"Spark") {
  662.                  mygun->name = L"VS";
  663.                  mygun->fullname = L"Voltage Spike";
  664.                  mygun->pershot = 50;
  665.                  mygun->rof = 0.325;
  666.                  mygun->mag = 1;
  667.                  mygun->reload = 0;
  668.                  mygun->next->name = L"RG";
  669.                  mygun->next->fullname = L"Ray Gun";
  670.                  mygun->next->pershot = 64;
  671.                  mygun->next->rof = 0.5;
  672.                  mygun->next->mag = 10;
  673.                  mygun->next->reload = 1;
  674.              } else if (this->comboBox1->Text == L"Support") {
  675.                  mygun->name = L"H/H";
  676.                  mygun->fullname = L"Heal/Hurt Gun";
  677.                  mygun->pershot = 10;
  678.                  mygun->rof = 0.25;
  679.                  mygun->mag = 20;
  680.                  mygun->reload = 1.2;
  681.                  mygun->next->name = L"SG";
  682.                  mygun->next->fullname = L"Shotgun";
  683.                  mygun->next->pershot = 120;
  684.                  mygun->next->rof = 0.8;
  685.                  mygun->next->mag = 8;
  686.                  mygun->next->reload = 1.75;
  687.              } else if (this->comboBox1->Text == L"Tank") {
  688.                  mygun->name = L"JG";
  689.                  mygun->fullname = L"Jet Gun";
  690.                  mygun->pershot = 23;
  691.                  mygun->rof = 0.1;
  692.                  mygun->mag = 100;
  693.                  mygun->reload = 2;
  694.                  mygun->next->name = L"RG";
  695.                  mygun->next->fullname = L"Rail Gun";
  696.                  mygun->next->pershot = 75;
  697.                  mygun->next->rof = 1;
  698.                  mygun->next->mag = 6;
  699.                  mygun->next->reload = 2;
  700.              } else if (this->comboBox1->Text == L"Veteran") {
  701.                  mygun->name = L"FF";
  702.                  mygun->fullname = L"Flying Falcon";
  703.                  mygun->pershot = 46;
  704.                  mygun->rof = 0.75;
  705.                  mygun->mag = 3;
  706.                  mygun->reload = 1;
  707.                  mygun->next->name = L"HS";
  708.                  mygun->next->fullname = L"Hot Seat";
  709.                  mygun->next->pershot = 79;
  710.                  mygun->next->rof = 0.5;
  711.                  mygun->next->mag = 1;
  712.                  mygun->next->reload = 0;
  713.              } else if (this->comboBox1->Text == L"Wascot") {
  714.                  mygun->name = L"CL";
  715.                  mygun->fullname = L"Coin Launcher";
  716.                  mygun->pershot = 100;
  717.                  mygun->rof = 1;
  718.                  mygun->mag = 4;
  719.                  mygun->reload = 1.5;
  720.                  mygun->next->name = L"HB";
  721.                  mygun->next->fullname = L"Heartbreaker";
  722.                  mygun->next->pershot = 50;
  723.                  mygun->next->rof = 0.325;
  724.                  mygun->next->mag = 1;
  725.                  mygun->next->reload = 0;
  726.              }
  727.              init(mygun);
  728.              calculate();
  729.          }
  730. ref class gun {
  731.     public:
  732.         System::String^ fullname;
  733.         System::String^ name;
  734.         double pershot;
  735.         double rof;
  736.         double mag;
  737.         double reload;
  738.         gun^ next;
  739.     };
  740. void init(gun^ x) {
  741.     this->pershot->Text = x->pershot.ToString();
  742.     this->rof->Text = x->rof.ToString()->Replace(L',',L'.');
  743.     this->mag->Text = x->mag.ToString();
  744.     this->reload->Text = x->reload.ToString()->Replace(L',',L'.');
  745.     this->button1->Text = x->name;
  746.     pershotv = x->pershot;
  747.     rofv = x->rof;
  748.     magv = x->mag;
  749.     reloadv = x->reload;
  750.     if (magv!=1) {
  751.         maxmag = ceil((round(magv*0.25)/magv-0.5/magv)*10000)/100;
  752.     } else {
  753.         maxmag = 0;
  754.     }
  755.     toolTip1->SetToolTip(this->button1, L"Current weapon preset is for "+x->fullname);
  756.     toolTip1->SetToolTip(this->label8, L"Max useful mag bonus is "+maxmag.ToString()+L"%\nYour endorsed mag size is "+(magv+round(magendov*magv)).ToString());
  757.     toolTip1->SetToolTip(this->label9, L"Your endorsed reload speed is "+(round(100*(reloadv*reloadendov))/100).ToString()->Replace(L',',L'.'));
  758.     toolTip1->SetToolTip(this->label4, L"Your endorsed rate of fire is "+(round(1000*(rofv*rofendov))/1000).ToString()->Replace(L',',L'.'));
  759.     }
  760.    
  761. void swap(gun^ %x) {
  762.     gun^ z;
  763.     z = x;
  764.     x = x->next;
  765.     x->next = z;
  766.     }
  767. double round(double x) {
  768.     double t;
  769.     t = x-floor(x);
  770.     if (t>=0.5) {
  771.         t=ceil(x);
  772.     }
  773.     else {
  774.         t=floor(x);
  775.     }
  776.     return(t);
  777.     }
  778. bool Parse(System::String ^s, double %result) {
  779.     if (s->Contains(L".")) {
  780.         s=s->Replace(L'.',L',');
  781.     }
  782.     if (Double::TryParse(s,result)) {
  783.         return false;
  784.     }
  785.     else {
  786.         return true;
  787.     }
  788. }
  789. gun^ mygun;
  790. double pershotv,rofv,magv,reloadv,rofendov,magendov,reloadendov,maxmag;
  791. int target,offencev,levelv;
  792. void calculate(void) {
  793.     double pershotmod;
  794.     pershotmod = pershotv * ((levelv-1)*0.142857143+1);
  795.     switch (offencev) {
  796.         case 2: pershotmod*=1.16; break;
  797.         case 3: pershotmod*=1.33; break;
  798.         case 4: pershotmod*=1.5; break;
  799.     }
  800.     switch (target) {
  801.         case 2: pershotmod*=((levelv-1)*0.0714285714+1); break;
  802.         case 3: pershotmod*=((levelv-1)*0.142857143+1); break;
  803.     }
  804.     double noreload = round(100*floor(pershotmod)/rofv)/100;
  805.     double dps = round(100*floor(pershotmod)*magv/(rofv*magv+reloadv))/100;
  806.     double dpsendo = round(100*floor(pershotmod)*(magv+round(magendov*magv))/(rofv*rofendov*(magv+round(magendov*magv))+reloadv*reloadendov))/100;
  807.     double dpsgain = round(100*(dpsendo-dps)/dps*100)/100;
  808.     if (rofv==0 || magv==0) {
  809.         noreload=0;
  810.         dps=0;
  811.         dpsendo=0;
  812.         dpsgain=0;
  813.     }
  814.     this->noreload->Text = noreload.ToString()->Replace(L',',L'.');
  815.     this->dps->Text = dps.ToString()->Replace(L',',L'.');
  816.     this->endodps->Text = dpsendo.ToString()->Replace(L',',L'.');
  817.     this->dpsgain->Text = dpsgain.ToString()->Replace(L',',L'.')+L'%';
  818. }
  819. private: System::Void pershot_Leave(System::Object^  sender, System::EventArgs^  e) {
  820.              if (Parse(this->pershot->Text,pershotv)) {this->pershot->Text=L"0"; pershotv=0;}
  821.              calculate();
  822.          }
  823. private: System::Void rof_Leave(System::Object^  sender, System::EventArgs^  e) {
  824.              if (Parse(this->rof->Text,rofv)) {this->rof->Text=L"0"; rofv=0;}
  825.              toolTip1->SetToolTip(this->label4, L"Your endorsed rate of fire is "+(round(1000*(rofv*rofendov))/1000).ToString()->Replace(L',',L'.'));
  826.              calculate();
  827.          }
  828. private: System::Void mag_Leave(System::Object^  sender, System::EventArgs^  e) {
  829.              if (Parse(this->mag->Text,magv)) {this->mag->Text=L"0"; magv=0;}
  830.              if (magv!=1) {
  831.                  maxmag = ceil((round(magv*0.25)/magv-0.5/magv)*10000)/100;
  832.              } else {
  833.                  maxmag = 0;
  834.              }
  835.              toolTip1->SetToolTip(this->label8, L"Max useful mag bonus is "+maxmag.ToString()+L"%\nYour endorsed mag size is "+(magv+round(magendov*magv)).ToString());
  836.              calculate();
  837.          }
  838. private: System::Void reload_Leave(System::Object^  sender, System::EventArgs^  e) {
  839.              if (Parse(this->reload->Text,reloadv)) {this->reload->Text=L"0"; reloadv=0;}
  840.              toolTip1->SetToolTip(this->label9, L"Your endorsed reload speed is "+(round(100*(reloadv*reloadendov))/100).ToString()->Replace(L',',L'.'));
  841.              calculate();
  842.          }
  843. private: System::Void rofendo_Leave(System::Object^  sender, System::EventArgs^  e) {
  844.              if (Parse(this->rofendo->Text,rofendov)) {this->rofendo->Text=L"0"; rofendov=0;}
  845.              else if (rofendov>10) {this->rofendo->Text=L"10"; rofendov=10;}
  846.              rofendov = 1-rofendov/100;
  847.              toolTip1->SetToolTip(this->label4, L"Your endorsed rate of fire is "+(round(1000*(rofv*rofendov))/1000).ToString()->Replace(L',',L'.'));
  848.              calculate();
  849.          }
  850. private: System::Void magendo_Leave(System::Object^  sender, System::EventArgs^  e) {
  851.              if (Parse(this->magendo->Text,magendov)) {this->magendo->Text=L"0"; magendov=0;}
  852.              else if (magendov>25) {this->magendo->Text=L"25"; magendov=25;}
  853.              magendov/=100;
  854.              toolTip1->SetToolTip(this->label8, L"Max useful mag bonus is "+maxmag.ToString()+L"%\nYour endorsed mag size is "+(magv+round(magendov*magv)).ToString());
  855.              calculate();
  856.          }
  857. private: System::Void reloadendo_Leave(System::Object^  sender, System::EventArgs^  e) {
  858.              if (Parse(this->reloadendo->Text,reloadendov)) {this->reloadendo->Text=L"0"; reloadendov=0;}
  859.              else if (magendov>25) {this->reloadendo->Text=L"25"; reloadendov=25;}
  860.              reloadendov=1-reloadendov/100;
  861.              toolTip1->SetToolTip(this->label9, L"Your endorsed reload speed is "+(round(100*(reloadv*reloadendov))/100).ToString()->Replace(L',',L'.'));
  862.              calculate();
  863.          }
  864. private: System::Void players_Click(System::Object^  sender, System::EventArgs^  e) {
  865.              target=1;
  866.              calculate();
  867.          }
  868. private: System::Void turrets_Click(System::Object^  sender, System::EventArgs^  e) {
  869.              target=2;
  870.              calculate();
  871.          }
  872. private: System::Void bots_Click(System::Object^  sender, System::EventArgs^  e) {
  873.              target=3;
  874.              calculate();
  875.          }
  876. private: System::Void offence_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
  877.              if (levelv<4 && this->offence->Value>2) {
  878.                  this->offence->Value=2;
  879.              } else if (levelv<8 && this->offence->Value==4) {
  880.                  this->offence->Value=3;
  881.              }
  882.              if (this->comboBox1->Text == L"Gunner") {
  883.                 if (this->offence->Value==4 && mygun->fullname==L"Minigun") {
  884.                      mygun->name = L"DMG";
  885.                      mygun->fullname = L"Dual Minigun";
  886.                      mygun->pershot = 20;
  887.                      mygun->rof = 0.075;
  888.                      mygun->mag = 300;
  889.                      init(mygun);
  890.                  } else if (this->offence->Value==4 && mygun->next->fullname==L"Minigun") {
  891.                      mygun->next->name = L"DMG";
  892.                      mygun->next->fullname = L"Dual Minigun";
  893.                      mygun->next->pershot = 20;
  894.                      mygun->next->rof = 0.075;
  895.                      mygun->next->mag = 300;
  896.                  } else if (this->offence->Value<4 && mygun->fullname==L"Dual Minigun") {
  897.                      mygun->name = L"MG";
  898.                      mygun->fullname = L"Minigun";
  899.                      mygun->pershot = 25;
  900.                      mygun->rof = 0.1;
  901.                      mygun->mag = 200;
  902.                      init(mygun);
  903.                  } else if (this->offence->Value<4 && mygun->next->fullname==L"Dual Minigun") {
  904.                      mygun->next->name = L"MG";
  905.                      mygun->next->fullname = L"Minigun";
  906.                      mygun->next->pershot = 25;
  907.                      mygun->next->rof = 0.1;
  908.                      mygun->next->mag = 200;
  909.                  }
  910.              }
  911.              offencev=int(this->offence->Value);
  912.              calculate();
  913.          }
  914. private: System::Void level_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
  915.              levelv=int(this->level->Value);
  916.              if (levelv<4 && this->offence->Value>2) {
  917.                  this->offence->Value=2;
  918.              } else if (levelv<8 && this->offence->Value==4) {
  919.                  this->offence->Value=3;
  920.              }
  921.              calculate();
  922.          }
  923. private: System::Void offence_Leave(System::Object^  sender, System::EventArgs^  e) {
  924.              this->offence->Text=this->offence->Value.ToString();
  925.          }
  926. private: System::Void level_Leave(System::Object^  sender, System::EventArgs^  e) {
  927.              this->level->Text=this->level->Value.ToString();
  928.          }
  929. private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
  930.              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");
  931.              pershotv = 0;
  932.              rofv = 0;
  933.              magv = 0;
  934.              reloadv = 0;
  935.              rofendov = 1;
  936.              magendov = 0;
  937.              reloadendov = 1;
  938.              maxmag = 0;
  939.              target = 1;
  940.              offencev = 1;
  941.              levelv = 1;
  942.              mygun = gcnew gun;
  943.              mygun->next = gcnew gun;
  944.          }
  945. private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  946.             swap(mygun);
  947.             init(mygun);
  948.             calculate();
  949.          }
  950. };
  951. }
Add Comment
Please, Sign In to add comment