Commit f0dc1348 authored by mthiele2's avatar mthiele2
Browse files

Player-Attacken To-Do

parent 866cc9b0
fileFormatVersion: 2
guid: 653e95e8f818b934cb58a7156c0a4be2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -132,4 +132,4 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
destroyTime: 1
thrust: 15
thrust: 10
......@@ -153,7 +153,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4738352637052488, guid: 49ad5eee708571d449789cb994b54fcb, type: 3}
propertyPath: m_RootOrder
value: 3
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4738352637052488, guid: 49ad5eee708571d449789cb994b54fcb, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
......@@ -172,8 +172,166 @@ PrefabInstance:
propertyPath: weight
value: 5
objectReference: {fileID: 0}
- target: {fileID: 50191559781069916, guid: 49ad5eee708571d449789cb994b54fcb,
type: 3}
propertyPath: m_Mass
value: 10
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 49ad5eee708571d449789cb994b54fcb, type: 3}
--- !u!1001 &252735506
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4605225109116865588, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_Name
value: Air
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.868001
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.34153736
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8746327460217138312, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7388429415559506403, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1,
type: 3}
propertyPath: m_IsTrigger
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 615b74be12ac7ec4e9b491a7ef5cbbe1, type: 3}
--- !u!1001 &393328824
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7340435369038607268, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalPosition.x
value: 13.45824
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.8468156
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607272, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_JumpForce
value: 700
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607275, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_Mass
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 938701439f7d9654da1b920d73ccf2cc, type: 3}
--- !u!1 &438036704
GameObject:
m_ObjectHideFlags: 0
......@@ -435,7 +593,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &664630839
PrefabInstance:
......@@ -478,7 +636,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4738352637052488, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3}
propertyPath: m_RootOrder
value: 2
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4738352637052488, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
......@@ -492,6 +650,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 50191559781069916, guid: 6cd7f8e10f89642fd88661db0d3f3827,
type: 3}
propertyPath: m_Mass
value: 3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3}
--- !u!1 &719626315
......@@ -674,7 +837,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &731052799
GameObject:
......@@ -771,7 +934,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 53e622d25d5bf8b45be54c49c309108d, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 1745000114}
player: {fileID: 1475208694}
--- !u!1 &924553758
GameObject:
m_ObjectHideFlags: 0
......@@ -839,77 +1002,31 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1001 &1164879884
PrefabInstance:
--- !u!1 &1475208694 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7340435369038607268, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
m_PrefabInstance: {fileID: 393328824}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1475208703
MonoBehaviour:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7340435369038607268, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalPosition.x
value: 9.36
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalPosition.y
value: 2.21
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 938701439f7d9654da1b920d73ccf2cc, type: 3}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1475208694}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2f8415a7fda2c084e87b3caa1b43ffbf, type: 3}
m_Name:
m_EditorClassIdentifier:
state: {fileID: 11400000, guid: c5777bcc7b64ce24c9bd65d2c4b7c639, type: 2}
onAirInfused: {fileID: 11400000, guid: b0928121a3619584c9612f68610a97a5, type: 2}
onEarthInfused: {fileID: 11400000, guid: 59d96edea2ecb434999c09413da7449a, type: 2}
onFireInfused: {fileID: 11400000, guid: f553df1a50d464e48837fbb6cb99b7e5, type: 2}
onWaterInfused: {fileID: 11400000, guid: ca31b08da78cb134086d7688bbb50628, type: 2}
--- !u!1 &1523356284
GameObject:
m_ObjectHideFlags: 0
......@@ -1072,7 +1189,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1561658102
GameObject:
......@@ -1218,14 +1335,8 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1745000114 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7340435369038607268, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3}
m_PrefabInstance: {fileID: 1164879884}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1855488229
GameObject:
m_ObjectHideFlags: 0
......@@ -1388,8 +1499,82 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1936446593
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1648869877852930880, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_Name
value: Earth
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalPosition.x
value: 2.4107509
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.08932567
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5794390821522793468, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5728584038078375575, guid: 4512b8eb550115443bbba2ecd59a960c,
type: 3}
propertyPath: m_IsTrigger
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4512b8eb550115443bbba2ecd59a960c, type: 3}
--- !u!1 &2027679585
GameObject:
m_ObjectHideFlags: 0
......@@ -1643,7 +1828,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!68 &2027679589
EdgeCollider2D:
......
fileFormatVersion: 2
guid: 324fe535716431c498b2ec38f3671127
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
public class Player_FireAttack : WeightedAction
{
GameObject nearestPlayer;
AI_Core myAI;
private float restCooldown;
public float Cooldown;
public float attackRange;
public int damage;
public GameObject shot;
List<GameObject> shots;
public float fireSpeed = 2f;
public int volleySize;
public int pooledAmount = 10;
public float launchPower = 20;
public float attackSpeed;
public Transform shotspawn;
public bool cluster;
public bool ricochet;
private Rigidbody2D body;
// Use this for initialization
void Start()
{
myAI = GetComponent<AI_Core>();
}
void CheckConditions()
{
nearestPlayer = myAI.findNearestPlayer();
float dist = Vector2.Distance(transform.position, nearestPlayer.transform.position);
if (dist > attackRange)
{
return;
}
Vector2 dir = Vector2.zero;
direction = dir;
myAI.desiredAction.Add(this);
}
public override void performAction()
{
if (restCooldown <= 0)
{
StartCoroutine(fireVolley());
restCooldown = Cooldown;
}
else
{
restCooldown -= Time.deltaTime;
}
}
IEnumerator fireVolley()
{
launchPower = 10;
for (int i = 0; i < volleySize; i++)
{
launchPower += 3;
GameObject projectile = Instantiate(shot, shotspawn.position, shotspawn.rotation);
if (nearestPlayer.transform.position.x > this.transform.position.x)
{
projectile.GetComponent<Rigidbody2D>().velocity = new Vector2(launchPower, launchPower);
}
else
{
projectile.GetComponent<Rigidbody2D>().velocity = new Vector2(-launchPower, launchPower);
}
yield return new WaitForSeconds(attackSpeed);
}
}
}
fileFormatVersion: 2
guid: 83eb4399ff535ee4cbc76de3b8a32e46
timeCreated: 1536939600
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
public class Player_FireProjectile : MonoBehaviour
{
public double damage;
public GameObject nearestPlayer;
/// <summary>
/// Bisher werden die Shots nach einer Sekunde auf inactive gesetzt
/// hier muss noch was mit Collidern eingefügt werden um
/// auf Zusammenstöße reagieren zu können, damit der Shot dann
/// auf inactive gesetzt wird
/// </summary>
public float destroyTime = 1f;
/// <summary>
/// Wenn das Geschoss auf active gesetzt wird, wird nach 2 Sekunden
/// die Destroy Methode aufgerufen
/// </summary>
void OnEnable()
{
Invoke("Destroy", destroyTime);
}