You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
using System;using BepInEx;using RogueLibsCore;namespace RogueLibsCore.Examples
{[BepInPlugin(pluginGuid, pluginName, pluginVersion)][BepInDependency(RogueLibs.pluginGuid,"1.1")]publicclassExample1:BaseUnityPlugin{publicconststringpluginGuid="abbysssal.streetsofrogue.example1";publicconststringpluginName="Rocket Bullets Mutators";publicconststringpluginVersion="1.0";publicstaticCustomMutatorRocketBullets{get;set;}protectedvoidAwake(){RocketBullets= RogueLibs.SetMutator("RocketBullets",true,new CustomNameInfo("Rocket Bullets"),new CustomNameInfo("Replaces all bullets with rockets. Rate of fire is unchanged."));
RocketBullets.AddConflicting("RocketLaunchers","NoGuns");this.PatchPrefix(typeof(Gun),"spawnBullet", GetType(),"Gun_spawnBullet",new Type[]{typeof(bulletStatus),typeof(InvItem),typeof(int),typeof(bool),typeof(string)});}protectedstaticvoidGun_spawnBullet(refbulletStatusbulletType){if(RocketBullets.IsActive)bulletType= bulletStatus.Rocket;}}}
Example Items used in CustomItems.md
using System;using BepInEx;using RogueLibsCore;using UnityEngine;namespace RogueLibsCore.Examples
{[BepInPlugin(pluginGuid, pluginName, pluginVersion)][BepInDependency(RogueLibs.pluginGuid,"1.3")]publicclassExample2:BaseUnityPlugin{publicconststringpluginGuid="abbysssal.streetsofrogue.example2";publicconststringpluginName="Example Items";publicconststringpluginVersion="1.0";publicvoidAwake(){Spritesprite= RogueUtilities.ConvertToSprite(Properties.Resources.MoneyContainer);CustomItemmoneyContainer= RogueLibs.SetItem("money-container", sprite,new CustomNameInfo("Money Container"),new CustomNameInfo("Gives you some money."),item =>{ item.itemType ="Consumable"; item.Categories.Add("Technology"); item.itemValue =20; item.initCount =2; item.rewardCount =4; item.stackable =true; item.goesInToolbar =true; item.cantBeCloned =true;});
moneyContainer.UseItem =(item,agent)=>{ agent.inventory.AddItem("Money", UnityEngine.Random.Range(5,40)); item.database.SubtractFromItemCount(item,1);new ItemFunctions().UseItemAnim(item, agent);};
moneyContainer.AddSpawnList("DrugDealerSpecialInv",10);
moneyContainer.AddSpawnList("BartenderSpecialInv",10);Spritesprite2= RogueUtilities.ConvertToSprite(Properties.Resources.RemoteGiantizer);CustomItemremoteGiantizer= RogueLibs.SetItem("remote-giantizer", sprite2,new CustomNameInfo("Remote Giantizer"),new CustomNameInfo("Turns someone into a giant. Permanently. Yeah, I know, it's OP, because you can target yourself or your companions."),item =>{ item.itemType ="Tool"; item.Categories.Add("Technology"); item.Categories.Add("Usable"); item.itemValue =20; item.initCount =3; item.rewardCount =5; item.stackable =true; item.goesInToolbar =true;});
remoteGiantizer.TargetFilter =(item,agent,obj)=> obj is Agent a &&!a.dead;
remoteGiantizer.TargetObject =(item,agent,obj)=>{ item.invInterface.HideTarget();Agenta=(Agent)obj; a.statusEffects.AddStatusEffect("Giant",true,true,999999); item.database.SubtractFromItemCount(item,1);};
remoteGiantizer.SetHoverText(new CustomNameInfo("g14nt1ze"));
remoteGiantizer.AddSpawnList("DrugDealerSpecialInv",10);
remoteGiantizer.AddSpawnList("BartenderSpecialInv",10);Spritesprite3= RogueUtilities.ConvertToSprite(Properties.Resources.Repairer);CustomItemrepairer= RogueLibs.SetItem("repairer", sprite3,new CustomNameInfo("Repairer"),new CustomNameInfo("Repairs your melee weapons. Has limited uses."),item =>{ item.itemType ="Combine"; item.Categories.Add("Technology"); item.itemValue =4; item.hasCharges =true; item.stackable =true; item.initCount =20; item.rewardCount =20;});
repairer.CombineFilter =(item,agent,otherItem)=> otherItem.itemType =="WeaponMelee"&& otherItem.invItemCount < otherItem.rewardCount;
repairer.CombineItem =(item,agent,otherItem,slotNum)=>{ otherItem.invItemCount += UnityEngine.Random.Range(30,50);if(otherItem.invItemCount > otherItem.rewardCount) otherItem.invItemCount = otherItem.rewardCount;if(!item.gc.challenges.Contains("NoLimits")) agent.agentInvDatabase.SubtractFromItemCount(item,1); item.gc.audioHandler.Play(agent,"CombineItem");if(item.invItemCount <= 0){ agent.mainGUI.invInterface.HideDraggedItem(); agent.mainGUI.invInterface.HideTarget();}};
repairer.AddSpawnList("DrugDealerSpecialInv",10);
repairer.AddSpawnList("BartenderSpecialInv",10);}}}