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


C++ Mover::monster_self方法代码示例

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


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

示例1: req_enter_scene_outpost

int Scene_Common::req_enter_scene_outpost(const int64_t monster_role_id) {
    Move_Scene* scene = move_scene();
    if(!scene) {
        return 0;
    }
    Single_Scene* single_scene = dynamic_cast<Single_Scene*>(scene);
    if(!single_scene) {
        return 0;
    }
    Mover* mover = single_scene->find_mover_with_layer(0, monster_role_id);
    if(!mover || mover->monster_self() == NULL) {
        return 0;
    }
    // 没有收益的玩家不能进去
    if(scene->is_no_profit(role_id())) {
        return ERROR_FB_ENTER_TBAY_NO_PROFIT;
    }
    int target_scene_id = 0;
    int target_scene_time = 0;
    int target_scene_type = 0;
    mover->monster_self()->get_ex_param(target_scene_id, target_scene_time, target_scene_type);
    if(target_scene_id == 0) {
        return 0;
    }
    player_self()->inner_transmit(target_scene_id,0,monster_role_id);
    return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:27,代码来源:Scene_Common.cpp

示例2: outpost_notice_exit

void Single_Scene::outpost_notice_exit(const int64_t monster_role_id, bool clear_single){
	if(monster_role_id != 0){
		Mover* mover = this->find_mover_with_layer(0, monster_role_id);
		if(mover && mover->monster_self()){
			mover->exit_move_scene();
		}
	}
	if(clear_single){
		this->set_scene_status(Move_Scene::SCENE_RECOVER_STATUS);
		MSG_DEBUG("single scene recover outpost notice, scene id:%ld", this->scene_id());
		recover_time_ = Time_Value::zero;
	}
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:13,代码来源:Single_Scene.cpp

示例3:

int Scene_Server_Request::process_20200050(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) {
	JUDGE_PLAYER_NULL(player, role_id);

	// 战斗中,退出战斗
	if (player->is_in_battle()){
		player->exit_battle_scene(14);
		player->notify_gate_exit_battle(14);
	}

	Coord coord;
	Monitor_Unique_ID scene_muid;
	Create_Scene_Args scene_args;
	scene_muid.deserialize(buf);
	coord.deserialize(buf);
	scene_args.deserialize(buf);

	int src_scene_id = player->move_scene_id();

	{// tbay
		const Scene_Config* target_cfg = CONFIG_CACHE_SCENE->scene_config_cache(scene_muid.id);
		if(target_cfg){
			if(target_cfg->type == Tbay_Scene_Type){
				int64_t monster_role_id = scene_args.id;
				if(player->move_scene()){
					Mover* mover = player->move_scene()->find_mover_with_layer(0, monster_role_id);
					if(mover && mover->monster_self()){
						int target_id = 0;
						int target_time = 0;
						int target_type = 0;
						mover->monster_self()->get_ex_param(target_id, target_time, target_type);
						scene_args.type = target_type;
						scene_args.sub_sort = player->move_scene_id();
						scene_args.int_value = target_time;
					}
				}
			}
		}
	}

	player->set_rela_scene_id(scene_muid.id);
	player->gang_war_info().exit_ = true;

	player->exit_move_scene(false);

	player->set_scene_muid(scene_muid);
	player->set_create_scene_args(scene_args.type, scene_args.time, scene_args.id, scene_args.sort, scene_args.sub_sort, scene_args.int_value);
	player->set_grid_coord(coord.grid_coord().x, coord.grid_coord().y);
	player->set_pixel_coord(coord.pixel_coord().x, coord.pixel_coord().y);

	player->scene_init();

	Block_Buffer inner_buf;
	inner_buf.make_message(INNER_TRAN_SCENE_SAME_PRO);
	scene_muid.serialize(inner_buf);
	coord.serialize(inner_buf);
	inner_buf.finish_message();
	player->send_to_logic(inner_buf);

	player->notice_enter_scene();

	MSG_DEBUG("tran scene in same process , role:%ld, src:%d, des scene:%d", role_id, src_scene_id, player->move_scene_id());

	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:64,代码来源:Scene_Server_Request.cpp


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