Пример #1
0
void Ability_Active::apply_ability(Unit & target)
{
	for(auto iter = effects.begin(); iter != effects.end(); ++iter)
		if(iter->expired(duration_counter))
			iter->apply_effect(*ability_caster, target);
	++duration_counter;
}
Пример #2
0
//----------------------------------------------------------------------------------------
// Run the filter action
// Function result:		FILTER_OK, FILTER_CANCEL, FILTER_ABORT or an error code
// bm:								bitmap reference
// settings:					private filter settings
// use_gui:						true: show dialog false: use current settings (silent mode)
//----------------------------------------------------------------------------------------
static Int32 filter_run(FI_REF fi, BM_REF bm, FILTER_PARAM _settings, Bool use_gui)
{
	PRIVATE_SETTINGS* settings;

	settings = (PRIVATE_SETTINGS*) _settings;
	if (use_gui)
	{
		SmplMatrixDialog dlg;

		if (dlg.Init(bm, settings))
		{
			if (dlg.Open())	// do the dialog handling
				return FILTER_OK;
		}

		return FILTER_CANCEL;
	}
	else
	{
		return apply_effect(bm, 0, 0, settings, false, 0);
	}
}
Пример #3
0
static void
apply_patch (test_entry_t *entry, test_patch_t *patch)
{
	guint32 offset = apply_selector (patch->selector, entry);
	apply_effect (patch->effect, entry, offset);
}