|
|
@@ -60,13 +60,11 @@ namespace UltimateNPCWeapons.Infos
|
|
|
Vector3 startPos = new Vector3((float)o[3], (float)o[4], (float)o[5]);
|
|
|
int dmg = (int)o[6];
|
|
|
int projRange = (int)o[7];
|
|
|
+ int rotation = (int)o[8];
|
|
|
Package2 package = new Package2(cursorPos, dmg, ProjectileID, projRange);
|
|
|
GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("proj/shot" + ProjectileID), startPos, Quaternion.identity);
|
|
|
gameObject2.SendMessage("Set", package);
|
|
|
-
|
|
|
- var angle = Mathf.Atan2(cursorPos.x, cursorPos.y) * Mathf.Rad2Deg;
|
|
|
- var angleVector = Quaternion.AngleAxis(angle, Vector3.forward).eulerAngles;
|
|
|
- gameObject2.transform.eulerAngles = new Vector3(0, 0, angleVector.z);
|
|
|
+ gameObject2.transform.rotation = Quaternion.Euler(0f, 0f, rotation);
|
|
|
}
|
|
|
|
|
|
public IEnumerator Attack(PlayerScript script)
|
|
|
@@ -93,9 +91,15 @@ namespace UltimateNPCWeapons.Infos
|
|
|
Package2 package = new Package2(cursorPos, (float)dmg, ProjectileID, (float)GameScript.MODS[10]);
|
|
|
GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("proj/shot" + ProjectileID), startPos, Quaternion.identity);
|
|
|
gameObject2.SendMessage("Set", package);
|
|
|
+ int rotation;
|
|
|
+ if (package.dir.x > 0f)
|
|
|
+ rotation = 150 + UnityEngine.Random.Range(-10, 11);
|
|
|
+ else
|
|
|
+ rotation = 20 + UnityEngine.Random.Range(-10, 11);
|
|
|
+ gameObject2.transform.rotation = Quaternion.Euler(0f, 0f, rotation);
|
|
|
|
|
|
GadgetCoreAPI.CallCustomRPC(RPCId, RPCMode.Others, cursorPos.x, cursorPos.y, cursorPos.z,
|
|
|
- startPos.x, startPos.y, startPos.z, dmg, PlayerGearModsTracker.GetGearMods(script)[10]);
|
|
|
+ startPos.x, startPos.y, startPos.z, dmg, PlayerGearModsTracker.GetGearMods(script)[10], rotation);
|
|
|
}
|
|
|
yield return new WaitForSeconds(0.3f);
|
|
|
attacking.SetValue(script, false);
|