Exemplo n.º 1
0
    void OnTriggerStay2D(Collider2D col2D)
    {
        if (col2D.gameObject.CompareTag("Enemy") || col2D.gameObject.CompareTag("FlyingEnemy") || col2D.gameObject.CompareTag("Boss"))
        {
            if (playerAttack.eq_Name == "Flamethrower")
            {
                equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
            }
            else if (playerAttack.eq_Name_2 == "Flamethrower")
            {
                equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
            }

            EnemyHealth enemyHP_Script = col2D.GetComponent <EnemyHealth>();

            if (equipmentAugment != null)
            {
                if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Burn)
                {
                    if (enemyHP_Script != null && enemyHP_Script.currStatusCondition != EnemyHealth.StatusCondition.Burn)
                    {
                        enemyHP_Script.TakeDamage(0, EnemyHealth.StatusCondition.Burn);
                    }
                }
                else if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Freeze)
                {
                    if (enemyHP_Script != null && enemyHP_Script.currStatusCondition != EnemyHealth.StatusCondition.Freeze)
                    {
                        enemyHP_Script.TakeDamage(0, EnemyHealth.StatusCondition.Freeze);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
 public void EquipAugment(Augment augment, int slot)
 {
     Debug.Log($"Equipped augment: {augment.name}, in slot: {slot}");
     CloseAllMenus();
     playerState.EquipAugment(augment, slot);
     UpdateAugmentIcons();
 }
        public void GarbageCollectionCleansUp()
        {
            // arrange
            CanSetAndGet();

            // internals have been made visible to us
            foreach (var x in Augment.Instances.Keys)
            {
                Assert.IsTrue(x.Owner.IsAlive);
                break;
            }

            // act
            GC.Collect();
            // when this runs is non-deterministic, so just run it for testing
            Augment.Compact();

            // assert
            foreach (var(key, value) in Augment.Instances)
            {
                Assert.IsFalse(key.Owner.IsAlive);
                Assert.IsNull(value);
                break;
            }
        }
Exemplo n.º 4
0
 public Currency(Blacksmith_whetstone blacksmith_whetstone, Armourer_scrap armourer_scrap, Glassblower_bauble glassblower_bauble, Gemcutter_prism gemcutter_prism, Cartographer_chisel cartographer_chisel, Transmutation transmutation, Alteration alteration, Annulment annulment, Chance chance, Augment augment, Exalted exalted, Mirror mirror, Regal regal, Alchemy alchemy, Chaos chaos, Blessed blessed, Divine divine, Jeweller jeweller, Fusing fusing, Chromatic chromatic, Scouring scouring, Regret regret, Vaal vaal, Silver_coin silver_coin, Perandus_coin perandus_coin, Apprentice_sextant apprentice_sextant, Journeyman_sextant journeyman_sextant, Master_sextant master_sextant)
 {
     this.blacksmith_whetstone = blacksmith_whetstone;
     this.armourer_scrap       = armourer_scrap;
     this.glassblower_bauble   = glassblower_bauble;
     this.gemcutter_prism      = gemcutter_prism;
     this.cartographer_chisel  = cartographer_chisel;
     this.transmutation        = transmutation;
     this.alteration           = alteration;
     this.annulment            = annulment;
     this.chance             = chance;
     this.augment            = augment;
     this.exalted            = exalted;
     this.mirror             = mirror;
     this.regal              = regal;
     this.alchemy            = alchemy;
     this.chaos              = chaos;
     this.blessed            = blessed;
     this.divine             = divine;
     this.jeweller           = jeweller;
     this.fusing             = fusing;
     this.chromatic          = chromatic;
     this.scouring           = scouring;
     this.regret             = regret;
     this.vaal               = vaal;
     this.silver_coin        = silver_coin;
     this.perandus_coin      = perandus_coin;
     this.apprentice_sextant = apprentice_sextant;
     this.journeyman_sextant = journeyman_sextant;
     this.master_sextant     = master_sextant;
 }
Exemplo n.º 5
0
    /// <summary>
    /// Setup npc for adding
    /// </summary>
    public virtual Augment[] NPC_Setup()
    {
        //creates a temp array too be loaded into the NPC
        Augment[] tempLoadOut = new Augment[System.Enum.GetNames(typeof(Aug_Placement)).Length - 1];


        for (int i = 0; i < tempLoadOut.Length; i++)
        {//find the augments of a specific type
            int  startLoca = 0, endLoca = 0;
            bool set = false;
            {
                for (int j = 0; j < Game_Manager.legalAugmentations.Count; j++)
                {
                    if ((int)Game_Manager.legalAugmentations[j].GS_placement == i && set == false)
                    {
                        startLoca = j;
                        set       = true;
                    }
                    if ((int)Game_Manager.legalAugmentations[j].GS_placement - 1 == i && set == true)
                    {
                        endLoca = j;
                        break;
                    }
                }
                int RngAug = Random.Range(startLoca, endLoca);
                tempLoadOut[i] = Game_Manager.legalAugmentations[RngAug];
            }
        }
        return(tempLoadOut);
    }
Exemplo n.º 6
0
    public override void Use()
    {
        Equipment tempMainEquipment = EquipmentManager.instance.MainEquipment();

        if (tempMainEquipment != null)
        {
            if (tempMainEquipment.augment == null)
            {
                tempMainEquipment.augment = this;

                //Remove from inventory
                RemoveFromInventory();
            }
            else
            {
                Augment tempAugment = tempMainEquipment.augment;
                tempMainEquipment.augment = this;

                // Swap in Inventory
                Inventory.instance.Add(tempAugment);
                RemoveFromInventory();
            }

            // Event call (Callback function)
            EquipmentManagerUI.instance.UpdateEquipmentUI(null, null);
        }
    }
Exemplo n.º 7
0
    // Start is called before the first frame update
    void Start()
    {
        if (rb == null)
        {
            rb = gameObject.GetComponent <Rigidbody2D>();
        }

        rb.velocity = transform.up *= speed;

        if (lifeTime >= 0)
        {
            Destroy(gameObject, lifeTime);
        }

        if (playerAttack == null)
        {
            playerAttack = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttack>();
        }

        if (playerAttack.eq_Name == "Bow")
        {
            equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
        }
        else if (playerAttack.eq_Name_2 == "Bow")
        {
            equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
        }
    }
 public PrimaryAugment(Augment source)
 {
     name         = source.Name;
     description  = source.Description;
     slot         = source.Slot.GetDescription();
     race         = source.Race == null ? "" : source.Race.GetDescription();
     gender       = source.Gender;
     customParams = source.AllCustomParameters;
 }
Exemplo n.º 9
0
        public override void Compile(sunCompiler compiler)
        {
            var symbol = compiler.Context.MustResolveStorable(Variable);

            if (symbol is sunConstantSymbol)
            {
                throw new sunAssignConstantException(Variable);
            }
            Augment.Compile(compiler, symbol);
            if (Parent is sunOperand)
            {
                symbol.CompileGet(compiler);
            }
        }
Exemplo n.º 10
0
 public void SetNewAugPlacement(Augment newAugment, bool exchange)
 {
     if (augmentations == null)
     {
         augmentations = new Augment[System.Enum.GetNames(typeof(Aug_Placement)).Length - 1];
     }
     if (augmentations[(int)newAugment.GS_placement] == null && !exchange)
     {
         augmentations[(int)newAugment.GS_placement] = newAugment;
     }
     if (augmentations[(int)newAugment.GS_placement].GS_name != null && exchange)
     {
         RemoveAugment(newAugment.GS_placement);
         augmentations[(int)newAugment.GS_placement] = newAugment;
     }
 }
Exemplo n.º 11
0
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");

        playerMovement = player.GetComponent <PlayerMovement>();

        if (playerAttack == null)
        {
            playerAttack = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttack>();
        }

        if (playerAttack.eq_Name == "Boomerang")
        {
            equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
        }
        else if (playerAttack.eq_Name_2 == "Boomerang")
        {
            equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
        }

        //Up
        //if (transform.localRotation.z <= 0)
        if (playerMovement.playerFaceDir == PlayerMovement.faceDir.Up)
        {
            destination = new Vector2(transform.localPosition.x, transform.localPosition.y + distance);
        }
        //Left
        //else if (transform.localRotation.z > 0 && transform.localRotation.z <= 90)
        else if (playerMovement.playerFaceDir == PlayerMovement.faceDir.Left)
        {
            destination = new Vector2(transform.localPosition.x - distance, transform.localPosition.y);
        }

        //Down
        //else if (transform.localRotation.z > 90 && transform.localRotation.z <= 180)
        else if (playerMovement.playerFaceDir == PlayerMovement.faceDir.Down)
        {
            destination = new Vector2(transform.localPosition.x, transform.localPosition.y - distance);
        }

        //Right
        //else if (transform.localRotation.z > 180 && transform.localRotation.z <= 270)
        else if (playerMovement.playerFaceDir == PlayerMovement.faceDir.Right)
        {
            destination = new Vector2(transform.localPosition.x + distance, transform.localPosition.y);
        }
    }
Exemplo n.º 12
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (playerAttack.eq_Name == "Bow")
        {
            equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
        }
        else if (playerAttack.eq_Name_2 == "Bow")
        {
            equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
        }

        if (col.CompareTag("Enemy") || col.CompareTag("FlyingEnemy") || col.gameObject.CompareTag("Boss"))
        {
            EnemyHealth enemyHP_Script = col.GetComponent <EnemyHealth>();

            enemyHP_Script.TakeDamage(damage);

            if (equipmentAugment != null)
            {
                //Debug.Log(col.name);

                if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Burn)
                {
                    if (enemyHP_Script != null && enemyHP_Script.currStatusCondition != EnemyHealth.StatusCondition.Burn)
                    {
                        enemyHP_Script.TakeDamage(0, EnemyHealth.StatusCondition.Burn);
                    }
                }
                else if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Freeze)
                {
                    if (enemyHP_Script != null && enemyHP_Script.currStatusCondition != EnemyHealth.StatusCondition.Freeze)
                    {
                        enemyHP_Script.TakeDamage(0, EnemyHealth.StatusCondition.Freeze);
                    }
                }
            }

            --hitAmount;
        }

        if (hitAmount <= 0)
        {
            Destroy(gameObject);
        }
    }
Exemplo n.º 13
0
    public void SetRadialSlot(IRadialSelectable item)
    {
        Augment augmentItem = item as Augment;

        if (augmentItem)
        {
            if (augmentItem != SelectedQuickAugment)
            {
                if (SelectedQuickAugment)
                {
                    SelectedQuickAugment.OnUnequip(this);
                }

                SelectedQuickAugment = item as Augment;
                SelectedQuickAugment.OnEquip(this);
            }
        }
    }
Exemplo n.º 14
0
    /// <summary>
    /// Attach a new augment to this board.
    /// </summary>
    /// <param name="aug">The augment to apply</param>
    public void ApplyAugment(Augment aug)
    {
        aug.board = this;

        for (int i = 0; i < augments.Count; i++)
        {
            aug.OnInteraction(augments[i]);
        }

        // It is possible augments interacting with their own type
        // prevent the need to apply twice, and rather combine,
        // so check if it still needs to be applied.
        if (aug.needsToBeAdded)
        {
            aug.OnApply();
            augments.Add(aug);
        }
    }
    public void EquipSideAugment(Augment newItem)
    {
        Augment oldItem = null;

        // There is no empty slot.
        if (currEquipment[(int)Equipment.EquipmentSlot.Side_Weapon].augment != null)
        {
            oldItem = currEquipment[(int)Equipment.EquipmentSlot.Side_Weapon].augment;
            inventory.Add(oldItem);
        }

        currEquipment[(int)Equipment.EquipmentSlot.Side_Weapon].augment = newItem;

        // Event call (Callback function)
        if (onEquipmentChanged != null)
        {
            onEquipmentChanged.Invoke();
        }
    }
Exemplo n.º 16
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.CompareTag("Obstacle"))
        {
            toReturn    = true;
            returnSpeed = toSpeed;
        }
        else if (col.gameObject.CompareTag("Enemy") || col.gameObject.CompareTag("FlyingEnemy") || col.gameObject.CompareTag("Boss"))
        {
            if (playerAttack.eq_Name == "Boomerang")
            {
                equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
            }
            else if (playerAttack.eq_Name_2 == "Boomerang")
            {
                equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
            }

            EnemyHealth enemyHP_Script = col.GetComponent <EnemyHealth>();

            enemyHP_Script.TakeDamage(damage);

            if (equipmentAugment != null)
            {
                if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Burn)
                {
                    if (enemyHP_Script != null && enemyHP_Script.currStatusCondition != EnemyHealth.StatusCondition.Burn)
                    {
                        enemyHP_Script.TakeDamage(0, EnemyHealth.StatusCondition.Burn);
                    }
                }
                else if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Freeze)
                {
                    if (enemyHP_Script != null && enemyHP_Script.currStatusCondition != EnemyHealth.StatusCondition.Freeze)
                    {
                        enemyHP_Script.TakeDamage(0, EnemyHealth.StatusCondition.Freeze);
                    }
                }
            }
        }
    }
Exemplo n.º 17
0
    void Start()
    {
        if (anim == null)
        {
            anim = gameObject.GetComponent <Animator>();
        }

        if (playerAttack == null)
        {
            playerAttack = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttack>();
        }

        if (playerAttack.eq_Name == "Flamethrower")
        {
            equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
        }
        else if (playerAttack.eq_Name_2 == "Flamethrower")
        {
            equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
        }
    }
Exemplo n.º 18
0
    void Update()
    {
        if (playerAttack.eq_Name == "Flamethrower")
        {
            equipmentAugment = EquipmentManager.instance.MainEquipment().augment;
        }
        else if (playerAttack.eq_Name_2 == "Flamethrower")
        {
            equipmentAugment = EquipmentManager.instance.SideEquipment().augment;
        }

        if (equipmentAugment != null)
        {
            if (equipmentAugment.augmentStatus != Augment.AugmentStatus.Freeze)
            {
                anim.SetBool("isCyro", false);
            }
            else if (equipmentAugment.augmentStatus == Augment.AugmentStatus.Freeze)
            {
                anim.SetBool("isCyro", true);
            }
        }
    }
Exemplo n.º 19
0
    public override void OnInteraction(Augment other)
    {
        // If already on fire, esentially reset the fire and take the stronger one
        // Stronger damage takes presendence.
        if (other.GetType() == GetType())
        {
            FireAug fireOther = other as FireAug;

            if (fireOther.damagePerTick < damagePerTick)
            {
                fireOther.damagePerTick = damagePerTick;
                fireOther.duration      = duration;
            }

            fireOther.timer -= duration; // Add this fires duration to the time remaining
            if (fireOther.timer < 0.0f)
            {
                fireOther.timer = 0.0f;
            }

            needsToBeAdded = false;
        }
    }
 private void Clear()
 {
     _trackedImageList.Clear();
     _augment = null;
     _trackedImageDistanceMin = null;
 }
    private void OnAugmentInstantiated(Augment augment)
    {
        _augment = augment;

        DebugOverlay.Log($"Augment {augment.name} instantiated");
    }
Exemplo n.º 22
0
 public void RemoveSwappableAugment(Augment aug)
 {
     _augments.Remove(aug);
     augmentMenu.RemoveItem(aug);
 }
        protected async override Task <bool> Process()
        {
            switch (type)
            {
            case AugmentationType.Organ:
            {
                switch (action)
                {
                case AugmentationAction.Install:
                {
                    Economics.Exchange.TakeItem(implant as Organ);
                    bool successful = Patient.InstallOrgan((implant as Organ).Slot);
                    if (successful)
                    {
                        Journal.AddRecord("Орган \"" + implant.Name + "\" установлен в пациента " + Patient.Name + ".", Controller.LogOutputDuringOperation);
                    }
                    return(successful);
                }

                case AugmentationAction.Remove:
                {
                    Organ ejected = Patient.EjectOrgan((target as Organ).Slot);
                    if (ejected != null)
                    {
                        Economics.Exchange.AddItem(ejected);
                        Journal.AddRecord("Из пациента " + Patient.Name + " извлечён орган \"" + ejected.Name + "\" и убран на склад.", Controller.LogOutputDuringOperation);
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }

                default: return(false);
                }
            }

            case AugmentationType.Primary:
            {
                switch (action)
                {
                case AugmentationAction.Install:
                {
                    Augment ejected = Patient.InstallAugmentToOrganSlot(implant as Augment);
                    Economics.Exchange.TakeItem(implant as Augment);
                    if ((implant as Augment).IsReplacement)
                    {
                        Journal.AddRecord("Протез \"" + implant.Name + "\" органа \"" + implant.SlotString + "\" установлен в пациента " + Patient.Name + ".", Controller.LogOutputDuringOperation);
                    }
                    else
                    {
                        Journal.AddRecord("Аугмент \"" + implant.Name + "\" для органа \"" + implant.SlotString + "\" установлен в пациента " + Patient.Name + ".", Controller.LogOutputDuringOperation);
                        if (ejected != null)
                        {
                            Economics.Exchange.AddItem(ejected);
                            Journal.AddRecord("Взамен, аугмент \"" + ejected.Name + "\" извлечён и убран на склад.", Controller.LogOutputDuringOperation);
                        }
                    }
                    return(true);
                }

                case AugmentationAction.Remove:
                {
                    Augment ejected = Patient.EjectAugmentFromOrganSlot((target as Organ).Slot);
                    if (ejected != null)
                    {
                        Economics.Exchange.AddItem(ejected);
                        if (ejected.IsReplacement)
                        {
                            Journal.AddRecord("Протез \"" + ejected.Name + "\" органа \"" + ((Character.BodyPartSlot.SlotType)(ejected.Slot)).GetDescription() + "\" извлечён из пациента " + Patient.Name + " и убран на склад.", Controller.LogOutputDuringOperation);
                        }
                        else
                        {
                            Journal.AddRecord("Аугмент \"" + ejected.Name + "\" для органа \"" + ((Character.BodyPartSlot.SlotType)(ejected.Slot)).GetDescription() + "\" извлечён из пациента " + Patient.Name + " и убран на склад.", Controller.LogOutputDuringOperation);
                        }
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }

                default: return(false);
                }
            }

            case AugmentationType.Auxilary:
            {
                switch (action)
                {
                case AugmentationAction.Install:
                {
                    Economics.Exchange.TakeItem(implant as Augment);
                    Patient.AddAugment(implant as Augment);
                    Journal.AddRecord("Аугмент \"" + implant.Name + "\" успешно имплантирован в пациента" + Patient.Name + ".", Controller.LogOutputDuringOperation);
                    return(true);
                }

                case AugmentationAction.Remove:
                {
                    bool didEject = Patient.EjectAugment(target as Augment);
                    if (didEject)
                    {
                        Journal.AddRecord("Извлечён имплант " + target.Name + " из пациента " + Patient.Name, Controller.LogOutputDuringOperation);
                    }
                    return(didEject);
                }

                default: return(false);
                }
            }

            default: return(false);
            }
        }
Exemplo n.º 24
0
    public void EquipAugment(Augment augment, int slot)
    {
        switch (slot)
        {
        case 0:
            UnequipAugment(slot);
            headAugment = augment;
            return;

        case 1:
            UnequipAugment(slot);
            rightArmAugment = augment;
            return;

        case 2:
            UnequipAugment(slot);
            leftArmAugment = augment;
            return;

        case 3:
            UnequipAugment(slot);
            chestAugment = augment;
            if (augment.name == "Volatile Discharge")
            {
                if (ability1 is LaserBeam laserBeam)
                {
                    laserBeam.energyCost += 25;
                    laserBeam.SetUseTimeToTick();
                    laserBeam.UpdateTickDamage();
                }
                else if (ability2 is LaserBeam laserBeam2)
                {
                    laserBeam2.energyCost += 25;
                    laserBeam2.SetUseTimeToTick();
                    laserBeam2.UpdateTickDamage();
                }
                return;
            }
            return;

        case 4:
            UnequipAugment(slot);
            waistAugment = augment;
            return;

        case 5:
            UnequipAugment(slot);
            rightLegAugment = augment;
            if (augment.name == "Impact Energy")
            {
                if (ability1 is LegSpin legSpin)
                {
                    legSpin.UpdateReturnEnergy(5);
                }
                else if (ability2 is LegSpin legSpin2)
                {
                    legSpin2.UpdateReturnEnergy(5);
                }
                return;
            }
            if (augment.name == "Increased Potential")
            {
                characterMovement.maxJumps++;
                return;
            }
            if (augment.name == "Fresh Oil")
            {
                this.runSpeed    *= 1.25f;
                this.sprintSpeed *= 1.25f;
                return;
            }
            if (augment.name == "Explosive Landing")
            {
                characterMovement.landingDamage    = 1;
                characterMovement.maxLandingDamage = 1000;
                return;
            }
            if (augment.name == "Overclock")
            {
                this.dashSpeed *= 2;
                return;
            }
            if (augment.name == "Aerial Stomp")
            {
                this.kickDamage = 500;
                return;
            }
            return;

        case 6:
            UnequipAugment(slot);
            leftLegAugment = augment;
            if (augment.name == "Impact Energy")
            {
                if (ability1 is LegSpin legSpin)
                {
                    legSpin.UpdateReturnEnergy(5);
                }
                else if (ability2 is LegSpin legSpin2)
                {
                    legSpin2.UpdateReturnEnergy(5);
                }
                return;
            }
            if (augment.name == "Increased Potential")
            {
                characterMovement.maxJumps++;
                return;
            }
            if (augment.name == "Fresh Oil")
            {
                this.runSpeed    *= 1.25f;
                this.sprintSpeed *= 1.25f;
                return;
            }
            if (augment.name == "Explosive Landing")
            {
                characterMovement.landingDamage    = 1;
                characterMovement.maxLandingDamage = 1000;
                return;
            }
            if (augment.name == "Overclock")
            {
                this.dashSpeed *= 2;
                return;
            }
            if (augment.name == "Aerial Stomp")
            {
                this.kickDamage = 500;
                return;
            }
            return;
        }
    }
Exemplo n.º 25
0
 public AuxilaryAugment(Augment source)
 {
     name         = source.Name;
     description  = source.Description;
     customParams = source.AllCustomParameters;
 }
Exemplo n.º 26
0
 /// <summary>
 /// Override this to allow interaction with curently applied augments.
 /// </summary>
 public virtual void OnInteraction(Augment other)
 {
 }
Exemplo n.º 27
0
    public void UnequipAugment(int slot)
    {
        switch (slot)
        {
        case 0:
            headAugment = null;
            return;

        case 1:
            rightArmAugment = null;
            return;

        case 2:
            leftArmAugment = null;
            return;

        case 3:
            if (chestAugment != null)
            {
                if (chestAugment.name == "Volatile Discharge")
                {
                    if (ability1 is LaserBeam laserBeam)
                    {
                        laserBeam.energyCost -= 25;
                        laserBeam.RevertUseTime();
                        laserBeam.UpdateTickDamage();
                    }
                    else if (ability2 is LaserBeam laserBeam2)
                    {
                        laserBeam2.energyCost -= 25;
                        laserBeam2.RevertUseTime();
                        laserBeam2.UpdateTickDamage();
                    }
                    chestAugment = null;
                    return;
                }
                chestAugment = null;
            }
            return;

        case 4:
            waistAugment = null;
            return;

        case 5:
            if (rightLegAugment != null)
            {
                if (rightLegAugment.name == "Impact Energy")
                {
                    if (ability1 is LegSpin legSpin)
                    {
                        legSpin.UpdateReturnEnergy(0);
                    }
                    else if (ability2 is LegSpin legSpin2)
                    {
                        legSpin2.UpdateReturnEnergy(0);
                    }
                    rightLegAugment = null;
                    return;
                }
                if (rightLegAugment.name == "Increased Potential")
                {
                    characterMovement.maxJumps--;
                    rightLegAugment = null;
                    return;
                }
                if (rightLegAugment.name == "Fresh Oil")
                {
                    this.runSpeed    = defaultSpeed;
                    this.sprintSpeed = runSpeed * 2;
                    rightLegAugment  = null;
                    return;
                }
                if (rightLegAugment.name == "Explosive Landing")
                {
                    characterMovement.landingDamage    = 0;
                    characterMovement.maxLandingDamage = 0;
                    rightLegAugment = null;
                    return;
                }
                if (rightLegAugment.name == "Overclock")
                {
                    this.dashSpeed /= 2;
                    rightLegAugment = null;
                    return;
                }
                if (rightLegAugment.name == "Aerial Stomp")
                {
                    this.kickDamage = 0;
                    rightLegAugment = null;
                    return;
                }
            }
            return;

        case 6:
            if (leftLegAugment != null)
            {
                if (leftLegAugment.name == "Impact Energy")
                {
                    if (ability1 is LegSpin legSpin)
                    {
                        legSpin.UpdateReturnEnergy(0);
                    }
                    else if (ability2 is LegSpin legSpin2)
                    {
                        legSpin2.UpdateReturnEnergy(0);
                    }
                    leftLegAugment = null;
                    return;
                }
                if (leftLegAugment.name == "Increased Potential")
                {
                    characterMovement.maxJumps--;
                    leftLegAugment = null;
                    return;
                }
                if (leftLegAugment.name == "Fresh Oil")
                {
                    this.runSpeed    = defaultSpeed;
                    this.sprintSpeed = runSpeed * 2;
                    leftLegAugment   = null;
                    return;
                }
                if (leftLegAugment.name == "Explosive Landing")
                {
                    characterMovement.landingDamage    = 0;
                    characterMovement.maxLandingDamage = 0;
                    leftLegAugment = null;
                    return;
                }
                if (leftLegAugment.name == "Overclock")
                {
                    this.dashSpeed /= 2;
                    leftLegAugment  = null;
                    return;
                }
                if (leftLegAugment.name == "Aerial Stomp")
                {
                    this.kickDamage = 0;
                    leftLegAugment  = null;
                    return;
                }
            }
            return;
        }
    }
Exemplo n.º 28
0
 public void UpdateAugmentData(Augment augment)
 {
     this.augmentInfo = augment;
 }
Exemplo n.º 29
0
 public AugmentDataContainer(Augment augment)
 {
     this.augmentInfo = augment;
 }
Exemplo n.º 30
0
    private void HandleItemDragging(UI_DragableItem dragableItem)
    {
        if (dragableItem)
        {
            if (dragableItem.IsDragging())
            {
                //Move the element!
                Rect canvasSize = UI_CanvasManager.GetCanvas().pixelRect;
                dragableItem.GetParentTransform().SetParent(UI_CanvasManager.GetCanvas().transform);
                dragableItem.GetParentTransform().localPosition = UI_CanvasManager.ConvertScreenPositionToCanvasLocalPosition(UI_CanvasManager.GetMousePositionFromScreenCentre());

                if (dragableItem.GetParentItem().GetItemType() == EItemType.WEAPON)
                {
                    //Hovering over HAND SLOTS
                    for (uint i = 0; i < (uint)EPlayerHand.MAX; i++)
                    {
                        //if your hovering over a UI hand
                        if (UI_CanvasManager.IsPointInsideRect(m_loadout_hands[i].rectTransform, dragableItem.GetParentTransform().localPosition))
                        {
                            m_loadout_handFrames[i].color = Color.green;
                        }
                    }
                }
                else
                {
                    for (uint i = 0; i < (uint)EPlayerHand.MAX; i++)
                    {
                        m_loadout_handFrames[i].color = Color.red;
                    }
                }

                if (dragableItem.GetParentItem().GetItemType() == EItemType.AUGMENT)
                {
                    Augment aug = dragableItem.GetParentItem() as Augment;

                    //Hovering over AUGMENTS
                    for (int i = 0; i < (int)EAugmentSlot.MAX; ++i)
                    {
                        EAugmentSlot augSlot = (EAugmentSlot)i;

                        if (UI_CanvasManager.IsPointInsideRect(m_augmentSlots[i].rectTransform, dragableItem.GetParentTransform().localPosition))
                        {
                            if (m_player.m_playerAugmentHandler.CanAttachAugmentToSlot(augSlot, aug))
                            {
                                m_augmentSlots_Frame[i].color = Color.green;
                            }
                            else
                            {
                                m_augmentSlots_Frame[i].color = Color.red;
                            }
                        }
                    }
                }
                else
                {
                    //display bad colours for aug slots
                    for (int i = 0; i < (int)EAugmentSlot.MAX; ++i)
                    {
                        m_augmentSlots_Frame[i].color = Color.red;
                    }
                }
            }
        }
    }