Beispiel #1
0
            public void Start()
            {
                if (!itemStealController)
                {
                    itemStealController = returnStolenItems.itemStealController;
                }
                itemStealController.onStealFinishClient += ItemStealController_onStealFinishClient;

                masterPrefab = MasterCatalog.FindMasterPrefab("EquipmentDroneMaster");
            }
Beispiel #2
0
        private void ItemStealController_RpcOnStealFinishClient(On.RoR2.ItemStealController.orig_RpcOnStealFinishClient orig, ItemStealController self)
        {
            orig(self);
            bool activate = false;

            foreach (var invInfo in self.stolenInventoryInfos)
            {
                if (invInfo.stolenItemStacks[(int)HonoredItem] > 0)
                {
                    activate = true;
                    break;
                }
            }

            if (activate)
            {
                var brother = GameObject.Find("BrotherHurtBody(Clone)");
                if (brother)
                {
                    var component = brother.AddComponent <MithrixKneel>();
                    component.characterBody = brother.GetComponent <CharacterBody>();
                    component.question      = Language.GetString(ItemCatalog.GetItemDef(HonoredItem).nameToken);
                }
            }
        }