wand power value affects spells
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -53,7 +54,7 @@ public class CraftingTable : MonoBehaviour
|
||||
if (item1.name.StartsWith("wand"))
|
||||
{
|
||||
WandData data = item1.GetComponent<WandData>();
|
||||
data.SetDamage(data.damage + 0.5f);
|
||||
data.SetPower(data.power + 0.5f);
|
||||
item1.transform.position = output.position;
|
||||
Destroy(item2.gameObject);
|
||||
item2 = null;
|
||||
@@ -61,7 +62,7 @@ public class CraftingTable : MonoBehaviour
|
||||
else
|
||||
{
|
||||
WandData data = item2.GetComponent<WandData>();
|
||||
data.SetDamage(data.damage + 0.5f);
|
||||
data.SetPower(data.power + 0.5f);
|
||||
item2.transform.position = output.position;
|
||||
Destroy(item1.gameObject);
|
||||
item1 = null;
|
||||
|
||||
@@ -4,13 +4,13 @@ using UnityEngine;
|
||||
|
||||
public class WandData : MonoBehaviour
|
||||
{
|
||||
public float damage = 1f;
|
||||
public float power = 1f;
|
||||
|
||||
//public string element = "water";
|
||||
|
||||
|
||||
public void SetDamage(float dam)
|
||||
public void SetPower(float pow)
|
||||
{
|
||||
damage = dam;
|
||||
power = dam;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user