void Start() { gm = FindObjectOfType <GameManager>(); gm.SetPlayer(this); playerLevel = 1; playerStrength = 10; playerExp = 1; attackModifier = .01f; sword = Instantiate(Resources.Load("Assets/Phase1") as GameObject, new Vector3(0, 0, 0), Quaternion.LookRotation(Vector3.up)).GetComponent <BloodDrinker>(); baseDamage = sword.GetWeaponDamage() + playerStrength; levelText.text = "Player Level: " + playerLevel; strengthText.text = "Player Strength: " + playerStrength; killsText.text = "Player Kills: " + kills; expText.text = "Player Exp: " + playerExp; #if DEBUGGING AddInventoryMaterialItem(new ForgeMaterial() { name = "Material1", quantity = 15 }); AddInventoryMaterialItem(new ForgeMaterial() { name = "Material2", quantity = 8 }); AddInventoryMaterialItem(new ForgeMaterial() { name = "Material3", quantity = 4 }); AddInventoryMaterialItem(new ForgeMaterial() { name = "Material4", quantity = 2 }); AddInventoryMaterialItem(new ForgeMaterial() { name = "Material5", quantity = 1 }); #endif }
public void UpdateDamage() { baseDamage = sword.GetWeaponDamage() + playerStrength; modifiedDamage = baseDamage + (int)(attackModifier * baseDamage); }