28 changed files with 410 additions and 21 deletions
@ -0,0 +1,38 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 0} |
||||
|
m_Name: GigaSwordFactory |
||||
|
m_EditorClassIdentifier: SAShop::ProceduralWeaponFactory |
||||
|
Rarity: 16711935 |
||||
|
DamageMin: 40 |
||||
|
DamageMax: 60 |
||||
|
PriceMin: 4500 |
||||
|
PriceMax: 8000 |
||||
|
Items: |
||||
|
- Sprite: {fileID: -4016013334462737405, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Giga-Axe |
||||
|
Description: This battle axe is two-sided and huge. While only the most skilled |
||||
|
heroes can master it, their foes are going to have a bad time. |
||||
|
AttackBonus: 5 |
||||
|
- Sprite: {fileID: -5362799649635832982, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Falcon Punch |
||||
|
Description: Who needs a weapon when you can just falcon punch people? |
||||
|
AttackBonus: 12 |
||||
|
- Sprite: {fileID: 5947598201806246533, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Electric Blade |
||||
|
Description: This sword is electrically charged and will deal massive damage |
||||
|
to anything it hits. |
||||
|
AttackBonus: 7 |
||||
|
Amount: 2 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 7e20569483b8ce942a78031bd0b0121c |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,37 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 0} |
||||
|
m_Name: MegaSwordFactory |
||||
|
m_EditorClassIdentifier: SAShop::ProceduralWeaponFactory |
||||
|
Rarity: 65280 |
||||
|
DamageMin: 20 |
||||
|
DamageMax: 25 |
||||
|
PriceMin: 800 |
||||
|
PriceMax: 2500 |
||||
|
Items: |
||||
|
- Sprite: {fileID: 3447626333678633045, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Diamond Sword |
||||
|
Description: Blatant copyright infringement! |
||||
|
AttackBonus: 10 |
||||
|
- Sprite: {fileID: -7479063964076681684, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Mace |
||||
|
Description: Not to be confused with Mace Windu, the jedi master! |
||||
|
AttackBonus: 5 |
||||
|
- Sprite: {fileID: 4292883687895924744, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Stab Stick |
||||
|
Description: This weapon is quite rare, and quite difficult to use. But a hit |
||||
|
is sure to be fatal! |
||||
|
AttackBonus: 12 |
||||
|
Amount: 2 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 99965d8d09fad704fb867941e17eec1a |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,47 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 0} |
||||
|
m_Name: NoobSwordFactory |
||||
|
m_EditorClassIdentifier: SAShop::ProceduralWeaponFactory |
||||
|
Rarity: 16777215 |
||||
|
DamageMin: 2 |
||||
|
DamageMax: 7 |
||||
|
PriceMin: 50 |
||||
|
PriceMax: 120 |
||||
|
Items: |
||||
|
- Sprite: {fileID: -6229739577819397656, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Wooden Sword |
||||
|
Description: This wooden sword is quite awful! |
||||
|
AttackBonus: 0 |
||||
|
- Sprite: {fileID: -4063295180217184869, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Basic Sword |
||||
|
Description: A basic common sword, which is not particularly useful in battle, |
||||
|
but keeps you safe from wildlife. |
||||
|
AttackBonus: 2 |
||||
|
- Sprite: {fileID: -7651958066320933242, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Weird Sword |
||||
|
Description: This sword is kind of weird. But it seems to do the job! |
||||
|
AttackBonus: 1 |
||||
|
- Sprite: {fileID: 206911327383899660, guid: b00993d063fbc4a87983115070f6145c, type: 3} |
||||
|
Name: Dagger |
||||
|
Description: Small dagger, easy to use and deadly, but with little range. |
||||
|
AttackBonus: 1 |
||||
|
- Sprite: {fileID: -8295029410813222302, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Wood Axe |
||||
|
Description: This axe was built to chop down trees. Apparently it also chops |
||||
|
down your enemies! |
||||
|
AttackBonus: 3 |
||||
|
Amount: 4 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 36357d288f5e56f4e91c809ea7909f67 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,39 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 0} |
||||
|
m_Name: ProSwordFactory |
||||
|
m_EditorClassIdentifier: SAShop::ProceduralWeaponFactory |
||||
|
Rarity: 255 |
||||
|
DamageMin: 12 |
||||
|
DamageMax: 19 |
||||
|
PriceMin: 350 |
||||
|
PriceMax: 750 |
||||
|
Items: |
||||
|
- Sprite: {fileID: -5939302461621596088, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Pirate Sword |
||||
|
Description: Pirates certainly know how to make swords. They may not slay a dragon, |
||||
|
but they are a safe bet for a battle. |
||||
|
AttackBonus: 2 |
||||
|
- Sprite: {fileID: -851246318378289833, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Short Sword |
||||
|
Description: This sword looks very short, but when it actually connects with |
||||
|
its target, it has devastating consequences. |
||||
|
AttackBonus: 5 |
||||
|
- Sprite: {fileID: -5996106085844551684, guid: b00993d063fbc4a87983115070f6145c, |
||||
|
type: 3} |
||||
|
Name: Spike Club |
||||
|
Description: It may look primitive. But you certainly do not want to get hit |
||||
|
on the head by it! |
||||
|
AttackBonus: 0 |
||||
|
Amount: 3 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 74b8070851d98094dbbaa907e8a7648d |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,22 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 1a6faf63d685386429bab9c581992b61, type: 3} |
||||
|
m_Name: DualBlade |
||||
|
m_EditorClassIdentifier: |
||||
|
Name: Dual Blade |
||||
|
Description: The legendary dual blade. Forged by the legendary legend himself. |
||||
|
It is so legendary that only the legend could wield it. |
||||
|
Sprite: {fileID: -1704500264438275045, guid: b00993d063fbc4a87983115070f6145c, type: 3} |
||||
|
Price: 50000 |
||||
|
Rarity: 16776960 |
||||
|
Attack: 350 |
||||
|
Damage: 420 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 6219ccc5039acc1489e2da701bc93d82 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,22 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 1a6faf63d685386429bab9c581992b61, type: 3} |
||||
|
m_Name: ImperialJapan |
||||
|
m_EditorClassIdentifier: |
||||
|
Name: Imperial Japan |
||||
|
Description: Wielding Imperial Japan comes with great responsibility, but also |
||||
|
with great power! Although it is yellow for some reason. |
||||
|
Sprite: {fileID: -1083111729585998019, guid: b00993d063fbc4a87983115070f6145c, type: 3} |
||||
|
Price: 15000 |
||||
|
Rarity: 16776960 |
||||
|
Attack: 280 |
||||
|
Damage: 325 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: cffb69fad9a3c914daa990daa78bcff4 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,20 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: be184c10b845d1044abbc1c356837cac, type: 3} |
||||
|
m_Name: ShopWeaponFactory |
||||
|
m_EditorClassIdentifier: |
||||
|
ItemFactories: |
||||
|
- {fileID: 11400000, guid: 36357d288f5e56f4e91c809ea7909f67, type: 2} |
||||
|
- {fileID: 11400000, guid: 74b8070851d98094dbbaa907e8a7648d, type: 2} |
||||
|
- {fileID: 11400000, guid: 99965d8d09fad704fb867941e17eec1a, type: 2} |
||||
|
- {fileID: 11400000, guid: 7e20569483b8ce942a78031bd0b0121c, type: 2} |
||||
|
- {fileID: 11400000, guid: c91975636a4024b46997f72b950e1977, type: 2} |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: ed86667a8c8440d489527401f6ada6b7 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,17 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: d4a440686e1eaa042a9d58081a9b8dbe, type: 3} |
||||
|
m_Name: UniqueItems |
||||
|
m_EditorClassIdentifier: |
||||
|
Items: |
||||
|
- {fileID: 11400000, guid: cffb69fad9a3c914daa990daa78bcff4, type: 2} |
||||
|
- {fileID: 11400000, guid: 6219ccc5039acc1489e2da701bc93d82, type: 2} |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: c91975636a4024b46997f72b950e1977 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,19 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
/// <summary>
|
||||
|
/// This is an item factory of item factories, simply put. Allows you to combine all sorts of factories to populate
|
||||
|
/// just one inventory with different types and levels of items.
|
||||
|
/// </summary>
|
||||
|
[CreateAssetMenu]//Allows creating ViewConfig objects in Assets -> Create menu in the Unity Editor
|
||||
|
public class MultiItemFactory : ItemFactory |
||||
|
{ |
||||
|
public ItemFactory[] ItemFactories; |
||||
|
public override void PopulateModel(ShopModel model) |
||||
|
{ |
||||
|
foreach (var factory in ItemFactories) |
||||
|
{ |
||||
|
factory.PopulateModel(model); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: be184c10b845d1044abbc1c356837cac |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,39 @@ |
|||||
|
using System; |
||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
using Random = UnityEngine.Random; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// This item factory literally just takes a handcrafted list of items and populates the model with that!
|
||||
|
/// </summary>
|
||||
|
[CreateAssetMenu]//Allows creating ViewConfig objects in Assets -> Create menu in the Unity Editor
|
||||
|
public class ProceduralWeaponFactory : ItemFactory |
||||
|
{ |
||||
|
public ItemRarity Rarity; |
||||
|
public int DamageMin; |
||||
|
public int DamageMax; |
||||
|
public int PriceMin; |
||||
|
public int PriceMax; |
||||
|
public ItemPrototype[] Items; |
||||
|
public int Amount; |
||||
|
|
||||
|
public override void PopulateModel(ShopModel model) |
||||
|
{ |
||||
|
for (int i = 0; i < Amount; i++) |
||||
|
{ |
||||
|
var item = Items[Random.Range(0, Items.Length)]; |
||||
|
model.inventory.AddItem(new ItemWeapon(item.Name,item.Sprite.name,Random.Range(PriceMin,PriceMax),Random.Range(DamageMin,DamageMax) + item.AttackBonus,Random.Range(DamageMin,DamageMax) + item.AttackBonus + 3,item.Description, Rarity)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// This has the sole purpose of associating a sprite with a name for the factory. Not making it a scriptable object because doing this in the factory editor view is faster
|
||||
|
[System.Serializable] |
||||
|
public struct ItemPrototype |
||||
|
{ |
||||
|
public Sprite Sprite; |
||||
|
public string Name; |
||||
|
public string Description; |
||||
|
public int AttackBonus; |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: ea9644082b1c77a44849c5b6af28eb4f |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
Loading…
Reference in new issue