public static void DisplayWeapon(UIView view, ItemData.WeaponRuntimeData weaponRuntimeData) { if (weaponRuntimeData.level > 0) { view.text.gameObject.SetActive(true); view.text.SetText("*" + weaponRuntimeData.level); } view.image.gameObject.SetActive(true); view.image.sprite = UIIconLoader.WeaponIcons[(int)weaponRuntimeData.weapon]; }
public int CalculatePlayerDamage() { ItemData.WeaponRuntimeData weaponData = playerRuntimeData.playerStock.weaponStock[playerRuntimeData.playerSlot.weaponIndex]; int weaponDamage = ItemData.weaponData[(int)weaponData.weapon].Attack[weaponData.level]; int res = (int)((playerData.MAS_damageAmount + weaponDamage) * (1 + playerRuntimeData.currentDecayPoints / CalculatePlayerMaxDecayPoint())); if (playerRuntimeData.playerSlot.IsWearableEquiped(playerRuntimeData.playerStock, ItemData.Wearable.Magic_Pendant)) { res = (int)(res * ItemData.WearableItemBuffData.Magic_Pendant_attackMultiplier); } return(res); }
protected void DisplayPlayerSlot() { slotViews.ClearViewGroup(); // There is always a weapon at slot 0 List <ItemData.WeaponRuntimeData> weapons = playerStock.weaponStock; int currentWeapon = playerSlot.weaponIndex; ItemData.WeaponRuntimeData weaponData = weapons[currentWeapon]; UIInventoryState.DisplayWeapon(slotViews.views[0], weaponData); // slot one List <ItemData.WearableRuntimeData> wearables = playerStock.wearableStock; int currentWearableOne = playerSlot.wearableOneIndex; int currentWearableTwo = playerSlot.wearableTwoIndex; if (playerSlot.IsWearableInUse(playerStock, currentWearableOne)) { UIInventoryState.DisplayWearable(slotViews.views[1], wearables[currentWearableOne]); } else { slotViews.views[1].image.gameObject.SetActive(true); slotViews.views[1].image.sprite = UIIconLoader.EmptySprite; } if (playerSlot.IsWearableInUse(playerStock, currentWearableTwo)) { UIInventoryState.DisplayWearable(slotViews.views[2], wearables[currentWearableTwo]); } else { slotViews.views[2].image.gameObject.SetActive(true); slotViews.views[2].image.sprite = UIIconLoader.EmptySprite; } // Debug.Log("weapon: " + weapons[currentWeapon].weapon.ToString()); // Debug.Log("slot one: " + wearables[currentWearableOne].wearable.ToString()); // Debug.Log("slot two: " + wearables[currentWearableTwo].wearable.ToString()); // slot two }
public PlayerEquipment(ItemData.WeaponRuntimeData weapon, ItemData.WearableRuntimeData wearableOne, ItemData.WearableRuntimeData wearableTwo) { this.weapon = weapon; this.wearableSlotOne = wearableOne; this.wearableSlotTwo = wearableTwo; }
public void Pick(ItemData.WeaponRuntimeData weapon) { weaponStock.Add(weapon); }