Exemplo n.º 1
0
 void Start()
 {
     InventoryList = new List <Item>();
     basemovespeed = MoveSpeed;
     Application.targetFrameRate = 60;
     guib     = GetComponent <GameUIBehavior>();
     selfanim = GetComponent <Animator>();
     looks    = GetComponent <SpriteRenderer>();
     Spawner  = GameObject.Find("GameManager");
     itemList = Spawner.GetComponent <ItemScript>();
     itemList.Initialize();
     src            = GetComponent <AudioSource>();
     cameramain     = GameObject.FindGameObjectWithTag("MainCamera");
     camAnim        = cameramain.GetComponent <Animator>();
     rb             = GetComponent <Rigidbody2D>();
     primary        = itemList.Weapons[1];
     secondary      = null;
     EquippedWeapon = primary;
     activeusable   = null;
     legsanimator   = legs.GetComponent <Animator>();
     if (activeusable != null)
     {
         currentTimeActiveitem = activeusable.regentime;
     }
     srctwo       = Spawner.GetComponent <AudioSource>();
     visitedRooms = new List <GameObject>();
 }
Exemplo n.º 2
0
    public void LateUpdate()
    {
        if (DoorsToRoom != null)
        {
            if ((DoorsToRoom.transform.position - player.transform.position).magnitude < 13f && PlayerHasCard == false && wasdialogueon == false && player.GetComponent <MoveScript>().roomison == false)
            {
                foreach (Transform child in DoorsToRoom.transform)
                {
                    if ((child.transform.position - player.transform.position).magnitude < 3f)
                    {
                        gui = player.GetComponent <GameUIBehavior>();
                        gui.movescript.dialogueon = true;
                        this.gameObject.transform.GetChild(0).gameObject.GetComponent <Dialogue>().StartDialogue();
                        wasdialogueon = true;
                        //CAN AS WELL CHANGE THE GRAPHICS TO THE DOOR:
                        GameObject.Find("ShopKeeper").SetActive(false);
                    }
                }
            }
            if ((DoorsToRoom.transform.position - player.transform.position).magnitude < 13f && PlayerHasCard == true && player.GetComponent <MoveScript>().roomison == false && WereDoorsOpen == false)
            {
                if ((DoorsToRoom.transform.position - player.transform.position).magnitude < 13f)
                {
                    FloatText.SetActive(true);
                    FloatText.transform.position             = player.transform.position;
                    FloatText.GetComponent <TextMesh>().text = "Press E to Open the doors";
                    if (Input.GetButtonDown("Interact"))
                    {
                        DoorsToRoom.SetActive(false);
                        PlayerHasCard = true;
                        isCard        = true;
                        WereDoorsOpen = true;
                        FloatText.SetActive(false);
                    }
                }
                else
                {
                    FloatText.SetActive(false);
                }
            }

            else
            {
                FloatText.SetActive(false);
            }
        }
    }
Exemplo n.º 3
0
 public virtual void OnBuy()
 {
     Player     = GameObject.Find("Player");
     movescript = Player.GetComponent <MoveScript>();
     if (movescript.hasDiscount)
     {
         movescript.money -= Mathf.CeilToInt(this.BuyValue / 2);
     }
     else
     {
         movescript.money -= Mathf.CeilToInt(this.BuyValue);
     }
     guib = Player.GetComponent <GameUIBehavior>();
     movescript.srctwo.PlayOneShot(Resources.Load <AudioClip>("Sounds/kachingshop"));
     if (movescript.secondary != null)
     {
         if (movescript.secondary.Type != "Weapon")
         {
             movescript.secondary = null;
         }
     }
 }
Exemplo n.º 4
0
 void Update()
 {
     if ((this.gameObject.transform.position - player.transform.position).magnitude <= 5 && !thisdialogueplayed && wasdialogueon && !movescript.dialogueon)
     {
         wasdialogueon = doors.GetComponent <BossRoomBehavior>().wasdialogueon;
         if (player.GetComponent <MoveScript>().roomison != true)
         {
             gui = player.GetComponent <GameUIBehavior>();
             gui.movescript.dialogueon = true;
             doors.gameObject.transform.GetChild(1).gameObject.GetComponent <Dialogue>().StartDialogue();
             thisdialogueplayed = true;
             GameObject.Find("ShopKeeper").SetActive(false);
         }
     }
     else if ((this.gameObject.transform.position - player.transform.position).magnitude <= 5 && !thisdialogueplayed && !wasdialogueon && !movescript.dialogueon)
     {
         wasdialogueon = doors.GetComponent <BossRoomBehavior>().wasdialogueon;
         if (player.GetComponent <MoveScript>().roomison != true)
         {
             gui = player.GetComponent <GameUIBehavior>();
             gui.movescript.dialogueon = true;
             doors.gameObject.transform.GetChild(2).gameObject.GetComponent <Dialogue>().StartDialogue();
             thisdialogueplayed = true;
             GameObject.Find("ShopKeeper").SetActive(false);
         }
     }
     else if (((this.gameObject.transform.position - player.transform.position).magnitude <= 15) || arrow.GetComponent <ArrowLookScript>().PlayerHasNav == true)
     {
         arrow.SetActive(true);
         arrow.GetComponent <ArrowLookScript>().target = this.gameObject;
     }
     else
     {
         arrow.SetActive(false);
     }
 }
Exemplo n.º 5
0
 void ShowDie()
 {
     Uimanage = GetComponent <GameUIBehavior>();
     Uimanage.ShowDie();
     Time.timeScale = 0;
 }
Exemplo n.º 6
0
 void ShowDie()
 {
     Uimanage = GetComponent <GameUIBehavior>();
     Uimanage.ShowDie();
 }