~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/ktk/team.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:
31
31
        {
32
32
            foreach (Base::$base->TEAMS as $team)
33
33
            {
34
 
                if (isset($team) && !is_null($team) && $team instanceof Team)
 
34
                if (isset($team) && $team instanceof Team)
35
35
                {
36
36
                    $team->ktk_tp->Reset();
37
37
                }
42
42
        {
43
43
            foreach (Base::$base->PLAYERS as $p)
44
44
            {
45
 
                if (isset($p) && !is_null($p) && $p instanceof Player)
 
45
                if (isset($p) && $p instanceof Player)
46
46
                {
47
47
                    unset($p->ktk_tp);
48
48
                }
58
58
        if (count($this->team->players) == 0) return false;
59
59
 
60
60
        $king = $this->team->players[rand(0, count($this->team->players) - 1)];
61
 
        if (isset($king) && !is_null($king) && $king instanceof Player)
 
61
        if (isset($king) && $king instanceof Player)
62
62
        {
63
63
            $king->ktk_tp = new KillTheKing(3);
64
64
            sendCommand("ANNOUNCE", "0x00aaff".$king." 0xaa99ffis the king of team: 0xaaff7a".strtolower($this->team)."0xaa99ff.");
70
70
 
71
71
        foreach ($this->team->players as $player)
72
72
        {
73
 
            if (isset($player) && !is_null($player) && $player instanceof Player && ($player != $king))
 
73
            if (isset($player) && $player instanceof Player && ($player != $king))
74
74
            {
75
75
                $set = false;
76
76
                while (!$set)