Advertisement
Awpteamoose

Untitled

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