Example #1
0
    // Update is called once per frame
    void Update()
    {
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, Mathf.Infinity))
        {
            Inspectable t = hit.transform.gameObject.GetComponent <Inspectable>();
            if (t != null)
            {
                output.SetText(t.getData());
                selected = t;
            }
        }

        if (Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(0))
        {
            selected = null;
        }

        if (selected == null)
        {
            output.SetText("");
        }
    }
Example #2
0
    public void Inspect(Sprite sprite, Inspectable inspectable)
    {
        isInspecting = true;
        inspectableImage.GetComponent <UiScaler>().UpdateScale();
        inspectableImage.GetComponent <Image>().color  = Color.white;
        inspectableImage.GetComponent <Image>().sprite = inspectable.sprite;

        for (int i = 0; i < 5; i++)
        {
            if (inspectable.pieces[i])
            {
                poster.pieces[i] = inspectable.pieces[i];
            }
        }
        if (!inspectable.isPoster)
        {
            poster.UpdatePoster();
        }

        if (inspectable.id != -1)
        {
            pagePieces[inspectable.id] = true;
        }

        currentInspectable = inspectable;
        player.canMove     = false;
        FadeOut(0.5f, 0.5f, 0);
    }
Example #3
0
    public void AddNewSearch(Inspectable insp, Vector3 v3, bool forinspectable)
    {
        Find.Invoke();

        Search new_search = new Search();

        if (forinspectable)
        {
            new_search.priority    = insp.level_priority;
            new_search.inspectable = insp;
            new_search.isvector    = false;
            new_search.pos         = insp.posToInspect.position;
            new_search.rig         = insp.GetComponentInChildren <RigInspectable>();
        }
        else
        {
            new_search.priority    = 1;
            new_search.inspectable = null;
            new_search.isvector    = true;
            new_search.pos         = v3;
            new_search.rig         = null;
        }
        if (IsRepeated(new_search))
        {
            return;
        }
        searchs.Add(new_search);
        StartCheck();
    }
Example #4
0
    private void DisplayInfo(GameObject go)
    {
        Inspectable inspectable = go.GetComponent <Inspectable>();

        if (inspectable != null)
        {
            StartDisplay(inspectable.description);
        }
    }
    private void PauseGame(GameObject go)
    {
        Inspectable inspectable = go.GetComponent <Inspectable>();

        if (inspectable != null)
        {
            Time.timeScale = 0;
        }
    }
Example #6
0
    public void GenerateSoundWave(Inspectable insp, float radius, ZoneBase room)
    {
        //Debug.Log("Insp", insp);
        //Debug.Log("Roombase", room);

        ////var enems = room.FindInvestigatorsInRadius(insp.posToInspect.position, radius);

        //Debug.Log(enems.Count);

        //enems[Random.Range(0, enems.Count)].OnSoundListen(insp);
    }
    void OnTriggerStay2D(Collider2D collider)
    {
        Inspectable inspect = collider.GetComponent <Inspectable>();

        if (Input.GetKeyDown(inspectKey))
        {
            if (inspect != null)
            {
                inspect.Inspect();
            }
        }
        else if (Input.GetKeyDown(storeKey) && collider.tag == "Store")
        {
            storeMenu.SetActive(true);
        }
    }
Example #8
0
    private void SeedContainerGroupWithWeapons(string groupName)
    {
        int weaponIndex = Random.Range(0, 4);

        for (int i = 0; i < 4; i++)
        {
            Inspectable container = GameObject.Find(groupName + " " + (i + 1)).GetComponent <Inspectable>();
            if (i == weaponIndex)
            {
                container.contents = CriticalContents;
            }
            else
            {
                container.contents = unimportantContents[Random.Range(0, unimportantContents.Length)];
            }
        }
    }
Example #9
0
    private void inspectMode()
    {
        if (Input.GetMouseButton(0))
        {
            onMouseDrag();
        }

        if (Input.GetAxis("Mouse ScrollWheel") > 0f)
        {
            MasterScript.CAM1.GetComponent <Camera>().fieldOfView -= zoomSpeed * Time.deltaTime;
        }
        else if ((Input.GetAxis("Mouse ScrollWheel") < 0f))
        {
            MasterScript.CAM1.GetComponent <Camera>().fieldOfView += zoomSpeed * Time.deltaTime;
        }



        if (CastRay.Shoot(this.GetComponent <Camera>(), inspectLayer, shootRange))
        {
            if (CastRay.detected.GetComponent <Inspectable>() != null)
            {
                MasterScript.EnableCrosshairAll();
                Inspectable inspectableScript = CastRay.detected.GetComponent <Inspectable>();
                MasterScript.toast(inspectableScript.text);

                if (Input.GetKeyDown(KeyCode.E))
                {
                    Inspectable.useInspectable();
                }
            }
            else
            {
                MasterScript.inactive();
            }
        }    // shoot close

        else //if nothing is hit
        {
            MasterScript.inactive();
        }
    }
Example #10
0
    private void OnShipDestroyed(string name)
    {
        Inspectable inspectableShip = GameObject.Find(name).GetComponent <Inspectable>();

        if (inspectableShip != null)
        {
            string containerContents = inspectableShip.GetComponent <Inspectable>().contents;
            if (CriticalContents == containerContents)
            {
                playerMissionEnd.FailMission("You destroyed a container with weapons");
            }
            else
            {
                if (--containersToDestroy == 0)
                {
                    playerMissionEnd.WinMission();
                }
            }
        }
    }
Example #11
0
 // Use this for initialization
 void Start()
 {
     clone = GameObject.Find(gameObject.name + " (clone)").GetComponent <Inspectable> ();
 }
Example #12
0
        static DungeonMockData()
        {
            int    dungeonId          = 1;
            string dungeonDescription =
                "Dies ist ein vordefiniertes Mock-Dungeon, welches die Benutzung eines Dungeons näher beleuten soll.";
            string       dungeonEpoch    = "Mittelalter";
            IRace        Orks            = new RaceSkeleton("Ork", "Orks sind schlimme Wesen.", 50, 20, 10);
            IRace        Elfen           = new RaceSkeleton("Elf", "Elfen sind tolle Wesen.", 40, 10, 30);
            List <IRace> configuredRaces = new List <IRace> {
                Orks, Elfen
            };
            IClass        Berserker         = new ClassSkeleton("Berserker", "Bererker sind stake Krieger.", 50, 30, 10);
            IClass        Magier            = new ClassSkeleton("Magier", "Magier haben ein langes Durchhaltevermögen.", 60, 10, 40);
            List <IClass> configuredClasses = new List <IClass> {
                Berserker, Magier
            };
            IInspectable        Baum    = new Inspectable("Baum", "Dies ist ein großer Baum");
            IInspectable        Busch   = new Inspectable("Busch", "In dem Busch raschelt es.");
            Consumable          Flasche = new Consumable("Flasche", "Diese Flasche ist voller Alkohol.", "Du freust dich über den Erfolg des Prototyps von Team Apollon!", 1);
            Takeable            Stab    = new Takeable("Stab", "Dies ist ein sonderbarer Stab.", 1);
            List <IInspectable> configuredInspectables = new List <IInspectable> {
                Baum, Busch, Flasche, Stab
            };
            IRoom Room1 = new RoomSkeleton(0, "Dies ist der erste Raum des Dungeons.")
            {
                Inspectables = new List <IInspectable> {
                    Busch, Baum
                },
                DirectionsToNeigbors = new List <Interfaces.Direction.EDirections> {
                    EDirections.NORDEN
                }
            };
            IRoom Room2 = new RoomSkeleton(1, "Dies ist der zweite Raum des Dungeons.")
            {
                Inspectables = new List <IInspectable> {
                    Baum, Flasche
                },
                DirectionsToNeigbors = new List <Interfaces.Direction.EDirections>
                {
                    EDirections.NORDEN, EDirections.SÜDEN, EDirections.OSTEN, EDirections.WESTEN
                }
            };
            IRoom Room3 = new RoomSkeleton(2, "Dies ist der dritte Raum des Dungeons.")
            {
                Inspectables = new List <IInspectable> {
                    Baum, Stab
                },
                DirectionsToNeigbors = new List <Interfaces.Direction.EDirections> {
                    EDirections.SÜDEN
                }
            };
            IRoom Room4 = new RoomSkeleton(3, "Dies ist der vierte Raum des Dungeons.")
            {
                Inspectables = new List <IInspectable> {
                    Baum, Flasche
                },
                DirectionsToNeigbors = new List <Interfaces.Direction.EDirections> {
                    EDirections.WESTEN
                }
            };
            IRoom Room5 = new RoomSkeleton(4, "Dies ist der fünfte Raum des Dungeons.")
            {
                Inspectables = new List <IInspectable> {
                    Baum, Stab, Flasche
                },
                DirectionsToNeigbors = new List <Interfaces.Direction.EDirections> {
                    EDirections.OSTEN
                }
            };
            List <IRoom> rooms = new List <IRoom> {
                Room1, Room2, Room3, Room4, Room5
            };
            Neighborship         Neighborship1 = new Neighborship(0, EDirections.NORDEN, 1);
            Neighborship         Neighborship2 = new Neighborship(1, EDirections.NORDEN, 2);
            Neighborship         Neighborship3 = new Neighborship(1, EDirections.OSTEN, 3);
            Neighborship         Neighborship4 = new Neighborship(1, EDirections.WESTEN, 4);
            List <INeighborship> neighborships = new List <INeighborship>
            {
                Neighborship1, Neighborship2, Neighborship3, Neighborship4
            };
            int defaultRoomId = 0;

            Dungeon = new DungeonSkeleton(dungeonEpoch)
            {
                DungeonId              = dungeonId,
                DungeonDescription     = dungeonDescription,
                ConfiguredRaces        = configuredRaces,
                ConfiguredClasses      = configuredClasses,
                ConfiguredInspectables = configuredInspectables,
                Neighborships          = neighborships,
                Rooms         = rooms,
                DefaultRoomId = defaultRoomId
            };
        }
Example #13
0
 //EXTERNOS
 public void OnSoundListen(Inspectable insp) => AddNewSearch(insp, Vector3.zero, true);