本文整理汇总了C#中System.Item.UpdateState方法的典型用法代码示例。如果您正苦于以下问题:C# Item.UpdateState方法的具体用法?C# Item.UpdateState怎么用?C# Item.UpdateState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Item
的用法示例。
在下文中一共展示了Item.UpdateState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
RoomUser User = null;
if (Session != null)
User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
{
if (Item.ExtraData != "-1")
{
if (Request == -1)
{
Item.ExtraData = "0";
Item.UpdateState();
}
else
{
Item.ExtraData = "-1";
Item.UpdateState(false, true);
Item.RequestUpdate(3, true);
}
}
}
else
{
User.MoveTo(Item.SquareInFront);
}
}
示例2: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (!HasRights)
{
return;
}
int OldValue = 0;
if (!int.TryParse(Item.ExtraData, out OldValue))
{
}
if (Request == 1)
{
OldValue++;
}
else if (Request == 2)
{
OldValue--;
}
else if (Request == 3)
{
OldValue = 0;
}
Item.ExtraData = OldValue.ToString();
Item.UpdateState(false, true);
}
示例3: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (Session == null || Item == null)
return;
if (!HasRights)
return;
IWiredItem Box = null;
if (!Item.GetRoom().GetWired().TryGet(Item.Id, out Box))
return;
Item.ExtraData = "1";
Item.UpdateState(false, true);
Item.RequestUpdate(2, true);
if (Item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect)
return;
if (Item.GetRoom().GetWired().IsTrigger(Item))
{
List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(Box, Item.GetRoom().GetWired().GetEffects(Box));
Session.SendMessage(new WiredTriggerConfigComposer(Box, BlockedItems));
}
else if (Item.GetRoom().GetWired().IsEffect(Item))
{
List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedTrigger(Box, Item.GetRoom().GetWired().GetTriggers(Box));
Session.SendMessage(new WiredEffectConfigComposer(Box, BlockedItems));
}
else if (Item.GetRoom().GetWired().IsCondition(Item))
Session.SendMessage(new WiredConditionConfigComposer(Box));
}
示例4: OnPlace
public void OnPlace(GameClient Session, Item Item)
{
if (Item.team == TEAM.NONE)
return;
Item.ExtraData = Item.GetRoom().GetGameManager().Points[Convert.ToInt32( Item.team)].ToString();
Item.UpdateState(false, true);
}
示例5: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (HasRights)
{
Item.GetRoom().GetGameManager().Points[Convert.ToInt32(Item.team)] = 0;
Item.ExtraData = "0";
Item.UpdateState();
}
}
示例6: OnWiredTrigger
public void OnWiredTrigger(Item Item)
{
if (Item == null)
return;
if (Item.ExtraData == "1")
return;
Item.ExtraData = "1";
Item.UpdateState(false, true);
Item.RequestUpdate(2, true);
}
示例7: OnWiredTrigger
public void OnWiredTrigger(Item Item)
{
int OldValue = 0;
if (!int.TryParse(Item.ExtraData, out OldValue))
{
}
OldValue++;
Item.ExtraData = OldValue.ToString();
Item.UpdateState(false, true);
}
示例8: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (Session == null)
return;
RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
{
int Modes = Item.GetBaseItem().Modes - 1;
if (Modes <= 0)
return;
PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH);
int CurrentMode = 0;
int NewMode = 0;
if (!int.TryParse(Item.ExtraData, out CurrentMode))
{
}
if (CurrentMode <= 0)
NewMode = 1;
else if (CurrentMode >= Modes)
NewMode = 0;
else
NewMode = CurrentMode + 1;
Item.ExtraData = NewMode.ToString();
Item.UpdateState();
}
else
User.MoveTo(Item.SquareInFront);
}
示例9: OnTrigger
public void OnTrigger(GameClients.GameClient Session, Item Item, int Request, bool HasRights)
{
if (Session == null || Session.GetHabbo() == null || Item == null)
return;
Room Room = Session.GetHabbo().CurrentRoom;
if(Room == null)
return;
RoomUser Actor = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (Actor == null)
return;
if (Item.ExtraData == "1")
return;
if(Gamemap.TileDistance(Actor.X, Actor.Y, Item.GetX, Item.GetY) > 2)
return;
Item.ExtraData = "1";
Item.UpdateState(false, true);
Item.RequestUpdate(2, true);
}
示例10: OnWiredTrigger
public void OnWiredTrigger(Item Item)
{
if (Item.GetRoom().GetSoccer().GameIsStarted)
Item.GetRoom().GetSoccer().StopGame(true);
Item.pendingReset = true;
Item.UpdateNeeded = true;
Item.ExtraData = "30";
Item.UpdateState();
Item.GetRoom().GetSoccer().StartGame();
}
示例11: OnPlace
public void OnPlace(GameClient Session, Item Item)
{
Item.ExtraData = "30";
Item.UpdateState();
}
示例12: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (!HasRights)
{
return;
}
int oldValue = 0;
if (!int.TryParse(Item.ExtraData, out oldValue))
{
Item.ExtraData = "30";
oldValue = 30;
}
if (Request == 0 && oldValue == 0)
{
oldValue = 30;
}
else if (Request == 2)
{
if (Item.GetRoom().GetSoccer().GameIsStarted && Item.pendingReset && oldValue > 0)
{
oldValue = 0;
Item.pendingReset = false;
}
else
{
if (oldValue < 30)
oldValue = 30;
else if (oldValue == 30)
oldValue = 60;
else if (oldValue == 60)
oldValue = 120;
else if (oldValue == 120)
oldValue = 180;
else if (oldValue == 180)
oldValue = 300;
else if (oldValue == 300)
oldValue = 600;
else
oldValue = 0;
Item.UpdateNeeded = false;
}
}
else if (Request == 1 || Request == 0)
{
if (Request == 1 && oldValue == 0)
{
Item.ExtraData = "30";
oldValue = 30;
}
if (!Item.GetRoom().GetSoccer().GameIsStarted)
{
Item.UpdateNeeded = !Item.UpdateNeeded;
if (Item.UpdateNeeded)
{
Item.GetRoom().GetSoccer().StartGame();
}
Item.pendingReset = true;
}
else
{
Item.UpdateNeeded = !Item.UpdateNeeded;
if (Item.UpdateNeeded)
{
Item.GetRoom().GetSoccer().StopGame(true);
}
Item.pendingReset = true;
}
}
Item.ExtraData = Convert.ToString(oldValue);
Item.UpdateState();
}
示例13: SetState
private void SetState(Item Item, string Extradata)
{
if (Item.ExtraData == Extradata)
return;
if (Item.GetBaseItem().InteractionType == InteractionType.DICE)
return;
Item.ExtraData = Extradata;
Item.UpdateState(false, true);
}
示例14: SetRotation
private void SetRotation(Item Item, int Rotation)
{
if (Item.Rotation == Rotation)
return;
Item.Rotation = Rotation;
Item.UpdateState(false, true);
}
示例15: OnWiredTrigger
public void OnWiredTrigger(Item Item)
{
if (Item.GetRoom().GetBanzai().isBanzaiActive)
Item.GetRoom().GetBanzai().BanzaiEnd(true);
Item.pendingReset = true;
Item.UpdateNeeded = true;
Item.ExtraData = "30";
Item.UpdateState();
if (!Item.GetRoom().GetBanzai().isBanzaiActive)
Item.GetRoom().GetBanzai().BanzaiStart();
}