本文整理汇总了C#中Item.GetBaseItem方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetBaseItem方法的具体用法?C# Item.GetBaseItem怎么用?C# Item.GetBaseItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.GetBaseItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0 &&
Session != null)
{
RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
{
return;
}
if (!Gamemap.TilesTouching(User.X, User.Y, Item.GetX, Item.GetY))
{
User.MoveTo(Item.SquareInFront);
return;
}
Item.InteractingUser = Session.GetHabbo().Id;
User.CanWalk = false;
User.ClearMovement(true);
User.SetRot(Rotation.Calculate(User.X, User.Y, Item.GetX, Item.GetY), false);
Item.RequestUpdate(2, true);
Item.ExtraData = "1";
Item.UpdateState(false, true);
}
}
示例2: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
int Modes = Item.GetBaseItem().Modes - 1;
if (Session == null || !HasRights || 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();
}
示例3: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
int Modes = Item.GetBaseItem().Modes - 1;
if (!HasRights)
{
return;
}
else if (Modes <= 0)
{
Item.UpdateState(false, true);
}
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;
}
if (NewMode == 0)
{
if (!Item.GetRoom().GetGameMap().itemCanBePlacedHere(Item.GetX, Item.GetY))
{
return;
}
}
Item.ExtraData = NewMode.ToString();
Item.UpdateState();
Item.GetRoom().GetGameMap().updateMapForItem(Item);
Item.GetRoom().GetWired().TriggerEvent(WiredBoxType.TriggerStateChanges, Session.GetHabbo(), Item);
//Item.GetRoom().GenerateMaps();
}
示例4: OnWiredTrigger
public void OnWiredTrigger(Item Item)
{
int Modes = Item.GetBaseItem().Modes - 1;
if (Modes <= 0)
{
Item.UpdateState(false, true);
}
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;
}
if (NewMode == 0)
{
if (!Item.GetRoom().GetGameMap().itemCanBePlacedHere(Item.GetX, Item.GetY))
{
return;
}
}
Item.ExtraData = NewMode.ToString();
Item.UpdateState();
Item.GetRoom().GetGameMap().updateMapForItem(Item);
//Item.GetRoom().GenerateMaps();
}
示例5: OnWiredTrigger
public void OnWiredTrigger(Item Item)
{
int Modes = Item.GetBaseItem().Modes - 1;
if (Modes == 0)
{
return;
}
int CurrentMode = 0;
int NewMode = 0;
if (string.IsNullOrEmpty(Item.ExtraData))
Item.ExtraData = "0";
if (!int.TryParse(Item.ExtraData, out CurrentMode))
{
return;
}
if (CurrentMode <= 0)
{
NewMode = 1;
}
else if (CurrentMode >= Modes)
{
NewMode = 0;
}
else
{
NewMode = CurrentMode + 1;
}
Item.ExtraData = NewMode.ToString();
Item.UpdateState();
}