Beispiel #1
0
    //attraction gun
    void Shoot()
    {
        RaycastHit HitInfo;

        if (Physics.Raycast(mainCam.transform.position, mainCam.transform.forward, out HitInfo, WeaponRange))
        {
            //Debug.Log(HitInfo.transform.name);
            CompanionTarget = HitInfo.transform.GetComponent <Companion>();

            if (CompanionTarget != null)
            {
                m_AttachedObject             = true;
                m_ObjectAttached             = CompanionTarget.GetComponent <Rigidbody>();
                m_ObjectAttached.isKinematic = true;

                m_AttachingObjectStartRotation = CompanionTarget.GetComponent <Quaternion>();
            }

            turret = HitInfo.transform.GetComponent <Turret>();

            if (turret != null)
            {
                m_AttachedObject             = true;
                m_ObjectAttached             = turret.GetComponent <Rigidbody>();
                m_ObjectAttached.isKinematic = true;

                m_AttachingObjectStartRotation = turret.GetComponent <Quaternion>();
            }
        }
    }
Beispiel #2
0
    private void MovePlayer(float translation, float rotation)
    {
        if (_navMeshAgent.isOnOffMeshLink)
        {
            _navMeshAgent.CompleteOffMeshLink();
            companion.GetComponent <NavMeshAgent>().Warp(teleportLocation.position);
            MusicController.GetInstance().variation = MusicController.Variation.C_NoLowpass;
        }
        Vector3 velocityForward   = transform.forward * translation;
        Vector3 velocitySideways  = transform.right * rotation;
        Vector3 resultantVelocity = velocityForward + velocitySideways;
        Vector3 destination       = resultantVelocity + transform.position;

        if (_isHeldBack)
        {
            Vector3 destFlat           = new Vector3(destination.x, 0, destination.z).normalized;
            Vector3 companionDirection = (companion.transform.position - transform.position).normalized;
            Vector3 companionFlat      = new Vector3(companionDirection.x, 0, companionDirection.z);
            float   dot = Vector3.Dot(destFlat, companionFlat);
            if (dot < -0.5f)
            {
                return;
            }
        }

        _navMeshAgent.speed          = resultantVelocity.magnitude;
        _navMeshAgent.velocity       = resultantVelocity;
        _navMeshAgent.updateRotation = translation > 0.0f || Math.Abs(rotation) > 0.0f;
        _navMeshAgent.SetDestination(destination);
    }
Beispiel #3
0
 public void DrawConclusionsForYourself()
 {
     if (Companion.GetComponent <Trader>().Strategy == TraderStrategy.Fraud)
     {
         WasItCheated = true;
     }
 }
Beispiel #4
0
    public void SelectTheTypeOfDeal()
    {
        if (Companion.GetComponent <Trader>().Type == TraderType.altruist)
        {
            Strategy = TraderStrategy.Honest;
        }
        else
        {
            Strategy = TraderStrategy.Fraud;
        }

        MayChangeMyMind();
    }
Beispiel #5
0
 public void DrawConclusionsForYourself()
 {
     LastCompanionStrategy = Companion.GetComponent <Trader>().Strategy;
 }
Beispiel #6
0
    public void SpellCombTip(int lvlAndnumber)
    {
        CurSpellToolTipBox2.SetActive(true);

        if (spellCombTip1 == true && lvlAndnumber <= 3)
        {
            Empty1();
        }
        if (spellCombTip2 == true && (lvlAndnumber > 3 && lvlAndnumber < 30))
        {
            Empty2();
        }
        if (spellCombTip3 == true && (lvlAndnumber >= 30 && lvlAndnumber < 40))
        {
            Empty3();
        }
        if (spellCombTip4 == true && (lvlAndnumber >= 40 && lvlAndnumber < 50))
        {
            Empty4();
        }
        if (spellCombTip5 == true && (lvlAndnumber >= 50 && lvlAndnumber < 60))
        {
            Empty5();
        }
        if (spellCombTip6 == true && (lvlAndnumber >= 60 && lvlAndnumber < 70))
        {
            Empty6();
        }

        switch (lvlAndnumber)
        {
        case 1:
            curSpellname[0] = fire.spellname;
            curDamage       = fire.damagePure;
            curCooldown     = fire.cooldownSeconds;
            spellCombTip1   = true;

            if (GameManager.FindObjectOfType <GameManager>().empowerToken_)
            {
                Effect0.text = fire.effect2;
            }
            else
            {
                Effect0.text = fire.effect;
            }

            SpellImage1.sprite = fire.GetComponent <Image>().sprite;

            break;

        case 2:
            curSpellname[0]    = frost.spellname;
            curDamage          = frost.damagePure;
            curCooldown        = frost.cooldownSeconds;
            spellCombTip1      = true;
            Effect0.text       = frost.effect;
            SpellImage1.sprite = frost.GetComponent <Image>().sprite;



            if (GameManager.FindObjectOfType <GameManager>().empowerToken_2)
            {
                Effect0.text = frost.effect2;
            }
            else
            {
                Effect0.text = frost.effect;
            }

            break;

        case 3:
            curSpellname[0]    = lightning.spellname;
            curDamage          = lightning.damagePure;
            curCooldown        = lightning.cooldownSeconds;
            spellCombTip1      = true;
            Effect0.text       = lightning.effect;
            SpellImage1.sprite = lightning.GetComponent <Image>().sprite;

            if (GameManager.FindObjectOfType <GameManager>().empowerToken_3)
            {
                Effect0.text = lightning.effect2;
            }
            else
            {
                Effect0.text = lightning.effect;
            }

            break;

        case 21:
            curSpellname[1]       = "-" + meteor.spellname;
            curDamageModifierlvl2 = meteor.damagePure;
            curExtraCD            = meteor.cooldownSeconds;
            spellCombTip2         = true;
            SpellImage2.sprite    = meteor.GetComponent <Image>().sprite;
            break;

        case 22:
            curSpellname[1]       = "-" + cone.spellname;
            curExtraCD            = cone.cooldownSeconds;
            curDamageModifierlvl2 = cone.damagePure;
            spellCombTip2         = true;
            SpellImage2.sprite    = cone.GetComponent <Image>().sprite;
            break;

        case 23:
            curSpellname[1]       = "-" + ghostcast.spellname;
            curDamageModifierlvl2 = ghostcast.damagePure;
            curExtraCD            = ghostcast.cooldownSeconds;
            spellCombTip2         = true;
            SpellImage2.sprite    = ghostcast.GetComponent <Image>().sprite;
            break;

        case 31:
            curSpellname[2]       = "-" + doublecast.spellname;
            curExtraCD2           = doublecast.cooldownPercent;
            curDamageModifierlvl3 = doublecast.damagePercent;
            spellCombTip3         = true;
            SpellImage3.sprite    = doublecast.GetComponent <Image>().sprite;
            break;

        case 32:
            curSpellname[2]       = "-" + splitcast.spellname;
            curExtraCD2           = splitcast.cooldownPercent;
            curDamageModifierlvl3 = splitcast.damagePercent;
            spellCombTip3         = true;
            SpellImage3.sprite    = splitcast.GetComponent <Image>().sprite;
            break;

        case 33:
            curSpellname[2]       = "-" + companion.spellname;
            curExtraCD2           = companion.cooldownPercent;
            curDamageModifierlvl3 = companion.damagePercent;
            spellCombTip3         = true;
            SpellImage3.sprite    = companion.GetComponent <Image>().sprite;
            break;

        case 41:
            curSpellname[3]         = "-" + boost.spellname;
            curDamageModifierlvl4   = boost.damagePercent;
            curDamageModifierlvl4_2 = boost.damagePure;
            spellCombTip4           = true;
            SpellImage4.sprite      = boost.GetComponent <Image>().sprite;
            break;

        case 42:
            curSpellname[3]    = "-" + hasten.spellname;
            curExtraCD3        = hasten.cooldownPercent;
            spellCombTip4      = true;
            SpellImage4.sprite = hasten.GetComponent <Image>().sprite;
            break;

        case 43:
            curSpellname[3]    = "-" + empower.spellname;
            spellCombTip4      = true;
            SpellImage4.sprite = empower.GetComponent <Image>().sprite;
            break;

        case 51:
            curSpellname[4]    = "-" + blackhole.spellname;
            curExtraCD4        = blackhole.cooldownSeconds;
            spellCombTip5      = true;
            SpellImage5.sprite = blackhole.GetComponent <Image>().sprite;
            break;

        case 52:
            curSpellname[4]    = "-" + push.spellname;
            curExtraCD4        = push.cooldownSeconds;
            spellCombTip5      = true;
            SpellImage5.sprite = push.GetComponent <Image>().sprite;
            break;

        case 53:
            curSpellname[4]    = "-" + pool.spellname;
            curExtraCD4        = pool.cooldownSeconds;
            spellCombTip5      = true;
            SpellImage5.sprite = pool.GetComponent <Image>().sprite;
            break;

        case 61:
            curSpellname[5]    = "-" + chaosorb.spellname;
            curExtraCD5        = chaosorb.cooldownPercent;
            curExtraCD5_2      = chaosorb.cooldownSeconds;
            spellCombTip6      = true;
            SpellImage6.sprite = chaosorb.GetComponent <Image>().sprite;
            break;

        case 62:
            curSpellname[5]       = "-" + channling.spellname;
            curExtraCD5           = channling.cooldownPercent;
            curExtraCD5_2         = channling.cooldownSeconds;
            curDamageModifierlvl5 = channling.damagePercent;
            spellCombTip6         = true;
            SpellImage6.sprite    = channling.GetComponent <Image>().sprite;
            break;

        case 63:
            curSpellname[5]       = "-" + blessedaim.spellname;
            curExtraCD5           = blessedaim.cooldownPercent;
            curDamageModifierlvl5 = blessedaim.damagePercent;
            spellCombTip6         = true;
            SpellImage6.sprite    = blessedaim.GetComponent <Image>().sprite;
            break;

        default:
            break;
        }
        curTSpellname.text = curSpellname[0] + curSpellname[1] + curSpellname[2] + curSpellname[3] + curSpellname[4] + curSpellname[5];
        curTDamage.text    = "Damage: " + ((curDamage + curDamageModifierlvl2 + curDamageModifierlvl4_2) * curDamageModifierlvl3 * curDamageModifierlvl4 * curDamageModifierlvl5).ToString("F1");
        curTCooldown.text  = "Cooldown: " + ((curCooldown + curExtraCD + curExtraCD4 + curExtraCD5_2) * curExtraCD2 * curExtraCD3 * curExtraCD5).ToString("F1");
    }