~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/bag.php

  • Committer: zodiacsohma1 at gmail
  • Date: 2014-02-19 05:55:57 UTC
  • Revision ID: zodiacsohma1@gmail.com-20140219055557-kpvbnge0idymfvo3
Updated battle_mania.cfg
Added a automatic respawn point to players for the CTF game mode.
Added a if statement to now allow processing of player positions during zombie challenge.
Increased the focus factor of attacks to 3 and adjusted attack messages.
Added attack learning code to bag when first created to immediately learn basic attacks.
Modified server.sh to adjust it to the use of a new method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    var $survive;           //  storage for surviving in zombie mode
16
16
    var $items   = array(); //  storage for items picked up
17
17
 
18
 
    function __construct()
 
18
    function __construct(Record $record)
19
19
    {
 
20
        $this->record = $record;
 
21
 
20
22
        $this->survive = new ZombieRec();
 
23
 
 
24
        //  automatically make the players learn the attack they can from basic level: 1
 
25
        if (count(Attack::$attacks) > 0)
 
26
        {
 
27
            foreach (Attack::$attacks as $attack)
 
28
            {
 
29
                if (isset($attack) && !is_null($attack) && $attack instanceof Attack && ($this->record->experience->level == $attack->level))
 
30
                {
 
31
                    $attacks_limit = getSetting("ATTACKS_LIMIT");
 
32
                    if (count($this->attacks) < $attacks_limit->value)
 
33
                    {
 
34
                        $this->attacks[] = clone $attack;
 
35
                        $attacks[] = $attack;
 
36
                    }
 
37
                }
 
38
            }
 
39
        }
21
40
    }
22
41
 
23
42
    function attackExists($name)