wand power value affects spells

This commit is contained in:
joonasp
2022-04-25 12:55:41 +03:00
parent 06045c07fb
commit 270acfd18d
12 changed files with 754 additions and 746 deletions

View File

@@ -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;

View File

@@ -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;
}
}