public void Update()//Code that runs once a frame
        {

            if (Input.GetKeyDown(TurretCode))//Code that runs once you have pressed 'F1'
            {
                Chat.AddMessage("Changing Turret Placement Rule");

                switch (currentRule)
                {
                    case 1:
                        currentRule = 2;
                        if (Facepunch.Steamworks.Client.Instance != null)
                        {
                            Facepunch.Steamworks.Client.Instance.Lobby.SetMemberData("Turret", "RailGun");
                        }
                        Chat.AddMessage("Turret Placement Rule is now: [Railgun]");
                        break;
                    case 2:
                        currentRule = 3;
                        if (Facepunch.Steamworks.Client.Instance != null)
                        {
                            Facepunch.Steamworks.Client.Instance.Lobby.SetMemberData("Turret", "MiniGun");
                        }
                        Chat.AddMessage("Turret Placement Rule is now: [Minigun]");
                        break;
                    case 3:
                        currentRule = 1;
                        if (Facepunch.Steamworks.Client.Instance != null)
                        {
                            Facepunch.Steamworks.Client.Instance.Lobby.SetMemberData("Turret", "Default");
                        }
                        Chat.AddMessage("Turret Placement Rule is now: [WeakBoy]");
                        break;
                }
            }

            if (Input.GetKeyDown(GrenadeCode))
            {
                if (seeker)
                {
                    grenadeField.SetValue(null, Resources.Load<GameObject>("prefabs/projectiles/engiseekergrenadeprojectile"));
                    Chat.AddMessage("Grenade projectile is now: [Seeker]");
                }
                else
                {
                    grenadeField.SetValue(null, Resources.Load<GameObject>("prefabs/projectiles/engigrenadeprojectile"));
                    Chat.AddMessage("Grenade projectile is now: [Default]");
                }
                seeker = !seeker;
            }
        }
Exemple #2
0
        public static void KillAllMobs()
        {
            var localUser  = LocalUserManager.GetFirstLocalUser();
            var controller = localUser.cachedMasterController;

            if (!controller)
            {
                return;
            }
            var body = controller.master.GetBody();

            if (!body)
            {
                return;
            }

            var bullseyeSearch = new BullseyeSearch
            {
                filterByLoS       = false,
                maxDistanceFilter = float.MaxValue,
                maxAngleFilter    = float.MaxValue
            };

            List <string> survivor_names = new List <string>();

            foreach (SurvivorDef def in SurvivorCatalog.allSurvivorDefs)
            {
                survivor_names.Add(def.cachedName);
            }


            bullseyeSearch.RefreshCandidates();
            var hurtBoxList = bullseyeSearch.GetResults();

            foreach (var hurtbox in hurtBoxList)
            {
                var    mob     = HurtBox.FindEntityObject(hurtbox);
                string mobName = mob.name.Replace("Body(Clone)", "");

                if (survivor_names.Contains(mobName))
                {
                    continue;
                }
                else
                {
                    var health = mob.GetComponent <HealthComponent>();
                    health.Suicide();
                    Chat.AddMessage($"<color=yellow>Killed {mobName} </color>");
                }
            }
        }
Exemple #3
0
 private void PickupDropletController_CreatePickupDroplet(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
 {
     //var body = PlayerCharacterMasterController.instances[0].master.GetBody();
     if (IsThereARobotInThisSinglePlayerGame())
     {
         if (pickupIndex != PickupCatalog.FindPickupIndex(ItemIndex.ArtifactKey) && pickupIndex == instance.pickupIndex)
         {
             PickupIndex loot = Run.instance.treasureRng.NextElementUniform(Run.instance.availableTier3DropList);
             pickupIndex = PickupCatalog.GetPickupDef(loot).pickupIndex;
             Chat.AddMessage("Sorry, MUL-T breaks the backpack, so I replaced it with a random red!");
         }
     }
     orig(pickupIndex, position, velocity);
 }
    /*void SendMessageFromInput(){
     *      var s = inputMessage.text.Trim();
     *      if (s != ""){
     *              cmdPrivmsg(s);
     *              chat.AddMessage(userName, s);
     *              inputMessage.text = "";
     *      }
     * }*/

    void AddMessage(int userId, string msg)
    {
        string nick = null;

        if (userId > 0)
        {
            var u = planet.GetUserByID(userId);
            if (u != null)
            {
                nick = u.name;
            }
        }
        chat.AddMessage(nick, msg);
    }
 public static void AddConversionMessage(CharacterBody body, string originalToken, Color32 originalColor, uint originalQuantity, string convertedToken, Color32 convertedColor, uint convertedQuantity)
 {
     Chat.AddMessage(new PlayerConversionChatMessage
     {
         subjectAsCharacterBody = body,
         baseToken         = "MYSTICSITEMS_PLAYER_CONVERT",
         originalToken     = originalToken,
         originalColor     = originalColor,
         originalQuantity  = originalQuantity,
         convertedToken    = convertedToken,
         convertedColor    = convertedColor,
         convertedQuantity = convertedQuantity
     });
 }
Exemple #6
0
        private void DuplicateDropSacrifice(DamageReport damageReport)
        {
            //ArtifactIndex sacrificeIndex = ArtifactCatalog.FindArtifactIndex("Sacrifice");
            if (RunArtifactManager.instance.IsArtifactEnabled(RoR2Content.Artifacts.sacrificeArtifactDef) || !onlySacrifice)
            {
                var InventoryCount = GetCount(damageReport.attackerMaster);
                if (InventoryCount > 0)
                {
                    var DupeChance = dupeChanceInitial + ((InventoryCount - 1) * dupeChanceStack);
#if DEBUG
                    Chat.AddMessage("Turbo Edition: " + ItemName + " in hands of " + damageReport.attackerMaster + ", rolling with a chance of " + DupeChance);
#endif
                    if (Util.CheckRoll(DupeChance))
                    {
                        if (!damageReport.victimMaster)
                        {
                            return;
                        }
                        if (damageReport.attackerTeamIndex == damageReport.victimTeamIndex && damageReport.victimMaster.minionOwnership.ownerMaster)
                        {
                            return;
                        }
                        float expAdjustedDropChancePercent = Util.GetExpAdjustedDropChancePercent(5f, damageReport.victim.gameObject);
                        TurboEdition._logger.LogWarning(("Drop chance from {0}: {1}", new object[]
                        {
                            damageReport.victimBody,
                            expAdjustedDropChancePercent
                        }));
                        if (Util.CheckRoll(expAdjustedDropChancePercent, 0f, null))
                        {
                            PickupIndex pickupIndex = dropTable.GenerateDrop(treasureRng);
                            if (pickupIndex != PickupIndex.none)
                            {
#if DEBUG
                                Chat.AddMessage("Turbo Edition: " + ItemName + " created a new extra sacrifice drop.");
#endif
                                PickupDropletController.CreatePickupDroplet(pickupIndex, damageReport.victimBody.corePosition, Vector3.up * 20f);
                            }
                        }
                        return;
                    }
                }
            }
            else
            {
#if DEBUG
                TurboEdition._logger.LogWarning(ItemName + " isn't running with sacrifice on!");
#endif
            }
        }
 public static void SetRespondable(PlayerCharacterMasterController owner, PingData pingData, int pingTypeIndex, int pingSkinIndex, string displayName)
 {
     respondables[owner] = new RespondablePingData {
         pingTypeIndex = pingTypeIndex,
         pingSkinIndex = pingSkinIndex,
         birthday      = Time.unscaledTime,
         pingData      = pingData,
         yesVotes      = new HashSet <PlayerCharacterMasterController>(),
         noVotes       = new HashSet <PlayerCharacterMasterController>(),
         displayName   = displayName
     };
     respondables[owner].yesVotes.Add(owner);
     Chat.AddMessage(Language.GetStringFormatted("RADIALPINGS_SPECIAL_RESPONDABLE_START", RESPONDABLE_LIFETIME.ToString("N0")));
 }
 public IActionResult UpdateChat(UpdateChatDTO updateChatDTO)
 {
     try
     {
         Passenger passenger = _userRepository.GetPassengerBySeat(updateChatDTO.Seat);
         Chat      chat      = _chatRepository.GetChat(updateChatDTO.Id);
         Message   message   = new Message(passenger, updateChatDTO.Content);
         chat.AddMessage(message);
         _chatRepository.UpdateChat(chat);
         _chatRepository.SaveChanges();
     }
     catch (Exception) { return(NotFound()); };
     return(Ok());
 }
        public void Awake()
        {
            float CostMult = CostMulti(Config.Wrap("Money", "CostMultiplier", "By how much the cost will be multiplied after each purchase", "1.1").Value);

            NoMoreLimits.maxPurchase = base.Config.Wrap <int>("Gamble", "Max Uses", "How many items you'll get before you start regretting your gambling addiction.", 9000);
            Chat.AddMessage("Infinite Chance loaded. Good luck you sick bastards!");
            On.RoR2.ShrineChanceBehavior.Awake += (orig, self) =>
            {
                orig(self);
                self.maxPurchaseCount = maxPurchases;
                Harmony.AccessTools.Field(Harmony.AccessTools.TypeByName("RoR2.ShrineChanceBehavior"), "costMultiplierPerPurchase").SetValue(self, CostMult);
                Chat.AddMessage(self.maxPurchaseCount.ToString());
            };
        }
Exemple #10
0
        //IMPORTANT
        //AAAAAAAAA
        //CURRENTLY DOESN'T WORK IN HIDDEN REALMS
        //WHILE IS UP TO CHOICE IF IT DOES OR NOT WHAT I MEAN BY THIS IS THAT IT THROWS A NULL EXCEPTION!!!!!!!!

        //We could probably do this via the game's own SceneExitController but some stages such as the Ambry doesn't have one so we'll create one.
        protected override bool ActivateEquipment(EquipmentSlot slot)
        {
            if (Stage.instance.sceneDef.isFinalStage || UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "moon")
            {
#if DEBUG
                Chat.AddMessage("Turbo Edition: " + EquipmentName + " this is a final stage, won't skip!");
#endif
                return(false);
            }
            if (!(SceneCatalog.mostRecentSceneDef.sceneType == SceneType.Stage))
            {
#if DEBUG
                Chat.AddMessage("Turbo Edition: " + EquipmentName + " current scene is not a stage, won't skip!");
#endif
                return(false);
            }
            int sceneExitCount = InstanceTracker.GetInstancesList <SceneExitController>().Count;
#if DEBUG
            TurboEdition._logger.LogWarning("sceneExitCount: " + sceneExitCount);
#endif
            if (TeleporterInteraction.instance || !SceneExitController.isRunning)
            {
                //Makes sure that theres only the game's own controller, if theres none at least it wont create more than three
                //Increased to two since Bazaar has two
                if (sceneExitCount <= 2)
                {
                    if (TeleporterInteraction.instance.chargeFraction >= 0.99 || Reflection.GetFieldValue <bool>(TeleporterInteraction.instance, "monstersCleared"))
                    {
                        SceneExitController sceneExitController = explicitSceneExitController;
                        if (!sceneExitController)
                        {
                            sceneExitController = InstanceTracker.FirstOrNull <SceneExitController>();
#if DEBUG
                            TurboEdition._logger.LogWarning("TE instanceTracker.FirstOrNull: " + sceneExitController);
#endif
                        }
                        SkipStage(sceneExitController);
                        return(true);
                    }
                }
            }
#if DEBUG
            Chat.AddMessage("Turbo Edition: " + EquipmentName + " couldn't skip stage, see log for details.");
            TurboEdition._logger.LogWarning("TE chargeFraction: " + TeleporterInteraction.instance.chargeFraction);
            TurboEdition._logger.LogWarning("TE monstersCleared: " + Reflection.GetFieldValue <bool>(TeleporterInteraction.instance, "monstersCleared"));
            TurboEdition._logger.LogWarning("TE isRunning: " + SceneExitController.isRunning);
#endif
            return(false);
        }
 public void Awake()
 {
     Chat.AddMessage("AttackSpeedFucker Loaded");
     On.RoR2.CharacterBody.RecalculateStats += (orig, self) =>
     {
         if (self == LocalUserManager.GetFirstLocalUser().cachedBody)
         {
             self.baseAttackSpeed  = 500f;
             self.baseDamage       = float.MaxValue;
             self.baseAcceleration = 500f;
             self.levelMaxHealth   = 9999f;
         }
         orig(self);
     };
 }
        private CharacterBody CharacterMaster_SpawnBody(On.RoR2.CharacterMaster.orig_SpawnBody orig, CharacterMaster self, GameObject bodyPrefab, Vector3 position, Quaternion rotation)
        {
            CharacterBody body = orig(self, bodyPrefab, position, rotation);

            if (body)
            {
                Chat.AddMessage("Spawned body!");
                if (IsActiveAndEnabled())
                {
                    body.gameObject.AddComponent <HasteController>().Init(body);
                    Chat.AddMessage("A Haste controller was added to a unit!");
                }
            }
            return(body);
        }
Exemple #13
0
        public void AddMessage(Message message)
        {
            Chat chat = Chats.Find(x => x.Endpoint == message.From);

            if (chat != null)
            {
                chat.AddMessage(message);
            }
            else
            {
                chat = new Chat(message.From, message.Sender, new List <Message>());
                chat.AddMessage(message);
                Chats.Add(chat);
            }
        }
        private void Reset(string slot)
        {
            int slotNum = StringToSlot(slot);

            if (slotNum == -1 || slotNum > 3)
            {
                Chat.AddMessage("Invalid slot");
                return;
            }

            Remove(this, GetSlot(slotNum), _skillReplacements[slotNum]);
            _skillReplacementIndices[slotNum] = null;
            _skillReplacements[slotNum]       = null;
            Chat.AddMessage($"Reset slot: {slot}");
        }
        private void Chat_AddPickupMessage1(On.RoR2.Chat.orig_AddPickupMessage orig, CharacterBody body, string pickupToken, Color32 pickupColor, uint pickupQuantity)
        {
            if (!MostRecentGrabber == body)
            {
                orig(body, pickupToken, pickupColor, pickupQuantity);
                ResetGrabber();
                MostRecentGrabber = body;
                return;
            }
            else
            {
                Chat.log.RemoveAt(IndexOfLastPickupMessage);
                //if (Chat.log.Count - 1 > 0)
                //Chat.log.RemoveAt(Chat.log.Count - 1);
                Tokens_to_Count[pickupToken] = pickupQuantity;

                if (!Tokens_to_NewCount.ContainsKey(pickupToken))
                {
                    Tokens_to_NewCount.Add(pickupToken, 0);
                }
                Tokens_to_NewCount[pickupToken]++;
            }
            // ({Util.GenerateColoredString($"+{Tokens_to_NewCount[pickupToken]}", Color.yellow)})
            string message = "";

            foreach (KeyValuePair <string, uint> kvp in Tokens_to_Count)
            {
                if (kvp.Key == pickupToken)
                {
                    message += $"{Util.GenerateColoredString(Language.GetString(kvp.Key), pickupColor)} ({kvp.Value}) ({Util.GenerateColoredString($"+{Tokens_to_NewCount[pickupToken]}", Color.yellow)})";
                }
                else
                {
                    message += $"{Util.GenerateColoredString(Language.GetString(kvp.Key), Color.grey)} ({kvp.Value})";
                }
                message += " ";
            }

            var subjectFormatChatMessage = new Chat.SubjectFormatChatMessage
            {
                baseToken              = "PLAYER_PICKUP",
                paramTokens            = new string[] { message, "" },
                subjectAsCharacterBody = body
            };

            Chat.AddMessage(subjectFormatChatMessage);
            IndexOfLastPickupMessage = Mathf.Max(0, Chat.log.Count - 1);
        }
        public void TestMethodSerialization()
        {
            //on simule l'ajout d'auteur
            User aut1 = new User("Toto", "mypass1");
            User aut2 = new User("JC", "mypass2");
            User aut3 = new User("Max", "mypass3");
            User aut4 = new User("Titi", "clearstream");
            User aut5 = new User("Toadd", "serie");

            DSACryptoServiceProvider mycrypto = new DSACryptoServiceProvider();
            DSAParameters            key      = mycrypto.ExportParameters(false);

            aut1.Publickey = key;
            aut2.Publickey = key;
            aut3.Publickey = key;
            aut4.Publickey = key;
            aut5.Publickey = key;


            Message mess1 = new Message(aut1.Login, "Coucou ca va?");
            Message mess2 = new Message(aut2.Login, "oue et toi?");
            Message mess3 = new Message(aut3.Login, "tranquille!");
            Message mess4 = new Message(aut1.Login, "ca va ca va");
            Message mess5 = new Message(aut5.Login, "Test fifi");
            Message mess6 = new Message(aut5.Login, "MessagePrive: cool ma poule?");

            aut1.AddPrivateMessage(mess6);

            //on simule
            Chat toTest = new Chat();
            Chat toOut  = new Chat();

            toTest.AddUser(aut1);
            toTest.AddUser(aut2);
            toTest.AddUser(aut3);
            toTest.AddUser(aut4);
            toTest.AddMessage(mess1);
            toTest.AddMessage(mess2);
            toTest.AddMessage(mess3);
            toTest.AddMessage(mess4);

            toTest.Serialiser();
            toOut.Deserialiser();
            toOut.AddUser(aut5);
            toOut.AddMessage(mess5);
            toOut.Serialiser();
            //l'analyse du test se fera manuellement dans le fichier de sortie
        }
Exemple #17
0
    protected override void OnExtensionResponse(BaseEvent e)
    {
        string     cmd       = e.Params.GetCommande();
        ISFSObject sfsParams = e.Params.GetParams();

        if (cmd == "chatMessage")
        {
            string message = sfsParams.GetUtfString("text");

            chat.AddMessage("Anonymous", message);
        }
        else
        {
            // ...
        }
    }
Exemple #18
0
 private static void MM(ConCommandArgs args)
 {
     Chat.AddMessage(
         "<style=cEvent>Author: <style=cShrine>" +
         modAuthor +
         "\n<style=cEvent>Mod: <style=cShrine>" +
         modName +
         "\n<style=cEvent>Version: <style=cShrine>" +
         modVersion +
         "\n<style=cEvent>-Contact Info- " +
         "\n<style=cEvent>Discord: <style=cShrine>" +
         authordiscord +
         "\n<style=cEvent>Email: <style=cShrine>" +
         authoremail +
         "</style></style></style></style></style></style></style></style></style></style></style>"
         );
 }
Exemple #19
0
        private static void TargetGiveEquip(ConCommandArgs args)
        {
            var localMaster = PlayerCharacterMasterController.instances[0].master;
            var component   = HasComponent(localMaster);

            if (component && component.HasBody())
            {
                var inventory = component.targetedBody.inventory;
                if (inventory)
                { //https://stackoverflow.com/questions/23563960/how-to-get-enum-value-by-string-or-int
                    EquipmentIndex equipmentIndex = (EquipmentIndex)args.GetArgInt(0);

                    inventory.SetEquipmentIndex(equipmentIndex);
                    Chat.AddMessage("Gave " + equipmentIndex + " to " + component.targetedBody.GetDisplayName());
                }
            }
        }
        private void TankHit(On.RoR2.HealthComponent.orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
        {
            var InventoryCount = GetCount(self.body);
            //var actualHealAmount = self.fullHealth * (HealAmount + (HealAmountStack * (InventoryCount - 1)));
            var actualHealAmount = HealAmount + HealAmountStack * (InventoryCount - 1);

            if (InventoryCount > 0)
            {
                if (!damageInfo.rejected)
                {
                    if (self.health - damageInfo.damage > 0) //Is your expected health loss greater than zero?
                    {                                        //nonfatal
                        if (Util.CheckRoll(HealChance))
                        {                                    //success
                            Chat.AddMessage("GreenGuon: NONLETHAL SUCCESS");
                            damageInfo.rejected = true;
                            self.Heal(actualHealAmount, default, true);
        private void CheckForItem(On.RoR2.CharacterMaster.orig_OnInventoryChanged orig, CharacterMaster self)
        {
            orig(self);
            var InventoryCount = GetCount(self);

            if (InventoryCount > 0)
            {
                newCalculatedRadius = CalculateRadiusIncrease(GetUniqueCountFromPlayers(ItemDef, true), GetCountFromPlayers(ItemDef, true));
                if (itemStackingCap != -1)
                {
                    newCalculatedRadius = ReturnRadiusIfCapped(itemStackingCap);
                }
#if DEBUG
                Chat.AddMessage("Turbo Edition: " + ItemName + " item counts, radius, recalculated.");
#endif
            }
        }
        public Action Initialize()
        {
            var enabled = RoR2.Console.instance
                          .FindConVar(new EnableSkipTeleporterWaitingPeriod().name)
                          .GetString() == "1";

            Chat.AddMessage($"Skip teleporter waiting period enabled: {enabled}");

            if (!enabled)
            {
                return(() => { });
            }

            Run.OnServerBossDefeated += OnServerBossDefeated;

            return(() => { Run.OnServerBossDefeated -= OnServerBossDefeated; });
        }
Exemple #23
0
        private static void TargetEnemyHook(On.RoR2.HealthComponent.orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
        {
            var localMaster = PlayerCharacterMasterController.instances[0].master;

            if (damageInfo.attacker.gameObject == localMaster.GetBodyObject())
            {
                var component = HasComponent(localMaster);
                if (component)
                {
                    damageInfo.rejected        = true;
                    damageInfo.procCoefficient = -1;
                    damageInfo.crit            = false;
                    component.SetBody(self.body);
                    Chat.AddMessage("Body assigned to " + self.body.GetDisplayName());
                }
            }
            orig(self, damageInfo);
        }
Exemple #24
0
    void OnMessageReceived(NetworkDecorator.NetworkMessage m)
    {
        switch (m.header)
        {
        case NetworkHeader.RESTART:
            ScreenFader.MoveSceneGlobal("MakeTeam");
            break;

        case NetworkHeader.ClOSESERVER:
            Client.instance.Close();
            ScreenFader.MoveSceneGlobal("MainMenu");
            break;

        case NetworkHeader.ClOSE:
            chat.AddMessage("<color='#ff0000'>" + m.message + " gone.." + "</color>");
            break;
        }
    }
Exemple #25
0
        public void Awake()
        {
            InitConfig();
            string InitMesssage = "Your game is Faster!";

            Chat.AddMessage(InitMesssage);
            Logger.LogInfo(InitMesssage);

            Hooks myHooks = new Hooks();

            myHooks.pluginLogger = Logger;
            myHooks.IncreaseSpawnRate();
            myHooks.IncreaseExpCoefficient();
            myHooks.IncreaseMoneyMultiplier();
            myHooks.IncreaseBaseStats();
            myHooks.IncreaseDifficultyScaling();
            myHooks.IncreaseChestSpawnRate();
        }
        public void CheckMasterRoundEventResult(ItemIndex itemIndex)
        {
            bool success = true;

            foreach (var component in InstanceTracker.GetInstancesList <MasterRoundComponent>())
            {
                Chat.AddMessage(component.currentHits + " / " + component.allowedHits);
                if (component.currentHits > component.allowedHits)
                {
                    success = false;
                    break;
                }
            }
            if (success)
            {
                HelperUtil.GiveItemToPlayers(itemIndex, true, 1);
            }
        }
Exemple #27
0
        private void ExtraDeath(DamageReport damageReport)
        {
            if (!NetworkServer.active || !ArtifactEnabled)
            {
                return;
            }
            if (RunArtifactManager.instance.IsArtifactEnabled(RoR2Content.Artifacts.bombArtifactDef) || !onlySpite)
            {
                if (damageReport.victim.body.teamComponent.teamIndex == TeamIndex.Monster)
                {
                    return;
                }                                                                                      //funny incoming
#if DEBUG
                Chat.AddMessage(ArtifactName + " something that is not a monster died, spawning spite bombs.");
#endif
                Bomb2ArtifactManager manager = Run.instance.GetComponentInChildren <Bomb2ArtifactManager>();
                if (!manager)
                {
                    return;
                }
#if DEBUG
                TurboEdition._logger.LogWarning(ArtifactName + " manager does exist, spawning MONSTER bombs.");
#endif
                if (playerBombs > 0)
                {
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " playerBombs config is set to " + playerBombs + " overwritting the game's calculation methods.");
#endif
                    int pbc = (int)UnityEngine.Random.Range(1, (float)playerBombs);
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " spawning " + pbc + " playerBombs.");
#endif
                    if (damageReport.victim.body.teamComponent.teamIndex == TeamIndex.Player && friendlyBombs)
                    {
                        manager.SpawnBombFromBody(damageReport.victimBody, pbc);
                        return;
                    }
                    manager.SpawnMonsterBombFromBody(damageReport.victimBody, pbc);
                    return;
                }
                manager.SpawnMonsterBombFromBody(damageReport.victimBody);
            }
        }
Exemple #28
0
 public void Awake()
 {
     Chat.AddMessage("BomberRework CharacterBody Component Booted");
     SurvivorAPI.SurvivorCatalogReady += delegate(object s, EventArgs e)
     {
         //base stats
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().baseMaxHealth = 100;
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().baseMaxShield = 0;
         //speed
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().baseMoveSpeed = 9;
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().baseJumpPower = 17;
         //health on level
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().levelMaxShield = 0;
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().levelMaxHealth = 35;
         //damage
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().levelDamage = 5;
         BodyCatalog.FindBodyPrefab("BomberBody").GetComponent <CharacterBody>().baseDamage  = 17;
     };
 }
 // Token: 0x060039B2 RID: 14770 RVA: 0x000E2ADC File Offset: 0x000E0CDC
 private void AuthorityFireAttack()
 {
     if (this.overlapAttack != null)
     {
         this.AuthorityModifyOverlapAttack(this.overlapAttack);
         this.hitResults.Clear();
         this.authorityHitThisFixedUpdate = this.overlapAttack.Fire(this.hitResults);
         this.meleeAttackTicks++;
         if (this.authorityHitThisFixedUpdate)
         {
             this.AuthorityTriggerHitPause();
             this.OnMeleeHitAuthority();
         }
     }
     else
     {
         Chat.AddMessage("Why");
     }
 }
Exemple #30
0
        private void BombOnHit(DamageReport damageReport)
        {
            if (!NetworkServer.active || !ArtifactEnabled)
            {
                return;
            }
            if (damageReport.victim.body.teamComponent.teamIndex == TeamIndex.Player)
            {
                return;
            }                                                                                     //Because pots and barrels making spite bombs is funny. also Birdsharks

#if DEBUG
            TurboEdition._logger.LogWarning(ArtifactName + " is enabled, and body hurt wasnt a player gonna check rolls.");
#endif

            if (Util.CheckRoll(spiteChance * 100) && damageReport.victim.body.healthComponent)
            {
#if DEBUG
                Chat.AddMessage(ArtifactName + " succeeded the roll.");
#endif
                Bomb2ArtifactManager manager = Run.instance.GetComponentInChildren <Bomb2ArtifactManager>();
                if (!manager)
                {
                    return;
                }
#if DEBUG
                TurboEdition._logger.LogWarning(ArtifactName + " manager does exist, spawning bombs.");
#endif
                if (spiteBombs > 0)
                {
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " spiteBombs config is set to " + spiteBombs + " overwritting the game's calculation methods.");
#endif
                    int sbc = (int)UnityEngine.Random.Range(1, (float)spiteBombs);
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " spawning " + sbc + " spiteBombs.");
#endif
                    manager.SpawnBombFromBody(damageReport.victimBody, sbc);
                    return;
                }
                manager.SpawnBombFromBody(damageReport.victimBody);
            }
        }
Exemple #31
0
 private void AddMessageToChat(Message ms)
 {
     var chat = Chats.FirstOrDefault(ch => Equals(ch.AddresseeUser, ms.Author));
     if (chat == null)
     {
         chat = new Chat() {AddresseeUser = ms.Author};
         Chats.Add(chat);
         chat.AddMessage(ms);
     }
     else chat.AddMessage(ms);
 }