Advertisement
Awpteamoose

Untitled

Mar 21st, 2012
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 22.26 KB | None | 0 0
  1. #pragma once
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <cmath>
  5.  
  6. namespace dpscalc {
  7.  
  8.     using namespace System;
  9.     using namespace System::ComponentModel;
  10.     using namespace System::Collections;
  11.     using namespace System::Windows::Forms;
  12.     using namespace System::Data;
  13.     using namespace System::Drawing;
  14.  
  15.     /// <summary>
  16.     /// Summary for Form1
  17.     ///
  18.     /// WARNING: If you change the name of this class, you will need to change the
  19.     ///          'Resource File Name' property for the managed resource compiler tool
  20.     ///          associated with all .resx files this class depends on.  Otherwise,
  21.     ///          the designers will not be able to interact properly with localized
  22.     ///          resources associated with this form.
  23.     /// </summary>
  24.     public ref class Form1 : public System::Windows::Forms::Form
  25.     {
  26.     public:
  27.         Form1(void)
  28.         {
  29.             InitializeComponent();
  30.             //
  31.             //TODO: Add the constructor code here
  32.             //
  33.         }
  34.  
  35.     protected:
  36.         /// <summary>
  37.         /// Clean up any resources being used.
  38.         /// </summary>
  39.         ~Form1()
  40.         {
  41.             if (components)
  42.             {
  43.                 delete components;
  44.             }
  45.         }
  46.     private: System::Windows::Forms::TextBox^  pershot;
  47.     protected:
  48.  
  49.     protected:
  50.     private: System::Windows::Forms::Label^  label1;
  51.     private: System::Windows::Forms::Label^  label2;
  52.     private: System::Windows::Forms::TextBox^  rof;
  53.  
  54.     private: System::Windows::Forms::Label^  label3;
  55.     private: System::Windows::Forms::TextBox^  mag;
  56.  
  57.     private: System::Windows::Forms::ComboBox^  comboBox1;
  58.     private: System::Windows::Forms::Label^  label4;
  59.  
  60.  
  61.     private: System::Windows::Forms::Label^  label7;
  62.     private: System::Windows::Forms::TextBox^  reload;
  63.     private: System::Windows::Forms::TextBox^  rofendo;
  64.     private: System::Windows::Forms::TextBox^  magendo;
  65.  
  66.  
  67.  
  68.     private: System::Windows::Forms::Label^  label8;
  69.     private: System::Windows::Forms::TextBox^  reloadendo;
  70.  
  71.     private: System::Windows::Forms::Label^  label9;
  72.     private: System::Windows::Forms::Label^  label5;
  73.     private: System::Windows::Forms::TextBox^  dps;
  74.  
  75.     private: System::Windows::Forms::Label^  label6;
  76.     private: System::Windows::Forms::Label^  label10;
  77.     private: System::Windows::Forms::TextBox^  endodps;
  78.  
  79.     private: System::Windows::Forms::Label^  label11;
  80.     private: System::Windows::Forms::TextBox^  dpsgain;
  81.  
  82.  
  83.  
  84.  
  85.  
  86.     protected:
  87.  
  88.  
  89.     private:
  90.         /// <summary>
  91.         /// Required designer variable.
  92.         /// </summary>
  93.         System::ComponentModel::Container ^components;
  94.  
  95. #pragma region Windows Form Designer generated code
  96.         /// <summary>
  97.         /// Required method for Designer support - do not modify
  98.         /// the contents of this method with the code editor.
  99.         /// </summary>
  100.         void InitializeComponent(void)
  101.         {
  102.             System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
  103.             this->pershot = (gcnew System::Windows::Forms::TextBox());
  104.             this->label1 = (gcnew System::Windows::Forms::Label());
  105.             this->label2 = (gcnew System::Windows::Forms::Label());
  106.             this->rof = (gcnew System::Windows::Forms::TextBox());
  107.             this->label3 = (gcnew System::Windows::Forms::Label());
  108.             this->mag = (gcnew System::Windows::Forms::TextBox());
  109.             this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
  110.             this->label4 = (gcnew System::Windows::Forms::Label());
  111.             this->label7 = (gcnew System::Windows::Forms::Label());
  112.             this->reload = (gcnew System::Windows::Forms::TextBox());
  113.             this->rofendo = (gcnew System::Windows::Forms::TextBox());
  114.             this->magendo = (gcnew System::Windows::Forms::TextBox());
  115.             this->label8 = (gcnew System::Windows::Forms::Label());
  116.             this->reloadendo = (gcnew System::Windows::Forms::TextBox());
  117.             this->label9 = (gcnew System::Windows::Forms::Label());
  118.             this->label5 = (gcnew System::Windows::Forms::Label());
  119.             this->dps = (gcnew System::Windows::Forms::TextBox());
  120.             this->label6 = (gcnew System::Windows::Forms::Label());
  121.             this->label10 = (gcnew System::Windows::Forms::Label());
  122.             this->endodps = (gcnew System::Windows::Forms::TextBox());
  123.             this->label11 = (gcnew System::Windows::Forms::Label());
  124.             this->dpsgain = (gcnew System::Windows::Forms::TextBox());
  125.             this->SuspendLayout();
  126.             //
  127.             // pershot
  128.             //
  129.             this->pershot->BackColor = System::Drawing::SystemColors::Window;
  130.             this->pershot->Location = System::Drawing::Point(106, 12);
  131.             this->pershot->Name = L"pershot";
  132.             this->pershot->Size = System::Drawing::Size(56, 20);
  133.             this->pershot->TabIndex = 0;
  134.             this->pershot->Text = L"0";
  135.             this->pershot->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  136.             this->pershot->Leave += gcnew System::EventHandler(this, &Form1::pershot_Leave);
  137.             //
  138.             // label1
  139.             //
  140.             this->label1->AutoSize = true;
  141.             this->label1->Location = System::Drawing::Point(12, 15);
  142.             this->label1->Name = L"label1";
  143.             this->label1->Size = System::Drawing::Size(88, 13);
  144.             this->label1->TabIndex = 1;
  145.             this->label1->Text = L"Damage per shot";
  146.             //
  147.             // label2
  148.             //
  149.             this->label2->AutoSize = true;
  150.             this->label2->Location = System::Drawing::Point(12, 41);
  151.             this->label2->Name = L"label2";
  152.             this->label2->Size = System::Drawing::Size(59, 13);
  153.             this->label2->TabIndex = 3;
  154.             this->label2->Text = L"Rate of fire";
  155.             //
  156.             // rof
  157.             //
  158.             this->rof->Location = System::Drawing::Point(106, 38);
  159.             this->rof->Name = L"rof";
  160.             this->rof->Size = System::Drawing::Size(56, 20);
  161.             this->rof->TabIndex = 2;
  162.             this->rof->Text = L"0";
  163.             this->rof->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  164.             this->rof->Leave += gcnew System::EventHandler(this, &Form1::rof_Leave);
  165.             //
  166.             // label3
  167.             //
  168.             this->label3->AutoSize = true;
  169.             this->label3->Location = System::Drawing::Point(12, 67);
  170.             this->label3->Name = L"label3";
  171.             this->label3->Size = System::Drawing::Size(49, 13);
  172.             this->label3->TabIndex = 5;
  173.             this->label3->Text = L"Mag size";
  174.             this->label3->Click += gcnew System::EventHandler(this, &Form1::label3_Click);
  175.             //
  176.             // mag
  177.             //
  178.             this->mag->Location = System::Drawing::Point(106, 64);
  179.             this->mag->Name = L"mag";
  180.             this->mag->Size = System::Drawing::Size(56, 20);
  181.             this->mag->TabIndex = 4;
  182.             this->mag->Text = L"0";
  183.             this->mag->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  184.             this->mag->Leave += gcnew System::EventHandler(this, &Form1::mag_Leave);
  185.             //
  186.             // comboBox1
  187.             //
  188.             this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
  189.             this->comboBox1->FormattingEnabled = true;
  190.             this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^  >(29) {L"Assassin Blade", L"Assassin Shuriken", L"Spark Voltage Spike",
  191.                 L"Spark Ray Gun", L"Wascot Heartbreaker", L"Wascot Coin Launcher", L"Assault Rifle", L"Assault Grenade Launcher", L"Karl Handler",
  192.                 L"Karl Bouncing Buddies", L"Megabeth Rocket Ma\'am", L"Megabeth Bearing Hates", L"Cheston Tommy Gun", L"Cheston Family Jewel",
  193.                 L"Gunner Minigun", L"Gunner Dual Minigun", L"Gunner Mortar", L"Tank Jetgun", L"Tank Railgun", L"Veteran Falcon", L"Veteran Hot Seat",
  194.                 L"Combat Girl Combat Healer", L"Combat Girl Nailgun", L"Support Heal/Hurt Gun", L"Support Shotgun", L"Gunslinger Lucinda", L"Gunslinger Love Pistol",
  195.                 L"Sniper Rifle", L"Sniper SMG"});
  196.             this->comboBox1->Location = System::Drawing::Point(12, 116);
  197.             this->comboBox1->Name = L"comboBox1";
  198.             this->comboBox1->Size = System::Drawing::Size(150, 21);
  199.             this->comboBox1->TabIndex = 6;
  200.             this->comboBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox1_SelectedIndexChanged);
  201.             //
  202.             // label4
  203.             //
  204.             this->label4->AutoSize = true;
  205.             this->label4->Location = System::Drawing::Point(12, 146);
  206.             this->label4->Name = L"label4";
  207.             this->label4->Size = System::Drawing::Size(61, 13);
  208.             this->label4->TabIndex = 9;
  209.             this->label4->Text = L"ROF bonus";
  210.             //
  211.             // label7
  212.             //
  213.             this->label7->AutoSize = true;
  214.             this->label7->Location = System::Drawing::Point(12, 93);
  215.             this->label7->Name = L"label7";
  216.             this->label7->Size = System::Drawing::Size(73, 13);
  217.             this->label7->TabIndex = 13;
  218.             this->label7->Text = L"Reload speed";
  219.             //
  220.             // reload
  221.             //
  222.             this->reload->Location = System::Drawing::Point(106, 90);
  223.             this->reload->Name = L"reload";
  224.             this->reload->Size = System::Drawing::Size(56, 20);
  225.             this->reload->TabIndex = 12;
  226.             this->reload->Text = L"0";
  227.             this->reload->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  228.             this->reload->Leave += gcnew System::EventHandler(this, &Form1::reload_Leave);
  229.             //
  230.             // rofendo
  231.             //
  232.             this->rofendo->Location = System::Drawing::Point(106, 143);
  233.             this->rofendo->Name = L"rofendo";
  234.             this->rofendo->Size = System::Drawing::Size(56, 20);
  235.             this->rofendo->TabIndex = 14;
  236.             this->rofendo->Text = L"0";
  237.             this->rofendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  238.             this->rofendo->Leave += gcnew System::EventHandler(this, &Form1::rofendo_Leave);
  239.             //
  240.             // magendo
  241.             //
  242.             this->magendo->Location = System::Drawing::Point(106, 169);
  243.             this->magendo->Name = L"magendo";
  244.             this->magendo->Size = System::Drawing::Size(56, 20);
  245.             this->magendo->TabIndex = 16;
  246.             this->magendo->Text = L"0";
  247.             this->magendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  248.             this->magendo->Leave += gcnew System::EventHandler(this, &Form1::magendo_Leave);
  249.             //
  250.             // label8
  251.             //
  252.             this->label8->AutoSize = true;
  253.             this->label8->Location = System::Drawing::Point(12, 172);
  254.             this->label8->Name = L"label8";
  255.             this->label8->Size = System::Drawing::Size(60, 13);
  256.             this->label8->TabIndex = 15;
  257.             this->label8->Text = L"Mag bonus";
  258.             //
  259.             // reloadendo
  260.             //
  261.             this->reloadendo->Location = System::Drawing::Point(106, 195);
  262.             this->reloadendo->Name = L"reloadendo";
  263.             this->reloadendo->Size = System::Drawing::Size(56, 20);
  264.             this->reloadendo->TabIndex = 18;
  265.             this->reloadendo->Text = L"0";
  266.             this->reloadendo->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  267.             this->reloadendo->Leave += gcnew System::EventHandler(this, &Form1::reloadendo_Leave);
  268.             //
  269.             // label9
  270.             //
  271.             this->label9->AutoSize = true;
  272.             this->label9->Location = System::Drawing::Point(12, 198);
  273.             this->label9->Name = L"label9";
  274.             this->label9->Size = System::Drawing::Size(73, 13);
  275.             this->label9->TabIndex = 17;
  276.             this->label9->Text = L"Reload bonus";
  277.             //
  278.             // label5
  279.             //
  280.             this->label5->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
  281.             this->label5->Location = System::Drawing::Point(12, 223);
  282.             this->label5->Name = L"label5";
  283.             this->label5->Size = System::Drawing::Size(148, 2);
  284.             this->label5->TabIndex = 19;
  285.             this->label5->Text = L" ";
  286.             //
  287.             // dps
  288.             //
  289.             this->dps->BackColor = System::Drawing::SystemColors::Control;
  290.             this->dps->Location = System::Drawing::Point(104, 236);
  291.             this->dps->Name = L"dps";
  292.             this->dps->ReadOnly = true;
  293.             this->dps->Size = System::Drawing::Size(56, 20);
  294.             this->dps->TabIndex = 20;
  295.             this->dps->Text = L"0";
  296.             this->dps->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  297.             //
  298.             // label6
  299.             //
  300.             this->label6->AutoSize = true;
  301.             this->label6->Location = System::Drawing::Point(12, 239);
  302.             this->label6->Name = L"label6";
  303.             this->label6->Size = System::Drawing::Size(29, 13);
  304.             this->label6->TabIndex = 21;
  305.             this->label6->Text = L"DPS";
  306.             //
  307.             // label10
  308.             //
  309.             this->label10->AutoSize = true;
  310.             this->label10->Location = System::Drawing::Point(12, 265);
  311.             this->label10->Name = L"label10";
  312.             this->label10->Size = System::Drawing::Size(77, 13);
  313.             this->label10->TabIndex = 23;
  314.             this->label10->Text = L"Endorsed DPS";
  315.             //
  316.             // endodps
  317.             //
  318.             this->endodps->Location = System::Drawing::Point(104, 262);
  319.             this->endodps->Name = L"endodps";
  320.             this->endodps->ReadOnly = true;
  321.             this->endodps->Size = System::Drawing::Size(56, 20);
  322.             this->endodps->TabIndex = 22;
  323.             this->endodps->Text = L"0";
  324.             this->endodps->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  325.             //
  326.             // label11
  327.             //
  328.             this->label11->AutoSize = true;
  329.             this->label11->Location = System::Drawing::Point(12, 291);
  330.             this->label11->Name = L"label11";
  331.             this->label11->Size = System::Drawing::Size(52, 13);
  332.             this->label11->TabIndex = 25;
  333.             this->label11->Text = L"DPS gain";
  334.             //
  335.             // dpsgain
  336.             //
  337.             this->dpsgain->Location = System::Drawing::Point(104, 288);
  338.             this->dpsgain->Name = L"dpsgain";
  339.             this->dpsgain->ReadOnly = true;
  340.             this->dpsgain->Size = System::Drawing::Size(56, 20);
  341.             this->dpsgain->TabIndex = 24;
  342.             this->dpsgain->Text = L"0";
  343.             this->dpsgain->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
  344.             //
  345.             // Form1
  346.             //
  347.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  348.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  349.             this->ClientSize = System::Drawing::Size(174, 320);
  350.             this->Controls->Add(this->label11);
  351.             this->Controls->Add(this->dpsgain);
  352.             this->Controls->Add(this->label10);
  353.             this->Controls->Add(this->endodps);
  354.             this->Controls->Add(this->label6);
  355.             this->Controls->Add(this->dps);
  356.             this->Controls->Add(this->label5);
  357.             this->Controls->Add(this->reloadendo);
  358.             this->Controls->Add(this->label9);
  359.             this->Controls->Add(this->magendo);
  360.             this->Controls->Add(this->label8);
  361.             this->Controls->Add(this->rofendo);
  362.             this->Controls->Add(this->label7);
  363.             this->Controls->Add(this->reload);
  364.             this->Controls->Add(this->label4);
  365.             this->Controls->Add(this->comboBox1);
  366.             this->Controls->Add(this->label3);
  367.             this->Controls->Add(this->mag);
  368.             this->Controls->Add(this->label2);
  369.             this->Controls->Add(this->rof);
  370.             this->Controls->Add(this->label1);
  371.             this->Controls->Add(this->pershot);
  372.             this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
  373.             this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
  374.             this->MaximizeBox = false;
  375.             this->MinimizeBox = false;
  376.             this->Name = L"Form1";
  377.             this->ShowIcon = false;
  378.             this->ShowInTaskbar = false;
  379.             this->Text = L"DPS calc";
  380.             this->TopMost = true;
  381.             this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
  382.             this->ResumeLayout(false);
  383.             this->PerformLayout();
  384.  
  385.         }
  386. #pragma endregion
  387.     private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
  388.              }
  389.     private: System::Void textBox1_Leave(System::Object^  sender, System::EventArgs^  e) {
  390.              }
  391.     private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
  392.              }
  393.     private: System::Void label3_Click(System::Object^  sender, System::EventArgs^  e) {
  394.              }
  395. private: System::Void comboBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
  396.              if (this->comboBox1->Text == L"Assassin Blade") {
  397.                  this->pershot->Text = L"65";
  398.                  this->rof->Text = L"0,5";
  399.                  this->mag->Text = L"1";
  400.                  this->reload->Text = L"0";
  401.              }
  402.              else if (this->comboBox1->Text == L"Assassin Shuriken") {
  403.                  this->pershot->Text = L"30";
  404.                  this->rof->Text = L"0,1";
  405.                  this->mag->Text = L"4";
  406.                  this->reload->Text = L"1";
  407.              }
  408.              else if (this->comboBox1->Text == L"Spark Voltage Spike") {
  409.                  this->pershot->Text = L"50";
  410.                  this->rof->Text = L"0,325";
  411.                  this->mag->Text = L"1";
  412.                  this->reload->Text = L"0";
  413.              }
  414.              else if (this->comboBox1->Text == L"Spark Ray Gun") {
  415.                  this->pershot->Text = L"64";
  416.                  this->rof->Text = L"0,5";
  417.                  this->mag->Text = L"10";
  418.                  this->reload->Text = L"1";
  419.              }
  420.              else if (this->comboBox1->Text == L"Wascot Heartbreaker") {
  421.                  this->pershot->Text = L"50";
  422.                  this->rof->Text = L"0,325";
  423.                  this->mag->Text = L"1";
  424.                  this->reload->Text = L"0";
  425.              }
  426.              else if (this->comboBox1->Text == L"Wascot Coin Launcher") {
  427.                  this->pershot->Text = L"100";
  428.                  this->rof->Text = L"1";
  429.                  this->mag->Text = L"4";
  430.                  this->reload->Text = L"1,5";
  431.              }
  432.              else if (this->comboBox1->Text == L"Assault Rifle") {
  433.                  this->pershot->Text = L"18";
  434.                  this->rof->Text = L"0,1";
  435.                  this->mag->Text = L"25";
  436.                  this->reload->Text = L"1";
  437.              }
  438.              else if (this->comboBox1->Text == L"Assault Grenade Launcher") {
  439.                  this->pershot->Text = L"99";
  440.                  this->rof->Text = L"0,75";
  441.                  this->mag->Text = L"6";
  442.                  this->reload->Text = L"1,8";
  443.              }
  444.              else if (this->comboBox1->Text == L"Karl Handler") {
  445.                  this->pershot->Text = L"36";
  446.                  this->rof->Text = L"0,2";
  447.                  this->mag->Text = L"15";
  448.                  this->reload->Text = L"1";
  449.              }
  450.              else if (this->comboBox1->Text == L"Karl Bouncing Buddies") {
  451.                  this->pershot->Text = L"70";
  452.                  this->rof->Text = L"0,25";
  453.                  this->mag->Text = L"4";
  454.                  this->reload->Text = L"1,75";
  455.              }
  456.              else if (this->comboBox1->Text == L"Megabeth Rocket Ma'am") {
  457.                  this->pershot->Text = L"120";
  458.                  this->rof->Text = L"0,7";
  459.                  this->mag->Text = L"4";
  460.                  this->reload->Text = L"1,35";
  461.              }
  462.              else if (this->comboBox1->Text == L"Megabeth Bearing Hates") {
  463.                  this->pershot->Text = L"27";
  464.                  this->rof->Text = L"0,2";
  465.                  this->mag->Text = L"20";
  466.                  this->reload->Text = L"1";
  467.              }
  468.              else if (this->comboBox1->Text == L"Cheston Tommy Gun") {
  469.                  this->pershot->Text = L"21";
  470.                  this->rof->Text = L"0,1";
  471.                  this->mag->Text = L"100";
  472.                  this->reload->Text = L"2";
  473.              }
  474.              else if (this->comboBox1->Text == L"Cheston Family Jewel") {
  475.                  this->pershot->Text = L"88";
  476.                  this->rof->Text = L"0,5";
  477.                  this->mag->Text = L"1";
  478.                  this->reload->Text = L"0";
  479.              }
  480.              else if (this->comboBox1->Text == L"Gunner Minigun") {
  481.                  this->pershot->Text = L"25";
  482.                  this->rof->Text = L"0,1";
  483.                  this->mag->Text = L"200";
  484.                  this->reload->Text = L"5";
  485.              }
  486.              else if (this->comboBox1->Text == L"Gunner Dual Minigun") {
  487.                  this->pershot->Text = L"20";
  488.                  this->rof->Text = L"0,075";
  489.                  this->mag->Text = L"300";
  490.                  this->reload->Text = L"5";
  491.              }
  492.              else if (this->comboBox1->Text == L"Gunner Mortar") {
  493.                  this->pershot->Text = L"50";
  494.                  this->rof->Text = L"1";
  495.                  this->mag->Text = L"10";
  496.                  this->reload->Text = L"2";
  497.              }
  498.              else if (this->comboBox1->Text == L"Tank Jetgun") {
  499.                  this->pershot->Text = L"23";
  500.                  this->rof->Text = L"0,1";
  501.                  this->mag->Text = L"100";
  502.                  this->reload->Text = L"2";
  503.              }
  504.              else if (this->comboBox1->Text == L"Tank Railgun") {
  505.                  this->pershot->Text = L"75";
  506.                  this->rof->Text = L"1";
  507.                  this->mag->Text = L"6";
  508.                  this->reload->Text = L"2";
  509.              }
  510.              else if (this->comboBox1->Text == L"Veteran Falcon") {
  511.                  this->pershot->Text = L"46";
  512.                  this->rof->Text = L"0,75";
  513.                  this->mag->Text = L"3";
  514.                  this->reload->Text = L"1";
  515.              }
  516.              else if (this->comboBox1->Text == L"Veteran Hot Seat") {
  517.                  this->pershot->Text = L"79";
  518.                  this->rof->Text = L"0,5";
  519.                  this->mag->Text = L"1";
  520.                  this->reload->Text = L"0";
  521.              }
  522.              else if (this->comboBox1->Text == L"Combat Girl Combat Healer") {
  523.                  this->pershot->Text = L"5";
  524.                  this->rof->Text = L"0,25";
  525.                  this->mag->Text = L"1";
  526.                  this->reload->Text = L"0";
  527.              }
  528.              else if (this->comboBox1->Text == L"Combat Girl Nailgun") {
  529.                  this->pershot->Text = L"27";
  530.                  this->rof->Text = L"0,15";
  531.                  this->mag->Text = L"15";
  532.                  this->reload->Text = L"1";
  533.              }
  534.              else if (this->comboBox1->Text == L"Support Heal/Hurt Gun") {
  535.                  this->pershot->Text = L"10";
  536.                  this->rof->Text = L"0,25";
  537.                  this->mag->Text = L"20";
  538.                  this->reload->Text = L"1,2";
  539.              }
  540.              else if (this->comboBox1->Text == L"Support Shotgun") {
  541.                  this->pershot->Text = L"120";
  542.                  this->rof->Text = L"0,8";
  543.                  this->mag->Text = L"8";
  544.                  this->reload->Text = L"1,75";
  545.              }
  546.              else if (this->comboBox1->Text == L"Gunslinger Lucinda") {
  547.                  this->pershot->Text = L"54";
  548.                  this->rof->Text = L"0,75";
  549.                  this->mag->Text = L"10";
  550.                  this->reload->Text = L"1,5";
  551.              }
  552.              else if (this->comboBox1->Text == L"Gunslinger Love Pistol") {
  553.                  this->pershot->Text = L"37";
  554.                  this->rof->Text = L"0,3";
  555.                  this->mag->Text = L"6";
  556.                  this->reload->Text = L"1";
  557.              }
  558.              else if (this->comboBox1->Text == L"Sniper Rifle") {
  559.                  this->pershot->Text = L"67";
  560.                  this->rof->Text = L"1";
  561.                  this->mag->Text = L"5";
  562.                  this->reload->Text = L"2";
  563.              }
  564.              else if (this->comboBox1->Text == L"Sniper SMG") {
  565.                  this->pershot->Text = L"16";
  566.                  this->rof->Text = L"0,1";
  567.                  this->mag->Text = L"15";
  568.                  this->reload->Text = L"1";
  569.              }
  570.              calculate();
  571.          }
  572. void calculate(void) {
  573.     double pershot = double::Parse(this->pershot->Text);
  574.     double rof = double::Parse(this->rof->Text);
  575.     double mag = double::Parse(this->mag->Text);
  576.     double reload = double::Parse(this->reload->Text);
  577.     double rofendo = 1-double::Parse(this->rofendo->Text)/100;
  578.     double magendo = double::Parse(this->magendo->Text)/100;
  579.     double reloadendo = 1-double::Parse(this->reloadendo->Text)/100;
  580.     double magbonus = 0;
  581.     double t;
  582.     magbonus = magendo*mag;
  583.     t=magbonus-floor(magbonus);
  584.     if (t>=0.5) {magbonus=ceil(magbonus);} else {magbonus=floor(magbonus);}
  585.     double dps = pershot*mag/(rof*mag+reload);
  586.     double dpsendo = pershot*(mag+magbonus)/(rof*rofendo*(mag+magbonus)+reload*reloadendo);
  587.     double dpsgain = (1-dps/dpsendo)*100;
  588.     t=dpsgain-floor(dpsgain);
  589.     if (t>=0.5) {dpsgain=ceil(dpsgain);} else {dpsgain=floor(dpsgain);}
  590.     dps*=100;
  591.     dps=static_cast<int>(dps);
  592.     dps/=100;
  593.     dpsendo*=100;
  594.     dpsendo=static_cast<int>(dpsendo);
  595.     dpsendo/=100;
  596.     this->dps->Text = dps.ToString();
  597.     this->endodps->Text = dpsendo.ToString();
  598.     this->dpsgain->Text = dpsgain.ToString()+L'%';
  599. }
  600. private: System::Void pershot_Leave(System::Object^  sender, System::EventArgs^  e) {
  601.              calculate();
  602.          }
  603. private: System::Void rof_Leave(System::Object^  sender, System::EventArgs^  e) {
  604.              calculate();
  605.          }
  606. private: System::Void mag_Leave(System::Object^  sender, System::EventArgs^  e) {
  607.              calculate();
  608.          }
  609. private: System::Void reload_Leave(System::Object^  sender, System::EventArgs^  e) {
  610.              calculate();
  611.          }
  612. private: System::Void rofendo_Leave(System::Object^  sender, System::EventArgs^  e) {
  613.              calculate();
  614.          }
  615. private: System::Void magendo_Leave(System::Object^  sender, System::EventArgs^  e) {
  616.              calculate();
  617.          }
  618. private: System::Void reloadendo_Leave(System::Object^  sender, System::EventArgs^  e) {
  619.              calculate();
  620.          }
  621. };
  622. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement