Пример #1
0
    //MAIN-----------------------------------------------------------------------------------------------------------------
    void Start()
    {
        hp        = hpMax;
        orgPos    = transform.position;
        rb        = GetComponent <Rigidbody2D>();
        objPlayer = GameObject.FindGameObjectWithTag("Player");
        mySprite  = GetComponent <SpriteRenderer>();
        auraDmg   = aura.GetComponent <EnemyDMG>();

        questHandler = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerQuestHandler>();

        stealth = true;

        deathExplosion = transform.Find("DeathExplosion").GetComponent <DeathExplosion>();

        animator = GetComponent <Animator>();

        soundHandler = GetComponent <PaintSoundHandler>();

        mouthSprite = transform.Find("Mouth").GetComponent <SpriteRenderer>();

        if (stealth)
        {
            mySprite.material    = chameleonMat;
            mouthSprite.material = chameleonMat;
        }
        else
        {
            mySprite.material    = defaultMat;
            mouthSprite.material = defaultMat;
        }
    }
Пример #2
0
    public void LoadPreviousGame()
    {
        GameObject temp = Instantiate(playerPackage, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0));

        player = temp.transform.Find("player").gameObject;
        pqh    = player.GetComponent <PlayerQuestHandler>();
        psh    = player.GetComponent <PlayerSpawnHandler>();

        pqh.activeAct   = PlayerPrefs.GetInt("act");
        pqh.activeQuest = PlayerPrefs.GetString("quest");
        pqh.letters     = PlayerPrefs.GetInt("letters");
        pqh.letterSend  = PlayerPrefs.GetInt("send") == 0 ? false : true;
        psh.targetScene = PlayerPrefs.GetString("scene");
        psh.targetSpawn = PlayerPrefs.GetString("spawn");

        //load questitems
        int count = PlayerPrefs.GetInt("questItemAmount");

        for (int i = 0; i < count; i++)
        {
            pqh.questItems.Add(PlayerPrefs.GetString("questItem" + i.ToString()));
        }
        //load collected items
        int collcount = PlayerPrefs.GetInt("collectedItemAmount");

        for (int i = 0; i < collcount; i++)
        {
            pqh.collectedItems.Add(PlayerPrefs.GetString("collectedItem" + i.ToString()));
        }

        psh.Respawn();
    }
Пример #3
0
        private void CheckForQuest(int difficulty, Core.Units.NPC enemy, int healingdone, double percent, List <Core.EnumCharClass> usedclass, bool battleWasWon)
        {
            if (player.CurrentQuest != null)
            {
                player.CurrentQuest.UpdateQuest(player, difficulty, enemy, healingdone, enemy.BuffedHP.IntValue, percent, usedclass, battleWasWon);

                if (player.CurrentQuest.questcompleted == true)
                {
                    PlayerQuestHandler.BeginNewQuest(player);
                }
            }
            else
            {
                Function.PlayerQuestHandler.BeginNewQuest(player);
            }
        }
Пример #4
0
 private void Start()
 {
     pqh = GetComponent <PlayerQuestHandler>();
     psh = GetComponent <PlayerSpawnHandler>();
     Reposition();
     //if there is another player in the scen destroy it
     GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
     foreach (GameObject p in players)
     {
         if (p != gameObject)
         {
             //Destroy(gameObject);
             //Camera.main.GetComponent<CameraMovement>().player = p;
         }
     }
     ps = GetComponent <PlayerStats>();
 }
Пример #5
0
    public void LoadGameAct(int act)
    {
        string[] scenes = new string[] { "DanceArea", "PaintingArea", "MusicArea", "PoetryArea", "FinalArea" };
        string[] doors  = new string[] { "MainHallDance", "MainHallDoorPainting", "MainHallDoorMusic", "MainHallDoorPoetry", "MainhallDoorFinal" };

        GameObject temp = Instantiate(playerPackage, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0));

        player = temp.transform.Find("player").gameObject;
        pqh    = player.GetComponent <PlayerQuestHandler>();
        psh    = player.GetComponent <PlayerSpawnHandler>();

        pqh.activeAct   = act - 1;
        pqh.activeQuest = act == 5 ? "mastered" : "running";
        pqh.letters     = act - 1;
        pqh.letterSend  = act == 5 ? true : false;
        psh.targetScene = scenes[act - 1];
        psh.targetSpawn = doors[act - 1];

        psh.Respawn();
    }
Пример #6
0
    //MAIN-----------------------------------------------------------------------------------------------------------------
    void Start()
    {
        stealth  = isStealth;
        orgPos   = transform.position;
        rb       = GetComponent <Rigidbody2D>();
        mySprite = GetComponent <SpriteRenderer>();
        auraDmg  = aura.GetComponent <EnemyDMG>();

        questHandler = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerQuestHandler>();

        animator = GetComponent <Animator>();

        soundHandler = GetComponent <DanceSoundHandler>();
        audioSource  = GetComponent <AudioSource>();

        if (stealth)
        {
            mySprite.material = chameleonMat;
        }
        else
        {
            mySprite.material = defaultMat;
        }
    }
Пример #7
0
 public override void EndQuest(Player _player)
 {
     this.currentValue = 0;
     PlayerQuestHandler.GiveVeryHardQuestReward(_player, PlayerQuestHandler.ChooseQuestRewardType());
     this.questcompleted = true;
 }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     pq     = player.GetComponent <PlayerQuestHandler>();
 }
Пример #9
0
 private void Start()
 {
     pc  = GetComponent <PlayerController>();
     ps  = GetComponent <PlayerStats>();
     pqh = GetComponent <PlayerQuestHandler>();
 }