~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/zombie.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:
71
71
            {
72
72
                try
73
73
                {
74
 
                    if (isset($p) && !is_null($p) && $p instanceof Player && $p->human)
 
74
                    if (isset($p) && $p instanceof Player && $p->human)
75
75
                    {
76
 
                        if (isset($p->cycle) && !is_null($p->cycle) && $p->cycle instanceof Cycle && $p->cycle->alive)
 
76
                        if (isset($p->cycle) && $p->cycle instanceof Cycle && $p->cycle->alive)
77
77
                        {
78
78
                            $record = getRecord($p->log);
79
 
                            if (isset($record) && !is_null($record) && $record instanceof Record)
 
79
                            if (isset($record) && $record instanceof Record)
80
80
                            {
81
81
                                if ($p->cycle->speed > 30)
82
82
                                    $gain += round($p->cycle->speed / 12);
113
113
            if (isset($times[$i]))
114
114
            {
115
115
                $record = $times[$i];
116
 
                if (isset($record) && !is_null($record) && $record instanceof Record)
 
116
                if (isset($record) && $record instanceof Record)
117
117
                {
118
118
                    $id = $i + 1;
119
119
                    for($lenT = strlen($id); $lenT < $len; $lenT++)
129
129
        for($i = 0; $i < count($times); $i++)
130
130
        {
131
131
            $record = $times[$i];
132
 
            if (isset($record) && !is_null($record) && $record instanceof Record)
 
132
            if (isset($record) && $record instanceof Record)
133
133
            {
134
134
                $player = getPlayerByLog($record->name);
135
 
                if (isset($player) && !is_null($player) && $player instanceof Player)
 
135
                if (isset($player) && $player instanceof Player)
136
136
                {
137
137
                    if (($i - 1) >= 0)
138
138
                    {
139
139
                        $prev_rec = $times[$i - 1];
140
 
                        if (isset($prev_rec) && !is_null($prev_rec) && $prev_rec instanceof Record)
 
140
                        if (isset($prev_rec) && $prev_rec instanceof Record)
141
141
                        {
142
142
                            $id = $i;
143
143
                            for($lenT = strlen($id); $lenT < $len; $lenT++)
156
156
                    if (($i + 1) < count($times))
157
157
                    {
158
158
                        $prev_rec = $times[$i + 1];
159
 
                        if (isset($prev_rec) && !is_null($prev_rec) && $prev_rec instanceof Record)
 
159
                        if (isset($prev_rec) && $prev_rec instanceof Record)
160
160
                        {
161
161
                            $id = $i + 2;
162
162
                            for($lenT = strlen($id); $lenT < $len; $lenT++)