~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/record.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:
141
141
                        $item_ext  = explode(":", $item_log);
142
142
                        $item_obj = Item::GetItem($item_ext[0]);
143
143
 
144
 
                        if (isset($item_obj) && !is_null($item_obj) && $item_obj instanceof Item)
 
144
                        if (isset($item_obj) & $item_obj instanceof Item)
145
145
                        {
146
146
                            $num = 0;
147
147
                            if (isset($item_ext[1]))
151
151
                            if ($this->bag->itemExists($item_obj))
152
152
                            {
153
153
                                $item = $this->bag->getItem($item_obj);
154
 
                                if (isset($item) && !is_null($item) && $item instanceof Item)
 
154
                                if (isset($item) && $item instanceof Item)
155
155
                                {
156
156
                                    $item->num = $num;
157
157
                                    if ($item->num > $item->max)
210
210
        {
211
211
            foreach ($this->bag->attacks as $attack)
212
212
            {
213
 
                if (isset($attack) && !is_null($attack) && $attack instanceof Attack)
 
213
                if (isset($attack) && $attack instanceof Attack)
214
214
                    $atk_line .= $attack->log." ";
215
215
            }
216
216
        }
225
225
        {
226
226
            foreach ($this->bag->items as $item)
227
227
            {
228
 
                if (isset($item) && !is_null($item) && $item instanceof Item)
 
228
                if (isset($item) && $item instanceof Item)
229
229
                    $itm_line .= $item->log.":".$item->num." ";
230
230
            }
231
231
        }
238
238
        {
239
239
            foreach (Base::$base->RECORDS as $r)
240
240
            {
241
 
                if (isset($r) && !is_null($r) && $r instanceof Record)
 
241
                if (isset($r) && $r instanceof Record)
242
242
                    unset($r);
243
243
            }
244
244
            unset(Base::$base->RECORDS);
346
346
                                $item_ext = explode(":", $item_log);
347
347
                                $item_obj = Item::GetItem($item_ext[0]);
348
348
 
349
 
                                if (isset($item_obj) && !is_null($item_obj) && $item_obj instanceof Item)
 
349
                                if (isset($item_obj) & $item_obj instanceof Item)
350
350
                                {
351
351
                                    $num = 0;
352
352
                                    if (isset($item_ext[1]))
356
356
                                    if ($record->bag->itemExists($item_obj))
357
357
                                    {
358
358
                                        $item = $record->bag->getItem($item_obj);
359
 
                                        if (isset($item) && !is_null($item) && $item instanceof Item)
 
359
                                        if (isset($item) && $item instanceof Item)
360
360
                                        {
361
361
                                            $item->num = $num;
362
362
                                            if ($item->num > $item->max)
395
395
        {
396
396
            foreach (Base::$base->RECORDS as $r)
397
397
            {
398
 
                if (isset($r) && !is_null($r) && $r instanceof Record)
 
398
                if (isset($r) && $r instanceof Record)
399
399
                    $r->save();
400
400
            }
401
401
        }
410
410
    {
411
411
        foreach (Base::$base->RECORDS as $r)
412
412
        {
413
 
            if (isset($r) && !is_null($r) && $r instanceof Record && ($r->name == $name))
 
413
            if (isset($r) && $r instanceof Record && ($r->name == $name))
414
414
                return true;
415
415
        }
416
416
    }
424
424
    {
425
425
        foreach (Base::$base->RECORDS as $r)
426
426
        {
427
 
            if (isset($r) && !is_null($r) && $r instanceof Record && ($r->name == $name))
 
427
            if (isset($r) && $r instanceof Record && ($r->name == $name))
428
428
                return $r;
429
429
        }
430
430
    }