public static void damageTarget(Unit source, Unit target, Map<ElementType, Integer> damage) {
		if (source != null && target != null && target.getLifeCurrent() > 0 && damage != null) {
			float currentLifeTarget = target.getLifeCurrent();
			Map<ElementType, Integer> resistance = target.getResistance();

			for (Map.Entry<ElementType, Integer> entry : damage.entrySet()) {
				ElementType type = entry.getKey();
				int amount = entry.getValue();
				if (resistance != null && resistance.containsKey(type)) {
					// target has resistance against this type
					amount = Math.max(0, entry.getValue() - resistance.get(entry.getKey()));
					damage.put(type, amount);
				}

				if (LOGGER.isDebugEnabled())
					LOGGER.debug(type + "_damage before UNIT_DEAL_DAMAGE event: " + amount);
			}

			// create damage dealing event for gameEventController
			Map<GameEventParameter, Object> eventParams = new HashMap<GameEventParameter, Object>();
			eventParams.put(GameEventParameter.TRIGGERING_UNIT, source);
			eventParams.put(GameEventParameter.TARGET_UNIT, target);
			eventParams.put(GameEventParameter.DAMAGE_DEALT, damage);
			GameEventHandler.INSTANCE.createAndDispatchEvent(GameEventType.UNIT_DEAL_DAMAGE, source, eventParams);

			// create damage taken event for gameEventController
			if (LOGGER.isDebugEnabled()) {
				for (Map.Entry<ElementType, Integer> entry : damage.entrySet()) {
					LOGGER.debug(entry.getKey() + "_damage after UNIT_DEAL_DAMAGE event: " + entry.getValue());
				}
			}
			eventParams.clear();
			eventParams.put(GameEventParameter.TRIGGERING_UNIT, target);
			eventParams.put(GameEventParameter.ATTACKING_UNIT, source);
			eventParams.put(GameEventParameter.DAMAGE_TAKEN, damage);
			GameEventHandler.INSTANCE.createAndDispatchEvent(GameEventType.UNIT_TAKE_DAMAGE, target, eventParams);

			for (Map.Entry<ElementType, Integer> entry : damage.entrySet()) {
				target.setLifeCurrent(currentLifeTarget - entry.getValue());
				if (LOGGER.isDebugEnabled()) {
					LOGGER.debug(entry.getKey() + "_damage after UNIT_TAKE_DAMAGE event: " + entry.getValue());
					LOGGER.debug("Unit '" + source + "' is dealing '" + entry.getValue() + "' " + entry.getKey() + "_damage to unit '" + target + "'");
				}
			}
		}
	}