mirror of
				https://github.com/chev2/RoR2-Mods.git
				synced 2025-10-30 08:11:54 +00:00 
			
		
		
		
	Artifact of Sequencing v1.0.1
This commit is contained in:
		
							parent
							
								
									2997e9ed37
								
							
						
					
					
						commit
						0c2b6e085d
					
				
					 4 changed files with 8 additions and 6 deletions
				
			
		|  | @ -1,2 +1,5 @@ | |||
| 1.0.1 -- | ||||
| - Fixed an error in RandomItem() preventing starting items from properly spawning | ||||
| 
 | ||||
| 1.0.0 -- | ||||
| - Initial mod release | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| { | ||||
|     "name": "ArtifactOfSequencing", | ||||
|     "version_number": "1.0.0", | ||||
|     "version_number": "1.0.1", | ||||
|     "website_url": "https://github.com/chev2/RoR2-Mods", | ||||
|     "description": "Spawn with a starting item of every tier. Any picked up items will be converted to the starting item of the same tier.", | ||||
|     "dependencies": [ | ||||
|  |  | |||
										
											Binary file not shown.
										
									
								
							|  | @ -10,7 +10,7 @@ using UnityEngine; | |||
| namespace Chev | ||||
| { | ||||
|     [BepInDependency("com.bepis.r2api")] | ||||
|     [BepInPlugin("com.Chev.ArtifactOfSequencing", "Artifact of Sequencing", "1.0.0")] | ||||
|     [BepInPlugin("com.Chev.ArtifactOfSequencing", "Artifact of Sequencing", "1.0.1")] | ||||
|     [NetworkCompatibility(CompatibilityLevel.EveryoneMustHaveMod, VersionStrictness.EveryoneNeedSameModVersion)] | ||||
|     [R2APISubmoduleDependency(nameof(ArtifactAPI))] | ||||
|     public class ArtifactOfSequencingMod : BaseUnityPlugin | ||||
|  | @ -84,10 +84,9 @@ namespace Chev | |||
|         private ItemDef RandomItem(ItemTier tier) | ||||
|         { | ||||
|             // Get all available items by tier | ||||
|             ItemIndex[] itemIndexesOfTier = Run.instance.availableItems.Where(item => ItemCatalog.GetItemDef(item).tier == tier).ToArray(); | ||||
| 
 | ||||
|             // Get ItemDefs from item indexes | ||||
|             ItemDef[] itemsOfTier = itemIndexesOfTier.Select(item => ItemCatalog.GetItemDef(item)).ToArray(); | ||||
|             ItemDef[] itemsOfTier = (from item in ItemCatalog.allItems | ||||
|                                      where Run.instance.IsItemAvailable(item) && ItemCatalog.GetItemDef(item).tier == tier | ||||
|                                      select ItemCatalog.GetItemDef(item)).ToArray(); | ||||
| 
 | ||||
|             return itemsOfTier[_random.Next(0, itemsOfTier.Length)]; | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Chev
						Chev