本文整理汇总了C#中System.Item.GetBaseItem方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetBaseItem方法的具体用法?C# Item.GetBaseItem怎么用?C# Item.GetBaseItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Item
的用法示例。
在下文中一共展示了Item.GetBaseItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: 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);
}
示例3: 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);
}
示例4: 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 (Item.InteractingUser2 != User.UserId)
Item.InteractingUser2 = User.UserId;
if (User == null)
{
return;
}
if (Item.GetBaseItem().InteractionType == InteractionType.ONE_WAY_GATE)
{
if (User.Coordinate != Item.SquareInFront && User.CanWalk)
{
User.MoveTo(Item.SquareInFront);
return;
}
if (!Item.GetRoom().GetGameMap().ValidTile(Item.SquareBehind.X, Item.SquareBehind.Y) ||
!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, false)
|| !Item.GetRoom().GetGameMap().SquareIsOpen(Item.SquareBehind.X, Item.SquareBehind.Y, false))
{
return;
}
if ((User.LastInteraction - PlusEnvironment.GetUnixTimestamp() < 0) && User.InteractingGate &&
User.GateId == Item.Id)
{
User.InteractingGate = false;
User.GateId = 0;
}
if (!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, User.AllowOverride))
{
return;
}
if (Item.InteractingUser == 0)
{
User.InteractingGate = true;
User.GateId = Item.Id;
Item.InteractingUser = User.HabboId;
User.CanWalk = false;
if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
{
User.ClearMovement(true);
}
User.AllowOverride = true;
User.MoveTo(Item.Coordinate);
Item.RequestUpdate(4, true);
}
}
}