Пример #1
0
void DragonTooth::beforeMatch(int i, int j)
{
    if(_mapInfo->isCollectPosition(i, j))
    {
        _state=-1;
        
        AnimationWraper aw2(NULL,e_aid_normal_explode,e_priority_normal_explode);
        
        _animationWraperVector->push_back(aw2);
    }
}
Пример #2
0
void NonConstBoundDismantlerPass::do_file_set_block( FileSetBlock* file_set_block ) {
    SuifEnv *env = get_suif_env();
    ReplacingWalker walker(env);
    ReverseMap rev_map;
    NonConstDimExpressionWalker ew1(env,walker,rev_map,MultiDimArrayExpression::get_class_name());
    NonConstDimExpressionWalker ew2(env,walker,rev_map,ArrayReferenceExpression::get_class_name());

    NonConstBoundArrayTypeWalker  aw1(env,rev_map,MultiDimArrayType::get_class_name());
    NonConstBoundArrayTypeWalker  aw2(env,rev_map,ArrayType::get_class_name());
    walker.append_walker(ew1);
    walker.append_walker(ew2);
    file_set_block->walk(walker);
    ReplacingWalker type_walker(env);
    type_walker.append_walker(aw1);
    type_walker.append_walker(aw2);

    file_set_block->walk(type_walker);
}
Пример #3
0
void Bottle::beforeMatch(int i, int j)
{
    if(_state<0) return;
    
    
    if(j + 1 < kMatrixWidth)
    {
        if (_gemStoneMatrix[i][j+1])
        {
            GemType type = (GemType)((_type - redbottle) / 5 + 1);
            if (_gemStoneMatrix[i][j+1]->getGemType() == type && _gemStoneMatrix[i][j+1]->getState() != -1)
            {
                _state-- ;
                MyPoint mp = MyPoint(i, j + 1);
                _gemStoneMatrix[i][j+1]->explode(mp, mp, 0, 0);
                
                AnimationWraper aw(NULL, e_aid_normal_explode, e_priority_normal_explode);
                
                _animationWraperVector->push_back(aw);
                
                __String *str = __String::create("");
                if (_state == 2)
                {
                    if (type == red )
                    {
                        str = __String::create("bottle1_red.png");
                    }
                    else if (type == yellow)
                    {
                        str = __String::create("bottle1_yellow.png");
                    }
                    else if (type == blue)
                    {
                        _state = 2;
                        str = __String::create("bottle1_blue.png");
                    }
                    else if (type == green)
                    {
                        str = __String::create("bottle1_green.png");
                    }
                    else if (type == purple)
                    {
                        str = __String::create("bottle1_purple.png");
                    }
                    else if (type == white)
                    {
                        str = __String::create("bottle1_white.png");
                    }
                }
                else if(_state == 1)
                {
                    if (type == red)
                    {
                        str = __String::create("bottle2_red.png");
                    }
                    else if (type == yellow)
                    {
                        str = __String::create("bottle2_yellow.png");
                    }
                    else if (type == blue)
                    {
                        str = __String::create("bottle2_blue.png");
                    }
                    else if (type == green)
                    {
                        str = __String::create("bottle2_green.png");
                    }
                    else if (type == purple)
                    {
                        str = __String::create("bottle2_purple.png");
                    }
                    else if (type == white)
                    {
                        str = __String::create("bottle2_white.png");
                    }

                }
                else if(_state == 0)
                {
                    if (type == red)
                    {
                        str = __String::create("bottle3_red.png");
                    }
                    else if (type == yellow)
                    {
                        str = __String::create("bottle3_yellow.png");
                    }
                    else if (type == blue)
                    {
                        str = __String::create("bottle3_blue.png");
                    }
                    else if (type == green)
                    {
                        str = __String::create("bottle3_green.png");
                    }
                    else if (type == purple)
                    {
                        str = __String::create("bottle3_purple.png");
                    }
                    else if (type == white)
                    {
                        str = __String::create("bottle3_white.png");
                    }
                }
                else if(_state == -1)
                {
                    if (type == red)
                    {
                        str = __String::create("bottle4_red.png");
                    }
                    else if (type == yellow)
                    {
                        str = __String::create("bottle4_yellow.png");
                    }
                    else if (type == blue)
                    {
                        str = __String::create("bottle4_blue.png");
                    }
                    else if (type == green)
                    {
                        str = __String::create("bottle4_green.png");
                    }
                    else if (type == purple)
                    {
                        str = __String::create("bottle4_purple.png");
                    }
                    else if (type == white)
                    {
                        str = __String::create("bottle4_white.png");
                    }
                }
                _spr->setTexture(str->getCString());
            }
        }
        
        if (_state == -1)
        {
            AnimationWraper aw2(NULL,e_aid_normal_explode,e_priority_normal_explode);
            
            _animationWraperVector->push_back(aw2);
        }
    }
}