本文整理汇总了C#中RoomUser.ApplyEffect方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.ApplyEffect方法的具体用法?C# RoomUser.ApplyEffect怎么用?C# RoomUser.ApplyEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomUser
的用法示例。
在下文中一共展示了RoomUser.ApplyEffect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CycleUser
public static void CycleUser(RoomUser user)
{
if (user.Freezed)
{
{
++user.FreezeCounter;
}
if (user.FreezeCounter > 10)
{
user.Freezed = false;
user.FreezeCounter = 0;
ActivateShield(user);
}
}
if (!user.ShieldActive) return;
{
++user.ShieldCounter;
}
if (user.ShieldCounter <= 10) return;
user.ShieldActive = false;
user.ShieldCounter = 10;
user.ApplyEffect((int) (user.Team + 39));
}
示例2: CycleUser
internal void CycleUser(RoomUser user)
{
if (user.Freezed)
{
user.FreezeCounter++;
if (user.FreezeCounter > 10)
{
user.Freezed = false;
user.FreezeCounter = 0;
//user.ApplyEffect((int)user.team + 39);
ActivateShield(user);
}
}
if (user.shieldActive)
{
user.shieldCounter++;
if (user.shieldCounter > 10)
{
user.shieldActive = false;
user.shieldCounter = 10;
user.ApplyEffect((int)user.team + 39);
}
}
}
示例3: FreezeUser
private void FreezeUser(RoomUser user)
{
if (user.IsBot || user.shieldActive || user.team == Team.none)
return;
if (user.Freezed)
{
user.Freezed = false;
user.ApplyEffect((int)user.team + 39);
return;
}
user.Freezed = true;
user.FreezeCounter = 0;
user.FreezeLives--;
if (user.FreezeLives <= 0)
{
user.ApplyEffect(-1);
room.GetGameManager().AddPointToTeam(user.team, -20, user);
user.team = Team.none;
if (exitTeleport != null)
room.GetGameMap().TeleportToItem(user, exitTeleport);
user.Freezed = false;
user.SetStep = false;
user.IsWalking = false;
user.UpdateNeeded = true;
return;
}
room.GetGameManager().AddPointToTeam(user.team, -10, user);
user.ApplyEffect(12);
ServerMessage message = new ServerMessage();
message.Init(701);
message.AppendInt32(user.InternalRoomID);
message.AppendInt32(user.FreezeLives);
user.GetClient().SendMessage(message);
}
示例4: RemoveUserFromTeam
private static void RemoveUserFromTeam(RoomUser user)
{
user.team = Team.none;
user.ApplyEffect(-1);
}
示例5: ActivateShield
private static void ActivateShield(RoomUser user)
{
user.ApplyEffect((int)user.team + 48);
user.shieldActive = true;
user.shieldCounter = 0;
}
示例6: HandleBanzaiTiles
private void HandleBanzaiTiles(Point coord, Team team, RoomUser user)
{
if (team == Team.None) return;
_room.GetGameMap().GetCoordinatedItems(coord);
int num = 0;
foreach (RoomItem roomItem in BanzaiTiles.Values)
{
if (roomItem.GetBaseItem().InteractionType != Interaction.BanzaiFloor)
{
user.Team = Team.None;
user.ApplyEffect(0);
}
else if (roomItem.ExtraData.Equals("5") || roomItem.ExtraData.Equals("8") ||
roomItem.ExtraData.Equals("11") || roomItem.ExtraData.Equals("14"))
{
++num;
}
else if (roomItem.X == coord.X && roomItem.Y == coord.Y)
{
SetTile(roomItem, team, user);
if (roomItem.ExtraData.Equals("5") || roomItem.ExtraData.Equals("8") ||
roomItem.ExtraData.Equals("11") || roomItem.ExtraData.Equals("14"))
{
++num;
}
roomItem.UpdateState(false, true);
}
}
if (num != BanzaiTiles.Count) return;
BanzaiEnd();
}
示例7: HandleBanzaiTiles
private void HandleBanzaiTiles(Point coord, Team team, RoomUser user)
{
if (team == Team.none)
return;
this.room.GetGameMap().GetCoordinatedItems(coord);
int num = 0;
foreach (RoomItem roomItem in (IEnumerable)this.banzaiTiles.Values)
{
if (roomItem.GetBaseItem().InteractionType != InteractionType.banzaifloor)
{
user.team = Team.none;
user.ApplyEffect(0);
}
else if (roomItem.ExtraData.Equals("5") || roomItem.ExtraData.Equals("8") || roomItem.ExtraData.Equals("11") || roomItem.ExtraData.Equals("14"))
checked { ++num; }
else if (roomItem.GetX == coord.X && roomItem.GetY == coord.Y)
{
this.SetTile(roomItem, team, user);
if (roomItem.ExtraData.Equals("5") || roomItem.ExtraData.Equals("8") || roomItem.ExtraData.Equals("11") || roomItem.ExtraData.Equals("14"))
checked { ++num; }
roomItem.UpdateState(false, true);
}
}
if (num != this.banzaiTiles.Count)
return;
this.BanzaiEnd();
}
示例8: FreezeUser
private void FreezeUser(RoomUser user)
{
if (user.IsBot || user.shieldActive || user.team == Team.none)
return;
if (user.Freezed)
{
user.Freezed = false;
user.ApplyEffect((int)user.team + 39);
return;
}
user.Freezed = true;
user.FreezeCounter = 0;
user.FreezeLives--;
if (user.FreezeLives <= 0)
{
ServerMessage message2 = new ServerMessage();
message2.Init(Outgoing.UpdateFreezeLives);
message2.AppendInt32(user.InternalRoomID);
message2.AppendInt32(user.FreezeLives);
user.GetClient().SendMessage(message2);
user.ApplyEffect(-1);
room.GetGameManager().AddPointToTeam(user.team, -20, user);
TeamManager t = room.GetTeamManagerForFreeze();
t.OnUserLeave(user);
user.team = Team.none;
if (exitTeleport != null)
room.GetGameMap().TeleportToItem(user, exitTeleport);
user.Freezed = false;
user.SetStep = false;
user.IsWalking = false;
user.UpdateNeeded = true;
if (t.BlueTeam.Count <= 0 && t.RedTeam.Count <= 0 && t.GreenTeam.Count <= 0 && t.YellowTeam.Count > 0)
this.StopGame(); // yellow team win
else if (t.BlueTeam.Count > 0 && t.RedTeam.Count <= 0 && t.GreenTeam.Count <= 0 && t.YellowTeam.Count <= 0)
this.StopGame(); // blue team win
else if (t.BlueTeam.Count <= 0 && t.RedTeam.Count > 0 && t.GreenTeam.Count <= 0 && t.YellowTeam.Count <= 0)
this.StopGame(); // red team win
else if (t.BlueTeam.Count <= 0 && t.RedTeam.Count <= 0 && t.GreenTeam.Count > 0 && t.YellowTeam.Count <= 0)
this.StopGame(); // green team win
return;
}
room.GetGameManager().AddPointToTeam(user.team, -10, user);
user.ApplyEffect(12);
ServerMessage message = new ServerMessage();
message.Init(Outgoing.UpdateFreezeLives);
message.AppendInt32(user.InternalRoomID);
message.AppendInt32(user.FreezeLives);
user.GetClient().SendMessage(message);
}
示例9: CycleUser
public void CycleUser(RoomUser User)
{
if (User.Freezed)
{
User.FreezeCounter++;
if (User.FreezeCounter > 10)
{
User.Freezed = false;
User.FreezeCounter = 0;
ActivateShield(User);
}
}
if (User.shieldActive)
{
User.shieldCounter++;
if (User.shieldCounter > 10)
{
User.shieldActive = false;
User.shieldCounter = 10;
User.ApplyEffect(Convert.ToInt32(User.Team) + 39);
}
}
}
示例10: FreezeUser
private void FreezeUser(RoomUser User)
{
if (User.IsBot || User.shieldActive || User.Team == TEAM.NONE || User.Freezed)
return;
User.Freezed = true;
User.FreezeCounter = 0;
User.FreezeLives--;
if (User.FreezeLives <= 0)
{
User.GetClient().SendMessage(new UpdateFreezeLivesComposer(User.InternalRoomID, User.FreezeLives));
User.ApplyEffect(-1);
_room.GetGameManager().AddPointToTeam(User.Team, -10);
TeamManager t = _room.GetTeamManagerForFreeze();
t.OnUserLeave(User);
User.Team = TEAM.NONE;
if (_exitTeleports.Count > 0)
_room.GetGameMap().TeleportToItem(User, this.GetRandomExitTile());
User.Freezed = false;
User.SetStep = false;
User.IsWalking = false;
User.UpdateNeeded = true;
if (t.BlueTeam.Count <= 0 && t.RedTeam.Count <= 0 && t.GreenTeam.Count <= 0 && t.YellowTeam.Count > 0)
StopGame(); // yellow team win
else if (t.BlueTeam.Count > 0 && t.RedTeam.Count <= 0 && t.GreenTeam.Count <= 0 &&
t.YellowTeam.Count <= 0)
StopGame(); // blue team win
else if (t.BlueTeam.Count <= 0 && t.RedTeam.Count > 0 && t.GreenTeam.Count <= 0 &&
t.YellowTeam.Count <= 0)
StopGame(); // red team win
else if (t.BlueTeam.Count <= 0 && t.RedTeam.Count <= 0 && t.GreenTeam.Count > 0 &&
t.YellowTeam.Count <= 0)
StopGame(); // green team win
return;
}
_room.GetGameManager().AddPointToTeam(User.Team, -10);
User.ApplyEffect(12);
User.GetClient().SendMessage(new UpdateFreezeLivesComposer(User.InternalRoomID, User.FreezeLives));
}
示例11: ActivateShield
private static void ActivateShield(RoomUser User)
{
User.ApplyEffect(Convert.ToInt32(User.Team + 48));
User.shieldActive = true;
User.shieldCounter = 0;
}
示例12: FreezeUser
private void FreezeUser(RoomUser user)
{
if (user.IsBot || user.ShieldActive || user.Team == Team.None || user.Freezed)
return;
user.Freezed = true;
user.FreezeCounter = 0;
--user.FreezeLives;
if (user.FreezeLives <= 0)
{
var serverMessage = new ServerMessage();
serverMessage.Init(LibraryParser.OutgoingRequest("UpdateFreezeLivesMessageComposer"));
serverMessage.AppendInteger(user.InternalRoomId);
serverMessage.AppendInteger(user.FreezeLives);
user.GetClient().SendMessage(serverMessage);
user.ApplyEffect(-1);
_room.GetGameManager().AddPointToTeam(user.Team, -10, user);
var managerForFreeze = _room.GetTeamManagerForFreeze();
managerForFreeze.OnUserLeave(user);
user.Team = Team.None;
if (ExitTeleport != null) _room.GetGameMap().TeleportToItem(user, ExitTeleport);
user.Freezed = false;
user.SetStep = false;
user.IsWalking = false;
user.UpdateNeeded = true;
if (!managerForFreeze.BlueTeam.Any() && !managerForFreeze.RedTeam.Any() &&
!managerForFreeze.GreenTeam.Any() && managerForFreeze.YellowTeam.Any())
StopGame();
else if (managerForFreeze.BlueTeam.Any() && !managerForFreeze.RedTeam.Any() &&
!managerForFreeze.GreenTeam.Any() && !managerForFreeze.YellowTeam.Any())
StopGame();
else if (!managerForFreeze.BlueTeam.Any() && managerForFreeze.RedTeam.Any() &&
!managerForFreeze.GreenTeam.Any() && !managerForFreeze.YellowTeam.Any())
StopGame();
else
{
if (managerForFreeze.BlueTeam.Any() || managerForFreeze.RedTeam.Any() ||
!managerForFreeze.GreenTeam.Any() || managerForFreeze.YellowTeam.Any())
return;
StopGame();
}
}
else
{
_room.GetGameManager().AddPointToTeam(user.Team, -10, user);
user.ApplyEffect(12);
var serverMessage = new ServerMessage();
serverMessage.Init(LibraryParser.OutgoingRequest("UpdateFreezeLivesMessageComposer"));
serverMessage.AppendInteger(user.InternalRoomId);
serverMessage.AppendInteger(user.FreezeLives);
user.GetClient().SendMessage(serverMessage);
}
}
示例13: HandleBanzaiTiles
private void HandleBanzaiTiles(Point coord, TEAM team, RoomUser user)
{
if (team == TEAM.NONE)
return;
List<Item> items = _room.GetGameMap().GetCoordinatedItems(coord);
int i = 0;
foreach (Item _item in _banzaiTiles.Values.ToList())
{
if (_item == null)
continue;
if (_item.GetBaseItem().InteractionType != InteractionType.banzaifloor)
{
user.Team = TEAM.NONE;
user.ApplyEffect(0);
continue;
}
if (_item.ExtraData.Equals("5") || _item.ExtraData.Equals("8") || _item.ExtraData.Equals("11") ||
_item.ExtraData.Equals("14"))
{
i++;
continue;
}
if (_item.GetX != coord.X || _item.GetY != coord.Y)
continue;
SetTile(_item, team, user);
if (_item.ExtraData.Equals("5") || _item.ExtraData.Equals("8") || _item.ExtraData.Equals("11") ||
_item.ExtraData.Equals("14"))
i++;
_item.UpdateState(false, true);
}
if (i == _banzaiTiles.Count)
BanzaiEnd();
}
示例14: CycleUser
internal void CycleUser(RoomUser user)
{
if (user.Freezed)
{
checked { ++user.FreezeCounter; }
if (user.FreezeCounter > 10)
{
user.Freezed = false;
user.FreezeCounter = 0;
Freeze.ActivateShield(user);
}
}
if (!user.shieldActive)
return;
checked { ++user.shieldCounter; }
if (user.shieldCounter > 10)
{
user.shieldActive = false;
user.shieldCounter = 10;
user.ApplyEffect((int)(user.team + 39));
}
}
示例15: HandleBanzaiTiles
private void HandleBanzaiTiles(Point coord, Team team, RoomUser user)
{
if (team == Team.none)
return;
List<RoomItem> items = room.GetGameMap().GetCoordinatedItems(coord);
int i = 0;
foreach (RoomItem _item in banzaiTiles.Values)
{
if (_item.GetBaseItem().InteractionType != InteractionType.banzaifloor)
{
user.team = Team.none;
user.ApplyEffect(0);
continue;
}
if (_item.ExtraData.Equals("5") || _item.ExtraData.Equals("8") || _item.ExtraData.Equals("11") || _item.ExtraData.Equals("14"))
{
i++;
continue;
}
if (_item.GetX != coord.X || _item.GetY != coord.Y)
continue;
SetTile(_item, team, user);
if (_item.ExtraData.Equals("5") || _item.ExtraData.Equals("8") || _item.ExtraData.Equals("11") || _item.ExtraData.Equals("14"))
i++;
_item.UpdateState(false, true);
}
if (i == banzaiTiles.Count)
this.BanzaiEnd();
}