Пример #1
1
Файл: Item.cs Проект: habb0/Bfly
        internal Item(UInt32 Id, int Sprite, string PublicName, string Name, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat, bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, InteractionType InteractionType, int Modes, string VendingIds)
        {
            this.Id = Id;
            this.SpriteId = Sprite;
            this.PublicName = PublicName;
            this.Name = Name;
            this.Type = char.Parse(Type);
            this.Width = Width;
            this.Length = Length;
            this.Height = Height;
            this.Stackable = Stackable;
            this.Walkable = Walkable;
            this.IsSeat = IsSeat;
            this.AllowRecycle = AllowRecycle;
            this.AllowTrade = AllowTrade;
            this.AllowMarketplaceSell = AllowMarketplaceSell;
            this.AllowGift = AllowGift;
            this.AllowInventoryStack = AllowInventoryStack;
            this.InteractionType = InteractionType;
            this.Modes = Modes;
            this.VendingIds = new List<int>();

            foreach (string VendingId in VendingIds.Split(','))
            {
                this.VendingIds.Add(int.Parse(VendingId));
            }
        }
Пример #2
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            bool result = false; 
            switch (Top.GAME.playerCharacter.GetHeldObject().function) {
                case Pickups.PickupObject.PickupFunction.FightFire:
                    if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite(true);
                    result = true; 
                    break;

                case Pickups.PickupObject.PickupFunction.BatteryLive: 
                    result = true;
                    if (status == ObjectStatus.Broken) {
                        status = ObjectStatus.On;
                        indicator.Hide();
                        if (GetComponent<ObjectiveStatus>()) {
                            GetComponent<ObjectiveStatus>().MarkComplete();
                        }
                    }
                    break;

                default:
                    Top.GAME.SetMessageText("That didn't do anything.", Color.red);
                    break;
            }

            Top.GAME.playerCharacter.GetHeldObject().OnUse(result);
            base.Interact();
        }//Interact
Пример #3
0
 //InteractionType.Input  : string
 //InteractionType.Concept: Tuple<string, string>
 public ProblemWord(int id, string word, InteractionType interactType, object dragObject)
 {
     Id = id;
     Word = word;
     InteractType = interactType;
     DragObject = dragObject;
 }
Пример #4
0
 internal static bool TypeIsWired(InteractionType type)
 {
     switch (type)
     {
         case InteractionType.triggertimer:
         case InteractionType.triggerroomenter:
         case InteractionType.triggergameend:
         case InteractionType.triggergamestart:
         case InteractionType.triggerrepeater:
         case InteractionType.triggeronusersay:
         case InteractionType.triggerscoreachieved:
         case InteractionType.triggerstatechanged:
         case InteractionType.triggerwalkonfurni:
         case InteractionType.triggerwalkofffurni:
         case InteractionType.actiongivescore:
         case InteractionType.actionposreset:
         case InteractionType.actionmoverotate:
         case InteractionType.actionresettimer:
         case InteractionType.actionshowmessage:
         case InteractionType.actionteleportto:
         case InteractionType.actiontogglestate:
         case InteractionType.conditionfurnishaveusers:
         case InteractionType.conditionfurnihasfurni:
         case InteractionType.conditionstatepos:
         case InteractionType.conditiontimelessthan:
         case InteractionType.conditiontimemorethan:
         case InteractionType.conditiontriggeronfurni:
             return true;
         default:
             return false;
     }
 }
Пример #5
0
        public void Add(InteractionType type, string extradata)
        {
            string line = DateTime.Now.ToFileTimeUtc().ToString() + "," + _userid + "," 
                          + _condition + "," + type.ToString() + "," + extradata;

            _logger.AddLine(line);
        }
Пример #6
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            if (type == InteractionType.Primary) {
                bool result = false;
                switch (Top.GAME.playerCharacter.GetHeldObject().function) {
                    //Light bulb
                    case Pickups.PickupObject.PickupFunction.LightBulb:
                        result = true;
                        status = ObjectStatus.Off;
                        indicator.Hide();
                        if (GetComponent<ObjectiveStatus>()) {
                            GetComponent<ObjectiveStatus>().MarkComplete();
                        }
                        break;

                    //Water / Extenguisher
                    case Pickups.PickupObject.PickupFunction.FightFire:
                        result = true;
                        if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite();
                        break;

                    default:
                        Top.GAME.SetMessageText("That didn't do any good", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;
                }
                Top.GAME.playerCharacter.GetHeldObject().OnUse(result);
            }
            base.Interact();
        }//Interact
Пример #7
0
 public virtual IInteraction CreateInteraction(string pId,
     DateTime pStartDateTime,
     DateTime pEndDateTime,
     bool pIsActive,
     string pText,
     InteractionType pType,
     InteractionState pState,
     IUser pOwner,
     IUser pCreator,
     DateTime pCreated,
     DateTime pModified)
 {
     if (string.IsNullOrEmpty(pId))
         pId = GenericHelper.GenerateId();
     return (new Interaction(pId,
         pStartDateTime,
         pEndDateTime,
         pCreated,
         pModified,
         pIsActive,
         pText,
         pType,
         pCreator,
         pOwner,
         pState));
 }
Пример #8
0
 public InteractionEventArgs(string pMessage, DateTime pEventDateTime, InteractionType pType, 
     List<InteractionAttributes> pChangedAttributes)
 {
     this.Type = pType;
     EventDateTime = pEventDateTime;
     Message = pMessage;
     ChangedAttributeList = pChangedAttributes;
 }
Пример #9
0
        }//OnFirstButton

        public override void Interact(InteractionType type = InteractionType.Primary) {
            Fire[] fires = Top.GAME.playerCharacter.GetComponentsInChildren<Fire>();
            for (int i = 0; i < fires.Length; ++i) {
                fires[i].Contain();
            }
            Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotHappy")); 
            base.Interact();
        }//Interact
Пример #10
0
 public static bool IsPet(InteractionType Type)
 {
     if (Type == InteractionType.pet0 || Type == InteractionType.pet1 || Type == InteractionType.pet2 || Type == InteractionType.pet3 || Type == InteractionType.pet4 || Type == InteractionType.pet5 || Type == InteractionType.pet6 ||
        Type == InteractionType.pet7 || Type == InteractionType.pet8 || Type == InteractionType.pet9 || Type == InteractionType.pet10 || Type == InteractionType.pet11 || Type == InteractionType.pet12 ||
        Type == InteractionType.pet13 || Type == InteractionType.pet14 || Type == InteractionType.pet15 || Type == InteractionType.pet16 || Type == InteractionType.pet17 || Type == InteractionType.pet18)
         return true;
     return false;
 }
Пример #11
0
        public ItemData(int Id, int Sprite, string Name, string PublicName, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat,
            bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, InteractionType InteractionType, int Modes,
            string VendingIds, string AdjustableHeights, int EffectId, int WiredId, bool IsRare, int ClothingId, bool ExtraRot)
        {
            this.Id = Id;
            this.SpriteId = Sprite;
            this.ItemName = Name;
            this.PublicName = PublicName;
            this.Type = char.Parse(Type);
            this.Width = Width;
            this.Length = Length;
            this.Height = Height;
            this.Stackable = Stackable;
            this.Walkable = Walkable;
            this.IsSeat = IsSeat;
            this.AllowEcotronRecycle = AllowRecycle;
            this.AllowTrade = AllowTrade;
            this.AllowMarketplaceSell = AllowMarketplaceSell;
            this.AllowGift = AllowGift;
            this.AllowInventoryStack = AllowInventoryStack;
            this.InteractionType = InteractionType;
            this.Modes = Modes;
            this.VendingIds = new List<int>();
            if (VendingIds.Contains(","))
            {
                foreach (string VendingId in VendingIds.Split(','))
                {
                    try
                    {
                        this.VendingIds.Add(int.Parse(VendingId));
                    }
                    catch
                    {
                        Console.WriteLine("Error with Item " + ItemName + " - Vending Ids");
                        continue;
                    }
                }
            }
            else if (!String.IsNullOrEmpty(VendingIds) && (int.Parse(VendingIds)) > 0)
                this.VendingIds.Add(int.Parse(VendingIds));

            this.AdjustableHeights = new List<double>();
            if (AdjustableHeights.Contains(","))
            {
                foreach (string H in AdjustableHeights.Split(','))
                {
                    this.AdjustableHeights.Add(double.Parse(H));
                }
            }
            else if (!String.IsNullOrEmpty(AdjustableHeights) && (double.Parse(AdjustableHeights)) > 0)
                this.AdjustableHeights.Add(double.Parse(AdjustableHeights));

            this.EffectId = EffectId;
            this.WiredType = WiredBoxTypeUtility.FromWiredId(WiredId);
            this.IsRare = IsRare;
            this.ClothingId = ClothingId;
            this.ExtraRot = ExtraRot;
        }
Пример #12
0
 public InteractionSprite(Texture2D tex, InteractionType type )
     : base(tex)
 {
     this.mTexture = tex;
     this.width = this.mTexture.Width / 2;
     this.height = this.mTexture.Height;
     this.BeenInteractedWith = false;
     this.InteractionType = type;
 }
Пример #13
0
 public PageItem SelectAppropriatePageItem(IEnumerable<PageItem> pageItems, InteractionType interactionType, string inputNumber, string givenAnswer)
 {
     IEnumerable<PageItem> result = pageItems.Where(p=>p.Interaction==interactionType&&p.ExpectedInputNumber==inputNumber).ToList();
     if (result.Count() == 1) return result.First();
     PageItem appropriatePage = result.FirstOrDefault(pi =>  pi.ExpectedInput.Equals(givenAnswer.Trim(), StringComparison.CurrentCultureIgnoreCase));
     if (appropriatePage == null) return result.FirstOrDefault();
     return appropriatePage;
     //return null;
 }
Пример #14
0
        }//OnFirstButton

        public override bool CanInteract(InteractionType type = InteractionType.Primary) {
            if (Top.GAME.playerCharacter.GetHeldObject() && Top.GAME.playerCharacter.GetHeldObject().function == PickupObject.PickupFunction.FightFire) {
                Top.GAME.PlayGlobalSound(Top.GAME.GetSound("fireExtenguish"));
                return true;
            } else {
                Top.GAME.SetMessageText("You don't have a fire extenguisher!", Color.red);
                Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                return false;
            }
        }//Interact
Пример #15
0
 internal static bool NeedsSettings(InteractionType type)
 {
     switch (type)
     {
         case InteractionType.conditionstatepos:
         case InteractionType.conditionhasfurnionfurni:
             return true;
     }
     return false;
 }
Пример #16
0
 public void InteractionStarted(InteractionType interaction)
 {
     switch (interaction)
     {
     case InteractionType.DinnerConversation:
         Player.CharacterAnimator.SetBool("Sit", true);
         Player.ForceLeft          = true;
         Player.transform.position = new Vector3(5.8f, Player.transform.position.y, Player.transform.position.z);
         break;
     }
 }
Пример #17
0
        private static ImmutableArray <InteractionType> LoadInteractionTypes(XElement elementRoot)
        {
            var interactionTypes = elementRoot
                                   .Element("Items")
                                   .Elements("Item")
                                   .Select(i => InteractionType.Create(i))
                                   .OrderBy(i => i.Order)
                                   .ToImmutableArray();

            return(interactionTypes);
        }
    public void CheckDirection(InteractionType previous, InteractionType next)
    {
        int direction = 1;

        if ((previous == InteractionType.Computer && next == InteractionType.Broom) || (previous == InteractionType.Computer && next == InteractionType.Baby) || (previous == InteractionType.Broom && next == InteractionType.Baby))
        {
            direction = -1;
        }

        mainCharacter.transform.localScale = new Vector3(Mathf.Abs(mainCharacter.transform.localScale.x) * direction, mainCharacter.transform.localScale.y, mainCharacter.transform.localScale.z);
    }
Пример #19
0
 public virtual void Interaction(InteractionType i)
 {
     switch (i)
     {
     case InteractionType.Debug:
     {
         Debugging.ToggleDebug();
         break;
     }
     }
 }
Пример #20
0
 void SetInteractionPanel(bool isOpenEvent, InteractionType interactionType)
 {
     if (_gameStateManager.CurrentGameState == GameState.Gameplay)
     {
         if (isOpenEvent)
         {
             _interactionPanel.FillInteractionPanel(interactionType);
         }
         _interactionPanel.gameObject.SetActive(isOpenEvent);
     }
 }
Пример #21
0
 public InteractionPointLatest(InteractionpointSerializeCompat pointCompat)
 {
     type               = pointCompat.type;
     title              = pointCompat.title;
     body               = pointCompat.body;
     filename           = pointCompat.filename;
     startTime          = pointCompat.startTime;
     endTime            = pointCompat.endTime;
     returnRayOrigin    = pointCompat.returnRayOrigin;
     returnRayDirection = pointCompat.returnRayDirection;
 }
 private InteractionPayload GetPayloadType(InteractionType value)
 {
     return(value switch
     {
         InteractionType.GlobalShortcut => new GlobalShortcutPayload(),
         InteractionType.MessageAction => new MessageActionPayload(),
         InteractionType.BlockActions => new BlockActionsPayload(),
         InteractionType.ViewClosed => new ViewClosedPayload(),
         InteractionType.ViewSubmission => new ViewSubmissionPayload(),
         _ => (InteractionPayload)null
     });
Пример #23
0
        /// <summary> Write the coordinates and action to the memory. </summary> <param
        /// name="pos">Vector3 containing the X,y & Z coordinates</param> <param name="action">CTM
        /// Interaction to perform</param>
        private static void WriteXYZToMemory(Vector3 pos, InteractionType action)
        {
            const float distance = 1.5f;

            AmeisenLogger.Instance.Log(LogLevel.VERBOSE, $"Writing: X [{pos.X},{pos.Y},{pos.Z}] Action [{action}] Distance [{distance}]", "AmeisenCore");
            BlackMagic.WriteFloat(Offsets.ctmX, (float)pos.X);
            BlackMagic.WriteFloat(Offsets.ctmY, (float)pos.Y);
            BlackMagic.WriteFloat(Offsets.ctmZ, (float)pos.Z);
            BlackMagic.WriteInt(Offsets.ctmAction, (int)action);
            BlackMagic.WriteFloat(Offsets.ctmDistance, distance);
        }
Пример #24
0
 /// <summary>
 /// Get currently used interaction hijack
 /// </summary>
 /// <param name="type">Type of the interaction</param>
 /// <returns>The hijack</returns>
 private IInteractable GetCurrentHijack(InteractionType type)
 {
     foreach (var hijack in Hijacks)
     {
         if (hijack.ValidateInteraction(type))
         {
             return(hijack);
         }
     }
     return(null);
 }
Пример #25
0
    public void TryInteractionMatch(InteractionType interactionType, Vector2 interactionPosition)
    {
        Police    police    = Interactor.GetFreeInteractor(FindObjectsOfType <Police>());
        Protester protester = Interactor.GetFreeInteractor(FindObjectsOfType <Protester>());

        if (police == null || protester == null)
        {
            return;
        }
        _interactions.Add(new InteractionProcess(interactionType, protester, police, interactionPosition));
    }
Пример #26
0
        public static bool IsPet(InteractionType Type)
        {
            if (Type == InteractionType.pet0 || Type == InteractionType.pet1 || Type == InteractionType.pet2 || Type == InteractionType.pet3 || Type == InteractionType.pet4 || Type == InteractionType.pet5 || Type == InteractionType.pet6 ||
                Type == InteractionType.pet7 || Type == InteractionType.pet8 || Type == InteractionType.pet9 || Type == InteractionType.pet10 || Type == InteractionType.pet11 || Type == InteractionType.pet12 ||
                Type == InteractionType.pet13 || Type == InteractionType.pet14 || Type == InteractionType.pet15 || Type == InteractionType.pet16 || Type == InteractionType.pet17 || Type == InteractionType.pet18)
            {
                return(true);
            }

            return(false);
        }
Пример #27
0
        public override void UpdatePropertiesFrom(IUpdatable sourceObject, ICloneManager cloneManager)
        {
            base.UpdatePropertiesFrom(sourceObject, cloneManager);
            var sourceInteractionProcess = sourceObject as InteractionProcess;

            if (sourceInteractionProcess == null)
            {
                return;
            }
            InteractionType = sourceInteractionProcess.InteractionType;
        }
Пример #28
0
 public void Add(Guid id, InteractionType type)
 {
     lock (_queueLocker)
     {
         _queue.Add(new InteractionItem
         {
             Id   = id,
             Type = type
         });
     }
 }
Пример #29
0
 public GameObject Find(InteractionType action)
 {
     if (children.ContainsKey(action))
     {
         return(children[action]);
     }
     else
     {
         return(null);
     }
 }
Пример #30
0
        private void KeyInputHandler(IInputElement sender, KeyEventArgs e, InteractionType type)
        {
            var mousePosition = Mouse.GetPosition(sender);
            var interaction   = new DiagramInteractionEventArguments(type)
            {
                MousePosition = mousePosition,
                Key           = e.Key
            };

            DiagramInteractionManager.HandleDiagramInput(interaction, this);
        }
Пример #31
0
        public async Task <ActionResult> Edit([Bind(Include = "InteractionTypeID,InteractionType1")] InteractionType interactionType)
        {
            if (ModelState.IsValid)
            {
                db.Entry(interactionType).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(interactionType));
        }
Пример #32
0
 public void Interact(InteractionType type, Interactor actor)
 {
     if (!GameStateManager.IsMenu)
     {
         // TODO (hitch) A SNOW EFFECT WOULD LOOK AWESOME!!!!
         GameStateManager.IsMenu = true;
         yearText.text           = "Year " + (GameStateManager.State.currentYear + 1);
         text.alpha = 0;
         StartCoroutine(DoNewYear());
     }
 }
 public virtual void FillInteractionPanel(InteractionType interactionType)
 {
     if (listInteractions != null && interactionItem != null)
     {
         if (listInteractions.Exists(o => o.InteractionType == interactionType))
         {
             interactionItem.FillInteractionPanel(listInteractions.Find(o =>
                                                                        o.InteractionType == interactionType));
         }
     }
 }
    public void FillInteractionPanel(InteractionType interactionType)
    {
        if ((_listInteractions != null) && (_interactionItem != null))
        {
            if (_listInteractions.Exists(o => o.InteractionType == interactionType))

            {
                _interactionItem.FillInteractionPanel(_listInteractions.Find(o => o.InteractionType == interactionType));
            }
        }
    }
 internal static InteractionPayload GetPayloadType(InteractionType value)
 {
     return(value switch
     {
         InteractionType.GlobalShortcut => new GlobalShortcutPayload(),
         InteractionType.MessageAction => new MessageActionPayload(),
         InteractionType.BlockActions => new BlockActionsPayload(),
         InteractionType.ViewClosed => new ViewClosedPayload(),
         InteractionType.ViewSubmission => new ViewSubmissionPayload(),
         InteractionType.WorkflowStepEdit => new WorkflowStepEditPayload(),
         _ => (InteractionPayload)null
     });
Пример #36
0
        public bool CreateInteraction(InteractionType type, DynamicElement character, out BaseAction action, out ActionArg arg)
        {
            if (interactionsCreator.ContainsKey(type) != true)
            {
                action = null;
                arg    = null;
                return(false);
            }

            interactionsCreator[type](character, out action, out arg);
            return(true);
        }
Пример #37
0
 public override void Interaction(InteractionType i)
 {
     base.Interaction(i);
     switch (i)
     {
     case InteractionType.Start:
     {
         representation.stateMachine.SetState(representation.inGame);
         break;
     }
     }
 }
Пример #38
0
 public void FillInteractionPanel(InteractionType interactionType)
 {
     if ((_listInteractions != null) && (_interactionItem != null))
     {
         //Check if interactionType exists in list of interactions
         if (_listInteractions.Exists(o => o.InteractionType == interactionType))
         {
             //Fill interaction panel if interactionType is present
             _interactionItem.FillInteractionPanel(_listInteractions.Find(o => o.InteractionType == interactionType));
         }
     }
 }
Пример #39
0
    InteractionConfig GetConfigForId(InteractionType id)
    {
        foreach (var config in editorInteractions)
        {
            if (config.interactionType == id)
            {
                return(config);
            }
        }

        return(null);
    }
Пример #40
0
 public static Sprite GetSprite(InteractionType type)
 {
     if (sprites.ContainsKey(type))
     {
         return(sprites[type]);
     }
     else
     {
         Debug.Log($"Sprite for {type} not found");
         return(null);
     }
 }
Пример #41
0
 private void RequestInteraction(Interactable interactable, InteractionType interactionType)
 {
     using (Packet packet = new Packet((int)ClientPackets.interactionRequest))
     {
         Debug.Log("interaction request");
         packet.Write(Client.instance.id);
         packet.Write(interactable.GetBoatEntity().id);
         packet.Write((int)interactable.GetBoatEntity().BoatEntityType);
         packet.Write((int)interactionType);
         ClientSend.SendUDPData(packet);
     }
 }
Пример #42
0
 public void StartInteraction(InteractionType interactionType)
 {
     Interacted.Raise(this, new InteractedWithEventArgs()
     {
         InteractionType = interactionType
     });
     if (_useGenericInteractionIndicators)
     {
         _interactionIndicatorRend.sprite = _interactingSprite;
         _interactionIndicatorPS.Stop();
     }
 }
Пример #43
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            switch (Top.GAME.playerCharacter.GetHeldObject().function) {
                case Pickups.PickupObject.PickupFunction.Trash:
                    if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite(true);
                    break;

                default:
                    break;
            }
            Top.GAME.playerCharacter.DropHeldObject(true);
            base.Interact();
        }//Interact
Пример #44
0
 public void OnPlayerInteracted(InteractionType type)
 {
     if (type == InteractionType.PC)
     {
         UICanvas.SetActive(true);
         Game.Instance.Player.GetPlayerConversant.StartDialogue(PCDialogue, aiConversant);
     }
     else
     {
         UICanvas.SetActive(false);
     }
 }
Пример #45
0
    public void Interact(InteractionType interactionReceived)
    {
        if (!CanInteract() || interactionReceived != m_interactionType)
        {
            return;
        }

        m_lastUse     = Time.time;
        m_isActivated = true;

        OnInteract();
    }
Пример #46
0
 public static InteractionItem GetItem(Guid id, InteractionType type, InteractionState state)
 {
     if (!_itemsPool.TryTake(out InteractionItem item))
     {
         item = new InteractionItem();
     }
     item.Id              = id;
     item.Type            = type;
     item.State           = state;
     item.WasTouchChanged = false;
     return(item);
 }
Пример #47
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            if (type == InteractionType.Primary) {
                switch (status) {
                    case ObjectStatus.Off:
                        status = ObjectStatus.On;
                        if (audioSource != null) {
                            audioSource.clip = Top.GAME.GetSound("ssj_loop");
                            audioSource.Play();
                        }
                        if (GetComponentInChildren<SpriteRenderer>()) GetComponentInChildren<SpriteRenderer>().sprite = onSprite;
                        break;

                    case ObjectStatus.On:
                        status = ObjectStatus.Off;
                        if (audioSource != null) audioSource.Stop();
                        if (GetComponentInChildren<SpriteRenderer>()) GetComponentInChildren<SpriteRenderer>().sprite = offSprite;
                        break;

                    case ObjectStatus.Broken:
                        Top.GAME.SetMessageText("The TV is broken!", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;
                }
            } else {
                bool result = false;
                switch (Top.GAME.playerCharacter.GetHeldObject().function) {
                    //Duct tape
                    case Pickups.PickupObject.PickupFunction.Repair:
                        result = true;
                        status = ObjectStatus.Off;
                        indicator.Hide();
                        if (GetComponent<ObjectiveStatus>()) {
                            GetComponent<ObjectiveStatus>().MarkComplete();
                        }
                        break;

                    //Water / Extenguisher
                    case Pickups.PickupObject.PickupFunction.FightFire:
                        result = true;
                        if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite();
                        break;

                    default:
                        Top.GAME.SetMessageText("That didn't do any good", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;
                }
                Top.GAME.playerCharacter.GetHeldObject().OnUse(result);
            }
            base.Interact();
        }//Interact
Пример #48
0
 public AnswerResult(long activityAttempId, long activityPackageId, string activityTitle, long? interactionId, CompletionStatus completionStatus, SuccessStatus? successStatus, 
     AttemptResult attempResult, object learnerResponse, string correctResponse, InteractionType? learnerResponseType, float? scaledScore)
 {
     this.ActivityAttemptId = activityAttempId;
     this.ActivityPackageId = activityPackageId;
     this.ActivityTitle = activityTitle;
     this.InteractionId = interactionId;
     this.CompletionStatus = completionStatus;
     this.SuccessStatus = successStatus;
     this.AttemptResult = attempResult;
     this.LearnerResponse = learnerResponse;
     this.CorrectResponse = correctResponse;
     this.LearnerResponseType = learnerResponseType;
     this.ScaledScore = scaledScore;
 }
Пример #49
0
 internal static bool TypeIsWire(InteractionType type)
 {
     switch (type)
     {
         case InteractionType.wireCenter:
         case InteractionType.wireCorner:
         case InteractionType.wireSplitter:
         case InteractionType.wireStandard:
             {
                 return true;
             }
         default:
             return false;
     }
 }
Пример #50
0
		internal Item(uint Id, int Sprite, string PublicName, string Name, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat, bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, InteractionType InteractionType, int Modes, string VendingIds, bool sub, int effect, bool StackMultiple, string[] toggle, int flatId)
		{
			this.Id = Id;
			this.SpriteId = Sprite;
			this.PublicName = PublicName;
			this.Name = Name;
			this.Type = char.Parse(Type);
			this.Width = Width;
			this.Length = Length;
			this.Height = Height;
			this.Stackable = Stackable;
			this.Walkable = Walkable;
			this.IsSeat = IsSeat;
			this.AllowRecycle = AllowRecycle;
			this.AllowTrade = AllowTrade;
			this.AllowMarketplaceSell = AllowMarketplaceSell;
			this.AllowGift = AllowGift;
			this.AllowInventoryStack = AllowInventoryStack;
			this.InteractionType = InteractionType;
			this.Modes = Modes;
			this.VendingIds = new List<int>();
			this.SubscriberOnly = sub;
			this.EffectId = effect;
			if (VendingIds.Contains(","))
			{
				string[] array = VendingIds.Split(new char[]
				{
					','
				});
				for (int i = 0; i < array.Length; i++)
				{
					string s = array[i];
					this.VendingIds.Add(int.Parse(s));
				}
			}
			else
			{
				if (!VendingIds.Equals("") && int.Parse(VendingIds) > 0)
				{
					this.VendingIds.Add(int.Parse(VendingIds));
				}
			}
			this.StackMultipler = StackMultiple;
			this.ToggleHeight = toggle;
			this.FlatId = flatId;
		}
        void MediaPlayer_CaptionsInvoked(object sender, RoutedEventArgs e)
        {
            if (MediaPlayer.AvailableCaptions.Any())
            {
                captionSelectorView = new CaptionSelectorView();
                if (CaptionSelectorViewStyle != null) captionSelectorView.Style = CaptionSelectorViewStyle;

                vm = MediaPlayer.InteractiveViewModel;
                captionSelectorView.AvailableCaptions = vm.AvailableCaptions;
                captionSelectorView.SelectedCaption = vm.SelectedCaption;

                SettingsContainer.Visibility = Visibility.Visible;
                SettingsContainer.Children.Add(captionSelectorView);
                captionSelectorView.Close += captionSelectorView_Close;
                captionSelectorView.SelectedCaptionChanged += captionSelectorView_SelectedCaptionChanged;
                deactivationMode = MediaPlayer.InteractiveDeactivationMode;
                MediaPlayer.InteractiveDeactivationMode = InteractionType.None;
            }
        }
Пример #52
0
 public static bool NeedsFurnitures(InteractionType type)
 {
     switch (type)
     {
         case InteractionType.triggerstatechanged:
         case InteractionType.triggerwalkonfurni:
         case InteractionType.triggerwalkofffurni:
         case InteractionType.actionposreset:
         case InteractionType.actionmoverotate:
         case InteractionType.actionresettimer:
         case InteractionType.actionteleportto:
         case InteractionType.actiontogglestate:
         case InteractionType.conditionfurnishaveusers:
         case InteractionType.conditionstatepos:
         case InteractionType.conditiontriggeronfurni:
         case InteractionType.conditionhasfurnionfurni:
             return true;
     }
     return false;
 }
Пример #53
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            if (type == InteractionType.Primary) {
                bool result = false;
                switch (Top.GAME.playerCharacter.GetHeldObject().function) {
                    //Battery 
                    case Pickups.PickupObject.PickupFunction.BatteryLive:
                        ++loadedBatteries;
                        result = true;
                        if (GetComponent<ObjectiveStatus>()) {
                            if (loadedBatteries >= batteriesToLoad) {
                                indicator.Hide();
                                GetComponent<ObjectiveStatus>().MarkComplete();
                            }

                            GetComponent<ObjectiveStatus>().ChangeDescription("Put a new battery in the Robo-Charger (" + loadedBatteries + "/2)");
                        }
                        break;

                    case Pickups.PickupObject.PickupFunction.BatteryDead:
                        Top.GAME.SetMessageText("The machine didn't seem to do anything.", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;

                    //Water / Extenguisher
                    case Pickups.PickupObject.PickupFunction.FightFire:
                        result = true;
                        if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite();
                        break;

                    default:
                        Top.GAME.SetMessageText("That didn't do any good", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;
                }
                Top.GAME.playerCharacter.GetHeldObject().OnUse(result);
            } else {
                Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotHappy"));
            }
            base.Interact();
        }//Interact
Пример #54
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            if (type == InteractionType.Primary) {
                bool result = false;
                switch (Top.GAME.playerCharacter.GetHeldObject().function) {
                    //Battery 
                    case Pickups.PickupObject.PickupFunction.FoodCart:
                        ++loadedFood;
                        result = true;
                        if (GetComponent<ObjectiveStatus>()) {
                            if (loadedFood >= foodToLoad) {
                                indicator.Hide();
                                GetComponent<ObjectiveStatus>().MarkComplete();
                            }

                            GetComponent<ObjectiveStatus>().ChangeDescription("Refill the food dispenser (" + loadedFood + "/" + foodToLoad + ")");
                        }
                        break;

                    case Pickups.PickupObject.PickupFunction.Trash:
                    case Pickups.PickupObject.PickupFunction.BatteryLive:
                    case Pickups.PickupObject.PickupFunction.LightBulb:
                    case Pickups.PickupObject.PickupFunction.BatteryDead:
                    case Pickups.PickupObject.PickupFunction.FightFire:
                        result = true;
                        Top.GAME.SetMessageText("It didn't like that.", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite();
                        break;

                    default:
                        Top.GAME.SetMessageText("That didn't do any good", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;
                }
                Top.GAME.playerCharacter.GetHeldObject().OnUse(result);
            }
            base.Interact();
        }//Interact
Пример #55
0
        internal Item(uint Id, int Sprite, string PublicName, string Name, string Type, int Width, int Length, 
            double Height, bool Stackable, bool Walkable, bool IsSeat, bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack,
            InteractionType InteractionType, int Modes, string VendingIds, SortedDictionary<uint, double> heightModes, bool isGroupItem)
        {
            this.Id = Id;
            this.SpriteId = Sprite;
            this.PublicName = PublicName;
            this.Name = Name;
			this.Type = char.ToLower(Type[0]);
            this.Width = Width;
            this.Length = Length;
            this.Height = Height;
            this.Stackable = Stackable;
            this.Walkable = Walkable;
            this.IsSeat = IsSeat;
            this.AllowRecycle = AllowRecycle;
			this.HeightModes = heightModes;
            this.AllowTrade = AllowTrade;
            this.AllowMarketplaceSell = AllowMarketplaceSell;
            this.AllowGift = AllowGift;
            this.AllowInventoryStack = AllowInventoryStack;
            this.InteractionType = InteractionType;
            this.FurniInteractor = FurniInteractorFactory.GetInteractable(this.InteractionType);
            this.FurniInitializer = FurniIInitializerFactory.GetInteractable(this.InteractionType);
            this.FurniTrigger = FurniTriggerFactory.GetInteractable(this.InteractionType);
            this.Modes = Modes;
            this.VendingIds = new List<int>();
            this.IsGift = false;
            this.IsGroupItem = isGroupItem;

            if (VendingIds.Contains(","))
            {
                foreach (string VendingId in VendingIds.Split(','))
                    this.VendingIds.Add(TextHandling.ParseInt32(VendingId));
            }
            else if (!VendingIds.Equals(string.Empty) && (TextHandling.ParseInt32(VendingIds)) > 0)
                this.VendingIds.Add(TextHandling.ParseInt32(VendingIds));
        }
Пример #56
0
        }//CanInteract

        public override void Interact(InteractionType type = InteractionType.Primary) {
            if (type == InteractionType.Primary) {
                switch (status) {
                    case ObjectStatus.Off:
                        status = ObjectStatus.On;
                        if (audioSource != null) audioSource.Play();
                        break;

                    case ObjectStatus.On:
                        status = ObjectStatus.Off;
                        if (audioSource != null) audioSource.Stop();
                        break;

                    case ObjectStatus.Broken:
                        Top.GAME.SetMessageText("It won't stop beeping! Oh no!", Color.red);
                        Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                        break;
                }
            } else {
                Top.GAME.PlayGlobalSound(Top.GAME.GetSound("smash"));
                float rand = Random.Range(0f,1f);
                if (rand < smashChance) {
                    Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("robotError"));
                    if (rand < igniteChance) {
                        if (GetComponent<Flammable>()) GetComponent<Flammable>().Ignite();
                    }
                } else {
                    status = ObjectStatus.Off;
                    if (audioSource != null) audioSource.Stop();
                    indicator.Hide();
                    if (GetComponent<ObjectiveStatus>()) {
                        GetComponent<ObjectiveStatus>().MarkComplete();
                    }
                }
            }
            base.Interact();
        }//Interact
Пример #57
0
 public Interaction(string pId,
     DateTime pstartDateTime,
     DateTime pendDateTime,
     DateTime pcreatedDateTime,
     DateTime pDateTimemodified,
     bool pisActive,
     string ptext,
     InteractionType ptype,
     IUser pcreator,
     IUser powner,
     InteractionState pstate)
 {
     _id = pId;
     StartDateTime = pstartDateTime;
     EndDateTime = pendDateTime;
     _createdDateTime= pcreatedDateTime;
     ModifiedDateTime = pDateTimemodified;
     _isActive = pisActive;
     Text = ptext;
     _type = ptype;
     _creator = pcreator;
     Owner = powner;
     _state = pstate;
 }
        public override void ShowGUI(List<ActionParameter> parameters)
        {
            if (AdvGame.GetReferences () && AdvGame.GetReferences ().settingsManager)
            {
                parameterID = Action.ChooseParameterGUI ("Hotspot to checl:", parameters, parameterID, ParameterType.GameObject);
                if (parameterID >= 0)
                {
                    constantID = 0;
                    hotspot = null;
                }
                else
                {
                    hotspot = (Hotspot) EditorGUILayout.ObjectField ("Hotspot to check:", hotspot, typeof (Hotspot), true);

                    constantID = FieldToID <Hotspot> (hotspot, constantID);
                    hotspot = IDToField <Hotspot> (hotspot, constantID, false);
                }

                interactionType = (InteractionType) EditorGUILayout.EnumPopup ("Interaction to check:", interactionType);

                if ((!isAssetFile && hotspot != null) || isAssetFile)
                {
                    if (interactionType == InteractionType.Use)
                    {
                        if (isAssetFile)
                        {
                            number = EditorGUILayout.IntField ("Use interaction:", number);
                        }
                        else if (AdvGame.GetReferences ().cursorManager)
                        {
                            // Multiple use interactions
                            List<string> labelList = new List<string>();

                            foreach (AC.Button button in hotspot.useButtons)
                            {
                                labelList.Add (hotspot.useButtons.IndexOf (button) + ": " + AdvGame.GetReferences ().cursorManager.GetLabelFromID (button.iconID, 0));
                            }

                            number = EditorGUILayout.Popup ("Use interaction:", number, labelList.ToArray ());
                        }
                        else
                        {
                            EditorGUILayout.HelpBox ("A Cursor Manager is required.", MessageType.Warning);
                        }
                    }
                    else if (interactionType == InteractionType.Inventory)
                    {
                        if (isAssetFile)
                        {
                            number = EditorGUILayout.IntField ("Inventory interaction:", number);
                        }
                        else if (AdvGame.GetReferences ().inventoryManager)
                        {
                            List<string> labelList = new List<string>();

                            foreach (AC.Button button in hotspot.invButtons)
                            {
                                labelList.Add (hotspot.invButtons.IndexOf (button) + ": " + AdvGame.GetReferences ().inventoryManager.GetLabel (button.invID));
                            }

                            number = EditorGUILayout.Popup ("Inventory interaction:", number, labelList.ToArray ());
                        }
                        else
                        {
                            EditorGUILayout.HelpBox ("An Inventory Manager is required.", MessageType.Warning);
                        }
                    }
                }
            }
            else
            {
                EditorGUILayout.HelpBox ("A Settings Manager is required for this Action.", MessageType.Warning);
            }

            AfterRunningOption ();
        }
Пример #59
0
Файл: Game.cs Проект: habb0/Bfly
 private static bool isSoccerGoal(InteractionType type)
 {
     return (type == InteractionType.footballgoalblue || type == InteractionType.footballgoalgreen || type == InteractionType.footballgoalred || type == InteractionType.footballgoalyellow);
 }
Пример #60
0
        internal void AddWire(RoomItem item, Point location, int rotation, InteractionType wireType)
        {

            WireCurrentTransfer transfer = WireCurrentTransfer.NONE;

            switch (wireType)
            {
                case InteractionType.wireCenter:
                    {
                        transfer = WireCurrentTransfer.DOWN | WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT | WireCurrentTransfer.UP;
                        break;
                    }
                case InteractionType.wireCorner:
                    {
                        switch (rotation)
                        {
                            default:
                                {
                                    transfer = WireCurrentTransfer.DOWN | WireCurrentTransfer.RIGHT;
                                    break;
                                }
                            case 2:
                                {
                                    transfer = WireCurrentTransfer.DOWN | WireCurrentTransfer.LEFT;
                                    break;
                                }
                            case 4:
                                {
                                    transfer = WireCurrentTransfer.UP | WireCurrentTransfer.LEFT;
                                    break;
                                }
                            case 6:
                                {
                                    transfer = WireCurrentTransfer.RIGHT | WireCurrentTransfer.UP;
                                    break;
                                }
                        }

                        break;
                    }
                case InteractionType.wireSplitter:
                    {
                        switch (rotation)
                        {
                            default:
                                {
                                    transfer = WireCurrentTransfer.UP | WireCurrentTransfer.DOWN | WireCurrentTransfer.RIGHT;
                                    break;
                                }
                            case 2:
                                {
                                    transfer = WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT | WireCurrentTransfer.DOWN;
                                    break;
                                }
                            case 4:
                                {
                                    transfer = WireCurrentTransfer.UP | WireCurrentTransfer.DOWN | WireCurrentTransfer.LEFT;
                                    break;
                                }
                            case 6:
                                {
                                    transfer = WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT | WireCurrentTransfer.UP;
                                    break;
                                }
                        }
                        break;
                    }

                case InteractionType.wireStandard:
                    {
                        switch (rotation)
                        {
                            default:
                            case 0:
                            case 4:
                                {
                                    transfer = WireCurrentTransfer.UP | WireCurrentTransfer.DOWN;
                                    break;
                                }
                            case 2:
                            case 6:
                                {
                                    transfer = WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT;
                                    break;
                                }
                        }
                        break;
                    }
            }

            if (transfer == WireCurrentTransfer.NONE)
                return;

			List<Point> pointsToTrigger = MarshallPoint(wireSlower.AddOrUpdateWire(location.X, location.Y, CurrentType.OFF, transfer));
            //form.AddOrUpdateWire(location.X, location.Y, CurrentType.OFF, transfer);
            HandleItems(pointsToTrigger);
        }