public InteractObject(string id, int interactId, InteractObjectType type, InteractObjectState state) { Id = id; InteractId = interactId; State = state; // enabling all interact objects. Seems like the default status in the xblock/flat files has it disabled. // TODO: find out where these are actually turned on? Type = type; }
public void SetInteractObject(int[] interactObjectIds, byte state, bool arg4, bool arg3) { InteractObjectState objectState = (InteractObjectState)state; foreach (int interactObjectId in interactObjectIds) { InteractObject interactObject = Field.State.InteractObjects.Values.FirstOrDefault(x => x.InteractId == interactObjectId); if (interactObject == null) { continue; } interactObject.State = objectState; Field.BroadcastPacket(InteractObjectPacket.Set(interactObject)); } }
public readonly long ExpirationTimestamp; // TODO: Remove from field if expired public AdBalloon(string id, int interactId, InteractObjectState state, InteractObjectType type, Player owner, InstallBillboard metadata, string title, string description, bool publicHouse) : base(id, interactId, type, state) { Owner = owner; Model = metadata.Model; Asset = metadata.Asset; NormalState = metadata.NormalState; Reactable = metadata.Reactable; Scale = metadata.Scale; Title = title; Description = description; PublicHouse = publicHouse; CreationTimestamp = TimeInfo.Now() + Environment.TickCount; ExpirationTimestamp = TimeInfo.Now() + Environment.TickCount + metadata.Duration; }
public long ExpirationTimestamp; // TODO: Remove from field if expired public AdBalloon(string id, int interactId, InteractObjectState state, InteractObjectType type, IFieldObject <Player> owner, InstallBillboard metadata, string title, string description, bool publicHouse) : base(id, interactId, type, state) { Owner = owner.Value; Position = owner.Coord; Rotation = owner.Rotation; Model = metadata.Model; Asset = metadata.Asset; NormalState = metadata.NormalState; Reactable = metadata.Reactable; Scale = metadata.Scale; Title = title; Description = description; PublicHouse = publicHouse; CreationTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + Environment.TickCount; ExpirationTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + Environment.TickCount + metadata.Duration; }
public bool ObjectInteracted(int[] interactIds, byte state) { InteractObjectState objectState = (InteractObjectState)state; foreach (int interactId in interactIds) { InteractObject interactObject = Field.State.InteractObjects.Values.FirstOrDefault(x => x.InteractId == interactId); if (interactObject == null) { continue; } if (interactObject.State != objectState) { return(false); } } return(true); }
public MapChest(string id, int interactId, InteractObjectType type, InteractObjectState state) : base(id, interactId, type, state) { }