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 Dec 30, 2024. It is now read-only.
usingSystem;usingBepInEx;usingRogueLibsCore;namespaceRogueLibsCore.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,newCustomNameInfo("Rocket Bullets"),newCustomNameInfo("Replaces all bullets with rockets. Rate of fire is unchanged."));RocketBullets.AddConflicting("RocketLaunchers","NoGuns");this.PatchPrefix(typeof(Gun),"spawnBullet",GetType(),"Gun_spawnBullet",newType[]{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
usingSystem;usingBepInEx;usingRogueLibsCore;usingUnityEngine;namespaceRogueLibsCore.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,newCustomNameInfo("Money Container"),newCustomNameInfo("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);newItemFunctions().UseItemAnim(item,agent);};moneyContainer.AddSpawnList("DrugDealerSpecialInv",10);moneyContainer.AddSpawnList("BartenderSpecialInv",10);Spritesprite2=RogueUtilities.ConvertToSprite(Properties.Resources.RemoteGiantizer);CustomItemremoteGiantizer=RogueLibs.SetItem("remote-giantizer",sprite2,newCustomNameInfo("Remote Giantizer"),newCustomNameInfo("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)=>objisAgenta&&!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(newCustomNameInfo("g14nt1ze"));remoteGiantizer.AddSpawnList("DrugDealerSpecialInv",10);remoteGiantizer.AddSpawnList("BartenderSpecialInv",10);Spritesprite3=RogueUtilities.ConvertToSprite(Properties.Resources.Repairer);CustomItemrepairer=RogueLibs.SetItem("repairer",sprite3,newCustomNameInfo("Repairer"),newCustomNameInfo("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);}}}