~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/attack/execute.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:
59
59
            $dir   = new Coord($cycle->speed * $cycle->dir->x * $speed, $cycle->speed * $cycle->dir->y * $speed);
60
60
            $color = new Color(15, 15, 0);
61
61
 
62
 
            if (isset($record->target) && !is_null($record->target) && $record->target instanceof Cycle)
 
62
            if (isset($record->target) && $record->target instanceof Cycle)
63
63
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name, $record->target->player->log, $speed);
64
64
            else
65
65
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name);
74
74
            $dir   = new Coord($cycle->speed * $cycle->dir->x * $speed, $cycle->speed * $cycle->dir->y * $speed);
75
75
            $color = new Color(12, 5, 0);
76
76
 
77
 
            if (isset($record->target) && !is_null($record->target) && $record->target instanceof Cycle)
 
77
            if (isset($record->target) && $record->target instanceof Cycle)
78
78
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name, $record->target->player->log, $speed);
79
79
            else
80
80
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name);
97
97
            $dir   = new Coord($cycle->speed * $cycle->dir->x * $speed, $cycle->speed * $cycle->dir->y * $speed);
98
98
            $color = new Color(0, 5, 13);
99
99
 
100
 
            if (isset($record->target) && !is_null($record->target) && $record->target instanceof Cycle)
 
100
            if (isset($record->target) && $record->target instanceof Cycle)
101
101
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name, $record->target->player->log, $speed);
102
102
            else
103
103
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name);
136
136
                $dir   = new Coord($cycle->dir->x * $cycle->speed * $speed, $cycle->dir->y * $cycle->speed * $speed);
137
137
                $color = new Color(rand(0, 15), rand(0, 15), rand(0, 15));
138
138
 
139
 
                if (isset($record->target) && !is_null($record->target) && $record->target instanceof Cycle)
 
139
                if (isset($record->target) && $record->target instanceof Cycle)
140
140
                    spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name, $record->target->player->log, $speed);
141
141
                else
142
142
                    spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name);
160
160
                $dir   = new Coord($tempDirection->x * $cycle->speed * $speed, $tempDirection->y * $cycle->speed * $speed);
161
161
                $color = new Color(rand(0, 15), rand(0, 15), rand(0, 15));
162
162
 
163
 
                if (isset($record->target) && !is_null($record->target) && $record->target instanceof Cycle)
 
163
                if (isset($record->target) && $record->target instanceof Cycle)
164
164
                    spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name, $record->target->player->log, $speed);
165
165
                else
166
166
                    spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name);
217
217
            $dir   = new Coord($cycle->speed * $cycle->dir->x * $speed, $cycle->speed * $cycle->dir->y * $speed);
218
218
            $color = new Color(7, 0, 15);
219
219
 
220
 
            if (isset($record->target) && !is_null($record->target) && $record->target instanceof Cycle)
 
220
            if (isset($record->target) && $record->target instanceof Cycle)
221
221
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name, $record->target->player->log, $speed);
222
222
            else
223
223
                spawnObjectZone($pos, $dir, $radius, $color, 0, false, 0, $name);