Пример #1
0
	public static bool SkillTargetStateCheck( Tbl_Skill_Record skillRecord, AsBaseEntity entity, bool _showAlert = true)
	{
		bool ret = false;
		
		switch( skillRecord.SkillIcon_Enable_Condition)
		{
		case eSkillIcon_Enable_Condition.NONE:
			return true;
		case eSkillIcon_Enable_Condition.LowHealth:
			if(entity.ContainProperty(eComponentProperty.HP_CUR) == true)
			{
				float curHP = entity.GetProperty<float>( eComponentProperty.HP_CUR);
				if( curHP < skillRecord.SkillIcon_Enable_ConditionValue)
					ret = true;
			}
			break;
		case eSkillIcon_Enable_Condition.Death:
			if(entity.ContainProperty(eComponentProperty.LIVING) == true)
			{
				bool isDied = entity.GetProperty<bool>( eComponentProperty.LIVING);
				ret = !isDied;
			}
			break;
		case eSkillIcon_Enable_Condition.Movable:
			AsUserEntity player = AsUserInfo.Instance.GetCurrentUserEntity();
			ret = player.CheckCondition( eSkillIcon_Enable_Condition.Movable) &&
				player.GetProperty<bool>(eComponentProperty.LIVING);
			break;
		default:
			ret = entity.CheckCondition( skillRecord.SkillIcon_Enable_Condition);
			break;
		}
		
		if( false == ret && _showAlert == true)
			AsMyProperty.Instance.AlertState();
		
		return ret;
	}