~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/stats.php

  • Committer: zodiacsohma1 at gmail
  • Date: 2014-03-02 08:09:55 UTC
  • Revision ID: zodiacsohma1@gmail.com-20140302080955-r5ot6eipfe0nlpww
Simplified all fields and code in all areas for better as they seem to repeat themselves.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
    if ($name == "")
18
18
    {
19
19
        $record = getRecord($player->log);
20
 
        if (isset($record) && !is_null($record) && $record instanceof Record)
 
20
        if (isset($record) && $record instanceof Record)
21
21
        {
22
22
            //  inform the user about their stats
23
23
            pm($player, "0x88ff22------------------------------------");
45
45
        {
46
46
            foreach (Base::$base->RECORDS as $record)
47
47
            {
48
 
                if (isset($record) && !is_null($record) && $record instanceof Record && contains($record->name, $name, false))
 
48
                if (isset($record) && $record instanceof Record && contains($record->name, $name, false))
49
49
                {
50
50
                    $player_found = true;
51
51
 
101
101
    {
102
102
        foreach (Base::$base->RECORDS as $record)
103
103
        {
104
 
            if (isset($record) && !is_null($record) && $record instanceof Record && contains($record->name, $name, false))
 
104
            if (isset($record) && $record instanceof Record && contains($record->name, $name, false))
105
105
            {
106
106
                $accounts[] = $record;
107
107
            }
116
116
        $players_msg = "";
117
117
        foreach ($accounts as $key => $record)
118
118
        {
119
 
            if (isset($record) && !is_null($record) && $record instanceof Record)
 
119
            if (isset($record) && $record instanceof Record)
120
120
            {
121
121
                if (($key + 1) == count($accounts))
122
122
                    $players_msg .= "0x77ff88".$record->name;
133
133
        return;
134
134
    }
135
135
 
136
 
    if (isset($u_record) && !is_null($u_record) && $u_record instanceof Record)
 
136
    if (isset($u_record) && $u_record instanceof Record)
137
137
    {
138
138
        switch ($type)
139
139
        {
152
152
                        $attacks_learnt_msg = "0xff77ff".$player." 0xf7f700mastered ";
153
153
                        foreach ($attacks_learnt as $key => $attack)
154
154
                        {
155
 
                            if (isset($attack) && !is_null($attack) && $attack instanceof Attack)
 
155
                            if (isset($attack) && $attack instanceof Attack)
156
156
                            {
157
157
                                if (($key + 1) == count($attacks_learnt))
158
158
                                    $attacks_learnt_msg .= "0x77ff99".$attack;