• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ G_EventAdd函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: G_EventActorWound

/**
 * @brief Actor has been wounded/treated
 * @param[in] ent The actor whose wound status has changed
 * @note This event is sent to the player this actor belongs to
 */
void G_EventActorWound (const edict_t *ent, const int bodyPart)
{
	const int mask = G_PlayerToPM(G_PLAYER_FROM_ENT(ent));
	G_EventAdd(mask, EV_ACTOR_WOUND, ent->number);
	gi.WriteByte(bodyPart);
	gi.WriteByte(ent->chr.wounds.woundLevel[bodyPart]);
	gi.WriteByte(ent->chr.wounds.treatmentLevel[bodyPart]);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:14,代码来源:g_events.cpp


示例2: G_EventActorStats

void G_EventActorStats (const edict_t* ent, int playerMask)
{
	G_EventAdd(playerMask, EV_ACTOR_STATS, ent->number);
	gi.WriteByte(ent->TU);
	gi.WriteShort(ent->HP);
	gi.WriteByte(ent->STUN);
	gi.WriteByte(ent->morale);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:9,代码来源:g_events.cpp


示例3: G_EventShootHidden

/**
 * @brief Start the shooting event for hidden actors
 * @param visMask the vis mask to determine the clients from this event is send to
 * @param fd The firedefinition to use for the shoot
 * @param firstShoot Is this the first shoot
 */
void G_EventShootHidden (vismask_t visMask, const fireDef_t* fd, bool firstShoot)
{
	G_EventAdd(~G_VisToPM(visMask), EV_ACTOR_SHOOT_HIDDEN, -1);
	gi.WriteByte(firstShoot);
	gi.WriteShort(fd->obj->idx);
	gi.WriteByte(fd->weapFdsIdx);
	gi.WriteByte(fd->fdIdx);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:15,代码来源:g_events.cpp


示例4: G_EventActorWound

/**
 * @brief Send info about an actor's wounds to the client.
 * @param[in] ent The actor whose wound status we are sending.
 * @param[in] bodyPart The body part index we are sending wound info about.
 * @note This event is sent to the player this actor belongs to
 */
void G_EventActorWound (const Edict& ent, const int bodyPart)
{
	const int mask = G_PlayerToPM(ent.getPlayer());
	G_EventAdd(mask, EV_ACTOR_WOUND, ent.number);
	gi.WriteByte(bodyPart);
	const woundInfo_t& wounds = ent.chr.wounds;
	gi.WriteByte(wounds.woundLevel[bodyPart]);
	gi.WriteByte(wounds.treatmentLevel[bodyPart]);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:16,代码来源:g_events.cpp


示例5: G_EventParticleSpawn

/**
 * @brief Spawn a new particle for the client
 * @param[in] playerMask A bit mask. One bit for each affected player
 * @param[in] name The id of the particle (see ptl_*.ufo script files in base/ufos)
 * @param[in] levelFlags Show at which levels
 * @param[in] s starting/location vector
 * @param[in] v velocity vector
 * @param[in] a acceleration vector
 */
void G_EventParticleSpawn (playermask_t playerMask, const char* name, int levelFlags, const vec3_t s, const vec3_t v, const vec3_t a)
{
	G_EventAdd(playerMask, EV_PARTICLE_SPAWN, -1);
	gi.WriteByte(levelFlags);
	gi.WritePos(s);
	gi.WritePos(v);
	gi.WritePos(a);
	gi.WriteString(name);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:19,代码来源:g_events.cpp


示例6: G_EventInventoryReload

void G_EventInventoryReload (const Edict& ent, playermask_t playerMask, const Item* item, const invDef_t* invDef, const Item* ic)
{
	G_EventAdd(playerMask, EV_INV_RELOAD, ent.number);
	gi.WriteByte(item->def()->ammo);
	gi.WriteByte(item->ammoDef()->idx);
	gi.WriteByte(invDef->id);
	gi.WriteByte(ic->getX());
	gi.WriteByte(ic->getY());
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:10,代码来源:g_events.cpp


示例7: G_EventSetClientAction

/**
 * @brief Informs the client that an interaction with the world is possible
 * @note It's assumed that the clientAction is already set
 * @param[in] ent The edict that can execute the action (an actor)
 */
void G_EventSetClientAction (const Edict& ent)
{
	assert(ent.clientAction);
	assert(ent.clientAction->flags & FL_CLIENTACTION);

	/* tell the hud to show the door buttons */
	G_EventAdd(G_TeamToPM(ent.team), EV_CLIENT_ACTION, ent.number);
	gi.WriteShort(ent.clientAction->number);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:15,代码来源:g_events.cpp


示例8: G_EventActorSendReservations

/**
 * @brief Will inform the player about the real TU reservation
 * @param ent The actors edict.
 */
void G_EventActorSendReservations (const Edict& ent)
{
	G_EventAdd(G_PlayerToPM(ent.getPlayer()), EV_ACTOR_RESERVATIONCHANGE, ent.number);
	const chrReservations_t& reservedTUs = ent.chr.reservedTus;
	gi.WriteShort(reservedTUs.reaction);
	gi.WriteShort(reservedTUs.shot);
	gi.WriteShort(reservedTUs.crouch);

	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:14,代码来源:g_events.cpp


示例9: G_EventInventoryReload

void G_EventInventoryReload (const edict_t* ent, int playerMask, const item_t* item, const invDef_t* invDef, const invList_t* ic)
{
	G_EventAdd(playerMask, EV_INV_RELOAD, ent->number);
	gi.WriteByte(item->item->ammo);
	gi.WriteByte(item->ammo->idx);
	gi.WriteByte(invDef->id);
	gi.WriteByte(ic->x);
	gi.WriteByte(ic->y);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:10,代码来源:g_events.cpp


示例10: G_EventReactionFireChange

void G_EventReactionFireChange (const edict_t* ent)
{
	const objDef_t *od = ent->chr.RFmode.weapon;

	G_EventAdd(G_PlayerToPM(G_PLAYER_FROM_ENT(ent)), EV_ACTOR_REACTIONFIRECHANGE, ent->number);
	gi.WriteByte(ent->chr.RFmode.fmIdx);
	gi.WriteByte(ent->chr.RFmode.getHand());
	gi.WriteShort(od ? od->idx : NONE);

	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:11,代码来源:g_events.cpp


示例11: G_EventCameraAppear

/**
 * @brief Send an appear event to the client.
 * @param playerMask The players to send the event to
 * @param ent The camera that should appear to the players included in the given mask.
 */
void G_EventCameraAppear (unsigned int playerMask, const edict_t *ent)
{
	G_EventAdd(playerMask, EV_CAMERA_APPEAR, ent->number);
	gi.WritePos(ent->origin);
	gi.WriteByte(ent->team);
	gi.WriteByte(ent->dir);
	gi.WriteByte(ent->camera.cameraType);
	/* strip the higher bits - only send levelflags */
	gi.WriteByte(ent->spawnflags & 0xFF);
	gi.WriteByte(ent->camera.rotate);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:17,代码来源:g_events.cpp


示例12: G_EventActorFall

void G_EventActorFall (const Edict& ent)
{
	G_EventAdd(G_VisToPM(ent.visflags), EV_ACTOR_MOVE, ent.number);
	gi.WriteByte(1);
	gi.WriteByte(ent.pos[0]);
	gi.WriteByte(ent.pos[1]);
	gi.WriteByte(ent.pos[2]);
	gi.WriteByte(makeDV(DIRECTION_FALL, ent.pos[2]));
	gi.WriteShort(GRAVITY);
	gi.WriteShort(0);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:12,代码来源:g_events.cpp


示例13: G_EventCameraAppear

/**
 * @brief Send an appear event to the client.
 * @param playerMask The players to send the event to
 * @param ent The camera that should appear to the players included in the given mask.
 */
void G_EventCameraAppear (playermask_t playerMask, const Edict& ent)
{
	G_EventAdd(playerMask, EV_CAMERA_APPEAR, ent.number);
	gi.WritePos(ent.origin);
	gi.WriteByte(ent.team);
	gi.WriteByte(ent.dir);
	gi.WriteByte(ent.camera.cameraType);
	/* strip the higher bits - only send levelflags */
	gi.WriteByte(ent.spawnflags & 0xFF);
	gi.WriteByte(ent.camera.rotate);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:17,代码来源:g_events.cpp


示例14: G_EventReactionFireChange

void G_EventReactionFireChange (const Edict& ent)
{
	const FiremodeSettings& fireMode = ent.chr.RFmode;
	const objDef_t* od = fireMode.getWeapon();

	G_EventAdd(G_PlayerToPM(ent.getPlayer()), EV_ACTOR_REACTIONFIRECHANGE, ent.number);
	gi.WriteByte(fireMode.getFmIdx());
	gi.WriteByte(fireMode.getHand());
	gi.WriteShort(od ? od->idx : NONE);

	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:12,代码来源:g_events.cpp


示例15: G_EventThrow

/**
 * @param[in] teamMask the vis mask to determine the clients from this event is send to
 * @param[in] fd The firedefinition to use
 * @param[in] dt Delta time
 * @param[in] flags bitmask of the following values: @c SF_BODY, @c SF_IMPACT, @c SF_BOUNCING and @c SF_BOUNCED
 * @param[in] position The current position
 * @param[in] velocity The velocity of the throw
 */
void G_EventThrow (teammask_t teamMask, const fireDef_t* fd, float dt, byte flags, const vec3_t position, const vec3_t velocity)
{
	G_EventAdd(G_VisToPM(teamMask), EV_ACTOR_THROW, -1);
	gi.WriteShort(dt * 1000);
	gi.WriteShort(fd->obj->idx);
	gi.WriteByte(fd->weapFdsIdx);
	gi.WriteByte(fd->fdIdx);
	gi.WriteByte(flags);
	gi.WritePos(position);
	gi.WritePos(velocity);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:20,代码来源:g_events.cpp


示例16: G_EventActorAdd

/**
 * @sa CL_ActorAdd
 */
void G_EventActorAdd (unsigned int playerMask, const edict_t *ent)
{
	G_EventAdd(playerMask, EV_ACTOR_ADD, ent->number);
	gi.WriteByte(ent->team);
	gi.WriteByte(ent->chr.teamDef ? ent->chr.teamDef->idx : NONE);
	gi.WriteByte(ent->chr.gender);
	gi.WriteByte(ent->pnum);
	gi.WriteGPos(ent->pos);
	gi.WriteShort(ent->state & STATE_PUBLIC);
	gi.WriteByte(ent->fieldSize);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:15,代码来源:g_events.cpp


示例17: G_EventActorAdd

/**
 * @sa CL_ActorAdd
 */
void G_EventActorAdd (playermask_t playerMask, const Edict& ent)
{
	G_EventAdd(playerMask, EV_ACTOR_ADD, ent.number);
	gi.WriteByte(ent.team);
	gi.WriteByte(ent.chr.teamDef ? ent.chr.teamDef->idx : NONE);
	gi.WriteByte(ent.chr.gender);
	gi.WriteByte(ent.pnum);
	gi.WriteGPos(ent.pos);
	gi.WriteShort(ent.state & STATE_PUBLIC);
	gi.WriteByte(ent.fieldSize);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:15,代码来源:g_events.cpp


示例18: G_EventInventoryAmmo

/**
 * @brief Change the amount of available ammo for the given entity
 * @param ent The entity to change the amount of ammo for
 * @param ammo The ammo to change
 * @param amount The new amount of the left ammo
 * @param shootType The shooting type to determine which container to use
 */
void G_EventInventoryAmmo (const Edict& ent, const objDef_t* ammo, int amount, shoot_types_t shootType)
{
	G_EventAdd(G_VisToPM(ent.visflags), EV_INV_AMMO, ent.number);
	gi.WriteByte(amount);
	gi.WriteByte(ammo->idx);
	if (IS_SHOT_RIGHT(shootType))
		gi.WriteByte(CID_RIGHT);
	else
		gi.WriteByte(CID_LEFT);
	/* x and y value */
	gi.WriteByte(0);
	gi.WriteByte(0);
	G_EventEnd();
}
开发者ID:Maximaximum,项目名称:ufoai,代码行数:21,代码来源:g_events.cpp


示例19: G_EventAddBrushModel

void G_EventAddBrushModel (unsigned int playerMask, const edict_t *ent)
{
	G_EventAdd(playerMask, EV_ADD_BRUSH_MODEL, ent->number);
	gi.WriteByte(ent->type);
	gi.WriteShort(ent->modelindex);
	/* strip the higher bits - only send levelflags */
	gi.WriteByte(ent->spawnflags & 0xFF);
	gi.WritePos(ent->origin);
	gi.WritePos(ent->angles);
	gi.WriteShort(ent->speed);
	gi.WriteByte(ent->angle);
	gi.WriteByte(ent->dir);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:14,代码来源:g_events.cpp


示例20: G_EventInventoryAmmo

/**
 * @brief Change the amount of available ammo for the given entity
 * @param ent The entity to change the amount of ammo for
 * @param ammo The ammo to change
 * @param amount The new amount of the left ammo
 * @param shootType The shooting type to determine which container to use
 */
void G_EventInventoryAmmo (const edict_t* ent, const objDef_t* ammo, int amount, shoot_types_t shootType)
{
	G_EventAdd(G_VisToPM(ent->visflags), EV_INV_AMMO, ent->number);
	gi.WriteByte(amount);
	gi.WriteByte(ammo->idx);
	if (IS_SHOT_RIGHT(shootType))
		gi.WriteByte(gi.csi->idRight);
	else
		gi.WriteByte(gi.csi->idLeft);
	/* x and y value */
	gi.WriteByte(0);
	gi.WriteByte(0);
	G_EventEnd();
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:21,代码来源:g_events.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ G_EventEnd函数代码示例发布时间:2022-05-30
下一篇:
C++ G_Error函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap