public static Weapon GetWeapon(WeaponType type, ItemRarity rarity) { WeaponPrefabData wpd = _weapons[(int)type].weapons.Random(); Weapon weapon = new Weapon(wpd.prefab.name, "n/A", rarity, wpd.animationSet.Random(), wpd.prefab, wpd.requiresBothHands, wpd.useLeftHandIK, type); //assign default actions switch (type) { case WeaponType.OnehandedSword: break; case WeaponType.TwohandedSword: break; case WeaponType.OnehandedBlunt: break; case WeaponType.TwohandedBlunt: break; case WeaponType.Polearm: break; case WeaponType.Ranged: break; default: break; } weapon.GetActions(ActionCategory.Activateable).Add(_itemActions.FirstOrDefault(a => a.header == "Precise Strike")); //weapon.GetActions(ActionCategory.Activateable).Add(_itemActions.FirstOrDefault(a => a.header == "OP Action of Epic Asspounding")); return(weapon); }
void Awake() { m_MovementController = this.GetComponent <MovementController>(); for (int i = 0; i < weaponDataArray.Length; i++) { WeaponPrefabData weaponData = weaponDataArray[i]; GameObject leftWeaponClone = Instantiate(weaponData.leftWeaponPrefab, leftWeaponConnect.position, leftWeaponConnect.rotation); leftWeaponClone.transform.SetParent(leftWeaponConnect, true); BaseWeapon leftWeaponScript = leftWeaponClone.GetComponentInChildren <BaseWeapon>(); GameObject rightWeaponClone = Instantiate(weaponData.rightWeaponPrefab, rightWeaponConnect.position, rightWeaponConnect.rotation); rightWeaponClone.transform.SetParent(rightWeaponConnect, true); BaseWeapon rightWeaponScript = rightWeaponClone.GetComponentInChildren <BaseWeapon>(); WeaponRunTimeData weaponRunTimeData = new WeaponRunTimeData(leftWeaponClone, rightWeaponClone, leftWeaponScript, rightWeaponScript); m_WeaponList.Add(weaponRunTimeData); if (i != m_ActiveIndex) { leftWeaponClone.SetActive(false); rightWeaponClone.SetActive(false); } else { currentLeftWeapon = leftWeaponScript; currentRightWeapon = rightWeaponScript; } } }
public static Holdable GetLightSource(ItemRarity rarity) { WeaponPrefabData wpd = _offhands.Random().weapons.Random(); return(new Holdable("Torch", "A torch", rarity, EquipSlot.LeftHandItem, wpd.prefab, wpd.animationSet.Random(), false, wpd.useLeftHandIK)); }