Exemplo n.º 1
0
        public ShrineBloodData(ShrineBloodBehavior shrine)
        {
            var purchaseInteraction = shrine.GetComponent <PurchaseInteraction>();

            transform     = new SerializableTransform(shrine.transform);
            purchaseCount = shrine.GetFieldValue <int>("purchaseCount");
            cost          = purchaseInteraction.cost;
            available     = purchaseInteraction.available;
        }
Exemplo n.º 2
0
        //Blood Shrine
        private static void ShrineBloodBehavior_AddShrineStack(On.RoR2.ShrineBloodBehavior.orig_AddShrineStack orig, ShrineBloodBehavior self, Interactor interactor)
        {
            orig(self, interactor);
            var characterBody = interactor.GetComponent <CharacterBody>();

            if (characterBody)
            {
                var inv = characterBody.inventory;
                if (inv)
                {
                    if (inv.GetItemCount(ExtraShrineRollItemIndex) > 0 && Util.CheckRoll(ItemProcChance * inv.GetItemCount(ExtraShrineRollItemIndex), characterBody.master))
                    {
                        var  purchaseInteraction = self.GetFieldValue <PurchaseInteraction>("purchaseInteraction");
                        uint amount = (uint)(characterBody.healthComponent.fullCombinedHealth * (float)purchaseInteraction.cost / 100f * self.goldToPaidHpRatio);
                        if (characterBody.master)
                        {
                            characterBody.master.GiveMoney(amount);
                            Chat.AddMessage($"<color=\"green\">Lucky Default Sphere <style=cShrine>has given you an additonal {amount} gold.</style>");
                        }
                    }
                }
            }
        }