~ubuntu-branches/ubuntu/trusty/enigma/trusty-proposed

« back to all changes in this revision

Viewing changes to src/stones/SurpriseStone.cc

  • Committer: Package Import Robot
  • Author(s): Erich Schubert
  • Date: 2013-04-06 14:54:02 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130406145402-jgjrtk7hac8gtvza
Tags: 1.20-dfsg.1-1
* New upstream release (Closes: #704595)
  (Repacked: dropped zipios++ source and main menu music)
* Update watch file, sf.net again.
* Fix documentation links (Closes: #653508)
* Conflict with enigma-level-previews to encourage deinstallation
  (Pregenerated level previews were only used with version 1.01)
* Use dh7 for building instead of CDBS
* Update to policy 3.9.4.0 (no changes)
* Register documentation with doc-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * modify it under the terms of the GNU General Public License
6
6
 * as published by the Free Software Foundation; either version 2
7
7
 * of the License, or (at your option) any later version.
8
 
 *  
 
8
 *
9
9
 * This program is distributed in the hope that it will be useful,
10
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
30
/* -------------------- Surprise stone -------------------- */
31
31
    SurpriseStone::SurpriseStone() : Stone ("st_surprise") {
32
32
    }
33
 
    
 
33
 
34
34
    std::string SurpriseStone::getClass() const {
35
35
        return "st_surprise";
36
36
    }
48
48
                "st_flat_breaking"
49
49
            };
50
50
            if (Value v = Stone::getAttr(key))
51
 
                return v; 
 
51
                return v;
52
52
            else {
53
53
                TokenList tl;
54
54
                for (int i = 0; i < 8; i++)
62
62
        } else
63
63
            return Stone::getAttr(key);
64
64
    }
65
 
    
 
65
 
66
66
    void SurpriseStone::actor_hit(const StoneContact &sc) {
67
 
        int id = getId();
 
67
        int theid = getId();
68
68
            performAction(true);    // may kill the stone!
69
 
        
70
 
        if (Object::getObject(id) != NULL) {  // not killed?
 
69
 
 
70
        if (Object::getObject(theid) != NULL) {  // not killed?
71
71
            TokenList tl = getAttr("selection");
72
72
            int idx = enigma::IntegerRand(1, tl.size()) - 1;
73
73
            TokenList::iterator itr = tl.begin();
74
 
            for (int i = 0; i < idx; i++, ++itr); 
 
74
            for (int i = 0; i < idx; i++, ++itr);
75
75
            sound_event("stonetransform");
76
76
            std::string name = (*itr).to_string();
77
77
            if (name.find('=') == 0) {
83
83
            }
84
84
        }
85
85
    }
86
 
    
 
86
 
87
87
    FreezeStatusBits SurpriseStone::get_freeze_bits() {
88
88
        return FREEZEBIT_IRREGULAR;
89
89
    }
90
 
    
 
90
 
91
91
    DEF_TRAITS(SurpriseStone, "st_surprise", st_surprise);
92
92
 
93
93
    BOOT_REGISTER_START