Esempio n. 1
0
 private void CharacterBody_Awake(On.RoR2.CharacterBody.orig_Awake orig, CharacterBody self)
 {
     if (self.isClient)
     {
         Logger.LogInfo("Client!" + self.GetDisplayName());
         RichPresence presence = client.CurrentPresence;
         presence.Assets.SmallImageKey  = self.baseNameToken;
         presence.Assets.SmallImageText = self.GetDisplayName();
     }
     orig(self);
 }
Esempio n. 2
0
            public void UpdateTrackerBoosts()
            {
                if (!BotBody || !BotOwnerBody)
                {
                    forceRecalculateOnSpawn = true;
                    //AetheriumPlugin._logger.LogMessage("DOESNT EXIST");
                    return;
                }
                int inventoryCount = instance.GetCount(BotOwnerBody);

                if (BoostCount != inventoryCount)
                {
                    if (OriginalName == "")
                    {
                        OriginalName = BotBody.GetDisplayName();
                    }
                    BoostCount       = inventoryCount;
                    DamageBoost      = CalculateStat(BotOwnerBody.damage, instance.damageGrantedPercentage);
                    AttackSpeedBoost = CalculateStat(BotOwnerBody.attackSpeed, instance.attackSpeedGrantedPercentage);
                    CritChanceBoost  = CalculateStat(BotOwnerBody.crit, instance.critChanceGrantedPercentage);
                    HealthBoost      = CalculateStat(BotOwnerBody.maxHealth, instance.healthGrantedPercentage);
                    RegenBoost       = CalculateStat(BotOwnerBody.regen, instance.regenGrantedPercentage);
                    ArmorBoost       = CalculateStat(BotOwnerBody.armor, instance.armorGrantedPercentage);
                    MoveSpeedBoost   = CalculateStat(BotOwnerBody.moveSpeed, instance.movementSpeedGrantedPercentage);
                    BotName          = "";
                    if (BoostCount > 0)
                    {
                        BotName += "Inspired ";
                    }
                    BotName += OriginalName;

                    //Add stock to bots that can use it.
                    if (!IsBlacklisted())
                    {
                        //Clear for updating.
                        //Chat.AddMessage("FIRED CLEAR");
                        BotSkillStocks.Clear();
                        BotRechargeIntervals.Clear();

                        //Assign Default values for the stocks for recomputation upon changing item count.
                        if (DefaultSkillStocks.Count <= 0 && DefaultRechargeIntervals.Count <= 0)
                        {
                            var GenericSkillsOnBots = BotBody.GetComponentsInChildren <RoR2.GenericSkill>();
                            for (int i = 0; i < GenericSkillsOnBots.Length; i++)
                            {
                                DefaultSkillStocks.Add(GenericSkillsOnBots[i].maxStock);
                                DefaultRechargeIntervals.Add(GenericSkillsOnBots[i].baseRechargeInterval);
                            }
                        }
                        for (int i = 0; i < DefaultSkillStocks.Count; i++)
                        {
                            BotSkillStocks.Add(DefaultSkillStocks[i] * (Mathf.CeilToInt(AttackSpeedBoost) + 1));
                            BotRechargeIntervals.Add(DefaultRechargeIntervals[i] * Mathf.Pow(.8f, BoostCount));
                        }
                    }
                }
            }
Esempio n. 3
0
 // Token: 0x06000A6E RID: 2670 RVA: 0x00033FC4 File Offset: 0x000321C4
 public override string ConstructChatString()
 {
     if (this.sender)
     {
         CharacterBody component = this.sender.GetComponent <CharacterBody>();
         string        arg       = ((component != null) ? component.GetDisplayName() : null) ?? "???";
         return(string.Format(CultureInfo.InvariantCulture, "<style=cWorldEvent>{0}: {1}</style>", arg, Language.GetString(this.baseToken)));
     }
     return(null);
 }
Esempio n. 4
0
        public static DataContainer GetCharacterDataFor(CharacterBody character)
        {
            string characterDisplayName = character.GetDisplayName().ToLower();

            if (!Characters.ContainsKey(characterDisplayName))
            {
                return(new DataContainer(characterDisplayName, characterDisplayName, EnemyHitLog.DefaultHighlightColor, DataContainerType.Character));
            }

            return(Characters[characterDisplayName]);
        }
Esempio n. 5
0
        public static string CharacterHeaderMessage(CharacterBody CB)
        {
            CharacterMaster CM          = CB.master;
            string          nameColor   = $"{(CB.teamComponent.teamIndex == TeamIndex.Player ? RoR2Colors.EasyDifficulty : RoR2Colors.HardDifficulty)}";
            string          displayName = $"{CB.GetDisplayName()}";
            string          level       = $"{CB.level}";

            string message = $"<color={nameColor}>{displayName} (lv. {level}):</color>";

            return(message);
        }
Esempio n. 6
0
        public static DataContainer LookupMinionDataFor(CharacterBody minion)
        {
            string minionDisplayName = minion.GetDisplayName().ToLower();

            if (Allies.ContainsKey(minionDisplayName))
            {
                return(Allies[minionDisplayName]);
            }

            if (Utilities.ContainsKey(minionDisplayName))
            {
                return(Utilities[minionDisplayName]);
            }

            return(new DataContainer(minionDisplayName, Utils.ToCamelCase(minionDisplayName), EnemyHitLog.DefaultHighlightColor, DataContainerType.Unknown));
        }
        private void CharacterBody_OnDeathStart(On.RoR2.CharacterBody.orig_OnDeathStart orig, CharacterBody self)
        {
            orig(self);
            //self.master.IsDeadAndOutOfLivesServer()
            bool lastLifeCheck = cfgOnlyLastLife.Value == false || (cfgOnlyLastLife.Value && self.master && IsDeadAndOutOfLives(self.master));

            if (self.isPlayerControlled && lastLifeCheck)
            {
                if (LocalUserManager.readOnlyLocalUsersList[0].cachedBody?.GetComponent <NetworkIdentity>() == self.GetComponent <NetworkIdentity>())
                {
                    var trackerObject = Instantiate <GameObject>(defaultTrackerObject);
                    trackerObject.name = $"Tracking Corpse: {self.GetDisplayName()}";
                    trackerObject.GetComponent <TrackCorpseClient>().modelTransform = self.modelLocator.modelTransform.transform;
                    trackerObject.GetComponent <TrackCorpseClient>().lastPosition   = self.transform.position;
                }
            }
        }
 private void AttachShadesBinding(int count)
 {
     if (currentGigaDrillBreakerTarget)
     {
         TTGL_Survivor.TTGL_SurvivorPlugin.instance.Logger.LogMessage("Boss " + currentGigaDrillBreakerTarget.GetDisplayName() + " was struck with Gurren Lagann's shades " + (count + 1) + " time(s)!");
     }
 }
Esempio n. 9
0
        public static void UpdateCrosshair(CrosshairManager.orig_UpdateCrosshair orig, RoR2.UI.CrosshairManager self,
                                           CharacterBody targetBody, Vector3 crosshairWorldPosition,
                                           Camera uiCamera)
        {
            orig(self, targetBody, crosshairWorldPosition, uiCamera);
            switch (targetBody.GetDisplayName())
            {
            case "Commando":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.CommandoCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowCommandoCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowCommandoHitmarker.Value);
                break;

            case "Huntress":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.HuntressCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowHuntressCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowHuntressHitmarker.Value);
                break;

            case "Mercenary":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.MercenaryCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowMercenaryCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowMercenaryHitmarker.Value);
                break;

            case "MUL-T":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.MulTCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowMulTCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowMulTHitmarker.Value);
                break;

            case "Engineer":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.EngineerCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowEngineerCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowEngineerHitmarker.Value);
                break;

            case "Artificer":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.ArtificerCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowArtificerCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowArtificerHitmarker.Value);
                break;

            case "REX":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.RexCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowRexCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowRexHitmarker.Value);
                break;

            case "Loader":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.LoaderCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowLoaderCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowLoaderHitmarker.Value);
                break;

            case "Acrid":
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.AcridCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowAcridCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowAcridHitmarker.Value);
                break;

            default:
                targetBody.crosshairPrefab =
                    GetCrosshairPrefabFromValue(CharacterConfiguration.OtherCharacterCrosshair.Value, targetBody);
                self.container.gameObject.SetActive(CharacterConfiguration.ShowOtherCharacterCrosshair.Value);
                self.hitmarker.gameObject.SetActive(CharacterConfiguration.ShowOtherCharacterHitmarker.Value);
                break;
            }
        }