当前位置: 首页>>代码示例>>C++>>正文


C++ CCustomMonster类代码示例

本文整理汇总了C++中CCustomMonster的典型用法代码示例。如果您正苦于以下问题:C++ CCustomMonster类的具体用法?C++ CCustomMonster怎么用?C++ CCustomMonster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CCustomMonster类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Level

void CLevelGraph::draw_objects	()
{
	u32					I = 0;
	u32					E = Level().Objects.o_count	();
	for ( ; I < E; ++I) {
		CObject			*_O = Level().Objects.o_get_by_iterator(I);
		CTeamBaseZone	*team_base_zone = smart_cast<CTeamBaseZone*>(_O);
		if (team_base_zone) {
			team_base_zone->OnRender();
			continue;
		}

		CCustomMonster	*tpCustomMonster = smart_cast<CCustomMonster*>(_O);
		if (tpCustomMonster) {
			tpCustomMonster->OnRender();
			if (!tpCustomMonster->movement().detail().path().empty()) {
				Fvector				temp = tpCustomMonster->movement().detail().path()[tpCustomMonster->movement().detail().path().size() - 1].position;
				Level().debug_renderer().draw_aabb	(temp,1.f,1.f,1.f,D3DCOLOR_XRGB(0,0,255));
			}
		}

		smart_cover::object	*smart_cover = smart_cast<smart_cover::object*>(_O);
		if (smart_cover) {
			smart_cover->OnRender	();
			continue;
		}
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:28,代码来源:level_graph_debug2.cpp

示例2: ai

u32	CScriptGameObject::vertex_in_direction(u32 level_vertex_id, Fvector direction, float max_distance) const
{
    CCustomMonster	*monster = smart_cast<CCustomMonster*>(&object());
    if (!monster)
    {
        ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "CCustomMonster : cannot access class member vertex_in_direction!");
        return		(u32(-1));
    }

    if (!monster->movement().restrictions().accessible(level_vertex_id))
    {
        ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "CCustomMonster::vertex_in_direction - start vertex id is not accessible!");
        return		(u32(-1));
    }

    direction.normalize_safe();
    direction.mul(max_distance);
    Fvector			start_position = ai().level_graph().vertex_position(level_vertex_id);
    Fvector			finish_position = Fvector(start_position).add(direction);
    u32				result = u32(-1);
    monster->movement().restrictions().add_border(level_vertex_id, max_distance);
    ai().level_graph().farthest_vertex_in_direction(level_vertex_id, start_position, finish_position, result, 0, true);
    monster->movement().restrictions().remove_border();
    return			(ai().level_graph().valid_vertex_id(result) ? result : level_vertex_id);
}
开发者ID:denanden,项目名称:xray-16,代码行数:25,代码来源:script_game_object.cpp

示例3:

void CScriptGameObject::set_start_point	(int point_index)
{
	CCustomMonster		*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster)
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member set_start_point!");
	else
		monster->movement().patrol().set_start_point(point_index);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:8,代码来源:script_game_object.cpp

示例4:

void CScriptGameObject::enable_memory_object	(CScriptGameObject *game_object, bool enable)
{
	CCustomMonster			*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster)
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member enable_memory_object!");
	else
		monster->memory().enable			(&game_object->object(),enable);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:8,代码来源:script_game_object2.cpp

示例5:

void CScriptGameObject::play_sound		(u32 internal_type, u32 max_start_time)
{
	CCustomMonster				*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster)
		ai().script_engine().script_log					(ScriptStorage::eLuaMessageTypeError,"CSoundPlayer : cannot access class member play!");
	else
		monster->sound().play		(internal_type,max_start_time);
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:8,代码来源:script_game_object4.cpp

示例6:

u32	 CScriptGameObject::accessible_nearest	(const Fvector &position, Fvector &result)
{
	CCustomMonster	*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CRestrictedObject : cannot access class member accessible!");
		return								(u32(-1));
	}
	return									(monster->movement().restrictions().accessible_nearest(position,result));
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:9,代码来源:script_game_object_inventory_owner.cpp

示例7: ai

void CScriptGameObject::set_enemy_callback	()
{
	CCustomMonster			*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster) {
		ai().script_engine().script_log			(ScriptStorage::eLuaMessageTypeError,"CCustomMonster : cannot access class member set_enemy_callback!");
		return;
	}
	monster->memory().enemy().useful_callback().clear();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:9,代码来源:script_game_object_use.cpp

示例8: ai

void CScriptGameObject::set_range				(float new_range)
{
	CCustomMonster			*monster = smart_cast<CCustomMonster*>(&this->object());
	if (!monster) {
		ai().script_engine().script_log			(ScriptStorage::eLuaMessageTypeError,"CCustomMonster : cannot access class member set_range!");
		return;
	}
	monster->set_range		(new_range);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:9,代码来源:script_game_object.cpp

示例9: get_current_patrol_point_index

u32 CScriptGameObject::get_current_patrol_point_index()
{
	CCustomMonster		*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot call [get_current_patrol_point_index()]!");
		return			(u32(-1));
	}
	return				(monster->movement().patrol().get_current_point_index());
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:9,代码来源:script_game_object.cpp

示例10: ai

void CScriptGameObject::enable_movement	(bool enable)
{
	CCustomMonster						*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster) {
		ai().script_engine().script_log	(ScriptStorage::eLuaMessageTypeError,"CCustomMonster : cannot access class member movement_enabled!");
		return;
	}

	monster->movement().enable_movement	(enable);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:10,代码来源:script_game_object_inventory_owner.cpp

示例11: memory_position

Fvector CScriptGameObject::memory_position(const CScriptGameObject &lua_game_object)
{
	CCustomMonster			*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster) {
		ai().script_engine().script_log			(ScriptStorage::eLuaMessageTypeError,"CScriptEntity : cannot access class member memory!");
		return				(Fvector().set(0.f,0.f,0.f));
	}
	else
		return				(monster->memory().memory_position(&lua_game_object.object()));
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:10,代码来源:script_game_object2.cpp

示例12: accessible_vertex_id

bool CScriptGameObject::accessible_vertex_id(u32 level_vertex_id)
{
	CCustomMonster	*monster = smart_cast<CCustomMonster*>(&object());
	if (!monster) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"CRestrictedObject : cannot access class member accessible!");
		return								(false);
	}
	THROW2									(ai().level_graph().valid_vertex_id(level_vertex_id),"Cannot check if level vertex id is accessible, because it is invalid");
	return									(monster->movement().restrictions().accessible(level_vertex_id));
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:10,代码来源:script_game_object_inventory_owner.cpp


注:本文中的CCustomMonster类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。