1: <?php
2:
3: namespace Budabot\User\Modules;
4:
5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
19: class AXPController {
20:
21: 22: 23: 24:
25: public $moduleName;
26:
27:
28: public $text;
29:
30: private $axp = array();
31:
32: public function __construct() {
33:
34: $this->axp[1] = 1500;
35: $this->axp[2] = 9000;
36: $this->axp[3] = 22500;
37: $this->axp[4] = 42000;
38: $this->axp[5] = 67500;
39: $this->axp[6] = 99000;
40: $this->axp[7] = 136500;
41: $this->axp[8] = 180000;
42: $this->axp[9] = 229500;
43: $this->axp[10] = 285000;
44: $this->axp[11] = 346500;
45: $this->axp[12] = 414000;
46: $this->axp[13] = 487500;
47: $this->axp[14] = 567000;
48: $this->axp[15] = 697410;
49: $this->axp[16] = 857814;
50: $this->axp[17] = 1055112;
51: $this->axp[18] = 1297787;
52: $this->axp[19] = 1596278;
53: $this->axp[20] = 1931497;
54: $this->axp[21] = 2298481;
55: $this->axp[22] = 2689223;
56: $this->axp[23] = 3092606;
57: $this->axp[24] = 3494645;
58: $this->axp[25] = 3879056;
59: $this->axp[26] = 4228171;
60: $this->axp[27] = 4608707;
61: $this->axp[28] = 5023490;
62: $this->axp[29] = 5475604;
63: $this->axp[30] = 5968409;
64: $this->axp[31] = 0;
65: }
66:
67: 68: 69: 70:
71: public function axpListCommand($message, $channel, $sender, $sendto, $args) {
72: $blob = "<u>AI Lvl - AXP - Rank - Lvl Req.</u>\n";
73: $blob .= " 1 - 1.500 - Fledgling - 5\n";
74: $blob .= " 2 - 9.000 - Amateur - 15\n";
75: $blob .= " 3 - 22.500 - Beginner - 25\n";
76: $blob .= " 4 - 42.000 - Starter - 35\n";
77: $blob .= " 5 - 67.500 - Newcomer - 45\n";
78: $blob .= " 6 - 99.000 - Student - 55\n";
79: $blob .= " 7 - 136.500 - Common - 65\n";
80: $blob .= " 8 - 180.000 - Intermediate - 75\n";
81: $blob .= " 9 - 229.500 - Mediocre - 85\n";
82: $blob .= "10 - 285.000 - Fair - 95\n";
83: $blob .= "11 - 346.500 - Able - 105\n";
84: $blob .= "12 - 414.000 - Accomplished - 110\n";
85: $blob .= "13 - 487.500 - Adept - 115\n";
86: $blob .= "14 - 567.000 - Qualified - 120\n";
87: $blob .= "15 - 697.410 - Competent - 125\n";
88: $blob .= "16 - 857.814 - Suited - 130\n";
89: $blob .= "17 - 1.055.112 - Talented - 135\n";
90: $blob .= "18 - 1.297.787 - Trustworthy - 140\n";
91: $blob .= "19 - 1.596.278 - Supporter - 145\n";
92: $blob .= "20 - 1.931.497 - Backer - 150\n";
93: $blob .= "21 - 2.298.481 - Defender - 155\n";
94: $blob .= "22 - 2.689.223 - Challenger - 160\n";
95: $blob .= "23 - 3.092.606 - Patron - 165\n";
96: $blob .= "24 - 3.494.645 - Protector - 170\n";
97: $blob .= "25 - 3.879.056 - Medalist - 175\n";
98: $blob .= "26 - 4.228.171 - Champ - 180\n";
99: $blob .= "27 - 4.608.707 - Hero - 185\n";
100: $blob .= "28 - 5.023.490 - Guardian - 190\n";
101: $blob .= "29 - 5.475.604 - Vanquisher - 195\n";
102: $blob .= "30 - 5.968.409 - Vindicator - 200\n";
103:
104: $msg = $this->text->makeBlob("Alien Experience", $blob);
105:
106: $sendto->reply($msg);
107: }
108:
109: 110: 111: 112:
113: public function axpSingleCommand($message, $channel, $sender, $sendto, $args) {
114: $level = $args[1];
115: if ($level >= 0 && $level <= 30) {
116: $msg = "At AI level <highlight>$level<end> you need <highlight>".number_format($this->axp[$level + 1])."<end> AXP to level up.";
117: } else {
118: $msg = "AI level must be between 0 and 30.";
119: }
120:
121: $sendto->reply($msg);
122: }
123:
124: 125: 126: 127:
128: public function axpDoubleCommand($message, $channel, $sender, $sendto, $args) {
129: $startLevel = $args[1];
130: $endLevel = $args[2];
131: if ($startLevel >= 0 && $startLevel <= 30 && $endLevel >= 0 && $endLevel <= 30) {
132: if ($startLevel <= $endLevel) {
133: for ($i = $startLevel + 1; $i <= $endLevel; $i++) {
134: $axp_comp += $this->axp[$i];
135: }
136:
137: $msg = "From the beginning of AI level <highlight>$startLevel<end> you need <highlight>".number_format($axp_comp)."<end> AXP to reach AI level <highlight>$endLevel<end>.";
138: } else {
139: $msg = "The start level cannot be higher than the end level.";
140: }
141: } else {
142: $msg = "AI level must be between 0 and 30.";
143: }
144:
145: $sendto->reply($msg);
146: }
147: }
148: