Exemple #1
0
    private void Start()
    {
        gunScript         = FindObjectOfType <AMS_GunManagement>();
        MaxCoolDown       = gunScript.defaultAlternativeMaxFireRate;
        AlternateFireFill = GameObject.Find("AlternateFireFill");
        AlternateFireFill.SetActive(false);

        //CoolDownRemaining = MaxCoolDown;
    }
    //public int Gun1BulletContactDamage;
    //public int Gun2BulletContactDamage;
    // public int TempBulletContactDamage;
//  public GameObject TempbulletObject;


    // Start is called before the first frame update
    void Start()
    {
        ams_GunManagement = GameObject.Find("MainPlayer").GetComponent <AMS_GunManagement>();
        // Gun1Bullet = ams_GunManagement.gun1Bullet;
        // Gun2Bullet = ams_GunManagement.gun2Bullet;
        currentBullet              = ams_GunManagement.currentBullet;
        currentBulletScript        = currentBullet.GetComponent <AMS_Bullet>();
        currentBulletContactDamage = currentBulletScript.contactDamage;
        // ams_Bullet1Script = Gun1Bullet.GetComponent<AMS_Bullet>();
        // Gun1BulletContactDamage = ams_Bullet1Script.contactDamage;
    }
 // Start is called before the first frame update
 void Start()
 {
     resourceControls = GameObject.FindObjectOfType <AMS_ResourceController>();
     if (resourceControls == null)
     {
         Debug.Log("can't find AMS_ResourceController");
     }
     buyMenuPlayer = GameObject.FindObjectOfType <AMS_BuyMenuPlayer>();
     playerGun     = GameObject.FindObjectOfType <AMS_GunManagement>();
     BuyMenuDescriptionText.enabled = false; //disable buy menu description
     AbilitiesToDisableOnStart();
 }
Exemple #4
0
    // Start is called before the first frame update
    void Start()
    {
        //    gunManagement = GameObject.Find("MainPlayer").GetComponent<AMS_GunManagement>();
        var timer = gameObject.AddComponent <DespawnTimer>();

        timer.timerStart = despawnLength;

        gun = FindObjectOfType <AMS_GunManagement>();
        if (gun == null)
        {
            Debug.Log("no gun found for player");
        }
    }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        var tempPlayerVar = GameObject.FindObjectOfType <KE_MainPlayer_Script>();

        if (tempPlayerVar != null)
        {
            gunScript = tempPlayerVar.gameObject.GetComponent <AMS_GunManagement>();
            if (gunScript == null)
            {
                Debug.Log("can't find gun on player");
            }
        }
        else
        {
            Debug.Log("can't find player script");
        }

        graphic = GetComponent <Image>();
        if (graphic == null)
        {
            Debug.Log("no graphic found on this object");
        }
        selfT = GetComponent <RectTransform>();
        if (selfT == null)
        {
            Debug.Log("no rect transform found on this object");
        }

        fullWidth  = (selfT.rect.width * canvas.scaleFactor);
        fullHeight = (selfT.rect.height * canvas.scaleFactor);

        if (marker != null)
        {
            var newHeight = fullHeight / 2 * barHeight;
            var newWidth  = fullWidth / 2 * barWidth;

            marker.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, newHeight);
            marker.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, newWidth);
            marker.SetPositionAndRotation(new Vector3(selfT.position.x, selfT.position.y, selfT.position.z), goal.rotation);
        }//this sets up the scrolling marker
        else
        {
            Debug.Log("No marker found");
        }

        ToggleView(false, false);
    }
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            playerAmmo = other.gameObject.GetComponent <AMS_GunManagement>();
            if (playerAmmo.currentClips == playerAmmo.maxClips)
            {
                AmmoText.text = "Your ammo clips are full";
                collectable   = false;
            }
            else
            {
                AmmoText.text = "Press E to grab Ammo";
                collectable   = true;
            }

            note.SetActive(true);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine(AnimateText());
        //Put all text in this string to make a new text just put , between the "".
        displayText = new string[] {
            //0
            "Listen up you lawn dart, my name is General Gnome, in order for you to stand any chance out in the garden you better listen to my instruction. First, put those legs to use by using the WASD keys.",
            //1
            "Now that you have proven you have a brain in that cone head of yours, I am trusting you with every gnome’s best friend an AK47. Now point that gun at that duck and press the left mouse button to hear him make his last quack.",
            //2
            "Now give in to your instincts and find one of those delectable mushrooms.",
            //3
            "This is going to go against every one of your instincts but don’t eat that mushroom instead drag it behind you with the E button.",
            //4
            "Okay now run back to your shack with the Shift key. This will transport the mushroom directly to me, and in return, I will assist you. Remember while dragging objects you won’t be able to fire your gun. Note to self-figure... out how to fire a gun without using your hands.",
            //5
            "That mushroom was on the small side, so it is only worth let’s say 50 resources. Now open the buy menu with B. Then use 10 of those resources to purchase access to ammo boxes. That means click Unlock: 10. Now click the Use button that appeared.",
            //6
            "Now just left click wherever you want me to deploy that ammo box.",
            //7
            "Since it takes forever for that ammo box to land let's go over reloading. I can’t believe I have to explain this, but you reload by pressing R. Okay, I guess this is a little interesting press R while the reload is halfway through and it will be completed instantly. How that works, I have no idea.",
            //8
            "Now that that ammo box has finally shown up it's time to collect. Walk over and press E to get your used clips back. If you take your sweet gnome time, I am going to take the box away so don’t test my patients.",
            //New 9
            "Now take back part of the garden by opening the fence to the north. You do this by walking up to it and pressing the E button. This will cost you some resources, but it will push the garden animals out of your territory.",
            //10
            "You dumb lawn dart, you didn’t have enough resources to open that fence. I just gave you a bonus, notice how the fence is now green that means you have enough. Well what are you waiting for open it up already, you dumb mushroom loving simpleton.",
            //11
            "With the leftover resources from your bonus it's time to nuke these bird-brained foes. Open up the buy menu with B and click unlock 40. Once that is done proceed to click use.",
            //12
            "Now for my favorite part of the lesson, drop the nuke on those bad eggs and see them wish they never hatched. Stand back from the explosion we have lost a lot of dumb recruits to our own bombs and I hate filling out the paperwork.",
            //13
            "YES!!! No extra paperwork tonight. …. Ohh yea, proceed to the next area.",
            //14
            "Now that you have proven that you won’t immediately kill yourself with explosives, you now have access to the grenade launcher attachment on your gun. Fire a round at that dumb duck by pressing either space or the middle mouse button.",
            //15
            "Let’s get the Gnominator, aka the pump action shotgun. First open the buy menu with with B. Then click unlock:40. Finally choose the shotgun. In the field you will have three options hopefully this does not overload your little gnome brain.",
            //16
            "Now that you have a secondary weapon, switch to it using the scroll wheel and behold the double barrel glory.",
            //17
            "Show that bird brained fool you mean business. ….. Come on already shoot him already.",
            //18
            "While you destroyed that duck I replaced your default gun with the ricochet rifle switch to it now by using the scroll wheel.",
            //19
            "Okay with this weapon its projectiles bounce off walls. Use this to take out that cowering duck behind the garden wall. This weapon requires both skill and intelligence something you obviously lack but there is always dumb luck.",
            //20
            "Like I said dumb luck. Now switch weapons with the scroll wheel you will notice you left yourself open again and I replaced your shotgun with the rail gun. ",
            //21
            "Now that all the ducks are in a row watch them topple with the might of the unstoppable rail gun.",
            //22
            "If out in the garden you find yourself running low on the ammo for these powerful weapons you can call in the specific ammo through the buy menu. Let's go through this for the thousandth time press B then click unlock: 30 finally press use. ",
            //23
            "Hurry up and call it in already so we can just move on already. Come on just left click where you want the ammo.",
            //24
            "Since we are in a rush go pickup that mini mushroom you will notice enemies dropping them when they are killed they give you resources like the large mushrooms but you don’t have to be brought back to the shack.",
            //25
            "Go collect some ammo from that drop you just called in. This type of ammo will only work with the unlocked weapon remember this when you are out in the garden. ",
            //26
            "Now that you understand the how to unlock and use abilities found in the buy menu lets go over how to upgrade them. First click B to open the buy menu then click upgrade: 50 under drop bomb. This will make for a bigger boom when deployed.",
            //27
            "You can also upgrade yourself your puny self with this method under the passive upgrades section of the buy menu. Click upgrade 20 under max health. These passive upgrades can go to level 4 while abilities can only go to level 3.",
            //28
            "Since I am tired of saying press B to open the buy menu lets close it by either clicking X or pressing escape. Then press 3 to use the bomb ability. You can see what abilities you have access to and what abilities are off cooldown by looking at the ability bar at the bottom of your screen.",
            //New 29
            "As much as I like explosions there is nothing to drop this bomb on so let's cancel the ability by pressing right click. This will restore the cooldown. … If for whatever reason you can’t hold back your drive to see explosions and deployed the bomb you can always cancel another ability to continue.",
            //30
            "Now if you are either brave and stupid or have any care for my sanity exit this tutorial by going down the right corridor. I am required by the gnomes on high that you can also continue this tutorial by going up the north path.",
            //31
            "While you may be a heartless monster at least you have some self preservation instincts. Now throw those instincts out the window and run past that turret that is armed with live rounds.",
            //32
            "Now go make friends with that emotionless death machine. You can do this by going up to it and dragging it with the E key.",
            //33
            "WHAT how in the gnome village did that work and even ignoring that basic piece of logic, how did that turret not turn you into lawn mulch. Ahh whatever just go bring that turret over to the turret buffer in the next area. The enemy developed these buffers to make there turrets more accurate but I guess your new friend could get some use out of it.",
            //New 34
            "So not only will the turret not kill you now that you made friends with it but apparently it will shoot things for you.",
            //35
            "What if you place the turret down with E. I wonder will it go back to killing you or will it remain your one and only friend.",
            //36
            "So apparently it remains friendly, too badddd.",
            //37
            "Well that failed so let's move onto dealing with volatile explosives it should be much safer. Also that turret is starting to creep me out since I can’t imagine anything wanting to be friends with such a useless gnome.",
            //38
            "While I deeply hope an explosive barrel will be the death of you one day, for now shoot that barrel the ducks are surrounding. Out in the garden there are alot of these barrels laying around so get used to shooting them.",
            //39
            "Ahhhhh that hit the spot. Okay now go drag that barrel behind you again use E. I promise it won’t explode on contact. While it would be nice, having put so much effort into your training, at this point you dying here would probably be worse. Only probably…. don’t get your hopes up.",
            //40
            "Okay now drag that barrel into the ducks path and place it down with E. Then back away and shoot it when the duck is close.",
            //41
            "Ohh nooo this is bad, it seems the ducks are mounting an attack on my shack. Go through that teleporter it will take you right outside my shack.",
            //42
            "In the future the ducks will attack your shack but for now you will need to defend  mine. While I try to remember the door passcode be on the lookout for enemies on the minimap located at the bottom right corner of your screen. Enemies look like red E’s if close and red exclamation marks if they are far away.",
            //New 43
            "Finally got it okay go take care of that duck before he does any more damage. If you even think about letting ducks destroy my shack I will fail you. Probably for the best since a shackless gnome is a dead gnome.",
            //44
            "Ohh thank gnome my shack is still in one piece. This is bad it looks like another wave of ducks is coming. At the top of your screen you can see the countdown till they get here and when they arrive it shows how long they will stay. I have given you a massive amount of resource and full access to the buy menu as thanks and so my shack doesn't get destroyed in the next minute.",
            //45
            "Here they are for both your sake and mine I hope you manage to hold these fowl creatures off.",
            //46
            "Thanks I greatly appreciate it. However it looks like those ducks are not going to stop anytime soon. Please I am begging you stay here and keep defending my base. Don’t even think about going through that graduation portal and leaving me here alone….. Please?"
        };
        myAudioSource = GetComponent <AudioSource>();
        arrow         = FindObjectOfType <AMS_TutorialPointer>();
        player        = GameObject.FindGameObjectWithTag("Player");
        playerGun     = player.GetComponent <AMS_GunManagement>();
        buyPlayer     = player.GetComponent <AMS_BuyMenuPlayer>();
        //Start of level disable players gun
        player.GetComponent <AMS_GunManagement>().alternativeFireEnabled = false;
        player.GetComponent <AMS_GunManagement>().laser.SetActive(false);
        //Disable all of the buy menu options
        for (int i = 0; i < buyMenuOptions.Length; i++)
        {
            buyMenuOptions[i].SetActive(false);
        }
        for (int i = 0; i < tutorialTargets.Length; i++)
        {
            tutorialTargets[i].SetActive(false);
        }
        for (int i = 1; i < textUpdaters.Length; i++)
        {
            textUpdaters[i].SetActive(false);
        }
        foreach (GameObject passiveUpgrade in passiveUpgrades)
        {
            passiveUpgrade.SetActive(false);
        }
        myAudioSource.clip = audioTracks[0];
        myAudioSource.Play();

        //Disable buy menu
        player.GetComponent <AMS_BuyMenuPlayer>().enabled = false;
    }