Commit 5030df32 authored by mthiele2's avatar mthiele2

Wasser-ATTACKEN FICK SCHEISSE FICKT EUCH

parent c2637386
......@@ -274,7 +274,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8757578769013443562}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.253, y: -0.309, z: 0}
m_LocalPosition: {x: 0.117, y: -0.302, z: 0}
m_LocalScale: {x: 0.3846154, y: 0.3846154, z: 0.3846154}
m_Children: []
m_Father: {fileID: 4738352637052488}
......
......@@ -14,9 +14,9 @@ GameObject:
- component: {fileID: 7928429373142515012}
- component: {fileID: 8237559276284760939}
- component: {fileID: 5473739827322462943}
m_Layer: 12
m_Layer: 0
m_Name: Enemy_WaterAttack
m_TagString: Water
m_TagString: EnemyShot
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
......@@ -29,7 +29,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7588789901055592565}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -1}
m_LocalScale: {x: 6, y: 6, z: 1}
m_Children: []
m_Father: {fileID: 0}
......@@ -95,7 +95,7 @@ Rigidbody2D:
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_Mass: 3
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 3
......@@ -133,7 +133,7 @@ CapsuleCollider2D:
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.008341174, y: -0.00032437945}
......
......@@ -23276,7 +23276,7 @@ PrefabInstance:
type: 3}
propertyPath: button
value:
objectReference: {fileID: 1858996996}
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3ff4cf871f5edaa40b0530c80a9ff9df, type: 3}
--- !u!1 &1373053034
......@@ -32640,12 +32640,12 @@ PrefabInstance:
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_LocalPosition.x
value: -39.7
value: -21.5
objectReference: {fileID: 0}
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_LocalPosition.y
value: 51.5
value: 48.5
objectReference: {fileID: 0}
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
......@@ -34650,18 +34650,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 49ad5eee708571d449789cb994b54fcb, type: 3}
--- !u!114 &1858996996 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5970381992757526481, guid: 50a0ddec8ac259c46a58a6b5324a759d,
type: 3}
m_PrefabInstance: {fileID: 1777049076}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1864783512
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -66,14 +66,9 @@ public class AI_WaterAttack : WeightedAction
launchPower += 3;
GameObject projectile = Instantiate(fireBall, shotspawn.position, shotspawn.rotation);
projectile.GetComponent<AI_WaterProjectile>().setValues(damage, destroyTime, thrust);
if (player.transform.position.x > this.transform.position.x)
{
projectile.GetComponent<Rigidbody2D>().velocity = new Vector2(launchPower, launchPower / 2);
}
else
{
projectile.GetComponent<Rigidbody2D>().velocity = new Vector2(-launchPower, launchPower / 2);
}
Vector3 dir = player.transform.position - projectile.transform.position;
dir.Normalize();
projectile.GetComponent<Rigidbody2D>().velocity = dir * launchPower;
yield return new WaitForSeconds(attackSpeed);
}
}
......
......@@ -13,10 +13,7 @@ public class AI_WaterProjectile : MonoBehaviour
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("EnemyShot") || other.gameObject.layer == LayerMask.NameToLayer("Ground") || other.gameObject.layer == LayerMask.NameToLayer("Enemy"))
{
return;
}
print(other.name);
if (other.CompareTag("Player"))
{
Vector2 dir = new Vector2(other.GetComponentInParent<Transform>().position.x - transform.position.x, 0);
......@@ -25,8 +22,7 @@ public class AI_WaterProjectile : MonoBehaviour
other.attachedRigidbody.AddForce(dir, ForceMode2D.Impulse);
other.GetComponentInParent<Life>().Damage(damage);
}
Debug.Log("test");
Destroy();
if(other.gameObject.layer == LayerMask.NameToLayer("Ground") || other.CompareTag("EnemyShot")) Destroy();
}
public void setValues(int damage, float destroyTime, float thrust)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment