Beispiel #1
0
void cText_Box::Init(void)
{
    m_type = TYPE_TEXT_BOX;
    box_type = m_type;
    m_can_be_on_ground = 0;
    m_name = _("Text Box");

    // default is infinite times activate-able
    Set_Useable_Count(-1, 1);
    // Spinbox Animation
    Set_Animation_Type("Default");

    // todo : editor image needed
    //item_image = NULL;
}
Beispiel #2
0
 void cBaseBox::Activate_Collision(ObjectDirection cdirection)
 {
     if (move_col_dir != DIR_UNDEFINED)
     {
         return;
     }
     
     if (useable_count == 0)
     {
         return;
     }
     
     if (box_invisible)
     {
         if (box_invisible == BOX_INVISIBLE_SEMI_MASSIVE)
         {
             m_massive_type = MASS_MASSIVE;
         }
     }
     
     if (cdirection == DIR_UP)
     {
         Set_Scale_Directions(1, 0, 1, 1);
     }
     else if (cdirection == DIR_DOWN)
     {
         Set_Scale_Directions(0, 1, 1, 1);
     }
     else if (cdirection == DIR_LEFT)
     {
         Set_Scale_Directions(1, 0, 1, 0);
     }
     else if (cdirection == DIR_RIGHT)
     {
         Set_Scale_Directions(1, 0, 0, 1);
     }
     
     move_col_dir = cdirection;
     Update_Valid_Update();
     
     Check_Collision(Get_Opposite_Direction(move_col_dir));
     Activate();
     
     if (useable_count > 0 || useable_count == -1)
     {
         Set_Useable_Count(useable_count - 1);
     }
 }
Beispiel #3
0
 void cBaseBox::Create_From_Stream(XMLElement* attributes)
 {
     int _posx, _posy;
     std::string _animation = anim_type;
     int _invisible;
     int _useable_count = start_useable_count;
     
     for (XMLElement* node = attributes->FirstChildElement(); node; node = node->NextSiblingElement())
     {
         const char* name = node->Attribute("name");
         const char* value = node->Attribute("value");
     
         if (!strcmp(name, "posx"))
         {
             _posx = atoi(value);
         }
         else if (!strcmp(name, "posy"))
         {
             _posy = atoi(value);
         }
         else if (!strcmp(name, "animation"))
         {
             _animation = value;
         }
         else if (!strcmp(name, "invisible"))
         {
             _invisible = atoi(value);
         }
         else if (!strcmp(name, "useable_count"))
         {
             _useable_count = atoi(value);
         }
     }
     
     Set_Pos(static_cast<float>(_posx), static_cast<float>(_posy), 1);
     if (box_type != TYPE_SPINBOX && box_type != TYPE_TEXT_BOX)
     {
         Set_Animation_Type(_animation.c_str());
     }
     Set_Invisible(static_cast<Box_Invisible_Type>(_invisible));
     Set_Useable_Count(_useable_count, 1);
 }
Beispiel #4
0
void cSpinBox :: Init( void )
{
	m_type = TYPE_SPIN_BOX;
	box_type = m_type;
	m_camera_range = 5000;
	m_can_be_on_ground = 0;

	m_spin_counter = 0.0f;
	m_spin = 0;

	// default is infinite times activate-able
	Set_Useable_Count( -1, 1 );
	// Spinbox Animation
	Set_Animation_Type( "Spin" );

	// editor image
	m_item_image = pVideo->Get_Surface( "game/arrow/small/white/up.png" );

	Create_Name();
}
Beispiel #5
0
 void cBaseBox::Load_From_Savegame(cSave_Level_Object* save_object)
 {
     int save_useable_count = string_to_int(save_object->Get_Value("useable_count"));
     Set_Useable_Count(save_useable_count);
 }