SampleItemCreator.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using UnityEngine;
  2. public class SampleItemCreator : MonoBehaviour
  3. {
  4. [Header("Create Sample Items")]
  5. [SerializeField] private bool createSampleItems = false;
  6. void Start()
  7. {
  8. if (createSampleItems)
  9. {
  10. CreateSampleWeapons();
  11. CreateSampleArmor();
  12. CreateSampleMiscItems();
  13. }
  14. }
  15. [ContextMenu("Create Sample Weapons")]
  16. void CreateSampleWeapons()
  17. {
  18. // Simple Sword
  19. var simpleSword = ScriptableObject.CreateInstance<WeaponItem>();
  20. simpleSword.itemName = "Simple Sword";
  21. simpleSword.description = "A basic sword for beginners.";
  22. simpleSword.minDamage = 1;
  23. simpleSword.maxDamage = 6;
  24. simpleSword.range = 2;
  25. simpleSword.weaponModifier = 0;
  26. simpleSword.attackSpeed = 1.0f;
  27. simpleSword.weaponType = WeaponType.Sword;
  28. simpleSword.goldCost = 10;
  29. simpleSword.searchTags = new string[] { "sword", "melee", "blade", "basic" };
  30. // Simple Bow
  31. var simpleBow = ScriptableObject.CreateInstance<WeaponItem>();
  32. simpleBow.itemName = "Simple Bow";
  33. simpleBow.description = "A basic bow for shooting arrows.";
  34. simpleBow.minDamage = 1;
  35. simpleBow.maxDamage = 6;
  36. simpleBow.range = 100;
  37. simpleBow.weaponModifier = 0;
  38. simpleBow.attackSpeed = 2.0f;
  39. simpleBow.weaponType = WeaponType.Bow;
  40. simpleBow.goldCost = 15;
  41. simpleBow.searchTags = new string[] { "bow", "ranged", "arrow", "basic" };
  42. // Iron Sword (upgraded)
  43. var ironSword = ScriptableObject.CreateInstance<WeaponItem>();
  44. ironSword.itemName = "Iron Sword";
  45. ironSword.description = "A well-crafted iron sword with better balance.";
  46. ironSword.minDamage = 2;
  47. ironSword.maxDamage = 8;
  48. ironSword.range = 2;
  49. ironSword.weaponModifier = 1;
  50. ironSword.attackSpeed = 1.0f;
  51. ironSword.weaponType = WeaponType.Sword;
  52. ironSword.rarity = ItemRarity.Uncommon;
  53. ironSword.goldCost = 25;
  54. ironSword.searchTags = new string[] { "sword", "melee", "blade", "iron", "metal" };
  55. // Composite Bow (upgraded)
  56. var compositeBow = ScriptableObject.CreateInstance<WeaponItem>();
  57. compositeBow.itemName = "Composite Bow";
  58. compositeBow.description = "A bow made of multiple materials for increased power.";
  59. compositeBow.minDamage = 2;
  60. compositeBow.maxDamage = 8;
  61. compositeBow.range = 120;
  62. compositeBow.weaponModifier = 1;
  63. compositeBow.attackSpeed = 1.8f;
  64. compositeBow.weaponType = WeaponType.Bow;
  65. compositeBow.rarity = ItemRarity.Uncommon;
  66. compositeBow.goldCost = 35;
  67. compositeBow.searchTags = new string[] { "bow", "ranged", "arrow", "composite" };
  68. }
  69. [ContextMenu("Create Sample Armor")]
  70. void CreateSampleArmor()
  71. {
  72. // Leather Helmet
  73. var leatherHelmet = ScriptableObject.CreateInstance<ArmorItem>();
  74. leatherHelmet.itemName = "Leather Helmet";
  75. leatherHelmet.description = "Basic head protection made of leather.";
  76. leatherHelmet.armorClass = 1;
  77. leatherHelmet.armorType = ArmorType.Light;
  78. leatherHelmet.armorSlot = ArmorSlot.Head;
  79. leatherHelmet.goldCost = 5;
  80. leatherHelmet.searchTags = new string[] { "helmet", "head", "leather", "light" };
  81. // Leather Vest
  82. var leatherVest = ScriptableObject.CreateInstance<ArmorItem>();
  83. leatherVest.itemName = "Leather Vest";
  84. leatherVest.description = "A simple leather vest providing basic protection.";
  85. leatherVest.armorClass = 2;
  86. leatherVest.dexterityModifier = 1;
  87. leatherVest.armorType = ArmorType.Light;
  88. leatherVest.armorSlot = ArmorSlot.Chest;
  89. leatherVest.goldCost = 12;
  90. leatherVest.searchTags = new string[] { "vest", "chest", "leather", "light" };
  91. // Iron Chainmail
  92. var ironChainmail = ScriptableObject.CreateInstance<ArmorItem>();
  93. ironChainmail.itemName = "Iron Chainmail";
  94. ironChainmail.description = "Chainmail made of iron rings, offering good protection.";
  95. ironChainmail.armorClass = 4;
  96. ironChainmail.dexterityModifier = -1;
  97. ironChainmail.armorType = ArmorType.Medium;
  98. ironChainmail.armorSlot = ArmorSlot.Chest;
  99. ironChainmail.rarity = ItemRarity.Uncommon;
  100. ironChainmail.goldCost = 30;
  101. ironChainmail.searchTags = new string[] { "chainmail", "chest", "iron", "medium", "mail" };
  102. }
  103. [ContextMenu("Create Sample Misc Items")]
  104. void CreateSampleMiscItems()
  105. {
  106. // Health Potion
  107. var healthPotion = ScriptableObject.CreateInstance<MiscellaneousItem>();
  108. healthPotion.itemName = "Health Potion";
  109. healthPotion.description = "Restores 15 health points when consumed.";
  110. healthPotion.isConsumable = true;
  111. healthPotion.isStackable = true;
  112. healthPotion.maxStackSize = 10;
  113. healthPotion.healthDiceType = 6;
  114. healthPotion.healthDiceCount = 1;
  115. healthPotion.healthBonus = 1;
  116. healthPotion.goldCost = 4;
  117. healthPotion.searchTags = new string[] { "potion", "health", "healing", "consumable" };
  118. // Rope
  119. var rope = ScriptableObject.CreateInstance<MiscellaneousItem>();
  120. rope.itemName = "Hemp Rope";
  121. rope.description = "50 feet of sturdy hemp rope.";
  122. rope.isConsumable = false;
  123. rope.isStackable = true;
  124. rope.maxStackSize = 5;
  125. rope.silverCost = 8;
  126. rope.searchTags = new string[] { "rope", "hemp", "utility", "tool" };
  127. }
  128. }