void AnimController::set_status(String p_key, String p_name, float p_time) {
    if (!current_anims.has(p_key) || current_anims[p_key] != p_name) {
        if (current_anims.has(p_key)) {
            remove_anim(p_key, current_anims[p_key]);
        }
        current_anims[p_key] = p_name;
        add_anim(p_key, p_name);
        if (p_time > 0) {
            remove_counts[p_key] = p_time;
        }
        _changed = true;
        if (get_script_instance()) {
            get_script_instance()->call(StringName("_add_status"), p_key, p_name);
        }
    }
}
Example #2
0
Y_Wolf::Y_Wolf(int size_x,int size_y,Y_Perso * _perso,Y_Fire * _fire1,Y_Fire * _fire2)
	: Actor(size_x,size_y),stress(0),perso(_perso),fire1(_fire1),fire2(_fire2)
{
	if (wolves.empty())
	{
		anim_wolf=new Animation();
		anim_wolf->load_animation("data/wolf2.png",54,45);
		w_yell_buffer.LoadFromFile("data/sound/grrB2.ogg");
		w_yell_sound.SetBuffer(w_yell_buffer);
		w_stress_buffer.LoadFromFile("data/sound/grr2.ogg");
		w_stress_sound.SetBuffer(w_stress_buffer);
	}
	add_anim(anim_wolf);
	x=-200;
	y=180;
	mass=0;
	//wolf.SetScale(2.0,2.0);
	wolves.push_back(this);
	number=wolves.size();
}